@congminh1254/shopee-sdk 0.4.0 → 0.6.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 +7 -6
- package/lib/errors.js +2 -2
- package/lib/fetch.d.ts +2 -2
- package/lib/fetch.js +17 -14
- package/lib/fetch.js.map +1 -1
- package/lib/managers/ads.manager.d.ts +221 -1
- package/lib/managers/ads.manager.js +281 -6
- package/lib/managers/ads.manager.js.map +1 -1
- package/lib/managers/auth.manager.d.ts +3 -3
- package/lib/managers/auth.manager.js +21 -12
- package/lib/managers/auth.manager.js.map +1 -1
- package/lib/managers/base.manager.d.ts +1 -1
- package/lib/managers/index.d.ts +10 -10
- package/lib/managers/index.js +10 -10
- package/lib/managers/logistics.manager.js +2 -2
- package/lib/managers/logistics.manager.js.map +1 -1
- package/lib/managers/order.manager.d.ts +3 -3
- package/lib/managers/order.manager.js +25 -25
- package/lib/managers/order.manager.js.map +1 -1
- package/lib/managers/payment.manager.js +2 -2
- package/lib/managers/payment.manager.js.map +1 -1
- package/lib/managers/product.manager.d.ts +3 -3
- package/lib/managers/product.manager.js +10 -10
- package/lib/managers/product.manager.js.map +1 -1
- package/lib/managers/public.manager.d.ts +3 -3
- package/lib/managers/public.manager.js +8 -8
- package/lib/managers/push.manager.d.ts +3 -3
- package/lib/managers/push.manager.js +11 -11
- package/lib/managers/push.manager.js.map +1 -1
- package/lib/managers/voucher.manager.js +12 -12
- package/lib/managers/voucher.manager.js.map +1 -1
- package/lib/schemas/access-token.d.ts +2 -1
- package/lib/schemas/ads.d.ts +456 -0
- package/lib/schemas/attribute.d.ts +4 -4
- package/lib/schemas/fetch.d.ts +2 -2
- package/lib/schemas/index.d.ts +12 -11
- package/lib/schemas/index.js +12 -11
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/logistics.d.ts +1 -1
- package/lib/schemas/order.d.ts +26 -26
- package/lib/schemas/order.js +1 -1
- package/lib/schemas/payment.d.ts +1 -1
- package/lib/schemas/product.d.ts +1 -1
- package/lib/schemas/product.js +0 -1
- package/lib/schemas/product.js.map +1 -1
- package/lib/schemas/push.d.ts +1 -1
- package/lib/schemas/region.js +5 -5
- package/lib/schemas/voucher.js.map +1 -1
- package/lib/sdk.d.ts +12 -12
- package/lib/sdk.js +15 -19
- package/lib/sdk.js.map +1 -1
- package/lib/storage/custom-token-storage.d.ts +2 -2
- package/lib/storage/custom-token-storage.js +11 -11
- package/lib/storage/custom-token-storage.js.map +1 -1
- package/lib/storage/token-storage.interface.d.ts +1 -1
- package/lib/utils/signature.js +3 -6
- package/lib/utils/signature.js.map +1 -1
- package/package.json +2 -1
package/lib/schemas/ads.d.ts
CHANGED
|
@@ -60,3 +60,459 @@ export interface GetRecommendedKeywordListResponse extends BaseResponse {
|
|
|
60
60
|
/** Optional warning message if some data cannot be responded normally */
|
|
61
61
|
warning?: string;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Response for the get recommended item list API
|
|
65
|
+
*/
|
|
66
|
+
export interface GetRecommendedItemListResponse extends BaseResponse {
|
|
67
|
+
response: Array<{
|
|
68
|
+
/** Recommended SKU's item id */
|
|
69
|
+
item_id: number;
|
|
70
|
+
/** This is param to indicate the status of items, so sellers can know whether an item is eligible for ads or not */
|
|
71
|
+
item_status_list: string[];
|
|
72
|
+
/** The corresponding tag (or tags) that belong to item_id, sequences follow as best selling>best ROI>top search */
|
|
73
|
+
sku_tag_list: string[];
|
|
74
|
+
/** Current status of the ad on this item. For example- no ongoing promotion, search ads, discovery ads, boost ads */
|
|
75
|
+
ongoing_ad_type_list: string[];
|
|
76
|
+
}>;
|
|
77
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
78
|
+
warning?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parameters for the get all CPC ads hourly performance API
|
|
82
|
+
*/
|
|
83
|
+
export type GetAllCpcAdsHourlyPerformanceParams = {
|
|
84
|
+
/** Single date on which to check the hourly performance (DD-MM-YYYY format) */
|
|
85
|
+
performance_date: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Response for the get all CPC ads hourly performance API
|
|
89
|
+
*/
|
|
90
|
+
export interface GetAllCpcAdsHourlyPerformanceResponse extends BaseResponse {
|
|
91
|
+
response: Array<{
|
|
92
|
+
/** Hour the performance record belongs to */
|
|
93
|
+
hour: number;
|
|
94
|
+
/** Date the performance record belongs to (DD-MM-YYYY format) */
|
|
95
|
+
date: string;
|
|
96
|
+
/** Number of times buyers see ads */
|
|
97
|
+
impression: number;
|
|
98
|
+
/** Total number of clicks on the Ad */
|
|
99
|
+
clicks: number;
|
|
100
|
+
/** Click-through rate (Clicks / Impressions) */
|
|
101
|
+
ctr: number;
|
|
102
|
+
/** Direct conversions - buyer placed an order within 7 days after clicking on the ads (item gets purchased from the clicked ads) */
|
|
103
|
+
direct_order: number;
|
|
104
|
+
/** Broad conversions - buyer placed an order within 7 days after clicking on the ads (any item from the same shop) */
|
|
105
|
+
broad_order: number;
|
|
106
|
+
/** Direct conversion rate (Ad orders / total clicks) - item gets purchased from the clicked ads */
|
|
107
|
+
direct_conversions: number;
|
|
108
|
+
/** Broad conversion rate (Ad orders / total clicks) - any item from the same shop gets purchased */
|
|
109
|
+
broad_conversions: number;
|
|
110
|
+
/** Items sold within 7 days after clicking on the ads (item gets purchased from the clicked ads) */
|
|
111
|
+
direct_item_sold: number;
|
|
112
|
+
/** Items sold within 7 days after clicking on the ads (any item from the same shop) */
|
|
113
|
+
broad_item_sold: number;
|
|
114
|
+
/** Total direct sales generated from ads over a 7-day window (item gets purchased from the clicked ads) */
|
|
115
|
+
direct_gmv: number;
|
|
116
|
+
/** Total broad sales generated from ads over a 7-day window (any item from the same shop) */
|
|
117
|
+
broad_gmv: number;
|
|
118
|
+
/** Ad expenditure */
|
|
119
|
+
expense: number;
|
|
120
|
+
/** Cost per conversion - ad's average cost per sales conversion */
|
|
121
|
+
cost_per_conversion: number;
|
|
122
|
+
/** Direct ROAS - Ad GMV/Ad Expenditure (item gets purchased from the clicked ads) */
|
|
123
|
+
direct_roas: number;
|
|
124
|
+
/** Broad ROAS - Ad GMV/Ad Expenditure (any item from the same shop gets purchased) */
|
|
125
|
+
broad_roas: number;
|
|
126
|
+
}>;
|
|
127
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
128
|
+
warning?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Parameters for the get all CPC ads daily performance API
|
|
132
|
+
*/
|
|
133
|
+
export type GetAllCpcAdsDailyPerformanceParams = {
|
|
134
|
+
/** Start date of the performance data range (DD-MM-YYYY format) */
|
|
135
|
+
start_date: string;
|
|
136
|
+
/** End date of the performance data range (DD-MM-YYYY format) */
|
|
137
|
+
end_date: string;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Response for the get all CPC ads daily performance API
|
|
141
|
+
*/
|
|
142
|
+
export interface GetAllCpcAdsDailyPerformanceResponse extends BaseResponse {
|
|
143
|
+
response: Array<{
|
|
144
|
+
/** Date the performance record belongs to (DD-MM-YYYY format) */
|
|
145
|
+
date: string;
|
|
146
|
+
/** Number of times buyers see ads */
|
|
147
|
+
impression: number;
|
|
148
|
+
/** Total number of clicks on the Ad */
|
|
149
|
+
clicks: number;
|
|
150
|
+
/** Click-through rate (Clicks / Impressions) */
|
|
151
|
+
ctr: number;
|
|
152
|
+
/** Direct conversions - buyer placed an order within 7 days after clicking on the ads (item gets purchased from the clicked ads) */
|
|
153
|
+
direct_order: number;
|
|
154
|
+
/** Broad conversions - buyer placed an order within 7 days after clicking on the ads (any item from the same shop) */
|
|
155
|
+
broad_order: number;
|
|
156
|
+
/** Direct conversion rate (Ad orders / total clicks) - item gets purchased from the clicked ads */
|
|
157
|
+
direct_conversions: number;
|
|
158
|
+
/** Broad conversion rate (Ad orders / total clicks) - any item from the same shop gets purchased */
|
|
159
|
+
broad_conversions: number;
|
|
160
|
+
/** Items sold within 7 days after clicking on the ads (item gets purchased from the clicked ads) */
|
|
161
|
+
direct_item_sold: number;
|
|
162
|
+
/** Items sold within 7 days after clicking on the ads (any item from the same shop) */
|
|
163
|
+
broad_item_sold: number;
|
|
164
|
+
/** Total direct sales generated from ads over a 7-day window (item gets purchased from the clicked ads) */
|
|
165
|
+
direct_gmv: number;
|
|
166
|
+
/** Total broad sales generated from ads over a 7-day window (any item from the same shop) */
|
|
167
|
+
broad_gmv: number;
|
|
168
|
+
/** Ad expenditure */
|
|
169
|
+
expense: number;
|
|
170
|
+
/** Cost per conversion - ad's average cost per sales conversion */
|
|
171
|
+
cost_per_conversion: number;
|
|
172
|
+
/** Direct ROAS - Ad GMV/Ad Expenditure (item gets purchased from the clicked ads) */
|
|
173
|
+
direct_roas: number;
|
|
174
|
+
/** Broad ROAS - Ad GMV/Ad Expenditure (any item from the same shop gets purchased) */
|
|
175
|
+
broad_roas: number;
|
|
176
|
+
}>;
|
|
177
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
178
|
+
warning?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Parameters for the get product campaign daily performance API
|
|
182
|
+
*/
|
|
183
|
+
export type GetProductCampaignDailyPerformanceParams = {
|
|
184
|
+
/** Start date of the performance data range (DD-MM-YYYY format) */
|
|
185
|
+
start_date: string;
|
|
186
|
+
/** End date of the performance data range (DD-MM-YYYY format) */
|
|
187
|
+
end_date: string;
|
|
188
|
+
/** Comma-separated list of campaign IDs to fetch performance for (max 100) */
|
|
189
|
+
campaign_id_list: string;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Response for the get product campaign daily performance API
|
|
193
|
+
*/
|
|
194
|
+
export interface GetProductCampaignDailyPerformanceResponse extends BaseResponse {
|
|
195
|
+
response: Array<{
|
|
196
|
+
/** The unique ID for the shop */
|
|
197
|
+
shop_id: number;
|
|
198
|
+
/** The region where the shop is located */
|
|
199
|
+
region: string;
|
|
200
|
+
/** List of campaigns and their performance data */
|
|
201
|
+
campaign_list: Array<{
|
|
202
|
+
/** The unique ID for the campaign */
|
|
203
|
+
campaign_id: number;
|
|
204
|
+
/** The ad type (auto or manual) */
|
|
205
|
+
ad_type: string;
|
|
206
|
+
/** The campaign placement (search, discovery, or all) */
|
|
207
|
+
campaign_placement: string;
|
|
208
|
+
/** The name of the ad */
|
|
209
|
+
ad_name: string;
|
|
210
|
+
/** List of daily performance metrics for the campaign */
|
|
211
|
+
metrics_list: Array<{
|
|
212
|
+
/** Date of the performance record (DD-MM-YYYY format) */
|
|
213
|
+
date: string;
|
|
214
|
+
/** Number of times shoppers see the ad */
|
|
215
|
+
impression: number;
|
|
216
|
+
/** Number of times shoppers click on the ad */
|
|
217
|
+
clicks: number;
|
|
218
|
+
/** Click-through rate (clicks ÷ impressions × 100%) */
|
|
219
|
+
ctr: number;
|
|
220
|
+
/** Amount spent on the ad */
|
|
221
|
+
expense: number;
|
|
222
|
+
/** Sales revenue generated from any product purchase within 7 days of ad click */
|
|
223
|
+
broad_gmv: number;
|
|
224
|
+
/** Number of orders placed within 7 days of ad click */
|
|
225
|
+
broad_order: number;
|
|
226
|
+
/** Total quantity of products purchased within 7 days of ad click */
|
|
227
|
+
broad_order_amount: number;
|
|
228
|
+
/** Broad return on ad spend (broad_gmv ÷ expense) */
|
|
229
|
+
broad_roi: number;
|
|
230
|
+
/** Broad advertising cost of sales (expense ÷ broad_gmv × 100%) */
|
|
231
|
+
broad_cir: number;
|
|
232
|
+
/** Conversion rate (conversions ÷ clicks × 100%) */
|
|
233
|
+
cr: number;
|
|
234
|
+
/** Cost per conversion (expense ÷ conversions) */
|
|
235
|
+
cpc: number;
|
|
236
|
+
/** Number of orders for the advertised product within 7 days of ad click */
|
|
237
|
+
direct_order: number;
|
|
238
|
+
/** Total quantity of the advertised product purchased within 7 days of ad click */
|
|
239
|
+
direct_order_amount: number;
|
|
240
|
+
/** Sales revenue generated from the advertised product within 7 days of ad click */
|
|
241
|
+
direct_gmv: number;
|
|
242
|
+
/** Direct return on ad spend (direct_gmv ÷ expense) */
|
|
243
|
+
direct_roi: number;
|
|
244
|
+
/** Direct advertising cost of sales (expense ÷ direct_gmv × 100%) */
|
|
245
|
+
direct_cir: number;
|
|
246
|
+
/** Direct conversion rate (direct conversions ÷ clicks × 100%) */
|
|
247
|
+
direct_cr: number;
|
|
248
|
+
/** Cost per direct conversion (expense ÷ direct conversions) */
|
|
249
|
+
cpdc: number;
|
|
250
|
+
}>;
|
|
251
|
+
}>;
|
|
252
|
+
}>;
|
|
253
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
254
|
+
warning?: string;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Parameters for the get product campaign hourly performance API
|
|
258
|
+
*/
|
|
259
|
+
export type GetProductCampaignHourlyPerformanceParams = {
|
|
260
|
+
/** Single date for the hourly performance data (DD-MM-YYYY format) */
|
|
261
|
+
performance_date: string;
|
|
262
|
+
/** Comma-separated list of campaign IDs to fetch performance for (max 100) */
|
|
263
|
+
campaign_id_list: string;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Response for the get product campaign hourly performance API
|
|
267
|
+
*/
|
|
268
|
+
export interface GetProductCampaignHourlyPerformanceResponse extends BaseResponse {
|
|
269
|
+
response: Array<{
|
|
270
|
+
/** The unique ID for the shop */
|
|
271
|
+
shop_id: number;
|
|
272
|
+
/** The region where the shop is located */
|
|
273
|
+
region: string;
|
|
274
|
+
/** List of campaigns and their performance data */
|
|
275
|
+
campaign_list: Array<{
|
|
276
|
+
/** The unique ID for the campaign */
|
|
277
|
+
campaign_id: number;
|
|
278
|
+
/** The ad type (auto or manual) */
|
|
279
|
+
ad_type: string;
|
|
280
|
+
/** The campaign placement (search, discovery, or all) */
|
|
281
|
+
campaign_placement: string;
|
|
282
|
+
/** The name of the ad */
|
|
283
|
+
ad_name: string;
|
|
284
|
+
/** List of hourly performance metrics for the campaign */
|
|
285
|
+
metrics_list: Array<{
|
|
286
|
+
/** Hour the performance record belongs to */
|
|
287
|
+
hour: number;
|
|
288
|
+
/** Date of the performance record (DD-MM-YYYY format) */
|
|
289
|
+
date: string;
|
|
290
|
+
/** Number of times shoppers see the ad */
|
|
291
|
+
impression: number;
|
|
292
|
+
/** Number of times shoppers click on the ad */
|
|
293
|
+
clicks: number;
|
|
294
|
+
/** Click-through rate (clicks ÷ impressions × 100%) */
|
|
295
|
+
ctr: number;
|
|
296
|
+
/** Amount spent on the ad */
|
|
297
|
+
expense: number;
|
|
298
|
+
/** Sales revenue generated from any product purchase within 7 days of ad click */
|
|
299
|
+
broad_gmv: number;
|
|
300
|
+
/** Number of orders placed within 7 days of ad click */
|
|
301
|
+
broad_order: number;
|
|
302
|
+
/** Total quantity of products purchased within 7 days of ad click */
|
|
303
|
+
broad_order_amount: number;
|
|
304
|
+
/** Broad return on ad spend (broad_gmv ÷ expense) */
|
|
305
|
+
broad_roi: number;
|
|
306
|
+
/** Broad advertising cost of sales (expense ÷ broad_gmv × 100%) */
|
|
307
|
+
broad_cir: number;
|
|
308
|
+
/** Conversion rate (conversions ÷ clicks × 100%) */
|
|
309
|
+
cr: number;
|
|
310
|
+
/** Cost per conversion (expense ÷ conversions) */
|
|
311
|
+
cpc: number;
|
|
312
|
+
/** Number of orders for the advertised product within 7 days of ad click */
|
|
313
|
+
direct_order: number;
|
|
314
|
+
/** Total quantity of the advertised product purchased within 7 days of ad click */
|
|
315
|
+
direct_order_amount: number;
|
|
316
|
+
/** Sales revenue generated from the advertised product within 7 days of ad click */
|
|
317
|
+
direct_gmv: number;
|
|
318
|
+
/** Direct return on ad spend (direct_gmv ÷ expense) */
|
|
319
|
+
direct_roi: number;
|
|
320
|
+
/** Direct advertising cost of sales (expense ÷ direct_gmv × 100%) */
|
|
321
|
+
direct_cir: number;
|
|
322
|
+
/** Direct conversion rate (direct conversions ÷ clicks × 100%) */
|
|
323
|
+
direct_cr: number;
|
|
324
|
+
/** Cost per direct conversion (expense ÷ direct conversions) */
|
|
325
|
+
cpdc: number;
|
|
326
|
+
}>;
|
|
327
|
+
}>;
|
|
328
|
+
}>;
|
|
329
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
330
|
+
warning?: string;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Parameters for the get product level campaign ID list API
|
|
334
|
+
*/
|
|
335
|
+
export type GetProductLevelCampaignIdListParams = {
|
|
336
|
+
/**
|
|
337
|
+
* Filter campaigns by ad type
|
|
338
|
+
* Can be any of ["", "all", "auto", "manual"]
|
|
339
|
+
*/
|
|
340
|
+
ad_type?: string;
|
|
341
|
+
/** Pagination offset */
|
|
342
|
+
offset?: number;
|
|
343
|
+
/** Page size limit (number of results to return) */
|
|
344
|
+
limit?: number;
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Response for the get product level campaign ID list API
|
|
348
|
+
*/
|
|
349
|
+
export interface GetProductLevelCampaignIdListResponse extends BaseResponse {
|
|
350
|
+
response: {
|
|
351
|
+
/** The unique ID for the shop */
|
|
352
|
+
shop_id: number;
|
|
353
|
+
/** The region where the shop is located */
|
|
354
|
+
region: string;
|
|
355
|
+
/** Indicates if there are more campaigns on the next page */
|
|
356
|
+
has_next_page: boolean;
|
|
357
|
+
/** List of campaigns */
|
|
358
|
+
campaign_list: Array<{
|
|
359
|
+
/** The ad type (auto or manual) */
|
|
360
|
+
ad_type: string;
|
|
361
|
+
/** The unique ID for the campaign */
|
|
362
|
+
campaign_id: number;
|
|
363
|
+
}>;
|
|
364
|
+
};
|
|
365
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
366
|
+
warning?: string;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Parameters for the get product level campaign setting info API
|
|
370
|
+
*/
|
|
371
|
+
export type GetProductLevelCampaignSettingInfoParams = {
|
|
372
|
+
/**
|
|
373
|
+
* Info types to retrieve, comma-separated
|
|
374
|
+
* 1: Common Info
|
|
375
|
+
* 2: Manual Bidding Info
|
|
376
|
+
* 3: Auto Bidding Info
|
|
377
|
+
* 4: Auto Product Ads Info
|
|
378
|
+
*/
|
|
379
|
+
info_type_list: string;
|
|
380
|
+
/** Comma-separated list of campaign IDs to fetch settings for (max 100) */
|
|
381
|
+
campaign_id_list: string;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Response for the get product level campaign setting info API
|
|
385
|
+
*/
|
|
386
|
+
export interface GetProductLevelCampaignSettingInfoResponse extends BaseResponse {
|
|
387
|
+
response: {
|
|
388
|
+
/** The unique ID for the shop */
|
|
389
|
+
shop_id: number;
|
|
390
|
+
/** The region where the shop is located */
|
|
391
|
+
region: string;
|
|
392
|
+
/** List of campaigns with their settings */
|
|
393
|
+
campaign_list: Array<{
|
|
394
|
+
/** The unique ID for the campaign */
|
|
395
|
+
campaign_id: number;
|
|
396
|
+
/** Common campaign information (returned if info_type_list includes 1) */
|
|
397
|
+
common_info?: {
|
|
398
|
+
/** The ad type (auto or manual) */
|
|
399
|
+
ad_type: string;
|
|
400
|
+
/** The name of the ad */
|
|
401
|
+
ad_name: string;
|
|
402
|
+
/** Campaign status (ongoing, scheduled, ended, paused, deleted, closed) */
|
|
403
|
+
campaign_status: string;
|
|
404
|
+
/** Bidding method (auto or manual) */
|
|
405
|
+
bidding_method: string;
|
|
406
|
+
/** Campaign placement (search, discovery, or all) */
|
|
407
|
+
campaign_placement: string;
|
|
408
|
+
/** The budget per campaign (0 means unlimited budget) */
|
|
409
|
+
campaign_budget: number;
|
|
410
|
+
/** Campaign duration */
|
|
411
|
+
campaign_duration: {
|
|
412
|
+
/** Campaign start time (Unix timestamp) */
|
|
413
|
+
start_time: number;
|
|
414
|
+
/** Campaign end time (Unix timestamp, 0 means no end date) */
|
|
415
|
+
end_time: number;
|
|
416
|
+
};
|
|
417
|
+
/** List of item IDs in the campaign */
|
|
418
|
+
item_id_list: number[];
|
|
419
|
+
};
|
|
420
|
+
/** Manual bidding information (returned if info_type_list includes 2) */
|
|
421
|
+
manual_bidding_info?: {
|
|
422
|
+
/** Whether Enhanced CPC functionality is enabled */
|
|
423
|
+
enhanced_cpc: boolean;
|
|
424
|
+
/** Selected keywords for search campaigns */
|
|
425
|
+
selected_keywords: Array<{
|
|
426
|
+
/** Bid keyword */
|
|
427
|
+
keyword: string;
|
|
428
|
+
/** Keyword status (deleted, normal, reserved, blacklist) */
|
|
429
|
+
status: string;
|
|
430
|
+
/** Match type (exact or broad) */
|
|
431
|
+
match_type: string;
|
|
432
|
+
/** Bid price per click */
|
|
433
|
+
bid_price_per_click: number;
|
|
434
|
+
}>;
|
|
435
|
+
/** Discovery ads placement settings */
|
|
436
|
+
discovery_ads_locations: Array<{
|
|
437
|
+
/** Location (daily_discover, you_may_also_like) */
|
|
438
|
+
location: string;
|
|
439
|
+
/** Status (active or inactive) */
|
|
440
|
+
status: string;
|
|
441
|
+
/** Bid price */
|
|
442
|
+
bid_price: number;
|
|
443
|
+
}>;
|
|
444
|
+
};
|
|
445
|
+
/** Auto bidding information (returned if info_type_list includes 3) */
|
|
446
|
+
auto_bidding_info?: {
|
|
447
|
+
/** ROAS target for campaigns with auto bidding */
|
|
448
|
+
roas_target: number;
|
|
449
|
+
};
|
|
450
|
+
/** Auto product ads information (returned if info_type_list includes 4) */
|
|
451
|
+
auto_product_ads_info?: Array<{
|
|
452
|
+
/** Product name */
|
|
453
|
+
product_name: string;
|
|
454
|
+
/** Product status (learning, ongoing, paused, ended, unavailable) */
|
|
455
|
+
status: string;
|
|
456
|
+
/** Unique identifier for the product */
|
|
457
|
+
item_id: number;
|
|
458
|
+
}>;
|
|
459
|
+
}>;
|
|
460
|
+
};
|
|
461
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
462
|
+
warning?: string;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Parameters for the get product recommended ROI target API
|
|
466
|
+
*/
|
|
467
|
+
export type GetProductRecommendedRoiTargetParams = {
|
|
468
|
+
/**
|
|
469
|
+
* A random string used to prevent duplicate ads.
|
|
470
|
+
* If an ads is created successfully, subsequent requests using the same reference id will fail.
|
|
471
|
+
* Use the same string for calling suggestion/recommendation API before the actual request to create an ads.
|
|
472
|
+
*/
|
|
473
|
+
reference_id: string;
|
|
474
|
+
/** Unique identifier for a product */
|
|
475
|
+
item_id: number;
|
|
476
|
+
};
|
|
477
|
+
/**
|
|
478
|
+
* Response for the get product recommended ROI target API
|
|
479
|
+
*/
|
|
480
|
+
export interface GetProductRecommendedRoiTargetResponse extends BaseResponse {
|
|
481
|
+
response: {
|
|
482
|
+
/**
|
|
483
|
+
* Lower bound recommendation.
|
|
484
|
+
* e.g., value=3.5 and percentile=80 mean that setting an ROI target of 3.5
|
|
485
|
+
* makes the ads more competitive than 80% of similar ads.
|
|
486
|
+
*/
|
|
487
|
+
lower_bound: {
|
|
488
|
+
/** The ROI target value */
|
|
489
|
+
value: number;
|
|
490
|
+
/** Competitiveness over similar ads */
|
|
491
|
+
percentile: number;
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Mid-level recommendation.
|
|
495
|
+
* e.g., value=5.9 and percentile=50 mean that setting an ROI target of 5.9
|
|
496
|
+
* makes the ads more competitive than 50% of similar ads.
|
|
497
|
+
*/
|
|
498
|
+
exact: {
|
|
499
|
+
/** The ROI target value */
|
|
500
|
+
value: number;
|
|
501
|
+
/** Competitiveness over similar ads */
|
|
502
|
+
percentile: number;
|
|
503
|
+
};
|
|
504
|
+
/**
|
|
505
|
+
* Higher bound recommendation.
|
|
506
|
+
* e.g., value=10.8 and percentile=20 mean that setting an ROI target of 10.8
|
|
507
|
+
* makes the ads more competitive than 20% of similar ads.
|
|
508
|
+
*/
|
|
509
|
+
upper_bound: {
|
|
510
|
+
/** The ROI target value */
|
|
511
|
+
value: number;
|
|
512
|
+
/** Competitiveness over similar ads */
|
|
513
|
+
percentile: number;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
/** Optional warning message if some data cannot be responded normally */
|
|
517
|
+
warning?: string;
|
|
518
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type InputValidationType =
|
|
2
|
-
export type FormatType =
|
|
3
|
-
export type DateFormatType =
|
|
4
|
-
export type InputType =
|
|
1
|
+
export type InputValidationType = "INT_TYPE" | "STRING_TYPE" | "ENUM_TYPE" | "FLOAT_TYPE" | "DATE_TYPE" | "TIMESTAMP_TYPE";
|
|
2
|
+
export type FormatType = "NORMAL" | "QUANTITATIVE";
|
|
3
|
+
export type DateFormatType = "YEAR_MONTH_DATE" | "YEAR_MONTH";
|
|
4
|
+
export type InputType = "DROP_DOWN" | "MULTIPLE_SELECT" | "TEXT_FILED" | "COMBO_BOX" | "MULTIPLE_SELECT_COMBO_BOX";
|
|
5
5
|
export interface AttributeValue {
|
|
6
6
|
value_id: number;
|
|
7
7
|
original_value_name: string;
|
package/lib/schemas/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestInit } from
|
|
2
|
-
export type FetchOptions = Omit<RequestInit,
|
|
1
|
+
import { RequestInit } from "node-fetch";
|
|
2
|
+
export type FetchOptions = Omit<RequestInit, "body"> & {
|
|
3
3
|
params?: Record<string, string | number | boolean | undefined | null | (string | number | boolean)[]>;
|
|
4
4
|
body?: unknown;
|
|
5
5
|
auth?: boolean;
|
package/lib/schemas/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
1
|
+
export * from "./access-token.js";
|
|
2
|
+
export * from "./attribute.js";
|
|
3
|
+
export * from "./authed-merchant.js";
|
|
4
|
+
export * from "./authed-shop.js";
|
|
5
|
+
export * from "./category.js";
|
|
6
|
+
export * from "./fetch.js";
|
|
7
|
+
export * from "./order.js";
|
|
8
|
+
export * from "./product.js";
|
|
9
|
+
export * from "./public.js";
|
|
10
|
+
export * from "./push.js";
|
|
11
|
+
export * from "./region.js";
|
|
12
|
+
export * from "./ads.js";
|
package/lib/schemas/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
1
|
+
export * from "./access-token.js";
|
|
2
|
+
export * from "./attribute.js";
|
|
3
|
+
export * from "./authed-merchant.js";
|
|
4
|
+
export * from "./authed-shop.js";
|
|
5
|
+
export * from "./category.js";
|
|
6
|
+
export * from "./fetch.js";
|
|
7
|
+
export * from "./order.js";
|
|
8
|
+
export * from "./product.js";
|
|
9
|
+
export * from "./public.js";
|
|
10
|
+
export * from "./push.js";
|
|
11
|
+
export * from "./region.js";
|
|
12
|
+
export * from "./ads.js";
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
package/lib/schemas/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
package/lib/schemas/order.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchResponse } from
|
|
1
|
+
import { FetchResponse } from "./fetch.js";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an item in an order with detailed product information
|
|
4
4
|
*/
|
|
@@ -73,31 +73,31 @@ export interface PackageItem {
|
|
|
73
73
|
*/
|
|
74
74
|
export type LogisticsStatus =
|
|
75
75
|
/** Initial status, order not ready for fulfillment */
|
|
76
|
-
|
|
76
|
+
"LOGISTICS_NOT_STARTED"
|
|
77
77
|
/** order arranged shipment */
|
|
78
|
-
|
|
|
78
|
+
| "LOGISTICS_REQUEST_CREATED"
|
|
79
79
|
/** order handed over to 3PL */
|
|
80
|
-
|
|
|
80
|
+
| "LOGISTICS_PICKUP_DONE"
|
|
81
81
|
/** order pending 3PL retry pickup */
|
|
82
|
-
|
|
|
82
|
+
| "LOGISTICS_PICKUP_RETRY"
|
|
83
83
|
/** order cancelled by 3PL due to failed pickup or picked up but not able to proceed with delivery */
|
|
84
|
-
|
|
|
84
|
+
| "LOGISTICS_PICKUP_FAILED"
|
|
85
85
|
/** order successfully delivered */
|
|
86
|
-
|
|
|
86
|
+
| "LOGISTICS_DELIVERY_DONE"
|
|
87
87
|
/** order cancelled due to 3PL delivery failed */
|
|
88
|
-
|
|
|
88
|
+
| "LOGISTICS_DELIVERY_FAILED"
|
|
89
89
|
/** order cancelled when order at LOGISTICS_REQUEST_CREATED */
|
|
90
|
-
|
|
|
90
|
+
| "LOGISTICS_REQUEST_CANCELED"
|
|
91
91
|
/** Integrated logistics COD: Order rejected for COD */
|
|
92
|
-
|
|
|
92
|
+
| "LOGISTICS_COD_REJECTED"
|
|
93
93
|
/** order ready for fulfilment from payment perspective: non-COD: order paid, COD: order passed COD screening */
|
|
94
|
-
|
|
|
94
|
+
| "LOGISTICS_READY"
|
|
95
95
|
/** order cancelled when order at LOGISTICS_READY */
|
|
96
|
-
|
|
|
96
|
+
| "LOGISTICS_INVALID"
|
|
97
97
|
/** order cancelled due to 3PL lost the order */
|
|
98
|
-
|
|
|
98
|
+
| "LOGISTICS_LOST"
|
|
99
99
|
/** order logistics pending arrangement */
|
|
100
|
-
|
|
|
100
|
+
| "LOGISTICS_PENDING_ARRANGE";
|
|
101
101
|
/**
|
|
102
102
|
* Represents a package in an order with shipping information
|
|
103
103
|
*/
|
|
@@ -262,31 +262,31 @@ export interface Order {
|
|
|
262
262
|
/**
|
|
263
263
|
* The kind of time range field for order list query
|
|
264
264
|
*/
|
|
265
|
-
export type TimeRangeField =
|
|
265
|
+
export type TimeRangeField = "create_time" | "update_time";
|
|
266
266
|
/**
|
|
267
267
|
* The status of an order
|
|
268
268
|
*/
|
|
269
269
|
export type OrderStatus =
|
|
270
270
|
/** Order is created, buyer has not paid yet */
|
|
271
|
-
|
|
271
|
+
"UNPAID"
|
|
272
272
|
/** Seller can arrange shipment */
|
|
273
|
-
|
|
|
273
|
+
| "READY_TO_SHIP"
|
|
274
274
|
/** Seller has arranged shipment online and got tracking number from 3PL */
|
|
275
|
-
|
|
|
275
|
+
| "PROCESSED"
|
|
276
276
|
/** 3PL pickup parcel fail. Need to re arrange shipment */
|
|
277
|
-
|
|
|
277
|
+
| "RETRY_SHIP"
|
|
278
278
|
/** The parcel has been drop to 3PL or picked up by 3PL */
|
|
279
|
-
|
|
|
279
|
+
| "SHIPPED"
|
|
280
280
|
/** The order has been received by buyer */
|
|
281
|
-
|
|
|
281
|
+
| "TO_CONFIRM_RECEIVE"
|
|
282
282
|
/** The order's cancelation is under processing */
|
|
283
|
-
|
|
|
283
|
+
| "IN_CANCEL"
|
|
284
284
|
/** The order has been canceled */
|
|
285
|
-
|
|
|
285
|
+
| "CANCELLED"
|
|
286
286
|
/** The buyer requested to return the order and order's return is processing */
|
|
287
|
-
|
|
|
287
|
+
| "TO_RETURN"
|
|
288
288
|
/** The order has been completed */
|
|
289
|
-
|
|
|
289
|
+
| "COMPLETED";
|
|
290
290
|
/**
|
|
291
291
|
* Represents a single order in the order list response
|
|
292
292
|
*/
|
|
@@ -334,7 +334,7 @@ export interface GetOrderListResponse extends FetchResponse<{
|
|
|
334
334
|
}> {
|
|
335
335
|
}
|
|
336
336
|
export declare const allOptionalFields = "buyer_user_id,buyer_username,estimated_shipping_fee,recipient_address,actual_shipping_fee,goods_to_declare,note,note_update_time,item_list,pay_time,dropshipper,dropshipper_phone,split_up,buyer_cancel_reason,cancel_by,cancel_reason,actual_shipping_fee_confirmed,buyer_cpf_id,fulfillment_flag,pickup_done_time,package_list,shipping_carrier,payment_method,total_amount,invoice_data,order_chargeable_weight_gram,return_request_due_date,edt";
|
|
337
|
-
export type OrderDetailOptionalFields =
|
|
337
|
+
export type OrderDetailOptionalFields = "buyer_user_id" | "buyer_username" | "estimated_shipping_fee" | "recipient_address" | "actual_shipping_fee" | "goods_to_declare" | "note" | "note_update_time" | "item_list" | "pay_time" | "dropshipper" | "dropshipper_phone" | "split_up" | "buyer_cancel_reason" | "cancel_by" | "cancel_reason" | "actual_shipping_fee_confirmed" | "buyer_cpf_id" | "fulfillment_flag" | "pickup_done_time" | "package_list" | "shipping_carrier" | "payment_method" | "total_amount" | "invoice_data" | "order_chargeable_weight_gram" | "return_request_due_date" | "edt";
|
|
338
338
|
/**
|
|
339
339
|
* Parameters for getting order details
|
|
340
340
|
*/
|
package/lib/schemas/order.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const allOptionalFields =
|
|
1
|
+
export const allOptionalFields = "buyer_user_id,buyer_username,estimated_shipping_fee,recipient_address,actual_shipping_fee,goods_to_declare,note,note_update_time,item_list,pay_time,dropshipper,dropshipper_phone,split_up,buyer_cancel_reason,cancel_by,cancel_reason,actual_shipping_fee_confirmed,buyer_cpf_id,fulfillment_flag,pickup_done_time,package_list,shipping_carrier,payment_method,total_amount,invoice_data,order_chargeable_weight_gram,return_request_due_date,edt";
|
|
2
2
|
//# sourceMappingURL=order.js.map
|
package/lib/schemas/payment.d.ts
CHANGED