@juhuu/sdk-ts 1.2.181 → 1.2.183
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/dist/index.d.mts +28 -17
- package/dist/index.d.ts +28 -17
- package/dist/index.js +17 -13
- package/dist/index.mjs +17 -13
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -366,12 +366,6 @@ type GraphNode = {
|
|
366
366
|
type: "flow.start";
|
367
367
|
trigger: "session.terminate";
|
368
368
|
nodeIdArray: string[];
|
369
|
-
} | {
|
370
|
-
id: string;
|
371
|
-
type: "flow.start";
|
372
|
-
trigger: "command.executed";
|
373
|
-
commandName: string;
|
374
|
-
nodeIdArray: string[];
|
375
369
|
} | {
|
376
370
|
id: string;
|
377
371
|
type: "flow.start";
|
@@ -403,11 +397,6 @@ type GraphNode = {
|
|
403
397
|
type: "open.phone";
|
404
398
|
nodeIdArray: string[];
|
405
399
|
phone: string;
|
406
|
-
} | {
|
407
|
-
id: string;
|
408
|
-
type: "device.message";
|
409
|
-
nodeIdArray: string[];
|
410
|
-
message: string;
|
411
400
|
} | {
|
412
401
|
id: string;
|
413
402
|
/**
|
@@ -451,15 +440,21 @@ type GraphNode = {
|
|
451
440
|
message: LocaleString;
|
452
441
|
} | {
|
453
442
|
id: string;
|
454
|
-
type: "parameter.set";
|
455
443
|
nodeIdArray: string[];
|
456
|
-
|
457
|
-
|
444
|
+
type: "app.alert.show";
|
445
|
+
title: LocaleString;
|
446
|
+
description: LocaleString;
|
458
447
|
} | {
|
459
448
|
id: string;
|
460
|
-
type: "command.execute";
|
461
449
|
nodeIdArray: string[];
|
462
|
-
|
450
|
+
type: "app.navigation.navigate";
|
451
|
+
screenName: string;
|
452
|
+
} | {
|
453
|
+
id: string;
|
454
|
+
type: "parameter.set";
|
455
|
+
nodeIdArray: string[];
|
456
|
+
parameterName: string;
|
457
|
+
value: number | string | boolean;
|
463
458
|
} | {
|
464
459
|
id: string;
|
465
460
|
type: "flow.exception";
|
@@ -590,6 +585,7 @@ declare class SessionService extends Service {
|
|
590
585
|
attachUser(SessionAttachUserParams: JUHUU.Session.AttachUser.Params, SessionAttachUserOptions?: JUHUU.Session.AttachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.AttachUser.Response>>;
|
591
586
|
detachUser(SessionDetachUserParams: JUHUU.Session.DetachUser.Params, SessionDetachUserOptions?: JUHUU.Session.DetachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.DetachUser.Response>>;
|
592
587
|
delete(SessionDeleteUserParams: JUHUU.Session.Delete.Params, SessionDeleteUserOptions?: JUHUU.Session.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.Delete.Response>>;
|
588
|
+
listen(SessionRealtimeParams: JUHUU.Session.Realtime.Params, SessionRealtimeOptions?: JUHUU.Session.Realtime.Options): JUHUU.Session.Realtime.Response;
|
593
589
|
}
|
594
590
|
|
595
591
|
declare class LinkService extends Service {
|
@@ -657,7 +653,6 @@ declare class DevicesService extends Service {
|
|
657
653
|
list(DeviceListParams: JUHUU.Device.List.Params, DeviceListOptions?: JUHUU.Device.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.List.Response>>;
|
658
654
|
update(DeviceUpdateParams: JUHUU.Device.Update.Params, DeviceUpdateOptions?: JUHUU.Device.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Update.Response>>;
|
659
655
|
listen(DeviceRealtimeParams: JUHUU.Device.Realtime.Params, DeviceRealtimeOptions?: JUHUU.Device.Realtime.Options): JUHUU.Device.Realtime.Response;
|
660
|
-
message(DeviceMessageParams: JUHUU.Device.Message.Params, DeviceMessageOptions?: JUHUU.Device.Message.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Message.Response>>;
|
661
656
|
nodeExecute(DeviceNodeExecuteParams: JUHUU.Device.NodeExecute.Params, DeviceNodeExecuteOptions?: JUHUU.Device.NodeExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.NodeExecute.Response>>;
|
662
657
|
delete(DeviceDeleteParams: JUHUU.Device.Delete.Params, DeviceDeleteOptions?: JUHUU.Device.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Delete.Response>>;
|
663
658
|
}
|
@@ -1184,6 +1179,22 @@ declare namespace JUHUU {
|
|
1184
1179
|
type Options = JUHUU.RequestOptions;
|
1185
1180
|
type Response = JUHUU.Session.Object;
|
1186
1181
|
}
|
1182
|
+
export namespace Realtime {
|
1183
|
+
type Params = {
|
1184
|
+
sessionId: string;
|
1185
|
+
};
|
1186
|
+
type Options = JUHUU.RequestOptions;
|
1187
|
+
type Response = {
|
1188
|
+
onUpdated: (callback: (message: {
|
1189
|
+
payload: {
|
1190
|
+
after: JUHUU.Session.Object;
|
1191
|
+
before: JUHUU.Session.Object;
|
1192
|
+
changedFields: string[];
|
1193
|
+
};
|
1194
|
+
}) => void) => void;
|
1195
|
+
close: () => void;
|
1196
|
+
};
|
1197
|
+
}
|
1187
1198
|
export { };
|
1188
1199
|
}
|
1189
1200
|
namespace User {
|
package/dist/index.d.ts
CHANGED
@@ -366,12 +366,6 @@ type GraphNode = {
|
|
366
366
|
type: "flow.start";
|
367
367
|
trigger: "session.terminate";
|
368
368
|
nodeIdArray: string[];
|
369
|
-
} | {
|
370
|
-
id: string;
|
371
|
-
type: "flow.start";
|
372
|
-
trigger: "command.executed";
|
373
|
-
commandName: string;
|
374
|
-
nodeIdArray: string[];
|
375
369
|
} | {
|
376
370
|
id: string;
|
377
371
|
type: "flow.start";
|
@@ -403,11 +397,6 @@ type GraphNode = {
|
|
403
397
|
type: "open.phone";
|
404
398
|
nodeIdArray: string[];
|
405
399
|
phone: string;
|
406
|
-
} | {
|
407
|
-
id: string;
|
408
|
-
type: "device.message";
|
409
|
-
nodeIdArray: string[];
|
410
|
-
message: string;
|
411
400
|
} | {
|
412
401
|
id: string;
|
413
402
|
/**
|
@@ -451,15 +440,21 @@ type GraphNode = {
|
|
451
440
|
message: LocaleString;
|
452
441
|
} | {
|
453
442
|
id: string;
|
454
|
-
type: "parameter.set";
|
455
443
|
nodeIdArray: string[];
|
456
|
-
|
457
|
-
|
444
|
+
type: "app.alert.show";
|
445
|
+
title: LocaleString;
|
446
|
+
description: LocaleString;
|
458
447
|
} | {
|
459
448
|
id: string;
|
460
|
-
type: "command.execute";
|
461
449
|
nodeIdArray: string[];
|
462
|
-
|
450
|
+
type: "app.navigation.navigate";
|
451
|
+
screenName: string;
|
452
|
+
} | {
|
453
|
+
id: string;
|
454
|
+
type: "parameter.set";
|
455
|
+
nodeIdArray: string[];
|
456
|
+
parameterName: string;
|
457
|
+
value: number | string | boolean;
|
463
458
|
} | {
|
464
459
|
id: string;
|
465
460
|
type: "flow.exception";
|
@@ -590,6 +585,7 @@ declare class SessionService extends Service {
|
|
590
585
|
attachUser(SessionAttachUserParams: JUHUU.Session.AttachUser.Params, SessionAttachUserOptions?: JUHUU.Session.AttachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.AttachUser.Response>>;
|
591
586
|
detachUser(SessionDetachUserParams: JUHUU.Session.DetachUser.Params, SessionDetachUserOptions?: JUHUU.Session.DetachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.DetachUser.Response>>;
|
592
587
|
delete(SessionDeleteUserParams: JUHUU.Session.Delete.Params, SessionDeleteUserOptions?: JUHUU.Session.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.Delete.Response>>;
|
588
|
+
listen(SessionRealtimeParams: JUHUU.Session.Realtime.Params, SessionRealtimeOptions?: JUHUU.Session.Realtime.Options): JUHUU.Session.Realtime.Response;
|
593
589
|
}
|
594
590
|
|
595
591
|
declare class LinkService extends Service {
|
@@ -657,7 +653,6 @@ declare class DevicesService extends Service {
|
|
657
653
|
list(DeviceListParams: JUHUU.Device.List.Params, DeviceListOptions?: JUHUU.Device.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.List.Response>>;
|
658
654
|
update(DeviceUpdateParams: JUHUU.Device.Update.Params, DeviceUpdateOptions?: JUHUU.Device.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Update.Response>>;
|
659
655
|
listen(DeviceRealtimeParams: JUHUU.Device.Realtime.Params, DeviceRealtimeOptions?: JUHUU.Device.Realtime.Options): JUHUU.Device.Realtime.Response;
|
660
|
-
message(DeviceMessageParams: JUHUU.Device.Message.Params, DeviceMessageOptions?: JUHUU.Device.Message.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Message.Response>>;
|
661
656
|
nodeExecute(DeviceNodeExecuteParams: JUHUU.Device.NodeExecute.Params, DeviceNodeExecuteOptions?: JUHUU.Device.NodeExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.NodeExecute.Response>>;
|
662
657
|
delete(DeviceDeleteParams: JUHUU.Device.Delete.Params, DeviceDeleteOptions?: JUHUU.Device.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Delete.Response>>;
|
663
658
|
}
|
@@ -1184,6 +1179,22 @@ declare namespace JUHUU {
|
|
1184
1179
|
type Options = JUHUU.RequestOptions;
|
1185
1180
|
type Response = JUHUU.Session.Object;
|
1186
1181
|
}
|
1182
|
+
export namespace Realtime {
|
1183
|
+
type Params = {
|
1184
|
+
sessionId: string;
|
1185
|
+
};
|
1186
|
+
type Options = JUHUU.RequestOptions;
|
1187
|
+
type Response = {
|
1188
|
+
onUpdated: (callback: (message: {
|
1189
|
+
payload: {
|
1190
|
+
after: JUHUU.Session.Object;
|
1191
|
+
before: JUHUU.Session.Object;
|
1192
|
+
changedFields: string[];
|
1193
|
+
};
|
1194
|
+
}) => void) => void;
|
1195
|
+
close: () => void;
|
1196
|
+
};
|
1197
|
+
}
|
1187
1198
|
export { };
|
1188
1199
|
}
|
1189
1200
|
namespace User {
|
package/dist/index.js
CHANGED
@@ -553,6 +553,23 @@ var SessionService = class extends Service {
|
|
553
553
|
SessionDeleteUserOptions
|
554
554
|
);
|
555
555
|
}
|
556
|
+
listen(SessionRealtimeParams, SessionRealtimeOptions) {
|
557
|
+
const socket = super.connectToWebsocket({
|
558
|
+
url: "sessions/" + SessionRealtimeParams.sessionId + "/websocket"
|
559
|
+
});
|
560
|
+
const onUpdated = (onUpdatedCallback) => {
|
561
|
+
socket.on("updated", (message) => {
|
562
|
+
onUpdatedCallback(message);
|
563
|
+
});
|
564
|
+
};
|
565
|
+
return {
|
566
|
+
onUpdated,
|
567
|
+
close: () => {
|
568
|
+
console.log("closing websocket connection");
|
569
|
+
socket.close();
|
570
|
+
}
|
571
|
+
};
|
572
|
+
}
|
556
573
|
};
|
557
574
|
|
558
575
|
// src/links/links.service.ts
|
@@ -1246,19 +1263,6 @@ var DevicesService = class extends Service {
|
|
1246
1263
|
}
|
1247
1264
|
};
|
1248
1265
|
}
|
1249
|
-
async message(DeviceMessageParams, DeviceMessageOptions) {
|
1250
|
-
return await super.sendRequest(
|
1251
|
-
{
|
1252
|
-
method: "POST",
|
1253
|
-
url: "devices/" + DeviceMessageParams.deviceId + "/message",
|
1254
|
-
body: {
|
1255
|
-
message: DeviceMessageParams.message
|
1256
|
-
},
|
1257
|
-
authenticationNotOptional: true
|
1258
|
-
},
|
1259
|
-
DeviceMessageOptions
|
1260
|
-
);
|
1261
|
-
}
|
1262
1266
|
async nodeExecute(DeviceNodeExecuteParams, DeviceNodeExecuteOptions) {
|
1263
1267
|
return await super.sendRequest(
|
1264
1268
|
{
|
package/dist/index.mjs
CHANGED
@@ -509,6 +509,23 @@ var SessionService = class extends Service {
|
|
509
509
|
SessionDeleteUserOptions
|
510
510
|
);
|
511
511
|
}
|
512
|
+
listen(SessionRealtimeParams, SessionRealtimeOptions) {
|
513
|
+
const socket = super.connectToWebsocket({
|
514
|
+
url: "sessions/" + SessionRealtimeParams.sessionId + "/websocket"
|
515
|
+
});
|
516
|
+
const onUpdated = (onUpdatedCallback) => {
|
517
|
+
socket.on("updated", (message) => {
|
518
|
+
onUpdatedCallback(message);
|
519
|
+
});
|
520
|
+
};
|
521
|
+
return {
|
522
|
+
onUpdated,
|
523
|
+
close: () => {
|
524
|
+
console.log("closing websocket connection");
|
525
|
+
socket.close();
|
526
|
+
}
|
527
|
+
};
|
528
|
+
}
|
512
529
|
};
|
513
530
|
|
514
531
|
// src/links/links.service.ts
|
@@ -1202,19 +1219,6 @@ var DevicesService = class extends Service {
|
|
1202
1219
|
}
|
1203
1220
|
};
|
1204
1221
|
}
|
1205
|
-
async message(DeviceMessageParams, DeviceMessageOptions) {
|
1206
|
-
return await super.sendRequest(
|
1207
|
-
{
|
1208
|
-
method: "POST",
|
1209
|
-
url: "devices/" + DeviceMessageParams.deviceId + "/message",
|
1210
|
-
body: {
|
1211
|
-
message: DeviceMessageParams.message
|
1212
|
-
},
|
1213
|
-
authenticationNotOptional: true
|
1214
|
-
},
|
1215
|
-
DeviceMessageOptions
|
1216
|
-
);
|
1217
|
-
}
|
1218
1222
|
async nodeExecute(DeviceNodeExecuteParams, DeviceNodeExecuteOptions) {
|
1219
1223
|
return await super.sendRequest(
|
1220
1224
|
{
|