@thingsboard/n8n-nodes-thingsboard 1.0.0
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/LICENSE.md +19 -0
- package/README.md +409 -0
- package/dist/credentials/ThingsBoardApi.credentials.d.ts +7 -0
- package/dist/credentials/ThingsBoardApi.credentials.js +36 -0
- package/dist/credentials/ThingsBoardApi.credentials.js.map +1 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.d.ts +5 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.js +1748 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.js.map +1 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.json +36 -0
- package/dist/nodes/thingsboard/resources/AlarmResource.d.ts +10 -0
- package/dist/nodes/thingsboard/resources/AlarmResource.js +127 -0
- package/dist/nodes/thingsboard/resources/AlarmResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/AssetResource.d.ts +12 -0
- package/dist/nodes/thingsboard/resources/AssetResource.js +131 -0
- package/dist/nodes/thingsboard/resources/AssetResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/CustomerResource.d.ts +11 -0
- package/dist/nodes/thingsboard/resources/CustomerResource.js +95 -0
- package/dist/nodes/thingsboard/resources/CustomerResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/DashboardResource.d.ts +10 -0
- package/dist/nodes/thingsboard/resources/DashboardResource.js +109 -0
- package/dist/nodes/thingsboard/resources/DashboardResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/DeviceResource.d.ts +12 -0
- package/dist/nodes/thingsboard/resources/DeviceResource.js +137 -0
- package/dist/nodes/thingsboard/resources/DeviceResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/EntityGroupResource.d.ts +9 -0
- package/dist/nodes/thingsboard/resources/EntityGroupResource.js +71 -0
- package/dist/nodes/thingsboard/resources/EntityGroupResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/RelationResource.d.ts +11 -0
- package/dist/nodes/thingsboard/resources/RelationResource.js +144 -0
- package/dist/nodes/thingsboard/resources/RelationResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/TelemetryResource.d.ts +17 -0
- package/dist/nodes/thingsboard/resources/TelemetryResource.js +252 -0
- package/dist/nodes/thingsboard/resources/TelemetryResource.js.map +1 -0
- package/dist/nodes/thingsboard/thingsboard-black.svg +10 -0
- package/dist/nodes/thingsboard/thingsboard-white.svg +10 -0
- package/dist/nodes/thingsboard/thingsboard.svg +10 -0
- package/dist/nodes/thingsboard/utils/helpers.d.ts +10 -0
- package/dist/nodes/thingsboard/utils/helpers.js +95 -0
- package/dist/nodes/thingsboard/utils/helpers.js.map +1 -0
- package/dist/nodes/thingsboard/utils/requestHandler.d.ts +11 -0
- package/dist/nodes/thingsboard/utils/requestHandler.js +116 -0
- package/dist/nodes/thingsboard/utils/requestHandler.js.map +1 -0
- package/dist/nodes/thingsboard/utils/resourceRegistry.d.ts +5 -0
- package/dist/nodes/thingsboard/utils/resourceRegistry.js +32 -0
- package/dist/nodes/thingsboard/utils/resourceRegistry.js.map +1 -0
- package/dist/nodes/thingsboard/utils/types.d.ts +42 -0
- package/dist/nodes/thingsboard/utils/types.js +3 -0
- package/dist/nodes/thingsboard/utils/types.js.map +1 -0
- package/dist/package.json +77 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,1748 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThingsBoard = void 0;
|
|
4
|
+
const requestHandler_1 = require("./utils/requestHandler");
|
|
5
|
+
const resourceRegistry_1 = require("./utils/resourceRegistry");
|
|
6
|
+
const PE_ONLY_OPERATIONS = new Set([
|
|
7
|
+
'entityGroup:getEntityGroupById',
|
|
8
|
+
'entityGroup:getEntityGroupsByType',
|
|
9
|
+
'entityGroup:getEntityGroupByOwnerAndNameAndType',
|
|
10
|
+
'entityGroup:getEntityGroupsByOwnerAndType',
|
|
11
|
+
'entityGroup:getEntityGroupsForEntity',
|
|
12
|
+
'customer:getCustomersByEntityGroupId',
|
|
13
|
+
'customer:getUserCustomers',
|
|
14
|
+
'device:getUserDevices',
|
|
15
|
+
'device:getDevicesByEntityGroupId',
|
|
16
|
+
'asset:getUserAssets',
|
|
17
|
+
'asset:getAssetsByEntityGroupId',
|
|
18
|
+
]);
|
|
19
|
+
class ThingsBoard {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.description = {
|
|
22
|
+
displayName: 'ThingsBoard',
|
|
23
|
+
name: 'thingsBoard',
|
|
24
|
+
icon: {
|
|
25
|
+
light: 'file:thingsboard-black.svg',
|
|
26
|
+
dark: 'file:thingsboard-white.svg',
|
|
27
|
+
},
|
|
28
|
+
group: ['transform'],
|
|
29
|
+
version: 1,
|
|
30
|
+
description: 'Interact with ThingsBoard REST API',
|
|
31
|
+
defaults: { name: 'ThingsBoard' },
|
|
32
|
+
inputs: ['main'],
|
|
33
|
+
outputs: ['main'],
|
|
34
|
+
credentials: [{ name: 'thingsBoardApi', required: true }],
|
|
35
|
+
usableAsTool: true,
|
|
36
|
+
documentationUrl: 'https://thingsboard.io/docs/samples/analytics/n8n-node/',
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Resource',
|
|
40
|
+
name: 'resource',
|
|
41
|
+
type: 'options',
|
|
42
|
+
noDataExpression: true,
|
|
43
|
+
options: [
|
|
44
|
+
{ name: 'Alarm', value: 'alarm' },
|
|
45
|
+
{ name: 'Asset', value: 'asset' },
|
|
46
|
+
{ name: 'Customer', value: 'customer' },
|
|
47
|
+
{ name: 'Dashboard', value: 'dashboard' },
|
|
48
|
+
{ name: 'Device', value: 'device' },
|
|
49
|
+
{ name: 'Entity Group', value: 'entityGroup' },
|
|
50
|
+
{ name: 'Relation', value: 'relation' },
|
|
51
|
+
{ name: 'Telemetry', value: 'telemetry' },
|
|
52
|
+
],
|
|
53
|
+
default: 'device',
|
|
54
|
+
description: 'Select which ThingsBoard resource to work with',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Operation',
|
|
58
|
+
name: 'operation',
|
|
59
|
+
type: 'options',
|
|
60
|
+
noDataExpression: true,
|
|
61
|
+
displayOptions: { show: { resource: ['device'] } },
|
|
62
|
+
options: [
|
|
63
|
+
{
|
|
64
|
+
name: 'Create',
|
|
65
|
+
value: 'createDevice',
|
|
66
|
+
action: 'Create a device',
|
|
67
|
+
description: 'Create a device',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Delete',
|
|
71
|
+
value: 'deleteDevice',
|
|
72
|
+
action: 'Delete a device',
|
|
73
|
+
description: 'Delete a device',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Get by ID',
|
|
77
|
+
value: 'getDeviceById',
|
|
78
|
+
action: 'Get a device by ID',
|
|
79
|
+
description: 'Fetch a device based on the provided Device ID',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Get by Name',
|
|
83
|
+
value: 'getTenantDevice',
|
|
84
|
+
action: 'Get a device by name',
|
|
85
|
+
description: 'Fetch a device by name',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Get Many',
|
|
89
|
+
value: 'getTenantDevices',
|
|
90
|
+
action: 'Get devices',
|
|
91
|
+
description: 'Returns a page of devices',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'Get Many by Customer',
|
|
95
|
+
value: 'getCustomerDevices',
|
|
96
|
+
action: 'Get customer devices',
|
|
97
|
+
description: 'Returns a page of devices assigned to the customer',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'Get Many by Entity Group',
|
|
101
|
+
value: 'getDevicesByEntityGroupId',
|
|
102
|
+
action: 'Get entity group devices',
|
|
103
|
+
description: 'Returns a page of devices that belongs to the specified Entity Group ID',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'Get Many for Current User',
|
|
107
|
+
value: 'getUserDevices',
|
|
108
|
+
action: 'Get user devices',
|
|
109
|
+
description: 'Returns a page of devices accessible to the current user',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
default: 'getDeviceById',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
displayName: 'Page Size',
|
|
116
|
+
name: 'pageSize',
|
|
117
|
+
type: 'number',
|
|
118
|
+
default: 10,
|
|
119
|
+
typeOptions: { minValue: 1 },
|
|
120
|
+
description: 'Maximum amount of entities in a one page',
|
|
121
|
+
displayOptions: {
|
|
122
|
+
show: {
|
|
123
|
+
resource: ['device', 'asset', 'customer', 'alarm', 'dashboard'],
|
|
124
|
+
operation: [
|
|
125
|
+
'getTenantDevices',
|
|
126
|
+
'getCustomerDevices',
|
|
127
|
+
'getUserDevices',
|
|
128
|
+
'getDevicesByEntityGroupId',
|
|
129
|
+
'getTenantAssets',
|
|
130
|
+
'getCustomerAssets',
|
|
131
|
+
'getUserAssets',
|
|
132
|
+
'getAssetsByEntityGroupId',
|
|
133
|
+
'getCustomers',
|
|
134
|
+
'getCustomersByEntityGroupId',
|
|
135
|
+
'getUserCustomers',
|
|
136
|
+
'getAlarms',
|
|
137
|
+
'getAllAlarms',
|
|
138
|
+
'getAlarmTypes',
|
|
139
|
+
'getDashboards',
|
|
140
|
+
'getCustomerDashboards',
|
|
141
|
+
'getUserDashboards',
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
displayName: 'Page Number',
|
|
148
|
+
name: 'page',
|
|
149
|
+
type: 'number',
|
|
150
|
+
default: 0,
|
|
151
|
+
typeOptions: { minValue: 0 },
|
|
152
|
+
description: 'Sequence number of page starting from 0',
|
|
153
|
+
displayOptions: {
|
|
154
|
+
show: {
|
|
155
|
+
resource: ['device', 'asset', 'customer', 'alarm', 'dashboard'],
|
|
156
|
+
operation: [
|
|
157
|
+
'getTenantDevices',
|
|
158
|
+
'getCustomerDevices',
|
|
159
|
+
'getUserDevices',
|
|
160
|
+
'getDevicesByEntityGroupId',
|
|
161
|
+
'getTenantAssets',
|
|
162
|
+
'getCustomerAssets',
|
|
163
|
+
'getUserAssets',
|
|
164
|
+
'getAssetsByEntityGroupId',
|
|
165
|
+
'getCustomers',
|
|
166
|
+
'getCustomersByEntityGroupId',
|
|
167
|
+
'getUserCustomers',
|
|
168
|
+
'getAlarms',
|
|
169
|
+
'getAllAlarms',
|
|
170
|
+
'getAlarmTypes',
|
|
171
|
+
'getDashboards',
|
|
172
|
+
'getCustomerDashboards',
|
|
173
|
+
'getUserDashboards',
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
displayName: 'Sort Order',
|
|
180
|
+
name: 'sortOrder',
|
|
181
|
+
type: 'options',
|
|
182
|
+
options: [
|
|
183
|
+
{ name: 'ASC', value: 'ASC' },
|
|
184
|
+
{ name: 'DESC', value: 'DESC' },
|
|
185
|
+
],
|
|
186
|
+
default: 'DESC',
|
|
187
|
+
description: 'Sort order. ASC (ASCENDING) or DESC (DESCENDING).',
|
|
188
|
+
displayOptions: {
|
|
189
|
+
show: {
|
|
190
|
+
resource: ['device', 'asset', 'customer', 'alarm', 'dashboard'],
|
|
191
|
+
operation: [
|
|
192
|
+
'getTenantDevices',
|
|
193
|
+
'getCustomerDevices',
|
|
194
|
+
'getUserDevices',
|
|
195
|
+
'getDevicesByEntityGroupId',
|
|
196
|
+
'getTenantAssets',
|
|
197
|
+
'getCustomerAssets',
|
|
198
|
+
'getUserAssets',
|
|
199
|
+
'getAssetsByEntityGroupId',
|
|
200
|
+
'getCustomers',
|
|
201
|
+
'getCustomersByEntityGroupId',
|
|
202
|
+
'getUserCustomers',
|
|
203
|
+
'getAlarms',
|
|
204
|
+
'getAllAlarms',
|
|
205
|
+
'getAlarmTypes',
|
|
206
|
+
'getDashboards',
|
|
207
|
+
'getCustomerDashboards',
|
|
208
|
+
'getUserDashboards',
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
displayName: 'Input Mode',
|
|
215
|
+
name: 'deviceInputMode',
|
|
216
|
+
type: 'options',
|
|
217
|
+
default: 'params',
|
|
218
|
+
options: [
|
|
219
|
+
{
|
|
220
|
+
name: 'Params',
|
|
221
|
+
value: 'params',
|
|
222
|
+
description: 'Use the fields below (name, type, label, etc.)',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'Full JSON',
|
|
226
|
+
value: 'json',
|
|
227
|
+
description: 'Provide a full ThingsBoard device JSON object',
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
displayOptions: { show: { resource: ['device'], operation: ['createDevice'] } },
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
displayName: 'Device JSON',
|
|
234
|
+
name: 'deviceJson',
|
|
235
|
+
type: 'json',
|
|
236
|
+
required: true,
|
|
237
|
+
default: '{ "name": "My device", "type": "default" }',
|
|
238
|
+
description: 'Full ThingsBoard device JSON object. Include "ID" to update existing device.',
|
|
239
|
+
displayOptions: {
|
|
240
|
+
show: { resource: ['device'], operation: ['createDevice'], deviceInputMode: ['json'] },
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
displayName: 'Device ID',
|
|
245
|
+
name: 'deviceId',
|
|
246
|
+
type: 'string',
|
|
247
|
+
required: true,
|
|
248
|
+
default: '',
|
|
249
|
+
description: 'A string value representing the device ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
250
|
+
displayOptions: {
|
|
251
|
+
show: { resource: ['device'], operation: ['getDeviceById', 'deleteDevice'] },
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
displayName: 'Name',
|
|
256
|
+
name: 'deviceName',
|
|
257
|
+
type: 'string',
|
|
258
|
+
required: true,
|
|
259
|
+
default: '',
|
|
260
|
+
description: 'A string value representing the device name. For example, "My device".',
|
|
261
|
+
displayOptions: { show: { resource: ['device'], operation: ['getTenantDevice'] } },
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Name',
|
|
265
|
+
name: 'deviceNameCreate',
|
|
266
|
+
type: 'string',
|
|
267
|
+
required: true,
|
|
268
|
+
default: '',
|
|
269
|
+
description: 'A string value representing the device name. For example, "My device".',
|
|
270
|
+
displayOptions: {
|
|
271
|
+
show: { resource: ['device'], operation: ['createDevice'], deviceInputMode: ['params'] },
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Label',
|
|
276
|
+
name: 'deviceLabel',
|
|
277
|
+
type: 'string',
|
|
278
|
+
default: '',
|
|
279
|
+
description: 'An optional label for the device',
|
|
280
|
+
displayOptions: {
|
|
281
|
+
show: { resource: ['device'], operation: ['createDevice'], deviceInputMode: ['params'] },
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
displayName: 'Access Token',
|
|
286
|
+
name: 'deviceAccessToken',
|
|
287
|
+
type: 'string',
|
|
288
|
+
typeOptions: { password: true },
|
|
289
|
+
default: '',
|
|
290
|
+
description: 'Device access token. If not provided it will be autogenerated.',
|
|
291
|
+
displayOptions: { show: { resource: ['device'], operation: ['createDevice'] } },
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
displayName: 'Type',
|
|
295
|
+
name: 'deviceType',
|
|
296
|
+
type: 'string',
|
|
297
|
+
default: '',
|
|
298
|
+
description: 'Device type as the name of the device profile',
|
|
299
|
+
displayOptions: {
|
|
300
|
+
show: {
|
|
301
|
+
resource: ['device'],
|
|
302
|
+
operation: ['getTenantDevices', 'getCustomerDevices', 'getUserDevices'],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
displayName: 'Type',
|
|
308
|
+
name: 'deviceTypeCreate',
|
|
309
|
+
type: 'string',
|
|
310
|
+
default: '',
|
|
311
|
+
description: 'Device type as the name of the device profile',
|
|
312
|
+
displayOptions: {
|
|
313
|
+
show: { resource: ['device'], operation: ['createDevice'], deviceInputMode: ['params'] },
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
displayName: 'Text Search',
|
|
318
|
+
name: 'deviceTextSearch',
|
|
319
|
+
type: 'string',
|
|
320
|
+
default: '',
|
|
321
|
+
description: 'The case insensitive "substring" filter based on the device name',
|
|
322
|
+
displayOptions: {
|
|
323
|
+
show: {
|
|
324
|
+
resource: ['device'],
|
|
325
|
+
operation: [
|
|
326
|
+
'getTenantDevices',
|
|
327
|
+
'getCustomerDevices',
|
|
328
|
+
'getUserDevices',
|
|
329
|
+
'getDevicesByEntityGroupId',
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
displayName: 'Sort Property',
|
|
336
|
+
name: 'deviceSortProperty',
|
|
337
|
+
type: 'options',
|
|
338
|
+
options: [
|
|
339
|
+
{ name: 'createdTime', value: 'createdTime' },
|
|
340
|
+
{ name: 'customerTitle', value: 'customerTitle' },
|
|
341
|
+
{ name: 'Label', value: 'label' },
|
|
342
|
+
{ name: 'Name', value: 'name' },
|
|
343
|
+
{ name: 'Type', value: 'type' },
|
|
344
|
+
],
|
|
345
|
+
default: 'createdTime',
|
|
346
|
+
description: 'Property of entity to sort by',
|
|
347
|
+
displayOptions: {
|
|
348
|
+
show: {
|
|
349
|
+
resource: ['device'],
|
|
350
|
+
operation: [
|
|
351
|
+
'getTenantDevices',
|
|
352
|
+
'getCustomerDevices',
|
|
353
|
+
'getUserDevices',
|
|
354
|
+
'getDevicesByEntityGroupId',
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
displayName: 'Operation',
|
|
361
|
+
name: 'operation',
|
|
362
|
+
type: 'options',
|
|
363
|
+
noDataExpression: true,
|
|
364
|
+
displayOptions: { show: { resource: ['asset'] } },
|
|
365
|
+
options: [
|
|
366
|
+
{
|
|
367
|
+
name: 'Create',
|
|
368
|
+
value: 'createAsset',
|
|
369
|
+
action: 'Create an asset',
|
|
370
|
+
description: 'Create an asset',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: 'Delete',
|
|
374
|
+
value: 'deleteAsset',
|
|
375
|
+
action: 'Delete an asset',
|
|
376
|
+
description: 'Delete an asset',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: 'Get by ID',
|
|
380
|
+
value: 'getAssetById',
|
|
381
|
+
action: 'Get asset by id',
|
|
382
|
+
description: 'Fetch an asset based on the provided Asset ID',
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: 'Get by Name',
|
|
386
|
+
value: 'getTenantAsset',
|
|
387
|
+
action: 'Get asset by name',
|
|
388
|
+
description: 'Fetch an asset by name',
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'Get Many',
|
|
392
|
+
value: 'getTenantAssets',
|
|
393
|
+
action: 'Get tenant assets',
|
|
394
|
+
description: 'Returns a page of assets',
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: 'Get Many by Customer',
|
|
398
|
+
value: 'getCustomerAssets',
|
|
399
|
+
action: 'Get customer assets',
|
|
400
|
+
description: 'Returns a page of assets assigned to the customer',
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'Get Many by Entity Group',
|
|
404
|
+
value: 'getAssetsByEntityGroupId',
|
|
405
|
+
action: 'Get assets by entity group',
|
|
406
|
+
description: 'Returns a page of devices that belongs to the specified Entity Group ID',
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
name: 'Get Many for Current User',
|
|
410
|
+
value: 'getUserAssets',
|
|
411
|
+
action: 'Get user assets',
|
|
412
|
+
description: 'Returns a page of assets accessible to the current user',
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
default: 'getAssetById',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
displayName: 'Input Mode',
|
|
419
|
+
name: 'assetInputMode',
|
|
420
|
+
type: 'options',
|
|
421
|
+
default: 'params',
|
|
422
|
+
options: [
|
|
423
|
+
{
|
|
424
|
+
name: 'Params',
|
|
425
|
+
value: 'params',
|
|
426
|
+
description: 'Use the fields below (name, type, label, etc.)',
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: 'Full JSON',
|
|
430
|
+
value: 'json',
|
|
431
|
+
description: 'Provide a full ThingsBoard asset JSON object',
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
displayOptions: { show: { resource: ['asset'], operation: ['createAsset'] } },
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
displayName: 'Asset JSON',
|
|
438
|
+
name: 'assetJson',
|
|
439
|
+
type: 'json',
|
|
440
|
+
required: true,
|
|
441
|
+
default: '{ "name": "My Asset", "type": "default" }',
|
|
442
|
+
description: 'Full ThingsBoard asset JSON object. Include "ID" to update existing asset.',
|
|
443
|
+
displayOptions: {
|
|
444
|
+
show: { resource: ['asset'], operation: ['createAsset'], assetInputMode: ['json'] },
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
displayName: 'Asset ID',
|
|
449
|
+
name: 'assetId',
|
|
450
|
+
type: 'string',
|
|
451
|
+
required: true,
|
|
452
|
+
default: '',
|
|
453
|
+
description: 'A string value representing the asset ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
454
|
+
displayOptions: {
|
|
455
|
+
show: { resource: ['asset'], operation: ['getAssetById', 'deleteAsset'] },
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
displayName: 'Asset Name',
|
|
460
|
+
name: 'assetName',
|
|
461
|
+
type: 'string',
|
|
462
|
+
required: true,
|
|
463
|
+
default: '',
|
|
464
|
+
description: 'A string value representing the asset name. For example, "My Asset".',
|
|
465
|
+
displayOptions: { show: { resource: ['asset'], operation: ['getTenantAsset'] } },
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
displayName: 'Asset Name',
|
|
469
|
+
name: 'assetNameCreate',
|
|
470
|
+
type: 'string',
|
|
471
|
+
required: true,
|
|
472
|
+
default: '',
|
|
473
|
+
description: 'A string value representing the asset name. For example, "My Asset".',
|
|
474
|
+
displayOptions: {
|
|
475
|
+
show: { resource: ['asset'], operation: ['createAsset'], assetInputMode: ['params'] },
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
displayName: 'Label',
|
|
480
|
+
name: 'assetLabel',
|
|
481
|
+
type: 'string',
|
|
482
|
+
default: '',
|
|
483
|
+
description: 'Optional label',
|
|
484
|
+
displayOptions: { show: { resource: ['asset'], operation: ['createAsset'] } },
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
displayName: 'Type',
|
|
488
|
+
name: 'assetType',
|
|
489
|
+
type: 'string',
|
|
490
|
+
default: '',
|
|
491
|
+
description: 'Asset type as the name of the asset profile',
|
|
492
|
+
displayOptions: {
|
|
493
|
+
show: {
|
|
494
|
+
resource: ['asset'],
|
|
495
|
+
operation: [
|
|
496
|
+
'getTenantAssets',
|
|
497
|
+
'getCustomerAssets',
|
|
498
|
+
'getUserAssets',
|
|
499
|
+
'getAssetsByEntityGroupId',
|
|
500
|
+
'createAsset',
|
|
501
|
+
],
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
displayName: 'Type',
|
|
507
|
+
name: 'assetTypeCreate',
|
|
508
|
+
type: 'string',
|
|
509
|
+
default: '',
|
|
510
|
+
description: 'Asset type as the name of the asset profile',
|
|
511
|
+
displayOptions: {
|
|
512
|
+
show: { resource: ['asset'], operation: ['createAsset'], assetInputMode: ['params'] },
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
displayName: 'Text Search',
|
|
517
|
+
name: 'assetTextSearch',
|
|
518
|
+
type: 'string',
|
|
519
|
+
default: '',
|
|
520
|
+
description: 'The case insensitive "substring" filter based on the asset name',
|
|
521
|
+
displayOptions: {
|
|
522
|
+
show: {
|
|
523
|
+
resource: ['asset'],
|
|
524
|
+
operation: [
|
|
525
|
+
'getTenantAssets',
|
|
526
|
+
'getCustomerAssets',
|
|
527
|
+
'getUserAssets',
|
|
528
|
+
'getAssetsByEntityGroupId',
|
|
529
|
+
],
|
|
530
|
+
},
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
displayName: 'Sort Property',
|
|
535
|
+
name: 'assetSortProperty',
|
|
536
|
+
type: 'options',
|
|
537
|
+
options: [
|
|
538
|
+
{ name: 'createdTime', value: 'createdTime' },
|
|
539
|
+
{ name: 'customerTitle', value: 'customerTitle' },
|
|
540
|
+
{ name: 'Label', value: 'label' },
|
|
541
|
+
{ name: 'Name', value: 'name' },
|
|
542
|
+
{ name: 'Type', value: 'type' },
|
|
543
|
+
],
|
|
544
|
+
default: 'createdTime',
|
|
545
|
+
description: 'Property of entity to sort by',
|
|
546
|
+
displayOptions: {
|
|
547
|
+
show: {
|
|
548
|
+
resource: ['asset'],
|
|
549
|
+
operation: [
|
|
550
|
+
'getTenantAssets',
|
|
551
|
+
'getCustomerAssets',
|
|
552
|
+
'getUserAssets',
|
|
553
|
+
'getAssetsByEntityGroupId',
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
displayName: 'Operation',
|
|
560
|
+
name: 'operation',
|
|
561
|
+
type: 'options',
|
|
562
|
+
noDataExpression: true,
|
|
563
|
+
displayOptions: { show: { resource: ['alarm'] } },
|
|
564
|
+
options: [
|
|
565
|
+
{
|
|
566
|
+
name: 'Get All',
|
|
567
|
+
value: 'getAllAlarms',
|
|
568
|
+
action: 'Get all alarms',
|
|
569
|
+
description: 'Returns a page of alarms that belongs to the current owner',
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: 'Get by ID',
|
|
573
|
+
value: 'getAlarmById',
|
|
574
|
+
action: 'Get alarm by id',
|
|
575
|
+
description: 'Fetch an alarm based on the provided Alarm ID',
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: 'Get by originator',
|
|
579
|
+
value: 'getAlarms',
|
|
580
|
+
action: 'Get alarms by originator',
|
|
581
|
+
description: 'Returns a page of alarms for the selected entity',
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: 'Get Highest Severity',
|
|
585
|
+
value: 'getHighestAlarmSeverity',
|
|
586
|
+
action: 'Get alarm highest severity',
|
|
587
|
+
description: 'Search the alarms by originator and return the highest AlarmSeverity(CRITICAL, MAJOR, MINOR, WARNING or INDETERMINATE)',
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: 'Get Info by ID',
|
|
591
|
+
value: 'getAlarmInfoById',
|
|
592
|
+
action: 'Get alarm info by id',
|
|
593
|
+
description: 'Fetch an alarm Info based on the provided Alarm ID',
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: 'Get Types',
|
|
597
|
+
value: 'getAlarmTypes',
|
|
598
|
+
action: 'Get alarm types',
|
|
599
|
+
description: 'Returns a set of unique alarm types',
|
|
600
|
+
},
|
|
601
|
+
],
|
|
602
|
+
default: 'getAlarmById',
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
displayName: 'Operation',
|
|
606
|
+
name: 'operation',
|
|
607
|
+
type: 'options',
|
|
608
|
+
noDataExpression: true,
|
|
609
|
+
displayOptions: { show: { resource: ['customer'] } },
|
|
610
|
+
options: [
|
|
611
|
+
{
|
|
612
|
+
name: 'Create',
|
|
613
|
+
value: 'createCustomer',
|
|
614
|
+
action: 'Create a customer',
|
|
615
|
+
description: 'Create a customer',
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
name: 'Delete',
|
|
619
|
+
value: 'deleteCustomer',
|
|
620
|
+
action: 'Delete a customer',
|
|
621
|
+
description: 'Delete a customer',
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
name: 'Get by ID',
|
|
625
|
+
value: 'getCustomerById',
|
|
626
|
+
action: 'Get customer by id',
|
|
627
|
+
description: 'Fetch a customer based on the provided Customer ID',
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
name: 'Get by Title',
|
|
631
|
+
value: 'getTenantCustomer',
|
|
632
|
+
action: 'Get customer by title',
|
|
633
|
+
description: 'Fetch a customer by title',
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
name: 'Get Many',
|
|
637
|
+
value: 'getCustomers',
|
|
638
|
+
action: 'Get customers',
|
|
639
|
+
description: 'Returns a page of customers',
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: 'Get Many by Entity Group',
|
|
643
|
+
value: 'getCustomersByEntityGroupId',
|
|
644
|
+
action: 'Get customers by entity group',
|
|
645
|
+
description: 'Returns a list of customers based on the provided Entity ID',
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: 'Get Many for Current User',
|
|
649
|
+
value: 'getUserCustomers',
|
|
650
|
+
action: 'Get user customers',
|
|
651
|
+
description: 'Returns a page of customers available for the current user',
|
|
652
|
+
},
|
|
653
|
+
],
|
|
654
|
+
default: 'getCustomerById',
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
displayName: 'Customer ID',
|
|
658
|
+
name: 'customerIdAssetCreate',
|
|
659
|
+
type: 'string',
|
|
660
|
+
default: '',
|
|
661
|
+
description: 'A string value representing the customer ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
662
|
+
displayOptions: {
|
|
663
|
+
show: { resource: ['asset'], operation: ['createAsset'], assetInputMode: ['params'] },
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
displayName: 'Customer ID',
|
|
668
|
+
name: 'customerIdDeviceCreate',
|
|
669
|
+
type: 'string',
|
|
670
|
+
default: '',
|
|
671
|
+
description: 'A string value representing the customer ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
672
|
+
displayOptions: {
|
|
673
|
+
show: { resource: ['device'], operation: ['createDevice'], deviceInputMode: ['params'] },
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
displayName: 'Customer ID',
|
|
678
|
+
name: 'customerIdRequired',
|
|
679
|
+
type: 'string',
|
|
680
|
+
default: '',
|
|
681
|
+
required: true,
|
|
682
|
+
description: 'A string value representing the customer ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
683
|
+
displayOptions: {
|
|
684
|
+
show: {
|
|
685
|
+
resource: ['customer', 'device', 'asset', 'dashboard'],
|
|
686
|
+
operation: [
|
|
687
|
+
'getCustomerById',
|
|
688
|
+
'getCustomerDevices',
|
|
689
|
+
'getCustomerAssets',
|
|
690
|
+
'getCustomerDashboards',
|
|
691
|
+
'deleteCustomer',
|
|
692
|
+
],
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
displayName: 'Text Search',
|
|
698
|
+
name: 'customerTextSearch',
|
|
699
|
+
type: 'string',
|
|
700
|
+
default: '',
|
|
701
|
+
description: 'The case insensitive "substring" filter based on the customer title',
|
|
702
|
+
displayOptions: {
|
|
703
|
+
show: {
|
|
704
|
+
resource: ['customer'],
|
|
705
|
+
operation: ['getCustomers', 'getCustomersByEntityGroupId', 'getUserCustomers'],
|
|
706
|
+
},
|
|
707
|
+
},
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
displayName: 'Sort Property',
|
|
711
|
+
name: 'customerSortProperty',
|
|
712
|
+
type: 'options',
|
|
713
|
+
options: [
|
|
714
|
+
{ name: 'City', value: 'city' },
|
|
715
|
+
{ name: 'Country', value: 'country' },
|
|
716
|
+
{ name: 'createdTime', value: 'createdTime' },
|
|
717
|
+
{ name: 'Email', value: 'email' },
|
|
718
|
+
{ name: 'Title', value: 'title' },
|
|
719
|
+
],
|
|
720
|
+
default: 'createdTime',
|
|
721
|
+
description: 'Property of entity to sort by',
|
|
722
|
+
displayOptions: {
|
|
723
|
+
show: {
|
|
724
|
+
resource: ['customer'],
|
|
725
|
+
operation: ['getCustomers', 'getCustomersByEntityGroupId', 'getUserCustomers'],
|
|
726
|
+
},
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
displayName: 'Customer Title',
|
|
731
|
+
name: 'customerTitle',
|
|
732
|
+
type: 'string',
|
|
733
|
+
default: '',
|
|
734
|
+
description: 'A string value representing the Customer title',
|
|
735
|
+
displayOptions: {
|
|
736
|
+
show: { resource: ['customer'], operation: ['getTenantCustomer', 'createCustomer'] },
|
|
737
|
+
},
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
displayName: 'Alarm ID',
|
|
741
|
+
name: 'alarmId',
|
|
742
|
+
type: 'string',
|
|
743
|
+
required: true,
|
|
744
|
+
default: '',
|
|
745
|
+
description: 'A string value representing the alarm ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
746
|
+
displayOptions: {
|
|
747
|
+
show: { resource: ['alarm'], operation: ['getAlarmById', 'getAlarmInfoById'] },
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
displayName: 'Entity Type',
|
|
752
|
+
name: 'alarmEntityType',
|
|
753
|
+
type: 'string',
|
|
754
|
+
required: true,
|
|
755
|
+
default: '',
|
|
756
|
+
description: 'A string value representing the entity type. For example, DEVICE, ASSET, ENTITY_VIEW, CUSTOMER, DASHBOARD, USER, DATA_CONVERTER, INTEGRATION, SCHEDULER_EVENT.',
|
|
757
|
+
displayOptions: {
|
|
758
|
+
show: { resource: ['alarm'], operation: ['getAlarms', 'getHighestAlarmSeverity'] },
|
|
759
|
+
},
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
displayName: 'Entity ID',
|
|
763
|
+
name: 'entityId',
|
|
764
|
+
type: 'string',
|
|
765
|
+
required: true,
|
|
766
|
+
default: '',
|
|
767
|
+
description: 'A string value representing the entity ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
768
|
+
displayOptions: {
|
|
769
|
+
show: {
|
|
770
|
+
resource: ['alarm', 'telemetry', 'entityGroup'],
|
|
771
|
+
operation: [
|
|
772
|
+
'getAlarms',
|
|
773
|
+
'getHighestAlarmSeverity',
|
|
774
|
+
'getTimeseries',
|
|
775
|
+
'getLatestTimeseries',
|
|
776
|
+
'getTimeseriesKeys',
|
|
777
|
+
'getAttributes',
|
|
778
|
+
'getAttributeKeys',
|
|
779
|
+
'getAttributeKeysByScope',
|
|
780
|
+
'saveEntityAttributes',
|
|
781
|
+
'saveEntityTelemetry',
|
|
782
|
+
'saveEntityTelemetryWithTTL',
|
|
783
|
+
'deleteEntityAttributes',
|
|
784
|
+
'deleteEntityTimeseries',
|
|
785
|
+
'getEntityGroupsForEntity',
|
|
786
|
+
],
|
|
787
|
+
},
|
|
788
|
+
},
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
displayName: 'Search Status',
|
|
792
|
+
name: 'searchStatus',
|
|
793
|
+
type: 'string',
|
|
794
|
+
default: '',
|
|
795
|
+
description: 'A string value representing one of the AlarmSearchStatus enumeration value. Allowed values: "ANY", "ACTIVE", "CLEARED", "ACK", "UNACK".',
|
|
796
|
+
displayOptions: {
|
|
797
|
+
show: {
|
|
798
|
+
resource: ['alarm'],
|
|
799
|
+
operation: ['getAlarms', 'getAllAlarms', 'getHighestAlarmSeverity'],
|
|
800
|
+
},
|
|
801
|
+
},
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
displayName: 'Status',
|
|
805
|
+
name: 'status',
|
|
806
|
+
type: 'string',
|
|
807
|
+
default: '',
|
|
808
|
+
description: 'A string value representing one of the AlarmStatus enumeration value. Allowed values: "ACTIVE_UNACK", "ACTIVE_ACK", "CLEARED_UNACK", "CLEARED_ACK".',
|
|
809
|
+
displayOptions: {
|
|
810
|
+
show: {
|
|
811
|
+
resource: ['alarm'],
|
|
812
|
+
operation: ['getAlarms', 'getAllAlarms', 'getHighestAlarmSeverity'],
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
displayName: 'Assignee ID',
|
|
818
|
+
name: 'assigneeId',
|
|
819
|
+
type: 'string',
|
|
820
|
+
default: '',
|
|
821
|
+
description: 'A string value representing the assignee user ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
822
|
+
displayOptions: { show: { resource: ['alarm'], operation: ['getAllAlarms'] } },
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
displayName: 'Text Search',
|
|
826
|
+
name: 'alarmTextSearch',
|
|
827
|
+
type: 'string',
|
|
828
|
+
default: '',
|
|
829
|
+
description: 'The case insensitive "substring" filter based on of next alarm fields: type, severity or status',
|
|
830
|
+
displayOptions: {
|
|
831
|
+
show: { resource: ['alarm'], operation: ['getAlarms', 'getAllAlarms', 'getAlarmTypes'] },
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
displayName: 'Sort Property',
|
|
836
|
+
name: 'alarmSortProperty',
|
|
837
|
+
type: 'options',
|
|
838
|
+
options: [
|
|
839
|
+
{ name: 'ackTs', value: 'ackTs' },
|
|
840
|
+
{ name: 'clearTs', value: 'clearTs' },
|
|
841
|
+
{ name: 'createdTime', value: 'createdTime' },
|
|
842
|
+
{ name: 'endTs', value: 'endTs' },
|
|
843
|
+
{ name: 'Severity', value: 'severity' },
|
|
844
|
+
{ name: 'startTs', value: 'startTs' },
|
|
845
|
+
{ name: 'Status', value: 'status' },
|
|
846
|
+
],
|
|
847
|
+
default: 'createdTime',
|
|
848
|
+
description: 'Property of entity to sort by',
|
|
849
|
+
displayOptions: {
|
|
850
|
+
show: { resource: ['alarm'], operation: ['getAlarms', 'getAllAlarms', 'getAlarmTypes'] },
|
|
851
|
+
},
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
displayName: 'Start Time',
|
|
855
|
+
name: 'startTs',
|
|
856
|
+
type: 'string',
|
|
857
|
+
default: '',
|
|
858
|
+
description: 'A long value representing the start timestamp of the time range in milliseconds, UTC',
|
|
859
|
+
displayOptions: {
|
|
860
|
+
show: {
|
|
861
|
+
resource: ['alarm', 'telemetry'],
|
|
862
|
+
operation: ['getAlarms', 'getAllAlarms', 'getTimeseries'],
|
|
863
|
+
},
|
|
864
|
+
},
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
displayName: 'End Time',
|
|
868
|
+
name: 'endTs',
|
|
869
|
+
type: 'string',
|
|
870
|
+
default: '',
|
|
871
|
+
description: 'A long value representing the end timestamp of the time range in milliseconds, UTC',
|
|
872
|
+
displayOptions: {
|
|
873
|
+
show: {
|
|
874
|
+
resource: ['alarm', 'telemetry'],
|
|
875
|
+
operation: ['getAlarms', 'getAllAlarms', 'getTimeseries'],
|
|
876
|
+
},
|
|
877
|
+
},
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
displayName: 'Fetch Originator',
|
|
881
|
+
name: 'fetchOriginator',
|
|
882
|
+
type: 'boolean',
|
|
883
|
+
default: false,
|
|
884
|
+
description: 'Whether to fetch the originator of the alarm',
|
|
885
|
+
displayOptions: { show: { resource: ['alarm'], operation: ['getAlarms', 'getAllAlarms'] } },
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
displayName: 'Operation',
|
|
889
|
+
name: 'operation',
|
|
890
|
+
type: 'options',
|
|
891
|
+
noDataExpression: true,
|
|
892
|
+
displayOptions: { show: { resource: ['relation'] } },
|
|
893
|
+
options: [
|
|
894
|
+
{
|
|
895
|
+
name: 'By From',
|
|
896
|
+
value: 'findByFrom',
|
|
897
|
+
action: 'Get relation by from',
|
|
898
|
+
description: 'Returns list of relation objects for the specified entity by the "from" direction',
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: 'By From (with Relation Type)',
|
|
902
|
+
value: 'findByFromWithRelationType',
|
|
903
|
+
action: 'Get relation by from with relation type',
|
|
904
|
+
description: 'Returns list of relation objects for the specified entity by the "from" direction with relation type',
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
name: 'By To',
|
|
908
|
+
value: 'findByTo',
|
|
909
|
+
action: 'Get relation by to',
|
|
910
|
+
description: 'Returns list of relation objects for the specified entity by the "to" direction',
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
name: 'By to (with Relation Type)',
|
|
914
|
+
value: 'findByToWithRelationType',
|
|
915
|
+
action: 'Get relation by to with relation type',
|
|
916
|
+
description: 'Returns list of relation objects for the specified entity by the "to" direction with relation type',
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
name: 'Get',
|
|
920
|
+
value: 'getRelation',
|
|
921
|
+
action: 'Get a relation',
|
|
922
|
+
description: 'Fetch a specific relation based on the provided parameters',
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
name: 'Info by From',
|
|
926
|
+
value: 'findInfoByFrom',
|
|
927
|
+
action: 'Get relation info by from',
|
|
928
|
+
description: 'Fetch relation information for the specified entity by the "from" direction',
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
name: 'Info by To',
|
|
932
|
+
value: 'findInfoByTo',
|
|
933
|
+
action: 'Get relation info by to',
|
|
934
|
+
description: 'Fetch relation information for the specified entity by the "to" direction',
|
|
935
|
+
},
|
|
936
|
+
],
|
|
937
|
+
default: 'getRelation',
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
displayName: 'From ID',
|
|
941
|
+
name: 'fromId',
|
|
942
|
+
type: 'string',
|
|
943
|
+
default: '',
|
|
944
|
+
required: true,
|
|
945
|
+
description: 'A string value representing the entity ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
946
|
+
displayOptions: {
|
|
947
|
+
show: {
|
|
948
|
+
resource: ['relation'],
|
|
949
|
+
operation: [
|
|
950
|
+
'getRelation',
|
|
951
|
+
'findByFrom',
|
|
952
|
+
'findInfoByFrom',
|
|
953
|
+
'findByFromWithRelationType',
|
|
954
|
+
],
|
|
955
|
+
},
|
|
956
|
+
},
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
displayName: 'From Type',
|
|
960
|
+
name: 'fromType',
|
|
961
|
+
type: 'string',
|
|
962
|
+
required: true,
|
|
963
|
+
default: 'DEVICE',
|
|
964
|
+
description: 'A string value representing the entity type. For example, "DEVICE".',
|
|
965
|
+
displayOptions: {
|
|
966
|
+
show: {
|
|
967
|
+
resource: ['relation'],
|
|
968
|
+
operation: [
|
|
969
|
+
'getRelation',
|
|
970
|
+
'findByFrom',
|
|
971
|
+
'findInfoByFrom',
|
|
972
|
+
'findByFromWithRelationType',
|
|
973
|
+
],
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
displayName: 'Relation Type',
|
|
979
|
+
name: 'relationType',
|
|
980
|
+
type: 'string',
|
|
981
|
+
required: true,
|
|
982
|
+
default: '',
|
|
983
|
+
displayOptions: {
|
|
984
|
+
show: {
|
|
985
|
+
resource: ['relation'],
|
|
986
|
+
operation: ['getRelation', 'findByFromWithRelationType', 'findByToWithRelationType'],
|
|
987
|
+
},
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
displayName: 'To ID',
|
|
992
|
+
name: 'toId',
|
|
993
|
+
type: 'string',
|
|
994
|
+
default: '',
|
|
995
|
+
required: true,
|
|
996
|
+
description: 'A string value representing the entity ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
997
|
+
displayOptions: {
|
|
998
|
+
show: {
|
|
999
|
+
resource: ['relation'],
|
|
1000
|
+
operation: ['getRelation', 'findByTo', 'findInfoByTo', 'findByToWithRelationType'],
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
displayName: 'To Type',
|
|
1006
|
+
name: 'toType',
|
|
1007
|
+
type: 'string',
|
|
1008
|
+
default: 'DEVICE',
|
|
1009
|
+
required: true,
|
|
1010
|
+
description: 'A string value representing the entity type. For example, "DEVICE".',
|
|
1011
|
+
displayOptions: {
|
|
1012
|
+
show: {
|
|
1013
|
+
resource: ['relation'],
|
|
1014
|
+
operation: ['getRelation', 'findByTo', 'findInfoByTo', 'findByToWithRelationType'],
|
|
1015
|
+
},
|
|
1016
|
+
},
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
displayName: 'Operation',
|
|
1020
|
+
name: 'operation',
|
|
1021
|
+
type: 'options',
|
|
1022
|
+
noDataExpression: true,
|
|
1023
|
+
displayOptions: { show: { resource: ['telemetry'] } },
|
|
1024
|
+
options: [
|
|
1025
|
+
{
|
|
1026
|
+
name: 'Attribute Keys',
|
|
1027
|
+
value: 'getAttributeKeys',
|
|
1028
|
+
action: 'Get attribute keys',
|
|
1029
|
+
description: 'Returns a set of unique attribute key names for the selected entity',
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
name: 'Attribute Keys (by Scope)',
|
|
1033
|
+
value: 'getAttributeKeysByScope',
|
|
1034
|
+
action: 'Get attribute keys by scope',
|
|
1035
|
+
description: 'Returns a set of unique attribute key names for the selected entity and scope',
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
name: 'Attributes',
|
|
1039
|
+
value: 'getAttributes',
|
|
1040
|
+
action: 'Get attributes',
|
|
1041
|
+
description: 'Returns a list of attributes for the selected entity',
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
name: 'Delete Device Attributes',
|
|
1045
|
+
value: 'deleteDeviceAttributes',
|
|
1046
|
+
action: 'Delete device attributes',
|
|
1047
|
+
description: 'Delete device attributes by keys',
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
name: 'Delete Entity Attributes',
|
|
1051
|
+
value: 'deleteEntityAttributes',
|
|
1052
|
+
action: 'Delete entity attributes',
|
|
1053
|
+
description: 'Delete entity attributes by keys',
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
name: 'Delete Entity Timeseries',
|
|
1057
|
+
value: 'deleteEntityTimeseries',
|
|
1058
|
+
action: 'Delete entity timeseries',
|
|
1059
|
+
description: 'Delete entity time series data',
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
name: 'Save Device Attributes',
|
|
1063
|
+
value: 'saveDeviceAttributes',
|
|
1064
|
+
action: 'Save device attributes',
|
|
1065
|
+
description: 'Creates or updates device attributes',
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
name: 'Save Entity Attributes',
|
|
1069
|
+
value: 'saveEntityAttributes',
|
|
1070
|
+
action: 'Save entity attributes',
|
|
1071
|
+
description: 'Creates or updates entity attributes for any entity type',
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
name: 'Save Entity Telemetry',
|
|
1075
|
+
value: 'saveEntityTelemetry',
|
|
1076
|
+
action: 'Save entity telemetry',
|
|
1077
|
+
description: 'Creates or updates entity time series data',
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
name: 'Save Entity Telemetry with TTL',
|
|
1081
|
+
value: 'saveEntityTelemetryWithTTL',
|
|
1082
|
+
action: 'Save entity telemetry with ttl',
|
|
1083
|
+
description: 'Creates or updates entity time series data with TTL',
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
name: 'Timeseries (Latest)',
|
|
1087
|
+
value: 'getLatestTimeseries',
|
|
1088
|
+
action: 'Get latest timeseries',
|
|
1089
|
+
description: 'Returns the latest timeseries data for the selected entity',
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
name: 'Timeseries (Range)',
|
|
1093
|
+
value: 'getTimeseries',
|
|
1094
|
+
action: 'Get timeseries',
|
|
1095
|
+
description: 'Returns timeseries data for the selected entity within a specified range',
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
name: 'Timeseries Keys',
|
|
1099
|
+
value: 'getTimeseriesKeys',
|
|
1100
|
+
action: 'Get timeseries keys',
|
|
1101
|
+
description: 'Returns a set of unique timeseries key names for the selected entity',
|
|
1102
|
+
},
|
|
1103
|
+
],
|
|
1104
|
+
default: 'getTimeseries',
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
displayName: 'Entity Type',
|
|
1108
|
+
name: 'entityType',
|
|
1109
|
+
type: 'string',
|
|
1110
|
+
default: 'DEVICE',
|
|
1111
|
+
description: 'A string value representing the entity type. For example, "DEVICE".',
|
|
1112
|
+
displayOptions: {
|
|
1113
|
+
show: {
|
|
1114
|
+
resource: ['telemetry'],
|
|
1115
|
+
operation: [
|
|
1116
|
+
'getTimeseries',
|
|
1117
|
+
'getLatestTimeseries',
|
|
1118
|
+
'getTimeseriesKeys',
|
|
1119
|
+
'getAttributes',
|
|
1120
|
+
'getAttributeKeys',
|
|
1121
|
+
'getAttributeKeysByScope',
|
|
1122
|
+
'saveEntityAttributes',
|
|
1123
|
+
'saveEntityTelemetry',
|
|
1124
|
+
'saveEntityTelemetryWithTTL',
|
|
1125
|
+
'deleteEntityAttributes',
|
|
1126
|
+
'deleteEntityTimeseries',
|
|
1127
|
+
],
|
|
1128
|
+
},
|
|
1129
|
+
},
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
displayName: 'Use Strict Data Types',
|
|
1133
|
+
name: 'useStrictDataTypes',
|
|
1134
|
+
type: 'boolean',
|
|
1135
|
+
default: false,
|
|
1136
|
+
description: 'Whether to convert telemetry values to strings. Conversion is enabled by default; set to "true" to disable conversion.',
|
|
1137
|
+
displayOptions: {
|
|
1138
|
+
show: { resource: ['telemetry'], operation: ['getLatestTimeseries', 'getTimeseries'] },
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
displayName: 'Attributes Scope',
|
|
1143
|
+
name: 'scope',
|
|
1144
|
+
type: 'options',
|
|
1145
|
+
options: [
|
|
1146
|
+
{ name: 'CLIENT_SCOPE', value: 'CLIENT_SCOPE' },
|
|
1147
|
+
{ name: 'SERVER_SCOPE', value: 'SERVER_SCOPE' },
|
|
1148
|
+
{ name: 'SHARED_SCOPE', value: 'SHARED_SCOPE' },
|
|
1149
|
+
],
|
|
1150
|
+
default: 'SERVER_SCOPE',
|
|
1151
|
+
description: 'Attribute scope for reading attributes. CLIENT_SCOPE is only supported for devices.',
|
|
1152
|
+
displayOptions: {
|
|
1153
|
+
show: {
|
|
1154
|
+
resource: ['telemetry'],
|
|
1155
|
+
operation: ['getAttributesByScope', 'getAttributeKeysByScope'],
|
|
1156
|
+
},
|
|
1157
|
+
},
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
displayName: 'Attributes Scope',
|
|
1161
|
+
name: 'scope',
|
|
1162
|
+
type: 'options',
|
|
1163
|
+
options: [
|
|
1164
|
+
{ name: 'SERVER_SCOPE', value: 'SERVER_SCOPE' },
|
|
1165
|
+
{ name: 'SHARED_SCOPE', value: 'SHARED_SCOPE' },
|
|
1166
|
+
],
|
|
1167
|
+
default: 'SERVER_SCOPE',
|
|
1168
|
+
description: 'Attribute scope for saving attributes. Only SERVER_SCOPE and SHARED_SCOPE are supported for save operations.',
|
|
1169
|
+
displayOptions: {
|
|
1170
|
+
show: {
|
|
1171
|
+
resource: ['telemetry'],
|
|
1172
|
+
operation: ['saveEntityAttributes', 'saveDeviceAttributes'],
|
|
1173
|
+
},
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
displayName: 'Attributes Scope',
|
|
1178
|
+
name: 'scope',
|
|
1179
|
+
type: 'options',
|
|
1180
|
+
options: [
|
|
1181
|
+
{ name: 'CLIENT_SCOPE', value: 'CLIENT_SCOPE' },
|
|
1182
|
+
{ name: 'SERVER_SCOPE', value: 'SERVER_SCOPE' },
|
|
1183
|
+
{ name: 'SHARED_SCOPE', value: 'SHARED_SCOPE' },
|
|
1184
|
+
],
|
|
1185
|
+
default: 'SERVER_SCOPE',
|
|
1186
|
+
description: 'Attribute scope for deleting attributes. All scopes are supported for delete operations.',
|
|
1187
|
+
displayOptions: {
|
|
1188
|
+
show: {
|
|
1189
|
+
resource: ['telemetry'],
|
|
1190
|
+
operation: ['deleteEntityAttributes', 'deleteDeviceAttributes'],
|
|
1191
|
+
},
|
|
1192
|
+
},
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
displayName: 'Keys (Comma Separated)',
|
|
1196
|
+
name: 'keys',
|
|
1197
|
+
type: 'string',
|
|
1198
|
+
required: true,
|
|
1199
|
+
default: 'temperature',
|
|
1200
|
+
description: 'Comma-separated telemetry keys or attribute keys',
|
|
1201
|
+
displayOptions: {
|
|
1202
|
+
show: {
|
|
1203
|
+
resource: ['telemetry'],
|
|
1204
|
+
operation: [
|
|
1205
|
+
'getTimeseries',
|
|
1206
|
+
'getAttributes',
|
|
1207
|
+
'getLatestTimeseries',
|
|
1208
|
+
'getAttributes',
|
|
1209
|
+
'getAttributesByScope',
|
|
1210
|
+
],
|
|
1211
|
+
},
|
|
1212
|
+
},
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
displayName: 'Aggregation',
|
|
1216
|
+
name: 'agg',
|
|
1217
|
+
type: 'options',
|
|
1218
|
+
options: [
|
|
1219
|
+
{ name: 'AVG', value: 'AVG' },
|
|
1220
|
+
{ name: 'COUNT', value: 'COUNT' },
|
|
1221
|
+
{ name: 'MAX', value: 'MAX' },
|
|
1222
|
+
{ name: 'MIN', value: 'MIN' },
|
|
1223
|
+
{ name: 'NONE', value: 'NONE' },
|
|
1224
|
+
{ name: 'SUM', value: 'SUM' },
|
|
1225
|
+
],
|
|
1226
|
+
default: 'NONE',
|
|
1227
|
+
displayOptions: { show: { resource: ['telemetry'], operation: ['getTimeseries'] } },
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
displayName: 'Interval (Ms)',
|
|
1231
|
+
name: 'interval',
|
|
1232
|
+
type: 'string',
|
|
1233
|
+
default: '0',
|
|
1234
|
+
displayOptions: { show: { resource: ['telemetry'], operation: ['getTimeseries'] } },
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
displayName: 'Interval Type',
|
|
1238
|
+
name: 'intervalType',
|
|
1239
|
+
type: 'options',
|
|
1240
|
+
options: [
|
|
1241
|
+
{ name: 'MILLISECONDS', value: 'MILLISECONDS' },
|
|
1242
|
+
{ name: 'MONTH', value: 'MONTH' },
|
|
1243
|
+
{ name: 'QUARTER', value: 'QUARTER' },
|
|
1244
|
+
{ name: 'WEEK', value: 'WEEK' },
|
|
1245
|
+
{ name: 'WEEK_ISO', value: 'WEEK_ISO' },
|
|
1246
|
+
],
|
|
1247
|
+
default: 'MILLISECONDS',
|
|
1248
|
+
displayOptions: { show: { resource: ['telemetry'], operation: ['getTimeseries'] } },
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
displayName: 'Time Zone',
|
|
1252
|
+
name: 'timeZone',
|
|
1253
|
+
type: 'string',
|
|
1254
|
+
default: '',
|
|
1255
|
+
description: 'Timezone used for WEEK/WEEK_ISO/MONTH/QUARTER interval types',
|
|
1256
|
+
displayOptions: { show: { resource: ['telemetry'], operation: ['getTimeseries'] } },
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
displayName: 'Order',
|
|
1260
|
+
name: 'orderBy',
|
|
1261
|
+
type: 'options',
|
|
1262
|
+
options: [
|
|
1263
|
+
{ name: 'ASC', value: 'ASC' },
|
|
1264
|
+
{ name: 'DESC', value: 'DESC' },
|
|
1265
|
+
],
|
|
1266
|
+
default: 'DESC',
|
|
1267
|
+
description: 'Sort order. ASC (ASCENDING) or DESC (DESCENDING).',
|
|
1268
|
+
displayOptions: { show: { resource: ['telemetry'], operation: ['getTimeseries'] } },
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
displayName: 'Limit (only if agg=NONE)',
|
|
1272
|
+
name: 'limit',
|
|
1273
|
+
type: 'number',
|
|
1274
|
+
typeOptions: { minValue: 1 },
|
|
1275
|
+
default: 50,
|
|
1276
|
+
description: 'Max number of results to return',
|
|
1277
|
+
displayOptions: { show: { resource: ['telemetry'], operation: ['getTimeseries'] } },
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
displayName: 'Device ID',
|
|
1281
|
+
name: 'deviceId',
|
|
1282
|
+
type: 'string',
|
|
1283
|
+
required: true,
|
|
1284
|
+
default: '',
|
|
1285
|
+
description: 'A string value representing the device ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
1286
|
+
displayOptions: {
|
|
1287
|
+
show: {
|
|
1288
|
+
resource: ['telemetry'],
|
|
1289
|
+
operation: ['saveDeviceAttributes', 'deleteDeviceAttributes'],
|
|
1290
|
+
},
|
|
1291
|
+
},
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
displayName: 'Attributes JSON',
|
|
1295
|
+
name: 'attributesJson',
|
|
1296
|
+
type: 'json',
|
|
1297
|
+
required: true,
|
|
1298
|
+
default: '{"stringKey": "value1", "booleanKey": true, "doubleKey": 42.0, "longKey": 73}',
|
|
1299
|
+
description: 'JSON object with key-value format of attributes to create or update. Supports string, boolean, number, and nested JSON values.',
|
|
1300
|
+
displayOptions: {
|
|
1301
|
+
show: {
|
|
1302
|
+
resource: ['telemetry'],
|
|
1303
|
+
operation: ['saveEntityAttributes', 'saveDeviceAttributes'],
|
|
1304
|
+
},
|
|
1305
|
+
},
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
displayName: 'Telemetry JSON',
|
|
1309
|
+
name: 'telemetryJson',
|
|
1310
|
+
type: 'json',
|
|
1311
|
+
required: true,
|
|
1312
|
+
default: '{"temperature": 26}',
|
|
1313
|
+
description: 'Telemetry data in JSON format. Supports: 1) Simple format: {"temperature": 26}, 2) With timestamp: {"ts":1634712287000,"values":{"temperature":26}}, 3) Array: [{"ts":1634712287000,"values":{"temperature":26}}].',
|
|
1314
|
+
displayOptions: {
|
|
1315
|
+
show: {
|
|
1316
|
+
resource: ['telemetry'],
|
|
1317
|
+
operation: ['saveEntityTelemetry', 'saveEntityTelemetryWithTTL'],
|
|
1318
|
+
},
|
|
1319
|
+
},
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
displayName: 'TTL (Time to Live)',
|
|
1323
|
+
name: 'ttl',
|
|
1324
|
+
type: 'number',
|
|
1325
|
+
typeOptions: { minValue: 0 },
|
|
1326
|
+
default: 0,
|
|
1327
|
+
description: 'Time to Live in milliseconds. Only affects Cassandra DB installations. Set to 0 for no TTL.',
|
|
1328
|
+
displayOptions: {
|
|
1329
|
+
show: { resource: ['telemetry'], operation: ['saveEntityTelemetryWithTTL'] },
|
|
1330
|
+
},
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
displayName: 'Attribute Keys (Comma Separated)',
|
|
1334
|
+
name: 'attributeKeys',
|
|
1335
|
+
type: 'string',
|
|
1336
|
+
required: true,
|
|
1337
|
+
default: '',
|
|
1338
|
+
description: 'Comma-separated list of attribute keys to delete. For example: "temperature,humidity,status".',
|
|
1339
|
+
displayOptions: {
|
|
1340
|
+
show: {
|
|
1341
|
+
resource: ['telemetry'],
|
|
1342
|
+
operation: ['deleteEntityAttributes', 'deleteDeviceAttributes'],
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
displayName: 'Timeseries Keys (Comma Separated)',
|
|
1348
|
+
name: 'timeseriesKeys',
|
|
1349
|
+
type: 'string',
|
|
1350
|
+
required: true,
|
|
1351
|
+
default: '',
|
|
1352
|
+
description: 'Comma-separated list of timeseries keys to delete. For example: "temperature,humidity,voltage".',
|
|
1353
|
+
displayOptions: {
|
|
1354
|
+
show: { resource: ['telemetry'], operation: ['deleteEntityTimeseries'] },
|
|
1355
|
+
},
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
displayName: 'Delete All Data for Keys',
|
|
1359
|
+
name: 'deleteAllDataForKeys',
|
|
1360
|
+
type: 'boolean',
|
|
1361
|
+
default: false,
|
|
1362
|
+
description: 'Whether to delete all data for selected keys. If false, only data in the specified time range will be deleted.',
|
|
1363
|
+
displayOptions: {
|
|
1364
|
+
show: { resource: ['telemetry'], operation: ['deleteEntityTimeseries'] },
|
|
1365
|
+
},
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
displayName: 'Start Timestamp',
|
|
1369
|
+
name: 'deleteStartTs',
|
|
1370
|
+
type: 'string',
|
|
1371
|
+
default: '',
|
|
1372
|
+
description: 'Start timestamp in milliseconds (UTC). Required when deleteAllDataForKeys is false.',
|
|
1373
|
+
displayOptions: {
|
|
1374
|
+
show: {
|
|
1375
|
+
resource: ['telemetry'],
|
|
1376
|
+
operation: ['deleteEntityTimeseries'],
|
|
1377
|
+
deleteAllDataForKeys: [false],
|
|
1378
|
+
},
|
|
1379
|
+
},
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
displayName: 'End Timestamp',
|
|
1383
|
+
name: 'deleteEndTs',
|
|
1384
|
+
type: 'string',
|
|
1385
|
+
default: '',
|
|
1386
|
+
description: 'End timestamp in milliseconds (UTC). Required when deleteAllDataForKeys is false.',
|
|
1387
|
+
displayOptions: {
|
|
1388
|
+
show: {
|
|
1389
|
+
resource: ['telemetry'],
|
|
1390
|
+
operation: ['deleteEntityTimeseries'],
|
|
1391
|
+
deleteAllDataForKeys: [false],
|
|
1392
|
+
},
|
|
1393
|
+
},
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
displayName: 'Delete Latest',
|
|
1397
|
+
name: 'deleteLatest',
|
|
1398
|
+
type: 'boolean',
|
|
1399
|
+
default: true,
|
|
1400
|
+
description: 'Whether to delete the latest telemetry value if its timestamp matches the time range',
|
|
1401
|
+
displayOptions: {
|
|
1402
|
+
show: { resource: ['telemetry'], operation: ['deleteEntityTimeseries'] },
|
|
1403
|
+
},
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
displayName: 'Rewrite Latest If Deleted',
|
|
1407
|
+
name: 'rewriteLatestIfDeleted',
|
|
1408
|
+
type: 'boolean',
|
|
1409
|
+
default: false,
|
|
1410
|
+
description: 'Whether to rewrite the latest value with the most recent value before the time range if the latest value was deleted',
|
|
1411
|
+
displayOptions: {
|
|
1412
|
+
show: { resource: ['telemetry'], operation: ['deleteEntityTimeseries'] },
|
|
1413
|
+
},
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
displayName: 'Operation',
|
|
1417
|
+
name: 'operation',
|
|
1418
|
+
type: 'options',
|
|
1419
|
+
noDataExpression: true,
|
|
1420
|
+
displayOptions: { show: { resource: ['entityGroup'] } },
|
|
1421
|
+
options: [
|
|
1422
|
+
{
|
|
1423
|
+
name: 'Get by ID',
|
|
1424
|
+
value: 'getEntityGroupById',
|
|
1425
|
+
action: 'Get entity group by id',
|
|
1426
|
+
description: 'Fetch an entity group based on the provided Entity Group ID',
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
name: 'Get by Owner/Name/Type',
|
|
1430
|
+
value: 'getEntityGroupByOwnerAndNameAndType',
|
|
1431
|
+
action: 'Get entity group by owner name and type',
|
|
1432
|
+
description: 'Fetch an entity group based on the provided owner, name, and type',
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
name: 'Get Many by Entity',
|
|
1436
|
+
value: 'getEntityGroupsForEntity',
|
|
1437
|
+
action: 'Get entity groups for entity',
|
|
1438
|
+
description: 'Fetch entity groups associated with the provided entity',
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
name: 'Get Many by Owner and Type',
|
|
1442
|
+
value: 'getEntityGroupsByOwnerAndType',
|
|
1443
|
+
action: 'Get entity groups by owner and type',
|
|
1444
|
+
description: 'Fetch entity groups based on the provided owner and type',
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
name: 'Get Many by Type',
|
|
1448
|
+
value: 'getEntityGroupsByType',
|
|
1449
|
+
action: 'Get entity groups by type',
|
|
1450
|
+
description: 'Fetch entity groups based on the provided type',
|
|
1451
|
+
},
|
|
1452
|
+
],
|
|
1453
|
+
default: 'getEntityGroupById',
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
displayName: 'Entity Group ID',
|
|
1457
|
+
name: 'entityGroupId',
|
|
1458
|
+
type: 'string',
|
|
1459
|
+
required: true,
|
|
1460
|
+
default: '',
|
|
1461
|
+
description: 'A string value representing the Entity Group ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
1462
|
+
displayOptions: {
|
|
1463
|
+
show: {
|
|
1464
|
+
resource: ['entityGroup', 'customer', 'device', 'asset'],
|
|
1465
|
+
operation: [
|
|
1466
|
+
'getEntityGroupById',
|
|
1467
|
+
'getCustomersByEntityGroupId',
|
|
1468
|
+
'getDevicesByEntityGroupId',
|
|
1469
|
+
'getAssetsByEntityGroupId',
|
|
1470
|
+
],
|
|
1471
|
+
},
|
|
1472
|
+
},
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
displayName: 'Group Type',
|
|
1476
|
+
name: 'groupType',
|
|
1477
|
+
type: 'options',
|
|
1478
|
+
options: [
|
|
1479
|
+
{ name: 'ASSET', value: 'ASSET' },
|
|
1480
|
+
{ name: 'CUSTOMER', value: 'CUSTOMER' },
|
|
1481
|
+
{ name: 'DASHBOARD', value: 'DASHBOARD' },
|
|
1482
|
+
{ name: 'DEVICE', value: 'DEVICE' },
|
|
1483
|
+
{ name: 'EDGE', value: 'EDGE' },
|
|
1484
|
+
{ name: 'ENTITY_VIEW', value: 'ENTITY_VIEW' },
|
|
1485
|
+
{ name: 'USER', value: 'USER' },
|
|
1486
|
+
],
|
|
1487
|
+
default: 'DEVICE',
|
|
1488
|
+
required: true,
|
|
1489
|
+
description: 'Entity group type',
|
|
1490
|
+
displayOptions: {
|
|
1491
|
+
show: {
|
|
1492
|
+
resource: ['entityGroup'],
|
|
1493
|
+
operation: [
|
|
1494
|
+
'getEntityGroupsForEntity',
|
|
1495
|
+
'getEntityGroupsByType',
|
|
1496
|
+
'getEntityGroupByOwnerAndNameAndType',
|
|
1497
|
+
'getEntityGroupsByOwnerAndType',
|
|
1498
|
+
],
|
|
1499
|
+
},
|
|
1500
|
+
},
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
displayName: 'Owner Type',
|
|
1504
|
+
name: 'ownerType',
|
|
1505
|
+
type: 'string',
|
|
1506
|
+
default: '',
|
|
1507
|
+
required: true,
|
|
1508
|
+
description: 'Owner entity type (e.g. TENANT, CUSTOMER)',
|
|
1509
|
+
displayOptions: {
|
|
1510
|
+
show: {
|
|
1511
|
+
resource: ['entityGroup'],
|
|
1512
|
+
operation: ['getEntityGroupByOwnerAndNameAndType', 'getEntityGroupsByOwnerAndType'],
|
|
1513
|
+
},
|
|
1514
|
+
},
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
displayName: 'Owner ID',
|
|
1518
|
+
name: 'ownerId',
|
|
1519
|
+
type: 'string',
|
|
1520
|
+
default: '',
|
|
1521
|
+
required: true,
|
|
1522
|
+
description: 'A string value representing the Owner ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
1523
|
+
displayOptions: {
|
|
1524
|
+
show: {
|
|
1525
|
+
resource: ['entityGroup'],
|
|
1526
|
+
operation: ['getEntityGroupByOwnerAndNameAndType', 'getEntityGroupsByOwnerAndType'],
|
|
1527
|
+
},
|
|
1528
|
+
},
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
displayName: 'Group Name',
|
|
1532
|
+
name: 'groupName',
|
|
1533
|
+
type: 'string',
|
|
1534
|
+
default: '',
|
|
1535
|
+
required: true,
|
|
1536
|
+
description: 'Entity Group name',
|
|
1537
|
+
displayOptions: {
|
|
1538
|
+
show: { resource: ['entityGroup'], operation: ['getEntityGroupByOwnerAndNameAndType'] },
|
|
1539
|
+
},
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
displayName: 'Operation',
|
|
1543
|
+
name: 'operation',
|
|
1544
|
+
type: 'options',
|
|
1545
|
+
noDataExpression: true,
|
|
1546
|
+
displayOptions: { show: { resource: ['dashboard'] } },
|
|
1547
|
+
options: [
|
|
1548
|
+
{
|
|
1549
|
+
name: 'Create',
|
|
1550
|
+
value: 'createDashboard',
|
|
1551
|
+
action: 'Create a dashboard',
|
|
1552
|
+
description: 'Create a dashboard',
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
name: 'Delete',
|
|
1556
|
+
value: 'deleteDashboard',
|
|
1557
|
+
action: 'Delete a dashboard',
|
|
1558
|
+
description: 'Delete a dashboard',
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
name: 'Get by ID',
|
|
1562
|
+
value: 'getDashboardById',
|
|
1563
|
+
action: 'Get dashboard by id',
|
|
1564
|
+
description: 'Fetch a dashboard based on the provided Dashboard ID',
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
name: 'Get Customer Dashboards',
|
|
1568
|
+
value: 'getCustomerDashboards',
|
|
1569
|
+
action: 'Get customer dashboards',
|
|
1570
|
+
description: 'Returns a page of dashboards based on the provided Customer ID',
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
name: 'Get Dashboards',
|
|
1574
|
+
value: 'getDashboards',
|
|
1575
|
+
action: 'Get dashboards',
|
|
1576
|
+
description: 'Returns a page of dashboards owned by the tenant of a current user',
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
name: 'Get User Dashboards',
|
|
1580
|
+
value: 'getUserDashboards',
|
|
1581
|
+
action: 'Get user dashboards',
|
|
1582
|
+
description: 'Returns a page of dashboards available for the current user',
|
|
1583
|
+
},
|
|
1584
|
+
],
|
|
1585
|
+
default: 'getDashboardById',
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
displayName: 'Dashboard ID',
|
|
1589
|
+
name: 'dashboardId',
|
|
1590
|
+
type: 'string',
|
|
1591
|
+
default: '',
|
|
1592
|
+
required: true,
|
|
1593
|
+
description: 'A string value representing the dashboard ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
1594
|
+
displayOptions: {
|
|
1595
|
+
show: { resource: ['dashboard'], operation: ['getDashboardById', 'deleteDashboard'] },
|
|
1596
|
+
},
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
displayName: 'Input Mode',
|
|
1600
|
+
name: 'dashboardInputMode',
|
|
1601
|
+
type: 'options',
|
|
1602
|
+
default: 'title',
|
|
1603
|
+
options: [
|
|
1604
|
+
{ name: 'Title Only', value: 'title', description: 'Provide just the dashboard title' },
|
|
1605
|
+
{
|
|
1606
|
+
name: 'Full JSON',
|
|
1607
|
+
value: 'json',
|
|
1608
|
+
description: 'Provide full ThingsBoard dashboard JSON',
|
|
1609
|
+
},
|
|
1610
|
+
],
|
|
1611
|
+
displayOptions: { show: { resource: ['dashboard'], operation: ['createDashboard'] } },
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
displayName: 'Dashboard Title',
|
|
1615
|
+
name: 'dashboardTitle',
|
|
1616
|
+
type: 'string',
|
|
1617
|
+
required: true,
|
|
1618
|
+
default: '',
|
|
1619
|
+
description: 'Title for the new dashboard',
|
|
1620
|
+
displayOptions: {
|
|
1621
|
+
show: {
|
|
1622
|
+
resource: ['dashboard'],
|
|
1623
|
+
operation: ['createDashboard'],
|
|
1624
|
+
dashboardInputMode: ['title'],
|
|
1625
|
+
},
|
|
1626
|
+
},
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
displayName: 'Dashboard JSON',
|
|
1630
|
+
name: 'dashboardJson',
|
|
1631
|
+
type: 'json',
|
|
1632
|
+
required: true,
|
|
1633
|
+
default: '{ "title": "My dashboard" }',
|
|
1634
|
+
typeOptions: { alwaysOpenEditWindow: true },
|
|
1635
|
+
description: 'Full ThingsBoard dashboard object. Include "ID" to update existing dashboard.',
|
|
1636
|
+
displayOptions: {
|
|
1637
|
+
show: {
|
|
1638
|
+
resource: ['dashboard'],
|
|
1639
|
+
operation: ['createDashboard'],
|
|
1640
|
+
dashboardInputMode: ['json'],
|
|
1641
|
+
},
|
|
1642
|
+
},
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
displayName: 'Text Search',
|
|
1646
|
+
name: 'dashboardTextSearch',
|
|
1647
|
+
type: 'string',
|
|
1648
|
+
default: '',
|
|
1649
|
+
description: 'The case insensitive "substring" filter based on the dashboard title',
|
|
1650
|
+
displayOptions: {
|
|
1651
|
+
show: {
|
|
1652
|
+
resource: ['dashboard'],
|
|
1653
|
+
operation: ['getDashboards', 'getCustomerDashboards', 'getUserDashboards'],
|
|
1654
|
+
},
|
|
1655
|
+
},
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
displayName: 'Sort Property',
|
|
1659
|
+
name: 'dashboardSortProperty',
|
|
1660
|
+
type: 'options',
|
|
1661
|
+
options: [
|
|
1662
|
+
{ name: 'createdTime', value: 'createdTime' },
|
|
1663
|
+
{ name: 'Title', value: 'title' },
|
|
1664
|
+
],
|
|
1665
|
+
default: 'createdTime',
|
|
1666
|
+
description: 'Property of entity to sort by',
|
|
1667
|
+
displayOptions: {
|
|
1668
|
+
show: {
|
|
1669
|
+
resource: ['dashboard'],
|
|
1670
|
+
operation: ['getDashboards', 'getCustomerDashboards', 'getUserDashboards'],
|
|
1671
|
+
},
|
|
1672
|
+
},
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
displayName: 'Mobile',
|
|
1676
|
+
name: 'isMobileDashboard',
|
|
1677
|
+
type: 'boolean',
|
|
1678
|
+
default: false,
|
|
1679
|
+
description: 'Whether to exclude dashboards that are hidden for mobile',
|
|
1680
|
+
displayOptions: {
|
|
1681
|
+
show: { resource: ['dashboard'], operation: ['getDashboards', 'getUserDashboards'] },
|
|
1682
|
+
},
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
displayName: 'Dashboard Operation',
|
|
1686
|
+
name: 'dashboardOperation',
|
|
1687
|
+
type: 'string',
|
|
1688
|
+
default: '',
|
|
1689
|
+
description: 'Filter by allowed operations for the current user',
|
|
1690
|
+
displayOptions: { show: { resource: ['dashboard'], operation: ['getUserDashboards'] } },
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
displayName: 'User ID',
|
|
1694
|
+
name: 'userId',
|
|
1695
|
+
type: 'string',
|
|
1696
|
+
default: '',
|
|
1697
|
+
description: 'A string value representing the user ID. For example, "784f394c-42b6-435a-983c-b7beff2784f9".',
|
|
1698
|
+
displayOptions: { show: { resource: ['dashboard'], operation: ['getUserDashboards'] } },
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
displayName: 'Include Customers',
|
|
1702
|
+
name: 'includeCustomers',
|
|
1703
|
+
type: 'boolean',
|
|
1704
|
+
default: false,
|
|
1705
|
+
description: 'Whether to include customer or sub-customer entities',
|
|
1706
|
+
displayOptions: { show: { resource: ['dashboard'], operation: ['getCustomerDashboards'] } },
|
|
1707
|
+
},
|
|
1708
|
+
],
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
async execute() {
|
|
1712
|
+
const items = this.getInputData();
|
|
1713
|
+
const results = [];
|
|
1714
|
+
for (let i = 0; i < items.length; i++) {
|
|
1715
|
+
try {
|
|
1716
|
+
const resource = this.getNodeParameter('resource', i);
|
|
1717
|
+
const operation = this.getNodeParameter('operation', i);
|
|
1718
|
+
const credentials = await (0, requestHandler_1.getThingsBoardCredentials)(this);
|
|
1719
|
+
const baseUrl = credentials.baseUrl;
|
|
1720
|
+
const token = await (0, requestHandler_1.getAccessToken)(this);
|
|
1721
|
+
(0, requestHandler_1.checkEditionSupport)(this, resource, operation, PE_ONLY_OPERATIONS);
|
|
1722
|
+
const context = {
|
|
1723
|
+
executeFunctions: this,
|
|
1724
|
+
itemIndex: i,
|
|
1725
|
+
baseUrl,
|
|
1726
|
+
token,
|
|
1727
|
+
};
|
|
1728
|
+
const handler = resourceRegistry_1.ResourceRegistry.getHandler(resource);
|
|
1729
|
+
const result = await handler.execute(context, operation);
|
|
1730
|
+
results.push({ json: result });
|
|
1731
|
+
}
|
|
1732
|
+
catch (error) {
|
|
1733
|
+
if (this.continueOnFail()) {
|
|
1734
|
+
results.push({
|
|
1735
|
+
json: { error: error.message },
|
|
1736
|
+
pairedItem: { item: i },
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
else {
|
|
1740
|
+
throw error;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
return [results];
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
exports.ThingsBoard = ThingsBoard;
|
|
1748
|
+
//# sourceMappingURL=ThingsBoard.node.js.map
|