@qzsy/pdd-shop-sdk 0.1.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 (86) hide show
  1. package/LICENSE +21 -0
  2. package/dist/apis/auth.d.ts +22 -0
  3. package/dist/apis/auth.d.ts.map +1 -0
  4. package/dist/apis/auth.js +25 -0
  5. package/dist/apis/auth.js.map +1 -0
  6. package/dist/apis/express.d.ts +58 -0
  7. package/dist/apis/express.d.ts.map +1 -0
  8. package/dist/apis/express.js +68 -0
  9. package/dist/apis/express.js.map +1 -0
  10. package/dist/apis/goods.d.ts +513 -0
  11. package/dist/apis/goods.d.ts.map +1 -0
  12. package/dist/apis/goods.js +665 -0
  13. package/dist/apis/goods.js.map +1 -0
  14. package/dist/apis/logistics.d.ts +119 -0
  15. package/dist/apis/logistics.d.ts.map +1 -0
  16. package/dist/apis/logistics.js +143 -0
  17. package/dist/apis/logistics.js.map +1 -0
  18. package/dist/apis/mall.d.ts +21 -0
  19. package/dist/apis/mall.d.ts.map +1 -0
  20. package/dist/apis/mall.js +23 -0
  21. package/dist/apis/mall.js.map +1 -0
  22. package/dist/apis/order.d.ts +256 -0
  23. package/dist/apis/order.d.ts.map +1 -0
  24. package/dist/apis/order.js +348 -0
  25. package/dist/apis/order.js.map +1 -0
  26. package/dist/apis/refund.d.ts +102 -0
  27. package/dist/apis/refund.d.ts.map +1 -0
  28. package/dist/apis/refund.js +132 -0
  29. package/dist/apis/refund.js.map +1 -0
  30. package/dist/apis/stock.d.ts +103 -0
  31. package/dist/apis/stock.d.ts.map +1 -0
  32. package/dist/apis/stock.js +123 -0
  33. package/dist/apis/stock.js.map +1 -0
  34. package/dist/apis/util.d.ts +21 -0
  35. package/dist/apis/util.d.ts.map +1 -0
  36. package/dist/apis/util.js +23 -0
  37. package/dist/apis/util.js.map +1 -0
  38. package/dist/apis/waybill.d.ts +130 -0
  39. package/dist/apis/waybill.d.ts.map +1 -0
  40. package/dist/apis/waybill.js +164 -0
  41. package/dist/apis/waybill.js.map +1 -0
  42. package/dist/client.d.ts +75 -0
  43. package/dist/client.d.ts.map +1 -0
  44. package/dist/client.js +93 -0
  45. package/dist/client.js.map +1 -0
  46. package/dist/index.d.ts +24 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +14 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/types/express.d.ts +407 -0
  51. package/dist/types/express.d.ts.map +1 -0
  52. package/dist/types/express.js +2 -0
  53. package/dist/types/express.js.map +1 -0
  54. package/dist/types/goods.d.ts +6985 -0
  55. package/dist/types/goods.d.ts.map +1 -0
  56. package/dist/types/goods.js +2 -0
  57. package/dist/types/goods.js.map +1 -0
  58. package/dist/types/logistics.d.ts +578 -0
  59. package/dist/types/logistics.d.ts.map +1 -0
  60. package/dist/types/logistics.js +2 -0
  61. package/dist/types/logistics.js.map +1 -0
  62. package/dist/types/mall.d.ts +32 -0
  63. package/dist/types/mall.d.ts.map +1 -0
  64. package/dist/types/mall.js +2 -0
  65. package/dist/types/mall.js.map +1 -0
  66. package/dist/types/order.d.ts +5447 -0
  67. package/dist/types/order.d.ts.map +1 -0
  68. package/dist/types/order.js +2 -0
  69. package/dist/types/order.js.map +1 -0
  70. package/dist/types/refund.d.ts +922 -0
  71. package/dist/types/refund.d.ts.map +1 -0
  72. package/dist/types/refund.js +2 -0
  73. package/dist/types/refund.js.map +1 -0
  74. package/dist/types/stock.d.ts +553 -0
  75. package/dist/types/stock.d.ts.map +1 -0
  76. package/dist/types/stock.js +2 -0
  77. package/dist/types/stock.js.map +1 -0
  78. package/dist/types/util.d.ts +10 -0
  79. package/dist/types/util.d.ts.map +1 -0
  80. package/dist/types/util.js +2 -0
  81. package/dist/types/util.js.map +1 -0
  82. package/dist/types/waybill.d.ts +1316 -0
  83. package/dist/types/waybill.d.ts.map +1 -0
  84. package/dist/types/waybill.js +2 -0
  85. package/dist/types/waybill.js.map +1 -0
  86. package/package.json +43 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 qzsy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ import type { PddHttpClient } from "@qzsy/pdd-core";
2
+ /**
3
+ * 商家基础支持:读取接口调用凭据。
4
+ */
5
+ export declare class ShopAuthApi {
6
+ #private;
7
+ /**
8
+ * @param http 共享的拼多多 HTTP 客户端
9
+ */
10
+ constructor(http: PddHttpClient);
11
+ /**
12
+ * 读取当前店铺 `access_token`。
13
+ *
14
+ * 令牌来自构造时传入的 `accessToken` / `refreshToken`,或 `ShopClient.forAuthorizer` 的回调。
15
+ * 拼多多没有 `client_id + client_secret` 直接换商家票的接口。
16
+ *
17
+ * @param forceRefresh 为 `true` 时忽略缓存并重新申请
18
+ * @returns `access_token`
19
+ */
20
+ getAccessToken(forceRefresh?: boolean): Promise<string>;
21
+ }
22
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/apis/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;GAEG;AACH,qBAAa,WAAW;;IAGtB;;OAEG;IACH,YAAY,IAAI,EAAE,aAAa,EAE9B;IAED;;;;;;;;OAQG;IACH,cAAc,CAAC,YAAY,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpD;CACF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 商家基础支持:读取接口调用凭据。
3
+ */
4
+ export class ShopAuthApi {
5
+ #http;
6
+ /**
7
+ * @param http 共享的拼多多 HTTP 客户端
8
+ */
9
+ constructor(http) {
10
+ this.#http = http;
11
+ }
12
+ /**
13
+ * 读取当前店铺 `access_token`。
14
+ *
15
+ * 令牌来自构造时传入的 `accessToken` / `refreshToken`,或 `ShopClient.forAuthorizer` 的回调。
16
+ * 拼多多没有 `client_id + client_secret` 直接换商家票的接口。
17
+ *
18
+ * @param forceRefresh 为 `true` 时忽略缓存并重新申请
19
+ * @returns `access_token`
20
+ */
21
+ getAccessToken(forceRefresh = false) {
22
+ return this.#http.getAccessToken(forceRefresh);
23
+ }
24
+ }
25
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/apis/auth.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,WAAW;IACb,KAAK,CAAgB;IAE9B;;OAEG;IACH,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;;OAQG;IACH,cAAc,CAAC,YAAY,GAAG,KAAK;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -0,0 +1,58 @@
1
+ import type { PddHttpClient } from "@qzsy/pdd-core";
2
+ import type { ShopExpressAddDepotQuery, ShopExpressChangeDepotInfoQuery, ShopExpressDepotInfo, ShopExpressDepotInfoGetQuery, ShopExpressDepotList, ShopExpressDepotListGetQuery, ShopExpressSearchDepotQuery, ShopExpressSearchDepotResult } from "../types/express.ts";
3
+ /**
4
+ * 仓储仓库:新增、修改、查询仓库。
5
+ */
6
+ export declare class ShopExpressApi {
7
+ #private;
8
+ /**
9
+ * @param http 共享的拼多多 HTTP 客户端
10
+ */
11
+ constructor(http: PddHttpClient);
12
+ /**
13
+ * 增加仓库。
14
+ *
15
+ * 对应官方接口:`pdd.express.add.depot`
16
+ *
17
+ * @param query 仓库地址、编码与覆盖区域
18
+ * @returns 操作结果,成功时为 `success`
19
+ */
20
+ addDepot(query: ShopExpressAddDepotQuery): Promise<string>;
21
+ /**
22
+ * 修改仓库信息。
23
+ *
24
+ * 对应官方接口:`pdd.express.change.depot.info`
25
+ *
26
+ * @param query 仓库 id 及要更新的字段
27
+ * @returns 响应结果
28
+ */
29
+ changeDepotInfo(query: ShopExpressChangeDepotInfoQuery): Promise<string>;
30
+ /**
31
+ * 查询仓库详细信息。
32
+ *
33
+ * 对应官方接口:`pdd.express.depot.info.get`
34
+ *
35
+ * @param query 仓库 id
36
+ * @returns 仓库详情
37
+ */
38
+ getDepotInfo(query: ShopExpressDepotInfoGetQuery): Promise<ShopExpressDepotInfo>;
39
+ /**
40
+ * 分页查询仓库列表。
41
+ *
42
+ * 对应官方接口:`pdd.express.depot.list.get`
43
+ *
44
+ * @param query 分页起始位置与 size
45
+ * @returns 仓库数量与列表
46
+ */
47
+ getDepotList(query: ShopExpressDepotListGetQuery): Promise<ShopExpressDepotList>;
48
+ /**
49
+ * 根据仓库名称和仓库编码查询仓库。
50
+ *
51
+ * 对应官方接口:`pdd.express.search.depot`
52
+ *
53
+ * @param query 仓库编码、名称与分页
54
+ * @returns 匹配的仓库数量与列表
55
+ */
56
+ searchDepot(query: ShopExpressSearchDepotQuery): Promise<ShopExpressSearchDepotResult>;
57
+ }
58
+ //# sourceMappingURL=express.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/apis/express.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,qBAAa,cAAc;;IAGzB;;OAEG;IACH,YAAY,IAAI,EAAE,aAAa,EAE9B;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,KAAK,EAAE,+BAA+B,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvE;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAE/E;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAE/E;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAErF;CACF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * 仓储仓库:新增、修改、查询仓库。
3
+ */
4
+ export class ShopExpressApi {
5
+ #http;
6
+ /**
7
+ * @param http 共享的拼多多 HTTP 客户端
8
+ */
9
+ constructor(http) {
10
+ this.#http = http;
11
+ }
12
+ /**
13
+ * 增加仓库。
14
+ *
15
+ * 对应官方接口:`pdd.express.add.depot`
16
+ *
17
+ * @param query 仓库地址、编码与覆盖区域
18
+ * @returns 操作结果,成功时为 `success`
19
+ */
20
+ addDepot(query) {
21
+ return this.#http.call("pdd.express.add.depot", query);
22
+ }
23
+ /**
24
+ * 修改仓库信息。
25
+ *
26
+ * 对应官方接口:`pdd.express.change.depot.info`
27
+ *
28
+ * @param query 仓库 id 及要更新的字段
29
+ * @returns 响应结果
30
+ */
31
+ changeDepotInfo(query) {
32
+ return this.#http.call("pdd.express.change.depot.info", query);
33
+ }
34
+ /**
35
+ * 查询仓库详细信息。
36
+ *
37
+ * 对应官方接口:`pdd.express.depot.info.get`
38
+ *
39
+ * @param query 仓库 id
40
+ * @returns 仓库详情
41
+ */
42
+ getDepotInfo(query) {
43
+ return this.#http.call("pdd.express.depot.info.get", query);
44
+ }
45
+ /**
46
+ * 分页查询仓库列表。
47
+ *
48
+ * 对应官方接口:`pdd.express.depot.list.get`
49
+ *
50
+ * @param query 分页起始位置与 size
51
+ * @returns 仓库数量与列表
52
+ */
53
+ getDepotList(query) {
54
+ return this.#http.call("pdd.express.depot.list.get", query);
55
+ }
56
+ /**
57
+ * 根据仓库名称和仓库编码查询仓库。
58
+ *
59
+ * 对应官方接口:`pdd.express.search.depot`
60
+ *
61
+ * @param query 仓库编码、名称与分页
62
+ * @returns 匹配的仓库数量与列表
63
+ */
64
+ searchDepot(query) {
65
+ return this.#http.call("pdd.express.search.depot", query);
66
+ }
67
+ }
68
+ //# sourceMappingURL=express.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/apis/express.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,OAAO,cAAc;IAChB,KAAK,CAAgB;IAE9B;;OAEG;IACH,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,KAA+B;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAS,uBAAuB,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,KAAsC;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAS,+BAA+B,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,KAAmC;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAuB,4BAA4B,EAAE,KAAK,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,KAAmC;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAuB,4BAA4B,EAAE,KAAK,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,KAAkC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAA+B,0BAA0B,EAAE,KAAK,CAAC,CAAC;IAC1F,CAAC;CACF"}