@roketus/loyalty-js-sdk 4.42.4 → 5.0.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/cjs/api/campaign/v2/actions/addAction.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/actions/removeAction.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/actions/updateAction.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/campaignResultSerializer.d.ts +1 -0
- package/dist/cjs/api/campaign/v2/createCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/deleteCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/getCampaignById.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/getCampaignStatistics.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/lifecycle/activateCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/lifecycle/cancelCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/lifecycle/completeCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/lifecycle/executeCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/lifecycle/pauseCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/lifecycle/resumeCampaign.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/listCampaigns.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/updateCampaignDates.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/updateCampaignInfo.d.ts +2 -0
- package/dist/cjs/api/campaign/v2/updateCampaignLocations.d.ts +2 -0
- package/dist/cjs/index.d.ts +9 -32
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/interfaces/IPOSTRequestPayloadDTO.d.ts +6 -0
- package/dist/cjs/interfaces/ISDK.d.ts +20 -0
- package/dist/cjs/interfaces/campaignsV2/ENotificationChannel.d.ts +7 -0
- package/dist/cjs/interfaces/campaignsV2/ICampaign.d.ts +37 -0
- package/dist/cjs/interfaces/campaignsV2/ICampaignAction.d.ts +76 -0
- package/dist/cjs/interfaces/campaignsV2/ICampaignCohort.d.ts +7 -0
- package/dist/cjs/interfaces/campaignsV2/ICampaignLocation.d.ts +4 -0
- package/dist/cjs/interfaces/campaignsV2/ICampaignRun.d.ts +12 -0
- package/dist/cjs/interfaces/campaignsV2/ICampaignStatistics.d.ts +41 -0
- package/dist/cjs/interfaces/campaignsV2/IExecuteCampaignResult.d.ts +24 -0
- package/dist/cjs/interfaces/campaignsV2/INotificationMedia.d.ts +10 -0
- package/dist/cjs/interfaces/campaignsV2/campaignInterfaces.d.ts +69 -0
- package/dist/cjs/interfaces/campaignsV2/campaignPayloads.d.ts +35 -0
- package/dist/cjs/interfaces/campaignsV2/index.d.ts +10 -0
- package/dist/cjs/interfaces/cardManagement/index.d.ts +2 -0
- package/dist/cjs/interfaces/cohortsV2/index.d.ts +4 -0
- package/dist/cjs/interfaces/excludes/index.d.ts +2 -0
- package/dist/cjs/interfaces/products/index.d.ts +5 -0
- package/dist/cjs/interfaces/promoCodes/index.d.ts +4 -0
- package/dist/cjs/interfaces/referralProgram/index.d.ts +6 -0
- package/dist/cjs/interfaces/tiers/index.d.ts +3 -0
- package/dist/cjs/interfaces/user/index.d.ts +5 -0
- package/dist/esm5/api/campaign/v2/actions/addAction.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/actions/removeAction.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/actions/updateAction.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/campaignResultSerializer.d.ts +1 -0
- package/dist/esm5/api/campaign/v2/createCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/deleteCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/getCampaignById.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/getCampaignStatistics.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/lifecycle/activateCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/lifecycle/cancelCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/lifecycle/completeCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/lifecycle/executeCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/lifecycle/pauseCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/lifecycle/resumeCampaign.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/listCampaigns.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/updateCampaignDates.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/updateCampaignInfo.d.ts +2 -0
- package/dist/esm5/api/campaign/v2/updateCampaignLocations.d.ts +2 -0
- package/dist/esm5/index.d.ts +9 -32
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/interfaces/IPOSTRequestPayloadDTO.d.ts +6 -0
- package/dist/esm5/interfaces/ISDK.d.ts +20 -0
- package/dist/esm5/interfaces/campaignsV2/ENotificationChannel.d.ts +7 -0
- package/dist/esm5/interfaces/campaignsV2/ICampaign.d.ts +37 -0
- package/dist/esm5/interfaces/campaignsV2/ICampaignAction.d.ts +76 -0
- package/dist/esm5/interfaces/campaignsV2/ICampaignCohort.d.ts +7 -0
- package/dist/esm5/interfaces/campaignsV2/ICampaignLocation.d.ts +4 -0
- package/dist/esm5/interfaces/campaignsV2/ICampaignRun.d.ts +12 -0
- package/dist/esm5/interfaces/campaignsV2/ICampaignStatistics.d.ts +41 -0
- package/dist/esm5/interfaces/campaignsV2/IExecuteCampaignResult.d.ts +24 -0
- package/dist/esm5/interfaces/campaignsV2/INotificationMedia.d.ts +10 -0
- package/dist/esm5/interfaces/campaignsV2/campaignInterfaces.d.ts +69 -0
- package/dist/esm5/interfaces/campaignsV2/campaignPayloads.d.ts +35 -0
- package/dist/esm5/interfaces/campaignsV2/index.d.ts +10 -0
- package/dist/esm5/interfaces/cardManagement/index.d.ts +2 -0
- package/dist/esm5/interfaces/cohortsV2/index.d.ts +4 -0
- package/dist/esm5/interfaces/excludes/index.d.ts +2 -0
- package/dist/esm5/interfaces/products/index.d.ts +5 -0
- package/dist/esm5/interfaces/promoCodes/index.d.ts +4 -0
- package/dist/esm5/interfaces/referralProgram/index.d.ts +6 -0
- package/dist/esm5/interfaces/tiers/index.d.ts +3 -0
- package/dist/esm5/interfaces/user/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ICampaignActionStats {
|
|
2
|
+
total_executed: number;
|
|
3
|
+
success_count: number;
|
|
4
|
+
failed_count: number;
|
|
5
|
+
metrics: Record<string, number>;
|
|
6
|
+
}
|
|
7
|
+
export interface ICampaignPromoCodeStats extends ICampaignActionStats {
|
|
8
|
+
metrics: {
|
|
9
|
+
promocodes_used: number;
|
|
10
|
+
conversion_rate: number;
|
|
11
|
+
total_discount_amount: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ICampaignNotificationStats extends ICampaignActionStats {
|
|
15
|
+
metrics: {
|
|
16
|
+
delivered: number;
|
|
17
|
+
opened: number;
|
|
18
|
+
clicked: number;
|
|
19
|
+
open_rate: number;
|
|
20
|
+
click_rate: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface ICampaignDailyStats {
|
|
24
|
+
date: string;
|
|
25
|
+
users_reached: number;
|
|
26
|
+
actions_executed: number;
|
|
27
|
+
success_rate: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ICampaignStatistics {
|
|
30
|
+
campaign_id: string;
|
|
31
|
+
total_runs: number;
|
|
32
|
+
total_users_reached: number;
|
|
33
|
+
success_rate: number;
|
|
34
|
+
actions_statistics: {
|
|
35
|
+
PROMOCODE?: ICampaignPromoCodeStats;
|
|
36
|
+
NOTIFICATION?: ICampaignNotificationStats;
|
|
37
|
+
[key: string]: ICampaignActionStats | undefined;
|
|
38
|
+
};
|
|
39
|
+
daily_statistics: ICampaignDailyStats[];
|
|
40
|
+
last_updated: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IExecuteCampaignResult {
|
|
2
|
+
id: string;
|
|
3
|
+
total_targets: number;
|
|
4
|
+
success_count: number;
|
|
5
|
+
failed_count: number;
|
|
6
|
+
in_progress_count: number;
|
|
7
|
+
custom_metrics: {
|
|
8
|
+
promocodes_assigned?: number;
|
|
9
|
+
avg_processing_time_ms?: number;
|
|
10
|
+
total_notifications_sent?: number;
|
|
11
|
+
push_sent?: number;
|
|
12
|
+
email_sent?: number;
|
|
13
|
+
sms_sent?: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ICampaignActionResult {
|
|
17
|
+
status: "COMPLETED" | "FAILED" | "IN_PROGRESS" | string;
|
|
18
|
+
started_at: string;
|
|
19
|
+
ended_at: string;
|
|
20
|
+
metrics: IExecuteCampaignResult;
|
|
21
|
+
}
|
|
22
|
+
export interface IExecuteCampaignResponse extends IExecuteCampaignResult {
|
|
23
|
+
action_result: ICampaignActionResult[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IHTTPClientResponse } from '@roketus/web-toolkit';
|
|
2
|
+
import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
3
|
+
import { IListFiltersPayload, IPaginationData } from '../requestFilterInterfaces';
|
|
4
|
+
import { ICampaign } from './ICampaign';
|
|
5
|
+
import { TCampaignAction } from './ICampaignAction';
|
|
6
|
+
import { ICampaignCohort } from './ICampaignCohort';
|
|
7
|
+
import { ICampaignLocation } from './ICampaignLocation';
|
|
8
|
+
import { ICampaignRun } from './ICampaignRun';
|
|
9
|
+
import { ICreateCampaignPayload, IUpdateCampaignDatesPayload, IUpdateCampaignLocationsPayload, IUpdateCampaignPayload, IUpdateCampaignActionPayload, TCampaignActionPayload, IExecuteCampaignPayload } from './campaignPayloads';
|
|
10
|
+
import { ICampaignActionResult, IExecuteCampaignResponse } from './IExecuteCampaignResult';
|
|
11
|
+
import { ICampaignStatistics } from './ICampaignStatistics';
|
|
12
|
+
export declare type CampaignResponseDTO = I_JSON_API_Response_Many<ICampaign, ICampaignCohort | TCampaignAction | ICampaignRun | ICampaignLocation>;
|
|
13
|
+
export interface IListCampaignsResponse {
|
|
14
|
+
data: ICampaign[];
|
|
15
|
+
meta: IPaginationData;
|
|
16
|
+
}
|
|
17
|
+
export interface ICreateCampaign {
|
|
18
|
+
(payload: ICreateCampaignPayload): Promise<ICampaign>;
|
|
19
|
+
}
|
|
20
|
+
export interface IUpdateCampaign {
|
|
21
|
+
(id: string, payload: IUpdateCampaignPayload): Promise<ICampaign>;
|
|
22
|
+
}
|
|
23
|
+
export interface IUpdateCampaignDates {
|
|
24
|
+
(id: string, payload: IUpdateCampaignDatesPayload): Promise<ICampaign>;
|
|
25
|
+
}
|
|
26
|
+
export interface IUpdateCampaignLocations {
|
|
27
|
+
(id: string, payload: IUpdateCampaignLocationsPayload): Promise<ICampaign>;
|
|
28
|
+
}
|
|
29
|
+
export interface IGetCampaignById {
|
|
30
|
+
(id: string): Promise<ICampaign>;
|
|
31
|
+
}
|
|
32
|
+
export interface IListCampaigns {
|
|
33
|
+
(params: IListFiltersPayload): Promise<IListCampaignsResponse>;
|
|
34
|
+
}
|
|
35
|
+
export interface IDeleteCampaign {
|
|
36
|
+
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
37
|
+
}
|
|
38
|
+
export interface IAddActionToCampaign {
|
|
39
|
+
(id: string, payload: TCampaignActionPayload): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export interface IUpdateCampaignAction {
|
|
42
|
+
(id: string, actionId: string, payload: IUpdateCampaignActionPayload): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
export interface IDeleteActionFromCampaign {
|
|
45
|
+
(id: string, actionId: string): Promise<IHTTPClientResponse<void>>;
|
|
46
|
+
}
|
|
47
|
+
export interface IActivateCampaign {
|
|
48
|
+
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
49
|
+
}
|
|
50
|
+
export interface IPauseCampaign {
|
|
51
|
+
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
52
|
+
}
|
|
53
|
+
export interface IResumeCampaign {
|
|
54
|
+
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
55
|
+
}
|
|
56
|
+
export interface ICompleteCampaign {
|
|
57
|
+
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
58
|
+
}
|
|
59
|
+
export interface ICancelCampaign {
|
|
60
|
+
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
61
|
+
}
|
|
62
|
+
export declare type IExecuteCampaignResponseDTO = I_JSON_API_Response_Many<IExecuteCampaignResponse, ICampaignActionResult>;
|
|
63
|
+
export interface IExecuteCampaign {
|
|
64
|
+
(id: string, payload: IExecuteCampaignPayload): Promise<IExecuteCampaignResponse>;
|
|
65
|
+
}
|
|
66
|
+
export declare type IGetCampaignStatisticsResponseDTO = I_JSON_API_Response_Many<ICampaignStatistics>;
|
|
67
|
+
export interface IGetCampaignStatistics {
|
|
68
|
+
(id: string): Promise<ICampaignStatistics>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ENotificationChannel } from './ENotificationChannel';
|
|
2
|
+
import { ECampaignExecutionMode, ECampaignType } from './ICampaign';
|
|
3
|
+
import type { IBonusAccrualAction, INotificationAction, IPromoCodeAction } from './ICampaignAction';
|
|
4
|
+
export declare type IPromoCodeActionPayload = Omit<IPromoCodeAction, 'id' | 'name' | 'version' | 'created_at'>;
|
|
5
|
+
export declare type INotificationActionPayload = Omit<INotificationAction, 'id' | 'version' | 'created_at'>;
|
|
6
|
+
export declare type IBonusAccrualActionPayload = Omit<IBonusAccrualAction, 'id' | 'version' | 'created_at'>;
|
|
7
|
+
export declare type TCampaignActionPayload = IPromoCodeActionPayload | INotificationActionPayload | IBonusAccrualActionPayload;
|
|
8
|
+
export interface ICreateCampaignPayload {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
campaign_type: ECampaignType;
|
|
12
|
+
execution_mode: ECampaignExecutionMode;
|
|
13
|
+
cohort_id: string;
|
|
14
|
+
actions: TCampaignActionPayload[];
|
|
15
|
+
locations?: string[];
|
|
16
|
+
start_date: string;
|
|
17
|
+
end_date: string;
|
|
18
|
+
metadata?: {
|
|
19
|
+
department: string;
|
|
20
|
+
budget: number;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface IUpdateCampaignPayload extends Pick<ICreateCampaignPayload, 'name' | 'description' | 'metadata'> {
|
|
25
|
+
}
|
|
26
|
+
export interface IUpdateCampaignDatesPayload extends Pick<ICreateCampaignPayload, 'start_date' | 'end_date'> {
|
|
27
|
+
}
|
|
28
|
+
export interface IUpdateCampaignLocationsPayload extends Pick<ICreateCampaignPayload, 'locations'> {
|
|
29
|
+
}
|
|
30
|
+
export interface IUpdateCampaignActionPayload extends Omit<TCampaignActionPayload, 'type'> {
|
|
31
|
+
}
|
|
32
|
+
export interface IExecuteCampaignPayload {
|
|
33
|
+
execution_mode?: string;
|
|
34
|
+
notification_channels: ENotificationChannel[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ICampaign as ICampaignV2, ECampaignType, ECampaignExecutionMode, ECampaignStatus } from './ICampaign';
|
|
2
|
+
export * from './ICampaignAction';
|
|
3
|
+
export { ICampaignCohort as ICampaignCohortV2 } from './ICampaignCohort';
|
|
4
|
+
export * from './ICampaignLocation';
|
|
5
|
+
export { ICampaignRun as ICampaignRunV2 } from './ICampaignRun';
|
|
6
|
+
export * from './ENotificationChannel';
|
|
7
|
+
export { ICreateCampaignPayload as ICreateCampaignPayloadV2, IUpdateCampaignPayload, IUpdateCampaignDatesPayload, IUpdateCampaignLocationsPayload, TCampaignActionPayload, IUpdateCampaignActionPayload, IBonusAccrualActionPayload, INotificationActionPayload, IPromoCodeActionPayload, IExecuteCampaignPayload, } from './campaignPayloads';
|
|
8
|
+
export * from './ICampaignStatistics';
|
|
9
|
+
export * from './IExecuteCampaignResult';
|
|
10
|
+
export * from './INotificationMedia';
|