@ada-support/embed2 1.14.18 → 1.14.20
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/client/components/ChatFrame/index.d.ts +1 -1
- package/dist/npm-entry/client/components/Container/index.d.ts +1 -1
- package/dist/npm-entry/client/components/IFrame/index.d.ts +1 -1
- package/dist/npm-entry/client/helpers/web-notifications/web-notification-events.d.ts +1 -1
- package/dist/npm-entry/client/lib/connect.d.ts +4 -4
- package/dist/npm-entry/client/lib/store-proxy.d.ts +1 -1
- package/dist/npm-entry/client/store/actions/index.d.ts +1 -1
- package/dist/npm-entry/common/constants/actions.d.ts +11 -11
- package/dist/npm-entry/common/helpers/TriggerConditionEvaluator.d.ts +1 -1
- package/dist/npm-entry/common/helpers/isRTL.d.ts +1 -1
- package/dist/npm-entry/common/helpers/url/index.d.ts +2 -2
- package/dist/npm-entry/common/lib/ConnectContainer/index.d.ts +9 -9
- package/dist/npm-entry/common/lib/channel.d.ts +34 -34
- 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/http.d.ts +4 -4
- package/dist/npm-entry/common/types/index.d.ts +4 -5
- package/dist/npm-entry/common/types/store.d.ts +2 -2
- package/dist/npm-entry/index.js +906 -905
- package/dist/npm-entry/proactiveConversations/proactiveConversation.d.ts +3 -3
- package/package.json +5 -11
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { StartOptions } from "@ada-support/embed-types";
|
|
2
|
-
import { Component, h } from "preact";
|
|
3
2
|
import type { LightboxImage } from "client/components/LightboxOverlay";
|
|
4
3
|
import type { MessageService } from "client/lib/message-service";
|
|
5
4
|
import type { StoreProxy } from "client/lib/store-proxy";
|
|
6
5
|
import type { FrameChannel } from "common/lib/fc";
|
|
7
6
|
import type { CreateNotificationPayload, MessagePayload } from "common/types/events";
|
|
8
7
|
import type { StoreState } from "common/types/store-state";
|
|
8
|
+
import { Component, h } from "preact";
|
|
9
9
|
interface PropsFromState {
|
|
10
10
|
handle: StoreState["handle"];
|
|
11
11
|
domain: StoreState["domain"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StartOptions } from "@ada-support/embed-types";
|
|
2
|
-
import { h } from "preact";
|
|
3
2
|
import type { MessageService } from "client/lib/message-service";
|
|
4
3
|
import type { StoreProxy } from "client/lib/store-proxy";
|
|
4
|
+
import { h } from "preact";
|
|
5
5
|
interface OwnProps {
|
|
6
6
|
store: StoreProxy;
|
|
7
7
|
messageService: MessageService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h } from "preact";
|
|
2
1
|
import type { MessageService } from "client/lib/message-service";
|
|
3
2
|
import type { StoreProxy } from "client/lib/store-proxy";
|
|
3
|
+
import { h } from "preact";
|
|
4
4
|
interface OwnProps {
|
|
5
5
|
name: "button" | "x-storage" | "intro" | "drawer-mask";
|
|
6
6
|
roleDescription?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentType } from "preact";
|
|
2
|
-
import { h } from "preact";
|
|
3
1
|
import type { ActionCreators } from "common/constants/actions";
|
|
4
2
|
import type { Dispatch, MapDispatchToProps, MapStateToProps } from "common/types/store";
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import type { ComponentType } from "preact";
|
|
4
|
+
import { h } from "preact";
|
|
5
|
+
export declare function connect<MapState extends MapStateToProps, MapDispatch extends MapDispatchToProps>(mapStateToProps?: MapState, mapDispatchToProps?: MapDispatch): <O>(WrappedComponent: ComponentType<O & ReturnType<MapState> & ReturnType<MapDispatch>>) => (ownProps: O) => h.JSX.Element;
|
|
6
|
+
export declare function bindActionCreators(action: Partial<ActionCreators>, dispatch: Dispatch): (payload?: Record<string, unknown>) => Promise<import("../../common/types/store-state").StoreState>;
|
|
@@ -11,7 +11,7 @@ export declare class StoreProxy implements StoreProxyInterface {
|
|
|
11
11
|
constructor(initialState: StoreState, messageService: MessageService);
|
|
12
12
|
get: <K extends keyof StoreState>(key: K) => Promise<StoreState[K]>;
|
|
13
13
|
getState: () => Promise<StoreState>;
|
|
14
|
-
dispatch: (actionKey: string, payload?:
|
|
14
|
+
dispatch: (actionKey: string, payload?: Record<string, unknown>) => Promise<StoreState>;
|
|
15
15
|
subscribe: (callback: (payload: StoreState) => unknown) => void;
|
|
16
16
|
addChannelListener: (name: keyof Channels) => void;
|
|
17
17
|
}
|
|
@@ -4,7 +4,7 @@ import type { MessagePayload } from "common/types/events";
|
|
|
4
4
|
import type { DirectDispatch } from "common/types/store";
|
|
5
5
|
import type { StoreState } from "common/types/store-state";
|
|
6
6
|
export declare const actions: {
|
|
7
|
-
[
|
|
7
|
+
[Key in ActionCreators]: ({ currentState, payload, dispatch, }: {
|
|
8
8
|
payload?: MessagePayload;
|
|
9
9
|
currentState: StoreState;
|
|
10
10
|
dispatch: DirectDispatch;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare enum ActionCreators {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
SetStateAction = "setState",
|
|
3
|
+
ToggleChatAction = "toggleChat",
|
|
4
|
+
SetConnectionState = "setConnectionState",
|
|
5
|
+
SendUnreadMessagesAction = "sendUnreadMessages",
|
|
6
|
+
FocusOffAdaAction = "focusOffAda"
|
|
7
7
|
}
|
|
8
8
|
export declare enum ActionTypes {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
SetStateType = "SET_STATE",
|
|
10
|
+
ToggleChatType = "TOGGLE_CHAT",
|
|
11
|
+
SetMetaFieldsType = "SET_META_FIELDS",
|
|
12
|
+
SetConnectionStateType = "SET_CONNECTION_STATE",
|
|
13
|
+
IncrementMessageCountType = "INCREMENT_MESSAGE_COUNT",
|
|
14
|
+
FocusOffAdaType = "FOCUS_OFF_ADA"
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DateTimeTriggerCondition, TriggerCondition } from "campaigns/types";
|
|
2
1
|
import type { UrlTriggerCondition } from "proactiveConversations/types";
|
|
2
|
+
import type { DateTimeTriggerCondition, TriggerCondition } from "campaigns/types";
|
|
3
3
|
export declare const evalUrlMatchTriggerCondition: (triggerConditions: UrlTriggerCondition[], url: string) => boolean;
|
|
4
4
|
export declare const evalDatetimeTriggerCondition: (triggerCondition: DateTimeTriggerCondition, currentDateTime: Date) => boolean;
|
|
5
5
|
export declare const evalTriggerCondition: (triggerCondition: TriggerCondition) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StoreState } from "common/types/store-state";
|
|
2
2
|
export declare const isRTLLanguage: (language: StoreState["language"] | undefined) => boolean;
|
|
3
|
-
export declare const isRTL: (
|
|
3
|
+
export declare const isRTL: (_client: StoreState["client"] | undefined, language: StoreState["language"] | undefined) => boolean;
|
|
@@ -18,11 +18,11 @@ export interface CSInterface {
|
|
|
18
18
|
isEmbedFramed?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export declare function getClientCacheUrl(handle: string, cluster?: AdaCluster, domain?: string): string;
|
|
21
|
-
export declare function getEmbedURL({ frameName, handle, cluster, domain }: GetEmbedUrlParams): string;
|
|
21
|
+
export declare function getEmbedURL({ frameName, handle, cluster, domain, }: GetEmbedUrlParams): string;
|
|
22
22
|
/**
|
|
23
23
|
* Generate the Chat / API URL
|
|
24
24
|
*/
|
|
25
|
-
export declare function getURL({ name, handle, cluster, domain, route, qp }: CSInterface): string;
|
|
25
|
+
export declare function getURL({ name, handle, cluster, domain, route, qp, }: CSInterface): string;
|
|
26
26
|
export declare function getChatURL({ handle, version, cluster, domain, qp, }: {
|
|
27
27
|
handle: string;
|
|
28
28
|
version?: string;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { ComponentType } from "preact";
|
|
2
|
-
import { Component, h } from "preact";
|
|
3
1
|
import type { MapDispatchToProps, MapStateToProps, StoreProxyInterface } from "common/types/store";
|
|
4
2
|
import type { StoreState } from "common/types/store-state";
|
|
5
|
-
type
|
|
3
|
+
import type { ComponentType } from "preact";
|
|
4
|
+
import { Component, h } from "preact";
|
|
5
|
+
type Props<O, MapState extends MapStateToProps, MapDispatch extends MapDispatchToProps> = {
|
|
6
6
|
store: StoreProxyInterface;
|
|
7
|
-
WrappedComponent: ComponentType<O & ReturnType<
|
|
8
|
-
mapStateToProps?:
|
|
9
|
-
mapDispatchToProps?:
|
|
7
|
+
WrappedComponent: ComponentType<O & ReturnType<MapState> & ReturnType<MapDispatch>>;
|
|
8
|
+
mapStateToProps?: MapState;
|
|
9
|
+
mapDispatchToProps?: MapDispatch;
|
|
10
10
|
} & O;
|
|
11
|
-
export declare class ConnectContainer<O,
|
|
11
|
+
export declare class ConnectContainer<O, MapState extends MapStateToProps, MapDispatch extends MapDispatchToProps> extends Component<Props<O, MapState, MapDispatch>> {
|
|
12
12
|
state: {
|
|
13
13
|
initialized: boolean;
|
|
14
|
-
propsFromState: ReturnType<
|
|
15
|
-
propsFromDispatch: ReturnType<
|
|
14
|
+
propsFromState: ReturnType<MapState>;
|
|
15
|
+
propsFromDispatch: ReturnType<MapDispatch>;
|
|
16
16
|
};
|
|
17
17
|
componentDidMount(): void;
|
|
18
18
|
mapStateAndDispatch(state: StoreState): object;
|
|
@@ -66,15 +66,15 @@ export interface EmbedRequestPayloadByEvent {
|
|
|
66
66
|
}
|
|
67
67
|
export type EmbedRequestEvent = keyof EmbedRequestPayloadByEvent;
|
|
68
68
|
export interface EmbedResponsePayloadByEvent {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
ALL_FRAMES_LOADED: unknown;
|
|
70
|
+
BROWSER_HAS_NOTIFICATIONS_RESPONSE: unknown;
|
|
71
|
+
CREATE_PROACTIVE_RESPONSE: string | null;
|
|
72
|
+
DELETE_HISTORY: unknown;
|
|
73
|
+
DELETE_HISTORY_RESPONSE: unknown;
|
|
74
|
+
DISPATCH_RESPONSE: StoreState;
|
|
75
|
+
EVAL_CAMPAIGN_CONDITIONS_RESPONSE: unknown;
|
|
76
|
+
GET_RESPONSE: StoreState[keyof StoreState];
|
|
77
|
+
GET_CONVERSATION_RESPONSE: {
|
|
78
78
|
id: string | null;
|
|
79
79
|
handoff: {
|
|
80
80
|
inLiveChat: boolean;
|
|
@@ -85,8 +85,8 @@ export interface EmbedResponsePayloadByEvent {
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
GET_INFO_RESPONSE: unknown;
|
|
89
|
+
GET_MESSAGES_RESPONSE: Array<{
|
|
90
90
|
id: string;
|
|
91
91
|
role: "user" | "bot" | "agent";
|
|
92
92
|
type: string;
|
|
@@ -98,39 +98,39 @@ export interface EmbedResponsePayloadByEvent {
|
|
|
98
98
|
avatarUrl?: string;
|
|
99
99
|
};
|
|
100
100
|
}>;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
GET_META_FIELDS_RESPONSE: MetaFieldPayload;
|
|
102
|
+
GET_STATE_RESPONSE: StoreState;
|
|
103
|
+
SEND_MESSAGE_RESPONSE: {
|
|
104
104
|
id: string;
|
|
105
105
|
} | {
|
|
106
106
|
error: string;
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
SET_COMPOSER_TEXT_RESPONSE: {
|
|
109
109
|
ok: true;
|
|
110
110
|
} | {
|
|
111
111
|
error: string;
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
113
|
+
GREETING: unknown;
|
|
114
|
+
JWT_AUTH_RESPONSE: unknown;
|
|
115
|
+
RESET_RESPONSE: unknown;
|
|
116
|
+
SET_META_FIELDS_RESPONSE: unknown;
|
|
117
|
+
SET_SENSITIVE_META_FIELDS_RESPONSE: unknown;
|
|
118
|
+
SET_WINDOW_ORIGIN: Location;
|
|
119
|
+
STATE_CHANGE: StoreState;
|
|
120
|
+
STOP_RESPONSE: unknown;
|
|
121
|
+
TRACK_EVENT_RESPONSE: string | null;
|
|
122
|
+
TRIGGER_CAMPAIGN_RESPONSE: string | null;
|
|
123
|
+
CLOSE_CAMPAIGN_RESPONSE: unknown;
|
|
124
|
+
entry_INIT: unknown;
|
|
125
|
+
client_INIT: unknown;
|
|
126
|
+
button_INIT: unknown;
|
|
127
|
+
intro_INIT: unknown;
|
|
128
128
|
"drawer-mask_INIT": unknown;
|
|
129
|
-
|
|
129
|
+
chat_INIT: unknown;
|
|
130
130
|
"x-storage_INIT": unknown;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
SET_DEVICE_TOKEN_RESPONSE: unknown;
|
|
132
|
+
TRIGGER_PROACTIVE_RESPONSE: unknown;
|
|
133
|
+
LIGHTBOX_CLOSE: unknown;
|
|
134
134
|
}
|
|
135
135
|
export type EmbedResponseEvent = keyof EmbedResponsePayloadByEvent;
|
|
136
136
|
export type EmbedEvent = EmbedRequestEvent | EmbedResponseEvent;
|
|
@@ -2,7 +2,7 @@ import type { AdaEventDataKeyedByEvent, AdaEventKey } from "@ada-support/embed-t
|
|
|
2
2
|
import type { FetchEventStatusType } from "common/constants/events";
|
|
3
3
|
import type { EmbedEvent, EmbedRequestEvent, PayloadByEvent } from "common/lib/channel";
|
|
4
4
|
export interface MessagePayload {
|
|
5
|
-
[key: string]:
|
|
5
|
+
[key: string]: unknown;
|
|
6
6
|
}
|
|
7
7
|
export interface CreateNotificationPayload {
|
|
8
8
|
title: string;
|
|
@@ -24,10 +24,10 @@ export interface CurrentIntro {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
export interface Features {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
ui_customization?: boolean;
|
|
28
|
+
afm_business_events?: boolean;
|
|
29
|
+
afm_proactive_messaging?: boolean;
|
|
30
|
+
chat_session_auth?: boolean;
|
|
31
31
|
"playbooks-image-support-fullscreen-lightbox"?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export interface ClientObject {
|
|
@@ -3,12 +3,11 @@ import type { ExtendedAdaEmbedAPI } from "./extended-api";
|
|
|
3
3
|
import type { StoreState } from "./store-state";
|
|
4
4
|
export * from "./interface";
|
|
5
5
|
export interface StoreAction {
|
|
6
|
-
[key: string]:
|
|
6
|
+
[key: string]: unknown;
|
|
7
7
|
type: ActionTypes;
|
|
8
|
+
payload?: Record<string, unknown>;
|
|
8
9
|
}
|
|
9
|
-
export
|
|
10
|
-
(state: StoreState, action: StoreAction): StoreState;
|
|
11
|
-
}
|
|
10
|
+
export type StoreMutations = (state: StoreState, action: StoreAction) => StoreState;
|
|
12
11
|
export interface StoreDispatchPayload {
|
|
13
12
|
actionKey: string;
|
|
14
13
|
payload: unknown;
|
|
@@ -19,7 +18,7 @@ export interface StoreGetPayload {
|
|
|
19
18
|
export interface TrackEventParams {
|
|
20
19
|
eventKey: string;
|
|
21
20
|
value?: number;
|
|
22
|
-
meta?:
|
|
21
|
+
meta?: Record<string, unknown>;
|
|
23
22
|
}
|
|
24
23
|
export type SendGreetingParams = {
|
|
25
24
|
responseId?: string;
|
|
@@ -4,8 +4,8 @@ export type GetState = () => Promise<StoreState>;
|
|
|
4
4
|
/**
|
|
5
5
|
* DirectDispatch does the same thing as Dispatch, except
|
|
6
6
|
*/
|
|
7
|
-
export type DirectDispatch = (actionKey: string, payload?:
|
|
8
|
-
export type Dispatch = (actionKey: string, payload?:
|
|
7
|
+
export type DirectDispatch = (actionKey: string, payload?: Record<string, unknown>) => void;
|
|
8
|
+
export type Dispatch = (actionKey: string, payload?: Record<string, unknown>) => Promise<StoreState>;
|
|
9
9
|
export type Subscribe = (callback: (payload: StoreState) => void) => void;
|
|
10
10
|
export type MapStateToProps<R = object> = (storeState: StoreState) => R;
|
|
11
11
|
export type MapDispatchToProps<R = object> = (dispatch: Dispatch) => R;
|