@roketus/loyalty-js-sdk 4.37.1 → 4.40.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/cjs/api/campaign/cohorts/v2/createCohort.d.ts +2 -0
- package/dist/cjs/api/campaign/cohorts/v2/deleteCohort.d.ts +2 -0
- package/dist/cjs/api/campaign/cohorts/v2/getCohortById.d.ts +2 -0
- package/dist/cjs/api/campaign/cohorts/v2/listCohorts.d.ts +2 -0
- package/dist/cjs/api/campaign/cohorts/v2/resultSerializer.d.ts +1 -0
- package/dist/cjs/api/campaign/cohorts/v2/updateCohort.d.ts +2 -0
- package/dist/cjs/api/messengerHub/sendTelegramMsg.d.ts +2 -0
- package/dist/cjs/clients/timeout.d.ts +2 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/interfaces/ISDK.d.ts +12 -0
- package/dist/cjs/interfaces/campaigns/index.d.ts +1 -0
- package/dist/cjs/interfaces/cohortsV2/ICohort.d.ts +84 -0
- package/dist/cjs/interfaces/cohortsV2/ICreateCohortPayload.d.ts +20 -0
- package/dist/cjs/interfaces/cohortsV2/IUpdateCohortPayload.d.ts +20 -0
- package/dist/cjs/interfaces/cohortsV2/cohortsInterfaces.d.ts +26 -0
- package/dist/cjs/interfaces/messengerHub/ISendTelegramMsg.d.ts +21 -0
- package/dist/esm5/api/campaign/cohorts/v2/createCohort.d.ts +2 -0
- package/dist/esm5/api/campaign/cohorts/v2/deleteCohort.d.ts +2 -0
- package/dist/esm5/api/campaign/cohorts/v2/getCohortById.d.ts +2 -0
- package/dist/esm5/api/campaign/cohorts/v2/listCohorts.d.ts +2 -0
- package/dist/esm5/api/campaign/cohorts/v2/resultSerializer.d.ts +1 -0
- package/dist/esm5/api/campaign/cohorts/v2/updateCohort.d.ts +2 -0
- package/dist/esm5/api/messengerHub/sendTelegramMsg.d.ts +2 -0
- package/dist/esm5/clients/timeout.d.ts +2 -0
- package/dist/esm5/index.d.ts +5 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/interfaces/ISDK.d.ts +12 -0
- package/dist/esm5/interfaces/campaigns/index.d.ts +1 -0
- package/dist/esm5/interfaces/cohortsV2/ICohort.d.ts +84 -0
- package/dist/esm5/interfaces/cohortsV2/ICreateCohortPayload.d.ts +20 -0
- package/dist/esm5/interfaces/cohortsV2/IUpdateCohortPayload.d.ts +20 -0
- package/dist/esm5/interfaces/cohortsV2/cohortsInterfaces.d.ts +26 -0
- package/dist/esm5/interfaces/messengerHub/ISendTelegramMsg.d.ts +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare enum ECohortStatus {
|
|
2
|
+
STARTED = "started",
|
|
3
|
+
NOT_STARTED = "notStarted",
|
|
4
|
+
COMPLETED = "completed",
|
|
5
|
+
DISABLED = "disabled",
|
|
6
|
+
ARCHIVED = "archived"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ECohortUserType {
|
|
9
|
+
ALL = "ALL",
|
|
10
|
+
NEW = "NEW",
|
|
11
|
+
WITH_CONDITIONS = "CONDITIONAL"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ECohortType {
|
|
14
|
+
DYNAMIC = "DYNAMIC",
|
|
15
|
+
STATIC = "STATIC"
|
|
16
|
+
}
|
|
17
|
+
export declare enum ECohortOS {
|
|
18
|
+
IOS = "IOS",
|
|
19
|
+
ANDROID = "ANDROID",
|
|
20
|
+
WEB = "WEB"
|
|
21
|
+
}
|
|
22
|
+
export declare enum ECohortAction {
|
|
23
|
+
REGISTRATION = "REGISTRATION",
|
|
24
|
+
PURCHASE = "PURCHASE",
|
|
25
|
+
TRANSITION_TO_NEW_LEVEL = "LEVEL_TRANSITION",
|
|
26
|
+
ADDED_CARD_TO_WALLET = "ADD_CARD_TO_WALLET",
|
|
27
|
+
REMOVED_CARD = "REMOVE_CARD"
|
|
28
|
+
}
|
|
29
|
+
export declare enum ECohortConditionsType {
|
|
30
|
+
LESS = "LESS",
|
|
31
|
+
MORE = "GREATER",
|
|
32
|
+
LESS_OR_EQUAL = "LESS_EQUAL",
|
|
33
|
+
MORE_OR_EQUAL = "GREATER_EQUAL",
|
|
34
|
+
EQUAL = "EQUAL",
|
|
35
|
+
NOT_EQUAL = "NOT_EQUAL"
|
|
36
|
+
}
|
|
37
|
+
export declare enum ECohortTimePeriod {
|
|
38
|
+
YESTERDAY = "YESTERDAY",
|
|
39
|
+
LAST_WEEK = "LAST_WEEK",
|
|
40
|
+
MONTH = "MONTH",
|
|
41
|
+
QUARTER = "QUARTER",
|
|
42
|
+
IN_EACH = "IN_EACH",
|
|
43
|
+
DURING = "DURING",
|
|
44
|
+
SINCE = "SINCE",
|
|
45
|
+
WITHIN = "WITHIN",
|
|
46
|
+
CUSTOM = "CUSTOM"
|
|
47
|
+
}
|
|
48
|
+
export declare type CohortCondition = {
|
|
49
|
+
action: ECohortAction;
|
|
50
|
+
is_positive: boolean;
|
|
51
|
+
time_range: {
|
|
52
|
+
period: string;
|
|
53
|
+
custom: {
|
|
54
|
+
start_date: string;
|
|
55
|
+
end_date: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
frequency?: {
|
|
59
|
+
operator: ECohortConditionsType;
|
|
60
|
+
count: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export interface ICohort {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
cohort_type: ECohortType;
|
|
67
|
+
count_of_users: number;
|
|
68
|
+
user_type: ECohortUserType;
|
|
69
|
+
criteria: {
|
|
70
|
+
new_user_time_range: {
|
|
71
|
+
period: string;
|
|
72
|
+
custom: {
|
|
73
|
+
start_date: string;
|
|
74
|
+
end_date: string;
|
|
75
|
+
};
|
|
76
|
+
} | null;
|
|
77
|
+
conditions: CohortCondition[];
|
|
78
|
+
};
|
|
79
|
+
os_filter: ECohortOS[];
|
|
80
|
+
status?: ECohortStatus;
|
|
81
|
+
archived?: boolean;
|
|
82
|
+
created_at?: number;
|
|
83
|
+
last_updated?: number;
|
|
84
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ECohortUserType, ECohortOS, ECohortStatus, CohortCondition, ECohortType } from './ICohort';
|
|
2
|
+
export interface ICreateCohortPayload {
|
|
3
|
+
name: string;
|
|
4
|
+
cohort_type: ECohortType;
|
|
5
|
+
count_of_users: number;
|
|
6
|
+
user_type: ECohortUserType;
|
|
7
|
+
criteria: {
|
|
8
|
+
new_user_time_range: {
|
|
9
|
+
period: string;
|
|
10
|
+
custom: {
|
|
11
|
+
start_date: string;
|
|
12
|
+
end_date: string;
|
|
13
|
+
};
|
|
14
|
+
} | null;
|
|
15
|
+
conditions: CohortCondition[];
|
|
16
|
+
};
|
|
17
|
+
os_filter: ECohortOS[];
|
|
18
|
+
status?: ECohortStatus;
|
|
19
|
+
archived?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ECohortUserType, ECohortOS, ECohortStatus, CohortCondition, ECohortType } from './ICohort';
|
|
2
|
+
export interface IUpdateCohortPayload {
|
|
3
|
+
name: string;
|
|
4
|
+
cohort_type: ECohortType;
|
|
5
|
+
count_of_users: number;
|
|
6
|
+
user_type: ECohortUserType;
|
|
7
|
+
criteria: {
|
|
8
|
+
new_user_time_range: {
|
|
9
|
+
period: string;
|
|
10
|
+
custom: {
|
|
11
|
+
start_date: string;
|
|
12
|
+
end_date: string;
|
|
13
|
+
};
|
|
14
|
+
} | null;
|
|
15
|
+
conditions: CohortCondition[];
|
|
16
|
+
};
|
|
17
|
+
os_filter: ECohortOS[];
|
|
18
|
+
status?: ECohortStatus;
|
|
19
|
+
archived?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
2
|
+
import { IListFiltersPayload, IPaginationData } from '../requestFilterInterfaces';
|
|
3
|
+
import { ICohort } from './ICohort';
|
|
4
|
+
import { ICreateCohortPayload } from './ICreateCohortPayload';
|
|
5
|
+
import { IUpdateCohortPayload } from './IUpdateCohortPayload';
|
|
6
|
+
export declare type TCohortResponseDTO = I_JSON_API_Response_Many<ICohort>;
|
|
7
|
+
export interface IListCohortsResponse {
|
|
8
|
+
data: ICohort[];
|
|
9
|
+
meta: IPaginationData;
|
|
10
|
+
}
|
|
11
|
+
export declare type TListCohorts = (params: IListFiltersPayload) => Promise<IListCohortsResponse>;
|
|
12
|
+
export declare type TGetCohortById = (id: string) => Promise<ICohort>;
|
|
13
|
+
export declare type TUseCohort = (id: string) => Promise<void>;
|
|
14
|
+
export interface ICreateCohortRequestDTO {
|
|
15
|
+
data: {
|
|
16
|
+
attributes: ICreateCohortPayload;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare type TCreateCohort = (payload: ICreateCohortPayload) => Promise<ICohort>;
|
|
20
|
+
export interface IUpdateCohortRequestDTO {
|
|
21
|
+
data: {
|
|
22
|
+
attributes: IUpdateCohortPayload;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare type TUpdateCohort = (id: string, payload: IUpdateCohortPayload) => Promise<void>;
|
|
26
|
+
export declare type TDeleteCohort = (id: string) => Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ISendTelegramMsgPayload {
|
|
2
|
+
user_ids?: string[];
|
|
3
|
+
text: string;
|
|
4
|
+
media_url?: string;
|
|
5
|
+
media_type?: 'image' | 'video';
|
|
6
|
+
caption: string;
|
|
7
|
+
}
|
|
8
|
+
interface ISendTelegramMsgResponseDTO {
|
|
9
|
+
total_users: number;
|
|
10
|
+
delivered_count: number;
|
|
11
|
+
failed_count: number;
|
|
12
|
+
results: {
|
|
13
|
+
user_id: string;
|
|
14
|
+
delivered: boolean;
|
|
15
|
+
delivered_at: number;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export interface ISendTelegramMsg {
|
|
19
|
+
(payload: ISendTelegramMsgPayload): Promise<ISendTelegramMsgResponseDTO>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|