@aikaara/chat-sdk 0.8.7 → 0.8.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/{MountTenant-z47varff.cjs → MountTenant-BCdh7baG.cjs} +30 -30
- package/dist/{MountTenant-DQwRihyN.mjs → MountTenant-Df3fIQU6.mjs} +1708 -1664
- package/dist/cdn/aikaara-chat.iife.js +1007 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.d.ts +47 -0
- package/dist/headless.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +47 -0
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
package/dist/headless.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-BCdh7baG.cjs");class s extends e.EventEmitter{registration=null;pendingEdits=[];constructor(t){super(),this.setupListeners(t)}registerForm(t){this.registration=t;const i=this.pendingEdits.filter(r=>r.entity_type===t.entityType&&String(r.entity_id)===String(t.entityId));if(i.length>0){for(const r of i)t.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===t.entityType&&String(r.entity_id)===String(t.entityId)))}}unregisterForm(t,i){this.registration?.entityType===t&&String(this.registration?.entityId)===String(i)&&(this.registration=null)}get currentForm(){return this.registration}pushFieldUpdates(t,i,r){this.registration&&this.registration.entityType===t&&String(this.registration.entityId)===String(i)?(this.registration.onFieldUpdate(r),this.emit("edit:applied",{entityType:t,entityId:i,fields:r})):(this.pendingEdits.push({action:"edit_entity",entity_type:t,entity_id:i,fields:r}),this.emit("edit:pending",{entityType:t,entityId:i,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(t){const i=t instanceof Error?t.message:"Save failed";return this.emit("save:error",{entityType:this.registration.entityType,entityId:this.registration.entityId,error:i}),{success:!1,error:i}}}async requestTest(t){if(!this.registration?.onTest)return{success:!1,error:"Current form does not support testing"};try{return await this.registration.onTest(t),{success:!0}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Test failed"}}}setupListeners(t){t.on("action:edit_entity",i=>{this.pushFieldUpdates(i.entity_type,i.entity_id,i.fields)}),t.on("action:save_entity",i=>{this.requestSave()}),t.on("action:test_tool",i=>{this.emit("test:triggered",{toolId:i.tool_id,parameters:i.parameters}),this.requestTest(i.parameters)})}}exports.ActionCableClient=e.ActionCableClient;exports.AikaaraChatClient=e.AikaaraChatClient;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.TokenDiscoveryError=e.TokenDiscoveryError;exports.TokenDiscoveryReader=e.TokenDiscoveryReader;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.collectSsoCredentials=e.collectSsoCredentials;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.discoverToken=e.discoverToken;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.FormBridge=s;
|
package/dist/headless.d.ts
CHANGED
|
@@ -1048,6 +1048,17 @@ export declare interface Presigned3StepAdapterConfig {
|
|
|
1048
1048
|
authHeader?: () => string | Promise<string>;
|
|
1049
1049
|
/** Static extra headers for sign + register. */
|
|
1050
1050
|
extraHeaders?: Record<string, string>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Extension → MIME map applied to the S3 PUT when the browser leaves
|
|
1053
|
+
* `file.type` empty (older Safari + some Windows configs do this for
|
|
1054
|
+
* `.csv`, `.doc`, etc.). Matches the taxbuddy-flutter-mobile table at
|
|
1055
|
+
* `lib/common/resources/util.dart#contentTypeForUploadS3File` so the
|
|
1056
|
+
* same partner endpoint sees the same content-type on web + native.
|
|
1057
|
+
* Keys are lowercase extensions WITHOUT the leading dot.
|
|
1058
|
+
*/
|
|
1059
|
+
contentTypeMap?: Record<string, string>;
|
|
1060
|
+
/** Final fallback when both `file.type` and `contentTypeMap` miss. Default `application/octet-stream`. */
|
|
1061
|
+
contentTypeFallback?: string;
|
|
1051
1062
|
}
|
|
1052
1063
|
|
|
1053
1064
|
export declare interface QuerySourceConfig {
|
|
@@ -2287,6 +2298,21 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2287
2298
|
/** Absolute base URL for tenant API calls. No trailing slash. */
|
|
2288
2299
|
baseUrl?: string;
|
|
2289
2300
|
};
|
|
2301
|
+
/**
|
|
2302
|
+
* Razorpay Checkout config consumed by the `payment_link` IIFE template.
|
|
2303
|
+
* `keyId` is the publishable key (safe to expose). `preferredBanksUrl`
|
|
2304
|
+
* (optional) is a tenant endpoint that returns the list of allowed
|
|
2305
|
+
* netbanking codes for an order, called as `GET <url>?orderId=<id>` with
|
|
2306
|
+
* the chat JWT as Bearer; when present the Razorpay UI is restricted to
|
|
2307
|
+
* netbanking with those banks.
|
|
2308
|
+
*/
|
|
2309
|
+
razorpay?: {
|
|
2310
|
+
keyId?: string;
|
|
2311
|
+
/** Merchant name shown on the Checkout sheet. Defaults to descriptor.title. */
|
|
2312
|
+
name?: string;
|
|
2313
|
+
/** Endpoint template; `{orderId}` is substituted, else appended as `?orderId=`. */
|
|
2314
|
+
preferredBanksUrl?: string;
|
|
2315
|
+
};
|
|
2290
2316
|
/**
|
|
2291
2317
|
* Unified slot map. Supersedes `templates` and the bespoke
|
|
2292
2318
|
* `linkHandlers[].render` mechanism. Each key is a slot id that some
|
|
@@ -2310,6 +2336,27 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2310
2336
|
* key isn't already present. Tenants on the old shape see no change.
|
|
2311
2337
|
*/
|
|
2312
2338
|
components?: Record<string, RemoteComponent>;
|
|
2339
|
+
/**
|
|
2340
|
+
* IIFE bundles to fetch and execute at mount time, before any template
|
|
2341
|
+
* or component renders. Sourced server-side from the tenant-wide
|
|
2342
|
+
* widget-asset registry (`TenantConfiguration.sub_type = "widget_assets"`,
|
|
2343
|
+
* `mode: "preload"`). Each entry's script is loaded with `loadScriptOnce`
|
|
2344
|
+
* in parallel; a 404 on one entry does not block others, by design.
|
|
2345
|
+
*/
|
|
2346
|
+
_preload?: Array<{
|
|
2347
|
+
scriptUrl: string;
|
|
2348
|
+
}>;
|
|
2349
|
+
/**
|
|
2350
|
+
* Manifest of every tenant-wide widget asset merged into this descriptor.
|
|
2351
|
+
* Informational — useful for debugging which uploaded version is live.
|
|
2352
|
+
* Not consumed by the SDK runtime today.
|
|
2353
|
+
*/
|
|
2354
|
+
_widget_assets?: Array<{
|
|
2355
|
+
name: string;
|
|
2356
|
+
version: string;
|
|
2357
|
+
url: string;
|
|
2358
|
+
mode: string;
|
|
2359
|
+
}>;
|
|
2313
2360
|
}
|
|
2314
2361
|
|
|
2315
2362
|
/**
|
package/dist/headless.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as s } from "./MountTenant-
|
|
2
|
-
import { A as p, b as l, k as g, C as c, l as h, m as y, M as u, S as m, n as f, T, o as S, p as _, q as v, s as E, t as C, u as F, v as k, w as A, x as I, y as x, z as U, B as q, D as M, F as b } from "./MountTenant-
|
|
1
|
+
import { E as s } from "./MountTenant-Df3fIQU6.mjs";
|
|
2
|
+
import { A as p, b as l, k as g, C as c, l as h, m as y, M as u, S as m, n as f, T, o as S, p as _, q as v, s as E, t as C, u as F, v as k, w as A, x as I, y as x, z as U, B as q, D as M, F as b } from "./MountTenant-Df3fIQU6.mjs";
|
|
3
3
|
class a extends s {
|
|
4
4
|
registration = null;
|
|
5
5
|
pendingEdits = [];
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MountTenant-BCdh7baG.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[o,n]of Object.entries(i)){const r=a[o];r!=null&&t.setAttribute(n,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.TokenDiscoveryError=e.TokenDiscoveryError;exports.TokenDiscoveryReader=e.TokenDiscoveryReader;exports.clearPersistedConversationId=e.clearPersistedConversationId;exports.collectSsoCredentials=e.collectSsoCredentials;exports.createFetchUploadAdapter=e.createFetchUploadAdapter;exports.createPresigned3StepUploadAdapter=e.createPresigned3StepUploadAdapter;exports.createTiledeskHistoryAdapter=e.createTiledeskHistoryAdapter;exports.discoverToken=e.discoverToken;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;
|
package/dist/index.d.ts
CHANGED
|
@@ -951,6 +951,17 @@ export declare interface Presigned3StepAdapterConfig {
|
|
|
951
951
|
authHeader?: () => string | Promise<string>;
|
|
952
952
|
/** Static extra headers for sign + register. */
|
|
953
953
|
extraHeaders?: Record<string, string>;
|
|
954
|
+
/**
|
|
955
|
+
* Extension → MIME map applied to the S3 PUT when the browser leaves
|
|
956
|
+
* `file.type` empty (older Safari + some Windows configs do this for
|
|
957
|
+
* `.csv`, `.doc`, etc.). Matches the taxbuddy-flutter-mobile table at
|
|
958
|
+
* `lib/common/resources/util.dart#contentTypeForUploadS3File` so the
|
|
959
|
+
* same partner endpoint sees the same content-type on web + native.
|
|
960
|
+
* Keys are lowercase extensions WITHOUT the leading dot.
|
|
961
|
+
*/
|
|
962
|
+
contentTypeMap?: Record<string, string>;
|
|
963
|
+
/** Final fallback when both `file.type` and `contentTypeMap` miss. Default `application/octet-stream`. */
|
|
964
|
+
contentTypeFallback?: string;
|
|
954
965
|
}
|
|
955
966
|
|
|
956
967
|
export declare interface QuerySourceConfig {
|
|
@@ -2049,6 +2060,21 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2049
2060
|
/** Absolute base URL for tenant API calls. No trailing slash. */
|
|
2050
2061
|
baseUrl?: string;
|
|
2051
2062
|
};
|
|
2063
|
+
/**
|
|
2064
|
+
* Razorpay Checkout config consumed by the `payment_link` IIFE template.
|
|
2065
|
+
* `keyId` is the publishable key (safe to expose). `preferredBanksUrl`
|
|
2066
|
+
* (optional) is a tenant endpoint that returns the list of allowed
|
|
2067
|
+
* netbanking codes for an order, called as `GET <url>?orderId=<id>` with
|
|
2068
|
+
* the chat JWT as Bearer; when present the Razorpay UI is restricted to
|
|
2069
|
+
* netbanking with those banks.
|
|
2070
|
+
*/
|
|
2071
|
+
razorpay?: {
|
|
2072
|
+
keyId?: string;
|
|
2073
|
+
/** Merchant name shown on the Checkout sheet. Defaults to descriptor.title. */
|
|
2074
|
+
name?: string;
|
|
2075
|
+
/** Endpoint template; `{orderId}` is substituted, else appended as `?orderId=`. */
|
|
2076
|
+
preferredBanksUrl?: string;
|
|
2077
|
+
};
|
|
2052
2078
|
/**
|
|
2053
2079
|
* Unified slot map. Supersedes `templates` and the bespoke
|
|
2054
2080
|
* `linkHandlers[].render` mechanism. Each key is a slot id that some
|
|
@@ -2072,6 +2098,27 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2072
2098
|
* key isn't already present. Tenants on the old shape see no change.
|
|
2073
2099
|
*/
|
|
2074
2100
|
components?: Record<string, RemoteComponent>;
|
|
2101
|
+
/**
|
|
2102
|
+
* IIFE bundles to fetch and execute at mount time, before any template
|
|
2103
|
+
* or component renders. Sourced server-side from the tenant-wide
|
|
2104
|
+
* widget-asset registry (`TenantConfiguration.sub_type = "widget_assets"`,
|
|
2105
|
+
* `mode: "preload"`). Each entry's script is loaded with `loadScriptOnce`
|
|
2106
|
+
* in parallel; a 404 on one entry does not block others, by design.
|
|
2107
|
+
*/
|
|
2108
|
+
_preload?: Array<{
|
|
2109
|
+
scriptUrl: string;
|
|
2110
|
+
}>;
|
|
2111
|
+
/**
|
|
2112
|
+
* Manifest of every tenant-wide widget asset merged into this descriptor.
|
|
2113
|
+
* Informational — useful for debugging which uploaded version is live.
|
|
2114
|
+
* Not consumed by the SDK runtime today.
|
|
2115
|
+
*/
|
|
2116
|
+
_widget_assets?: Array<{
|
|
2117
|
+
name: string;
|
|
2118
|
+
version: string;
|
|
2119
|
+
url: string;
|
|
2120
|
+
mode: string;
|
|
2121
|
+
}>;
|
|
2075
2122
|
}
|
|
2076
2123
|
|
|
2077
2124
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as o } from "./MountTenant-
|
|
2
|
-
import { A as u, a as m, b as k, c as g, d as h, e as A, f as C, g as T, h as b, i as v, j as f, k as y, C as S, l as w, m as E, E as M, M as x, S as B, n as F, T as U, o as D, p as I, q as j, s as q, t as H, u as P, v as R, w as W, x as z, y as K, z as L, B as O, D as G, F as J } from "./MountTenant-
|
|
1
|
+
import { r as o } from "./MountTenant-Df3fIQU6.mjs";
|
|
2
|
+
import { A as u, a as m, b as k, c as g, d as h, e as A, f as C, g as T, h as b, i as v, j as f, k as y, C as S, l as w, m as E, E as M, M as x, S as B, n as F, T as U, o as D, p as I, q as j, s as q, t as H, u as P, v as R, w as W, x as z, y as K, z as L, B as O, D as G, F as J } from "./MountTenant-Df3fIQU6.mjs";
|
|
3
3
|
import { FormBridge as Q } from "./headless.mjs";
|
|
4
4
|
function l(e) {
|
|
5
5
|
o();
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./MountTenant-BCdh7baG.cjs");exports.AikaaraChat=a.AikaaraChat;exports.AikaaraChatBubble=a.AikaaraChatBubble;exports.AikaaraChatHeader=a.AikaaraChatHeader;exports.AikaaraChatInput=a.AikaaraChatInput;exports.AikaaraChatWidget=a.AikaaraChatWidget;exports.AikaaraComparePlans=a.AikaaraComparePlans;exports.AikaaraErrorBanner=a.AikaaraErrorBanner;exports.AikaaraLinkModal=a.AikaaraLinkModal;exports.AikaaraMessageBubble=a.AikaaraMessageBubble;exports.AikaaraMessageList=a.AikaaraMessageList;exports.AikaaraModalAction=a.AikaaraModalAction;exports.AikaaraOptionList=a.AikaaraOptionList;exports.AikaaraStreamingMessage=a.AikaaraStreamingMessage;exports.AikaaraSubmitAction=a.AikaaraSubmitAction;exports.AikaaraSystemPill=a.AikaaraSystemPill;exports.AikaaraTemplateRenderer=a.AikaaraTemplateRenderer;exports.AikaaraTypingIndicator=a.AikaaraTypingIndicator;exports.registerComponents=a.registerComponents;
|
package/dist/ui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as i, a as s, c as e, d as t, e as A, H as k, f as n, I as o, g, h as l, J as d, K as m, i as p, L as C, N as h, O as b, j as M, r as c } from "./MountTenant-
|
|
1
|
+
import { G as i, a as s, c as e, d as t, e as A, H as k, f as n, I as o, g, h as l, J as d, K as m, i as p, L as C, N as h, O as b, j as M, r as c } from "./MountTenant-Df3fIQU6.mjs";
|
|
2
2
|
export {
|
|
3
3
|
i as AikaaraChat,
|
|
4
4
|
s as AikaaraChatBubble,
|