@aikaara/chat-sdk 1.3.4 → 1.4.0
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/{AikaaraLinkButton-C1S7MfVT.mjs → AikaaraLinkButton--t5yyst9.mjs} +20 -17
- package/dist/AikaaraLinkButton-DtbxlRUu.cjs +25 -0
- package/dist/AikaaraPaymentLink-BlxQSATl.cjs +1 -0
- package/dist/AikaaraPaymentLink-BuQX9XAE.mjs +155 -0
- package/dist/{MountTenant-DYhDyux6.cjs → MountTenant-DUSZye2K.cjs} +71 -71
- package/dist/{MountTenant-a_9ZUVQQ.mjs → MountTenant-xtZIgPSM.mjs} +1717 -1691
- package/dist/cdn/aikaara-chat.iife.js +56 -56
- package/dist/headless.cjs +1 -1
- package/dist/headless.d.ts +12 -6
- package/dist/headless.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +5 -3
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/AikaaraLinkButton-VDNx7RfC.cjs +0 -25
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-DUSZye2K.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.runMethodSelectPreflight=e.runMethodSelectPreflight;exports.FormBridge=s;
|
package/dist/headless.d.ts
CHANGED
|
@@ -837,9 +837,11 @@ export declare function isTiledeskSelfEcho(message: TiledeskMessage, userId: str
|
|
|
837
837
|
export declare interface LinkHandler {
|
|
838
838
|
/** Glob pattern matched against the clicked URL. */
|
|
839
839
|
match: string;
|
|
840
|
-
/** What to do on match. `tab` opens in new tab, `
|
|
841
|
-
*
|
|
842
|
-
|
|
840
|
+
/** What to do on match. `tab` opens in new tab, `popup` opens a centered
|
|
841
|
+
* popup window (auto-closes on `window.opener.postMessage`), `iframe` uses
|
|
842
|
+
* default modal, `fetch-render` fetches data and mounts `render` inside the
|
|
843
|
+
* modal. */
|
|
844
|
+
target?: 'tab' | 'popup' | 'iframe' | 'fetch-render';
|
|
843
845
|
/** Modal title when `target` involves the modal. Default: link text. */
|
|
844
846
|
title?: string;
|
|
845
847
|
/** Fetch config (only used with `target: "fetch-render"`). */
|
|
@@ -2681,9 +2683,10 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2681
2683
|
* Razorpay Checkout config consumed by the `payment_link` IIFE template.
|
|
2682
2684
|
* `keyId` is the publishable key (safe to expose). `preferredBanksUrl`
|
|
2683
2685
|
* (optional) is a tenant endpoint that returns the list of allowed
|
|
2684
|
-
* netbanking codes for an order, called as
|
|
2685
|
-
* the chat JWT as Bearer;
|
|
2686
|
-
* netbanking with those
|
|
2686
|
+
* netbanking codes for an order, called as `<method> <url>?orderId=<id>`
|
|
2687
|
+
* (default GET; see `preferredBanksMethod`) with the chat JWT as Bearer;
|
|
2688
|
+
* when present the Razorpay UI is restricted to netbanking with those
|
|
2689
|
+
* banks.
|
|
2687
2690
|
*/
|
|
2688
2691
|
razorpay?: {
|
|
2689
2692
|
keyId?: string;
|
|
@@ -2691,6 +2694,9 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2691
2694
|
name?: string;
|
|
2692
2695
|
/** Endpoint template; `{orderId}` is substituted, else appended as `?orderId=`. */
|
|
2693
2696
|
preferredBanksUrl?: string;
|
|
2697
|
+
/** HTTP verb for the preferred-banks call. Default GET; POST also sends
|
|
2698
|
+
* `{ orderId }` as a JSON body. */
|
|
2699
|
+
preferredBanksMethod?: 'GET' | 'POST';
|
|
2694
2700
|
};
|
|
2695
2701
|
/**
|
|
2696
2702
|
* Native-login config consumed by the hosted-shell's `LoginScreen`
|
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, G as w } from "./MountTenant-
|
|
1
|
+
import { E as s } from "./MountTenant-xtZIgPSM.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, G as w } from "./MountTenant-xtZIgPSM.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-DUSZye2K.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.runMethodSelectPreflight=e.runMethodSelectPreflight;exports.FormBridge=s.FormBridge;exports.mount=l;exports.unmount=d;
|
package/dist/index.d.ts
CHANGED
|
@@ -786,9 +786,11 @@ export declare function isTiledeskSelfEcho(message: TiledeskMessage, userId: str
|
|
|
786
786
|
export declare interface LinkHandler {
|
|
787
787
|
/** Glob pattern matched against the clicked URL. */
|
|
788
788
|
match: string;
|
|
789
|
-
/** What to do on match. `tab` opens in new tab, `
|
|
790
|
-
*
|
|
791
|
-
|
|
789
|
+
/** What to do on match. `tab` opens in new tab, `popup` opens a centered
|
|
790
|
+
* popup window (auto-closes on `window.opener.postMessage`), `iframe` uses
|
|
791
|
+
* default modal, `fetch-render` fetches data and mounts `render` inside the
|
|
792
|
+
* modal. */
|
|
793
|
+
target?: 'tab' | 'popup' | 'iframe' | 'fetch-render';
|
|
792
794
|
/** Modal title when `target` involves the modal. Default: link text. */
|
|
793
795
|
title?: string;
|
|
794
796
|
/** Fetch config (only used with `target: "fetch-render"`). */
|
|
@@ -2454,9 +2456,10 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2454
2456
|
* Razorpay Checkout config consumed by the `payment_link` IIFE template.
|
|
2455
2457
|
* `keyId` is the publishable key (safe to expose). `preferredBanksUrl`
|
|
2456
2458
|
* (optional) is a tenant endpoint that returns the list of allowed
|
|
2457
|
-
* netbanking codes for an order, called as
|
|
2458
|
-
* the chat JWT as Bearer;
|
|
2459
|
-
* netbanking with those
|
|
2459
|
+
* netbanking codes for an order, called as `<method> <url>?orderId=<id>`
|
|
2460
|
+
* (default GET; see `preferredBanksMethod`) with the chat JWT as Bearer;
|
|
2461
|
+
* when present the Razorpay UI is restricted to netbanking with those
|
|
2462
|
+
* banks.
|
|
2460
2463
|
*/
|
|
2461
2464
|
razorpay?: {
|
|
2462
2465
|
keyId?: string;
|
|
@@ -2464,6 +2467,9 @@ export declare interface WidgetConfigDescriptor {
|
|
|
2464
2467
|
name?: string;
|
|
2465
2468
|
/** Endpoint template; `{orderId}` is substituted, else appended as `?orderId=`. */
|
|
2466
2469
|
preferredBanksUrl?: string;
|
|
2470
|
+
/** HTTP verb for the preferred-banks call. Default GET; POST also sends
|
|
2471
|
+
* `{ orderId }` as a JSON body. */
|
|
2472
|
+
preferredBanksMethod?: 'GET' | 'POST';
|
|
2467
2473
|
};
|
|
2468
2474
|
/**
|
|
2469
2475
|
* Native-login config consumed by the hosted-shell's `LoginScreen`
|
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 g, c as h, d as k, e as A, f as C, g as T, h as b, i as f, j as v, k as S, C as y, l as M, m as w, E, M as x, S as B, n as F, T as U, o as D, p as I, q as P, s as j, t as q, u as H, v as R, w as W, x as z, y as G, z as K, B as L, D as O, F as J, G as N } from "./MountTenant-
|
|
1
|
+
import { r as o } from "./MountTenant-xtZIgPSM.mjs";
|
|
2
|
+
import { A as u, a as m, b as g, c as h, d as k, e as A, f as C, g as T, h as b, i as f, j as v, k as S, C as y, l as M, m as w, E, M as x, S as B, n as F, T as U, o as D, p as I, q as P, s as j, t as q, u as H, v as R, w as W, x as z, y as G, z as K, B as L, D as O, F as J, G as N } from "./MountTenant-xtZIgPSM.mjs";
|
|
3
3
|
import { FormBridge as V } 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-DUSZye2K.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.AikaaraSchemaForm=a.AikaaraSchemaForm;exports.AikaaraSmartEditModal=a.AikaaraSmartEditModal;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.d.ts
CHANGED
|
@@ -835,9 +835,11 @@ declare interface GroupField extends BaseField {
|
|
|
835
835
|
declare interface LinkHandler {
|
|
836
836
|
/** Glob pattern matched against the clicked URL. */
|
|
837
837
|
match: string;
|
|
838
|
-
/** What to do on match. `tab` opens in new tab, `
|
|
839
|
-
*
|
|
840
|
-
|
|
838
|
+
/** What to do on match. `tab` opens in new tab, `popup` opens a centered
|
|
839
|
+
* popup window (auto-closes on `window.opener.postMessage`), `iframe` uses
|
|
840
|
+
* default modal, `fetch-render` fetches data and mounts `render` inside the
|
|
841
|
+
* modal. */
|
|
842
|
+
target?: 'tab' | 'popup' | 'iframe' | 'fetch-render';
|
|
841
843
|
/** Modal title when `target` involves the modal. Default: link text. */
|
|
842
844
|
title?: string;
|
|
843
845
|
/** Fetch config (only used with `target: "fetch-render"`). */
|
package/dist/ui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as i, a as s, c as e, d as t, e as A, J as k, f as n, K as o, g as m, h as d, L as l, N as g, O as h, P as p, i as C, Q as M, R as b, U as c, j as S, r as u } from "./MountTenant-xtZIgPSM.mjs";
|
|
2
2
|
export {
|
|
3
3
|
i as AikaaraChat,
|
|
4
4
|
s as AikaaraChatBubble,
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class d extends HTMLElement{shadow;payload=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render()}setPayload(e){this.payload=e,this.render()}render(){const e=this.payload;this.shadow.innerHTML=`
|
|
2
|
-
<style>
|
|
3
|
-
:host { display: block; margin-top: 8px; }
|
|
4
|
-
button {
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
gap: 6px;
|
|
8
|
-
padding: 10px 16px;
|
|
9
|
-
background: var(--aikaara-primary, #0f2e5c);
|
|
10
|
-
color: var(--aikaara-primary-contrast, #fff);
|
|
11
|
-
border: none;
|
|
12
|
-
border-radius: var(--aikaara-button-radius, 8px);
|
|
13
|
-
font-family: var(--aikaara-font, system-ui);
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
}
|
|
18
|
-
button:hover { background: var(--aikaara-primary-hover, #0a2347); }
|
|
19
|
-
button[disabled] { opacity: 0.5; cursor: not-allowed; }
|
|
20
|
-
</style>
|
|
21
|
-
<button type="button" ${e?"":"disabled"}>
|
|
22
|
-
${c(e?.name??"Open")}
|
|
23
|
-
<span aria-hidden="true">↗</span>
|
|
24
|
-
</button>
|
|
25
|
-
`,this.shadow.querySelector("button")?.addEventListener("click",()=>this.handleClick())}handleClick(){if(!this.payload)return;const{url:e,name:a,openLinkInNewTab:o,orderId:r,extra:i,messageId:n}=this.payload,s=o?"tab":"modal",l=new CustomEvent("aikaara-link-action",{detail:{url:e,name:a,orderId:r,openedIn:s,extra:i,messageId:n},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(l))if(o)window.open(e,"_blank","noopener,noreferrer");else{const u=p();requestAnimationFrame(()=>u?.show?.(e,a))}this.dispatchEvent(new CustomEvent("template-action",{detail:{text:a,attributes:{action:{type:"link",url:e,orderId:r,openedIn:s,...i??{}},...n?{message_id:n}:{}}},bubbles:!0,composed:!0}))}}function c(t){return t.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function p(){if(typeof document>"u")return null;let t=document.querySelector("aikaara-link-modal");if(!t){const e=document.createElement("aikaara-link-modal");document.body.appendChild(e),t=e}return t}function m(){typeof customElements>"u"||customElements.get("aikaara-link-button")||customElements.define("aikaara-link-button",d)}exports.AikaaraLinkButton=d;exports.registerAikaaraLinkButton=m;
|