@congminh1254/shopee-sdk 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/lib/errors.js +2 -2
- package/lib/fetch.d.ts +2 -2
- package/lib/fetch.js +17 -14
- package/lib/fetch.js.map +1 -1
- package/lib/managers/ads.manager.js +22 -22
- package/lib/managers/ads.manager.js.map +1 -1
- package/lib/managers/auth.manager.d.ts +3 -3
- package/lib/managers/auth.manager.js +21 -12
- package/lib/managers/auth.manager.js.map +1 -1
- package/lib/managers/base.manager.d.ts +1 -1
- package/lib/managers/index.d.ts +10 -10
- package/lib/managers/index.js +10 -10
- package/lib/managers/logistics.manager.js +2 -2
- package/lib/managers/logistics.manager.js.map +1 -1
- package/lib/managers/order.manager.d.ts +3 -3
- package/lib/managers/order.manager.js +25 -25
- package/lib/managers/order.manager.js.map +1 -1
- package/lib/managers/payment.manager.js +2 -2
- package/lib/managers/payment.manager.js.map +1 -1
- package/lib/managers/product.manager.d.ts +3 -3
- package/lib/managers/product.manager.js +10 -10
- package/lib/managers/product.manager.js.map +1 -1
- package/lib/managers/public.manager.d.ts +3 -3
- package/lib/managers/public.manager.js +8 -8
- package/lib/managers/push.manager.d.ts +3 -3
- package/lib/managers/push.manager.js +11 -11
- package/lib/managers/push.manager.js.map +1 -1
- package/lib/managers/voucher.manager.js +12 -12
- package/lib/managers/voucher.manager.js.map +1 -1
- package/lib/schemas/access-token.d.ts +2 -1
- package/lib/schemas/attribute.d.ts +4 -4
- package/lib/schemas/fetch.d.ts +2 -2
- package/lib/schemas/index.d.ts +12 -12
- package/lib/schemas/index.js +12 -12
- package/lib/schemas/logistics.d.ts +1 -1
- package/lib/schemas/order.d.ts +26 -26
- package/lib/schemas/order.js +1 -1
- package/lib/schemas/payment.d.ts +1 -1
- package/lib/schemas/product.d.ts +1 -1
- package/lib/schemas/product.js +0 -1
- package/lib/schemas/product.js.map +1 -1
- package/lib/schemas/push.d.ts +1 -1
- package/lib/schemas/region.js +5 -5
- package/lib/schemas/voucher.js.map +1 -1
- package/lib/sdk.d.ts +12 -12
- package/lib/sdk.js +15 -19
- package/lib/sdk.js.map +1 -1
- package/lib/storage/custom-token-storage.d.ts +2 -2
- package/lib/storage/custom-token-storage.js +11 -11
- package/lib/storage/custom-token-storage.js.map +1 -1
- package/lib/storage/token-storage.interface.d.ts +1 -1
- package/lib/utils/signature.js +3 -6
- package/lib/utils/signature.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.manager.js","sourceRoot":"","sources":["../../src/managers/payment.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"payment.manager.js","sourceRoot":"","sources":["../../src/managers/payment.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,4BAA4B,EAC5B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseManager } from
|
|
2
|
-
import { ShopeeConfig } from
|
|
3
|
-
import { GetCommentParams, GetCommentResponse, ReplyCommentParams, ReplyCommentResponse, GetItemListParams, GetItemListResponse, GetItemBaseInfoParams, GetItemBaseInfoResponse } from
|
|
1
|
+
import { BaseManager } from "./base.manager.js";
|
|
2
|
+
import { ShopeeConfig } from "../sdk.js";
|
|
3
|
+
import { GetCommentParams, GetCommentResponse, ReplyCommentParams, ReplyCommentResponse, GetItemListParams, GetItemListResponse, GetItemBaseInfoParams, GetItemBaseInfoResponse } from "../schemas/product.js";
|
|
4
4
|
export declare class ProductManager extends BaseManager {
|
|
5
5
|
constructor(config: ShopeeConfig);
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseManager } from
|
|
2
|
-
import { ShopeeFetch } from
|
|
1
|
+
import { BaseManager } from "./base.manager.js";
|
|
2
|
+
import { ShopeeFetch } from "../fetch.js";
|
|
3
3
|
export class ProductManager extends BaseManager {
|
|
4
4
|
constructor(config) {
|
|
5
5
|
super(config);
|
|
@@ -25,7 +25,7 @@ export class ProductManager extends BaseManager {
|
|
|
25
25
|
*/
|
|
26
26
|
async getComment(params) {
|
|
27
27
|
const response = await ShopeeFetch.fetch(this.config, `/product/get_comment`, {
|
|
28
|
-
method:
|
|
28
|
+
method: "GET",
|
|
29
29
|
auth: true,
|
|
30
30
|
params,
|
|
31
31
|
});
|
|
@@ -56,7 +56,7 @@ export class ProductManager extends BaseManager {
|
|
|
56
56
|
*/
|
|
57
57
|
async replyComment(params) {
|
|
58
58
|
const response = await ShopeeFetch.fetch(this.config, `/product/reply_comment`, {
|
|
59
|
-
method:
|
|
59
|
+
method: "POST",
|
|
60
60
|
auth: true,
|
|
61
61
|
body: params,
|
|
62
62
|
});
|
|
@@ -87,8 +87,8 @@ export class ProductManager extends BaseManager {
|
|
|
87
87
|
* - error_item_not_found: Product not found
|
|
88
88
|
*/
|
|
89
89
|
async getItemList(params) {
|
|
90
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
91
|
-
method:
|
|
90
|
+
const response = await ShopeeFetch.fetch(this.config, "/product/get_item_list", {
|
|
91
|
+
method: "GET",
|
|
92
92
|
auth: true,
|
|
93
93
|
params,
|
|
94
94
|
});
|
|
@@ -133,13 +133,13 @@ export class ProductManager extends BaseManager {
|
|
|
133
133
|
* - error_query_over_itemid_size: Too many item_ids in list
|
|
134
134
|
*/
|
|
135
135
|
async getItemBaseInfo(params) {
|
|
136
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
137
|
-
method:
|
|
136
|
+
const response = await ShopeeFetch.fetch(this.config, "/product/get_item_base_info", {
|
|
137
|
+
method: "GET",
|
|
138
138
|
auth: true,
|
|
139
139
|
params: {
|
|
140
140
|
...params,
|
|
141
|
-
item_id_list: params.item_id_list.join(
|
|
142
|
-
}
|
|
141
|
+
item_id_list: params.item_id_list.join(","),
|
|
142
|
+
},
|
|
143
143
|
});
|
|
144
144
|
return response;
|
|
145
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.manager.js","sourceRoot":"","sources":["../../src/managers/product.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"product.manager.js","sourceRoot":"","sources":["../../src/managers/product.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAY1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,WAAW,CAAC,MAAyB;QACzC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,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;gBACN,GAAG,MAAM;gBACT,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;aAC5C;SACF,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ShopeeConfig } from
|
|
2
|
-
import { GetShopsByPartnerParams, GetMerchantsByPartnerParams, GetShopsByPartnerResponse, GetMerchantsByPartnerResponse, GetShopeeIpRangeResponse } from
|
|
3
|
-
import { BaseManager } from
|
|
1
|
+
import { ShopeeConfig } from "../sdk.js";
|
|
2
|
+
import { GetShopsByPartnerParams, GetMerchantsByPartnerParams, GetShopsByPartnerResponse, GetMerchantsByPartnerResponse, GetShopeeIpRangeResponse } from "../schemas/public.js";
|
|
3
|
+
import { BaseManager } from "./base.manager.js";
|
|
4
4
|
export declare class PublicManager extends BaseManager {
|
|
5
5
|
constructor(config: ShopeeConfig);
|
|
6
6
|
getShopsByPartner(params?: GetShopsByPartnerParams): Promise<GetShopsByPartnerResponse>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ShopeeFetch } from
|
|
2
|
-
import { BaseManager } from
|
|
1
|
+
import { ShopeeFetch } from "../fetch.js";
|
|
2
|
+
import { BaseManager } from "./base.manager.js";
|
|
3
3
|
export class PublicManager extends BaseManager {
|
|
4
4
|
constructor(config) {
|
|
5
5
|
super(config);
|
|
6
6
|
}
|
|
7
7
|
async getShopsByPartner(params) {
|
|
8
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
9
|
-
method:
|
|
8
|
+
const response = await ShopeeFetch.fetch(this.config, "/public/get_shops_by_partner", {
|
|
9
|
+
method: "GET",
|
|
10
10
|
params: {
|
|
11
11
|
partner_id: this.config.partner_id,
|
|
12
12
|
...params,
|
|
@@ -15,8 +15,8 @@ export class PublicManager extends BaseManager {
|
|
|
15
15
|
return response;
|
|
16
16
|
}
|
|
17
17
|
async getMerchantsByPartner(params) {
|
|
18
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
19
|
-
method:
|
|
18
|
+
const response = await ShopeeFetch.fetch(this.config, "/public/get_merchants_by_partner", {
|
|
19
|
+
method: "GET",
|
|
20
20
|
params: {
|
|
21
21
|
partner_id: this.config.partner_id,
|
|
22
22
|
...params,
|
|
@@ -25,8 +25,8 @@ export class PublicManager extends BaseManager {
|
|
|
25
25
|
return response;
|
|
26
26
|
}
|
|
27
27
|
async getShopeeIpRange() {
|
|
28
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
29
|
-
method:
|
|
28
|
+
const response = await ShopeeFetch.fetch(this.config, "/public/get_shopee_ip_ranges", {
|
|
29
|
+
method: "GET",
|
|
30
30
|
});
|
|
31
31
|
return response;
|
|
32
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ShopeeConfig } from
|
|
2
|
-
import { SetAppPushConfigParams, SetAppPushConfigResponse, GetAppPushConfigResponse, GetLostPushMessageResponse, ConfirmConsumedLostPushMessageParams, ConfirmConsumedLostPushMessageResponse } from
|
|
3
|
-
import { BaseManager } from
|
|
1
|
+
import { ShopeeConfig } from "../sdk.js";
|
|
2
|
+
import { SetAppPushConfigParams, SetAppPushConfigResponse, GetAppPushConfigResponse, GetLostPushMessageResponse, ConfirmConsumedLostPushMessageParams, ConfirmConsumedLostPushMessageResponse } from "../schemas/push.js";
|
|
3
|
+
import { BaseManager } from "./base.manager.js";
|
|
4
4
|
export declare class PushManager extends BaseManager {
|
|
5
5
|
constructor(config: ShopeeConfig);
|
|
6
6
|
setAppPushConfig(params: SetAppPushConfigParams): Promise<SetAppPushConfigResponse>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ShopeeFetch } from
|
|
2
|
-
import { BaseManager } from
|
|
1
|
+
import { ShopeeFetch } from "../fetch.js";
|
|
2
|
+
import { BaseManager } from "./base.manager.js";
|
|
3
3
|
export class PushManager extends BaseManager {
|
|
4
4
|
constructor(config) {
|
|
5
5
|
super(config);
|
|
6
6
|
}
|
|
7
7
|
async setAppPushConfig(params) {
|
|
8
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
9
|
-
method:
|
|
10
|
-
body: params
|
|
8
|
+
const response = await ShopeeFetch.fetch(this.config, "/push/set_app_push_config", {
|
|
9
|
+
method: "POST",
|
|
10
|
+
body: params,
|
|
11
11
|
});
|
|
12
12
|
return response;
|
|
13
13
|
}
|
|
14
14
|
async getAppPushConfig() {
|
|
15
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
16
|
-
method:
|
|
15
|
+
const response = await ShopeeFetch.fetch(this.config, "/push/get_app_push_config", {
|
|
16
|
+
method: "GET",
|
|
17
17
|
});
|
|
18
18
|
return response;
|
|
19
19
|
}
|
|
@@ -32,8 +32,8 @@ export class PushManager extends BaseManager {
|
|
|
32
32
|
* - data: The actual push message content (as a JSON string)
|
|
33
33
|
*/
|
|
34
34
|
async getLostPushMessage() {
|
|
35
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
36
|
-
method:
|
|
35
|
+
const response = await ShopeeFetch.fetch(this.config, "/push/get_lost_push_message", {
|
|
36
|
+
method: "GET",
|
|
37
37
|
});
|
|
38
38
|
return response;
|
|
39
39
|
}
|
|
@@ -50,8 +50,8 @@ export class PushManager extends BaseManager {
|
|
|
50
50
|
* Use this method after you have successfully processed the messages returned by getLostPushMessage.
|
|
51
51
|
*/
|
|
52
52
|
async confirmConsumedLostPushMessage(params) {
|
|
53
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
54
|
-
method:
|
|
53
|
+
const response = await ShopeeFetch.fetch(this.config, "/push/confirm_consumed_lost_push_message", {
|
|
54
|
+
method: "POST",
|
|
55
55
|
body: params,
|
|
56
56
|
});
|
|
57
57
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.manager.js","sourceRoot":"","sources":["../../src/managers/push.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,WAAY,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"push.manager.js","sourceRoot":"","sources":["../../src/managers/push.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,MAA8B;QAC1D,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,2BAA2B,EAC3B;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAmD;SAC1D,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC3B,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,2BAA2B,EAC3B;YACE,MAAM,EAAE,KAAK;SACd,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,KAAK,CAAC,kBAAkB;QAC7B,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,6BAA6B,EAC7B;YACE,MAAM,EAAE,KAAK;SACd,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,8BAA8B,CACzC,MAA4C;QAE5C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,0CAA0C,EAC1C;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -10,8 +10,8 @@ export class VoucherManager extends BaseManager {
|
|
|
10
10
|
* @returns {Promise<AddVoucherResponse>} The response containing the created voucher ID
|
|
11
11
|
*/
|
|
12
12
|
async addVoucher(params) {
|
|
13
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
14
|
-
method:
|
|
13
|
+
const response = await ShopeeFetch.fetch(this.config, "/voucher/add_voucher", {
|
|
14
|
+
method: "POST",
|
|
15
15
|
auth: true,
|
|
16
16
|
body: params,
|
|
17
17
|
});
|
|
@@ -26,8 +26,8 @@ export class VoucherManager extends BaseManager {
|
|
|
26
26
|
* Will return an error if attempting to delete a voucher that has already started.
|
|
27
27
|
*/
|
|
28
28
|
async deleteVoucher(params) {
|
|
29
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
30
|
-
method:
|
|
29
|
+
const response = await ShopeeFetch.fetch(this.config, "/voucher/delete_voucher", {
|
|
30
|
+
method: "POST",
|
|
31
31
|
auth: true,
|
|
32
32
|
body: params,
|
|
33
33
|
});
|
|
@@ -42,8 +42,8 @@ export class VoucherManager extends BaseManager {
|
|
|
42
42
|
* Will return an error if attempting to end an upcoming or expired voucher.
|
|
43
43
|
*/
|
|
44
44
|
async endVoucher(params) {
|
|
45
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
46
|
-
method:
|
|
45
|
+
const response = await ShopeeFetch.fetch(this.config, "/voucher/end_voucher", {
|
|
46
|
+
method: "POST",
|
|
47
47
|
auth: true,
|
|
48
48
|
body: params,
|
|
49
49
|
});
|
|
@@ -62,8 +62,8 @@ export class VoucherManager extends BaseManager {
|
|
|
62
62
|
* - item_id_list
|
|
63
63
|
*/
|
|
64
64
|
async updateVoucher(params) {
|
|
65
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
66
|
-
method:
|
|
65
|
+
const response = await ShopeeFetch.fetch(this.config, "/voucher/update_voucher", {
|
|
66
|
+
method: "POST",
|
|
67
67
|
auth: true,
|
|
68
68
|
body: params,
|
|
69
69
|
});
|
|
@@ -83,8 +83,8 @@ export class VoucherManager extends BaseManager {
|
|
|
83
83
|
* - For product vouchers: list of applicable items
|
|
84
84
|
*/
|
|
85
85
|
async getVoucher(params) {
|
|
86
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
87
|
-
method:
|
|
86
|
+
const response = await ShopeeFetch.fetch(this.config, "/voucher/get_voucher", {
|
|
87
|
+
method: "GET",
|
|
88
88
|
auth: true,
|
|
89
89
|
params,
|
|
90
90
|
});
|
|
@@ -103,8 +103,8 @@ export class VoucherManager extends BaseManager {
|
|
|
103
103
|
* - A list of vouchers with details such as ID, code, name, type, usage statistics, timing, and reward information
|
|
104
104
|
*/
|
|
105
105
|
async getVoucherList(params) {
|
|
106
|
-
const response = await ShopeeFetch.fetch(this.config,
|
|
107
|
-
method:
|
|
106
|
+
const response = await ShopeeFetch.fetch(this.config, "/voucher/get_voucher_list", {
|
|
107
|
+
method: "GET",
|
|
108
108
|
auth: true,
|
|
109
109
|
params,
|
|
110
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voucher.manager.js","sourceRoot":"","sources":["../../src/managers/voucher.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"voucher.manager.js","sourceRoot":"","sources":["../../src/managers/voucher.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAehD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,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;;;;;;;OAOG;IACH,KAAK,CAAC,aAAa,CAAC,MAA2B;QAC7C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,yBAAyB,EACzB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,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;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,aAAa,CAAC,MAA2B;QAC7C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,yBAAyB,EACzB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,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,2BAA2B,EAC3B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -9,8 +9,9 @@ export interface AccessToken {
|
|
|
9
9
|
merchant_id_list?: number[];
|
|
10
10
|
shop_id_list?: number[];
|
|
11
11
|
supplier_id_list?: number[];
|
|
12
|
+
expired_at?: number;
|
|
12
13
|
}
|
|
13
|
-
export interface RefreshedAccessToken extends Omit<AccessToken,
|
|
14
|
+
export interface RefreshedAccessToken extends Omit<AccessToken, "merchant_id_list" | "shop_id_list" | "supplier_id_list"> {
|
|
14
15
|
partner_id: number;
|
|
15
16
|
shop_id?: number;
|
|
16
17
|
merchant_id?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type InputValidationType =
|
|
2
|
-
export type FormatType =
|
|
3
|
-
export type DateFormatType =
|
|
4
|
-
export type InputType =
|
|
1
|
+
export type InputValidationType = "INT_TYPE" | "STRING_TYPE" | "ENUM_TYPE" | "FLOAT_TYPE" | "DATE_TYPE" | "TIMESTAMP_TYPE";
|
|
2
|
+
export type FormatType = "NORMAL" | "QUANTITATIVE";
|
|
3
|
+
export type DateFormatType = "YEAR_MONTH_DATE" | "YEAR_MONTH";
|
|
4
|
+
export type InputType = "DROP_DOWN" | "MULTIPLE_SELECT" | "TEXT_FILED" | "COMBO_BOX" | "MULTIPLE_SELECT_COMBO_BOX";
|
|
5
5
|
export interface AttributeValue {
|
|
6
6
|
value_id: number;
|
|
7
7
|
original_value_name: string;
|
package/lib/schemas/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestInit } from
|
|
2
|
-
export type FetchOptions = Omit<RequestInit,
|
|
1
|
+
import { RequestInit } from "node-fetch";
|
|
2
|
+
export type FetchOptions = Omit<RequestInit, "body"> & {
|
|
3
3
|
params?: Record<string, string | number | boolean | undefined | null | (string | number | boolean)[]>;
|
|
4
4
|
body?: unknown;
|
|
5
5
|
auth?: boolean;
|
package/lib/schemas/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
1
|
+
export * from "./access-token.js";
|
|
2
|
+
export * from "./attribute.js";
|
|
3
|
+
export * from "./authed-merchant.js";
|
|
4
|
+
export * from "./authed-shop.js";
|
|
5
|
+
export * from "./category.js";
|
|
6
|
+
export * from "./fetch.js";
|
|
7
|
+
export * from "./order.js";
|
|
8
|
+
export * from "./product.js";
|
|
9
|
+
export * from "./public.js";
|
|
10
|
+
export * from "./push.js";
|
|
11
|
+
export * from "./region.js";
|
|
12
|
+
export * from "./ads.js";
|
package/lib/schemas/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
1
|
+
export * from "./access-token.js";
|
|
2
|
+
export * from "./attribute.js";
|
|
3
|
+
export * from "./authed-merchant.js";
|
|
4
|
+
export * from "./authed-shop.js";
|
|
5
|
+
export * from "./category.js";
|
|
6
|
+
export * from "./fetch.js";
|
|
7
|
+
export * from "./order.js";
|
|
8
|
+
export * from "./product.js";
|
|
9
|
+
export * from "./public.js";
|
|
10
|
+
export * from "./push.js";
|
|
11
|
+
export * from "./region.js";
|
|
12
|
+
export * from "./ads.js";
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/lib/schemas/order.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchResponse } from
|
|
1
|
+
import { FetchResponse } from "./fetch.js";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an item in an order with detailed product information
|
|
4
4
|
*/
|
|
@@ -73,31 +73,31 @@ export interface PackageItem {
|
|
|
73
73
|
*/
|
|
74
74
|
export type LogisticsStatus =
|
|
75
75
|
/** Initial status, order not ready for fulfillment */
|
|
76
|
-
|
|
76
|
+
"LOGISTICS_NOT_STARTED"
|
|
77
77
|
/** order arranged shipment */
|
|
78
|
-
|
|
|
78
|
+
| "LOGISTICS_REQUEST_CREATED"
|
|
79
79
|
/** order handed over to 3PL */
|
|
80
|
-
|
|
|
80
|
+
| "LOGISTICS_PICKUP_DONE"
|
|
81
81
|
/** order pending 3PL retry pickup */
|
|
82
|
-
|
|
|
82
|
+
| "LOGISTICS_PICKUP_RETRY"
|
|
83
83
|
/** order cancelled by 3PL due to failed pickup or picked up but not able to proceed with delivery */
|
|
84
|
-
|
|
|
84
|
+
| "LOGISTICS_PICKUP_FAILED"
|
|
85
85
|
/** order successfully delivered */
|
|
86
|
-
|
|
|
86
|
+
| "LOGISTICS_DELIVERY_DONE"
|
|
87
87
|
/** order cancelled due to 3PL delivery failed */
|
|
88
|
-
|
|
|
88
|
+
| "LOGISTICS_DELIVERY_FAILED"
|
|
89
89
|
/** order cancelled when order at LOGISTICS_REQUEST_CREATED */
|
|
90
|
-
|
|
|
90
|
+
| "LOGISTICS_REQUEST_CANCELED"
|
|
91
91
|
/** Integrated logistics COD: Order rejected for COD */
|
|
92
|
-
|
|
|
92
|
+
| "LOGISTICS_COD_REJECTED"
|
|
93
93
|
/** order ready for fulfilment from payment perspective: non-COD: order paid, COD: order passed COD screening */
|
|
94
|
-
|
|
|
94
|
+
| "LOGISTICS_READY"
|
|
95
95
|
/** order cancelled when order at LOGISTICS_READY */
|
|
96
|
-
|
|
|
96
|
+
| "LOGISTICS_INVALID"
|
|
97
97
|
/** order cancelled due to 3PL lost the order */
|
|
98
|
-
|
|
|
98
|
+
| "LOGISTICS_LOST"
|
|
99
99
|
/** order logistics pending arrangement */
|
|
100
|
-
|
|
|
100
|
+
| "LOGISTICS_PENDING_ARRANGE";
|
|
101
101
|
/**
|
|
102
102
|
* Represents a package in an order with shipping information
|
|
103
103
|
*/
|
|
@@ -262,31 +262,31 @@ export interface Order {
|
|
|
262
262
|
/**
|
|
263
263
|
* The kind of time range field for order list query
|
|
264
264
|
*/
|
|
265
|
-
export type TimeRangeField =
|
|
265
|
+
export type TimeRangeField = "create_time" | "update_time";
|
|
266
266
|
/**
|
|
267
267
|
* The status of an order
|
|
268
268
|
*/
|
|
269
269
|
export type OrderStatus =
|
|
270
270
|
/** Order is created, buyer has not paid yet */
|
|
271
|
-
|
|
271
|
+
"UNPAID"
|
|
272
272
|
/** Seller can arrange shipment */
|
|
273
|
-
|
|
|
273
|
+
| "READY_TO_SHIP"
|
|
274
274
|
/** Seller has arranged shipment online and got tracking number from 3PL */
|
|
275
|
-
|
|
|
275
|
+
| "PROCESSED"
|
|
276
276
|
/** 3PL pickup parcel fail. Need to re arrange shipment */
|
|
277
|
-
|
|
|
277
|
+
| "RETRY_SHIP"
|
|
278
278
|
/** The parcel has been drop to 3PL or picked up by 3PL */
|
|
279
|
-
|
|
|
279
|
+
| "SHIPPED"
|
|
280
280
|
/** The order has been received by buyer */
|
|
281
|
-
|
|
|
281
|
+
| "TO_CONFIRM_RECEIVE"
|
|
282
282
|
/** The order's cancelation is under processing */
|
|
283
|
-
|
|
|
283
|
+
| "IN_CANCEL"
|
|
284
284
|
/** The order has been canceled */
|
|
285
|
-
|
|
|
285
|
+
| "CANCELLED"
|
|
286
286
|
/** The buyer requested to return the order and order's return is processing */
|
|
287
|
-
|
|
|
287
|
+
| "TO_RETURN"
|
|
288
288
|
/** The order has been completed */
|
|
289
|
-
|
|
|
289
|
+
| "COMPLETED";
|
|
290
290
|
/**
|
|
291
291
|
* Represents a single order in the order list response
|
|
292
292
|
*/
|
|
@@ -334,7 +334,7 @@ export interface GetOrderListResponse extends FetchResponse<{
|
|
|
334
334
|
}> {
|
|
335
335
|
}
|
|
336
336
|
export declare const allOptionalFields = "buyer_user_id,buyer_username,estimated_shipping_fee,recipient_address,actual_shipping_fee,goods_to_declare,note,note_update_time,item_list,pay_time,dropshipper,dropshipper_phone,split_up,buyer_cancel_reason,cancel_by,cancel_reason,actual_shipping_fee_confirmed,buyer_cpf_id,fulfillment_flag,pickup_done_time,package_list,shipping_carrier,payment_method,total_amount,invoice_data,order_chargeable_weight_gram,return_request_due_date,edt";
|
|
337
|
-
export type OrderDetailOptionalFields =
|
|
337
|
+
export type OrderDetailOptionalFields = "buyer_user_id" | "buyer_username" | "estimated_shipping_fee" | "recipient_address" | "actual_shipping_fee" | "goods_to_declare" | "note" | "note_update_time" | "item_list" | "pay_time" | "dropshipper" | "dropshipper_phone" | "split_up" | "buyer_cancel_reason" | "cancel_by" | "cancel_reason" | "actual_shipping_fee_confirmed" | "buyer_cpf_id" | "fulfillment_flag" | "pickup_done_time" | "package_list" | "shipping_carrier" | "payment_method" | "total_amount" | "invoice_data" | "order_chargeable_weight_gram" | "return_request_due_date" | "edt";
|
|
338
338
|
/**
|
|
339
339
|
* Parameters for getting order details
|
|
340
340
|
*/
|
package/lib/schemas/order.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const allOptionalFields =
|
|
1
|
+
export const allOptionalFields = "buyer_user_id,buyer_username,estimated_shipping_fee,recipient_address,actual_shipping_fee,goods_to_declare,note,note_update_time,item_list,pay_time,dropshipper,dropshipper_phone,split_up,buyer_cancel_reason,cancel_by,cancel_reason,actual_shipping_fee_confirmed,buyer_cpf_id,fulfillment_flag,pickup_done_time,package_list,shipping_carrier,payment_method,total_amount,invoice_data,order_chargeable_weight_gram,return_request_due_date,edt";
|
|
2
2
|
//# sourceMappingURL=order.js.map
|
package/lib/schemas/payment.d.ts
CHANGED
package/lib/schemas/product.d.ts
CHANGED
package/lib/schemas/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../src/schemas/product.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;AACjC,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../src/schemas/product.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;AACjC,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB"}
|
package/lib/schemas/push.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface SetAppPushConfigParams extends Record<string, string | number |
|
|
|
10
10
|
export type SetAppPushConfigResponse = FetchResponse<{
|
|
11
11
|
result: string;
|
|
12
12
|
}>;
|
|
13
|
-
export type LivePushStatus =
|
|
13
|
+
export type LivePushStatus = "Normal" | "Warning" | "Suspended";
|
|
14
14
|
export interface GetAppPushConfigResponse extends FetchResponse<{
|
|
15
15
|
callback_url: string;
|
|
16
16
|
live_push_status: LivePushStatus;
|
package/lib/schemas/region.js
CHANGED
|
@@ -7,10 +7,10 @@ export var ShopeeRegion;
|
|
|
7
7
|
ShopeeRegion["TEST_CHINA"] = "TEST_CHINA";
|
|
8
8
|
})(ShopeeRegion || (ShopeeRegion = {}));
|
|
9
9
|
export const SHOPEE_BASE_URLS = {
|
|
10
|
-
[ShopeeRegion.GLOBAL]:
|
|
11
|
-
[ShopeeRegion.CHINA]:
|
|
12
|
-
[ShopeeRegion.BRAZIL]:
|
|
13
|
-
[ShopeeRegion.TEST_GLOBAL]:
|
|
14
|
-
[ShopeeRegion.TEST_CHINA]:
|
|
10
|
+
[ShopeeRegion.GLOBAL]: "https://partner.shopeemobile.com/api/v2",
|
|
11
|
+
[ShopeeRegion.CHINA]: "https://openplatform.shopee.cn/api/v2/public",
|
|
12
|
+
[ShopeeRegion.BRAZIL]: "https://openplatform.shopee.com.br/api/v2",
|
|
13
|
+
[ShopeeRegion.TEST_GLOBAL]: "https://partner.test-stable.shopeemobile.com/api/v2",
|
|
14
|
+
[ShopeeRegion.TEST_CHINA]: "https://openplatform.test-stable.shopee.cn/api/v2",
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=region.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voucher.js","sourceRoot":"","sources":["../../src/schemas/voucher.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;
|
|
1
|
+
{"version":3,"file":"voucher.js","sourceRoot":"","sources":["../../src/schemas/voucher.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;IACvB,wCAAwC;IACxC,4BAAW,CAAA;IACX,yCAAyC;IACzC,sCAAqB,CAAA;IACrB,gCAAgC;IAChC,oCAAmB,CAAA;IACnB,+BAA+B;IAC/B,oCAAmB,CAAA;AACrB,CAAC,EATW,aAAa,KAAb,aAAa,QASxB"}
|
package/lib/sdk.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ProductManager } from
|
|
2
|
-
import { OrderManager } from
|
|
3
|
-
import { AuthManager } from
|
|
4
|
-
import { ShopeeRegion } from
|
|
5
|
-
import { TokenStorage } from
|
|
6
|
-
import { AccessToken } from
|
|
7
|
-
import { PublicManager } from
|
|
8
|
-
import { PushManager } from
|
|
9
|
-
import { PaymentManager } from
|
|
10
|
-
import { LogisticsManager } from
|
|
11
|
-
import { VoucherManager } from
|
|
12
|
-
import { AdsManager } from
|
|
1
|
+
import { ProductManager } from "./managers/product.manager.js";
|
|
2
|
+
import { OrderManager } from "./managers/order.manager.js";
|
|
3
|
+
import { AuthManager } from "./managers/auth.manager.js";
|
|
4
|
+
import { ShopeeRegion } from "./schemas/region.js";
|
|
5
|
+
import { TokenStorage } from "./storage/token-storage.interface.js";
|
|
6
|
+
import { AccessToken } from "./schemas/access-token.js";
|
|
7
|
+
import { PublicManager } from "./managers/public.manager.js";
|
|
8
|
+
import { PushManager } from "./managers/push.manager.js";
|
|
9
|
+
import { PaymentManager } from "./managers/payment.manager.js";
|
|
10
|
+
import { LogisticsManager } from "./managers/logistics.manager.js";
|
|
11
|
+
import { VoucherManager } from "./managers/voucher.manager.js";
|
|
12
|
+
import { AdsManager } from "./managers/ads.manager.js";
|
|
13
13
|
export interface ShopeeConfig {
|
|
14
14
|
partner_id: number;
|
|
15
15
|
partner_key: string;
|