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