@youzan-cloud/zan-saas-cli 0.0.0-stage → 0.1.0-beta.3

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 (329) hide show
  1. package/DEPENDENCIES.json +50 -0
  2. package/INSTALL.md +79 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE +1 -0
  5. package/README.md +151 -2
  6. package/THIRD_PARTY_NOTICES.txt +162 -0
  7. package/bin/zan-saas-cli.js +28 -0
  8. package/internal/registry/index.js +123 -0
  9. package/internal/registry/manifest.json +424 -0
  10. package/npm-shrinkwrap.json +86 -0
  11. package/package.json +33 -4
  12. package/skills/README.md +30 -0
  13. package/skills/zan-saas/SKILL.md +54 -0
  14. package/skills/zan-saas/references/host-entry.md +25 -0
  15. package/skills/zan-saas-access/SKILL.md +37 -0
  16. package/skills/zan-saas-access/references/role-list.md +11 -0
  17. package/skills/zan-saas-access/references/staff-perms-get.md +11 -0
  18. package/skills/zan-saas-aftersale/SKILL.md +31 -0
  19. package/skills/zan-saas-aftersale/references/case-list.md +13 -0
  20. package/skills/zan-saas-aftersale/references/case-scan.md +31 -0
  21. package/skills/zan-saas-benefit/SKILL.md +46 -0
  22. package/skills/zan-saas-benefit/references/card-get.md +7 -0
  23. package/skills/zan-saas-benefit/references/card-grant-list.md +11 -0
  24. package/skills/zan-saas-benefit/references/card-list.md +7 -0
  25. package/skills/zan-saas-benefit/references/customer-card-get.md +7 -0
  26. package/skills/zan-saas-benefit/references/customer-card-list.md +7 -0
  27. package/skills/zan-saas-coupon/SKILL.md +41 -0
  28. package/skills/zan-saas-coupon/references/activity-get.md +11 -0
  29. package/skills/zan-saas-coupon/references/activity-list.md +15 -0
  30. package/skills/zan-saas-coupon/references/voucher-get.md +13 -0
  31. package/skills/zan-saas-coupon/references/voucher-list.md +25 -0
  32. package/skills/zan-saas-customer/SKILL.md +73 -0
  33. package/skills/zan-saas-customer/references/customer-scan.md +11 -0
  34. package/skills/zan-saas-customer/references/segment-list.md +22 -0
  35. package/skills/zan-saas-fulfillment/SKILL.md +36 -0
  36. package/skills/zan-saas-fulfillment/references/delivery-get.md +11 -0
  37. package/skills/zan-saas-fulfillment/references/shipment-list.md +11 -0
  38. package/skills/zan-saas-fulfillment/references/waybill-get.md +9 -0
  39. package/skills/zan-saas-interaction/SKILL.md +37 -0
  40. package/skills/zan-saas-interaction/references/lottery-get.md +11 -0
  41. package/skills/zan-saas-interaction/references/lottery-list.md +19 -0
  42. package/skills/zan-saas-item/SKILL.md +61 -0
  43. package/skills/zan-saas-item/references/attribute-list.md +11 -0
  44. package/skills/zan-saas-item/references/brand-list.md +7 -0
  45. package/skills/zan-saas-item/references/classification-get.md +7 -0
  46. package/skills/zan-saas-item/references/classification-list.md +7 -0
  47. package/skills/zan-saas-item/references/group-list.md +9 -0
  48. package/skills/zan-saas-item/references/item-content.md +9 -0
  49. package/skills/zan-saas-item/references/item-get.md +9 -0
  50. package/skills/zan-saas-item/references/item-search.md +23 -0
  51. package/skills/zan-saas-item/references/product-identity.md +11 -0
  52. package/skills/zan-saas-member/SKILL.md +41 -0
  53. package/skills/zan-saas-member/references/customer-level-get.md +7 -0
  54. package/skills/zan-saas-member/references/growth-log-list.md +17 -0
  55. package/skills/zan-saas-member/references/membership-get.md +7 -0
  56. package/skills/zan-saas-order/SKILL.md +56 -0
  57. package/skills/zan-saas-order/references/order-get.md +26 -0
  58. package/skills/zan-saas-order/references/order-list.md +25 -0
  59. package/skills/zan-saas-order/references/order-scan.md +35 -0
  60. package/skills/zan-saas-org/SKILL.md +37 -0
  61. package/skills/zan-saas-org/references/staff-get.md +15 -0
  62. package/skills/zan-saas-org/references/staff-role-get.md +11 -0
  63. package/skills/zan-saas-org/references/unit-get.md +11 -0
  64. package/skills/zan-saas-org/references/unit-list.md +15 -0
  65. package/skills/zan-saas-points/SKILL.md +42 -0
  66. package/skills/zan-saas-points/references/account-get.md +7 -0
  67. package/skills/zan-saas-points/references/log-list.md +17 -0
  68. package/skills/zan-saas-points/references/rule-list.md +2 -0
  69. package/skills/zan-saas-privacy/SKILL.md +30 -0
  70. package/skills/zan-saas-privacy/references/field-decrypt.md +19 -0
  71. package/skills/zan-saas-shared/SKILL.md +94 -0
  72. package/skills/zan-saas-shared/references/authentication.md +52 -0
  73. package/skills/zan-saas-shared/references/value-processing.md +27 -0
  74. package/skills/zan-saas-stock/SKILL.md +28 -0
  75. package/skills/zan-saas-stock/references/log-list.md +11 -0
  76. package/skills/zan-saas-valuecard/SKILL.md +37 -0
  77. package/skills/zan-saas-valuecard/references/card-get.md +13 -0
  78. package/skills/zan-saas-valuecard/references/card-list.md +11 -0
  79. package/src/auth/browser.js +28 -0
  80. package/src/auth/callback-server.js +99 -0
  81. package/src/auth/config.js +53 -0
  82. package/src/auth/credential-store.js +109 -0
  83. package/src/auth/oauth-client.js +105 -0
  84. package/src/auth/pkce.js +28 -0
  85. package/src/auth/session.js +178 -0
  86. package/src/auth/tool.js +25 -0
  87. package/src/cli/command-paths.js +126 -0
  88. package/src/cli/context-help.js +102 -0
  89. package/src/cli/diagnostic-command.js +57 -0
  90. package/src/cli/domain-catalog.js +42 -0
  91. package/src/cli/help-text.js +32 -0
  92. package/src/cli/native-loader.js +120 -0
  93. package/src/cli/native-path.js +22 -0
  94. package/src/cli/parser-policy.js +141 -0
  95. package/src/cli/program.js +134 -0
  96. package/src/cli/skill-catalog.js +241 -0
  97. package/src/commands/native/access/commands.index.json +24 -0
  98. package/src/commands/native/access/domain.json +3 -0
  99. package/src/commands/native/access/role/list/command.js +141 -0
  100. package/src/commands/native/access/role/list/schema.json +393 -0
  101. package/src/commands/native/access/staff-perms/get/command.js +119 -0
  102. package/src/commands/native/access/staff-perms/get/schema.json +703 -0
  103. package/src/commands/native/aftersale/case/get/command.js +104 -0
  104. package/src/commands/native/aftersale/case/get/exact-json.js +52 -0
  105. package/src/commands/native/aftersale/case/get/money.js +28 -0
  106. package/src/commands/native/aftersale/case/get/projection.js +120 -0
  107. package/src/commands/native/aftersale/case/get/query.js +72 -0
  108. package/src/commands/native/aftersale/case/get/schema.json +134 -0
  109. package/src/commands/native/aftersale/case/list/command.js +135 -0
  110. package/src/commands/native/aftersale/case/list/schema.json +1095 -0
  111. package/src/commands/native/aftersale/case/scan/command.js +110 -0
  112. package/src/commands/native/aftersale/case/scan/query.js +62 -0
  113. package/src/commands/native/aftersale/case/scan/scan.js +78 -0
  114. package/src/commands/native/aftersale/case/scan/schema.json +964 -0
  115. package/src/commands/native/aftersale/case/scan/search.js +108 -0
  116. package/src/commands/native/aftersale/commands.index.json +42 -0
  117. package/src/commands/native/aftersale/domain.json +3 -0
  118. package/src/commands/native/aftersale/refund/list/command.js +97 -0
  119. package/src/commands/native/aftersale/refund/list/money.js +25 -0
  120. package/src/commands/native/aftersale/refund/list/projection.js +50 -0
  121. package/src/commands/native/aftersale/refund/list/query.js +73 -0
  122. package/src/commands/native/aftersale/refund/list/schema.json +130 -0
  123. package/src/commands/native/aftersale/shared/query.js +58 -0
  124. package/src/commands/native/aftersale/shared/search.js +128 -0
  125. package/src/commands/native/benefit/card-definition/get/command.js +110 -0
  126. package/src/commands/native/benefit/card-definition/get/schema.json +545 -0
  127. package/src/commands/native/benefit/card-definition/list/command.js +105 -0
  128. package/src/commands/native/benefit/card-definition/list/schema.json +690 -0
  129. package/src/commands/native/benefit/card-grant/list/command.js +135 -0
  130. package/src/commands/native/benefit/card-grant/list/schema.json +758 -0
  131. package/src/commands/native/benefit/commands.index.json +51 -0
  132. package/src/commands/native/benefit/customer-card/get/command.js +110 -0
  133. package/src/commands/native/benefit/customer-card/get/schema.json +340 -0
  134. package/src/commands/native/benefit/customer-card/list/command.js +102 -0
  135. package/src/commands/native/benefit/customer-card/list/schema.json +731 -0
  136. package/src/commands/native/benefit/domain.json +3 -0
  137. package/src/commands/native/coupon/activity/get/command.js +183 -0
  138. package/src/commands/native/coupon/activity/get/schema.json +624 -0
  139. package/src/commands/native/coupon/activity/list/command.js +169 -0
  140. package/src/commands/native/coupon/activity/list/schema.json +845 -0
  141. package/src/commands/native/coupon/commands.index.json +42 -0
  142. package/src/commands/native/coupon/domain.json +3 -0
  143. package/src/commands/native/coupon/shared/query.js +15 -0
  144. package/src/commands/native/coupon/voucher/get/command.js +113 -0
  145. package/src/commands/native/coupon/voucher/get/schema.json +147 -0
  146. package/src/commands/native/coupon/voucher/list/command.js +155 -0
  147. package/src/commands/native/coupon/voucher/list/schema.json +772 -0
  148. package/src/commands/native/customer/commands.index.json +96 -0
  149. package/src/commands/native/customer/customer/get/adapter.js +82 -0
  150. package/src/commands/native/customer/customer/get/command.js +106 -0
  151. package/src/commands/native/customer/customer/get/schema.json +958 -0
  152. package/src/commands/native/customer/customer/list/command.js +78 -0
  153. package/src/commands/native/customer/customer/list/input.js +145 -0
  154. package/src/commands/native/customer/customer/list/query.js +103 -0
  155. package/src/commands/native/customer/customer/list/schema.json +969 -0
  156. package/src/commands/native/customer/customer/scan/command.js +80 -0
  157. package/src/commands/native/customer/customer/scan/scan.js +92 -0
  158. package/src/commands/native/customer/customer/scan/schema.json +211 -0
  159. package/src/commands/native/customer/customer-tag/get/command.js +166 -0
  160. package/src/commands/native/customer/customer-tag/get/schema.json +317 -0
  161. package/src/commands/native/customer/customer-tag/list/command.js +143 -0
  162. package/src/commands/native/customer/customer-tag/list/schema.json +259 -0
  163. package/src/commands/native/customer/domain.json +3 -0
  164. package/src/commands/native/customer/segment/list/command.js +96 -0
  165. package/src/commands/native/customer/segment/list/query.js +98 -0
  166. package/src/commands/native/customer/segment/list/schema.json +135 -0
  167. package/src/commands/native/customer/segment-customer/list/command.js +171 -0
  168. package/src/commands/native/customer/segment-customer/list/schema.json +123 -0
  169. package/src/commands/native/customer/shared/search-input.js +179 -0
  170. package/src/commands/native/customer/shared/search-page.js +54 -0
  171. package/src/commands/native/customer/tag/get/command.js +73 -0
  172. package/src/commands/native/customer/tag/get/schema.json +339 -0
  173. package/src/commands/native/customer/tagcategory/get/command.js +80 -0
  174. package/src/commands/native/customer/tagcategory/get/query.js +98 -0
  175. package/src/commands/native/customer/tagcategory/get/schema.json +339 -0
  176. package/src/commands/native/customer/tagcategory/list/command.js +127 -0
  177. package/src/commands/native/customer/tagcategory/list/schema.json +394 -0
  178. package/src/commands/native/fulfillment/commands.index.json +33 -0
  179. package/src/commands/native/fulfillment/delivery/get/command.js +107 -0
  180. package/src/commands/native/fulfillment/delivery/get/projection.js +142 -0
  181. package/src/commands/native/fulfillment/delivery/get/schema.json +173 -0
  182. package/src/commands/native/fulfillment/domain.json +3 -0
  183. package/src/commands/native/fulfillment/shipment/list/command.js +83 -0
  184. package/src/commands/native/fulfillment/shipment/list/projection.js +130 -0
  185. package/src/commands/native/fulfillment/shipment/list/schema.json +752 -0
  186. package/src/commands/native/fulfillment/waybill/get/command.js +193 -0
  187. package/src/commands/native/fulfillment/waybill/get/response.js +68 -0
  188. package/src/commands/native/fulfillment/waybill/get/schema.json +190 -0
  189. package/src/commands/native/interaction/commands.index.json +24 -0
  190. package/src/commands/native/interaction/domain.json +3 -0
  191. package/src/commands/native/interaction/lottery/get/command.js +61 -0
  192. package/src/commands/native/interaction/lottery/get/query.js +152 -0
  193. package/src/commands/native/interaction/lottery/get/schema.json +1004 -0
  194. package/src/commands/native/interaction/lottery/list/command.js +176 -0
  195. package/src/commands/native/interaction/lottery/list/schema.json +898 -0
  196. package/src/commands/native/item/attribute/list/command.js +122 -0
  197. package/src/commands/native/item/attribute/list/schema.json +727 -0
  198. package/src/commands/native/item/brand/list/command.js +114 -0
  199. package/src/commands/native/item/brand/list/schema.json +725 -0
  200. package/src/commands/native/item/classification/get/command.js +87 -0
  201. package/src/commands/native/item/classification/get/schema.json +596 -0
  202. package/src/commands/native/item/classification/list/command.js +105 -0
  203. package/src/commands/native/item/classification/list/schema.json +676 -0
  204. package/src/commands/native/item/commands.index.json +87 -0
  205. package/src/commands/native/item/domain.json +1 -0
  206. package/src/commands/native/item/group/list/command.js +122 -0
  207. package/src/commands/native/item/group/list/schema.json +809 -0
  208. package/src/commands/native/item/item/get/command.js +122 -0
  209. package/src/commands/native/item/item/get/schema.json +3799 -0
  210. package/src/commands/native/item/item/list/command.js +7 -0
  211. package/src/commands/native/item/item/list/schema.json +1118 -0
  212. package/src/commands/native/item/item/scan/command.js +7 -0
  213. package/src/commands/native/item/item/scan/schema.json +1046 -0
  214. package/src/commands/native/item/item-content/get/command.js +54 -0
  215. package/src/commands/native/item/item-content/get/schema.json +677 -0
  216. package/src/commands/native/item/shared/api.js +31 -0
  217. package/src/commands/native/item/shared/content.js +20 -0
  218. package/src/commands/native/item/shared/diagnostics.js +61 -0
  219. package/src/commands/native/item/shared/h5.js +63 -0
  220. package/src/commands/native/item/shared/identity.js +62 -0
  221. package/src/commands/native/item/shared/normalize.js +49 -0
  222. package/src/commands/native/item/shared/scope.js +22 -0
  223. package/src/commands/native/item/shared/search-command.js +61 -0
  224. package/src/commands/native/item/shared/search-options.js +150 -0
  225. package/src/commands/native/item/shared/search.js +158 -0
  226. package/src/commands/native/member/commands.index.json +60 -0
  227. package/src/commands/native/member/customer-level/get/command.js +122 -0
  228. package/src/commands/native/member/customer-level/get/schema.json +300 -0
  229. package/src/commands/native/member/domain.json +3 -0
  230. package/src/commands/native/member/growth/get/command.js +64 -0
  231. package/src/commands/native/member/growth/get/schema.json +283 -0
  232. package/src/commands/native/member/growth-log/list/command.js +203 -0
  233. package/src/commands/native/member/growth-log/list/schema.json +695 -0
  234. package/src/commands/native/member/level/get/command.js +70 -0
  235. package/src/commands/native/member/level/get/query.js +125 -0
  236. package/src/commands/native/member/level/get/schema.json +339 -0
  237. package/src/commands/native/member/level/list/command.js +50 -0
  238. package/src/commands/native/member/level/list/query.js +109 -0
  239. package/src/commands/native/member/level/list/schema.json +104 -0
  240. package/src/commands/native/member/membership/get/command.js +78 -0
  241. package/src/commands/native/member/membership/get/schema.json +283 -0
  242. package/src/commands/native/order/commands.index.json +33 -0
  243. package/src/commands/native/order/domain.json +3 -0
  244. package/src/commands/native/order/order/get/command.js +155 -0
  245. package/src/commands/native/order/order/get/schema.json +1167 -0
  246. package/src/commands/native/order/order/list/command.js +230 -0
  247. package/src/commands/native/order/order/list/schema.json +1363 -0
  248. package/src/commands/native/order/order/scan/command.js +148 -0
  249. package/src/commands/native/order/order/scan/scan.js +89 -0
  250. package/src/commands/native/order/order/scan/schema.json +1445 -0
  251. package/src/commands/native/order/shared/projection.js +183 -0
  252. package/src/commands/native/order/shared/query.js +84 -0
  253. package/src/commands/native/order/shared/search.js +112 -0
  254. package/src/commands/native/org/commands.index.json +42 -0
  255. package/src/commands/native/org/domain.json +3 -0
  256. package/src/commands/native/org/shared/single-staff.js +115 -0
  257. package/src/commands/native/org/staff/get/command.js +148 -0
  258. package/src/commands/native/org/staff/get/schema.json +114 -0
  259. package/src/commands/native/org/staff-role/get/command.js +45 -0
  260. package/src/commands/native/org/staff-role/get/schema.json +93 -0
  261. package/src/commands/native/org/unit/get/command.js +131 -0
  262. package/src/commands/native/org/unit/get/schema.json +478 -0
  263. package/src/commands/native/org/unit/list/command.js +187 -0
  264. package/src/commands/native/org/unit/list/schema.json +828 -0
  265. package/src/commands/native/points/account/get/command.js +65 -0
  266. package/src/commands/native/points/account/get/schema.json +303 -0
  267. package/src/commands/native/points/commands.index.json +33 -0
  268. package/src/commands/native/points/domain.json +3 -0
  269. package/src/commands/native/points/log/list/command.js +141 -0
  270. package/src/commands/native/points/log/list/schema.json +761 -0
  271. package/src/commands/native/points/rule/list/command.js +82 -0
  272. package/src/commands/native/points/rule/list/schema.json +294 -0
  273. package/src/commands/native/privacy/commands.index.json +15 -0
  274. package/src/commands/native/privacy/domain.json +3 -0
  275. package/src/commands/native/privacy/field/decrypt/command.js +185 -0
  276. package/src/commands/native/privacy/field/decrypt/schema.json +656 -0
  277. package/src/commands/native/privacy/shared/order-source.js +33 -0
  278. package/src/commands/native/stock/commands.index.json +15 -0
  279. package/src/commands/native/stock/domain.json +3 -0
  280. package/src/commands/native/stock/log/list/command.js +207 -0
  281. package/src/commands/native/stock/log/list/schema.json +922 -0
  282. package/src/commands/native/valuecard/card/get/command.js +107 -0
  283. package/src/commands/native/valuecard/card/get/schema.json +683 -0
  284. package/src/commands/native/valuecard/card/list/command.js +136 -0
  285. package/src/commands/native/valuecard/card/list/pagination.js +23 -0
  286. package/src/commands/native/valuecard/card/list/schema.json +780 -0
  287. package/src/commands/native/valuecard/commands.index.json +24 -0
  288. package/src/commands/native/valuecard/domain.json +3 -0
  289. package/src/commands/native/valuecard/shared/projection.js +57 -0
  290. package/src/commands/system/api.js +47 -0
  291. package/src/commands/system/auth.js +118 -0
  292. package/src/commands/system/contracts.js +373 -0
  293. package/src/commands/system/doctor.js +24 -0
  294. package/src/commands/system/install.js +41 -0
  295. package/src/commands/system/printer.js +16 -0
  296. package/src/commands/system/schema.js +162 -0
  297. package/src/commands/system/shop-guidance.js +9 -0
  298. package/src/commands/system/shop.js +237 -0
  299. package/src/commands/system/skills.js +49 -0
  300. package/src/execution/beijing-date-time.js +29 -0
  301. package/src/execution/beijing-time.js +21 -0
  302. package/src/execution/bounded-input.js +42 -0
  303. package/src/execution/command-io.js +137 -0
  304. package/src/execution/command-policy.js +41 -0
  305. package/src/execution/command-schema.js +131 -0
  306. package/src/execution/datetime.js +83 -0
  307. package/src/execution/error-details.js +399 -0
  308. package/src/execution/error-model.js +82 -0
  309. package/src/execution/exact-json.js +80 -0
  310. package/src/execution/list-total.js +10 -0
  311. package/src/execution/money.js +59 -0
  312. package/src/execution/parser-error.js +66 -0
  313. package/src/execution/privacy.js +197 -0
  314. package/src/execution/public-schema.js +52 -0
  315. package/src/execution/query-api.js +101 -0
  316. package/src/execution/range.js +84 -0
  317. package/src/execution/request-state.js +55 -0
  318. package/src/execution/schema-completeness.js +116 -0
  319. package/src/execution/shop-query.js +54 -0
  320. package/src/execution/target-shop-default.js +23 -0
  321. package/src/execution/target-shop.js +49 -0
  322. package/src/identity/context-store.js +54 -0
  323. package/src/identity/context.js +38 -0
  324. package/src/installation/install.js +158 -0
  325. package/src/installation/npm-error.js +93 -0
  326. package/src/installation/skill.js +113 -0
  327. package/src/transport/account-api.js +152 -0
  328. package/src/transport/api.js +199 -0
  329. package/src/transport/shop-app.js +63 -0
@@ -0,0 +1,752 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "required": [
6
+ "kdtId",
7
+ "orderNo"
8
+ ],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "kdtId": {
12
+ "$ref": "#/definitions/shopId"
13
+ },
14
+ "orderNo": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "maxLength": 128,
18
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$(?![\\s\\S])",
19
+ "description": "原始订单号,不限定前缀或位数;保留原值,不含空白或控制字符。"
20
+ }
21
+ },
22
+ "description": "CLI 解析参数后的订单发货单列表输入。"
23
+ },
24
+ "output": {
25
+ "type": "object",
26
+ "required": [
27
+ "data"
28
+ ],
29
+ "additionalProperties": false,
30
+ "properties": {
31
+ "data": {
32
+ "type": "object",
33
+ "required": [
34
+ "shipments"
35
+ ],
36
+ "additionalProperties": false,
37
+ "properties": {
38
+ "shipments": {
39
+ "type": "array",
40
+ "maxItems": 1000,
41
+ "items": {
42
+ "$ref": "#/definitions/shipment"
43
+ },
44
+ "description": "本次接口返回的订单发货单集合,保持顺序,零张、一张、多张均为数组。空数组不证明订单不存在、无需发货或履约完成。不表示完整历史。"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "preview": {
51
+ "type": "object",
52
+ "required": [
53
+ "scope",
54
+ "prerequisites",
55
+ "requests",
56
+ "result"
57
+ ],
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "scope": {
61
+ "type": "object",
62
+ "required": [
63
+ "kdtId"
64
+ ],
65
+ "additionalProperties": false,
66
+ "properties": {
67
+ "kdtId": {
68
+ "$ref": "#/definitions/shopId"
69
+ }
70
+ }
71
+ },
72
+ "prerequisites": {
73
+ "type": "array",
74
+ "minItems": 1,
75
+ "maxItems": 1,
76
+ "items": {
77
+ "type": "object",
78
+ "required": [
79
+ "method",
80
+ "path",
81
+ "body"
82
+ ],
83
+ "additionalProperties": false,
84
+ "properties": {
85
+ "method": {
86
+ "const": "POST"
87
+ },
88
+ "path": {
89
+ "const": "youzan.shop.basic.get/3.0.0"
90
+ },
91
+ "body": {
92
+ "type": "object",
93
+ "additionalProperties": false
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "requests": {
99
+ "type": "array",
100
+ "minItems": 1,
101
+ "maxItems": 1,
102
+ "items": {
103
+ "type": "object",
104
+ "required": [
105
+ "method",
106
+ "path",
107
+ "body"
108
+ ],
109
+ "additionalProperties": false,
110
+ "properties": {
111
+ "method": {
112
+ "const": "POST"
113
+ },
114
+ "path": {
115
+ "const": "youzan.trade.dc.query.querybyorderno/1.0.1"
116
+ },
117
+ "body": {
118
+ "type": "object",
119
+ "required": [
120
+ "tid",
121
+ "include_item_delivery_status",
122
+ "include_dist_order"
123
+ ],
124
+ "additionalProperties": false,
125
+ "properties": {
126
+ "tid": {
127
+ "type": "string",
128
+ "pattern": "^\\*{3}[^\\s\\u0000-\\u001f\\u007f-\\u009f]{1,4}$(?![\\s\\S])",
129
+ "description": "脱敏订单号,固定 *** 加原始订单号末尾最多四个字符,不限定数字。"
130
+ },
131
+ "include_item_delivery_status": {
132
+ "const": true
133
+ },
134
+ "include_dist_order": {
135
+ "const": true
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ },
142
+ "result": {
143
+ "type": "object",
144
+ "required": [
145
+ "collection",
146
+ "items",
147
+ "deliveries",
148
+ "pagination"
149
+ ],
150
+ "additionalProperties": false,
151
+ "properties": {
152
+ "collection": {
153
+ "const": "data.shipments"
154
+ },
155
+ "items": {
156
+ "const": true
157
+ },
158
+ "deliveries": {
159
+ "const": true
160
+ },
161
+ "pagination": {
162
+ "const": false
163
+ }
164
+ }
165
+ }
166
+ }
167
+ },
168
+ "error": {
169
+ "type": "object",
170
+ "required": [
171
+ "success",
172
+ "code",
173
+ "message",
174
+ "details"
175
+ ],
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "success": {
179
+ "const": false
180
+ },
181
+ "code": {
182
+ "const": -10001
183
+ },
184
+ "message": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ },
188
+ "details": {
189
+ "type": "object",
190
+ "required": [
191
+ "category",
192
+ "stage",
193
+ "command",
194
+ "targetScope",
195
+ "requestState",
196
+ "nextStep",
197
+ "errorVersion",
198
+ "recovery",
199
+ "execution"
200
+ ],
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "category": {
204
+ "enum": [
205
+ "validation",
206
+ "configuration",
207
+ "parameter",
208
+ "permission",
209
+ "authentication",
210
+ "scope_unresolved",
211
+ "transport",
212
+ "http",
213
+ "protocol",
214
+ "business_rejected",
215
+ "target_mismatch",
216
+ "budget_exceeded"
217
+ ]
218
+ },
219
+ "stage": {
220
+ "type": "string",
221
+ "minLength": 1
222
+ },
223
+ "command": {
224
+ "const": "fulfillment.shipment.list"
225
+ },
226
+ "targetScope": {
227
+ "type": "object",
228
+ "additionalProperties": false,
229
+ "properties": {
230
+ "kdtId": {
231
+ "$ref": "#/definitions/shopId"
232
+ }
233
+ }
234
+ },
235
+ "requestState": {
236
+ "enum": [
237
+ "not_sent",
238
+ "sent",
239
+ "unknown"
240
+ ]
241
+ },
242
+ "nextStep": {
243
+ "type": "string",
244
+ "minLength": 1
245
+ },
246
+ "api": {
247
+ "type": "string"
248
+ },
249
+ "httpStatus": {
250
+ "type": "integer"
251
+ },
252
+ "businessCode": {
253
+ "anyOf": [
254
+ {
255
+ "type": "integer"
256
+ },
257
+ {
258
+ "type": "string"
259
+ }
260
+ ]
261
+ },
262
+ "gatewayCode": {
263
+ "anyOf": [
264
+ {
265
+ "type": "integer"
266
+ },
267
+ {
268
+ "type": "string"
269
+ }
270
+ ]
271
+ },
272
+ "trace_id": {
273
+ "type": "string"
274
+ },
275
+ "request_id": {
276
+ "type": "string"
277
+ },
278
+ "errorVersion": {
279
+ "const": 2,
280
+ "description": "本命令采用错误诊断协议第二版。"
281
+ },
282
+ "issues": {
283
+ "type": "array",
284
+ "minItems": 1,
285
+ "maxItems": 16,
286
+ "items": {
287
+ "$ref": "#/definitions/diagnosticIssue"
288
+ },
289
+ "description": "最多十六个已定位问题,不包含收到的原值。"
290
+ },
291
+ "issuesTruncated": {
292
+ "const": true,
293
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
294
+ },
295
+ "recovery": {
296
+ "$ref": "#/definitions/diagnosticRecovery",
297
+ "description": "受限的恢复说明,不会自动执行。"
298
+ },
299
+ "execution": {
300
+ "$ref": "#/definitions/diagnosticExecution",
301
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
302
+ }
303
+ }
304
+ }
305
+ }
306
+ },
307
+ "definitions": {
308
+ "shopId": {
309
+ "type": "integer",
310
+ "minimum": 1,
311
+ "maximum": 9007199254740991
312
+ },
313
+ "safeInteger": {
314
+ "type": "integer",
315
+ "minimum": 0,
316
+ "maximum": 9007199254740991
317
+ },
318
+ "shipment": {
319
+ "type": "object",
320
+ "required": [
321
+ "shipmentNo",
322
+ "orderNo",
323
+ "kdtId",
324
+ "status",
325
+ "deliveryMethod",
326
+ "items",
327
+ "deliveries"
328
+ ],
329
+ "additionalProperties": false,
330
+ "properties": {
331
+ "shipmentNo": {
332
+ "type": "string",
333
+ "minLength": 1,
334
+ "description": "发货单身份,非空字符串,本次集合内唯一;不是配送单号。"
335
+ },
336
+ "orderNo": {
337
+ "type": "string",
338
+ "minLength": 1,
339
+ "maxLength": 128,
340
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$(?![\\s\\S])",
341
+ "description": "所属订单号,必须与请求订单号一致。"
342
+ },
343
+ "kdtId": {
344
+ "$ref": "#/definitions/shopId",
345
+ "description": "所属店铺,必须与请求及凭证核验的店铺一致。"
346
+ },
347
+ "status": {
348
+ "$ref": "#/definitions/safeInteger",
349
+ "description": "货单状态:0 待发货;1 已发货;2 无需发货。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
350
+ },
351
+ "deliveryMethod": {
352
+ "$ref": "#/definitions/safeInteger",
353
+ "description": "配送方式:1 快递;2 同城送;3 自提。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
354
+ },
355
+ "flowType": {
356
+ "$ref": "#/definitions/safeInteger",
357
+ "description": "可选流程类型:1 基于订单发货流程;2 基于货单发货流程;3 货单升级;4 多期订单发货流程;5 多地址发货流程;6 单订单、单商品、多运单发货流程。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
358
+ },
359
+ "mode": {
360
+ "$ref": "#/definitions/safeInteger",
361
+ "description": "可选发货模式:0 手动发货;1 系统自动发货。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
362
+ },
363
+ "deliveryPoint": {
364
+ "type": "object",
365
+ "required": [
366
+ "id",
367
+ "type"
368
+ ],
369
+ "additionalProperties": false,
370
+ "properties": {
371
+ "id": {
372
+ "type": "string",
373
+ "pattern": "^[1-9]\\d*$",
374
+ "description": "正安全整数无损编码为十进制字符串,范围 1..9007199254740991,不作为店铺 ID。"
375
+ },
376
+ "type": {
377
+ "$ref": "#/definitions/safeInteger",
378
+ "description": "出货点类型:0 门店;1 仓库;2 总店;3 网点。总店为业务对象称呼,不代表总部授权身份。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
379
+ }
380
+ },
381
+ "description": "出货点 ID 与类型均取得时返回,均缺失或 null 时省略,仅取得一个则失败。"
382
+ },
383
+ "remark": {
384
+ "type": "string",
385
+ "description": "可选货单备注,保留原文和空字符串;缺失或 null 时省略。"
386
+ },
387
+ "items": {
388
+ "type": "array",
389
+ "maxItems": 1000,
390
+ "items": {
391
+ "type": "object",
392
+ "required": [
393
+ "orderItemId",
394
+ "quantity"
395
+ ],
396
+ "additionalProperties": false,
397
+ "properties": {
398
+ "orderItemId": {
399
+ "type": "string",
400
+ "pattern": "^[1-9]\\d*$",
401
+ "description": "交易订单条目 ID,原始 JSON 正整数数字词元保真转字符串;不是商品主档 ID。"
402
+ },
403
+ "quantity": {
404
+ "$ref": "#/definitions/safeInteger",
405
+ "description": "本行货单商品数量,非负安全整数,保留 0,不从购买数量补值。"
406
+ }
407
+ }
408
+ },
409
+ "description": "固定返回,保留顺序与重复商品行,可为空;缺失或 null 整体失败。"
410
+ },
411
+ "deliveries": {
412
+ "type": "array",
413
+ "maxItems": 1000,
414
+ "items": {
415
+ "type": "object",
416
+ "required": [
417
+ "deliveryId",
418
+ "status",
419
+ "deliveryMethod"
420
+ ],
421
+ "additionalProperties": false,
422
+ "properties": {
423
+ "deliveryId": {
424
+ "type": "string",
425
+ "minLength": 1
426
+ },
427
+ "status": {
428
+ "$ref": "#/definitions/safeInteger",
429
+ "description": "配送引用状态:0 未发货;1 发货中;2 已发货;3 已取消。与货单状态分别解释。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
430
+ },
431
+ "deliveryMethod": {
432
+ "$ref": "#/definitions/safeInteger",
433
+ "description": "配送方式:1 快递;2 同城送;3 自提。均为 JSON 数字;未来未知非负安全整数原值保留,不推断含义,不接受字符串数字。"
434
+ }
435
+ }
436
+ },
437
+ "description": "固定返回的配送引用,可为空;缺失或 null 整体失败,不补查配送详情。配送单 ID 在本次全部货单中不得重复。"
438
+ }
439
+ }
440
+ },
441
+ "diagnosticExpected": {
442
+ "type": "object",
443
+ "additionalProperties": false,
444
+ "required": [],
445
+ "properties": {
446
+ "type": {
447
+ "anyOf": [
448
+ {
449
+ "type": "string",
450
+ "description": "预期的 JSON 类型。"
451
+ },
452
+ {
453
+ "type": "array",
454
+ "items": {
455
+ "type": "string",
456
+ "description": "预期的 JSON 类型。"
457
+ }
458
+ }
459
+ ],
460
+ "description": "同版模型允许的类型。"
461
+ },
462
+ "enum": {
463
+ "type": "array",
464
+ "items": {
465
+ "anyOf": [
466
+ {
467
+ "type": "string"
468
+ },
469
+ {
470
+ "type": "number"
471
+ },
472
+ {
473
+ "type": "boolean"
474
+ },
475
+ {
476
+ "type": "null"
477
+ }
478
+ ],
479
+ "description": "契约声明的静态标量约束。"
480
+ },
481
+ "description": "同版模型允许的静态值。"
482
+ },
483
+ "const": {
484
+ "anyOf": [
485
+ {
486
+ "type": "string"
487
+ },
488
+ {
489
+ "type": "number"
490
+ },
491
+ {
492
+ "type": "boolean"
493
+ },
494
+ {
495
+ "type": "null"
496
+ }
497
+ ],
498
+ "description": "契约声明的静态标量约束。"
499
+ },
500
+ "minimum": {
501
+ "type": "number",
502
+ "description": "包含的最小值。"
503
+ },
504
+ "maximum": {
505
+ "type": "number",
506
+ "description": "包含的最大值。"
507
+ },
508
+ "exclusiveMinimum": {
509
+ "type": "number",
510
+ "description": "不包含的最小值。"
511
+ },
512
+ "exclusiveMaximum": {
513
+ "type": "number",
514
+ "description": "不包含的最大值。"
515
+ },
516
+ "minLength": {
517
+ "type": "integer",
518
+ "description": "最少字符数。"
519
+ },
520
+ "maxLength": {
521
+ "type": "integer",
522
+ "description": "最多字符数。"
523
+ },
524
+ "minItems": {
525
+ "type": "integer",
526
+ "description": "最少元素数。"
527
+ },
528
+ "maxItems": {
529
+ "type": "integer",
530
+ "description": "最多元素数。"
531
+ },
532
+ "format": {
533
+ "type": "string",
534
+ "description": "同版模型声明的格式。"
535
+ },
536
+ "pattern": {
537
+ "type": "string",
538
+ "description": "同版模型声明的字符约束。"
539
+ },
540
+ "additionalProperties": {
541
+ "const": false,
542
+ "description": "对象拒绝契约以外的属性。"
543
+ },
544
+ "contains": {
545
+ "type": "object",
546
+ "additionalProperties": false,
547
+ "required": [
548
+ "const"
549
+ ],
550
+ "properties": {
551
+ "const": {
552
+ "anyOf": [
553
+ {
554
+ "type": "string"
555
+ },
556
+ {
557
+ "type": "number"
558
+ },
559
+ {
560
+ "type": "boolean"
561
+ },
562
+ {
563
+ "type": "null"
564
+ }
565
+ ],
566
+ "description": "契约声明的静态标量约束。"
567
+ }
568
+ }
569
+ },
570
+ "items": {
571
+ "type": "object",
572
+ "additionalProperties": false,
573
+ "required": [
574
+ "enum"
575
+ ],
576
+ "properties": {
577
+ "enum": {
578
+ "type": "array",
579
+ "items": {
580
+ "anyOf": [
581
+ {
582
+ "type": "string"
583
+ },
584
+ {
585
+ "type": "number"
586
+ },
587
+ {
588
+ "type": "boolean"
589
+ },
590
+ {
591
+ "type": "null"
592
+ }
593
+ ],
594
+ "description": "契约声明的静态标量约束。"
595
+ },
596
+ "description": "元素允许的静态值。"
597
+ }
598
+ }
599
+ }
600
+ }
601
+ },
602
+ "diagnosticIssue": {
603
+ "type": "object",
604
+ "additionalProperties": false,
605
+ "required": [
606
+ "source",
607
+ "reason"
608
+ ],
609
+ "properties": {
610
+ "source": {
611
+ "enum": [
612
+ "argv",
613
+ "input",
614
+ "context",
615
+ "output",
616
+ "preview"
617
+ ],
618
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
619
+ },
620
+ "path": {
621
+ "type": "string",
622
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
623
+ },
624
+ "option": {
625
+ "type": "string",
626
+ "description": "可定位时给出的已注册 CLI 选项。"
627
+ },
628
+ "reason": {
629
+ "enum": [
630
+ "required",
631
+ "invalid_type",
632
+ "invalid_choice",
633
+ "out_of_range",
634
+ "invalid_format",
635
+ "conditional_required",
636
+ "constraint",
637
+ "unexpected_property",
638
+ "unknown_option",
639
+ "unknown_command",
640
+ "excess_arguments",
641
+ "missing_value"
642
+ ],
643
+ "description": "字段违反的约束类型,原始值不回显。"
644
+ },
645
+ "expected": {
646
+ "$ref": "#/definitions/diagnosticExpected",
647
+ "description": "同版契约的静态预期。"
648
+ },
649
+ "relatedPaths": {
650
+ "type": "array",
651
+ "items": {
652
+ "type": "string",
653
+ "description": "关联字段的 JSON Pointer。"
654
+ },
655
+ "description": "触发条件约束的关联字段。"
656
+ }
657
+ }
658
+ },
659
+ "diagnosticRecovery": {
660
+ "type": "object",
661
+ "additionalProperties": false,
662
+ "required": [
663
+ "action",
664
+ "automaticBusinessRetry"
665
+ ],
666
+ "properties": {
667
+ "action": {
668
+ "enum": [
669
+ "correct_input",
670
+ "complete_authentication",
671
+ "request_access_review",
672
+ "stop_and_inspect"
673
+ ],
674
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
675
+ },
676
+ "automaticBusinessRetry": {
677
+ "const": false,
678
+ "description": "不据此自动重放业务请求。"
679
+ }
680
+ }
681
+ },
682
+ "diagnosticExecution": {
683
+ "type": "object",
684
+ "additionalProperties": false,
685
+ "required": [
686
+ "requestState",
687
+ "coverage",
688
+ "observedAttempts"
689
+ ],
690
+ "properties": {
691
+ "requestState": {
692
+ "enum": [
693
+ "not_sent",
694
+ "sent",
695
+ "unknown"
696
+ ],
697
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
698
+ },
699
+ "coverage": {
700
+ "enum": [
701
+ "complete",
702
+ "partial"
703
+ ],
704
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
705
+ },
706
+ "observedAttempts": {
707
+ "type": "integer",
708
+ "minimum": 0,
709
+ "maximum": 9007199254740991,
710
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
711
+ }
712
+ }
713
+ }
714
+ },
715
+ "modules": {
716
+ "items": {
717
+ "base": true,
718
+ "upstreamPath": "data[].delivery_order_items",
719
+ "required": true,
720
+ "description": "每张发货单的订单商品明细。"
721
+ },
722
+ "deliveries": {
723
+ "base": true,
724
+ "upstreamPath": "data[].dist_order_d_t_os",
725
+ "required": true,
726
+ "description": "每张发货单的配送引用。"
727
+ }
728
+ },
729
+ "api": {
730
+ "method": "POST",
731
+ "path": "youzan.trade.dc.query.querybyorderno/1.0.1"
732
+ },
733
+ "notes": [
734
+ "--kdt-id 省略时使用本次有效上下文 shopId;显式提供的非法值不回退。两者都缺失时拒绝;目标范围、同店核验和服务端权限仍按本命令校验。",
735
+ "订单号通常为 E/V/C 开头加 23 位数字,仅供核对,不限定前缀、数字组合或 24 位长度;按原值传递。仅保留非空、无空白或控制字符和最多 128 字符的文本保护;服务端仍判断支持范围和对象归属。",
736
+ "必须提供完整订单号;店铺省略时使用当前上下文,显式非法店铺不回退;不提供 include、shipment-no、分页或旧参数别名。商品明细与配送引用固定包含。",
737
+ "真实执行需有效 userId/hq/shopId/orgType 上下文,目标店铺必须等于上下文 shopId,包括总部上下文;凭证店铺回读仍不代替服务端员工授权。缺上下文只可显式完整输入本地预览,无效上下文拒绝。",
738
+ "适用于接口支持的微商城、零售单店及相应连锁 D、L 组织;at: all 不表示查询所有店铺或跨店授权。",
739
+ "最多一次店铺核验与一次业务读取,每请求 10 秒,不自动重试、切店或换身份。",
740
+ "主响应读取后最多 10 MiB,每个集合最多 1000 条,最终 JSON 最多 5 MiB;超额整体失败,不截断。读取后阈值不代表流式硬上限。",
741
+ "没有分页,不构造 total、hasMore 或 pagination;固定集合缺失、重复货单、重复配送及任一关系或字段无效整体失败。",
742
+ "所有输出码均为 JSON 数字,已知含义按字段说明,未知非负安全整数原值保留。可选 flowType、mode、remark 缺省或 null 时省略。",
743
+ "预览仅保留订单号末四位,不读取 token、网关环境或网络,不证明订单存在或授权有效。"
744
+ ],
745
+ "success": {
746
+ "description": "店铺核验通过,主接口成功且 data 是满足固定模型的发货单数组。"
747
+ },
748
+ "errors": {
749
+ "description": "失败 stdout 为空,stderr 为脱敏错误 JSON;不返回部分成功,不自动重试或切换店铺。",
750
+ "diagnosticsVersion": 2
751
+ }
752
+ }