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