@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,1004 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "required": [
6
+ "activityId",
7
+ "kdtId"
8
+ ],
9
+ "additionalProperties": false,
10
+ "description": "CLI 解析并补全店铺后的业务输入,不是 CLI 接收的 JSON 或服务端请求体。",
11
+ "properties": {
12
+ "activityId": {
13
+ "$ref": "#/definitions/positiveInteger",
14
+ "description": "抽奖活动 ID,必需;不是活动别名、奖项或领奖标识。"
15
+ },
16
+ "kdtId": {
17
+ "$ref": "#/definitions/positiveInteger",
18
+ "description": "目标店铺 ID,省略选项时取有效 context.shopId;不证明授权。"
19
+ }
20
+ }
21
+ },
22
+ "output": {
23
+ "type": "object",
24
+ "required": [
25
+ "data"
26
+ ],
27
+ "additionalProperties": false,
28
+ "description": "本次读取的有限活动配置,不是可回写快照或客户实际奖励。",
29
+ "properties": {
30
+ "data": {
31
+ "type": "object",
32
+ "required": [
33
+ "lottery"
34
+ ],
35
+ "additionalProperties": false,
36
+ "description": "成功读取的单个活动结果,不含分页。",
37
+ "properties": {
38
+ "lottery": {
39
+ "$ref": "#/definitions/lottery",
40
+ "description": "与输入活动和目标店铺匹配的抽奖活动配置。"
41
+ }
42
+ }
43
+ }
44
+ }
45
+ },
46
+ "preview": {
47
+ "type": "object",
48
+ "required": [
49
+ "scope",
50
+ "prerequisites",
51
+ "requests",
52
+ "limits"
53
+ ],
54
+ "additionalProperties": false,
55
+ "description": "零认证、零网络的本地查询计划。",
56
+ "properties": {
57
+ "scope": {
58
+ "$ref": "#/definitions/scope",
59
+ "description": "本次解析的目标店铺,尚未核验授权。"
60
+ },
61
+ "prerequisites": {
62
+ "type": "array",
63
+ "const": [
64
+ "context",
65
+ "token-shop-binding"
66
+ ],
67
+ "description": "context 为有效上下文,token-shop-binding 为同凭证店铺核验。",
68
+ "items": {
69
+ "type": "string"
70
+ }
71
+ },
72
+ "requests": {
73
+ "type": "array",
74
+ "minItems": 2,
75
+ "maxItems": 2,
76
+ "additionalItems": false,
77
+ "description": "先核验店铺,再单次读取指定活动,不补查列表或奖励资产。",
78
+ "items": [
79
+ {
80
+ "type": "object",
81
+ "required": [
82
+ "method",
83
+ "api",
84
+ "body"
85
+ ],
86
+ "additionalProperties": false,
87
+ "properties": {
88
+ "method": {
89
+ "const": "POST",
90
+ "description": "核验请求方法。"
91
+ },
92
+ "api": {
93
+ "const": "youzan.shop.basic.get/3.0.0",
94
+ "description": "店铺核验接口及版本。"
95
+ },
96
+ "body": {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "description": "无业务参数。"
100
+ }
101
+ }
102
+ },
103
+ {
104
+ "type": "object",
105
+ "required": [
106
+ "method",
107
+ "api",
108
+ "body"
109
+ ],
110
+ "additionalProperties": false,
111
+ "properties": {
112
+ "method": {
113
+ "const": "POST",
114
+ "description": "活动读取请求方法。"
115
+ },
116
+ "api": {
117
+ "const": "youzan.ump.lottery.get/1.0.0",
118
+ "description": "活动详情接口及版本。"
119
+ },
120
+ "body": {
121
+ "type": "object",
122
+ "required": [
123
+ "activity_id"
124
+ ],
125
+ "additionalProperties": false,
126
+ "description": "单次详情请求的精确参数。",
127
+ "properties": {
128
+ "activity_id": {
129
+ "$ref": "#/definitions/positiveInteger",
130
+ "description": "输入活动 ID。"
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ ]
137
+ },
138
+ "limits": {
139
+ "type": "object",
140
+ "required": [
141
+ "maxBusinessRequests",
142
+ "bindingResponseBytes",
143
+ "queryResponseBytes"
144
+ ],
145
+ "additionalProperties": false,
146
+ "description": "固定内部预算,不属于业务输入或上游配额。",
147
+ "properties": {
148
+ "maxBusinessRequests": {
149
+ "const": 2,
150
+ "description": "最多两次业务 API 请求,不含认证续期网络。"
151
+ },
152
+ "bindingResponseBytes": {
153
+ "const": 524288,
154
+ "description": "店铺核验响应的 UTF-8 字节上限。"
155
+ },
156
+ "queryResponseBytes": {
157
+ "const": 8388608,
158
+ "description": "活动详情响应的 UTF-8 字节上限。"
159
+ }
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "error": {
165
+ "type": "object",
166
+ "required": [
167
+ "success",
168
+ "code",
169
+ "message",
170
+ "details"
171
+ ],
172
+ "additionalProperties": false,
173
+ "description": "失败只写入 stderr,stdout 为空,退出码为 1;不输出部分配置。",
174
+ "properties": {
175
+ "success": {
176
+ "const": false,
177
+ "description": "固定为失败。"
178
+ },
179
+ "code": {
180
+ "const": -10001,
181
+ "description": "CLI 查询错误码。"
182
+ },
183
+ "message": {
184
+ "type": "string",
185
+ "minLength": 1,
186
+ "description": "不含上游自由文本的安全错误说明。"
187
+ },
188
+ "details": {
189
+ "type": "object",
190
+ "required": [
191
+ "category",
192
+ "stage",
193
+ "command",
194
+ "targetScope",
195
+ "requestState",
196
+ "nextStep",
197
+ "errorVersion",
198
+ "recovery",
199
+ "execution"
200
+ ],
201
+ "additionalProperties": false,
202
+ "description": "失败阶段、发送事实和安全恢复指引。",
203
+ "properties": {
204
+ "category": {
205
+ "type": "string",
206
+ "enum": [
207
+ "parameter",
208
+ "validation",
209
+ "configuration",
210
+ "authentication",
211
+ "permission",
212
+ "http",
213
+ "transport",
214
+ "protocol",
215
+ "business_rejected",
216
+ "scope_unresolved",
217
+ "not_found",
218
+ "limit"
219
+ ],
220
+ "description": "parameter 参数解析错误;validation 输入格式错误;configuration 配置不足;authentication 身份失败;permission 权限拒绝;http HTTP 失败;transport 传输结果未知;protocol 响应不符;business_rejected 业务拒绝;scope_unresolved 活动、店铺或玩法不符;not_found 活动不存在;limit 响应超限。"
221
+ },
222
+ "stage": {
223
+ "type": "string",
224
+ "minLength": 1,
225
+ "description": "input 输入;context 公共上下文;scope 公共目标冲突;validation 公共店铺格式;configuration 配置;shop-binding 店铺核验;query 活动读取;response 正文预算或字段投影。"
226
+ },
227
+ "command": {
228
+ "const": "interaction.lottery.get",
229
+ "description": "失败命令。"
230
+ },
231
+ "targetScope": {
232
+ "type": "object",
233
+ "additionalProperties": false,
234
+ "description": "已解析目标,解析前失败时为空。",
235
+ "properties": {
236
+ "kdtId": {
237
+ "$ref": "#/definitions/positiveInteger",
238
+ "description": "本次目标店铺 ID。"
239
+ }
240
+ }
241
+ },
242
+ "requestState": {
243
+ "enum": [
244
+ "not_sent",
245
+ "sent",
246
+ "unknown"
247
+ ],
248
+ "description": "not_sent 尚未发送当前阶段请求;sent 已收到响应;unknown 已尝试发送但结果未知。"
249
+ },
250
+ "nextStep": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "description": "停止后核查原目标及授权,不自动重试、换店或换身份。"
254
+ },
255
+ "api": {
256
+ "type": "string",
257
+ "description": "失败接口及版本。"
258
+ },
259
+ "httpStatus": {
260
+ "type": "integer",
261
+ "description": "实际 HTTP 状态码。"
262
+ },
263
+ "businessCode": {
264
+ "$ref": "#/definitions/diagnosticCode",
265
+ "description": "安全上游业务码,1605406001 表示活动不存在,1605407001 表示店铺信息获取失败。"
266
+ },
267
+ "gatewayCode": {
268
+ "$ref": "#/definitions/diagnosticCode",
269
+ "description": "安全网关拒绝码,不当作活动不存在。"
270
+ },
271
+ "trace_id": {
272
+ "type": "string",
273
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$",
274
+ "description": "经过字符白名单校验的追踪标识。"
275
+ },
276
+ "request_id": {
277
+ "type": "string",
278
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$",
279
+ "description": "经过字符白名单校验的请求标识。"
280
+ },
281
+ "errorVersion": {
282
+ "const": 2,
283
+ "description": "本命令采用错误诊断协议第二版。"
284
+ },
285
+ "issues": {
286
+ "type": "array",
287
+ "minItems": 1,
288
+ "maxItems": 16,
289
+ "items": {
290
+ "$ref": "#/definitions/diagnosticIssue"
291
+ },
292
+ "description": "最多十六个已定位问题,不包含收到的原值。"
293
+ },
294
+ "issuesTruncated": {
295
+ "const": true,
296
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
297
+ },
298
+ "recovery": {
299
+ "$ref": "#/definitions/diagnosticRecovery",
300
+ "description": "受限的恢复说明,不会自动执行。"
301
+ },
302
+ "execution": {
303
+ "$ref": "#/definitions/diagnosticExecution",
304
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
305
+ }
306
+ }
307
+ }
308
+ }
309
+ },
310
+ "definitions": {
311
+ "diagnosticCode": {
312
+ "anyOf": [
313
+ {
314
+ "type": "integer",
315
+ "minimum": -9007199254740991,
316
+ "maximum": 9007199254740991
317
+ },
318
+ {
319
+ "type": "string",
320
+ "pattern": "^-?\\d{1,12}$"
321
+ }
322
+ ]
323
+ },
324
+ "positiveInteger": {
325
+ "type": "integer",
326
+ "minimum": 1,
327
+ "maximum": 9007199254740991
328
+ },
329
+ "integer": {
330
+ "type": "integer",
331
+ "minimum": -9007199254740991,
332
+ "maximum": 9007199254740991
333
+ },
334
+ "nonnegativeInteger": {
335
+ "type": "integer",
336
+ "minimum": 0,
337
+ "maximum": 9007199254740991
338
+ },
339
+ "scope": {
340
+ "type": "object",
341
+ "required": [
342
+ "kdtId"
343
+ ],
344
+ "additionalProperties": false,
345
+ "properties": {
346
+ "kdtId": {
347
+ "$ref": "#/definitions/positiveInteger",
348
+ "description": "目标店铺 ID。"
349
+ }
350
+ }
351
+ },
352
+ "lottery": {
353
+ "type": "object",
354
+ "required": [
355
+ "activityId",
356
+ "ownerKdtId",
357
+ "title",
358
+ "kind"
359
+ ],
360
+ "additionalProperties": false,
361
+ "description": "活动配置;可选字段未返回则省略,返回 null 或错型整体失败。",
362
+ "properties": {
363
+ "activityId": {
364
+ "$ref": "#/definitions/positiveInteger",
365
+ "description": "活动数字主键,必须与输入一致。"
366
+ },
367
+ "ownerKdtId": {
368
+ "$ref": "#/definitions/positiveInteger",
369
+ "description": "接口报告的活动归属店铺,必须与目标一致。"
370
+ },
371
+ "title": {
372
+ "type": "string",
373
+ "pattern": "\\S",
374
+ "description": "活动名称,必需且非空白。"
375
+ },
376
+ "kind": {
377
+ "type": "string",
378
+ "enum": [
379
+ "cards",
380
+ "wheel",
381
+ "zodiac",
382
+ "crazyguess",
383
+ "shake"
384
+ ],
385
+ "description": "抽奖玩法字符串:cards 刮刮卡;wheel 幸运大抽奖;zodiac 生肖翻翻看;crazyguess 疯狂猜猜猜;shake 有赞摇一摇。未知玩法失败。"
386
+ },
387
+ "alias": {
388
+ "type": "string",
389
+ "pattern": "\\S",
390
+ "description": "活动别名,不能代替活动数字 ID。"
391
+ },
392
+ "startsAt": {
393
+ "type": "string",
394
+ "format": "beijing-date-time-ms",
395
+ "description": "配置开始时间,北京时间 yyyy-MM-dd HH:mm:ss.SSS,年份 0001..9999;不用于推算状态。"
396
+ },
397
+ "endsAt": {
398
+ "type": "string",
399
+ "format": "beijing-date-time-ms",
400
+ "description": "配置结束时间,北京时间 yyyy-MM-dd HH:mm:ss.SSS,年份 0001..9999;不用于推算状态。"
401
+ },
402
+ "participation": {
403
+ "$ref": "#/definitions/participation",
404
+ "description": "至少一个所选参与配置存在时返回,不判断当前客户资格。"
405
+ },
406
+ "winning": {
407
+ "$ref": "#/definitions/winning",
408
+ "description": "中奖、未中奖和奖项定义配置,源空对象保留为空对象。"
409
+ },
410
+ "wheelSlots": {
411
+ "type": "array",
412
+ "description": "同次返回的转盘槽位,保留源顺序、重复引用和空数组,不表示奖品总数。",
413
+ "items": {
414
+ "$ref": "#/definitions/slot"
415
+ }
416
+ },
417
+ "view": {
418
+ "$ref": "#/definitions/view",
419
+ "description": "页面展示配置,源空对象保留为空对象。"
420
+ },
421
+ "autoReplyEnabled": {
422
+ "type": "boolean",
423
+ "description": "活动是否启用自动回复:true 启用,false 不启用。源字段缺失时省略,null 或非布尔值整体失败;不执行回复。"
424
+ },
425
+ "autoReply": {
426
+ "$ref": "#/definitions/autoReply",
427
+ "description": "自动回复配置,不执行回复,源空对象保留为空对象。"
428
+ }
429
+ }
430
+ },
431
+ "participation": {
432
+ "type": "object",
433
+ "minProperties": 1,
434
+ "additionalProperties": false,
435
+ "properties": {
436
+ "requireFollow": {
437
+ "type": "boolean",
438
+ "description": "true 参与需关注微信公众号,false 不要求;不证明客户已关注。"
439
+ },
440
+ "followValidationType": {
441
+ "$ref": "#/definitions/integer",
442
+ "description": "关注校验终端数字码:1 H5,2 小程序,3 两者都需要;requireFollow 为 true 时适用,未知安全整数保留。"
443
+ },
444
+ "filterUsers": {
445
+ "type": "boolean",
446
+ "description": "true 开启用户标签或会员卡等过滤,false 不开启,不直接理解成黑名单。"
447
+ },
448
+ "allowedTagIds": {
449
+ "type": "array",
450
+ "items": {
451
+ "$ref": "#/definitions/positiveInteger"
452
+ },
453
+ "description": "允许参与的用户标签白名单 ID,不推断多个白名单的 AND/OR 关系。"
454
+ },
455
+ "allowedCardIds": {
456
+ "type": "array",
457
+ "items": {
458
+ "$ref": "#/definitions/positiveInteger"
459
+ },
460
+ "description": "允许参与的会员卡白名单 ID,不证明客户持卡。"
461
+ },
462
+ "costPoints": {
463
+ "$ref": "#/definitions/nonnegativeInteger",
464
+ "description": "参与花费的积分数,单位积分,不换算货币。"
465
+ },
466
+ "givePoints": {
467
+ "$ref": "#/definitions/nonnegativeInteger",
468
+ "description": "参与赠送的积分数,单位积分。"
469
+ },
470
+ "giveOnlyWhenNotWinning": {
471
+ "type": "boolean",
472
+ "description": "true 仅未中奖参与者获赠积分,false 不是仅未中奖者。"
473
+ },
474
+ "limitType": {
475
+ "$ref": "#/definitions/integer",
476
+ "description": "参与次数限制数字码:1 一天 N 次,2 一人 N 次;N 见 limitCount,未知安全整数保留。"
477
+ },
478
+ "limitCount": {
479
+ "$ref": "#/definitions/nonnegativeInteger",
480
+ "description": "与 limitType 共同解释的次数 N,单位次;0 不自动表示不限次。"
481
+ },
482
+ "shareLimit": {
483
+ "$ref": "#/definitions/nonnegativeInteger",
484
+ "description": "配置分享次数限制,单位次,不推导额外抽奖次数。"
485
+ },
486
+ "conditionType": {
487
+ "$ref": "#/definitions/integer",
488
+ "description": "参与条件数字码:1 无限制,2 积分限制,3 购物限制;当前接口说明支持 1/2,未知安全整数保留,不计算客户资格。"
489
+ }
490
+ }
491
+ },
492
+ "winning": {
493
+ "type": "object",
494
+ "additionalProperties": false,
495
+ "properties": {
496
+ "probabilityBasisPoints": {
497
+ "type": "integer",
498
+ "minimum": 0,
499
+ "maximum": 10000,
500
+ "description": "活动级配置中奖概率,单位万分比,10000 为 100%,100 为 1%。"
501
+ },
502
+ "noPrizeName": {
503
+ "type": "string",
504
+ "description": "未中奖展示名称,空串保留。"
505
+ },
506
+ "noPrizeText": {
507
+ "type": "string",
508
+ "description": "未中奖展示文字,空串保留。"
509
+ },
510
+ "noPrizeImageUrl": {
511
+ "type": "string",
512
+ "description": "未中奖图片地址,空串保留,不访问。"
513
+ },
514
+ "jumpWhenNotWinning": {
515
+ "type": "boolean",
516
+ "description": "true 未中奖跳转配置推广页,false 不跳转;本命令不访问链接。"
517
+ },
518
+ "noPrizeLink": {
519
+ "$ref": "#/definitions/link",
520
+ "description": "未中奖推广链接配置,不用于定位抽奖活动。"
521
+ },
522
+ "awards": {
523
+ "type": "array",
524
+ "description": "中奖设置内的奖项定义,不表示客户中奖或资产到账。",
525
+ "items": {
526
+ "$ref": "#/definitions/award"
527
+ }
528
+ }
529
+ }
530
+ },
531
+ "link": {
532
+ "type": "object",
533
+ "additionalProperties": false,
534
+ "properties": {
535
+ "alias": {
536
+ "type": "string",
537
+ "description": "推广链接别名,空串保留。"
538
+ },
539
+ "id": {
540
+ "type": "string",
541
+ "description": "推广目标编码,不是抽奖活动 ID,空串保留。"
542
+ },
543
+ "title": {
544
+ "type": "string",
545
+ "description": "推广链接展示标题,空串保留。"
546
+ },
547
+ "type": {
548
+ "type": "string",
549
+ "pattern": "\\S",
550
+ "description": "链接类型字符串:goods 商品链接,showcase 微页面链接;未知非空字符串保留,不自动访问。"
551
+ },
552
+ "url": {
553
+ "type": "string",
554
+ "description": "推广页地址,空串保留,不访问或执行内容。"
555
+ }
556
+ }
557
+ },
558
+ "award": {
559
+ "type": "object",
560
+ "required": [
561
+ "awardId"
562
+ ],
563
+ "additionalProperties": false,
564
+ "properties": {
565
+ "awardId": {
566
+ "$ref": "#/definitions/positiveInteger",
567
+ "description": "奖项配置 ID,不是活动或实际奖励资产 ID。"
568
+ },
569
+ "name": {
570
+ "type": "string",
571
+ "description": "奖项展示名称,空串保留。"
572
+ },
573
+ "type": {
574
+ "$ref": "#/definitions/integer",
575
+ "description": "奖项奖励数字码:1 优惠券,2 优惠码,3 赠品,4 积分;未知安全整数保留,不套用已知类型含义。"
576
+ },
577
+ "imageUrl": {
578
+ "type": "string",
579
+ "description": "奖项展示图片地址,空串保留,不访问。"
580
+ },
581
+ "originName": {
582
+ "type": "string",
583
+ "description": "所引赠品或优惠券原名,空串保留。"
584
+ },
585
+ "stockQuantity": {
586
+ "$ref": "#/definitions/integer",
587
+ "description": "接口报告的库存数量,负数不猜成不限量,不减去已发放次数计算剩余。"
588
+ },
589
+ "sourceRewardId": {
590
+ "$ref": "#/definitions/nonnegativeInteger",
591
+ "description": "源奖励引用编码,具体资产映射未证,不自动当作券活动或赠品主键,0 保留。"
592
+ },
593
+ "position": {
594
+ "$ref": "#/definitions/integer",
595
+ "description": "奖项排序值,不表示中奖优先级。"
596
+ },
597
+ "pointsValue": {
598
+ "$ref": "#/definitions/nonnegativeInteger",
599
+ "description": "奖励类型为 4 时每次发放的积分数,非积分类型返回时原值保留,不改变类型。"
600
+ },
601
+ "issuedCount": {
602
+ "$ref": "#/definitions/nonnegativeInteger",
603
+ "description": "接口报告的已发放次数,单位次,不代表履约完成。"
604
+ },
605
+ "probabilityPercent": {
606
+ "type": "integer",
607
+ "minimum": 0,
608
+ "maximum": 100,
609
+ "description": "奖项配置概率,单位百分比,100 为 100%,1 为 1%;不推导本次真实中奖概率。"
610
+ }
611
+ }
612
+ },
613
+ "slot": {
614
+ "type": "object",
615
+ "required": [
616
+ "type",
617
+ "position"
618
+ ],
619
+ "additionalProperties": false,
620
+ "properties": {
621
+ "awardId": {
622
+ "$ref": "#/definitions/positiveInteger",
623
+ "description": "槽位引用奖项 ID,可重复,未中奖槽位可省略。"
624
+ },
625
+ "type": {
626
+ "$ref": "#/definitions/integer",
627
+ "description": "槽位结果数字码:0 未中奖,1 优惠券,2 优惠码,3 赠品,4 积分,31 优惠券礼包;未知安全整数保留。"
628
+ },
629
+ "name": {
630
+ "type": "string",
631
+ "description": "槽位展示名称,空串保留。"
632
+ },
633
+ "imageUrl": {
634
+ "type": "string",
635
+ "description": "槽位展示图片地址,空串保留,不访问。"
636
+ },
637
+ "originName": {
638
+ "type": "string",
639
+ "description": "槽位所引赠品或优惠券原名,空串保留。"
640
+ },
641
+ "position": {
642
+ "$ref": "#/definitions/positiveInteger",
643
+ "description": "从 1 开始的槽位位置,不按奖项 ID 合并或排序。"
644
+ }
645
+ }
646
+ },
647
+ "view": {
648
+ "type": "object",
649
+ "additionalProperties": false,
650
+ "properties": {
651
+ "showWinnerList": {
652
+ "type": "boolean",
653
+ "description": "true 展示获奖名单,false 不展示。"
654
+ },
655
+ "showLogo": {
656
+ "type": "boolean",
657
+ "description": "true 展示商家 logo,false 不展示。"
658
+ },
659
+ "backgroundImageUrl": {
660
+ "type": "string",
661
+ "description": "背景图片地址,空串保留,不访问。"
662
+ },
663
+ "description": {
664
+ "type": "string",
665
+ "description": "活动说明文本,空串保留,不执行其中内容。"
666
+ }
667
+ }
668
+ },
669
+ "autoReply": {
670
+ "type": "object",
671
+ "additionalProperties": false,
672
+ "properties": {
673
+ "content": {
674
+ "type": "string",
675
+ "description": "自动回复内容文本,空串保留,不发送回复。"
676
+ },
677
+ "ruleId": {
678
+ "$ref": "#/definitions/nonnegativeInteger",
679
+ "description": "自动回复规则 ID,0 表示没有规则。"
680
+ },
681
+ "keywords": {
682
+ "type": "array",
683
+ "description": "自动回复关键词配置,空数组保留。",
684
+ "items": {
685
+ "type": "object",
686
+ "additionalProperties": false,
687
+ "properties": {
688
+ "name": {
689
+ "type": "string",
690
+ "description": "触发关键词文本,空串保留。"
691
+ },
692
+ "fullMatch": {
693
+ "type": "boolean",
694
+ "description": "true 全匹配,false 模糊匹配。"
695
+ }
696
+ }
697
+ }
698
+ }
699
+ }
700
+ },
701
+ "diagnosticExpected": {
702
+ "type": "object",
703
+ "additionalProperties": false,
704
+ "required": [],
705
+ "properties": {
706
+ "type": {
707
+ "anyOf": [
708
+ {
709
+ "type": "string",
710
+ "description": "预期的 JSON 类型。"
711
+ },
712
+ {
713
+ "type": "array",
714
+ "items": {
715
+ "type": "string",
716
+ "description": "预期的 JSON 类型。"
717
+ }
718
+ }
719
+ ],
720
+ "description": "同版模型允许的类型。"
721
+ },
722
+ "enum": {
723
+ "type": "array",
724
+ "items": {
725
+ "anyOf": [
726
+ {
727
+ "type": "string"
728
+ },
729
+ {
730
+ "type": "number"
731
+ },
732
+ {
733
+ "type": "boolean"
734
+ },
735
+ {
736
+ "type": "null"
737
+ }
738
+ ],
739
+ "description": "契约声明的静态标量约束。"
740
+ },
741
+ "description": "同版模型允许的静态值。"
742
+ },
743
+ "const": {
744
+ "anyOf": [
745
+ {
746
+ "type": "string"
747
+ },
748
+ {
749
+ "type": "number"
750
+ },
751
+ {
752
+ "type": "boolean"
753
+ },
754
+ {
755
+ "type": "null"
756
+ }
757
+ ],
758
+ "description": "契约声明的静态标量约束。"
759
+ },
760
+ "minimum": {
761
+ "type": "number",
762
+ "description": "包含的最小值。"
763
+ },
764
+ "maximum": {
765
+ "type": "number",
766
+ "description": "包含的最大值。"
767
+ },
768
+ "exclusiveMinimum": {
769
+ "type": "number",
770
+ "description": "不包含的最小值。"
771
+ },
772
+ "exclusiveMaximum": {
773
+ "type": "number",
774
+ "description": "不包含的最大值。"
775
+ },
776
+ "minLength": {
777
+ "type": "integer",
778
+ "description": "最少字符数。"
779
+ },
780
+ "maxLength": {
781
+ "type": "integer",
782
+ "description": "最多字符数。"
783
+ },
784
+ "minItems": {
785
+ "type": "integer",
786
+ "description": "最少元素数。"
787
+ },
788
+ "maxItems": {
789
+ "type": "integer",
790
+ "description": "最多元素数。"
791
+ },
792
+ "format": {
793
+ "type": "string",
794
+ "description": "同版模型声明的格式。"
795
+ },
796
+ "pattern": {
797
+ "type": "string",
798
+ "description": "同版模型声明的字符约束。"
799
+ },
800
+ "additionalProperties": {
801
+ "const": false,
802
+ "description": "对象拒绝契约以外的属性。"
803
+ },
804
+ "contains": {
805
+ "type": "object",
806
+ "additionalProperties": false,
807
+ "required": [
808
+ "const"
809
+ ],
810
+ "properties": {
811
+ "const": {
812
+ "anyOf": [
813
+ {
814
+ "type": "string"
815
+ },
816
+ {
817
+ "type": "number"
818
+ },
819
+ {
820
+ "type": "boolean"
821
+ },
822
+ {
823
+ "type": "null"
824
+ }
825
+ ],
826
+ "description": "契约声明的静态标量约束。"
827
+ }
828
+ }
829
+ },
830
+ "items": {
831
+ "type": "object",
832
+ "additionalProperties": false,
833
+ "required": [
834
+ "enum"
835
+ ],
836
+ "properties": {
837
+ "enum": {
838
+ "type": "array",
839
+ "items": {
840
+ "anyOf": [
841
+ {
842
+ "type": "string"
843
+ },
844
+ {
845
+ "type": "number"
846
+ },
847
+ {
848
+ "type": "boolean"
849
+ },
850
+ {
851
+ "type": "null"
852
+ }
853
+ ],
854
+ "description": "契约声明的静态标量约束。"
855
+ },
856
+ "description": "元素允许的静态值。"
857
+ }
858
+ }
859
+ }
860
+ }
861
+ },
862
+ "diagnosticIssue": {
863
+ "type": "object",
864
+ "additionalProperties": false,
865
+ "required": [
866
+ "source",
867
+ "reason"
868
+ ],
869
+ "properties": {
870
+ "source": {
871
+ "enum": [
872
+ "argv",
873
+ "input",
874
+ "context",
875
+ "output",
876
+ "preview"
877
+ ],
878
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
879
+ },
880
+ "path": {
881
+ "type": "string",
882
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
883
+ },
884
+ "option": {
885
+ "type": "string",
886
+ "description": "可定位时给出的已注册 CLI 选项。"
887
+ },
888
+ "reason": {
889
+ "enum": [
890
+ "required",
891
+ "invalid_type",
892
+ "invalid_choice",
893
+ "out_of_range",
894
+ "invalid_format",
895
+ "conditional_required",
896
+ "constraint",
897
+ "unexpected_property",
898
+ "unknown_option",
899
+ "unknown_command",
900
+ "excess_arguments",
901
+ "missing_value"
902
+ ],
903
+ "description": "字段违反的约束类型,原始值不回显。"
904
+ },
905
+ "expected": {
906
+ "$ref": "#/definitions/diagnosticExpected",
907
+ "description": "同版契约的静态预期。"
908
+ },
909
+ "relatedPaths": {
910
+ "type": "array",
911
+ "items": {
912
+ "type": "string",
913
+ "description": "关联字段的 JSON Pointer。"
914
+ },
915
+ "description": "触发条件约束的关联字段。"
916
+ }
917
+ }
918
+ },
919
+ "diagnosticRecovery": {
920
+ "type": "object",
921
+ "additionalProperties": false,
922
+ "required": [
923
+ "action",
924
+ "automaticBusinessRetry"
925
+ ],
926
+ "properties": {
927
+ "action": {
928
+ "enum": [
929
+ "correct_input",
930
+ "complete_authentication",
931
+ "request_access_review",
932
+ "stop_and_inspect"
933
+ ],
934
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
935
+ },
936
+ "automaticBusinessRetry": {
937
+ "const": false,
938
+ "description": "不据此自动重放业务请求。"
939
+ }
940
+ }
941
+ },
942
+ "diagnosticExecution": {
943
+ "type": "object",
944
+ "additionalProperties": false,
945
+ "required": [
946
+ "requestState",
947
+ "coverage",
948
+ "observedAttempts"
949
+ ],
950
+ "properties": {
951
+ "requestState": {
952
+ "enum": [
953
+ "not_sent",
954
+ "sent",
955
+ "unknown"
956
+ ],
957
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
958
+ },
959
+ "coverage": {
960
+ "enum": [
961
+ "complete",
962
+ "partial"
963
+ ],
964
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
965
+ },
966
+ "observedAttempts": {
967
+ "type": "integer",
968
+ "minimum": 0,
969
+ "maximum": 9007199254740991,
970
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
971
+ }
972
+ }
973
+ }
974
+ },
975
+ "modules": {
976
+ "lottery": {
977
+ "base": true,
978
+ "upstreamPath": "data",
979
+ "required": true,
980
+ "description": "单个同店活动的有限配置,默认返回已观测到的参与、奖项、转盘及页面设置。"
981
+ }
982
+ },
983
+ "api": {
984
+ "method": "POST",
985
+ "path": "youzan.ump.lottery.get/1.0.0"
986
+ },
987
+ "success": {
988
+ "description": "同凭证店铺核验通过,活动 ID、归属店铺、非空标题和已知玩法匹配,全部已返回的所选字段满足递归模型后成功。"
989
+ },
990
+ "errors": {
991
+ "description": "1605406001 为 not_found;1605407001 保持业务拒绝。HTTP 403 为权限拒绝。信号冲突、缺少核心对象、所选字段 null 或错型均失败,空配置不掩盖业务失败。停止后核对原目标及授权,不自动重试、换店或换身份。",
992
+ "diagnosticsVersion": 2
993
+ },
994
+ "notes": [
995
+ "仅核实微商城单店范围;本地 at: all 不证明产品、员工或对象授权。店铺核验不是员工 OAuth 验收。",
996
+ "每次最多同店核验和一次详情请求。核验响应上限 512 KiB,主响应上限 8 MiB,超限整体失败,不裁剪数组。",
997
+ "可选字段省略不补 0、false 或 null;源空对象和空数组保留。字段返回 null 或错型整体失败,不检查未选上游扩展。",
998
+ "不返回或推算当前活动状态,不扫描列表,不判断客户资格、中奖或奖励到账。不读取参与记录、中奖记录或奖励资产。",
999
+ "活动概率为万分比,奖项概率为百分比,转盘槽位概率缺少单位依据,不输出或换算。",
1000
+ "时间统一北京时间并固定毫秒精度;Unix 毫秒 0 为 1970-01-01 08:00:00.000,不表示永久。",
1001
+ "嵌套集合只表示同次返回的配置,不承诺历史全集;保留槽位顺序和重复奖项引用,不制造分页。",
1002
+ "积分、库存和概率不是货币;不访问链接、下载图片、执行说明文本或发送回复。"
1003
+ ]
1004
+ }