@xpert-ai/chatkit-ui5 0.16.2 → 0.17.1
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/chatkit.cjs +27 -2
- package/dist/chatkit.cjs.map +1 -1
- package/dist/chatkit.ui5.js +27 -2
- package/dist/chatkit.ui5.js.map +1 -1
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/chatkit.ui5.js
CHANGED
|
@@ -385,7 +385,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
385
385
|
return null;
|
|
386
386
|
}
|
|
387
387
|
function safeRandomUUID() {
|
|
388
|
-
|
|
388
|
+
const id = createSecureChannelId();
|
|
389
|
+
if (id === null) {
|
|
390
|
+
throw new Error(
|
|
391
|
+
"ChatKit requires crypto.randomUUID or crypto.getRandomValues to generate secure UUIDs."
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
return id;
|
|
389
395
|
}
|
|
390
396
|
function isTrustedChatKitMessageEvent(event, { channelId, expectedOrigin, expectedSource }) {
|
|
391
397
|
const payload = event.data;
|
|
@@ -434,6 +440,20 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
434
440
|
this.stack = new Error(message).stack;
|
|
435
441
|
}
|
|
436
442
|
}
|
|
443
|
+
function serializeFrameError(error) {
|
|
444
|
+
try {
|
|
445
|
+
return structuredClone(error);
|
|
446
|
+
} catch {
|
|
447
|
+
const message = error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "ChatKit host request failed";
|
|
448
|
+
if (error && typeof error === "object" && "status" in error && typeof error.status === "number") {
|
|
449
|
+
return new FrameSafeHttpError(message, {
|
|
450
|
+
status: error.status,
|
|
451
|
+
statusText: "statusText" in error && typeof error.statusText === "string" ? error.statusText : void 0
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
return new Error(message);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
437
457
|
class BaseMessenger {
|
|
438
458
|
constructor({
|
|
439
459
|
handlers,
|
|
@@ -631,7 +651,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
631
651
|
const message = {
|
|
632
652
|
__xpaiChatKit: true,
|
|
633
653
|
...this.channelId ? { channelId: this.channelId } : {},
|
|
634
|
-
...data
|
|
654
|
+
...data,
|
|
655
|
+
...data.type === "response" && data.error !== void 0 ? { error: serializeFrameError(data.error) } : {}
|
|
635
656
|
};
|
|
636
657
|
(_a2 = this.target()) == null ? void 0 : _a2.postMessage(message, this.targetOrigin, transfer);
|
|
637
658
|
}
|
|
@@ -2604,6 +2625,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2604
2625
|
}
|
|
2605
2626
|
return connect(request);
|
|
2606
2627
|
},
|
|
2628
|
+
onWorkbenchNavigationChange: async (navigation) => {
|
|
2629
|
+
var _a2, _b2, _c2;
|
|
2630
|
+
await ((_c2 = (_b2 = (_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.workbench) == null ? void 0 : _b2.onNavigationChange) == null ? void 0 : _c2.call(_b2, navigation));
|
|
2631
|
+
},
|
|
2607
2632
|
onWorkbenchClientCommand: async ({
|
|
2608
2633
|
commandKey,
|
|
2609
2634
|
payload,
|