@congminh1254/shopee-sdk 0.9.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.
Files changed (137) hide show
  1. package/README.md +178 -36
  2. package/lib/fetch.js +13 -0
  3. package/lib/fetch.js.map +1 -1
  4. package/lib/managers/add-on-deal.manager.d.ts +140 -0
  5. package/lib/managers/add-on-deal.manager.js +240 -0
  6. package/lib/managers/add-on-deal.manager.js.map +1 -0
  7. package/lib/managers/ads.manager.d.ts +217 -1
  8. package/lib/managers/ads.manager.js +312 -0
  9. package/lib/managers/ads.manager.js.map +1 -1
  10. package/lib/managers/bundle-deal.manager.d.ts +106 -0
  11. package/lib/managers/bundle-deal.manager.js +178 -0
  12. package/lib/managers/bundle-deal.manager.js.map +1 -0
  13. package/lib/managers/discount.manager.d.ts +102 -0
  14. package/lib/managers/discount.manager.js +167 -0
  15. package/lib/managers/discount.manager.js.map +1 -0
  16. package/lib/managers/fbs.manager.d.ts +115 -0
  17. package/lib/managers/fbs.manager.js +145 -0
  18. package/lib/managers/fbs.manager.js.map +1 -0
  19. package/lib/managers/first-mile.manager.d.ts +150 -0
  20. package/lib/managers/first-mile.manager.js +264 -0
  21. package/lib/managers/first-mile.manager.js.map +1 -0
  22. package/lib/managers/follow-prize.manager.d.ts +108 -0
  23. package/lib/managers/follow-prize.manager.js +152 -0
  24. package/lib/managers/follow-prize.manager.js.map +1 -0
  25. package/lib/managers/global-product.manager.d.ts +664 -0
  26. package/lib/managers/global-product.manager.js +904 -0
  27. package/lib/managers/global-product.manager.js.map +1 -0
  28. package/lib/managers/index.d.ts +17 -1
  29. package/lib/managers/index.js +17 -1
  30. package/lib/managers/index.js.map +1 -1
  31. package/lib/managers/livestream.manager.d.ts +377 -0
  32. package/lib/managers/livestream.manager.js +529 -0
  33. package/lib/managers/livestream.manager.js.map +1 -0
  34. package/lib/managers/logistics.manager.d.ts +267 -1
  35. package/lib/managers/logistics.manager.js +544 -0
  36. package/lib/managers/logistics.manager.js.map +1 -1
  37. package/lib/managers/media-space.manager.d.ts +179 -0
  38. package/lib/managers/media-space.manager.js +220 -0
  39. package/lib/managers/media-space.manager.js.map +1 -0
  40. package/lib/managers/media.manager.d.ts +226 -0
  41. package/lib/managers/media.manager.js +274 -0
  42. package/lib/managers/media.manager.js.map +1 -0
  43. package/lib/managers/merchant.manager.d.ts +100 -0
  44. package/lib/managers/merchant.manager.js +144 -0
  45. package/lib/managers/merchant.manager.js.map +1 -0
  46. package/lib/managers/order.manager.d.ts +213 -1
  47. package/lib/managers/order.manager.js +305 -0
  48. package/lib/managers/order.manager.js.map +1 -1
  49. package/lib/managers/payment.manager.d.ts +186 -1
  50. package/lib/managers/payment.manager.js +288 -0
  51. package/lib/managers/payment.manager.js.map +1 -1
  52. package/lib/managers/product.manager.d.ts +346 -1
  53. package/lib/managers/product.manager.js +718 -0
  54. package/lib/managers/product.manager.js.map +1 -1
  55. package/lib/managers/returns.manager.d.ts +200 -0
  56. package/lib/managers/returns.manager.js +300 -0
  57. package/lib/managers/returns.manager.js.map +1 -0
  58. package/lib/managers/sbs.manager.d.ts +112 -0
  59. package/lib/managers/sbs.manager.js +149 -0
  60. package/lib/managers/sbs.manager.js.map +1 -0
  61. package/lib/managers/shop-category.manager.d.ts +207 -0
  62. package/lib/managers/shop-category.manager.js +258 -0
  63. package/lib/managers/shop-category.manager.js.map +1 -0
  64. package/lib/managers/shop-flash-sale.manager.d.ts +242 -0
  65. package/lib/managers/shop-flash-sale.manager.js +321 -0
  66. package/lib/managers/shop-flash-sale.manager.js.map +1 -0
  67. package/lib/managers/shop.manager.d.ts +173 -0
  68. package/lib/managers/shop.manager.js +217 -0
  69. package/lib/managers/shop.manager.js.map +1 -0
  70. package/lib/managers/top-picks.manager.d.ts +62 -0
  71. package/lib/managers/top-picks.manager.js +91 -0
  72. package/lib/managers/top-picks.manager.js.map +1 -0
  73. package/lib/schemas/add-on-deal.d.ts +390 -0
  74. package/lib/schemas/add-on-deal.js +45 -0
  75. package/lib/schemas/add-on-deal.js.map +1 -0
  76. package/lib/schemas/ads.d.ts +437 -0
  77. package/lib/schemas/bundle-deal.d.ts +300 -0
  78. package/lib/schemas/bundle-deal.js +27 -0
  79. package/lib/schemas/bundle-deal.js.map +1 -0
  80. package/lib/schemas/discount.d.ts +334 -0
  81. package/lib/schemas/discount.js +15 -0
  82. package/lib/schemas/discount.js.map +1 -0
  83. package/lib/schemas/fbs.d.ts +117 -0
  84. package/lib/schemas/fbs.js +2 -0
  85. package/lib/schemas/fbs.js.map +1 -0
  86. package/lib/schemas/first-mile.d.ts +551 -0
  87. package/lib/schemas/first-mile.js +2 -0
  88. package/lib/schemas/first-mile.js.map +1 -0
  89. package/lib/schemas/follow-prize.d.ts +198 -0
  90. package/lib/schemas/follow-prize.js +27 -0
  91. package/lib/schemas/follow-prize.js.map +1 -0
  92. package/lib/schemas/global-product.d.ts +1127 -0
  93. package/lib/schemas/global-product.js +2 -0
  94. package/lib/schemas/global-product.js.map +1 -0
  95. package/lib/schemas/index.d.ts +13 -0
  96. package/lib/schemas/index.js +17 -0
  97. package/lib/schemas/index.js.map +1 -1
  98. package/lib/schemas/livestream.d.ts +649 -0
  99. package/lib/schemas/livestream.js +2 -0
  100. package/lib/schemas/livestream.js.map +1 -0
  101. package/lib/schemas/logistics.d.ts +979 -0
  102. package/lib/schemas/logistics.js +13 -0
  103. package/lib/schemas/logistics.js.map +1 -1
  104. package/lib/schemas/media-space.d.ts +189 -0
  105. package/lib/schemas/media-space.js +2 -0
  106. package/lib/schemas/media-space.js.map +1 -0
  107. package/lib/schemas/media.d.ts +230 -0
  108. package/lib/schemas/media.js +2 -0
  109. package/lib/schemas/media.js.map +1 -0
  110. package/lib/schemas/merchant.d.ts +236 -0
  111. package/lib/schemas/merchant.js +2 -0
  112. package/lib/schemas/merchant.js.map +1 -0
  113. package/lib/schemas/order.d.ts +431 -0
  114. package/lib/schemas/payment.d.ts +397 -0
  115. package/lib/schemas/product.d.ts +1157 -0
  116. package/lib/schemas/returns.d.ts +632 -0
  117. package/lib/schemas/returns.js +63 -0
  118. package/lib/schemas/returns.js.map +1 -0
  119. package/lib/schemas/sbs.d.ts +484 -0
  120. package/lib/schemas/sbs.js +2 -0
  121. package/lib/schemas/sbs.js.map +1 -0
  122. package/lib/schemas/shop-category.d.ts +176 -0
  123. package/lib/schemas/shop-category.js +2 -0
  124. package/lib/schemas/shop-category.js.map +1 -0
  125. package/lib/schemas/shop-flash-sale.d.ts +473 -0
  126. package/lib/schemas/shop-flash-sale.js +43 -0
  127. package/lib/schemas/shop-flash-sale.js.map +1 -0
  128. package/lib/schemas/shop.d.ts +250 -0
  129. package/lib/schemas/shop.js +2 -0
  130. package/lib/schemas/shop.js.map +1 -0
  131. package/lib/schemas/top-picks.d.ts +99 -0
  132. package/lib/schemas/top-picks.js +2 -0
  133. package/lib/schemas/top-picks.js.map +1 -0
  134. package/lib/sdk.d.ts +34 -0
  135. package/lib/sdk.js +34 -0
  136. package/lib/sdk.js.map +1 -1
  137. package/package.json +7 -4
@@ -0,0 +1,904 @@
1
+ import { BaseManager } from "./base.manager.js";
2
+ import { ShopeeFetch } from "../fetch.js";
3
+ /**
4
+ * GlobalProductManager handles all global product operations for China mainland and Korean sellers.
5
+ * Global products allow sellers to manage products centrally and publish them to multiple shops.
6
+ */
7
+ export class GlobalProductManager extends BaseManager {
8
+ constructor(config) {
9
+ super(config);
10
+ }
11
+ /**
12
+ * Get global category list
13
+ *
14
+ * Use this API to get global category list. Only for China mainland sellers and Korean sellers.
15
+ *
16
+ * @param params - Parameters for getting category list
17
+ * @param params.language - Display language. Should be one of "zh-hans", "en"
18
+ *
19
+ * @returns Promise resolving to category list response
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const categories = await sdk.globalProduct.getCategory({
24
+ * language: "en"
25
+ * });
26
+ * ```
27
+ */
28
+ async getCategory(params = {}) {
29
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_category", {
30
+ method: "GET",
31
+ auth: true,
32
+ params,
33
+ });
34
+ return response;
35
+ }
36
+ /**
37
+ * Get global item list
38
+ *
39
+ * Use this API to get global item id list. Only for China mainland sellers and Korean sellers.
40
+ *
41
+ * @param params - Parameters for getting global item list
42
+ * @param params.page_size - The size of one page. Limit is [1,50]
43
+ * @param params.offset - Specifies the starting entry of data to return
44
+ * @param params.update_time_from - The starting date range for retrieving items
45
+ * @param params.update_time_to - The ending date range for retrieving items
46
+ *
47
+ * @returns Promise resolving to global item list response
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * const items = await sdk.globalProduct.getGlobalItemList({
52
+ * page_size: 20,
53
+ * update_time_from: 1611311600,
54
+ * update_time_to: 1611311631
55
+ * });
56
+ * ```
57
+ */
58
+ async getGlobalItemList(params) {
59
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_global_item_list", {
60
+ method: "GET",
61
+ auth: true,
62
+ params,
63
+ });
64
+ return response;
65
+ }
66
+ /**
67
+ * Get global item information
68
+ *
69
+ * Use this API to get global item detailed information.
70
+ *
71
+ * @param params - Parameters for getting global item info
72
+ * @param params.global_item_id_list - List of global item IDs to retrieve (max 50)
73
+ *
74
+ * @returns Promise resolving to global item info response
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const itemInfo = await sdk.globalProduct.getGlobalItemInfo({
79
+ * global_item_id_list: [123456, 789012]
80
+ * });
81
+ * ```
82
+ */
83
+ async getGlobalItemInfo(params) {
84
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_global_item_info", {
85
+ method: "GET",
86
+ auth: true,
87
+ params,
88
+ });
89
+ return response;
90
+ }
91
+ /**
92
+ * Get global model list
93
+ *
94
+ * Use this API to get global model list for a global item.
95
+ *
96
+ * @param params - Parameters for getting global model list
97
+ * @param params.global_item_id - Global item ID
98
+ *
99
+ * @returns Promise resolving to global model list response
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * const models = await sdk.globalProduct.getGlobalModelList({
104
+ * global_item_id: 123456
105
+ * });
106
+ * ```
107
+ */
108
+ async getGlobalModelList(params) {
109
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_global_model_list", {
110
+ method: "GET",
111
+ auth: true,
112
+ params,
113
+ });
114
+ return response;
115
+ }
116
+ /**
117
+ * Add a global item
118
+ *
119
+ * Use this API to add a new global item.
120
+ *
121
+ * @param params - Parameters for adding a global item
122
+ * @returns Promise resolving to add global item response
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * const result = await sdk.globalProduct.addGlobalItem({
127
+ * category_id: 100182,
128
+ * global_item_name: "Test Product",
129
+ * description: "This is a test product",
130
+ * weight: 1.0,
131
+ * image: {
132
+ * image_id_list: ["image123"]
133
+ * }
134
+ * });
135
+ * ```
136
+ */
137
+ async addGlobalItem(params) {
138
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/add_global_item", {
139
+ method: "POST",
140
+ auth: true,
141
+ body: params,
142
+ });
143
+ return response;
144
+ }
145
+ /**
146
+ * Update a global item
147
+ *
148
+ * Use this API to update an existing global item.
149
+ *
150
+ * @param params - Parameters for updating a global item
151
+ * @returns Promise resolving to update global item response
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * const result = await sdk.globalProduct.updateGlobalItem({
156
+ * global_item_id: 123456,
157
+ * global_item_name: "Updated Product Name",
158
+ * description: "Updated description"
159
+ * });
160
+ * ```
161
+ */
162
+ async updateGlobalItem(params) {
163
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_global_item", {
164
+ method: "POST",
165
+ auth: true,
166
+ body: params,
167
+ });
168
+ return response;
169
+ }
170
+ /**
171
+ * Delete a global item
172
+ *
173
+ * Use this API to delete a global item.
174
+ *
175
+ * @param params - Parameters for deleting a global item
176
+ * @param params.global_item_id - Global item ID to delete
177
+ *
178
+ * @returns Promise resolving to delete global item response
179
+ *
180
+ * @example
181
+ * ```typescript
182
+ * const result = await sdk.globalProduct.deleteGlobalItem({
183
+ * global_item_id: 123456
184
+ * });
185
+ * ```
186
+ */
187
+ async deleteGlobalItem(params) {
188
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/delete_global_item", {
189
+ method: "POST",
190
+ auth: true,
191
+ body: params,
192
+ });
193
+ return response;
194
+ }
195
+ /**
196
+ * Add global models
197
+ *
198
+ * Use this API to add models to a global item.
199
+ *
200
+ * @param params - Parameters for adding global models
201
+ * @returns Promise resolving to add global model response
202
+ *
203
+ * @example
204
+ * ```typescript
205
+ * const result = await sdk.globalProduct.addGlobalModel({
206
+ * global_item_id: 123456,
207
+ * model_list: [{
208
+ * tier_index: [0, 1],
209
+ * model_sku: "SKU-001"
210
+ * }]
211
+ * });
212
+ * ```
213
+ */
214
+ async addGlobalModel(params) {
215
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/add_global_model", {
216
+ method: "POST",
217
+ auth: true,
218
+ body: params,
219
+ });
220
+ return response;
221
+ }
222
+ /**
223
+ * Update global models
224
+ *
225
+ * Use this API to update existing global models.
226
+ *
227
+ * @param params - Parameters for updating global models
228
+ * @returns Promise resolving to update global model response
229
+ *
230
+ * @example
231
+ * ```typescript
232
+ * const result = await sdk.globalProduct.updateGlobalModel({
233
+ * global_item_id: 123456,
234
+ * model_list: [{
235
+ * global_model_id: 789,
236
+ * model_sku: "SKU-002"
237
+ * }]
238
+ * });
239
+ * ```
240
+ */
241
+ async updateGlobalModel(params) {
242
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_global_model", {
243
+ method: "POST",
244
+ auth: true,
245
+ body: params,
246
+ });
247
+ return response;
248
+ }
249
+ /**
250
+ * Delete global models
251
+ *
252
+ * Use this API to delete global models.
253
+ *
254
+ * @param params - Parameters for deleting global models
255
+ * @returns Promise resolving to delete global model response
256
+ *
257
+ * @example
258
+ * ```typescript
259
+ * const result = await sdk.globalProduct.deleteGlobalModel({
260
+ * global_item_id: 123456,
261
+ * global_model_id_list: [789, 790]
262
+ * });
263
+ * ```
264
+ */
265
+ async deleteGlobalModel(params) {
266
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/delete_global_model", {
267
+ method: "POST",
268
+ auth: true,
269
+ body: params,
270
+ });
271
+ return response;
272
+ }
273
+ /**
274
+ * Initialize tier variation
275
+ *
276
+ * Use this API to initialize tier variation for a global item.
277
+ *
278
+ * @param params - Parameters for initializing tier variation
279
+ * @returns Promise resolving to init tier variation response
280
+ *
281
+ * @example
282
+ * ```typescript
283
+ * const result = await sdk.globalProduct.initTierVariation({
284
+ * global_item_id: 123456,
285
+ * tier_variation: [{
286
+ * name: "Color",
287
+ * option_list: [
288
+ * { option: "Red" },
289
+ * { option: "Blue" }
290
+ * ]
291
+ * }],
292
+ * model_list: [{
293
+ * tier_index: [0],
294
+ * model_sku: "SKU-RED"
295
+ * }]
296
+ * });
297
+ * ```
298
+ */
299
+ async initTierVariation(params) {
300
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/init_tier_variation", {
301
+ method: "POST",
302
+ auth: true,
303
+ body: params,
304
+ });
305
+ return response;
306
+ }
307
+ /**
308
+ * Update tier variation
309
+ *
310
+ * Use this API to update tier variation for a global item.
311
+ *
312
+ * @param params - Parameters for updating tier variation
313
+ * @returns Promise resolving to update tier variation response
314
+ *
315
+ * @example
316
+ * ```typescript
317
+ * const result = await sdk.globalProduct.updateTierVariation({
318
+ * global_item_id: 123456,
319
+ * tier_variation: [{
320
+ * name: "Size",
321
+ * option_list: [
322
+ * { option: "S" },
323
+ * { option: "M" },
324
+ * { option: "L" }
325
+ * ]
326
+ * }]
327
+ * });
328
+ * ```
329
+ */
330
+ async updateTierVariation(params) {
331
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_tier_variation", {
332
+ method: "POST",
333
+ auth: true,
334
+ body: params,
335
+ });
336
+ return response;
337
+ }
338
+ /**
339
+ * Update global item stock
340
+ *
341
+ * Use this API to update stock for global items or models.
342
+ *
343
+ * @param params - Parameters for updating stock
344
+ * @returns Promise resolving to update stock response
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * const result = await sdk.globalProduct.updateStock({
349
+ * global_item_id: 123456,
350
+ * stock_list: [{
351
+ * shop_id: 67890,
352
+ * normal_stock: 100
353
+ * }]
354
+ * });
355
+ * ```
356
+ */
357
+ async updateStock(params) {
358
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_stock", {
359
+ method: "POST",
360
+ auth: true,
361
+ body: params,
362
+ });
363
+ return response;
364
+ }
365
+ /**
366
+ * Update global item price
367
+ *
368
+ * Use this API to update price for global items or models.
369
+ *
370
+ * @param params - Parameters for updating price
371
+ * @returns Promise resolving to update price response
372
+ *
373
+ * @example
374
+ * ```typescript
375
+ * const result = await sdk.globalProduct.updatePrice({
376
+ * global_item_id: 123456,
377
+ * price_list: [{
378
+ * shop_id: 67890,
379
+ * original_price: 29.99
380
+ * }]
381
+ * });
382
+ * ```
383
+ */
384
+ async updatePrice(params) {
385
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_price", {
386
+ method: "POST",
387
+ auth: true,
388
+ body: params,
389
+ });
390
+ return response;
391
+ }
392
+ /**
393
+ * Get attribute tree
394
+ *
395
+ * Use this API to get attribute tree for a category.
396
+ *
397
+ * @param params - Parameters for getting attribute tree
398
+ * @param params.category_id - Category ID
399
+ * @param params.language - Language for attribute names
400
+ *
401
+ * @returns Promise resolving to attribute tree response
402
+ *
403
+ * @example
404
+ * ```typescript
405
+ * const attributes = await sdk.globalProduct.getAttributeTree({
406
+ * category_id: 100182,
407
+ * language: "en"
408
+ * });
409
+ * ```
410
+ */
411
+ async getAttributeTree(params) {
412
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_attribute_tree", {
413
+ method: "GET",
414
+ auth: true,
415
+ params,
416
+ });
417
+ return response;
418
+ }
419
+ /**
420
+ * Get brand list
421
+ *
422
+ * Use this API to get brand list for a category.
423
+ *
424
+ * @param params - Parameters for getting brand list
425
+ * @returns Promise resolving to brand list response
426
+ *
427
+ * @example
428
+ * ```typescript
429
+ * const brands = await sdk.globalProduct.getBrandList({
430
+ * category_id: 100182,
431
+ * page_size: 20
432
+ * });
433
+ * ```
434
+ */
435
+ async getBrandList(params) {
436
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_brand_list", {
437
+ method: "GET",
438
+ auth: true,
439
+ params,
440
+ });
441
+ return response;
442
+ }
443
+ /**
444
+ * Get category recommendation
445
+ *
446
+ * Use this API to get category recommendations based on item name.
447
+ *
448
+ * @param params - Parameters for getting category recommendation
449
+ * @param params.global_item_name - Global item name
450
+ *
451
+ * @returns Promise resolving to category recommendation response
452
+ *
453
+ * @example
454
+ * ```typescript
455
+ * const recommendations = await sdk.globalProduct.categoryRecommend({
456
+ * global_item_name: "iPhone Case"
457
+ * });
458
+ * ```
459
+ */
460
+ async categoryRecommend(params) {
461
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/category_recommend", {
462
+ method: "POST",
463
+ auth: true,
464
+ body: params,
465
+ });
466
+ return response;
467
+ }
468
+ /**
469
+ * Get global item limit
470
+ *
471
+ * Use this API to get limits for a category (max images, videos, name length, etc.).
472
+ *
473
+ * @param params - Parameters for getting global item limit
474
+ * @param params.category_id - Category ID
475
+ *
476
+ * @returns Promise resolving to global item limit response
477
+ *
478
+ * @example
479
+ * ```typescript
480
+ * const limits = await sdk.globalProduct.getGlobalItemLimit({
481
+ * category_id: 100182
482
+ * });
483
+ * ```
484
+ */
485
+ async getGlobalItemLimit(params) {
486
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_global_item_limit", {
487
+ method: "GET",
488
+ auth: true,
489
+ params,
490
+ });
491
+ return response;
492
+ }
493
+ /**
494
+ * Get publishable shop list
495
+ *
496
+ * Use this API to get list of shops where a global item can be published.
497
+ *
498
+ * @param params - Parameters for getting publishable shops
499
+ * @param params.global_item_id - Global item ID
500
+ *
501
+ * @returns Promise resolving to publishable shop list response
502
+ *
503
+ * @example
504
+ * ```typescript
505
+ * const shops = await sdk.globalProduct.getPublishableShop({
506
+ * global_item_id: 123456
507
+ * });
508
+ * ```
509
+ */
510
+ async getPublishableShop(params) {
511
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_publishable_shop", {
512
+ method: "GET",
513
+ auth: true,
514
+ params,
515
+ });
516
+ return response;
517
+ }
518
+ /**
519
+ * Get shop publishable status
520
+ *
521
+ * Use this API to check if shops can publish a specific global item.
522
+ *
523
+ * @param params - Parameters for getting shop publishable status
524
+ * @returns Promise resolving to shop publishable status response
525
+ *
526
+ * @example
527
+ * ```typescript
528
+ * const status = await sdk.globalProduct.getShopPublishableStatus({
529
+ * global_item_id: 123456,
530
+ * shop_id_list: [67890, 67891]
531
+ * });
532
+ * ```
533
+ */
534
+ async getShopPublishableStatus(params) {
535
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_shop_publishable_status", {
536
+ method: "GET",
537
+ auth: true,
538
+ params,
539
+ });
540
+ return response;
541
+ }
542
+ /**
543
+ * Create publish task
544
+ *
545
+ * Use this API to create a task to publish a global item to multiple shops.
546
+ *
547
+ * @param params - Parameters for creating publish task
548
+ * @returns Promise resolving to create publish task response
549
+ *
550
+ * @example
551
+ * ```typescript
552
+ * const task = await sdk.globalProduct.createPublishTask({
553
+ * global_item_id: 123456,
554
+ * shop_list: [
555
+ * { shop_id: 67890 },
556
+ * { shop_id: 67891 }
557
+ * ]
558
+ * });
559
+ * ```
560
+ */
561
+ async createPublishTask(params) {
562
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/create_publish_task", {
563
+ method: "POST",
564
+ auth: true,
565
+ body: params,
566
+ });
567
+ return response;
568
+ }
569
+ /**
570
+ * Get publish task result
571
+ *
572
+ * Use this API to get the result of a publish task.
573
+ *
574
+ * @param params - Parameters for getting publish task result
575
+ * @param params.publish_task_id - Publish task ID
576
+ *
577
+ * @returns Promise resolving to publish task result response
578
+ *
579
+ * @example
580
+ * ```typescript
581
+ * const result = await sdk.globalProduct.getPublishTaskResult({
582
+ * publish_task_id: "task123"
583
+ * });
584
+ * ```
585
+ */
586
+ async getPublishTaskResult(params) {
587
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_publish_task_result", {
588
+ method: "GET",
589
+ auth: true,
590
+ params,
591
+ });
592
+ return response;
593
+ }
594
+ /**
595
+ * Get published list
596
+ *
597
+ * Use this API to get list of shops where a global item has been published.
598
+ *
599
+ * @param params - Parameters for getting published list
600
+ * @param params.global_item_id - Global item ID
601
+ *
602
+ * @returns Promise resolving to published list response
603
+ *
604
+ * @example
605
+ * ```typescript
606
+ * const published = await sdk.globalProduct.getPublishedList({
607
+ * global_item_id: 123456
608
+ * });
609
+ * ```
610
+ */
611
+ async getPublishedList(params) {
612
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_published_list", {
613
+ method: "GET",
614
+ auth: true,
615
+ params,
616
+ });
617
+ return response;
618
+ }
619
+ /**
620
+ * Get global item ID by shop item ID
621
+ *
622
+ * Use this API to get the global item ID from a shop item ID.
623
+ *
624
+ * @param params - Parameters for getting global item ID
625
+ * @param params.shop_id - Shop ID
626
+ * @param params.item_id - Item ID in the shop
627
+ *
628
+ * @returns Promise resolving to global item ID response
629
+ *
630
+ * @example
631
+ * ```typescript
632
+ * const globalId = await sdk.globalProduct.getGlobalItemId({
633
+ * shop_id: 67890,
634
+ * item_id: 123456
635
+ * });
636
+ * ```
637
+ */
638
+ async getGlobalItemId(params) {
639
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_global_item_id", {
640
+ method: "GET",
641
+ auth: true,
642
+ params,
643
+ });
644
+ return response;
645
+ }
646
+ /**
647
+ * Get recommended attributes
648
+ *
649
+ * Use this API to get recommended attributes for a global item.
650
+ *
651
+ * @param params - Parameters for getting recommended attributes
652
+ * @param params.global_item_id - Global item ID
653
+ *
654
+ * @returns Promise resolving to recommended attributes response
655
+ *
656
+ * @example
657
+ * ```typescript
658
+ * const attributes = await sdk.globalProduct.getRecommendAttribute({
659
+ * global_item_id: 123456
660
+ * });
661
+ * ```
662
+ */
663
+ async getRecommendAttribute(params) {
664
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_recommend_attribute", {
665
+ method: "GET",
666
+ auth: true,
667
+ params,
668
+ });
669
+ return response;
670
+ }
671
+ /**
672
+ * Search global attribute value list
673
+ *
674
+ * Use this API to search for attribute values.
675
+ *
676
+ * @param params - Parameters for searching attribute values
677
+ * @returns Promise resolving to search attribute value list response
678
+ *
679
+ * @example
680
+ * ```typescript
681
+ * const values = await sdk.globalProduct.searchGlobalAttributeValueList({
682
+ * category_id: 100182,
683
+ * attribute_id: 1000,
684
+ * keyword: "cotton"
685
+ * });
686
+ * ```
687
+ */
688
+ async searchGlobalAttributeValueList(params) {
689
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/search_global_attribute_value_list", {
690
+ method: "GET",
691
+ auth: true,
692
+ params,
693
+ });
694
+ return response;
695
+ }
696
+ /**
697
+ * Get variations
698
+ *
699
+ * Use this API to get variation information for a global item.
700
+ *
701
+ * @param params - Parameters for getting variations
702
+ * @param params.global_item_id - Global item ID
703
+ *
704
+ * @returns Promise resolving to variations response
705
+ *
706
+ * @example
707
+ * ```typescript
708
+ * const variations = await sdk.globalProduct.getVariations({
709
+ * global_item_id: 123456
710
+ * });
711
+ * ```
712
+ */
713
+ async getVariations(params) {
714
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_variations", {
715
+ method: "GET",
716
+ auth: true,
717
+ params,
718
+ });
719
+ return response;
720
+ }
721
+ /**
722
+ * Set sync field
723
+ *
724
+ * Use this API to set which fields should sync between global item and shop items.
725
+ *
726
+ * @param params - Parameters for setting sync field
727
+ * @returns Promise resolving to set sync field response
728
+ *
729
+ * @example
730
+ * ```typescript
731
+ * const result = await sdk.globalProduct.setSyncField({
732
+ * global_item_id: 123456,
733
+ * shop_list: [{
734
+ * shop_id: 67890,
735
+ * sync_field_list: ["name", "price", "stock"]
736
+ * }]
737
+ * });
738
+ * ```
739
+ */
740
+ async setSyncField(params) {
741
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/set_sync_field", {
742
+ method: "POST",
743
+ auth: true,
744
+ body: params,
745
+ });
746
+ return response;
747
+ }
748
+ /**
749
+ * Get local adjustment rate
750
+ *
751
+ * Use this API to get local price adjustment rates for shops.
752
+ *
753
+ * @param params - Parameters for getting local adjustment rate
754
+ * @returns Promise resolving to local adjustment rate response
755
+ *
756
+ * @example
757
+ * ```typescript
758
+ * const rates = await sdk.globalProduct.getLocalAdjustmentRate({
759
+ * global_item_id: 123456,
760
+ * shop_id_list: [67890, 67891]
761
+ * });
762
+ * ```
763
+ */
764
+ async getLocalAdjustmentRate(params) {
765
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_local_adjustment_rate", {
766
+ method: "GET",
767
+ auth: true,
768
+ params,
769
+ });
770
+ return response;
771
+ }
772
+ /**
773
+ * Update local adjustment rate
774
+ *
775
+ * Use this API to update local price adjustment rates for shops.
776
+ *
777
+ * @param params - Parameters for updating local adjustment rate
778
+ * @returns Promise resolving to update local adjustment rate response
779
+ *
780
+ * @example
781
+ * ```typescript
782
+ * const result = await sdk.globalProduct.updateLocalAdjustmentRate({
783
+ * global_item_id: 123456,
784
+ * adjustment_rate_list: [{
785
+ * shop_id: 67890,
786
+ * adjustment_rate: 10.5
787
+ * }]
788
+ * });
789
+ * ```
790
+ */
791
+ async updateLocalAdjustmentRate(params) {
792
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_local_adjustment_rate", {
793
+ method: "POST",
794
+ auth: true,
795
+ body: params,
796
+ });
797
+ return response;
798
+ }
799
+ /**
800
+ * Get size chart list
801
+ *
802
+ * Use this API to get list of size charts.
803
+ *
804
+ * @param params - Parameters for getting size chart list
805
+ * @returns Promise resolving to size chart list response
806
+ *
807
+ * @example
808
+ * ```typescript
809
+ * const sizeCharts = await sdk.globalProduct.getSizeChartList({
810
+ * page_size: 20
811
+ * });
812
+ * ```
813
+ */
814
+ async getSizeChartList(params) {
815
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_size_chart_list", {
816
+ method: "GET",
817
+ auth: true,
818
+ params,
819
+ });
820
+ return response;
821
+ }
822
+ /**
823
+ * Get size chart detail
824
+ *
825
+ * Use this API to get detailed information of a size chart.
826
+ *
827
+ * @param params - Parameters for getting size chart detail
828
+ * @param params.size_chart_id - Size chart ID
829
+ *
830
+ * @returns Promise resolving to size chart detail response
831
+ *
832
+ * @example
833
+ * ```typescript
834
+ * const sizeChart = await sdk.globalProduct.getSizeChartDetail({
835
+ * size_chart_id: "chart123"
836
+ * });
837
+ * ```
838
+ */
839
+ async getSizeChartDetail(params) {
840
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/get_size_chart_detail", {
841
+ method: "GET",
842
+ auth: true,
843
+ params,
844
+ });
845
+ return response;
846
+ }
847
+ /**
848
+ * Update size chart
849
+ *
850
+ * Use this API to update a size chart.
851
+ *
852
+ * @param params - Parameters for updating size chart
853
+ * @returns Promise resolving to update size chart response
854
+ *
855
+ * @example
856
+ * ```typescript
857
+ * const result = await sdk.globalProduct.updateSizeChart({
858
+ * size_chart_id: "chart123",
859
+ * size_chart_name: "Updated Size Chart",
860
+ * size_chart_table: {
861
+ * header: ["Size", "Chest", "Length"],
862
+ * rows: [
863
+ * ["S", "90cm", "60cm"],
864
+ * ["M", "95cm", "65cm"]
865
+ * ]
866
+ * }
867
+ * });
868
+ * ```
869
+ */
870
+ async updateSizeChart(params) {
871
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/update_size_chart", {
872
+ method: "POST",
873
+ auth: true,
874
+ body: params,
875
+ });
876
+ return response;
877
+ }
878
+ /**
879
+ * Check size chart support
880
+ *
881
+ * Use this API to check if a category supports size charts.
882
+ *
883
+ * @param params - Parameters for checking size chart support
884
+ * @param params.category_id - Category ID
885
+ *
886
+ * @returns Promise resolving to size chart support response
887
+ *
888
+ * @example
889
+ * ```typescript
890
+ * const support = await sdk.globalProduct.supportSizeChart({
891
+ * category_id: 100182
892
+ * });
893
+ * ```
894
+ */
895
+ async supportSizeChart(params) {
896
+ const response = await ShopeeFetch.fetch(this.config, "/global_product/support_size_chart", {
897
+ method: "GET",
898
+ auth: true,
899
+ params,
900
+ });
901
+ return response;
902
+ }
903
+ }
904
+ //# sourceMappingURL=global-product.manager.js.map