@juhuu/sdk-ts 1.2.182 → 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 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
  /**
@@ -466,11 +455,6 @@ type GraphNode = {
466
455
  nodeIdArray: string[];
467
456
  parameterName: string;
468
457
  value: number | string | boolean;
469
- } | {
470
- id: string;
471
- type: "command.execute";
472
- nodeIdArray: string[];
473
- commandName: string;
474
458
  } | {
475
459
  id: string;
476
460
  type: "flow.exception";
@@ -601,6 +585,7 @@ declare class SessionService extends Service {
601
585
  attachUser(SessionAttachUserParams: JUHUU.Session.AttachUser.Params, SessionAttachUserOptions?: JUHUU.Session.AttachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.AttachUser.Response>>;
602
586
  detachUser(SessionDetachUserParams: JUHUU.Session.DetachUser.Params, SessionDetachUserOptions?: JUHUU.Session.DetachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.DetachUser.Response>>;
603
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;
604
589
  }
605
590
 
606
591
  declare class LinkService extends Service {
@@ -668,7 +653,6 @@ declare class DevicesService extends Service {
668
653
  list(DeviceListParams: JUHUU.Device.List.Params, DeviceListOptions?: JUHUU.Device.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.List.Response>>;
669
654
  update(DeviceUpdateParams: JUHUU.Device.Update.Params, DeviceUpdateOptions?: JUHUU.Device.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Update.Response>>;
670
655
  listen(DeviceRealtimeParams: JUHUU.Device.Realtime.Params, DeviceRealtimeOptions?: JUHUU.Device.Realtime.Options): JUHUU.Device.Realtime.Response;
671
- message(DeviceMessageParams: JUHUU.Device.Message.Params, DeviceMessageOptions?: JUHUU.Device.Message.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Message.Response>>;
672
656
  nodeExecute(DeviceNodeExecuteParams: JUHUU.Device.NodeExecute.Params, DeviceNodeExecuteOptions?: JUHUU.Device.NodeExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.NodeExecute.Response>>;
673
657
  delete(DeviceDeleteParams: JUHUU.Device.Delete.Params, DeviceDeleteOptions?: JUHUU.Device.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Delete.Response>>;
674
658
  }
@@ -1195,6 +1179,22 @@ declare namespace JUHUU {
1195
1179
  type Options = JUHUU.RequestOptions;
1196
1180
  type Response = JUHUU.Session.Object;
1197
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
+ }
1198
1198
  export { };
1199
1199
  }
1200
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
  /**
@@ -466,11 +455,6 @@ type GraphNode = {
466
455
  nodeIdArray: string[];
467
456
  parameterName: string;
468
457
  value: number | string | boolean;
469
- } | {
470
- id: string;
471
- type: "command.execute";
472
- nodeIdArray: string[];
473
- commandName: string;
474
458
  } | {
475
459
  id: string;
476
460
  type: "flow.exception";
@@ -601,6 +585,7 @@ declare class SessionService extends Service {
601
585
  attachUser(SessionAttachUserParams: JUHUU.Session.AttachUser.Params, SessionAttachUserOptions?: JUHUU.Session.AttachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.AttachUser.Response>>;
602
586
  detachUser(SessionDetachUserParams: JUHUU.Session.DetachUser.Params, SessionDetachUserOptions?: JUHUU.Session.DetachUser.Options): Promise<JUHUU.HttpResponse<JUHUU.Session.DetachUser.Response>>;
603
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;
604
589
  }
605
590
 
606
591
  declare class LinkService extends Service {
@@ -668,7 +653,6 @@ declare class DevicesService extends Service {
668
653
  list(DeviceListParams: JUHUU.Device.List.Params, DeviceListOptions?: JUHUU.Device.List.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.List.Response>>;
669
654
  update(DeviceUpdateParams: JUHUU.Device.Update.Params, DeviceUpdateOptions?: JUHUU.Device.Update.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Update.Response>>;
670
655
  listen(DeviceRealtimeParams: JUHUU.Device.Realtime.Params, DeviceRealtimeOptions?: JUHUU.Device.Realtime.Options): JUHUU.Device.Realtime.Response;
671
- message(DeviceMessageParams: JUHUU.Device.Message.Params, DeviceMessageOptions?: JUHUU.Device.Message.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Message.Response>>;
672
656
  nodeExecute(DeviceNodeExecuteParams: JUHUU.Device.NodeExecute.Params, DeviceNodeExecuteOptions?: JUHUU.Device.NodeExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.NodeExecute.Response>>;
673
657
  delete(DeviceDeleteParams: JUHUU.Device.Delete.Params, DeviceDeleteOptions?: JUHUU.Device.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Delete.Response>>;
674
658
  }
@@ -1195,6 +1179,22 @@ declare namespace JUHUU {
1195
1179
  type Options = JUHUU.RequestOptions;
1196
1180
  type Response = JUHUU.Session.Object;
1197
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
+ }
1198
1198
  export { };
1199
1199
  }
1200
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
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.2.182",
3
+ "version": "1.2.183",
4
4
  "description": "Typescript wrapper for JUHUU services",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",