@aikaara/chat-sdk 0.7.2 → 0.7.6

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/headless.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./MountTenant-BNpG6T7E.cjs");class s extends i.EventEmitter{registration=null;pendingEdits=[];constructor(e){super(),this.setupListeners(e)}registerForm(e){this.registration=e;const t=this.pendingEdits.filter(r=>r.entity_type===e.entityType&&String(r.entity_id)===String(e.entityId));if(t.length>0){for(const r of t)e.onFieldUpdate(r.fields),this.emit("edit:applied",{entityType:r.entity_type,entityId:r.entity_id,fields:r.fields});this.pendingEdits=this.pendingEdits.filter(r=>!(r.entity_type===e.entityType&&String(r.entity_id)===String(e.entityId)))}}unregisterForm(e,t){this.registration?.entityType===e&&String(this.registration?.entityId)===String(t)&&(this.registration=null)}get currentForm(){return this.registration}pushFieldUpdates(e,t,r){this.registration&&this.registration.entityType===e&&String(this.registration.entityId)===String(t)?(this.registration.onFieldUpdate(r),this.emit("edit:applied",{entityType:e,entityId:t,fields:r})):(this.pendingEdits.push({action:"edit_entity",entity_type:e,entity_id:t,fields:r}),this.emit("edit:pending",{entityType:e,entityId:t,fields:r}))}async requestSave(){if(!this.registration)return{success:!1,error:"No form registered"};try{return await this.registration.onSave(),this.emit("save:success",{entityType:this.registration.entityType,entityId:this.registration.entityId}),{success:!0}}catch(e){const t=e instanceof Error?e.message:"Save failed";return this.emit("save:error",{entityType:this.registration.entityType,entityId:this.registration.entityId,error:t}),{success:!1,error:t}}}async requestTest(e){if(!this.registration?.onTest)return{success:!1,error:"Current form does not support testing"};try{return await this.registration.onTest(e),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Test failed"}}}setupListeners(e){e.on("action:edit_entity",t=>{this.pushFieldUpdates(t.entity_type,t.entity_id,t.fields)}),e.on("action:save_entity",t=>{this.requestSave()}),e.on("action:test_tool",t=>{this.emit("test:triggered",{toolId:t.tool_id,parameters:t.parameters}),this.requestTest(t.parameters)})}}exports.ActionCableClient=i.ActionCableClient;exports.AikaaraChatClient=i.AikaaraChatClient;exports.ApiClient=i.ApiClient;exports.ChannelSubscription=i.ChannelSubscription;exports.ConnectionManager=i.ConnectionManager;exports.ConversationManager=i.ConversationManager;exports.EventEmitter=i.EventEmitter;exports.MessageStore=i.MessageStore;exports.SessionAuthAdapter=i.SessionAuthAdapter;exports.TiledeskTransport=i.TiledeskTransport;exports.clearPersistedConversationId=i.clearPersistedConversationId;exports.createFetchUploadAdapter=i.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=i.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=i.createTiledeskHistoryAdapter;exports.extractTiledeskFileEnvelope=i.extractTiledeskFileEnvelope;exports.inferTiledeskRole=i.inferTiledeskRole;exports.isTiledeskSelfEcho=i.isTiledeskSelfEcho;exports.mountFromSlug=i.mountFromSlug;exports.mountTenantWidget=i.mount;exports.parseTiledeskTemplate=i.parseTiledeskTemplate;exports.FormBridge=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./MountTenant-CTSUKHmw.cjs");class r extends i.EventEmitter{registration=null;pendingEdits=[];constructor(e){super(),this.setupListeners(e)}registerForm(e){this.registration=e;const t=this.pendingEdits.filter(s=>s.entity_type===e.entityType&&String(s.entity_id)===String(e.entityId));if(t.length>0){for(const s of t)e.onFieldUpdate(s.fields),this.emit("edit:applied",{entityType:s.entity_type,entityId:s.entity_id,fields:s.fields});this.pendingEdits=this.pendingEdits.filter(s=>!(s.entity_type===e.entityType&&String(s.entity_id)===String(e.entityId)))}}unregisterForm(e,t){this.registration?.entityType===e&&String(this.registration?.entityId)===String(t)&&(this.registration=null)}get currentForm(){return this.registration}pushFieldUpdates(e,t,s){this.registration&&this.registration.entityType===e&&String(this.registration.entityId)===String(t)?(this.registration.onFieldUpdate(s),this.emit("edit:applied",{entityType:e,entityId:t,fields:s})):(this.pendingEdits.push({action:"edit_entity",entity_type:e,entity_id:t,fields:s}),this.emit("edit:pending",{entityType:e,entityId:t,fields:s}))}async requestSave(){if(!this.registration)return{success:!1,error:"No form registered"};try{return await this.registration.onSave(),this.emit("save:success",{entityType:this.registration.entityType,entityId:this.registration.entityId}),{success:!0}}catch(e){const t=e instanceof Error?e.message:"Save failed";return this.emit("save:error",{entityType:this.registration.entityType,entityId:this.registration.entityId,error:t}),{success:!1,error:t}}}async requestTest(e){if(!this.registration?.onTest)return{success:!1,error:"Current form does not support testing"};try{return await this.registration.onTest(e),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Test failed"}}}setupListeners(e){e.on("action:edit_entity",t=>{this.pushFieldUpdates(t.entity_type,t.entity_id,t.fields)}),e.on("action:save_entity",t=>{this.requestSave()}),e.on("action:test_tool",t=>{this.emit("test:triggered",{toolId:t.tool_id,parameters:t.parameters}),this.requestTest(t.parameters)})}}exports.ActionCableClient=i.ActionCableClient;exports.AikaaraChatClient=i.AikaaraChatClient;exports.ApiClient=i.ApiClient;exports.ChannelSubscription=i.ChannelSubscription;exports.ConnectionManager=i.ConnectionManager;exports.ConversationManager=i.ConversationManager;exports.EventEmitter=i.EventEmitter;exports.MessageStore=i.MessageStore;exports.SessionAuthAdapter=i.SessionAuthAdapter;exports.SsoExchangeAdapter=i.SsoExchangeAdapter;exports.TiledeskTransport=i.TiledeskTransport;exports.clearPersistedConversationId=i.clearPersistedConversationId;exports.collectSsoCredentials=i.collectSsoCredentials;exports.createFetchUploadAdapter=i.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=i.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=i.createTiledeskHistoryAdapter;exports.extractTiledeskFileEnvelope=i.extractTiledeskFileEnvelope;exports.inferTiledeskRole=i.inferTiledeskRole;exports.isTiledeskSelfEcho=i.isTiledeskSelfEcho;exports.mountFromSlug=i.mountFromSlug;exports.mountTenantWidget=i.mount;exports.parseTiledeskTemplate=i.parseTiledeskTemplate;exports.FormBridge=r;
@@ -440,6 +440,9 @@ declare interface ChatEvents_2 {
440
440
 
441
441
  export declare function clearPersistedConversationId(userId: string, projectId: string): void;
442
442
 
443
+ /** Read every credential listed in `spec`. Throws on missing required. */
444
+ export declare function collectSsoCredentials(opts: SsoCollectorOptions): Promise<Record<string, string>>;
445
+
443
446
  export declare interface ConnectionConfig {
444
447
  baseUrl: string;
445
448
  wsUrl?: string;
@@ -531,6 +534,8 @@ export declare function createPresigned3StepUploadAdapter(config: Presigned3Step
531
534
 
532
535
  export declare function createTiledeskHistoryAdapter(config: TiledeskHistoryAdapterConfig): ConversationHistoryAdapter;
533
536
 
537
+ export declare type CredentialProviders = Record<string, () => string | Promise<string>>;
538
+
534
539
  export declare interface EditEntityAction {
535
540
  action: 'edit_entity';
536
541
  entity_type: string;
@@ -585,6 +590,34 @@ declare interface FieldUpdate_2 {
585
590
  previousValue?: unknown;
586
591
  }
587
592
 
593
+ export declare interface FlowDescriptor {
594
+ /** Heading rendered above the step list (e.g. "ITR filing process"). */
595
+ title?: string;
596
+ steps: FlowStep[];
597
+ }
598
+
599
+ /**
600
+ * Static side-rail process taxonomy (e.g. bandhan's "ITR filing process").
601
+ * Fully descriptor-driven — dashboard owns the steps. The runtime state
602
+ * (which step is `done` / `active`) is calculated host-side from chat
603
+ * events (or overlaid from a backend status endpoint like
604
+ * `/itr/life-cycle-status`).
605
+ */
606
+ export declare interface FlowStep {
607
+ /** Stable id used by the host's reducer to address this step. */
608
+ id: string;
609
+ /** Display title. */
610
+ title: string;
611
+ /** Initial status. The host's `onMessage` reducer flips these as the
612
+ * conversation progresses. */
613
+ state?: 'done' | 'active' | 'pending';
614
+ /** Optional nested sub-steps (one level deep — bandhan style). */
615
+ sub?: FlowStep[];
616
+ /** Free-form metadata the host can use in its reducer (templateId
617
+ * patterns the bot uses to advance the step, copy text, hint, etc.). */
618
+ meta?: Record<string, unknown>;
619
+ }
620
+
588
621
  export declare class FormBridge extends EventEmitter<FormBridgeEvents> {
589
622
  private registration;
590
623
  private pendingEdits;
@@ -714,7 +747,7 @@ export declare function isTiledeskSelfEcho(message: TiledeskMessage, userId: str
714
747
  * Descriptor entry for intercepting link clicks. `match` is a glob pattern
715
748
  * (`*` = any, `?` = single char) tested against the full clicked URL.
716
749
  */
717
- declare interface LinkHandler {
750
+ export declare interface LinkHandler {
718
751
  /** Glob pattern matched against the clicked URL. */
719
752
  match: string;
720
753
  /** What to do on match. `tab` opens in new tab, `iframe` uses default modal,
@@ -870,7 +903,7 @@ export declare function parseTiledeskTemplate(message: TiledeskMessage): Tiledes
870
903
  * One HTTP call run by the SDK before auth. Failure of `soft: true` steps
871
904
  * is logged and ignored; failure of strict steps aborts the mount.
872
905
  */
873
- declare interface PreflightStep {
906
+ export declare interface PreflightStep {
874
907
  url: string;
875
908
  method?: 'GET' | 'POST' | 'PUT';
876
909
  body?: Record<string, unknown>;
@@ -932,6 +965,16 @@ export declare class SessionAuthAdapter {
932
965
  /** Force-refresh by clearing cache. Next `get()` call refetches. */
933
966
  reset(): void;
934
967
  get(): Promise<SessionAuthData>;
968
+ /**
969
+ * Backend often races on first signup — `/chatbuddy/auth?serviceType=ITR`
970
+ * returns 500 with `customerNew is null` for 5–30 seconds after the
971
+ * partner-user-onboard call resolves. The data does land eventually;
972
+ * retry with exponential backoff before bubbling the error up so the
973
+ * SDK doesn't need to wait by hand. Each retry burns through the
974
+ * preflight chain too (via the host's `runPreflight` re-invocation),
975
+ * but the cache makes that cheap.
976
+ */
977
+ private static readonly RETRY_DELAYS_MS;
935
978
  private fetchOnce;
936
979
  }
937
980
 
@@ -983,6 +1026,9 @@ export declare type SessionTokenProvider = string | (() => string | Promise<stri
983
1026
 
984
1027
  export declare interface SlugMountedWidget extends MountedTenantWidget {
985
1028
  fullName: string;
1029
+ /** Resolved descriptor (fallback ⊕ fetched ⊕ overrides). Host reads
1030
+ * `descriptor.itrFlow`, `descriptor.theme`, etc. */
1031
+ descriptor: WidgetConfigDescriptor;
986
1032
  /** Force a fresh /chatbuddy/auth-style refetch (clears cached requestId). */
987
1033
  refreshAuth(): Promise<void>;
988
1034
  }
@@ -997,6 +1043,12 @@ export declare interface SlugMountOptions {
997
1043
  /** Additional headers for the descriptor fetch. */
998
1044
  configHeaders?: Record<string, string>;
999
1045
  user: {
1046
+ /**
1047
+ * Initial identifier. When `descriptor.sso` is configured, the
1048
+ * server-issued `ext_uid` from the SSO exchange overrides this
1049
+ * value. For SSO-only flows you can pass an empty string and rely
1050
+ * on the exchange to populate the identity.
1051
+ */
1000
1052
  id: string;
1001
1053
  /** Display name fallback when descriptor.auth doesn't return one. */
1002
1054
  name?: string;
@@ -1007,12 +1059,31 @@ export declare interface SlugMountOptions {
1007
1059
  * or a getter that re-resolves on each refresh.
1008
1060
  */
1009
1061
  token: SessionTokenProvider;
1062
+ /**
1063
+ * Async getters for SSO credentials with `source: "callback"`. Each
1064
+ * key matches a `descriptor.sso.collect[].name` entry. Lets the host
1065
+ * app supply tokens that don't live in cookies / localStorage (e.g.
1066
+ * an in-memory auth context, a parent-frame postMessage).
1067
+ */
1068
+ credentialProviders?: CredentialProviders;
1069
+ /**
1070
+ * Free-form identity bag forwarded to descriptor.preflight URL and
1071
+ * body templates. Keys become `{name}` placeholders. Useful for
1072
+ * tenant-specific fields the SDK doesn't know about (`pan`, `mobile`,
1073
+ * `dob`, etc.) so the descriptor can drive the full warm-up chain
1074
+ * without host code per call.
1075
+ */
1076
+ identity?: Record<string, string | undefined>;
1010
1077
  };
1011
1078
  /** Optional escape hatches; merge over descriptor-driven defaults. */
1012
1079
  hooks?: {
1013
1080
  upload?: UploadAdapter;
1014
1081
  history?: ConversationHistoryAdapter;
1015
1082
  onError?: (err: Error) => void;
1083
+ /** Fired for every chat message (incoming + outgoing). Host apps can
1084
+ * use this to advance UI state outside the widget — e.g. update an
1085
+ * ITR-filing-process side rail when the bot moves the flow forward. */
1086
+ onMessage?: (message: Message) => void;
1016
1087
  };
1017
1088
  /** Per-mount visual overrides. */
1018
1089
  overrides?: Partial<WidgetConfigDescriptor>;
@@ -1025,6 +1096,105 @@ export declare interface SlugMountOptions {
1025
1096
  fallbackConfig?: WidgetConfigDescriptor;
1026
1097
  }
1027
1098
 
1099
+ export declare interface SsoCollectorOptions {
1100
+ /** Spec from `descriptor.sso.collect`. */
1101
+ spec: SsoCollectSpec[];
1102
+ /** Async getters for `source: "callback"` entries (host-supplied). */
1103
+ providers?: CredentialProviders;
1104
+ }
1105
+
1106
+ export declare interface SsoCollectSpec {
1107
+ /** Field name sent to aikaara-ai as `credentials[name]`. */
1108
+ name: string;
1109
+ /** Where to read it from. */
1110
+ source: SsoSourceKind;
1111
+ /** Source-specific key (cookie name, storage key, query param, etc). */
1112
+ key?: string;
1113
+ /** When true, throw if the credential is absent / empty. */
1114
+ required?: boolean;
1115
+ /** Default value if the source doesn't provide one (and not required). */
1116
+ default?: string;
1117
+ }
1118
+
1119
+ export declare interface SsoDescriptor {
1120
+ /**
1121
+ * Aikaara-ai endpoint that runs the server-side SSO + provisioning chain.
1122
+ * Optional — when omitted the SDK derives it from the same `configBase`
1123
+ * it used to fetch `widget_configs/:slug`:
1124
+ * `${configBase}/api/v1/projects/by-slug/${slug}/sso_exchange`
1125
+ * Set this only when self-hosted aikaara-ai sits at a different host
1126
+ * than the widget-config endpoint.
1127
+ */
1128
+ exchangeEndpoint?: string;
1129
+ /** localStorage key for the cached identity. Null/empty → no cache. */
1130
+ cacheKey?: string;
1131
+ /** Cache TTL in seconds. Default 1800 (30 min). */
1132
+ cacheTtlSec?: number;
1133
+ /** Per-widget API key sent as `X-Api-Key` to aikaara-ai. */
1134
+ apiKey?: string;
1135
+ /** Extra static headers attached to the exchange POST. */
1136
+ headers?: Record<string, string>;
1137
+ /** Browser credential collection spec. */
1138
+ collect: SsoCollectSpec[];
1139
+ }
1140
+
1141
+ export declare class SsoExchangeAdapter {
1142
+ private readonly opts;
1143
+ private cache;
1144
+ private inflight;
1145
+ constructor(opts: SsoExchangeOptions);
1146
+ /** Drop any cached identity. Forces a fresh exchange on next `get()`. */
1147
+ reset(): void;
1148
+ /**
1149
+ * Resolve the SSO identity. Returns cached when fresh; otherwise runs the
1150
+ * collect → POST → response flow once and caches the result.
1151
+ */
1152
+ get(force?: boolean): Promise<SsoIdentity>;
1153
+ private exchange;
1154
+ private computeExpiry;
1155
+ private loadCache;
1156
+ private persistCache;
1157
+ private clearCache;
1158
+ }
1159
+
1160
+ export declare interface SsoExchangeOptions {
1161
+ descriptor: SsoDescriptor;
1162
+ /** Host-supplied async getters for `source: "callback"` entries. */
1163
+ providers?: CredentialProviders;
1164
+ /**
1165
+ * Resolved exchange URL. When `descriptor.exchangeEndpoint` is set it
1166
+ * wins; otherwise `mountFromSlug` builds this from
1167
+ * `${configBase}/api/v1/projects/by-slug/${slug}/sso_exchange`.
1168
+ */
1169
+ exchangeUrl?: string;
1170
+ }
1171
+
1172
+ export declare interface SsoIdentity {
1173
+ /** Aikaara `User.id` (UUID/int). Useful for support / audit. */
1174
+ id?: string | number;
1175
+ /** Partner system user id, mirrored as Aikaara `User.ext_uid`. */
1176
+ extUid: string;
1177
+ /** Aikaara user token (ActionCable / Aikaara REST bearer). */
1178
+ userToken: string;
1179
+ email?: string;
1180
+ displayName?: string;
1181
+ /** Free-form properties the provisioner wrote on the user row. */
1182
+ properties?: Record<string, unknown>;
1183
+ /** Unix-ms expiry for the cache row (not the token itself). */
1184
+ expiresAt?: number;
1185
+ }
1186
+
1187
+ /**
1188
+ * Browser-side credential collector for `descriptor.sso.collect`.
1189
+ *
1190
+ * Each entry tells the SDK where to read one credential from. The collected
1191
+ * map gets POSTed to aikaara-ai's `sso_exchange` endpoint, where the
1192
+ * server-side resolver swaps it for a partner identity + provisions an
1193
+ * Aikaara user. No secrets ever live in the public descriptor — this just
1194
+ * tells us "go look at cookie X" or "ask the host app for token Y".
1195
+ */
1196
+ export declare type SsoSourceKind = 'cookie' | 'localStorage' | 'sessionStorage' | 'url_param' | 'header_meta' | 'callback';
1197
+
1028
1198
  declare type SubscriptionCallback = (data: unknown) => void;
1029
1199
 
1030
1200
  declare interface TemplateMessageEvent {
@@ -1084,8 +1254,17 @@ export declare interface TenantMountOptions {
1084
1254
  overrides?: Partial<WidgetConfigDescriptor>;
1085
1255
  /** Surfaced from the SDK. */
1086
1256
  onError?: (err: Error) => void;
1257
+ /** Forwarded to `WidgetConfig.onMessage` — fires for every message. */
1258
+ onMessage?: (message: Message) => void;
1087
1259
  /** Bearer source for descriptor.linkHandlers fetches. */
1088
1260
  getLinkBearer?: (source: 'session' | 'chat' | 'none') => Promise<string | null>;
1261
+ /**
1262
+ * Aikaara user token used by the ActionCable transport
1263
+ * (`?token=<userToken>` on the cable URL). Comes from the SSO exchange
1264
+ * when present. Tiledesk-only widgets ignore it; defaults to `userId`
1265
+ * for backwards compatibility.
1266
+ */
1267
+ userToken?: string;
1089
1268
  }
1090
1269
 
1091
1270
  export declare interface TestToolAction {
@@ -1577,6 +1756,12 @@ export declare interface WidgetConfigDescriptor {
1577
1756
  };
1578
1757
  /** Defaults merged into every form-action postback */
1579
1758
  templateActionAttributes?: Record<string, unknown>;
1759
+ /**
1760
+ * Static side-rail flow (e.g. bandhan's "ITR filing process"). The
1761
+ * dashboard owns this — host renders it next to the chat. Live state
1762
+ * is overlaid by host code from chat events / status endpoints.
1763
+ */
1764
+ itrFlow?: FlowDescriptor;
1580
1765
  /** Adapter endpoints — SDK builds the actual fetch calls */
1581
1766
  uploadEndpoint?: string;
1582
1767
  uploadFieldName?: string;
@@ -1595,6 +1780,17 @@ export declare interface WidgetConfigDescriptor {
1595
1780
  * itself — the host app no longer needs a `tokenProvider` callback.
1596
1781
  */
1597
1782
  auth?: SessionAuthDescriptor;
1783
+ /**
1784
+ * Aikaara-ai-side SSO + provisioning. When present, the SDK collects the
1785
+ * partner credentials listed in `sso.collect`, POSTs them to
1786
+ * `sso.exchangeEndpoint`, and aikaara-ai resolves a partner identity +
1787
+ * provisions an Aikaara user. The returned `ext_uid` overrides
1788
+ * `opts.user.id` and the returned `userToken` populates
1789
+ * `widgetConfig.userToken` (used by the ActionCable transport). This
1790
+ * runs **before** `auth` — so partner SSO seeds the identity, then
1791
+ * `auth` mints chat-platform JWTs against that identity.
1792
+ */
1793
+ sso?: SsoDescriptor;
1598
1794
  /**
1599
1795
  * HTTP calls fired in order before `auth`. Use for backend warmups whose
1600
1796
  * side effects the auth call depends on (e.g. bandhan's bootstrap
@@ -1664,7 +1860,7 @@ export declare interface WidgetConfigDescriptor {
1664
1860
  * (`--aikaara-<kebab-cased-key>`), so renderers (built-in or
1665
1861
  * tenant-supplied) can style themselves consistently.
1666
1862
  */
1667
- declare interface WidgetTheme {
1863
+ export declare interface WidgetTheme {
1668
1864
  primary?: string;
1669
1865
  primaryHover?: string;
1670
1866
  primaryContrast?: string;
package/dist/headless.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { E as s } from "./MountTenant-Bdm9wkBa.mjs";
2
- import { A as p, b as g, k as l, C as h, l as y, m as c, M as u, S as m, T as f, n as T, o as S, p as _, q as v, s as E, t as C, u as F, v as A, w as k, x as I } from "./MountTenant-Bdm9wkBa.mjs";
1
+ import { E as s } from "./MountTenant-DK039M0S.mjs";
2
+ import { A as p, b as l, k as g, C as h, l as c, m as y, M as u, S as m, n as f, T as S, o as T, p as _, q as E, s as v, t as C, u as F, v as A, w as k, x as I, y as x, z as U } from "./MountTenant-DK039M0S.mjs";
3
3
  class a extends s {
4
4
  registration = null;
5
5
  pendingEdits = [];
@@ -94,24 +94,26 @@ class a extends s {
94
94
  }
95
95
  export {
96
96
  p as ActionCableClient,
97
- g as AikaaraChatClient,
98
- l as ApiClient,
97
+ l as AikaaraChatClient,
98
+ g as ApiClient,
99
99
  h as ChannelSubscription,
100
- y as ConnectionManager,
101
- c as ConversationManager,
100
+ c as ConnectionManager,
101
+ y as ConversationManager,
102
102
  s as EventEmitter,
103
103
  a as FormBridge,
104
104
  u as MessageStore,
105
105
  m as SessionAuthAdapter,
106
- f as TiledeskTransport,
106
+ f as SsoExchangeAdapter,
107
+ S as TiledeskTransport,
107
108
  T as clearPersistedConversationId,
108
- S as createFetchUploadAdapter,
109
- _ as createPresigned3StepUploadAdapter,
110
- v as createTiledeskHistoryAdapter,
111
- E as extractTiledeskFileEnvelope,
112
- C as inferTiledeskRole,
113
- F as isTiledeskSelfEcho,
114
- A as mountFromSlug,
115
- k as mountTenantWidget,
116
- I as parseTiledeskTemplate
109
+ _ as collectSsoCredentials,
110
+ E as createFetchUploadAdapter,
111
+ v as createPresigned3StepUploadAdapter,
112
+ C as createTiledeskHistoryAdapter,
113
+ F as extractTiledeskFileEnvelope,
114
+ A as inferTiledeskRole,
115
+ k as isTiledeskSelfEcho,
116
+ I as mountFromSlug,
117
+ x as mountTenantWidget,
118
+ U as parseTiledeskTemplate
117
119
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-BNpG6T7E.cjs"),s=require("./headless.cjs");function l(a){e.registerComponents();const t=document.createElement("aikaara-chat-widget"),i={baseUrl:"base-url",userToken:"user-token",apiKey:"api-key",title:"title",subtitle:"subtitle",theme:"theme",primaryColor:"primary-color",position:"position",width:"width",height:"height",placeholder:"placeholder",welcomeMessage:"welcome-message",avatarUrl:"avatar-url"};for(const[n,o]of Object.entries(i)){const r=a[n];r!=null&&t.setAttribute(o,String(r))}return t.configure(a),document.body.appendChild(t),t}function d(){const a=document.querySelector("aikaara-chat-widget");a&&a.remove()}exports.ActionCableClient=e.ActionCableClient;exports.AikaaraChatBubble=e.AikaaraChatBubble;exports.AikaaraChatClient=e.AikaaraChatClient;exports.AikaaraChatHeader=e.AikaaraChatHeader;exports.AikaaraChatInput=e.AikaaraChatInput;exports.AikaaraChatWidget=e.AikaaraChatWidget;exports.AikaaraErrorBanner=e.AikaaraErrorBanner;exports.AikaaraMessageBubble=e.AikaaraMessageBubble;exports.AikaaraMessageList=e.AikaaraMessageList;exports.AikaaraStreamingMessage=e.AikaaraStreamingMessage;exports.AikaaraTypingIndicator=e.AikaaraTypingIndicator;exports.ApiClient=e.ApiClient;exports.ChannelSubscription=e.ChannelSubscription;exports.ConnectionManager=e.ConnectionManager;exports.ConversationManager=e.ConversationManager;exports.EventEmitter=e.EventEmitter;exports.MessageStore=e.MessageStore;exports.SessionAuthAdapter=e.SessionAuthAdapter;exports.TiledeskTransport=e.TiledeskTransport;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.extractTiledeskFileEnvelope=e.extractTiledeskFileEnvelope;exports.inferTiledeskRole=e.inferTiledeskRole;exports.isTiledeskSelfEcho=e.isTiledeskSelfEcho;exports.mountFromSlug=e.mountFromSlug;exports.mountTenantWidget=e.mount;exports.parseTiledeskTemplate=e.parseTiledeskTemplate;exports.registerComponents=e.registerComponents;exports.FormBridge=s.FormBridge;exports.mount=l;exports.unmount=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-CTSUKHmw.cjs"),s=require("./headless.cjs");function l(a){e.registerComponents();const t=document.createElement("aikaara-chat-widget"),i={baseUrl:"base-url",userToken:"user-token",apiKey:"api-key",title:"title",subtitle:"subtitle",theme:"theme",primaryColor:"primary-color",position:"position",width:"width",height:"height",placeholder:"placeholder",welcomeMessage:"welcome-message",avatarUrl:"avatar-url"};for(const[n,o]of Object.entries(i)){const r=a[n];r!=null&&t.setAttribute(o,String(r))}return t.configure(a),document.body.appendChild(t),t}function d(){const a=document.querySelector("aikaara-chat-widget");a&&a.remove()}exports.ActionCableClient=e.ActionCableClient;exports.AikaaraChatBubble=e.AikaaraChatBubble;exports.AikaaraChatClient=e.AikaaraChatClient;exports.AikaaraChatHeader=e.AikaaraChatHeader;exports.AikaaraChatInput=e.AikaaraChatInput;exports.AikaaraChatWidget=e.AikaaraChatWidget;exports.AikaaraErrorBanner=e.AikaaraErrorBanner;exports.AikaaraMessageBubble=e.AikaaraMessageBubble;exports.AikaaraMessageList=e.AikaaraMessageList;exports.AikaaraStreamingMessage=e.AikaaraStreamingMessage;exports.AikaaraTypingIndicator=e.AikaaraTypingIndicator;exports.ApiClient=e.ApiClient;exports.ChannelSubscription=e.ChannelSubscription;exports.ConnectionManager=e.ConnectionManager;exports.ConversationManager=e.ConversationManager;exports.EventEmitter=e.EventEmitter;exports.MessageStore=e.MessageStore;exports.SessionAuthAdapter=e.SessionAuthAdapter;exports.SsoExchangeAdapter=e.SsoExchangeAdapter;exports.TiledeskTransport=e.TiledeskTransport;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.collectSsoCredentials=e.collectSsoCredentials;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.extractTiledeskFileEnvelope=e.extractTiledeskFileEnvelope;exports.inferTiledeskRole=e.inferTiledeskRole;exports.isTiledeskSelfEcho=e.isTiledeskSelfEcho;exports.mountFromSlug=e.mountFromSlug;exports.mountTenantWidget=e.mount;exports.parseTiledeskTemplate=e.parseTiledeskTemplate;exports.registerComponents=e.registerComponents;exports.FormBridge=s.FormBridge;exports.mount=l;exports.unmount=d;