const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_asyncToGenerator = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
const require_index = require("../../utils/index.js");
//#region src/plus/pisellTopology/topologyDeviceApi.ts
const CONFIG = { isPisell2: true };
const TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY = { with: [
	"type",
	"model",
	"workarea"
] };
/**
* 拉取设备列表（无翻页），返回请求描述与原始 HTTP 封装响应。
*/
function fetchTopologyDeviceList() {
	return _fetchTopologyDeviceList.apply(this, arguments);
}
function _fetchTopologyDeviceList() {
	_fetchTopologyDeviceList = require_asyncToGenerator._asyncToGenerator(function* (query = TOPOLOGY_DEVICE_LIST_DEFAULT_QUERY) {
		var _query$with;
		const params = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ with: (_query$with = query.with) !== null && _query$with !== void 0 ? _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
		};
		return {
			request: requestInfo,
			response: yield require_index.request.getRequest().get(requestInfo.url, params, CONFIG)
		};
	});
	return _fetchTopologyDeviceList.apply(this, arguments);
}
const TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY = { with: [] };
/**
* 拉取设备连接列表，每条记录代表一条 source_device → target_device 的连接边。
*/
function fetchTopologyDeviceConnectionList() {
	return _fetchTopologyDeviceConnectionList.apply(this, arguments);
}
function _fetchTopologyDeviceConnectionList() {
	_fetchTopologyDeviceConnectionList = require_asyncToGenerator._asyncToGenerator(function* (query = TOPOLOGY_DEVICE_CONNECTION_LIST_DEFAULT_QUERY) {
		var _query$with2;
		const params = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ with: (_query$with2 = query.with) !== null && _query$with2 !== void 0 ? _query$with2 : [] }, 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
		};
		return {
			request: requestInfo,
			response: yield require_index.request.getRequest().get(requestInfo.url, params, CONFIG)
		};
	});
	return _fetchTopologyDeviceConnectionList.apply(this, arguments);
}
//#endregion
exports.fetchTopologyDeviceConnectionList = fetchTopologyDeviceConnectionList;
exports.fetchTopologyDeviceList = fetchTopologyDeviceList;
