@voucherify/sdk 2.9.2 → 2.9.3
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/voucherifysdk.cjs +2 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.d.mts +5252 -0
- package/dist/voucherifysdk.d.ts +5252 -0
- package/dist/voucherifysdk.esm.js +2 -2261
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +12 -8
- package/CHANGELOG.md +0 -663
- package/dist/ApiLimitsHandler.d.ts +0 -10
- package/dist/AsyncActions.d.ts +0 -15
- package/dist/Balance.d.ts +0 -12
- package/dist/Campaigns.d.ts +0 -58
- package/dist/Categories.d.ts +0 -26
- package/dist/ClientSide.d.ts +0 -53
- package/dist/Consents.d.ts +0 -10
- package/dist/Customers.d.ts +0 -72
- package/dist/Distributions.d.ts +0 -22
- package/dist/Events.d.ts +0 -10
- package/dist/Exports.d.ts +0 -22
- package/dist/Loyalties.d.ts +0 -159
- package/dist/MetadataSchemas.d.ts +0 -14
- package/dist/Orders.d.ts +0 -27
- package/dist/ProductCollections.d.ts +0 -26
- package/dist/Products.d.ts +0 -63
- package/dist/PromotionTiers.d.ts +0 -34
- package/dist/Promotions.d.ts +0 -18
- package/dist/PromotionsStacks.d.ts +0 -30
- package/dist/Qualifications.d.ts +0 -10
- package/dist/Redemptions.d.ts +0 -35
- package/dist/RequestController.d.ts +0 -29
- package/dist/Rewards.d.ts +0 -43
- package/dist/Segments.d.ts +0 -22
- package/dist/ValidationRules.d.ts +0 -43
- package/dist/Validations.d.ts +0 -17
- package/dist/VoucherifyClientSide.d.ts +0 -86
- package/dist/VoucherifyError.d.ts +0 -20
- package/dist/VoucherifyServerSide.d.ts +0 -131
- package/dist/Vouchers.d.ts +0 -78
- package/dist/helpers.d.ts +0 -18
- package/dist/index.d.ts +0 -25
- package/dist/types/ApplicableTo.d.ts +0 -30
- package/dist/types/AsyncActions.d.ts +0 -21
- package/dist/types/Balance.d.ts +0 -16
- package/dist/types/Campaigns.d.ts +0 -120
- package/dist/types/Categories.d.ts +0 -38
- package/dist/types/ClientSide.d.ts +0 -134
- package/dist/types/Consents.d.ts +0 -33
- package/dist/types/Customers.d.ts +0 -361
- package/dist/types/DiscountVoucher.d.ts +0 -93
- package/dist/types/Distributions.d.ts +0 -144
- package/dist/types/Events.d.ts +0 -17
- package/dist/types/Exports.d.ts +0 -149
- package/dist/types/Gift.d.ts +0 -3
- package/dist/types/Loyalties.d.ts +0 -1057
- package/dist/types/MetadataSchemas.d.ts +0 -33
- package/dist/types/Orders.d.ts +0 -195
- package/dist/types/ProductCollections.d.ts +0 -96
- package/dist/types/Products.d.ts +0 -106
- package/dist/types/PromotionTiers.d.ts +0 -127
- package/dist/types/Promotions.d.ts +0 -108
- package/dist/types/PromotionsStacks.d.ts +0 -71
- package/dist/types/Qualifications.d.ts +0 -86
- package/dist/types/Redemptions.d.ts +0 -205
- package/dist/types/Rewards.d.ts +0 -219
- package/dist/types/Segments.d.ts +0 -32
- package/dist/types/Stackable.d.ts +0 -101
- package/dist/types/UtilityTypes.d.ts +0 -3
- package/dist/types/ValidateSession.d.ts +0 -17
- package/dist/types/ValidationError.d.ts +0 -7
- package/dist/types/ValidationRules.d.ts +0 -93
- package/dist/types/Validations.d.ts +0 -98
- package/dist/types/Vouchers.d.ts +0 -364
- package/dist/types/index.d.ts +0 -25
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Category } from './Categories';
|
|
2
|
-
export interface PromotionsStacksListInCampaignResponseBody {
|
|
3
|
-
object: 'list';
|
|
4
|
-
data_ref: 'data';
|
|
5
|
-
data: PromotionStack[];
|
|
6
|
-
total: number;
|
|
7
|
-
}
|
|
8
|
-
export interface PromotionsStacksListResponseBody {
|
|
9
|
-
object: 'list';
|
|
10
|
-
data_ref: 'data';
|
|
11
|
-
data: PromotionStack[];
|
|
12
|
-
total: number;
|
|
13
|
-
}
|
|
14
|
-
export interface PromotionsStacksListRequestQuery {
|
|
15
|
-
limit?: number;
|
|
16
|
-
page?: number;
|
|
17
|
-
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at' | 'name' | '-name';
|
|
18
|
-
created_at?: {
|
|
19
|
-
before?: string;
|
|
20
|
-
after?: string;
|
|
21
|
-
};
|
|
22
|
-
updated_at?: {
|
|
23
|
-
before?: string;
|
|
24
|
-
after?: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export declare type PromotionsStacksGetResponseBody = PromotionStack;
|
|
28
|
-
export declare type PromotionsStacksUpdateRequestBody = {
|
|
29
|
-
name: string;
|
|
30
|
-
tiers?: {
|
|
31
|
-
ids?: string[];
|
|
32
|
-
hierarchy_mode?: 'MANUAL';
|
|
33
|
-
};
|
|
34
|
-
category_id?: string;
|
|
35
|
-
};
|
|
36
|
-
export declare type PromotionsStacksUpdateResponseBody = PromotionStackBase & {
|
|
37
|
-
id: string;
|
|
38
|
-
created_at: string;
|
|
39
|
-
updated_at: string;
|
|
40
|
-
campaign_id: string;
|
|
41
|
-
object: 'promotion_stack';
|
|
42
|
-
category_id: string | null;
|
|
43
|
-
categories: Category[];
|
|
44
|
-
};
|
|
45
|
-
export declare type PromotionsStacksCreateInCampaignRequestBody = PromotionStackBase & {
|
|
46
|
-
category_id?: string;
|
|
47
|
-
};
|
|
48
|
-
export declare type PromotionsStacksCreateInCampaignResponseBody = PromotionStackBase & {
|
|
49
|
-
id: string;
|
|
50
|
-
created_at: string;
|
|
51
|
-
campaign_id: string;
|
|
52
|
-
object: 'promotion_stack';
|
|
53
|
-
category_id: string | null;
|
|
54
|
-
categories: Category[];
|
|
55
|
-
};
|
|
56
|
-
export interface PromotionStackBase {
|
|
57
|
-
name: string;
|
|
58
|
-
tiers: {
|
|
59
|
-
ids: string[];
|
|
60
|
-
hierarchy_mode?: 'MANUAL';
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export declare type PromotionStack = PromotionStackBase & {
|
|
64
|
-
id: string;
|
|
65
|
-
created_at: string;
|
|
66
|
-
updated_at?: string;
|
|
67
|
-
campaign_id: string;
|
|
68
|
-
object: 'promotion_stack';
|
|
69
|
-
category_id: string | null;
|
|
70
|
-
categories: Category[];
|
|
71
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { CustomerRequest } from './Customers';
|
|
2
|
-
import { Junction } from './Exports';
|
|
3
|
-
import { Order, OrderCalculated } from './Orders';
|
|
4
|
-
import { ApplicableToResultList, InapplicableToResultList } from './ApplicableTo';
|
|
5
|
-
import { Category } from './Categories';
|
|
6
|
-
import { Discount } from './DiscountVoucher';
|
|
7
|
-
import { LoyaltiesTransferPoints } from './Loyalties';
|
|
8
|
-
import { ValidationRulesAssignmentsList } from './ValidationRules';
|
|
9
|
-
export declare type QualificationsCheckEligibilityRequestBody = {
|
|
10
|
-
customer?: CustomerRequest;
|
|
11
|
-
order?: Order;
|
|
12
|
-
mode?: 'BASIC' | 'ADVANCED';
|
|
13
|
-
tracking_id?: string;
|
|
14
|
-
scenario?: 'ALL' | 'CUSTOMER_WALLET' | 'AUDIENCE_ONLY' | 'PRODUCTS' | 'PRODUCTS_DISCOUNT' | 'PROMOTION_STACKS' | 'PRODUCTS_BY_CUSTOMER' | 'PRODUCTS_DISCOUNT_BY_CUSTOMER';
|
|
15
|
-
options?: {
|
|
16
|
-
limit?: number;
|
|
17
|
-
starting_after?: string;
|
|
18
|
-
filters?: {
|
|
19
|
-
junction?: Junction;
|
|
20
|
-
} & Partial<Record<QualificationsFiltersFields, QualificationsFieldConditions>>;
|
|
21
|
-
expand?: ('redeemable' | 'category' | 'validation_rules')[];
|
|
22
|
-
sorting_rule?: 'BEST_DEAL' | 'LEAST_DEAL' | 'DEFAULT';
|
|
23
|
-
};
|
|
24
|
-
metadata?: Record<string, any>;
|
|
25
|
-
};
|
|
26
|
-
export declare type QualificationsCheckEligibilityResponseBody = {
|
|
27
|
-
redeemables: QualificationsRedeemableList;
|
|
28
|
-
tracking_id?: string;
|
|
29
|
-
order?: OrderCalculated;
|
|
30
|
-
stacking_rules: QualificationsStackingRules;
|
|
31
|
-
};
|
|
32
|
-
export declare type QualificationsFiltersFields = 'category_id' | 'campaign_id' | 'resource_id' | 'resource_type' | 'voucher_type' | 'code';
|
|
33
|
-
export declare type QualificationsFiltersCondition = '$in' | '$not_in' | '$is' | '$is_not' | '$has_value' | '$is_unknown';
|
|
34
|
-
export declare type QualificationsFieldConditions = {
|
|
35
|
-
conditions?: Partial<Record<QualificationsFiltersCondition, any>>;
|
|
36
|
-
};
|
|
37
|
-
export declare type QualificationsRedeemableList = {
|
|
38
|
-
object: 'list';
|
|
39
|
-
data_ref: 'data';
|
|
40
|
-
data: QualificationsRedeemable[];
|
|
41
|
-
total: number;
|
|
42
|
-
has_more: boolean;
|
|
43
|
-
more_starting_after?: string;
|
|
44
|
-
};
|
|
45
|
-
export declare type QualificationsStackingRules = {
|
|
46
|
-
redeemables_limit: number;
|
|
47
|
-
applicable_redeemables_limit: number;
|
|
48
|
-
applicable_exclusive_redeemables_limit: number;
|
|
49
|
-
exclusive_categories: string[];
|
|
50
|
-
joint_categories: string[];
|
|
51
|
-
};
|
|
52
|
-
export declare type QualificationsRedeemable = QualificationsRedeemableBase & {
|
|
53
|
-
redeemables?: QualificationsRedeemableBase[];
|
|
54
|
-
};
|
|
55
|
-
export declare type QualificationsRedeemableBase = {
|
|
56
|
-
id: string;
|
|
57
|
-
object: 'campaign' | 'promotion_tier' | 'promotion_stack' | 'voucher';
|
|
58
|
-
created_at: string;
|
|
59
|
-
result: RedeemableResult;
|
|
60
|
-
order?: OrderCalculated;
|
|
61
|
-
validation_rule_id?: string;
|
|
62
|
-
applicable_to: ApplicableToResultList;
|
|
63
|
-
inapplicable_to: InapplicableToResultList;
|
|
64
|
-
metadata: Record<string, unknown> | null;
|
|
65
|
-
categories: Category[];
|
|
66
|
-
banner?: string;
|
|
67
|
-
name?: string;
|
|
68
|
-
campaign_name?: string;
|
|
69
|
-
campaign_id?: string;
|
|
70
|
-
validation_rules_assignments?: ValidationRulesAssignmentsList;
|
|
71
|
-
};
|
|
72
|
-
export declare type RedeemableResult = {
|
|
73
|
-
discount?: Discount;
|
|
74
|
-
gift?: {
|
|
75
|
-
balance: number;
|
|
76
|
-
credits: number;
|
|
77
|
-
};
|
|
78
|
-
loyalty_card?: {
|
|
79
|
-
points?: number;
|
|
80
|
-
balance?: number;
|
|
81
|
-
exchange_ratio?: number;
|
|
82
|
-
points_ratio?: number;
|
|
83
|
-
transfers?: LoyaltiesTransferPoints[];
|
|
84
|
-
};
|
|
85
|
-
error?: Error;
|
|
86
|
-
};
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { OrdersCreateResponse, OrdersCreate } from './Orders';
|
|
2
|
-
import { RewardsCreateResponse, RewardRedemptionParams } from './Rewards';
|
|
3
|
-
import { CustomersCreateBody, SimpleCustomer } from './Customers';
|
|
4
|
-
import { VouchersResponse } from './Vouchers';
|
|
5
|
-
import { GiftRedemptionParams } from './Gift';
|
|
6
|
-
import { ValidationSessionParams, ValidationSessionReleaseParams } from './ValidateSession';
|
|
7
|
-
import { StackableOptions, StackableRedeemableInapplicableResponse, StackableRedeemableParams, StackableRedeemableSkippedResponse } from './Stackable';
|
|
8
|
-
import { PromotionTierRedeemDetailsSimple, PromotionTierRedeemDetails } from './PromotionTiers';
|
|
9
|
-
export interface RedemptionsRedeemBody {
|
|
10
|
-
tracking_id?: string;
|
|
11
|
-
customer?: Omit<SimpleCustomer, 'id'> & {
|
|
12
|
-
description?: string;
|
|
13
|
-
id?: string;
|
|
14
|
-
};
|
|
15
|
-
order?: Pick<Partial<OrdersCreateResponse>, 'id' | 'source_id' | 'amount' | 'items' | 'status' | 'metadata'>;
|
|
16
|
-
metadata?: Record<string, any>;
|
|
17
|
-
reward?: RewardRedemptionParams;
|
|
18
|
-
gift?: GiftRedemptionParams;
|
|
19
|
-
session?: ValidationSessionReleaseParams;
|
|
20
|
-
}
|
|
21
|
-
export interface RedemptionsRedeemResponse {
|
|
22
|
-
id: string;
|
|
23
|
-
object: 'redemption';
|
|
24
|
-
date?: string;
|
|
25
|
-
customer_id?: string;
|
|
26
|
-
tracking_id?: string;
|
|
27
|
-
order?: OrdersCreateResponse;
|
|
28
|
-
metadata?: Record<string, any>;
|
|
29
|
-
result: 'SUCCESS' | 'FAILURE';
|
|
30
|
-
voucher: VouchersResponse;
|
|
31
|
-
customer?: SimpleCustomer;
|
|
32
|
-
reward?: RewardsCreateResponse;
|
|
33
|
-
related_object_type: 'voucher';
|
|
34
|
-
gift?: {
|
|
35
|
-
amount: number;
|
|
36
|
-
};
|
|
37
|
-
loyalty_card?: {
|
|
38
|
-
points: number;
|
|
39
|
-
};
|
|
40
|
-
promotion_tier?: PromotionTierRedeemDetailsSimple | PromotionTierRedeemDetails;
|
|
41
|
-
failure_code?: string;
|
|
42
|
-
failure_message?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface RedemptionsListParams {
|
|
45
|
-
limit?: number;
|
|
46
|
-
page?: number;
|
|
47
|
-
result?: 'SUCCESS' | 'FAILURE';
|
|
48
|
-
campaign?: string;
|
|
49
|
-
customer?: string;
|
|
50
|
-
created_at?: {
|
|
51
|
-
before?: string;
|
|
52
|
-
after?: string;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export interface Redemption {
|
|
56
|
-
id: string;
|
|
57
|
-
object: 'redemption';
|
|
58
|
-
date?: string;
|
|
59
|
-
customer_id?: string;
|
|
60
|
-
tracking_id?: string;
|
|
61
|
-
order?: Omit<OrdersCreateResponse, 'object'> & {
|
|
62
|
-
related_object_id: string;
|
|
63
|
-
related_object_type: 'redemption';
|
|
64
|
-
referrer?: string;
|
|
65
|
-
};
|
|
66
|
-
metadata?: Record<string, any>;
|
|
67
|
-
result: 'SUCCESS' | 'FAILURE';
|
|
68
|
-
failure_code?: string;
|
|
69
|
-
failure_message?: string;
|
|
70
|
-
customer?: SimpleCustomer;
|
|
71
|
-
related_object_type?: 'string';
|
|
72
|
-
voucher?: {
|
|
73
|
-
code: string;
|
|
74
|
-
campaign?: string;
|
|
75
|
-
id: string;
|
|
76
|
-
object: 'voucher';
|
|
77
|
-
campaign_id?: string;
|
|
78
|
-
};
|
|
79
|
-
gift?: {
|
|
80
|
-
amount: number;
|
|
81
|
-
};
|
|
82
|
-
loyalty_card?: {
|
|
83
|
-
points: number;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export interface RedemptionsListResponse {
|
|
87
|
-
object: 'list';
|
|
88
|
-
total: number;
|
|
89
|
-
data_ref: 'redemptions';
|
|
90
|
-
redemptions: (Redemption | SimpleRollback)[];
|
|
91
|
-
}
|
|
92
|
-
export interface RedemptionsGetForVoucherResponse {
|
|
93
|
-
object: 'list';
|
|
94
|
-
total: number;
|
|
95
|
-
data_ref: string;
|
|
96
|
-
quantity: number;
|
|
97
|
-
redeemed_quantity?: number;
|
|
98
|
-
redeemed_amount?: number;
|
|
99
|
-
redemption_entries?: (Redemption | SimpleRollback)[];
|
|
100
|
-
}
|
|
101
|
-
export interface RedemptionsRollbackParams {
|
|
102
|
-
reason?: string;
|
|
103
|
-
tracking_id?: string;
|
|
104
|
-
customer?: SimpleCustomer & {
|
|
105
|
-
description?: string;
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
export interface RedemptionsRollbackQueryParams {
|
|
109
|
-
reason?: string;
|
|
110
|
-
tracking_id?: string;
|
|
111
|
-
}
|
|
112
|
-
export interface RedemptionsRollbackPayload {
|
|
113
|
-
customer?: SimpleCustomer & {
|
|
114
|
-
description?: string;
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
export interface RedemptionsRollbackResponse {
|
|
118
|
-
id: string;
|
|
119
|
-
object: 'redemption_rollback';
|
|
120
|
-
date?: string;
|
|
121
|
-
customer_id?: string;
|
|
122
|
-
tracking_id?: string;
|
|
123
|
-
redemption?: string;
|
|
124
|
-
amount?: number;
|
|
125
|
-
reason?: string;
|
|
126
|
-
result: 'SUCCESS' | 'FAILURE';
|
|
127
|
-
voucher?: VouchersResponse;
|
|
128
|
-
customer?: SimpleCustomer;
|
|
129
|
-
reward?: {
|
|
130
|
-
assignment_id: string;
|
|
131
|
-
object: 'reward';
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
export declare type SimpleRollback = Pick<RedemptionsRollbackResponse, 'id' | 'object' | 'date' | 'customer_id' | 'tracking_id' | 'redemption' | 'result' | 'customer'> & {
|
|
135
|
-
related_object_type: 'voucher';
|
|
136
|
-
voucher: {
|
|
137
|
-
id: string;
|
|
138
|
-
object: 'voucher';
|
|
139
|
-
code: string;
|
|
140
|
-
campaign?: string;
|
|
141
|
-
campaign_id?: string;
|
|
142
|
-
};
|
|
143
|
-
gift?: {
|
|
144
|
-
amount: number;
|
|
145
|
-
};
|
|
146
|
-
loyalty_card?: {
|
|
147
|
-
points: number;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
export interface RedemptionsRedeemStackableParams {
|
|
151
|
-
options?: StackableOptions;
|
|
152
|
-
redeemables: StackableRedeemableParams[];
|
|
153
|
-
session?: ValidationSessionParams;
|
|
154
|
-
order?: OrdersCreate;
|
|
155
|
-
customer?: CustomersCreateBody;
|
|
156
|
-
metadata?: Record<string, any>;
|
|
157
|
-
}
|
|
158
|
-
export declare type RedemptionsRedeemStackableRedemptionResult = RedemptionsRedeemResponse & {
|
|
159
|
-
redemption: string;
|
|
160
|
-
};
|
|
161
|
-
export declare type RedemptionsRedeemStackableOrderResponse = OrdersCreateResponse & {
|
|
162
|
-
redemptions?: Record<string, {
|
|
163
|
-
date: string;
|
|
164
|
-
rollback_id?: string;
|
|
165
|
-
rollback_date?: string;
|
|
166
|
-
related_object_type: 'redemption';
|
|
167
|
-
related_object_id: string;
|
|
168
|
-
stacked: string[];
|
|
169
|
-
rollback_stacked?: string[];
|
|
170
|
-
}>;
|
|
171
|
-
};
|
|
172
|
-
export interface RedemptionsRedeemStackableResponse {
|
|
173
|
-
redemptions: RedemptionsRedeemStackableRedemptionResult[];
|
|
174
|
-
parent_redemption: {
|
|
175
|
-
id: string;
|
|
176
|
-
object: 'redemption';
|
|
177
|
-
date: string;
|
|
178
|
-
customer_id?: string;
|
|
179
|
-
tracking_id?: string;
|
|
180
|
-
metadata?: Record<string, any>;
|
|
181
|
-
result: 'SUCCESS' | 'FAILURE';
|
|
182
|
-
order?: RedemptionsRedeemStackableOrderResponse;
|
|
183
|
-
customer?: SimpleCustomer;
|
|
184
|
-
related_object_type: 'redemption';
|
|
185
|
-
related_object_id: string;
|
|
186
|
-
};
|
|
187
|
-
order?: RedemptionsRedeemStackableOrderResponse;
|
|
188
|
-
skipped_redeemables?: StackableRedeemableSkippedResponse;
|
|
189
|
-
inapplicable_redeemables?: StackableRedeemableInapplicableResponse;
|
|
190
|
-
}
|
|
191
|
-
export interface RedemptionsRollbackStackableResponse {
|
|
192
|
-
rollbacks: RedemptionsRedeemStackableRedemptionResult[];
|
|
193
|
-
parent_rollback: {
|
|
194
|
-
id: string;
|
|
195
|
-
date: string;
|
|
196
|
-
customer_id?: string;
|
|
197
|
-
tracking_id?: string;
|
|
198
|
-
metadata?: Record<string, any>;
|
|
199
|
-
result: 'SUCCESS' | 'FAILURE';
|
|
200
|
-
order?: OrdersCreateResponse;
|
|
201
|
-
customer?: SimpleCustomer;
|
|
202
|
-
redemption: string;
|
|
203
|
-
};
|
|
204
|
-
order?: RedemptionsRedeemStackableOrderResponse;
|
|
205
|
-
}
|
package/dist/types/Rewards.d.ts
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
export interface RewardsListParams {
|
|
2
|
-
page?: number;
|
|
3
|
-
limit?: number;
|
|
4
|
-
}
|
|
5
|
-
export interface RewardsResponse {
|
|
6
|
-
id: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
stock?: number;
|
|
9
|
-
redeemed?: number;
|
|
10
|
-
attributes?: {
|
|
11
|
-
image_url?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
};
|
|
14
|
-
created_at: string;
|
|
15
|
-
updated_at?: string;
|
|
16
|
-
object: 'reward';
|
|
17
|
-
}
|
|
18
|
-
export declare type RewardsCreateResponse = RewardsResponse & RewardsTypeResponse;
|
|
19
|
-
export declare type RewardsGetResponse = RewardsResponse & RewardsTypeResponse;
|
|
20
|
-
export interface RewardsListResponse {
|
|
21
|
-
object: 'list';
|
|
22
|
-
total: number;
|
|
23
|
-
data_ref: 'data';
|
|
24
|
-
data: RewardsCreateResponse[];
|
|
25
|
-
}
|
|
26
|
-
export interface Rewards {
|
|
27
|
-
name: string;
|
|
28
|
-
stock?: number;
|
|
29
|
-
attributes?: {
|
|
30
|
-
image_url?: string;
|
|
31
|
-
description?: string;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
interface RewardsTypeMaterial {
|
|
35
|
-
type?: 'MATERIAL';
|
|
36
|
-
parameters: {
|
|
37
|
-
product?: {
|
|
38
|
-
id?: string;
|
|
39
|
-
sku?: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
interface RewardsTypeCampaign {
|
|
44
|
-
type?: 'CAMPAIGN';
|
|
45
|
-
parameters: {
|
|
46
|
-
campaign?: {
|
|
47
|
-
id: string;
|
|
48
|
-
balance?: number;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
interface RewardsTypeCampaignResponse {
|
|
53
|
-
type?: 'CAMPAIGN';
|
|
54
|
-
parameters: {
|
|
55
|
-
campaign?: {
|
|
56
|
-
id: string;
|
|
57
|
-
balance?: number;
|
|
58
|
-
type?: 'DISCOUNT_COUPONS' | 'PROMOTION' | 'GIFT_VOUCHERS' | 'REFERRAL_PROGRAM';
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
interface RewardsTypeCoin {
|
|
63
|
-
type?: 'COIN';
|
|
64
|
-
parameters: {
|
|
65
|
-
coin?: {
|
|
66
|
-
exchange_ratio?: number;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
export declare type RewardsType = RewardsTypeCampaign | RewardsTypeCoin | RewardsTypeMaterial;
|
|
71
|
-
export declare type RewardsTypeResponse = Required<RewardsTypeCampaignResponse> | Required<RewardsTypeCoin> | Required<RewardsTypeMaterial>;
|
|
72
|
-
export declare type RewardsCreate = Rewards & RewardsType;
|
|
73
|
-
export declare type RewardsUpdate = Omit<RewardsCreate, 'type'> & {
|
|
74
|
-
id: string;
|
|
75
|
-
};
|
|
76
|
-
export declare type RewardsUpdateResponse = RewardsCreateResponse;
|
|
77
|
-
export interface RewardsAssignmentObject {
|
|
78
|
-
id: string;
|
|
79
|
-
reward_id: string;
|
|
80
|
-
related_object_id?: string;
|
|
81
|
-
related_object_type?: string;
|
|
82
|
-
parameters?: {
|
|
83
|
-
loyalty?: {
|
|
84
|
-
points: number;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
created_at: string;
|
|
88
|
-
updated_at?: string;
|
|
89
|
-
object: 'reward_assignment';
|
|
90
|
-
}
|
|
91
|
-
export interface RewardsListAssignmentsParams {
|
|
92
|
-
limit?: number;
|
|
93
|
-
page?: number;
|
|
94
|
-
}
|
|
95
|
-
export interface RewardsListAssignmentsResponse {
|
|
96
|
-
total: number;
|
|
97
|
-
data: RewardsAssignmentObject[];
|
|
98
|
-
object: 'list';
|
|
99
|
-
data_ref: 'data';
|
|
100
|
-
}
|
|
101
|
-
export interface RewardsCreateAssignment {
|
|
102
|
-
campaign?: string;
|
|
103
|
-
parameters?: {
|
|
104
|
-
loyalty?: {
|
|
105
|
-
points: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export declare type RewardsCreateAssignmentResponse = RewardsAssignmentObject;
|
|
110
|
-
export declare type RewardsUpdateAssignment = RewardsCreateAssignment & {
|
|
111
|
-
id: string;
|
|
112
|
-
};
|
|
113
|
-
export declare type RewardsUpdateAssignmentResponse = RewardsAssignmentObject;
|
|
114
|
-
export interface RewardRedemptionParams {
|
|
115
|
-
points?: number;
|
|
116
|
-
assignment_id?: string;
|
|
117
|
-
id?: string;
|
|
118
|
-
}
|
|
119
|
-
export declare type Reward = {
|
|
120
|
-
id: string;
|
|
121
|
-
name?: string;
|
|
122
|
-
stock?: string;
|
|
123
|
-
redeemed?: string;
|
|
124
|
-
attributes?: {
|
|
125
|
-
image_url?: string;
|
|
126
|
-
description?: string;
|
|
127
|
-
};
|
|
128
|
-
created_at: string;
|
|
129
|
-
updated_at?: string;
|
|
130
|
-
object: 'reward';
|
|
131
|
-
} & RewardType;
|
|
132
|
-
export interface RewardTypeCampaign {
|
|
133
|
-
type: 'CAMPAIGN';
|
|
134
|
-
parameters: {
|
|
135
|
-
campaign: {
|
|
136
|
-
id: string;
|
|
137
|
-
balance?: number;
|
|
138
|
-
type: 'DISCOUNT_COUPONS' | 'PROMOTION' | 'GIFT_VOUCHERS' | 'REFERRAL_PROGRAM';
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
export interface RewardTypeCoin {
|
|
143
|
-
type: 'COIN';
|
|
144
|
-
parameters: {
|
|
145
|
-
coin: {
|
|
146
|
-
exchange_ratio: number;
|
|
147
|
-
points_ratio?: number;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
export interface RewardTypeMaterial {
|
|
152
|
-
type: 'MATERIAL';
|
|
153
|
-
parameters: {
|
|
154
|
-
product: {
|
|
155
|
-
id: string;
|
|
156
|
-
sku: string | null;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
export declare type RewardType = RewardTypeCampaign | RewardTypeCoin | RewardTypeMaterial;
|
|
161
|
-
export declare type RewardAssignment = RewardsAssignmentCoinReward | RewardsAssignmentCampaignOrMaterialReward;
|
|
162
|
-
export interface RewardsAssignmentCoinReward {
|
|
163
|
-
id: string;
|
|
164
|
-
reward_id: string;
|
|
165
|
-
related_object_id: string;
|
|
166
|
-
related_object_type: 'campaign';
|
|
167
|
-
created_at: string;
|
|
168
|
-
updated_at: string | null;
|
|
169
|
-
object: 'reward-assignment';
|
|
170
|
-
}
|
|
171
|
-
export interface RewardsAssignmentCampaignOrMaterialReward {
|
|
172
|
-
id: string;
|
|
173
|
-
reward_id: string;
|
|
174
|
-
related_object_id: string;
|
|
175
|
-
related_object_type: 'campaign';
|
|
176
|
-
created_at: string;
|
|
177
|
-
updated_at: string | null;
|
|
178
|
-
object: 'reward-assignment';
|
|
179
|
-
parameters: {
|
|
180
|
-
loyalty: {
|
|
181
|
-
points?: number;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
export declare type RewardsGetAssignmentResponseBody = RewardAssignment;
|
|
186
|
-
export interface RewardsListAssignmentsRequestQuery {
|
|
187
|
-
limit?: number;
|
|
188
|
-
page?: number;
|
|
189
|
-
}
|
|
190
|
-
export interface RewardsListAssignmentsResponseBody {
|
|
191
|
-
object: 'list';
|
|
192
|
-
data_ref: 'data';
|
|
193
|
-
data: RewardAssignment[];
|
|
194
|
-
total: number;
|
|
195
|
-
}
|
|
196
|
-
export declare type RewardsCreateAssignmentRequestBody = RewardsCreateAssignmentCoinRewardRequestBody | RewardsCreateAssignmentCampaignOrMaterialRewardRequestBody;
|
|
197
|
-
export interface RewardsCreateAssignmentCoinRewardRequestBody {
|
|
198
|
-
campaign: string;
|
|
199
|
-
validation_rules?: string[];
|
|
200
|
-
}
|
|
201
|
-
export interface RewardsCreateAssignmentCampaignOrMaterialRewardRequestBody {
|
|
202
|
-
campaign: string;
|
|
203
|
-
parameters: {
|
|
204
|
-
loyalty: {
|
|
205
|
-
points?: number;
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
export declare type RewardsCreateAssignmentResponseBody = RewardAssignment;
|
|
210
|
-
export interface RewardsUpdateAssignmentRequestBody {
|
|
211
|
-
parameters?: {
|
|
212
|
-
loyalty?: {
|
|
213
|
-
points?: number;
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
id: string;
|
|
217
|
-
}
|
|
218
|
-
export declare type RewardsUpdateAssignmentResponseBody = RewardAssignment;
|
|
219
|
-
export {};
|
package/dist/types/Segments.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface SegmentsCreate {
|
|
2
|
-
name: string;
|
|
3
|
-
type: 'static' | 'auto-update';
|
|
4
|
-
filter?: {
|
|
5
|
-
junction?: 'AND' | 'OR';
|
|
6
|
-
[filter_conditions: string]: any;
|
|
7
|
-
};
|
|
8
|
-
customers?: string[];
|
|
9
|
-
}
|
|
10
|
-
export interface SegmentsCreateResponse {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
created_at: string;
|
|
14
|
-
metadata?: Record<string, any>;
|
|
15
|
-
filter?: {
|
|
16
|
-
junction?: 'AND' | 'OR';
|
|
17
|
-
[filter_conditions: string]: any;
|
|
18
|
-
};
|
|
19
|
-
type?: string;
|
|
20
|
-
object: 'segment';
|
|
21
|
-
}
|
|
22
|
-
export declare type SegmentsGetResponse = SegmentsCreateResponse;
|
|
23
|
-
export interface SegmentsListResponse {
|
|
24
|
-
object: 'list';
|
|
25
|
-
total: number;
|
|
26
|
-
data_ref: 'data';
|
|
27
|
-
data: {
|
|
28
|
-
id: string;
|
|
29
|
-
name: string;
|
|
30
|
-
object: 'segment';
|
|
31
|
-
}[];
|
|
32
|
-
}
|