@cpzxrobot/sdk 1.3.111 → 1.3.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/device_gateway.ts +23 -0
- package/dist/device_gateway.js +21 -0
- package/package.json +1 -1
package/device_gateway.ts
CHANGED
|
@@ -154,6 +154,29 @@ export class DeviceGateway extends Object {
|
|
|
154
154
|
});
|
|
155
155
|
},
|
|
156
156
|
|
|
157
|
+
export: async (params: any = undefined) => {
|
|
158
|
+
let axios = await this.context.ready;
|
|
159
|
+
var url = `/api/v2/device/list/export`;
|
|
160
|
+
if (params) {
|
|
161
|
+
//if params is string
|
|
162
|
+
if (typeof params === "string") {
|
|
163
|
+
url = `/api/v2/device/list/export?${params}`;
|
|
164
|
+
}
|
|
165
|
+
// if params is object
|
|
166
|
+
else {
|
|
167
|
+
url = `/api/v2/device/list/export?${Object.keys(params)
|
|
168
|
+
.map((key) => `${key}=${params[key]}`)
|
|
169
|
+
.join("&")}`;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return axios.getAndSave(url, {
|
|
174
|
+
params: params,
|
|
175
|
+
}).then((res) => {
|
|
176
|
+
return res.data;
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
|
|
157
180
|
preview: async (type: String, sn: any) => {
|
|
158
181
|
let axios = await this.context.ready;
|
|
159
182
|
|
package/dist/device_gateway.js
CHANGED
|
@@ -99,6 +99,27 @@ class DeviceGateway extends Object {
|
|
|
99
99
|
return res.data;
|
|
100
100
|
});
|
|
101
101
|
}),
|
|
102
|
+
export: (...args_1) => __awaiter(this, [...args_1], void 0, function* (params = undefined) {
|
|
103
|
+
let axios = yield this.context.ready;
|
|
104
|
+
var url = `/api/v2/device/list/export`;
|
|
105
|
+
if (params) {
|
|
106
|
+
//if params is string
|
|
107
|
+
if (typeof params === "string") {
|
|
108
|
+
url = `/api/v2/device/list/export?${params}`;
|
|
109
|
+
}
|
|
110
|
+
// if params is object
|
|
111
|
+
else {
|
|
112
|
+
url = `/api/v2/device/list/export?${Object.keys(params)
|
|
113
|
+
.map((key) => `${key}=${params[key]}`)
|
|
114
|
+
.join("&")}`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return axios.getAndSave(url, {
|
|
118
|
+
params: params,
|
|
119
|
+
}).then((res) => {
|
|
120
|
+
return res.data;
|
|
121
|
+
});
|
|
122
|
+
}),
|
|
102
123
|
preview: (type, sn) => __awaiter(this, void 0, void 0, function* () {
|
|
103
124
|
let axios = yield this.context.ready;
|
|
104
125
|
return axios.get(`/api/v2/device/iotValue/${type}/${sn}`).then((res) => {
|