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/saasDevice/deviceProfile/serve.ts
var serve_exports = {};
__export(serve_exports, {
  createDeviceProfile: () => createDeviceProfile,
  deleteDeviceProfile: () => deleteDeviceProfile,
  getDeviceProfiles: () => getDeviceProfiles,
  getDeviceTypes: () => getDeviceTypes,
  getProfileLinkedDevices: () => getProfileLinkedDevices,
  updateDeviceProfile: () => updateDeviceProfile
});
module.exports = __toCommonJS(serve_exports);
var import_utils = require("../../../utils");
var CONFIG = {
  isPisell2: true
};
var getDeviceTypes = async (params = {}) => {
  const response = await import_utils.request.getRequest().get("/tenant/device/type/all", params, CONFIG);
  console.log("xue_>>>>>getDeviceTypes response", response);
  return (response == null ? void 0 : response.data) || [];
};
var getDeviceProfiles = async (params) => {
  const response = await import_utils.request.getRequest().get(
    "/tenant/device/profile",
    params,
    CONFIG
  );
  return (response == null ? void 0 : response.data) || {
    list: [],
    count: 0,
    page: params.page,
    size: params.size
  };
};
var createDeviceProfile = async (payload) => {
  const response = await import_utils.request.getRequest().post(
    "/tenant/device/profile",
    payload,
    CONFIG
  );
  return (response == null ? void 0 : response.data) || null;
};
var updateDeviceProfile = (id, body) => import_utils.request.getRequest().put(`/tenant/device/profile/${id}`, body, CONFIG);
var getProfileLinkedDevices = async (params) => {
  const response = await import_utils.request.getRequest().get(
    "/tenant/device",
    {
      ...params,
      with: params.with || ["workarea"]
    },
    CONFIG
  );
  return (response == null ? void 0 : response.data) || [];
};
var deleteDeviceProfile = (id) => import_utils.request.getRequest().remove(`/tenant/device/profile/${id}`, CONFIG);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  createDeviceProfile,
  deleteDeviceProfile,
  getDeviceProfiles,
  getDeviceTypes,
  getProfileLinkedDevices,
  updateDeviceProfile
});
