@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,695 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "required": [
6
+ "kdtId",
7
+ "yzOpenId",
8
+ "createdAt",
9
+ "pageNo",
10
+ "pageSize"
11
+ ],
12
+ "additionalProperties": false,
13
+ "properties": {
14
+ "kdtId": {
15
+ "$ref": "#/definitions/shopId"
16
+ },
17
+ "yzOpenId": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f](?:[^\\u0000-\\u001f\\u007f-\\u009f]*[^\\s\\u0000-\\u001f\\u007f-\\u009f])?$",
21
+ "description": "trim 后的客户 yzOpenId,不是手机号、微信 openId 或员工 ID。"
22
+ },
23
+ "createdAt": {
24
+ "type": "object",
25
+ "required": [
26
+ "start",
27
+ "end"
28
+ ],
29
+ "additionalProperties": false,
30
+ "properties": {
31
+ "start": {
32
+ "$ref": "#/definitions/beijingSecond"
33
+ },
34
+ "end": {
35
+ "$ref": "#/definitions/beijingSecond"
36
+ }
37
+ },
38
+ "description": "显式两端的北京时间秒精度窗口,允许相等;起点不早于本次固定 now 前 360×24 小时,跨度不超过 90×24 小时,终点不晚于 now。"
39
+ },
40
+ "pageNo": {
41
+ "$ref": "#/definitions/pageNo"
42
+ },
43
+ "pageSize": {
44
+ "$ref": "#/definitions/pageSize"
45
+ }
46
+ },
47
+ "description": "CLI 解析参数并完成必要上下文补全后的业务输入,不是直接传入 CLI 的 JSON。"
48
+ },
49
+ "output": {
50
+ "type": "object",
51
+ "required": [
52
+ "data"
53
+ ],
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "data": {
57
+ "type": "object",
58
+ "required": [
59
+ "logs",
60
+ "pagination"
61
+ ],
62
+ "additionalProperties": false,
63
+ "properties": {
64
+ "logs": {
65
+ "type": "array",
66
+ "maxItems": 50,
67
+ "description": "当前请求页的成长值变更记录,保留源顺序和重复,不补造流水 ID 或余额。",
68
+ "items": {
69
+ "type": "object",
70
+ "required": [
71
+ "amount",
72
+ "eventType",
73
+ "createdAt"
74
+ ],
75
+ "additionalProperties": false,
76
+ "properties": {
77
+ "amount": {
78
+ "$ref": "#/definitions/safeInteger",
79
+ "description": "有符号成长值变动原值,不解释增减方向。"
80
+ },
81
+ "eventType": {
82
+ "type": "integer",
83
+ "minimum": -2147483648,
84
+ "maximum": 2147483647,
85
+ "description": "源事件码,未知合法整数原样保留;事件不证明客户实际等级变化。已知整数值:401=生日特权发放成长值;460=等级降级扣减成长值;800=交易发放成长值;801=管理员操作成长值发放;802=退款扣减成长值;803=领卡发放成长值;804=储值发放成长值;805=退卡扣减成长值;806=权益数据迁移发放成长值;808=会员卡续期发放成长值;810=客户导入发放成长值;811=微商城新会员等级初始化;812=交易金额成长值规则发放成长值;813=交易购次成长值规则发放成长值;814=交易退款扣减成长值;815=节日发放成长值;816=纪念日发放成长值;817=系统修正数据;818=开放平台操作加成长值;819=开放平台操作减成长值;820=完善信息发放成长值;821=绑定手机号;822=每日签到;823=任务中心完成任务;824=权益系统发放成长值;999=设置等级给成长值。"
86
+ },
87
+ "createdAt": {
88
+ "type": "string",
89
+ "format": "beijing-date-time-ms",
90
+ "$comment": "upstream-time:seconds",
91
+ "description": "源 Unix 秒转换后的北京时间,固定三位毫秒。"
92
+ },
93
+ "description": {
94
+ "type": "string",
95
+ "description": "源记录描述,缺省时省略,空串保留。"
96
+ },
97
+ "bizValue": {
98
+ "type": "string",
99
+ "description": "源成长值业务键,缺省时省略,空串保留;不保证唯一,不作为流水 ID 或订单号。"
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "pagination": {
105
+ "type": "object",
106
+ "required": [
107
+ "pageNo",
108
+ "pageSize",
109
+ "hasMore"
110
+ ],
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "pageNo": {
114
+ "$ref": "#/definitions/pageNo",
115
+ "description": "上游页码,必须等于请求页码。"
116
+ },
117
+ "pageSize": {
118
+ "$ref": "#/definitions/pageSize",
119
+ "description": "上游容量,必须等于请求容量。"
120
+ },
121
+ "total": {
122
+ "type": "integer",
123
+ "minimum": 0,
124
+ "maximum": 2147483647,
125
+ "description": "匹配本次查询条件的总记录数,不是当前页返回条数;上游未提供可确认总数时省略。"
126
+ },
127
+ "hasMore": {
128
+ "type": ["boolean", "null"],
129
+ "description": "true 表示还有后续页,false 表示已确认没有后续页;无法确定时为 null,不以空页或短页推算。"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ },
137
+ "preview": {
138
+ "type": "object",
139
+ "required": [
140
+ "scope",
141
+ "requests"
142
+ ],
143
+ "additionalProperties": false,
144
+ "properties": {
145
+ "scope": {
146
+ "type": "object",
147
+ "required": [
148
+ "kdtId"
149
+ ],
150
+ "additionalProperties": false,
151
+ "properties": {
152
+ "kdtId": {
153
+ "$ref": "#/definitions/shopId"
154
+ }
155
+ }
156
+ },
157
+ "requests": {
158
+ "type": "array",
159
+ "minItems": 2,
160
+ "maxItems": 2,
161
+ "description": "按顺序先核验店铺再查询成长流水。第二项 body.params 为 JSON 字符串,内容是固定账号类型 5、客户标识、分页和秒精度时间文本。",
162
+ "items": {
163
+ "type": "object",
164
+ "required": [
165
+ "method",
166
+ "path",
167
+ "body"
168
+ ],
169
+ "additionalProperties": false,
170
+ "properties": {
171
+ "method": {
172
+ "const": "POST"
173
+ },
174
+ "path": {
175
+ "enum": [
176
+ "youzan.shop.basic.get/3.0.0",
177
+ "youzan.crm.growth.search.userlog/1.0.0"
178
+ ]
179
+ },
180
+ "body": {
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "properties": {
184
+ "params": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ }
188
+ }
189
+ }
190
+ },
191
+ "allOf": [
192
+ {
193
+ "if": {
194
+ "properties": {
195
+ "path": {
196
+ "const": "youzan.shop.basic.get/3.0.0"
197
+ }
198
+ }
199
+ },
200
+ "then": {
201
+ "properties": {
202
+ "body": {
203
+ "type": "object",
204
+ "maxProperties": 0
205
+ }
206
+ }
207
+ },
208
+ "else": {
209
+ "properties": {
210
+ "body": {
211
+ "type": "object",
212
+ "required": [
213
+ "params"
214
+ ],
215
+ "properties": {
216
+ "params": {
217
+ "type": "string"
218
+ }
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
224
+ ]
225
+ }
226
+ }
227
+ }
228
+ },
229
+ "error": {
230
+ "type": "object",
231
+ "required": [
232
+ "success",
233
+ "code",
234
+ "message",
235
+ "details"
236
+ ],
237
+ "additionalProperties": false,
238
+ "properties": {
239
+ "success": {
240
+ "const": false
241
+ },
242
+ "code": {
243
+ "const": -10001
244
+ },
245
+ "message": {
246
+ "type": "string",
247
+ "minLength": 1
248
+ },
249
+ "details": {
250
+ "type": "object",
251
+ "required": [
252
+ "command",
253
+ "category",
254
+ "stage",
255
+ "targetScope",
256
+ "requestState",
257
+ "nextStep",
258
+ "errorVersion",
259
+ "recovery",
260
+ "execution"
261
+ ],
262
+ "additionalProperties": false,
263
+ "properties": {
264
+ "command": {
265
+ "const": "member.growth-log.list"
266
+ },
267
+ "category": {
268
+ "enum": [
269
+ "validation",
270
+ "parameter",
271
+ "configuration",
272
+ "authentication",
273
+ "permission",
274
+ "scope_unresolved",
275
+ "http",
276
+ "business_rejected",
277
+ "transport",
278
+ "protocol",
279
+ "limit"
280
+ ]
281
+ },
282
+ "stage": {
283
+ "enum": [
284
+ "input",
285
+ "context",
286
+ "configuration",
287
+ "shop-binding",
288
+ "logs",
289
+ "logs-model",
290
+ "pagination",
291
+ "output"
292
+ ]
293
+ },
294
+ "targetScope": {
295
+ "type": "object",
296
+ "additionalProperties": false,
297
+ "properties": {
298
+ "kdtId": {
299
+ "$ref": "#/definitions/shopId"
300
+ }
301
+ }
302
+ },
303
+ "requestState": {
304
+ "enum": [
305
+ "not_sent",
306
+ "sent",
307
+ "unknown"
308
+ ]
309
+ },
310
+ "nextStep": {
311
+ "type": "string",
312
+ "minLength": 1
313
+ },
314
+ "api": {
315
+ "type": "string",
316
+ "minLength": 1
317
+ },
318
+ "httpStatus": {
319
+ "type": "integer",
320
+ "minimum": 100,
321
+ "maximum": 599
322
+ },
323
+ "businessCode": {
324
+ "$ref": "#/definitions/diagnosticCode"
325
+ },
326
+ "gatewayCode": {
327
+ "$ref": "#/definitions/diagnosticCode"
328
+ },
329
+ "trace_id": {
330
+ "$ref": "#/definitions/trace"
331
+ },
332
+ "request_id": {
333
+ "$ref": "#/definitions/trace"
334
+ },
335
+ "errorVersion": {
336
+ "const": 2,
337
+ "description": "本命令采用错误诊断协议第二版。"
338
+ },
339
+ "issues": {
340
+ "type": "array",
341
+ "minItems": 1,
342
+ "maxItems": 16,
343
+ "items": {
344
+ "$ref": "#/definitions/diagnosticIssue"
345
+ },
346
+ "description": "最多十六个已定位问题,不包含收到的原值。"
347
+ },
348
+ "issuesTruncated": {
349
+ "const": true,
350
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
351
+ },
352
+ "recovery": {
353
+ "$ref": "#/definitions/diagnosticRecovery",
354
+ "description": "受限的恢复说明,不会自动执行。"
355
+ },
356
+ "execution": {
357
+ "$ref": "#/definitions/diagnosticExecution",
358
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
359
+ }
360
+ }
361
+ }
362
+ }
363
+ },
364
+ "definitions": {
365
+ "shopId": {
366
+ "type": "integer",
367
+ "minimum": 1,
368
+ "maximum": 9007199254740991
369
+ },
370
+ "safeInteger": {
371
+ "type": "integer",
372
+ "minimum": -9007199254740991,
373
+ "maximum": 9007199254740991
374
+ },
375
+ "pageNo": {
376
+ "type": "integer",
377
+ "minimum": 1,
378
+ "maximum": 2147483647
379
+ },
380
+ "pageSize": {
381
+ "type": "integer",
382
+ "minimum": 1,
383
+ "maximum": 50
384
+ },
385
+ "diagnosticCode": {
386
+ "anyOf": [
387
+ {
388
+ "$ref": "#/definitions/safeInteger"
389
+ },
390
+ {
391
+ "type": "string",
392
+ "pattern": "^-?\\d{1,12}$"
393
+ }
394
+ ]
395
+ },
396
+ "trace": {
397
+ "type": "string",
398
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
399
+ },
400
+ "beijingSecond": {
401
+ "type": "string",
402
+ "format": "beijing-date-time-ms",
403
+ "pattern": "\\.000$"
404
+ },
405
+ "diagnosticExpected": {
406
+ "type": "object",
407
+ "additionalProperties": false,
408
+ "required": [],
409
+ "properties": {
410
+ "type": {
411
+ "anyOf": [
412
+ {
413
+ "type": "string",
414
+ "description": "预期的 JSON 类型。"
415
+ },
416
+ {
417
+ "type": "array",
418
+ "items": {
419
+ "type": "string",
420
+ "description": "预期的 JSON 类型。"
421
+ }
422
+ }
423
+ ],
424
+ "description": "同版模型允许的类型。"
425
+ },
426
+ "enum": {
427
+ "type": "array",
428
+ "items": {
429
+ "anyOf": [
430
+ {
431
+ "type": "string"
432
+ },
433
+ {
434
+ "type": "number"
435
+ },
436
+ {
437
+ "type": "boolean"
438
+ },
439
+ {
440
+ "type": "null"
441
+ }
442
+ ],
443
+ "description": "契约声明的静态标量约束。"
444
+ },
445
+ "description": "同版模型允许的静态值。"
446
+ },
447
+ "const": {
448
+ "anyOf": [
449
+ {
450
+ "type": "string"
451
+ },
452
+ {
453
+ "type": "number"
454
+ },
455
+ {
456
+ "type": "boolean"
457
+ },
458
+ {
459
+ "type": "null"
460
+ }
461
+ ],
462
+ "description": "契约声明的静态标量约束。"
463
+ },
464
+ "minimum": {
465
+ "type": "number",
466
+ "description": "包含的最小值。"
467
+ },
468
+ "maximum": {
469
+ "type": "number",
470
+ "description": "包含的最大值。"
471
+ },
472
+ "exclusiveMinimum": {
473
+ "type": "number",
474
+ "description": "不包含的最小值。"
475
+ },
476
+ "exclusiveMaximum": {
477
+ "type": "number",
478
+ "description": "不包含的最大值。"
479
+ },
480
+ "minLength": {
481
+ "type": "integer",
482
+ "description": "最少字符数。"
483
+ },
484
+ "maxLength": {
485
+ "type": "integer",
486
+ "description": "最多字符数。"
487
+ },
488
+ "minItems": {
489
+ "type": "integer",
490
+ "description": "最少元素数。"
491
+ },
492
+ "maxItems": {
493
+ "type": "integer",
494
+ "description": "最多元素数。"
495
+ },
496
+ "format": {
497
+ "type": "string",
498
+ "description": "同版模型声明的格式。"
499
+ },
500
+ "pattern": {
501
+ "type": "string",
502
+ "description": "同版模型声明的字符约束。"
503
+ },
504
+ "additionalProperties": {
505
+ "const": false,
506
+ "description": "对象拒绝契约以外的属性。"
507
+ },
508
+ "contains": {
509
+ "type": "object",
510
+ "additionalProperties": false,
511
+ "required": [
512
+ "const"
513
+ ],
514
+ "properties": {
515
+ "const": {
516
+ "anyOf": [
517
+ {
518
+ "type": "string"
519
+ },
520
+ {
521
+ "type": "number"
522
+ },
523
+ {
524
+ "type": "boolean"
525
+ },
526
+ {
527
+ "type": "null"
528
+ }
529
+ ],
530
+ "description": "契约声明的静态标量约束。"
531
+ }
532
+ }
533
+ },
534
+ "items": {
535
+ "type": "object",
536
+ "additionalProperties": false,
537
+ "required": [
538
+ "enum"
539
+ ],
540
+ "properties": {
541
+ "enum": {
542
+ "type": "array",
543
+ "items": {
544
+ "anyOf": [
545
+ {
546
+ "type": "string"
547
+ },
548
+ {
549
+ "type": "number"
550
+ },
551
+ {
552
+ "type": "boolean"
553
+ },
554
+ {
555
+ "type": "null"
556
+ }
557
+ ],
558
+ "description": "契约声明的静态标量约束。"
559
+ },
560
+ "description": "元素允许的静态值。"
561
+ }
562
+ }
563
+ }
564
+ }
565
+ },
566
+ "diagnosticIssue": {
567
+ "type": "object",
568
+ "additionalProperties": false,
569
+ "required": [
570
+ "source",
571
+ "reason"
572
+ ],
573
+ "properties": {
574
+ "source": {
575
+ "enum": [
576
+ "argv",
577
+ "input",
578
+ "context",
579
+ "output",
580
+ "preview"
581
+ ],
582
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
583
+ },
584
+ "path": {
585
+ "type": "string",
586
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
587
+ },
588
+ "option": {
589
+ "type": "string",
590
+ "description": "可定位时给出的已注册 CLI 选项。"
591
+ },
592
+ "reason": {
593
+ "enum": [
594
+ "required",
595
+ "invalid_type",
596
+ "invalid_choice",
597
+ "out_of_range",
598
+ "invalid_format",
599
+ "conditional_required",
600
+ "constraint",
601
+ "unexpected_property",
602
+ "unknown_option",
603
+ "unknown_command",
604
+ "excess_arguments",
605
+ "missing_value"
606
+ ],
607
+ "description": "字段违反的约束类型,原始值不回显。"
608
+ },
609
+ "expected": {
610
+ "$ref": "#/definitions/diagnosticExpected",
611
+ "description": "同版契约的静态预期。"
612
+ },
613
+ "relatedPaths": {
614
+ "type": "array",
615
+ "items": {
616
+ "type": "string",
617
+ "description": "关联字段的 JSON Pointer。"
618
+ },
619
+ "description": "触发条件约束的关联字段。"
620
+ }
621
+ }
622
+ },
623
+ "diagnosticRecovery": {
624
+ "type": "object",
625
+ "additionalProperties": false,
626
+ "required": [
627
+ "action",
628
+ "automaticBusinessRetry"
629
+ ],
630
+ "properties": {
631
+ "action": {
632
+ "enum": [
633
+ "correct_input",
634
+ "complete_authentication",
635
+ "request_access_review",
636
+ "stop_and_inspect"
637
+ ],
638
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
639
+ },
640
+ "automaticBusinessRetry": {
641
+ "const": false,
642
+ "description": "不据此自动重放业务请求。"
643
+ }
644
+ }
645
+ },
646
+ "diagnosticExecution": {
647
+ "type": "object",
648
+ "additionalProperties": false,
649
+ "required": [
650
+ "requestState",
651
+ "coverage",
652
+ "observedAttempts"
653
+ ],
654
+ "properties": {
655
+ "requestState": {
656
+ "enum": [
657
+ "not_sent",
658
+ "sent",
659
+ "unknown"
660
+ ],
661
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
662
+ },
663
+ "coverage": {
664
+ "enum": [
665
+ "complete",
666
+ "partial"
667
+ ],
668
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
669
+ },
670
+ "observedAttempts": {
671
+ "type": "integer",
672
+ "minimum": 0,
673
+ "maximum": 9007199254740991,
674
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
675
+ }
676
+ }
677
+ }
678
+ },
679
+ "api": {
680
+ "method": "POST",
681
+ "path": "youzan.crm.growth.search.userlog/1.0.0"
682
+ },
683
+ "success": {
684
+ "description": "同店核验、主请求严格成功、记录和分页模型均通过后返回有限视图。"
685
+ },
686
+ "errors": {
687
+ "description": "失败 stdout 为空,stderr 为脱敏错误 JSON,退出码非零;不返回半页、不自动重试或翻页。",
688
+ "diagnosticsVersion": 2
689
+ },
690
+ "notes": [
691
+ "created_at 按已核验的 Unix 秒解释,并转换为北京时间三位毫秒;不能按位数切换毫秒解释。",
692
+ "主请求 params 是 JSON 字符串,固定 user.account_type=5;不发送未声明的 kdt_id。",
693
+ "--dry-run 完成本地校验后零网络、零凭证读取,只展示两次请求计划。"
694
+ ]
695
+ }