@ada-support/embed2 1.9.2 → 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/npm-entry/campaigns/types.d.ts +3 -3
- package/dist/npm-entry/client/components/ChatFrame/index.d.ts +1 -1
- package/dist/npm-entry/client/embed.d.ts +1 -1
- package/dist/npm-entry/common/constants/events.d.ts +1 -1
- package/dist/npm-entry/common/lib/ConnectContainer/index.d.ts +1 -1
- package/dist/npm-entry/common/lib/channel.d.ts +4 -4
- package/dist/npm-entry/common/types/channels.d.ts +2 -2
- package/dist/npm-entry/common/types/events.d.ts +1 -1
- package/dist/npm-entry/common/types/helpers.d.ts +1 -1
- package/dist/npm-entry/common/types/index.d.ts +1 -1
- package/dist/npm-entry/common/types/interface.d.ts +1 -1
- package/dist/npm-entry/common/types/languages.d.ts +2 -2
- package/dist/npm-entry/common/types/modules.d.ts +1 -1
- package/dist/npm-entry/common/types/store.d.ts +9 -9
- package/dist/npm-entry/index.js +5 -5
- package/dist/npm-entry/proactiveConversations/types.d.ts +4 -4
- package/dist/npm-entry/services/logger/index.d.ts +0 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type GoalEvent = unknown;
|
|
2
|
+
export type CampaignFrequency = "every-time" | "once-per-session" | "once-per-user";
|
|
3
|
+
export type TriggerCondition = URLMatchTriggerCondition | DateTimeTriggerCondition;
|
|
4
4
|
export interface URLMatchTriggerCondition {
|
|
5
5
|
type: "url-match";
|
|
6
6
|
conditions_any: [
|
|
@@ -34,7 +34,7 @@ interface PropsFromDispatch {
|
|
|
34
34
|
setGlobalState: (payload: Partial<StoreState>) => Promise<StoreState>;
|
|
35
35
|
toggleChat: () => Promise<StoreState>;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
type ChatFrameProps = PropsFromState & OwnProps & PropsFromDispatch;
|
|
38
38
|
interface ChatFrameState {
|
|
39
39
|
isMounted: boolean;
|
|
40
40
|
closeTransitionTime: number;
|
|
@@ -22,4 +22,4 @@ export declare function createEmbed(adaSettings: StartOptions): {
|
|
|
22
22
|
readonly setDeviceToken: (token: string) => Promise<void>;
|
|
23
23
|
readonly triggerProactive: (triggerProactiveParams: TriggerProactiveParams) => Promise<void>;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type Embed = ReturnType<typeof createEmbed>;
|
|
@@ -85,4 +85,4 @@ export declare enum FetchEventStatus {
|
|
|
85
85
|
Success = "SUCCESS",
|
|
86
86
|
Failure = "FAILURE"
|
|
87
87
|
}
|
|
88
|
-
export
|
|
88
|
+
export type FetchEventStatusType = FetchEventStatus.Success | FetchEventStatus.Failure;
|
|
@@ -2,7 +2,7 @@ import type { ComponentType } from "preact";
|
|
|
2
2
|
import { Component, h } from "preact";
|
|
3
3
|
import type { MapDispatchToProps, MapStateToProps, StoreProxyInterface } from "common/types/store";
|
|
4
4
|
import type { StoreState } from "common/types/store-state";
|
|
5
|
-
|
|
5
|
+
type Props<O, MSP extends MapStateToProps, MDP extends MapDispatchToProps> = {
|
|
6
6
|
store: StoreProxyInterface;
|
|
7
7
|
WrappedComponent: ComponentType<O & ReturnType<MSP> & ReturnType<MDP>>;
|
|
8
8
|
mapStateToProps?: MSP;
|
|
@@ -41,7 +41,7 @@ export interface EmbedRequestPayloadByEvent {
|
|
|
41
41
|
language: string;
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export type EmbedRequestEvent = keyof EmbedRequestPayloadByEvent;
|
|
45
45
|
export interface EmbedResponsePayloadByEvent {
|
|
46
46
|
"ALL_FRAMES_LOADED": unknown;
|
|
47
47
|
"BROWSER_HAS_NOTIFICATIONS_RESPONSE": unknown;
|
|
@@ -74,9 +74,9 @@ export interface EmbedResponsePayloadByEvent {
|
|
|
74
74
|
"SET_DEVICE_TOKEN_RESPONSE": unknown;
|
|
75
75
|
"TRIGGER_PROACTIVE_RESPONSE": unknown;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
78
|
-
export
|
|
79
|
-
export
|
|
77
|
+
export type EmbedResponseEvent = keyof EmbedResponsePayloadByEvent;
|
|
78
|
+
export type EmbedEvent = EmbedRequestEvent | EmbedResponseEvent;
|
|
79
|
+
export type PayloadByEvent = EmbedRequestPayloadByEvent & EmbedResponsePayloadByEvent;
|
|
80
80
|
export declare abstract class Channel {
|
|
81
81
|
protected abstract trackedListeners: Set<Refhandler>;
|
|
82
82
|
protected abstract trackedTimeouts: Set<number>;
|
|
@@ -2,9 +2,9 @@ import type { CustomEventChannel } from "client/lib/ce";
|
|
|
2
2
|
import type { FrameChannel } from "common/lib/fc";
|
|
3
3
|
import type { PartialRecord } from "common/types/helpers";
|
|
4
4
|
import type { Module } from "common/types/modules";
|
|
5
|
-
export
|
|
5
|
+
export type FrameChannels = PartialRecord<Module, FrameChannel>;
|
|
6
6
|
interface LocalChannel {
|
|
7
7
|
local: CustomEventChannel;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type Channels = FrameChannels & LocalChannel;
|
|
10
10
|
export {};
|
|
@@ -24,4 +24,4 @@ export interface AdaCustomEvent<E extends EmbedEvent | string = string> {
|
|
|
24
24
|
id?: string;
|
|
25
25
|
status?: FetchEventStatusType;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type Refhandler<E extends EmbedRequestEvent | string = string> = (handleEvent: MessageEvent | CustomEventInit<AdaCustomEvent<E>>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type AdaCluster = "att" | "ca" | "eu" | "ficanex" | "maple" | undefined;
|
|
@@ -45,7 +45,7 @@ export declare const Languages: {
|
|
|
45
45
|
readonly ar: "ar";
|
|
46
46
|
readonly he: "he";
|
|
47
47
|
};
|
|
48
|
-
export
|
|
49
|
-
export
|
|
48
|
+
export type LanguageKey = keyof typeof Languages;
|
|
49
|
+
export type LanguageMap = {
|
|
50
50
|
[K in LanguageKey]?: string;
|
|
51
51
|
};
|
|
@@ -5,4 +5,4 @@ export declare const INTRO_IFRAME = "intro";
|
|
|
5
5
|
export declare const BUTTON_IFRAME = "button";
|
|
6
6
|
export declare const MASK_IFRAME = "drawer-mask";
|
|
7
7
|
export declare const XSTORAGE_IFRAME = "x-storage";
|
|
8
|
-
export
|
|
8
|
+
export type Module = typeof CHAT_IFRAME | typeof ENTRY_SCRIPT | typeof EMBED_SCRIPT | typeof INTRO_IFRAME | typeof BUTTON_IFRAME | typeof MASK_IFRAME | typeof XSTORAGE_IFRAME;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { StoreState } from "./store-state";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type Get = <K extends keyof StoreState>(key: K) => Promise<StoreState[K]>;
|
|
3
|
+
export type GetState = () => Promise<StoreState>;
|
|
4
4
|
/**
|
|
5
5
|
* DirectDispatch does the same thing as Dispatch, except
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
7
|
+
export type DirectDispatch = (actionKey: string, payload?: {}) => void;
|
|
8
|
+
export type Dispatch = (actionKey: string, payload?: {}) => Promise<StoreState>;
|
|
9
|
+
export type Subscribe = (callback: (payload: StoreState) => void) => void;
|
|
10
|
+
export type MapStateToProps<R = object> = (storeState: StoreState) => R;
|
|
11
|
+
export type MapDispatchToProps<R = object> = (dispatch: Dispatch) => R;
|
|
12
12
|
export interface StoreProxyInterface {
|
|
13
13
|
get: Get;
|
|
14
14
|
getState: GetState;
|
|
15
15
|
dispatch: Dispatch;
|
|
16
16
|
subscribe: Subscribe;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type MetaFieldValue = string | number | boolean | null;
|
|
19
|
+
export type MetaFieldPayload = Record<string, MetaFieldValue>;
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -15919,7 +15919,7 @@ const client = new BrowserClient({
|
|
|
15919
15919
|
return event;
|
|
15920
15920
|
},
|
|
15921
15921
|
environment: "production",
|
|
15922
|
-
release: "1.
|
|
15922
|
+
release: "1.10.0-3873935",
|
|
15923
15923
|
sampleRate: 0.25,
|
|
15924
15924
|
autoSessionTracking: false,
|
|
15925
15925
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -16496,7 +16496,7 @@ function getEmbedURL(_ref) {
|
|
|
16496
16496
|
} else {
|
|
16497
16497
|
host = `http://${handle}.localhost:9001`;
|
|
16498
16498
|
}
|
|
16499
|
-
return `${host}/embed/${frameName}/${"
|
|
16499
|
+
return `${host}/embed/${frameName}/${"3873935"}/index.html`;
|
|
16500
16500
|
}
|
|
16501
16501
|
function constructQueryString(query) {
|
|
16502
16502
|
return Object.keys(query).map(key => {
|
|
@@ -17676,9 +17676,9 @@ async function log(message, extra, options) {
|
|
|
17676
17676
|
service: "embed",
|
|
17677
17677
|
env: "production",
|
|
17678
17678
|
embedVersion: 2,
|
|
17679
|
-
version: "1.
|
|
17679
|
+
version: "1.10.0",
|
|
17680
17680
|
isNpm: true,
|
|
17681
|
-
commitHash: "
|
|
17681
|
+
commitHash: "3873935"
|
|
17682
17682
|
}))
|
|
17683
17683
|
});
|
|
17684
17684
|
}
|
|
@@ -18852,7 +18852,7 @@ class ChatFrame extends d {
|
|
|
18852
18852
|
const hostPageUrlParams = new URL(window.location.href).searchParams;
|
|
18853
18853
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
18854
18854
|
const queryParams = {
|
|
18855
|
-
embedVersion: "
|
|
18855
|
+
embedVersion: "3873935".slice(0, 7),
|
|
18856
18856
|
greeting,
|
|
18857
18857
|
language,
|
|
18858
18858
|
skipGreeting,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ProactiveConversationUrlTriggerConditions = UrlTriggerCondition[] | null;
|
|
2
2
|
export interface ProactiveConversation {
|
|
3
3
|
messages: {
|
|
4
4
|
[language: string]: string[];
|
|
@@ -23,10 +23,10 @@ export interface RecentProactiveConversationConfig {
|
|
|
23
23
|
key: string;
|
|
24
24
|
params: Record<string, string>;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type ProactiveConversationFrequency = "always" | "session";
|
|
27
|
+
export type ProactiveConversationUrlTriggerConditionType = "equals" | "ends-with" | "regex" | "contains";
|
|
28
28
|
export interface UrlTriggerCondition {
|
|
29
29
|
type: ProactiveConversationUrlTriggerConditionType;
|
|
30
30
|
value: string;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type ProactiveConversationTriggerMethod = "url" | "programmatic";
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/embed2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/npm-entry",
|
|
6
6
|
"typings": "dist/npm-entry/index-npm.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=20"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production npx webpack --config webpack.prod.ts",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"@babel/preset-env": "^7.23.2",
|
|
54
54
|
"@babel/preset-typescript": "^7.23.2",
|
|
55
55
|
"@testing-library/preact": "^2.0.1",
|
|
56
|
-
"@types/enzyme": "^3.10.
|
|
56
|
+
"@types/enzyme": "^3.10.18",
|
|
57
57
|
"@types/jest": "^27.0.2",
|
|
58
58
|
"@types/json-stable-stringify": "^1.0.33",
|
|
59
59
|
"@types/lodash.debounce": "^4.0.6",
|
|
60
60
|
"@types/lodash.memoize": "^4.1.6",
|
|
61
|
-
"@types/node": "^
|
|
61
|
+
"@types/node": "^20.17.58",
|
|
62
62
|
"@types/uniqid": "^5.3.2",
|
|
63
63
|
"@types/webpack": "^5.28.0",
|
|
64
64
|
"@types/webpack-bundle-analyzer": "^4.4.1",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"start-server-and-test": "^2.0.4",
|
|
89
89
|
"ts-node": "^10.2.1",
|
|
90
90
|
"tsconfig-paths": "^3.11.0",
|
|
91
|
-
"typescript": "^
|
|
91
|
+
"typescript": "^5.6.3",
|
|
92
92
|
"webpack": "^5.76.0",
|
|
93
93
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
94
94
|
"webpack-cli": "^5.1.4",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"webpack-merge": "^5.8.0"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@ada-support/embed-types": "^1.9.
|
|
99
|
+
"@ada-support/embed-types": "^1.9.2",
|
|
100
100
|
"@ada-support/web-storage": "^1.2.9",
|
|
101
101
|
"@babel/runtime-corejs3": "^7.26.10",
|
|
102
102
|
"@sentry/browser": "^8.33.0",
|