@voucherify/sdk 1.2.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/CHANGELOG.md +110 -0
- package/README.md +1258 -0
- package/dist/AsyncActions.d.ts +15 -0
- package/dist/Balance.d.ts +12 -0
- package/dist/Campaigns.d.ts +45 -0
- package/dist/ClientSide.d.ts +40 -0
- package/dist/Consents.d.ts +10 -0
- package/dist/Customers.d.ts +43 -0
- package/dist/Distributions.d.ts +22 -0
- package/dist/Events.d.ts +7 -0
- package/dist/Exports.d.ts +18 -0
- package/dist/Loyalties.d.ts +82 -0
- package/dist/Orders.d.ts +22 -0
- package/dist/Products.d.ts +54 -0
- package/dist/PromotionTiers.d.ts +30 -0
- package/dist/Promotions.d.ts +16 -0
- package/dist/Redemptions.d.ts +26 -0
- package/dist/RequestController.d.ts +20 -0
- package/dist/Rewards.d.ts +39 -0
- package/dist/Segments.d.ts +22 -0
- package/dist/ValidationRules.d.ts +39 -0
- package/dist/Validations.d.ts +13 -0
- package/dist/VoucherifyClientSide.d.ts +76 -0
- package/dist/VoucherifyError.d.ts +6 -0
- package/dist/VoucherifyServerSide.d.ts +111 -0
- package/dist/Vouchers.d.ts +64 -0
- package/dist/helpers.d.ts +19 -0
- package/dist/index.d.ts +24 -0
- package/dist/types/AsyncActions.d.ts +18 -0
- package/dist/types/Balance.d.ts +14 -0
- package/dist/types/Campaigns.d.ts +117 -0
- package/dist/types/ClientSide.d.ts +135 -0
- package/dist/types/Consents.d.ts +33 -0
- package/dist/types/Customers.d.ts +113 -0
- package/dist/types/Distributions.d.ts +141 -0
- package/dist/types/Events.d.ts +17 -0
- package/dist/types/Exports.d.ts +30 -0
- package/dist/types/Loyalties.d.ts +462 -0
- package/dist/types/Orders.d.ts +61 -0
- package/dist/types/Products.d.ts +97 -0
- package/dist/types/PromotionTiers.d.ts +107 -0
- package/dist/types/Promotions.d.ts +90 -0
- package/dist/types/Redemptions.d.ts +150 -0
- package/dist/types/Rewards.d.ts +114 -0
- package/dist/types/Segments.d.ts +32 -0
- package/dist/types/ValidationRules.d.ts +74 -0
- package/dist/types/Validations.d.ts +66 -0
- package/dist/types/Vouchers.d.ts +227 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/voucherifysdk.esm.js +1567 -0
- package/dist/voucherifysdk.esm.js.map +1 -0
- package/dist/voucherifysdk.umd.development.js +1578 -0
- package/dist/voucherifysdk.umd.development.js.map +1 -0
- package/dist/voucherifysdk.umd.production.min.js +2 -0
- package/dist/voucherifysdk.umd.production.min.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { OrdersGetResponse } from './Orders';
|
|
2
|
+
import { SimpleCustomer } from './Customers';
|
|
3
|
+
export declare type VoucherType = 'GIFT' | 'DISCOUNT' | 'LOYALTY_CARD' | 'LUCKY_DRAW';
|
|
4
|
+
export interface SimpleVoucher {
|
|
5
|
+
code_config?: {
|
|
6
|
+
length?: number;
|
|
7
|
+
charset?: string;
|
|
8
|
+
pattern?: string;
|
|
9
|
+
prefix?: string;
|
|
10
|
+
suffix?: string;
|
|
11
|
+
};
|
|
12
|
+
type: VoucherType;
|
|
13
|
+
is_referral_code?: boolean;
|
|
14
|
+
discount?: DiscountUnit | DiscountAmount | DiscountPercent;
|
|
15
|
+
loyalty_card?: {
|
|
16
|
+
points: number;
|
|
17
|
+
balance: number;
|
|
18
|
+
};
|
|
19
|
+
redemption?: {
|
|
20
|
+
quantity: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface DiscountUnit {
|
|
24
|
+
type?: 'UNIT';
|
|
25
|
+
unit_off?: number;
|
|
26
|
+
effect?: 'ADD_MISSING_ITEMS' | 'ADD_NEW_ITEMS';
|
|
27
|
+
unit_type?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DiscountAmount {
|
|
30
|
+
type?: 'AMOUNT';
|
|
31
|
+
amount_off?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface DiscountPercent {
|
|
34
|
+
type?: 'PERCENT';
|
|
35
|
+
percent_off?: number;
|
|
36
|
+
amount_limit?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface VouchersResponse {
|
|
39
|
+
id: string;
|
|
40
|
+
code: string;
|
|
41
|
+
campaign?: string;
|
|
42
|
+
category?: string;
|
|
43
|
+
type?: 'DISCOUNT_VOUCHER' | 'GIFT_VOUCHER';
|
|
44
|
+
discount?: DiscountAmount | DiscountPercent | DiscountUnit;
|
|
45
|
+
gift?: {
|
|
46
|
+
amount: number;
|
|
47
|
+
};
|
|
48
|
+
loyalty_card?: {
|
|
49
|
+
points: number;
|
|
50
|
+
};
|
|
51
|
+
start_date?: string;
|
|
52
|
+
expiration_date?: string;
|
|
53
|
+
validity_timeframe?: {
|
|
54
|
+
interval: string;
|
|
55
|
+
duration: string;
|
|
56
|
+
};
|
|
57
|
+
validity_day_of_week?: number[];
|
|
58
|
+
publish?: {
|
|
59
|
+
object: 'list';
|
|
60
|
+
count: number;
|
|
61
|
+
data_ref: 'entries';
|
|
62
|
+
entries: string[];
|
|
63
|
+
total: number;
|
|
64
|
+
url: string;
|
|
65
|
+
};
|
|
66
|
+
redemption?: {
|
|
67
|
+
object: 'list';
|
|
68
|
+
quantity?: number;
|
|
69
|
+
redeemed_quantity: number;
|
|
70
|
+
data_ref: 'redemption_entries';
|
|
71
|
+
redemption_entries: string[];
|
|
72
|
+
total: number;
|
|
73
|
+
url: string;
|
|
74
|
+
};
|
|
75
|
+
active: boolean;
|
|
76
|
+
additional_info?: string;
|
|
77
|
+
metadata?: Record<string, any>;
|
|
78
|
+
assets?: {
|
|
79
|
+
qr?: {
|
|
80
|
+
id: string;
|
|
81
|
+
url: string;
|
|
82
|
+
};
|
|
83
|
+
barcode?: {
|
|
84
|
+
id: string;
|
|
85
|
+
url: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
is_referral_code: boolean;
|
|
89
|
+
referrer_id?: string;
|
|
90
|
+
holder_id?: string;
|
|
91
|
+
updated_at?: string;
|
|
92
|
+
object: 'voucher';
|
|
93
|
+
validation_rules_assignments: {
|
|
94
|
+
object: 'list';
|
|
95
|
+
total: number;
|
|
96
|
+
data_ref: 'data';
|
|
97
|
+
data?: {
|
|
98
|
+
id: string;
|
|
99
|
+
rule_id?: string;
|
|
100
|
+
related_object_id?: string;
|
|
101
|
+
related_object_type?: string;
|
|
102
|
+
created_at: string;
|
|
103
|
+
object: 'validation_rules_assignment';
|
|
104
|
+
}[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export interface VouchersQualificationExamineBody {
|
|
108
|
+
customer?: Omit<SimpleCustomer, 'object'> & {
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
order?: Pick<OrdersGetResponse, 'id' | 'source_id' | 'amount' | 'items' | 'metadata'>;
|
|
112
|
+
reward?: {
|
|
113
|
+
id: string;
|
|
114
|
+
assignment_id?: string;
|
|
115
|
+
};
|
|
116
|
+
metadata?: Record<string, any>;
|
|
117
|
+
}
|
|
118
|
+
export interface VouchersQualificationExamineParams {
|
|
119
|
+
audienceRulesOnly?: boolean;
|
|
120
|
+
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at';
|
|
121
|
+
limit?: number;
|
|
122
|
+
}
|
|
123
|
+
export interface VouchersQualificationExamineResponse {
|
|
124
|
+
object: 'list';
|
|
125
|
+
total: number;
|
|
126
|
+
data_ref: 'data';
|
|
127
|
+
data?: VouchersResponse[];
|
|
128
|
+
}
|
|
129
|
+
export interface VouchersCreateParameters {
|
|
130
|
+
active?: boolean;
|
|
131
|
+
code?: string;
|
|
132
|
+
code_config?: {
|
|
133
|
+
length?: number;
|
|
134
|
+
charset?: string;
|
|
135
|
+
pattern?: string;
|
|
136
|
+
prefix?: string;
|
|
137
|
+
suffix?: string;
|
|
138
|
+
};
|
|
139
|
+
redemption?: {
|
|
140
|
+
quantity: number;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
export declare type VouchersCreate = VouchersCreateParameters & Pick<VouchersResponse, 'type' | 'discount' | 'gift' | 'category' | 'additional_info' | 'start_date' | 'expiration_date' | 'metadata'>;
|
|
144
|
+
export declare type VouchersCreateResponse = Omit<VouchersResponse, 'validation_rules_assignments'>;
|
|
145
|
+
export declare type VouchersGetResponse = VouchersResponse;
|
|
146
|
+
export interface VouchersUpdate {
|
|
147
|
+
code: string;
|
|
148
|
+
category?: string;
|
|
149
|
+
start_date?: string;
|
|
150
|
+
expiration_date?: string;
|
|
151
|
+
active?: boolean;
|
|
152
|
+
additional_info?: string;
|
|
153
|
+
metadata?: Record<string, any>;
|
|
154
|
+
gift?: {
|
|
155
|
+
amount: number;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export declare type VouchersUpdateResponse = VouchersResponse;
|
|
159
|
+
export interface VouchersDeleteParams {
|
|
160
|
+
force?: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface VouchersListParams {
|
|
163
|
+
limit?: number;
|
|
164
|
+
page?: number;
|
|
165
|
+
category?: string;
|
|
166
|
+
campaign?: string;
|
|
167
|
+
customer?: string;
|
|
168
|
+
created_at?: {
|
|
169
|
+
after?: string;
|
|
170
|
+
before?: string;
|
|
171
|
+
};
|
|
172
|
+
updated_at?: {
|
|
173
|
+
after?: string;
|
|
174
|
+
before?: string;
|
|
175
|
+
};
|
|
176
|
+
order?: '-created_at' | 'created_at' | '-updated_at' | 'updated_at' | '-type' | 'type' | '-code' | 'code' | '-campaign' | 'campaign' | '-category' | 'category';
|
|
177
|
+
}
|
|
178
|
+
export interface VouchersListResponse {
|
|
179
|
+
object: 'list';
|
|
180
|
+
total: number;
|
|
181
|
+
data_ref: 'vouchers';
|
|
182
|
+
vouchers: VouchersResponse[];
|
|
183
|
+
}
|
|
184
|
+
export declare type VouchersEnableResponse = VouchersResponse;
|
|
185
|
+
export declare type VouchersDisableResponse = VouchersResponse;
|
|
186
|
+
export interface VouchersImport {
|
|
187
|
+
code: string;
|
|
188
|
+
category?: string;
|
|
189
|
+
type?: 'DISCOUNT_VOUCHER' | 'GIFT_VOUCHER';
|
|
190
|
+
discount: DiscountAmount | DiscountPercent | DiscountUnit;
|
|
191
|
+
additional_info?: string;
|
|
192
|
+
start_date?: string;
|
|
193
|
+
expiration_date?: string;
|
|
194
|
+
active?: boolean;
|
|
195
|
+
metadata?: Record<string, any>;
|
|
196
|
+
redemption?: {
|
|
197
|
+
quantity: number;
|
|
198
|
+
};
|
|
199
|
+
code_config?: {
|
|
200
|
+
length?: number;
|
|
201
|
+
charset?: string;
|
|
202
|
+
pattern?: string;
|
|
203
|
+
prefix?: string;
|
|
204
|
+
suffix?: string;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export interface VouchersBulkUpdateObject {
|
|
208
|
+
code: string;
|
|
209
|
+
metadata?: Record<string, any>;
|
|
210
|
+
}
|
|
211
|
+
export declare type VouchersBulkUpdate = VouchersBulkUpdateObject[];
|
|
212
|
+
export interface VouchersBulkUpdateMetadata {
|
|
213
|
+
codes: string[];
|
|
214
|
+
metadata?: Record<string, any>;
|
|
215
|
+
}
|
|
216
|
+
export interface VouchersBulkUpdateMetadataObjectResponse {
|
|
217
|
+
code: string;
|
|
218
|
+
found: boolean;
|
|
219
|
+
updated: boolean;
|
|
220
|
+
}
|
|
221
|
+
export declare type VouchersBulkUpdateMetadataResponse = VouchersBulkUpdateMetadataObjectResponse[];
|
|
222
|
+
export interface VouchersBulkUpdateObjectResponse {
|
|
223
|
+
code: string;
|
|
224
|
+
found: boolean;
|
|
225
|
+
updated: boolean;
|
|
226
|
+
}
|
|
227
|
+
export declare type VouchersBulkUpdateResponse = VouchersBulkUpdateObjectResponse[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './Customers';
|
|
2
|
+
export * from './Balance';
|
|
3
|
+
export * from './ClientSide';
|
|
4
|
+
export * from './Redemptions';
|
|
5
|
+
export * from './Validations';
|
|
6
|
+
export * from './Campaigns';
|
|
7
|
+
export * from './PromotionTiers';
|
|
8
|
+
export * from './Promotions';
|
|
9
|
+
export * from './Loyalties';
|
|
10
|
+
export * from './Vouchers';
|
|
11
|
+
export * from './ValidationRules';
|
|
12
|
+
export * from './Rewards';
|
|
13
|
+
export * from './Products';
|
|
14
|
+
export * from './Distributions';
|
|
15
|
+
export * from './Segments';
|
|
16
|
+
export * from './Exports';
|
|
17
|
+
export * from './Orders';
|
|
18
|
+
export * from './Consents';
|
|
19
|
+
export * from './Events';
|