@ada-cx/messaging-sdk 1.9.4 → 1.10.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/client/client-channel-handlers.d.ts +3 -0
- package/dist/client/client-host-runtime.d.ts +6 -0
- package/dist/client/client-types.d.ts +1 -0
- package/dist/client/client.d.ts +17 -2
- package/dist/client/config-helpers.d.ts +1 -17
- package/dist/client/embed-interface.d.ts +2 -0
- package/dist/client/frame-visibility.d.ts +1 -0
- package/dist/client/proactive/proactive-channel.d.ts +1 -0
- package/dist/client/proactive/proactive-runtime.d.ts +1 -0
- package/dist/embed-host/bridge.d.ts +17 -0
- package/dist/embed-host/controller-origin.d.ts +3 -0
- package/dist/embed-host/index.d.ts +2 -0
- package/dist/embed-host/layout.d.ts +16 -0
- package/dist/embed-host/registry.d.ts +220 -0
- package/dist/embed-host/window-events.d.ts +2 -0
- package/dist/embed-host/wire.d.ts +13 -0
- package/dist/embed-protocol.d.ts +217 -0
- package/dist/frame-channel/types.d.ts +2 -0
- package/dist/helpers/api-endpoint.d.ts +17 -0
- package/dist/helpers/bridge-validation.d.ts +1 -0
- package/dist/helpers/host-environment.d.ts +40 -0
- package/dist/helpers/iframe-embed-mode.d.ts +23 -0
- package/dist/helpers/integration-lifecycle.d.ts +1 -0
- package/dist/helpers/launch-controls.d.ts +3 -2
- package/dist/npm/index.cjs +6 -6
- package/dist/npm/index.cjs.map +1 -1
- package/dist/npm/index.js +6 -6
- package/dist/npm/index.js.map +1 -1
- package/dist/npm/testing.cjs +1 -1
- package/dist/npm/testing.cjs.map +1 -1
- package/dist/npm/testing.js +79 -95
- package/dist/npm/testing.js.map +1 -1
- package/package.json +8 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CustomAppFrameStyles } from "../shared-utils/index.js";
|
|
2
2
|
import type { FrameChannel, FrameName, FrameRegistry, FrameToSdkEvents, StartupConfig } from "../frame-channel/index.js";
|
|
3
|
+
import type { IframeEmbedHost } from "../helpers/iframe-embed-mode.js";
|
|
3
4
|
import type { AdaMessagingClientConfig, AdaSdkEventCallback, WindowInfo } from "./client-types.js";
|
|
4
5
|
interface BaseChannelDependencies {
|
|
5
6
|
channels: Map<FrameName, FrameChannel>;
|
|
@@ -19,6 +20,8 @@ export interface ProactiveDisplayRequest {
|
|
|
19
20
|
export interface CoreChannelDependencies extends BaseChannelDependencies {
|
|
20
21
|
channel: FrameChannel;
|
|
21
22
|
openHostNavigationInNewWindow?: boolean;
|
|
23
|
+
iframeEmbedMode?: boolean;
|
|
24
|
+
embedHost?: IframeEmbedHost;
|
|
22
25
|
config: {
|
|
23
26
|
handle: string;
|
|
24
27
|
language?: string;
|
|
@@ -39,6 +39,11 @@ export interface DeliverConfigRuntimeOptions {
|
|
|
39
39
|
testMode?: boolean;
|
|
40
40
|
privateMode?: boolean;
|
|
41
41
|
isParentElementMode?: boolean;
|
|
42
|
+
isIframeEmbed?: boolean;
|
|
43
|
+
iframeEmbedNavigation?: boolean;
|
|
44
|
+
embedHostOrigin?: string;
|
|
45
|
+
embedMode?: "inline" | "floating";
|
|
46
|
+
shimVersion?: string;
|
|
42
47
|
headless?: boolean;
|
|
43
48
|
isMobileViewport?: boolean;
|
|
44
49
|
hideDefaultHeader?: boolean;
|
|
@@ -56,6 +61,7 @@ export interface DeliverConfigRuntimeOptions {
|
|
|
56
61
|
initialURL?: string | null;
|
|
57
62
|
/** Internal (EXP-1082): the mobile webview runtime mirrors session state natively. */
|
|
58
63
|
nativeSessionMirror?: boolean;
|
|
64
|
+
embedEngagement?: boolean;
|
|
59
65
|
}
|
|
60
66
|
/** Send the client configuration to a frame. */
|
|
61
67
|
export declare function deliverConfigRuntime(channel: FrameChannel, config: DeliverConfigRuntimeOptions): void;
|
|
@@ -165,6 +165,7 @@ export interface AdaMessagingSettings {
|
|
|
165
165
|
adaReadyCallback?: (params: AdaReadyCallbackParams) => void;
|
|
166
166
|
/** Legacy callback fired when a chatter token becomes available. */
|
|
167
167
|
chatterTokenCallback?: (chatterToken: string) => void;
|
|
168
|
+
analyticsCallback?: AdaSdkEventCallback;
|
|
168
169
|
/** Legacy callback fired when the conversation ends. */
|
|
169
170
|
conversationEndCallback?: (event?: Record<string, unknown>) => void;
|
|
170
171
|
/** Legacy callback fired when the drawer opens or closes. */
|
package/dist/client/client.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ declare class AdaMessagingClient {
|
|
|
133
133
|
/** An acknowledgement that landed before the chatter token existed to send it. */
|
|
134
134
|
private _pendingUnreadAcknowledgement;
|
|
135
135
|
private _isChatOpen;
|
|
136
|
+
private _isChatOpenPending;
|
|
136
137
|
private _runtimeGeneration;
|
|
137
138
|
private _resetGeneration;
|
|
138
139
|
private _visibilityGeneration;
|
|
@@ -146,6 +147,7 @@ declare class AdaMessagingClient {
|
|
|
146
147
|
/** Explicit host/user engagement, distinct from a hidden background resume. */
|
|
147
148
|
private _hasExplicitlyEngaged;
|
|
148
149
|
private _nativeViewVisible;
|
|
150
|
+
private _embedVisibilityObserver;
|
|
149
151
|
private _nativeVisibilityReported;
|
|
150
152
|
private _sessionPreparationSent;
|
|
151
153
|
/** Resolved HTMLElement when parentElement config is active, null otherwise */
|
|
@@ -172,6 +174,7 @@ declare class AdaMessagingClient {
|
|
|
172
174
|
private _pendingHostCallbackErrors;
|
|
173
175
|
private readonly _hostCallbackErrorSink;
|
|
174
176
|
private _cleanupCoreChannelHandlers;
|
|
177
|
+
private _hasConnectedCore;
|
|
175
178
|
private _restoreStandaloneDocument;
|
|
176
179
|
private _cleanupServiceWorkerNotificationClick;
|
|
177
180
|
private _activationId;
|
|
@@ -227,6 +230,7 @@ declare class AdaMessagingClient {
|
|
|
227
230
|
private _shownCampaign;
|
|
228
231
|
private _openedCampaignSeq;
|
|
229
232
|
private _introSurfaceSeq;
|
|
233
|
+
private _reportedPageUrl;
|
|
230
234
|
private _currentIntroSurface;
|
|
231
235
|
private _internalHostTelemetry?;
|
|
232
236
|
private _isStandaloneChatPage;
|
|
@@ -282,6 +286,7 @@ declare class AdaMessagingClient {
|
|
|
282
286
|
* window.adaEmbed.close();
|
|
283
287
|
*/
|
|
284
288
|
close(reason?: "close" | "minimize"): void;
|
|
289
|
+
private _close;
|
|
285
290
|
/**
|
|
286
291
|
* Reset the active conversation and optionally apply new configuration.
|
|
287
292
|
* Use this when the authenticated user changes or to start a fresh session.
|
|
@@ -324,6 +329,9 @@ declare class AdaMessagingClient {
|
|
|
324
329
|
private _warnAboutLegacySettings;
|
|
325
330
|
private get _isLegacyLoader();
|
|
326
331
|
private _createContainer;
|
|
332
|
+
private _cancelLauncherExposureRetry;
|
|
333
|
+
private _launcherExposureRetryAttempt;
|
|
334
|
+
private _retryLauncherExposure;
|
|
327
335
|
/**
|
|
328
336
|
* Give a height-less inline (`parentElement`) host a 720px floor so the
|
|
329
337
|
* absolutely-filled chat frame is visible instead of collapsing to 0.
|
|
@@ -615,6 +623,8 @@ declare class AdaMessagingClient {
|
|
|
615
623
|
* @deprecated Messaging supports only generative features; scripted/declarative campaigns are ignored.
|
|
616
624
|
*/
|
|
617
625
|
evaluateCampaignConditions(..._args: unknown[]): void;
|
|
626
|
+
/** Report an absolute HTTP(S) page URL on load and navigation. Embed URLs must match the parent origin. */
|
|
627
|
+
setPageUrl(url: string): void;
|
|
618
628
|
/** Close the currently displayed proactive or campaign bubble. */
|
|
619
629
|
closeCampaign(): void;
|
|
620
630
|
/**
|
|
@@ -633,8 +643,8 @@ declare class AdaMessagingClient {
|
|
|
633
643
|
* Use with {@link AdaMessagingClientConfig.lazy} = `true` to defer initialization
|
|
634
644
|
* until an explicit user action, then call `start()` to mount.
|
|
635
645
|
* Optional settings overrides are applied before first initialization.
|
|
636
|
-
* Headless and capable native hosts restore at start and create on engagement.
|
|
637
|
-
*
|
|
646
|
+
* Headless, observer-capable iframe embeds, and capable native hosts restore at start and create on engagement.
|
|
647
|
+
* Other web parentElement hosts activate through the document visibility wait.
|
|
638
648
|
*
|
|
639
649
|
* @example
|
|
640
650
|
* // Defer loading until consent granted:
|
|
@@ -744,6 +754,7 @@ declare class AdaMessagingClient {
|
|
|
744
754
|
private _ensureIntroFrame;
|
|
745
755
|
private _showOrQueueEmojiDisplay;
|
|
746
756
|
private _drainPendingEmojiDisplay;
|
|
757
|
+
private _displayIntroWithLayout;
|
|
747
758
|
private _drainPendingIntroDisplay;
|
|
748
759
|
private _clearPendingIntroDisplay;
|
|
749
760
|
private _dropPendingIntroDisplay;
|
|
@@ -895,6 +906,7 @@ declare class AdaMessagingClient {
|
|
|
895
906
|
private _setChatterToken;
|
|
896
907
|
private _scheduleCandidateDiscovery;
|
|
897
908
|
private _setPersistedChatterCandidate;
|
|
909
|
+
private get _usesEmbedVisibility();
|
|
898
910
|
private get _waitsForEngagement();
|
|
899
911
|
private _reportNativeViewVisibility;
|
|
900
912
|
private _beginExplicitEngagement;
|
|
@@ -941,6 +953,7 @@ declare class AdaMessagingClient {
|
|
|
941
953
|
/** Patch only the current chatter when an accepted proactive is removed. */
|
|
942
954
|
private _markProactiveIntroShown;
|
|
943
955
|
/**
|
|
956
|
+
* Iframe embeds cannot observe the host page URL.
|
|
944
957
|
* Standalone URLs can carry credentials and metadata.
|
|
945
958
|
* The SDK suppresses URLs for marked asset documents and HTTPS `/chat[/]` pages without ports
|
|
946
959
|
* on a strict subdomain of the configured cluster domain.
|
|
@@ -948,6 +961,7 @@ declare class AdaMessagingClient {
|
|
|
948
961
|
* Host-supplied markers or endpoint overrides cannot establish either document origin.
|
|
949
962
|
*/
|
|
950
963
|
private _initialUrlMetaField;
|
|
964
|
+
private _pageUrl;
|
|
951
965
|
/**
|
|
952
966
|
* Where this build loads its own frames from. Preserves any path prefix (e.g.
|
|
953
967
|
* "/messaging" on the static.ada.support root) so frame URLs don't 404 there;
|
|
@@ -970,6 +984,7 @@ declare class AdaMessagingClient {
|
|
|
970
984
|
private _scheduleRuntimeMetaSync;
|
|
971
985
|
/** Called on every SPA navigation. Re-evaluates intro and proactive conditions. */
|
|
972
986
|
private _onLocationChange;
|
|
987
|
+
private _cancelPendingChatOpen;
|
|
973
988
|
/**
|
|
974
989
|
* Evaluate URL-triggered proactive conversations for the current page,
|
|
975
990
|
* without the intro-greeting scheduling that `_onLocationChange` also does.
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import { CSAT_INTEGRATION_ID, CSAT_SUBMIT_ACTION, normalizeCsatSubmitAction, VALID_ADA_CLUSTERS } from "../shared-utils/index.js";
|
|
2
2
|
import type { MetaFieldCounts } from "../frame-channel/types.js";
|
|
3
3
|
import type { AdaMessagingBranding, MetaFieldValue } from "./client-types.js";
|
|
4
|
+
export { buildApiEndpoint, deriveLocalhostApiProxyBase, LOCAL_ASSETS_HOSTNAME, LOCAL_BOT_API_PORT, LOCALHOST_API_PROXY_BASE, LOOPBACK_API_PROXY_PORT, validateEndpointOverride, } from "../helpers/api-endpoint.js";
|
|
4
5
|
export declare const LOCALHOST_CLUSTER = "localhost";
|
|
5
6
|
export declare const DEFAULT_ADA_DOMAIN = "ada";
|
|
6
7
|
export { VALID_ADA_CLUSTERS };
|
|
7
8
|
export declare const KNOWN_ADA_BASE_DOMAINS: Set<string>;
|
|
8
9
|
export declare const HANDLE_PATTERN: RegExp;
|
|
9
|
-
export declare const LOCALHOST_API_PROXY_BASE = "https://messaging-demo.net:5040/api";
|
|
10
|
-
export declare const LOOPBACK_API_PROXY_PORT = 5040;
|
|
11
|
-
/** Hostname of the local messaging asset server (the /etc/hosts alias serving the SDK
|
|
12
|
-
* on :4900). When the SDK loads from here the demo-server proxy (:5040) is running
|
|
13
|
-
* too, so the bot API is reached through it — not the direct-bot fallback. */
|
|
14
|
-
export declare const LOCAL_ASSETS_HOSTNAME = "messaging-assets.net";
|
|
15
|
-
/** The api's default local `APP_PORT`. A `<handle>.localhost` host page (e.g. the
|
|
16
|
-
* app dashboard's Test Chat) talks to its bot api directly on this port. */
|
|
17
|
-
export declare const LOCAL_BOT_API_PORT = 8000;
|
|
18
|
-
export declare function deriveLocalhostApiProxyBase(sdkUrl: string, pageHost?: string): string;
|
|
19
10
|
export declare function normalizeIdentityToken(value: unknown): string | undefined;
|
|
20
11
|
export declare function normalizeCrossWindowPersistence(value: unknown): boolean | undefined;
|
|
21
12
|
/**
|
|
@@ -74,13 +65,6 @@ export interface TrackedIntegrationCommand {
|
|
|
74
65
|
requestId?: string;
|
|
75
66
|
zendeskOperationSeq?: number;
|
|
76
67
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Normalize and validate a customer-provided endpoint override.
|
|
79
|
-
* Throws on invalid input so the constructor surfaces config errors early.
|
|
80
|
-
*/
|
|
81
|
-
export declare function validateEndpointOverride(endpoint: string): string;
|
|
82
|
-
/** Append `/api/` to a base URL, avoiding double-appending if already present. */
|
|
83
|
-
export declare function buildApiEndpoint(apiBase: string): string;
|
|
84
68
|
export declare function normalizeClusterInput(value: string | null | undefined): string | null;
|
|
85
69
|
export declare function validateCluster(cluster: string, label: string): string;
|
|
86
70
|
/**
|
|
@@ -146,6 +146,8 @@ export interface AdaEmbedInterface {
|
|
|
146
146
|
evaluateCampaignConditions: (options?: Record<string, unknown>) => Promise<void>;
|
|
147
147
|
/** Close the currently displayed proactive or campaign bubble. */
|
|
148
148
|
closeCampaign: () => Promise<void>;
|
|
149
|
+
/** Set the page URL used for targeting and SDK metadata on load and navigation. */
|
|
150
|
+
setPageUrl: (url: string) => Promise<void>;
|
|
149
151
|
/** Trigger a generative Answer by its response id. */
|
|
150
152
|
triggerAnswer: (answerId: string) => Promise<void>;
|
|
151
153
|
/** Trigger a proactive message by key, with optional template params. */
|
|
@@ -38,6 +38,7 @@ export declare function hasMeasuredSize(frame: HTMLElement | null | undefined):
|
|
|
38
38
|
* cannot override a hidden ancestor and so reads as an opt-back-in it can never be.
|
|
39
39
|
*/
|
|
40
40
|
export declare function setFrameHidden(frame: HTMLElement | null | undefined, hidden: boolean): void;
|
|
41
|
+
export declare function hideFrameUntilLayoutApplied(frame: HTMLElement): void;
|
|
41
42
|
/**
|
|
42
43
|
* Write a frame's style block and bring its accessibility exposure with it.
|
|
43
44
|
*
|
|
@@ -28,6 +28,7 @@ export interface IntroChannelDependencies {
|
|
|
28
28
|
/** Open a proactive bubble's branded CTA URL from the host-page context. The
|
|
29
29
|
* intro frame is sandboxed without allow-popups, so it cannot navigate itself;
|
|
30
30
|
* it delegates the open to the SDK running on the host page. */
|
|
31
|
+
retireLayoutSurface?: () => void;
|
|
31
32
|
openCtaUrl?: (url: string, openInNewTab: boolean) => void;
|
|
32
33
|
}
|
|
33
34
|
/** Wire all message handlers for the intro (proactive messages + greeting) frame. */
|
|
@@ -3,6 +3,7 @@ export type IntroShowingState = "greeting" | "proactive" | null;
|
|
|
3
3
|
export type IntroDisplayKind = "greeting" | "proactive";
|
|
4
4
|
export interface ProactiveRuntimeDependencies {
|
|
5
5
|
handle: string;
|
|
6
|
+
getPageUrl?: () => string | null;
|
|
6
7
|
language?: string;
|
|
7
8
|
parentElement: HTMLElement | null;
|
|
8
9
|
/** Whether the resolved host layout currently permits launcher/intro chrome. */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ConnectInbox {
|
|
2
|
+
drain(receive: (event: MessageEvent) => void): void;
|
|
3
|
+
close(): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createConnectInbox(win: Window): ConnectInbox;
|
|
6
|
+
export declare function validConnect(data: Record<string, unknown>): boolean;
|
|
7
|
+
export declare function createEmbedHostBridge(options: {
|
|
8
|
+
window: Window;
|
|
9
|
+
documentId: string;
|
|
10
|
+
handle: string;
|
|
11
|
+
cluster: string;
|
|
12
|
+
parentElement: HTMLElement;
|
|
13
|
+
inbox?: ConnectInbox;
|
|
14
|
+
}): {
|
|
15
|
+
configure: (config: unknown) => boolean;
|
|
16
|
+
destroy: () => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DrawnRegions, HostEnvironment } from "../helpers/host-environment.js";
|
|
2
|
+
export declare function drawnRegion(element: HTMLElement): DrawnRegions;
|
|
3
|
+
export declare function covers(cover: DrawnRegions, required: DrawnRegions): boolean;
|
|
4
|
+
export declare function createLayoutChannel(options: {
|
|
5
|
+
window: Window;
|
|
6
|
+
send(kind: string, fields: Record<string, unknown>): void;
|
|
7
|
+
generation(): number;
|
|
8
|
+
restart(): void;
|
|
9
|
+
failure(): void;
|
|
10
|
+
}): {
|
|
11
|
+
environment: HostEnvironment;
|
|
12
|
+
receive: (data: Record<string, unknown>) => boolean;
|
|
13
|
+
resync: () => void;
|
|
14
|
+
restarted(): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
export declare const METHOD_CLASSIFICATION: {
|
|
2
|
+
readonly open: "exposed";
|
|
3
|
+
readonly close: "exposed";
|
|
4
|
+
readonly reset: "exposed";
|
|
5
|
+
readonly toggle: "exposed";
|
|
6
|
+
readonly getInfo: "exposed";
|
|
7
|
+
readonly isOpen: "exposed";
|
|
8
|
+
readonly getMetaFields: "exposed";
|
|
9
|
+
readonly getConversation: "exposed";
|
|
10
|
+
readonly getMessages: "exposed";
|
|
11
|
+
readonly setComposerText: "exposed";
|
|
12
|
+
readonly setDelegate: "exposed";
|
|
13
|
+
readonly deleteHistory: "exposed";
|
|
14
|
+
readonly setLanguage: "exposed";
|
|
15
|
+
readonly setTheme: "exposed";
|
|
16
|
+
readonly setMetaFields: "exposed";
|
|
17
|
+
readonly setSensitiveMetaFields: "exposed";
|
|
18
|
+
readonly setDeviceToken: "exposed";
|
|
19
|
+
readonly sendMessage: "exposed";
|
|
20
|
+
readonly triggerPlaybook: "exposed";
|
|
21
|
+
readonly selectQuickReply: "exposed";
|
|
22
|
+
readonly trackEvent: "exposed";
|
|
23
|
+
readonly subscribeEvent: "exposed";
|
|
24
|
+
readonly unsubscribeEvent: "exposed";
|
|
25
|
+
readonly subscribeAll: "exposed";
|
|
26
|
+
readonly triggerProactive: "exposed";
|
|
27
|
+
readonly triggerProactiveConversation: "exposed";
|
|
28
|
+
readonly createProactive: "exposed";
|
|
29
|
+
readonly triggerCampaign: "exposed";
|
|
30
|
+
readonly evaluateCampaignConditions: "exposed";
|
|
31
|
+
readonly closeCampaign: "exposed";
|
|
32
|
+
readonly setPageUrl: "exposed";
|
|
33
|
+
readonly triggerAnswer: "exposed";
|
|
34
|
+
readonly start: "exposed";
|
|
35
|
+
readonly stop: "exposed";
|
|
36
|
+
readonly triggerGreeting: "exposed";
|
|
37
|
+
readonly destroy: "exposed";
|
|
38
|
+
readonly requestNotifications: "exposed";
|
|
39
|
+
readonly handleNotification: "exposed";
|
|
40
|
+
readonly setTestModeBanner: "internal";
|
|
41
|
+
readonly acknowledgeSessionMirrorClear: "internal";
|
|
42
|
+
readonly deliverSessionMirrorSeed: "internal";
|
|
43
|
+
};
|
|
44
|
+
export declare const CONFIG_CLASSIFICATION: {
|
|
45
|
+
readonly handle: "fixed";
|
|
46
|
+
readonly cluster: "fixed";
|
|
47
|
+
readonly domain: "fixed";
|
|
48
|
+
readonly endpoint: "fixed";
|
|
49
|
+
readonly rolloutOverride: "fixed";
|
|
50
|
+
readonly parentElement: "embed_owned";
|
|
51
|
+
readonly align: "embed_owned";
|
|
52
|
+
readonly hideMask: "embed_owned";
|
|
53
|
+
readonly lazy: "embed_owned";
|
|
54
|
+
readonly toggleCallback: "embed_owned";
|
|
55
|
+
readonly onAdaEmbedLoaded: "embed_owned";
|
|
56
|
+
readonly deviceToken: "passthrough";
|
|
57
|
+
readonly language: "passthrough";
|
|
58
|
+
readonly greeting: "passthrough";
|
|
59
|
+
readonly skipGreeting: "passthrough";
|
|
60
|
+
readonly identityToken: "passthrough";
|
|
61
|
+
readonly appUrl: "passthrough";
|
|
62
|
+
readonly appUrlFallback: "passthrough";
|
|
63
|
+
readonly metaFields: "passthrough";
|
|
64
|
+
readonly allowMetaFieldsInReset: "passthrough";
|
|
65
|
+
readonly enableProgrammaticControl: "passthrough";
|
|
66
|
+
readonly styles: "passthrough";
|
|
67
|
+
readonly branding: "passthrough";
|
|
68
|
+
readonly hideDefaultHeader: "passthrough";
|
|
69
|
+
readonly privateMode: "passthrough";
|
|
70
|
+
readonly testMode: "passthrough";
|
|
71
|
+
readonly headless: "passthrough";
|
|
72
|
+
readonly showFallbackOnTimeout: "passthrough";
|
|
73
|
+
readonly sensitiveMetaFields: "passthrough";
|
|
74
|
+
readonly eventCallbacks: "passthrough";
|
|
75
|
+
readonly crossWindowPersistence: "passthrough";
|
|
76
|
+
readonly theme: "passthrough";
|
|
77
|
+
readonly adaReadyCallback: "passthrough";
|
|
78
|
+
readonly chatterTokenCallback: "passthrough";
|
|
79
|
+
readonly conversationEndCallback: "passthrough";
|
|
80
|
+
readonly zdChatterAuthCallback: "passthrough";
|
|
81
|
+
readonly analyticsCallback: "passthrough";
|
|
82
|
+
};
|
|
83
|
+
export declare const FLOATING_CONFIG_CLASSIFICATION: {
|
|
84
|
+
readonly align: "passthrough";
|
|
85
|
+
readonly hideMask: "passthrough";
|
|
86
|
+
readonly toggleCallback: "passthrough";
|
|
87
|
+
readonly handle: "fixed";
|
|
88
|
+
readonly cluster: "fixed";
|
|
89
|
+
readonly domain: "fixed";
|
|
90
|
+
readonly endpoint: "fixed";
|
|
91
|
+
readonly rolloutOverride: "fixed";
|
|
92
|
+
readonly parentElement: "embed_owned";
|
|
93
|
+
readonly lazy: "embed_owned";
|
|
94
|
+
readonly onAdaEmbedLoaded: "embed_owned";
|
|
95
|
+
readonly deviceToken: "passthrough";
|
|
96
|
+
readonly language: "passthrough";
|
|
97
|
+
readonly greeting: "passthrough";
|
|
98
|
+
readonly skipGreeting: "passthrough";
|
|
99
|
+
readonly identityToken: "passthrough";
|
|
100
|
+
readonly appUrl: "passthrough";
|
|
101
|
+
readonly appUrlFallback: "passthrough";
|
|
102
|
+
readonly metaFields: "passthrough";
|
|
103
|
+
readonly allowMetaFieldsInReset: "passthrough";
|
|
104
|
+
readonly enableProgrammaticControl: "passthrough";
|
|
105
|
+
readonly styles: "passthrough";
|
|
106
|
+
readonly branding: "passthrough";
|
|
107
|
+
readonly hideDefaultHeader: "passthrough";
|
|
108
|
+
readonly privateMode: "passthrough";
|
|
109
|
+
readonly testMode: "passthrough";
|
|
110
|
+
readonly headless: "passthrough";
|
|
111
|
+
readonly showFallbackOnTimeout: "passthrough";
|
|
112
|
+
readonly sensitiveMetaFields: "passthrough";
|
|
113
|
+
readonly eventCallbacks: "passthrough";
|
|
114
|
+
readonly crossWindowPersistence: "passthrough";
|
|
115
|
+
readonly theme: "passthrough";
|
|
116
|
+
readonly adaReadyCallback: "passthrough";
|
|
117
|
+
readonly chatterTokenCallback: "passthrough";
|
|
118
|
+
readonly conversationEndCallback: "passthrough";
|
|
119
|
+
readonly zdChatterAuthCallback: "passthrough";
|
|
120
|
+
readonly analyticsCallback: "passthrough";
|
|
121
|
+
};
|
|
122
|
+
export declare const CONFIG_CLASSIFICATION_BY_MODE: {
|
|
123
|
+
readonly inline: {
|
|
124
|
+
readonly handle: "fixed";
|
|
125
|
+
readonly cluster: "fixed";
|
|
126
|
+
readonly domain: "fixed";
|
|
127
|
+
readonly endpoint: "fixed";
|
|
128
|
+
readonly rolloutOverride: "fixed";
|
|
129
|
+
readonly parentElement: "embed_owned";
|
|
130
|
+
readonly align: "embed_owned";
|
|
131
|
+
readonly hideMask: "embed_owned";
|
|
132
|
+
readonly lazy: "embed_owned";
|
|
133
|
+
readonly toggleCallback: "embed_owned";
|
|
134
|
+
readonly onAdaEmbedLoaded: "embed_owned";
|
|
135
|
+
readonly deviceToken: "passthrough";
|
|
136
|
+
readonly language: "passthrough";
|
|
137
|
+
readonly greeting: "passthrough";
|
|
138
|
+
readonly skipGreeting: "passthrough";
|
|
139
|
+
readonly identityToken: "passthrough";
|
|
140
|
+
readonly appUrl: "passthrough";
|
|
141
|
+
readonly appUrlFallback: "passthrough";
|
|
142
|
+
readonly metaFields: "passthrough";
|
|
143
|
+
readonly allowMetaFieldsInReset: "passthrough";
|
|
144
|
+
readonly enableProgrammaticControl: "passthrough";
|
|
145
|
+
readonly styles: "passthrough";
|
|
146
|
+
readonly branding: "passthrough";
|
|
147
|
+
readonly hideDefaultHeader: "passthrough";
|
|
148
|
+
readonly privateMode: "passthrough";
|
|
149
|
+
readonly testMode: "passthrough";
|
|
150
|
+
readonly headless: "passthrough";
|
|
151
|
+
readonly showFallbackOnTimeout: "passthrough";
|
|
152
|
+
readonly sensitiveMetaFields: "passthrough";
|
|
153
|
+
readonly eventCallbacks: "passthrough";
|
|
154
|
+
readonly crossWindowPersistence: "passthrough";
|
|
155
|
+
readonly theme: "passthrough";
|
|
156
|
+
readonly adaReadyCallback: "passthrough";
|
|
157
|
+
readonly chatterTokenCallback: "passthrough";
|
|
158
|
+
readonly conversationEndCallback: "passthrough";
|
|
159
|
+
readonly zdChatterAuthCallback: "passthrough";
|
|
160
|
+
readonly analyticsCallback: "passthrough";
|
|
161
|
+
};
|
|
162
|
+
readonly floating: {
|
|
163
|
+
readonly align: "passthrough";
|
|
164
|
+
readonly hideMask: "passthrough";
|
|
165
|
+
readonly toggleCallback: "passthrough";
|
|
166
|
+
readonly handle: "fixed";
|
|
167
|
+
readonly cluster: "fixed";
|
|
168
|
+
readonly domain: "fixed";
|
|
169
|
+
readonly endpoint: "fixed";
|
|
170
|
+
readonly rolloutOverride: "fixed";
|
|
171
|
+
readonly parentElement: "embed_owned";
|
|
172
|
+
readonly lazy: "embed_owned";
|
|
173
|
+
readonly onAdaEmbedLoaded: "embed_owned";
|
|
174
|
+
readonly deviceToken: "passthrough";
|
|
175
|
+
readonly language: "passthrough";
|
|
176
|
+
readonly greeting: "passthrough";
|
|
177
|
+
readonly skipGreeting: "passthrough";
|
|
178
|
+
readonly identityToken: "passthrough";
|
|
179
|
+
readonly appUrl: "passthrough";
|
|
180
|
+
readonly appUrlFallback: "passthrough";
|
|
181
|
+
readonly metaFields: "passthrough";
|
|
182
|
+
readonly allowMetaFieldsInReset: "passthrough";
|
|
183
|
+
readonly enableProgrammaticControl: "passthrough";
|
|
184
|
+
readonly styles: "passthrough";
|
|
185
|
+
readonly branding: "passthrough";
|
|
186
|
+
readonly hideDefaultHeader: "passthrough";
|
|
187
|
+
readonly privateMode: "passthrough";
|
|
188
|
+
readonly testMode: "passthrough";
|
|
189
|
+
readonly headless: "passthrough";
|
|
190
|
+
readonly showFallbackOnTimeout: "passthrough";
|
|
191
|
+
readonly sensitiveMetaFields: "passthrough";
|
|
192
|
+
readonly eventCallbacks: "passthrough";
|
|
193
|
+
readonly crossWindowPersistence: "passthrough";
|
|
194
|
+
readonly theme: "passthrough";
|
|
195
|
+
readonly adaReadyCallback: "passthrough";
|
|
196
|
+
readonly chatterTokenCallback: "passthrough";
|
|
197
|
+
readonly conversationEndCallback: "passthrough";
|
|
198
|
+
readonly zdChatterAuthCallback: "passthrough";
|
|
199
|
+
readonly analyticsCallback: "passthrough";
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
export declare const WINDOW_EVENTS: readonly ["ada:error", "ada:integration:event"];
|
|
203
|
+
export declare const ENVELOPE_KINDS: readonly ["connect", "connected", "already_connected", "connect_rejected", "layout.clip", "layout.applied", "layout.reset", "layout.heartbeat", "host.viewport", "host.scroll_lock", "host.escape_listen", "host.key", "host.resume", "host.navigate", "host.navigate_result", "host.notification_state", "host.notification", "host.notification_click", "request", "response", "callback", "callback_result", "release_callbacks", "release_request", "disconnect", "window_event"];
|
|
204
|
+
export declare const ERROR_CODES: readonly ["unsupported", "invalid_params", "not_started", "disconnected", "timeout", "limit_exceeded", "sdk_error", "internal"];
|
|
205
|
+
export declare const ID_LENGTH: {
|
|
206
|
+
readonly min: 1;
|
|
207
|
+
readonly max: 128;
|
|
208
|
+
};
|
|
209
|
+
export declare const RANDOM_ID_PATTERN = "^[A-Za-z0-9_-]{22}$";
|
|
210
|
+
export declare const LIMITS: {
|
|
211
|
+
readonly depth: 32;
|
|
212
|
+
readonly nodes: 50000;
|
|
213
|
+
readonly bytes: number;
|
|
214
|
+
readonly registrations: 256;
|
|
215
|
+
readonly callbacks: 64;
|
|
216
|
+
readonly requests: 64;
|
|
217
|
+
};
|
|
218
|
+
export declare function callbackSlot(method: string, path: readonly (string | number)[], mode?: "inline" | "floating"): "event" | "beforeSend" | "zendesk" | undefined;
|
|
219
|
+
export declare const EMBED_CAPABILITIES: readonly ["layout.v1", "notifications.v1", "navigate.v1"];
|
|
220
|
+
export declare const CONNECT_FIELDS: readonly ["protocol", "v", "kind", "nonce", "pageUrl", "mode", "capabilities", "shimVersion"];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EmbedError, EmbedErrorCode } from "../embed-protocol.js";
|
|
2
|
+
export declare class ProtocolError extends Error {
|
|
3
|
+
readonly code: EmbedErrorCode;
|
|
4
|
+
constructor(code: EmbedErrorCode);
|
|
5
|
+
}
|
|
6
|
+
export declare function normalizeError(error: unknown): EmbedError;
|
|
7
|
+
export declare function record(value: unknown): Record<string, unknown> | undefined;
|
|
8
|
+
export declare function copyWire(value: unknown, marker?: (value: Record<string, unknown>, path: (string | number)[]) => unknown): unknown;
|
|
9
|
+
export declare function envelope(kind: string, fields?: Record<string, unknown>): {
|
|
10
|
+
protocol: string;
|
|
11
|
+
v: number;
|
|
12
|
+
kind: string;
|
|
13
|
+
};
|