@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.
Files changed (58) hide show
  1. package/README.md +7 -6
  2. package/lib/errors.js +2 -2
  3. package/lib/fetch.d.ts +2 -2
  4. package/lib/fetch.js +17 -14
  5. package/lib/fetch.js.map +1 -1
  6. package/lib/managers/ads.manager.d.ts +221 -1
  7. package/lib/managers/ads.manager.js +281 -6
  8. package/lib/managers/ads.manager.js.map +1 -1
  9. package/lib/managers/auth.manager.d.ts +3 -3
  10. package/lib/managers/auth.manager.js +21 -12
  11. package/lib/managers/auth.manager.js.map +1 -1
  12. package/lib/managers/base.manager.d.ts +1 -1
  13. package/lib/managers/index.d.ts +10 -10
  14. package/lib/managers/index.js +10 -10
  15. package/lib/managers/logistics.manager.js +2 -2
  16. package/lib/managers/logistics.manager.js.map +1 -1
  17. package/lib/managers/order.manager.d.ts +3 -3
  18. package/lib/managers/order.manager.js +25 -25
  19. package/lib/managers/order.manager.js.map +1 -1
  20. package/lib/managers/payment.manager.js +2 -2
  21. package/lib/managers/payment.manager.js.map +1 -1
  22. package/lib/managers/product.manager.d.ts +3 -3
  23. package/lib/managers/product.manager.js +10 -10
  24. package/lib/managers/product.manager.js.map +1 -1
  25. package/lib/managers/public.manager.d.ts +3 -3
  26. package/lib/managers/public.manager.js +8 -8
  27. package/lib/managers/push.manager.d.ts +3 -3
  28. package/lib/managers/push.manager.js +11 -11
  29. package/lib/managers/push.manager.js.map +1 -1
  30. package/lib/managers/voucher.manager.js +12 -12
  31. package/lib/managers/voucher.manager.js.map +1 -1
  32. package/lib/schemas/access-token.d.ts +2 -1
  33. package/lib/schemas/ads.d.ts +456 -0
  34. package/lib/schemas/attribute.d.ts +4 -4
  35. package/lib/schemas/fetch.d.ts +2 -2
  36. package/lib/schemas/index.d.ts +12 -11
  37. package/lib/schemas/index.js +12 -11
  38. package/lib/schemas/index.js.map +1 -1
  39. package/lib/schemas/logistics.d.ts +1 -1
  40. package/lib/schemas/order.d.ts +26 -26
  41. package/lib/schemas/order.js +1 -1
  42. package/lib/schemas/payment.d.ts +1 -1
  43. package/lib/schemas/product.d.ts +1 -1
  44. package/lib/schemas/product.js +0 -1
  45. package/lib/schemas/product.js.map +1 -1
  46. package/lib/schemas/push.d.ts +1 -1
  47. package/lib/schemas/region.js +5 -5
  48. package/lib/schemas/voucher.js.map +1 -1
  49. package/lib/sdk.d.ts +12 -12
  50. package/lib/sdk.js +15 -19
  51. package/lib/sdk.js.map +1 -1
  52. package/lib/storage/custom-token-storage.d.ts +2 -2
  53. package/lib/storage/custom-token-storage.js +11 -11
  54. package/lib/storage/custom-token-storage.js.map +1 -1
  55. package/lib/storage/token-storage.interface.d.ts +1 -1
  56. package/lib/utils/signature.js +3 -6
  57. package/lib/utils/signature.js.map +1 -1
  58. package/package.json +2 -1
@@ -19,8 +19,8 @@ export class AdsManager extends BaseManager {
19
19
  * that can be used for advertising campaigns.
20
20
  */
21
21
  async getTotalBalance() {
22
- const response = await ShopeeFetch.fetch(this.config, '/ads/get_total_balance', {
23
- method: 'GET',
22
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_total_balance", {
23
+ method: "GET",
24
24
  auth: true,
25
25
  });
26
26
  return response;
@@ -40,8 +40,8 @@ export class AdsManager extends BaseManager {
40
40
  * These settings affect how ads campaigns are managed and funded.
41
41
  */
42
42
  async getShopToggleInfo() {
43
- const response = await ShopeeFetch.fetch(this.config, '/ads/get_shop_toggle_info', {
44
- method: 'GET',
43
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_shop_toggle_info", {
44
+ method: "GET",
45
45
  auth: true,
46
46
  });
47
47
  return response;
@@ -63,8 +63,283 @@ export class AdsManager extends BaseManager {
63
63
  * Use this API to get keyword suggestions to improve item discoverability in search results.
64
64
  */
65
65
  async getRecommendedKeywordList(params) {
66
- const response = await ShopeeFetch.fetch(this.config, '/ads/get_recommended_keyword_list', {
67
- method: 'GET',
66
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_recommended_keyword_list", {
67
+ method: "GET",
68
+ auth: true,
69
+ params,
70
+ });
71
+ return response;
72
+ }
73
+ /**
74
+ * Get the list of recommended SKUs (Shop level) with the corresponding tag
75
+ * @returns {Promise<GetRecommendedItemListResponse>} Response containing recommended items
76
+ *
77
+ * This API is used to get the list of recommended SKU (Shop level) with the corresponding tag,
78
+ * i.e top search/best selling/best ROI tag.
79
+ *
80
+ * The response includes an array of items with the following details for each item:
81
+ * - item_id: Recommended SKU's item id
82
+ * - item_status_list: Status of items (indicates whether an item is eligible for ads or not)
83
+ * - sku_tag_list: Tags such as "best selling", "best ROI", "top search"
84
+ * - ongoing_ad_type_list: Current status of ads on this item (e.g., search ads, discovery ads)
85
+ *
86
+ * Use this API to identify high-potential items for advertising campaigns.
87
+ */
88
+ async getRecommendedItemList() {
89
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_recommended_item_list", {
90
+ method: "GET",
91
+ auth: true,
92
+ });
93
+ return response;
94
+ }
95
+ /**
96
+ * Get shop level CPC ads single-date hourly performance data
97
+ * @param {GetAllCpcAdsHourlyPerformanceParams} params Request parameters
98
+ * @param {string} params.performance_date Single date for hourly performance data in DD-MM-YYYY format
99
+ * @returns {Promise<GetAllCpcAdsHourlyPerformanceResponse>} Response containing hourly performance metrics
100
+ *
101
+ * This API is used to get Shop level CPC ads single-date hourly performance.
102
+ * The date must be today or earlier than today (up to 6 months ago).
103
+ *
104
+ * The response includes an array of hourly performance metrics with the following details for each hour:
105
+ * - hour: The hour the performance record belongs to
106
+ * - date: The date the performance record belongs to
107
+ * - impression: Number of times buyers see ads
108
+ * - clicks: Total number of clicks on the ad
109
+ * - ctr: Click-through rate (Clicks / Impressions)
110
+ * - direct_order: Orders placed within 7 days after clicking on the clicked ad
111
+ * - broad_order: Orders placed within 7 days after clicking on any ad from the same shop
112
+ * - direct_conversions: Direct conversion rate (clicked ad orders / total clicks)
113
+ * - broad_conversions: Broad conversion rate (any shop orders / total clicks)
114
+ * - direct_item_sold: Items sold from the clicked ad
115
+ * - broad_item_sold: Items sold from the shop after any ad click
116
+ * - direct_gmv: Total sales from the clicked ad
117
+ * - broad_gmv: Total sales from the shop after any ad click
118
+ * - expense: Ad expenditure
119
+ * - cost_per_conversion: Average cost per sales conversion
120
+ * - direct_roas: Direct return on ad spend (direct GMV / expense)
121
+ * - broad_roas: Broad return on ad spend (broad GMV / expense)
122
+ *
123
+ * Use this API to analyze hourly ad performance patterns for optimization.
124
+ */
125
+ async getAllCpcAdsHourlyPerformance(params) {
126
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_all_cpc_ads_hourly_performance", {
127
+ method: "GET",
128
+ auth: true,
129
+ params,
130
+ });
131
+ return response;
132
+ }
133
+ /**
134
+ * Get shop level CPC ads daily performance data for a date range
135
+ * @param {GetAllCpcAdsDailyPerformanceParams} params Request parameters
136
+ * @param {string} params.start_date Start date of the performance data range in DD-MM-YYYY format
137
+ * @param {string} params.end_date End date of the performance data range in DD-MM-YYYY format
138
+ * @returns {Promise<GetAllCpcAdsDailyPerformanceResponse>} Response containing daily performance metrics
139
+ *
140
+ * This API is used to get Shop level CPC ads multiple-days daily performance.
141
+ * The date range must be today or earlier than today (up to 6 months ago), and cannot exceed 1 month.
142
+ * Start date must be earlier than end date and cannot be equal to end date.
143
+ *
144
+ * The response includes an array of daily performance metrics with the following details for each day:
145
+ * - date: The date the performance record belongs to
146
+ * - impression: Number of times buyers see ads
147
+ * - clicks: Total number of clicks on the ad
148
+ * - ctr: Click-through rate (Clicks / Impressions)
149
+ * - direct_order: Orders placed within 7 days after clicking on the clicked ad
150
+ * - broad_order: Orders placed within 7 days after clicking on any ad from the same shop
151
+ * - direct_conversions: Direct conversion rate (clicked ad orders / total clicks)
152
+ * - broad_conversions: Broad conversion rate (any shop orders / total clicks)
153
+ * - direct_item_sold: Items sold from the clicked ad
154
+ * - broad_item_sold: Items sold from the shop after any ad click
155
+ * - direct_gmv: Total sales from the clicked ad
156
+ * - broad_gmv: Total sales from the shop after any ad click
157
+ * - expense: Ad expenditure
158
+ * - cost_per_conversion: Average cost per sales conversion
159
+ * - direct_roas: Direct return on ad spend (direct GMV / expense)
160
+ * - broad_roas: Broad return on ad spend (broad GMV / expense)
161
+ *
162
+ * Use this API to analyze daily ad performance trends over a time period.
163
+ */
164
+ async getAllCpcAdsDailyPerformance(params) {
165
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_all_cpc_ads_daily_performance", {
166
+ method: "GET",
167
+ auth: true,
168
+ params,
169
+ });
170
+ return response;
171
+ }
172
+ /**
173
+ * Get product-level campaign performance data for a date range
174
+ * @param {GetProductCampaignDailyPerformanceParams} params Request parameters
175
+ * @param {string} params.start_date Start date of the performance data range in DD-MM-YYYY format
176
+ * @param {string} params.end_date End date of the performance data range in DD-MM-YYYY format
177
+ * @param {string} params.campaign_id_list Comma-separated list of campaign IDs to fetch performance for (max 100)
178
+ * @returns {Promise<GetProductCampaignDailyPerformanceResponse>} Response containing detailed campaign performance metrics
179
+ *
180
+ * This API is used to get product-level ads performance data across multiple days.
181
+ * The date range must be today or earlier than today (up to 6 months ago), and cannot exceed 1 month.
182
+ * Start date must be earlier than end date and cannot be equal to end date.
183
+ *
184
+ * The response is structured hierarchically with:
185
+ * - shop_id and region information
186
+ * - Detailed campaign list with campaign_id, ad_type, campaign_placement, and ad_name
187
+ * - Comprehensive daily metrics for each campaign including:
188
+ * - Impressions, clicks, and CTR
189
+ * - Expense (ad spend)
190
+ * - Direct and broad performance metrics (orders, GMV, ROI)
191
+ * - Conversion rates and cost efficiency metrics
192
+ *
193
+ * Direct metrics refer to performance of the advertised product specifically, while
194
+ * broad metrics account for any purchases from the shop after an ad click.
195
+ *
196
+ * Use this API to analyze campaign effectiveness at the product level and optimize
197
+ * your advertising strategy based on detailed performance data.
198
+ */
199
+ async getProductCampaignDailyPerformance(params) {
200
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_product_campaign_daily_performance", {
201
+ method: "GET",
202
+ auth: true,
203
+ params,
204
+ });
205
+ return response;
206
+ }
207
+ /**
208
+ * Get product-level campaign hourly performance data for a single day
209
+ * @param {GetProductCampaignHourlyPerformanceParams} params Request parameters
210
+ * @param {string} params.performance_date Single date for the hourly performance data in DD-MM-YYYY format
211
+ * @param {string} params.campaign_id_list Comma-separated list of campaign IDs to fetch performance for (max 100)
212
+ * @returns {Promise<GetProductCampaignHourlyPerformanceResponse>} Response containing detailed hourly campaign performance metrics
213
+ *
214
+ * This API is used to get product-level ads hourly performance data for a single day.
215
+ * The date must be today or earlier than today (up to 6 months ago).
216
+ *
217
+ * The response is structured hierarchically with:
218
+ * - shop_id and region information
219
+ * - Detailed campaign list with campaign_id, ad_type, campaign_placement, and ad_name
220
+ * - Comprehensive hourly metrics for each campaign including:
221
+ * - Hour the performance record belongs to
222
+ * - Impressions, clicks, and CTR
223
+ * - Expense (ad spend)
224
+ * - Direct and broad performance metrics (orders, GMV, ROI)
225
+ * - Conversion rates and cost efficiency metrics
226
+ *
227
+ * Direct metrics refer to performance of the advertised product specifically, while
228
+ * broad metrics account for any purchases from the shop after an ad click.
229
+ *
230
+ * Use this API to analyze hourly campaign patterns and performance fluctuations
231
+ * throughout the day to optimize timing of ad campaigns and budget allocation.
232
+ */
233
+ async getProductCampaignHourlyPerformance(params) {
234
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_product_campaign_hourly_performance", {
235
+ method: "GET",
236
+ auth: true,
237
+ params,
238
+ });
239
+ return response;
240
+ }
241
+ /**
242
+ * Get a list of all product-level campaign IDs for a shop
243
+ * @param {GetProductLevelCampaignIdListParams} [params] Optional request parameters
244
+ * @param {string} [params.ad_type] Filter campaigns by ad type (can be "", "all", "auto", or "manual")
245
+ * @param {number} [params.offset] Pagination offset for fetching subsequent pages
246
+ * @param {number} [params.limit] Page size limit (number of results to return)
247
+ * @returns {Promise<GetProductLevelCampaignIdListResponse>} Response containing campaign IDs and pagination info
248
+ *
249
+ * This API is used to fetch all product campaign IDs displayed on the advertiser platform
250
+ * for a specific shop. The results can be filtered by ad type and paginated using
251
+ * offset and limit parameters.
252
+ *
253
+ * The response contains:
254
+ * - shop_id: The unique identifier for the shop
255
+ * - region: The region where the shop is located
256
+ * - has_next_page: Indicates if there are more campaigns on the next page
257
+ * - campaign_list: List of campaigns with ad_type and campaign_id
258
+ *
259
+ * Use this API to retrieve campaign IDs that can then be used with other APIs
260
+ * like getProductCampaignDailyPerformance or getProductCampaignHourlyPerformance
261
+ * to fetch detailed performance metrics.
262
+ */
263
+ async getProductLevelCampaignIdList(params) {
264
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_product_level_campaign_id_list", {
265
+ method: "GET",
266
+ auth: true,
267
+ params,
268
+ });
269
+ return response;
270
+ }
271
+ /**
272
+ * Get detailed settings information for product-level campaigns
273
+ * @param {GetProductLevelCampaignSettingInfoParams} params Request parameters
274
+ * @param {string} params.info_type_list Comma-separated list of info types to retrieve (1: Common Info, 2: Manual Bidding Info, 3: Auto Bidding Info, 4: Auto Product Ads Info)
275
+ * @param {string} params.campaign_id_list Comma-separated list of campaign IDs to fetch settings for (max 100)
276
+ * @returns {Promise<GetProductLevelCampaignSettingInfoResponse>} Response containing detailed campaign settings
277
+ *
278
+ * This API is used to retrieve detailed configuration settings for product-level ad campaigns.
279
+ * Depending on the info_type_list parameter, different types of information will be returned:
280
+ *
281
+ * Info type 1 (Common Info) includes:
282
+ * - Ad type (auto or manual)
283
+ * - Ad name and status
284
+ * - Bidding method and placement
285
+ * - Campaign budget and duration
286
+ * - List of item IDs in the campaign
287
+ *
288
+ * Info type 2 (Manual Bidding Info) includes:
289
+ * - Enhanced CPC setting
290
+ * - Selected keywords with match types and bid prices
291
+ * - Discovery ads placement settings
292
+ *
293
+ * Info type 3 (Auto Bidding Info) includes:
294
+ * - ROAS (Return on Ad Spend) target
295
+ *
296
+ * Info type 4 (Auto Product Ads Info) includes:
297
+ * - Product name and status
298
+ * - Item IDs
299
+ *
300
+ * Use this API to analyze and understand the detailed settings of your ad campaigns,
301
+ * which can help with optimization and decision-making for future campaign management.
302
+ */
303
+ async getProductLevelCampaignSettingInfo(params) {
304
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_product_level_campaign_setting_info", {
305
+ method: "GET",
306
+ auth: true,
307
+ params,
308
+ });
309
+ return response;
310
+ }
311
+ /**
312
+ * Get recommended ROI target values for a product's ad campaign
313
+ * @param {GetProductRecommendedRoiTargetParams} params Request parameters
314
+ * @param {string} params.reference_id A random string used to prevent duplicate ads
315
+ * @param {number} params.item_id Unique identifier for a product
316
+ * @returns {Promise<GetProductRecommendedRoiTargetResponse>} Response containing recommended ROI targets
317
+ *
318
+ * This API is used to get recommended Return on Investment (ROI) target values for
319
+ * a product's ad campaign. These recommendations help sellers set competitive ROI
320
+ * targets for their advertising campaigns.
321
+ *
322
+ * The response includes three recommendation levels:
323
+ *
324
+ * - Lower bound: A more competitive target (e.g., value=3.5, percentile=80) that makes
325
+ * the ad more competitive than 80% of similar ads.
326
+ *
327
+ * - Exact (mid-level): A balanced target (e.g., value=5.9, percentile=50) that makes
328
+ * the ad more competitive than 50% of similar ads.
329
+ *
330
+ * - Upper bound: A less competitive target (e.g., value=10.8, percentile=20) that makes
331
+ * the ad more competitive than 20% of similar ads.
332
+ *
333
+ * Each recommendation includes:
334
+ * - value: The recommended ROI target value
335
+ * - percentile: Indicates how competitive this target is compared to similar ads
336
+ *
337
+ * Use this API to help determine optimal ROI targets for your advertising strategy
338
+ * based on competitive marketplace data.
339
+ */
340
+ async getProductRecommendedRoiTarget(params) {
341
+ const response = await ShopeeFetch.fetch(this.config, "/ads/get_product_recommended_roi_target", {
342
+ method: "GET",
68
343
  auth: true,
69
344
  params,
70
345
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ads.manager.js","sourceRoot":"","sources":["../../src/managers/ads.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,E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Q,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,8CAA8C,EAC9C;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,KAAK,CAAC,8BAA8B,CAClC,MAA4C;QAE5C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,yCAAyC,EACzC;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
- import { ShopeeConfig } from '../sdk.js';
2
- import { AccessToken } from '../schemas/access-token.js';
3
- import { BaseManager } from './base.manager.js';
1
+ import { ShopeeConfig } from "../sdk.js";
2
+ import { AccessToken } from "../schemas/access-token.js";
3
+ import { BaseManager } from "./base.manager.js";
4
4
  export declare class AuthManager extends BaseManager {
5
5
  constructor(config: ShopeeConfig);
6
6
  getAccessToken(code: string, shopId?: number, mainAccountId?: number): Promise<AccessToken>;
@@ -1,5 +1,5 @@
1
- import { ShopeeFetch } from '../fetch.js';
2
- import { BaseManager } from './base.manager.js';
1
+ import { ShopeeFetch } from "../fetch.js";
2
+ import { BaseManager } from "./base.manager.js";
3
3
  export class AuthManager extends BaseManager {
4
4
  constructor(config) {
5
5
  super(config);
@@ -15,23 +15,29 @@ export class AuthManager extends BaseManager {
15
15
  if (mainAccountId) {
16
16
  body.main_account_id = mainAccountId;
17
17
  }
18
- const response = await ShopeeFetch.fetch(this.config, '/auth/token/get', {
19
- method: 'POST',
18
+ const response = await ShopeeFetch.fetch(this.config, "/auth/token/get", {
19
+ method: "POST",
20
20
  body,
21
21
  });
22
+ if (!response.expired_at && response.expire_in) {
23
+ response.expired_at = Date.now() + response.expire_in * 1000 - 60 * 1000;
24
+ }
22
25
  return {
23
26
  ...response,
24
- shop_id: shopId
27
+ shop_id: shopId,
25
28
  };
26
29
  }
27
30
  async getAccessTokenByResendCode(code) {
28
31
  const body = {
29
32
  resend_code: code,
30
33
  };
31
- const response = await ShopeeFetch.fetch(this.config, '/public/get_token_by_resend_code', {
32
- method: 'POST',
33
- body
34
+ const response = await ShopeeFetch.fetch(this.config, "/public/get_token_by_resend_code", {
35
+ method: "POST",
36
+ body,
34
37
  });
38
+ if (!response.expired_at && response.expire_in) {
39
+ response.expired_at = Date.now() + response.expire_in * 1000 - 60 * 1000;
40
+ }
35
41
  return response;
36
42
  }
37
43
  async getRefreshToken(refreshToken, shopId, merchantId) {
@@ -45,13 +51,16 @@ export class AuthManager extends BaseManager {
45
51
  if (merchantId) {
46
52
  body.merchant_id = merchantId;
47
53
  }
48
- const response = await ShopeeFetch.fetch(this.config, '/auth/access_token/get', {
49
- method: 'POST',
50
- body
54
+ const response = await ShopeeFetch.fetch(this.config, "/auth/access_token/get", {
55
+ method: "POST",
56
+ body,
51
57
  });
58
+ if (!response.expired_at && response.expire_in) {
59
+ response.expired_at = Date.now() + response.expire_in * 1000 - 60 * 1000;
60
+ }
52
61
  return {
53
62
  ...response,
54
- shop_id: shopId
63
+ shop_id: shopId,
55
64
  };
56
65
  }
57
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auth.manager.js","sourceRoot":"","sources":["../../src/managers/auth.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,cAAc,CACzB,IAAY,EACZ,MAAe,EACf,aAAsB;QAEtB,MAAM,IAAI,GAA8C;YACtD,IAA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stract class BaseManager {
3
3
  protected config: ShopeeConfig;
4
4
  constructor(config: ShopeeConfig);
@@ -1,10 +1,10 @@
1
- export * from './auth.manager.js';
2
- export * from './base.manager.js';
3
- export * from './logistics.manager.js';
4
- export * from './order.manager.js';
5
- export * from './order.manager.js';
6
- export * from './product.manager.js';
7
- export * from './public.manager.js';
8
- export * from './push.manager.js';
9
- export * from './voucher.manager.js';
10
- export * from './ads.manager.js';
1
+ export * from "./auth.manager.js";
2
+ export * from "./base.manager.js";
3
+ export * from "./logistics.manager.js";
4
+ export * from "./order.manager.js";
5
+ export * from "./order.manager.js";
6
+ export * from "./product.manager.js";
7
+ export * from "./public.manager.js";
8
+ export * from "./push.manager.js";
9
+ export * from "./voucher.manager.js";
10
+ export * from "./ads.manager.js";
@@ -1,11 +1,11 @@
1
- export * from './auth.manager.js';
2
- export * from './base.manager.js';
3
- export * from './logistics.manager.js';
4
- export * from './order.manager.js';
5
- export * from './order.manager.js';
6
- export * from './product.manager.js';
7
- export * from './public.manager.js';
8
- export * from './push.manager.js';
9
- export * from './voucher.manager.js';
10
- export * from './ads.manager.js';
1
+ export * from "./auth.manager.js";
2
+ export * from "./base.manager.js";
3
+ export * from "./logistics.manager.js";
4
+ export * from "./order.manager.js";
5
+ export * from "./order.manager.js";
6
+ export * from "./product.manager.js";
7
+ export * from "./public.manager.js";
8
+ export * from "./push.manager.js";
9
+ export * from "./voucher.manager.js";
10
+ export * from "./ads.manager.js";
11
11
  //# sourceMappingURL=index.js.map
@@ -31,8 +31,8 @@ export class LogisticsManager extends BaseManager {
31
31
  * - logistics.package_number_not_exist: Package number required for split order
32
32
  */
33
33
  async getTrackingInfo(params) {
34
- const response = await ShopeeFetch.fetch(this.config, '/logistics/get_tracking_info', {
35
- method: 'GET',
34
+ const response = await ShopeeFetch.fetch(this.config, "/logistics/get_tracking_info", {
35
+ method: "GET",
36
36
  auth: true,
37
37
  params,
38
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"logistics.manager.js","sourceRoot":"","sources":["../../src/managers/logistics.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC7C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QAC/C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACpC,IAAI,CAAC,MAAM,EACX,8BAA8B,EAC9B;YACI,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACT,CACJ,CAAC;QAEF,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"}
1
+ {"version":3,"file":"logistics.manager.js","sourceRoot":"","sources":["../../src/managers/logistics.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,8BAA8B,EAC9B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
- import { BaseManager } from './base.manager.js';
2
- import { ShopeeConfig } from '../sdk.js';
3
- import { GetOrderListParams, GetOrderListResponse, GetOrdersDetailParams, GetOrdersDetailResponse, GetShipmentListParams, GetShipmentListResponse, SplitOrderParams, SplitOrderResponse, UnsplitOrderParams, UnsplitOrderResponse, CancelOrderParams, CancelOrderResponse, GetBuyerInvoiceInfoParams, GetBuyerInvoiceInfoResponse } from '../schemas/order.js';
1
+ import { BaseManager } from "./base.manager.js";
2
+ import { ShopeeConfig } from "../sdk.js";
3
+ import { GetOrderListParams, GetOrderListResponse, GetOrdersDetailParams, GetOrdersDetailResponse, GetShipmentListParams, GetShipmentListResponse, SplitOrderParams, SplitOrderResponse, UnsplitOrderParams, UnsplitOrderResponse, CancelOrderParams, CancelOrderResponse, GetBuyerInvoiceInfoParams, GetBuyerInvoiceInfoResponse } from "../schemas/order.js";
4
4
  export declare class OrderManager extends BaseManager {
5
5
  constructor(config: ShopeeConfig);
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { BaseManager } from './base.manager.js';
2
- import { ShopeeFetch } from '../fetch.js';
1
+ import { BaseManager } from "./base.manager.js";
2
+ import { ShopeeFetch } from "../fetch.js";
3
3
  export class OrderManager extends BaseManager {
4
4
  constructor(config) {
5
5
  super(config);
@@ -20,8 +20,8 @@ export class OrderManager extends BaseManager {
20
20
  * @returns Promise<GetOrderListResponse> - The response containing order list and pagination information
21
21
  */
22
22
  async getOrderList(params) {
23
- const response = await ShopeeFetch.fetch(this.config, '/order/get_order_list', {
24
- method: 'GET',
23
+ const response = await ShopeeFetch.fetch(this.config, "/order/get_order_list", {
24
+ method: "GET",
25
25
  params,
26
26
  auth: true,
27
27
  });
@@ -38,11 +38,11 @@ export class OrderManager extends BaseManager {
38
38
  */
39
39
  async getOrdersDetail(params) {
40
40
  const response = await ShopeeFetch.fetch(this.config, `/order/get_order_detail`, {
41
- method: 'GET',
41
+ method: "GET",
42
42
  auth: true,
43
43
  params: {
44
44
  ...params,
45
- order_sn_list: params.order_sn_list.join(','),
45
+ order_sn_list: params.order_sn_list.join(","),
46
46
  },
47
47
  });
48
48
  return response;
@@ -56,8 +56,8 @@ export class OrderManager extends BaseManager {
56
56
  * @returns Promise<GetShipmentListResponse> - The response containing shipment list and pagination information
57
57
  */
58
58
  async getShipmentList(params) {
59
- const response = await ShopeeFetch.fetch(this.config, '/order/get_shipment_list', {
60
- method: 'GET',
59
+ const response = await ShopeeFetch.fetch(this.config, "/order/get_shipment_list", {
60
+ method: "GET",
61
61
  params,
62
62
  auth: true,
63
63
  });
@@ -71,21 +71,21 @@ export class OrderManager extends BaseManager {
71
71
  * @returns Promise resolving to the split order response
72
72
  */
73
73
  async splitOrder(params) {
74
- return ShopeeFetch.fetch(this.config, '/order/split_order', {
75
- method: 'POST',
74
+ return ShopeeFetch.fetch(this.config, "/order/split_order", {
75
+ method: "POST",
76
76
  body: {
77
77
  order_sn: params.order_sn,
78
- package_list: params.package_list.map(pkg => ({
79
- item_list: pkg.item_list.map(item => ({
78
+ package_list: params.package_list.map((pkg) => ({
79
+ item_list: pkg.item_list.map((item) => ({
80
80
  item_id: item.item_id,
81
81
  model_id: item.model_id,
82
82
  order_item_id: item.order_item_id,
83
83
  promotion_group_id: item.promotion_group_id,
84
- model_quantity: item.model_quantity
85
- }))
86
- }))
84
+ model_quantity: item.model_quantity,
85
+ })),
86
+ })),
87
87
  },
88
- auth: true
88
+ auth: true,
89
89
  });
90
90
  }
91
91
  /**
@@ -103,12 +103,12 @@ export class OrderManager extends BaseManager {
103
103
  * - Cannot unsplit order with missing items
104
104
  */
105
105
  async unsplitOrder(params) {
106
- return ShopeeFetch.fetch(this.config, '/order/unsplit_order', {
107
- method: 'POST',
106
+ return ShopeeFetch.fetch(this.config, "/order/unsplit_order", {
107
+ method: "POST",
108
108
  body: {
109
- order_sn: params.order_sn
109
+ order_sn: params.order_sn,
110
110
  },
111
- auth: true
111
+ auth: true,
112
112
  });
113
113
  }
114
114
  /**
@@ -129,14 +129,14 @@ export class OrderManager extends BaseManager {
129
129
  * - Order has already been shipped
130
130
  */
131
131
  async cancelOrder(params) {
132
- return ShopeeFetch.fetch(this.config, '/order/cancel_order', {
133
- method: 'POST',
132
+ return ShopeeFetch.fetch(this.config, "/order/cancel_order", {
133
+ method: "POST",
134
134
  body: {
135
135
  order_sn: params.order_sn,
136
136
  cancel_reason: params.cancel_reason,
137
- item_list: params.item_list
137
+ item_list: params.item_list,
138
138
  },
139
- auth: true
139
+ auth: true,
140
140
  });
141
141
  }
142
142
  /**
@@ -163,7 +163,7 @@ export class OrderManager extends BaseManager {
163
163
  */
164
164
  async getBuyerInvoiceInfo(params) {
165
165
  const response = await ShopeeFetch.fetch(this.config, `/order/get_buyer_invoice_info`, {
166
- method: 'POST',
166
+ method: "POST",
167
167
  auth: true,
168
168
  body: params,
169
169
  });
@@ -1 +1 @@
1
- {"version":3,"file":"order.manager.js","sourceRoot":"","sources":["../../src/managers/order.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmBhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CAAuB,IAAI,CAAC,MAAM,EAAE,uBAAuB,EAAE;YACnG,MAAM,EAAE,KAAK;YACb,MAAM;YACN,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CAA0B,IAAI,CAAC,MAAM,EAAE,yBAAyB,EAAE;YACxG,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE;gBACN,GAAG,MAAM;gBACT,aAAa,E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,IAAI,CAAC,cAAc;qBACpC,CAAC,CAAC;iBACJ,CAAC,CAAC;aACJ;YACD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,OAAO,WAAW,CAAC,KAAK,CAAuB,IAAI,CAAC,MAAM,EAAE,sBAAsB,EAAE;YAClF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B;YACD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,WAAW,CAAC,MAAyB;QACzC,OAAO,WAAW,CAAC,KAAK,CAAsB,IAAI,CAAC,MAAM,EAAE,qBAAqB,EAAE;YAChF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B;YACD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,mBAAmB,CACvB,MAAiC;QAEjC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,+BAA+B,EAC/B;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -28,8 +28,8 @@ export class PaymentManager extends BaseManager {
28
28
  * - error_not_found: Order income details not found
29
29
  */
30
30
  async getEscrowDetail(params) {
31
- const response = await ShopeeFetch.fetch(this.config, '/payment/get_escrow_detail', {
32
- method: 'GET',
31
+ const response = await ShopeeFetch.fetch(this.config, "/payment/get_escrow_detail", {
32
+ method: "GET",
33
33
  auth: true,
34
34
  params,
35
35
  });
@@ -1 +1 @@
1
- {"version":3,"file":"payment.manager.js","sourceRoot":"","sources":["../../src/managers/payment.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC3C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QAC/C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACpC,IAAI,CAAC,MAAM,EACX,4BAA4B,EAC5B;YACI,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACT,CACJ,CAAC;QACF,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"}
1
+ {"version":3,"file":"payment.manager.js","sourceRoot":"","sources":["../../src/managers/payment.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,4BAA4B,EAC5B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}