@phystack/hub-device 4.3.40-dev
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/.prettierignore +10 -0
- package/.prettierrc +10 -0
- package/CHANGELOG.md +1202 -0
- package/README.md +12 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +967 -0
- package/dist/index.js.map +1 -0
- package/dist/storage/browser.d.ts +2 -0
- package/dist/storage/browser.d.ts.map +1 -0
- package/dist/storage/browser.js +20 -0
- package/dist/storage/browser.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +31 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/node.d.ts +2 -0
- package/dist/storage/node.d.ts.map +1 -0
- package/dist/storage/node.js +47 -0
- package/dist/storage/node.js.map +1 -0
- package/dist/sysinfo/browser.d.ts +3 -0
- package/dist/sysinfo/browser.d.ts.map +1 -0
- package/dist/sysinfo/browser.js +194 -0
- package/dist/sysinfo/browser.js.map +1 -0
- package/dist/sysinfo/index.d.ts +3 -0
- package/dist/sysinfo/index.d.ts.map +1 -0
- package/dist/sysinfo/index.js +34 -0
- package/dist/sysinfo/index.js.map +1 -0
- package/dist/sysinfo/node.d.ts +3 -0
- package/dist/sysinfo/node.d.ts.map +1 -0
- package/dist/sysinfo/node.js +53 -0
- package/dist/sysinfo/node.js.map +1 -0
- package/dist/sysinfo/tizen.d.ts +8 -0
- package/dist/sysinfo/tizen.d.ts.map +1 -0
- package/dist/sysinfo/tizen.js +168 -0
- package/dist/sysinfo/tizen.js.map +1 -0
- package/dist/types/command.types.d.ts +8 -0
- package/dist/types/command.types.d.ts.map +1 -0
- package/dist/types/command.types.js +8 -0
- package/dist/types/command.types.js.map +1 -0
- package/dist/types/container.types.d.ts +10 -0
- package/dist/types/container.types.d.ts.map +1 -0
- package/dist/types/container.types.js +3 -0
- package/dist/types/container.types.js.map +1 -0
- package/dist/types/job.types.d.ts +31 -0
- package/dist/types/job.types.d.ts.map +1 -0
- package/dist/types/job.types.js +15 -0
- package/dist/types/job.types.js.map +1 -0
- package/dist/types/twin.types.d.ts +653 -0
- package/dist/types/twin.types.d.ts.map +1 -0
- package/dist/types/twin.types.js +21 -0
- package/dist/types/twin.types.js.map +1 -0
- package/dist/utilities/get-device-identifier.utility.d.ts +2 -0
- package/dist/utilities/get-device-identifier.utility.d.ts.map +1 -0
- package/dist/utilities/get-device-identifier.utility.js +140 -0
- package/dist/utilities/get-device-identifier.utility.js.map +1 -0
- package/dist/utilities/get-hub-credentials.utility.d.ts +8 -0
- package/dist/utilities/get-hub-credentials.utility.d.ts.map +1 -0
- package/dist/utilities/get-hub-credentials.utility.js +47 -0
- package/dist/utilities/get-hub-credentials.utility.js.map +1 -0
- package/dist/utilities/get-provisioning-code.utility.d.ts +3 -0
- package/dist/utilities/get-provisioning-code.utility.d.ts.map +1 -0
- package/dist/utilities/get-provisioning-code.utility.js +49 -0
- package/dist/utilities/get-provisioning-code.utility.js.map +1 -0
- package/package.json +39 -0
- package/src/hub-device.d.ts +0 -0
- package/src/index.ts +1228 -0
- package/src/storage/browser.ts +16 -0
- package/src/storage/index.ts +46 -0
- package/src/storage/node.ts +42 -0
- package/src/sysinfo/browser.ts +217 -0
- package/src/sysinfo/index.ts +29 -0
- package/src/sysinfo/node.ts +387 -0
- package/src/sysinfo/tizen.ts +203 -0
- package/src/types/command.types.ts +8 -0
- package/src/types/container.types.ts +12 -0
- package/src/types/job.types.ts +36 -0
- package/src/types/twin.types.ts +751 -0
- package/src/utilities/get-device-identifier.utility.ts +179 -0
- package/src/utilities/get-hub-credentials.utility.ts +56 -0
- package/src/utilities/get-provisioning-code.utility.ts +55 -0
- package/tsconfig.json +45 -0
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
import { Job } from './job.types';
|
|
2
|
+
|
|
3
|
+
export enum TwinTypeEnum {
|
|
4
|
+
Device = 'Device',
|
|
5
|
+
Screen = 'Screen',
|
|
6
|
+
Edge = 'Edge',
|
|
7
|
+
Cloud = 'Cloud',
|
|
8
|
+
Web = 'Web',
|
|
9
|
+
Peripheral = 'Peripheral'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum TwinStatusEnum {
|
|
13
|
+
Offline = 'Offline',
|
|
14
|
+
Online = 'Online',
|
|
15
|
+
Starting = 'Starting',
|
|
16
|
+
Exited = 'Exited',
|
|
17
|
+
ImageNotFound = 'ImageNotFound',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface WifiNetwork {
|
|
21
|
+
ssid: string;
|
|
22
|
+
bssid: string;
|
|
23
|
+
mode?: string;
|
|
24
|
+
channel: number;
|
|
25
|
+
frequency: number;
|
|
26
|
+
signalLevel: number;
|
|
27
|
+
quality: number;
|
|
28
|
+
security: string[];
|
|
29
|
+
wpaFlags?: string[];
|
|
30
|
+
rsnFlags?: string[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface WifiConnection {
|
|
34
|
+
id: string;
|
|
35
|
+
iface: string;
|
|
36
|
+
model: string;
|
|
37
|
+
ssid: string;
|
|
38
|
+
bssid?: string;
|
|
39
|
+
channel: number;
|
|
40
|
+
frequency: number;
|
|
41
|
+
type: string;
|
|
42
|
+
security: string[];
|
|
43
|
+
signalLevel: number;
|
|
44
|
+
quality: number;
|
|
45
|
+
txRate: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface Baseboard {
|
|
49
|
+
manufacturer: string;
|
|
50
|
+
model: string;
|
|
51
|
+
version: string;
|
|
52
|
+
serial: string;
|
|
53
|
+
assetTag: string;
|
|
54
|
+
memMax: number;
|
|
55
|
+
memSlots: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface Battery {
|
|
59
|
+
hasBattery: boolean;
|
|
60
|
+
cycleCount: number;
|
|
61
|
+
isCharging: boolean;
|
|
62
|
+
designedCapacity: number;
|
|
63
|
+
maxCapacity: number;
|
|
64
|
+
currentCapacity: number;
|
|
65
|
+
voltage: number;
|
|
66
|
+
capacityUnit: string;
|
|
67
|
+
percent: number;
|
|
68
|
+
timeRemaining: number;
|
|
69
|
+
acConnected: boolean;
|
|
70
|
+
type: string;
|
|
71
|
+
model: string;
|
|
72
|
+
manufacturer: string;
|
|
73
|
+
serial: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface GraphicsController {
|
|
77
|
+
vendor: string;
|
|
78
|
+
model: string;
|
|
79
|
+
bus: string;
|
|
80
|
+
vramDynamic: boolean;
|
|
81
|
+
vram: number | null;
|
|
82
|
+
deviceId: string;
|
|
83
|
+
vendorId: string;
|
|
84
|
+
external: boolean;
|
|
85
|
+
cores: string;
|
|
86
|
+
metalVersion: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Display {
|
|
90
|
+
vendor: string;
|
|
91
|
+
vendorId: string;
|
|
92
|
+
model: string;
|
|
93
|
+
productionYear: string;
|
|
94
|
+
serial: string;
|
|
95
|
+
displayId: string;
|
|
96
|
+
main: boolean;
|
|
97
|
+
builtin: boolean;
|
|
98
|
+
connection: string | null;
|
|
99
|
+
sizeX: number | null;
|
|
100
|
+
sizeY: number | null;
|
|
101
|
+
pixelDepth: number | null;
|
|
102
|
+
resolutionX: number;
|
|
103
|
+
resolutionY: number;
|
|
104
|
+
currentResX: number;
|
|
105
|
+
currentResY: number;
|
|
106
|
+
positionX: number;
|
|
107
|
+
positionY: number;
|
|
108
|
+
currentRefreshRate: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface Graphics {
|
|
112
|
+
controllers: GraphicsController[];
|
|
113
|
+
displays: Display[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface Chassis {
|
|
117
|
+
manufacturer: string;
|
|
118
|
+
model: string;
|
|
119
|
+
type: string;
|
|
120
|
+
version: string;
|
|
121
|
+
serial: string;
|
|
122
|
+
assetTag: string;
|
|
123
|
+
sku: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface Bios {
|
|
127
|
+
vendor: string;
|
|
128
|
+
version: string;
|
|
129
|
+
releaseDate: string;
|
|
130
|
+
revision: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface Cache {
|
|
134
|
+
l1d: number;
|
|
135
|
+
l1i: number;
|
|
136
|
+
l2: number;
|
|
137
|
+
l3: number | null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface CPU {
|
|
141
|
+
manufacturer: string;
|
|
142
|
+
brand: string;
|
|
143
|
+
vendor: string;
|
|
144
|
+
family: string;
|
|
145
|
+
model: string;
|
|
146
|
+
stepping: string;
|
|
147
|
+
revision: string;
|
|
148
|
+
voltage: string;
|
|
149
|
+
speed: number;
|
|
150
|
+
speedMin: number;
|
|
151
|
+
speedMax: number;
|
|
152
|
+
governor: string;
|
|
153
|
+
cores: number;
|
|
154
|
+
physicalCores: number;
|
|
155
|
+
performanceCores: number;
|
|
156
|
+
efficiencyCores: number;
|
|
157
|
+
processors: number;
|
|
158
|
+
socket: string;
|
|
159
|
+
flags: string;
|
|
160
|
+
virtualization: boolean;
|
|
161
|
+
cache: Cache;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface Memory {
|
|
165
|
+
total: number;
|
|
166
|
+
free: number;
|
|
167
|
+
used: number;
|
|
168
|
+
active: number;
|
|
169
|
+
available: number;
|
|
170
|
+
buffers: number;
|
|
171
|
+
cached: number;
|
|
172
|
+
slab: number;
|
|
173
|
+
buffcache: number;
|
|
174
|
+
swaptotal: number;
|
|
175
|
+
swapused: number;
|
|
176
|
+
swapfree: number;
|
|
177
|
+
writeback: number | null;
|
|
178
|
+
dirty: number | null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface CpuCurrentSpeed {
|
|
182
|
+
min: number;
|
|
183
|
+
max: number;
|
|
184
|
+
avg: number;
|
|
185
|
+
cores: number[];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface CPUUsage {
|
|
189
|
+
load: number;
|
|
190
|
+
loadUser: number;
|
|
191
|
+
loadSystem: number;
|
|
192
|
+
loadNice: number;
|
|
193
|
+
loadIdle: number;
|
|
194
|
+
loadIrq: number;
|
|
195
|
+
loadSteal: number;
|
|
196
|
+
loadGuest: number;
|
|
197
|
+
rawLoad: number;
|
|
198
|
+
rawLoadUser: number;
|
|
199
|
+
rawLoadSystem: number;
|
|
200
|
+
rawLoadNice: number;
|
|
201
|
+
rawLoadIdle: number;
|
|
202
|
+
rawLoadIrq: number;
|
|
203
|
+
rawLoadSteal: number;
|
|
204
|
+
rawLoadGuest: number;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface CurrentLoad {
|
|
208
|
+
avgLoad: number;
|
|
209
|
+
currentLoad: number;
|
|
210
|
+
currentLoadUser: number;
|
|
211
|
+
currentLoadSystem: number;
|
|
212
|
+
currentLoadNice: number;
|
|
213
|
+
currentLoadIdle: number;
|
|
214
|
+
currentLoadIrq: number;
|
|
215
|
+
currentLoadSteal: number;
|
|
216
|
+
currentLoadGuest: number;
|
|
217
|
+
rawCurrentLoad: number;
|
|
218
|
+
rawCurrentLoadUser: number;
|
|
219
|
+
rawCurrentLoadSystem: number;
|
|
220
|
+
rawCurrentLoadNice: number;
|
|
221
|
+
rawCurrentLoadIdle: number;
|
|
222
|
+
rawCurrentLoadIrq: number;
|
|
223
|
+
rawCurrentLoadSteal: number;
|
|
224
|
+
rawCurrentLoadGuest: number;
|
|
225
|
+
cpus: CPUUsage[];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface NetworkInterface {
|
|
229
|
+
iface: string;
|
|
230
|
+
ifaceName: string;
|
|
231
|
+
default: boolean;
|
|
232
|
+
ip4: string;
|
|
233
|
+
ip4subnet: string;
|
|
234
|
+
ip6: string;
|
|
235
|
+
ip6subnet: string;
|
|
236
|
+
mac: string;
|
|
237
|
+
internal: boolean;
|
|
238
|
+
virtual: boolean;
|
|
239
|
+
operstate: string;
|
|
240
|
+
type: string;
|
|
241
|
+
duplex: string;
|
|
242
|
+
mtu: number;
|
|
243
|
+
speed: number | null;
|
|
244
|
+
dhcp: boolean;
|
|
245
|
+
dnsSuffix: string;
|
|
246
|
+
ieee8021xAuth: string;
|
|
247
|
+
ieee8021xState: string;
|
|
248
|
+
carrierChanges: number;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface WifiInterface {
|
|
252
|
+
iface: string;
|
|
253
|
+
id: string;
|
|
254
|
+
model: boolean;
|
|
255
|
+
vendor: string;
|
|
256
|
+
mac: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface NetworkStats {
|
|
260
|
+
iface: string;
|
|
261
|
+
operstate: string;
|
|
262
|
+
rx_bytes: number;
|
|
263
|
+
rx_dropped: number;
|
|
264
|
+
rx_errors: number;
|
|
265
|
+
tx_bytes: number;
|
|
266
|
+
tx_dropped: number;
|
|
267
|
+
tx_errors: number;
|
|
268
|
+
rx_sec: number;
|
|
269
|
+
tx_sec: number;
|
|
270
|
+
ms: number;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface MemLayout {
|
|
274
|
+
size: number;
|
|
275
|
+
bank: string;
|
|
276
|
+
type: string;
|
|
277
|
+
ecc: boolean;
|
|
278
|
+
clockSpeed: number;
|
|
279
|
+
formFactor: string;
|
|
280
|
+
manufacturer: string;
|
|
281
|
+
partNum: string;
|
|
282
|
+
serialNum: string;
|
|
283
|
+
voltageConfigured: number | null;
|
|
284
|
+
voltageMin: number | null;
|
|
285
|
+
voltageMax: number | null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface FsSize {
|
|
289
|
+
fs: string;
|
|
290
|
+
type: string;
|
|
291
|
+
size: number;
|
|
292
|
+
used: number;
|
|
293
|
+
available: number;
|
|
294
|
+
use: number;
|
|
295
|
+
mount: string;
|
|
296
|
+
rw: boolean;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface FsStats {
|
|
300
|
+
rx: number;
|
|
301
|
+
wx: number;
|
|
302
|
+
tx: number;
|
|
303
|
+
rx_sec: number;
|
|
304
|
+
wx_sec: number;
|
|
305
|
+
tx_sec: number;
|
|
306
|
+
ms: number;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface UUID {
|
|
310
|
+
os: string;
|
|
311
|
+
hardware: string;
|
|
312
|
+
macs: string[];
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface TimeStatus {
|
|
316
|
+
current: number;
|
|
317
|
+
uptime: number;
|
|
318
|
+
timezone: string;
|
|
319
|
+
timezoneName: string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface System {
|
|
323
|
+
manufacturer: string;
|
|
324
|
+
model: string;
|
|
325
|
+
version: string;
|
|
326
|
+
serial: string;
|
|
327
|
+
uuid: string;
|
|
328
|
+
sku: string;
|
|
329
|
+
virtual: boolean;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface DeviceTwinReportedProperties {
|
|
333
|
+
ip: DeviceIp[];
|
|
334
|
+
os: {
|
|
335
|
+
osVersion: string;
|
|
336
|
+
};
|
|
337
|
+
env: {
|
|
338
|
+
gridEnv: string;
|
|
339
|
+
};
|
|
340
|
+
phydeviceVersion: string;
|
|
341
|
+
baseboard: Baseboard;
|
|
342
|
+
battery: Battery;
|
|
343
|
+
graphics: Graphics;
|
|
344
|
+
chassis: Chassis;
|
|
345
|
+
bios: Bios;
|
|
346
|
+
cpu: CPU;
|
|
347
|
+
mem: Memory;
|
|
348
|
+
inetLatency: number;
|
|
349
|
+
cpuCurrentSpeed: CpuCurrentSpeed;
|
|
350
|
+
currentLoad: CurrentLoad;
|
|
351
|
+
networkInterfaces: NetworkInterface[];
|
|
352
|
+
wifiInterfaces: WifiInterface[];
|
|
353
|
+
networkStats: NetworkStats[];
|
|
354
|
+
memLayout: MemLayout[];
|
|
355
|
+
fsSize: FsSize[];
|
|
356
|
+
fsStats: FsStats;
|
|
357
|
+
wifiNetworks: WifiNetwork[];
|
|
358
|
+
wifiConnections: WifiConnection[];
|
|
359
|
+
uuid: UUID;
|
|
360
|
+
time: TimeStatus;
|
|
361
|
+
users: any[]; // todo: update
|
|
362
|
+
system: System;
|
|
363
|
+
jobs: Job[];
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export interface EdgeTwinReportedProperties {
|
|
367
|
+
lastError?: {
|
|
368
|
+
message: string;
|
|
369
|
+
errorObject: Object;
|
|
370
|
+
timestamp: Date;
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface ScreenTwinReportedProperties {
|
|
375
|
+
screenshot?: string;
|
|
376
|
+
sound?: Record<string, string>;
|
|
377
|
+
crash?: {
|
|
378
|
+
count?: number;
|
|
379
|
+
reason?: string;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
interface TwinCreatePayloadBase {
|
|
384
|
+
deviceId: string;
|
|
385
|
+
tenantId: string;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export interface DeviceTwinCreatePayload extends TwinCreatePayloadBase {
|
|
389
|
+
displayName: string;
|
|
390
|
+
accessKey: string;
|
|
391
|
+
env: string;
|
|
392
|
+
spaceId: string;
|
|
393
|
+
serialNumber: string;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface TwinDocumentBase extends Document {
|
|
397
|
+
deviceId: string;
|
|
398
|
+
tenantId: string;
|
|
399
|
+
type: TwinTypeEnum;
|
|
400
|
+
isDeleted: boolean;
|
|
401
|
+
properties: unknown;
|
|
402
|
+
version: number;
|
|
403
|
+
createdAt: Date;
|
|
404
|
+
updatedAt: Date;
|
|
405
|
+
lastStatusUpdatedAt: Date;
|
|
406
|
+
status: TwinStatusEnum;
|
|
407
|
+
notes: string;
|
|
408
|
+
deletedAt?: Date;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface ScreenTwinDesiredProperties {
|
|
412
|
+
url: string;
|
|
413
|
+
screenResolution: string;
|
|
414
|
+
soundOutput: string;
|
|
415
|
+
soundInput: string;
|
|
416
|
+
scale: string;
|
|
417
|
+
screenOrientation: string;
|
|
418
|
+
enableDebug: boolean;
|
|
419
|
+
installationId: string;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export interface ScreenTwinDesiredPropertiesResponse {
|
|
423
|
+
url: string;
|
|
424
|
+
screenResolution: string;
|
|
425
|
+
soundOutput: string;
|
|
426
|
+
soundInput: string;
|
|
427
|
+
scale: string;
|
|
428
|
+
screenOrientation: string;
|
|
429
|
+
enableDebug: boolean;
|
|
430
|
+
installationId: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface EdgeTwinDesiredProperties {
|
|
434
|
+
image: string;
|
|
435
|
+
containerCreateOptions: Record<string, any>;
|
|
436
|
+
credentials: {
|
|
437
|
+
address: string;
|
|
438
|
+
username?: string;
|
|
439
|
+
password?: string;
|
|
440
|
+
};
|
|
441
|
+
installationId: string;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export interface EdgeTwinDesiredPropertiesResponse {
|
|
445
|
+
image: string;
|
|
446
|
+
containerCreateOptions: Record<string, any>;
|
|
447
|
+
credentials: {
|
|
448
|
+
address: string;
|
|
449
|
+
username?: string;
|
|
450
|
+
password?: string;
|
|
451
|
+
};
|
|
452
|
+
installationId: string;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
export interface CloudTwinDesiredProperties {
|
|
456
|
+
installationId: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface CloudTwinDesiredPropertiesResponse {
|
|
460
|
+
installationId: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface WebTwinDesiredProperties {
|
|
464
|
+
installationId: string;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export interface WebTwinDesiredPropertiesResponse {
|
|
468
|
+
installationId: string;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface DeviceTwinDesiredProperties {
|
|
472
|
+
spaceId: string;
|
|
473
|
+
env: string;
|
|
474
|
+
displayName: string;
|
|
475
|
+
deviceSerial: string;
|
|
476
|
+
externalId?: string;
|
|
477
|
+
accessKey: string;
|
|
478
|
+
jobs?: Job[];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface DeviceTwinDesiredPropertiesResponse {
|
|
482
|
+
spaceId: string;
|
|
483
|
+
env: string;
|
|
484
|
+
displayName: string;
|
|
485
|
+
deviceSerial: string;
|
|
486
|
+
externalId?: string;
|
|
487
|
+
accessKey: string;
|
|
488
|
+
jobs: Job[];
|
|
489
|
+
timezone?: string;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
interface ScreenTwinDocument extends TwinDocumentBase {
|
|
493
|
+
type: TwinTypeEnum.Screen;
|
|
494
|
+
properties: {
|
|
495
|
+
desired: ScreenTwinDesiredProperties;
|
|
496
|
+
reported: ScreenTwinReportedProperties;
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
interface EdgeTwinDocument extends TwinDocumentBase {
|
|
501
|
+
type: TwinTypeEnum.Edge;
|
|
502
|
+
properties: {
|
|
503
|
+
desired: EdgeTwinDesiredProperties;
|
|
504
|
+
reported: EdgeTwinReportedProperties;
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
interface CloudTwinDocument extends TwinDocumentBase {
|
|
509
|
+
type: TwinTypeEnum.Cloud;
|
|
510
|
+
properties: {
|
|
511
|
+
desired: CloudTwinDesiredProperties;
|
|
512
|
+
reported: Record<string, any>;
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
interface WebTwinDocument extends TwinDocumentBase {
|
|
517
|
+
type: TwinTypeEnum.Web;
|
|
518
|
+
properties: {
|
|
519
|
+
desired: WebTwinDesiredProperties;
|
|
520
|
+
reported: Record<string, any>;
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
interface DeviceTwinDocument extends TwinDocumentBase {
|
|
525
|
+
type: TwinTypeEnum.Device;
|
|
526
|
+
properties: {
|
|
527
|
+
desired: DeviceTwinDesiredProperties;
|
|
528
|
+
reported: DeviceTwinReportedProperties;
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export type TwinDocument =
|
|
533
|
+
| ScreenTwinDocument
|
|
534
|
+
| EdgeTwinDocument
|
|
535
|
+
| CloudTwinDocument
|
|
536
|
+
| WebTwinDocument
|
|
537
|
+
| DeviceTwinDocument;
|
|
538
|
+
|
|
539
|
+
interface TwinResponseBase {
|
|
540
|
+
id: string;
|
|
541
|
+
deviceId: string;
|
|
542
|
+
tenantId: string;
|
|
543
|
+
type: unknown;
|
|
544
|
+
version: number;
|
|
545
|
+
status: TwinStatusEnum;
|
|
546
|
+
notes: string;
|
|
547
|
+
createdAt: Date;
|
|
548
|
+
updatedAt: Date;
|
|
549
|
+
lastStatusUpdatedAt: Date;
|
|
550
|
+
properties: unknown;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export interface ScreenTwinResponse extends TwinResponseBase {
|
|
554
|
+
type: TwinTypeEnum.Screen;
|
|
555
|
+
properties: {
|
|
556
|
+
reported: ScreenTwinReportedProperties;
|
|
557
|
+
desired: ScreenTwinDesiredPropertiesResponse;
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export interface EdgeTwinResponse extends TwinResponseBase {
|
|
562
|
+
type: TwinTypeEnum.Edge;
|
|
563
|
+
properties: {
|
|
564
|
+
reported: EdgeTwinReportedProperties;
|
|
565
|
+
desired: EdgeTwinDesiredPropertiesResponse;
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export interface CloudTwinResponse extends TwinResponseBase {
|
|
570
|
+
type: TwinTypeEnum.Cloud;
|
|
571
|
+
properties: {
|
|
572
|
+
reported: Record<string, any>;
|
|
573
|
+
desired: CloudTwinDesiredPropertiesResponse;
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export interface WebTwinResponse extends TwinResponseBase {
|
|
578
|
+
type: TwinTypeEnum.Web;
|
|
579
|
+
properties: {
|
|
580
|
+
reported: Record<string, any>;
|
|
581
|
+
desired: WebTwinDesiredPropertiesResponse;
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export interface DeviceTwinResponse extends TwinResponseBase {
|
|
586
|
+
type: TwinTypeEnum.Device;
|
|
587
|
+
properties: {
|
|
588
|
+
reported: DeviceTwinReportedProperties;
|
|
589
|
+
desired: DeviceTwinDesiredPropertiesResponse;
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export interface PeripheralTwinResponse extends TwinResponseBase {
|
|
594
|
+
type: TwinTypeEnum.Peripheral;
|
|
595
|
+
instanceId: string;
|
|
596
|
+
properties: {
|
|
597
|
+
reported: PeripheralTwinReportedProperties;
|
|
598
|
+
desired: Record<string, any>;
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export type TwinResponse =
|
|
603
|
+
| DeviceTwinResponse
|
|
604
|
+
| ScreenTwinResponse
|
|
605
|
+
| EdgeTwinResponse
|
|
606
|
+
| CloudTwinResponse
|
|
607
|
+
| WebTwinResponse
|
|
608
|
+
| PeripheralTwinResponse;
|
|
609
|
+
|
|
610
|
+
export type TwinDesiredPropertiesResponse =
|
|
611
|
+
| DeviceTwinDesiredPropertiesResponse
|
|
612
|
+
| ScreenTwinDesiredPropertiesResponse
|
|
613
|
+
| EdgeTwinDesiredPropertiesResponse
|
|
614
|
+
| CloudTwinDesiredPropertiesResponse
|
|
615
|
+
| WebTwinDesiredPropertiesResponse;
|
|
616
|
+
|
|
617
|
+
interface TwinCreateDocumentBase {
|
|
618
|
+
deviceId: string;
|
|
619
|
+
tenantId: string;
|
|
620
|
+
type: unknown;
|
|
621
|
+
properties: {
|
|
622
|
+
desired: unknown;
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export interface DeviceTwinCreateDocument extends TwinCreateDocumentBase {
|
|
627
|
+
type: TwinTypeEnum.Device;
|
|
628
|
+
properties: {
|
|
629
|
+
desired: DeviceTwinDesiredProperties;
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export interface ScreenTwinCreateDocument extends TwinCreateDocumentBase {
|
|
634
|
+
type: TwinTypeEnum.Screen;
|
|
635
|
+
properties: {
|
|
636
|
+
desired: ScreenTwinDesiredProperties;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export interface EdgeTwinCreateDocument extends TwinCreateDocumentBase {
|
|
641
|
+
type: TwinTypeEnum.Edge;
|
|
642
|
+
properties: {
|
|
643
|
+
desired: EdgeTwinDesiredProperties;
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
export type TwinCreateDocument =
|
|
648
|
+
| DeviceTwinCreateDocument
|
|
649
|
+
| ScreenTwinCreateDocument
|
|
650
|
+
| EdgeTwinCreateDocument;
|
|
651
|
+
|
|
652
|
+
export interface TwinsGroupedByDeviceId {
|
|
653
|
+
_id: string;
|
|
654
|
+
twins: TwinDocument[];
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export interface TwinsGroupedByDeviceIdResponse {
|
|
658
|
+
_id: string;
|
|
659
|
+
twins: TwinResponse[];
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export type InstanceTwinReportedProperties =
|
|
663
|
+
| EdgeTwinReportedProperties
|
|
664
|
+
| DeviceTwinReportedProperties
|
|
665
|
+
| ScreenTwinReportedProperties;
|
|
666
|
+
|
|
667
|
+
export interface DeviceTwinUpdatePayload {
|
|
668
|
+
spaceId?: string;
|
|
669
|
+
env?: string;
|
|
670
|
+
displayName?: string;
|
|
671
|
+
notes?: string;
|
|
672
|
+
jobs?: Job[];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export interface DeviceTwinDesiredPropertiesUpdatePayload {
|
|
676
|
+
spaceId?: string;
|
|
677
|
+
env?: string;
|
|
678
|
+
displayName?: string;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export interface ScreenTwinDesiredPropertiesUpdatePayload {
|
|
682
|
+
screenResolution?: string;
|
|
683
|
+
soundOutput?: string;
|
|
684
|
+
soundInput?: string;
|
|
685
|
+
scale?: string;
|
|
686
|
+
screenOrientation?: string;
|
|
687
|
+
enableDebug?: string;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export interface DeviceTwinUpdateDocument {
|
|
691
|
+
status?: TwinStatusEnum;
|
|
692
|
+
lastStatusUpdatedAt?: Date;
|
|
693
|
+
notes?: string;
|
|
694
|
+
properties?: {
|
|
695
|
+
reported?: DeviceTwinReportedProperties;
|
|
696
|
+
desired?: DeviceTwinDesiredPropertiesUpdatePayload;
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export type InstanceTwinDesiredProperties =
|
|
701
|
+
| ScreenTwinDesiredPropertiesUpdatePayload
|
|
702
|
+
| DeviceTwinDesiredPropertiesUpdatePayload;
|
|
703
|
+
|
|
704
|
+
export interface InstanceTwinUpdateDocument {
|
|
705
|
+
status?: TwinStatusEnum;
|
|
706
|
+
lastStatusUpdatedAt?: Date;
|
|
707
|
+
properties?: {
|
|
708
|
+
reported?: InstanceTwinReportedProperties;
|
|
709
|
+
desired?: InstanceTwinDesiredProperties;
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
export type TwinUpdateDocument = DeviceTwinUpdateDocument | InstanceTwinUpdateDocument;
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
export interface DeviceIp {
|
|
717
|
+
interface: string;
|
|
718
|
+
ipv4: string;
|
|
719
|
+
ipv6: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export interface DeviceStatus {
|
|
723
|
+
deviceId: string;
|
|
724
|
+
accessKey: string;
|
|
725
|
+
deviceSerial: string;
|
|
726
|
+
gridEnv: string;
|
|
727
|
+
osVersion: string;
|
|
728
|
+
ip: DeviceIp[];
|
|
729
|
+
provisioningCode: string;
|
|
730
|
+
displayName: string;
|
|
731
|
+
deviceEnv: string;
|
|
732
|
+
spaceId: string;
|
|
733
|
+
tenantId: string;
|
|
734
|
+
dataResidency: string;
|
|
735
|
+
socketConnected: boolean;
|
|
736
|
+
socketAuthenticated: boolean;
|
|
737
|
+
twins: Record<string, string[]>;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export interface PeripheralTwinReportedProperties {
|
|
741
|
+
lastError?: {
|
|
742
|
+
message: string;
|
|
743
|
+
errorObject?: Object;
|
|
744
|
+
timestamp: Date;
|
|
745
|
+
};
|
|
746
|
+
status?: {
|
|
747
|
+
connected: boolean;
|
|
748
|
+
lastConnected?: Date;
|
|
749
|
+
metadata?: Record<string, any>;
|
|
750
|
+
};
|
|
751
|
+
}
|