@congminh1254/shopee-sdk 0.10.0 → 1.0.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/README.md +172 -36
- package/lib/fetch.js +13 -0
- package/lib/fetch.js.map +1 -1
- package/lib/managers/add-on-deal.manager.d.ts +140 -0
- package/lib/managers/add-on-deal.manager.js +240 -0
- package/lib/managers/add-on-deal.manager.js.map +1 -0
- package/lib/managers/ads.manager.d.ts +217 -1
- package/lib/managers/ads.manager.js +312 -0
- package/lib/managers/ads.manager.js.map +1 -1
- package/lib/managers/bundle-deal.manager.d.ts +106 -0
- package/lib/managers/bundle-deal.manager.js +178 -0
- package/lib/managers/bundle-deal.manager.js.map +1 -0
- package/lib/managers/discount.manager.d.ts +102 -0
- package/lib/managers/discount.manager.js +167 -0
- package/lib/managers/discount.manager.js.map +1 -0
- package/lib/managers/fbs.manager.d.ts +115 -0
- package/lib/managers/fbs.manager.js +145 -0
- package/lib/managers/fbs.manager.js.map +1 -0
- package/lib/managers/first-mile.manager.d.ts +150 -0
- package/lib/managers/first-mile.manager.js +264 -0
- package/lib/managers/first-mile.manager.js.map +1 -0
- package/lib/managers/follow-prize.manager.d.ts +108 -0
- package/lib/managers/follow-prize.manager.js +152 -0
- package/lib/managers/follow-prize.manager.js.map +1 -0
- package/lib/managers/global-product.manager.d.ts +664 -0
- package/lib/managers/global-product.manager.js +904 -0
- package/lib/managers/global-product.manager.js.map +1 -0
- package/lib/managers/index.d.ts +17 -1
- package/lib/managers/index.js +17 -1
- package/lib/managers/index.js.map +1 -1
- package/lib/managers/livestream.manager.d.ts +377 -0
- package/lib/managers/livestream.manager.js +529 -0
- package/lib/managers/livestream.manager.js.map +1 -0
- package/lib/managers/logistics.manager.d.ts +267 -1
- package/lib/managers/logistics.manager.js +544 -0
- package/lib/managers/logistics.manager.js.map +1 -1
- package/lib/managers/media-space.manager.d.ts +179 -0
- package/lib/managers/media-space.manager.js +220 -0
- package/lib/managers/media-space.manager.js.map +1 -0
- package/lib/managers/media.manager.d.ts +226 -0
- package/lib/managers/media.manager.js +274 -0
- package/lib/managers/media.manager.js.map +1 -0
- package/lib/managers/merchant.manager.d.ts +100 -0
- package/lib/managers/merchant.manager.js +144 -0
- package/lib/managers/merchant.manager.js.map +1 -0
- package/lib/managers/order.manager.d.ts +213 -1
- package/lib/managers/order.manager.js +305 -0
- package/lib/managers/order.manager.js.map +1 -1
- package/lib/managers/payment.manager.d.ts +186 -1
- package/lib/managers/payment.manager.js +288 -0
- package/lib/managers/payment.manager.js.map +1 -1
- package/lib/managers/returns.manager.d.ts +200 -0
- package/lib/managers/returns.manager.js +300 -0
- package/lib/managers/returns.manager.js.map +1 -0
- package/lib/managers/sbs.manager.d.ts +112 -0
- package/lib/managers/sbs.manager.js +149 -0
- package/lib/managers/sbs.manager.js.map +1 -0
- package/lib/managers/shop-category.manager.d.ts +207 -0
- package/lib/managers/shop-category.manager.js +258 -0
- package/lib/managers/shop-category.manager.js.map +1 -0
- package/lib/managers/shop-flash-sale.manager.d.ts +242 -0
- package/lib/managers/shop-flash-sale.manager.js +321 -0
- package/lib/managers/shop-flash-sale.manager.js.map +1 -0
- package/lib/managers/shop.manager.d.ts +173 -0
- package/lib/managers/shop.manager.js +217 -0
- package/lib/managers/shop.manager.js.map +1 -0
- package/lib/managers/top-picks.manager.d.ts +62 -0
- package/lib/managers/top-picks.manager.js +91 -0
- package/lib/managers/top-picks.manager.js.map +1 -0
- package/lib/schemas/add-on-deal.d.ts +390 -0
- package/lib/schemas/add-on-deal.js +45 -0
- package/lib/schemas/add-on-deal.js.map +1 -0
- package/lib/schemas/ads.d.ts +437 -0
- package/lib/schemas/bundle-deal.d.ts +300 -0
- package/lib/schemas/bundle-deal.js +27 -0
- package/lib/schemas/bundle-deal.js.map +1 -0
- package/lib/schemas/discount.d.ts +334 -0
- package/lib/schemas/discount.js +15 -0
- package/lib/schemas/discount.js.map +1 -0
- package/lib/schemas/fbs.d.ts +117 -0
- package/lib/schemas/fbs.js +2 -0
- package/lib/schemas/fbs.js.map +1 -0
- package/lib/schemas/first-mile.d.ts +551 -0
- package/lib/schemas/first-mile.js +2 -0
- package/lib/schemas/first-mile.js.map +1 -0
- package/lib/schemas/follow-prize.d.ts +198 -0
- package/lib/schemas/follow-prize.js +27 -0
- package/lib/schemas/follow-prize.js.map +1 -0
- package/lib/schemas/global-product.d.ts +1127 -0
- package/lib/schemas/global-product.js +2 -0
- package/lib/schemas/global-product.js.map +1 -0
- package/lib/schemas/index.d.ts +13 -0
- package/lib/schemas/index.js +17 -0
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/livestream.d.ts +649 -0
- package/lib/schemas/livestream.js +2 -0
- package/lib/schemas/livestream.js.map +1 -0
- package/lib/schemas/logistics.d.ts +979 -0
- package/lib/schemas/logistics.js +13 -0
- package/lib/schemas/logistics.js.map +1 -1
- package/lib/schemas/media-space.d.ts +189 -0
- package/lib/schemas/media-space.js +2 -0
- package/lib/schemas/media-space.js.map +1 -0
- package/lib/schemas/media.d.ts +230 -0
- package/lib/schemas/media.js +2 -0
- package/lib/schemas/media.js.map +1 -0
- package/lib/schemas/merchant.d.ts +236 -0
- package/lib/schemas/merchant.js +2 -0
- package/lib/schemas/merchant.js.map +1 -0
- package/lib/schemas/order.d.ts +431 -0
- package/lib/schemas/payment.d.ts +397 -0
- package/lib/schemas/returns.d.ts +632 -0
- package/lib/schemas/returns.js +63 -0
- package/lib/schemas/returns.js.map +1 -0
- package/lib/schemas/sbs.d.ts +484 -0
- package/lib/schemas/sbs.js +2 -0
- package/lib/schemas/sbs.js.map +1 -0
- package/lib/schemas/shop-category.d.ts +176 -0
- package/lib/schemas/shop-category.js +2 -0
- package/lib/schemas/shop-category.js.map +1 -0
- package/lib/schemas/shop-flash-sale.d.ts +473 -0
- package/lib/schemas/shop-flash-sale.js +43 -0
- package/lib/schemas/shop-flash-sale.js.map +1 -0
- package/lib/schemas/shop.d.ts +250 -0
- package/lib/schemas/shop.js +2 -0
- package/lib/schemas/shop.js.map +1 -0
- package/lib/schemas/top-picks.d.ts +99 -0
- package/lib/schemas/top-picks.js +2 -0
- package/lib/schemas/top-picks.js.map +1 -0
- package/lib/sdk.d.ts +34 -0
- package/lib/sdk.js +34 -0
- package/lib/sdk.js.map +1 -1
- package/package.json +2 -4
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { BaseResponse } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bundle deal rule types
|
|
4
|
+
*/
|
|
5
|
+
export declare enum BundleDealRuleType {
|
|
6
|
+
/** Fixed price for the bundle */
|
|
7
|
+
FIX_PRICE = 1,
|
|
8
|
+
/** Discount percentage */
|
|
9
|
+
DISCOUNT_PERCENTAGE = 2,
|
|
10
|
+
/** Discount value */
|
|
11
|
+
DISCOUNT_VALUE = 3
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Bundle deal time status for filtering
|
|
15
|
+
*/
|
|
16
|
+
export declare enum BundleDealTimeStatus {
|
|
17
|
+
/** All bundle deals regardless of status */
|
|
18
|
+
ALL = 1,
|
|
19
|
+
/** Bundle deals that have not started yet */
|
|
20
|
+
UPCOMING = 2,
|
|
21
|
+
/** Currently active bundle deals */
|
|
22
|
+
ONGOING = 3,
|
|
23
|
+
/** Bundle deals that have ended */
|
|
24
|
+
EXPIRED = 4
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Additional tier for multi-tier bundle deals
|
|
28
|
+
*/
|
|
29
|
+
export interface BundleDealAdditionalTier {
|
|
30
|
+
/** The quantity of items that the buyers need to purchase for additional tier */
|
|
31
|
+
min_amount: number;
|
|
32
|
+
/** The bundle price when the buyers purchase a bundle deal for additional tiers */
|
|
33
|
+
fix_price?: number;
|
|
34
|
+
/** The bundle deal discount amount the buyer can save when purchasing a bundle deal */
|
|
35
|
+
discount_value?: number;
|
|
36
|
+
/** The bundle deal discount% that the buyer can get when buying a bundle deal for additional tiers */
|
|
37
|
+
discount_percentage?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Bundle deal rule information
|
|
41
|
+
*/
|
|
42
|
+
export interface BundleDealRule {
|
|
43
|
+
/** The bundle deal rule type */
|
|
44
|
+
rule_type: BundleDealRuleType;
|
|
45
|
+
/** The deducted price when buying a bundle deal */
|
|
46
|
+
discount_value?: number;
|
|
47
|
+
/** The amount of the buyer needs to spend to purchase a bundle deal */
|
|
48
|
+
fix_price?: number;
|
|
49
|
+
/** The discount that the buyer can get when buying a bundle deal */
|
|
50
|
+
discount_percentage?: number;
|
|
51
|
+
/** The quantity of items that need buyer to combine purchased */
|
|
52
|
+
min_amount: number;
|
|
53
|
+
/** Additional tiers for tiered bundle deals (max 2 additional tiers) */
|
|
54
|
+
additional_tiers?: BundleDealAdditionalTier[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Bundle deal item in list
|
|
58
|
+
*/
|
|
59
|
+
export interface BundleDealItem {
|
|
60
|
+
/** Shopee's unique identifier for an item */
|
|
61
|
+
item_id: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Bundle deal information
|
|
65
|
+
*/
|
|
66
|
+
export interface BundleDealInfo {
|
|
67
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
68
|
+
bundle_deal_id: number;
|
|
69
|
+
/** Title of the bundle deal */
|
|
70
|
+
name: string;
|
|
71
|
+
/** The time when bundle deal activity start */
|
|
72
|
+
start_time: number;
|
|
73
|
+
/** The time when bundle deal activity end */
|
|
74
|
+
end_time: number;
|
|
75
|
+
/** Bundle deal rule configuration */
|
|
76
|
+
bundle_deal_rule: BundleDealRule;
|
|
77
|
+
/** Maximum number of bundle deals that can be bought by a buyer */
|
|
78
|
+
purchase_limit: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Failed item in batch operations
|
|
82
|
+
*/
|
|
83
|
+
export interface BundleDealFailedItem {
|
|
84
|
+
/** Shopee's unique identifier for an item */
|
|
85
|
+
item_id: number;
|
|
86
|
+
/** Error code */
|
|
87
|
+
fail_error: string;
|
|
88
|
+
/** Error message */
|
|
89
|
+
fail_message: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Parameters for adding a new bundle deal
|
|
93
|
+
*/
|
|
94
|
+
export interface AddBundleDealParams {
|
|
95
|
+
/** The bundle deal rule type */
|
|
96
|
+
rule_type: BundleDealRuleType;
|
|
97
|
+
/** The deducted price when buying a bundle deal (required when rule_type is DISCOUNT_VALUE) */
|
|
98
|
+
discount_value?: number;
|
|
99
|
+
/** The amount of the buyer needs to spend to purchase a bundle deal (required when rule_type is FIX_PRICE) */
|
|
100
|
+
fix_price?: number;
|
|
101
|
+
/** The discount that the buyer can get when buying a bundle deal (required when rule_type is DISCOUNT_PERCENTAGE) */
|
|
102
|
+
discount_percentage?: number;
|
|
103
|
+
/** The quantity of items that need buyer to combine purchased */
|
|
104
|
+
min_amount: number;
|
|
105
|
+
/** The time when bundle deal activity start */
|
|
106
|
+
start_time: number;
|
|
107
|
+
/** The time when bundle deal activity end */
|
|
108
|
+
end_time: number;
|
|
109
|
+
/** Title of the bundle deal */
|
|
110
|
+
name: string;
|
|
111
|
+
/** Maximum number of bundle deals that can be bought by a buyer */
|
|
112
|
+
purchase_limit: number;
|
|
113
|
+
/** Additional tiers for tiered bundle deals (max 2 additional tiers) */
|
|
114
|
+
additional_tiers?: BundleDealAdditionalTier[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Parameters for adding items to a bundle deal
|
|
118
|
+
*/
|
|
119
|
+
export interface AddBundleDealItemParams {
|
|
120
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
121
|
+
bundle_deal_id: number;
|
|
122
|
+
/** List of items to add to the bundle deal */
|
|
123
|
+
item_list: BundleDealItem[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Parameters for deleting a bundle deal
|
|
127
|
+
*/
|
|
128
|
+
export interface DeleteBundleDealParams {
|
|
129
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
130
|
+
bundle_deal_id: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Parameters for deleting items from a bundle deal
|
|
134
|
+
*/
|
|
135
|
+
export interface DeleteBundleDealItemParams {
|
|
136
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
137
|
+
bundle_deal_id: number;
|
|
138
|
+
/** List of items to delete from the bundle deal */
|
|
139
|
+
item_list: BundleDealItem[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Parameters for ending a bundle deal immediately
|
|
143
|
+
*/
|
|
144
|
+
export interface EndBundleDealParams {
|
|
145
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
146
|
+
bundle_deal_id: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Parameters for getting bundle deal details
|
|
150
|
+
*/
|
|
151
|
+
export interface GetBundleDealParams {
|
|
152
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
153
|
+
bundle_deal_id: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Parameters for getting bundle deal items
|
|
157
|
+
*/
|
|
158
|
+
export interface GetBundleDealItemParams {
|
|
159
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
160
|
+
bundle_deal_id: number;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Parameters for getting a list of bundle deals
|
|
164
|
+
*/
|
|
165
|
+
export interface GetBundleDealListParams {
|
|
166
|
+
/** Data paging, representing the data size of each page (max: 1000, default: 20) */
|
|
167
|
+
page_size?: number;
|
|
168
|
+
/** The Status of bundle deal */
|
|
169
|
+
time_status?: BundleDealTimeStatus;
|
|
170
|
+
/** Data paging, represents the page number, starting from 1 (default: 1) */
|
|
171
|
+
page_no?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Parameters for updating a bundle deal
|
|
175
|
+
*/
|
|
176
|
+
export interface UpdateBundleDealParams {
|
|
177
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
178
|
+
bundle_deal_id: number;
|
|
179
|
+
/** The bundle deal rule type */
|
|
180
|
+
rule_type?: BundleDealRuleType;
|
|
181
|
+
/** The deducted price when buying a bundle deal */
|
|
182
|
+
discount_value?: number;
|
|
183
|
+
/** The amount of the buyer needs to spend to purchase a bundle deal */
|
|
184
|
+
fix_price?: number;
|
|
185
|
+
/** The discount that the buyer can get when buying a bundle deal */
|
|
186
|
+
discount_percentage?: number;
|
|
187
|
+
/** The quantity of items that need buyer to combine purchased */
|
|
188
|
+
min_amount?: number;
|
|
189
|
+
/** The time when bundle deal activity start */
|
|
190
|
+
start_time?: number;
|
|
191
|
+
/** The time when bundle deal activity end */
|
|
192
|
+
end_time?: number;
|
|
193
|
+
/** Title of the bundle deal */
|
|
194
|
+
name?: string;
|
|
195
|
+
/** Maximum number of bundle deals that can be bought by a buyer */
|
|
196
|
+
purchase_limit?: number;
|
|
197
|
+
/** Additional tiers for tiered bundle deals */
|
|
198
|
+
additional_tiers?: BundleDealAdditionalTier[];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Parameters for updating bundle deal items
|
|
202
|
+
*/
|
|
203
|
+
export interface UpdateBundleDealItemParams {
|
|
204
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
205
|
+
bundle_deal_id: number;
|
|
206
|
+
/** List of items to update in the bundle deal */
|
|
207
|
+
item_list: BundleDealItem[];
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Response for the add bundle deal API
|
|
211
|
+
*/
|
|
212
|
+
export interface AddBundleDealResponse extends BaseResponse {
|
|
213
|
+
response: {
|
|
214
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
215
|
+
bundle_deal_id: number;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Response for the add bundle deal item API
|
|
220
|
+
*/
|
|
221
|
+
export interface AddBundleDealItemResponse extends BaseResponse {
|
|
222
|
+
response: {
|
|
223
|
+
/** List of items that failed to be added */
|
|
224
|
+
failed_list: BundleDealFailedItem[];
|
|
225
|
+
/** List of successfully added item IDs */
|
|
226
|
+
success_list: number[];
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Response for the delete bundle deal API
|
|
231
|
+
*/
|
|
232
|
+
export interface DeleteBundleDealResponse extends BaseResponse {
|
|
233
|
+
response: {
|
|
234
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
235
|
+
bundle_deal_id: number;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Response for the delete bundle deal item API
|
|
240
|
+
*/
|
|
241
|
+
export interface DeleteBundleDealItemResponse extends BaseResponse {
|
|
242
|
+
response: {
|
|
243
|
+
/** List of items that failed to be deleted */
|
|
244
|
+
failed_list: BundleDealFailedItem[];
|
|
245
|
+
/** List of successfully deleted item IDs */
|
|
246
|
+
success_list: number[];
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Response for the end bundle deal API
|
|
251
|
+
*/
|
|
252
|
+
export interface EndBundleDealResponse extends BaseResponse {
|
|
253
|
+
response: {
|
|
254
|
+
/** Shopee's unique identifier for a bundle deal activity */
|
|
255
|
+
bundle_deal_id: number;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Response for the get bundle deal API
|
|
260
|
+
*/
|
|
261
|
+
export interface GetBundleDealResponse extends BaseResponse {
|
|
262
|
+
response: BundleDealInfo;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Response for the get bundle deal item API
|
|
266
|
+
*/
|
|
267
|
+
export interface GetBundleDealItemResponse extends BaseResponse {
|
|
268
|
+
response: {
|
|
269
|
+
/** List of items in the bundle deal */
|
|
270
|
+
item_list: number[];
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Response for the get bundle deal list API
|
|
275
|
+
*/
|
|
276
|
+
export interface GetBundleDealListResponse extends BaseResponse {
|
|
277
|
+
response: {
|
|
278
|
+
/** The list of bundle deals */
|
|
279
|
+
bundle_deal_list: BundleDealInfo[];
|
|
280
|
+
/** Indicates whether there are more pages of bundle deals to retrieve */
|
|
281
|
+
more: boolean;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Response for the update bundle deal API
|
|
286
|
+
*/
|
|
287
|
+
export interface UpdateBundleDealResponse extends BaseResponse {
|
|
288
|
+
response: BundleDealInfo;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Response for the update bundle deal item API
|
|
292
|
+
*/
|
|
293
|
+
export interface UpdateBundleDealItemResponse extends BaseResponse {
|
|
294
|
+
response: {
|
|
295
|
+
/** List of items that failed to be updated */
|
|
296
|
+
failed_list: BundleDealFailedItem[];
|
|
297
|
+
/** List of successfully updated item IDs */
|
|
298
|
+
success_list: number[];
|
|
299
|
+
};
|
|
300
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle deal rule types
|
|
3
|
+
*/
|
|
4
|
+
export var BundleDealRuleType;
|
|
5
|
+
(function (BundleDealRuleType) {
|
|
6
|
+
/** Fixed price for the bundle */
|
|
7
|
+
BundleDealRuleType[BundleDealRuleType["FIX_PRICE"] = 1] = "FIX_PRICE";
|
|
8
|
+
/** Discount percentage */
|
|
9
|
+
BundleDealRuleType[BundleDealRuleType["DISCOUNT_PERCENTAGE"] = 2] = "DISCOUNT_PERCENTAGE";
|
|
10
|
+
/** Discount value */
|
|
11
|
+
BundleDealRuleType[BundleDealRuleType["DISCOUNT_VALUE"] = 3] = "DISCOUNT_VALUE";
|
|
12
|
+
})(BundleDealRuleType || (BundleDealRuleType = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Bundle deal time status for filtering
|
|
15
|
+
*/
|
|
16
|
+
export var BundleDealTimeStatus;
|
|
17
|
+
(function (BundleDealTimeStatus) {
|
|
18
|
+
/** All bundle deals regardless of status */
|
|
19
|
+
BundleDealTimeStatus[BundleDealTimeStatus["ALL"] = 1] = "ALL";
|
|
20
|
+
/** Bundle deals that have not started yet */
|
|
21
|
+
BundleDealTimeStatus[BundleDealTimeStatus["UPCOMING"] = 2] = "UPCOMING";
|
|
22
|
+
/** Currently active bundle deals */
|
|
23
|
+
BundleDealTimeStatus[BundleDealTimeStatus["ONGOING"] = 3] = "ONGOING";
|
|
24
|
+
/** Bundle deals that have ended */
|
|
25
|
+
BundleDealTimeStatus[BundleDealTimeStatus["EXPIRED"] = 4] = "EXPIRED";
|
|
26
|
+
})(BundleDealTimeStatus || (BundleDealTimeStatus = {}));
|
|
27
|
+
//# sourceMappingURL=bundle-deal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-deal.js","sourceRoot":"","sources":["../../src/schemas/bundle-deal.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,qEAAa,CAAA;IACb,0BAA0B;IAC1B,yFAAuB,CAAA;IACvB,qBAAqB;IACrB,+EAAkB,CAAA;AACpB,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,oBASX;AATD,WAAY,oBAAoB;IAC9B,4CAA4C;IAC5C,6DAAO,CAAA;IACP,6CAA6C;IAC7C,uEAAY,CAAA;IACZ,oCAAoC;IACpC,qEAAW,CAAA;IACX,mCAAmC;IACnC,qEAAW,CAAA;AACb,CAAC,EATW,oBAAoB,KAApB,oBAAoB,QAS/B"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { BaseResponse } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Status of discounts for filtering in discount list query
|
|
4
|
+
*/
|
|
5
|
+
export declare enum DiscountStatus {
|
|
6
|
+
/** All discounts regardless of status */
|
|
7
|
+
ALL = "all",
|
|
8
|
+
/** Discounts that have not started yet */
|
|
9
|
+
UPCOMING = "upcoming",
|
|
10
|
+
/** Currently active discounts */
|
|
11
|
+
ONGOING = "ongoing",
|
|
12
|
+
/** Discounts that have ended */
|
|
13
|
+
EXPIRED = "expired"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Model information for discount items with variations
|
|
17
|
+
*/
|
|
18
|
+
export interface DiscountModel {
|
|
19
|
+
/** Shopee's unique identifier for a variation of an item */
|
|
20
|
+
model_id: number;
|
|
21
|
+
/** The discount price of the variation */
|
|
22
|
+
model_promotion_price: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Discount item information
|
|
26
|
+
*/
|
|
27
|
+
export interface DiscountItem {
|
|
28
|
+
/** Shopee's unique identifier for an item */
|
|
29
|
+
item_id: number;
|
|
30
|
+
/** The max number of this product in the promotion price */
|
|
31
|
+
purchase_limit?: number;
|
|
32
|
+
/** The discount price of the item. If there is variation, this field is not needed */
|
|
33
|
+
item_promotion_price?: number;
|
|
34
|
+
/** The list of variations for this item */
|
|
35
|
+
model_list?: DiscountModel[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parameters for adding a new discount
|
|
39
|
+
*/
|
|
40
|
+
export interface AddDiscountParams {
|
|
41
|
+
/** Title of the discount */
|
|
42
|
+
discount_name: string;
|
|
43
|
+
/** The time when discount activity start. Must be 1 hour later than current time */
|
|
44
|
+
start_time: number;
|
|
45
|
+
/** The time when discount activity end. Must be 1 hour later than start time, and the discount period must be less than 180 days */
|
|
46
|
+
end_time: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Parameters for adding items to a discount
|
|
50
|
+
*/
|
|
51
|
+
export interface AddDiscountItemParams {
|
|
52
|
+
/** Shopee's unique identifier for a discount activity */
|
|
53
|
+
discount_id: number;
|
|
54
|
+
/** The items added in this discount promotion */
|
|
55
|
+
item_list: DiscountItem[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Parameters for deleting a discount
|
|
59
|
+
*/
|
|
60
|
+
export interface DeleteDiscountParams {
|
|
61
|
+
/** Shopee's unique identifier for a discount activity */
|
|
62
|
+
discount_id: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Parameters for deleting an item from a discount
|
|
66
|
+
*/
|
|
67
|
+
export interface DeleteDiscountItemParams {
|
|
68
|
+
/** Shopee's unique identifier for a discount activity */
|
|
69
|
+
discount_id: number;
|
|
70
|
+
/** Shopee's unique identifier for an item */
|
|
71
|
+
item_id: number;
|
|
72
|
+
/** Shopee's unique identifier for a variation of an item. If item has no variation, set to 0 */
|
|
73
|
+
model_id?: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Parameters for ending a discount immediately
|
|
77
|
+
*/
|
|
78
|
+
export interface EndDiscountParams {
|
|
79
|
+
/** Shopee's unique identifier for a discount activity */
|
|
80
|
+
discount_id: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Parameters for getting discount details
|
|
84
|
+
*/
|
|
85
|
+
export interface GetDiscountParams {
|
|
86
|
+
/** Shopee's unique identifier for a discount activity */
|
|
87
|
+
discount_id: number;
|
|
88
|
+
/** Specifies the page number of data to return. Starting from 1 */
|
|
89
|
+
page_no: number;
|
|
90
|
+
/** Maximum number of entries to retrieve per page */
|
|
91
|
+
page_size: number;
|
|
92
|
+
[key: string]: string | number | boolean | undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Parameters for getting a list of discounts
|
|
96
|
+
*/
|
|
97
|
+
export interface GetDiscountListParams {
|
|
98
|
+
/** The status of discount promotion */
|
|
99
|
+
discount_status: DiscountStatus;
|
|
100
|
+
/** Specifies the page number of data to return. Default 1 */
|
|
101
|
+
page_no?: number;
|
|
102
|
+
/** Maximum number of entries to retrieve per page. Default 100, max 100 */
|
|
103
|
+
page_size?: number;
|
|
104
|
+
[key: string]: string | number | boolean | undefined;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Parameters for updating a discount
|
|
108
|
+
*/
|
|
109
|
+
export interface UpdateDiscountParams {
|
|
110
|
+
/** Shopee's unique identifier for a discount activity */
|
|
111
|
+
discount_id: number;
|
|
112
|
+
/** Title of the discount */
|
|
113
|
+
discount_name?: string;
|
|
114
|
+
/** The time when discount activity start */
|
|
115
|
+
start_time?: number;
|
|
116
|
+
/** The time when discount activity end */
|
|
117
|
+
end_time?: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Parameters for updating discount items
|
|
121
|
+
*/
|
|
122
|
+
export interface UpdateDiscountItemParams {
|
|
123
|
+
/** Shopee's unique identifier for a discount activity */
|
|
124
|
+
discount_id: number;
|
|
125
|
+
/** The items to update in this discount promotion */
|
|
126
|
+
item_list: DiscountItem[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Error information for failed item operations
|
|
130
|
+
*/
|
|
131
|
+
export interface DiscountItemError {
|
|
132
|
+
/** The item ID that failed */
|
|
133
|
+
item_id?: number;
|
|
134
|
+
/** The model ID that failed */
|
|
135
|
+
model_id?: number;
|
|
136
|
+
/** The error message */
|
|
137
|
+
fail_message?: string;
|
|
138
|
+
/** The error code */
|
|
139
|
+
fail_error?: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Model information in get discount response
|
|
143
|
+
*/
|
|
144
|
+
export interface DiscountModelInfo {
|
|
145
|
+
/** Shopee's unique identifier for a variation of an item */
|
|
146
|
+
model_id: number;
|
|
147
|
+
/** Name of the variation that belongs to the same item */
|
|
148
|
+
model_name: string;
|
|
149
|
+
/** The current stock quantity of the variation */
|
|
150
|
+
model_normal_stock: number;
|
|
151
|
+
/** The reserved stock of the model */
|
|
152
|
+
model_promotion_stock: number;
|
|
153
|
+
/** The original price before discount of the variation */
|
|
154
|
+
model_original_price: number;
|
|
155
|
+
/** The discount price of the variation */
|
|
156
|
+
model_promotion_price: number;
|
|
157
|
+
/** The original price after tax of model (Only for taxable Shop) */
|
|
158
|
+
model_inflated_price_of_original_price?: number;
|
|
159
|
+
/** The discount price after tax of model (Only for taxable Shop) */
|
|
160
|
+
model_inflated_price_of_promotion_price?: number;
|
|
161
|
+
/** The local price of model */
|
|
162
|
+
model_local_price?: number;
|
|
163
|
+
/** The local discount price of model */
|
|
164
|
+
model_local_promotion_price?: number;
|
|
165
|
+
/** The local price after tax of model (Only for taxable Shop) */
|
|
166
|
+
model_local_price_inflated?: number;
|
|
167
|
+
/** The local discount price after tax of model (Only for taxable Shop) */
|
|
168
|
+
model_local_promotion_price_inflated?: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Item information in get discount response
|
|
172
|
+
*/
|
|
173
|
+
export interface DiscountItemInfo {
|
|
174
|
+
/** Shopee's unique identifier for an item */
|
|
175
|
+
item_id: number;
|
|
176
|
+
/** Name of the item in local language */
|
|
177
|
+
item_name: string;
|
|
178
|
+
/** The current stock quantity of the item */
|
|
179
|
+
normal_stock: number;
|
|
180
|
+
/** The reserved stock of the item */
|
|
181
|
+
item_promotion_stock: number;
|
|
182
|
+
/** The original price before discount of the item */
|
|
183
|
+
item_original_price: number;
|
|
184
|
+
/** The discount price of the item */
|
|
185
|
+
item_promotion_price: number;
|
|
186
|
+
/** The original price after tax of item (Only for taxable Shop) */
|
|
187
|
+
item_inflated_price_of_original_price?: number;
|
|
188
|
+
/** The discount price after tax of item (Only for taxable Shop) */
|
|
189
|
+
item_inflated_price_of_promotion_price?: number;
|
|
190
|
+
/** The local price of item */
|
|
191
|
+
item_local_price?: number;
|
|
192
|
+
/** The local discount price of item */
|
|
193
|
+
item_local_promotion_price?: number;
|
|
194
|
+
/** The local price after tax of item (Only for taxable Shop) */
|
|
195
|
+
item_local_price_inflated?: number;
|
|
196
|
+
/** The local discount price after tax of item (Only for taxable Shop) */
|
|
197
|
+
item_local_promotion_price_inflated?: number;
|
|
198
|
+
/** The list of variations for this item */
|
|
199
|
+
model_list: DiscountModelInfo[];
|
|
200
|
+
/** The max number of this product in the promotion price */
|
|
201
|
+
purchase_limit: number;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Discount information in list response
|
|
205
|
+
*/
|
|
206
|
+
export interface DiscountInfo {
|
|
207
|
+
/** The status of discount promotion */
|
|
208
|
+
status: string;
|
|
209
|
+
/** Title of the discount */
|
|
210
|
+
discount_name: string;
|
|
211
|
+
/** The time when discount activity start */
|
|
212
|
+
start_time: number;
|
|
213
|
+
/** Shopee's unique identifier for a discount activity */
|
|
214
|
+
discount_id: number;
|
|
215
|
+
/** The source of the discount. 0: seller created, 1: Shopee created */
|
|
216
|
+
source?: number;
|
|
217
|
+
/** The time when discount activity end */
|
|
218
|
+
end_time: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Response for the add discount API
|
|
222
|
+
*/
|
|
223
|
+
export interface AddDiscountResponse extends BaseResponse {
|
|
224
|
+
response: {
|
|
225
|
+
/** Shopee's unique identifier for a discount activity */
|
|
226
|
+
discount_id: number;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Response for the add discount item API
|
|
231
|
+
*/
|
|
232
|
+
export interface AddDiscountItemResponse extends BaseResponse {
|
|
233
|
+
response: {
|
|
234
|
+
/** Shopee's unique identifier for a discount activity */
|
|
235
|
+
discount_id: number;
|
|
236
|
+
/** The number of items successfully added */
|
|
237
|
+
count: number;
|
|
238
|
+
/** List of items that failed to be added */
|
|
239
|
+
error_list: DiscountItemError[];
|
|
240
|
+
/** Warning message if any */
|
|
241
|
+
warning?: string;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Response for the delete discount API
|
|
246
|
+
*/
|
|
247
|
+
export interface DeleteDiscountResponse extends BaseResponse {
|
|
248
|
+
response: {
|
|
249
|
+
/** Shopee's unique identifier for a discount activity */
|
|
250
|
+
discount_id: number;
|
|
251
|
+
/** The time when the discount was modified */
|
|
252
|
+
modify_time: number;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Response for the delete discount item API
|
|
257
|
+
*/
|
|
258
|
+
export interface DeleteDiscountItemResponse extends BaseResponse {
|
|
259
|
+
response: {
|
|
260
|
+
/** Shopee's unique identifier for a discount activity */
|
|
261
|
+
discount_id: number;
|
|
262
|
+
/** List of items that failed to be deleted */
|
|
263
|
+
error_list: DiscountItemError[];
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Response for the end discount API
|
|
268
|
+
*/
|
|
269
|
+
export interface EndDiscountResponse extends BaseResponse {
|
|
270
|
+
response: {
|
|
271
|
+
/** Shopee's unique identifier for a discount activity */
|
|
272
|
+
discount_id: number;
|
|
273
|
+
/** The time when the discount was modified */
|
|
274
|
+
modify_time: number;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Response for the get discount API
|
|
279
|
+
*/
|
|
280
|
+
export interface GetDiscountResponse extends BaseResponse {
|
|
281
|
+
response: {
|
|
282
|
+
/** The status of discount promotion */
|
|
283
|
+
status: string;
|
|
284
|
+
/** Title of the discount */
|
|
285
|
+
discount_name: string;
|
|
286
|
+
/** The items selected in this discount */
|
|
287
|
+
item_list: DiscountItemInfo[];
|
|
288
|
+
/** The time when discount activity start */
|
|
289
|
+
start_time: number;
|
|
290
|
+
/** Shopee's unique identifier for a discount activity */
|
|
291
|
+
discount_id: number;
|
|
292
|
+
/** The time when discount activity end */
|
|
293
|
+
end_time: number;
|
|
294
|
+
/** This is to indicate whether the item list is more than one page */
|
|
295
|
+
more: boolean;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Response for the get discount list API
|
|
300
|
+
*/
|
|
301
|
+
export interface GetDiscountListResponse extends BaseResponse {
|
|
302
|
+
response: {
|
|
303
|
+
/** The list of discounts matching the query parameters */
|
|
304
|
+
discount_list: DiscountInfo[];
|
|
305
|
+
/** Indicates whether there are more pages of discounts to retrieve */
|
|
306
|
+
more: boolean;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Response for the update discount API
|
|
311
|
+
*/
|
|
312
|
+
export interface UpdateDiscountResponse extends BaseResponse {
|
|
313
|
+
response: {
|
|
314
|
+
/** Shopee's unique identifier for a discount activity */
|
|
315
|
+
discount_id: number;
|
|
316
|
+
/** The time when the discount was modified */
|
|
317
|
+
modify_time: number;
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Response for the update discount item API
|
|
322
|
+
*/
|
|
323
|
+
export interface UpdateDiscountItemResponse extends BaseResponse {
|
|
324
|
+
response: {
|
|
325
|
+
/** Shopee's unique identifier for a discount activity */
|
|
326
|
+
discount_id: number;
|
|
327
|
+
/** The number of items successfully updated */
|
|
328
|
+
count: number;
|
|
329
|
+
/** List of items that failed to be updated */
|
|
330
|
+
error_list: DiscountItemError[];
|
|
331
|
+
};
|
|
332
|
+
/** Warning message if any */
|
|
333
|
+
warning?: string;
|
|
334
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status of discounts for filtering in discount list query
|
|
3
|
+
*/
|
|
4
|
+
export var DiscountStatus;
|
|
5
|
+
(function (DiscountStatus) {
|
|
6
|
+
/** All discounts regardless of status */
|
|
7
|
+
DiscountStatus["ALL"] = "all";
|
|
8
|
+
/** Discounts that have not started yet */
|
|
9
|
+
DiscountStatus["UPCOMING"] = "upcoming";
|
|
10
|
+
/** Currently active discounts */
|
|
11
|
+
DiscountStatus["ONGOING"] = "ongoing";
|
|
12
|
+
/** Discounts that have ended */
|
|
13
|
+
DiscountStatus["EXPIRED"] = "expired";
|
|
14
|
+
})(DiscountStatus || (DiscountStatus = {}));
|
|
15
|
+
//# sourceMappingURL=discount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount.js","sourceRoot":"","sources":["../../src/schemas/discount.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,yCAAyC;IACzC,6BAAW,CAAA;IACX,0CAA0C;IAC1C,uCAAqB,CAAA;IACrB,iCAAiC;IACjC,qCAAmB,CAAA;IACnB,gCAAgC;IAChC,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB"}
|