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