@roketus/loyalty-js-sdk 5.4.0 → 5.4.2
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/README.dev.md +29 -0
- package/README.md +4 -6
- package/dist/cjs/api/issuer/getCardBonuses.d.ts +1 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/interfaces/IRequestWithCancelAndData.d.ts +1 -1
- package/dist/cjs/interfaces/analyticsInterfaces.d.ts +6 -6
- package/dist/cjs/interfaces/campaigns/ICampaignAction.d.ts +1 -1
- package/dist/cjs/interfaces/campaigns/campaignInterfaces.d.ts +3 -3
- package/dist/cjs/interfaces/campaigns/campaignPayloads.d.ts +4 -4
- package/dist/cjs/interfaces/card/IGetBonuses.d.ts +1 -1
- package/dist/cjs/interfaces/cardInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/cardManagement/cardManagementInterfaces.d.ts +3 -3
- package/dist/cjs/interfaces/cohorts/ICohort.d.ts +1 -1
- package/dist/cjs/interfaces/cohorts/cohortsInterfaces.d.ts +7 -7
- package/dist/cjs/interfaces/excludes/excludeInterfaces.d.ts +5 -5
- package/dist/cjs/interfaces/excludes/listExcludesInterfaces.d.ts +2 -2
- package/dist/cjs/interfaces/issuer/IGetCardSpends.d.ts +2 -2
- package/dist/cjs/interfaces/issuer/issuerInterface.d.ts +3 -3
- package/dist/cjs/interfaces/json.d.ts +2 -2
- package/dist/cjs/interfaces/order/orderInterfaces.d.ts +10 -10
- package/dist/cjs/interfaces/products/TGetGroupById.d.ts +2 -2
- package/dist/cjs/interfaces/products/TGetProductById.d.ts +2 -2
- package/dist/cjs/interfaces/products/categoryInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/products/listCategoriesInterfaces.d.ts +2 -2
- package/dist/cjs/interfaces/products/listProductsInterfaces.d.ts +2 -2
- package/dist/cjs/interfaces/products/productInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/promoCodes/promocodeInterfaces.d.ts +10 -10
- package/dist/cjs/interfaces/referralProgram/ICreateRefProgramPayload.d.ts +1 -1
- package/dist/cjs/interfaces/referralProgram/IReferralProgram.d.ts +1 -1
- package/dist/cjs/interfaces/referralProgram/influencerInterfaces.d.ts +4 -4
- package/dist/cjs/interfaces/referralProgram/referralProgramInterfaces.d.ts +4 -4
- package/dist/cjs/interfaces/rewardProgram/IProgramRule.d.ts +4 -4
- package/dist/cjs/interfaces/rewardProgram/programRulesInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/rewardProgram/rewardProgramInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/rewardProgram/tierInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/shortLinkActionInterface.d.ts +12 -12
- package/dist/cjs/interfaces/shortLinkInterface.d.ts +1 -1
- package/dist/cjs/interfaces/tiers/IGetTiersByCard.d.ts +1 -1
- package/dist/cjs/interfaces/transactions/IGetTransactionsByCard.d.ts +1 -1
- package/dist/cjs/interfaces/urlInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/user/IUser.d.ts +1 -0
- package/dist/cjs/interfaces/user/IUserCreate.d.ts +1 -1
- package/dist/cjs/interfaces/user/userNotificationsInterfaces.d.ts +1 -1
- package/dist/cjs/utils/toFilterQueryParams.d.ts +2 -2
- package/dist/esm5/api/issuer/getCardBonuses.d.ts +1 -4
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/interfaces/IRequestWithCancelAndData.d.ts +1 -1
- package/dist/esm5/interfaces/analyticsInterfaces.d.ts +6 -6
- package/dist/esm5/interfaces/campaigns/ICampaignAction.d.ts +1 -1
- package/dist/esm5/interfaces/campaigns/campaignInterfaces.d.ts +3 -3
- package/dist/esm5/interfaces/campaigns/campaignPayloads.d.ts +4 -4
- package/dist/esm5/interfaces/card/IGetBonuses.d.ts +1 -1
- package/dist/esm5/interfaces/cardInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/cardManagement/cardManagementInterfaces.d.ts +3 -3
- package/dist/esm5/interfaces/cohorts/ICohort.d.ts +1 -1
- package/dist/esm5/interfaces/cohorts/cohortsInterfaces.d.ts +7 -7
- package/dist/esm5/interfaces/excludes/excludeInterfaces.d.ts +5 -5
- package/dist/esm5/interfaces/excludes/listExcludesInterfaces.d.ts +2 -2
- package/dist/esm5/interfaces/issuer/IGetCardSpends.d.ts +2 -2
- package/dist/esm5/interfaces/issuer/issuerInterface.d.ts +3 -3
- package/dist/esm5/interfaces/json.d.ts +2 -2
- package/dist/esm5/interfaces/order/orderInterfaces.d.ts +10 -10
- package/dist/esm5/interfaces/products/TGetGroupById.d.ts +2 -2
- package/dist/esm5/interfaces/products/TGetProductById.d.ts +2 -2
- package/dist/esm5/interfaces/products/categoryInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/products/listCategoriesInterfaces.d.ts +2 -2
- package/dist/esm5/interfaces/products/listProductsInterfaces.d.ts +2 -2
- package/dist/esm5/interfaces/products/productInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/promoCodes/promocodeInterfaces.d.ts +10 -10
- package/dist/esm5/interfaces/referralProgram/ICreateRefProgramPayload.d.ts +1 -1
- package/dist/esm5/interfaces/referralProgram/IReferralProgram.d.ts +1 -1
- package/dist/esm5/interfaces/referralProgram/influencerInterfaces.d.ts +4 -4
- package/dist/esm5/interfaces/referralProgram/referralProgramInterfaces.d.ts +4 -4
- package/dist/esm5/interfaces/rewardProgram/IProgramRule.d.ts +4 -4
- package/dist/esm5/interfaces/rewardProgram/programRulesInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/rewardProgram/rewardProgramInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/rewardProgram/tierInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/shortLinkActionInterface.d.ts +12 -12
- package/dist/esm5/interfaces/shortLinkInterface.d.ts +1 -1
- package/dist/esm5/interfaces/tiers/IGetTiersByCard.d.ts +1 -1
- package/dist/esm5/interfaces/transactions/IGetTransactionsByCard.d.ts +1 -1
- package/dist/esm5/interfaces/urlInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/user/IUser.d.ts +1 -0
- package/dist/esm5/interfaces/user/IUserCreate.d.ts +1 -1
- package/dist/esm5/interfaces/user/userNotificationsInterfaces.d.ts +1 -1
- package/dist/esm5/utils/toFilterQueryParams.d.ts +2 -2
- package/package.json +5 -4
|
@@ -3,24 +3,24 @@ import { IListFiltersPayload, IPaginationData } from '../requestFilterInterfaces
|
|
|
3
3
|
import { ICohort } from './ICohort';
|
|
4
4
|
import { ICreateCohortPayload } from './ICreateCohortPayload';
|
|
5
5
|
import { IUpdateCohortPayload } from './IUpdateCohortPayload';
|
|
6
|
-
export
|
|
6
|
+
export type TCohortResponseDTO = I_JSON_API_Response_Many<ICohort>;
|
|
7
7
|
export interface IListCohortsResponse {
|
|
8
8
|
data: ICohort[];
|
|
9
9
|
meta: IPaginationData;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
11
|
+
export type TListCohorts = (params: IListFiltersPayload) => Promise<IListCohortsResponse>;
|
|
12
|
+
export type TGetCohortById = (id: string) => Promise<ICohort>;
|
|
13
|
+
export type TUseCohort = (id: string) => Promise<void>;
|
|
14
14
|
export interface ICreateCohortRequestDTO {
|
|
15
15
|
data: {
|
|
16
16
|
attributes: ICreateCohortPayload;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type TCreateCohort = (payload: ICreateCohortPayload) => Promise<ICohort>;
|
|
20
20
|
export interface IUpdateCohortRequestDTO {
|
|
21
21
|
data: {
|
|
22
22
|
attributes: IUpdateCohortPayload;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type TUpdateCohort = (id: string, payload: IUpdateCohortPayload) => Promise<void>;
|
|
26
|
+
export type TDeleteCohort = (id: string) => Promise<void>;
|
|
@@ -22,7 +22,7 @@ export interface IExcludeResponseAttributes {
|
|
|
22
22
|
param_type: EProductSearchType;
|
|
23
23
|
status: string;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type TExcludeResponseDTO = I_JSON_API_Response_Single<IExcludeResponseAttributes>;
|
|
26
26
|
export interface IExcludeProduct {
|
|
27
27
|
id: string;
|
|
28
28
|
title: string;
|
|
@@ -37,7 +37,7 @@ export interface IExclude {
|
|
|
37
37
|
group?: IExcludeProduct[];
|
|
38
38
|
product?: IExcludeProduct[];
|
|
39
39
|
}
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
40
|
+
export type TCreateExclude = (payload: IExcludePayload) => Promise<IExclude>;
|
|
41
|
+
export type TUpdateExclude = (id: string, payload: IExcludePayload) => Promise<IExclude>;
|
|
42
|
+
export type TGetExclude = (id: string) => Promise<IExclude>;
|
|
43
|
+
export type TDeleteExclude = (id: string) => Promise<void>;
|
|
@@ -2,9 +2,9 @@ import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
|
2
2
|
import { IPaginationData } from '../requestFilterInterfaces';
|
|
3
3
|
import { IListFiltersPayload } from '../requestFilterInterfaces';
|
|
4
4
|
import { IExclude, IExcludeResponseAttributes } from './excludeInterfaces';
|
|
5
|
-
export
|
|
5
|
+
export type TListExcludesResponseDTO = I_JSON_API_Response_Many<IExcludeResponseAttributes>;
|
|
6
6
|
export interface IListExcludesResponse {
|
|
7
7
|
data: IExclude[];
|
|
8
8
|
meta: IPaginationData;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type TListExcludes = (params: IListFiltersPayload) => Promise<IListExcludesResponse>;
|
|
@@ -11,5 +11,5 @@ export interface IGetCardSpendsAttributes {
|
|
|
11
11
|
description: string;
|
|
12
12
|
spendID: string;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type IGetCardSpendsResponseDTO = IGetCardSpendsAttributes[];
|
|
15
|
+
export type IGetCardSpendsJSONAPIResponseDTO = I_JSON_API_Response_Many<IGetCardSpendsAttributes>;
|
|
@@ -53,18 +53,18 @@ export interface ISetCardName {
|
|
|
53
53
|
export interface IGetSettings {
|
|
54
54
|
(): Promise<IIssuerSettings>;
|
|
55
55
|
}
|
|
56
|
-
export
|
|
56
|
+
export type TSettingsResponseDTO = I_JSON_API_Response_Many<IIssuerSettings>;
|
|
57
57
|
export interface ISetSettings {
|
|
58
58
|
(payload: ISetIssuerSettingsPayload): Promise<IIssuerSettings>;
|
|
59
59
|
}
|
|
60
60
|
export interface ISetIssuerToken {
|
|
61
61
|
(token: string): void;
|
|
62
62
|
}
|
|
63
|
-
export
|
|
63
|
+
export type IGetCardByPhoneResponseDTO = IGetCardByIdResponseDTO;
|
|
64
64
|
export interface IGetCardByPhone {
|
|
65
65
|
(phoneNumber: string): IRequestWithCancelAndData<IGetCardByPhoneResponseDTO, I_JSON_API_Response_Many>;
|
|
66
66
|
}
|
|
67
|
-
export
|
|
67
|
+
export type GatewayType = 'sms' | 'email' | 'iosPush' | 'androidPush' | 'passPush' | 'webPush';
|
|
68
68
|
interface CreateIssuerResponseDTO {
|
|
69
69
|
data: [
|
|
70
70
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type JSONValue = string | number | boolean | JSONObject | JSONArray;
|
|
2
2
|
export interface JSONObject {
|
|
3
3
|
[x: string]: JSONValue;
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export type JSONArray = Array<JSONValue>;
|
|
@@ -48,25 +48,25 @@ export interface IOrder extends IOrderAttributes {
|
|
|
48
48
|
receipt?: IOrderReceipt;
|
|
49
49
|
consumer?: IOrderConsumer;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
export
|
|
51
|
+
type ConsumerCredentialType = 'consumer_id' | 'card_number' | 'phone';
|
|
52
|
+
export type TCouponDiscountPayload = {
|
|
53
53
|
type: EOrderDiscountType.COUPON;
|
|
54
54
|
code: string;
|
|
55
55
|
};
|
|
56
|
-
export
|
|
56
|
+
export type TPromoDiscountPayload = {
|
|
57
57
|
type: EOrderDiscountType.USER_PROMO_CODE | EOrderDiscountType.PROMO_CODE;
|
|
58
58
|
code: string;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type TBonusDiscountPayload = {
|
|
61
61
|
type: EOrderDiscountType.BONUS;
|
|
62
62
|
amount: number;
|
|
63
63
|
apply_method: 'proportionalToItems' | 'toTotalPrice';
|
|
64
64
|
};
|
|
65
|
-
export
|
|
65
|
+
export type TPercentageDiscountPayload = {
|
|
66
66
|
type: EOrderDiscountType.PERCENTAGE;
|
|
67
67
|
percent: number;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type TOrderDiscountPayload = TCouponDiscountPayload | TPromoDiscountPayload | TBonusDiscountPayload | TPercentageDiscountPayload;
|
|
70
70
|
export interface IOrderProductPayload {
|
|
71
71
|
product_id: string;
|
|
72
72
|
receipt_name: string;
|
|
@@ -75,7 +75,7 @@ export interface IOrderProductPayload {
|
|
|
75
75
|
unit_of_measure: string;
|
|
76
76
|
ean_code: string;
|
|
77
77
|
}
|
|
78
|
-
export
|
|
78
|
+
export type TOrderConsumerPayload = {
|
|
79
79
|
credential: ConsumerCredentialType;
|
|
80
80
|
value: string;
|
|
81
81
|
} | {};
|
|
@@ -95,7 +95,7 @@ export interface IOpenOrderPayloadDTO {
|
|
|
95
95
|
attributes: IOpenOrderPayload;
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
export
|
|
99
|
-
export
|
|
100
|
-
export
|
|
98
|
+
export type TOrderResponseDTO = I_JSON_API_Response_Many<IOrderAttributes>;
|
|
99
|
+
export type TOpenOrder = (payload: IOpenOrderPayload) => Promise<IOrder>;
|
|
100
|
+
export type TCloseOrder = (id: string) => Promise<IOrder>;
|
|
101
101
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { I_JSON_API_Response_Single } from '../I_JSON_API_ResponseDTO';
|
|
2
2
|
import { ICategory } from './categoryInterfaces';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type TGetCategoryByIdResponseDTO = I_JSON_API_Response_Single<ICategory>;
|
|
4
|
+
export type TGetCategoryById = (id: string) => Promise<ICategory>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { I_JSON_API_Response_Single } from '../I_JSON_API_ResponseDTO';
|
|
2
2
|
import { IProduct } from './productInterfaces';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type TGetProductByIdResponseDTO = I_JSON_API_Response_Single<IProduct>;
|
|
4
|
+
export type TGetProductById = (id: string) => Promise<IProduct>;
|
|
@@ -3,7 +3,7 @@ export interface ICategoryResponseAttributes {
|
|
|
3
3
|
description: string;
|
|
4
4
|
title: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type TCategoryResponseDTO = I_JSON_API_Response_Single<ICategoryResponseAttributes>;
|
|
7
7
|
export interface ICategory {
|
|
8
8
|
id: string;
|
|
9
9
|
description: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
2
2
|
import { IPaginationData } from '../requestFilterInterfaces';
|
|
3
3
|
import { ICategory, ICategoryResponseAttributes } from './categoryInterfaces';
|
|
4
|
-
export
|
|
4
|
+
export type TListCategoriesResponseDTO = I_JSON_API_Response_Many<ICategoryResponseAttributes>;
|
|
5
5
|
export interface IListCategoriesResponse {
|
|
6
6
|
data: ICategory[];
|
|
7
7
|
meta: IPaginationData;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type TListCategories = ({ page, pageSize, search, }: {
|
|
10
10
|
page?: number;
|
|
11
11
|
pageSize?: number;
|
|
12
12
|
search?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
2
2
|
import { IPaginationData } from '../requestFilterInterfaces';
|
|
3
3
|
import { IProduct, IProductResponseAttributes } from './productInterfaces';
|
|
4
|
-
export
|
|
4
|
+
export type TListProductsResponseDTO = I_JSON_API_Response_Many<IProductResponseAttributes>;
|
|
5
5
|
export interface IListProductsResponse {
|
|
6
6
|
data: IProduct[];
|
|
7
7
|
meta: IPaginationData;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type TListProducts = ({ page, pageSize, search, }: {
|
|
10
10
|
page?: number;
|
|
11
11
|
pageSize?: number;
|
|
12
12
|
search?: string;
|
|
@@ -15,7 +15,7 @@ export interface IProductResponseAttributes {
|
|
|
15
15
|
unit_of_measure: string;
|
|
16
16
|
vendor_code: string;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type TProductResponseDTO = I_JSON_API_Response_Single<IProductResponseAttributes>;
|
|
19
19
|
export interface IProductBrand {
|
|
20
20
|
id: string;
|
|
21
21
|
name: string;
|
|
@@ -3,27 +3,27 @@ import { IListFiltersPayload, IPaginationData } from '../requestFilterInterfaces
|
|
|
3
3
|
import { IPromocode } from './IPromocode';
|
|
4
4
|
import { ICreatePromocodePayload } from './ICreatePromocodePayload';
|
|
5
5
|
import { IUpdatePromocodePayload } from './IUpdatePromocodePayload';
|
|
6
|
-
export
|
|
6
|
+
export type TPromocodeResponseDTO = I_JSON_API_Response_Many<IPromocode>;
|
|
7
7
|
export interface IListPromocodesResponse {
|
|
8
8
|
data: IPromocode[];
|
|
9
9
|
meta: IPaginationData;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
11
|
+
export type TListPromocodes = (params: IListFiltersPayload) => Promise<IListPromocodesResponse>;
|
|
12
|
+
export type TGetPromocodeById = (id: string) => Promise<IPromocode>;
|
|
13
|
+
export type TUsePromocode = (id: string) => Promise<void>;
|
|
14
14
|
export interface ICreatePromocodeRequestDTO {
|
|
15
15
|
data: {
|
|
16
16
|
attributes: ICreatePromocodePayload;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type TCreatePromocode = (payload: ICreatePromocodePayload) => Promise<IPromocode>;
|
|
20
20
|
export interface IUpdatePromocodeRequestDTO {
|
|
21
21
|
data: {
|
|
22
22
|
attributes: IUpdatePromocodePayload;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
25
|
+
export type TUpdatePromocode = (id: string, payload: IUpdatePromocodePayload) => Promise<void>;
|
|
26
|
+
export type TEnablePromocode = (id: string) => Promise<void>;
|
|
27
|
+
export type TDisablePromocode = (id: string) => Promise<void>;
|
|
28
|
+
export type TArchivePromocode = (id: string) => Promise<void>;
|
|
29
|
+
export type TUnarchivePromocode = (id: string) => Promise<void>;
|
|
@@ -7,7 +7,7 @@ export interface IRefProgramCouponRewardPayload {
|
|
|
7
7
|
type: ERefProgramRewardType.COUPON;
|
|
8
8
|
promo_code_id: string;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type IRefProgramRewardPayload = IRefProgramBonusRewardPayload | IRefProgramCouponRewardPayload;
|
|
11
11
|
export interface ICreateRefProgramPayload {
|
|
12
12
|
name: string;
|
|
13
13
|
description: string;
|
|
@@ -30,7 +30,7 @@ export interface IRefProgramCouponReward {
|
|
|
30
30
|
} | null;
|
|
31
31
|
value: number;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type IRefProgramReward = IRefProgramBonusReward | IRefProgramCouponReward;
|
|
34
34
|
export interface IReferralProgram {
|
|
35
35
|
id: string;
|
|
36
36
|
name: string;
|
|
@@ -3,7 +3,7 @@ import { I_JSON_API_Response_Many, I_JSON_API_Response_Single } from '../I_JSON_
|
|
|
3
3
|
import { I_Deserialized_List_Response_DTO } from '../I_Deserialized_Response_DTO';
|
|
4
4
|
import { IInfluencer, IInfluencerPerfomance } from './IInfluencer';
|
|
5
5
|
import { ICreateInfluencerPayload, IUpdateInfluencerPayload, IUpdateInfluencerRewardPayload } from './IInfluencerPayload';
|
|
6
|
-
export
|
|
6
|
+
export type InfluencerResponseDTO = I_JSON_API_Response_Single<IInfluencer>;
|
|
7
7
|
export interface IAddInfluencer {
|
|
8
8
|
(programId: string, payload: ICreateInfluencerPayload): Promise<IInfluencer>;
|
|
9
9
|
}
|
|
@@ -19,15 +19,15 @@ export interface IUpdateInfluencerReward {
|
|
|
19
19
|
export interface IDeleteInfluencer {
|
|
20
20
|
(programId: string, influencerId: string): Promise<void>;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
export
|
|
22
|
+
export type ListInfluencersResponseDTO = I_JSON_API_Response_Many<IInfluencer>;
|
|
23
|
+
export type IListInfluencersResponse = I_Deserialized_List_Response_DTO<IInfluencer>;
|
|
24
24
|
export interface IListInfluencers {
|
|
25
25
|
(programId: string, params: IListFiltersPayload): Promise<IListInfluencersResponse>;
|
|
26
26
|
}
|
|
27
27
|
export interface IGetInfluencer {
|
|
28
28
|
(programId: string, influencerId: string): Promise<IInfluencer>;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export type IGetInfluencerPerfomanceResponseDTO = I_JSON_API_Response_Many<IInfluencerPerfomance>;
|
|
31
31
|
export interface IGetInfluencerPerfomance {
|
|
32
32
|
(programId: string, influencerId: string): Promise<IInfluencerPerfomance>;
|
|
33
33
|
}
|
|
@@ -10,7 +10,7 @@ export interface CreateRefProgramRequestDTO {
|
|
|
10
10
|
attributes: ICreateRefProgramPayload;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type ReferralProgramResponseDTO = I_JSON_API_Response_Many<IReferralProgram>;
|
|
14
14
|
export interface ICreateReferralProgram {
|
|
15
15
|
(payload: ICreateRefProgramPayload): Promise<IReferralProgram>;
|
|
16
16
|
}
|
|
@@ -37,12 +37,12 @@ export interface IArchiveReferralProgram {
|
|
|
37
37
|
export interface IListReferralPrograms {
|
|
38
38
|
(params: IListFiltersPayload): Promise<IListReferralProgramsResponse>;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
41
|
-
export
|
|
40
|
+
export type ListReferralProgramsResponseDTO = I_JSON_API_Response_Many<ReferralProgramResponseDTO>;
|
|
41
|
+
export type IListReferralProgramsResponse = I_Deserialized_List_Response_DTO<IReferralProgram>;
|
|
42
42
|
export interface IGetReferralProgram {
|
|
43
43
|
(id: string): Promise<IReferralProgram>;
|
|
44
44
|
}
|
|
45
|
-
export
|
|
45
|
+
export type RefProgramAnalyticsResponseDTO = I_JSON_API_Response_Many<IReferralProgramAnalytics>;
|
|
46
46
|
export interface IGetRefProgramAnalytics {
|
|
47
47
|
(id: string): Promise<IReferralProgramAnalytics>;
|
|
48
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type TProgramRuleTriggerEventType = 'custom_event' | 'inner_event' | string;
|
|
2
|
+
export type TProgramRuleTriggerEventName = 'coupon_to_card' | 'order_closed' | 'referral_registered' | 'spent_bonus' | 'remove_bonus' | 'refund_transaction' | 'order_closed_issue_coupon' | string;
|
|
3
|
+
export type TProgramRuleOutcomeEventType = 'add_transaction' | 'update_card' | 'add_points' | 'add_gift_bonuses' | 'spent_bonus' | 'remove_points' | 'send_notification' | 'refund_transaction' | 'order_closed_issue_coupon' | string;
|
|
4
4
|
export interface IProgramRulePayloadUserAction {
|
|
5
5
|
Parameter: string;
|
|
6
6
|
Value: string;
|
|
@@ -18,7 +18,7 @@ export interface IProgramRulePayloadGiftBonuses {
|
|
|
18
18
|
description: string;
|
|
19
19
|
Metadata?: unknown | null;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type IProgramRuleDefaultPayload = IProgramRulePayloadUserAction | IProgramRulePayloadPoints | IProgramRulePayloadGiftBonuses | IProgramRulePayloadNotification | {
|
|
22
22
|
[key: string]: any;
|
|
23
23
|
};
|
|
24
24
|
export interface IProgramRuleOutcome {
|
|
@@ -18,7 +18,7 @@ export interface AddProgramRuleRequestDTO {
|
|
|
18
18
|
attributes: IAddProgramRulePayload;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type ProgramRuleResponseDTO = I_JSON_API_Response_Many<IProgramRule>;
|
|
22
22
|
export interface IAddProgramRule {
|
|
23
23
|
(programId: string, payload: IAddProgramRulePayload): Promise<AxiosResponse<void>>;
|
|
24
24
|
}
|
|
@@ -10,7 +10,7 @@ export interface CreateRewardProgramRequestDTO {
|
|
|
10
10
|
attributes: ICreateRewardProgramPayload;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type RewardProgramResponseDTO = I_JSON_API_Response_Many<IRewardProgram>;
|
|
14
14
|
export interface ICreateRewardProgram {
|
|
15
15
|
(payload: ICreateRewardProgramPayload): Promise<IRewardProgram>;
|
|
16
16
|
}
|
|
@@ -26,7 +26,7 @@ export interface CreateTierRequestDTO {
|
|
|
26
26
|
attributes: ICreateTierPayload;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type TierResponseDTO = I_JSON_API_Response_Many<ITier>;
|
|
30
30
|
export interface ICreateTier {
|
|
31
31
|
(payload: ICreateTierPayload): Promise<ITier>;
|
|
32
32
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IHTTPClientResponse } from '@roketus/web-toolkit';
|
|
2
2
|
import { NotificationChannel } from './common/NotificationChannelEnum';
|
|
3
3
|
import { CurrencyCode } from './common/CurrencyCodeEnum';
|
|
4
|
-
export
|
|
4
|
+
export type TLinkActionType = 'add_gift_bonuses' | 'card' | 'send_notification' | 'coupon' | 'add_promo_to_user' | 'change_template';
|
|
5
5
|
interface IBonusPayload {
|
|
6
6
|
currency_code: CurrencyCode;
|
|
7
7
|
amount: number;
|
|
@@ -21,7 +21,7 @@ interface IAddUserPromoPayload {
|
|
|
21
21
|
interface IChangeTemplatePayload {
|
|
22
22
|
template_id: string;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
type NotificationEmailRequest = {
|
|
25
25
|
template: {
|
|
26
26
|
subject: string;
|
|
27
27
|
html?: string;
|
|
@@ -29,20 +29,20 @@ declare type NotificationEmailRequest = {
|
|
|
29
29
|
};
|
|
30
30
|
channel: NotificationChannel.Email;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
type NotificationSmsRequest = {
|
|
33
33
|
template: {
|
|
34
34
|
msg: string;
|
|
35
35
|
};
|
|
36
36
|
channel: NotificationChannel.Sms;
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
type NotificationWepPassPushRequest = {
|
|
39
39
|
template: {
|
|
40
40
|
msg: string;
|
|
41
41
|
title: string;
|
|
42
42
|
};
|
|
43
43
|
channel: NotificationChannel.WebPush | NotificationChannel.PassPush;
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
type INotificationPayload = NotificationEmailRequest | NotificationSmsRequest | NotificationWepPassPushRequest;
|
|
46
46
|
interface ILinkActionPayload<T> {
|
|
47
47
|
type: TLinkActionType;
|
|
48
48
|
payload: T;
|
|
@@ -68,7 +68,7 @@ interface ILinkActionPayloadAddUserPromoResponse {
|
|
|
68
68
|
interface ILinkActionPayloadChangeTemplateResponse {
|
|
69
69
|
TemplateID: string;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
type NotificationEmailResponse = {
|
|
72
72
|
Template: {
|
|
73
73
|
subject: string;
|
|
74
74
|
html?: string;
|
|
@@ -76,21 +76,21 @@ declare type NotificationEmailResponse = {
|
|
|
76
76
|
};
|
|
77
77
|
Channel: NotificationChannel.Email;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
type NotificationSmsResponse = {
|
|
80
80
|
Template: {
|
|
81
81
|
msg: string;
|
|
82
82
|
};
|
|
83
83
|
Channel: NotificationChannel.Sms;
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
type NotificationWepPassPushResponse = {
|
|
86
86
|
Template: {
|
|
87
87
|
msg: string;
|
|
88
88
|
title: string;
|
|
89
89
|
};
|
|
90
90
|
Channel: NotificationChannel.WebPush | NotificationChannel.PassPush;
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
export
|
|
92
|
+
type TLinkActionPayloadNotificationResponse = NotificationEmailResponse | NotificationSmsResponse | NotificationWepPassPushResponse;
|
|
93
|
+
export type TLinkActionPayloadResponse = ILinkActionPayloadBonusResponse | ILinkActionPayloadCardResponse | TLinkActionPayloadNotificationResponse[] | ILinkActionPayloadCouponWithPromoResponse | ILinkActionPayloadAddUserPromoResponse | ILinkActionPayloadChangeTemplateResponse;
|
|
94
94
|
interface ILinkActionResponse {
|
|
95
95
|
data: {
|
|
96
96
|
id: string;
|
|
@@ -127,8 +127,8 @@ interface ILinkActionResponse {
|
|
|
127
127
|
}
|
|
128
128
|
];
|
|
129
129
|
}
|
|
130
|
-
export
|
|
131
|
-
export
|
|
130
|
+
export type LinkActionResponseDTO = IHTTPClientResponse<ILinkActionResponse>;
|
|
131
|
+
export type TLinkActionPayload = ILinkActionPayload<IBonusPayload | ICardPayload | ICouponWithPromoPayload | IAddUserPromoPayload | IChangeTemplatePayload | INotificationPayload[]>;
|
|
132
132
|
export interface LinkActionRequestDTO {
|
|
133
133
|
data: {
|
|
134
134
|
attributes: TLinkActionPayload;
|
|
@@ -45,7 +45,7 @@ export interface IShortLink {
|
|
|
45
45
|
meta: Record<string, string>;
|
|
46
46
|
action?: IShortLinkAction[];
|
|
47
47
|
}
|
|
48
|
-
export
|
|
48
|
+
export type LinkResponseDTO = I_JSON_API_Response_Many<IShortLinkResponseDTO, IShortLinkActionResponseDTO>;
|
|
49
49
|
export interface ICreateLink {
|
|
50
50
|
(payload: ICreateLinkPayload): Promise<IShortLink>;
|
|
51
51
|
}
|
|
@@ -3,7 +3,7 @@ import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
|
3
3
|
export interface IGetTiersByCard {
|
|
4
4
|
(cardNumber: string): IRequestWithCancelAndData<IGetTiersByCardResponseDTO, I_JSON_API_Response_Many<IUserTiersJSONAPIDTO, void>>;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type IGetTiersByCardResponseDTO = IUserTiersAttributes;
|
|
7
7
|
export interface IUserTiersJSONAPIDTO {
|
|
8
8
|
id: string;
|
|
9
9
|
type: 'userTier';
|
|
@@ -6,7 +6,7 @@ export interface IUserAddress {
|
|
|
6
6
|
building?: string;
|
|
7
7
|
apartment?: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type TUserGender = 'male' | 'female' | 'secret' | 'other';
|
|
10
10
|
export interface IUserCreate {
|
|
11
11
|
firstName: string;
|
|
12
12
|
lastName: string;
|
|
@@ -31,4 +31,4 @@ export interface IEmailTemplate {
|
|
|
31
31
|
export interface IListEmailTemplatesResponse {
|
|
32
32
|
data: IEmailTemplate[];
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type TListEmailTemplatesResponseDTO = I_JSON_API_Response_Many<IEmailTemplate>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IListFiltersPayload } from '../interfaces/requestFilterInterfaces';
|
|
2
|
-
export
|
|
2
|
+
export type TFilterQueryParams = {
|
|
3
3
|
'page[limit]'?: number;
|
|
4
4
|
'page[offset]': number;
|
|
5
5
|
} & {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type TToFilterQueryParams = (params: IListFiltersPayload) => TFilterQueryParams;
|
|
9
9
|
export declare const toFilterQueryParams: TToFilterQueryParams;
|
|
@@ -5,9 +5,6 @@ export declare const commonGetCardBonuses: (client: IHTTPClientInstance, url: st
|
|
|
5
5
|
jsonAPI: any;
|
|
6
6
|
data: any;
|
|
7
7
|
}>;
|
|
8
|
-
abort:
|
|
9
|
-
(reason?: any): void;
|
|
10
|
-
(): void;
|
|
11
|
-
};
|
|
8
|
+
abort: (reason?: any) => void;
|
|
12
9
|
};
|
|
13
10
|
export declare const getCardBonuses: IGetCardBonuses;
|