@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
@@ -112,4 +112,17 @@ export var TrackingLogisticsStatus;
112
112
  /** Failed to cancel order */
113
113
  TrackingLogisticsStatus["FAILED_CANCELED"] = "FAILED_CANCELED";
114
114
  })(TrackingLogisticsStatus || (TrackingLogisticsStatus = {}));
115
+ // ============================================
116
+ // Shipping Documents
117
+ // ============================================
118
+ /**
119
+ * Shipping document type enum
120
+ */
121
+ export var ShippingDocumentType;
122
+ (function (ShippingDocumentType) {
123
+ ShippingDocumentType["NORMAL_AIR_WAYBILL"] = "NORMAL_AIR_WAYBILL";
124
+ ShippingDocumentType["THERMAL_AIR_WAYBILL"] = "THERMAL_AIR_WAYBILL";
125
+ ShippingDocumentType["NORMAL_JOB_AIR_WAYBILL"] = "NORMAL_JOB_AIR_WAYBILL";
126
+ ShippingDocumentType["THERMAL_JOB_AIR_WAYBILL"] = "THERMAL_JOB_AIR_WAYBILL";
127
+ })(ShippingDocumentType || (ShippingDocumentType = {}));
115
128
  //# sourceMappingURL=logistics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logistics.js","sourceRoot":"","sources":["../../src/schemas/logistics.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,eA+BX;AA/BD,WAAY,eAAe;IACzB,sDAAsD;IACtD,8DAA2C,CAAA;IAC3C,8BAA8B;IAC9B,0EAAuD,CAAA;IACvD,+BAA+B;IAC/B,kEAA+C,CAAA;IAC/C,qCAAqC;IACrC,oEAAiD,CAAA;IACjD,qGAAqG;IACrG,sEAAmD,CAAA;IACnD,mCAAmC;IACnC,sEAAmD,CAAA;IACnD,iDAAiD;IACjD,0EAAuD,CAAA;IACvD,8DAA8D;IAC9D,4EAAyD,CAAA;IACzD,uDAAuD;IACvD,oEAAiD,CAAA;IACjD;;;;OAIG;IACH,sDAAmC,CAAA;IACnC,oDAAoD;IACpD,0DAAuC,CAAA;IACvC,gDAAgD;IAChD,oDAAiC,CAAA;IACjC,0CAA0C;IAC1C,0EAAuD,CAAA;AACzD,CAAC,EA/BW,eAAe,KAAf,eAAe,QA+B1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,uBAyEX;AAzED,WAAY,uBAAuB;IACjC,oBAAoB;IACpB,8CAAmB,CAAA;IACnB,2BAA2B;IAC3B,oDAAyB,CAAA;IACzB,+BAA+B;IAC/B,8DAAmC,CAAA;IACnC,+BAA+B;IAC/B,8DAAmC,CAAA;IACnC,6BAA6B;IAC7B,0DAA+B,CAAA;IAC/B,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,wBAAwB;IACxB,4DAAiC,CAAA;IACjC,iCAAiC;IACjC,kDAAuB,CAAA;IACvB,0BAA0B;IAC1B,gEAAqC,CAAA;IACrC,iCAAiC;IACjC,kDAAuB,CAAA;IACvB,2BAA2B;IAC3B,wDAA6B,CAAA;IAC7B,0BAA0B;IAC1B,8CAAmB,CAAA;IACnB,sBAAsB;IACtB,wCAAa,CAAA;IACb,oBAAoB;IACpB,4CAAiB,CAAA;IACjB,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,8BAA8B;IAC9B,4DAAiC,CAAA;IACjC,6BAA6B;IAC7B,4DAAiC,CAAA;IACjC,gCAAgC;IAChC,gDAAqB,CAAA;IACrB,wBAAwB;IACxB,4DAAiC,CAAA;IACjC,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,4BAA4B;IAC5B,8CAAmB,CAAA;IACnB,6BAA6B;IAC7B,4CAAiB,CAAA;IACjB,oCAAoC;IACpC,4DAAiC,CAAA;IACjC,8BAA8B;IAC9B,gDAAqB,CAAA;IACrB,iCAAiC;IACjC,kEAAuC,CAAA;IACvC,6BAA6B;IAC7B,4EAAiD,CAAA;IACjD,6BAA6B;IAC7B,wEAA6C,CAAA;IAC7C,+BAA+B;IAC/B,8EAAmD,CAAA;IACnD,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,8BAA8B;IAC9B,8EAAmD,CAAA;IACnD,8BAA8B;IAC9B,0EAA+C,CAAA;IAC/C,6BAA6B;IAC7B,0EAA+C,CAAA;IAC/C,+BAA+B;IAC/B,8DAAmC,CAAA;IACnC,oCAAoC;IACpC,0EAA+C,CAAA;IAC/C,6BAA6B;IAC7B,8DAAmC,CAAA;AACrC,CAAC,EAzEW,uBAAuB,KAAvB,uBAAuB,QAyElC"}
1
+ {"version":3,"file":"logistics.js","sourceRoot":"","sources":["../../src/schemas/logistics.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,eA+BX;AA/BD,WAAY,eAAe;IACzB,sDAAsD;IACtD,8DAA2C,CAAA;IAC3C,8BAA8B;IAC9B,0EAAuD,CAAA;IACvD,+BAA+B;IAC/B,kEAA+C,CAAA;IAC/C,qCAAqC;IACrC,oEAAiD,CAAA;IACjD,qGAAqG;IACrG,sEAAmD,CAAA;IACnD,mCAAmC;IACnC,sEAAmD,CAAA;IACnD,iDAAiD;IACjD,0EAAuD,CAAA;IACvD,8DAA8D;IAC9D,4EAAyD,CAAA;IACzD,uDAAuD;IACvD,oEAAiD,CAAA;IACjD;;;;OAIG;IACH,sDAAmC,CAAA;IACnC,oDAAoD;IACpD,0DAAuC,CAAA;IACvC,gDAAgD;IAChD,oDAAiC,CAAA;IACjC,0CAA0C;IAC1C,0EAAuD,CAAA;AACzD,CAAC,EA/BW,eAAe,KAAf,eAAe,QA+B1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,uBAyEX;AAzED,WAAY,uBAAuB;IACjC,oBAAoB;IACpB,8CAAmB,CAAA;IACnB,2BAA2B;IAC3B,oDAAyB,CAAA;IACzB,+BAA+B;IAC/B,8DAAmC,CAAA;IACnC,+BAA+B;IAC/B,8DAAmC,CAAA;IACnC,6BAA6B;IAC7B,0DAA+B,CAAA;IAC/B,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,wBAAwB;IACxB,4DAAiC,CAAA;IACjC,iCAAiC;IACjC,kDAAuB,CAAA;IACvB,0BAA0B;IAC1B,gEAAqC,CAAA;IACrC,iCAAiC;IACjC,kDAAuB,CAAA;IACvB,2BAA2B;IAC3B,wDAA6B,CAAA;IAC7B,0BAA0B;IAC1B,8CAAmB,CAAA;IACnB,sBAAsB;IACtB,wCAAa,CAAA;IACb,oBAAoB;IACpB,4CAAiB,CAAA;IACjB,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,8BAA8B;IAC9B,4DAAiC,CAAA;IACjC,6BAA6B;IAC7B,4DAAiC,CAAA;IACjC,gCAAgC;IAChC,gDAAqB,CAAA;IACrB,wBAAwB;IACxB,4DAAiC,CAAA;IACjC,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,4BAA4B;IAC5B,8CAAmB,CAAA;IACnB,6BAA6B;IAC7B,4CAAiB,CAAA;IACjB,oCAAoC;IACpC,4DAAiC,CAAA;IACjC,8BAA8B;IAC9B,gDAAqB,CAAA;IACrB,iCAAiC;IACjC,kEAAuC,CAAA;IACvC,6BAA6B;IAC7B,4EAAiD,CAAA;IACjD,6BAA6B;IAC7B,wEAA6C,CAAA;IAC7C,+BAA+B;IAC/B,8EAAmD,CAAA;IACnD,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,gCAAgC;IAChC,gEAAqC,CAAA;IACrC,8BAA8B;IAC9B,8EAAmD,CAAA;IACnD,8BAA8B;IAC9B,0EAA+C,CAAA;IAC/C,6BAA6B;IAC7B,0EAA+C,CAAA;IAC/C,+BAA+B;IAC/B,8DAAmC,CAAA;IACnC,oCAAoC;IACpC,0EAA+C,CAAA;IAC/C,6BAA6B;IAC7B,8DAAmC,CAAA;AACrC,CAAC,EAzEW,uBAAuB,KAAvB,uBAAuB,QAyElC;AAmqBD,+CAA+C;AAC/C,qBAAqB;AACrB,+CAA+C;AAE/C;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,iEAAyC,CAAA;IACzC,mEAA2C,CAAA;IAC3C,yEAAiD,CAAA;IACjD,2EAAmD,CAAA;AACrD,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B"}
@@ -0,0 +1,189 @@
1
+ import { BaseResponse } from "./base.js";
2
+ /**
3
+ * Parameters for uploading image to MediaSpace
4
+ */
5
+ export interface UploadImageParams {
6
+ /** The scene where the picture is used. Default is 'normal'
7
+ * - normal: Process the image as a square image (recommended for item images)
8
+ * - desc: Do not process the image (recommended for extend_description images)
9
+ */
10
+ scene?: "normal" | "desc";
11
+ /** Image aspect ratio. Only applicable to whitelisted sellers.
12
+ * Supported values: "1:1" (default), "3:4"
13
+ */
14
+ ratio?: "1:1" | "3:4";
15
+ /** Image files. Max 10.0 MB each. Image format accepted: JPG, JPEG, PNG.
16
+ * Image number should be less than 9.
17
+ * Note: This is handled as multipart/form-data in the actual request
18
+ */
19
+ image?: File | Blob | Buffer;
20
+ }
21
+ /**
22
+ * Image URL information by region
23
+ */
24
+ export interface ImageUrlRegion {
25
+ /** Region of image url */
26
+ image_url_region: string;
27
+ /** Image URL */
28
+ image_url: string;
29
+ }
30
+ /**
31
+ * Image information for MediaSpace
32
+ */
33
+ export interface MediaSpaceImageInfo {
34
+ /** Id of image */
35
+ image_id: string;
36
+ /** Image URL of each region */
37
+ image_url_list: ImageUrlRegion[];
38
+ }
39
+ /**
40
+ * Individual image info in the list
41
+ */
42
+ export interface ImageInfoListItem {
43
+ /** The index of images */
44
+ id: number;
45
+ /** Indicate error type if this index's image upload processing hit error */
46
+ error?: string;
47
+ /** Indicate error detail if this index's image upload processing hit error */
48
+ message?: string;
49
+ /** Image information */
50
+ image_info?: MediaSpaceImageInfo;
51
+ }
52
+ /**
53
+ * Response for uploading image to MediaSpace
54
+ */
55
+ export interface UploadImageResponse extends BaseResponse {
56
+ warning?: string;
57
+ response: {
58
+ /** Deprecated field - use image_info_list instead */
59
+ image_info?: MediaSpaceImageInfo;
60
+ /** List of uploaded images with their information */
61
+ image_info_list?: ImageInfoListItem[];
62
+ };
63
+ }
64
+ /**
65
+ * Parameters for initializing video upload
66
+ */
67
+ export interface InitVideoUploadParams {
68
+ /** MD5 of video file */
69
+ file_md5: string;
70
+ /** Size of video file, in bytes. Maximum is 30MB */
71
+ file_size: number;
72
+ }
73
+ /**
74
+ * Response for initializing video upload
75
+ */
76
+ export interface InitVideoUploadResponse extends BaseResponse {
77
+ response: {
78
+ /** The identifier of this upload session, used in following video upload requests and item creating/updating */
79
+ video_upload_id: string;
80
+ };
81
+ }
82
+ /**
83
+ * Parameters for uploading video part
84
+ */
85
+ export interface UploadVideoPartParams {
86
+ /** The video_upload_id from init_video_upload response */
87
+ video_upload_id: string;
88
+ /** Sequence of the current part, starts from 0 */
89
+ part_seq: number;
90
+ /** MD5 of this part */
91
+ content_md5: string;
92
+ /** The content of this part of file. Part size should be exactly 4MB, except last part of file.
93
+ * Note: This is handled as multipart/form-data in the actual request
94
+ */
95
+ part_content?: File | Blob | Buffer;
96
+ }
97
+ /**
98
+ * Response for uploading video part
99
+ */
100
+ export interface UploadVideoPartResponse extends BaseResponse {
101
+ warning?: string;
102
+ }
103
+ /**
104
+ * Report data for completing video upload
105
+ */
106
+ export interface ReportData {
107
+ /** Time used for uploading the video file via upload_video_part api, in milliseconds */
108
+ upload_cost: number;
109
+ }
110
+ /**
111
+ * Parameters for completing video upload
112
+ */
113
+ export interface CompleteVideoUploadParams {
114
+ /** The ID of this upload session, returned in init_video_upload */
115
+ video_upload_id: string;
116
+ /** All uploaded sequence numbers */
117
+ part_seq_list: number[];
118
+ /** Report data for tracking upload performance */
119
+ report_data: ReportData;
120
+ }
121
+ /**
122
+ * Response for completing video upload
123
+ */
124
+ export interface CompleteVideoUploadResponse extends BaseResponse {
125
+ warning?: string;
126
+ }
127
+ /**
128
+ * Parameters for canceling video upload
129
+ */
130
+ export interface CancelVideoUploadParams {
131
+ /** The ID of this upload session, returned in init_video_upload */
132
+ video_upload_id: string;
133
+ }
134
+ /**
135
+ * Response for canceling video upload
136
+ */
137
+ export interface CancelVideoUploadResponse extends BaseResponse {
138
+ warning?: string;
139
+ }
140
+ /**
141
+ * Video URL information by region
142
+ */
143
+ export interface VideoUrlRegion {
144
+ /** The region of this video URL */
145
+ video_url_region: string;
146
+ /** Video playback URL */
147
+ video_url: string;
148
+ }
149
+ /**
150
+ * Video information after successful transcoding
151
+ */
152
+ export interface MediaSpaceVideoInfo {
153
+ /** Video playback URL list */
154
+ video_url_list: VideoUrlRegion[];
155
+ /** Video thumbnail image URL list */
156
+ thumbnail_url_list: ImageUrlRegion[];
157
+ /** Duration of this video, in seconds */
158
+ duration: number;
159
+ }
160
+ /**
161
+ * Parameters for getting video upload result
162
+ */
163
+ export interface GetVideoUploadResultParams extends Record<string, string | number | boolean | undefined> {
164
+ /** The video_upload_id from init_video_upload response */
165
+ video_upload_id: string;
166
+ }
167
+ /**
168
+ * Video upload status
169
+ * - INITIATED: Waiting for part uploading and/or the complete_video_upload API call
170
+ * - TRANSCODING: Has received all video parts, and is transcoding the video file
171
+ * - SUCCEEDED: Transcoding completed, and this upload_id can now be used for item adding/updating
172
+ * - FAILED: This upload failed, see the message field for info
173
+ * - CANCELLED: This upload is cancelled
174
+ */
175
+ export type VideoUploadStatus = "INITIATED" | "TRANSCODING" | "SUCCEEDED" | "FAILED" | "CANCELLED";
176
+ /**
177
+ * Response for getting video upload result
178
+ */
179
+ export interface GetVideoUploadResultResponse extends BaseResponse {
180
+ warning?: string;
181
+ response: {
182
+ /** Current status of this video upload session */
183
+ status: VideoUploadStatus;
184
+ /** Transcoded video info, present if status is SUCCEEDED */
185
+ video_info?: MediaSpaceVideoInfo;
186
+ /** Detail error message if video uploading/transcoding failed */
187
+ message?: string;
188
+ };
189
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=media-space.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-space.js","sourceRoot":"","sources":["../../src/schemas/media-space.ts"],"names":[],"mappings":""}
@@ -0,0 +1,230 @@
1
+ import { BaseResponse } from "./base.js";
2
+ /**
3
+ * Business type for image upload
4
+ * 2 = Returns
5
+ */
6
+ export type MediaImageBusiness = 2;
7
+ /**
8
+ * Scene type for image upload
9
+ * If business = 2 (Returns):
10
+ * - 1 = Return Seller Self Arrange Pickup Proof Image
11
+ */
12
+ export type MediaImageScene = 1;
13
+ /**
14
+ * Uploaded image information
15
+ */
16
+ export interface MediaImageInfo {
17
+ /** Unique ID of the uploaded image */
18
+ image_id: string;
19
+ /** URL of the uploaded image */
20
+ image_url: string;
21
+ }
22
+ /**
23
+ * Parameters for v2.media.upload_image
24
+ */
25
+ export interface UploadMediaImageParams {
26
+ /** Defines the business type of the uploaded image */
27
+ business: MediaImageBusiness;
28
+ /** Defines the purpose of the uploaded image under the specified business type */
29
+ scene: MediaImageScene;
30
+ /** The image files to be uploaded (file path or buffer) */
31
+ images: string | Buffer | Array<string | Buffer>;
32
+ }
33
+ /**
34
+ * Response for v2.media.upload_image
35
+ */
36
+ export interface UploadMediaImageResponse extends BaseResponse {
37
+ response: {
38
+ /** List of uploaded images */
39
+ image_list: MediaImageInfo[];
40
+ };
41
+ }
42
+ /**
43
+ * Scene type for media_space image upload
44
+ * - "normal": Process image as square, recommended for item images
45
+ * - "desc": No processing, recommended for extended_description images
46
+ */
47
+ export type MediaSpaceImageScene = "normal" | "desc";
48
+ /**
49
+ * Image ratio for media_space upload
50
+ * - "1:1": Square image (default)
51
+ * - "3:4": Portrait image (whitelisted sellers only)
52
+ */
53
+ export type MediaSpaceImageRatio = "1:1" | "3:4";
54
+ /**
55
+ * Region-specific image URL information
56
+ */
57
+ export interface ImageUrlRegion {
58
+ /** Region of image url */
59
+ image_url_region: string;
60
+ /** Image URL */
61
+ image_url: string;
62
+ }
63
+ /**
64
+ * Image information with regional URLs
65
+ */
66
+ export interface MediaSpaceImageInfo {
67
+ /** Id of image */
68
+ image_id: string;
69
+ /** Image URL of each region */
70
+ image_url_list: ImageUrlRegion[];
71
+ }
72
+ /**
73
+ * Individual image upload information
74
+ */
75
+ export interface ImageInfoItem {
76
+ /** The index of images */
77
+ id: number;
78
+ /** Indicate error type if this index's image upload processing hit error */
79
+ error: string;
80
+ /** Indicate error detail if this index's image upload processing hit error */
81
+ message: string;
82
+ /** Image information for this upload */
83
+ image_info: MediaSpaceImageInfo;
84
+ }
85
+ /**
86
+ * Parameters for v2.media_space.upload_image
87
+ */
88
+ export interface UploadImageParams {
89
+ /** The image files to be uploaded (up to 9 images) */
90
+ image: string | Buffer | Array<string | Buffer>;
91
+ /** Scene where the picture is used */
92
+ scene?: MediaSpaceImageScene;
93
+ /** Image ratio (only for whitelisted sellers) */
94
+ ratio?: MediaSpaceImageRatio;
95
+ }
96
+ /**
97
+ * Response for v2.media_space.upload_image
98
+ */
99
+ export interface UploadImageResponse extends BaseResponse {
100
+ response: {
101
+ /** @deprecated Use image_info_list instead */
102
+ image_info?: MediaSpaceImageInfo;
103
+ /** List of uploaded images with individual results */
104
+ image_info_list: ImageInfoItem[];
105
+ };
106
+ }
107
+ /**
108
+ * Parameters for v2.media_space.init_video_upload
109
+ */
110
+ export interface InitVideoUploadParams {
111
+ /** MD5 of video file */
112
+ file_md5: string;
113
+ /** Size of video file in bytes (maximum 30MB) */
114
+ file_size: number;
115
+ }
116
+ /**
117
+ * Response for v2.media_space.init_video_upload
118
+ */
119
+ export interface InitVideoUploadResponse extends BaseResponse {
120
+ response: {
121
+ /** The identifier of this upload session */
122
+ video_upload_id: string;
123
+ };
124
+ }
125
+ /**
126
+ * Parameters for v2.media_space.upload_video_part
127
+ */
128
+ export interface UploadVideoPartParams {
129
+ /** The video_upload_id returned by init_video_upload */
130
+ video_upload_id: string;
131
+ /** Sequence of the current part, starts from 0 */
132
+ part_seq: number;
133
+ /** MD5 of this part */
134
+ content_md5: string;
135
+ /** The content of this part of file (exactly 4MB except last part) */
136
+ part_content: string | Buffer;
137
+ }
138
+ /**
139
+ * Response for v2.media_space.upload_video_part
140
+ */
141
+ export interface UploadVideoPartResponse extends BaseResponse {
142
+ }
143
+ /**
144
+ * Report data for video upload performance tracking
145
+ */
146
+ export interface VideoUploadReportData {
147
+ /** Time used for uploading the video file via upload_video_part api, in milliseconds */
148
+ upload_cost: number;
149
+ }
150
+ /**
151
+ * Parameters for v2.media_space.complete_video_upload
152
+ */
153
+ export interface CompleteVideoUploadParams {
154
+ /** The ID of this upload session, returned in init_video_upload */
155
+ video_upload_id: string;
156
+ /** All uploaded sequence numbers */
157
+ part_seq_list: number[];
158
+ /** Upload performance tracking data */
159
+ report_data: VideoUploadReportData;
160
+ }
161
+ /**
162
+ * Response for v2.media_space.complete_video_upload
163
+ */
164
+ export interface CompleteVideoUploadResponse extends BaseResponse {
165
+ }
166
+ /**
167
+ * Video upload status
168
+ */
169
+ export type VideoUploadStatus = "INITIATED" | "TRANSCODING" | "SUCCEEDED" | "FAILED" | "CANCELLED";
170
+ /**
171
+ * Region-specific video URL information
172
+ */
173
+ export interface VideoUrlRegion {
174
+ /** The region of this video URL */
175
+ video_url_region: string;
176
+ /** Video playback URL */
177
+ video_url: string;
178
+ }
179
+ /**
180
+ * Region-specific thumbnail URL information
181
+ */
182
+ export interface ThumbnailUrlRegion {
183
+ /** The region of this image URL */
184
+ image_url_region: string;
185
+ /** Image display URL */
186
+ image_url: string;
187
+ }
188
+ /**
189
+ * Transcoded video information
190
+ */
191
+ export interface MediaVideoInfo {
192
+ /** Video playback URL list */
193
+ video_url_list: VideoUrlRegion[];
194
+ /** Video thumbnail image URL list */
195
+ thumbnail_url_list: ThumbnailUrlRegion[];
196
+ /** Duration of this video in seconds */
197
+ duration: number;
198
+ }
199
+ /**
200
+ * Parameters for v2.media_space.get_video_upload_result
201
+ */
202
+ export interface GetVideoUploadResultParams extends Record<string, string | number | boolean | null | undefined> {
203
+ /** The video_upload_id returned by init_video_upload */
204
+ video_upload_id: string;
205
+ }
206
+ /**
207
+ * Response for v2.media_space.get_video_upload_result
208
+ */
209
+ export interface GetVideoUploadResultResponse extends BaseResponse {
210
+ response: {
211
+ /** Current status of this video upload session */
212
+ status: VideoUploadStatus;
213
+ /** Detail error message if video uploading/transcoding failed */
214
+ message?: string;
215
+ /** Transcoded video info, present if status is SUCCEEDED */
216
+ video_info?: MediaVideoInfo;
217
+ };
218
+ }
219
+ /**
220
+ * Parameters for v2.media_space.cancel_video_upload
221
+ */
222
+ export interface CancelVideoUploadParams {
223
+ /** The ID of this upload session, returned in init_video_upload */
224
+ video_upload_id: string;
225
+ }
226
+ /**
227
+ * Response for v2.media_space.cancel_video_upload
228
+ */
229
+ export interface CancelVideoUploadResponse extends BaseResponse {
230
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/schemas/media.ts"],"names":[],"mappings":""}
@@ -0,0 +1,236 @@
1
+ import { BaseResponse } from "./base.js";
2
+ import { SipAffiShop } from "./shop.js";
3
+ /**
4
+ * Cursor for pagination with double-sided navigation
5
+ */
6
+ export interface DoubleSidedCursor {
7
+ /** ID for fetching next page. Set to null or 0 for first page */
8
+ next_id?: number | null;
9
+ /** ID for fetching previous page */
10
+ prev_id?: number | null;
11
+ /** Number of items per page */
12
+ page_size: number;
13
+ }
14
+ /**
15
+ * Response wrapper for merchant endpoints
16
+ */
17
+ export type MerchantResponse<T> = BaseResponse & {
18
+ response?: T;
19
+ };
20
+ /**
21
+ * Parameters for getting merchant information
22
+ */
23
+ export type GetMerchantInfoParams = Record<string, never>;
24
+ /**
25
+ * Response from getting merchant information
26
+ */
27
+ export interface GetMerchantInfoResponse extends BaseResponse {
28
+ /** Name of the merchant */
29
+ merchant_name?: string;
30
+ /** Timestamp when the merchant was authorized to the partner */
31
+ auth_time?: number;
32
+ /** Expiration date for merchant authorization */
33
+ expire_time?: number;
34
+ /** Currency unit used for items in this merchant (e.g., CNY, USD, KRW) */
35
+ merchant_currency?: string;
36
+ /** Region of the merchant (KR, HK, CN, etc.) */
37
+ merchant_region?: string;
38
+ /** Whether this merchant is upgraded to CBSC */
39
+ is_upgraded_cbsc?: boolean;
40
+ /** Whether this is a CNSC merchant */
41
+ is_cnsc?: boolean;
42
+ }
43
+ /**
44
+ * Parameters for getting merchant prepaid account list
45
+ */
46
+ export interface GetMerchantPrepaidAccountListParams {
47
+ /** Page number, starting from 1 */
48
+ page_no: number;
49
+ /** Number of items per page, maximum 100 */
50
+ page_size: number;
51
+ }
52
+ /**
53
+ * Prepaid account information
54
+ */
55
+ export interface PrepaidAccount {
56
+ /** ID of the prepaid account */
57
+ prepaid_account_id: number;
58
+ /** Courier key identifier */
59
+ prepaid_account_courier_key: string;
60
+ /** Display name of the courier */
61
+ prepaid_account_courier_name: string;
62
+ /** Whether this is the default account */
63
+ prepaid_account_is_default: boolean;
64
+ /** Partner ID for the prepaid account */
65
+ prepaid_account_partner_id: string;
66
+ /** Partner code */
67
+ prepaid_account_partner_code?: string;
68
+ /** Partner key (may be masked) */
69
+ prepaid_account_partner_key?: string;
70
+ /** Partner secret (may be masked) */
71
+ prepaid_account_partner_secret?: string;
72
+ /** Partner name */
73
+ prepaid_account_partner_name?: string;
74
+ /** Partner network */
75
+ prepaid_account_partner_net?: string;
76
+ /** Check man information */
77
+ prepaid_account_check_man?: string;
78
+ }
79
+ /**
80
+ * Response from getting merchant prepaid account list
81
+ */
82
+ export type GetMerchantPrepaidAccountListResponse = MerchantResponse<{
83
+ /** List of prepaid accounts */
84
+ list: PrepaidAccount[];
85
+ /** Whether there are more pages */
86
+ more: boolean;
87
+ /** Total number of accounts */
88
+ total: number;
89
+ }>;
90
+ /**
91
+ * Parameters for getting merchant warehouse list
92
+ */
93
+ export interface GetMerchantWarehouseListParams {
94
+ /** Pagination cursor */
95
+ cursor: DoubleSidedCursor;
96
+ }
97
+ /**
98
+ * Address information
99
+ */
100
+ export interface Address {
101
+ /** Street address */
102
+ address: string;
103
+ /** Name associated with the address */
104
+ address_name: string;
105
+ /** City */
106
+ city: string;
107
+ /** District */
108
+ district?: string;
109
+ /** Region code */
110
+ region: string;
111
+ /** State/Province */
112
+ state: string;
113
+ /** Town */
114
+ town?: string;
115
+ /** Postal/ZIP code */
116
+ zip_code: string;
117
+ }
118
+ /**
119
+ * Enterprise information for warehouse
120
+ */
121
+ export interface EnterpriseInfo {
122
+ /** CNPJ number (Brazil) */
123
+ cnpj?: string;
124
+ /** Company name */
125
+ company_name?: string;
126
+ /** Whether the company is a freight payer */
127
+ is_freight_payer?: boolean;
128
+ /** State registration number */
129
+ state_registration_number?: string;
130
+ }
131
+ /**
132
+ * Warehouse information
133
+ */
134
+ export interface Warehouse {
135
+ /** Warehouse ID */
136
+ warehouse_id: number;
137
+ /** Name of the warehouse */
138
+ warehouse_name: string;
139
+ /** Region where warehouse is located */
140
+ warehouse_region: string;
141
+ /** Type of warehouse: 1 = pickup, 2 = return */
142
+ warehouse_type: number;
143
+ /** Location identifier */
144
+ location_id: string;
145
+ /** Address details */
146
+ address: Address;
147
+ /** Enterprise information (if applicable) */
148
+ enterprise_info?: EnterpriseInfo | null;
149
+ }
150
+ /**
151
+ * Response from getting merchant warehouse list
152
+ */
153
+ export type GetMerchantWarehouseListResponse = MerchantResponse<{
154
+ /** List of warehouses */
155
+ warehouse_list: Warehouse[];
156
+ /** Pagination cursor */
157
+ cursor: DoubleSidedCursor;
158
+ /** Total count of warehouses */
159
+ total_count: number;
160
+ }>;
161
+ /**
162
+ * Parameters for getting merchant warehouse location list
163
+ */
164
+ export type GetMerchantWarehouseLocationListParams = Record<string, never>;
165
+ /**
166
+ * Warehouse location information
167
+ */
168
+ export interface WarehouseLocation {
169
+ /** Location ID */
170
+ location_id: string;
171
+ /** Warehouse name */
172
+ warehouse_name: string;
173
+ }
174
+ /**
175
+ * Response from getting merchant warehouse location list
176
+ */
177
+ export type GetMerchantWarehouseLocationListResponse = MerchantResponse<WarehouseLocation[]>;
178
+ /**
179
+ * Parameters for getting shop list by merchant
180
+ */
181
+ export interface GetShopListByMerchantParams {
182
+ /** Page number, starting from 1 */
183
+ page_no: number;
184
+ /** Number of items per page, maximum 500 */
185
+ page_size: number;
186
+ [key: string]: string | number | boolean | undefined;
187
+ }
188
+ /**
189
+ * Shop information
190
+ */
191
+ export interface MerchantShop {
192
+ /** Shopee's unique identifier for a shop */
193
+ shop_id: number;
194
+ /** List of SIP affiliate shops (only for primary shop) */
195
+ sip_affi_shops?: SipAffiShop[];
196
+ }
197
+ /**
198
+ * Response from getting shop list by merchant
199
+ */
200
+ export interface GetShopListByMerchantResponse extends BaseResponse {
201
+ /** List of shops authorized to the partner and bound to the merchant */
202
+ shop_list: MerchantShop[];
203
+ /** Whether there are more pages */
204
+ more: boolean;
205
+ /** Whether this is a CNSC merchant */
206
+ is_cnsc?: boolean;
207
+ }
208
+ /**
209
+ * Parameters for getting warehouse eligible shop list
210
+ */
211
+ export interface GetWarehouseEligibleShopListParams {
212
+ /** Warehouse address identifier */
213
+ warehouse_id: number;
214
+ /** 1 = pickup warehouse, 2 = return warehouse */
215
+ warehouse_type: number;
216
+ /** Pagination cursor */
217
+ cursor: DoubleSidedCursor;
218
+ }
219
+ /**
220
+ * Eligible shop information
221
+ */
222
+ export interface EligibleShop {
223
+ /** Shopee's unique identifier for a shop */
224
+ shop_id: number;
225
+ /** Name of the shop */
226
+ shop_name: string;
227
+ }
228
+ /**
229
+ * Response from getting warehouse eligible shop list
230
+ */
231
+ export type GetWarehouseEligibleShopListResponse = MerchantResponse<{
232
+ /** List of eligible shops */
233
+ shop_list: EligibleShop[];
234
+ /** Pagination cursor */
235
+ cursor: DoubleSidedCursor;
236
+ }>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=merchant.js.map