@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,772 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "required": [
6
+ "kdtId",
7
+ "form",
8
+ "yzOpenId",
9
+ "status",
10
+ "pageNo",
11
+ "pageSize"
12
+ ],
13
+ "additionalProperties": false,
14
+ "properties": {
15
+ "kdtId": {
16
+ "$ref": "#/definitions/positiveInteger"
17
+ },
18
+ "form": {
19
+ "type": "string",
20
+ "enum": [
21
+ "card",
22
+ "code"
23
+ ],
24
+ "description": "card 优惠卡券,默认普通优惠券类别范围,不承诺完整覆盖三方券、兑换券、买赠券或运费抵扣券;code 优惠码,仅为该分组默认返回范围,不承诺全部码活动。未知形态拒绝。"
25
+ },
26
+ "yzOpenId": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "pattern": "^(?!.*[\\u0000-\\u001f\\u007f-\\u009f])\\S(?:[\\s\\S]*\\S)?$",
30
+ "description": "客户有赞开放标识,trim 后非空,无控制字符,保持字符串。"
31
+ },
32
+ "status": {
33
+ "type": "integer",
34
+ "minimum": 0,
35
+ "maximum": 4,
36
+ "description": "筛选0为所选形态及默认活动类别内的全部使用状态;1生效即未使用且未过期;2已使用;3未使用且已过期;4已失效即已使用或已过期,不是商家作废。默认0,不表示全部券类别。"
37
+ },
38
+ "pageNo": {
39
+ "type": "integer",
40
+ "minimum": 1,
41
+ "maximum": 2147483647
42
+ },
43
+ "pageSize": {
44
+ "type": "integer",
45
+ "minimum": 1,
46
+ "maximum": 200
47
+ }
48
+ },
49
+ "description": "CLI 参数解析与上下文补全后的规范化业务输入,不接受 JSON 直接调用;原始选项和默认值见 options。"
50
+ },
51
+ "output": {
52
+ "type": "object",
53
+ "required": [
54
+ "data"
55
+ ],
56
+ "additionalProperties": false,
57
+ "properties": {
58
+ "data": {
59
+ "type": "object",
60
+ "required": [
61
+ "vouchers",
62
+ "pagination"
63
+ ],
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "vouchers": {
67
+ "type": "array",
68
+ "maxItems": 200,
69
+ "items": {
70
+ "$ref": "#/definitions/voucher"
71
+ }
72
+ },
73
+ "pagination": {
74
+ "$ref": "#/definitions/pagination"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ },
80
+ "preview": {
81
+ "type": "object",
82
+ "required": [
83
+ "scope",
84
+ "prerequisites",
85
+ "requests"
86
+ ],
87
+ "additionalProperties": false,
88
+ "properties": {
89
+ "scope": {
90
+ "type": "object",
91
+ "required": [
92
+ "kdtId"
93
+ ],
94
+ "additionalProperties": false,
95
+ "properties": {
96
+ "kdtId": {
97
+ "$ref": "#/definitions/positiveInteger"
98
+ }
99
+ }
100
+ },
101
+ "prerequisites": {
102
+ "type": "array",
103
+ "minItems": 1,
104
+ "maxItems": 1,
105
+ "items": {
106
+ "type": "object",
107
+ "required": [
108
+ "method",
109
+ "path",
110
+ "body"
111
+ ],
112
+ "additionalProperties": false,
113
+ "properties": {
114
+ "method": {
115
+ "const": "POST"
116
+ },
117
+ "path": {
118
+ "const": "youzan.shop.basic.get/3.0.0"
119
+ },
120
+ "body": {
121
+ "type": "object",
122
+ "additionalProperties": false
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "requests": {
128
+ "type": "array",
129
+ "minItems": 1,
130
+ "maxItems": 1,
131
+ "items": {
132
+ "type": "object",
133
+ "required": [
134
+ "method",
135
+ "path",
136
+ "body"
137
+ ],
138
+ "additionalProperties": false,
139
+ "properties": {
140
+ "method": {
141
+ "const": "POST"
142
+ },
143
+ "path": {
144
+ "const": "youzan.ump.voucher.query/3.0.0"
145
+ },
146
+ "body": {
147
+ "type": "object",
148
+ "required": [
149
+ "activity_type_group",
150
+ "yz_open_id",
151
+ "status",
152
+ "page_num",
153
+ "page_size"
154
+ ],
155
+ "additionalProperties": false,
156
+ "properties": {
157
+ "activity_type_group": {
158
+ "type": "integer",
159
+ "enum": [
160
+ 1,
161
+ 2
162
+ ]
163
+ },
164
+ "yz_open_id": {
165
+ "type": "string",
166
+ "minLength": 1,
167
+ "pattern": "^(?!.*[\\u0000-\\u001f\\u007f-\\u009f])\\S(?:[\\s\\S]*\\S)?$",
168
+ "description": "客户有赞开放标识,trim 后非空,无控制字符,保持字符串。"
169
+ },
170
+ "status": {
171
+ "type": "integer",
172
+ "minimum": 0,
173
+ "maximum": 4
174
+ },
175
+ "page_num": {
176
+ "type": "integer",
177
+ "minimum": 1,
178
+ "maximum": 2147483647
179
+ },
180
+ "page_size": {
181
+ "type": "integer",
182
+ "minimum": 1,
183
+ "maximum": 200
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+ },
192
+ "error": {
193
+ "type": "object",
194
+ "required": [
195
+ "success",
196
+ "code",
197
+ "message",
198
+ "details"
199
+ ],
200
+ "additionalProperties": false,
201
+ "properties": {
202
+ "success": {
203
+ "const": false
204
+ },
205
+ "code": {
206
+ "const": -10001
207
+ },
208
+ "message": {
209
+ "type": "string",
210
+ "minLength": 1
211
+ },
212
+ "details": {
213
+ "type": "object",
214
+ "required": [
215
+ "category",
216
+ "stage",
217
+ "command",
218
+ "targetScope",
219
+ "requestState",
220
+ "nextStep",
221
+ "errorVersion",
222
+ "recovery",
223
+ "execution"
224
+ ],
225
+ "additionalProperties": false,
226
+ "properties": {
227
+ "category": {
228
+ "type": "string",
229
+ "enum": [
230
+ "validation",
231
+ "configuration",
232
+ "parameter",
233
+ "permission",
234
+ "authentication",
235
+ "scope_unresolved",
236
+ "transport",
237
+ "http",
238
+ "protocol",
239
+ "business_rejected",
240
+ "not_found",
241
+ "target_mismatch",
242
+ "ambiguous"
243
+ ]
244
+ },
245
+ "stage": {
246
+ "type": "string",
247
+ "minLength": 1
248
+ },
249
+ "command": {
250
+ "const": "coupon.voucher.list"
251
+ },
252
+ "targetScope": {
253
+ "type": "object",
254
+ "additionalProperties": false,
255
+ "properties": {
256
+ "kdtId": {
257
+ "$ref": "#/definitions/shopId"
258
+ }
259
+ }
260
+ },
261
+ "requestState": {
262
+ "enum": [
263
+ "not_sent",
264
+ "sent",
265
+ "unknown"
266
+ ]
267
+ },
268
+ "nextStep": {
269
+ "type": "string",
270
+ "minLength": 1
271
+ },
272
+ "api": {
273
+ "type": "string"
274
+ },
275
+ "httpStatus": {
276
+ "type": "integer"
277
+ },
278
+ "businessCode": {
279
+ "anyOf": [
280
+ {
281
+ "type": "integer"
282
+ },
283
+ {
284
+ "type": "string"
285
+ }
286
+ ]
287
+ },
288
+ "gatewayCode": {
289
+ "anyOf": [
290
+ {
291
+ "type": "integer"
292
+ },
293
+ {
294
+ "type": "string"
295
+ }
296
+ ]
297
+ },
298
+ "trace_id": {
299
+ "type": "string"
300
+ },
301
+ "request_id": {
302
+ "type": "string"
303
+ },
304
+ "errorVersion": {
305
+ "const": 2,
306
+ "description": "本命令采用错误诊断协议第二版。"
307
+ },
308
+ "issues": {
309
+ "type": "array",
310
+ "minItems": 1,
311
+ "maxItems": 16,
312
+ "items": {
313
+ "$ref": "#/definitions/diagnosticIssue"
314
+ },
315
+ "description": "最多十六个已定位问题,不包含收到的原值。"
316
+ },
317
+ "issuesTruncated": {
318
+ "const": true,
319
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
320
+ },
321
+ "recovery": {
322
+ "$ref": "#/definitions/diagnosticRecovery",
323
+ "description": "受限的恢复说明,不会自动执行。"
324
+ },
325
+ "execution": {
326
+ "$ref": "#/definitions/diagnosticExecution",
327
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
328
+ }
329
+ }
330
+ }
331
+ }
332
+ },
333
+ "definitions": {
334
+ "positiveInteger": {
335
+ "type": "integer",
336
+ "minimum": 1,
337
+ "maximum": 9007199254740991
338
+ },
339
+ "shopId": {
340
+ "type": "integer",
341
+ "minimum": 1,
342
+ "maximum": 9007199254740991
343
+ },
344
+ "voucher": {
345
+ "type": "object",
346
+ "required": [
347
+ "voucherId",
348
+ "form",
349
+ "ownerKdtId",
350
+ "activityId",
351
+ "yzOpenId",
352
+ "status",
353
+ "validity"
354
+ ],
355
+ "additionalProperties": false,
356
+ "properties": {
357
+ "voucherId": {
358
+ "type": "integer",
359
+ "minimum": 1,
360
+ "maximum": 9007199254740991,
361
+ "description": "买家单张凭证ID,不是活动ID或客户ID。"
362
+ },
363
+ "form": {
364
+ "type": "string",
365
+ "enum": [
366
+ "card",
367
+ "code"
368
+ ],
369
+ "description": "card 优惠卡券;code 优惠码;未知或与请求不一致的凭证类型拒绝。"
370
+ },
371
+ "ownerKdtId": {
372
+ "type": "integer",
373
+ "minimum": 1,
374
+ "maximum": 9007199254740991,
375
+ "description": "归属店铺,必须等于本次目标店铺。"
376
+ },
377
+ "activityId": {
378
+ "type": "integer",
379
+ "minimum": 1,
380
+ "maximum": 9007199254740991,
381
+ "description": "券发行活动引用,不作为查询筛选。"
382
+ },
383
+ "yzOpenId": {
384
+ "type": "string",
385
+ "minLength": 1,
386
+ "pattern": "^(?!.*[\\u0000-\\u001f\\u007f-\\u009f])\\S(?:[\\s\\S]*\\S)?$",
387
+ "description": "客户有赞开放标识,trim 后非空,无控制字符,保持字符串。"
388
+ },
389
+ "status": {
390
+ "type": "integer",
391
+ "minimum": -9007199254740991,
392
+ "maximum": 9007199254740991,
393
+ "description": "单券状态:1正常、2冻结、3已核销、4不可用、5已删除;未来安全整数保留,不按筛选status解释。"
394
+ },
395
+ "title": {
396
+ "type": "string",
397
+ "description": "源省略则省略,空串保留,null或错型失败。"
398
+ },
399
+ "description": {
400
+ "type": "string",
401
+ "description": "原文描述;源省略则省略,空串保留,null或错型失败。"
402
+ },
403
+ "validity": {
404
+ "type": "object",
405
+ "required": [
406
+ "startAt",
407
+ "endAt"
408
+ ],
409
+ "additionalProperties": false,
410
+ "properties": {
411
+ "startAt": {
412
+ "type": "string",
413
+ "format": "beijing-date-time-ms",
414
+ "description": "有效期开始;源为正安全毫秒整数,转换为北京时间 YYYY-MM-DD HH:mm:ss.SSS;无零值或永久哨兵。"
415
+ },
416
+ "endAt": {
417
+ "type": "string",
418
+ "format": "beijing-date-time-ms",
419
+ "description": "有效期结束,须不早于开始;源为正安全毫秒整数,转换为北京时间 YYYY-MM-DD HH:mm:ss.SSS;无零值或永久哨兵。"
420
+ }
421
+ }
422
+ },
423
+ "sentAt": {
424
+ "type": "string",
425
+ "format": "beijing-date-time-ms",
426
+ "description": "发放时间,源省略则省略,null或错型失败;源为正安全毫秒整数,转换为北京时间 YYYY-MM-DD HH:mm:ss.SSS;无零值或永久哨兵。"
427
+ }
428
+ }
429
+ },
430
+ "pagination": {
431
+ "type": "object",
432
+ "required": [
433
+ "pageNo",
434
+ "pageSize",
435
+ "returnedCount",
436
+ "hasMore",
437
+ "nextPageNo"
438
+ ],
439
+ "additionalProperties": false,
440
+ "properties": {
441
+ "pageNo": {
442
+ "type": "integer",
443
+ "minimum": 1,
444
+ "maximum": 2147483647
445
+ },
446
+ "pageSize": {
447
+ "type": "integer",
448
+ "minimum": 1,
449
+ "maximum": 200
450
+ },
451
+ "total": {
452
+ "type": "integer",
453
+ "minimum": 0,
454
+ "maximum": 9007199254740991,
455
+ "description": "匹配本次查询条件的总记录数,不是当前页返回条数;上游未提供可确认总数时省略。"
456
+ },
457
+ "returnedCount": {
458
+ "type": "integer",
459
+ "minimum": 0,
460
+ "maximum": 200
461
+ },
462
+ "hasMore": {
463
+ "type": ["boolean", "null"],
464
+ "description": "true 表示还有后续页,false 表示已确认没有后续页;无法确定时为 null,不以空页或短页推算。"
465
+ },
466
+ "nextPageNo": {
467
+ "anyOf": [
468
+ {
469
+ "type": "integer",
470
+ "minimum": 1,
471
+ "maximum": 2147483647
472
+ },
473
+ {
474
+ "type": "null"
475
+ }
476
+ ],
477
+ "description": "已确认且未超过页码上限的下一页;无法确认或到达上限时为 null。"
478
+ }
479
+ }
480
+ },
481
+ "diagnosticExpected": {
482
+ "type": "object",
483
+ "additionalProperties": false,
484
+ "required": [],
485
+ "properties": {
486
+ "type": {
487
+ "anyOf": [
488
+ {
489
+ "type": "string",
490
+ "description": "预期的 JSON 类型。"
491
+ },
492
+ {
493
+ "type": "array",
494
+ "items": {
495
+ "type": "string",
496
+ "description": "预期的 JSON 类型。"
497
+ }
498
+ }
499
+ ],
500
+ "description": "同版模型允许的类型。"
501
+ },
502
+ "enum": {
503
+ "type": "array",
504
+ "items": {
505
+ "anyOf": [
506
+ {
507
+ "type": "string"
508
+ },
509
+ {
510
+ "type": "number"
511
+ },
512
+ {
513
+ "type": "boolean"
514
+ },
515
+ {
516
+ "type": "null"
517
+ }
518
+ ],
519
+ "description": "契约声明的静态标量约束。"
520
+ },
521
+ "description": "同版模型允许的静态值。"
522
+ },
523
+ "const": {
524
+ "anyOf": [
525
+ {
526
+ "type": "string"
527
+ },
528
+ {
529
+ "type": "number"
530
+ },
531
+ {
532
+ "type": "boolean"
533
+ },
534
+ {
535
+ "type": "null"
536
+ }
537
+ ],
538
+ "description": "契约声明的静态标量约束。"
539
+ },
540
+ "minimum": {
541
+ "type": "number",
542
+ "description": "包含的最小值。"
543
+ },
544
+ "maximum": {
545
+ "type": "number",
546
+ "description": "包含的最大值。"
547
+ },
548
+ "exclusiveMinimum": {
549
+ "type": "number",
550
+ "description": "不包含的最小值。"
551
+ },
552
+ "exclusiveMaximum": {
553
+ "type": "number",
554
+ "description": "不包含的最大值。"
555
+ },
556
+ "minLength": {
557
+ "type": "integer",
558
+ "description": "最少字符数。"
559
+ },
560
+ "maxLength": {
561
+ "type": "integer",
562
+ "description": "最多字符数。"
563
+ },
564
+ "minItems": {
565
+ "type": "integer",
566
+ "description": "最少元素数。"
567
+ },
568
+ "maxItems": {
569
+ "type": "integer",
570
+ "description": "最多元素数。"
571
+ },
572
+ "format": {
573
+ "type": "string",
574
+ "description": "同版模型声明的格式。"
575
+ },
576
+ "pattern": {
577
+ "type": "string",
578
+ "description": "同版模型声明的字符约束。"
579
+ },
580
+ "additionalProperties": {
581
+ "const": false,
582
+ "description": "对象拒绝契约以外的属性。"
583
+ },
584
+ "contains": {
585
+ "type": "object",
586
+ "additionalProperties": false,
587
+ "required": [
588
+ "const"
589
+ ],
590
+ "properties": {
591
+ "const": {
592
+ "anyOf": [
593
+ {
594
+ "type": "string"
595
+ },
596
+ {
597
+ "type": "number"
598
+ },
599
+ {
600
+ "type": "boolean"
601
+ },
602
+ {
603
+ "type": "null"
604
+ }
605
+ ],
606
+ "description": "契约声明的静态标量约束。"
607
+ }
608
+ }
609
+ },
610
+ "items": {
611
+ "type": "object",
612
+ "additionalProperties": false,
613
+ "required": [
614
+ "enum"
615
+ ],
616
+ "properties": {
617
+ "enum": {
618
+ "type": "array",
619
+ "items": {
620
+ "anyOf": [
621
+ {
622
+ "type": "string"
623
+ },
624
+ {
625
+ "type": "number"
626
+ },
627
+ {
628
+ "type": "boolean"
629
+ },
630
+ {
631
+ "type": "null"
632
+ }
633
+ ],
634
+ "description": "契约声明的静态标量约束。"
635
+ },
636
+ "description": "元素允许的静态值。"
637
+ }
638
+ }
639
+ }
640
+ }
641
+ },
642
+ "diagnosticIssue": {
643
+ "type": "object",
644
+ "additionalProperties": false,
645
+ "required": [
646
+ "source",
647
+ "reason"
648
+ ],
649
+ "properties": {
650
+ "source": {
651
+ "enum": [
652
+ "argv",
653
+ "input",
654
+ "context",
655
+ "output",
656
+ "preview"
657
+ ],
658
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
659
+ },
660
+ "path": {
661
+ "type": "string",
662
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
663
+ },
664
+ "option": {
665
+ "type": "string",
666
+ "description": "可定位时给出的已注册 CLI 选项。"
667
+ },
668
+ "reason": {
669
+ "enum": [
670
+ "required",
671
+ "invalid_type",
672
+ "invalid_choice",
673
+ "out_of_range",
674
+ "invalid_format",
675
+ "conditional_required",
676
+ "constraint",
677
+ "unexpected_property",
678
+ "unknown_option",
679
+ "unknown_command",
680
+ "excess_arguments",
681
+ "missing_value"
682
+ ],
683
+ "description": "字段违反的约束类型,原始值不回显。"
684
+ },
685
+ "expected": {
686
+ "$ref": "#/definitions/diagnosticExpected",
687
+ "description": "同版契约的静态预期。"
688
+ },
689
+ "relatedPaths": {
690
+ "type": "array",
691
+ "items": {
692
+ "type": "string",
693
+ "description": "关联字段的 JSON Pointer。"
694
+ },
695
+ "description": "触发条件约束的关联字段。"
696
+ }
697
+ }
698
+ },
699
+ "diagnosticRecovery": {
700
+ "type": "object",
701
+ "additionalProperties": false,
702
+ "required": [
703
+ "action",
704
+ "automaticBusinessRetry"
705
+ ],
706
+ "properties": {
707
+ "action": {
708
+ "enum": [
709
+ "correct_input",
710
+ "complete_authentication",
711
+ "request_access_review",
712
+ "stop_and_inspect"
713
+ ],
714
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
715
+ },
716
+ "automaticBusinessRetry": {
717
+ "const": false,
718
+ "description": "不据此自动重放业务请求。"
719
+ }
720
+ }
721
+ },
722
+ "diagnosticExecution": {
723
+ "type": "object",
724
+ "additionalProperties": false,
725
+ "required": [
726
+ "requestState",
727
+ "coverage",
728
+ "observedAttempts"
729
+ ],
730
+ "properties": {
731
+ "requestState": {
732
+ "enum": [
733
+ "not_sent",
734
+ "sent",
735
+ "unknown"
736
+ ],
737
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
738
+ },
739
+ "coverage": {
740
+ "enum": [
741
+ "complete",
742
+ "partial"
743
+ ],
744
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
745
+ },
746
+ "observedAttempts": {
747
+ "type": "integer",
748
+ "minimum": 0,
749
+ "maximum": 9007199254740991,
750
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
751
+ }
752
+ }
753
+ }
754
+ },
755
+ "api": {
756
+ "method": "POST",
757
+ "path": "youzan.ump.voucher.query/3.0.0"
758
+ },
759
+ "success": {
760
+ "description": "分页匹配请求,所有券的类型、客户、归属和固定字段完整后整页成功,不返回部分结果。"
761
+ },
762
+ "errors": {
763
+ "description": "失败 stdout 为空,stderr 为脱敏错误JSON且非零退出。161201523映射not_found,161201012/161201545为business_rejected;HTTP403为permission,冲突成功信号或旧包装为protocol,身份不符为scope_unresolved。不重试、切店、过滤异常行或输出部分成功。",
764
+ "diagnosticsVersion": 2
765
+ },
766
+ "notes": [
767
+ "固定同店凭证核验及一次主请求,最多两次应用请求;预览零请求,不读取凭证。无include、活动筛选、扫描或详情补查。",
768
+ "仅按默认活动类别查询。card 默认普通优惠券类别,不承诺完整覆盖三方券、兑换券、买赠券、运费抵扣券;code 不承诺所有码活动。total 与空页只描述该范围和当前筛选,不表示全部客户券资产。返回页码及容量须等于请求,total不得小于本页数量;有总量未到达的空页失败。",
769
+ "未选择面额、折扣、核销码、手机号、身份扩展、发放来源及订单;未知扩展不投影不校验。单券状态不转换成筛选状态,不根据时间推导资格。",
770
+ "仅支持凭证所属目标店铺,店铺核验不证明员工OAuth。支持微商城单店、零售单店、连锁D总部/网店/合伙人。"
771
+ ]
772
+ }