var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/pisellTopology/topologyDeviceApi.ts
var topologyDeviceApi_exports = {};
__export(topologyDeviceApi_exports, {
  TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY: () => TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY,
  TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY: () => TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY,
  fetchTopologyDeviceConnectionList: () => fetchTopologyDeviceConnectionList,
  fetchTopologyDeviceList: () => fetchTopologyDeviceList
});
module.exports = __toCommonJS(topologyDeviceApi_exports);
var import_utils = require("../../utils");
var CONFIG = { isPisell2: true };
var TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY = {
  with: ["type", "model", "workarea"]
};
async function fetchTopologyDeviceList(query = TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY) {
  const params = {
    with: query.with ?? ["type", "model", "workarea"],
    ...query.workarea_id != null ? { workarea_id: query.workarea_id } : {},
    ...query.type_kind ? { type_kind: query.type_kind } : {},
    ...query.profile_id != null ? { profile_id: query.profile_id } : {}
  };
  const requestInfo = {
    method: "GET",
    url: "/tenant/device",
    params
  };
  const response = await import_utils.request.getRequest().get(
    requestInfo.url,
    params,
    CONFIG
  );
  return { request: requestInfo, response };
}
var TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY = {
  /**
   * 拓扑视图当前只用到端点 id + 状态，不需要展开 source/target 详情；
   * 调用方需要更多字段时再传入 `with`。
   */
  with: []
};
async function fetchTopologyDeviceConnectionList(query = TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY) {
  const params = {
    with: query.with ?? [],
    ...query.source_device_id != null ? { source_device_id: query.source_device_id } : {},
    ...query.target_device_id != null ? { target_device_id: query.target_device_id } : {},
    ...query.type ? { type: query.type } : {}
  };
  const requestInfo = {
    method: "GET",
    url: "/tenant/device/connection",
    params
  };
  const response = await import_utils.request.getRequest().get(
    requestInfo.url,
    params,
    CONFIG
  );
  return { request: requestInfo, response };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY,
  TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY,
  fetchTopologyDeviceConnectionList,
  fetchTopologyDeviceList
});
