shop-cli 0.1.1

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 (350) 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 +6443 -0
  23. package/dist/cli/help/render.d.ts +8 -0
  24. package/dist/cli/help/render.js +399 -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/parse-command.d.ts +18 -0
  42. package/dist/cli/parse-command.js +109 -0
  43. package/dist/cli/router.d.ts +29 -0
  44. package/dist/cli/router.js +480 -0
  45. package/dist/cli/selection/buildAllSelection.d.ts +13 -0
  46. package/dist/cli/selection/buildAllSelection.js +108 -0
  47. package/dist/cli/selection/graphqlSelection.d.ts +5 -0
  48. package/dist/cli/selection/graphqlSelection.js +301 -0
  49. package/dist/cli/selection/select.d.ts +13 -0
  50. package/dist/cli/selection/select.js +136 -0
  51. package/dist/cli/selection/stripDeprecated.d.ts +2 -0
  52. package/dist/cli/selection/stripDeprecated.js +63 -0
  53. package/dist/cli/suggest.d.ts +5 -0
  54. package/dist/cli/suggest.js +88 -0
  55. package/dist/cli/userErrors.d.ts +4 -0
  56. package/dist/cli/userErrors.js +41 -0
  57. package/dist/cli/verbs/_shared.d.ts +38 -0
  58. package/dist/cli/verbs/_shared.js +181 -0
  59. package/dist/cli/verbs/abandoned-checkouts.d.ts +6 -0
  60. package/dist/cli/verbs/abandoned-checkouts.js +259 -0
  61. package/dist/cli/verbs/app-billing.d.ts +6 -0
  62. package/dist/cli/verbs/app-billing.js +452 -0
  63. package/dist/cli/verbs/apps.d.ts +6 -0
  64. package/dist/cli/verbs/apps.js +296 -0
  65. package/dist/cli/verbs/articles.d.ts +6 -0
  66. package/dist/cli/verbs/articles.js +251 -0
  67. package/dist/cli/verbs/backup.d.ts +6 -0
  68. package/dist/cli/verbs/backup.js +94 -0
  69. package/dist/cli/verbs/blogs.d.ts +6 -0
  70. package/dist/cli/verbs/blogs.js +273 -0
  71. package/dist/cli/verbs/bulk-operations.d.ts +6 -0
  72. package/dist/cli/verbs/bulk-operations.js +272 -0
  73. package/dist/cli/verbs/business-entities.d.ts +6 -0
  74. package/dist/cli/verbs/business-entities.js +102 -0
  75. package/dist/cli/verbs/carrier-services.d.ts +6 -0
  76. package/dist/cli/verbs/carrier-services.js +195 -0
  77. package/dist/cli/verbs/cart-transforms.d.ts +6 -0
  78. package/dist/cli/verbs/cart-transforms.js +141 -0
  79. package/dist/cli/verbs/cash-tracking.d.ts +6 -0
  80. package/dist/cli/verbs/cash-tracking.js +118 -0
  81. package/dist/cli/verbs/catalogs.d.ts +6 -0
  82. package/dist/cli/verbs/catalogs.js +267 -0
  83. package/dist/cli/verbs/channels.d.ts +6 -0
  84. package/dist/cli/verbs/channels.js +120 -0
  85. package/dist/cli/verbs/checkout-branding.d.ts +6 -0
  86. package/dist/cli/verbs/checkout-branding.js +144 -0
  87. package/dist/cli/verbs/checkout-profiles.d.ts +6 -0
  88. package/dist/cli/verbs/checkout-profiles.js +124 -0
  89. package/dist/cli/verbs/collections.d.ts +6 -0
  90. package/dist/cli/verbs/collections.js +620 -0
  91. package/dist/cli/verbs/comments.d.ts +6 -0
  92. package/dist/cli/verbs/comments.js +160 -0
  93. package/dist/cli/verbs/companies.d.ts +6 -0
  94. package/dist/cli/verbs/companies.js +313 -0
  95. package/dist/cli/verbs/company-contacts.d.ts +6 -0
  96. package/dist/cli/verbs/company-contacts.js +318 -0
  97. package/dist/cli/verbs/company-locations.d.ts +6 -0
  98. package/dist/cli/verbs/company-locations.js +467 -0
  99. package/dist/cli/verbs/customer-account-pages.d.ts +6 -0
  100. package/dist/cli/verbs/customer-account-pages.js +97 -0
  101. package/dist/cli/verbs/customer-payment-methods.d.ts +6 -0
  102. package/dist/cli/verbs/customer-payment-methods.js +358 -0
  103. package/dist/cli/verbs/customer-privacy.d.ts +6 -0
  104. package/dist/cli/verbs/customer-privacy.js +167 -0
  105. package/dist/cli/verbs/customer-segments.d.ts +6 -0
  106. package/dist/cli/verbs/customer-segments.js +193 -0
  107. package/dist/cli/verbs/customers.d.ts +6 -0
  108. package/dist/cli/verbs/customers.js +793 -0
  109. package/dist/cli/verbs/delegate-tokens.d.ts +6 -0
  110. package/dist/cli/verbs/delegate-tokens.js +95 -0
  111. package/dist/cli/verbs/delivery-customizations.d.ts +6 -0
  112. package/dist/cli/verbs/delivery-customizations.js +205 -0
  113. package/dist/cli/verbs/delivery-profile-locations.d.ts +6 -0
  114. package/dist/cli/verbs/delivery-profile-locations.js +90 -0
  115. package/dist/cli/verbs/delivery-profiles.d.ts +6 -0
  116. package/dist/cli/verbs/delivery-profiles.js +207 -0
  117. package/dist/cli/verbs/delivery-promises.d.ts +6 -0
  118. package/dist/cli/verbs/delivery-promises.js +262 -0
  119. package/dist/cli/verbs/delivery-settings.d.ts +6 -0
  120. package/dist/cli/verbs/delivery-settings.js +85 -0
  121. package/dist/cli/verbs/discount-nodes.d.ts +6 -0
  122. package/dist/cli/verbs/discount-nodes.js +169 -0
  123. package/dist/cli/verbs/discount-redeem-codes.d.ts +6 -0
  124. package/dist/cli/verbs/discount-redeem-codes.js +102 -0
  125. package/dist/cli/verbs/discount-saved-searches.d.ts +6 -0
  126. package/dist/cli/verbs/discount-saved-searches.js +113 -0
  127. package/dist/cli/verbs/discounts-automatic.d.ts +6 -0
  128. package/dist/cli/verbs/discounts-automatic.js +501 -0
  129. package/dist/cli/verbs/discounts-code.d.ts +6 -0
  130. package/dist/cli/verbs/discounts-code.js +540 -0
  131. package/dist/cli/verbs/disputes.d.ts +6 -0
  132. package/dist/cli/verbs/disputes.js +154 -0
  133. package/dist/cli/verbs/draft-orders.d.ts +6 -0
  134. package/dist/cli/verbs/draft-orders.js +475 -0
  135. package/dist/cli/verbs/events.d.ts +6 -0
  136. package/dist/cli/verbs/events.js +182 -0
  137. package/dist/cli/verbs/file-saved-searches.d.ts +6 -0
  138. package/dist/cli/verbs/file-saved-searches.js +83 -0
  139. package/dist/cli/verbs/files.d.ts +6 -0
  140. package/dist/cli/verbs/files.js +329 -0
  141. package/dist/cli/verbs/finance.d.ts +6 -0
  142. package/dist/cli/verbs/finance.js +115 -0
  143. package/dist/cli/verbs/flow.d.ts +6 -0
  144. package/dist/cli/verbs/flow.js +94 -0
  145. package/dist/cli/verbs/fulfillment-constraint-rules.d.ts +6 -0
  146. package/dist/cli/verbs/fulfillment-constraint-rules.js +139 -0
  147. package/dist/cli/verbs/fulfillment-orders.d.ts +6 -0
  148. package/dist/cli/verbs/fulfillment-orders.js +689 -0
  149. package/dist/cli/verbs/fulfillment-services.d.ts +6 -0
  150. package/dist/cli/verbs/fulfillment-services.js +212 -0
  151. package/dist/cli/verbs/fulfillments.d.ts +6 -0
  152. package/dist/cli/verbs/fulfillments.js +279 -0
  153. package/dist/cli/verbs/gift-cards.d.ts +6 -0
  154. package/dist/cli/verbs/gift-cards.js +359 -0
  155. package/dist/cli/verbs/graphql.d.ts +14 -0
  156. package/dist/cli/verbs/graphql.js +285 -0
  157. package/dist/cli/verbs/inventory-items.d.ts +6 -0
  158. package/dist/cli/verbs/inventory-items.js +164 -0
  159. package/dist/cli/verbs/inventory-shipments.d.ts +6 -0
  160. package/dist/cli/verbs/inventory-shipments.js +276 -0
  161. package/dist/cli/verbs/inventory-transfers.d.ts +6 -0
  162. package/dist/cli/verbs/inventory-transfers.js +396 -0
  163. package/dist/cli/verbs/inventory.d.ts +6 -0
  164. package/dist/cli/verbs/inventory.js +557 -0
  165. package/dist/cli/verbs/locales.d.ts +6 -0
  166. package/dist/cli/verbs/locales.js +61 -0
  167. package/dist/cli/verbs/locations.d.ts +6 -0
  168. package/dist/cli/verbs/locations.js +385 -0
  169. package/dist/cli/verbs/market-localizations.d.ts +6 -0
  170. package/dist/cli/verbs/market-localizations.js +291 -0
  171. package/dist/cli/verbs/market-web-presences.d.ts +6 -0
  172. package/dist/cli/verbs/market-web-presences.js +139 -0
  173. package/dist/cli/verbs/marketing-activities.d.ts +6 -0
  174. package/dist/cli/verbs/marketing-activities.js +353 -0
  175. package/dist/cli/verbs/marketing-events.d.ts +6 -0
  176. package/dist/cli/verbs/marketing-events.js +132 -0
  177. package/dist/cli/verbs/markets.d.ts +6 -0
  178. package/dist/cli/verbs/markets.js +357 -0
  179. package/dist/cli/verbs/menus.d.ts +6 -0
  180. package/dist/cli/verbs/menus.js +251 -0
  181. package/dist/cli/verbs/metafield-definition-tools.d.ts +6 -0
  182. package/dist/cli/verbs/metafield-definition-tools.js +289 -0
  183. package/dist/cli/verbs/metafield-definitions.d.ts +6 -0
  184. package/dist/cli/verbs/metafield-definitions.js +240 -0
  185. package/dist/cli/verbs/metafields.d.ts +6 -0
  186. package/dist/cli/verbs/metafields.js +112 -0
  187. package/dist/cli/verbs/metaobject-definition-tools.d.ts +6 -0
  188. package/dist/cli/verbs/metaobject-definition-tools.js +83 -0
  189. package/dist/cli/verbs/metaobject-definitions.d.ts +6 -0
  190. package/dist/cli/verbs/metaobject-definitions.js +176 -0
  191. package/dist/cli/verbs/metaobjects.d.ts +6 -0
  192. package/dist/cli/verbs/metaobjects.js +306 -0
  193. package/dist/cli/verbs/mobile-platform-applications.d.ts +6 -0
  194. package/dist/cli/verbs/mobile-platform-applications.js +247 -0
  195. package/dist/cli/verbs/order-edit.d.ts +6 -0
  196. package/dist/cli/verbs/order-edit.js +596 -0
  197. package/dist/cli/verbs/orders.d.ts +6 -0
  198. package/dist/cli/verbs/orders.js +853 -0
  199. package/dist/cli/verbs/pages.d.ts +6 -0
  200. package/dist/cli/verbs/pages.js +234 -0
  201. package/dist/cli/verbs/payment-customizations.d.ts +6 -0
  202. package/dist/cli/verbs/payment-customizations.js +193 -0
  203. package/dist/cli/verbs/payment-terms.d.ts +6 -0
  204. package/dist/cli/verbs/payment-terms.js +228 -0
  205. package/dist/cli/verbs/point-of-sale.d.ts +6 -0
  206. package/dist/cli/verbs/point-of-sale.js +57 -0
  207. package/dist/cli/verbs/price-lists.d.ts +6 -0
  208. package/dist/cli/verbs/price-lists.js +426 -0
  209. package/dist/cli/verbs/product-feeds.d.ts +6 -0
  210. package/dist/cli/verbs/product-feeds.js +187 -0
  211. package/dist/cli/verbs/product-variants.d.ts +6 -0
  212. package/dist/cli/verbs/product-variants.js +439 -0
  213. package/dist/cli/verbs/products.d.ts +6 -0
  214. package/dist/cli/verbs/products.js +2309 -0
  215. package/dist/cli/verbs/publications.d.ts +6 -0
  216. package/dist/cli/verbs/publications.js +256 -0
  217. package/dist/cli/verbs/publishables.d.ts +6 -0
  218. package/dist/cli/verbs/publishables.js +73 -0
  219. package/dist/cli/verbs/refunds.d.ts +6 -0
  220. package/dist/cli/verbs/refunds.js +226 -0
  221. package/dist/cli/verbs/resource-feedback.d.ts +6 -0
  222. package/dist/cli/verbs/resource-feedback.js +119 -0
  223. package/dist/cli/verbs/returnable-fulfillments.d.ts +6 -0
  224. package/dist/cli/verbs/returnable-fulfillments.js +102 -0
  225. package/dist/cli/verbs/returns.d.ts +6 -0
  226. package/dist/cli/verbs/returns.js +506 -0
  227. package/dist/cli/verbs/reverse-deliveries.d.ts +6 -0
  228. package/dist/cli/verbs/reverse-deliveries.js +203 -0
  229. package/dist/cli/verbs/reverse-fulfillment-orders.d.ts +6 -0
  230. package/dist/cli/verbs/reverse-fulfillment-orders.js +157 -0
  231. package/dist/cli/verbs/saved-searches.d.ts +6 -0
  232. package/dist/cli/verbs/saved-searches.js +150 -0
  233. package/dist/cli/verbs/script-tags.d.ts +6 -0
  234. package/dist/cli/verbs/script-tags.js +179 -0
  235. package/dist/cli/verbs/segments.d.ts +6 -0
  236. package/dist/cli/verbs/segments.js +343 -0
  237. package/dist/cli/verbs/selling-plan-group-products.d.ts +6 -0
  238. package/dist/cli/verbs/selling-plan-group-products.js +115 -0
  239. package/dist/cli/verbs/selling-plan-groups.d.ts +6 -0
  240. package/dist/cli/verbs/selling-plan-groups.js +230 -0
  241. package/dist/cli/verbs/server-pixels.d.ts +6 -0
  242. package/dist/cli/verbs/server-pixels.js +172 -0
  243. package/dist/cli/verbs/shipping-packages.d.ts +6 -0
  244. package/dist/cli/verbs/shipping-packages.js +107 -0
  245. package/dist/cli/verbs/shop-policies.d.ts +6 -0
  246. package/dist/cli/verbs/shop-policies.js +91 -0
  247. package/dist/cli/verbs/shop-utils.d.ts +6 -0
  248. package/dist/cli/verbs/shop-utils.js +147 -0
  249. package/dist/cli/verbs/shop.d.ts +6 -0
  250. package/dist/cli/verbs/shop.js +177 -0
  251. package/dist/cli/verbs/shopify-functions.d.ts +6 -0
  252. package/dist/cli/verbs/shopify-functions.js +127 -0
  253. package/dist/cli/verbs/shopify-payments.d.ts +6 -0
  254. package/dist/cli/verbs/shopify-payments.js +111 -0
  255. package/dist/cli/verbs/staff.d.ts +6 -0
  256. package/dist/cli/verbs/staff.js +127 -0
  257. package/dist/cli/verbs/staged-uploads.d.ts +6 -0
  258. package/dist/cli/verbs/staged-uploads.js +128 -0
  259. package/dist/cli/verbs/store-credit.d.ts +6 -0
  260. package/dist/cli/verbs/store-credit.js +209 -0
  261. package/dist/cli/verbs/storefront-access-tokens.d.ts +6 -0
  262. package/dist/cli/verbs/storefront-access-tokens.js +183 -0
  263. package/dist/cli/verbs/subscription-billing-cycles.d.ts +6 -0
  264. package/dist/cli/verbs/subscription-billing-cycles.js +391 -0
  265. package/dist/cli/verbs/subscription-billing.d.ts +6 -0
  266. package/dist/cli/verbs/subscription-billing.js +391 -0
  267. package/dist/cli/verbs/subscription-contracts.d.ts +6 -0
  268. package/dist/cli/verbs/subscription-contracts.js +392 -0
  269. package/dist/cli/verbs/subscription-drafts.d.ts +6 -0
  270. package/dist/cli/verbs/subscription-drafts.js +315 -0
  271. package/dist/cli/verbs/tags.d.ts +6 -0
  272. package/dist/cli/verbs/tags.js +73 -0
  273. package/dist/cli/verbs/tax.d.ts +6 -0
  274. package/dist/cli/verbs/tax.js +114 -0
  275. package/dist/cli/verbs/taxonomy.d.ts +6 -0
  276. package/dist/cli/verbs/taxonomy.js +99 -0
  277. package/dist/cli/verbs/tender-transactions.d.ts +6 -0
  278. package/dist/cli/verbs/tender-transactions.js +105 -0
  279. package/dist/cli/verbs/themes.d.ts +6 -0
  280. package/dist/cli/verbs/themes.js +315 -0
  281. package/dist/cli/verbs/translations.d.ts +6 -0
  282. package/dist/cli/verbs/translations.js +221 -0
  283. package/dist/cli/verbs/types.d.ts +4 -0
  284. package/dist/cli/verbs/types.js +224 -0
  285. package/dist/cli/verbs/url-redirects.d.ts +6 -0
  286. package/dist/cli/verbs/url-redirects.js +465 -0
  287. package/dist/cli/verbs/validations.d.ts +6 -0
  288. package/dist/cli/verbs/validations.js +181 -0
  289. package/dist/cli/verbs/web-pixels.d.ts +6 -0
  290. package/dist/cli/verbs/web-pixels.js +145 -0
  291. package/dist/cli/verbs/web-presences.d.ts +6 -0
  292. package/dist/cli/verbs/web-presences.js +186 -0
  293. package/dist/cli/verbs/webhooks.d.ts +6 -0
  294. package/dist/cli/verbs/webhooks.js +336 -0
  295. package/dist/cli/workflows/files/stagedUploads.d.ts +28 -0
  296. package/dist/cli/workflows/files/stagedUploads.js +227 -0
  297. package/dist/cli/workflows/files/stdinFile.d.ts +7 -0
  298. package/dist/cli/workflows/files/stdinFile.js +65 -0
  299. package/dist/cli/workflows/files/urlDownloads.d.ts +14 -0
  300. package/dist/cli/workflows/files/urlDownloads.js +114 -0
  301. package/dist/cli/workflows/files/waitForReady.d.ts +20 -0
  302. package/dist/cli/workflows/files/waitForReady.js +114 -0
  303. package/dist/cli/workflows/inventory/resolveInventoryItemId.d.ts +6 -0
  304. package/dist/cli/workflows/inventory/resolveInventoryItemId.js +59 -0
  305. package/dist/cli/workflows/productVariants/upsert.d.ts +8 -0
  306. package/dist/cli/workflows/productVariants/upsert.js +110 -0
  307. package/dist/cli/workflows/products/metafieldsUpsert.d.ts +6 -0
  308. package/dist/cli/workflows/products/metafieldsUpsert.js +94 -0
  309. package/dist/cli/workflows/products/publishablePublish.d.ts +21 -0
  310. package/dist/cli/workflows/products/publishablePublish.js +131 -0
  311. package/dist/cli/workflows/publications/resolvePublicationId.d.ts +17 -0
  312. package/dist/cli/workflows/publications/resolvePublicationId.js +93 -0
  313. package/dist/cli.d.ts +1 -0
  314. package/dist/cli.js +238 -0
  315. package/dist/defaults.d.ts +2 -0
  316. package/dist/defaults.js +38 -0
  317. package/dist/generated/admin-2026-04/index.d.ts +25 -0
  318. package/dist/generated/admin-2026-04/index.js +70 -0
  319. package/dist/generated/admin-2026-04/runtime/batcher.d.ts +105 -0
  320. package/dist/generated/admin-2026-04/runtime/batcher.js +203 -0
  321. package/dist/generated/admin-2026-04/runtime/createClient.d.ts +17 -0
  322. package/dist/generated/admin-2026-04/runtime/createClient.js +59 -0
  323. package/dist/generated/admin-2026-04/runtime/error.d.ts +18 -0
  324. package/dist/generated/admin-2026-04/runtime/error.js +44 -0
  325. package/dist/generated/admin-2026-04/runtime/fetcher.d.ts +10 -0
  326. package/dist/generated/admin-2026-04/runtime/fetcher.js +104 -0
  327. package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.d.ts +30 -0
  328. package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.js +191 -0
  329. package/dist/generated/admin-2026-04/runtime/index.d.ts +11 -0
  330. package/dist/generated/admin-2026-04/runtime/index.js +46 -0
  331. package/dist/generated/admin-2026-04/runtime/linkTypeMap.d.ts +9 -0
  332. package/dist/generated/admin-2026-04/runtime/linkTypeMap.js +142 -0
  333. package/dist/generated/admin-2026-04/runtime/typeSelection.d.ts +28 -0
  334. package/dist/generated/admin-2026-04/runtime/typeSelection.js +17 -0
  335. package/dist/generated/admin-2026-04/runtime/types.d.ts +55 -0
  336. package/dist/generated/admin-2026-04/runtime/types.js +17 -0
  337. package/dist/generated/admin-2026-04/schema.d.ts +102240 -0
  338. package/dist/generated/admin-2026-04/schema.graphql +91596 -0
  339. package/dist/generated/admin-2026-04/schema.js +20322 -0
  340. package/dist/generated/admin-2026-04/types.d.ts +24224 -0
  341. package/dist/generated/admin-2026-04/types.js +62299 -0
  342. package/dist/generated/help/schema-help.d.ts +30 -0
  343. package/dist/generated/help/schema-help.js +61833 -0
  344. package/dist/graphqlValidator.d.ts +17 -0
  345. package/dist/graphqlValidator.js +84 -0
  346. package/dist/index.d.ts +1 -0
  347. package/dist/index.js +23 -0
  348. package/package.json +66 -0
  349. package/schema/2026-04.graphql +61256 -0
  350. package/schema/2026-04.introspection.json +1 -0
@@ -0,0 +1,557 @@
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 inventory_exports = {};
20
+ __export(inventory_exports, {
21
+ runInventory: () => runInventory
22
+ });
23
+ module.exports = __toCommonJS(inventory_exports);
24
+ var import_node_crypto = require("node:crypto");
25
+ var import_errors = require("../errors");
26
+ var import_gid = require("../gid");
27
+ var import_router = require("../router");
28
+ var import_userErrors = require("../userErrors");
29
+ var import_resolveInventoryItemId = require("../workflows/inventory/resolveInventoryItemId");
30
+ var import_output = require("../output");
31
+ var import_shared = require("./_shared");
32
+ const inventoryAdjustmentGroupSelection = ({
33
+ inventoryItemId,
34
+ locationIds
35
+ }) => ({
36
+ id: true,
37
+ reason: true,
38
+ createdAt: true,
39
+ referenceDocumentUri: true,
40
+ changes: {
41
+ __args: {
42
+ inventoryItemIds: [inventoryItemId],
43
+ locationIds,
44
+ quantityNames: ["available"]
45
+ },
46
+ name: true,
47
+ delta: true,
48
+ quantityAfterChange: true,
49
+ item: { id: true },
50
+ location: { id: true, name: true }
51
+ }
52
+ });
53
+ const runInventory = async ({
54
+ ctx,
55
+ verb,
56
+ argv
57
+ }) => {
58
+ if (argv.includes("--help") || argv.includes("-h")) {
59
+ console.log(
60
+ [
61
+ "Usage:",
62
+ " shop inventory <verb> [flags]",
63
+ "",
64
+ "Verbs:",
65
+ " list|set|adjust|move",
66
+ " properties|level",
67
+ " activate|deactivate|bulk-toggle-activation",
68
+ " set-on-hand-quantities|set-scheduled-changes|transfer-set-items",
69
+ "",
70
+ "Notes:",
71
+ " - set/adjust support --inventory-item-id or --variant-id",
72
+ " - move requires --from-location-id, --to-location-id, and --reference-document-uri"
73
+ ].join("\n")
74
+ );
75
+ return;
76
+ }
77
+ const parseOptionalInt = (value, flag) => {
78
+ if (value === void 0) return void 0;
79
+ return (0, import_shared.parseIntFlag)(flag, value);
80
+ };
81
+ const requireInventoryLevelId = (value) => {
82
+ if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --inventory-level-id", 2);
83
+ return (0, import_gid.coerceGid)(value, "InventoryLevel");
84
+ };
85
+ const requireInventoryTransferId = (value) => {
86
+ if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --transfer-id", 2);
87
+ return (0, import_gid.coerceGid)(value, "InventoryTransfer");
88
+ };
89
+ const inventoryLevelSelection = {
90
+ id: true,
91
+ updatedAt: true,
92
+ item: { id: true, sku: true, tracked: true },
93
+ location: { id: true, name: true },
94
+ quantities: {
95
+ __args: { names: ["available", "on_hand"] },
96
+ name: true,
97
+ quantity: true,
98
+ updatedAt: true
99
+ }
100
+ };
101
+ if (verb === "properties") {
102
+ const result = await (0, import_router.runQuery)(ctx, {
103
+ inventoryProperties: {
104
+ quantityNames: {
105
+ name: true,
106
+ displayName: true,
107
+ isInUse: true,
108
+ belongsTo: true,
109
+ comprises: true
110
+ }
111
+ }
112
+ });
113
+ if (result === void 0) return;
114
+ (0, import_output.printJson)(result.inventoryProperties, ctx.format !== "raw");
115
+ return;
116
+ }
117
+ if (verb === "level") {
118
+ const args2 = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
119
+ const id = requireInventoryLevelId(args2.id);
120
+ const result = await (0, import_router.runQuery)(ctx, { inventoryLevel: { __args: { id }, ...inventoryLevelSelection } });
121
+ if (result === void 0) return;
122
+ (0, import_output.printNode)({ node: result.inventoryLevel, format: ctx.format, quiet: ctx.quiet });
123
+ return;
124
+ }
125
+ if (verb === "activate") {
126
+ const args2 = (0, import_router.parseStandardArgs)({
127
+ argv,
128
+ extraOptions: {
129
+ "inventory-item-id": { type: "string" },
130
+ "variant-id": { type: "string" },
131
+ "location-id": { type: "string" },
132
+ available: { type: "string" },
133
+ "on-hand": { type: "string" },
134
+ "stock-at-legacy-location": { type: "string" }
135
+ }
136
+ });
137
+ const locationId2 = (0, import_shared.requireLocationId)(args2["location-id"]);
138
+ const inventoryItemId2 = await (0, import_resolveInventoryItemId.resolveInventoryItemId)({
139
+ ctx,
140
+ inventoryItemId: args2["inventory-item-id"],
141
+ variantId: args2["variant-id"]
142
+ });
143
+ const available = parseOptionalInt(args2.available, "--available");
144
+ const onHand = parseOptionalInt(args2["on-hand"], "--on-hand");
145
+ const stockAtLegacyLocation = (() => {
146
+ const raw = args2["stock-at-legacy-location"];
147
+ if (raw === void 0) return void 0;
148
+ const v = raw.trim().toLowerCase();
149
+ if (v === "true" || v === "1" || v === "yes") return true;
150
+ if (v === "false" || v === "0" || v === "no") return false;
151
+ throw new import_errors.CliError("--stock-at-legacy-location must be true|false", 2);
152
+ })();
153
+ const result = await (0, import_router.runMutation)(ctx, {
154
+ inventoryActivate: {
155
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
156
+ __args: {
157
+ inventoryItemId: inventoryItemId2,
158
+ locationId: locationId2,
159
+ ...available === void 0 ? {} : { available },
160
+ ...onHand === void 0 ? {} : { onHand },
161
+ ...stockAtLegacyLocation === void 0 ? {} : { stockAtLegacyLocation }
162
+ },
163
+ inventoryLevel: inventoryLevelSelection,
164
+ userErrors: { field: true, message: true }
165
+ }
166
+ });
167
+ if (result === void 0) return;
168
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.inventoryActivate, failOnUserErrors: ctx.failOnUserErrors });
169
+ if (ctx.quiet) return console.log(result.inventoryActivate?.inventoryLevel?.id ?? "");
170
+ (0, import_output.printJson)(result.inventoryActivate, ctx.format !== "raw");
171
+ return;
172
+ }
173
+ if (verb === "deactivate") {
174
+ const args2 = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "inventory-level-id": { type: "string" } } });
175
+ const inventoryLevelIdRaw = args2["inventory-level-id"];
176
+ if (!inventoryLevelIdRaw) throw new import_errors.CliError("Missing --inventory-level-id", 2);
177
+ const inventoryLevelId = requireInventoryLevelId(inventoryLevelIdRaw);
178
+ const result = await (0, import_router.runMutation)(ctx, {
179
+ inventoryDeactivate: {
180
+ __args: { inventoryLevelId },
181
+ userErrors: { field: true, message: true }
182
+ }
183
+ });
184
+ if (result === void 0) return;
185
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.inventoryDeactivate, failOnUserErrors: ctx.failOnUserErrors });
186
+ if (ctx.quiet || ctx.view === "ids") {
187
+ process.stdout.write(`${inventoryLevelId}
188
+ `);
189
+ return;
190
+ }
191
+ const out = { inventoryLevelId, deactivated: true };
192
+ (0, import_output.printNode)({ node: out, format: ctx.format, quiet: false });
193
+ return;
194
+ }
195
+ if (verb === "bulk-toggle-activation") {
196
+ const args2 = (0, import_router.parseStandardArgs)({
197
+ argv,
198
+ extraOptions: {
199
+ "inventory-item-id": { type: "string" },
200
+ "variant-id": { type: "string" },
201
+ updates: { type: "string" },
202
+ "location-id": { type: "string" },
203
+ activate: { type: "string" }
204
+ }
205
+ });
206
+ const inventoryItemId2 = await (0, import_resolveInventoryItemId.resolveInventoryItemId)({
207
+ ctx,
208
+ inventoryItemId: args2["inventory-item-id"],
209
+ variantId: args2["variant-id"]
210
+ });
211
+ const updatesRaw = args2.updates;
212
+ const parsedUpdates = updatesRaw ? (0, import_shared.parseJsonArg)(updatesRaw, "--updates") : void 0;
213
+ const inventoryItemUpdates = (() => {
214
+ if (Array.isArray(parsedUpdates)) return parsedUpdates;
215
+ const locationIdRaw = args2["location-id"];
216
+ const activateRaw = args2.activate;
217
+ if (locationIdRaw && activateRaw !== void 0) {
218
+ const v = activateRaw.trim().toLowerCase();
219
+ const activate = v === "true" || v === "1" || v === "yes" ? true : v === "false" || v === "0" || v === "no" ? false : (() => {
220
+ throw new import_errors.CliError("--activate must be true|false", 2);
221
+ })();
222
+ return [{ locationId: (0, import_gid.coerceGid)(locationIdRaw, "Location"), activate }];
223
+ }
224
+ throw new import_errors.CliError("Missing --updates or (--location-id and --activate)", 2);
225
+ })();
226
+ const result = await (0, import_router.runMutation)(ctx, {
227
+ inventoryBulkToggleActivation: {
228
+ __args: { inventoryItemId: inventoryItemId2, inventoryItemUpdates },
229
+ inventoryItem: { id: true, sku: true, tracked: true },
230
+ inventoryLevels: { id: true },
231
+ userErrors: { field: true, message: true, code: true }
232
+ }
233
+ });
234
+ if (result === void 0) return;
235
+ (0, import_userErrors.maybeFailOnUserErrors)({ payload: result.inventoryBulkToggleActivation, failOnUserErrors: ctx.failOnUserErrors });
236
+ (0, import_output.printJson)(result.inventoryBulkToggleActivation, ctx.format !== "raw");
237
+ return;
238
+ }
239
+ if (verb === "set-on-hand-quantities") {
240
+ const args2 = (0, import_router.parseStandardArgs)({
241
+ argv,
242
+ extraOptions: {
243
+ "inventory-item-id": { type: "string" },
244
+ "variant-id": { type: "string" },
245
+ "location-id": { type: "string" },
246
+ "on-hand": { type: "string" },
247
+ "set-quantities": { type: "string" },
248
+ reason: { type: "string" },
249
+ "reference-document-uri": { type: "string" }
250
+ }
251
+ });
252
+ const reason2 = args2.reason ?? "correction";
253
+ const referenceDocumentUri2 = args2["reference-document-uri"];
254
+ const setQuantitiesRaw = args2["set-quantities"];
255
+ const parsed = setQuantitiesRaw ? (0, import_shared.parseJsonArg)(setQuantitiesRaw, "--set-quantities") : void 0;
256
+ if (parsed !== void 0 && !Array.isArray(parsed)) {
257
+ throw new import_errors.CliError("--set-quantities must be a JSON array", 2);
258
+ }
259
+ const setQuantities = (() => {
260
+ if (Array.isArray(parsed)) return parsed;
261
+ return void 0;
262
+ })();
263
+ const locationIdRaw = args2["location-id"];
264
+ const onHandRaw = args2["on-hand"];
265
+ const builtSetQuantities = setQuantities ?? (locationIdRaw && onHandRaw !== void 0 ? [
266
+ {
267
+ inventoryItemId: "__RESOLVE__",
268
+ locationId: (0, import_shared.requireLocationId)(locationIdRaw),
269
+ quantity: (0, import_shared.parseIntFlag)("--on-hand", onHandRaw)
270
+ }
271
+ ] : void 0);
272
+ const finalSetQuantities = builtSetQuantities;
273
+ if (!finalSetQuantities) throw new import_errors.CliError("Missing --set-quantities (or --location-id and --on-hand)", 2);
274
+ for (const q of finalSetQuantities) {
275
+ if (q && typeof q === "object" && q.inventoryItemId === "__RESOLVE__") {
276
+ const inventoryItemId2 = await (0, import_resolveInventoryItemId.resolveInventoryItemId)({
277
+ ctx,
278
+ inventoryItemId: args2["inventory-item-id"],
279
+ variantId: args2["variant-id"]
280
+ });
281
+ q.inventoryItemId = inventoryItemId2;
282
+ }
283
+ }
284
+ const result = await (0, import_router.runMutation)(ctx, {
285
+ inventorySetOnHandQuantities: {
286
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
287
+ __args: { input: { reason: reason2, ...referenceDocumentUri2 ? { referenceDocumentUri: referenceDocumentUri2 } : {}, setQuantities: finalSetQuantities } },
288
+ inventoryAdjustmentGroup: { id: true, reason: true, createdAt: true },
289
+ userErrors: { field: true, message: true, code: true }
290
+ }
291
+ });
292
+ if (result === void 0) return;
293
+ (0, import_userErrors.maybeFailOnUserErrors)({
294
+ payload: result.inventorySetOnHandQuantities,
295
+ failOnUserErrors: ctx.failOnUserErrors
296
+ });
297
+ if (ctx.quiet) return console.log(result.inventorySetOnHandQuantities?.inventoryAdjustmentGroup?.id ?? "");
298
+ (0, import_output.printJson)(result.inventorySetOnHandQuantities, ctx.format !== "raw");
299
+ return;
300
+ }
301
+ if (verb === "set-scheduled-changes") {
302
+ const args2 = (0, import_router.parseStandardArgs)({
303
+ argv,
304
+ extraOptions: {
305
+ reason: { type: "string" },
306
+ items: { type: "string" },
307
+ "reference-document-uri": { type: "string" }
308
+ }
309
+ });
310
+ const reason2 = args2.reason ?? "correction";
311
+ const referenceDocumentUriRaw = args2["reference-document-uri"];
312
+ if (referenceDocumentUriRaw === void 0) throw new import_errors.CliError("Missing --reference-document-uri", 2);
313
+ const referenceDocumentUri2 = (0, import_shared.parseTextArg)(referenceDocumentUriRaw, "--reference-document-uri");
314
+ const itemsRaw = args2.items;
315
+ if (itemsRaw === void 0) throw new import_errors.CliError("Missing --items", 2);
316
+ const items = (0, import_shared.parseJsonArg)(itemsRaw, "--items");
317
+ if (!Array.isArray(items)) throw new import_errors.CliError("--items must be a JSON array", 2);
318
+ const result = await (0, import_router.runMutation)(ctx, {
319
+ inventorySetScheduledChanges: {
320
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
321
+ __args: { input: { reason: reason2, items, referenceDocumentUri: referenceDocumentUri2 } },
322
+ scheduledChanges: { expectedAt: true },
323
+ userErrors: { field: true, message: true, code: true }
324
+ }
325
+ });
326
+ if (result === void 0) return;
327
+ (0, import_userErrors.maybeFailOnUserErrors)({
328
+ payload: result.inventorySetScheduledChanges,
329
+ failOnUserErrors: ctx.failOnUserErrors
330
+ });
331
+ (0, import_output.printJson)(result.inventorySetScheduledChanges, ctx.format !== "raw");
332
+ return;
333
+ }
334
+ if (verb === "transfer-set-items") {
335
+ const args2 = (0, import_router.parseStandardArgs)({
336
+ argv,
337
+ extraOptions: {
338
+ "transfer-id": { type: "string" },
339
+ "line-items": { type: "string" }
340
+ }
341
+ });
342
+ const transferIdRaw = args2["transfer-id"];
343
+ if (!transferIdRaw) throw new import_errors.CliError("Missing --transfer-id", 2);
344
+ const transferId = requireInventoryTransferId(transferIdRaw);
345
+ if (args2["line-items"] === void 0) throw new import_errors.CliError("Missing --line-items", 2);
346
+ const lineItems = (0, import_shared.parseJsonArg)(args2["line-items"], "--line-items");
347
+ if (!Array.isArray(lineItems)) throw new import_errors.CliError("--line-items must be a JSON array", 2);
348
+ const result = await (0, import_router.runMutation)(ctx, {
349
+ inventoryTransferSetItems: {
350
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
351
+ __args: { input: { id: transferId, lineItems } },
352
+ inventoryTransfer: { id: true, status: true },
353
+ updatedLineItems: { inventoryItemId: true, deltaQuantity: true, newQuantity: true },
354
+ userErrors: { field: true, message: true, code: true }
355
+ }
356
+ });
357
+ if (result === void 0) return;
358
+ (0, import_userErrors.maybeFailOnUserErrors)({
359
+ payload: result.inventoryTransferSetItems,
360
+ failOnUserErrors: ctx.failOnUserErrors
361
+ });
362
+ if (ctx.quiet) return console.log(result.inventoryTransferSetItems?.inventoryTransfer?.id ?? "");
363
+ (0, import_output.printJson)(result.inventoryTransferSetItems, ctx.format !== "raw");
364
+ return;
365
+ }
366
+ if (verb === "list") {
367
+ const args2 = (0, import_router.parseStandardArgs)({
368
+ argv,
369
+ extraOptions: {
370
+ "location-id": { type: "string" }
371
+ }
372
+ });
373
+ const locationId2 = (0, import_shared.requireLocationId)(args2["location-id"]);
374
+ const first = (0, import_shared.parseFirst)(args2.first);
375
+ const after = args2.after;
376
+ const query = args2.query;
377
+ const result = await (0, import_router.runQuery)(ctx, {
378
+ location: {
379
+ __args: { id: locationId2 },
380
+ id: true,
381
+ name: true,
382
+ inventoryLevels: {
383
+ __args: { first, after, query },
384
+ pageInfo: { hasNextPage: true, endCursor: true },
385
+ nodes: {
386
+ id: true,
387
+ updatedAt: true,
388
+ item: { id: true, sku: true, tracked: true },
389
+ quantities: { __args: { names: ["available"] }, name: true, quantity: true, updatedAt: true }
390
+ }
391
+ }
392
+ }
393
+ });
394
+ if (result === void 0) return;
395
+ const connection = result.location?.inventoryLevels ?? { nodes: [], pageInfo: void 0 };
396
+ (0, import_output.printConnection)({
397
+ connection,
398
+ format: ctx.format,
399
+ quiet: ctx.quiet,
400
+ nextPageArgs: (0, import_shared.buildListNextPageArgs)(
401
+ "inventory",
402
+ { first, query },
403
+ [{ flag: "--location-id", value: locationId2 }]
404
+ )
405
+ });
406
+ return;
407
+ }
408
+ if (verb !== "set" && verb !== "adjust" && verb !== "move") {
409
+ throw new import_errors.CliError(`Unknown verb for inventory: ${verb}`, 2);
410
+ }
411
+ const args = (0, import_router.parseStandardArgs)({
412
+ argv,
413
+ extraOptions: {
414
+ "inventory-item-id": { type: "string" },
415
+ "variant-id": { type: "string" },
416
+ "location-id": { type: "string" },
417
+ "from-location-id": { type: "string" },
418
+ "to-location-id": { type: "string" },
419
+ available: { type: "string" },
420
+ delta: { type: "string" },
421
+ quantity: { type: "string" },
422
+ "quantity-name": { type: "string" },
423
+ reason: { type: "string" },
424
+ "reference-document-uri": { type: "string" }
425
+ }
426
+ });
427
+ const locationId = verb === "move" ? void 0 : (0, import_shared.requireLocationId)(args["location-id"]);
428
+ const inventoryItemId = await (0, import_resolveInventoryItemId.resolveInventoryItemId)({
429
+ ctx,
430
+ inventoryItemId: args["inventory-item-id"],
431
+ variantId: args["variant-id"]
432
+ });
433
+ const reason = args.reason ?? "correction";
434
+ const referenceDocumentUri = args["reference-document-uri"];
435
+ if (verb === "set") {
436
+ const available = (0, import_shared.parseIntFlag)("--available", args.available);
437
+ const result = await (0, import_router.runMutation)(ctx, {
438
+ inventorySetQuantities: {
439
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
440
+ __args: {
441
+ input: {
442
+ name: "available",
443
+ reason,
444
+ ...referenceDocumentUri ? { referenceDocumentUri } : {},
445
+ quantities: [
446
+ {
447
+ inventoryItemId,
448
+ locationId,
449
+ quantity: available,
450
+ changeFromQuantity: null
451
+ }
452
+ ]
453
+ }
454
+ },
455
+ inventoryAdjustmentGroup: inventoryAdjustmentGroupSelection({
456
+ inventoryItemId,
457
+ locationIds: [locationId]
458
+ }),
459
+ userErrors: { field: true, message: true }
460
+ }
461
+ });
462
+ if (result === void 0) return;
463
+ (0, import_userErrors.maybeFailOnUserErrors)({
464
+ payload: result.inventorySetQuantities,
465
+ failOnUserErrors: ctx.failOnUserErrors
466
+ });
467
+ if (ctx.quiet) return console.log(result.inventorySetQuantities?.inventoryAdjustmentGroup?.id ?? "");
468
+ (0, import_output.printJson)(result.inventorySetQuantities);
469
+ return;
470
+ }
471
+ if (verb === "adjust") {
472
+ const delta = (0, import_shared.parseIntFlag)("--delta", args.delta);
473
+ const result = await (0, import_router.runMutation)(ctx, {
474
+ inventoryAdjustQuantities: {
475
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
476
+ __args: {
477
+ input: {
478
+ name: "available",
479
+ reason,
480
+ ...referenceDocumentUri ? { referenceDocumentUri } : {},
481
+ changes: [
482
+ {
483
+ inventoryItemId,
484
+ locationId,
485
+ delta,
486
+ changeFromQuantity: null
487
+ }
488
+ ]
489
+ }
490
+ },
491
+ inventoryAdjustmentGroup: inventoryAdjustmentGroupSelection({
492
+ inventoryItemId,
493
+ locationIds: [locationId]
494
+ }),
495
+ userErrors: { field: true, message: true }
496
+ }
497
+ });
498
+ if (result === void 0) return;
499
+ (0, import_userErrors.maybeFailOnUserErrors)({
500
+ payload: result.inventoryAdjustQuantities,
501
+ failOnUserErrors: ctx.failOnUserErrors
502
+ });
503
+ if (ctx.quiet) return console.log(result.inventoryAdjustQuantities?.inventoryAdjustmentGroup?.id ?? "");
504
+ (0, import_output.printJson)(result.inventoryAdjustQuantities);
505
+ return;
506
+ }
507
+ if (verb === "move") {
508
+ const fromLocationIdRaw = args["from-location-id"];
509
+ const toLocationIdRaw = args["to-location-id"];
510
+ if (!fromLocationIdRaw) throw new import_errors.CliError("Missing --from-location-id", 2);
511
+ if (!toLocationIdRaw) throw new import_errors.CliError("Missing --to-location-id", 2);
512
+ const fromLocationId = (0, import_shared.requireLocationId)(fromLocationIdRaw, "--from-location-id");
513
+ const toLocationId = (0, import_shared.requireLocationId)(toLocationIdRaw, "--to-location-id");
514
+ const quantity = (0, import_shared.parseIntFlag)("--quantity", args.quantity);
515
+ const quantityName = args["quantity-name"] ?? "available";
516
+ if (!referenceDocumentUri) {
517
+ throw new import_errors.CliError("Missing --reference-document-uri (required for inventory move)", 2);
518
+ }
519
+ const result = await (0, import_router.runMutation)(ctx, {
520
+ inventoryMoveQuantities: {
521
+ __directives: { idempotent: { key: (0, import_node_crypto.randomUUID)() } },
522
+ __args: {
523
+ input: {
524
+ reason,
525
+ referenceDocumentUri,
526
+ changes: [
527
+ {
528
+ inventoryItemId,
529
+ quantity,
530
+ from: { locationId: fromLocationId, name: quantityName, changeFromQuantity: null },
531
+ to: { locationId: toLocationId, name: quantityName, changeFromQuantity: null }
532
+ }
533
+ ]
534
+ }
535
+ },
536
+ inventoryAdjustmentGroup: inventoryAdjustmentGroupSelection({
537
+ inventoryItemId,
538
+ locationIds: [fromLocationId, toLocationId]
539
+ }),
540
+ userErrors: { field: true, message: true, code: true }
541
+ }
542
+ });
543
+ if (result === void 0) return;
544
+ (0, import_userErrors.maybeFailOnUserErrors)({
545
+ payload: result.inventoryMoveQuantities,
546
+ failOnUserErrors: ctx.failOnUserErrors
547
+ });
548
+ if (ctx.quiet) return console.log(result.inventoryMoveQuantities?.inventoryAdjustmentGroup?.id ?? "");
549
+ (0, import_output.printJson)(result.inventoryMoveQuantities);
550
+ return;
551
+ }
552
+ };
553
+ // Annotate the CommonJS export names for ESM import in node:
554
+ 0 && (module.exports = {
555
+ runInventory
556
+ });
557
+ //# sourceMappingURL=inventory.js.map
@@ -0,0 +1,6 @@
1
+ import { type CommandContext } from '../router';
2
+ export declare const runLocales: ({ ctx, verb, argv, }: {
3
+ ctx: CommandContext;
4
+ verb: string;
5
+ argv: string[];
6
+ }) => Promise<void>;
@@ -0,0 +1,61 @@
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 locales_exports = {};
20
+ __export(locales_exports, {
21
+ runLocales: () => runLocales
22
+ });
23
+ module.exports = __toCommonJS(locales_exports);
24
+ var import_errors = require("../errors");
25
+ var import_output = require("../output");
26
+ var import_router = require("../router");
27
+ const localeSelection = {
28
+ isoCode: true,
29
+ name: true
30
+ };
31
+ const runLocales = async ({
32
+ ctx,
33
+ verb,
34
+ argv
35
+ }) => {
36
+ if (argv.includes("--help") || argv.includes("-h")) {
37
+ console.log(
38
+ [
39
+ "Usage:",
40
+ " shop locales <verb> [flags]",
41
+ "",
42
+ "Verbs:",
43
+ " available"
44
+ ].join("\n")
45
+ );
46
+ return;
47
+ }
48
+ if (verb === "available") {
49
+ const result = await (0, import_router.runQuery)(ctx, { availableLocales: localeSelection });
50
+ if (result === void 0) return;
51
+ if (ctx.quiet) return;
52
+ (0, import_output.printJson)(result.availableLocales, ctx.format !== "raw");
53
+ return;
54
+ }
55
+ throw new import_errors.CliError(`Unknown verb for locales: ${verb}`, 2);
56
+ };
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ runLocales
60
+ });
61
+ //# sourceMappingURL=locales.js.map
@@ -0,0 +1,6 @@
1
+ import { type CommandContext } from '../router';
2
+ export declare const runLocations: ({ ctx, verb, argv, }: {
3
+ ctx: CommandContext;
4
+ verb: string;
5
+ argv: string[];
6
+ }) => Promise<void>;