shop-cli 0.1.0

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 (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +392 -0
  3. package/bin/shop-cli.js +17 -0
  4. package/bin/shop.js +16 -0
  5. package/dist/adminClient.d.ts +34 -0
  6. package/dist/adminClient.js +144 -0
  7. package/dist/cli/client.d.ts +10 -0
  8. package/dist/cli/client.js +56 -0
  9. package/dist/cli/command.d.ts +5 -0
  10. package/dist/cli/command.js +62 -0
  11. package/dist/cli/errors.d.ts +4 -0
  12. package/dist/cli/errors.js +35 -0
  13. package/dist/cli/gid.d.ts +3 -0
  14. package/dist/cli/gid.js +42 -0
  15. package/dist/cli/globalFlags.d.ts +15 -0
  16. package/dist/cli/globalFlags.js +100 -0
  17. package/dist/cli/headers.d.ts +2 -0
  18. package/dist/cli/headers.js +79 -0
  19. package/dist/cli/help/format.d.ts +8 -0
  20. package/dist/cli/help/format.js +78 -0
  21. package/dist/cli/help/registry.d.ts +5 -0
  22. package/dist/cli/help/registry.js +5651 -0
  23. package/dist/cli/help/render.d.ts +7 -0
  24. package/dist/cli/help/render.js +352 -0
  25. package/dist/cli/help/spec.d.ts +39 -0
  26. package/dist/cli/help/spec.js +17 -0
  27. package/dist/cli/input.d.ts +9 -0
  28. package/dist/cli/input.js +104 -0
  29. package/dist/cli/introspection/deprecations.d.ts +1 -0
  30. package/dist/cli/introspection/deprecations.js +83 -0
  31. package/dist/cli/introspection/format.d.ts +6 -0
  32. package/dist/cli/introspection/format.js +63 -0
  33. package/dist/cli/introspection/index.d.ts +14 -0
  34. package/dist/cli/introspection/index.js +89 -0
  35. package/dist/cli/introspection/resources.d.ts +1 -0
  36. package/dist/cli/introspection/resources.js +127 -0
  37. package/dist/cli/output/computedFields.d.ts +39 -0
  38. package/dist/cli/output/computedFields.js +104 -0
  39. package/dist/cli/output.d.ts +37 -0
  40. package/dist/cli/output.js +332 -0
  41. package/dist/cli/router.d.ts +29 -0
  42. package/dist/cli/router.js +480 -0
  43. package/dist/cli/selection/buildAllSelection.d.ts +13 -0
  44. package/dist/cli/selection/buildAllSelection.js +108 -0
  45. package/dist/cli/selection/graphqlSelection.d.ts +5 -0
  46. package/dist/cli/selection/graphqlSelection.js +301 -0
  47. package/dist/cli/selection/select.d.ts +13 -0
  48. package/dist/cli/selection/select.js +136 -0
  49. package/dist/cli/selection/stripDeprecated.d.ts +2 -0
  50. package/dist/cli/selection/stripDeprecated.js +63 -0
  51. package/dist/cli/userErrors.d.ts +4 -0
  52. package/dist/cli/userErrors.js +41 -0
  53. package/dist/cli/verbs/_shared.d.ts +38 -0
  54. package/dist/cli/verbs/_shared.js +180 -0
  55. package/dist/cli/verbs/abandoned-checkouts.d.ts +6 -0
  56. package/dist/cli/verbs/abandoned-checkouts.js +259 -0
  57. package/dist/cli/verbs/app-billing.d.ts +6 -0
  58. package/dist/cli/verbs/app-billing.js +452 -0
  59. package/dist/cli/verbs/apps.d.ts +6 -0
  60. package/dist/cli/verbs/apps.js +296 -0
  61. package/dist/cli/verbs/articles.d.ts +6 -0
  62. package/dist/cli/verbs/articles.js +251 -0
  63. package/dist/cli/verbs/backup.d.ts +6 -0
  64. package/dist/cli/verbs/backup.js +94 -0
  65. package/dist/cli/verbs/blogs.d.ts +6 -0
  66. package/dist/cli/verbs/blogs.js +273 -0
  67. package/dist/cli/verbs/bulk-operations.d.ts +6 -0
  68. package/dist/cli/verbs/bulk-operations.js +272 -0
  69. package/dist/cli/verbs/business-entities.d.ts +6 -0
  70. package/dist/cli/verbs/business-entities.js +102 -0
  71. package/dist/cli/verbs/carrier-services.d.ts +6 -0
  72. package/dist/cli/verbs/carrier-services.js +195 -0
  73. package/dist/cli/verbs/cart-transforms.d.ts +6 -0
  74. package/dist/cli/verbs/cart-transforms.js +141 -0
  75. package/dist/cli/verbs/cash-tracking.d.ts +6 -0
  76. package/dist/cli/verbs/cash-tracking.js +118 -0
  77. package/dist/cli/verbs/catalogs.d.ts +6 -0
  78. package/dist/cli/verbs/catalogs.js +267 -0
  79. package/dist/cli/verbs/channels.d.ts +6 -0
  80. package/dist/cli/verbs/channels.js +120 -0
  81. package/dist/cli/verbs/checkout-branding.d.ts +6 -0
  82. package/dist/cli/verbs/checkout-branding.js +144 -0
  83. package/dist/cli/verbs/checkout-profiles.d.ts +6 -0
  84. package/dist/cli/verbs/checkout-profiles.js +124 -0
  85. package/dist/cli/verbs/collections.d.ts +6 -0
  86. package/dist/cli/verbs/collections.js +485 -0
  87. package/dist/cli/verbs/comments.d.ts +6 -0
  88. package/dist/cli/verbs/comments.js +160 -0
  89. package/dist/cli/verbs/companies.d.ts +6 -0
  90. package/dist/cli/verbs/companies.js +313 -0
  91. package/dist/cli/verbs/company-contacts.d.ts +6 -0
  92. package/dist/cli/verbs/company-contacts.js +314 -0
  93. package/dist/cli/verbs/company-locations.d.ts +6 -0
  94. package/dist/cli/verbs/company-locations.js +467 -0
  95. package/dist/cli/verbs/customer-account-pages.d.ts +6 -0
  96. package/dist/cli/verbs/customer-account-pages.js +97 -0
  97. package/dist/cli/verbs/customer-payment-methods.d.ts +6 -0
  98. package/dist/cli/verbs/customer-payment-methods.js +358 -0
  99. package/dist/cli/verbs/customer-privacy.d.ts +6 -0
  100. package/dist/cli/verbs/customer-privacy.js +167 -0
  101. package/dist/cli/verbs/customer-segments.d.ts +6 -0
  102. package/dist/cli/verbs/customer-segments.js +193 -0
  103. package/dist/cli/verbs/customers.d.ts +6 -0
  104. package/dist/cli/verbs/customers.js +656 -0
  105. package/dist/cli/verbs/delegate-tokens.d.ts +6 -0
  106. package/dist/cli/verbs/delegate-tokens.js +95 -0
  107. package/dist/cli/verbs/delivery-customizations.d.ts +6 -0
  108. package/dist/cli/verbs/delivery-customizations.js +205 -0
  109. package/dist/cli/verbs/delivery-profile-locations.d.ts +6 -0
  110. package/dist/cli/verbs/delivery-profile-locations.js +90 -0
  111. package/dist/cli/verbs/delivery-profiles.d.ts +6 -0
  112. package/dist/cli/verbs/delivery-profiles.js +207 -0
  113. package/dist/cli/verbs/delivery-promises.d.ts +6 -0
  114. package/dist/cli/verbs/delivery-promises.js +262 -0
  115. package/dist/cli/verbs/delivery-settings.d.ts +6 -0
  116. package/dist/cli/verbs/delivery-settings.js +85 -0
  117. package/dist/cli/verbs/discount-nodes.d.ts +6 -0
  118. package/dist/cli/verbs/discount-nodes.js +169 -0
  119. package/dist/cli/verbs/discount-redeem-codes.d.ts +6 -0
  120. package/dist/cli/verbs/discount-redeem-codes.js +102 -0
  121. package/dist/cli/verbs/discount-saved-searches.d.ts +6 -0
  122. package/dist/cli/verbs/discount-saved-searches.js +113 -0
  123. package/dist/cli/verbs/discounts-automatic.d.ts +6 -0
  124. package/dist/cli/verbs/discounts-automatic.js +475 -0
  125. package/dist/cli/verbs/discounts-code.d.ts +6 -0
  126. package/dist/cli/verbs/discounts-code.js +523 -0
  127. package/dist/cli/verbs/disputes.d.ts +6 -0
  128. package/dist/cli/verbs/disputes.js +154 -0
  129. package/dist/cli/verbs/draft-orders.d.ts +6 -0
  130. package/dist/cli/verbs/draft-orders.js +429 -0
  131. package/dist/cli/verbs/events.d.ts +6 -0
  132. package/dist/cli/verbs/events.js +182 -0
  133. package/dist/cli/verbs/file-saved-searches.d.ts +6 -0
  134. package/dist/cli/verbs/file-saved-searches.js +83 -0
  135. package/dist/cli/verbs/files.d.ts +6 -0
  136. package/dist/cli/verbs/files.js +213 -0
  137. package/dist/cli/verbs/finance.d.ts +6 -0
  138. package/dist/cli/verbs/finance.js +115 -0
  139. package/dist/cli/verbs/flow.d.ts +6 -0
  140. package/dist/cli/verbs/flow.js +94 -0
  141. package/dist/cli/verbs/fulfillment-constraint-rules.d.ts +6 -0
  142. package/dist/cli/verbs/fulfillment-constraint-rules.js +139 -0
  143. package/dist/cli/verbs/fulfillment-orders.d.ts +6 -0
  144. package/dist/cli/verbs/fulfillment-orders.js +674 -0
  145. package/dist/cli/verbs/fulfillment-services.d.ts +6 -0
  146. package/dist/cli/verbs/fulfillment-services.js +212 -0
  147. package/dist/cli/verbs/fulfillments.d.ts +6 -0
  148. package/dist/cli/verbs/fulfillments.js +273 -0
  149. package/dist/cli/verbs/gift-cards.d.ts +6 -0
  150. package/dist/cli/verbs/gift-cards.js +359 -0
  151. package/dist/cli/verbs/graphql.d.ts +14 -0
  152. package/dist/cli/verbs/graphql.js +285 -0
  153. package/dist/cli/verbs/inventory-items.d.ts +6 -0
  154. package/dist/cli/verbs/inventory-items.js +164 -0
  155. package/dist/cli/verbs/inventory-shipments.d.ts +6 -0
  156. package/dist/cli/verbs/inventory-shipments.js +276 -0
  157. package/dist/cli/verbs/inventory-transfers.d.ts +6 -0
  158. package/dist/cli/verbs/inventory-transfers.js +396 -0
  159. package/dist/cli/verbs/inventory.d.ts +6 -0
  160. package/dist/cli/verbs/inventory.js +551 -0
  161. package/dist/cli/verbs/locales.d.ts +6 -0
  162. package/dist/cli/verbs/locales.js +61 -0
  163. package/dist/cli/verbs/locations.d.ts +6 -0
  164. package/dist/cli/verbs/locations.js +385 -0
  165. package/dist/cli/verbs/market-localizations.d.ts +6 -0
  166. package/dist/cli/verbs/market-localizations.js +291 -0
  167. package/dist/cli/verbs/market-web-presences.d.ts +6 -0
  168. package/dist/cli/verbs/market-web-presences.js +139 -0
  169. package/dist/cli/verbs/marketing-activities.d.ts +6 -0
  170. package/dist/cli/verbs/marketing-activities.js +353 -0
  171. package/dist/cli/verbs/marketing-events.d.ts +6 -0
  172. package/dist/cli/verbs/marketing-events.js +132 -0
  173. package/dist/cli/verbs/markets.d.ts +6 -0
  174. package/dist/cli/verbs/markets.js +324 -0
  175. package/dist/cli/verbs/menus.d.ts +6 -0
  176. package/dist/cli/verbs/menus.js +251 -0
  177. package/dist/cli/verbs/metafield-definition-tools.d.ts +6 -0
  178. package/dist/cli/verbs/metafield-definition-tools.js +289 -0
  179. package/dist/cli/verbs/metafield-definitions.d.ts +6 -0
  180. package/dist/cli/verbs/metafield-definitions.js +240 -0
  181. package/dist/cli/verbs/metafields.d.ts +6 -0
  182. package/dist/cli/verbs/metafields.js +112 -0
  183. package/dist/cli/verbs/metaobject-definition-tools.d.ts +6 -0
  184. package/dist/cli/verbs/metaobject-definition-tools.js +83 -0
  185. package/dist/cli/verbs/metaobject-definitions.d.ts +6 -0
  186. package/dist/cli/verbs/metaobject-definitions.js +176 -0
  187. package/dist/cli/verbs/metaobjects.d.ts +6 -0
  188. package/dist/cli/verbs/metaobjects.js +297 -0
  189. package/dist/cli/verbs/mobile-platform-applications.d.ts +6 -0
  190. package/dist/cli/verbs/mobile-platform-applications.js +247 -0
  191. package/dist/cli/verbs/order-edit.d.ts +6 -0
  192. package/dist/cli/verbs/order-edit.js +596 -0
  193. package/dist/cli/verbs/orders.d.ts +6 -0
  194. package/dist/cli/verbs/orders.js +781 -0
  195. package/dist/cli/verbs/pages.d.ts +6 -0
  196. package/dist/cli/verbs/pages.js +234 -0
  197. package/dist/cli/verbs/payment-customizations.d.ts +6 -0
  198. package/dist/cli/verbs/payment-customizations.js +193 -0
  199. package/dist/cli/verbs/payment-terms.d.ts +6 -0
  200. package/dist/cli/verbs/payment-terms.js +228 -0
  201. package/dist/cli/verbs/point-of-sale.d.ts +6 -0
  202. package/dist/cli/verbs/point-of-sale.js +57 -0
  203. package/dist/cli/verbs/price-lists.d.ts +6 -0
  204. package/dist/cli/verbs/price-lists.js +426 -0
  205. package/dist/cli/verbs/product-feeds.d.ts +6 -0
  206. package/dist/cli/verbs/product-feeds.js +187 -0
  207. package/dist/cli/verbs/product-variants.d.ts +6 -0
  208. package/dist/cli/verbs/product-variants.js +388 -0
  209. package/dist/cli/verbs/products.d.ts +6 -0
  210. package/dist/cli/verbs/products.js +1257 -0
  211. package/dist/cli/verbs/publications.d.ts +6 -0
  212. package/dist/cli/verbs/publications.js +256 -0
  213. package/dist/cli/verbs/publishables.d.ts +6 -0
  214. package/dist/cli/verbs/publishables.js +73 -0
  215. package/dist/cli/verbs/refunds.d.ts +6 -0
  216. package/dist/cli/verbs/refunds.js +226 -0
  217. package/dist/cli/verbs/resource-feedback.d.ts +6 -0
  218. package/dist/cli/verbs/resource-feedback.js +119 -0
  219. package/dist/cli/verbs/returnable-fulfillments.d.ts +6 -0
  220. package/dist/cli/verbs/returnable-fulfillments.js +102 -0
  221. package/dist/cli/verbs/returns.d.ts +6 -0
  222. package/dist/cli/verbs/returns.js +506 -0
  223. package/dist/cli/verbs/reverse-deliveries.d.ts +6 -0
  224. package/dist/cli/verbs/reverse-deliveries.js +203 -0
  225. package/dist/cli/verbs/reverse-fulfillment-orders.d.ts +6 -0
  226. package/dist/cli/verbs/reverse-fulfillment-orders.js +157 -0
  227. package/dist/cli/verbs/saved-searches.d.ts +6 -0
  228. package/dist/cli/verbs/saved-searches.js +150 -0
  229. package/dist/cli/verbs/script-tags.d.ts +6 -0
  230. package/dist/cli/verbs/script-tags.js +179 -0
  231. package/dist/cli/verbs/segments.d.ts +6 -0
  232. package/dist/cli/verbs/segments.js +343 -0
  233. package/dist/cli/verbs/selling-plan-group-products.d.ts +6 -0
  234. package/dist/cli/verbs/selling-plan-group-products.js +115 -0
  235. package/dist/cli/verbs/selling-plan-groups.d.ts +6 -0
  236. package/dist/cli/verbs/selling-plan-groups.js +208 -0
  237. package/dist/cli/verbs/server-pixels.d.ts +6 -0
  238. package/dist/cli/verbs/server-pixels.js +172 -0
  239. package/dist/cli/verbs/shipping-packages.d.ts +6 -0
  240. package/dist/cli/verbs/shipping-packages.js +107 -0
  241. package/dist/cli/verbs/shop-policies.d.ts +6 -0
  242. package/dist/cli/verbs/shop-policies.js +91 -0
  243. package/dist/cli/verbs/shop-utils.d.ts +6 -0
  244. package/dist/cli/verbs/shop-utils.js +147 -0
  245. package/dist/cli/verbs/shop.d.ts +6 -0
  246. package/dist/cli/verbs/shop.js +177 -0
  247. package/dist/cli/verbs/shopify-functions.d.ts +6 -0
  248. package/dist/cli/verbs/shopify-functions.js +127 -0
  249. package/dist/cli/verbs/shopify-payments.d.ts +6 -0
  250. package/dist/cli/verbs/shopify-payments.js +111 -0
  251. package/dist/cli/verbs/staff.d.ts +6 -0
  252. package/dist/cli/verbs/staff.js +127 -0
  253. package/dist/cli/verbs/staged-uploads.d.ts +6 -0
  254. package/dist/cli/verbs/staged-uploads.js +128 -0
  255. package/dist/cli/verbs/store-credit.d.ts +6 -0
  256. package/dist/cli/verbs/store-credit.js +209 -0
  257. package/dist/cli/verbs/storefront-access-tokens.d.ts +6 -0
  258. package/dist/cli/verbs/storefront-access-tokens.js +183 -0
  259. package/dist/cli/verbs/subscription-billing-cycles.d.ts +6 -0
  260. package/dist/cli/verbs/subscription-billing-cycles.js +391 -0
  261. package/dist/cli/verbs/subscription-billing.d.ts +6 -0
  262. package/dist/cli/verbs/subscription-billing.js +391 -0
  263. package/dist/cli/verbs/subscription-contracts.d.ts +6 -0
  264. package/dist/cli/verbs/subscription-contracts.js +391 -0
  265. package/dist/cli/verbs/subscription-drafts.d.ts +6 -0
  266. package/dist/cli/verbs/subscription-drafts.js +315 -0
  267. package/dist/cli/verbs/tags.d.ts +6 -0
  268. package/dist/cli/verbs/tags.js +73 -0
  269. package/dist/cli/verbs/tax.d.ts +6 -0
  270. package/dist/cli/verbs/tax.js +114 -0
  271. package/dist/cli/verbs/taxonomy.d.ts +6 -0
  272. package/dist/cli/verbs/taxonomy.js +99 -0
  273. package/dist/cli/verbs/tender-transactions.d.ts +6 -0
  274. package/dist/cli/verbs/tender-transactions.js +105 -0
  275. package/dist/cli/verbs/themes.d.ts +6 -0
  276. package/dist/cli/verbs/themes.js +297 -0
  277. package/dist/cli/verbs/translations.d.ts +6 -0
  278. package/dist/cli/verbs/translations.js +221 -0
  279. package/dist/cli/verbs/types.d.ts +4 -0
  280. package/dist/cli/verbs/types.js +224 -0
  281. package/dist/cli/verbs/url-redirects.d.ts +6 -0
  282. package/dist/cli/verbs/url-redirects.js +407 -0
  283. package/dist/cli/verbs/validations.d.ts +6 -0
  284. package/dist/cli/verbs/validations.js +181 -0
  285. package/dist/cli/verbs/web-pixels.d.ts +6 -0
  286. package/dist/cli/verbs/web-pixels.js +145 -0
  287. package/dist/cli/verbs/web-presences.d.ts +6 -0
  288. package/dist/cli/verbs/web-presences.js +186 -0
  289. package/dist/cli/verbs/webhooks.d.ts +6 -0
  290. package/dist/cli/verbs/webhooks.js +336 -0
  291. package/dist/cli/workflows/files/stagedUploads.d.ts +28 -0
  292. package/dist/cli/workflows/files/stagedUploads.js +175 -0
  293. package/dist/cli/workflows/inventory/resolveInventoryItemId.d.ts +6 -0
  294. package/dist/cli/workflows/inventory/resolveInventoryItemId.js +59 -0
  295. package/dist/cli/workflows/productVariants/upsert.d.ts +8 -0
  296. package/dist/cli/workflows/productVariants/upsert.js +110 -0
  297. package/dist/cli/workflows/products/metafieldsUpsert.d.ts +6 -0
  298. package/dist/cli/workflows/products/metafieldsUpsert.js +94 -0
  299. package/dist/cli/workflows/products/publishablePublish.d.ts +21 -0
  300. package/dist/cli/workflows/products/publishablePublish.js +131 -0
  301. package/dist/cli/workflows/publications/resolvePublicationId.d.ts +17 -0
  302. package/dist/cli/workflows/publications/resolvePublicationId.js +93 -0
  303. package/dist/cli.d.ts +1 -0
  304. package/dist/cli.js +152 -0
  305. package/dist/defaults.d.ts +2 -0
  306. package/dist/defaults.js +38 -0
  307. package/dist/generated/admin-2026-04/index.d.ts +25 -0
  308. package/dist/generated/admin-2026-04/index.js +70 -0
  309. package/dist/generated/admin-2026-04/runtime/batcher.d.ts +105 -0
  310. package/dist/generated/admin-2026-04/runtime/batcher.js +203 -0
  311. package/dist/generated/admin-2026-04/runtime/createClient.d.ts +17 -0
  312. package/dist/generated/admin-2026-04/runtime/createClient.js +59 -0
  313. package/dist/generated/admin-2026-04/runtime/error.d.ts +18 -0
  314. package/dist/generated/admin-2026-04/runtime/error.js +44 -0
  315. package/dist/generated/admin-2026-04/runtime/fetcher.d.ts +10 -0
  316. package/dist/generated/admin-2026-04/runtime/fetcher.js +104 -0
  317. package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.d.ts +30 -0
  318. package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.js +191 -0
  319. package/dist/generated/admin-2026-04/runtime/index.d.ts +11 -0
  320. package/dist/generated/admin-2026-04/runtime/index.js +46 -0
  321. package/dist/generated/admin-2026-04/runtime/linkTypeMap.d.ts +9 -0
  322. package/dist/generated/admin-2026-04/runtime/linkTypeMap.js +142 -0
  323. package/dist/generated/admin-2026-04/runtime/typeSelection.d.ts +28 -0
  324. package/dist/generated/admin-2026-04/runtime/typeSelection.js +17 -0
  325. package/dist/generated/admin-2026-04/runtime/types.d.ts +55 -0
  326. package/dist/generated/admin-2026-04/runtime/types.js +17 -0
  327. package/dist/generated/admin-2026-04/schema.d.ts +102240 -0
  328. package/dist/generated/admin-2026-04/schema.graphql +91596 -0
  329. package/dist/generated/admin-2026-04/schema.js +20322 -0
  330. package/dist/generated/admin-2026-04/types.d.ts +24224 -0
  331. package/dist/generated/admin-2026-04/types.js +62299 -0
  332. package/dist/generated/help/schema-help.d.ts +30 -0
  333. package/dist/generated/help/schema-help.js +61833 -0
  334. package/dist/graphqlValidator.d.ts +17 -0
  335. package/dist/graphqlValidator.js +84 -0
  336. package/dist/index.d.ts +1 -0
  337. package/dist/index.js +23 -0
  338. package/package.json +65 -0
  339. package/schema/2026-04.graphql +61256 -0
  340. package/schema/2026-04.introspection.json +1 -0
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var subscription_drafts_exports = {};
20
+ __export(subscription_drafts_exports, {
21
+ runSubscriptionDrafts: () => runSubscriptionDrafts
22
+ });
23
+ module.exports = __toCommonJS(subscription_drafts_exports);
24
+ var import_errors = require("../errors");
25
+ var import_gid = require("../gid");
26
+ var import_input = require("../input");
27
+ var import_output = require("../output");
28
+ var import_router = require("../router");
29
+ var import_select = require("../selection/select");
30
+ var import_userErrors = require("../userErrors");
31
+ const subscriptionDraftSummarySelection = {
32
+ id: true,
33
+ customer: { id: true, displayName: true, email: true },
34
+ currencyCode: true,
35
+ billingPolicy: {
36
+ interval: true,
37
+ intervalCount: true
38
+ },
39
+ deliveryPolicy: {
40
+ interval: true,
41
+ intervalCount: true
42
+ },
43
+ lines: {
44
+ __args: { first: 10 },
45
+ nodes: {
46
+ id: true,
47
+ title: true,
48
+ quantity: true,
49
+ variantId: true
50
+ }
51
+ }
52
+ };
53
+ const getSubscriptionDraftSelection = (view) => {
54
+ if (view === "ids") return { id: true };
55
+ if (view === "full") return subscriptionDraftSummarySelection;
56
+ if (view === "raw") return {};
57
+ return subscriptionDraftSummarySelection;
58
+ };
59
+ const requireDraftId = (value) => {
60
+ if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --id", 2);
61
+ return (0, import_gid.coerceGid)(value, "SubscriptionDraft");
62
+ };
63
+ const requireLineId = (value) => {
64
+ if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --line-id", 2);
65
+ return (0, import_gid.coerceGid)(value, "SubscriptionLine");
66
+ };
67
+ const requireDiscountId = (value) => {
68
+ if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --discount-id", 2);
69
+ return (0, import_gid.coerceGid)(value, "SubscriptionManualDiscount");
70
+ };
71
+ const runSubscriptionDrafts = async ({
72
+ ctx,
73
+ verb,
74
+ argv
75
+ }) => {
76
+ if (argv.includes("--help") || argv.includes("-h")) {
77
+ console.log(
78
+ [
79
+ "Usage:",
80
+ " shop subscription-drafts <verb> [flags]",
81
+ "",
82
+ "Verbs:",
83
+ " get|commit|update|add-line|update-line|remove-line",
84
+ " add-discount|update-discount|remove-discount|apply-code",
85
+ " add-free-shipping|update-free-shipping",
86
+ "",
87
+ "Common output flags:",
88
+ " --view summary|ids|full|raw",
89
+ " --select <path> (repeatable; dot paths; adds to base view selection)",
90
+ " --selection <graphql> (selection override; can be @file.gql)"
91
+ ].join("\n")
92
+ );
93
+ return;
94
+ }
95
+ if (verb === "get") {
96
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
97
+ const id = requireDraftId(args.id);
98
+ const selection = (0, import_select.resolveSelection)({
99
+ resource: "subscription-drafts",
100
+ typeName: "SubscriptionDraft",
101
+ view: ctx.view,
102
+ baseSelection: getSubscriptionDraftSelection(ctx.view),
103
+ select: args.select,
104
+ selection: args.selection,
105
+ include: args.include,
106
+ ensureId: ctx.quiet
107
+ });
108
+ const result = await (0, import_router.runQuery)(ctx, { subscriptionDraft: { __args: { id }, ...selection } });
109
+ if (result === void 0) return;
110
+ (0, import_output.printNode)({ node: result.subscriptionDraft, format: ctx.format, quiet: ctx.quiet });
111
+ return;
112
+ }
113
+ if (verb === "commit") {
114
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
115
+ const draftId = requireDraftId(args.id);
116
+ const result = await (0, import_router.runMutation)(ctx, {
117
+ subscriptionDraftCommit: {
118
+ __args: { draftId },
119
+ contract: { id: true, status: true, nextBillingDate: true },
120
+ userErrors: { field: true, message: true }
121
+ }
122
+ });
123
+ if (result === void 0) return;
124
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftCommit, failOnUserErrors: ctx.failOnUserErrors });
125
+ if (ctx.quiet) return console.log(result.subscriptionDraftCommit?.contract?.id ?? "");
126
+ (0, import_output.printJson)(result.subscriptionDraftCommit, ctx.format !== "raw");
127
+ return;
128
+ }
129
+ if (verb === "update") {
130
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
131
+ const draftId = requireDraftId(args.id);
132
+ const built = (0, import_input.buildInput)({
133
+ inputArg: args.input,
134
+ setArgs: args.set,
135
+ setJsonArgs: args["set-json"]
136
+ });
137
+ if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
138
+ const result = await (0, import_router.runMutation)(ctx, {
139
+ subscriptionDraftUpdate: {
140
+ __args: { draftId, input: built.input },
141
+ draft: subscriptionDraftSummarySelection,
142
+ userErrors: { field: true, message: true }
143
+ }
144
+ });
145
+ if (result === void 0) return;
146
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftUpdate, failOnUserErrors: ctx.failOnUserErrors });
147
+ if (ctx.quiet) return console.log(result.subscriptionDraftUpdate?.draft?.id ?? "");
148
+ (0, import_output.printJson)(result.subscriptionDraftUpdate, ctx.format !== "raw");
149
+ return;
150
+ }
151
+ if (verb === "add-line") {
152
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
153
+ const draftId = requireDraftId(args.id);
154
+ const built = (0, import_input.buildInput)({
155
+ inputArg: args.input,
156
+ setArgs: args.set,
157
+ setJsonArgs: args["set-json"]
158
+ });
159
+ if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
160
+ const result = await (0, import_router.runMutation)(ctx, {
161
+ subscriptionDraftLineAdd: {
162
+ __args: { draftId, input: built.input },
163
+ draft: subscriptionDraftSummarySelection,
164
+ lineAdded: { id: true, title: true, quantity: true, variantId: true },
165
+ userErrors: { field: true, message: true }
166
+ }
167
+ });
168
+ if (result === void 0) return;
169
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftLineAdd, failOnUserErrors: ctx.failOnUserErrors });
170
+ if (ctx.quiet) return console.log(result.subscriptionDraftLineAdd?.draft?.id ?? "");
171
+ (0, import_output.printJson)(result.subscriptionDraftLineAdd, ctx.format !== "raw");
172
+ return;
173
+ }
174
+ if (verb === "update-line") {
175
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "line-id": { type: "string" } } });
176
+ const draftId = requireDraftId(args.id);
177
+ const lineId = requireLineId(args["line-id"]);
178
+ const built = (0, import_input.buildInput)({
179
+ inputArg: args.input,
180
+ setArgs: args.set,
181
+ setJsonArgs: args["set-json"]
182
+ });
183
+ if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
184
+ const result = await (0, import_router.runMutation)(ctx, {
185
+ subscriptionDraftLineUpdate: {
186
+ __args: { draftId, lineId, input: built.input },
187
+ draft: subscriptionDraftSummarySelection,
188
+ lineUpdated: { id: true, title: true, quantity: true, variantId: true },
189
+ userErrors: { field: true, message: true }
190
+ }
191
+ });
192
+ if (result === void 0) return;
193
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftLineUpdate, failOnUserErrors: ctx.failOnUserErrors });
194
+ if (ctx.quiet) return console.log(result.subscriptionDraftLineUpdate?.draft?.id ?? "");
195
+ (0, import_output.printJson)(result.subscriptionDraftLineUpdate, ctx.format !== "raw");
196
+ return;
197
+ }
198
+ if (verb === "remove-line") {
199
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "line-id": { type: "string" } } });
200
+ const draftId = requireDraftId(args.id);
201
+ const lineId = requireLineId(args["line-id"]);
202
+ const result = await (0, import_router.runMutation)(ctx, {
203
+ subscriptionDraftLineRemove: {
204
+ __args: { draftId, lineId },
205
+ draft: subscriptionDraftSummarySelection,
206
+ lineRemoved: { id: true, title: true, quantity: true },
207
+ userErrors: { field: true, message: true }
208
+ }
209
+ });
210
+ if (result === void 0) return;
211
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftLineRemove, failOnUserErrors: ctx.failOnUserErrors });
212
+ if (ctx.quiet) return console.log(result.subscriptionDraftLineRemove?.draft?.id ?? "");
213
+ (0, import_output.printJson)(result.subscriptionDraftLineRemove, ctx.format !== "raw");
214
+ return;
215
+ }
216
+ if (verb === "add-discount" || verb === "update-discount") {
217
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "discount-id": { type: "string" } } });
218
+ const draftId = requireDraftId(args.id);
219
+ const built = (0, import_input.buildInput)({
220
+ inputArg: args.input,
221
+ setArgs: args.set,
222
+ setJsonArgs: args["set-json"]
223
+ });
224
+ if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
225
+ const mutationField = verb === "add-discount" ? "subscriptionDraftDiscountAdd" : "subscriptionDraftDiscountUpdate";
226
+ const discountId = verb === "update-discount" ? requireDiscountId(args["discount-id"]) : void 0;
227
+ const result = await (0, import_router.runMutation)(ctx, {
228
+ [mutationField]: {
229
+ __args: {
230
+ draftId,
231
+ ...discountId ? { discountId } : {},
232
+ input: built.input
233
+ },
234
+ draft: subscriptionDraftSummarySelection,
235
+ userErrors: { field: true, message: true }
236
+ }
237
+ });
238
+ if (result === void 0) return;
239
+ const payload = result[mutationField];
240
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload, failOnUserErrors: ctx.failOnUserErrors });
241
+ if (ctx.quiet) return console.log(payload?.draft?.id ?? "");
242
+ (0, import_output.printJson)(payload, ctx.format !== "raw");
243
+ return;
244
+ }
245
+ if (verb === "remove-discount") {
246
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "discount-id": { type: "string" } } });
247
+ const draftId = requireDraftId(args.id);
248
+ const discountId = requireDiscountId(args["discount-id"]);
249
+ const result = await (0, import_router.runMutation)(ctx, {
250
+ subscriptionDraftDiscountRemove: {
251
+ __args: { draftId, discountId },
252
+ draft: subscriptionDraftSummarySelection,
253
+ userErrors: { field: true, message: true }
254
+ }
255
+ });
256
+ if (result === void 0) return;
257
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftDiscountRemove, failOnUserErrors: ctx.failOnUserErrors });
258
+ if (ctx.quiet) return console.log(result.subscriptionDraftDiscountRemove?.draft?.id ?? "");
259
+ (0, import_output.printJson)(result.subscriptionDraftDiscountRemove, ctx.format !== "raw");
260
+ return;
261
+ }
262
+ if (verb === "apply-code") {
263
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { code: { type: "string" } } });
264
+ const draftId = requireDraftId(args.id);
265
+ const code = args.code;
266
+ if (!code) throw new import_errors.CliError("Missing --code", 2);
267
+ const result = await (0, import_router.runMutation)(ctx, {
268
+ subscriptionDraftDiscountCodeApply: {
269
+ __args: { draftId, redeemCode: code },
270
+ draft: subscriptionDraftSummarySelection,
271
+ userErrors: { field: true, message: true }
272
+ }
273
+ });
274
+ if (result === void 0) return;
275
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionDraftDiscountCodeApply, failOnUserErrors: ctx.failOnUserErrors });
276
+ if (ctx.quiet) return console.log(result.subscriptionDraftDiscountCodeApply?.draft?.id ?? "");
277
+ (0, import_output.printJson)(result.subscriptionDraftDiscountCodeApply, ctx.format !== "raw");
278
+ return;
279
+ }
280
+ if (verb === "add-free-shipping" || verb === "update-free-shipping") {
281
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "discount-id": { type: "string" } } });
282
+ const draftId = requireDraftId(args.id);
283
+ const built = (0, import_input.buildInput)({
284
+ inputArg: args.input,
285
+ setArgs: args.set,
286
+ setJsonArgs: args["set-json"]
287
+ });
288
+ if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
289
+ const mutationField = verb === "add-free-shipping" ? "subscriptionDraftFreeShippingDiscountAdd" : "subscriptionDraftFreeShippingDiscountUpdate";
290
+ const discountId = verb === "update-free-shipping" ? requireDiscountId(args["discount-id"]) : void 0;
291
+ const result = await (0, import_router.runMutation)(ctx, {
292
+ [mutationField]: {
293
+ __args: {
294
+ draftId,
295
+ ...discountId ? { discountId } : {},
296
+ input: built.input
297
+ },
298
+ draft: subscriptionDraftSummarySelection,
299
+ userErrors: { field: true, message: true }
300
+ }
301
+ });
302
+ if (result === void 0) return;
303
+ const payload = result[mutationField];
304
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload, failOnUserErrors: ctx.failOnUserErrors });
305
+ if (ctx.quiet) return console.log(payload?.draft?.id ?? "");
306
+ (0, import_output.printJson)(payload, ctx.format !== "raw");
307
+ return;
308
+ }
309
+ throw new import_errors.CliError(`Unknown verb for subscription-drafts: ${verb}`, 2);
310
+ };
311
+ // Annotate the CommonJS export names for ESM import in node:
312
+ 0 && (module.exports = {
313
+ runSubscriptionDrafts
314
+ });
315
+ //# sourceMappingURL=subscription-drafts.js.map
@@ -0,0 +1,6 @@
1
+ import { type CommandContext } from '../router';
2
+ export declare const runTags: ({ ctx, verb, argv, }: {
3
+ ctx: CommandContext;
4
+ verb: string;
5
+ argv: string[];
6
+ }) => Promise<void>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var tags_exports = {};
20
+ __export(tags_exports, {
21
+ runTags: () => runTags
22
+ });
23
+ module.exports = __toCommonJS(tags_exports);
24
+ var import_errors = require("../errors");
25
+ var import_output = require("../output");
26
+ var import_router = require("../router");
27
+ var import_userErrors = require("../userErrors");
28
+ var import_shared = require("./_shared");
29
+ const runTags = async ({
30
+ ctx,
31
+ verb,
32
+ argv
33
+ }) => {
34
+ if (argv.includes("--help") || argv.includes("-h")) {
35
+ console.log(
36
+ [
37
+ "Usage:",
38
+ " shop tags <verb> [flags]",
39
+ "",
40
+ "Verbs:",
41
+ " add|remove"
42
+ ].join("\n")
43
+ );
44
+ return;
45
+ }
46
+ if (verb === "add" || verb === "remove") {
47
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
48
+ const idRaw = args.id;
49
+ if (typeof idRaw !== "string" || !idRaw) throw new import_errors.CliError("Missing --id", 2);
50
+ const id = idRaw;
51
+ const tags = (0, import_shared.parseCsv)(args.tags, "--tags");
52
+ const mutationField = verb === "add" ? "tagsAdd" : "tagsRemove";
53
+ const result = await (0, import_router.runMutation)(ctx, {
54
+ [mutationField]: {
55
+ __args: { id, tags },
56
+ node: { id: true },
57
+ userErrors: { field: true, message: true }
58
+ }
59
+ });
60
+ if (result === void 0) return;
61
+ const payload = result[mutationField];
62
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload, failOnUserErrors: ctx.failOnUserErrors });
63
+ if (ctx.quiet) return console.log(payload?.node?.id ?? "");
64
+ (0, import_output.printJson)(payload, ctx.format !== "raw");
65
+ return;
66
+ }
67
+ throw new import_errors.CliError(`Unknown verb for tags: ${verb}`, 2);
68
+ };
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ runTags
72
+ });
73
+ //# sourceMappingURL=tags.js.map
@@ -0,0 +1,6 @@
1
+ import { type CommandContext } from '../router';
2
+ export declare const runTax: ({ ctx, verb, argv, }: {
3
+ ctx: CommandContext;
4
+ verb: string;
5
+ argv: string[];
6
+ }) => Promise<void>;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var tax_exports = {};
20
+ __export(tax_exports, {
21
+ runTax: () => runTax
22
+ });
23
+ module.exports = __toCommonJS(tax_exports);
24
+ var import_errors = require("../errors");
25
+ var import_gid = require("../gid");
26
+ var import_output = require("../output");
27
+ var import_router = require("../router");
28
+ var import_userErrors = require("../userErrors");
29
+ var import_shared = require("./_shared");
30
+ const parseBool = (value, flag) => {
31
+ if (value === void 0 || value === null || value === "") throw new import_errors.CliError(`Missing ${flag}`, 2);
32
+ if (typeof value !== "string") throw new import_errors.CliError(`${flag} must be a string`, 2);
33
+ const raw = value.trim().toLowerCase();
34
+ if (raw === "true" || raw === "1" || raw === "yes") return true;
35
+ if (raw === "false" || raw === "0" || raw === "no") return false;
36
+ throw new import_errors.CliError(`${flag} must be true|false`, 2);
37
+ };
38
+ const runTax = async ({
39
+ ctx,
40
+ verb,
41
+ argv
42
+ }) => {
43
+ if (argv.includes("--help") || argv.includes("-h")) {
44
+ console.log(
45
+ [
46
+ "Usage:",
47
+ " shop tax <verb> [flags]",
48
+ "",
49
+ "Verbs:",
50
+ " configure-app|create-summary"
51
+ ].join("\n")
52
+ );
53
+ return;
54
+ }
55
+ if (verb === "configure-app") {
56
+ const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { ready: { type: "string" } } });
57
+ const ready = parseBool(args.ready, "--ready");
58
+ const result = await (0, import_router.runMutation)(ctx, {
59
+ taxAppConfigure: {
60
+ __args: { ready },
61
+ taxAppConfiguration: { state: true },
62
+ userErrors: { field: true, message: true, code: true }
63
+ }
64
+ });
65
+ if (result === void 0) return;
66
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.taxAppConfigure, failOnUserErrors: ctx.failOnUserErrors });
67
+ (0, import_output.printJson)(result.taxAppConfigure, ctx.format !== "raw");
68
+ return;
69
+ }
70
+ if (verb === "create-summary") {
71
+ const args = (0, import_router.parseStandardArgs)({
72
+ argv,
73
+ extraOptions: { "start-time": { type: "string" }, "end-time": { type: "string" } }
74
+ });
75
+ const orderIdRaw = args["order-id"];
76
+ const idFallback = args.id;
77
+ const orderId = orderIdRaw ?? idFallback;
78
+ const startTimeRaw = args["start-time"];
79
+ const endTimeRaw = args["end-time"];
80
+ if (!orderId && !(startTimeRaw && endTimeRaw)) {
81
+ throw new import_errors.CliError("Missing --order-id (or --id) or --start-time/--end-time", 2);
82
+ }
83
+ const startTime = startTimeRaw ? (0, import_shared.parseDateTime)(startTimeRaw, "--start-time") : void 0;
84
+ const endTime = endTimeRaw ? (0, import_shared.parseDateTime)(endTimeRaw, "--end-time") : void 0;
85
+ const result = await (0, import_router.runMutation)(ctx, {
86
+ taxSummaryCreate: {
87
+ __args: {
88
+ ...orderId ? { orderId: (0, import_gid.coerceGid)(orderId, "Order") } : {},
89
+ ...startTime ? { startTime } : {},
90
+ ...endTime ? { endTime } : {}
91
+ },
92
+ enqueuedOrders: { id: true, name: true },
93
+ userErrors: { field: true, message: true, code: true }
94
+ }
95
+ });
96
+ if (result === void 0) return;
97
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.taxSummaryCreate, failOnUserErrors: ctx.failOnUserErrors });
98
+ if (ctx.quiet) {
99
+ for (const order of result.taxSummaryCreate?.enqueuedOrders ?? []) {
100
+ if (order?.id) process.stdout.write(`${order.id}
101
+ `);
102
+ }
103
+ return;
104
+ }
105
+ (0, import_output.printJson)(result.taxSummaryCreate, ctx.format !== "raw");
106
+ return;
107
+ }
108
+ throw new import_errors.CliError(`Unknown verb for tax: ${verb}`, 2);
109
+ };
110
+ // Annotate the CommonJS export names for ESM import in node:
111
+ 0 && (module.exports = {
112
+ runTax
113
+ });
114
+ //# sourceMappingURL=tax.js.map
@@ -0,0 +1,6 @@
1
+ import { type CommandContext } from '../router';
2
+ export declare const runTaxonomy: ({ ctx, verb, argv, }: {
3
+ ctx: CommandContext;
4
+ verb: string;
5
+ argv: string[];
6
+ }) => Promise<void>;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var taxonomy_exports = {};
20
+ __export(taxonomy_exports, {
21
+ runTaxonomy: () => runTaxonomy
22
+ });
23
+ module.exports = __toCommonJS(taxonomy_exports);
24
+ var import_errors = require("../errors");
25
+ var import_output = require("../output");
26
+ var import_router = require("../router");
27
+ var import_shared = require("./_shared");
28
+ const taxonomyCategorySummarySelection = {
29
+ id: true,
30
+ name: true,
31
+ fullName: true,
32
+ level: true,
33
+ isRoot: true,
34
+ isLeaf: true,
35
+ isArchived: true,
36
+ parentId: true
37
+ };
38
+ const runTaxonomy = async ({
39
+ ctx,
40
+ verb,
41
+ argv
42
+ }) => {
43
+ if (verb !== "categories" && verb !== "list") {
44
+ throw new import_errors.CliError(`Unknown verb for taxonomy: ${verb}`, 2);
45
+ }
46
+ const args = (0, import_router.parseStandardArgs)({
47
+ argv,
48
+ extraOptions: {
49
+ search: { type: "string" },
50
+ "children-of": { type: "string" },
51
+ "descendants-of": { type: "string" },
52
+ "siblings-of": { type: "string" }
53
+ }
54
+ });
55
+ const first = (0, import_shared.parseFirst)(args.first);
56
+ const after = args.after;
57
+ const search = args.search;
58
+ const childrenOf = args["children-of"];
59
+ const descendantsOf = args["descendants-of"];
60
+ const siblingsOf = args["siblings-of"];
61
+ const result = await (0, import_router.runQuery)(ctx, {
62
+ taxonomy: {
63
+ categories: {
64
+ __args: {
65
+ first,
66
+ after,
67
+ ...search ? { search } : {},
68
+ ...childrenOf ? { childrenOf } : {},
69
+ ...descendantsOf ? { descendantsOf } : {},
70
+ ...siblingsOf ? { siblingsOf } : {}
71
+ },
72
+ pageInfo: { hasNextPage: true, endCursor: true },
73
+ nodes: taxonomyCategorySummarySelection
74
+ }
75
+ }
76
+ });
77
+ if (result === void 0) return;
78
+ const connection = result.taxonomy?.categories ?? { nodes: [], pageInfo: void 0 };
79
+ (0, import_output.printConnection)({
80
+ connection,
81
+ format: ctx.format,
82
+ quiet: ctx.quiet,
83
+ nextPageArgs: {
84
+ base: `shop taxonomy ${verb}`,
85
+ first,
86
+ extraFlags: [
87
+ ...search ? [{ flag: "--search", value: search }] : [],
88
+ ...childrenOf ? [{ flag: "--children-of", value: childrenOf }] : [],
89
+ ...descendantsOf ? [{ flag: "--descendants-of", value: descendantsOf }] : [],
90
+ ...siblingsOf ? [{ flag: "--siblings-of", value: siblingsOf }] : []
91
+ ]
92
+ }
93
+ });
94
+ };
95
+ // Annotate the CommonJS export names for ESM import in node:
96
+ 0 && (module.exports = {
97
+ runTaxonomy
98
+ });
99
+ //# sourceMappingURL=taxonomy.js.map
@@ -0,0 +1,6 @@
1
+ import { type CommandContext } from '../router';
2
+ export declare const runTenderTransactions: ({ ctx, verb, argv, }: {
3
+ ctx: CommandContext;
4
+ verb: string;
5
+ argv: string[];
6
+ }) => Promise<void>;