@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,1095 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "scope",
8
+ "filters",
9
+ "range",
10
+ "pagination"
11
+ ],
12
+ "properties": {
13
+ "scope": {
14
+ "$ref": "#/definitions/scope"
15
+ },
16
+ "filters": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "orderNo": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 128,
24
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$",
25
+ "description": "精确交易订单号,不转数字。"
26
+ },
27
+ "caseId": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 128,
31
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$",
32
+ "description": "精确售后单号,与交易订单号不同,不转数字。"
33
+ },
34
+ "yzOpenId": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 128,
38
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$",
39
+ "description": "有赞客户标识,不是员工ID。预览遮盖为 ***。"
40
+ },
41
+ "buyerPhone": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "maxLength": 64,
45
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f](?:[^\\u0000-\\u001f\\u007f-\\u009f]*[^\\s\\u0000-\\u001f\\u007f-\\u009f])?$",
46
+ "description": "买家电话,保留文本,不允许控制字符或首尾空白。预览遮盖为 ***。"
47
+ },
48
+ "demand": {
49
+ "type": "integer",
50
+ "enum": [
51
+ 1,
52
+ 2,
53
+ 3
54
+ ],
55
+ "description": "诉求筛选:1=仅退款,2=退货退款,3=换货。列表不返回当前诉求,不回填筛选值。"
56
+ },
57
+ "status": {
58
+ "type": "string",
59
+ "enum": [
60
+ "WAIT_SELLER_AGREE",
61
+ "WAIT_BUYER_RETURN_GOODS",
62
+ "WAIT_SELLER_CONFIRM_GOODS",
63
+ "SELLER_REFUSE_BUYER",
64
+ "CLOSED",
65
+ "SUCCESS",
66
+ "CUSTOMER_SERVICE_IN",
67
+ "SELLER_REFUSE_BUYER_RETURN_GOODS",
68
+ "SELLER_RETURN_GOODS"
69
+ ],
70
+ "description": "处理状态:WAIT_SELLER_AGREE=等待商家同意,WAIT_BUYER_RETURN_GOODS=等待买家退货,WAIT_SELLER_CONFIRM_GOODS=等待商家确认收货,SELLER_REFUSE_BUYER=商家拒绝退款,CLOSED=退款关闭,SUCCESS=退款成功,CUSTOMER_SERVICE_IN=客满介入,SELLER_REFUSE_BUYER_RETURN_GOODS=商家拒绝收货,SELLER_RETURN_GOODS=商家确认收货并发送换货。成功不代表逐笔资金到账。"
71
+ },
72
+ "type": {
73
+ "type": "integer",
74
+ "enum": [
75
+ 1,
76
+ 2,
77
+ 3,
78
+ 4,
79
+ 5
80
+ ],
81
+ "description": "流程类型:1=买家申请退款,2=商家主动退款,3=一键退款,4=零售门店换货,5=微商城换货。不是诉求。"
82
+ },
83
+ "phase": {
84
+ "type": "integer",
85
+ "enum": [
86
+ 1,
87
+ 2
88
+ ],
89
+ "description": "阶段:1=售中,2=售后。"
90
+ },
91
+ "handlingStatus": {
92
+ "type": "integer",
93
+ "enum": [
94
+ 0,
95
+ 1,
96
+ 2
97
+ ],
98
+ "description": "待处理归属:0=待商家处理,1=待买家处理,2=客服介入中;0也会发送。"
99
+ },
100
+ "serviceStatus": {
101
+ "type": "integer",
102
+ "enum": [
103
+ 1,
104
+ 2,
105
+ 3
106
+ ],
107
+ "description": "客服筛选:1=不需要客服介入,2=需要客服介入,3=介入结束;不直接套用响应字典。"
108
+ },
109
+ "itemTitle": {
110
+ "type": "string",
111
+ "minLength": 1,
112
+ "maxLength": 256,
113
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f](?:[^\\u0000-\\u001f\\u007f-\\u009f]*[^\\s\\u0000-\\u001f\\u007f-\\u009f])?$",
114
+ "description": "商品名称筛选,不承诺精确匹配或分词;不允许控制字符或首尾空白,预览遮盖为 ***。"
115
+ },
116
+ "skuNo": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "maxLength": 128,
120
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f](?:[^\\u0000-\\u001f\\u007f-\\u009f]*[^\\s\\u0000-\\u001f\\u007f-\\u009f])?$",
121
+ "description": "商品规格编码,不是统一商品ID;不允许控制字符或首尾空白。"
122
+ },
123
+ "deliveryStatus": {
124
+ "type": "integer",
125
+ "enum": [
126
+ 1,
127
+ 2
128
+ ],
129
+ "description": "发货状态筛选:1=未发货,2=已发货,不表示签收。"
130
+ },
131
+ "refundMode": {
132
+ "type": "integer",
133
+ "enum": [
134
+ 0,
135
+ 1,
136
+ 2
137
+ ],
138
+ "description": "退款资金类型筛选:0=原路退,1=现金退,2=标记退。不补造返回资金事实。"
139
+ },
140
+ "returnStockStatus": {
141
+ "type": "integer",
142
+ "enum": [
143
+ 0,
144
+ 10,
145
+ 20
146
+ ],
147
+ "description": "退货归还库存状态:0=无需入库,10=待入库,20=归还库存成功。不是商家售后收货确认。"
148
+ },
149
+ "saleWay": {
150
+ "type": "integer",
151
+ "enum": [
152
+ 1,
153
+ 2
154
+ ],
155
+ "description": "销售渠道:1=门店,2=网店。"
156
+ },
157
+ "payType": {
158
+ "type": "integer",
159
+ "enum": [
160
+ 0,
161
+ 1,
162
+ 2,
163
+ 3,
164
+ 4,
165
+ 5,
166
+ 6,
167
+ 7,
168
+ 8
169
+ ],
170
+ "description": "支付类型:0=支付方式与渠道组合,1=无需支付,2=现付,3=部分支付,4=货到付款,5=线下收银,6=单次支付,7=阶段支付,8=外部支付。"
171
+ }
172
+ }
173
+ },
174
+ "range": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "created": {
179
+ "$ref": "#/definitions/timePair",
180
+ "description": "创建时间对;未提供时不虚构日期,上游默认近三个月创建的记录,不等同于90天。"
181
+ },
182
+ "updated": {
183
+ "$ref": "#/definitions/timePair",
184
+ "description": "更新时间对,提供时还必须提供创建时间对。不承诺端点包含性。"
185
+ }
186
+ },
187
+ "dependencies": {
188
+ "updated": [
189
+ "created"
190
+ ]
191
+ }
192
+ },
193
+ "pagination": {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "required": [
197
+ "pageNo",
198
+ "pageSize"
199
+ ],
200
+ "properties": {
201
+ "pageNo": {
202
+ "type": "integer",
203
+ "minimum": 1,
204
+ "maximum": 100,
205
+ "description": "本次请求页码,不能绕过100页及页码乘页大小3000的深度限制。"
206
+ },
207
+ "pageSize": {
208
+ "type": "integer",
209
+ "minimum": 1,
210
+ "maximum": 20,
211
+ "description": "本页数量,20是CLI有界策略,不声称是接口最大值。"
212
+ }
213
+ }
214
+ }
215
+ }
216
+ },
217
+ "output": {
218
+ "type": "object",
219
+ "additionalProperties": false,
220
+ "required": [
221
+ "data"
222
+ ],
223
+ "properties": {
224
+ "data": {
225
+ "type": "object",
226
+ "additionalProperties": false,
227
+ "required": [
228
+ "cases",
229
+ "pagination"
230
+ ],
231
+ "properties": {
232
+ "cases": {
233
+ "type": "array",
234
+ "maxItems": 20,
235
+ "items": {
236
+ "$ref": "#/definitions/case"
237
+ },
238
+ "description": "仅本页售后摘要;空数组只表示本页无结果,不保证读完。无每行详情请求。"
239
+ },
240
+ "pagination": {
241
+ "type": "object",
242
+ "additionalProperties": false,
243
+ "required": [
244
+ "pageNo",
245
+ "pageSize",
246
+ "hasMore",
247
+ "nextPageNo",
248
+ "windowLimitReached"
249
+ ],
250
+ "properties": {
251
+ "pageNo": {
252
+ "type": "integer",
253
+ "minimum": 1,
254
+ "maximum": 100,
255
+ "description": "实际请求页码。"
256
+ },
257
+ "pageSize": {
258
+ "type": "integer",
259
+ "minimum": 1,
260
+ "maximum": 20,
261
+ "description": "实际请求页大小。"
262
+ },
263
+ "total": {
264
+ "type": "integer",
265
+ "minimum": 0,
266
+ "maximum": 9007199254740991,
267
+ "description": "匹配本次查询条件的总记录数,不是当前页返回条数;上游未提供可确认总数时省略。"
268
+ },
269
+ "hasMore": {
270
+ "type": [
271
+ "boolean",
272
+ "null"
273
+ ],
274
+ "description": "true 表示还有后续页,false 表示已确认没有后续页;无法确定时为 null,不以空页或短页推算。"
275
+ },
276
+ "nextPageNo": {
277
+ "type": [
278
+ "integer",
279
+ "null"
280
+ ],
281
+ "minimum": 1,
282
+ "maximum": 100,
283
+ "description": "已确认且未超过页码上限的下一页;无法确认或到达上限时为 null。"
284
+ },
285
+ "windowLimitReached": {
286
+ "type": "boolean",
287
+ "description": "true表示已到100页CLI窗口且尚未确认取完;保留原筛选并缩小范围,不请求第101页,不表示已读全集。"
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+ },
295
+ "preview": {
296
+ "type": "object",
297
+ "additionalProperties": false,
298
+ "required": [
299
+ "requests"
300
+ ],
301
+ "properties": {
302
+ "requests": {
303
+ "type": "array",
304
+ "minItems": 2,
305
+ "maxItems": 2,
306
+ "items": [
307
+ {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "required": [
311
+ "method",
312
+ "path",
313
+ "body"
314
+ ],
315
+ "properties": {
316
+ "method": {
317
+ "const": "POST"
318
+ },
319
+ "path": {
320
+ "const": "youzan.shop.basic.get/3.0.0"
321
+ },
322
+ "body": {
323
+ "type": "object",
324
+ "additionalProperties": false
325
+ }
326
+ }
327
+ },
328
+ {
329
+ "type": "object",
330
+ "additionalProperties": false,
331
+ "required": [
332
+ "method",
333
+ "path",
334
+ "body"
335
+ ],
336
+ "properties": {
337
+ "method": {
338
+ "const": "POST"
339
+ },
340
+ "path": {
341
+ "const": "youzan.trade.refund.search/3.0.1"
342
+ },
343
+ "body": {
344
+ "$ref": "#/definitions/previewBody"
345
+ }
346
+ }
347
+ }
348
+ ],
349
+ "additionalItems": false,
350
+ "description": "纯本地计划,不读凭证、不联网,无token或完整URL;敏感筛选遮盖不影响真实请求。"
351
+ }
352
+ }
353
+ },
354
+ "error": {
355
+ "type": "object",
356
+ "additionalProperties": false,
357
+ "required": [
358
+ "success",
359
+ "code",
360
+ "message"
361
+ ],
362
+ "properties": {
363
+ "success": {
364
+ "const": false
365
+ },
366
+ "code": {
367
+ "const": -10001
368
+ },
369
+ "message": {
370
+ "type": "string",
371
+ "minLength": 1,
372
+ "description": "受控错误说明,不拼接业务正文、凭证或个人信息。"
373
+ },
374
+ "details": {
375
+ "type": "object",
376
+ "additionalProperties": false,
377
+ "required": [
378
+ "category",
379
+ "stage",
380
+ "command",
381
+ "targetScope",
382
+ "requestState",
383
+ "nextStep",
384
+ "errorVersion",
385
+ "recovery",
386
+ "execution"
387
+ ],
388
+ "properties": {
389
+ "category": {
390
+ "type": "string",
391
+ "enum": [
392
+ "validation",
393
+ "configuration",
394
+ "authentication",
395
+ "permission",
396
+ "scope_unresolved",
397
+ "http",
398
+ "business_rejected",
399
+ "not_found",
400
+ "protocol",
401
+ "transport",
402
+ "limit"
403
+ ],
404
+ "description": "validation=本地输入无效,configuration=配置缺失或无效,authentication=认证失败,permission=权限拒绝,scope_unresolved=范围无法核对,http=其他HTTP错误,business_rejected=业务或网关拒绝,not_found=准确错误码证明不存在,protocol=返回契约冲突,transport=网络失败,limit=资源限制超出。不猜测未核实错误码含义。"
405
+ },
406
+ "stage": {
407
+ "type": "string",
408
+ "enum": [
409
+ "input",
410
+ "context",
411
+ "configuration",
412
+ "shop-binding",
413
+ "cases",
414
+ "output-model",
415
+ "transport",
416
+ "response"
417
+ ],
418
+ "description": "input=输入,context=四字段上下文,configuration=传输配置,shop-binding=凭证店铺核验,cases=列表请求或范围核对,output-model=分页与字段投影,transport=网络传输,response=响应读取或解码。"
419
+ },
420
+ "command": {
421
+ "const": "aftersale.case.list"
422
+ },
423
+ "targetScope": {
424
+ "type": "object",
425
+ "additionalProperties": false,
426
+ "properties": {
427
+ "kdtId": {
428
+ "$ref": "#/definitions/shopId"
429
+ }
430
+ },
431
+ "description": "仅已验证的目标店铺,不回显筛选或非法输入。"
432
+ },
433
+ "requestState": {
434
+ "type": "string",
435
+ "enum": [
436
+ "not_sent",
437
+ "sent",
438
+ "unknown"
439
+ ],
440
+ "description": "not_sent=当前阶段尚未发送,sent=已取得响应,unknown=无法确定结果。不授权自动重放。"
441
+ },
442
+ "nextStep": {
443
+ "type": "string",
444
+ "minLength": 1
445
+ },
446
+ "api": {
447
+ "type": "string",
448
+ "minLength": 1,
449
+ "description": "准确API及版本,不含URL或token。"
450
+ },
451
+ "httpStatus": {
452
+ "type": "integer",
453
+ "minimum": 100,
454
+ "maximum": 599
455
+ },
456
+ "businessCode": {
457
+ "$ref": "#/definitions/diagnosticCode"
458
+ },
459
+ "gatewayCode": {
460
+ "$ref": "#/definitions/diagnosticCode"
461
+ },
462
+ "trace_id": {
463
+ "type": "string",
464
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
465
+ },
466
+ "request_id": {
467
+ "type": "string",
468
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
469
+ },
470
+ "errorVersion": {
471
+ "const": 2,
472
+ "description": "本命令采用错误诊断协议第二版。"
473
+ },
474
+ "issues": {
475
+ "type": "array",
476
+ "minItems": 1,
477
+ "maxItems": 16,
478
+ "items": {
479
+ "$ref": "#/definitions/diagnosticIssue"
480
+ },
481
+ "description": "最多十六个已定位问题,不包含收到的原值。"
482
+ },
483
+ "issuesTruncated": {
484
+ "const": true,
485
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
486
+ },
487
+ "recovery": {
488
+ "$ref": "#/definitions/diagnosticRecovery",
489
+ "description": "受限的恢复说明,不会自动执行。"
490
+ },
491
+ "execution": {
492
+ "$ref": "#/definitions/diagnosticExecution",
493
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
494
+ }
495
+ }
496
+ }
497
+ }
498
+ },
499
+ "definitions": {
500
+ "shopId": {
501
+ "type": "integer",
502
+ "minimum": 1,
503
+ "maximum": 9007199254740991,
504
+ "description": "正安全整数店铺ID。argv必须使用规范十进制文本。"
505
+ },
506
+ "scope": {
507
+ "type": "object",
508
+ "additionalProperties": false,
509
+ "required": [
510
+ "kdtId"
511
+ ],
512
+ "properties": {
513
+ "kdtId": {
514
+ "$ref": "#/definitions/shopId"
515
+ }
516
+ }
517
+ },
518
+ "timePair": {
519
+ "type": "object",
520
+ "additionalProperties": false,
521
+ "required": [
522
+ "start",
523
+ "end"
524
+ ],
525
+ "properties": {
526
+ "start": {
527
+ "$ref": "#/definitions/time"
528
+ },
529
+ "end": {
530
+ "$ref": "#/definitions/time"
531
+ }
532
+ },
533
+ "description": "北京时间起止时间,须严格先后。argv接受空格分隔秒及1..3位小数秒,但非零毫秒拒绝,不截断、不舍入,不接收Unix数字或T分隔。规范化后为三位零毫秒文本。"
534
+ },
535
+ "time": {
536
+ "type": "string",
537
+ "format": "beijing-date-time-ms",
538
+ "description": "北京时间 YYYY-MM-DD HH:mm:ss.SSS,三位毫秒文本。"
539
+ },
540
+ "case": {
541
+ "type": "object",
542
+ "additionalProperties": false,
543
+ "required": [
544
+ "caseId",
545
+ "orderNo",
546
+ "kdtId",
547
+ "status",
548
+ "amount"
549
+ ],
550
+ "properties": {
551
+ "caseId": {
552
+ "type": "string",
553
+ "minLength": 1,
554
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$",
555
+ "description": "售后单号,用于售后定位,不是订单号。"
556
+ },
557
+ "orderNo": {
558
+ "type": "string",
559
+ "minLength": 1,
560
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$",
561
+ "description": "关联交易订单号,不是售后商品行ID。"
562
+ },
563
+ "kdtId": {
564
+ "$ref": "#/definitions/shopId",
565
+ "description": "必须等于本次目标店铺。"
566
+ },
567
+ "nodeKdtId": {
568
+ "$ref": "#/definitions/shopId",
569
+ "description": "可选分店引用,不改写为目标店铺。"
570
+ },
571
+ "status": {
572
+ "type": "string",
573
+ "minLength": 1,
574
+ "description": "WAIT_SELLER_AGREE=等待商家同意,WAIT_BUYER_RETURN_GOODS=等待买家退货,WAIT_SELLER_CONFIRM_GOODS=等待商家确认收货,SELLER_REFUSE_BUYER=商家拒绝退款,CLOSED=退款关闭,SUCCESS=退款成功,CUSTOMER_SERVICE_IN=客满介入,SELLER_REFUSE_BUYER_RETURN_GOODS=商家拒绝收货,SELLER_RETURN_GOODS=商家确认收货并发送换货。未知非空状态原样保留,不据此自动写入。"
575
+ },
576
+ "amount": {
577
+ "type": "string",
578
+ "pattern": "^(0|[1-9]\\d*)\\.\\d{2}$",
579
+ "description": "申请退款金额,默认CNY,元,两位小数,不表示实际到账。精确分值为0..9223372036854775807,CLI有界模型,不声称为接口最大退款额;拒绝空串、负值及无法精确落为整数分的值。"
580
+ },
581
+ "hasReturnGoods": {
582
+ "type": "boolean",
583
+ "description": "上游是否有退货的事实;缺失省略,不补false。"
584
+ },
585
+ "createdAt": {
586
+ "$ref": "#/definitions/time",
587
+ "description": "可选售后申请时间,北京时间三位毫秒文本。"
588
+ },
589
+ "updatedAt": {
590
+ "$ref": "#/definitions/time",
591
+ "description": "可选售后修改时间,北京时间三位毫秒文本。"
592
+ },
593
+ "serviceStatus": {
594
+ "type": "integer",
595
+ "minimum": -9007199254740991,
596
+ "maximum": 9007199254740991,
597
+ "description": "已知1=客满未介入,2=客满介入中;3及其他未知安全整数原样保留,不套用请求或详情字典。"
598
+ },
599
+ "deliveryStatus": {
600
+ "type": "integer",
601
+ "minimum": -9007199254740991,
602
+ "maximum": 9007199254740991,
603
+ "description": "已知1=未发货,2=已发货;未知安全整数原样保留,不表示签收。"
604
+ }
605
+ }
606
+ },
607
+ "diagnosticCode": {
608
+ "anyOf": [
609
+ {
610
+ "type": "integer",
611
+ "minimum": -9007199254740991,
612
+ "maximum": 9007199254740991
613
+ },
614
+ {
615
+ "type": "string",
616
+ "pattern": "^-?\\d{1,12}$"
617
+ }
618
+ ],
619
+ "description": "当前诊断白名单保留的业务或网关码,不保留错误正文。"
620
+ },
621
+ "previewBody": {
622
+ "type": "object",
623
+ "additionalProperties": false,
624
+ "required": [
625
+ "page_no",
626
+ "page_size"
627
+ ],
628
+ "properties": {
629
+ "page_no": {
630
+ "type": "integer",
631
+ "minimum": 1,
632
+ "maximum": 100
633
+ },
634
+ "page_size": {
635
+ "type": "integer",
636
+ "minimum": 1,
637
+ "maximum": 20
638
+ },
639
+ "tid": {
640
+ "type": "string",
641
+ "minLength": 1
642
+ },
643
+ "refund_id": {
644
+ "type": "string",
645
+ "minLength": 1
646
+ },
647
+ "yz_open_id": {
648
+ "const": "***"
649
+ },
650
+ "buyer_phone": {
651
+ "const": "***"
652
+ },
653
+ "goods_title": {
654
+ "const": "***"
655
+ },
656
+ "sku_no": {
657
+ "type": "string",
658
+ "minLength": 1
659
+ },
660
+ "status": {
661
+ "type": "string",
662
+ "enum": [
663
+ "WAIT_SELLER_AGREE",
664
+ "WAIT_BUYER_RETURN_GOODS",
665
+ "WAIT_SELLER_CONFIRM_GOODS",
666
+ "SELLER_REFUSE_BUYER",
667
+ "CLOSED",
668
+ "SUCCESS",
669
+ "CUSTOMER_SERVICE_IN",
670
+ "SELLER_REFUSE_BUYER_RETURN_GOODS",
671
+ "SELLER_RETURN_GOODS"
672
+ ]
673
+ },
674
+ "demand": {
675
+ "type": "integer",
676
+ "enum": [
677
+ 1,
678
+ 2,
679
+ 3
680
+ ]
681
+ },
682
+ "type": {
683
+ "type": "integer",
684
+ "enum": [
685
+ 1,
686
+ 2,
687
+ 3,
688
+ 4,
689
+ 5
690
+ ]
691
+ },
692
+ "phase": {
693
+ "type": "integer",
694
+ "enum": [
695
+ 1,
696
+ 2
697
+ ]
698
+ },
699
+ "search_tag": {
700
+ "type": "integer",
701
+ "enum": [
702
+ 0,
703
+ 1,
704
+ 2
705
+ ]
706
+ },
707
+ "cs_status": {
708
+ "type": "integer",
709
+ "enum": [
710
+ 1,
711
+ 2,
712
+ 3
713
+ ]
714
+ },
715
+ "delivery_status": {
716
+ "type": "integer",
717
+ "enum": [
718
+ 1,
719
+ 2
720
+ ]
721
+ },
722
+ "refund_mode": {
723
+ "type": "integer",
724
+ "enum": [
725
+ 0,
726
+ 1,
727
+ 2
728
+ ]
729
+ },
730
+ "return_stock_status": {
731
+ "type": "integer",
732
+ "enum": [
733
+ 0,
734
+ 10,
735
+ 20
736
+ ]
737
+ },
738
+ "sale_way": {
739
+ "type": "integer",
740
+ "enum": [
741
+ 1,
742
+ 2
743
+ ]
744
+ },
745
+ "pay_type": {
746
+ "type": "integer",
747
+ "enum": [
748
+ 0,
749
+ 1,
750
+ 2,
751
+ 3,
752
+ 4,
753
+ 5,
754
+ 6,
755
+ 7,
756
+ 8
757
+ ]
758
+ },
759
+ "create_time_start": {
760
+ "type": "integer",
761
+ "minimum": -62135625600,
762
+ "maximum": 253402271999,
763
+ "description": "创建开始,整数秒,与结束成对。"
764
+ },
765
+ "create_time_end": {
766
+ "type": "integer",
767
+ "minimum": -62135625600,
768
+ "maximum": 253402271999,
769
+ "description": "创建结束,整数秒。"
770
+ },
771
+ "update_time_start": {
772
+ "type": "integer",
773
+ "minimum": -62135625600,
774
+ "maximum": 253402271999,
775
+ "description": "更新开始,整数秒,须有更新结束及创建时间对。"
776
+ },
777
+ "update_time_end": {
778
+ "type": "integer",
779
+ "minimum": -62135625600,
780
+ "maximum": 253402271999,
781
+ "description": "更新结束,整数秒。"
782
+ }
783
+ },
784
+ "dependencies": {
785
+ "create_time_start": [
786
+ "create_time_end"
787
+ ],
788
+ "create_time_end": [
789
+ "create_time_start"
790
+ ],
791
+ "update_time_start": [
792
+ "update_time_end",
793
+ "create_time_start"
794
+ ],
795
+ "update_time_end": [
796
+ "update_time_start",
797
+ "create_time_start"
798
+ ]
799
+ }
800
+ },
801
+ "diagnosticExpected": {
802
+ "type": "object",
803
+ "additionalProperties": false,
804
+ "required": [],
805
+ "properties": {
806
+ "type": {
807
+ "anyOf": [
808
+ {
809
+ "type": "string",
810
+ "description": "预期的 JSON 类型。"
811
+ },
812
+ {
813
+ "type": "array",
814
+ "items": {
815
+ "type": "string",
816
+ "description": "预期的 JSON 类型。"
817
+ }
818
+ }
819
+ ],
820
+ "description": "同版模型允许的类型。"
821
+ },
822
+ "enum": {
823
+ "type": "array",
824
+ "items": {
825
+ "anyOf": [
826
+ {
827
+ "type": "string"
828
+ },
829
+ {
830
+ "type": "number"
831
+ },
832
+ {
833
+ "type": "boolean"
834
+ },
835
+ {
836
+ "type": "null"
837
+ }
838
+ ],
839
+ "description": "契约声明的静态标量约束。"
840
+ },
841
+ "description": "同版模型允许的静态值。"
842
+ },
843
+ "const": {
844
+ "anyOf": [
845
+ {
846
+ "type": "string"
847
+ },
848
+ {
849
+ "type": "number"
850
+ },
851
+ {
852
+ "type": "boolean"
853
+ },
854
+ {
855
+ "type": "null"
856
+ }
857
+ ],
858
+ "description": "契约声明的静态标量约束。"
859
+ },
860
+ "minimum": {
861
+ "type": "number",
862
+ "description": "包含的最小值。"
863
+ },
864
+ "maximum": {
865
+ "type": "number",
866
+ "description": "包含的最大值。"
867
+ },
868
+ "exclusiveMinimum": {
869
+ "type": "number",
870
+ "description": "不包含的最小值。"
871
+ },
872
+ "exclusiveMaximum": {
873
+ "type": "number",
874
+ "description": "不包含的最大值。"
875
+ },
876
+ "minLength": {
877
+ "type": "integer",
878
+ "description": "最少字符数。"
879
+ },
880
+ "maxLength": {
881
+ "type": "integer",
882
+ "description": "最多字符数。"
883
+ },
884
+ "minItems": {
885
+ "type": "integer",
886
+ "description": "最少元素数。"
887
+ },
888
+ "maxItems": {
889
+ "type": "integer",
890
+ "description": "最多元素数。"
891
+ },
892
+ "format": {
893
+ "type": "string",
894
+ "description": "同版模型声明的格式。"
895
+ },
896
+ "pattern": {
897
+ "type": "string",
898
+ "description": "同版模型声明的字符约束。"
899
+ },
900
+ "additionalProperties": {
901
+ "const": false,
902
+ "description": "对象拒绝契约以外的属性。"
903
+ },
904
+ "contains": {
905
+ "type": "object",
906
+ "additionalProperties": false,
907
+ "required": [
908
+ "const"
909
+ ],
910
+ "properties": {
911
+ "const": {
912
+ "anyOf": [
913
+ {
914
+ "type": "string"
915
+ },
916
+ {
917
+ "type": "number"
918
+ },
919
+ {
920
+ "type": "boolean"
921
+ },
922
+ {
923
+ "type": "null"
924
+ }
925
+ ],
926
+ "description": "契约声明的静态标量约束。"
927
+ }
928
+ }
929
+ },
930
+ "items": {
931
+ "type": "object",
932
+ "additionalProperties": false,
933
+ "required": [
934
+ "enum"
935
+ ],
936
+ "properties": {
937
+ "enum": {
938
+ "type": "array",
939
+ "items": {
940
+ "anyOf": [
941
+ {
942
+ "type": "string"
943
+ },
944
+ {
945
+ "type": "number"
946
+ },
947
+ {
948
+ "type": "boolean"
949
+ },
950
+ {
951
+ "type": "null"
952
+ }
953
+ ],
954
+ "description": "契约声明的静态标量约束。"
955
+ },
956
+ "description": "元素允许的静态值。"
957
+ }
958
+ }
959
+ }
960
+ }
961
+ },
962
+ "diagnosticIssue": {
963
+ "type": "object",
964
+ "additionalProperties": false,
965
+ "required": [
966
+ "source",
967
+ "reason"
968
+ ],
969
+ "properties": {
970
+ "source": {
971
+ "enum": [
972
+ "argv",
973
+ "input",
974
+ "context",
975
+ "output",
976
+ "preview"
977
+ ],
978
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
979
+ },
980
+ "path": {
981
+ "type": "string",
982
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
983
+ },
984
+ "option": {
985
+ "type": "string",
986
+ "description": "可定位时给出的已注册 CLI 选项。"
987
+ },
988
+ "reason": {
989
+ "enum": [
990
+ "required",
991
+ "invalid_type",
992
+ "invalid_choice",
993
+ "out_of_range",
994
+ "invalid_format",
995
+ "conditional_required",
996
+ "constraint",
997
+ "unexpected_property",
998
+ "unknown_option",
999
+ "unknown_command",
1000
+ "excess_arguments",
1001
+ "missing_value"
1002
+ ],
1003
+ "description": "字段违反的约束类型,原始值不回显。"
1004
+ },
1005
+ "expected": {
1006
+ "$ref": "#/definitions/diagnosticExpected",
1007
+ "description": "同版契约的静态预期。"
1008
+ },
1009
+ "relatedPaths": {
1010
+ "type": "array",
1011
+ "items": {
1012
+ "type": "string",
1013
+ "description": "关联字段的 JSON Pointer。"
1014
+ },
1015
+ "description": "触发条件约束的关联字段。"
1016
+ }
1017
+ }
1018
+ },
1019
+ "diagnosticRecovery": {
1020
+ "type": "object",
1021
+ "additionalProperties": false,
1022
+ "required": [
1023
+ "action",
1024
+ "automaticBusinessRetry"
1025
+ ],
1026
+ "properties": {
1027
+ "action": {
1028
+ "enum": [
1029
+ "correct_input",
1030
+ "complete_authentication",
1031
+ "request_access_review",
1032
+ "stop_and_inspect"
1033
+ ],
1034
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
1035
+ },
1036
+ "automaticBusinessRetry": {
1037
+ "const": false,
1038
+ "description": "不据此自动重放业务请求。"
1039
+ }
1040
+ }
1041
+ },
1042
+ "diagnosticExecution": {
1043
+ "type": "object",
1044
+ "additionalProperties": false,
1045
+ "required": [
1046
+ "requestState",
1047
+ "coverage",
1048
+ "observedAttempts"
1049
+ ],
1050
+ "properties": {
1051
+ "requestState": {
1052
+ "enum": [
1053
+ "not_sent",
1054
+ "sent",
1055
+ "unknown"
1056
+ ],
1057
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
1058
+ },
1059
+ "coverage": {
1060
+ "enum": [
1061
+ "complete",
1062
+ "partial"
1063
+ ],
1064
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
1065
+ },
1066
+ "observedAttempts": {
1067
+ "type": "integer",
1068
+ "minimum": 0,
1069
+ "maximum": 9007199254740991,
1070
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
1071
+ }
1072
+ }
1073
+ }
1074
+ },
1075
+ "api": {
1076
+ "method": "POST",
1077
+ "path": "youzan.trade.refund.search/3.0.1"
1078
+ },
1079
+ "success": {
1080
+ "description": "同店核验及业务成功后返回本页data;预览返回requests。"
1081
+ },
1082
+ "notes": [
1083
+ "--kdt-id 省略时使用本次有效上下文 shopId;显式提供的非法值不回退。两者都缺失时拒绝;目标范围、同店核验和服务端权限仍按本命令校验。",
1084
+ "仅店铺位置可执行,目标店铺省略时使用当前上下文,显式非法值不回退;目标须与当前店铺及凭证核验一致。上下文不是授权证明,应用token不证明员工权限。缺上下文时只允许显式合法店铺的本地预览。",
1085
+ "输入拒绝未知选项、多余参数、重复单值选项、空串及非规范数字。没有旧参数别名,没有include,没有自动翻页。",
1086
+ "可选输出缺失时省略,显式null或错型失败;不从筛选值填充当前诉求、退款模式或其他未返回字段。单页重复售后、缺数组及矛盾total失败。",
1087
+ "至多2次请求,累计响应10MiB,最终输出5MiB;流读取取消超限,不输出部分结果,不自动重试、换店或切身份。",
1088
+ "错误时stdout为空,stderr一份JSON,退出非零。解析错误可能没有details,进入业务执行的错误必须有details。",
1089
+ "列表不提供精确售后商品行、资金流水、库存确认或财务对账,不承诺全集、无遗漏、排序或分页快照。"
1090
+ ],
1091
+ "errors": {
1092
+ "description": "失败 stdout 为空,stderr 为一条安全错误;本地输入问题提供字段诊断,不自动重试、切店或换身份。",
1093
+ "diagnosticsVersion": 2
1094
+ }
1095
+ }