@xibosignage/xibo-communication-framework 0.0.8 → 0.0.9
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/src/modules/xmr/xmr.d.ts +2 -1
- package/dist/xibo-communication-framework.cjs +4 -1
- package/dist/xibo-communication-framework.cjs.map +1 -1
- package/dist/xibo-communication-framework.d.ts +2 -1
- package/dist/xibo-communication-framework.esm.js +4 -1
- package/dist/xibo-communication-framework.esm.js.map +1 -1
- package/dist/xibo-communication-framework.js +4 -1
- package/dist/xibo-communication-framework.min.js +1 -1
- package/dist/xibo-communication-framework.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ export interface XmrEvents {
|
|
|
17
17
|
dataUpdate: (widgetId: number) => void;
|
|
18
18
|
purgeAll: () => void;
|
|
19
19
|
clearStatsAndLogs: () => void;
|
|
20
|
+
triggerWebhook: (triggerCode: string) => void;
|
|
20
21
|
}
|
|
21
22
|
export default class Xmr {
|
|
22
23
|
emitter: Emitter<XmrEvents>;
|
|
@@ -27,7 +28,7 @@ export default class Xmr {
|
|
|
27
28
|
isConnectionWanted: boolean;
|
|
28
29
|
isConnected: boolean;
|
|
29
30
|
lastMessageAt: DateTime;
|
|
30
|
-
interval:
|
|
31
|
+
interval: ReturnType<typeof setInterval> | null;
|
|
31
32
|
constructor(channel: string);
|
|
32
33
|
on<E extends keyof XmrEvents>(event: E, callback: XmrEvents[E]): import("nanoevents").Unsubscribe;
|
|
33
34
|
init(): Promise<void>;
|
|
@@ -8338,7 +8338,7 @@ var Xmr = /*#__PURE__*/function () {
|
|
|
8338
8338
|
_defineProperty(this, "isConnectionWanted", void 0);
|
|
8339
8339
|
_defineProperty(this, "isConnected", void 0);
|
|
8340
8340
|
_defineProperty(this, "lastMessageAt", void 0);
|
|
8341
|
-
_defineProperty(this, "interval",
|
|
8341
|
+
_defineProperty(this, "interval", null);
|
|
8342
8342
|
// Emitter
|
|
8343
8343
|
this.emitter = createNanoEvents();
|
|
8344
8344
|
this.url = null;
|
|
@@ -8492,6 +8492,7 @@ var Xmr = /*#__PURE__*/function () {
|
|
|
8492
8492
|
// JSON message.
|
|
8493
8493
|
var message = JSON.parse(event.data);
|
|
8494
8494
|
console.debug('Xmr::message: action is ' + message.action);
|
|
8495
|
+
console.debug('Xmr::message', message);
|
|
8495
8496
|
// Check the createdDt and TTL against the current date time.
|
|
8496
8497
|
var expiresAt = DateTime.fromISO(message.createdDt).plus({
|
|
8497
8498
|
seconds: parseInt(message.ttl)
|
|
@@ -8514,6 +8515,8 @@ var Xmr = /*#__PURE__*/function () {
|
|
|
8514
8515
|
_this2.emitter.emit('purgeAll');
|
|
8515
8516
|
} else if (message.action == 'clearStatsAndLogs') {
|
|
8516
8517
|
_this2.emitter.emit('clearStatsAndLogs');
|
|
8518
|
+
} else if (message.action == 'triggerWebhook') {
|
|
8519
|
+
_this2.emitter.emit('triggerWebhook', message.triggerCode);
|
|
8517
8520
|
} else {
|
|
8518
8521
|
console.error('Xmr::message: unknown action: ' + message.action);
|
|
8519
8522
|
}
|