@congminh1254/shopee-sdk 0.10.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +172 -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/returns.manager.d.ts +200 -0
  53. package/lib/managers/returns.manager.js +300 -0
  54. package/lib/managers/returns.manager.js.map +1 -0
  55. package/lib/managers/sbs.manager.d.ts +112 -0
  56. package/lib/managers/sbs.manager.js +149 -0
  57. package/lib/managers/sbs.manager.js.map +1 -0
  58. package/lib/managers/shop-category.manager.d.ts +207 -0
  59. package/lib/managers/shop-category.manager.js +258 -0
  60. package/lib/managers/shop-category.manager.js.map +1 -0
  61. package/lib/managers/shop-flash-sale.manager.d.ts +242 -0
  62. package/lib/managers/shop-flash-sale.manager.js +321 -0
  63. package/lib/managers/shop-flash-sale.manager.js.map +1 -0
  64. package/lib/managers/shop.manager.d.ts +173 -0
  65. package/lib/managers/shop.manager.js +217 -0
  66. package/lib/managers/shop.manager.js.map +1 -0
  67. package/lib/managers/top-picks.manager.d.ts +62 -0
  68. package/lib/managers/top-picks.manager.js +91 -0
  69. package/lib/managers/top-picks.manager.js.map +1 -0
  70. package/lib/schemas/add-on-deal.d.ts +390 -0
  71. package/lib/schemas/add-on-deal.js +45 -0
  72. package/lib/schemas/add-on-deal.js.map +1 -0
  73. package/lib/schemas/ads.d.ts +437 -0
  74. package/lib/schemas/bundle-deal.d.ts +300 -0
  75. package/lib/schemas/bundle-deal.js +27 -0
  76. package/lib/schemas/bundle-deal.js.map +1 -0
  77. package/lib/schemas/discount.d.ts +334 -0
  78. package/lib/schemas/discount.js +15 -0
  79. package/lib/schemas/discount.js.map +1 -0
  80. package/lib/schemas/fbs.d.ts +117 -0
  81. package/lib/schemas/fbs.js +2 -0
  82. package/lib/schemas/fbs.js.map +1 -0
  83. package/lib/schemas/first-mile.d.ts +551 -0
  84. package/lib/schemas/first-mile.js +2 -0
  85. package/lib/schemas/first-mile.js.map +1 -0
  86. package/lib/schemas/follow-prize.d.ts +198 -0
  87. package/lib/schemas/follow-prize.js +27 -0
  88. package/lib/schemas/follow-prize.js.map +1 -0
  89. package/lib/schemas/global-product.d.ts +1127 -0
  90. package/lib/schemas/global-product.js +2 -0
  91. package/lib/schemas/global-product.js.map +1 -0
  92. package/lib/schemas/index.d.ts +13 -0
  93. package/lib/schemas/index.js +17 -0
  94. package/lib/schemas/index.js.map +1 -1
  95. package/lib/schemas/livestream.d.ts +649 -0
  96. package/lib/schemas/livestream.js +2 -0
  97. package/lib/schemas/livestream.js.map +1 -0
  98. package/lib/schemas/logistics.d.ts +979 -0
  99. package/lib/schemas/logistics.js +13 -0
  100. package/lib/schemas/logistics.js.map +1 -1
  101. package/lib/schemas/media-space.d.ts +189 -0
  102. package/lib/schemas/media-space.js +2 -0
  103. package/lib/schemas/media-space.js.map +1 -0
  104. package/lib/schemas/media.d.ts +230 -0
  105. package/lib/schemas/media.js +2 -0
  106. package/lib/schemas/media.js.map +1 -0
  107. package/lib/schemas/merchant.d.ts +236 -0
  108. package/lib/schemas/merchant.js +2 -0
  109. package/lib/schemas/merchant.js.map +1 -0
  110. package/lib/schemas/order.d.ts +431 -0
  111. package/lib/schemas/payment.d.ts +397 -0
  112. package/lib/schemas/returns.d.ts +632 -0
  113. package/lib/schemas/returns.js +63 -0
  114. package/lib/schemas/returns.js.map +1 -0
  115. package/lib/schemas/sbs.d.ts +484 -0
  116. package/lib/schemas/sbs.js +2 -0
  117. package/lib/schemas/sbs.js.map +1 -0
  118. package/lib/schemas/shop-category.d.ts +176 -0
  119. package/lib/schemas/shop-category.js +2 -0
  120. package/lib/schemas/shop-category.js.map +1 -0
  121. package/lib/schemas/shop-flash-sale.d.ts +473 -0
  122. package/lib/schemas/shop-flash-sale.js +43 -0
  123. package/lib/schemas/shop-flash-sale.js.map +1 -0
  124. package/lib/schemas/shop.d.ts +250 -0
  125. package/lib/schemas/shop.js +2 -0
  126. package/lib/schemas/shop.js.map +1 -0
  127. package/lib/schemas/top-picks.d.ts +99 -0
  128. package/lib/schemas/top-picks.js +2 -0
  129. package/lib/schemas/top-picks.js.map +1 -0
  130. package/lib/sdk.d.ts +34 -0
  131. package/lib/sdk.js +34 -0
  132. package/lib/sdk.js.map +1 -1
  133. package/package.json +2 -4
@@ -0,0 +1,173 @@
1
+ import { BaseManager } from "./base.manager.js";
2
+ import { ShopeeConfig } from "../sdk.js";
3
+ import { GetProfileParams, GetProfileResponse, GetShopInfoParams, GetShopInfoResponse, UpdateProfileParams, UpdateProfileResponse, GetWarehouseDetailParams, GetWarehouseDetailResponse, GetShopNotificationParams, GetShopNotificationResponse, GetAuthorisedResellerBrandParams, GetAuthorisedResellerBrandResponse } from "../schemas/shop.js";
4
+ export declare class ShopManager extends BaseManager {
5
+ constructor(config: ShopeeConfig);
6
+ /**
7
+ * Get shop profile
8
+ *
9
+ * This API support to get information of shop.
10
+ *
11
+ * @returns A promise that resolves to the profile response containing:
12
+ * - shop_logo: The Image URL of the shop logo
13
+ * - description: The content of the shop description
14
+ * - shop_name: The content of the shop name
15
+ * - invoice_issuer: The invoice issuer information for BR CNPJ seller only
16
+ *
17
+ * @throws {Error} When the API request fails or returns an error
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const profile = await sdk.shop.getProfile();
22
+ * console.log('Shop name:', profile.response.shop_name);
23
+ * console.log('Shop logo:', profile.response.shop_logo);
24
+ * ```
25
+ */
26
+ getProfile(params?: GetProfileParams): Promise<GetProfileResponse>;
27
+ /**
28
+ * Get shop information
29
+ *
30
+ * Use this call to get information of shop
31
+ *
32
+ * @returns A promise that resolves to the shop info response containing:
33
+ * - shop_name: Name of the shop
34
+ * - region: Shop's area
35
+ * - status: Shop status (BANNED, FROZEN, NORMAL)
36
+ * - is_cb: Whether the shop is a cross-border shop
37
+ * - auth_time: Timestamp when shop was authorized
38
+ * - expire_time: Expiration date for shop authorization
39
+ * - is_sip: Whether it's a SIP primary/affiliate shop
40
+ * - Additional fields for merchant info, fulfillment type, etc.
41
+ *
42
+ * @throws {Error} When the API request fails or returns an error
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const shopInfo = await sdk.shop.getShopInfo();
47
+ * console.log('Shop name:', shopInfo.shop_name);
48
+ * console.log('Region:', shopInfo.region);
49
+ * console.log('Status:', shopInfo.status);
50
+ * ```
51
+ */
52
+ getShopInfo(params?: GetShopInfoParams): Promise<GetShopInfoResponse>;
53
+ /**
54
+ * Update shop profile
55
+ *
56
+ * This API support to let sellers to update the shop name, shop logo, and shop description.
57
+ *
58
+ * @param params - The parameters for updating profile
59
+ * @param params.shop_name - The new shop name
60
+ * @param params.shop_logo - The new shop logo url
61
+ * @param params.description - The new shop description
62
+ *
63
+ * @returns A promise that resolves to the updated profile response
64
+ *
65
+ * @throws {Error} When the API request fails or returns an error:
66
+ * - error_data_check: Failed to change shop name (changed within 30 days, invalid length, etc.)
67
+ * - error_data_check: Failed to change shop logo (invalid URL, wrong format, etc.)
68
+ * - error_data_check: Failed to change description (exceeds 500 characters, etc.)
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const result = await sdk.shop.updateProfile({
73
+ * shop_name: 'New Shop Name',
74
+ * description: 'Welcome to our shop. Quality products at great prices!'
75
+ * });
76
+ * console.log('Updated shop:', result.response.shop_name);
77
+ * ```
78
+ */
79
+ updateProfile(params: UpdateProfileParams): Promise<UpdateProfileResponse>;
80
+ /**
81
+ * Get warehouse detail
82
+ *
83
+ * For given shop id and region, return warehouse info including warehouse id, address id and location id
84
+ *
85
+ * @param params - The parameters for getting warehouse detail
86
+ * @param params.warehouse_type - Type of warehouse (1: Pickup Warehouse, 2: Return Warehouse). Default is 1
87
+ *
88
+ * @returns A promise that resolves to the warehouse detail response containing:
89
+ * - warehouse_id: Warehouse address identifier
90
+ * - warehouse_name: The warehouse name
91
+ * - warehouse_type: Type of warehouse
92
+ * - location_id: Location identifier for stocks
93
+ * - address_id: Identity of address
94
+ * - region, state, city, address: Location details
95
+ * - zipcode, district, town, state_code: Additional location info
96
+ * - holiday_mode_state: Holiday mode status
97
+ *
98
+ * @throws {Error} When the API request fails or returns an error:
99
+ * - warehouse.error_can_not_find_warehouse: No legal warehouse address for given shop id
100
+ * - warehouse.error_not_in_whitelist: Shop has no permission to access multi-warehouse
101
+ * - warehouse.error_region_can_not_blank: Region is missing
102
+ * - warehouse.error_region_not_valid: Region is not valid
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * const warehouses = await sdk.shop.getWarehouseDetail({
107
+ * warehouse_type: 1 // Pickup warehouse
108
+ * });
109
+ * warehouses.response.forEach(wh => {
110
+ * console.log('Warehouse:', wh.warehouse_name);
111
+ * console.log('Location ID:', wh.location_id);
112
+ * });
113
+ * ```
114
+ */
115
+ getWarehouseDetail(params?: GetWarehouseDetailParams): Promise<GetWarehouseDetailResponse>;
116
+ /**
117
+ * Get shop notification
118
+ *
119
+ * Get Seller Center notification, the permission is controlled by App type
120
+ *
121
+ * @param params - The parameters for getting shop notification
122
+ * @param params.cursor - The last notification_id returned on the page. When using the cursor, notifications will start with the one following this cursor notification. If no cursor is provided, the latest message from the shop will be returned.
123
+ * @param params.page_size - Default 10; maximum 50
124
+ *
125
+ * @returns A promise that resolves to the notification response containing:
126
+ * - cursor: Last notification_id returned in the page
127
+ * - data: Notification data with create_time, content, title, and url
128
+ *
129
+ * @throws {Error} When the API request fails or returns an error
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * const notifications = await sdk.shop.getShopNotification({
134
+ * page_size: 10
135
+ * });
136
+ * console.log('Title:', notifications.data.title);
137
+ * console.log('Content:', notifications.data.content);
138
+ * console.log('Cursor:', notifications.cursor);
139
+ * ```
140
+ */
141
+ getShopNotification(params?: GetShopNotificationParams): Promise<GetShopNotificationResponse>;
142
+ /**
143
+ * Get authorised reseller brand
144
+ *
145
+ * Get the authorised reseller brand list for the shop.
146
+ *
147
+ * @param params - The parameters for getting authorised reseller brand
148
+ * @param params.page_no - Specifies the page number of data to return (starting from 1)
149
+ * @param params.page_size - Maximum number of entries per page (between 1 and 30)
150
+ *
151
+ * @returns A promise that resolves to the authorised reseller brand response containing:
152
+ * - is_authorised_reseller: Whether the shop is authorised reseller
153
+ * - total_count: Number of authorised brands linked with the shop
154
+ * - more: Whether there are more pages
155
+ * - authorised_brand_list: List of authorised brands with brand_id and brand_name
156
+ *
157
+ * @throws {Error} When the API request fails or returns an error
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * const brands = await sdk.shop.getAuthorisedResellerBrand({
162
+ * page_no: 1,
163
+ * page_size: 10
164
+ * });
165
+ * console.log('Is authorised reseller:', brands.response.is_authorised_reseller);
166
+ * console.log('Total brands:', brands.response.total_count);
167
+ * brands.response.authorised_brand_list.forEach(brand => {
168
+ * console.log('Brand:', brand.brand_name);
169
+ * });
170
+ * ```
171
+ */
172
+ getAuthorisedResellerBrand(params: GetAuthorisedResellerBrandParams): Promise<GetAuthorisedResellerBrandResponse>;
173
+ }
@@ -0,0 +1,217 @@
1
+ import { BaseManager } from "./base.manager.js";
2
+ import { ShopeeFetch } from "../fetch.js";
3
+ export class ShopManager extends BaseManager {
4
+ constructor(config) {
5
+ super(config);
6
+ }
7
+ /**
8
+ * Get shop profile
9
+ *
10
+ * This API support to get information of shop.
11
+ *
12
+ * @returns A promise that resolves to the profile response containing:
13
+ * - shop_logo: The Image URL of the shop logo
14
+ * - description: The content of the shop description
15
+ * - shop_name: The content of the shop name
16
+ * - invoice_issuer: The invoice issuer information for BR CNPJ seller only
17
+ *
18
+ * @throws {Error} When the API request fails or returns an error
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const profile = await sdk.shop.getProfile();
23
+ * console.log('Shop name:', profile.response.shop_name);
24
+ * console.log('Shop logo:', profile.response.shop_logo);
25
+ * ```
26
+ */
27
+ async getProfile(params) {
28
+ const response = await ShopeeFetch.fetch(this.config, "/shop/get_profile", {
29
+ method: "GET",
30
+ auth: true,
31
+ params: params || {},
32
+ });
33
+ return response;
34
+ }
35
+ /**
36
+ * Get shop information
37
+ *
38
+ * Use this call to get information of shop
39
+ *
40
+ * @returns A promise that resolves to the shop info response containing:
41
+ * - shop_name: Name of the shop
42
+ * - region: Shop's area
43
+ * - status: Shop status (BANNED, FROZEN, NORMAL)
44
+ * - is_cb: Whether the shop is a cross-border shop
45
+ * - auth_time: Timestamp when shop was authorized
46
+ * - expire_time: Expiration date for shop authorization
47
+ * - is_sip: Whether it's a SIP primary/affiliate shop
48
+ * - Additional fields for merchant info, fulfillment type, etc.
49
+ *
50
+ * @throws {Error} When the API request fails or returns an error
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * const shopInfo = await sdk.shop.getShopInfo();
55
+ * console.log('Shop name:', shopInfo.shop_name);
56
+ * console.log('Region:', shopInfo.region);
57
+ * console.log('Status:', shopInfo.status);
58
+ * ```
59
+ */
60
+ async getShopInfo(params) {
61
+ const response = await ShopeeFetch.fetch(this.config, "/shop/get_shop_info", {
62
+ method: "GET",
63
+ auth: true,
64
+ params: params || {},
65
+ });
66
+ return response;
67
+ }
68
+ /**
69
+ * Update shop profile
70
+ *
71
+ * This API support to let sellers to update the shop name, shop logo, and shop description.
72
+ *
73
+ * @param params - The parameters for updating profile
74
+ * @param params.shop_name - The new shop name
75
+ * @param params.shop_logo - The new shop logo url
76
+ * @param params.description - The new shop description
77
+ *
78
+ * @returns A promise that resolves to the updated profile response
79
+ *
80
+ * @throws {Error} When the API request fails or returns an error:
81
+ * - error_data_check: Failed to change shop name (changed within 30 days, invalid length, etc.)
82
+ * - error_data_check: Failed to change shop logo (invalid URL, wrong format, etc.)
83
+ * - error_data_check: Failed to change description (exceeds 500 characters, etc.)
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * const result = await sdk.shop.updateProfile({
88
+ * shop_name: 'New Shop Name',
89
+ * description: 'Welcome to our shop. Quality products at great prices!'
90
+ * });
91
+ * console.log('Updated shop:', result.response.shop_name);
92
+ * ```
93
+ */
94
+ async updateProfile(params) {
95
+ const response = await ShopeeFetch.fetch(this.config, "/shop/update_profile", {
96
+ method: "POST",
97
+ auth: true,
98
+ body: params,
99
+ });
100
+ return response;
101
+ }
102
+ /**
103
+ * Get warehouse detail
104
+ *
105
+ * For given shop id and region, return warehouse info including warehouse id, address id and location id
106
+ *
107
+ * @param params - The parameters for getting warehouse detail
108
+ * @param params.warehouse_type - Type of warehouse (1: Pickup Warehouse, 2: Return Warehouse). Default is 1
109
+ *
110
+ * @returns A promise that resolves to the warehouse detail response containing:
111
+ * - warehouse_id: Warehouse address identifier
112
+ * - warehouse_name: The warehouse name
113
+ * - warehouse_type: Type of warehouse
114
+ * - location_id: Location identifier for stocks
115
+ * - address_id: Identity of address
116
+ * - region, state, city, address: Location details
117
+ * - zipcode, district, town, state_code: Additional location info
118
+ * - holiday_mode_state: Holiday mode status
119
+ *
120
+ * @throws {Error} When the API request fails or returns an error:
121
+ * - warehouse.error_can_not_find_warehouse: No legal warehouse address for given shop id
122
+ * - warehouse.error_not_in_whitelist: Shop has no permission to access multi-warehouse
123
+ * - warehouse.error_region_can_not_blank: Region is missing
124
+ * - warehouse.error_region_not_valid: Region is not valid
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const warehouses = await sdk.shop.getWarehouseDetail({
129
+ * warehouse_type: 1 // Pickup warehouse
130
+ * });
131
+ * warehouses.response.forEach(wh => {
132
+ * console.log('Warehouse:', wh.warehouse_name);
133
+ * console.log('Location ID:', wh.location_id);
134
+ * });
135
+ * ```
136
+ */
137
+ async getWarehouseDetail(params) {
138
+ const response = await ShopeeFetch.fetch(this.config, "/shop/get_warehouse_detail", {
139
+ method: "GET",
140
+ auth: true,
141
+ params: params || {},
142
+ });
143
+ return response;
144
+ }
145
+ /**
146
+ * Get shop notification
147
+ *
148
+ * Get Seller Center notification, the permission is controlled by App type
149
+ *
150
+ * @param params - The parameters for getting shop notification
151
+ * @param params.cursor - The last notification_id returned on the page. When using the cursor, notifications will start with the one following this cursor notification. If no cursor is provided, the latest message from the shop will be returned.
152
+ * @param params.page_size - Default 10; maximum 50
153
+ *
154
+ * @returns A promise that resolves to the notification response containing:
155
+ * - cursor: Last notification_id returned in the page
156
+ * - data: Notification data with create_time, content, title, and url
157
+ *
158
+ * @throws {Error} When the API request fails or returns an error
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const notifications = await sdk.shop.getShopNotification({
163
+ * page_size: 10
164
+ * });
165
+ * console.log('Title:', notifications.data.title);
166
+ * console.log('Content:', notifications.data.content);
167
+ * console.log('Cursor:', notifications.cursor);
168
+ * ```
169
+ */
170
+ async getShopNotification(params) {
171
+ const response = await ShopeeFetch.fetch(this.config, "/shop/get_shop_notification", {
172
+ method: "GET",
173
+ auth: true,
174
+ params: params || {},
175
+ });
176
+ return response;
177
+ }
178
+ /**
179
+ * Get authorised reseller brand
180
+ *
181
+ * Get the authorised reseller brand list for the shop.
182
+ *
183
+ * @param params - The parameters for getting authorised reseller brand
184
+ * @param params.page_no - Specifies the page number of data to return (starting from 1)
185
+ * @param params.page_size - Maximum number of entries per page (between 1 and 30)
186
+ *
187
+ * @returns A promise that resolves to the authorised reseller brand response containing:
188
+ * - is_authorised_reseller: Whether the shop is authorised reseller
189
+ * - total_count: Number of authorised brands linked with the shop
190
+ * - more: Whether there are more pages
191
+ * - authorised_brand_list: List of authorised brands with brand_id and brand_name
192
+ *
193
+ * @throws {Error} When the API request fails or returns an error
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const brands = await sdk.shop.getAuthorisedResellerBrand({
198
+ * page_no: 1,
199
+ * page_size: 10
200
+ * });
201
+ * console.log('Is authorised reseller:', brands.response.is_authorised_reseller);
202
+ * console.log('Total brands:', brands.response.total_count);
203
+ * brands.response.authorised_brand_list.forEach(brand => {
204
+ * console.log('Brand:', brand.brand_name);
205
+ * });
206
+ * ```
207
+ */
208
+ async getAuthorisedResellerBrand(params) {
209
+ const response = await ShopeeFetch.fetch(this.config, "/shop/get_authorised_reseller_brand", {
210
+ method: "GET",
211
+ auth: true,
212
+ params,
213
+ });
214
+ return response;
215
+ }
216
+ }
217
+ //# sourceMappingURL=shop.manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop.manager.js","sourceRoot":"","sources":["../../src/managers/shop.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB1C,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,UAAU,CAAC,MAAyB;QACxC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CAAqB,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE;YAC7F,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM,IAAI,EAAE;SACrB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,WAAW,CAAC,MAA0B;QAC1C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,qBAAqB,EACrB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM,IAAI,EAAE;SACrB,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,aAAa,CAAC,MAA2B;QAC7C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,KAAK,CAAC,kBAAkB,CAAC,MAAiC;QACxD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,4BAA4B,EAC5B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM,IAAI,EAAE;SACrB,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,mBAAmB,CACvB,MAAkC;QAElC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,6BAA6B,EAC7B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM,IAAI,EAAE;SACrB,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,KAAK,CAAC,0BAA0B,CAC9B,MAAwC;QAExC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,qCAAqC,EACrC;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,62 @@
1
+ import { ShopeeConfig } from "../sdk.js";
2
+ import { BaseManager } from "./base.manager.js";
3
+ import { AddTopPicksParams, AddTopPicksResponse, DeleteTopPicksParams, DeleteTopPicksResponse, GetTopPicksListResponse, UpdateTopPicksParams, UpdateTopPicksResponse } from "../schemas/top-picks.js";
4
+ export declare class TopPicksManager extends BaseManager {
5
+ constructor(config: ShopeeConfig);
6
+ /**
7
+ * Add a new top picks collection
8
+ * @param {AddTopPicksParams} params - Parameters for creating a new top picks collection
9
+ * @returns {Promise<AddTopPicksResponse>} The response containing the created collection list
10
+ *
11
+ * Top picks are featured product collections that can be displayed on your shop page.
12
+ * Only one collection can be activated at a time. When you activate a new collection,
13
+ * all other collections will be automatically deactivated.
14
+ *
15
+ * @throws {Error} When the API request fails or returns an error
16
+ * - top_pick.top_pick_name_duplication: The Top-picks name already exists
17
+ * - top_pick.top_pick_item_id_not_exist: Item does not belong to shop
18
+ * - top_pick.exceed_max_top_pick_count: The created top picks can not more than limit
19
+ */
20
+ addTopPicks(params: AddTopPicksParams): Promise<AddTopPicksResponse>;
21
+ /**
22
+ * Delete an existing top picks collection
23
+ * @param {DeleteTopPicksParams} params - Parameters for deleting a top picks collection
24
+ * @returns {Promise<DeleteTopPicksResponse>} The response containing the deleted collection ID
25
+ *
26
+ * Note: Only disabled/deactivated top picks collections can be deleted.
27
+ * You cannot delete an activated collection.
28
+ *
29
+ * @throws {Error} When the API request fails or returns an error
30
+ * - top_pick.top_pick_delete_status_error: The enabled top-picks can not be deleted
31
+ * - common.error_not_found: The collection does not exist
32
+ */
33
+ deleteTopPicks(params: DeleteTopPicksParams): Promise<DeleteTopPicksResponse>;
34
+ /**
35
+ * Get all top picks collections for the shop
36
+ * @returns {Promise<GetTopPicksListResponse>} The response containing all top picks collections
37
+ *
38
+ * This endpoint retrieves all top picks collections in your shop, including both
39
+ * activated and deactivated collections. Each collection contains:
40
+ * - top_picks_id: The unique identifier
41
+ * - name: The collection name
42
+ * - is_activated: Activation status
43
+ * - item_list: Array of items with details (name, id, price, sales)
44
+ */
45
+ getTopPicksList(): Promise<GetTopPicksListResponse>;
46
+ /**
47
+ * Update an existing top picks collection
48
+ * @param {UpdateTopPicksParams} params - Parameters for updating a top picks collection
49
+ * @returns {Promise<UpdateTopPicksResponse>} The response containing the updated collection list
50
+ *
51
+ * You can update the name, items, and activation status of a collection.
52
+ * When updating item_id_list, it will completely replace the old item list.
53
+ * If you set is_activated to true, all other collections will be automatically deactivated.
54
+ *
55
+ * @throws {Error} When the API request fails or returns an error
56
+ * - top_pick.top_pick_name_duplication: The Top-picks name already exists
57
+ * - top_pick.top_pick_item_id_not_exist: Item does not belong to shop
58
+ * - top_pick.top_pick_item_id_duplication: The top-picks has duplicative item
59
+ * - common.error_not_found: The collection does not exist
60
+ */
61
+ updateTopPicks(params: UpdateTopPicksParams): Promise<UpdateTopPicksResponse>;
62
+ }
@@ -0,0 +1,91 @@
1
+ import { BaseManager } from "./base.manager.js";
2
+ import { ShopeeFetch } from "../fetch.js";
3
+ export class TopPicksManager extends BaseManager {
4
+ constructor(config) {
5
+ super(config);
6
+ }
7
+ /**
8
+ * Add a new top picks collection
9
+ * @param {AddTopPicksParams} params - Parameters for creating a new top picks collection
10
+ * @returns {Promise<AddTopPicksResponse>} The response containing the created collection list
11
+ *
12
+ * Top picks are featured product collections that can be displayed on your shop page.
13
+ * Only one collection can be activated at a time. When you activate a new collection,
14
+ * all other collections will be automatically deactivated.
15
+ *
16
+ * @throws {Error} When the API request fails or returns an error
17
+ * - top_pick.top_pick_name_duplication: The Top-picks name already exists
18
+ * - top_pick.top_pick_item_id_not_exist: Item does not belong to shop
19
+ * - top_pick.exceed_max_top_pick_count: The created top picks can not more than limit
20
+ */
21
+ async addTopPicks(params) {
22
+ const response = await ShopeeFetch.fetch(this.config, "/top_picks/add_top_picks", {
23
+ method: "POST",
24
+ auth: true,
25
+ body: params,
26
+ });
27
+ return response;
28
+ }
29
+ /**
30
+ * Delete an existing top picks collection
31
+ * @param {DeleteTopPicksParams} params - Parameters for deleting a top picks collection
32
+ * @returns {Promise<DeleteTopPicksResponse>} The response containing the deleted collection ID
33
+ *
34
+ * Note: Only disabled/deactivated top picks collections can be deleted.
35
+ * You cannot delete an activated collection.
36
+ *
37
+ * @throws {Error} When the API request fails or returns an error
38
+ * - top_pick.top_pick_delete_status_error: The enabled top-picks can not be deleted
39
+ * - common.error_not_found: The collection does not exist
40
+ */
41
+ async deleteTopPicks(params) {
42
+ const response = await ShopeeFetch.fetch(this.config, "/top_picks/delete_top_picks", {
43
+ method: "POST",
44
+ auth: true,
45
+ body: params,
46
+ });
47
+ return response;
48
+ }
49
+ /**
50
+ * Get all top picks collections for the shop
51
+ * @returns {Promise<GetTopPicksListResponse>} The response containing all top picks collections
52
+ *
53
+ * This endpoint retrieves all top picks collections in your shop, including both
54
+ * activated and deactivated collections. Each collection contains:
55
+ * - top_picks_id: The unique identifier
56
+ * - name: The collection name
57
+ * - is_activated: Activation status
58
+ * - item_list: Array of items with details (name, id, price, sales)
59
+ */
60
+ async getTopPicksList() {
61
+ const response = await ShopeeFetch.fetch(this.config, "/top_picks/get_top_picks_list", {
62
+ method: "GET",
63
+ auth: true,
64
+ });
65
+ return response;
66
+ }
67
+ /**
68
+ * Update an existing top picks collection
69
+ * @param {UpdateTopPicksParams} params - Parameters for updating a top picks collection
70
+ * @returns {Promise<UpdateTopPicksResponse>} The response containing the updated collection list
71
+ *
72
+ * You can update the name, items, and activation status of a collection.
73
+ * When updating item_id_list, it will completely replace the old item list.
74
+ * If you set is_activated to true, all other collections will be automatically deactivated.
75
+ *
76
+ * @throws {Error} When the API request fails or returns an error
77
+ * - top_pick.top_pick_name_duplication: The Top-picks name already exists
78
+ * - top_pick.top_pick_item_id_not_exist: Item does not belong to shop
79
+ * - top_pick.top_pick_item_id_duplication: The top-picks has duplicative item
80
+ * - common.error_not_found: The collection does not exist
81
+ */
82
+ async updateTopPicks(params) {
83
+ const response = await ShopeeFetch.fetch(this.config, "/top_picks/update_top_picks", {
84
+ method: "POST",
85
+ auth: true,
86
+ body: params,
87
+ });
88
+ return response;
89
+ }
90
+ }
91
+ //# sourceMappingURL=top-picks.manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-picks.manager.js","sourceRoot":"","sources":["../../src/managers/top-picks.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,WAAW,CAAC,MAAyB;QACzC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,0BAA0B,EAC1B;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,cAAc,CAAC,MAA4B;QAC/C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,6BAA6B,EAC7B;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,eAAe;QACnB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,+BAA+B,EAC/B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,cAAc,CAAC,MAA4B;QAC/C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,6BAA6B,EAC7B;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}