open-chat-studio-widget 0.5.2 → 0.5.3
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/cjs/{index-Ctja7z-R.js → index-D8A4RBzq.js} +3 -3
- package/dist/cjs/{index-Ctja7z-R.js.map → index-D8A4RBzq.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js +15 -7
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.js +1 -1
- package/dist/cjs/open-chat-studio-widget.entry.cjs.js.map +1 -1
- package/dist/collection/services/chat-session-service.js +14 -6
- package/dist/collection/services/chat-session-service.js.map +1 -1
- package/dist/components/open-chat-studio-widget.js +14 -6
- package/dist/components/open-chat-studio-widget.js.map +1 -1
- package/dist/esm/{index-BbCwiO7g.js → index-C53whb-B.js} +3 -3
- package/dist/esm/{index-BbCwiO7g.js.map → index-C53whb-B.js.map} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/open-chat-studio-widget.entry.js +15 -7
- package/dist/esm/open-chat-studio-widget.entry.js.map +1 -1
- package/dist/esm/open-chat-studio-widget.js +2 -2
- package/dist/open-chat-studio-widget/open-chat-studio-widget.entry.esm.js.map +1 -1
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +1 -1
- package/dist/open-chat-studio-widget/{p-BbCwiO7g.js → p-C53whb-B.js} +2 -2
- package/dist/open-chat-studio-widget/{p-BbCwiO7g.js.map → p-C53whb-B.js.map} +1 -1
- package/dist/open-chat-studio-widget/p-b9556259.entry.js +4 -0
- package/dist/open-chat-studio-widget/p-b9556259.entry.js.map +1 -0
- package/dist/types/services/chat-session-service.d.ts +1 -0
- package/package.json +1 -1
- package/dist/open-chat-studio-widget/p-96920183.entry.js +0 -4
- package/dist/open-chat-studio-widget/p-96920183.entry.js.map +0 -1
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-C53whb-B.js';
|
|
2
|
+
export { s as setNonce } from './index-C53whb-B.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, r as registerInstance, E as Env, H as Host, g as getElement } from './index-
|
|
1
|
+
import { h, r as registerInstance, E as Env, H as Host, g as getElement } from './index-C53whb-B.js';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
4
|
const OcsWidgetAvatar = () => {
|
|
@@ -4933,7 +4933,9 @@ class ChatSessionService {
|
|
|
4933
4933
|
return response.json();
|
|
4934
4934
|
}
|
|
4935
4935
|
async pollTaskOnce(sessionId, taskId) {
|
|
4936
|
-
const response = await fetch(`${this.apiBaseUrl}/api/chat/${sessionId}/${taskId}/poll
|
|
4936
|
+
const response = await fetch(`${this.apiBaseUrl}/api/chat/${sessionId}/${taskId}/poll/`, {
|
|
4937
|
+
headers: this.getCommonHeaders(),
|
|
4938
|
+
});
|
|
4937
4939
|
if (!response.ok) {
|
|
4938
4940
|
throw new Error(`Failed to poll task: ${response.statusText}`);
|
|
4939
4941
|
}
|
|
@@ -4991,7 +4993,9 @@ class ChatSessionService {
|
|
|
4991
4993
|
if (since) {
|
|
4992
4994
|
url.searchParams.set('since', since);
|
|
4993
4995
|
}
|
|
4994
|
-
const response = await fetch(url.toString()
|
|
4996
|
+
const response = await fetch(url.toString(), {
|
|
4997
|
+
headers: this.getCommonHeaders(),
|
|
4998
|
+
});
|
|
4995
4999
|
if (!response.ok) {
|
|
4996
5000
|
throw new Error(`Failed to poll messages: ${response.statusText}`);
|
|
4997
5001
|
}
|
|
@@ -5028,14 +5032,18 @@ class ChatSessionService {
|
|
|
5028
5032
|
}
|
|
5029
5033
|
}
|
|
5030
5034
|
getJsonHeaders() {
|
|
5031
|
-
const headers =
|
|
5032
|
-
|
|
5033
|
-
'x-ocs-widget-version': this.widgetVersion,
|
|
5034
|
-
};
|
|
5035
|
+
const headers = this.getCommonHeaders();
|
|
5036
|
+
headers['Content-Type'] = 'application/json';
|
|
5035
5037
|
const csrfToken = this.csrfTokenProvider(this.apiBaseUrl);
|
|
5036
5038
|
if (csrfToken) {
|
|
5037
5039
|
headers['X-CSRFToken'] = csrfToken;
|
|
5038
5040
|
}
|
|
5041
|
+
return headers;
|
|
5042
|
+
}
|
|
5043
|
+
getCommonHeaders() {
|
|
5044
|
+
const headers = {
|
|
5045
|
+
'x-ocs-widget-version': this.widgetVersion,
|
|
5046
|
+
};
|
|
5039
5047
|
if (this.embedKey) {
|
|
5040
5048
|
headers['X-Embed-Key'] = this.embedKey;
|
|
5041
5049
|
}
|