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

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