@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,624 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "required": [
6
+ "activityId",
7
+ "kdtId"
8
+ ],
9
+ "additionalProperties": false,
10
+ "description": "参数解析并按有效上下文补全后的业务输入;原始选项及默认值见 options。",
11
+ "properties": {
12
+ "activityId": {
13
+ "$ref": "#/definitions/id",
14
+ "description": "券发行活动 ID,不是客户持券 ID、码号或 alias。"
15
+ },
16
+ "kdtId": {
17
+ "$ref": "#/definitions/id",
18
+ "description": "目标店铺;省略选项时取有效上下文 shopId,执行时核验同店凭证。"
19
+ }
20
+ }
21
+ },
22
+ "output": {
23
+ "type": "object",
24
+ "required": [
25
+ "data"
26
+ ],
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "data": {
30
+ "type": "object",
31
+ "required": [
32
+ "activity"
33
+ ],
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "activity": {
37
+ "type": "object",
38
+ "required": [
39
+ "activityId",
40
+ "ownerKdtId",
41
+ "title",
42
+ "activityType",
43
+ "status",
44
+ "offer"
45
+ ],
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "activityId": {
49
+ "$ref": "#/definitions/id",
50
+ "description": "必须与输入活动 ID 一致。"
51
+ },
52
+ "ownerKdtId": {
53
+ "$ref": "#/definitions/id",
54
+ "description": "活动归属店铺,必须与目标一致;不是领取或使用店铺。"
55
+ },
56
+ "title": {
57
+ "type": "string",
58
+ "minLength": 1,
59
+ "pattern": "\\S"
60
+ },
61
+ "activityType": {
62
+ "$ref": "#/definitions/integer",
63
+ "description": "7 优惠券,9 共享码,10 唯一码;未知整数保留,不赋予已知含义。"
64
+ },
65
+ "status": {
66
+ "$ref": "#/definitions/integer",
67
+ "description": "-1 无法发放和使用,0 正常可发放,1 已失效,2 审核中,3 已作废;未知整数保留,不当正常。0 不证明客户资格或订单可用。"
68
+ },
69
+ "remark": {
70
+ "type": "string",
71
+ "description": "可选文本;空串保留,缺失省略,null 不合法。"
72
+ },
73
+ "description": {
74
+ "type": "string",
75
+ "description": "可选规则原文,只作文本,不是结构化日期或资格结果。"
76
+ },
77
+ "offer": {
78
+ "$ref": "#/definitions/offer"
79
+ },
80
+ "threshold": {
81
+ "$ref": "#/definitions/threshold",
82
+ "description": "取得门槛类型时出现;缺失省略,不补默认门槛。"
83
+ }
84
+ }
85
+ },
86
+ "budget": {
87
+ "type": "object",
88
+ "minProperties": 1,
89
+ "additionalProperties": false,
90
+ "description": "取得任一预算字段时出现,仅保留已返回字段;不是客户余额,不推算库存。缺失省略,null 或错型失败。",
91
+ "properties": {
92
+ "takenQty": {
93
+ "$ref": "#/definitions/count",
94
+ "description": "已领取数量,不是去重客户数。"
95
+ },
96
+ "usedQty": {
97
+ "$ref": "#/definitions/count",
98
+ "description": "已使用数量。"
99
+ },
100
+ "sendTotalQty": {
101
+ "$ref": "#/definitions/integer",
102
+ "description": "发放预算,保留原整数,不解释负数哨兵。"
103
+ },
104
+ "useTotalQty": {
105
+ "$ref": "#/definitions/integer",
106
+ "description": "使用预算,保留原整数,不解释负数哨兵。"
107
+ },
108
+ "sendStockQty": {
109
+ "$ref": "#/definitions/integer",
110
+ "description": "发放库存,保留原整数,不由预算推算。"
111
+ },
112
+ "useStockQty": {
113
+ "$ref": "#/definitions/integer",
114
+ "description": "使用库存,保留原整数,不由预算推算。"
115
+ }
116
+ }
117
+ },
118
+ "scope": {
119
+ "type": "object",
120
+ "minProperties": 1,
121
+ "additionalProperties": false,
122
+ "description": "取得任一范围字段时出现,仅为本次返回的配置引用;不补齐渠道或成员,不证明最终可用性或完整经营商品集合,不可直接回写覆盖。",
123
+ "properties": {
124
+ "shops": {
125
+ "type": "object",
126
+ "minProperties": 1,
127
+ "additionalProperties": false,
128
+ "properties": {
129
+ "type": {
130
+ "type": "integer",
131
+ "enum": [
132
+ 1,
133
+ 2,
134
+ 3
135
+ ],
136
+ "description": "1 仅本店,2 部分店铺,3 全部店铺;未知类型失败,省略不推断。"
137
+ },
138
+ "kdtIds": {
139
+ "$ref": "#/definitions/ids",
140
+ "description": "已返回的使用店铺 ID;保留顺序和实际空数组,不用空数组反推类型。"
141
+ }
142
+ }
143
+ },
144
+ "online": {
145
+ "$ref": "#/definitions/channel",
146
+ "description": "网店配置,取得该渠道任一字段时出现。"
147
+ },
148
+ "offline": {
149
+ "$ref": "#/definitions/channel",
150
+ "description": "门店配置,取得该渠道任一字段时出现。"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "preview": {
159
+ "type": "object",
160
+ "required": [
161
+ "scope",
162
+ "prerequisites",
163
+ "requests"
164
+ ],
165
+ "additionalProperties": false,
166
+ "properties": {
167
+ "scope": {
168
+ "$ref": "#/definitions/scope"
169
+ },
170
+ "prerequisites": {
171
+ "type": "array",
172
+ "const": [
173
+ "context",
174
+ "token-shop-binding"
175
+ ],
176
+ "items": {
177
+ "type": "string"
178
+ }
179
+ },
180
+ "requests": {
181
+ "type": "array",
182
+ "minItems": 2,
183
+ "maxItems": 2,
184
+ "additionalItems": false,
185
+ "items": [
186
+ {
187
+ "type": "object",
188
+ "required": [
189
+ "method",
190
+ "api",
191
+ "body"
192
+ ],
193
+ "additionalProperties": false,
194
+ "properties": {
195
+ "method": {
196
+ "const": "POST"
197
+ },
198
+ "api": {
199
+ "const": "youzan.shop.basic.get/3.0.0"
200
+ },
201
+ "body": {
202
+ "type": "object",
203
+ "additionalProperties": false,
204
+ "properties": {}
205
+ }
206
+ }
207
+ },
208
+ {
209
+ "type": "object",
210
+ "required": [
211
+ "method",
212
+ "api",
213
+ "body"
214
+ ],
215
+ "additionalProperties": false,
216
+ "properties": {
217
+ "method": {
218
+ "const": "POST"
219
+ },
220
+ "api": {
221
+ "const": "youzan.ump.voucheractivity.detail.query/3.0.4"
222
+ },
223
+ "body": {
224
+ "type": "object",
225
+ "required": [
226
+ "activity_id"
227
+ ],
228
+ "additionalProperties": false,
229
+ "properties": {
230
+ "activity_id": {
231
+ "$ref": "#/definitions/id"
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ ]
238
+ }
239
+ }
240
+ },
241
+ "error": {
242
+ "type": "object",
243
+ "required": [
244
+ "success",
245
+ "code",
246
+ "message",
247
+ "details"
248
+ ],
249
+ "additionalProperties": false,
250
+ "properties": {
251
+ "success": {
252
+ "const": false
253
+ },
254
+ "code": {
255
+ "const": -10001
256
+ },
257
+ "message": {
258
+ "type": "string",
259
+ "minLength": 1
260
+ },
261
+ "details": {
262
+ "type": "object",
263
+ "required": [
264
+ "command",
265
+ "category",
266
+ "stage",
267
+ "targetScope",
268
+ "requestState",
269
+ "nextStep"
270
+ ],
271
+ "additionalProperties": false,
272
+ "properties": {
273
+ "command": {
274
+ "const": "coupon.activity.get"
275
+ },
276
+ "category": {
277
+ "enum": [
278
+ "parameter",
279
+ "validation",
280
+ "configuration",
281
+ "authentication",
282
+ "permission",
283
+ "scope_unresolved",
284
+ "transport",
285
+ "http",
286
+ "protocol",
287
+ "business_rejected",
288
+ "not_found"
289
+ ]
290
+ },
291
+ "stage": {
292
+ "enum": [
293
+ "input",
294
+ "configuration",
295
+ "shop-binding",
296
+ "query",
297
+ "response"
298
+ ]
299
+ },
300
+ "targetScope": {
301
+ "type": "object",
302
+ "additionalProperties": false,
303
+ "properties": {
304
+ "kdtId": {
305
+ "$ref": "#/definitions/id"
306
+ }
307
+ }
308
+ },
309
+ "requestState": {
310
+ "enum": [
311
+ "not_sent",
312
+ "sent",
313
+ "unknown"
314
+ ]
315
+ },
316
+ "nextStep": {
317
+ "type": "string",
318
+ "minLength": 1
319
+ },
320
+ "api": {
321
+ "type": "string",
322
+ "minLength": 1
323
+ },
324
+ "httpStatus": {
325
+ "type": "integer",
326
+ "minimum": 100,
327
+ "maximum": 599
328
+ },
329
+ "businessCode": {
330
+ "$ref": "#/definitions/code"
331
+ },
332
+ "gatewayCode": {
333
+ "$ref": "#/definitions/code"
334
+ },
335
+ "trace_id": {
336
+ "$ref": "#/definitions/trace"
337
+ },
338
+ "request_id": {
339
+ "$ref": "#/definitions/trace"
340
+ }
341
+ }
342
+ }
343
+ }
344
+ },
345
+ "definitions": {
346
+ "id": {
347
+ "type": "integer",
348
+ "minimum": 1,
349
+ "maximum": 9007199254740991
350
+ },
351
+ "integer": {
352
+ "type": "integer",
353
+ "minimum": -9007199254740991,
354
+ "maximum": 9007199254740991
355
+ },
356
+ "count": {
357
+ "type": "integer",
358
+ "minimum": 0,
359
+ "maximum": 9007199254740991
360
+ },
361
+ "ids": {
362
+ "type": "array",
363
+ "items": {
364
+ "$ref": "#/definitions/id"
365
+ }
366
+ },
367
+ "scope": {
368
+ "type": "object",
369
+ "required": [
370
+ "kdtId"
371
+ ],
372
+ "additionalProperties": false,
373
+ "properties": {
374
+ "kdtId": {
375
+ "$ref": "#/definitions/id"
376
+ }
377
+ }
378
+ },
379
+ "money": {
380
+ "type": "string",
381
+ "pattern": "^(?:0|[1-9][0-9]*)\\.[0-9]{2}$",
382
+ "description": "人民币 CNY 元两位十进制文本,非负,不舍入;缺失不补零,null 不合法。",
383
+ "$comment": "upstream-money:fen"
384
+ },
385
+ "offer": {
386
+ "description": "互斥优惠分支;未知方式或不支持的代金券面额规则失败,不混用金额与折扣。",
387
+ "oneOf": [
388
+ {
389
+ "type": "object",
390
+ "required": [
391
+ "mode",
392
+ "valueRule",
393
+ "amount"
394
+ ],
395
+ "additionalProperties": false,
396
+ "properties": {
397
+ "mode": {
398
+ "const": 1,
399
+ "description": "1 代金券。"
400
+ },
401
+ "valueRule": {
402
+ "const": 1,
403
+ "description": "1 固定面额。"
404
+ },
405
+ "amount": {
406
+ "$ref": "#/definitions/money"
407
+ }
408
+ }
409
+ },
410
+ {
411
+ "type": "object",
412
+ "required": [
413
+ "mode",
414
+ "valueRule",
415
+ "minAmount",
416
+ "maxAmount"
417
+ ],
418
+ "additionalProperties": false,
419
+ "properties": {
420
+ "mode": {
421
+ "const": 1,
422
+ "description": "1 代金券。"
423
+ },
424
+ "valueRule": {
425
+ "type": "integer",
426
+ "enum": [
427
+ 2,
428
+ 3
429
+ ],
430
+ "description": "2 指定范围,3 范围随机;不代表已确定的随机金额。"
431
+ },
432
+ "minAmount": {
433
+ "$ref": "#/definitions/money",
434
+ "description": "金额下限,必须小于或等于上限。"
435
+ },
436
+ "maxAmount": {
437
+ "$ref": "#/definitions/money",
438
+ "description": "金额上限。"
439
+ }
440
+ }
441
+ },
442
+ {
443
+ "type": "object",
444
+ "required": [
445
+ "mode",
446
+ "discountTenths"
447
+ ],
448
+ "additionalProperties": false,
449
+ "properties": {
450
+ "mode": {
451
+ "const": 2,
452
+ "description": "2 折扣券。"
453
+ },
454
+ "discountTenths": {
455
+ "type": "integer",
456
+ "minimum": 1,
457
+ "maximum": 100,
458
+ "description": "十分之一折,88=8.8折,100=10折,不是金额。"
459
+ },
460
+ "maxDiscountAmount": {
461
+ "$ref": "#/definitions/money",
462
+ "description": "可选折扣金额上限,0.00 表示未设金额上限;省略不作此推断。"
463
+ }
464
+ }
465
+ },
466
+ {
467
+ "type": "object",
468
+ "required": [
469
+ "mode"
470
+ ],
471
+ "additionalProperties": false,
472
+ "properties": {
473
+ "mode": {
474
+ "const": 3,
475
+ "description": "3 兑换券;不输出占位金额或折扣,兑换引用见范围。"
476
+ }
477
+ }
478
+ }
479
+ ]
480
+ },
481
+ "threshold": {
482
+ "oneOf": [
483
+ {
484
+ "type": "object",
485
+ "required": [
486
+ "type"
487
+ ],
488
+ "additionalProperties": false,
489
+ "properties": {
490
+ "type": {
491
+ "const": 0,
492
+ "description": "0 无门槛。"
493
+ }
494
+ }
495
+ },
496
+ {
497
+ "type": "object",
498
+ "required": [
499
+ "type",
500
+ "amount"
501
+ ],
502
+ "additionalProperties": false,
503
+ "properties": {
504
+ "type": {
505
+ "const": 1,
506
+ "description": "1 满金额。"
507
+ },
508
+ "amount": {
509
+ "$ref": "#/definitions/money"
510
+ }
511
+ }
512
+ },
513
+ {
514
+ "type": "object",
515
+ "required": [
516
+ "type",
517
+ "minPieces"
518
+ ],
519
+ "additionalProperties": false,
520
+ "properties": {
521
+ "type": {
522
+ "const": 2,
523
+ "description": "2 满件数。"
524
+ },
525
+ "minPieces": {
526
+ "$ref": "#/definitions/count",
527
+ "description": "件数下限;0 按数值保留,不解释为不限。"
528
+ },
529
+ "maxPieces": {
530
+ "$ref": "#/definitions/count",
531
+ "description": "可选件数上限;0 按数值保留,不解释为不限。"
532
+ }
533
+ }
534
+ }
535
+ ]
536
+ },
537
+ "channel": {
538
+ "type": "object",
539
+ "minProperties": 1,
540
+ "additionalProperties": false,
541
+ "description": "只保留已取得的字段;缺失不填空数组,缺少类型或关联集合时不推断具体适用商品。",
542
+ "properties": {
543
+ "type": {
544
+ "type": "integer",
545
+ "enum": [
546
+ 0,
547
+ 1,
548
+ 2,
549
+ 3
550
+ ],
551
+ "description": "0 不可用,1 不限制,2 部分可用,3 部分不可用;未知失败,省略不推断。"
552
+ },
553
+ "channel_item_ids": {
554
+ "$ref": "#/definitions/ids",
555
+ "description": "该网店或门店渠道的旧商品ID配置引用;类型2纳入、3排除,保留顺序及空数组,不直接作为OneID。"
556
+ },
557
+ "groupIds": {
558
+ "$ref": "#/definitions/ids",
559
+ "description": "商品分组配置引用,不展开成员。"
560
+ },
561
+ "exchange_channel_item_ids": {
562
+ "$ref": "#/definitions/ids",
563
+ "description": "该渠道可兑换的旧商品ID配置引用,不代表OneID或商品当前可售。"
564
+ },
565
+ "exchangeGroupIds": {
566
+ "$ref": "#/definitions/ids",
567
+ "description": "可兑换商品分组配置引用,不展开成员。"
568
+ }
569
+ }
570
+ },
571
+ "code": {
572
+ "anyOf": [
573
+ {
574
+ "$ref": "#/definitions/integer"
575
+ },
576
+ {
577
+ "type": "string",
578
+ "pattern": "^-?[0-9]{1,12}$"
579
+ }
580
+ ]
581
+ },
582
+ "trace": {
583
+ "type": "string",
584
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
585
+ }
586
+ },
587
+ "modules": {
588
+ "activity": {
589
+ "base": true,
590
+ "upstreamPath": "data",
591
+ "required": true,
592
+ "description": "已知活动的身份、状态、优惠及可选门槛。"
593
+ },
594
+ "budget": {
595
+ "base": true,
596
+ "upstreamPath": "data",
597
+ "required": false,
598
+ "description": "同次结果中已有的活动预算;源全部缺失则省略。"
599
+ },
600
+ "scope": {
601
+ "base": true,
602
+ "upstreamPath": "data",
603
+ "required": false,
604
+ "description": "同次结果中已有的使用范围引用;源全部缺失则省略。"
605
+ }
606
+ },
607
+ "api": {
608
+ "method": "POST",
609
+ "path": "youzan.ump.voucheractivity.detail.query/3.0.4"
610
+ },
611
+ "success": {
612
+ "description": "活动标识与输入一致、归属店铺与目标一致、必需锚点与优惠分支有效,所有已取得的可选预算和范围字段符合模型后整体成功。"
613
+ },
614
+ "errors": {
615
+ "description": "明确活动不存在时为 not_found;空对象、null、错型或缺必需字段为 protocol;归属不符或未知规则为 scope_unresolved。仅诊断业务码,不按自由消息猜权限;失败不输出部分成功结果。"
616
+ },
617
+ "notes": [
618
+ "只读券发行活动,不查询客户持券,不证明领取资格、持券状态或订单用券结果;不是可直接回写的编辑快照。",
619
+ "默认投影已有预算与范围,源缺失省略,实际空数组和零值保留,已返回字段错型或 null 失败;不提供 include 或任意字段选择。",
620
+ "不输出结构化活动日期、领取限制、平台信息或未承诺扩展字段。支持微商城/零售单店、连锁 D 总部/网店/合伙人,不承诺连锁 L。",
621
+ "最多两次请求,同一凭证先核验店铺再读取详情;无补查、自动重试、切店或换身份,不承诺跨归属店铺。",
622
+ "真实执行需有效四字段上下文和同店凭证,位置准入不证明员工授权;缺上下文仅显式合法目标可本地预览。"
623
+ ]
624
+ }