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

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 +106 -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 +103 -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,1167 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "properties": {
7
+ "scope": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "kdtId": {
12
+ "$ref": "#/definitions/shopId"
13
+ },
14
+ "orderNo": {
15
+ "$ref": "#/definitions/orderNo"
16
+ }
17
+ },
18
+ "required": [
19
+ "kdtId",
20
+ "orderNo"
21
+ ]
22
+ },
23
+ "include": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "string",
27
+ "enum": [
28
+ "buyer",
29
+ "address",
30
+ "remark",
31
+ "source",
32
+ "promotion",
33
+ "aftersale",
34
+ "fulfillment"
35
+ ]
36
+ },
37
+ "uniqueItems": true,
38
+ "description": "逗号分隔输入裁首尾空白、去重;空值、空项或未知模块拒绝。仅影响投影。"
39
+ },
40
+ "format": {
41
+ "type": "string",
42
+ "enum": [
43
+ "json",
44
+ "pretty"
45
+ ],
46
+ "description": "仅 JSON 缩进不同。"
47
+ },
48
+ "decrypt": {
49
+ "$ref": "#/definitions/decryptFields"
50
+ },
51
+ "reason": {
52
+ "type": "string",
53
+ "minLength": 1,
54
+ "maxLength": 200,
55
+ "pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]+$",
56
+ "description": "仅 decrypt 时必需,裁首尾空白后 1 至 200 个 Unicode 码点,无换行或控制字符;不填写个人信息。用途不授予权限。"
57
+ },
58
+ "dryRun": {
59
+ "type": "boolean",
60
+ "description": "只校验和预览,不读凭证、不联网。"
61
+ }
62
+ },
63
+ "dependencies": {
64
+ "decrypt": [
65
+ "reason"
66
+ ],
67
+ "reason": [
68
+ "decrypt"
69
+ ]
70
+ },
71
+ "allOf": [
72
+ {
73
+ "if": {
74
+ "required": [
75
+ "decrypt"
76
+ ],
77
+ "properties": {
78
+ "decrypt": {
79
+ "$ref": "#/definitions/decryptFields"
80
+ }
81
+ }
82
+ },
83
+ "then": {
84
+ "properties": {
85
+ "include": {
86
+ "type": "array",
87
+ "contains": {
88
+ "const": "address"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ],
95
+ "required": [
96
+ "scope",
97
+ "include",
98
+ "format",
99
+ "dryRun"
100
+ ]
101
+ },
102
+ "output": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "properties": {
106
+ "data": {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "properties": {
110
+ "order": {
111
+ "$ref": "#/definitions/order"
112
+ },
113
+ "items": {
114
+ "type": "array",
115
+ "items": {
116
+ "$ref": "#/definitions/orderItem"
117
+ },
118
+ "description": "保留交易行顺序和重复商品,不展开套餐子品;实际空数组才输出空数组。"
119
+ },
120
+ "payment": {
121
+ "$ref": "#/definitions/payment"
122
+ },
123
+ "buyer": {
124
+ "$ref": "#/definitions/buyer"
125
+ },
126
+ "address": {
127
+ "$ref": "#/definitions/address"
128
+ },
129
+ "remark": {
130
+ "$ref": "#/definitions/remark"
131
+ },
132
+ "source": {
133
+ "$ref": "#/definitions/source"
134
+ },
135
+ "promotion": {
136
+ "$ref": "#/definitions/promotion"
137
+ },
138
+ "aftersale": {
139
+ "$ref": "#/definitions/aftersale"
140
+ },
141
+ "fulfillment": {
142
+ "$ref": "#/definitions/fulfillment"
143
+ }
144
+ },
145
+ "required": [
146
+ "order",
147
+ "items",
148
+ "payment"
149
+ ]
150
+ }
151
+ },
152
+ "required": [
153
+ "data"
154
+ ]
155
+ },
156
+ "preview": {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "privacy": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "fields": {
165
+ "$ref": "#/definitions/decryptFields"
166
+ },
167
+ "maximumApiRequests": {
168
+ "const": 4
169
+ },
170
+ "requiresSensitiveAuthorization": {
171
+ "const": true
172
+ }
173
+ },
174
+ "required": [
175
+ "fields",
176
+ "maximumApiRequests",
177
+ "requiresSensitiveAuthorization"
178
+ ],
179
+ "description": "仅显式解密时出现。只列字段和调用上限,不含用途、凭证或密文,不表示权限已通过。"
180
+ },
181
+ "requests": {
182
+ "type": "array",
183
+ "minItems": 2,
184
+ "maxItems": 2,
185
+ "additionalItems": false,
186
+ "items": [
187
+ {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "properties": {
191
+ "method": {
192
+ "const": "POST"
193
+ },
194
+ "path": {
195
+ "const": "youzan.shop.basic.get/3.0.0"
196
+ },
197
+ "body": {
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "properties": {},
201
+ "required": []
202
+ }
203
+ },
204
+ "required": [
205
+ "method",
206
+ "path",
207
+ "body"
208
+ ]
209
+ },
210
+ {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "properties": {
214
+ "method": {
215
+ "const": "POST"
216
+ },
217
+ "path": {
218
+ "const": "youzan.trade.get/4.0.2"
219
+ },
220
+ "body": {
221
+ "type": "object",
222
+ "additionalProperties": false,
223
+ "properties": {
224
+ "tid": {
225
+ "$ref": "#/definitions/orderNo"
226
+ }
227
+ },
228
+ "required": [
229
+ "tid"
230
+ ]
231
+ }
232
+ },
233
+ "required": [
234
+ "method",
235
+ "path",
236
+ "body"
237
+ ]
238
+ }
239
+ ]
240
+ }
241
+ },
242
+ "required": [
243
+ "requests"
244
+ ]
245
+ },
246
+ "error": {
247
+ "type": "object",
248
+ "required": [
249
+ "success",
250
+ "code",
251
+ "message",
252
+ "details"
253
+ ],
254
+ "additionalProperties": false,
255
+ "properties": {
256
+ "success": {
257
+ "const": false
258
+ },
259
+ "code": {
260
+ "const": -10001
261
+ },
262
+ "message": {
263
+ "type": "string",
264
+ "minLength": 1
265
+ },
266
+ "details": {
267
+ "type": "object",
268
+ "required": [
269
+ "category",
270
+ "stage",
271
+ "command",
272
+ "targetScope",
273
+ "requestState",
274
+ "nextStep",
275
+ "errorVersion",
276
+ "recovery",
277
+ "execution"
278
+ ],
279
+ "additionalProperties": false,
280
+ "properties": {
281
+ "category": {
282
+ "type": "string",
283
+ "enum": [
284
+ "validation",
285
+ "configuration",
286
+ "authentication",
287
+ "permission",
288
+ "scope_unresolved",
289
+ "http",
290
+ "business_rejected",
291
+ "transport",
292
+ "protocol",
293
+ "limit"
294
+ ]
295
+ },
296
+ "stage": {
297
+ "type": "string",
298
+ "enum": [
299
+ "input",
300
+ "context",
301
+ "configuration",
302
+ "shop-binding",
303
+ "order",
304
+ "orders",
305
+ "scan",
306
+ "sensitive-authorization",
307
+ "source",
308
+ "ciphertext-verification",
309
+ "decryption",
310
+ "sensitive-audit",
311
+ "output-model"
312
+ ]
313
+ },
314
+ "command": {
315
+ "const": "order.order.get"
316
+ },
317
+ "targetScope": {
318
+ "type": "object",
319
+ "additionalProperties": false,
320
+ "properties": {
321
+ "kdtId": {
322
+ "$ref": "#/definitions/shopId"
323
+ }
324
+ },
325
+ "required": []
326
+ },
327
+ "requestState": {
328
+ "enum": [
329
+ "not_sent",
330
+ "sent",
331
+ "unknown"
332
+ ]
333
+ },
334
+ "nextStep": {
335
+ "type": "string",
336
+ "minLength": 1
337
+ },
338
+ "api": {
339
+ "type": "string"
340
+ },
341
+ "httpStatus": {
342
+ "type": "integer"
343
+ },
344
+ "businessCode": {
345
+ "anyOf": [
346
+ {
347
+ "type": "integer",
348
+ "minimum": -9007199254740991,
349
+ "maximum": 9007199254740991
350
+ },
351
+ {
352
+ "type": "string",
353
+ "pattern": "^-?\\d{1,12}$"
354
+ }
355
+ ]
356
+ },
357
+ "gatewayCode": {
358
+ "anyOf": [
359
+ {
360
+ "type": "integer",
361
+ "minimum": -9007199254740991,
362
+ "maximum": 9007199254740991
363
+ },
364
+ {
365
+ "type": "string",
366
+ "pattern": "^-?\\d{1,12}$"
367
+ }
368
+ ]
369
+ },
370
+ "trace_id": {
371
+ "type": "string",
372
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
373
+ },
374
+ "request_id": {
375
+ "type": "string",
376
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
377
+ },
378
+ "errorVersion": {
379
+ "const": 2,
380
+ "description": "本命令采用错误诊断协议第二版。"
381
+ },
382
+ "issues": {
383
+ "type": "array",
384
+ "minItems": 1,
385
+ "maxItems": 16,
386
+ "items": {
387
+ "$ref": "#/definitions/diagnosticIssue"
388
+ },
389
+ "description": "最多十六个已定位问题,不包含收到的原值。"
390
+ },
391
+ "issuesTruncated": {
392
+ "const": true,
393
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
394
+ },
395
+ "recovery": {
396
+ "$ref": "#/definitions/diagnosticRecovery",
397
+ "description": "受限的恢复说明,不会自动执行。"
398
+ },
399
+ "execution": {
400
+ "$ref": "#/definitions/diagnosticExecution",
401
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
402
+ }
403
+ }
404
+ }
405
+ }
406
+ },
407
+ "definitions": {
408
+ "decryptFields": {
409
+ "type": "array",
410
+ "minItems": 1,
411
+ "maxItems": 3,
412
+ "uniqueItems": true,
413
+ "items": {
414
+ "type": "string",
415
+ "enum": [
416
+ "address.receiverName",
417
+ "address.receiverPhone",
418
+ "address.address"
419
+ ],
420
+ "description": "address.receiverName 为收货姓名;address.receiverPhone 为收货联系方式;address.address 为详细收货地址。"
421
+ },
422
+ "description": "逗号分隔字段路径,去首尾空白及去重;拒绝空项、未知字段、通配和数组路径,必须 include address。"
423
+ },
424
+ "id": {
425
+ "type": "string",
426
+ "pattern": "^(?=.*[1-9])\\d+$",
427
+ "description": "十进制正整数 ID 字符串;上游 number 仅接受安全整数,字符串不经浮点转换。"
428
+ },
429
+ "sku_id": {
430
+ "type": "string",
431
+ "pattern": "^\\d+$",
432
+ "description": "规格 ID 字符串,可为 0;统一规格与渠道规格不可互换。"
433
+ },
434
+ "shopId": {
435
+ "type": "string",
436
+ "pattern": "^[1-9]\\d*$",
437
+ "description": "显式目标店铺 ID,输入仅正安全整数;成功输出为实际订单所属店铺。"
438
+ },
439
+ "orderNo": {
440
+ "type": "string",
441
+ "minLength": 1,
442
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$(?![\\s\\S])",
443
+ "maxLength": 128,
444
+ "description": "原始交易订单号,最多 128 字符,不含空白或控制字符;不按前缀或位数判断有效性,不改写原值。"
445
+ },
446
+ "nonemptyText": {
447
+ "type": "string",
448
+ "minLength": 1,
449
+ "pattern": "\\S",
450
+ "description": "非空文本标识或状态;保留业务空格,不解密。"
451
+ },
452
+ "time": {
453
+ "type": "string",
454
+ "format": "beijing-date-time-ms",
455
+ "$comment": "upstream-time:text",
456
+ "description": "固定北京时间 YYYY-MM-DD HH:mm:ss.SSS;来源为文本且仅秒精度,拒绝非零毫秒、非法日历、时区及数字时间戳。"
457
+ },
458
+ "money": {
459
+ "type": "string",
460
+ "pattern": "^\\d+\\.\\d{2}$",
461
+ "$comment": "upstream-money:yuan",
462
+ "description": "元金额字符串,无损补齐两位,不再次除以100;不接受负数、科学计数法、非零额外小数位或非字符串。不计算汇总;本命令默认以 CNY 计价,不新增币种字段或作汇率换算。"
463
+ },
464
+ "signedMoney": {
465
+ "type": "string",
466
+ "pattern": "^-?\\d+\\.\\d{2}$",
467
+ "$comment": "upstream-money:yuan",
468
+ "description": "改价元字符串,保留符号:负数涨价,正数减价。本命令默认以 CNY 计价,不新增币种字段或作汇率换算。"
469
+ },
470
+ "order": {
471
+ "type": "object",
472
+ "additionalProperties": false,
473
+ "properties": {
474
+ "orderNo": {
475
+ "$ref": "#/definitions/nonemptyText",
476
+ "description": "交易订单号,严格等于输入订单号。"
477
+ },
478
+ "kdtId": {
479
+ "$ref": "#/definitions/shopId"
480
+ },
481
+ "rootKdtId": {
482
+ "$ref": "#/definitions/id",
483
+ "description": "订单所属总部 ID;返回时须等于本次 context.hq,不以本地值补造。"
484
+ },
485
+ "status": {
486
+ "$ref": "#/definitions/nonemptyText",
487
+ "description": "状态字符串。WAIT_BUYER_PAY=待支付,TRADE_PAID=支付成功瞬态,WAIT_CONFIRM=待确认,WAIT_SELLER_SEND_GOODS=待发货,WAIT_BUYER_CONFIRM_GOODS=待收货,TRADE_SUCCESS=交易完成,TRADE_CLOSED=关闭;未来非空字符串原样保留,不编造标签。"
488
+ },
489
+ "statusText": {
490
+ "type": "string",
491
+ "description": "上游展示状态文案,不反推状态码。"
492
+ },
493
+ "type": {
494
+ "type": "integer",
495
+ "minimum": -9007199254740991,
496
+ "maximum": 9007199254740991,
497
+ "description": "业务类型。0普通、1老送礼、2代付、3分销供货、4赠品、5心愿、6二维码、7合并付货款、8一分钱实名、9品鉴、10拼团、15返利、35酒店、40外卖、41堂食、46外卖买单、51全员开店、61线下收银、71美业预约、72美业服务、75知识付费、81礼品卡、85爱逛直播、89样品、100批发。未知安全整数保留。"
498
+ },
499
+ "createdAt": {
500
+ "$ref": "#/definitions/time"
501
+ },
502
+ "paidAt": {
503
+ "$ref": "#/definitions/time",
504
+ "description": "可选订单支付时间,北京时间三位毫秒;未取得时省略,不证明未支付。不保证首笔、末笔或结清时间,也不是逐笔资金事件。"
505
+ },
506
+ "isPaid": {
507
+ "type": "boolean",
508
+ "description": "可选订单支付标记;true 表示已支付,false 表示未支付,未知时省略。不从状态、金额或支付时间推算。"
509
+ },
510
+ "updatedAt": {
511
+ "$ref": "#/definitions/time",
512
+ "description": "可选更新时间,不是快照版本。"
513
+ },
514
+ "shopName": {
515
+ "type": "string",
516
+ "description": "订单记录的店铺名,不作店铺归属锚点。"
517
+ }
518
+ },
519
+ "required": [
520
+ "orderNo",
521
+ "kdtId",
522
+ "status",
523
+ "type",
524
+ "createdAt"
525
+ ]
526
+ },
527
+ "orderItem": {
528
+ "type": "object",
529
+ "additionalProperties": false,
530
+ "properties": {
531
+ "oid": {
532
+ "$ref": "#/definitions/nonemptyText",
533
+ "description": "交易明细 ID,不是商品或 SKU ID。"
534
+ },
535
+ "title": {
536
+ "type": "string",
537
+ "description": "成交商品名称,允许空文本。"
538
+ },
539
+ "quantity": {
540
+ "type": "integer",
541
+ "minimum": 0,
542
+ "maximum": 9007199254740991,
543
+ "description": "本交易行商品数量,不是库存。"
544
+ },
545
+ "item_id": {
546
+ "$ref": "#/definitions/id",
547
+ "description": "OneID商品 ID;同一商品在分店及渠道间保持一致。"
548
+ },
549
+ "sku_id": {
550
+ "$ref": "#/definitions/sku_id",
551
+ "description": "OneID商品规格 ID,与所属商品一起解释。"
552
+ },
553
+ "channel_item_id": {
554
+ "$ref": "#/definitions/id",
555
+ "description": "历史交易的店铺渠道商品 ID,不能代替OneID。"
556
+ },
557
+ "channel_sku_id": {
558
+ "$ref": "#/definitions/sku_id",
559
+ "description": "历史交易的店铺渠道规格 ID,不能代替统一规格。"
560
+ },
561
+ "unitPrice": {
562
+ "$ref": "#/definitions/money"
563
+ },
564
+ "payment": {
565
+ "$ref": "#/definitions/money",
566
+ "description": "交易明细分摊应付/支付价格,不推导到账。"
567
+ },
568
+ "isPresent": {
569
+ "type": "boolean",
570
+ "description": "true 为赠品,false 为非赠品,缺失不补 false。"
571
+ },
572
+ "isCombo": {
573
+ "type": "boolean",
574
+ "description": "true 是套餐主行,false 不是;不表示已取得全部套餐子品。"
575
+ }
576
+ },
577
+ "required": [
578
+ "oid",
579
+ "title",
580
+ "quantity"
581
+ ]
582
+ },
583
+ "payment": {
584
+ "type": "object",
585
+ "additionalProperties": false,
586
+ "properties": {
587
+ "totalFee": {
588
+ "$ref": "#/definitions/money",
589
+ "description": "商品总价。"
590
+ },
591
+ "postFee": {
592
+ "$ref": "#/definitions/money",
593
+ "description": "邮费。"
594
+ },
595
+ "payment": {
596
+ "$ref": "#/definitions/money",
597
+ "description": "整单应付金额 payment,不是实付或到账。"
598
+ },
599
+ "realPayment": {
600
+ "$ref": "#/definitions/money",
601
+ "description": "整单实付价格,不扣退款,不当作净收入。"
602
+ }
603
+ },
604
+ "required": [
605
+ "totalFee",
606
+ "postFee",
607
+ "payment",
608
+ "realPayment"
609
+ ]
610
+ },
611
+ "buyer": {
612
+ "type": "object",
613
+ "additionalProperties": false,
614
+ "properties": {
615
+ "yzOpenId": {
616
+ "type": "string",
617
+ "description": "有赞客户开放标识,不是手机号、微信 openId 或员工 ID。"
618
+ }
619
+ },
620
+ "required": [],
621
+ "minProperties": 1
622
+ },
623
+ "address": {
624
+ "type": "object",
625
+ "additionalProperties": false,
626
+ "properties": {
627
+ "receiverName": {
628
+ "type": "string",
629
+ "description": "接口实际返回的收货人姓名,不主动解密。"
630
+ },
631
+ "receiverPhone": {
632
+ "type": "string",
633
+ "description": "接口实际返回的收货电话,不保证明文。"
634
+ },
635
+ "province": {
636
+ "type": "string",
637
+ "description": "省。"
638
+ },
639
+ "city": {
640
+ "type": "string",
641
+ "description": "市。"
642
+ },
643
+ "district": {
644
+ "type": "string",
645
+ "description": "区。"
646
+ },
647
+ "address": {
648
+ "type": "string",
649
+ "description": "订单收货要求中的详细地址,不是运单实时目的地。"
650
+ },
651
+ "postalCode": {
652
+ "type": "string",
653
+ "description": "邮政编码。"
654
+ }
655
+ },
656
+ "required": [],
657
+ "minProperties": 1
658
+ },
659
+ "remark": {
660
+ "type": "object",
661
+ "additionalProperties": false,
662
+ "properties": {
663
+ "buyerMessage": {
664
+ "type": "string",
665
+ "description": "买家留言,空文本保留。"
666
+ },
667
+ "tradeMemo": {
668
+ "type": "string",
669
+ "description": "商家备注,空文本保留。"
670
+ }
671
+ },
672
+ "required": [],
673
+ "minProperties": 1
674
+ },
675
+ "source": {
676
+ "type": "object",
677
+ "additionalProperties": false,
678
+ "properties": {
679
+ "isOfflineOrder": {
680
+ "type": "boolean",
681
+ "description": "true 是线下来源,false 是非线下来源。"
682
+ },
683
+ "bookKey": {
684
+ "type": "string",
685
+ "description": "订单识别码,与交易订单号不同。"
686
+ }
687
+ },
688
+ "required": [],
689
+ "minProperties": 1
690
+ },
691
+ "promotion": {
692
+ "type": "object",
693
+ "additionalProperties": false,
694
+ "properties": {
695
+ "itemDiscountFee": {
696
+ "$ref": "#/definitions/money"
697
+ },
698
+ "orderDiscountFee": {
699
+ "$ref": "#/definitions/money"
700
+ },
701
+ "adjustFee": {
702
+ "$ref": "#/definitions/signedMoney"
703
+ }
704
+ },
705
+ "required": [
706
+ "itemDiscountFee",
707
+ "orderDiscountFee",
708
+ "adjustFee"
709
+ ]
710
+ },
711
+ "caseSummary": {
712
+ "type": "object",
713
+ "additionalProperties": false,
714
+ "properties": {
715
+ "caseId": {
716
+ "$ref": "#/definitions/nonemptyText",
717
+ "description": "售后引用标识,不是退款资金流水号。"
718
+ },
719
+ "type": {
720
+ "type": "integer",
721
+ "minimum": -9007199254740991,
722
+ "maximum": 9007199254740991,
723
+ "description": "售后类型:1买家申请退款、2商家主动退款、3一键退款、4零售门店换货、5网店换货;未知安全整数保留。"
724
+ },
725
+ "state": {
726
+ "type": "integer",
727
+ "minimum": -9007199254740991,
728
+ "maximum": 9007199254740991,
729
+ "description": "摘要售后状态:1买家申请退款等待卖家同意、10卖家拒绝退款、20卖家同意退货等待买家退货、30买家已退货等待卖家确认收货、40卖家未收到货拒绝退款、45商家已发货等待买家确认收货、60退款成功;未知安全整数保留,不与售后详情码混用。"
730
+ },
731
+ "refundFee": {
732
+ "$ref": "#/definitions/money",
733
+ "description": "本售后引用金额,不等于确认到账金额。"
734
+ },
735
+ "appliedAt": {
736
+ "$ref": "#/definitions/time"
737
+ },
738
+ "oids": {
739
+ "type": "array",
740
+ "items": {
741
+ "$ref": "#/definitions/nonemptyText"
742
+ },
743
+ "description": "上游对象数组仅投影每个非空 oid,保持顺序,不以下标代替身份。"
744
+ }
745
+ },
746
+ "required": [
747
+ "caseId",
748
+ "type",
749
+ "state"
750
+ ]
751
+ },
752
+ "aftersale": {
753
+ "type": "object",
754
+ "additionalProperties": false,
755
+ "properties": {
756
+ "refundState": {
757
+ "type": "integer",
758
+ "minimum": -9007199254740991,
759
+ "maximum": 9007199254740991,
760
+ "description": "订单退款金额状态:0未退款、1部分退款中瞬态、2部分退款成功、11全额退款中瞬态、12全额退款成功;未知安全整数保留,不表示售后处理状态。"
761
+ },
762
+ "cases": {
763
+ "type": "array",
764
+ "items": {
765
+ "$ref": "#/definitions/caseSummary"
766
+ },
767
+ "description": "仅本详情响应所选售后引用,不承诺全部退换货或资金到账。"
768
+ }
769
+ },
770
+ "required": [
771
+ "refundState",
772
+ "cases"
773
+ ]
774
+ },
775
+ "fulfillment": {
776
+ "type": "object",
777
+ "additionalProperties": false,
778
+ "properties": {
779
+ "deliveryType": {
780
+ "type": "string",
781
+ "enum": [
782
+ "EXPRESS",
783
+ "SELF_FETCH",
784
+ "LOCAL_DELIVERY",
785
+ "VIRTUAL"
786
+ ],
787
+ "description": "EXPRESS=快递、SELF_FETCH=自提、LOCAL_DELIVERY=同城配送、VIRTUAL=无需发货;无法识别的配送方式整体失败。"
788
+ },
789
+ "consignTime": {
790
+ "anyOf": [
791
+ {
792
+ "$ref": "#/definitions/time"
793
+ },
794
+ {
795
+ "const": ""
796
+ }
797
+ ],
798
+ "$comment": "upstream-time:text:empty",
799
+ "description": "可选全商品发货时间,空串保留但不能解释为未发货。"
800
+ }
801
+ },
802
+ "required": [
803
+ "deliveryType"
804
+ ]
805
+ },
806
+ "diagnosticExpected": {
807
+ "type": "object",
808
+ "additionalProperties": false,
809
+ "required": [],
810
+ "properties": {
811
+ "type": {
812
+ "anyOf": [
813
+ {
814
+ "type": "string",
815
+ "description": "预期的 JSON 类型。"
816
+ },
817
+ {
818
+ "type": "array",
819
+ "items": {
820
+ "type": "string",
821
+ "description": "预期的 JSON 类型。"
822
+ }
823
+ }
824
+ ],
825
+ "description": "同版模型允许的类型。"
826
+ },
827
+ "enum": {
828
+ "type": "array",
829
+ "items": {
830
+ "anyOf": [
831
+ {
832
+ "type": "string"
833
+ },
834
+ {
835
+ "type": "number"
836
+ },
837
+ {
838
+ "type": "boolean"
839
+ },
840
+ {
841
+ "type": "null"
842
+ }
843
+ ],
844
+ "description": "契约声明的静态标量约束。"
845
+ },
846
+ "description": "同版模型允许的静态值。"
847
+ },
848
+ "const": {
849
+ "anyOf": [
850
+ {
851
+ "type": "string"
852
+ },
853
+ {
854
+ "type": "number"
855
+ },
856
+ {
857
+ "type": "boolean"
858
+ },
859
+ {
860
+ "type": "null"
861
+ }
862
+ ],
863
+ "description": "契约声明的静态标量约束。"
864
+ },
865
+ "minimum": {
866
+ "type": "number",
867
+ "description": "包含的最小值。"
868
+ },
869
+ "maximum": {
870
+ "type": "number",
871
+ "description": "包含的最大值。"
872
+ },
873
+ "exclusiveMinimum": {
874
+ "type": "number",
875
+ "description": "不包含的最小值。"
876
+ },
877
+ "exclusiveMaximum": {
878
+ "type": "number",
879
+ "description": "不包含的最大值。"
880
+ },
881
+ "minLength": {
882
+ "type": "integer",
883
+ "description": "最少字符数。"
884
+ },
885
+ "maxLength": {
886
+ "type": "integer",
887
+ "description": "最多字符数。"
888
+ },
889
+ "minItems": {
890
+ "type": "integer",
891
+ "description": "最少元素数。"
892
+ },
893
+ "maxItems": {
894
+ "type": "integer",
895
+ "description": "最多元素数。"
896
+ },
897
+ "format": {
898
+ "type": "string",
899
+ "description": "同版模型声明的格式。"
900
+ },
901
+ "pattern": {
902
+ "type": "string",
903
+ "description": "同版模型声明的字符约束。"
904
+ },
905
+ "additionalProperties": {
906
+ "const": false,
907
+ "description": "对象拒绝契约以外的属性。"
908
+ },
909
+ "contains": {
910
+ "type": "object",
911
+ "additionalProperties": false,
912
+ "required": [
913
+ "const"
914
+ ],
915
+ "properties": {
916
+ "const": {
917
+ "anyOf": [
918
+ {
919
+ "type": "string"
920
+ },
921
+ {
922
+ "type": "number"
923
+ },
924
+ {
925
+ "type": "boolean"
926
+ },
927
+ {
928
+ "type": "null"
929
+ }
930
+ ],
931
+ "description": "契约声明的静态标量约束。"
932
+ }
933
+ }
934
+ },
935
+ "items": {
936
+ "type": "object",
937
+ "additionalProperties": false,
938
+ "required": [
939
+ "enum"
940
+ ],
941
+ "properties": {
942
+ "enum": {
943
+ "type": "array",
944
+ "items": {
945
+ "anyOf": [
946
+ {
947
+ "type": "string"
948
+ },
949
+ {
950
+ "type": "number"
951
+ },
952
+ {
953
+ "type": "boolean"
954
+ },
955
+ {
956
+ "type": "null"
957
+ }
958
+ ],
959
+ "description": "契约声明的静态标量约束。"
960
+ },
961
+ "description": "元素允许的静态值。"
962
+ }
963
+ }
964
+ }
965
+ }
966
+ },
967
+ "diagnosticIssue": {
968
+ "type": "object",
969
+ "additionalProperties": false,
970
+ "required": [
971
+ "source",
972
+ "reason"
973
+ ],
974
+ "properties": {
975
+ "source": {
976
+ "enum": [
977
+ "argv",
978
+ "input",
979
+ "context",
980
+ "output",
981
+ "preview"
982
+ ],
983
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
984
+ },
985
+ "path": {
986
+ "type": "string",
987
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
988
+ },
989
+ "option": {
990
+ "type": "string",
991
+ "description": "可定位时给出的已注册 CLI 选项。"
992
+ },
993
+ "reason": {
994
+ "enum": [
995
+ "required",
996
+ "invalid_type",
997
+ "invalid_choice",
998
+ "out_of_range",
999
+ "invalid_format",
1000
+ "conditional_required",
1001
+ "constraint",
1002
+ "unexpected_property",
1003
+ "unknown_option",
1004
+ "unknown_command",
1005
+ "excess_arguments",
1006
+ "missing_value"
1007
+ ],
1008
+ "description": "字段违反的约束类型,原始值不回显。"
1009
+ },
1010
+ "expected": {
1011
+ "$ref": "#/definitions/diagnosticExpected",
1012
+ "description": "同版契约的静态预期。"
1013
+ },
1014
+ "relatedPaths": {
1015
+ "type": "array",
1016
+ "items": {
1017
+ "type": "string",
1018
+ "description": "关联字段的 JSON Pointer。"
1019
+ },
1020
+ "description": "触发条件约束的关联字段。"
1021
+ }
1022
+ }
1023
+ },
1024
+ "diagnosticRecovery": {
1025
+ "type": "object",
1026
+ "additionalProperties": false,
1027
+ "required": [
1028
+ "action",
1029
+ "automaticBusinessRetry"
1030
+ ],
1031
+ "properties": {
1032
+ "action": {
1033
+ "enum": [
1034
+ "correct_input",
1035
+ "complete_authentication",
1036
+ "request_access_review",
1037
+ "stop_and_inspect"
1038
+ ],
1039
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
1040
+ },
1041
+ "automaticBusinessRetry": {
1042
+ "const": false,
1043
+ "description": "不据此自动重放业务请求。"
1044
+ }
1045
+ }
1046
+ },
1047
+ "diagnosticExecution": {
1048
+ "type": "object",
1049
+ "additionalProperties": false,
1050
+ "required": [
1051
+ "requestState",
1052
+ "coverage",
1053
+ "observedAttempts"
1054
+ ],
1055
+ "properties": {
1056
+ "requestState": {
1057
+ "enum": [
1058
+ "not_sent",
1059
+ "sent",
1060
+ "unknown"
1061
+ ],
1062
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
1063
+ },
1064
+ "coverage": {
1065
+ "enum": [
1066
+ "complete",
1067
+ "partial"
1068
+ ],
1069
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
1070
+ },
1071
+ "observedAttempts": {
1072
+ "type": "integer",
1073
+ "minimum": 0,
1074
+ "maximum": 9007199254740991,
1075
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
1076
+ }
1077
+ }
1078
+ }
1079
+ },
1080
+ "modules": {
1081
+ "order": {
1082
+ "base": true,
1083
+ "upstreamPath": "data.full_order_info.order_info",
1084
+ "required": true,
1085
+ "description": "固定订单标识及状态时间;返回所属总部时校验总部。"
1086
+ },
1087
+ "items": {
1088
+ "base": true,
1089
+ "upstreamPath": "data.full_order_info.orders",
1090
+ "required": true,
1091
+ "description": "固定交易商品行有限视图;缺失或错型失败。"
1092
+ },
1093
+ "payment": {
1094
+ "base": true,
1095
+ "upstreamPath": "data.full_order_info.pay_info",
1096
+ "required": true,
1097
+ "description": "固定应付与实付分离的元金额视图;本命令默认以 CNY 计价,不新增币种字段或作汇率换算。"
1098
+ },
1099
+ "buyer": {
1100
+ "base": false,
1101
+ "upstreamPath": "data.full_order_info.buyer_info",
1102
+ "required": true,
1103
+ "description": "buyer 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1104
+ },
1105
+ "address": {
1106
+ "base": false,
1107
+ "upstreamPath": "data.full_order_info.address_info",
1108
+ "required": true,
1109
+ "description": "address 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1110
+ },
1111
+ "remark": {
1112
+ "base": false,
1113
+ "upstreamPath": "data.full_order_info.remark_info",
1114
+ "required": true,
1115
+ "description": "remark 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1116
+ },
1117
+ "source": {
1118
+ "base": false,
1119
+ "upstreamPath": "data.full_order_info.source_info",
1120
+ "required": true,
1121
+ "description": "source 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1122
+ },
1123
+ "promotion": {
1124
+ "base": false,
1125
+ "upstreamPath": "data.order_promotion",
1126
+ "required": true,
1127
+ "description": "promotion 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1128
+ },
1129
+ "aftersale": {
1130
+ "base": false,
1131
+ "upstreamPath": "data.refund_order",
1132
+ "required": true,
1133
+ "description": "aftersale 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1134
+ },
1135
+ "fulfillment": {
1136
+ "base": false,
1137
+ "upstreamPath": "data.full_order_info.order_info",
1138
+ "required": true,
1139
+ "description": "fulfillment 仅主响应投影,选定才校验;缺失或无表列字段失败,不补空对象。"
1140
+ }
1141
+ },
1142
+ "api": {
1143
+ "method": "POST",
1144
+ "path": "youzan.trade.get/4.0.2"
1145
+ },
1146
+ "success": {
1147
+ "description": "同一凭证先核验目标店铺,再读取订单。订单号与店铺必须匹配,返回的总部须匹配当前上下文;选定模块及递归模型全部通过才输出。"
1148
+ },
1149
+ "errors": {
1150
+ "description": "必需字段缺失、字段错型、不安全数字、非零额外金额精度或非零毫秒整体失败;paidAt 未取得时省略,其余 null 按字段契约拒绝。未知字段不进入校验。不猜订单不存在,不自动重试或换店;失败 stdout 为空,安全 stderr,传输中断 unknown。 错误诊断第二版保留字段问题、恢复说明和整次请求观察;本地输入修正不授权重放已发送请求。不自动初始化应用或重发。",
1151
+ "diagnosticsVersion": 2
1152
+ },
1153
+ "notes": [
1154
+ "--kdt-id 省略时使用本次有效上下文 shopId;显式提供的非法值不回退。两者都缺失时拒绝;目标范围、同店核验和服务端权限仍按本命令校验。",
1155
+ "订单号通常为 E/V/C 开头加 23 位数字,仅供核对,不限定前缀、数字组合或 24 位长度;按原值传递。仅保留非空、无空白或控制字符和最多 128 字符的文本保护;服务端仍判断支持范围和对象归属。",
1156
+ "必须提供 --order-no;--kdt-id 省略时使用当前上下文店铺,显式非法值不回退;非总部目标须等于 context.shopId;总部也限定 当前调用所绑定的目标店铺,at:all 不表示跨店读取。",
1157
+ "输出 ID 是字符串;只有请求适配在安全范围转为 number。include 仅投影,普通读取所有组合最多两请求,无关联详情、跨店或重试。显式 decrypt 时最多四次有赞业务请求,禁用 1106 自动初始化及重发。",
1158
+ "累计业务响应 10MiB、最终序列化 UTF-8 输出含换行 5MiB,超限整体失败;不承诺全链路恒定内存。",
1159
+ "默认不主动解密。decrypt 仅收货姓名、联系方式和详细地址,必须 include address 并提供 reason。打星值不能恢复;字段缺失、空值或平台未确认为密文均整体拒绝。所有选定字段和可靠审计完成后才原位输出;失败 stdout 为空。",
1160
+ "当前安装版尚未接通可信员工字段授权、来源绑定和可靠审计服务,实际解密拒绝,不能以应用 token、订单读取成功或本地上下文代替;普通读取与离线预览不受影响。",
1161
+ "可选字段缺失省略,null 或错型失败;paidAt 未取得、空文本或 null 时省略,不证明未支付,非空错型、非法日期或非零毫秒失败。isPaid 未取得时省略,false 原样保留,非 boolean 失败;两者不从状态或金额推算。已选对象至少有一个已知字段。false、零、合法空文本和实际空数组保留。",
1162
+ "本地上下文与查询成功不替代服务端业务授权或权限隔离验证。",
1163
+ "本批默认以 CNY 计价,金额保留两位小数字符串,不新增币种字段或换汇;该默认不用于确认上游逐订单币种或跨币种结算事实。",
1164
+ "商品行 item_id/sku_id 为OneID,channel_item_id/channel_sku_id 为历史渠道身份;oid仍为交易行,不用当前档案重写历史。",
1165
+ "历史统一商品或规格字段为空字符串时,省略对应OneID并保留明确渠道身份,不用渠道ID补造;null和其他错型仍失败。"
1166
+ ]
1167
+ }