@ada-support/embed2 1.1.45 → 1.2.1
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/campaign.d.ts +2 -2
- package/dist/npm-entry/client/embed.d.ts +3 -2
- package/dist/npm-entry/client/helpers/web-notifications/index.d.ts +1 -0
- package/dist/npm-entry/client/helpers/web-notifications/web-notification-events.d.ts +3 -0
- package/dist/npm-entry/common/constants/events.d.ts +2 -0
- package/dist/npm-entry/common/lib/channel.d.ts +6 -2
- package/dist/npm-entry/common/types/store-state.d.ts +1 -0
- package/dist/npm-entry/index.js +2713 -181
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CampaignParams, StartOptions } from "@ada-support/embed-types";
|
|
2
2
|
import type { MessageService } from "client/lib/message-service";
|
|
3
3
|
import type { MarketingCampaign } from "./types";
|
|
4
4
|
interface TriggerCampaignImplParams {
|
|
@@ -11,5 +11,5 @@ interface TriggerCampaignImplParams {
|
|
|
11
11
|
messageService: MessageService;
|
|
12
12
|
}
|
|
13
13
|
export declare function triggerCampaignImpl({ adaSettings, chatterToken, campaign, ignoreStatus, ignoreFrequency, clearCampaignToTrigger, messageService, }: TriggerCampaignImplParams): void;
|
|
14
|
-
export declare const getCampaignToTrigger: (adaSettings: StartOptions, marketingCampaigns: MarketingCampaign[] | undefined, options:
|
|
14
|
+
export declare const getCampaignToTrigger: (adaSettings: StartOptions, marketingCampaigns: MarketingCampaign[] | undefined, options: CampaignParams, onlyBasic: boolean) => MarketingCampaign | undefined;
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdaEventKey, AdaEventSubscriptionCallback,
|
|
1
|
+
import type { AdaEventKey, AdaEventSubscriptionCallback, CampaignParams, ResetParams, StartOptions, WindowInfo } from "@ada-support/embed-types";
|
|
2
2
|
import { MessageService } from "client/lib/message-service";
|
|
3
3
|
import { StoreProxy } from "client/lib/store-proxy";
|
|
4
4
|
import "client/lib/error-tracker";
|
|
@@ -31,9 +31,10 @@ export declare class Embed {
|
|
|
31
31
|
reset(resetParams?: ResetParams): Promise<void>;
|
|
32
32
|
trackEvent(eventKey: string, value: number, meta?: {}): Promise<void>;
|
|
33
33
|
triggerCampaign(campaignKey: string, triggerCampaignParams?: {}): Promise<void>;
|
|
34
|
-
evaluateCampaignConditions(options:
|
|
34
|
+
evaluateCampaignConditions(options: CampaignParams): Promise<void>;
|
|
35
35
|
createProactive(body: string, duration: number, responseId?: string): Promise<void>;
|
|
36
36
|
subscribeEvent<K extends AdaEventKey>(eventKey: K, callback: AdaEventSubscriptionCallback<K>): number;
|
|
37
37
|
unsubscribeEvent(id: number): void;
|
|
38
38
|
closeCampaign(): Promise<void>;
|
|
39
|
+
setDeviceToken(token: string): Promise<void>;
|
|
39
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addServiceWorkerListeners(): void;
|
|
@@ -74,6 +74,8 @@ export declare const EVAL_CAMPAIGN_CONDITIONS = "EVAL_CAMPAIGN_CONDITIONS";
|
|
|
74
74
|
export declare const EVAL_CAMPAIGN_CONDITIONS_RESPONSE = "EVAL_CAMPAIGN_CONDITIONS_RESPONSE";
|
|
75
75
|
export declare const CLOSE_CAMPAIGN = "CLOSE_CAMPAIGN";
|
|
76
76
|
export declare const CLOSE_CAMPAIGN_RESPONSE = "CLOSE_CAMPAIGN_RESPONSE";
|
|
77
|
+
export declare const SET_DEVICE_TOKEN = "SET_DEVICE_TOKEN";
|
|
78
|
+
export declare const SET_DEVICE_TOKEN_RESPONSE = "SET_DEVICE_TOKEN_RESPONSE";
|
|
77
79
|
export declare const SEND_GREETING = "SEND_GREETING";
|
|
78
80
|
/**
|
|
79
81
|
* Fetch Event Status
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CampaignParams, ResetParams } from "@ada-support/embed-types";
|
|
2
2
|
import type { FetchEventStatusType } from "common/constants/events";
|
|
3
3
|
import type { AdaCustomEvent, Refhandler } from "common/types/events";
|
|
4
4
|
import type { SendGreetingParams, StoreDispatchPayload, StoreGetPayload, TrackEventParams } from "common/types/index";
|
|
@@ -12,7 +12,7 @@ export interface EmbedRequestPayloadByEvent {
|
|
|
12
12
|
};
|
|
13
13
|
DELETE_HISTORY: unknown;
|
|
14
14
|
DISPATCH: StoreDispatchPayload;
|
|
15
|
-
EVAL_CAMPAIGN_CONDITIONS:
|
|
15
|
+
EVAL_CAMPAIGN_CONDITIONS: CampaignParams;
|
|
16
16
|
GET: StoreGetPayload;
|
|
17
17
|
GET_INFO: unknown;
|
|
18
18
|
GET_STATE: unknown;
|
|
@@ -25,6 +25,9 @@ export interface EmbedRequestPayloadByEvent {
|
|
|
25
25
|
TRACK_EVENT: TrackEventParams;
|
|
26
26
|
SEND_GREETING: SendGreetingParams;
|
|
27
27
|
CLOSE_CAMPAIGN: unknown;
|
|
28
|
+
SET_DEVICE_TOKEN: {
|
|
29
|
+
token: string;
|
|
30
|
+
};
|
|
28
31
|
}
|
|
29
32
|
export declare type EmbedRequestEvent = keyof EmbedRequestPayloadByEvent;
|
|
30
33
|
export interface EmbedResponsePayloadByEvent {
|
|
@@ -57,6 +60,7 @@ export interface EmbedResponsePayloadByEvent {
|
|
|
57
60
|
"drawer-mask_INIT": unknown;
|
|
58
61
|
chat_INIT: unknown;
|
|
59
62
|
"x-storage_INIT": unknown;
|
|
63
|
+
SET_DEVICE_TOKEN_RESPONSE: unknown;
|
|
60
64
|
}
|
|
61
65
|
export declare type EmbedResponseEvent = keyof EmbedResponsePayloadByEvent;
|
|
62
66
|
export declare type EmbedEvent = (EmbedRequestEvent | EmbedResponseEvent);
|
|
@@ -39,6 +39,7 @@ export interface StoreState extends StartOptionsNoFunction {
|
|
|
39
39
|
adaSettings: StartOptions;
|
|
40
40
|
wasCampaignShownButNowClosed: boolean;
|
|
41
41
|
proactiveCampaignHadMessages: boolean;
|
|
42
|
+
deviceToken: string | null;
|
|
42
43
|
}
|
|
43
44
|
export interface StartOptionsNoFunction {
|
|
44
45
|
handle?: string;
|