isometrik-plugin-chat-sdk 1.0.0 → 1.0.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.
Files changed (54) hide show
  1. package/dist/cjs/{MessageSearch-5fc9dc00.js → MessageSearch-f5b72462.js} +2 -2
  2. package/dist/cjs/{MessageSearch-5fc9dc00.js.map → MessageSearch-f5b72462.js.map} +1 -1
  3. package/dist/cjs/{WebChat-403e7ab1.js → WebChat-2329244b.js} +33 -23
  4. package/dist/cjs/WebChat-2329244b.js.map +1 -0
  5. package/dist/cjs/audio-bubble_8.cjs.entry.js +2 -2
  6. package/dist/cjs/chat-app.cjs.entry.js +3 -3
  7. package/dist/cjs/chat-creds-7ddd5f40.js +27 -0
  8. package/dist/cjs/chat-creds-7ddd5f40.js.map +1 -0
  9. package/dist/cjs/login-page.cjs.entry.js +1 -1
  10. package/dist/cjs/signup-page.cjs.entry.js +1 -1
  11. package/dist/cjs/theme-provider_2.cjs.entry.js +3 -3
  12. package/dist/collection/components/my-component/web-chat/WebChat.js +30 -20
  13. package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
  14. package/dist/collection/constants/chat-creds.js +18 -29
  15. package/dist/esm/{MessageSearch-4101a627.js → MessageSearch-4010486c.js} +2 -2
  16. package/dist/esm/{MessageSearch-4101a627.js.map → MessageSearch-4010486c.js.map} +1 -1
  17. package/dist/esm/{WebChat-5448d615.js → WebChat-95518d72.js} +33 -23
  18. package/dist/esm/WebChat-95518d72.js.map +1 -0
  19. package/dist/esm/audio-bubble_8.entry.js +3 -3
  20. package/dist/esm/chat-app.entry.js +3 -3
  21. package/dist/esm/chat-creds-99dd8834.js +24 -0
  22. package/dist/esm/chat-creds-99dd8834.js.map +1 -0
  23. package/dist/esm/login-page.entry.js +1 -1
  24. package/dist/esm/signup-page.entry.js +1 -1
  25. package/dist/esm/theme-provider_2.entry.js +3 -3
  26. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  27. package/dist/isometrik-webchat/{p-bfd51dd4.entry.js → p-35f143c9.entry.js} +2 -2
  28. package/dist/isometrik-webchat/{p-8dcdea59.js → p-55355714.js} +2 -2
  29. package/dist/isometrik-webchat/{p-adbb398d.entry.js → p-675c105e.entry.js} +2 -2
  30. package/dist/isometrik-webchat/p-70f4360e.js +2 -0
  31. package/dist/isometrik-webchat/p-70f4360e.js.map +1 -0
  32. package/dist/isometrik-webchat/{p-48e243ec.entry.js → p-72a0b844.entry.js} +2 -2
  33. package/dist/isometrik-webchat/{p-89108249.entry.js → p-d7e335cb.entry.js} +2 -2
  34. package/dist/isometrik-webchat/{p-bf0aeb22.entry.js → p-e36db3f6.entry.js} +2 -2
  35. package/dist/isometrik-webchat/p-e954c29f.js +591 -0
  36. package/dist/isometrik-webchat/p-e954c29f.js.map +1 -0
  37. package/package.json +1 -1
  38. package/readme.md +5 -5
  39. package/dist/cjs/WebChat-403e7ab1.js.map +0 -1
  40. package/dist/cjs/chat-creds-f4cbf400.js +0 -38
  41. package/dist/cjs/chat-creds-f4cbf400.js.map +0 -1
  42. package/dist/esm/WebChat-5448d615.js.map +0 -1
  43. package/dist/esm/chat-creds-ff086f05.js +0 -35
  44. package/dist/esm/chat-creds-ff086f05.js.map +0 -1
  45. package/dist/isometrik-webchat/p-12774661.js +0 -2
  46. package/dist/isometrik-webchat/p-12774661.js.map +0 -1
  47. package/dist/isometrik-webchat/p-e09b32eb.js +0 -591
  48. package/dist/isometrik-webchat/p-e09b32eb.js.map +0 -1
  49. /package/dist/isometrik-webchat/{p-bfd51dd4.entry.js.map → p-35f143c9.entry.js.map} +0 -0
  50. /package/dist/isometrik-webchat/{p-8dcdea59.js.map → p-55355714.js.map} +0 -0
  51. /package/dist/isometrik-webchat/{p-adbb398d.entry.js.map → p-675c105e.entry.js.map} +0 -0
  52. /package/dist/isometrik-webchat/{p-48e243ec.entry.js.map → p-72a0b844.entry.js.map} +0 -0
  53. /package/dist/isometrik-webchat/{p-89108249.entry.js.map → p-d7e335cb.entry.js.map} +0 -0
  54. /package/dist/isometrik-webchat/{p-bf0aeb22.entry.js.map → p-e36db3f6.entry.js.map} +0 -0
@@ -3,15 +3,15 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9afe62b6.js');
6
- require('./WebChat-403e7ab1.js');
6
+ require('./WebChat-2329244b.js');
7
7
  require('./Image-67c52acd.js');
8
- require('./chat-creds-f4cbf400.js');
8
+ require('./chat-creds-7ddd5f40.js');
9
9
  require('./dialog-drawer-9d04911c.js');
10
10
  require('./content-eca5336c.js');
11
11
  require('./Text-fedf6eab.js');
12
12
  require('./group-members-a60fb1cb.js');
13
13
  require('./toast-helper-defae4a5.js');
14
- require('./MessageSearch-5fc9dc00.js');
14
+ require('./MessageSearch-f5b72462.js');
15
15
  require('./BlockChatList-720a703e.js');
16
16
  require('./imagePlaceholder-030cc566.js');
17
17
  require('./taguser-aca04ed9.js');
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ // Filled at runtime from <web-chat> props (parent). Do not hardcode secrets here.
4
+ const CHAT_CREDS = {
5
+ userToken: '',
6
+ appSecret: '',
7
+ licenseKey: '',
8
+ userSecret: '',
9
+ accountId: '',
10
+ keysetId: '',
11
+ projectId: '',
12
+ isometrikUserId: '',
13
+ // Public API host — parent can override via base-url prop
14
+ baseUrl: 'https://apis.isometrik.ai',
15
+ // Instagram/Zernio OAuth return URL — parent should set via social-redirect-url
16
+ socialRedirectUrl: '',
17
+ };
18
+
19
+ const MQTT_CREDS = {
20
+ // Public broker — parent can override via host-url prop
21
+ URL: 'wss://connections.isometrik.io:2053/mqtt',
22
+ };
23
+
24
+ exports.CHAT_CREDS = CHAT_CREDS;
25
+ exports.MQTT_CREDS = MQTT_CREDS;
26
+
27
+ //# sourceMappingURL=chat-creds-7ddd5f40.js.map
@@ -0,0 +1 @@
1
+ {"file":"chat-creds-7ddd5f40.js","mappings":";;AAAA;AACY,MAAC,UAAU,GAAG;AAC1B,EAAE,SAAS,EAAE,EAAE;AACf,EAAE,SAAS,EAAE,EAAE;AACf,EAAE,UAAU,EAAE,EAAE;AAChB,EAAE,UAAU,EAAE,EAAE;AAChB,EAAE,SAAS,EAAE,EAAE;AACf,EAAE,QAAQ,EAAE,EAAE;AACd,EAAE,SAAS,EAAE,EAAE;AACf,EAAE,eAAe,EAAE,EAAE;AACrB;AACA,EAAE,OAAO,EAAE,2BAA2B;AACtC;AACA,EAAE,iBAAiB,EAAE,EAAE;AACvB,EAAE;AACF;AACY,MAAC,UAAU,GAAG;AAC1B;AACA,EAAE,GAAG,EAAE,0CAA0C;AACjD;;;;;","names":[],"sources":["src/constants/chat-creds.js"],"sourcesContent":["// Filled at runtime from <web-chat> props (parent). Do not hardcode secrets here.\nexport const CHAT_CREDS = {\n userToken: '',\n appSecret: '',\n licenseKey: '',\n userSecret: '',\n accountId: '',\n keysetId: '',\n projectId: '',\n isometrikUserId: '',\n // Public API host — parent can override via base-url prop\n baseUrl: 'https://apis.isometrik.ai',\n // Instagram/Zernio OAuth return URL — parent should set via social-redirect-url\n socialRedirectUrl: '',\n};\n\nexport const MQTT_CREDS = {\n // Public broker — parent can override via host-url prop\n URL: 'wss://connections.isometrik.io:2053/mqtt',\n};\n"],"version":3}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9afe62b6.js');
6
- const chatCreds = require('./chat-creds-f4cbf400.js');
6
+ const chatCreds = require('./chat-creds-7ddd5f40.js');
7
7
  const IsometrikLogo = require('./IsometrikLogo-976b1c34.js');
8
8
  const content = require('./content-eca5336c.js');
9
9
  const chatAssets = require('./chat-assets-6ab1faa6.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9afe62b6.js');
6
6
  const IsometrikLogo = require('./IsometrikLogo-976b1c34.js');
7
- const chatCreds = require('./chat-creds-f4cbf400.js');
7
+ const chatCreds = require('./chat-creds-7ddd5f40.js');
8
8
 
9
9
  const onboardingImagePath = index.getAssetPath('../assets/images/onboarding.webp');
10
10
  const Signup = class {
@@ -3,15 +3,15 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9afe62b6.js');
6
- const WebChat = require('./WebChat-403e7ab1.js');
6
+ const WebChat = require('./WebChat-2329244b.js');
7
7
  require('./Image-67c52acd.js');
8
- require('./chat-creds-f4cbf400.js');
8
+ require('./chat-creds-7ddd5f40.js');
9
9
  require('./dialog-drawer-9d04911c.js');
10
10
  require('./content-eca5336c.js');
11
11
  require('./Text-fedf6eab.js');
12
12
  require('./group-members-a60fb1cb.js');
13
13
  require('./toast-helper-defae4a5.js');
14
- require('./MessageSearch-5fc9dc00.js');
14
+ require('./MessageSearch-f5b72462.js');
15
15
  require('./BlockChatList-720a703e.js');
16
16
  require('./imagePlaceholder-030cc566.js');
17
17
  require('./taguser-aca04ed9.js');
@@ -75,9 +75,29 @@ export class WebChat {
75
75
  if (parts.length === 2)
76
76
  return parts.pop().split(';').shift();
77
77
  };
78
- // Auth from chat-creds (no login UI)
79
- this.userTokenFromCookie = CHAT_CREDS.userToken;
80
- this.isometrikUserIdFromCookie = CHAT_CREDS.isometrikUserId;
78
+ // Filled from parent <web-chat> props in applyParentCreds()
79
+ this.userTokenFromCookie = '';
80
+ this.isometrikUserIdFromCookie = '';
81
+ /** Copy parent props into CHAT_CREDS so API helpers use host values (no hardcode). */
82
+ this.applyParentCreds = () => {
83
+ var _a;
84
+ const pick = (prop, fallback = '') => typeof prop === 'string' && prop.trim() ? prop.trim() : fallback;
85
+ CHAT_CREDS.userToken = pick(this.userToken);
86
+ CHAT_CREDS.appSecret = pick(this.appSecret);
87
+ CHAT_CREDS.licenseKey = pick(this.licenseKey);
88
+ CHAT_CREDS.userSecret = pick(this.userSecret);
89
+ CHAT_CREDS.accountId = pick(this.accountId);
90
+ CHAT_CREDS.keysetId = pick(this.keysetId);
91
+ CHAT_CREDS.projectId = pick(this.projectId);
92
+ CHAT_CREDS.isometrikUserId = pick(this.isometrikUserId);
93
+ CHAT_CREDS.baseUrl = pick(this.baseUrl, CHAT_CREDS.baseUrl || 'https://apis.isometrik.ai');
94
+ CHAT_CREDS.socialRedirectUrl = pick(this.socialRedirectUrl);
95
+ if ((_a = this.hostUrl) === null || _a === void 0 ? void 0 : _a.trim()) {
96
+ MQTT_CREDS.URL = this.hostUrl.trim();
97
+ }
98
+ this.userTokenFromCookie = CHAT_CREDS.userToken;
99
+ this.isometrikUserIdFromCookie = CHAT_CREDS.isometrikUserId;
100
+ };
81
101
  this.clearConversationState = () => {
82
102
  this.allConversationList = [];
83
103
  this.selectedConversationId = null;
@@ -760,11 +780,7 @@ export class WebChat {
760
780
  this.isMobileView = window.innerWidth <= 768;
761
781
  }
762
782
  componentWillLoad() {
763
- var _a;
764
- // Instagram OAuth return URL — host page where accounts are linked
765
- if ((_a = this.socialRedirectUrl) === null || _a === void 0 ? void 0 : _a.trim()) {
766
- CHAT_CREDS.socialRedirectUrl = this.socialRedirectUrl.trim();
767
- }
783
+ this.applyParentCreds();
768
784
  // OAuth popup return: notify opener ASAP and close (skip full chat boot)
769
785
  if (notifyOpenerIfSocialPopupCallback())
770
786
  return;
@@ -804,12 +820,13 @@ export class WebChat {
804
820
  // Initialize SDK
805
821
  try {
806
822
  this.updateLoading(25, 'Initializing chat SDK...');
823
+ this.applyParentCreds();
807
824
  ChatSDK.initializeInstance({
808
825
  baseUrl: CHAT_CREDS.baseUrl,
809
826
  licenseKey: CHAT_CREDS.licenseKey,
810
827
  appSecret: CHAT_CREDS.appSecret,
811
828
  userSecret: CHAT_CREDS.userSecret,
812
- userToken: this.userTokenFromCookie,
829
+ userToken: CHAT_CREDS.userToken,
813
830
  });
814
831
  this.isInitialized = true;
815
832
  }
@@ -924,10 +941,12 @@ export class WebChat {
924
941
  }
925
942
  }
926
943
  async setupMqttClient() {
944
+ var _a;
927
945
  // let retryToConnect:any = null;
928
946
  const deviceID = await getDeviceID();
947
+ this.applyParentCreds();
929
948
  const mqttClient = ChatSDK.getInstance().initializeMqtt({
930
- hostUri: MQTT_CREDS.URL || this.hostUrl,
949
+ hostUri: ((_a = this.hostUrl) === null || _a === void 0 ? void 0 : _a.trim()) || MQTT_CREDS.URL,
931
950
  clientId: CHAT_CREDS.isometrikUserId,
932
951
  licenseKey: CHAT_CREDS.licenseKey,
933
952
  projectId: CHAT_CREDS.projectId,
@@ -935,15 +954,6 @@ export class WebChat {
935
954
  accountId: CHAT_CREDS.accountId,
936
955
  deviceId: deviceID,
937
956
  });
938
- // const mqttClient = ChatSDK.getInstance().initializeMqtt({
939
- // hostUri: this.hostUrl,
940
- // clientId: this.isometrikUserId,
941
- // licenseKey: this.licenseKey,
942
- // projectId: this.projectId,
943
- // keysetId: this.keysetId,
944
- // accountId: this.accountId,
945
- // deviceId: deviceID,
946
- // });
947
957
  this.mqttClient = mqttClient;
948
958
  let refetchInterval = null;
949
959
  this.isMqttConnected = false;
@@ -1965,7 +1975,7 @@ export class WebChat {
1965
1975
  }
1966
1976
  render() {
1967
1977
  var _a, _b, _c, _d, _e;
1968
- return (h(Fragment, { key: '54bf58235570d4cd19ae3bbc1ac54dda2346d644' }, this.isLoading ? (h("chat-loading-placeholder", { progress: this.loadingProgress, loadingStatus: this.loadingStatus })) : (h(Fragment, null, this.isConversationLoading ? (h("div", { class: "loaderoverlay" }, h("spinner-loader", { height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary-color)", spinnerSecondaryColor: "var(--text-primary-color)", spinnerBorderWidth: "2px" }))) : null, h("div", { class: {
1978
+ return (h(Fragment, { key: '120ba07af7eb93f1f6cbed603f6e25bfd48b0900' }, this.isLoading ? (h("chat-loading-placeholder", { progress: this.loadingProgress, loadingStatus: this.loadingStatus })) : (h(Fragment, null, this.isConversationLoading ? (h("div", { class: "loaderoverlay" }, h("spinner-loader", { height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary-color)", spinnerSecondaryColor: "var(--text-primary-color)", spinnerBorderWidth: "2px" }))) : null, h("div", { class: {
1969
1979
  'isometrik-quickchat': true,
1970
1980
  'is-resizing': this.isResizingSidebar,
1971
1981
  'is-instagram-gate': !this.isInstagramConnected,