@shopify/cli 0.0.0-snapshot-20260722210655 → 0.0.0-snapshot-20260723175937

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 (293) hide show
  1. package/dist/analytics-7C5M2VCO.js +1 -0
  2. package/dist/analytics-ISEOSBXQ.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-ROBYXQMW.js → chunk-25TGONTZ.js} +1 -1
  5. package/dist/{chunk-Q37I33P7.js → chunk-26NH7QQF.js} +1 -1
  6. package/dist/chunk-27IBAKXK.js +1 -0
  7. package/dist/{chunk-GAUJKBLY.js → chunk-2ABJYYVF.js} +1 -1
  8. package/dist/{chunk-6SVMZEJO.js → chunk-2AIX3ZEA.js} +1 -1
  9. package/dist/{chunk-SUOXR2CE.js → chunk-2KAM4SR5.js} +1 -1
  10. package/dist/{chunk-GWUDVP3Q.js → chunk-2S5KE5HI.js} +1 -1
  11. package/dist/{chunk-L6VQZJM4.js → chunk-2XNXIQPJ.js} +1 -1
  12. package/dist/{chunk-VSPM4VES.js → chunk-2ZSXGYTT.js} +1 -1
  13. package/dist/{chunk-PNCF5LNZ.js → chunk-37B4MKUV.js} +1 -1
  14. package/dist/{chunk-VFU5YYTM.js → chunk-3CZCBBO2.js} +1 -1
  15. package/dist/{chunk-SACH2YSZ.js → chunk-3EL4GA72.js} +1 -1
  16. package/dist/{chunk-POYWH3PD.js → chunk-3F46XSP6.js} +1 -1
  17. package/dist/{chunk-X2NVFYY6.js → chunk-3FANSGNX.js} +1 -1
  18. package/dist/{chunk-2OBG4WT7.js → chunk-3FJMXGVN.js} +1 -1
  19. package/dist/{chunk-OYOTLGGD.js → chunk-3HEORIF3.js} +1 -1
  20. package/dist/{chunk-HXJ7HJFS.js → chunk-3LDCOBRM.js} +1 -1
  21. package/dist/{chunk-SW3DP3GU.js → chunk-3MV5A5HR.js} +1 -1
  22. package/dist/{chunk-3R45SEUK.js → chunk-3OKGR33F.js} +1 -1
  23. package/dist/{chunk-JNAAHGJ6.js → chunk-3PFKQSWK.js} +1 -1
  24. package/dist/{chunk-PNYIQOOE.js → chunk-3UFQ664V.js} +1 -1
  25. package/dist/{chunk-AK4NPOQG.js → chunk-3UYW3ZAG.js} +1 -1
  26. package/dist/{chunk-3PFIBTES.js → chunk-3XHYGKBZ.js} +3 -3
  27. package/dist/{chunk-SY3LXLT2.js → chunk-4D7XW3LW.js} +1 -1
  28. package/dist/{chunk-34CCAMTT.js → chunk-4DEWRMWM.js} +1 -1
  29. package/dist/{chunk-P5KLFBCI.js → chunk-4KXJD6WW.js} +1 -1
  30. package/dist/{chunk-GVHVEYNG.js → chunk-4LK74JVJ.js} +1 -1
  31. package/dist/{chunk-LANGOUPS.js → chunk-4MERFNHB.js} +2 -2
  32. package/dist/{chunk-2RLFO4KD.js → chunk-5HTTO4O6.js} +1 -1
  33. package/dist/{chunk-NIQWXTKA.js → chunk-5UTJOHAV.js} +1 -1
  34. package/dist/{chunk-MH6UDGGS.js → chunk-5X6JR7QJ.js} +1 -1
  35. package/dist/{chunk-65H3LZJA.js → chunk-62G4E3FF.js} +1 -1
  36. package/dist/{chunk-IDRP7BXW.js → chunk-63G2KGOU.js} +1 -1
  37. package/dist/{chunk-AMLHR2HO.js → chunk-65VUWLXE.js} +1 -1
  38. package/dist/{chunk-5RMFBXP6.js → chunk-6MDI7364.js} +1 -1
  39. package/dist/{chunk-EIEHPIWJ.js → chunk-6SZRXJX2.js} +1 -1
  40. package/dist/{chunk-HJH672U6.js → chunk-72YGVGPS.js} +1 -1
  41. package/dist/{chunk-SP7NSQ6G.js → chunk-7CF2LWEW.js} +1 -1
  42. package/dist/{chunk-ZDKGQCIZ.js → chunk-7ER6T55S.js} +1 -1
  43. package/dist/{chunk-3RUWUOIR.js → chunk-7LOSGGE6.js} +1 -1
  44. package/dist/{chunk-XEHMXJ5J.js → chunk-AB7462EM.js} +1 -1
  45. package/dist/chunk-AS7WHEG6.js +1 -0
  46. package/dist/{chunk-LX3NHWCT.js → chunk-AZK63TEX.js} +1 -1
  47. package/dist/{chunk-4NSHAMD3.js → chunk-BGTOVY2S.js} +1 -1
  48. package/dist/{chunk-EI6ZQXTF.js → chunk-BXQV7N7H.js} +1 -1
  49. package/dist/{chunk-3GPUBV4D.js → chunk-BYW2F2BY.js} +1 -1
  50. package/dist/{chunk-V4CPWXJP.js → chunk-C3AC5FQS.js} +1 -1
  51. package/dist/{chunk-WKJNCJUV.js → chunk-C7BPIZLV.js} +1 -1
  52. package/dist/{chunk-OQ6WYWG4.js → chunk-CG22VLHL.js} +1 -1
  53. package/dist/{chunk-MTGARKCQ.js → chunk-CTYRVUJF.js} +1 -1
  54. package/dist/{chunk-33AVVFWW.js → chunk-CXYYVAYY.js} +1 -1
  55. package/dist/{chunk-H3QSHKNT.js → chunk-CY227SF6.js} +1 -1
  56. package/dist/{chunk-OPHCAOPB.js → chunk-DBH75XMC.js} +1 -1
  57. package/dist/{chunk-2CMSXRZ5.js → chunk-DDQPQB5D.js} +1 -1
  58. package/dist/{chunk-Q3DRVTVJ.js → chunk-DFSWF4VW.js} +1 -1
  59. package/dist/{chunk-2FNJZPYC.js → chunk-DYFP3SBA.js} +2 -2
  60. package/dist/{chunk-3XBPV64S.js → chunk-EFRJEZBJ.js} +1 -1
  61. package/dist/{chunk-M3FOYFPN.js → chunk-EIFAHNSO.js} +1 -1
  62. package/dist/{chunk-CNOGRHAB.js → chunk-EO3BLRBC.js} +1 -1
  63. package/dist/{chunk-SQVJGTTD.js → chunk-EOGQ7TJP.js} +2 -2
  64. package/dist/{chunk-XGJH3HBA.js → chunk-F46ZV3EJ.js} +1 -1
  65. package/dist/{chunk-E7Z7KYBR.js → chunk-F5LI3LKB.js} +1 -1
  66. package/dist/{chunk-ALKT4HX7.js → chunk-FD55RBY6.js} +1 -1
  67. package/dist/{chunk-IV3S4JU6.js → chunk-FDAURSWQ.js} +1 -1
  68. package/dist/chunk-FDYZZLAY.js +1 -0
  69. package/dist/{chunk-J5D222UG.js → chunk-FY7D7Z24.js} +1 -1
  70. package/dist/{chunk-5EDRU7YU.js → chunk-GHVEHA7R.js} +1 -1
  71. package/dist/{chunk-UMMEUYHM.js → chunk-GLBVUEXK.js} +1 -1
  72. package/dist/{chunk-LZO2JTZS.js → chunk-GQFZ3NV5.js} +1 -1
  73. package/dist/{chunk-DC3JYNAG.js → chunk-GZ4OU46N.js} +1 -1
  74. package/dist/{chunk-IDMJWVJC.js → chunk-H5BHHSWX.js} +1 -1
  75. package/dist/{chunk-22YTDD56.js → chunk-HIT7MKA6.js} +1 -1
  76. package/dist/{chunk-BPRY3O4N.js → chunk-HXPUMDUV.js} +1 -1
  77. package/dist/{chunk-IP2ZMDG4.js → chunk-I3RM47TC.js} +1 -1
  78. package/dist/{chunk-32KQUYFF.js → chunk-I6RAL5QK.js} +1 -1
  79. package/dist/{chunk-BKMZCB6M.js → chunk-I6UFC3HR.js} +1 -1
  80. package/dist/{chunk-IZCDEDIM.js → chunk-IF7RP3M3.js} +1 -1
  81. package/dist/{chunk-P4LA3M5S.js → chunk-IKLOCQ2C.js} +1 -1
  82. package/dist/{chunk-B3XKHB4G.js → chunk-INZZF4R2.js} +1 -1
  83. package/dist/{chunk-3GQ6AVHU.js → chunk-IUIDJ2PO.js} +1 -1
  84. package/dist/{chunk-MXATGPGZ.js → chunk-JMGXQSF3.js} +1 -1
  85. package/dist/{chunk-5N6YKJLU.js → chunk-JOKF7TQS.js} +1 -1
  86. package/dist/{chunk-HPH7WWMW.js → chunk-JWAFPHPO.js} +1 -1
  87. package/dist/{chunk-O6BUPYXH.js → chunk-K44YPOUY.js} +2 -2
  88. package/dist/{chunk-ZZ5M5IMF.js → chunk-K4Y7L7JO.js} +1 -1
  89. package/dist/{chunk-4GWHZ4RW.js → chunk-K7N3O5JJ.js} +1 -1
  90. package/dist/{chunk-6NRRHHK5.js → chunk-KLRRNM7H.js} +1 -1
  91. package/dist/{chunk-YKAMTVJM.js → chunk-KZHXG3OR.js} +1 -1
  92. package/dist/{chunk-J2JMKTPR.js → chunk-L2DBLX4V.js} +1 -1
  93. package/dist/{chunk-NDVET7BL.js → chunk-LBEAJPA3.js} +1 -1
  94. package/dist/{chunk-UA2432YR.js → chunk-LEMDZHSP.js} +1 -1
  95. package/dist/{chunk-UZR7JB5B.js → chunk-LMOWRJJP.js} +1 -1
  96. package/dist/{chunk-O5FUKS5D.js → chunk-LNE7HDII.js} +1 -1
  97. package/dist/{chunk-W6BBFBOM.js → chunk-LSNGFAPG.js} +1 -1
  98. package/dist/{chunk-IKP2EM5F.js → chunk-M2F2HMDM.js} +1 -1
  99. package/dist/{chunk-WFCP2AG5.js → chunk-M5NVKW2D.js} +1 -1
  100. package/dist/{chunk-SXWAECCX.js → chunk-MK2K6PO4.js} +1 -1
  101. package/dist/{chunk-A35F74KC.js → chunk-N5MWZQUH.js} +1 -1
  102. package/dist/{chunk-SNK55FY2.js → chunk-N5VSGERX.js} +1 -1
  103. package/dist/{chunk-35Z5TIZM.js → chunk-O7LFTI43.js} +1 -1
  104. package/dist/{chunk-H2Z3SST2.js → chunk-OJVEC76K.js} +1 -1
  105. package/dist/{chunk-O7HL63YP.js → chunk-OK7WTQON.js} +1 -1
  106. package/dist/{chunk-CFZVZFVH.js → chunk-P7YRGKJH.js} +1 -1
  107. package/dist/{chunk-L6C3DLKN.js → chunk-PFVF5CZ4.js} +1 -1
  108. package/dist/{chunk-X5GZF33W.js → chunk-PJWEE7VH.js} +1 -1
  109. package/dist/{chunk-FS37ZPWQ.js → chunk-PR7JET4Q.js} +1 -1
  110. package/dist/{chunk-ISVXQQ4E.js → chunk-Q2QCCK7J.js} +1 -1
  111. package/dist/{chunk-CFXL555E.js → chunk-QBL3VWF4.js} +1 -1
  112. package/dist/{chunk-R56CBH7G.js → chunk-QG4SGGWR.js} +1 -1
  113. package/dist/{chunk-74DZVIJF.js → chunk-QRUQJQYE.js} +1 -1
  114. package/dist/{chunk-FDQNY7RF.js → chunk-R3GD62F4.js} +1 -1
  115. package/dist/{chunk-MSDNBGRH.js → chunk-RQLOFISE.js} +1 -1
  116. package/dist/{chunk-HFGB7XAM.js → chunk-RUMPZWDB.js} +1 -1
  117. package/dist/{chunk-PPHJ4F2Z.js → chunk-S3SPKCJD.js} +1 -1
  118. package/dist/{chunk-5VKFEYZK.js → chunk-S6JGBSUV.js} +1 -1
  119. package/dist/{chunk-CT5MMCRM.js → chunk-SEIBJIHL.js} +1 -1
  120. package/dist/{chunk-5Y33JTFD.js → chunk-SK4IRFCK.js} +1 -1
  121. package/dist/{chunk-HG5QVQ2T.js → chunk-SLDQ5BC7.js} +1 -1
  122. package/dist/{chunk-VURVVLVE.js → chunk-SLQHQJIR.js} +1 -1
  123. package/dist/{chunk-RUV5AE3N.js → chunk-ST2DGIWE.js} +1 -1
  124. package/dist/{chunk-BQ2752RO.js → chunk-TGIRO2TB.js} +1 -1
  125. package/dist/{chunk-X4JRQETX.js → chunk-TYR2AZ2U.js} +1 -1
  126. package/dist/{chunk-VBL7DLY7.js → chunk-TZ7FKRXB.js} +1 -1
  127. package/dist/{chunk-6CZ7WGE2.js → chunk-UJ4VQGXU.js} +1 -1
  128. package/dist/{chunk-JBIXZWT6.js → chunk-V3IMCEL6.js} +1 -1
  129. package/dist/{chunk-XYV4QXQT.js → chunk-VCXCFKA6.js} +1 -1
  130. package/dist/{chunk-5HGRHX2Z.js → chunk-VGJ3QPC2.js} +1 -1
  131. package/dist/{chunk-FS4HIL62.js → chunk-VJXKYDM6.js} +1 -1
  132. package/dist/{chunk-ZKNONN2F.js → chunk-VMPA4DZ3.js} +1 -1
  133. package/dist/{chunk-I7QJGHS6.js → chunk-W25DPKDC.js} +1 -1
  134. package/dist/{chunk-YZQYDTO7.js → chunk-W2W2F55C.js} +1 -1
  135. package/dist/{chunk-FVQG4KLI.js → chunk-W57R5X75.js} +1 -1
  136. package/dist/{chunk-FW732EHN.js → chunk-W6MEUK2V.js} +1 -1
  137. package/dist/{chunk-HS7TCC4I.js → chunk-WAH2LVVU.js} +1 -1
  138. package/dist/{chunk-NUCUZBO3.js → chunk-WQDFO5DZ.js} +1 -1
  139. package/dist/{chunk-VQ44LFBY.js → chunk-WQLVBL6G.js} +1 -1
  140. package/dist/{chunk-3I6ZVKZ2.js → chunk-WUSJP6KG.js} +1 -1
  141. package/dist/{chunk-XBFXB6S6.js → chunk-X6YKSZTY.js} +1 -1
  142. package/dist/{chunk-W6KRZTDH.js → chunk-X7EK6UZQ.js} +1 -1
  143. package/dist/{chunk-OLQN2OBC.js → chunk-XALIRIZF.js} +1 -1
  144. package/dist/{chunk-W2RZY64W.js → chunk-XCTHPL4E.js} +1 -1
  145. package/dist/{chunk-FFC42T6R.js → chunk-XGCOJ7UT.js} +1 -1
  146. package/dist/{chunk-SH5VEQ7F.js → chunk-XJMML6SY.js} +1 -1
  147. package/dist/{chunk-AROEKWUX.js → chunk-XQBHDUNJ.js} +1 -1
  148. package/dist/{chunk-KHOW6SXW.js → chunk-XR6V742E.js} +1 -1
  149. package/dist/{chunk-OM3YN7ZK.js → chunk-YDUVKJIB.js} +1 -1
  150. package/dist/{chunk-ONCEFPYP.js → chunk-YIZV3FZO.js} +1 -1
  151. package/dist/{chunk-KNLPWHHJ.js → chunk-YKQLGBJM.js} +2 -2
  152. package/dist/{chunk-FOQ2RDEI.js → chunk-YLA2NKA6.js} +1 -1
  153. package/dist/{chunk-XKMLKEYX.js → chunk-YNFZXXCS.js} +1 -1
  154. package/dist/{chunk-IPKYIHDV.js → chunk-YNVN765Y.js} +1 -1
  155. package/dist/{chunk-N54QOQ2V.js → chunk-YPHEUPMZ.js} +1 -1
  156. package/dist/{chunk-QAMPDFZB.js → chunk-YTINYHIV.js} +1 -1
  157. package/dist/{chunk-WYT437LJ.js → chunk-Z4E54GTK.js} +1 -1
  158. package/dist/{chunk-EL5U7452.js → chunk-Z4HK5PYZ.js} +1 -1
  159. package/dist/{chunk-N2UVYELM.js → chunk-ZA2P2XLH.js} +1 -1
  160. package/dist/{chunk-2VVXGQ36.js → chunk-ZEVWQAWR.js} +1 -1
  161. package/dist/{chunk-GJGKVHUR.js → chunk-ZMEDSOFC.js} +1 -1
  162. package/dist/{chunk-ZKIIMXKC.js → chunk-ZXXEEQKW.js} +1 -1
  163. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  164. package/dist/cli/commands/app/build.js +1 -1
  165. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  166. package/dist/cli/commands/app/bulk/execute.js +1 -1
  167. package/dist/cli/commands/app/bulk/status.js +1 -1
  168. package/dist/cli/commands/app/config/link.js +1 -1
  169. package/dist/cli/commands/app/config/pull.js +1 -1
  170. package/dist/cli/commands/app/config/use.js +1 -1
  171. package/dist/cli/commands/app/config/validate.js +1 -1
  172. package/dist/cli/commands/app/demo/watcher.js +1 -1
  173. package/dist/cli/commands/app/deploy.js +1 -1
  174. package/dist/cli/commands/app/dev/clean.js +1 -1
  175. package/dist/cli/commands/app/dev.js +1 -1
  176. package/dist/cli/commands/app/env/pull.js +1 -1
  177. package/dist/cli/commands/app/env/show.js +1 -1
  178. package/dist/cli/commands/app/execute.js +1 -1
  179. package/dist/cli/commands/app/function/build.js +1 -1
  180. package/dist/cli/commands/app/function/info.js +1 -1
  181. package/dist/cli/commands/app/function/replay.js +1 -1
  182. package/dist/cli/commands/app/function/run.js +1 -1
  183. package/dist/cli/commands/app/function/schema.js +1 -1
  184. package/dist/cli/commands/app/function/typegen.js +1 -1
  185. package/dist/cli/commands/app/generate/extension.js +1 -1
  186. package/dist/cli/commands/app/graphiql.js +1 -1
  187. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  188. package/dist/cli/commands/app/import-extensions.js +1 -1
  189. package/dist/cli/commands/app/info.js +1 -1
  190. package/dist/cli/commands/app/init.js +1 -1
  191. package/dist/cli/commands/app/logs.js +1 -1
  192. package/dist/cli/commands/app/release.js +1 -1
  193. package/dist/cli/commands/app/versions/list.js +1 -1
  194. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  195. package/dist/cli/commands/auth/login.js +1 -1
  196. package/dist/cli/commands/auth/logout.js +1 -1
  197. package/dist/cli/commands/cache/clear.js +1 -1
  198. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  199. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  200. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  201. package/dist/cli/commands/debug/command-flags.js +1 -1
  202. package/dist/cli/commands/doc/fetch.js +1 -1
  203. package/dist/cli/commands/doc/search.js +1 -1
  204. package/dist/cli/commands/docs/generate.js +1 -1
  205. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  206. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  207. package/dist/cli/commands/help.js +1 -1
  208. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  209. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  210. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  211. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  212. package/dist/cli/commands/notifications/generate.js +1 -1
  213. package/dist/cli/commands/notifications/list.js +1 -1
  214. package/dist/cli/commands/organization/list.js +1 -1
  215. package/dist/cli/commands/search.js +1 -1
  216. package/dist/cli/commands/theme/check.js +1 -1
  217. package/dist/cli/commands/theme/console.js +1 -1
  218. package/dist/cli/commands/theme/delete.js +1 -1
  219. package/dist/cli/commands/theme/dev.js +1 -1
  220. package/dist/cli/commands/theme/duplicate.js +1 -1
  221. package/dist/cli/commands/theme/info.js +1 -1
  222. package/dist/cli/commands/theme/init.js +1 -1
  223. package/dist/cli/commands/theme/language-server.js +1 -1
  224. package/dist/cli/commands/theme/list.js +1 -1
  225. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  226. package/dist/cli/commands/theme/open.js +1 -1
  227. package/dist/cli/commands/theme/package.js +1 -1
  228. package/dist/cli/commands/theme/preview.js +1 -1
  229. package/dist/cli/commands/theme/profile.js +1 -1
  230. package/dist/cli/commands/theme/publish.js +1 -1
  231. package/dist/cli/commands/theme/pull.js +1 -1
  232. package/dist/cli/commands/theme/push.js +1 -1
  233. package/dist/cli/commands/theme/rename.js +1 -1
  234. package/dist/cli/commands/theme/share.js +1 -1
  235. package/dist/cli/commands/upgrade.js +1 -1
  236. package/dist/cli/commands/validate/components.js +1 -1
  237. package/dist/cli/commands/validate/functions.js +1 -1
  238. package/dist/cli/commands/validate/graphql.js +1 -1
  239. package/dist/cli/commands/validate/theme.js +1 -1
  240. package/dist/cli/commands/version.js +1 -1
  241. package/dist/command-registry.js +1 -1
  242. package/dist/conf-store-UXALA7ZH.js +1 -0
  243. package/dist/{deprecations-SA4HEVBI.js → deprecations-Z2AKXOSN.js} +1 -1
  244. package/dist/dist-AB723W2X.js +1 -0
  245. package/dist/dist-MI22B6JV.js +1 -0
  246. package/dist/{environments-LDSGQHXC.js → environments-2J6IO6NS.js} +1 -1
  247. package/dist/{error-YY774ESQ.js → error-C7LRAXPN.js} +1 -1
  248. package/dist/error-handler-AG5VMYWI.js +1 -0
  249. package/dist/{fs-EIM4AORY.js → fs-L2VBGU3E.js} +1 -1
  250. package/dist/hooks/app-init.js +1 -1
  251. package/dist/hooks/did-you-mean.js +1 -1
  252. package/dist/hooks/hydrogen-init.js +1 -1
  253. package/dist/hooks/postrun.js +1 -1
  254. package/dist/hooks/prerun.js +1 -1
  255. package/dist/hooks/public-metadata.js +1 -1
  256. package/dist/hooks/sensitive-metadata.js +1 -1
  257. package/dist/hooks/tunnel-provider.js +1 -1
  258. package/dist/hooks/tunnel-start.js +1 -1
  259. package/dist/index.js +15 -15
  260. package/dist/{is-global-USYUXR55.js → is-global-ZB4Z53E4.js} +1 -1
  261. package/dist/{local-INRMOHAI.js → local-MZAF2JS4.js} +1 -1
  262. package/dist/{local-storage-7THURD3W.js → local-storage-LFCMTFLG.js} +1 -1
  263. package/dist/{metadata-WJ637XA2.js → metadata-IFRL6WLE.js} +1 -1
  264. package/dist/{node-package-manager-4X2YQGFC.js → node-package-manager-MNMMTKSE.js} +1 -1
  265. package/dist/notifications-system-WTOJOHUT.js +1 -0
  266. package/dist/{output-CLCX5WU7.js → output-CRFKNJOK.js} +1 -1
  267. package/dist/{prettier-VLTY4MIE.js → prettier-NOE3TJJ5.js} +1 -1
  268. package/dist/{system-J4OPHQAQ.js → system-2WLFWPW2.js} +1 -1
  269. package/dist/tsconfig.tsbuildinfo +1 -1
  270. package/dist/{ui-ZC5QZT4J.js → ui-ATGLY4UO.js} +1 -1
  271. package/dist/upgrade-NYAZSXEQ.js +1 -0
  272. package/dist/{version-EYLYG4JK.js → version-OFO7OKSR.js} +1 -1
  273. package/dist/version-Q4RRYUAM.js +1 -0
  274. package/dist/{workerd-VC3MCYDV.js → workerd-FIJ77CM7.js} +1 -1
  275. package/oclif.manifest.json +1 -30
  276. package/package.json +7 -10
  277. package/dist/analytics-JBPJLL57.js +0 -1
  278. package/dist/analytics-QVTQTZFT.js +0 -1
  279. package/dist/chunk-G3CPHVML.js +0 -1
  280. package/dist/chunk-RXO77IC5.js +0 -1
  281. package/dist/chunk-WMKVFUMY.js +0 -1
  282. package/dist/chunk-X2ZCC772.js +0 -1
  283. package/dist/cli/commands/skill/install.d.ts +0 -13
  284. package/dist/cli/commands/skill/install.js +0 -1
  285. package/dist/conf-store-OHJSRXSL.js +0 -1
  286. package/dist/dist-MIUGJGUW.js +0 -1
  287. package/dist/dist-XVWDWM2Y.js +0 -1
  288. package/dist/error-handler-QHCOZUC7.js +0 -1
  289. package/dist/notifications-system-ZSZWUJIZ.js +0 -1
  290. package/dist/skills-OXV2TD42.js +0 -1
  291. package/dist/upgrade-VSILBOCY.js +0 -1
  292. package/dist/version-FEVNX3F6.js +0 -1
  293. /package/dist/{chunk-2S3FHQFS.js → chunk-HVECVOIO.js} +0 -0
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import{a as Be}from"./chunk-ZU5FTJVN.js";import{a as He,b as tr}from"./chunk-2FNJZPYC.js";import"./chunk-XWPPBOGF.js";import"./chunk-2VVXGQ36.js";import"./chunk-R3WCJACL.js";import{a as Pr}from"./chunk-LX3NHWCT.js";import{a as cr}from"./chunk-J5D222UG.js";import{a as qr}from"./chunk-2RLFO4KD.js";import{a as Rr}from"./chunk-W6KRZTDH.js";import{a as Tr}from"./chunk-AROEKWUX.js";import{a as _r}from"./chunk-IKP2EM5F.js";import{a as M,b as St,c as Ir}from"./chunk-W2RZY64W.js";import{a as lr}from"./chunk-5N6YKJLU.js";import{a as pr}from"./chunk-FVQG4KLI.js";import{a as Nr}from"./chunk-Q3DRVTVJ.js";import{a as Or}from"./chunk-GJGKVHUR.js";import{a as kr}from"./chunk-74DZVIJF.js";import{a as Lr}from"./chunk-VFU5YYTM.js";import{a as wr}from"./chunk-32KQUYFF.js";import{a as vr}from"./chunk-CFXL555E.js";import"./chunk-EI6ZQXTF.js";import{a as br}from"./chunk-FOQ2RDEI.js";import{a as Ar}from"./chunk-OPHCAOPB.js";import"./chunk-BQ2752RO.js";import{a as xr}from"./chunk-SNK55FY2.js";import{a as Zo,b as er,c as yr}from"./chunk-MXATGPGZ.js";import{a as sr}from"./chunk-RUV5AE3N.js";import{a as Er}from"./chunk-NIQWXTKA.js";import{a as ur}from"./chunk-KHOW6SXW.js";import"./chunk-22YTDD56.js";import{a as ze,b as mr}from"./chunk-WYT437LJ.js";import"./chunk-UOHNRH6E.js";import"./chunk-PPHJ4F2Z.js";import"./chunk-5RMFBXP6.js";import{a as Ii}from"./chunk-A35F74KC.js";import"./chunk-CFZVZFVH.js";import"./chunk-FFC42T6R.js";import"./chunk-L6VQZJM4.js";import{a as Ei}from"./chunk-SACH2YSZ.js";import"./chunk-N2UVYELM.js";import"./chunk-B3XKHB4G.js";import"./chunk-MSDNBGRH.js";import"./chunk-AMLHR2HO.js";import"./chunk-EIEHPIWJ.js";import"./chunk-VBL7DLY7.js";import"./chunk-X5GZF33W.js";import"./chunk-QAMPDFZB.js";import"./chunk-LZO2JTZS.js";import"./chunk-H2Z3SST2.js";import"./chunk-PNYIQOOE.js";import"./chunk-JBIXZWT6.js";import"./chunk-WKJNCJUV.js";import"./chunk-3GQ6AVHU.js";import"./chunk-5Y33JTFD.js";import"./chunk-J3JPJCWP.js";import"./chunk-V4CPWXJP.js";import"./chunk-GVHVEYNG.js";import"./chunk-KRZABRYT.js";import"./chunk-3XBPV64S.js";import"./chunk-HS7TCC4I.js";import"./chunk-ONCEFPYP.js";import"./chunk-GAUJKBLY.js";import"./chunk-UZR7JB5B.js";import"./chunk-65H3LZJA.js";import"./chunk-STJ3LWFL.js";import"./chunk-XEHMXJ5J.js";import{b as _i}from"./chunk-L6C3DLKN.js";import"./chunk-OYOTLGGD.js";import"./chunk-VQ44LFBY.js";import{a as q,b as Ro,c as te,d as ge,e as Ue}from"./chunk-5VKFEYZK.js";import"./chunk-R56CBH7G.js";import"./chunk-ROBYXQMW.js";import"./chunk-VE35YELD.js";import"./chunk-PNCF5LNZ.js";import"./chunk-TU47HMTL.js";import"./chunk-NUCUZBO3.js";import"./chunk-TYMYIUIQ.js";import"./chunk-AK4NPOQG.js";import"./chunk-VURVVLVE.js";import"./chunk-ZZ5M5IMF.js";import"./chunk-Q7BOSHWX.js";import"./chunk-I7QJGHS6.js";import"./chunk-VSPM4VES.js";import"./chunk-M3FOYFPN.js";import"./chunk-OLQN2OBC.js";import"./chunk-ZI7LK3LW.js";import"./chunk-IP2ZMDG4.js";import{a as Dr}from"./chunk-X4JRQETX.js";import{a as fr}from"./chunk-GWUDVP3Q.js";import"./chunk-FKIVKNOV.js";import{a as hr}from"./chunk-3I6ZVKZ2.js";import"./chunk-N54QOQ2V.js";import{a as Sr}from"./chunk-XGJH3HBA.js";import{a as Oo}from"./chunk-MH6UDGGS.js";import{a as wo}from"./chunk-POYWH3PD.js";import{a as rr}from"./chunk-NDVET7BL.js";import"./chunk-G3CPHVML.js";import"./chunk-6SVMZEJO.js";import{a as nr}from"./chunk-J2JMKTPR.js";import{a as gr}from"./chunk-2OBG4WT7.js";import{a as ir}from"./chunk-BKMZCB6M.js";import"./chunk-XBFXB6S6.js";import{a as Ie,b as qo,c as Se,e as ye,f as Ee,g as $o,h as Uo,i as Mo,j as zo,k as Ho,l as Bo,m as Me,n as Go,o as Vo,p as jo,q as Wo,r as Qo,s as Yo}from"./chunk-HXJ7HJFS.js";import"./chunk-IV3S4JU6.js";import{a as ar}from"./chunk-35Z5TIZM.js";import{a as dr}from"./chunk-CNOGRHAB.js";import"./chunk-X2ZCC772.js";import"./chunk-33AVVFWW.js";import"./chunk-OM3YN7ZK.js";import{a as Lo}from"./chunk-RXO77IC5.js";import{a as Po}from"./chunk-X2NVFYY6.js";import{a as Fo}from"./chunk-DC3JYNAG.js";import{a as Co}from"./chunk-P5KLFBCI.js";import"./chunk-4GWHZ4RW.js";import"./chunk-O5FUKS5D.js";import{a as Do}from"./chunk-FW732EHN.js";import"./chunk-P4LA3M5S.js";import{a as Eo}from"./chunk-H3QSHKNT.js";import{a as No}from"./chunk-HFGB7XAM.js";import"./chunk-GCN4O7HM.js";import{a as Ao}from"./chunk-HPH7WWMW.js";import{a as ko}from"./chunk-ZKNONN2F.js";import{a as ho}from"./chunk-2CMSXRZ5.js";import{a as yo}from"./chunk-MTGARKCQ.js";import"./chunk-IZCDEDIM.js";import{a as go}from"./chunk-3RUWUOIR.js";import"./chunk-FS4HIL62.js";import"./chunk-VUMUCNI7.js";import{a as So}from"./chunk-SUOXR2CE.js";import"./chunk-6CZ7WGE2.js";import{a as _o}from"./chunk-IDRP7BXW.js";import{a as To}from"./chunk-IPKYIHDV.js";import"./chunk-ALKT4HX7.js";import{a as mo}from"./chunk-FS37ZPWQ.js";import"./chunk-3R45SEUK.js";import{a as ao}from"./chunk-SW3DP3GU.js";import{a as po}from"./chunk-CT5MMCRM.js";import{a as lo}from"./chunk-XYV4QXQT.js";import{a as Io}from"./chunk-34CCAMTT.js";import{a as fo}from"./chunk-Q37I33P7.js";import{a as vo}from"./chunk-HG5QVQ2T.js";import{a as bo}from"./chunk-EL5U7452.js";import"./chunk-5HGRHX2Z.js";import{a as Fr}from"./chunk-SP7NSQ6G.js";import{r as or}from"./chunk-LANGOUPS.js";import"./chunk-YKAMTVJM.js";import"./chunk-2S3FHQFS.js";import"./chunk-VJEKDBGZ.js";import{a as Jo,b as Ko,d as Xo}from"./chunk-FDQNY7RF.js";import"./chunk-W6BBFBOM.js";import{e as ce}from"./chunk-ZKIIMXKC.js";import"./chunk-5EDRU7YU.js";import"./chunk-HJH672U6.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import"./chunk-F3TMLDLC.js";import"./chunk-SY3LXLT2.js";import"./chunk-O7HL63YP.js";import{a as Cr}from"./chunk-ZDKGQCIZ.js";import"./chunk-XKMLKEYX.js";import{a as Fi}from"./chunk-SXWAECCX.js";import{d as Pi}from"./chunk-YZQYDTO7.js";import{a as xo}from"./chunk-UMMEUYHM.js";import{a as uo}from"./chunk-3GPUBV4D.js";import{a as Ti}from"./chunk-6QDOCBD4.js";import{a as so,b as y,c as _,e as co}from"./chunk-BPRY3O4N.js";import{c as Ge,d as Oi}from"./chunk-ISVXQQ4E.js";import{b as he}from"./chunk-3PFIBTES.js";import"./chunk-WW7TENNA.js";import{F as C,P as L,a as Qt,c as le,ea as pe,fa as se,m as mt,n as lt,na as ft,pa as de,u as pt,y as E}from"./chunk-OQ6WYWG4.js";import"./chunk-ZDF5N422.js";import"./chunk-SH5VEQ7F.js";import{B as eo,C as fe,E as R,F as to,I as oo,J as $e,P as no,a as Wt,u as T,v as b,w as _e,x as Z,y as Xt,z as Zt}from"./chunk-SQVJGTTD.js";import"./chunk-EJDWYASP.js";import"./chunk-MVPRNGNO.js";import"./chunk-GB3YC4TI.js";import"./chunk-MPW2YJWU.js";import"./chunk-WMKVFUMY.js";import{b as Yt}from"./chunk-JNAAHGJ6.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import{a as dt}from"./chunk-UA2432YR.js";import"./chunk-WFCP2AG5.js";import{d as Jt,e as Kt}from"./chunk-4NSHAMD3.js";import"./chunk-IDMJWVJC.js";import{d as xi,l as ro,m as d,p as ee}from"./chunk-O6BUPYXH.js";import{Fb as s,Hb as c,Lb as v,Mb as P,N as Vt,Ob as io,Pb as f,Qb as ht,Rb as gt,Ta as Te,V as jt,Z as Ae,ba as ct,ga as ut,ma as xe,ua as Re}from"./chunk-KNLPWHHJ.js";import{u as qe}from"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-E7Z7KYBR.js";import"./chunk-T7KHS6RF.js";import"./chunk-UKQ7NE5V.js";import{f as ie}from"./chunk-773TIA5M.js";import{a as ae}from"./chunk-M5GXA5W4.js";import{a as ke,b as Ni}from"./chunk-CLMK6VYF.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import{e as U,g as n}from"./chunk-VKWPEFWQ.js";n();var bi=U(Ti(),1);n();n();n();n();function yt(e){return Ro(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}function $r(){return{sessions:yt().map(e=>({kind:"store",store:e.store,userId:e.userId,scopes:e.scopes,connectedAt:e.acquiredAt,...e.expiresAt?{expiresAt:e.expiresAt}:{},...e.refreshTokenExpiresAt?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...e.associatedUser?{associatedUser:e.associatedUser}:{}}))}}n();n();var Ci=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function Ve(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Ci.format(t)}function je(e){let t=M(e);if(t)return t.split(".")[0]}function Ur(e,t){if(t==="json"){v(JSON.stringify(Di(e),null,2));return}Li(e)}function Di(e){return{sessions:e.sessions.map(Mr),...e.sessions.length===0?{message:zr()}:{}}}function Li(e){if(e.sessions.length===0){P(zr());return}fe({rows:e.sessions.map(Mr),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}function Mr(e){return{subdomain:je(e.store)??e.store,connected:Ve(e.connectedAt)}}function zr(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
2
- `)}var kt,z=class extends he{async run(){let{flags:t}=await this.parse(kt),o=$r();Ur(o,t.json?"json":"text")}};kt=z;z.summary="List stores authenticated directly with store auth.";z.descriptionWithMarkdown="Lists stores authenticated directly on this machine with `shopify store auth`.\n\nUse this command to find stores that can be used with store-authenticated commands such as `shopify store execute`.\nTo list stores in a Shopify organization, run `shopify store list`.";z.description=kt.descriptionWithoutMarkdown();z.examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];z.flags={...y,..._};var Hr=z;n();n();n();var Br=13387,We="/auth/callback";function Gr(e){return`http://127.0.0.1:${e}${We}`}function F(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function Vr(e,t=300){return e.slice(0,t)}async function jr(e){let t=`https://${e.store}/admin/oauth/access_token`;f(c`Exchanging authorization code for token at ${s.raw(t)}`);let o=await mt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:q,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw f(c`Token exchange failed with HTTP ${s.raw(String(o.status))}: ${s.raw(Vr(r||o.statusText))}`),new d(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,r||o.statusText);let i;try{i=JSON.parse(r)}catch{throw new d("Received an invalid token response from Shopify.")}return f(c`Token exchange succeeded: access_token=${s.raw(F(i.access_token))}, refresh_token=${s.raw(i.refresh_token?F(i.refresh_token):"none")}, expires_in=${s.raw(String(i.expires_in??"unknown"))}s, user=${s.raw(String(i.associated_user?.id??"unknown"))} (${s.raw(i.associated_user?.email??"no email")})`),i}async function Wr(e){let t=`https://${e.store}/admin/oauth/access_token`;f(c`Refreshing access token for ${s.raw(e.store)} using refresh_token=${s.raw(F(e.refreshToken))}`);let o=await mt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:q,grant_type:"refresh_token",refresh_token:e.refreshToken})}),r=await o.text();if(!o.ok)throw f(c`Token refresh failed with HTTP ${s.raw(String(o.status))}: ${s.raw(Vr(r||o.statusText))}`),new d(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let i;try{i=JSON.parse(r)}catch{throw new d("Received an invalid refresh response from Shopify.")}if(!i.access_token)throw new d(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresIn:i.expires_in,refreshTokenExpiresIn:i.refresh_token_expires_in}}var Ri=`#graphql
1
+ import{a as Be}from"./chunk-ZU5FTJVN.js";import{a as He,b as er}from"./chunk-DYFP3SBA.js";import"./chunk-XWPPBOGF.js";import"./chunk-ZEVWQAWR.js";import"./chunk-R3WCJACL.js";import{a as dr}from"./chunk-FY7D7Z24.js";import{a as Rr}from"./chunk-5HTTO4O6.js";import{a as xr}from"./chunk-XQBHDUNJ.js";import{a as Tr}from"./chunk-M2F2HMDM.js";import{a as M,b as St,c as _r}from"./chunk-XCTHPL4E.js";import{a as mr}from"./chunk-JOKF7TQS.js";import{a as pr}from"./chunk-W57R5X75.js";import{a as Er}from"./chunk-DFSWF4VW.js";import{a as Nr}from"./chunk-ZMEDSOFC.js";import{a as Or}from"./chunk-AZK63TEX.js";import{a as Dr}from"./chunk-3CZCBBO2.js";import{a as kr}from"./chunk-I6RAL5QK.js";import{a as wr}from"./chunk-QBL3VWF4.js";import"./chunk-BXQV7N7H.js";import{a as vr}from"./chunk-YLA2NKA6.js";import{a as br}from"./chunk-DBH75XMC.js";import{a as Ar}from"./chunk-N5VSGERX.js";import{a as Xo,b as Zo,c as Sr}from"./chunk-JMGXQSF3.js";import{a as Lr}from"./chunk-X7EK6UZQ.js";import{a as Ir}from"./chunk-5UTJOHAV.js";import{a as cr}from"./chunk-XR6V742E.js";import"./chunk-HIT7MKA6.js";import{a as ze,b as ur}from"./chunk-Z4E54GTK.js";import"./chunk-UOHNRH6E.js";import"./chunk-6MDI7364.js";import{a as _i}from"./chunk-N5MWZQUH.js";import"./chunk-P7YRGKJH.js";import"./chunk-XGCOJ7UT.js";import"./chunk-2XNXIQPJ.js";import{a as Ii}from"./chunk-3EL4GA72.js";import"./chunk-INZZF4R2.js";import"./chunk-RQLOFISE.js";import"./chunk-65VUWLXE.js";import"./chunk-6SZRXJX2.js";import"./chunk-TZ7FKRXB.js";import"./chunk-PJWEE7VH.js";import"./chunk-YTINYHIV.js";import"./chunk-S3SPKCJD.js";import"./chunk-OJVEC76K.js";import"./chunk-3UFQ664V.js";import"./chunk-V3IMCEL6.js";import"./chunk-C7BPIZLV.js";import"./chunk-IUIDJ2PO.js";import"./chunk-SK4IRFCK.js";import"./chunk-J3JPJCWP.js";import"./chunk-C3AC5FQS.js";import"./chunk-4LK74JVJ.js";import"./chunk-KRZABRYT.js";import"./chunk-EFRJEZBJ.js";import"./chunk-WAH2LVVU.js";import"./chunk-LMOWRJJP.js";import"./chunk-62G4E3FF.js";import"./chunk-3HEORIF3.js";import"./chunk-ZA2P2XLH.js";import"./chunk-YIZV3FZO.js";import"./chunk-2ABJYYVF.js";import"./chunk-STJ3LWFL.js";import"./chunk-AB7462EM.js";import{b as Ti}from"./chunk-PFVF5CZ4.js";import"./chunk-WQLVBL6G.js";import{a as q,b as Lo,c as te,d as ge,e as Ue}from"./chunk-S6JGBSUV.js";import"./chunk-QG4SGGWR.js";import"./chunk-25TGONTZ.js";import"./chunk-GQFZ3NV5.js";import"./chunk-VE35YELD.js";import"./chunk-37B4MKUV.js";import"./chunk-TU47HMTL.js";import"./chunk-WQDFO5DZ.js";import"./chunk-TYMYIUIQ.js";import"./chunk-3UYW3ZAG.js";import"./chunk-SLQHQJIR.js";import"./chunk-K4Y7L7JO.js";import"./chunk-Q7BOSHWX.js";import"./chunk-W25DPKDC.js";import"./chunk-2ZSXGYTT.js";import"./chunk-EIFAHNSO.js";import"./chunk-XALIRIZF.js";import"./chunk-ZI7LK3LW.js";import"./chunk-I3RM47TC.js";import{a as Cr}from"./chunk-TYR2AZ2U.js";import{a as lr}from"./chunk-2S5KE5HI.js";import"./chunk-FKIVKNOV.js";import{a as fr}from"./chunk-WUSJP6KG.js";import"./chunk-YPHEUPMZ.js";import{a as gr}from"./chunk-F46ZV3EJ.js";import{a as yr}from"./chunk-QRUQJQYE.js";import"./chunk-TGIRO2TB.js";import{a as wo}from"./chunk-3F46XSP6.js";import{a as or}from"./chunk-LBEAJPA3.js";import"./chunk-2AIX3ZEA.js";import{a as rr}from"./chunk-L2DBLX4V.js";import{a as hr}from"./chunk-3FJMXGVN.js";import{a as nr}from"./chunk-I6UFC3HR.js";import"./chunk-X6YKSZTY.js";import{a as Ie,b as Ro,c as Se,e as ye,f as Ee,g as qo,h as $o,i as Uo,j as Mo,k as zo,l as Ho,m as Me,n as Bo,o as Go,p as Vo,q as jo,r as Wo,s as Qo}from"./chunk-3LDCOBRM.js";import"./chunk-FDAURSWQ.js";import{a as ir}from"./chunk-O7LFTI43.js";import{a as sr}from"./chunk-EO3BLRBC.js";import"./chunk-FDYZZLAY.js";import{a as ar}from"./chunk-ST2DGIWE.js";import"./chunk-AS7WHEG6.js";import"./chunk-CXYYVAYY.js";import"./chunk-YDUVKJIB.js";import{a as Po}from"./chunk-3FANSGNX.js";import{a as Fo}from"./chunk-GZ4OU46N.js";import{a as Co}from"./chunk-4KXJD6WW.js";import"./chunk-K7N3O5JJ.js";import"./chunk-LNE7HDII.js";import{a as Do}from"./chunk-W6MEUK2V.js";import"./chunk-IKLOCQ2C.js";import{a as Eo}from"./chunk-CY227SF6.js";import{a as No}from"./chunk-RUMPZWDB.js";import{a as Oo}from"./chunk-5X6JR7QJ.js";import"./chunk-GCN4O7HM.js";import{a as Ao}from"./chunk-JWAFPHPO.js";import{a as ko}from"./chunk-VMPA4DZ3.js";import{a as ho}from"./chunk-DDQPQB5D.js";import{a as yo}from"./chunk-CTYRVUJF.js";import"./chunk-IF7RP3M3.js";import{a as go}from"./chunk-7LOSGGE6.js";import"./chunk-VJXKYDM6.js";import"./chunk-VUMUCNI7.js";import{a as So}from"./chunk-2KAM4SR5.js";import"./chunk-UJ4VQGXU.js";import{a as _o}from"./chunk-63G2KGOU.js";import{a as To}from"./chunk-YNVN765Y.js";import"./chunk-FD55RBY6.js";import{a as mo}from"./chunk-PR7JET4Q.js";import"./chunk-3OKGR33F.js";import{a as ao}from"./chunk-3MV5A5HR.js";import{a as lo}from"./chunk-SEIBJIHL.js";import{a as po}from"./chunk-VCXCFKA6.js";import{a as Io}from"./chunk-4DEWRMWM.js";import{a as fo}from"./chunk-26NH7QQF.js";import{a as vo}from"./chunk-SLDQ5BC7.js";import{a as bo}from"./chunk-Z4HK5PYZ.js";import"./chunk-VGJ3QPC2.js";import{a as Pr}from"./chunk-7CF2LWEW.js";import{r as tr}from"./chunk-4MERFNHB.js";import"./chunk-KZHXG3OR.js";import"./chunk-HVECVOIO.js";import"./chunk-VJEKDBGZ.js";import{a as Yo,b as Jo,d as Ko}from"./chunk-R3GD62F4.js";import"./chunk-LSNGFAPG.js";import{e as ce}from"./chunk-ZXXEEQKW.js";import"./chunk-GHVEHA7R.js";import"./chunk-72YGVGPS.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import"./chunk-F3TMLDLC.js";import"./chunk-4D7XW3LW.js";import"./chunk-OK7WTQON.js";import{a as Fr}from"./chunk-7ER6T55S.js";import"./chunk-YNFZXXCS.js";import{a as Pi}from"./chunk-MK2K6PO4.js";import{d as Oi}from"./chunk-W2W2F55C.js";import{a as xo}from"./chunk-GLBVUEXK.js";import{a as uo}from"./chunk-BYW2F2BY.js";import{a as xi}from"./chunk-6QDOCBD4.js";import{a as so,b as y,c as _,e as co}from"./chunk-HXPUMDUV.js";import{c as Ge,d as Ni}from"./chunk-Q2QCCK7J.js";import{b as he}from"./chunk-3XHYGKBZ.js";import"./chunk-WW7TENNA.js";import{F as C,P as L,a as Qt,c as pe,ea as le,fa as se,m as mt,n as pt,na as ft,pa as de,u as lt,y as E}from"./chunk-CG22VLHL.js";import"./chunk-ZDF5N422.js";import"./chunk-XJMML6SY.js";import"./chunk-MPW2YJWU.js";import"./chunk-27IBAKXK.js";import{b as Yt}from"./chunk-3PFKQSWK.js";import{B as eo,C as fe,E as R,F as to,I as oo,J as $e,P as no,a as Wt,u as T,v as b,w as _e,x as Z,y as Xt,z as Zt}from"./chunk-EOGQ7TJP.js";import"./chunk-EJDWYASP.js";import"./chunk-MVPRNGNO.js";import"./chunk-GB3YC4TI.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import{a as dt}from"./chunk-LEMDZHSP.js";import"./chunk-M5NVKW2D.js";import{d as Jt,e as Kt}from"./chunk-BGTOVY2S.js";import"./chunk-H5BHHSWX.js";import{d as Ai,l as ro,m as d,p as ee}from"./chunk-K44YPOUY.js";import{Fb as s,Hb as c,Lb as v,Mb as P,N as Vt,Ob as io,Pb as f,Qb as ht,Rb as gt,Ta as Te,V as jt,Z as Ae,ba as ct,ga as ut,ma as xe,ua as Re}from"./chunk-YKQLGBJM.js";import{u as qe}from"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-F5LI3LKB.js";import"./chunk-T7KHS6RF.js";import"./chunk-UKQ7NE5V.js";import{f as ie}from"./chunk-773TIA5M.js";import{a as ae}from"./chunk-M5GXA5W4.js";import{a as ke,b as Ei}from"./chunk-CLMK6VYF.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import{e as U,g as n}from"./chunk-VKWPEFWQ.js";n();var vi=U(xi(),1);n();n();n();n();function yt(e){return Lo(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}function qr(){return{sessions:yt().map(e=>({kind:"store",store:e.store,userId:e.userId,scopes:e.scopes,connectedAt:e.acquiredAt,...e.expiresAt?{expiresAt:e.expiresAt}:{},...e.refreshTokenExpiresAt?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...e.associatedUser?{associatedUser:e.associatedUser}:{}}))}}n();n();var Fi=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function Ve(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Fi.format(t)}function je(e){let t=M(e);if(t)return t.split(".")[0]}function $r(e,t){if(t==="json"){v(JSON.stringify(Ci(e),null,2));return}Di(e)}function Ci(e){return{sessions:e.sessions.map(Ur),...e.sessions.length===0?{message:Mr()}:{}}}function Di(e){if(e.sessions.length===0){P(Mr());return}fe({rows:e.sessions.map(Ur),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}function Ur(e){return{subdomain:je(e.store)??e.store,connected:Ve(e.connectedAt)}}function Mr(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
2
+ `)}var kt,z=class extends he{async run(){let{flags:t}=await this.parse(kt),o=qr();$r(o,t.json?"json":"text")}};kt=z;z.summary="List stores authenticated directly with store auth.";z.descriptionWithMarkdown="Lists stores authenticated directly on this machine with `shopify store auth`.\n\nUse this command to find stores that can be used with store-authenticated commands such as `shopify store execute`.\nTo list stores in a Shopify organization, run `shopify store list`.";z.description=kt.descriptionWithoutMarkdown();z.examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];z.flags={...y,..._};var zr=z;n();n();n();var Hr=13387,We="/auth/callback";function Br(e){return`http://127.0.0.1:${e}${We}`}function F(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function Gr(e,t=300){return e.slice(0,t)}async function Vr(e){let t=`https://${e.store}/admin/oauth/access_token`;f(c`Exchanging authorization code for token at ${s.raw(t)}`);let o=await mt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:q,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw f(c`Token exchange failed with HTTP ${s.raw(String(o.status))}: ${s.raw(Gr(r||o.statusText))}`),new d(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,r||o.statusText);let i;try{i=JSON.parse(r)}catch{throw new d("Received an invalid token response from Shopify.")}return f(c`Token exchange succeeded: access_token=${s.raw(F(i.access_token))}, refresh_token=${s.raw(i.refresh_token?F(i.refresh_token):"none")}, expires_in=${s.raw(String(i.expires_in??"unknown"))}s, user=${s.raw(String(i.associated_user?.id??"unknown"))} (${s.raw(i.associated_user?.email??"no email")})`),i}async function jr(e){let t=`https://${e.store}/admin/oauth/access_token`;f(c`Refreshing access token for ${s.raw(e.store)} using refresh_token=${s.raw(F(e.refreshToken))}`);let o=await mt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:q,grant_type:"refresh_token",refresh_token:e.refreshToken})}),r=await o.text();if(!o.ok)throw f(c`Token refresh failed with HTTP ${s.raw(String(o.status))}: ${s.raw(Gr(r||o.statusText))}`),new d(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let i;try{i=JSON.parse(r)}catch{throw new d("Received an invalid refresh response from Shopify.")}if(!i.access_token)throw new d(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresIn:i.expires_in,refreshTokenExpiresIn:i.refresh_token_expires_in}}var Li=`#graphql
3
3
  query CurrentAppInstallationAccessScopes {
4
4
  currentAppInstallation {
5
5
  accessScopes {
@@ -7,7 +7,7 @@ import{a as Be}from"./chunk-ZU5FTJVN.js";import{a as He,b as tr}from"./chunk-2FN
7
7
  }
8
8
  }
9
9
  }
10
- `;async function Qr(e){f(c`Fetching current app installation scopes for ${s.raw(e.store)} using token ${s.raw(F(e.accessToken))}`);let t=await se({query:Ri,api:"Admin",url:ce(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!Array.isArray(t.currentAppInstallation?.accessScopes))throw new Error("Shopify did not return currentAppInstallation.accessScopes.");return t.currentAppInstallation.accessScopes.flatMap(o=>typeof o.handle=="string"?[o.handle]:[])}n();n();var wt="<comma-separated-scopes>";function Yr(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function qi(e){return[[Yr(e,wt)]]}function Jr(e,t,o){return[["Run",Yr(e,t),o]]}function $i(e){return e.kind==="preview"?wt:e.scopes.join(",")}function Kr(e){throw new d(`No stored app authentication found for ${e}.`,void 0,Jr(e,wt,"to authenticate"))}function Ne(e,t){throw new d(e,void 0,Jr(t.store,$i(t),"to re-authenticate"))}function Qe(e){let t=e.kind==="preview"?`The preview store ${e.store} has likely been claimed, so its stored authentication is no longer valid.`:`Stored app authentication for ${e.store} is no longer valid.`;Ne(t,e)}function Xr(e){return new d("OAuth callback store does not match the requested store.",`Shopify returned ${e} during authentication. Re-run using the permanent store domain:`,qi(e))}import{timingSafeEqual as Ui}from"crypto";import{createServer as Mi}from"http";function Zr(e,t){let o=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),r=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return`<!doctype html>
10
+ `;async function Wr(e){f(c`Fetching current app installation scopes for ${s.raw(e.store)} using token ${s.raw(F(e.accessToken))}`);let t=await se({query:Li,api:"Admin",url:ce(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!Array.isArray(t.currentAppInstallation?.accessScopes))throw new Error("Shopify did not return currentAppInstallation.accessScopes.");return t.currentAppInstallation.accessScopes.flatMap(o=>typeof o.handle=="string"?[o.handle]:[])}n();n();var wt="<comma-separated-scopes>";function Qr(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function Ri(e){return[[Qr(e,wt)]]}function Yr(e,t,o){return[["Run",Qr(e,t),o]]}function qi(e){return e.kind==="preview"?wt:e.scopes.join(",")}function Jr(e){throw new d(`No stored app authentication found for ${e}.`,void 0,Yr(e,wt,"to authenticate"))}function Ne(e,t){throw new d(e,void 0,Yr(t.store,qi(t),"to re-authenticate"))}function Qe(e){let t=e.kind==="preview"?`The preview store ${e.store} has likely been claimed, so its stored authentication is no longer valid.`:`Stored app authentication for ${e.store} is no longer valid.`;Ne(t,e)}function Kr(e){return new d("OAuth callback store does not match the requested store.",`Shopify returned ${e} during authentication. Re-run using the permanent store domain:`,Ri(e))}import{timingSafeEqual as $i}from"crypto";import{createServer as Ui}from"http";function Xr(e,t){let o=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),r=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return`<!doctype html>
11
11
  <html lang="en">
12
12
  <head>
13
13
  <meta charset="utf-8" />
@@ -76,14 +76,14 @@ import{a as Be}from"./chunk-ZU5FTJVN.js";import{a as He,b as tr}from"./chunk-2FN
76
76
  </main>
77
77
  </div>
78
78
  </body>
79
- </html>`}async function en({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i}){let a=E(e);return new Promise((u,m)=>{let p=!1,h=!1,A=setTimeout(()=>{I(new d("Timed out waiting for OAuth callback."))},r),g=Mi((l,S)=>{let nt=new URL(l.url??"/",`http://127.0.0.1:${o}`);if(nt.pathname!==We){S.statusCode=404,S.end("Not found");return}let{searchParams:Le}=nt,be=(st,Ai)=>{let Gt=typeof st=="string"?new d(st,Ai):st;S.statusCode=400,S.setHeader("Content-Type","text/html"),S.setHeader("Connection","close"),S.once("finish",()=>I(Gt)),S.end(Zr("Authentication failed",Gt.message))},it=Le.get("shop");if(f(c`Received OAuth callback for shop ${s.raw(it??"unknown")}`),!it){be("OAuth callback store does not match the requested store.");return}let zt=E(it);if(zt!==a){be(Xr(zt));return}let Ht=Le.get("state");if(!Ht||!zi(Ht,t)){be("OAuth callback state does not match the original request.");return}let Bt=Le.get("error");if(Bt){be(`Shopify returned an OAuth error: ${Bt}`);return}let at=Le.get("code");if(!at){be("OAuth callback did not include an authorization code.");return}f(c`Received authorization code ${s.raw(F(at))}`),S.statusCode=200,S.setHeader("Content-Type","text/html"),S.setHeader("Connection","close"),S.once("finish",()=>x(()=>u(at))),S.end(Zr("Authentication succeeded","Close this window and return to the terminal"))}),x=l=>{if(p)return;p=!0,clearTimeout(A);let S=()=>{l()};if(!h){S();return}g.close(()=>{h=!1,S()}),g.closeIdleConnections?.()},I=l=>{x(()=>m(l))};g.on("error",l=>{if(l.code==="EADDRINUSE"){I(new d(`Port ${o} is already in use.`,`Free port ${o} and re-run ${s.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}I(l)}),g.listen(o,"127.0.0.1",()=>{h=!0,f(c`PKCE callback server listening on http://127.0.0.1:${s.raw(String(o))}${s.raw(We)}`),i&&Promise.resolve(i()).catch(l=>{I(l instanceof Error?l:new Error(String(l)))})})})}function zi(e,t){return e.length!==t.length?!1:Ui(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as Hi,randomBytes as Bi}from"crypto";function Gi(){return Bi(32).toString("base64url")}function Vi(e){return Hi("sha256").update(e).digest("base64url")}function ji(e){let t=new URLSearchParams;return t.set("client_id",q),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),e.signup&&t.set("signup",e.signup),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function tn(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Br,u=le(),m=Gr(a),p=Gi(),h=Vi(p),A=ji({store:t,scopes:o,state:u,redirectUri:m,codeChallenge:h,signup:r});return f(c`Starting PKCE auth for ${s.raw(t)} with scopes ${s.raw(o.join(","))} (redirect_uri=${s.raw(m)})`),{authorization:{store:t,scopes:o,state:u,port:a,redirectUri:m,authorizationUrl:A,codeVerifier:p,signup:r},waitForAuthCodeOptions:{store:t,state:u,port:a},exchangeCodeForToken:g=>i({store:t,code:g,codeVerifier:p,redirectUri:m})}}n();function bt(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new d("At least one scope is required.","Pass --scopes as a comma-separated list.");return Vt(t)}function vt(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function on(e,t){let o=[...t],r=vt(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of vt([i]))r.add(a)}return o}function rn(e,t){if(!e.scope)return f(c`Token response did not include scope; falling back to requested scopes`),t;let o=bt(e.scope),r=vt(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new d("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var Wi=240*1e3;function Qi(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Wi<Date.now()}function Yi(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function D(e){let t=te(e);if(t||Kr(e),f(c`Loaded stored session for ${s.raw(e)}: token=${s.raw(F(t.accessToken))}, expires=${s.raw(t.expiresAt??"unknown")}`),!Qi(t))return t;t.refreshToken||Ne(`No refresh token stored for ${t.store}.`,t),f(c`Refreshing expired token for ${s.raw(t.store)} (expired at ${s.raw(t.expiresAt??"unknown")}, refresh_token=${s.raw(F(t.refreshToken))})`);let o=t.accessToken,r;try{r=await Wr({store:t.store,refreshToken:t.refreshToken})}catch(i){throw Ue(t.store,t.userId),i instanceof d&&i.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&Ne(i.message,t),i instanceof d&&i.message===`Token refresh returned an invalid response for ${t.store}.`&&Ne(i.message,t),i instanceof d&&i.message==="Received an invalid refresh response from Shopify.",i}return t=Yi(t,r),f(c`Token refresh succeeded for ${s.raw(t.store)}: ${s.raw(F(o))} → ${s.raw(F(t.accessToken))}, new expiry ${s.raw(t.expiresAt??"unknown")}`),ge(t),t}function nn(e,t=300){return e.slice(0,t)}function Ji(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return nn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return nn(e instanceof Error?e.message:String(e))}async function an(e){let t=E(e),o=te(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await D(t),i=await Qr({store:r.store,accessToken:r.accessToken});return f(c`Resolved current remote scopes for ${s.raw(t)}: ${s.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return f(c`Falling back to locally stored scopes for ${s.raw(t)} after remote scope lookup failed: ${s.raw(Ji(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Ki(e){return JSON.stringify(e,null,2)}function Xi(e){return{completed:["Logged in.",`Authenticated${e.associatedUser?.email?` as ${e.associatedUser.email}`:""} against ${e.store}.`],info:["","To verify that authentication worked, run:",`shopify store execute --store ${e.store} --query 'query { shop { name id } }'`]}}function Zi(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function ea(e){P("Browser did not open automatically. Open this URL manually:"),P(c`${s.link(e)}`),P("")}function ta(e,t="text"){if(t==="json"){v(Ki(e));return}let o=Xi(e);o.completed.forEach(r=>io(r)),o.info.forEach(r=>P(r))}function we(e="text"){return{openingBrowser:Zi,manualAuthUrl:ea,success(t){ta(t,e)}}}n();async function N(e,t,o){await Kt(()=>({store_fqdn:e})),await Jt(()=>({store_fqdn_hash:Qt(e),store_fqdn_validated:t,store_domain:e,store_id:jt(o)}))}var oa={openURL:$e,waitForStoreAuthCode:en,exchangeStoreAuthCodeForToken:jr,resolveExistingScopes:an,getCurrentStoredStoreAppSession:te,presenter:we("text")};async function Ye(e,t={}){let o={...oa,...t},r=E(e.store);ra(r,o),await N(r,!1);let i=bt(e.scopes),a=await o.resolveExistingScopes(r),u=on(i,a.scopes),m=a.authoritative?u:i;a.scopes.length>0&&f(c`Merged requested scopes ${s.raw(i.join(","))} with existing scopes ${s.raw(a.scopes.join(","))} for ${s.raw(r)}`);let p=tn({store:r,scopes:u,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:h}}=p;o.presenter.openingBrowser();let A=await o.waitForStoreAuthCode({...p.waitForAuthCodeOptions,onListening:async()=>{await o.openURL(h)||o.presenter.manualAuthUrl(h)}}),g=await p.exchangeCodeForToken(A);await N(r,!0);let x=g.associated_user?.id?.toString();if(!x)throw new d("Shopify did not return associated user information for the online access token.");C(x);let I=Date.now(),l=g.expires_in?new Date(I+g.expires_in*1e3).toISOString():void 0,S={store:r,userId:x,scopes:rn(g,m),acquiredAt:new Date(I).toISOString(),expiresAt:l,refreshTokenExpiresAt:g.refresh_token_expires_in?new Date(I+g.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!g.refresh_token,associatedUser:g.associated_user?{id:g.associated_user.id,email:g.associated_user.email,firstName:g.associated_user.first_name,lastName:g.associated_user.last_name,accountOwner:g.associated_user.account_owner}:void 0};return ge({store:r,clientId:q,userId:x,accessToken:g.access_token,refreshToken:g.refresh_token,scopes:S.scopes,acquiredAt:S.acquiredAt,expiresAt:l,refreshTokenExpiresAt:S.refreshTokenExpiresAt,associatedUser:S.associatedUser}),f(c`Session persisted for ${s.raw(r)} (user ${s.raw(x)}, expires ${s.raw(l??"unknown")})`),o.presenter.success(S),S}function ra(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new d("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
79
+ </html>`}async function Zr({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i}){let a=E(e);return new Promise((u,m)=>{let l=!1,h=!1,A=setTimeout(()=>{I(new d("Timed out waiting for OAuth callback."))},r),g=Ui((p,S)=>{let nt=new URL(p.url??"/",`http://127.0.0.1:${o}`);if(nt.pathname!==We){S.statusCode=404,S.end("Not found");return}let{searchParams:Le}=nt,be=(st,bi)=>{let Gt=typeof st=="string"?new d(st,bi):st;S.statusCode=400,S.setHeader("Content-Type","text/html"),S.setHeader("Connection","close"),S.once("finish",()=>I(Gt)),S.end(Xr("Authentication failed",Gt.message))},it=Le.get("shop");if(f(c`Received OAuth callback for shop ${s.raw(it??"unknown")}`),!it){be("OAuth callback store does not match the requested store.");return}let zt=E(it);if(zt!==a){be(Kr(zt));return}let Ht=Le.get("state");if(!Ht||!Mi(Ht,t)){be("OAuth callback state does not match the original request.");return}let Bt=Le.get("error");if(Bt){be(`Shopify returned an OAuth error: ${Bt}`);return}let at=Le.get("code");if(!at){be("OAuth callback did not include an authorization code.");return}f(c`Received authorization code ${s.raw(F(at))}`),S.statusCode=200,S.setHeader("Content-Type","text/html"),S.setHeader("Connection","close"),S.once("finish",()=>x(()=>u(at))),S.end(Xr("Authentication succeeded","Close this window and return to the terminal"))}),x=p=>{if(l)return;l=!0,clearTimeout(A);let S=()=>{p()};if(!h){S();return}g.close(()=>{h=!1,S()}),g.closeIdleConnections?.()},I=p=>{x(()=>m(p))};g.on("error",p=>{if(p.code==="EADDRINUSE"){I(new d(`Port ${o} is already in use.`,`Free port ${o} and re-run ${s.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}I(p)}),g.listen(o,"127.0.0.1",()=>{h=!0,f(c`PKCE callback server listening on http://127.0.0.1:${s.raw(String(o))}${s.raw(We)}`),i&&Promise.resolve(i()).catch(p=>{I(p instanceof Error?p:new Error(String(p)))})})})}function Mi(e,t){return e.length!==t.length?!1:$i(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as zi,randomBytes as Hi}from"crypto";function Bi(){return Hi(32).toString("base64url")}function Gi(e){return zi("sha256").update(e).digest("base64url")}function Vi(e){let t=new URLSearchParams;return t.set("client_id",q),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),e.signup&&t.set("signup",e.signup),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function en(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Hr,u=pe(),m=Br(a),l=Bi(),h=Gi(l),A=Vi({store:t,scopes:o,state:u,redirectUri:m,codeChallenge:h,signup:r});return f(c`Starting PKCE auth for ${s.raw(t)} with scopes ${s.raw(o.join(","))} (redirect_uri=${s.raw(m)})`),{authorization:{store:t,scopes:o,state:u,port:a,redirectUri:m,authorizationUrl:A,codeVerifier:l,signup:r},waitForAuthCodeOptions:{store:t,state:u,port:a},exchangeCodeForToken:g=>i({store:t,code:g,codeVerifier:l,redirectUri:m})}}n();function bt(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new d("At least one scope is required.","Pass --scopes as a comma-separated list.");return Vt(t)}function vt(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function tn(e,t){let o=[...t],r=vt(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of vt([i]))r.add(a)}return o}function on(e,t){if(!e.scope)return f(c`Token response did not include scope; falling back to requested scopes`),t;let o=bt(e.scope),r=vt(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new d("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var ji=240*1e3;function Wi(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-ji<Date.now()}function Qi(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function D(e){let t=te(e);if(t||Jr(e),f(c`Loaded stored session for ${s.raw(e)}: token=${s.raw(F(t.accessToken))}, expires=${s.raw(t.expiresAt??"unknown")}`),!Wi(t))return t;t.refreshToken||Ne(`No refresh token stored for ${t.store}.`,t),f(c`Refreshing expired token for ${s.raw(t.store)} (expired at ${s.raw(t.expiresAt??"unknown")}, refresh_token=${s.raw(F(t.refreshToken))})`);let o=t.accessToken,r;try{r=await jr({store:t.store,refreshToken:t.refreshToken})}catch(i){throw Ue(t.store,t.userId),i instanceof d&&i.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&Ne(i.message,t),i instanceof d&&i.message===`Token refresh returned an invalid response for ${t.store}.`&&Ne(i.message,t),i instanceof d&&i.message==="Received an invalid refresh response from Shopify.",i}return t=Qi(t,r),f(c`Token refresh succeeded for ${s.raw(t.store)}: ${s.raw(F(o))} → ${s.raw(F(t.accessToken))}, new expiry ${s.raw(t.expiresAt??"unknown")}`),ge(t),t}function rn(e,t=300){return e.slice(0,t)}function Yi(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return rn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return rn(e instanceof Error?e.message:String(e))}async function nn(e){let t=E(e),o=te(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await D(t),i=await Wr({store:r.store,accessToken:r.accessToken});return f(c`Resolved current remote scopes for ${s.raw(t)}: ${s.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return f(c`Falling back to locally stored scopes for ${s.raw(t)} after remote scope lookup failed: ${s.raw(Yi(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Ji(e){return JSON.stringify(e,null,2)}function Ki(e){return{completed:["Logged in.",`Authenticated${e.associatedUser?.email?` as ${e.associatedUser.email}`:""} against ${e.store}.`],info:["","To verify that authentication worked, run:",`shopify store execute --store ${e.store} --query 'query { shop { name id } }'`]}}function Xi(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function Zi(e){P("Browser did not open automatically. Open this URL manually:"),P(c`${s.link(e)}`),P("")}function ea(e,t="text"){if(t==="json"){v(Ji(e));return}let o=Ki(e);o.completed.forEach(r=>io(r)),o.info.forEach(r=>P(r))}function we(e="text"){return{openingBrowser:Xi,manualAuthUrl:Zi,success(t){ea(t,e)}}}n();async function N(e,t,o){await Kt(()=>({store_fqdn:e})),await Jt(()=>({store_fqdn_hash:Qt(e),store_fqdn_validated:t,store_domain:e,store_id:jt(o)}))}var ta={openURL:$e,waitForStoreAuthCode:Zr,exchangeStoreAuthCodeForToken:Vr,resolveExistingScopes:nn,getCurrentStoredStoreAppSession:te,presenter:we("text")};async function Ye(e,t={}){let o={...ta,...t},r=E(e.store);oa(r,o),await N(r,!1);let i=bt(e.scopes),a=await o.resolveExistingScopes(r),u=tn(i,a.scopes),m=a.authoritative?u:i;a.scopes.length>0&&f(c`Merged requested scopes ${s.raw(i.join(","))} with existing scopes ${s.raw(a.scopes.join(","))} for ${s.raw(r)}`);let l=en({store:r,scopes:u,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:h}}=l;o.presenter.openingBrowser();let A=await o.waitForStoreAuthCode({...l.waitForAuthCodeOptions,onListening:async()=>{await o.openURL(h)||o.presenter.manualAuthUrl(h)}}),g=await l.exchangeCodeForToken(A);await N(r,!0);let x=g.associated_user?.id?.toString();if(!x)throw new d("Shopify did not return associated user information for the online access token.");C(x);let I=Date.now(),p=g.expires_in?new Date(I+g.expires_in*1e3).toISOString():void 0,S={store:r,userId:x,scopes:on(g,m),acquiredAt:new Date(I).toISOString(),expiresAt:p,refreshTokenExpiresAt:g.refresh_token_expires_in?new Date(I+g.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!g.refresh_token,associatedUser:g.associated_user?{id:g.associated_user.id,email:g.associated_user.email,firstName:g.associated_user.first_name,lastName:g.associated_user.last_name,accountOwner:g.associated_user.account_owner}:void 0};return ge({store:r,clientId:q,userId:x,accessToken:g.access_token,refreshToken:g.refresh_token,scopes:S.scopes,acquiredAt:S.acquiredAt,expiresAt:p,refreshTokenExpiresAt:S.refreshTokenExpiresAt,associatedUser:S.associatedUser}),f(c`Session persisted for ${s.raw(r)} (user ${s.raw(x)}, expires ${s.raw(p??"unknown")})`),o.presenter.success(S),S}function oa(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new d("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
80
80
 
81
- Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends he{};n();var O=U(ae(),1);function na(e){return O.Flags.string({description:"Two-letter country code for the store, such as US, CA, or GB.",env:e,required:!1,parse:async t=>t.trim().toUpperCase()})}function sn(e){return/^[A-Z]{2}$/.test(e)}var dn={country:na("SHOPIFY_FLAG_STORE_COUNTRY")},w={store:O.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>E(e),required:!0}),"organization-id":O.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},cn={env:"SHOPIFY_FLAG_ID",parse:async e=>qo(e)},un=O.Flags.string({...cn,description:"The bulk operation ID (numeric ID or full GID). If not provided, lists all bulk operations on this store in the last 7 days."}),mn=O.Flags.string({...cn,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),ln={query:O.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":O.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>ie(e),exactlyOne:["query","query-file"]}),variables:O.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":O.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>ie(e),exclusive:["variables"]}),watch:O.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":O.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:O.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"allow-mutations":O.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var pn=U(ae(),1),At,H=class extends k{async run(){let{flags:t}=await this.parse(At);await Ye({store:t.store,scopes:t.scopes},{presenter:we(t.json?"json":"text")})}};At=H;H.summary="Authenticate an app against a store for store commands.";H.descriptionWithMarkdown=`Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
81
+ Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends he{};n();var O=U(ae(),1);function ra(e){return O.Flags.string({description:"Two-letter country code for the store, such as US, CA, or GB.",env:e,required:!1,parse:async t=>t.trim().toUpperCase()})}function an(e){return/^[A-Z]{2}$/.test(e)}var sn={country:ra("SHOPIFY_FLAG_STORE_COUNTRY")},w={store:O.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>E(e),required:!0}),"organization-id":O.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},dn={env:"SHOPIFY_FLAG_ID",parse:async e=>Ro(e)},cn=O.Flags.string({...dn,description:"The bulk operation ID (numeric ID or full GID). If not provided, lists all bulk operations on this store in the last 7 days."}),un=O.Flags.string({...dn,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),mn={query:O.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":O.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>ie(e),exactlyOne:["query","query-file"]}),variables:O.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":O.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>ie(e),exclusive:["variables"]}),watch:O.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":O.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:O.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"allow-mutations":O.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var pn=U(ae(),1),At,H=class extends k{async run(){let{flags:t}=await this.parse(At);await Ye({store:t.store,scopes:t.scopes},{presenter:we(t.json?"json":"text")})}};At=H;H.summary="Authenticate an app against a store for store commands.";H.descriptionWithMarkdown=`Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
82
82
 
83
- Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;H.description=At.descriptionWithoutMarkdown();H.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];H.flags={...y,..._,store:w.store,scopes:pn.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};var fn=H;n();n();n();function ue(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function hn(e,t=!1){if(ye(e)&&!t)throw new d("Mutations are disabled by default for shopify store bulk execute.","Re-run with --allow-mutations if you intend to modify store data.")}n();async function me(e){let t=await D(e);return await N(t.store,!0),C(t.userId),{token:t.accessToken,storeFqdn:t.store}}async function gn(e){let{store:t,operationId:o}=e,r=await me(t);T({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${o}`,...ue({storeFqdn:r.storeFqdn})]}}]});let i=await Bo({adminSession:r,operationId:o});if(i?.userErrors?.length){Go(i.userErrors,"Failed to cancel bulk operation.");return}let a=i?.bulkOperation;if(a){let u=Vo(a),m=a.status==="CANCELING"?[`This may take a few moments. Check the status with:
84
- `,{command:`shopify store bulk status --id=${Se(a.id)}`}]:u.body,p={headline:u.headline,...m&&{body:m},...u.customSections&&{customSections:u.customSections}};switch(u.renderType){case"success":b(p);break;case"warning":_e(p);break;case"info":T(p);break}}else Z({headline:"Bulk operation not found or could not be canceled.",body:c`ID: ${s.yellow(o)}`.value})}var xt,B=class extends k{async run(){let{flags:t}=await this.parse(xt);await gn({store:t.store,operationId:t.id})}};xt=B;B.summary="Cancel a bulk operation on a store.";B.descriptionWithMarkdown="Cancels a running bulk operation by ID, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.";B.description=xt.descriptionWithoutMarkdown();B.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];B.flags={...y,store:w.store,id:mn};var Sn=B;n();n();async function ia(e,t){if(e)return e.join(`
85
- `);if(t){if(!await Te(t))throw new d(c`Variable file not found at ${s.path(t)}. Please check the path and try again.`);return xe(t,{encoding:"utf8"})}else return}async function kn(e){let{store:t,query:o,variables:r,variableFile:i,outputFile:a,watch:u=!1,version:m,allowMutations:p=!1}=e;hn(o,p);let{adminSession:h,version:A}=await R({title:c`Authenticating`,task:async()=>{let l=await me(t),S=await Ee({adminSession:l,userSpecifiedVersion:m,minimumDefaultVersion:Ie});return{adminSession:l,version:S}},renderOptions:{stdout:process.stderr}}),g=await ia(r,i);aa(o,g),T({headline:"Starting bulk operation.",body:[{list:{items:ue({storeFqdn:h.storeFqdn,version:A})}}]});let x=ye(o)?await Mo({adminSession:h,query:o,variablesJsonl:g,version:A}):await Uo({adminSession:h,query:o,version:A});if(x?.userErrors?.length){Z({headline:"Error creating bulk operation.",body:{list:{items:x.userErrors.map(l=>l.field?`${l.field.join(".")}: ${l.message}`:l.message)}}});return}let I=x?.bulkOperation;if(I)if(u){let l=new Wt,S=await Wo(h,I.id,l.signal,()=>l.abort());l.signal.aborted?T({headline:`Bulk operation ${S.id} is still running in the background.`,body:Je(S.id)}):await yn(S,a)}else{let l=await jo(h,I.id);["FAILED","CANCELED","EXPIRED"].includes(l.status)?await yn(l,a):b({headline:"Bulk operation is running.",body:Je(l.id),customSections:[{body:[{list:{items:[c`ID: ${s.cyan(l.id)}`.value]}}]}]})}else throw _e({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new ee("Bulk operation response returned null with no error message.")}async function yn(e,t){let o=Me(e).value,i=[{body:[{list:{items:[c`ID: ${s.cyan(e.id)}`.value,c`Status: ${s.yellow(e.status)}`.value,c`Created at: ${s.gray(String(e.createdAt))}`.value,...e.completedAt?[c`Completed at: ${s.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":b({headline:"Bulk operation started.",body:Je(e.id),customSections:i});break;case"RUNNING":b({headline:"Bulk operation is running.",body:Je(e.id),customSections:i});break;case"COMPLETED":if(e.url){let a=await Qo(e.url),u=Yo(a);t?await Re(t,a):v(a),u?_e({headline:"Bulk operation completed with errors.",body:t?`Results written to ${t}. Check file for error details.`:"Check results for error details.",customSections:i}):b({headline:o,body:t?[`Results written to ${t}`]:void 0,customSections:i})}else b({headline:o,customSections:i});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":Z({headline:o,customSections:i});break}}function aa(e,t){if(ye(e)&&!t)throw new d(c`Bulk mutations require variables. Provide a JSONL file with ${s.yellow("--variable-file")} or individual JSON objects with ${s.yellow("--variables")}.`);if(!ye(e)&&t)throw new d(c`The ${s.yellow("--variables")} and ${s.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function Je(e){return[`Monitor its progress with:
86
- `,{command:`shopify store bulk status --id=${Se(e)}`}]}var Tt,G=class extends k{async run(){let{flags:t}=await this.parse(Tt),o=await $o({query:t.query,queryFile:t["query-file"]});await kn({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,outputFile:t["output-file"],allowMutations:t["allow-mutations"],...t.version&&{version:t.version}})}};Tt=G;G.summary="Execute bulk operations on a store.";G.descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store as a bulk operation, using previously stored app authentication.
83
+ Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;H.description=At.descriptionWithoutMarkdown();H.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];H.flags={...y,..._,store:w.store,scopes:pn.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};var ln=H;n();n();n();function ue(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function fn(e,t=!1){if(ye(e)&&!t)throw new d("Mutations are disabled by default for shopify store bulk execute.","Re-run with --allow-mutations if you intend to modify store data.")}n();async function me(e){let t=await D(e);return await N(t.store,!0),C(t.userId),{token:t.accessToken,storeFqdn:t.store}}async function hn(e){let{store:t,operationId:o}=e,r=await me(t);T({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${o}`,...ue({storeFqdn:r.storeFqdn})]}}]});let i=await Ho({adminSession:r,operationId:o});if(i?.userErrors?.length){Bo(i.userErrors,"Failed to cancel bulk operation.");return}let a=i?.bulkOperation;if(a){let u=Go(a),m=a.status==="CANCELING"?[`This may take a few moments. Check the status with:
84
+ `,{command:`shopify store bulk status --id=${Se(a.id)}`}]:u.body,l={headline:u.headline,...m&&{body:m},...u.customSections&&{customSections:u.customSections}};switch(u.renderType){case"success":b(l);break;case"warning":_e(l);break;case"info":T(l);break}}else Z({headline:"Bulk operation not found or could not be canceled.",body:c`ID: ${s.yellow(o)}`.value})}var xt,B=class extends k{async run(){let{flags:t}=await this.parse(xt);await hn({store:t.store,operationId:t.id})}};xt=B;B.summary="Cancel a bulk operation on a store.";B.descriptionWithMarkdown="Cancels a running bulk operation by ID, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.";B.description=xt.descriptionWithoutMarkdown();B.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];B.flags={...y,store:w.store,id:un};var gn=B;n();n();async function na(e,t){if(e)return e.join(`
85
+ `);if(t){if(!await Te(t))throw new d(c`Variable file not found at ${s.path(t)}. Please check the path and try again.`);return xe(t,{encoding:"utf8"})}else return}async function yn(e){let{store:t,query:o,variables:r,variableFile:i,outputFile:a,watch:u=!1,version:m,allowMutations:l=!1}=e;fn(o,l);let{adminSession:h,version:A}=await R({title:c`Authenticating`,task:async()=>{let p=await me(t),S=await Ee({adminSession:p,userSpecifiedVersion:m,minimumDefaultVersion:Ie});return{adminSession:p,version:S}},renderOptions:{stdout:process.stderr}}),g=await na(r,i);ia(o,g),T({headline:"Starting bulk operation.",body:[{list:{items:ue({storeFqdn:h.storeFqdn,version:A})}}]});let x=ye(o)?await Uo({adminSession:h,query:o,variablesJsonl:g,version:A}):await $o({adminSession:h,query:o,version:A});if(x?.userErrors?.length){Z({headline:"Error creating bulk operation.",body:{list:{items:x.userErrors.map(p=>p.field?`${p.field.join(".")}: ${p.message}`:p.message)}}});return}let I=x?.bulkOperation;if(I)if(u){let p=new Wt,S=await jo(h,I.id,p.signal,()=>p.abort());p.signal.aborted?T({headline:`Bulk operation ${S.id} is still running in the background.`,body:Je(S.id)}):await Sn(S,a)}else{let p=await Vo(h,I.id);["FAILED","CANCELED","EXPIRED"].includes(p.status)?await Sn(p,a):b({headline:"Bulk operation is running.",body:Je(p.id),customSections:[{body:[{list:{items:[c`ID: ${s.cyan(p.id)}`.value]}}]}]})}else throw _e({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new ee("Bulk operation response returned null with no error message.")}async function Sn(e,t){let o=Me(e).value,i=[{body:[{list:{items:[c`ID: ${s.cyan(e.id)}`.value,c`Status: ${s.yellow(e.status)}`.value,c`Created at: ${s.gray(String(e.createdAt))}`.value,...e.completedAt?[c`Completed at: ${s.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":b({headline:"Bulk operation started.",body:Je(e.id),customSections:i});break;case"RUNNING":b({headline:"Bulk operation is running.",body:Je(e.id),customSections:i});break;case"COMPLETED":if(e.url){let a=await Wo(e.url),u=Qo(a);t?await Re(t,a):v(a),u?_e({headline:"Bulk operation completed with errors.",body:t?`Results written to ${t}. Check file for error details.`:"Check results for error details.",customSections:i}):b({headline:o,body:t?[`Results written to ${t}`]:void 0,customSections:i})}else b({headline:o,customSections:i});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":Z({headline:o,customSections:i});break}}function ia(e,t){if(ye(e)&&!t)throw new d(c`Bulk mutations require variables. Provide a JSONL file with ${s.yellow("--variable-file")} or individual JSON objects with ${s.yellow("--variables")}.`);if(!ye(e)&&t)throw new d(c`The ${s.yellow("--variables")} and ${s.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function Je(e){return[`Monitor its progress with:
86
+ `,{command:`shopify store bulk status --id=${Se(e)}`}]}var Tt,G=class extends k{async run(){let{flags:t}=await this.parse(Tt),o=await qo({query:t.query,queryFile:t["query-file"]});await yn({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,outputFile:t["output-file"],allowMutations:t["allow-mutations"],...t.version&&{version:t.version}})}};Tt=G;G.summary="Execute bulk operations on a store.";G.descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store as a bulk operation, using previously stored app authentication.
87
87
 
88
88
  Run \`shopify store auth\` first to create stored auth for the store.
89
89
 
@@ -91,14 +91,14 @@ Re-run this command if the stored token is missing, expires, or no longer has th
91
91
 
92
92
  Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.
93
93
 
94
- Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;G.description=Tt.descriptionWithoutMarkdown();G.examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];G.flags={...y,store:w.store,...ln};var wn=G;n();n();async function vn(e){let{store:t,operationId:o}=e,r=await me(t);T({headline:"Checking bulk operation status.",body:[{list:{items:ue({storeFqdn:r.storeFqdn})}}]});let i=await zo({adminSession:r,operationId:o,version:await Ee({adminSession:r,minimumDefaultVersion:Ie})});i?sa(i):Z({headline:"Bulk operation not found.",body:c`ID: ${s.yellow(o)}`.value})}async function bn(e){let{store:t}=e,o=await me(t);T({headline:"Listing bulk operations.",body:[{list:{items:ue({storeFqdn:o.storeFqdn})}}]});let i=(await Ho({adminSession:o,version:await Ee({adminSession:o,minimumDefaultVersion:Ie})})).map(a=>({id:Se(a.id),status:ca(a.status),count:ua(a.objectCount),dateCreated:ct(new Date(String(a.createdAt))),dateFinished:a.completedAt?ct(new Date(String(a.completedAt))):"",results:ma(a.url??a.partialDataUrl)}));gt(),i.length===0?T({body:"No bulk operations found in the last 7 days."}):fe({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),gt()}function sa(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:u}=e,m=Me(e).value,p=da(r,i),h=c`ID: ${s.yellow(t)}\n${p}`.value;if(o==="COMPLETED"){let A=a?s.link("Download results",a):"";b({headline:m,body:c`${h}\n${A}`.value})}else if(o==="FAILED"){let A=u?s.link("Download partial results",u):"";Z({headline:m,body:c`${h}\n${A}`.value})}else T({headline:m,body:h})}function da(e,t){let o=new Date;return t?`Finished ${ut(new Date(String(t)),o)}`:`Started ${ut(new Date(String(e)),o)}`}function ca(e){return e==="COMPLETED"?qe.green(e):e==="FAILED"?qe.red(e):qe.dim(e)}function ua(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ma(e){return e?c`${s.link("download",e)}`.value:""}var _t,V=class extends k{async run(){let{flags:t}=await this.parse(_t);t.id?await vn({store:t.store,operationId:t.id}):await bn({store:t.store})}};_t=V;V.summary="Check the status of bulk operations on a store.";V.descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";V.description=_t.descriptionWithoutMarkdown();V.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];V.flags={...y,store:w.store,id:un};var An=V;n();var It=U(ae(),1),Et,$=class extends k{async run(){let{flags:t}=await this.parse(Et);await Ye({store:t.store,scopes:t.scopes,signup:t.signup},{presenter:we(t.json?"json":"text")})}};Et=$;$.hidden=!0;$.summary="Authenticate for store commands.";$.descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup.";$.description=Et.descriptionWithoutMarkdown();$.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];$.flags={...y,..._,store:w.store,scopes:It.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:It.Flags.string({description:"Provide JWT for the store.",env:"SHOPIFY_FLAG_SIGNUP",required:!0})};var xn=$;n();n();n();function oe(e={}){return{type:"token_refresh",handler:async()=>({token:await la(e)})}}async function la(e){return L([],{noPrompt:e.noPrompt})}n();var Nt={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},Ke=Object.keys(Nt),Tn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var _n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var In={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var pa=2,fa=300*1e3;function ha(e){switch(e){case"CALLING_CORE":return"Initiating store creation...";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready...";case"FINALIZING":return"Finalizing store setup...";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function En(e){let{organization:t,name:o,plan:r}=e,i=await L(),a=oe(),m=(await de({query:_n,token:i,organizationId:t.id,variables:{shopName:o,priceLookupKey:Nt[r],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview},unauthorizedHandler:a})).createAppDevelopmentStore;if(!m)throw new d("Store creation failed: unexpected empty response.");let p=m.userErrors;if(p&&p.length>0){let g=p.map(x=>x.message).join(", ");throw new d(`Failed to create development store: ${g}`)}let{shopDomain:h,shopAdminUrl:A}=m;if(!h)throw new d("Store creation succeeded but no shop domain was returned.");await R({title:c`Waiting for store to be ready...`,task:async g=>{let x=Date.now();for(;;){if(Date.now()-x>fa)throw new d("Store creation timed out after 5 minutes.");let l=(await de({query:In,token:i,organizationId:t.id,variables:{shopDomain:h},unauthorizedHandler:a})).organization?.storeCreation?.status;if(!l)throw new d("Unable to determine store creation status.");if(l==="COMPLETE")return;if(l==="FAILED"||l==="TIMED_OUT"||l==="USER_ERROR")throw new d(`Store creation failed with status: ${l}`);g(c`${ha(l)}`),await no(pa)}},renderOptions:{stdout:process.stderr}}),e.json?v(JSON.stringify({store:{name:o,domain:h,adminUrl:A,plan:r,...e.featurePreview?{featurePreview:e.featurePreview}:{},demoData:e.withDemoData??!1},organization:{id:t.id,name:t.businessName}},null,2)):b({headline:`Development store "${o}" created successfully.`,body:[`Domain: ${h}`,`Admin: ${A??"N/A"}`,`Plan: ${r}`,...e.featurePreview?[`Feature preview: ${e.featurePreview}`]:[],`Demo data: ${e.withDemoData?"enabled":"disabled"}`]})}n();var ga={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};async function Nn(){return to({message:"Name for the new development store"})}async function On(){return Zt({message:"Which Shopify plan do you want to use?",choices:Ke.map(e=>({label:ga[e],value:e}))})}var Oe=U(ae(),1),Ot,j=class extends he{async run(){let{flags:t}=await this.parse(Ot);this.failMissingNonTTYFlags(t,["name","organization-id","plan"]);let o=await Xo(t["organization-id"]?.toString()),r=t.name??await Nn(),i=t.plan??await On();try{await En({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:t["with-demo-data"],json:t.json})}catch(a){throw t.json&&a instanceof d&&(v(JSON.stringify({error:!0,message:a.message,nextSteps:a.nextSteps??[],exitCode:1},null,2)),process.exit(1)),a}}};Ot=j;j.hidden=!0;j.summary="Create a new development store.";j.descriptionWithMarkdown="Creates a new app development store in your organization.";j.description=Ot.descriptionWithoutMarkdown();j.flags={...y,..._,name:Oe.Flags.string({description:"Name for the new development store.",env:"SHOPIFY_FLAG_STORE_NAME"}),"organization-id":w["organization-id"],plan:Oe.Flags.string({description:"The Shopify plan to use for the new development store.",options:Ke,env:"SHOPIFY_FLAG_STORE_PLAN"}),"feature-preview":Oe.Flags.string({description:"The handle of a feature preview to enable on the new development store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"with-demo-data":Oe.Flags.boolean({description:"Populate the new development store with demo data.",default:!1,env:"SHOPIFY_FLAG_STORE_WITH_DEMO_DATA"})};var Pn=j;n();n();n();var Sa="X-Shopify-CLI-Instance",ya="X-Shopify-CLI-Version",Pt;function ka(){return Pt??(Pt=new Yt({projectName:"shopify-cli-store"})),Pt}var Pe=class extends d{constructor(t,o,r){super(o,r??null),this.status=t}};function Fn(e=ka()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=le();return e.set("cliInstanceId",o),o}function Cn(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${dt}`,[Sa]:e,[ya]:dt}}function wa(e){return Cn(e)}function va(e,t){return{...Cn(e),authorization:t,"X-Shopify-Access-Token":t}}async function Dn(e,t={}){let r=`https://${await pt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await lt(r,{method:"POST",headers:wa(Fn(t.storage)),body:i}),u=await a.text();if(!a.ok){let p=ba(a.status,u);throw new d(p.message,p.tryMessage)}let m;try{m=JSON.parse(u)}catch(p){let h=p instanceof Error?p.message:"Unknown error";throw new d("Preview store creation returned a non-JSON response.",`Parse error: ${h}. Body (truncated): ${Xe(u).slice(0,500)}`)}return xa(m)}async function Ln(e,t={}){let r=`https://${await pt()}/services/preview-stores/${e.shopId}`,i=await lt(r,{method:"GET",headers:va(Fn(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=Aa(i.status,a);throw new Pe(i.status,m.message,m.tryMessage)}let u;try{u=JSON.parse(a)}catch(m){let p=m instanceof Error?m.message:"Unknown error";throw new d("Preview store lookup returned a non-JSON response.",`Parse error: ${p}. Body (truncated): ${Xe(a).slice(0,500)}`)}return Ta(u)}function ba(e,t){let o=Rn(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=Xe(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Rn(e){if(e.length===0)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object")return{};let o=t;return{...typeof o.error_code=="string"?{error_code:o.error_code}:{},...typeof o.message=="string"?{message:o.message}:{}}}catch(t){if(t instanceof SyntaxError)return{};throw t}}function Aa(e,t){let o=Rn(t),r=Xe(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function xa(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?E(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,u=typeof e.access_url=="string"?e.access_url:void 0,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,p=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(h=>typeof h=="string"):void 0;if(!o||!r||!i||!a||!u||!p)throw new d("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(_a(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:p,accessUrl:u,...m?{placeholderAccountUuid:m}:{}}}function Ta(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?E(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,u=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new d("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(Ia(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...u?{claimUrl:u}:{}}}function _a(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Xe(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function Ia(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var Ea={createPreviewStore:Dn,setStoredStoreAppSession:ge,recordStoreFqdnMetadata:N,setLastSeenUserId:C,now:()=>new Date};async function qn(e,t={}){let o={...Ea,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Oa(r,e.country,o)}function Na(e){return e.placeholderAccountUuid??e.shop.id}async function Oa(e,t,o){let r=o.now().toISOString(),i=Na(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:q,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl}}}n();function $n(e,t){if(t==="json"){v(JSON.stringify(Pa(e),null,2));return}Fa(e)}function Pa(e){return{status:e.status,message:e.message,store:e.store,next_steps:Un(e).map(t=>t.json)}}function Un(e){return[{json:`Use \`shopify store open --store ${e.store.subdomain}\` to preview the storefront.`,text:["Use ",{command:`shopify store open --store ${e.store.subdomain}`}," to preview the storefront."]},{json:`Use \`shopify store execute --store ${e.store.subdomain}\` to add products, collections, pages, and more.`,text:["Use ",{command:`shopify store execute --store ${e.store.subdomain}`}," to add products, collections, pages, and more."]},{json:`Use \`shopify theme pull --store ${e.store.subdomain}\` and \`shopify theme push --store ${e.store.subdomain}\` to edit your store design.`,text:["Use ",{command:`shopify theme pull --store ${e.store.subdomain}`}," and ",{command:`shopify theme push --store ${e.store.subdomain}`}," to edit your store design."]}]}function Fa(e){b({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:Un(e).map(t=>t.text)}}}]})}var Mn=U(ae(),1),Ft,W=class extends k{async run(){let{flags:t}=await this.parse(Ft);t.country!==void 0&&!sn(t.country)&&this.error("Country must be a two-letter country code, for example: US.");let o=await R({title:c`Creating store`,task:async()=>qn({name:t.name,country:t.country})});$n(o,t.json?"json":"text")}};Ft=W;W.summary="Create a preview Shopify store.";W.descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";W.description=Ft.descriptionWithoutMarkdown();W.examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];W.flags={...y,..._,name:Mn.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:dn.country};var zn=W;n();n();n();var Hn=U(xi(),1);async function Ca(e){if(e.query!==void 0){if(!e.query.trim())throw new d("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await Te(e.queryFile))throw new d(c`Query file not found at ${s.path(e.queryFile)}. Please check the path and try again.`);let t=await xe(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new d(c`Query file at ${s.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new ee("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}async function Da(e,t){if(e)try{return JSON.parse(e)}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new d(c`Invalid JSON in ${s.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(t){if(!await Te(t))throw new d(c`Variable file not found at ${s.path(t)}. Please check the path and try again.`);let o=await xe(t,{encoding:"utf8"});try{return JSON.parse(o)}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw new d(c`Invalid JSON in variable file ${s.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function La(e){let t;try{t=(0,Hn.parse)(e)}catch(r){throw r instanceof Error?new d(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new d("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function Ra(e){return e.operationDefinition.operation==="mutation"}function qa(e,t=!1){if(Ra(e)&&!t)throw new d("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Bn(e){let t=await Ca({query:e.query,queryFile:e.queryFile}),o=La(t);qa(o,e.allowMutations);let r=await Da(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Ct(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Gn(e){if(!Ct(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Vn=["the user aborted a request","the operation was aborted"];function $a(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Vn.some(o=>t.includes(o))}function Fe(e,t){if(Gn(e)===402)return new d(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if($a(e))return new d(`Request to ${t} was aborted before it completed.`)}function Ce(e,t){let o=Gn(e);o!==401&&o!==404||(t.kind!=="preview"&&Ue(t.store,t.userId),Qe(t))}var Ua=`
94
+ Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;G.description=Tt.descriptionWithoutMarkdown();G.examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];G.flags={...y,store:w.store,...mn};var kn=G;n();n();async function wn(e){let{store:t,operationId:o}=e,r=await me(t);T({headline:"Checking bulk operation status.",body:[{list:{items:ue({storeFqdn:r.storeFqdn})}}]});let i=await Mo({adminSession:r,operationId:o,version:await Ee({adminSession:r,minimumDefaultVersion:Ie})});i?aa(i):Z({headline:"Bulk operation not found.",body:c`ID: ${s.yellow(o)}`.value})}async function vn(e){let{store:t}=e,o=await me(t);T({headline:"Listing bulk operations.",body:[{list:{items:ue({storeFqdn:o.storeFqdn})}}]});let i=(await zo({adminSession:o,version:await Ee({adminSession:o,minimumDefaultVersion:Ie})})).map(a=>({id:Se(a.id),status:da(a.status),count:ca(a.objectCount),dateCreated:ct(new Date(String(a.createdAt))),dateFinished:a.completedAt?ct(new Date(String(a.completedAt))):"",results:ua(a.url??a.partialDataUrl)}));gt(),i.length===0?T({body:"No bulk operations found in the last 7 days."}):fe({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),gt()}function aa(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:u}=e,m=Me(e).value,l=sa(r,i),h=c`ID: ${s.yellow(t)}\n${l}`.value;if(o==="COMPLETED"){let A=a?s.link("Download results",a):"";b({headline:m,body:c`${h}\n${A}`.value})}else if(o==="FAILED"){let A=u?s.link("Download partial results",u):"";Z({headline:m,body:c`${h}\n${A}`.value})}else T({headline:m,body:h})}function sa(e,t){let o=new Date;return t?`Finished ${ut(new Date(String(t)),o)}`:`Started ${ut(new Date(String(e)),o)}`}function da(e){return e==="COMPLETED"?qe.green(e):e==="FAILED"?qe.red(e):qe.dim(e)}function ca(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ua(e){return e?c`${s.link("download",e)}`.value:""}var _t,V=class extends k{async run(){let{flags:t}=await this.parse(_t);t.id?await wn({store:t.store,operationId:t.id}):await vn({store:t.store})}};_t=V;V.summary="Check the status of bulk operations on a store.";V.descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";V.description=_t.descriptionWithoutMarkdown();V.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];V.flags={...y,store:w.store,id:cn};var bn=V;n();var It=U(ae(),1),Et,$=class extends k{async run(){let{flags:t}=await this.parse(Et);await Ye({store:t.store,scopes:t.scopes,signup:t.signup},{presenter:we(t.json?"json":"text")})}};Et=$;$.hidden=!0;$.summary="Authenticate for store commands.";$.descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup.";$.description=Et.descriptionWithoutMarkdown();$.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];$.flags={...y,..._,store:w.store,scopes:It.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:It.Flags.string({description:"Provide JWT for the store.",env:"SHOPIFY_FLAG_SIGNUP",required:!0})};var An=$;n();n();n();function oe(e={}){return{type:"token_refresh",handler:async()=>({token:await ma(e)})}}async function ma(e){return L([],{noPrompt:e.noPrompt})}n();var Nt={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},Ke=Object.keys(Nt),xn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var Tn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var _n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var pa=2,la=300*1e3;function fa(e){switch(e){case"CALLING_CORE":return"Initiating store creation...";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready...";case"FINALIZING":return"Finalizing store setup...";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function In(e){let{organization:t,name:o,plan:r}=e,i=await L(),a=oe(),m=(await de({query:Tn,token:i,organizationId:t.id,variables:{shopName:o,priceLookupKey:Nt[r],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview},unauthorizedHandler:a})).createAppDevelopmentStore;if(!m)throw new d("Store creation failed: unexpected empty response.");let l=m.userErrors;if(l&&l.length>0){let g=l.map(x=>x.message).join(", ");throw new d(`Failed to create development store: ${g}`)}let{shopDomain:h,shopAdminUrl:A}=m;if(!h)throw new d("Store creation succeeded but no shop domain was returned.");await R({title:c`Waiting for store to be ready...`,task:async g=>{let x=Date.now();for(;;){if(Date.now()-x>la)throw new d("Store creation timed out after 5 minutes.");let p=(await de({query:_n,token:i,organizationId:t.id,variables:{shopDomain:h},unauthorizedHandler:a})).organization?.storeCreation?.status;if(!p)throw new d("Unable to determine store creation status.");if(p==="COMPLETE")return;if(p==="FAILED"||p==="TIMED_OUT"||p==="USER_ERROR")throw new d(`Store creation failed with status: ${p}`);g(c`${fa(p)}`),await no(pa)}},renderOptions:{stdout:process.stderr}}),e.json?v(JSON.stringify({store:{name:o,domain:h,adminUrl:A,plan:r,...e.featurePreview?{featurePreview:e.featurePreview}:{},demoData:e.withDemoData??!1},organization:{id:t.id,name:t.businessName}},null,2)):b({headline:`Development store "${o}" created successfully.`,body:[`Domain: ${h}`,`Admin: ${A??"N/A"}`,`Plan: ${r}`,...e.featurePreview?[`Feature preview: ${e.featurePreview}`]:[],`Demo data: ${e.withDemoData?"enabled":"disabled"}`]})}n();var ha={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};async function En(){return to({message:"Name for the new development store"})}async function Nn(){return Zt({message:"Which Shopify plan do you want to use?",choices:Ke.map(e=>({label:ha[e],value:e}))})}var Oe=U(ae(),1),Ot,j=class extends he{async run(){let{flags:t}=await this.parse(Ot);this.failMissingNonTTYFlags(t,["name","organization-id","plan"]);let o=await Ko(t["organization-id"]?.toString()),r=t.name??await En(),i=t.plan??await Nn();try{await In({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:t["with-demo-data"],json:t.json})}catch(a){throw t.json&&a instanceof d&&(v(JSON.stringify({error:!0,message:a.message,nextSteps:a.nextSteps??[],exitCode:1},null,2)),process.exit(1)),a}}};Ot=j;j.hidden=!0;j.summary="Create a new development store.";j.descriptionWithMarkdown="Creates a new app development store in your organization.";j.description=Ot.descriptionWithoutMarkdown();j.flags={...y,..._,name:Oe.Flags.string({description:"Name for the new development store.",env:"SHOPIFY_FLAG_STORE_NAME"}),"organization-id":w["organization-id"],plan:Oe.Flags.string({description:"The Shopify plan to use for the new development store.",options:Ke,env:"SHOPIFY_FLAG_STORE_PLAN"}),"feature-preview":Oe.Flags.string({description:"The handle of a feature preview to enable on the new development store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"with-demo-data":Oe.Flags.boolean({description:"Populate the new development store with demo data.",default:!1,env:"SHOPIFY_FLAG_STORE_WITH_DEMO_DATA"})};var On=j;n();n();n();var ga="X-Shopify-CLI-Instance",Sa="X-Shopify-CLI-Version",Pt;function ya(){return Pt??(Pt=new Yt({projectName:"shopify-cli-store"})),Pt}var Pe=class extends d{constructor(t,o,r){super(o,r??null),this.status=t}};function Pn(e=ya()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=pe();return e.set("cliInstanceId",o),o}function Fn(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${dt}`,[ga]:e,[Sa]:dt}}function ka(e){return Fn(e)}function wa(e,t){return{...Fn(e),authorization:t,"X-Shopify-Access-Token":t}}async function Cn(e,t={}){let r=`https://${await lt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await pt(r,{method:"POST",headers:ka(Pn(t.storage)),body:i}),u=await a.text();if(!a.ok){let l=va(a.status,u);throw new d(l.message,l.tryMessage)}let m;try{m=JSON.parse(u)}catch(l){let h=l instanceof Error?l.message:"Unknown error";throw new d("Preview store creation returned a non-JSON response.",`Parse error: ${h}. Body (truncated): ${Xe(u).slice(0,500)}`)}return Aa(m)}async function Dn(e,t={}){let r=`https://${await lt()}/services/preview-stores/${e.shopId}`,i=await pt(r,{method:"GET",headers:wa(Pn(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=ba(i.status,a);throw new Pe(i.status,m.message,m.tryMessage)}let u;try{u=JSON.parse(a)}catch(m){let l=m instanceof Error?m.message:"Unknown error";throw new d("Preview store lookup returned a non-JSON response.",`Parse error: ${l}. Body (truncated): ${Xe(a).slice(0,500)}`)}return xa(u)}function va(e,t){let o=Ln(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=Xe(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Ln(e){if(e.length===0)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object")return{};let o=t;return{...typeof o.error_code=="string"?{error_code:o.error_code}:{},...typeof o.message=="string"?{message:o.message}:{}}}catch(t){if(t instanceof SyntaxError)return{};throw t}}function ba(e,t){let o=Ln(t),r=Xe(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function Aa(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?E(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,u=typeof e.access_url=="string"?e.access_url:void 0,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,l=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(h=>typeof h=="string"):void 0;if(!o||!r||!i||!a||!u||!l)throw new d("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(Ta(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:l,accessUrl:u,...m?{placeholderAccountUuid:m}:{}}}function xa(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?E(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,u=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new d("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(_a(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...u?{claimUrl:u}:{}}}function Ta(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Xe(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function _a(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var Ia={createPreviewStore:Cn,setStoredStoreAppSession:ge,recordStoreFqdnMetadata:N,setLastSeenUserId:C,now:()=>new Date};async function Rn(e,t={}){let o={...Ia,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Na(r,e.country,o)}function Ea(e){return e.placeholderAccountUuid??e.shop.id}async function Na(e,t,o){let r=o.now().toISOString(),i=Ea(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:q,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl}}}n();function qn(e,t){if(t==="json"){v(JSON.stringify(Oa(e),null,2));return}Pa(e)}function Oa(e){return{status:e.status,message:e.message,store:e.store,next_steps:$n(e).map(t=>t.json)}}function $n(e){return[{json:`Use \`shopify store open --store ${e.store.subdomain}\` to preview the storefront.`,text:["Use ",{command:`shopify store open --store ${e.store.subdomain}`}," to preview the storefront."]},{json:`Use \`shopify store execute --store ${e.store.subdomain}\` to add products, collections, pages, and more.`,text:["Use ",{command:`shopify store execute --store ${e.store.subdomain}`}," to add products, collections, pages, and more."]},{json:`Use \`shopify theme pull --store ${e.store.subdomain}\` and \`shopify theme push --store ${e.store.subdomain}\` to edit your store design.`,text:["Use ",{command:`shopify theme pull --store ${e.store.subdomain}`}," and ",{command:`shopify theme push --store ${e.store.subdomain}`}," to edit your store design."]}]}function Pa(e){b({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:$n(e).map(t=>t.text)}}}]})}var Un=U(ae(),1),Ft,W=class extends k{async run(){let{flags:t}=await this.parse(Ft);t.country!==void 0&&!an(t.country)&&this.error("Country must be a two-letter country code, for example: US.");let o=await R({title:c`Creating store`,task:async()=>Rn({name:t.name,country:t.country})});qn(o,t.json?"json":"text")}};Ft=W;W.summary="Create a preview Shopify store.";W.descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";W.description=Ft.descriptionWithoutMarkdown();W.examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];W.flags={...y,..._,name:Un.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:sn.country};var Mn=W;n();n();n();var zn=U(Ai(),1);async function Fa(e){if(e.query!==void 0){if(!e.query.trim())throw new d("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await Te(e.queryFile))throw new d(c`Query file not found at ${s.path(e.queryFile)}. Please check the path and try again.`);let t=await xe(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new d(c`Query file at ${s.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new ee("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}async function Ca(e,t){if(e)try{return JSON.parse(e)}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new d(c`Invalid JSON in ${s.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(t){if(!await Te(t))throw new d(c`Variable file not found at ${s.path(t)}. Please check the path and try again.`);let o=await xe(t,{encoding:"utf8"});try{return JSON.parse(o)}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw new d(c`Invalid JSON in variable file ${s.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function Da(e){let t;try{t=(0,zn.parse)(e)}catch(r){throw r instanceof Error?new d(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new d("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function La(e){return e.operationDefinition.operation==="mutation"}function Ra(e,t=!1){if(La(e)&&!t)throw new d("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Hn(e){let t=await Fa({query:e.query,queryFile:e.queryFile}),o=Da(t);Ra(o,e.allowMutations);let r=await Ca(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Ct(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Bn(e){if(!Ct(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Gn=["the user aborted a request","the operation was aborted"];function qa(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Gn.some(o=>t.includes(o))}function Fe(e,t){if(Bn(e)===402)return new d(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(qa(e))return new d(`Request to ${t} was aborted before it completed.`)}function Ce(e,t){let o=Bn(e);o!==401&&o!==404||(t.kind!=="preview"&&Ue(t.store,t.userId),Qe(t))}var $a=`
95
95
  query StoreExecutePublicApiVersions {
96
96
  publicApiVersions {
97
97
  handle
98
98
  supported
99
99
  }
100
100
  }
101
- `;async function jn(e){try{return(await se({query:Ua,api:"Admin",url:ce(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){Ce(t,e.session);let o=Fe(t,e.adminSession.storeFqdn);throw o||t}}async function Wn(e){try{return await R({title:c`Executing GraphQL operation`,task:async()=>se({query:e.request.query,api:"Admin",url:ce(e.context.adminSession.storeFqdn,e.context.version,e.context.adminSession),token:e.context.adminSession.token,variables:e.request.parsedVariables,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}})}catch(t){Ce(t,e.context.session);let o=Fe(t,e.context.adminSession.storeFqdn);throw o||(Ct(t)&&t.response.errors?new d("GraphQL operation failed.",JSON.stringify({errors:t.response.errors},null,2)):t)}}n();async function Dt(e){let t=await D(E(e));return await N(t.store,!0),C(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function Ma(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await jn({adminSession:o,session:t});if(!r)return i.filter(m=>m.supported).map(m=>m.handle).sort().reverse()[0];let a=i.map(u=>u.handle);if(a.includes(r))return r;throw new d(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function Qn(e){let{adminSession:t,session:o}=await Dt(e.store),r=await Ma({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var za={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>Qn({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>Wn({context:e,request:t})};function Yn(e){if(e==="admin")return za;throw new ee(`Unsupported store GraphQL API target: ${e}`)}async function Jn(e){await N(e.store,!1);let t=Yn(e.api??"admin"),o=await Bn({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await R({title:c`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:r,request:o})}n();function Ha(e){return JSON.stringify(e,null,2)}function Kn(e){if(e){b({headline:"Operation succeeded.",body:`Results written to ${e}`});return}b({headline:"Operation succeeded."})}async function Xn(e,t,o="text"){let r=Ha(e);if(t){await Re(t,r),o==="text"&&Kn(t);return}o==="text"&&Kn(),v(r)}var re=U(ae(),1),Lt,Q=class extends k{async run(){let{flags:t}=await this.parse(Lt),o=await Jn({store:t.store,query:t.query,queryFile:t["query-file"],variables:t.variables,variableFile:t["variable-file"],version:t.version,allowMutations:t["allow-mutations"]});await Xn(o,t["output-file"],t.json?"json":"text")}};Lt=Q;Q.summary="Execute GraphQL queries and mutations on a store.";Q.descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";Q.description=Lt.descriptionWithoutMarkdown();Q.examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',`<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,'<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations','<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json'];Q.flags={...y,..._,query:re.Flags.string({char:"q",description:"The GraphQL query or mutation, as a string.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":re.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>ie(e),exactlyOne:["query","query-file"]}),variables:re.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES",exclusive:["variable-file"]}),"variable-file":re.Flags.string({description:"Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>ie(e),exclusive:["variables"]}),store:w.store,version:re.Flags.string({description:"The API version to use for the query or mutation. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"output-file":re.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async e=>ie(e)}),"allow-mutations":re.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var Zn=Q;n();n();async function ei(e){let t=Ba(e.store),o=Zo();await er({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,additionalReadyMessages:[c`Mutations are ${e.allowMutations?s.green("allowed"):s.yellow("blocked")}.`],abortSignal:e.abortSignal})}function Ba(e){return{getToken:async()=>(await D(e)).accessToken,refreshToken:async()=>(await D(e)).accessToken}}var Ze=U(ae(),1),Rt,Y=class extends k{async run(){let{flags:t}=await this.parse(Rt);await ei({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version})}};Rt=Y;Y.summary="Open a local GraphiQL UI for a store.";Y.descriptionWithMarkdown="Opens an authenticated Admin API GraphiQL UI for the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";Y.description=Rt.descriptionWithoutMarkdown();Y.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --allow-mutations","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];Y.flags={...y,store:w.store,port:co({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":Ze.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:Ze.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:Ze.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};var ti=Y;n();n();n();n();var oi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var De=class extends d{};async function ni(e){let t=e.token??await L([],{noPrompt:e.noPrompt}),o=oe({noPrompt:e.noPrompt}),r=M(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await ft({query:oi,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(h=>Va(h,r));if(!m)throw new De(`Couldn't find a store with domain ${e.store} for the current account.`,"Verify the domain (must be the canonical `myshopify.com` FQDN) and that you are signed in to an account with access to the store. Inactive shops are not searchable.");let p=await Ga(String(m.publicId),t,o);return{...p?{owningOrg:p}:{}}}async function Ga(e,t,o){try{let i=(await ft({query:ri,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?Jo(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${ja(r)}`);return}}function Va(e,t){return[e.primaryDomain,e.webUrl].some(o=>M(o)===t)}function ja(e){return e instanceof Error?e.message:String(e)}n();n();var ii={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"5"}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"developerPreviewHandle"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"ownerDetails"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function ai(e){let t=e.token??await L([],{noPrompt:e.noPrompt}),o=oe({noPrompt:e.noPrompt}),i=(await de({query:ii,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),u=i.map(m=>m.node).find(m=>M(m.primaryDomain)===a);if(!u)throw new ee(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return{shopifyShopId:u.shopifyShopId??void 0,name:u.name,primaryDomain:u.primaryDomain??void 0,storeType:u.storeType??void 0,developerPreviewHandle:u.developerPreviewHandle??void 0,planName:u.planName??void 0,ownerName:u.ownerDetails?.fullName??void 0,ownerEmail:u.ownerDetails?.email??void 0}}n();function si(e){if(e)return Tn[e.toLowerCase()]}n();var Wa={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client_transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function et(e){if(e)return Wa[e]}function di(e){return e?Ae(e):""}var Qa=`#graphql
101
+ `;async function Vn(e){try{return(await se({query:$a,api:"Admin",url:ce(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){Ce(t,e.session);let o=Fe(t,e.adminSession.storeFqdn);throw o||t}}async function jn(e){try{return await R({title:c`Executing GraphQL operation`,task:async()=>se({query:e.request.query,api:"Admin",url:ce(e.context.adminSession.storeFqdn,e.context.version,e.context.adminSession),token:e.context.adminSession.token,variables:e.request.parsedVariables,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}})}catch(t){Ce(t,e.context.session);let o=Fe(t,e.context.adminSession.storeFqdn);throw o||(Ct(t)&&t.response.errors?new d("GraphQL operation failed.",JSON.stringify({errors:t.response.errors},null,2)):t)}}n();async function Dt(e){let t=await D(E(e));return await N(t.store,!0),C(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function Ua(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await Vn({adminSession:o,session:t});if(!r)return i.filter(m=>m.supported).map(m=>m.handle).sort().reverse()[0];let a=i.map(u=>u.handle);if(a.includes(r))return r;throw new d(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function Wn(e){let{adminSession:t,session:o}=await Dt(e.store),r=await Ua({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var Ma={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>Wn({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>jn({context:e,request:t})};function Qn(e){if(e==="admin")return Ma;throw new ee(`Unsupported store GraphQL API target: ${e}`)}async function Yn(e){await N(e.store,!1);let t=Qn(e.api??"admin"),o=await Hn({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await R({title:c`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:r,request:o})}n();function za(e){return JSON.stringify(e,null,2)}function Jn(e){if(e){b({headline:"Operation succeeded.",body:`Results written to ${e}`});return}b({headline:"Operation succeeded."})}async function Kn(e,t,o="text"){let r=za(e);if(t){await Re(t,r),o==="text"&&Jn(t);return}o==="text"&&Jn(),v(r)}var re=U(ae(),1),Lt,Q=class extends k{async run(){let{flags:t}=await this.parse(Lt),o=await Yn({store:t.store,query:t.query,queryFile:t["query-file"],variables:t.variables,variableFile:t["variable-file"],version:t.version,allowMutations:t["allow-mutations"]});await Kn(o,t["output-file"],t.json?"json":"text")}};Lt=Q;Q.summary="Execute GraphQL queries and mutations on a store.";Q.descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";Q.description=Lt.descriptionWithoutMarkdown();Q.examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',`<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,'<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations','<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json'];Q.flags={...y,..._,query:re.Flags.string({char:"q",description:"The GraphQL query or mutation, as a string.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":re.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>ie(e),exactlyOne:["query","query-file"]}),variables:re.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES",exclusive:["variable-file"]}),"variable-file":re.Flags.string({description:"Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>ie(e),exclusive:["variables"]}),store:w.store,version:re.Flags.string({description:"The API version to use for the query or mutation. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"output-file":re.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async e=>ie(e)}),"allow-mutations":re.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var Xn=Q;n();n();async function Zn(e){let t=Ha(e.store),o=Xo();await Zo({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,additionalReadyMessages:[c`Mutations are ${e.allowMutations?s.green("allowed"):s.yellow("blocked")}.`],abortSignal:e.abortSignal})}function Ha(e){return{getToken:async()=>(await D(e)).accessToken,refreshToken:async()=>(await D(e)).accessToken}}var Ze=U(ae(),1),Rt,Y=class extends k{async run(){let{flags:t}=await this.parse(Rt);await Zn({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version})}};Rt=Y;Y.summary="Open a local GraphiQL UI for a store.";Y.descriptionWithMarkdown="Opens an authenticated Admin API GraphiQL UI for the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";Y.description=Rt.descriptionWithoutMarkdown();Y.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --allow-mutations","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];Y.flags={...y,store:w.store,port:co({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":Ze.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:Ze.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:Ze.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};var ei=Y;n();n();n();n();var ti={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var oi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var De=class extends d{};async function ri(e){let t=e.token??await L([],{noPrompt:e.noPrompt}),o=oe({noPrompt:e.noPrompt}),r=M(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await ft({query:ti,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(h=>Ga(h,r));if(!m)throw new De(`Couldn't find a store with domain ${e.store} for the current account.`,"Verify the domain (must be the canonical `myshopify.com` FQDN) and that you are signed in to an account with access to the store. Inactive shops are not searchable.");let l=await Ba(String(m.publicId),t,o);return{...l?{owningOrg:l}:{}}}async function Ba(e,t,o){try{let i=(await ft({query:oi,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?Yo(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${Va(r)}`);return}}function Ga(e,t){return[e.primaryDomain,e.webUrl].some(o=>M(o)===t)}function Va(e){return e instanceof Error?e.message:String(e)}n();n();var ni={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"5"}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"developerPreviewHandle"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"ownerDetails"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function ii(e){let t=e.token??await L([],{noPrompt:e.noPrompt}),o=oe({noPrompt:e.noPrompt}),i=(await de({query:ni,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),u=i.map(m=>m.node).find(m=>M(m.primaryDomain)===a);if(!u)throw new ee(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return{shopifyShopId:u.shopifyShopId??void 0,name:u.name,primaryDomain:u.primaryDomain??void 0,storeType:u.storeType??void 0,developerPreviewHandle:u.developerPreviewHandle??void 0,planName:u.planName??void 0,ownerName:u.ownerDetails?.fullName??void 0,ownerEmail:u.ownerDetails?.email??void 0}}n();function ai(e){if(e)return xn[e.toLowerCase()]}n();var ja={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client_transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function et(e){if(e)return ja[e]}function si(e){return e?Ae(e):""}var Wa=`#graphql
102
102
  query StoreInfoAdminShop {
103
103
  shop {
104
104
  id
@@ -112,11 +112,11 @@ Re-run this command if the stored token is missing, expires, or no longer has th
112
112
  }
113
113
  }
114
114
  }
115
- `;async function tt(e){let t=e.store;if(!t)throw new d("No store specified.","Pass the `myshopify.com` domain via the `--store` flag, e.g. `shopify store info --store shop.myshopify.com`.");let o=te(t);if(Xa(o)){await N(o.store,!0,o.preview.shopId),C(o.userId);let i=await Za(o);return as({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await Ja(t,{noPrompt:r})}catch(i){if(!r||!ts(i))throw i;return f(`BP store info lookup failed; falling back to stored store auth: ${rs(i)}`),Ya(t)}}async function Ya(e){let t=await D(e);await N(t.store,!0),C(t.userId);let o=await Ka(t);return ns({store:t.store,shop:o})}async function Ja(e,t={}){let o=await ni({store:e,noPrompt:t.noPrompt}),r=await es(o,e,{noPrompt:t.noPrompt});return is({store:e,destinationsCtx:o,orgShop:r})}async function Ka(e){try{let t=await se({query:Qa,api:"Admin",url:ce(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!t.shop)throw new d(`Shopify did not return store information for ${e.store}.`);return t.shop}catch(t){Ce(t,e);let o=Fe(t,e.store);throw o||t}}function Xa(e){return e?.kind==="preview"&&e.preview!==void 0}async function Za(e){try{let t=await Ln({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof Pe&&(t.status===401||t.status===404)&&Qe(e),t}}async function es(e,t,o={}){if(!e.owningOrg?.id){f("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await ai({store:t,organizationId:e.owningOrg.id,noPrompt:o.noPrompt})}catch(r){f(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function ts(e){return e instanceof De||os(e)}function os(e){return e instanceof d&&e.message.includes("unable to prompt for reauthentication")}function rs(e){return e instanceof Error?e.message:String(e)}function ns(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:ss(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:ui(St(r))};return{...pe(i),subdomain:r}}function is(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:ci(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:ds(r),type:et(r?.storeType),plan:si(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:ui(St(t))};return{...pe(i),subdomain:t}}function as(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:ci(o.preview.shopId),displayName:o.preview.name,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...pe(i),subdomain:t,authScopes:o.scopes}}function ci(e){if(e)return`gid://shopify/Shop/${e}`}function ss(e){let t=pe({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function ds(e){if(!e)return;let t=pe({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function ui(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();function mi(e,t){if(t==="json"){v(JSON.stringify(e,null,2));return}let o=us(e);T({customSections:[{title:"Store details",body:{tabularData:cs(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function cs(e){let t=[];return ne(t,"ID",e.id),ne(t,"Display Name",e.displayName),ne(t,"Subdomain",e.subdomain),ne(t,"Organization",e.organizationName),ne(t,"Store owner",ms(e.storeOwner)),ne(t,"Type",e.type?Ae(e.type):void 0),ne(t,"Plan",e.plan?Ae(e.plan):void 0),ne(t,"Feature Preview",e.featurePreview),t}function us(e){let t=[];return qt(t,e.adminUrl,"Manage this store in the Shopify admin"),qt(t,e.accessUrl,"View your store"),qt(t,e.saveUrl,"Save your store"),t}function ms(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function ne(e,t,o){o&&e.push([t,o])}function qt(e,t,o){t&&e.push({link:{label:o,url:t}})}var $t,J=class extends k{async run(){let{flags:t}=await this.parse($t),o=await tt({store:t.store});mi(o,t.json?"json":"text")}};$t=J;J.summary="Surface metadata about a Shopify store.";J.descriptionWithMarkdown=`Returns available metadata about a store you have access to, such as its id, display name, subdomain, organization, store owner, type, plan, feature preview, admin URL, and access and save URLs for preview stores.
115
+ `;async function tt(e){let t=e.store;if(!t)throw new d("No store specified.","Pass the `myshopify.com` domain via the `--store` flag, e.g. `shopify store info --store shop.myshopify.com`.");let o=te(t);if(Ka(o)){await N(o.store,!0,o.preview.shopId),C(o.userId);let i=await Xa(o);return is({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await Ya(t,{noPrompt:r})}catch(i){if(!r||!es(i))throw i;return f(`BP store info lookup failed; falling back to stored store auth: ${os(i)}`),Qa(t)}}async function Qa(e){let t=await D(e);await N(t.store,!0),C(t.userId);let o=await Ja(t);return rs({store:t.store,shop:o})}async function Ya(e,t={}){let o=await ri({store:e,noPrompt:t.noPrompt}),r=await Za(o,e,{noPrompt:t.noPrompt});return ns({store:e,destinationsCtx:o,orgShop:r})}async function Ja(e){try{let t=await se({query:Wa,api:"Admin",url:ce(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!t.shop)throw new d(`Shopify did not return store information for ${e.store}.`);return t.shop}catch(t){Ce(t,e);let o=Fe(t,e.store);throw o||t}}function Ka(e){return e?.kind==="preview"&&e.preview!==void 0}async function Xa(e){try{let t=await Dn({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof Pe&&(t.status===401||t.status===404)&&Qe(e),t}}async function Za(e,t,o={}){if(!e.owningOrg?.id){f("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await ii({store:t,organizationId:e.owningOrg.id,noPrompt:o.noPrompt})}catch(r){f(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function es(e){return e instanceof De||ts(e)}function ts(e){return e instanceof d&&e.message.includes("unable to prompt for reauthentication")}function os(e){return e instanceof Error?e.message:String(e)}function rs(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:as(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:ci(St(r))};return{...le(i),subdomain:r}}function ns(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:di(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:ss(r),type:et(r?.storeType),plan:ai(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:ci(St(t))};return{...le(i),subdomain:t}}function is(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:di(o.preview.shopId),displayName:o.preview.name,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...le(i),subdomain:t,authScopes:o.scopes}}function di(e){if(e)return`gid://shopify/Shop/${e}`}function as(e){let t=le({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function ss(e){if(!e)return;let t=le({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function ci(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();function ui(e,t){if(t==="json"){v(JSON.stringify(e,null,2));return}let o=cs(e);T({customSections:[{title:"Store details",body:{tabularData:ds(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function ds(e){let t=[];return ne(t,"ID",e.id),ne(t,"Display Name",e.displayName),ne(t,"Subdomain",e.subdomain),ne(t,"Organization",e.organizationName),ne(t,"Store owner",us(e.storeOwner)),ne(t,"Type",e.type?Ae(e.type):void 0),ne(t,"Plan",e.plan?Ae(e.plan):void 0),ne(t,"Feature Preview",e.featurePreview),t}function cs(e){let t=[];return qt(t,e.adminUrl,"Manage this store in the Shopify admin"),qt(t,e.accessUrl,"View your store"),qt(t,e.saveUrl,"Save your store"),t}function us(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function ne(e,t,o){o&&e.push([t,o])}function qt(e,t,o){t&&e.push({link:{label:o,url:t}})}var $t,J=class extends k{async run(){let{flags:t}=await this.parse($t),o=await tt({store:t.store});ui(o,t.json?"json":"text")}};$t=J;J.summary="Surface metadata about a Shopify store.";J.descriptionWithMarkdown=`Returns available metadata about a store you have access to, such as its id, display name, subdomain, organization, store owner, type, plan, feature preview, admin URL, and access and save URLs for preview stores.
116
116
 
117
117
  Some details may be omitted when they are not available for the store.
118
118
 
119
- Use \`--json\` for machine-readable output.`;J.description=$t.descriptionWithoutMarkdown();J.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];J.flags={...y,..._,store:w.store};var li=J;n();n();n();n();n();var pi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_STATUS"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"active",block:!1}}]}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function fi(e){let{entries:t,hasMore:o}=await ls(e.token,e.organization);return{entries:t.sort(fs),hasMore:o}}async function ls(e,t){let o=oe(),i=(await de({query:pi,token:e,organizationId:t.id,variables:{first:250},unauthorizedHandler:o})).organization?.accessibleShops;if(!i)return{entries:[],hasMore:!1};let a=[];for(let u of i.edges){let m=ps(u.node,t);m&&a.push(m)}return{entries:a,hasMore:i.pageInfo.hasNextPage}}function ps(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:M(o)??o,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:et(e.storeType)}}function fs(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function hi(e={}){let t=await L(),o=await Ko(t);if(!o.currentUserResolved)return{stores:[],source:"organization",notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[],source:"organization"};if(!e.organizationId&&o.organizations.length>1&&!oo())throw new d("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await hs(o.organizations,e.organizationId),i=await fi({token:t,organization:r}),{stores:a,truncated:u}=Ss(i.entries,i.hasMore);return{stores:a,source:"organization",organization:gs(r),...u?{truncated:!0}:{}}}async function hs(e,t){if(t){let a=e.find(u=>u.id===t.toString());if(!a)throw new d(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(u=>`${u.businessName} (${u.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await eo({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function gs(e){return{id:e.id,name:e.businessName}}function Ss(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();function gi(e,t){if(e.notice&&ht(e.notice),e.truncated&&ht(ys(e)),t==="json"){v(JSON.stringify({stores:e.stores,...e.organization?{organization:e.organization}:{},...e.notice?{notice:e.notice}:{},...e.truncated?{truncated:!0}:{}},null,2));return}ks(e)}function ys(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent stores${t}. More stores exist.`}function ks(e){if(e.stores.length===0){P(vs(e));return}e.organization&&P(`Organization: ${e.organization.name} (${e.organization.id})`),ws(e.stores),P("To list stores authenticated directly with `shopify store auth`, run `shopify store auth list`.")}function ws(e){fe({rows:e.map(t=>({subdomain:bs(t.store),name:t.name??"",type:di(t.type),created:Ve(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},created:{header:"Created"}}})}function vs(e){return e.notice?["No stores were returned for the current CLI session.","","Run `shopify store auth list` to list stores authenticated directly with `shopify store auth`."].join(`
119
+ Use \`--json\` for machine-readable output.`;J.description=$t.descriptionWithoutMarkdown();J.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];J.flags={...y,..._,store:w.store};var mi=J;n();n();n();n();n();var pi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_STATUS"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"active",block:!1}}]}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function li(e){let{entries:t,hasMore:o}=await ms(e.token,e.organization);return{entries:t.sort(ls),hasMore:o}}async function ms(e,t){let o=oe(),i=(await de({query:pi,token:e,organizationId:t.id,variables:{first:250},unauthorizedHandler:o})).organization?.accessibleShops;if(!i)return{entries:[],hasMore:!1};let a=[];for(let u of i.edges){let m=ps(u.node,t);m&&a.push(m)}return{entries:a,hasMore:i.pageInfo.hasNextPage}}function ps(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:M(o)??o,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:et(e.storeType)}}function ls(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function fi(e={}){let t=await L(),o=await Jo(t);if(!o.currentUserResolved)return{stores:[],source:"organization",notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[],source:"organization"};if(!e.organizationId&&o.organizations.length>1&&!oo())throw new d("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await fs(o.organizations,e.organizationId),i=await li({token:t,organization:r}),{stores:a,truncated:u}=gs(i.entries,i.hasMore);return{stores:a,source:"organization",organization:hs(r),...u?{truncated:!0}:{}}}async function fs(e,t){if(t){let a=e.find(u=>u.id===t.toString());if(!a)throw new d(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(u=>`${u.businessName} (${u.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await eo({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function hs(e){return{id:e.id,name:e.businessName}}function gs(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();function hi(e,t){if(e.notice&&ht(e.notice),e.truncated&&ht(Ss(e)),t==="json"){v(JSON.stringify({stores:e.stores,...e.organization?{organization:e.organization}:{},...e.notice?{notice:e.notice}:{},...e.truncated?{truncated:!0}:{}},null,2));return}ys(e)}function Ss(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent stores${t}. More stores exist.`}function ys(e){if(e.stores.length===0){P(ws(e));return}e.organization&&P(`Organization: ${e.organization.name} (${e.organization.id})`),ks(e.stores),P("To list stores authenticated directly with `shopify store auth`, run `shopify store auth list`.")}function ks(e){fe({rows:e.map(t=>({subdomain:vs(t.store),name:t.name??"",type:si(t.type),created:Ve(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},created:{header:"Created"}}})}function ws(e){return e.notice?["No stores were returned for the current CLI session.","","Run `shopify store auth list` to list stores authenticated directly with `shopify store auth`."].join(`
120
120
  `):e.organization?`No stores found in ${e.organization.name}.`:["No stores found in your Shopify organization.","","Run `shopify store auth list` to list stores authenticated directly with `shopify store auth`."].join(`
121
- `)}function bs(e){return je(e)??e}var Ut,K=class extends k{async run(){let{flags:t}=await this.parse(Ut),o=await hi({organizationId:t["organization-id"]});gi(o,t.json?"json":"text")}};Ut=K;K.summary="List stores in a Shopify organization.";K.descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`.\nIn non-interactive environments, `--organization-id` is required.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";K.description=Ut.descriptionWithoutMarkdown();K.examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --json"];K.flags={...y,..._,"organization-id":w["organization-id"]};var Si=K;n();n();var As={getStoreInfo:tt,openURL:$e};async function yi(e,t={}){let{getStoreInfo:o,openURL:r}={...As,...t},i=await o({store:e.store}),a=xs(i);if(await r(a)){T({headline:`Opening the storefront for ${e.store} in your browser.`});return}T({headline:"Browser didn't open automatically. Open the storefront manually:",body:[c`${s.link(a,a)}`.value]})}function xs(e){return e.accessUrl??`https://${e.subdomain}`}var Mt,X=class extends k{async run(){let{flags:t}=await this.parse(Mt);await yi({store:t.store})}};Mt=X;X.summary="Open your Shopify store in the default web browser.";X.descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";X.description=Mt.descriptionWithoutMarkdown();X.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];X.flags={...y,store:w.store};var ki=X;var Ts={"store:auth:list":Hr,"store:auth":fn,"store:bulk:cancel":Sn,"store:bulk:execute":wn,"store:bulk:status":An,"store:stripe-auth":xn,"store:create:dev":Pn,"store:create:preview":zn,"store:execute":Zn,"store:graphiql":ti,"store:info":li,"store:list":Si,"store:open":ki},ot=Ts;n();n();var _s=async e=>{or(),process.env.COMMAND_RUN_ID=le()},wi=_s;var rt={"app:build":rr,"app:bulk:cancel":nr,"app:bulk:status":ir,"app:deploy":ur,"app:dev":mr,"app:dev:clean":Dr,"app:logs":lr,"app:logs:sources":pr,"app:import-custom-data-definitions":Rr,"app:import-extensions":Tr,"app:info":_r,"app:init":Ir,"app:config:validate":Er,"app:release":Nr,"app:config:link":ar,"app:config:use":sr,"app:config:pull":dr,"app:env:pull":fr,"app:env:show":hr,"app:execute":Sr,"app:graphiql":yr,"app:bulk:execute":gr,"app:function:build":kr,"app:function:replay":wr,"app:function:run":vr,"app:function:info":Lr,"app:function:schema":br,"app:function:typegen":Ar,"app:generate:extension":xr,"app:versions:list":Or,"app:webhook:trigger":Pr,"demo:watcher":cr,"organization:list":qr},Is=Cr,Es=wi,Ns=Fr;import Os from"fs";var aS=tr.init;(0,bi.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof ro?Xt(e):Os.writeSync(process.stderr.fd,`${e.stack??e.message??e}
122
- `),process.exit(1)});var Ps=["SIGINT","SIGTERM","SIGQUIT"];Ps.forEach(e=>{process.on(e,()=>{process.exit(1)})});var vi=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(vi)||(process.stdout.columns=vi);async function Fs({development:e}){await so({moduleURL:import.meta.url,development:e})}ke.plugins.hidden=!0;ke["plugins:install"].description="";var Cs=Object.keys(rt);Cs.forEach(e=>{rt[e].customPluginName="@shopify/app"});var Ds=Object.keys(ze);Ds.forEach(e=>{ze[e].customPluginName="@shopify/theme"});var Ls=Object.keys(He);Ls.forEach(e=>{He[e].customPluginName="@shopify/cli-hydrogen"});var Rs=Object.keys(ot);Rs.forEach(e=>{ot[e].customPluginName="@shopify/store"});var qs=Object.keys(Be);qs.forEach(e=>{Be[e].customPluginName="@oclif/plugin-commands"});var $s=Object.keys(Ge);$s.forEach(e=>{Ge[e].customPluginName="@shopify/plugin-did-you-mean"});var Us=Object.keys(ke);Us.forEach(e=>{ke[e].customPluginName="@oclif/plugin-plugins"});var sS={...rt,...ze,...ke,...Ge,...Be,...He,...ot,search:uo,upgrade:mo,version:ao,help:xo,"auth:logout":lo,"auth:login":po,"debug:command-flags":fo,"kitchen-sink":yo,"kitchen-sink:async":ho,"kitchen-sink:prompts":go,"kitchen-sink:static":So,"doctor-release":ko,"doctor-release:theme":wo,"doc:fetch":vo,"doc:search":bo,"docs:generate":Ao,"notifications:list":To,"notifications:generate":_o,"cache:clear":Io,"config:autoupgrade:off":Eo,"config:autoupgrade:on":No,"config:autoupgrade:status":Oo,"validate:components":Po,"validate:functions":Fo,"validate:graphql":Co,"validate:theme":Do,"skill:install":Lo},dS=Fs;export{Es as AppInitHook,Ns as AppPublicMetadataHook,Is as AppSensitiveMetadataHook,sS as COMMANDS,Oi as DidYouMeanHook,aS as HydrogenInitHook,Ni as PluginHook,Pi as TunnelProviderHook,Fi as TunnelStartHook,dS as default,_i as fetchStoreThemes,Ii as pull,Ei as push};
121
+ `)}function vs(e){return je(e)??e}var Ut,K=class extends k{async run(){let{flags:t}=await this.parse(Ut),o=await fi({organizationId:t["organization-id"]});hi(o,t.json?"json":"text")}};Ut=K;K.summary="List stores in a Shopify organization.";K.descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`.\nIn non-interactive environments, `--organization-id` is required.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";K.description=Ut.descriptionWithoutMarkdown();K.examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --json"];K.flags={...y,..._,"organization-id":w["organization-id"]};var gi=K;n();n();var bs={getStoreInfo:tt,openURL:$e};async function Si(e,t={}){let{getStoreInfo:o,openURL:r}={...bs,...t},i=await o({store:e.store}),a=As(i);if(await r(a)){T({headline:`Opening the storefront for ${e.store} in your browser.`});return}T({headline:"Browser didn't open automatically. Open the storefront manually:",body:[c`${s.link(a,a)}`.value]})}function As(e){return e.accessUrl??`https://${e.subdomain}`}var Mt,X=class extends k{async run(){let{flags:t}=await this.parse(Mt);await Si({store:t.store})}};Mt=X;X.summary="Open your Shopify store in the default web browser.";X.descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";X.description=Mt.descriptionWithoutMarkdown();X.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];X.flags={...y,store:w.store};var yi=X;var xs={"store:auth:list":zr,"store:auth":ln,"store:bulk:cancel":gn,"store:bulk:execute":kn,"store:bulk:status":bn,"store:stripe-auth":An,"store:create:dev":On,"store:create:preview":Mn,"store:execute":Xn,"store:graphiql":ei,"store:info":mi,"store:list":gi,"store:open":yi},ot=xs;n();n();var Ts=async e=>{tr(),process.env.COMMAND_RUN_ID=pe()},ki=Ts;var rt={"app:build":or,"app:bulk:cancel":rr,"app:bulk:status":nr,"app:deploy":cr,"app:dev":ur,"app:dev:clean":Cr,"app:logs":mr,"app:logs:sources":pr,"app:import-custom-data-definitions":Lr,"app:import-extensions":xr,"app:info":Tr,"app:init":_r,"app:config:validate":Ir,"app:release":Er,"app:config:link":ir,"app:config:use":ar,"app:config:pull":sr,"app:env:pull":lr,"app:env:show":fr,"app:execute":gr,"app:graphiql":Sr,"app:bulk:execute":hr,"app:function:build":yr,"app:function:replay":kr,"app:function:run":wr,"app:function:info":Dr,"app:function:schema":vr,"app:function:typegen":br,"app:generate:extension":Ar,"app:versions:list":Nr,"app:webhook:trigger":Or,"demo:watcher":dr,"organization:list":Rr},_s=Fr,Is=ki,Es=Pr;import Ns from"fs";var nS=er.init;(0,vi.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof ro?Xt(e):Ns.writeSync(process.stderr.fd,`${e.stack??e.message??e}
122
+ `),process.exit(1)});var Os=["SIGINT","SIGTERM","SIGQUIT"];Os.forEach(e=>{process.on(e,()=>{process.exit(1)})});var wi=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(wi)||(process.stdout.columns=wi);async function Ps({development:e}){await so({moduleURL:import.meta.url,development:e})}ke.plugins.hidden=!0;ke["plugins:install"].description="";var Fs=Object.keys(rt);Fs.forEach(e=>{rt[e].customPluginName="@shopify/app"});var Cs=Object.keys(ze);Cs.forEach(e=>{ze[e].customPluginName="@shopify/theme"});var Ds=Object.keys(He);Ds.forEach(e=>{He[e].customPluginName="@shopify/cli-hydrogen"});var Ls=Object.keys(ot);Ls.forEach(e=>{ot[e].customPluginName="@shopify/store"});var Rs=Object.keys(Be);Rs.forEach(e=>{Be[e].customPluginName="@oclif/plugin-commands"});var qs=Object.keys(Ge);qs.forEach(e=>{Ge[e].customPluginName="@shopify/plugin-did-you-mean"});var $s=Object.keys(ke);$s.forEach(e=>{ke[e].customPluginName="@oclif/plugin-plugins"});var iS={...rt,...ze,...ke,...Ge,...Be,...He,...ot,search:uo,upgrade:mo,version:ao,help:xo,"auth:logout":po,"auth:login":lo,"debug:command-flags":fo,"kitchen-sink":yo,"kitchen-sink:async":ho,"kitchen-sink:prompts":go,"kitchen-sink:static":So,"doctor-release":ko,"doctor-release:theme":wo,"doc:fetch":vo,"doc:search":bo,"docs:generate":Ao,"notifications:list":To,"notifications:generate":_o,"cache:clear":Io,"config:autoupgrade:off":Eo,"config:autoupgrade:on":No,"config:autoupgrade:status":Oo,"validate:components":Po,"validate:functions":Fo,"validate:graphql":Co,"validate:theme":Do},aS=Ps;export{Is as AppInitHook,Es as AppPublicMetadataHook,_s as AppSensitiveMetadataHook,iS as COMMANDS,Ni as DidYouMeanHook,nS as HydrogenInitHook,Ei as PluginHook,Oi as TunnelProviderHook,Pi as TunnelStartHook,aS as default,Ti as fetchStoreThemes,_i as pull,Ii as push};
@@ -1 +1 @@
1
- import{Ab as c,Bb as d,Cb as e,yb as a,zb as b}from"./chunk-KNLPWHHJ.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-E7Z7KYBR.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as currentProcessIsGlobal,e as getProjectDir,d as inferPackageManagerForGlobalCLI,c as installGlobalCLIPrompt,b as installGlobalShopifyCLI};
1
+ import{Ab as c,Bb as d,Cb as e,yb as a,zb as b}from"./chunk-YKQLGBJM.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-F5LI3LKB.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as currentProcessIsGlobal,e as getProjectDir,d as inferPackageManagerForGlobalCLI,c as installGlobalCLIPrompt,b as installGlobalShopifyCLI};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-E7Z7KYBR.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-VKWPEFWQ.js";export{h as alwaysLogAnalytics,i as alwaysLogMetrics,g as analyticsDisabled,j as canRunDoctorRelease,r as ciPlatform,p as cloudEnvironment,m as codespacePortForwardingDomain,l as codespaceURL,t as getThemeKitAccessDomain,k as gitpodURL,q as hasGit,b as homeDirectory,n as isCloudEnvironment,c as isDevelopment,e as isShopify,a as isTerminalInteractive,f as isUnitTest,d as isVerbose,s as macAddress,u as opentelemetryDomain,o as themeToken};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-F5LI3LKB.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-VKWPEFWQ.js";export{h as alwaysLogAnalytics,i as alwaysLogMetrics,g as analyticsDisabled,j as canRunDoctorRelease,r as ciPlatform,p as cloudEnvironment,m as codespacePortForwardingDomain,l as codespaceURL,t as getThemeKitAccessDomain,k as gitpodURL,q as hasGit,b as homeDirectory,n as isCloudEnvironment,c as isDevelopment,e as isShopify,a as isTerminalInteractive,f as isUnitTest,d as isVerbose,s as macAddress,u as opentelemetryDomain,o as themeToken};
@@ -1 +1 @@
1
- import{b as a}from"./chunk-JNAAHGJ6.js";import"./chunk-RJ5VF3QY.js";import"./chunk-O6BUPYXH.js";import"./chunk-KNLPWHHJ.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-E7Z7KYBR.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-M5GXA5W4.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as LocalStorage};
1
+ import{b as a}from"./chunk-3PFKQSWK.js";import"./chunk-RJ5VF3QY.js";import"./chunk-K44YPOUY.js";import"./chunk-YKQLGBJM.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-F5LI3LKB.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-M5GXA5W4.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as LocalStorage};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"./chunk-4NSHAMD3.js";import"./chunk-E7Z7KYBR.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-VKWPEFWQ.js";export{d as addPublicMetadata,e as addSensitiveMetadata,a as createRuntimeMetadataContainer,b as getAllPublicMetadata,c as getAllSensitiveMetadata,f as runWithTimer};
1
+ import{a,b,c,d,e,f}from"./chunk-BGTOVY2S.js";import"./chunk-F5LI3LKB.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-VKWPEFWQ.js";export{d as addPublicMetadata,e as addSensitiveMetadata,a as createRuntimeMetadataContainer,b as getAllPublicMetadata,c as getAllSensitiveMetadata,f as runWithTimer};
@@ -1 +1 @@
1
- import{A,B,C,D,E,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-SH5VEQ7F.js";import"./chunk-SQVJGTTD.js";import"./chunk-EJDWYASP.js";import"./chunk-MVPRNGNO.js";import"./chunk-GB3YC4TI.js";import"./chunk-WMKVFUMY.js";import"./chunk-JNAAHGJ6.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import"./chunk-WFCP2AG5.js";import"./chunk-4NSHAMD3.js";import"./chunk-O6BUPYXH.js";import"./chunk-KNLPWHHJ.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-E7Z7KYBR.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-M5GXA5W4.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{k as FindUpAndReadPackageJsonNotFoundError,j as PackageJsonNotFoundError,i as UnknownPackageManagerError,z as addNPMDependencies,y as addNPMDependenciesIfNeeded,A as addNPMDependenciesWithoutVersionIfNeeded,C as addResolutionOrOverride,d as bunLockfile,v as checkForCachedNewVersion,u as checkForNewVersion,B as findUpAndReadPackageJson,s as getDependencies,m as getPackageManager,q as getPackageName,r as getPackageVersion,E as inferPackageManager,o as installNPMDependenciesRecursively,p as installNodeModules,f as lockfiles,g as lockfilesByManager,b as npmLockfile,h as packageManager,n as packageManagerBinaryCommandForDirectory,l as packageManagerFromUserAgent,c as pnpmLockfile,e as pnpmWorkspaceFile,x as readAndParsePackageJson,t as usesWorkspaces,w as versionSatisfies,D as writePackageJSON,a as yarnLockfile};
1
+ import{A,B,C,D,E,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-XJMML6SY.js";import"./chunk-27IBAKXK.js";import"./chunk-3PFKQSWK.js";import"./chunk-EOGQ7TJP.js";import"./chunk-EJDWYASP.js";import"./chunk-MVPRNGNO.js";import"./chunk-GB3YC4TI.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import"./chunk-M5NVKW2D.js";import"./chunk-BGTOVY2S.js";import"./chunk-K44YPOUY.js";import"./chunk-YKQLGBJM.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-F5LI3LKB.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-M5GXA5W4.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{k as FindUpAndReadPackageJsonNotFoundError,j as PackageJsonNotFoundError,i as UnknownPackageManagerError,z as addNPMDependencies,y as addNPMDependenciesIfNeeded,A as addNPMDependenciesWithoutVersionIfNeeded,C as addResolutionOrOverride,d as bunLockfile,v as checkForCachedNewVersion,u as checkForNewVersion,B as findUpAndReadPackageJson,s as getDependencies,m as getPackageManager,q as getPackageName,r as getPackageVersion,E as inferPackageManager,o as installNPMDependenciesRecursively,p as installNodeModules,f as lockfiles,g as lockfilesByManager,b as npmLockfile,h as packageManager,n as packageManagerBinaryCommandForDirectory,l as packageManagerFromUserAgent,c as pnpmLockfile,e as pnpmWorkspaceFile,x as readAndParsePackageJson,t as usesWorkspaces,w as versionSatisfies,D as writePackageJSON,a as yarnLockfile};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f}from"./chunk-OK7WTQON.js";import"./chunk-WW7TENNA.js";import"./chunk-CG22VLHL.js";import"./chunk-ZDF5N422.js";import"./chunk-XJMML6SY.js";import"./chunk-MPW2YJWU.js";import"./chunk-27IBAKXK.js";import"./chunk-3PFKQSWK.js";import"./chunk-EOGQ7TJP.js";import"./chunk-EJDWYASP.js";import"./chunk-MVPRNGNO.js";import"./chunk-GB3YC4TI.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import"./chunk-LEMDZHSP.js";import"./chunk-M5NVKW2D.js";import"./chunk-BGTOVY2S.js";import"./chunk-H5BHHSWX.js";import"./chunk-K44YPOUY.js";import"./chunk-YKQLGBJM.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-F5LI3LKB.js";import"./chunk-T7KHS6RF.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-M5GXA5W4.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{c as fetchNotifications,d as fetchNotificationsInBackground,e as filterNotifications,b as getNotifications,a as showNotificationsIfNeeded,f as stringifyFilters};
@@ -1 +1 @@
1
- import{Eb as a,Fb as b,Gb as c,Hb as d,Ib as e,Jb as f,Kb as g,Lb as h,Mb as i,Nb as j,Ob as k,Pb as l,Qb as m,Rb as n,Sb as o,Tb as p,Ub as q,Vb as r,Wb as s,Xb as t}from"./chunk-KNLPWHHJ.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-E7Z7KYBR.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as TokenizedString,g as clearCollectedLogs,f as collectLog,e as collectedLogs,c as formatPackageManagerCommand,t as formatSection,p as itemToString,k as outputCompleted,d as outputContent,l as outputDebug,i as outputInfo,n as outputNewline,h as outputResult,j as outputSuccess,b as outputToken,m as outputWarn,q as outputWhereAppropriate,s as shouldDisplayColors,o as stringifyMessage,r as unstyled};
1
+ import{Eb as a,Fb as b,Gb as c,Hb as d,Ib as e,Jb as f,Kb as g,Lb as h,Mb as i,Nb as j,Ob as k,Pb as l,Qb as m,Rb as n,Sb as o,Tb as p,Ub as q,Vb as r,Wb as s,Xb as t}from"./chunk-YKQLGBJM.js";import"./chunk-A4SBXDZB.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-F5LI3LKB.js";import"./chunk-UKQ7NE5V.js";import"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as TokenizedString,g as clearCollectedLogs,f as collectLog,e as collectedLogs,c as formatPackageManagerCommand,t as formatSection,p as itemToString,k as outputCompleted,d as outputContent,l as outputDebug,i as outputInfo,n as outputNewline,h as outputResult,j as outputSuccess,b as outputToken,m as outputWarn,q as outputWhereAppropriate,s as shouldDisplayColors,o as stringifyMessage,r as unstyled};