@shopify/cli 4.8.1 → 4.8.3

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 (300) hide show
  1. package/dist/analytics-AL5WLCEC.js +1 -0
  2. package/dist/{analytics-TQHJN5PY.js → analytics-VCJLTHBI.js} +1 -1
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-BMDCOBUR.js → chunk-2AFQC53K.js} +1 -1
  5. package/dist/{chunk-EIBQRJTQ.js → chunk-2C27YWUC.js} +1 -1
  6. package/dist/{chunk-IPSY5EEL.js → chunk-2E3JUVRC.js} +1 -1
  7. package/dist/{chunk-YUNINHOR.js → chunk-2NHLSPBM.js} +1 -1
  8. package/dist/{chunk-5PWJTOWK.js → chunk-34EOYW4N.js} +1 -1
  9. package/dist/{chunk-U42P3F7Y.js → chunk-34YS3IUO.js} +1 -1
  10. package/dist/chunk-3CFHLIBD.js +7 -0
  11. package/dist/{chunk-GTIBT4V6.js → chunk-3D3IYIZ7.js} +1 -1
  12. package/dist/{chunk-VPRDI4TT.js → chunk-3DXA7B3Y.js} +1 -1
  13. package/dist/{chunk-H6HILX7D.js → chunk-3U7O3PMX.js} +1 -1
  14. package/dist/{chunk-HKSRCMQ7.js → chunk-3X7XO4LN.js} +1 -1
  15. package/dist/{chunk-WVQZOLZJ.js → chunk-46ISGKTW.js} +1 -1
  16. package/dist/{chunk-J3PS4JF2.js → chunk-4CLJ6W23.js} +2 -2
  17. package/dist/chunk-4EHFK2OI.js +1 -0
  18. package/dist/{chunk-3R7OHZ4C.js → chunk-4XZJKSDD.js} +1 -1
  19. package/dist/{chunk-X3KYRBGE.js → chunk-4ZMWIIJV.js} +1 -1
  20. package/dist/{chunk-UCJ3NHJH.js → chunk-56362WJR.js} +1 -1
  21. package/dist/{chunk-MNTJZ6JO.js → chunk-5QCSJYJ4.js} +1 -1
  22. package/dist/{chunk-BKYTBTQ5.js → chunk-5QNB6464.js} +1 -1
  23. package/dist/{chunk-SEGZQCXZ.js → chunk-5VBEPL4S.js} +1 -1
  24. package/dist/{chunk-7CPYFKFK.js → chunk-5YSO5HRH.js} +1 -1
  25. package/dist/{chunk-CKZOLGWI.js → chunk-65DQFHSH.js} +1 -1
  26. package/dist/{chunk-LQGF3RKX.js → chunk-6ECS5KDX.js} +1 -1
  27. package/dist/{chunk-LJO22Z6S.js → chunk-6NO44HAQ.js} +1 -1
  28. package/dist/{chunk-XSUX2XAW.js → chunk-6QDI53VP.js} +1 -1
  29. package/dist/{chunk-4ASQQTCD.js → chunk-6TPUTSNR.js} +1 -1
  30. package/dist/{chunk-WT2KJHUO.js → chunk-6ZGCTTAD.js} +1 -1
  31. package/dist/{chunk-5THZTE44.js → chunk-777JJJYW.js} +1 -1
  32. package/dist/{chunk-PJTRZSH4.js → chunk-77QBDEU4.js} +1 -1
  33. package/dist/{chunk-SAKMJGXL.js → chunk-7W7RGEII.js} +1 -1
  34. package/dist/{chunk-GZEPWYMP.js → chunk-7YBBERPS.js} +1 -1
  35. package/dist/{chunk-TQNGFSCI.js → chunk-7YDT5AOW.js} +1 -1
  36. package/dist/{chunk-HZDEDEAS.js → chunk-AHJT2Z7G.js} +1 -1
  37. package/dist/{chunk-QH7QOLZK.js → chunk-ALDLKZJW.js} +1 -1
  38. package/dist/{chunk-PCL4UWAE.js → chunk-AQJEA33T.js} +1 -1
  39. package/dist/{chunk-QPT6DUMC.js → chunk-ASBTWQJO.js} +1 -1
  40. package/dist/{chunk-DS7OKDQN.js → chunk-AU2OGZBS.js} +1 -1
  41. package/dist/{chunk-F2DO3R6R.js → chunk-AURREHRU.js} +1 -1
  42. package/dist/{chunk-XRVMKP53.js → chunk-AWTBC3MC.js} +3 -3
  43. package/dist/{chunk-SIVRBIKH.js → chunk-B3GLHLAQ.js} +1 -1
  44. package/dist/{chunk-5CC4QYN4.js → chunk-B52JFWYO.js} +1 -1
  45. package/dist/{chunk-XNP7PMGC.js → chunk-BAUHOB76.js} +1 -1
  46. package/dist/{chunk-EDHR546O.js → chunk-BIV3GWMB.js} +1 -1
  47. package/dist/chunk-BJ3JF35I.js +6 -0
  48. package/dist/{chunk-O2X6EVXQ.js → chunk-BO45JVQ3.js} +1 -1
  49. package/dist/{chunk-XNKAPGJD.js → chunk-BQTD7UV2.js} +1 -1
  50. package/dist/{chunk-ZYEGQSF5.js → chunk-BR3GYG2H.js} +1 -1
  51. package/dist/{chunk-WJEVB67Y.js → chunk-BR5CFKIN.js} +1 -1
  52. package/dist/{chunk-VM6EBNGR.js → chunk-BU4EGAMH.js} +1 -1
  53. package/dist/{chunk-RNFZJQVV.js → chunk-BV4K7JX5.js} +1 -1
  54. package/dist/{chunk-JVXKDM2E.js → chunk-C2AA5NVP.js} +1 -1
  55. package/dist/{chunk-UBX3HUMH.js → chunk-CF3PBTFV.js} +1 -1
  56. package/dist/{chunk-PSH4QKUX.js → chunk-CM4QZI6V.js} +1 -1
  57. package/dist/{chunk-7DJNASBC.js → chunk-CNDB4VEM.js} +1 -1
  58. package/dist/{chunk-WIBPVYPN.js → chunk-CRSAEF22.js} +1 -1
  59. package/dist/{chunk-GCTCRKET.js → chunk-CSNXCRPY.js} +1 -1
  60. package/dist/{chunk-3A2HLI4D.js → chunk-CYSB5AJJ.js} +1 -1
  61. package/dist/{chunk-OBRMBYTG.js → chunk-DDWJRJWW.js} +1 -1
  62. package/dist/{chunk-U7ELUEH2.js → chunk-DE3HBSUU.js} +1 -1
  63. package/dist/{chunk-5AMPXLKT.js → chunk-DGZCOTKZ.js} +1 -1
  64. package/dist/{chunk-3ACZB27E.js → chunk-E2IUEX5H.js} +1 -1
  65. package/dist/{chunk-7JG3CKDE.js → chunk-E6DIK7Z7.js} +1 -1
  66. package/dist/{chunk-PPC3RJDZ.js → chunk-E767ITG2.js} +1 -1
  67. package/dist/{chunk-PVZE65R7.js → chunk-EIASA32Z.js} +1 -1
  68. package/dist/{chunk-6633X2JU.js → chunk-EIEPBDNX.js} +1 -1
  69. package/dist/chunk-ENEPD4BS.js +1 -0
  70. package/dist/{chunk-LTRJWOI6.js → chunk-EQ7HQXEK.js} +1 -1
  71. package/dist/{chunk-GVEJO3WM.js → chunk-ERMLZF2C.js} +1 -1
  72. package/dist/{chunk-LEPENRGG.js → chunk-ETHKJFFN.js} +1 -1
  73. package/dist/{chunk-NQRSFMS7.js → chunk-EWKIFVW3.js} +1 -1
  74. package/dist/{chunk-5G2W7QKA.js → chunk-F3FHSS7N.js} +1 -1
  75. package/dist/{chunk-3NYK63U4.js → chunk-F4S4ITHP.js} +1 -1
  76. package/dist/{chunk-7DLMETRR.js → chunk-FKW62ZUV.js} +1 -1
  77. package/dist/{chunk-7USNGNVI.js → chunk-FYVFGKCJ.js} +1 -1
  78. package/dist/{chunk-2R6KOKWG.js → chunk-G52SCW6W.js} +1 -1
  79. package/dist/{chunk-PGBXHL2G.js → chunk-GK23CIPB.js} +1 -1
  80. package/dist/{chunk-HFRWZQOF.js → chunk-GKRGXRD4.js} +1 -1
  81. package/dist/{chunk-RHJLAYNK.js → chunk-GO4KOSHA.js} +1 -1
  82. package/dist/{chunk-2BHYBR2F.js → chunk-GSYVQPMP.js} +1 -1
  83. package/dist/{chunk-D2R7HPCT.js → chunk-HEABWGTV.js} +1 -1
  84. package/dist/{chunk-ILHEVBNU.js → chunk-HG63NM4M.js} +1 -1
  85. package/dist/{chunk-TCP4OG3D.js → chunk-HHWZV7CG.js} +1 -1
  86. package/dist/{chunk-VRO6QBVN.js → chunk-HLLMMIIM.js} +1 -1
  87. package/dist/{chunk-HEIZ3RSD.js → chunk-HPGQGIPA.js} +1 -1
  88. package/dist/{chunk-6USL7BKQ.js → chunk-HZASAGTU.js} +1 -1
  89. package/dist/{chunk-RRQYOGEA.js → chunk-I44E5KLI.js} +1 -1
  90. package/dist/{chunk-OYFNB5RY.js → chunk-I7XKF22Z.js} +1 -1
  91. package/dist/{chunk-AINDVTMY.js → chunk-IAURXPUJ.js} +3 -3
  92. package/dist/{chunk-AXLLN6DZ.js → chunk-J6BXYZRY.js} +1 -1
  93. package/dist/{chunk-33PLVLCE.js → chunk-JGSHB34D.js} +1 -1
  94. package/dist/{chunk-TBEG57SV.js → chunk-JKWKFDP7.js} +1 -1
  95. package/dist/{chunk-NV4SPMQS.js → chunk-KIPKRAUB.js} +1 -1
  96. package/dist/{chunk-UMZG254H.js → chunk-KLI5Z5RC.js} +1 -1
  97. package/dist/{chunk-FH36PGZH.js → chunk-KSSPT7G5.js} +12 -12
  98. package/dist/{chunk-UPTF2HK6.js → chunk-LOSBZZHU.js} +1 -1
  99. package/dist/{chunk-5U4UTFA4.js → chunk-LUSG2EHB.js} +1 -1
  100. package/dist/{chunk-6T5AZZUI.js → chunk-LZSDOB4O.js} +1 -1
  101. package/dist/{chunk-565SON6A.js → chunk-M7YZJWY3.js} +1 -1
  102. package/dist/{chunk-XH66VYZA.js → chunk-MF2PINFC.js} +1 -1
  103. package/dist/{chunk-KAAC4VIW.js → chunk-MI5HPOXV.js} +1 -1
  104. package/dist/{chunk-T24RA3WI.js → chunk-MPO2T5YQ.js} +1 -1
  105. package/dist/{chunk-KEUMU5TQ.js → chunk-MQM3PRVN.js} +1 -1
  106. package/dist/{chunk-R4YJM7KY.js → chunk-N34YKDEK.js} +1 -1
  107. package/dist/{chunk-PROWADZL.js → chunk-NG5FY45G.js} +1 -1
  108. package/dist/{chunk-YAA7OGRM.js → chunk-NKSLEPE2.js} +2 -2
  109. package/dist/chunk-NNCLTG6A.js +1 -0
  110. package/dist/{chunk-TVQVZHNP.js → chunk-NS7QRCJF.js} +1 -1
  111. package/dist/{chunk-CSAVYME2.js → chunk-NTV746FL.js} +1 -1
  112. package/dist/{chunk-E7I5YT53.js → chunk-O2YFSYDR.js} +1 -1
  113. package/dist/{chunk-QMYCJ2TM.js → chunk-O4ZMMPEP.js} +1 -1
  114. package/dist/{chunk-YMS6RVE5.js → chunk-OI3MNE72.js} +1 -1
  115. package/dist/{chunk-F5BTQI5W.js → chunk-OSMT4BVT.js} +1 -1
  116. package/dist/{chunk-AICVQH4V.js → chunk-OZJBUWZK.js} +1 -1
  117. package/dist/{chunk-4QXDDAMD.js → chunk-PERAXNOY.js} +2 -2
  118. package/dist/chunk-PJH3JJEQ.js +1 -0
  119. package/dist/{chunk-HEWKCSY7.js → chunk-PUGAY4JP.js} +3 -3
  120. package/dist/{chunk-RAOMLN5A.js → chunk-PXAYMXQN.js} +1 -1
  121. package/dist/{chunk-AXMSJ46T.js → chunk-PXM3ENVN.js} +1 -1
  122. package/dist/{chunk-3LBHSZSR.js → chunk-PYCGZSME.js} +1 -1
  123. package/dist/{chunk-X4JCATEE.js → chunk-PZH4WAOO.js} +1 -1
  124. package/dist/{chunk-VFQW2QL2.js → chunk-QCMGYBFD.js} +1 -1
  125. package/dist/{chunk-3FTP36HH.js → chunk-QGYETVYA.js} +1 -1
  126. package/dist/{chunk-ODFOSJU3.js → chunk-QIGFVVLB.js} +1 -1
  127. package/dist/{chunk-WLGEAJBU.js → chunk-RAJX2CQP.js} +1 -1
  128. package/dist/{chunk-KPJRLS53.js → chunk-RFORHGOR.js} +1 -1
  129. package/dist/{chunk-LC2BDU4B.js → chunk-RIWEYVNK.js} +1 -1
  130. package/dist/{chunk-Y6DYQWQK.js → chunk-RM3XC2IX.js} +1 -1
  131. package/dist/{chunk-7DGVNVW3.js → chunk-RPM2BFMN.js} +1 -1
  132. package/dist/chunk-RV4UQZ2W.js +1 -0
  133. package/dist/{chunk-36OXWMXZ.js → chunk-RVEAQUUF.js} +1 -1
  134. package/dist/{chunk-4ARQFW35.js → chunk-SASKWPDJ.js} +1 -1
  135. package/dist/{chunk-S5FGFQHD.js → chunk-SLZ6UMVV.js} +1 -1
  136. package/dist/{chunk-6U4BOZ73.js → chunk-SUQF2LM7.js} +1 -1
  137. package/dist/{chunk-OTVZU5AQ.js → chunk-SVO2M3F5.js} +1 -1
  138. package/dist/{chunk-BHDFVO2R.js → chunk-SYJXM2RN.js} +1 -1
  139. package/dist/{chunk-XZUL2HVC.js → chunk-SZ2V5WT6.js} +1 -1
  140. package/dist/{chunk-LIH7CQO7.js → chunk-T3IMDY72.js} +3 -3
  141. package/dist/{chunk-PSYQTFPK.js → chunk-T5I2LEDJ.js} +1 -1
  142. package/dist/{chunk-UBJYXNCN.js → chunk-T7BQYKKT.js} +1 -1
  143. package/dist/{chunk-6HMTAB2V.js → chunk-TBC5FH2W.js} +1 -1
  144. package/dist/{chunk-FM6VJLE7.js → chunk-TEHDOYO2.js} +1 -1
  145. package/dist/{chunk-GYFRTLML.js → chunk-TNYPQ2UL.js} +3 -3
  146. package/dist/{chunk-562EV2EJ.js → chunk-TWTZLWO7.js} +1 -1
  147. package/dist/{chunk-3GAN6KS6.js → chunk-U5APMZGT.js} +1 -1
  148. package/dist/{chunk-OJE7S6D4.js → chunk-UCP6UA7M.js} +1 -1
  149. package/dist/{chunk-WSJ5PUK6.js → chunk-UI75K6AX.js} +1 -1
  150. package/dist/{chunk-JDEOBIXA.js → chunk-ULIXS6H7.js} +1 -1
  151. package/dist/{chunk-AVX7CIDJ.js → chunk-UU3VUYVX.js} +1 -1
  152. package/dist/{chunk-FZUPL5YO.js → chunk-VCJ252CK.js} +1 -1
  153. package/dist/{chunk-UXL2A5UK.js → chunk-VEXW766J.js} +1 -1
  154. package/dist/{chunk-32IIURQB.js → chunk-VTKZJ6MD.js} +1 -1
  155. package/dist/{chunk-22JJHQVU.js → chunk-WE72MX7V.js} +1 -1
  156. package/dist/{chunk-ZJ6DWT36.js → chunk-WKC5HDMY.js} +1 -1
  157. package/dist/{chunk-4QAM7ROJ.js → chunk-WXDINLQ6.js} +1 -1
  158. package/dist/{chunk-U63A4OUA.js → chunk-XBL6HWDC.js} +1 -1
  159. package/dist/{chunk-H7IQZNKR.js → chunk-XCTRPBWM.js} +1 -1
  160. package/dist/{chunk-IMSPA67L.js → chunk-XNMDPOYU.js} +1 -1
  161. package/dist/{chunk-YZKBG7UZ.js → chunk-XSFF6KEB.js} +1 -1
  162. package/dist/{chunk-6JC2PM43.js → chunk-YJCNZGPY.js} +1 -1
  163. package/dist/{chunk-B3I7OMRN.js → chunk-YKHDUKFK.js} +1 -1
  164. package/dist/{chunk-DQVNW6EQ.js → chunk-YSOLGBU3.js} +1 -1
  165. package/dist/{chunk-T74ECTO7.js → chunk-Z3JINOCM.js} +1 -1
  166. package/dist/{chunk-L6OBJDYK.js → chunk-Z6MS5OET.js} +1 -1
  167. package/dist/{chunk-YY2JHCIG.js → chunk-ZBMPFLOH.js} +1 -1
  168. package/dist/{chunk-LH7KQZDD.js → chunk-ZC7FWXYM.js} +1 -1
  169. package/dist/{chunk-ZLMXR2XV.js → chunk-ZRFOMQ2L.js} +1 -1
  170. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  171. package/dist/cli/commands/app/build.js +1 -1
  172. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  173. package/dist/cli/commands/app/bulk/execute.js +1 -1
  174. package/dist/cli/commands/app/bulk/status.js +1 -1
  175. package/dist/cli/commands/app/config/link.js +1 -1
  176. package/dist/cli/commands/app/config/pull.js +1 -1
  177. package/dist/cli/commands/app/config/use.js +1 -1
  178. package/dist/cli/commands/app/config/validate.js +1 -1
  179. package/dist/cli/commands/app/demo/watcher.js +1 -1
  180. package/dist/cli/commands/app/deploy.js +1 -1
  181. package/dist/cli/commands/app/dev/clean.js +1 -1
  182. package/dist/cli/commands/app/dev.js +1 -1
  183. package/dist/cli/commands/app/doctor/instructions.js +1 -1
  184. package/dist/cli/commands/app/doctor.js +1 -1
  185. package/dist/cli/commands/app/env/pull.js +1 -1
  186. package/dist/cli/commands/app/env/show.js +1 -1
  187. package/dist/cli/commands/app/execute.js +1 -1
  188. package/dist/cli/commands/app/function/build.js +1 -1
  189. package/dist/cli/commands/app/function/info.js +1 -1
  190. package/dist/cli/commands/app/function/replay.js +1 -1
  191. package/dist/cli/commands/app/function/run.js +1 -1
  192. package/dist/cli/commands/app/function/schema.js +1 -1
  193. package/dist/cli/commands/app/function/typegen.js +1 -1
  194. package/dist/cli/commands/app/generate/extension.js +1 -1
  195. package/dist/cli/commands/app/graphiql.js +1 -1
  196. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  197. package/dist/cli/commands/app/import-extensions.js +1 -1
  198. package/dist/cli/commands/app/info.js +1 -1
  199. package/dist/cli/commands/app/init.js +1 -1
  200. package/dist/cli/commands/app/logs.js +1 -1
  201. package/dist/cli/commands/app/release.js +1 -1
  202. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  203. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  204. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  205. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  206. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  207. package/dist/cli/commands/app/versions/list.js +1 -1
  208. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  209. package/dist/cli/commands/auth/login.js +1 -1
  210. package/dist/cli/commands/auth/logout.js +1 -1
  211. package/dist/cli/commands/cache/clear.js +1 -1
  212. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  213. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  214. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  215. package/dist/cli/commands/debug/command-flags.js +1 -1
  216. package/dist/cli/commands/doc/fetch.js +1 -1
  217. package/dist/cli/commands/doc/search.js +1 -1
  218. package/dist/cli/commands/docs/generate.js +1 -1
  219. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  220. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  221. package/dist/cli/commands/help.js +1 -1
  222. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  223. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  224. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  225. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  226. package/dist/cli/commands/notifications/generate.js +1 -1
  227. package/dist/cli/commands/notifications/list.js +1 -1
  228. package/dist/cli/commands/organization/list.js +1 -1
  229. package/dist/cli/commands/search.js +1 -1
  230. package/dist/cli/commands/send-analytics.js +1 -1
  231. package/dist/cli/commands/theme/check.js +1 -1
  232. package/dist/cli/commands/theme/console.js +1 -1
  233. package/dist/cli/commands/theme/delete.js +1 -1
  234. package/dist/cli/commands/theme/dev.js +1 -1
  235. package/dist/cli/commands/theme/duplicate.js +1 -1
  236. package/dist/cli/commands/theme/info.js +1 -1
  237. package/dist/cli/commands/theme/init.js +1 -1
  238. package/dist/cli/commands/theme/language-server.js +1 -1
  239. package/dist/cli/commands/theme/list.js +1 -1
  240. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  241. package/dist/cli/commands/theme/open.js +1 -1
  242. package/dist/cli/commands/theme/package.js +1 -1
  243. package/dist/cli/commands/theme/preview.js +1 -1
  244. package/dist/cli/commands/theme/profile.js +1 -1
  245. package/dist/cli/commands/theme/publish.js +1 -1
  246. package/dist/cli/commands/theme/pull.js +1 -1
  247. package/dist/cli/commands/theme/push.js +1 -1
  248. package/dist/cli/commands/theme/rename.js +1 -1
  249. package/dist/cli/commands/theme/share.js +1 -1
  250. package/dist/cli/commands/upgrade.js +1 -1
  251. package/dist/cli/commands/version.js +1 -1
  252. package/dist/command-registry.js +1 -1
  253. package/dist/{conf-store-K65PEQF6.js → conf-store-F4NCJPWK.js} +1 -1
  254. package/dist/{deprecations-2SG4PB2W.js → deprecations-PX5KIFDO.js} +1 -1
  255. package/dist/dist-WO24PYXH.js +1 -0
  256. package/dist/dist-X7YIFLSP.js +1 -0
  257. package/dist/{environments-B4OWPMPR.js → environments-TLO674UK.js} +1 -1
  258. package/dist/{error-5YQYW3V2.js → error-YLDXWEC5.js} +1 -1
  259. package/dist/error-handler-SY45FR6A.js +1 -0
  260. package/dist/{fs-FM6YDE2U.js → fs-CDN2NZJC.js} +1 -1
  261. package/dist/hooks/did-you-mean.js +1 -1
  262. package/dist/hooks/hydrogen-init.js +1 -1
  263. package/dist/hooks/postrun.js +1 -1
  264. package/dist/hooks/prerun.js +1 -1
  265. package/dist/hooks/public-metadata.js +1 -1
  266. package/dist/hooks/sensitive-metadata.js +1 -1
  267. package/dist/hooks/tunnel-provider.js +1 -1
  268. package/dist/hooks/tunnel-start.js +1 -1
  269. package/dist/index.js +1 -1
  270. package/dist/{is-global-3FFDTC2G.js → is-global-KBYTYD3Y.js} +1 -1
  271. package/dist/{local-W73VIWHZ.js → local-IBYCFEVA.js} +1 -1
  272. package/dist/{metadata-OGQEI47Y.js → metadata-LOCKHSUF.js} +1 -1
  273. package/dist/{node-package-manager-GSHLPD5X.js → node-package-manager-ESOHDRPJ.js} +1 -1
  274. package/dist/notifications-system-EMCOAF3T.js +1 -0
  275. package/dist/os-XLJNYIZF.js +1 -0
  276. package/dist/{output-MG7RJ37P.js → output-OAORC6TH.js} +1 -1
  277. package/dist/{system-3HTWCGQH.js → system-VNXEM5E7.js} +1 -1
  278. package/dist/tsconfig.tsbuildinfo +1 -1
  279. package/dist/{ui-T22J7MQF.js → ui-CIZHMGKK.js} +1 -1
  280. package/dist/upgrade-AIZVY3E5.js +1 -0
  281. package/dist/version-CNIDTUMV.js +1 -0
  282. package/dist/{version-KWF3XRSN.js → version-JJYR4NOL.js} +1 -1
  283. package/dist/{workerd-RB5ZS43X.js → workerd-JWZNKSHU.js} +1 -1
  284. package/oclif.manifest.json +1 -1
  285. package/package.json +7 -7
  286. package/dist/analytics-32PK45SE.js +0 -1
  287. package/dist/chunk-3NVQXPTU.js +0 -1
  288. package/dist/chunk-4IG7WG6V.js +0 -1
  289. package/dist/chunk-E3FZRPNL.js +0 -1
  290. package/dist/chunk-JLR6X5NA.js +0 -6
  291. package/dist/chunk-MA6QRENS.js +0 -1
  292. package/dist/chunk-PSUNX2YX.js +0 -1
  293. package/dist/chunk-V6UCVTJT.js +0 -7
  294. package/dist/dist-L4A3SGNF.js +0 -1
  295. package/dist/dist-XXCZFNRC.js +0 -1
  296. package/dist/error-handler-3PBXTHYY.js +0 -1
  297. package/dist/notifications-system-HQNQUKLF.js +0 -1
  298. package/dist/os-6HP4QG7V.js +0 -1
  299. package/dist/upgrade-FZ35KTBW.js +0 -1
  300. package/dist/version-LJOGYA5H.js +0 -1
@@ -1 +1 @@
1
- import{c as l}from"./chunk-H7IQZNKR.js";import{e as u,j as m}from"./chunk-EDHR546O.js";import{a as d}from"./chunk-3NVQXPTU.js";import{wa as p}from"./chunk-YAA7OGRM.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var a=class extends Error{operationId;constructor(t){super(`Migration cancellation for ${t} returned neither an operation nor user errors`),this.name="MigrationCancellationProtocolError",this.operationId=t}};async function f({clientId:i,operationIds:t,cancelOperation:n=m}){return{outcomes:await Promise.all(t.map(async o=>{let e=await n({clientId:i,operationId:o});if(e.userErrors.length>0)return{status:"failed",operationId:o,operation:e.operation,userErrors:e.userErrors};if(!e.operation)throw new a(o);return{status:"success",operationId:o,operation:e.operation}}))}}var s=class i extends d{static hidden=!0;static summary="Cancels app subscription migration operations.";static descriptionWithMarkdown="Cancels app subscription migration operations.\n\nCanceling stops additional unprocessed shops, but does not undo shops that have already been scheduled or migrated. Use `unschedule` for reversible schedules.\n\nRepeat `--id` to cancel every operation GID returned by a multi-batch submission. Use `--json` to output the resulting operation states and per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2>","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...u};async run(){let{flags:t}=await this.parse(i),{app:n,remoteApp:c}=await p({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=await f({clientId:c.apiKey,operationIds:t.id}),e=l(o,{json:t.json});return e!==0&&(process.exitCode=e),{app:n}}};export{s as a};
1
+ import{c as l}from"./chunk-XCTRPBWM.js";import{e as u,j as m}from"./chunk-BIV3GWMB.js";import{a as d}from"./chunk-NNCLTG6A.js";import{wa as p}from"./chunk-NKSLEPE2.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var a=class extends Error{operationId;constructor(t){super(`Migration cancellation for ${t} returned neither an operation nor user errors`),this.name="MigrationCancellationProtocolError",this.operationId=t}};async function f({clientId:i,operationIds:t,cancelOperation:n=m}){return{outcomes:await Promise.all(t.map(async o=>{let e=await n({clientId:i,operationId:o});if(e.userErrors.length>0)return{status:"failed",operationId:o,operation:e.operation,userErrors:e.userErrors};if(!e.operation)throw new a(o);return{status:"success",operationId:o,operation:e.operation}}))}}var s=class i extends d{static hidden=!0;static summary="Cancels app subscription migration operations.";static descriptionWithMarkdown="Cancels app subscription migration operations.\n\nCanceling stops additional unprocessed shops, but does not undo shops that have already been scheduled or migrated. Use `unschedule` for reversible schedules.\n\nRepeat `--id` to cancel every operation GID returned by a multi-batch submission. Use `--json` to output the resulting operation states and per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2>","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...u};async run(){let{flags:t}=await this.parse(i),{app:n,remoteApp:c}=await p({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=await f({clientId:c.apiKey,operationIds:t.id}),e=l(o,{json:t.json});return e!==0&&(process.exitCode=e),{app:n}}};export{s as a};
@@ -1,4 +1,4 @@
1
- import{a as i}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-HEWKCSY7.js";import{y as e}from"./chunk-LIH7CQO7.js";import{t}from"./chunk-Y6DYQWQK.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Enable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
1
+ import{a as i}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-PUGAY4JP.js";import{y as e}from"./chunk-T3IMDY72.js";import{t}from"./chunk-RM3XC2IX.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Enable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
2
2
 
3
3
  When auto-upgrade is enabled, Shopify CLI automatically updates to the latest version once per day. Major version upgrades are skipped and must be done manually.
4
4
 
@@ -1,9 +1,9 @@
1
- import{a as B,j as C,m as P}from"./chunk-FH36PGZH.js";import{e as U,f as _}from"./chunk-GCTCRKET.js";import{e as g}from"./chunk-UXL2A5UK.js";import{l as v,m as w}from"./chunk-ZYEGQSF5.js";import{Aa as E}from"./chunk-AINDVTMY.js";import{Ab as m}from"./chunk-GYFRTLML.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var $=20,J=1024*1024,A=2;function oe(t,e,r,s,o={},l){let n=B(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=R(t,e,n),h=Promise.all([s.ready(),u]).then(()=>q(n,s,t,e,i)),p=h.then(a=>a.promise).then(()=>j(n,s,t,e,o,i)),k=o?.deferPartialWork?u:p.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([u,h.then(a=>a.promise),p.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:d}=await h,f=o.multiEnvironment?4e3:1e3;await g(b({promise:d,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment);let{progress:y,promise:F}=await p;await g(b({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(y)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment),await g([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),H(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&o()}})};return o(),s}function j(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=L(t,e),i=x(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let p=0;p<i.length;p+=$){let k=i.slice(p,p+$),a=v(r.id,k.map(d=>d.key),s).then(d=>{d.forEach(f=>{if(l.set(f.key,f),!f.success){let y=f.errors?.asset?.map(F=>`-${F}`).join(`
1
+ import{a as B,j as C,m as P}from"./chunk-KSSPT7G5.js";import{e as U,f as _}from"./chunk-CSNXCRPY.js";import{e as g}from"./chunk-VEXW766J.js";import{l as v,m as w}from"./chunk-BR3GYG2H.js";import{Aa as E}from"./chunk-IAURXPUJ.js";import{Ab as m}from"./chunk-TNYPQ2UL.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var $=20,J=1024*1024,A=2;function oe(t,e,r,s,o={},l){let n=B(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=R(t,e,n),h=Promise.all([s.ready(),u]).then(()=>q(n,s,t,e,i)),p=h.then(a=>a.promise).then(()=>j(n,s,t,e,o,i)),k=o?.deferPartialWork?u:p.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([u,h.then(a=>a.promise),p.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:d}=await h,f=o.multiEnvironment?4e3:1e3;await g(b({promise:d,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment);let{progress:y,promise:F}=await p;await g(b({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(y)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment),await g([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),H(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&o()}})};return o(),s}function j(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=L(t,e),i=x(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let p=0;p<i.length;p+=$){let k=i.slice(p,p+$),a=v(r.id,k.map(d=>d.key),s).then(d=>{d.forEach(f=>{if(l.set(f.key,f),!f.success){let y=f.errors?.asset?.map(F=>`-${F}`).join(`
2
2
  `);_(f.key,"delete")(new Error(`Failed to delete ${f.key}: ${y}`))}}),c.current+=k.length});u.push(a)}let h=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:h}}function L(t,e){let s=e.applyIgnoreFilters(t).filter(o=>!e.files.has(o.key));return m(`Files to be deleted:
3
3
  ${s.map(o=>`-${o.key}`).join(`
4
- `)}`),s}function x(t){let e=P(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configStylesheetFiles,...e.documentationFiles,...e.configSchemaFile,...e.staticAssetFiles]}var D=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function R(t,e,r){let s=new Set(r.map(l=>l.key)),o=D.filter(({key:l})=>!s.has(l));o.length>0&&await w(t.id,o,e)}function q(t,e,r,s,o){let l=S(e,t);e.unsyncedFileKeys.clear(),l.forEach(a=>e.unsyncedFileKeys.add(a.key));let{independentFiles:n,dependentFiles:i}=I(l),c={current:0,total:l.length},u=a=>a.length===0?Promise.resolve():Promise.all(z(a).map(d=>N(d,e,s,r.id,o).then(()=>{c.current+=d.length,d.forEach(f=>e.unsyncedFileKeys.delete(f.key))}))).then(()=>{}),h=i.reduce((a,d)=>a.then(()=>u(d)),Promise.resolve()),p=Promise.resolve().then(()=>u(n.flat())),k=Promise.all([h,p]).then(()=>{c.current=c.total});return{progress:c,promise:k}}function S(t,e){let r=K(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
4
+ `)}`),s}function x(t){let e=P(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configSchemaFile,...e.staticAssetFiles]}var D=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function R(t,e,r){let s=new Set(r.map(l=>l.key)),o=D.filter(({key:l})=>!s.has(l));o.length>0&&await w(t.id,o,e)}function q(t,e,r,s,o){let l=I(e,t);e.unsyncedFileKeys.clear(),l.forEach(a=>e.unsyncedFileKeys.add(a.key));let{independentFiles:n,dependentFiles:i}=z(l),c={current:0,total:l.length},u=a=>a.length===0?Promise.resolve():Promise.all(S(a).map(d=>N(d,e,s,r.id,o).then(()=>{c.current+=d.length,d.forEach(f=>e.unsyncedFileKeys.delete(f.key))}))).then(()=>{}),h=i.reduce((a,d)=>a.then(()=>u(d)),Promise.resolve()),p=Promise.resolve().then(()=>u(n.flat())),k=Promise.all([h,p]).then(()=>{c.current=c.total});return{progress:c,promise:k}}function I(t,e){let r=K(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
5
5
  ${l.map(n=>`-${n.key}`).join(`
6
- `)}`),l}function I(t){let e=P(t);return{independentFiles:[e.otherLiquidFiles,e.otherJsonFiles,e.staticAssetFiles,e.configStylesheetFiles,e.documentationFiles],dependentFiles:[e.configSchemaFile,e.layoutFiles,e.blockLiquidFiles,e.sectionLiquidFiles,e.sectionJsonFiles,e.templateJsonFiles,e.contextualizedJsonFiles,e.configDataFile]}}function z(t){let e=[],r=[],s=0;for(let o of t){let l=r.length>=$,n=s>=J;(l||n)&&(e.push(r),r=[],s=0),r.push(o),s+=o.size??0}return r.length>0&&e.push(r),e}function K(t){let e=[];return t.files.forEach((r,s)=>{let o=r.value?Buffer.byteLength(r.value,"utf8"):r.attachment?.length??0;e.push({key:s,checksum:r.checksum,size:o})}),e}async function N(t,e,r,s,o){let l=t.map(i=>{let c=e.files.get(i.key)?.value,u=e.files.get(i.key)?.attachment;return{key:i.key,...c&&{value:c},...u&&{attachment:u}}});m(`Uploading the following files:
6
+ `)}`),l}function z(t){let e=P(t);return{independentFiles:[e.otherLiquidFiles,e.otherJsonFiles,e.staticAssetFiles],dependentFiles:[e.configSchemaFile,e.layoutFiles,e.blockLiquidFiles,e.sectionLiquidFiles,e.sectionJsonFiles,e.templateJsonFiles,e.contextualizedJsonFiles,e.configDataFile]}}function S(t){let e=[],r=[],s=0;for(let o of t){let l=r.length>=$,n=s>=J;(l||n)&&(e.push(r),r=[],s=0),r.push(o),s+=o.size??0}return r.length>0&&e.push(r),e}function K(t){let e=[];return t.files.forEach((r,s)=>{let o=r.value?Buffer.byteLength(r.value,"utf8"):r.attachment?.length??0;e.push({key:s,checksum:r.checksum,size:o})}),e}async function N(t,e,r,s,o){let l=t.map(i=>{let c=e.files.get(i.key)?.value,u=e.files.get(i.key)?.attachment;return{key:i.key,...c&&{value:c},...u&&{attachment:u}}});m(`Uploading the following files:
7
7
  ${t.map(i=>`-${i.key}`).join(`
8
8
  `)}`),(await M(l,s,r)).forEach(i=>{o.set(i.key,i),W(i,e,s)})}function W(t,e,r){if(t.success)e.uploadErrors.delete(t.key);else{let s=t.errors?.asset??["Response was not successful."];e.uploadErrors.set(t.key,s),C(r,t.key)}}async function M(t,e,r,s=0){if(t.length===0)return[];s>0&&m(`Retry Attempt ${s}/${A} for the following files:
9
9
  ${t.map(n=>`-${n.key}`).join(`
@@ -1 +1 @@
1
- import{d as l}from"./chunk-GCTCRKET.js";import{c as t}from"./chunk-YY6TFARF.js";import{f as i,m,n as w,o as d,r as f}from"./chunk-7DJNASBC.js";import{J as n}from"./chunk-LIH7CQO7.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function y(o,r,P){i()||f({store:r});let e=o??m()??await p(["Enter your",{link:{label:"store password",url:t(r)}}]),s=!1;for(;!await l(e,r,P);)s||(d(),s=!0),e=await p(["Incorrect",{link:{label:"store password",url:t(r)}},{char:"."},"Please try again"]);return w(e),e}async function p(o){return n({message:o,password:!0})}export{y as a};
1
+ import{d as l}from"./chunk-CSNXCRPY.js";import{c as t}from"./chunk-YY6TFARF.js";import{f as i,m,n as w,o as d,r as f}from"./chunk-CNDB4VEM.js";import{J as n}from"./chunk-T3IMDY72.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function y(o,r,P){i()||f({store:r});let e=o??m()??await p(["Enter your",{link:{label:"store password",url:t(r)}}]),s=!1;for(;!await l(e,r,P);)s||(d(),s=!0),e=await p(["Incorrect",{link:{label:"store password",url:t(r)}},{char:"."},"Please try again"]);return w(e),e}async function p(o){return n({message:o,password:!0})}export{y as a};
@@ -1 +1 @@
1
- import{a as p}from"./chunk-VPRDI4TT.js";import{a as r,b as c}from"./chunk-H7IQZNKR.js";import{d as s}from"./chunk-EDHR546O.js";import{a}from"./chunk-3NVQXPTU.js";import{wa as n}from"./chunk-YAA7OGRM.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class d extends a{static hidden=!0;static summary="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.";static descriptionWithMarkdown="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV columns: `shop_id`, `target_plan_handle`, and `price_behavior`.\n- Optional CSV column: `notification`.\n- Example header: `shop_id,target_plan_handle,price_behavior,notification`.\n- Example row: `123456789,pro,HONOR_BILLING_PRICE,WHEN_REQUIRED`.\n\n`price_behavior` must be `HONOR_BILLING_PRICE` or `PLAN_PRICE`. `notification` can be `OPT_OUT` or `WHEN_REQUIRED` and defaults to `WHEN_REQUIRED` when omitted or blank.\n\nValidation is atomic: the command submits no operations unless the entire CSV is valid. Valid rows are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.\n\nUse `--force` to skip confirmation and immediately submit every valid row. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...s};async run(){let{flags:i}=await this.parse(d),{app:m,remoteApp:l}=await n({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),u=await p({action:"schedule",input:i.input??"-",clientId:l.apiKey,skipConfirmation:i.force,watch:i.watch,...i.watch&&!i.json?{onSubmissionAccepted:r}:{}}),e=c(u,{json:i.json,watch:i.watch});return e!==0&&(process.exitCode=e),{app:m}}};export{t as a};
1
+ import{a as p}from"./chunk-3DXA7B3Y.js";import{a as r,b as c}from"./chunk-XCTRPBWM.js";import{d as s}from"./chunk-BIV3GWMB.js";import{a}from"./chunk-NNCLTG6A.js";import{wa as n}from"./chunk-NKSLEPE2.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class d extends a{static hidden=!0;static summary="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.";static descriptionWithMarkdown="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV columns: `shop_id`, `target_plan_handle`, and `price_behavior`.\n- Optional CSV column: `notification`.\n- Example header: `shop_id,target_plan_handle,price_behavior,notification`.\n- Example row: `123456789,pro,HONOR_BILLING_PRICE,WHEN_REQUIRED`.\n\n`price_behavior` must be `HONOR_BILLING_PRICE` or `PLAN_PRICE`. `notification` can be `OPT_OUT` or `WHEN_REQUIRED` and defaults to `WHEN_REQUIRED` when omitted or blank.\n\nValidation is atomic: the command submits no operations unless the entire CSV is valid. Valid rows are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.\n\nUse `--force` to skip confirmation and immediately submit every valid row. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...s};async run(){let{flags:i}=await this.parse(d),{app:m,remoteApp:l}=await n({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),u=await p({action:"schedule",input:i.input??"-",clientId:l.apiKey,skipConfirmation:i.force,watch:i.watch,...i.watch&&!i.json?{onSubmissionAccepted:r}:{}}),e=c(u,{json:i.json,watch:i.watch});return e!==0&&(process.exitCode=e),{app:m}}};export{t as a};
@@ -1,4 +1,4 @@
1
- import{a as f,b as R,c as _,d as N,e as O,f as F,g as j,h as x,i as E,j as L}from"./chunk-WLGEAJBU.js";import{a as $}from"./chunk-36OXWMXZ.js";import{b as C,c as I}from"./chunk-WJEVB67Y.js";import{b as A}from"./chunk-HEWKCSY7.js";import{A as v,B as P,D as b,V as D,z as w}from"./chunk-LIH7CQO7.js";import{h as k}from"./chunk-PSUNX2YX.js";import{a as z}from"./chunk-CTNBSUVU.js";import{wb as S}from"./chunk-GYFRTLML.js";import{d as a,f as c,g as y}from"./chunk-773TIA5M.js";import{e as q,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();import{randomBytes as U}from"node:crypto";import{lstat as p,mkdir as Q,realpath as T,rename as X,unlink as Z,writeFile as tt}from"node:fs/promises";function et(t){let e=a(t,".shopify","app-doctor");return{artifactDirectory:e,reviewPath:a(e,"review.json"),tracePath:a(e,"trace.json")}}async function B(t){let e=et(t.appRoot);return await nt(t.appRoot,e.artifactDirectory),await W(e.tracePath,`${JSON.stringify(t.trace,null,2)}
1
+ import{a as f,b as R,c as _,d as N,e as O,f as F,g as j,h as x,i as E,j as L}from"./chunk-RAJX2CQP.js";import{a as $}from"./chunk-RVEAQUUF.js";import{b as C,c as I}from"./chunk-BR5CFKIN.js";import{b as A}from"./chunk-PUGAY4JP.js";import{A as v,B as P,D as b,V as D,z as w}from"./chunk-T3IMDY72.js";import{h as k}from"./chunk-4EHFK2OI.js";import{a as z}from"./chunk-CTNBSUVU.js";import{wb as S}from"./chunk-TNYPQ2UL.js";import{d as a,f as c,g as y}from"./chunk-773TIA5M.js";import{e as q,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();import{randomBytes as U}from"node:crypto";import{lstat as p,mkdir as Q,realpath as T,rename as X,unlink as Z,writeFile as tt}from"node:fs/promises";function et(t){let e=a(t,".shopify","app-doctor");return{artifactDirectory:e,reviewPath:a(e,"review.json"),tracePath:a(e,"trace.json")}}async function B(t){let e=et(t.appRoot);return await nt(t.appRoot,e.artifactDirectory),await W(e.tracePath,`${JSON.stringify(t.trace,null,2)}
2
2
  `),t.operation!=="scan"?{artifactDirectory:e.artifactDirectory,tracePath:e.tracePath}:(await W(e.reviewPath,`${JSON.stringify(t.reviewPack,null,2)}
3
3
  `),e)}async function nt(t,e){let n=c(t),o=c(e);J(n,o);let r=await p(n);(r.isSymbolicLink()||!r.isDirectory())&&d(o);let s=n;for(let K of[".shopify","app-doctor"])s=a(s,K),await ot(s);let u=await T(n),V=await T(o);J(u,V)}async function ot(t){try{let n=await p(t);(n.isSymbolicLink()||!n.isDirectory())&&d(t);return}catch(n){if(n.code!=="ENOENT")throw n}await Q(t,{mode:448});let e=await p(t);(e.isSymbolicLink()||!e.isDirectory())&&d(t)}function J(t,e){let n=y(t,e);(!n||n.startsWith("..")||n.startsWith("/"))&&d(e)}function d(t){throw new k(`Refusing to write App Doctor artifacts through a symbolic link or outside the app: ${t}`,"Remove or replace the unsafe App Doctor artifact path, then run the command again.")}async function W(t,e){await h(t);let n=`${t}.${U(8).toString("hex")}.tmp`;await h(n);try{await tt(n,e,{encoding:"utf8",mode:384}),await h(t),await X(n,t)}catch(o){throw await Z(n).catch(()=>{}),o}}async function h(t){try{(await p(t)).isSymbolicLink()&&d(t)}catch(e){if(e.code==="ENOENT")return;throw e}}i();function H(t){return t.operation==="scan"?{operation:"scan",engine:t.engine,scan:t.scan,trace:t.trace,reviewPack:t.reviewPack}:{operation:"compile",engine:t.engine,scan:t.scan,trace:t.trace,findings:t.findings}}function Y(t){return`${JSON.stringify(t,null,2)}
4
4
  `}i();var rt={high:"High",medium:"Medium",low:"Low"};function it(t){return{type:st(t),options:{headline:at(t),body:ct(t),...t.findings?{}:{nextSteps:ft(t.commands)},reference:[{subdued:`Engine: ${t.engine.name} ${t.engine.version}`},{subdued:`Ruleset: ${t.engine.ruleset}`}],customSections:dt(t)}}}function G(t){let{type:e,options:n}=it(t);if(e==="success"){w(n);return}if(e==="warning"){v(n);return}P(n)}function M(t){return t.scan.score===null||!t.scan.scan.coverage_complete||t.scan.scan.coverage_gaps.length>0}function st(t){return t.findings&&t.findings.rejected.length>0||t.scan.issues.some(e=>e.severity==="high")?"error":t.scan.issues.length>0||M(t)?"warning":"success"}function at(t){if(t.findings&&t.findings.rejected.length>0)return"App Doctor could not compile some agent findings.";let e=t.scan.issues.length;return e>0?`${e} security ${e===1?"issue":"issues"} found.`:M(t)?"Scan completed with coverage gaps.":"No security issues found."}function ct(t){let e=t.scan,n=[{userInput:f(e.app.name)},{char:"."},`${e.scan.files_scanned} files scanned in ${ht(t.elapsedMilliseconds)}.`],o=e.scan.checks_executed.filter(r=>r.status==="not_applicable").length;return o>0&&n.push({info:`
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-36OXWMXZ.js";import{T as a}from"./chunk-YAA7OGRM.js";import{b as l,c as g,f as S}from"./chunk-WJEVB67Y.js";import{n as o}from"./chunk-AINDVTMY.js";import{a as C}from"./chunk-CTNBSUVU.js";import{e as h,g as e}from"./chunk-VKWPEFWQ.js";e();e();var P=["HONOR_BILLING_PRICE","PLAN_PRICE"],T=["OPT_OUT","WHEN_REQUIRED"],f=["UNSCHEDULED","SCHEDULED","MIGRATED"];var r=h(C(),1);var u={...l,...d,...g},F={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final outcome when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},y={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final state when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},R={...u,status:r.Flags.option({description:"Filter subscriptions by migration status.",env:"SHOPIFY_FLAG_STATUS",options:[...f]})()},L={...u,input:r.Flags.string({char:"i",description:"Path to the migration CSV. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),force:S(r.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})),...F},_={...u,id:r.Flags.string({description:"The app subscription migration operation ID. Can be specified multiple times.",env:"SHOPIFY_FLAG_ID",required:!0,multiple:!0})},v={..._,...y};e();e();var I=o`
1
+ import{a as d}from"./chunk-RVEAQUUF.js";import{T as a}from"./chunk-NKSLEPE2.js";import{b as l,c as g,f as S}from"./chunk-BR5CFKIN.js";import{n as o}from"./chunk-IAURXPUJ.js";import{a as C}from"./chunk-CTNBSUVU.js";import{e as h,g as e}from"./chunk-VKWPEFWQ.js";e();e();var P=["HONOR_BILLING_PRICE","PLAN_PRICE"],T=["OPT_OUT","WHEN_REQUIRED"],f=["UNSCHEDULED","SCHEDULED","MIGRATED"];var r=h(C(),1);var u={...l,...d,...g},F={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final outcome when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},y={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final state when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},R={...u,status:r.Flags.option({description:"Filter subscriptions by migration status.",env:"SHOPIFY_FLAG_STATUS",options:[...f]})()},L={...u,input:r.Flags.string({char:"i",description:"Path to the migration CSV. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),force:S(r.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})),...F},_={...u,id:r.Flags.string({description:"The app subscription migration operation ID. Can be specified multiple times.",env:"SHOPIFY_FLAG_ID",required:!0,multiple:!0})},v={..._,...y};e();e();var I=o`
2
2
  query MigratableAppSubscriptions(
3
3
  $apiKey: String!
4
4
  $first: Int!
@@ -0,0 +1,6 @@
1
+ import{S as v,a as S}from"./chunk-T3IMDY72.js";import{l as O,n as W}from"./chunk-RM3XC2IX.js";import{f as y}from"./chunk-HLLMMIIM.js";import{h as u,k as L}from"./chunk-4EHFK2OI.js";import{a as I}from"./chunk-CX5CC6P5.js";import{$a as F,Ab as d,Ta as w,Ua as i,Wa as D,jb as B,ma as x,qb as c,sb as s,ua as _}from"./chunk-TNYPQ2UL.js";import{d as r,i as k}from"./chunk-773TIA5M.js";import{e as R,g as f}from"./chunk-VKWPEFWQ.js";f();f();function b(e,n){try{return JSON.parse(e)}catch(a){let t=a instanceof Error?a.message:String(a),o=n?` from ${n}`:"";throw new u(`Failed to parse JSON${o}.
2
+ ${t}`)}}var l=R(I()),N="yarn.lock",j="package-lock.json",$="pnpm-lock.yaml",C="bun.lockb",J="bun.lock",T="pnpm-workspace.yaml",we=[N,$,j,C,J],ye={yarn:[N],npm:[j],pnpm:[$],bun:[C,J],homebrew:[],unknown:[]},E=["yarn","npm","pnpm","bun","homebrew","unknown"],M=class extends u{constructor(){super("Unknown package manager")}},h=class extends u{constructor(n){super(s`The directory ${c.path(n)} doesn't have a package.json.`)}},P=class extends L{constructor(n){super(s`Couldn't find a a package.json traversing directories from ${c.path(n)}`)}};function V(e=process.env){let n=e.npm_config_user_agent;return["yarn","pnpm","bun","npm"].find(a=>n?.includes(a))??"unknown"}function U(e){return i(r(e,C))||i(r(e,J))}function G(e){switch(e){case"yarn":case"npm":case"pnpm":case"bun":return e;case"homebrew":case"unknown":return"npm"}}function K(e,n,...a){switch(e){case"npm":return{command:"npm",args:["exec","--",n,...a]};case"pnpm":return{command:"pnpm",args:["exec",n,...a]};case"yarn":return{command:"yarn",args:["run",n,...a]};case"bun":return{command:"bun",args:["x",n,...a]}}}async function A(e){let n=e;for(d(s`Looking for a lockfile in ${c.path(n)}...`);;){if(i(r(n,N)))return"yarn";if(i(r(n,$))||i(r(n,T)))return"pnpm";if(U(n))return"bun";if(i(r(n,j)))return"npm";let t=k(n);if(t===n)break;n=t}let a=V();return a!=="unknown"?a:"npm"}async function he(e,n,...a){let t=G(await A(e));return K(t,n,...a)}async function xe(e){let n=await D(r(e.directory,"**/package.json"),{ignore:[r(e.directory,"node_modules/**/package.json")],cwd:e.directory,onlyFiles:!0,deep:e.deep}),a=new S;try{await Promise.all(n.map(async t=>{let o=k(t);await z({directory:o,packageManager:e.packageManager,stdout:void 0,stderr:void 0,signal:a.signal,args:[]})}))}catch(t){throw a.abort(),t}}async function z(e){let n={cwd:e.directory,stdin:void 0,stdout:e.stdout,stderr:e.stderr,signal:e.signal},a=["install"];e.args&&(a=a.concat(e.args)),await y("cmd_all_timing_network_ms")(async()=>{await v(e.packageManager,a,n)})}async function ve(e){return(await m(e)).name}async function be(e){return(await m(e)).version}async function H(e){let n=await m(e),a=n.dependencies??{},t=n.devDependencies??{};return{...a,...t}}async function Me(e){let n=r(e,"package.json"),a=await m(n),t=r(e,T);return!!a.workspaces||w(t)}async function Pe(e,n,{cacheExpiryInHours:a=0}={}){let t=async()=>(d(s`Checking if there's a version of ${e} newer than ${n}`),ne(e)),o=`npm-package-${e}`,p;try{p=await O(o,t,a*3600*1e3)}catch{return}if(p&&new l.SemVer(n).compare(p)<0)return p}function Ne(e,n){let a=`npm-package-${e}`,t=W(a)?.value;if(t&&new l.SemVer(n).compare(t)<0)return t}function je(e,n){return(0,l.satisfies)(e,n)}async function m(e){if(!await w(e))throw new h(k(e));return b(await x(e),e)}async function Y(e,n){d(s`Adding the following dependencies if needed:
3
+ ${c.json(e)}
4
+ With options:
5
+ ${c.json(n)}
6
+ `);let a=r(n.directory,"package.json");if(!await w(a))throw new h(n.directory);let t=Object.keys(await H(a)),o=e.filter(p=>!t.includes(p.name));o.length!==0&&await q(o,n)}async function q(e,n){let a=e.map(t=>t.version?`${t.name}@${t.version}`:t.name);switch(n.stdout?.write(`Installing ${a.join(" ")} with ${n.packageManager}`),n.packageManager){case"npm":for(let t of a)await g(n,Q(t,n.type));break;case"yarn":await g(n,X(a,n.type,!!n.addToRootDirectory));break;case"pnpm":await g(n,Z(a,n.type,!!n.addToRootDirectory));break;case"bun":await g(n,ee(a,n.type)),await g(n,["install"]);break;case"homebrew":throw new u("Homebrew can't be used to install project dependencies. Use npm, yarn, pnpm, or bun.");case"unknown":throw new M}}async function g(e,n){return y("cmd_all_timing_network_ms")(async()=>v(e.packageManager,n,{cwd:e.directory,stdout:e.stdout,stderr:e.stderr,signal:e.signal}))}async function $e(e,n){await Y(e.map(a=>({name:a,version:void 0})),n)}function Q(e,n){let t=["install",e,{dev:"--save-dev",peer:"--save-peer",prod:"--save-prod"}[n]];return e.match(/@\d/g)&&t.push("--save-exact"),t}function X(e,n,a=!1){let t={dev:"--dev",peer:"--peer",prod:"--prod"};return["add",...a?["-W"]:[],...e,t[n]]}function Z(e,n,a=!1){let t={dev:"--save-dev",peer:"--save-peer",prod:"--save-prod"};return["add",...a?["-w"]:[],...e,t[n]]}function ee(e,n){let t={dev:"--development",peer:"--optional"}[n];return["add",...e,...t?[t]:[]]}async function Ce(e){let n=await F("package.json",{cwd:e,type:"file"});if(n){let a=b(await x(n),n);return{path:n,content:a}}else throw new P(e)}async function Je(e,n){let a=await A(e),t=await m(r(e,"package.json")),o=a==="yarn"?"resolutions":"overrides";t[o]={...t[o],...n},await ae(e,t)}async function ne(e){return d(s`Getting the latest version of NPM package: ${c.raw(e)}`),y("cmd_all_timing_network_ms")(async()=>{let{default:n}=await import("./latest-version-LDWU5F7A.js");return n(e)})}async function ae(e,n){d(s`JSON-encoding and writing content to package.json at ${c.path(e)}...`);let a=r(e,"package.json");await _(a,JSON.stringify(n,null,2))}function _e(e,n=process.env){if(e&&E.includes(e))return e;let a=V(n);if(a!=="unknown")return a;let t=B();return t!=="unknown"?t:"npm"}export{N as a,j as b,$ as c,C as d,T as e,we as f,ye as g,E as h,M as i,h as j,P as k,V as l,A as m,he as n,xe as o,z as p,ve as q,be as r,H as s,Me as t,Pe as u,Ne as v,je as w,m as x,Y as y,q as z,$e as A,Ce as B,Je as C,ae as D,_e as E};
@@ -1,4 +1,4 @@
1
- import{b as N,c as S,d as A}from"./chunk-H6HILX7D.js";import{a as T}from"./chunk-MA6QRENS.js";import{a as g}from"./chunk-36OXWMXZ.js";import{b as P,c as y,xa as x}from"./chunk-YAA7OGRM.js";import{b as d,c as b}from"./chunk-WJEVB67Y.js";import{y as f}from"./chunk-LIH7CQO7.js";import{qb as h,sb as l,wb as m}from"./chunk-GYFRTLML.js";import{d as p}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function w(n,t){let o={};return n.targeting?.forEach(e=>{e.target&&(o[e.target]={...e.input_query&&{inputQueryPath:`${t}/${e.input_query}`},...e.export&&{export:e.export}})}),o}function C(n,t,o,e,r,i){return JSON.stringify({handle:t.handle,name:n.name,apiVersion:t.api_version,targeting:o,schemaPath:i,wasmPath:r,functionRunnerPath:e},null,2)}function I(n,t){return{title:`CONFIGURATION
1
+ import{b as N,c as S,d as A}from"./chunk-3U7O3PMX.js";import{a as T}from"./chunk-ENEPD4BS.js";import{a as g}from"./chunk-RVEAQUUF.js";import{b as P,c as y,xa as x}from"./chunk-NKSLEPE2.js";import{b as d,c as b}from"./chunk-BR5CFKIN.js";import{y as f}from"./chunk-T3IMDY72.js";import{qb as h,sb as l,wb as m}from"./chunk-TNYPQ2UL.js";import{d as p}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function w(n,t){let o={};return n.targeting?.forEach(e=>{e.target&&(o[e.target]={...e.input_query&&{inputQueryPath:`${t}/${e.input_query}`},...e.export&&{export:e.export}})}),o}function C(n,t,o,e,r,i){return JSON.stringify({handle:t.handle,name:n.name,apiVersion:t.api_version,targeting:o,schemaPath:i,wasmPath:r,functionRunnerPath:e},null,2)}function I(n,t){return{title:`CONFIGURATION
2
2
  `,body:{tabularData:[["Handle",n.handle??"N/A"],["Name",t??"N/A"],["API Version",n.api_version??"N/A"]],firstColumnSubdued:!0}}}function j(n){if(Object.keys(n).length===0)return null;let t=[];return Object.entries(n).forEach(([o,e])=>{t.push([l`${h.cyan(o)}`.value,""]),e.inputQueryPath&&t.push([{subdued:" Input Query Path"},{filePath:e.inputQueryPath}]),e.export&&t.push([{subdued:" Export"},e.export])}),{title:`
3
3
  TARGETING
4
4
  `,body:{tabularData:t}}}function O(n,t){return{title:`
@@ -1,4 +1,4 @@
1
- import{a as C}from"./chunk-3NVQXPTU.js";import{a as R}from"./chunk-36OXWMXZ.js";import{R as I,S as E,U as x,wa as F}from"./chunk-YAA7OGRM.js";import{b as k}from"./chunk-WJEVB67Y.js";import{B as v,H as h,z as g}from"./chunk-LIH7CQO7.js";import{d as w}from"./chunk-VRO6QBVN.js";import{j as A}from"./chunk-PSUNX2YX.js";import{a as y}from"./chunk-CTNBSUVU.js";import{e as b,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function P(o){let{developerPlatformClient:e,app:l,remoteApp:s}=o,{extensionIdentifiersBreakdown:r,versionDetails:n}=await I(e,s,o.version),i=E({localApp:l,versionAppModules:n.appModuleVersions,activeAppVersion:await e.activeAppVersion(s)});if(!await x({configExtensionIdentifiersBreakdown:i,extensionIdentifiersBreakdown:r,appTitle:s.title,release:!0,allowUpdates:o.force||o.allowUpdates,allowDeletes:o.force||o.allowDeletes}))throw new A;let d=[{title:"Releasing version",task:async m=>{m.appRelease=await e.release({app:s,version:{versionId:n.uuid,appVersionId:n.id}})}}],{appRelease:{appRelease:p}}=await h(d),c=[{link:{label:n.versionTag??void 0,url:n.location}},n.message?`
1
+ import{a as C}from"./chunk-NNCLTG6A.js";import{a as R}from"./chunk-RVEAQUUF.js";import{R as I,S as E,U as x,wa as F}from"./chunk-NKSLEPE2.js";import{b as k}from"./chunk-BR5CFKIN.js";import{B as v,H as h,z as g}from"./chunk-T3IMDY72.js";import{d as w}from"./chunk-HLLMMIIM.js";import{j as A}from"./chunk-4EHFK2OI.js";import{a as y}from"./chunk-CTNBSUVU.js";import{e as b,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function P(o){let{developerPlatformClient:e,app:l,remoteApp:s}=o,{extensionIdentifiersBreakdown:r,versionDetails:n}=await I(e,s,o.version),i=E({localApp:l,versionAppModules:n.appModuleVersions,activeAppVersion:await e.activeAppVersion(s)});if(!await x({configExtensionIdentifiersBreakdown:i,extensionIdentifiersBreakdown:r,appTitle:s.title,release:!0,allowUpdates:o.force||o.allowUpdates,allowDeletes:o.force||o.allowDeletes}))throw new A;let d=[{title:"Releasing version",task:async m=>{m.appRelease=await e.release({app:s,version:{versionId:n.uuid,appVersionId:n.id}})}}],{appRelease:{appRelease:p}}=await h(d),c=[{link:{label:n.versionTag??void 0,url:n.location}},n.message?`
2
2
  ${n.message}`:""];if(p.userErrors&&p.userErrors.length>0){let m=p.userErrors?.map(_=>_.message).join(", ");v({headline:"Version couldn't be released.",body:[...c,`${c.length>0?`
3
3
 
4
4
  `:""}${m}`]})}else g({headline:"Version released to users.",body:c})}var t=b(y(),1);var f=class o extends C{static summary="Release an app version.";static usage="app release --version <version>";static descriptionWithMarkdown="Releases an existing app version. Pass the name of the version that you want to release using the `--version` flag.";static description=this.descriptionWithoutMarkdown();static flags={...k,...R,"allow-updates":t.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. Required in non-interactive environments unless --allow-deletes is provided.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":t.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. Required in non-interactive environments unless --allow-updates is provided.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),version:t.Flags.string({hidden:!1,description:"The name of the app version to release.",env:"SHOPIFY_FLAG_VERSION",required:!0})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes"]}]}async run(){let{flags:e}=await this.parse(o),l=e["client-id"];await w(()=>({cmd_app_reset_used:e.reset}));let s=e["allow-updates"],r=e["allow-deletes"],n=!!(s&&r),{app:i,remoteApp:u,developerPlatformClient:d}=await F({directory:e.path,clientId:l,forceRelink:e.reset,userProvidedConfigName:e.config});return await P({app:i,remoteApp:u,developerPlatformClient:d,force:n,allowUpdates:s,allowDeletes:r,version:e.version}),{app:i}}};export{f as a};
@@ -1 +1 @@
1
- import{b as p}from"./chunk-JVXKDM2E.js";import{Aa as s,l as E,xa as b,ya as k}from"./chunk-AINDVTMY.js";import{J as w}from"./chunk-LIH7CQO7.js";import{h as N}from"./chunk-PSUNX2YX.js";import{Ab as V,S as _}from"./chunk-GYFRTLML.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ie="live",ae="unpublished";function te(e){return e.role===g}async function de(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??=!1,e.createdAtRuntime??=!1;let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function se(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",c={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function sn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await p({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),k(i),V(`Error fetching theme with ID: ${e}`)}}async function un(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await T({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await T({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw k(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function cn(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await T({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:c});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw k(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function pn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await T({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let u=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async u=>{let{attachment:h,value:v}=await J(u.body);return{attachment:h,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function vn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await p({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:c});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:h}=o;u&&u.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(k(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function Nn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);b("theme-api:upload-files");let o=await K(e,m,a);b("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return p({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:c})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),k(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function hn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await T({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw k(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function fn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await p({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:c});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let u=d.userErrors.map(h=>h.message).join(", ");throw k(new N(u))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function yn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await p({query:O,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function Sn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await p({query:x,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),!0}async function Fn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await p({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:c,responseOptions:{onResponse:u=>{i=u.headers.get("x-request-id")??void 0}}});if(!t)return k("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Tn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await p({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await p({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw k(new N(e))}async function T(e){try{return await p(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw k(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:Z(i)}function Z(e){return e.trim().replace(/\.$/,"").replace(/^The user needs\s+/i,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function J(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw k(new N(`Error downloading content from URL: ${e.url}`))}}}export{se as a,g as b,ie as c,ae as d,te as e,de as f,sn as g,un as h,kn as i,cn as j,pn as k,vn as l,Nn as m,hn as n,fn as o,yn as p,Sn as q,Fn as r,Tn as s,bn as t};
1
+ import{b as p}from"./chunk-C2AA5NVP.js";import{Aa as s,l as E,xa as b,ya as k}from"./chunk-IAURXPUJ.js";import{J as w}from"./chunk-T3IMDY72.js";import{h as N}from"./chunk-4EHFK2OI.js";import{Ab as V,S as _}from"./chunk-TNYPQ2UL.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ie="live",ae="unpublished";function te(e){return e.role===g}async function de(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??=!1,e.createdAtRuntime??=!1;let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function se(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",c={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function sn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await p({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),k(i),V(`Error fetching theme with ID: ${e}`)}}async function un(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await T({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await T({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw k(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function cn(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await T({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:c});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw k(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function pn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await T({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let u=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async u=>{let{attachment:h,value:v}=await J(u.body);return{attachment:h,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function vn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await p({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:c});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:h}=o;u&&u.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(k(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function Nn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);b("theme-api:upload-files");let o=await K(e,m,a);b("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return p({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:c})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),k(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function hn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await T({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw k(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function fn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await p({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:c});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let u=d.userErrors.map(h=>h.message).join(", ");throw k(new N(u))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function yn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await p({query:O,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function Sn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await p({query:x,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),!0}async function Fn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await p({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:c,responseOptions:{onResponse:u=>{i=u.headers.get("x-request-id")??void 0}}});if(!t)return k("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Tn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await p({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await p({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw k(new N(e))}async function T(e){try{return await p(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw k(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:Z(i)}function Z(e){return e.trim().replace(/\.$/,"").replace(/^The user needs\s+/i,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function J(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw k(new N(`Error downloading content from URL: ${e.url}`))}}}export{se as a,g as b,ie as c,ae as d,te as e,de as f,sn as g,un as h,kn as i,cn as j,pn as k,vn as l,Nn as m,hn as n,fn as o,yn as p,Sn as q,Fn as r,Tn as s,bn as t};
@@ -1 +1 @@
1
- import{a as I}from"./chunk-CTNBSUVU.js";import{b as l}from"./chunk-DPNZWBT5.js";import{a as c}from"./chunk-JD5P5RAJ.js";import{e as h,g as s}from"./chunk-VKWPEFWQ.js";s();s();import{fileURLToPath as L}from"node:url";async function m(e){let{isDevelopment:o}=await import("./local-W73VIWHZ.js"),{ShopifyConfig:n}=await import("./custom-oclif-loader-BWAMUFQ4.js"),t=await import("./lib-2BR2WN7L.js"),{run:i,flush:p,Errors:d,settings:f}=t.default??t;o()&&(f.debug=!0);try{let r=new n({root:L(e.moduleURL)});await r.load(),e.lazyCommandLoader&&r.setLazyCommandLoader(e.lazyCommandLoader),await i(e.argv,r),await p()}catch(r){let{errorHandler:u}=await import("./error-handler-3PBXTHYY.js");return await u(r),d.handle(r)}}var a=h(I());async function C(e=process.versions){let o=e.node,n=Number(o.split(".")[0]);if(n<22){let{renderError:i}=await import("./ui-T22J7MQF.js");i({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function y(e,o=process.argv,n=process.env){o.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function b(e=process.argv,o=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||c(o.NO_COLOR)||c(o.SHOPIFY_FLAG_NO_COLOR)||c(o[l.json])||o.TERM==="dumb")&&(o.FORCE_COLOR="0")}async function F(e,o=m,n=process.argv,t=process.env,i=process.versions){return y(e,n,t),e.runInCreateMode&&await g(e,n),b(n,t),await C(i),o({moduleURL:e.moduleURL,lazyCommandLoader:e.lazyCommandLoader})}async function g(e,o=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-GSHLPD5X.js"),{moduleDirectory:t}=await import("./path-MBXP7ZIC.js"),d=(await n(t(e.moduleURL))).content.name.replace("@shopify/create-","");if(o.findIndex(r=>r.includes("init"))===-1){let r=o.findIndex(u=>u.match(new RegExp(`bin(\\/|\\\\)+(create-${d}|dev|run)`)))+1;o.splice(r,0,"init")}}var R={"no-color":a.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:a.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output. May include sensitive data.",env:"SHOPIFY_FLAG_VERBOSE"})},S={json:a.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:l.json})},E={"auth-alias":a.Flags.string({description:"Alias of the Shopify account to use for authentication.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})},A=(e={})=>{let o=[e.description,"Must be between 1 and 65535."].filter(Boolean).join(" ");return a.Flags.integer({min:1,max:65535,...e,description:o})};function j(e){let o=e.description?.trimEnd(),t=[o&&!o.endsWith(".")?`${o}.`:o,"Required if non interactive."].filter(Boolean).join(" ");return{...e,description:t,requiredIfNonInteractive:!0}}async function U(){let{cacheClear:e}=await import("./conf-store-K65PEQF6.js");e()}export{F as a,R as b,S as c,E as d,A as e,j as f,U as g};
1
+ import{a as I}from"./chunk-CTNBSUVU.js";import{b as l}from"./chunk-DPNZWBT5.js";import{a as c}from"./chunk-JD5P5RAJ.js";import{e as h,g as s}from"./chunk-VKWPEFWQ.js";s();s();import{fileURLToPath as L}from"node:url";async function m(e){let{isDevelopment:o}=await import("./local-IBYCFEVA.js"),{ShopifyConfig:n}=await import("./custom-oclif-loader-BWAMUFQ4.js"),t=await import("./lib-2BR2WN7L.js"),{run:i,flush:p,Errors:d,settings:f}=t.default??t;o()&&(f.debug=!0);try{let r=new n({root:L(e.moduleURL)});await r.load(),e.lazyCommandLoader&&r.setLazyCommandLoader(e.lazyCommandLoader),await i(e.argv,r),await p()}catch(r){let{errorHandler:u}=await import("./error-handler-SY45FR6A.js");return await u(r),d.handle(r)}}var a=h(I());async function C(e=process.versions){let o=e.node,n=Number(o.split(".")[0]);if(n<22){let{renderError:i}=await import("./ui-CIZHMGKK.js");i({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function y(e,o=process.argv,n=process.env){o.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function b(e=process.argv,o=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||c(o.NO_COLOR)||c(o.SHOPIFY_FLAG_NO_COLOR)||c(o[l.json])||o.TERM==="dumb")&&(o.FORCE_COLOR="0")}async function F(e,o=m,n=process.argv,t=process.env,i=process.versions){return y(e,n,t),e.runInCreateMode&&await g(e,n),b(n,t),await C(i),o({moduleURL:e.moduleURL,lazyCommandLoader:e.lazyCommandLoader})}async function g(e,o=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-ESOHDRPJ.js"),{moduleDirectory:t}=await import("./path-MBXP7ZIC.js"),d=(await n(t(e.moduleURL))).content.name.replace("@shopify/create-","");if(o.findIndex(r=>r.includes("init"))===-1){let r=o.findIndex(u=>u.match(new RegExp(`bin(\\/|\\\\)+(create-${d}|dev|run)`)))+1;o.splice(r,0,"init")}}var R={"no-color":a.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:a.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output. May include sensitive data.",env:"SHOPIFY_FLAG_VERBOSE"})},S={json:a.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:l.json})},E={"auth-alias":a.Flags.string({description:"Alias of the Shopify account to use for authentication.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})},A=(e={})=>{let o=[e.description,"Must be between 1 and 65535."].filter(Boolean).join(" ");return a.Flags.integer({min:1,max:65535,...e,description:o})};function j(e){let o=e.description?.trimEnd(),t=[o&&!o.endsWith(".")?`${o}.`:o,"Required if non interactive."].filter(Boolean).join(" ");return{...e,description:t,requiredIfNonInteractive:!0}}async function U(){let{cacheClear:e}=await import("./conf-store-F4NCJPWK.js");e()}export{F as a,R as b,S as c,E as d,A as e,j as f,U as g};
@@ -1,4 +1,4 @@
1
- import{a as M}from"./chunk-LJO22Z6S.js";import{a as E}from"./chunk-3NVQXPTU.js";import{a as I}from"./chunk-36OXWMXZ.js";import{B as C,wa as j}from"./chunk-YAA7OGRM.js";import{e as O}from"./chunk-JVXKDM2E.js";import{a as z}from"./chunk-AXLLN6DZ.js";import{b as R}from"./chunk-WJEVB67Y.js";import{D as y,W as _,ia as h,la as g}from"./chunk-AINDVTMY.js";import{H as T,I as k,y as A}from"./chunk-LIH7CQO7.js";import{k as D}from"./chunk-PSUNX2YX.js";import{a as H}from"./chunk-CTNBSUVU.js";import{qb as p,sb as m,xb as f}from"./chunk-GYFRTLML.js";import{e as F,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};l();async function J(e){let i="Admin",n=O(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function P(e){return g({query:e.query,...await J(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}l();var w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var x=F(z(),1);var Q={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function $({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>P({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),s=[];for(s.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),s.push(...o.nodes);return{status:"ok",items:s}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function V(e,i){let n="";for(let t of e)n=(0,x.updateTomlValues)(n,t);return`# ${i}
1
+ import{a as M}from"./chunk-6NO44HAQ.js";import{a as E}from"./chunk-NNCLTG6A.js";import{a as I}from"./chunk-RVEAQUUF.js";import{B as C,wa as j}from"./chunk-NKSLEPE2.js";import{e as O}from"./chunk-C2AA5NVP.js";import{a as z}from"./chunk-J6BXYZRY.js";import{b as R}from"./chunk-BR5CFKIN.js";import{D as y,W as _,ia as h,la as g}from"./chunk-IAURXPUJ.js";import{H as T,I as k,y as A}from"./chunk-T3IMDY72.js";import{k as D}from"./chunk-4EHFK2OI.js";import{a as H}from"./chunk-CTNBSUVU.js";import{qb as p,sb as m,xb as f}from"./chunk-TNYPQ2UL.js";import{e as F,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};l();async function J(e){let i="Admin",n=O(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function P(e){return g({query:e.query,...await J(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}l();var w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var x=F(z(),1);var Q={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function $({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>P({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),s=[];for(s.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),s.push(...o.nodes);return{status:"ok",items:s}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function V(e,i){let n="";for(let t of e)n=(0,x.updateTomlValues)(n,t);return`# ${i}
2
2
  ${n}`}function Z(e,i){let n=i.map(oe).map(a=>{switch(a.status){case"ok":{let{typeName:o,patches:s}=a;return V(s,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:s})=>a.map(r=>({result:de(r,o),graphQLOwner:s}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:s,key:r,patches:N}=a;return V(N,`namespace: ${s==="app"?"$app":`$app:${s}`} key: ${r} owner_type: ${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null);return{tomlContent:[...n,...t].join(`
3
3
  `),metafieldCount:t.length,metaobjectCount:n.length}}async function q(e){let i=await ae(e),n=i.storeFqdn,t=await ee(i),d=await ne(i);e.includeExistingDeclaredDefinitions||(t=ie(t,e.appConfiguration),d=te(d,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:s}=Z(t,d);X(o,s,n,a)}function X(e,i,n,t){A({headline:"Conversion to TOML complete.",body:["Converted",{warn:`${e} metafields`},"and",{warn:`${i} metaobjects`},"from",{warn:n},"into TOML, ready for you to copy."],orderedNextSteps:!0,nextSteps:["Review the suggested TOML carefully before applying.",["Missing sections? Make sure your app has the required access scopes to load metafields and metaobjects (e.g.",{command:"read_customers"},"to load customer metafields,",{command:"read_metaobject_definitions"},"to load metaobjects.)"],["Missing definitions? Only metafields and metaobjects that are app-reserved (using",{command:"$app"},") will be converted."],["When you're ready, add the generated TOML to your app's configuration file and test out changes with the",{command:"shopify app dev"},"command."]]}),ce(t)}async function ee(e){let i=[];return await T(Object.entries(Q).map(([n,t])=>({title:m`Loading ${p.green(n)} metafields`,task:async()=>{let d=await $({query:L,session:e,toNodes:a=>a.metafieldDefinitions,toVariables:a=>({ownerType:t,after:a})});i.push({metafields:d,ownerType:n,graphQLOwner:t})}}))),i.map(({metafields:n,ownerType:t,graphQLOwner:d})=>n.status==="ok"?{ownerType:t,items:n.items,graphQLOwner:d}:null).filter(n=>n!==null)}async function ne(e){let i=await k({title:m`Loading ${p.green("metaobjects")}`,task:async()=>$({query:w,session:e,toNodes:n=>n.metaobjectDefinitions,toVariables:n=>({after:n})})});return i.status==="ok"?i.items:[]}function ie(e,i){return e.map(n=>{let t=n.items.filter(d=>!K(i,[n.ownerType,"metafields",u(d.namespace)??"",d.key]));return t.length>0?{...n,items:t}:null}).filter(n=>n!==null)}function te(e,i){return e.filter(n=>!K(i,["metaobjects","app",u(n.type)??""]))}function K(e,i){let n=e;for(let t of i){if(!n[t])return!1;n=n[t]}return!0}async function ae(e){let{remoteApp:i,store:n}=e,t=i.apiSecretKeys[0]?.secret;if(!t)throw new D("No API secret keys found for app");return await _(n.shopDomain,i.apiKey,t)}function u(e){if(!e.match(/^app--\d+/))return null;let i="app";return e.match(/^app--\d+--/)&&(i=e.replace(/^app--\d+--/,"")),i}function de(e,i){let n=u(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,d=se(e),a=re(d,i,n,t);return{status:"ok",key:t,namespace:n,patches:a}}function oe(e){let i=u(e.type);if(!i)return{status:"not_app_reserved"};let n=le(e,i),t=me(n,i);return{status:"ok",typeName:i,patches:t}}function se(e){let i={name:e.name===e.key?void 0:e.name,type:e.type.name,description:e.description??void 0,capabilities:c({admin_filterable:e.capabilities.adminFilterable.enabled||void 0}),access:c({admin:W(e.access.admin),storefront:Y(e.access.storefront),customer_account:ue(e.access.customerAccount)}),validations:G(e.validations)},{type:n,validations:t}=U(i.type,i.validations);return i.type=n,i.validations=t,i}function le(e,i){return{name:e.name===i?void 0:e.name,description:e.description??void 0,display_name_field:e.displayNameKey??void 0,access:c({admin:W(e.access.admin),storefront:Y(e.access.storefront)}),capabilities:c({translatable:e.capabilities.translatable.enabled||void 0,publishable:e.capabilities.publishable.enabled||void 0,renderable:e.capabilities.renderable?.enabled||void 0,renderable_meta_title_field:e.capabilities.renderable?.data?.metaTitleKey??void 0,renderable_meta_description_field:e.capabilities.renderable?.data?.metaDescriptionKey??void 0}),fields:Object.fromEntries(e.fieldDefinitions.map(n=>{let t={type:n.type.name,description:n.description??void 0,name:n.name===n.key?void 0:n.name,required:n.required||void 0,validations:G(n.validations)},{type:d,validations:a}=U(t.type,t.validations);return t.type=d,t.validations=a,[n.key,t]}))}}function U(e,i){if(!i)return{type:e,validations:void 0};if(i.metaobject_definition_type&&typeof i.metaobject_definition_type=="string"){let n=u(i.metaobject_definition_type);return{type:`${e}<$app:${n}>`,validations:c({...i,metaobject_definition_type:void 0})}}if(i.metaobject_definition_types&&Array.isArray(i.metaobject_definition_types)&&i.metaobject_definition_types.every(n=>typeof n=="string")){let n=i.metaobject_definition_types.map(t=>u(t));return{type:`${e}<${n.map(t=>`$app:${t}`).join(",")}>`,validations:c({...i,metaobject_definition_types:void 0})}}return{type:e,validations:i}}function G(e){let i=n=>{try{return JSON.parse(n)}catch{return n}};return c(Object.fromEntries(e.filter(n=>n.value!==void 0&&n.name!=="metaobject_definition_id"&&n.name!=="metaobject_definition_ids").map(n=>[n.name,n.value?i(n.value):void 0])))}function re(e,i,n,t){let d=[[[i,"metafields",n,t,"name"],e.name],[[i,"metafields",n,t,"type"],e.type],[[i,"metafields",n,t,"description"],e.description]],a=[[[i,"metafields",n,t,"access","admin"],e.access?.admin],[[i,"metafields",n,t,"access","storefront"],e.access?.storefront],[[i,"metafields",n,t,"access","customer_account"],e.access?.customer_account],[[i,"metafields",n,t,"capabilities","admin_filterable"],e.capabilities?.admin_filterable||void 0]];return e.validations&&B(e.validations).forEach(({validationKey:s,actualValue:r})=>{d.push([[i,"metafields",n,t,"validations",s],r])}),[v(d),v(a)]}function me(e,i){let n=[[["metaobjects","app",i,"name"],e.name===i?void 0:e.name],[["metaobjects","app",i,"description"],e.description],[["metaobjects","app",i,"display_name_field"],e.display_name_field]],t=[[["metaobjects","app",i,"access","admin"],e.access?.admin],[["metaobjects","app",i,"access","storefront"],e.access?.storefront]];return e.capabilities?.translatable&&t.push([["metaobjects","app",i,"capabilities","translatable"],!0]),e.capabilities?.publishable&&t.push([["metaobjects","app",i,"capabilities","publishable"],!0]),e.capabilities?.renderable&&(t.push([["metaobjects","app",i,"capabilities","renderable"],!0]),e.capabilities?.renderable_meta_title_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_title_field"],e.capabilities.renderable_meta_title_field]),e.capabilities?.renderable_meta_description_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_description_field"],e.capabilities.renderable_meta_description_field])),Object.entries(e.fields).forEach(([d,a])=>{if(typeof a=="string")n.push([["metaobjects","app",i,"fields",d],a]);else{let o=Object.fromEntries(Object.entries(a).filter(([s,r])=>r!==void 0));Object.keys(o).length===1?n.push([["metaobjects","app",i,"fields",d],a.type]):(n.push([["metaobjects","app",i,"fields",d,"type"],a.type]),n.push([["metaobjects","app",i,"fields",d,"description"],a.description]),n.push([["metaobjects","app",i,"fields",d,"name"],a.name]),n.push([["metaobjects","app",i,"fields",d,"required"],a.required||void 0]),a.validations&&B(a.validations).forEach(({validationKey:r,actualValue:N})=>{n.push([["metaobjects","app",i,"fields",d,"validations",r],N])}))}}),[v(n),v(t)]}function B(e){return Object.entries(e).map(([i,n])=>{let t;return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&n.every(d=>typeof d=="string")?t=n:t=JSON.stringify(n),{validationKey:i,actualValue:t}})}function ce(e){let i=e.split(`
4
4
  `);for(let n of i)n.match(/^\s*\[/)?f(m`${p.green(n)}`):n.match(/^\s*#/)?f(m`${p.gray(n)}`):f(m`${n}`)}function W(e){switch(e){case"MERCHANT_READ_WRITE":return"merchant_read_write";case"MERCHANT_READ":case"PRIVATE":case"PUBLIC_READ":case"PUBLIC_READ_WRITE":case null:case void 0:return}}function Y(e){switch(e){case"PUBLIC_READ":return"public_read";case"NONE":case null:case void 0:return}}function ue(e){switch(e){case"READ":return"read";case"READ_WRITE":return"read_write";case"NONE":case null:case void 0:return}}function c(e){if(e&&!h(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function v(e){return e.filter(([i,n])=>n!==void 0)}var b=F(H(),1);var S=class e extends E{static summary="Import metafield and metaobject definitions.";static descriptionWithMarkdown="Import metafield and metaobject definitions from your development store. [Read more about declarative custom data definitions](https://shopify.dev/docs/apps/build/custom-data/declarative-custom-data-definitions).";static description=this.descriptionWithoutMarkdown();static flags={...R,...I,store:b.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>y(i)}),"include-existing":b.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})};async run(){let{appContextResult:i,...n}=await k({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(e);await C(t.path);let d=await j({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await M({appContextResult:d,storeFqdn:t.store,forceReselectStore:t.reset});return{appContextResult:d,appConfiguration:d.app.configuration,remoteApp:d.remoteApp,store:a,includeExistingDeclaredDefinitions:t["include-existing"]}}});return await q(n),{app:i.app}}};export{S as a};
@@ -1,4 +1,4 @@
1
- import{a as x}from"./chunk-LJO22Z6S.js";import{wa as D}from"./chunk-YAA7OGRM.js";import{b as u,d as B}from"./chunk-JVXKDM2E.js";import{k as W,r as y}from"./chunk-AINDVTMY.js";import{B as A,I as N,T as F}from"./chunk-LIH7CQO7.js";import{h as s,k as C}from"./chunk-PSUNX2YX.js";import{Ta as _,ma as T,qb as m,sb as o}from"./chunk-GYFRTLML.js";import{e as z,g as t}from"./chunk-VKWPEFWQ.js";t();var b=z(W(),1);function H(e){return e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/BulkOperation/${e}`:e}function J(e){return e.match(/^gid:\/\/shopify\/BulkOperation\/(\d+)$/)?.[1]??e}function g(e){let n;try{n=(0,b.parse)(e)}catch(i){throw i instanceof Error?new s(`Invalid GraphQL syntax: ${i.message}`):i}if(n.definitions.filter(i=>i.kind==="OperationDefinition").length!==1)throw new s("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.")}function X(e){let n;try{n=(0,b.parse)(e)}catch(i){throw i instanceof Error?new s(`Invalid GraphQL syntax: ${i.message}`):i}return n.definitions.find(i=>i.kind==="OperationDefinition")?.operation==="mutation"}async function Y(e){let{adminSession:n,userSpecifiedVersion:a,minimumDefaultVersion:i}=e;if(a==="unstable")return a;let r=await B(n);if(!a){let c=r.filter(v=>v.supported).map(v=>v.handle);i&&c.push(i);let f=c.sort().reverse()[0];if(!f)throw new s("No supported API versions available for this store.");return f}let l=r.map(c=>c.handle);if(l.includes(a))return a;let d=o`Invalid API version: ${a}`.value,k=o`Allowed versions: ${l.join(", ")}`.value;throw new s(d,k)}t();t();var p="2026-01";t();async function E(e){let n;if(e.query!==void 0){if(!e.query.trim())throw new s("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");n=e.query}else if(e.queryFile){if(!await _(e.queryFile))throw new s(o`Query file not found at ${m.path(e.queryFile)}. Please check the path and try again.`);let a=await T(e.queryFile,{encoding:"utf8"});if(!a.trim())throw new s(o`Query file at ${m.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);n=a}else throw new C("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.");return g(n),n}t();t();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BulkOperationRunQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperationRunQuery"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{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"}}]}}]}}]};async function Z(e){let{adminSession:n,query:a,version:i}=e;return(await u({query:R,session:n,variables:{query:a},...i&&{version:i}})).bulkOperationRunQuery}t();t();t();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StagedUploadsCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StagedUploadInput"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"stagedUploadsCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"stagedTargets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"resourceUrl"}},{kind:"Field",name:{kind:"Name",value:"parameters"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};async function h(e){let{adminSession:n,variablesJsonl:a}=e,i=Buffer.from(a??"","utf-8"),r="bulk-variables.jsonl",l=i.length,d=await ee(n,r,l),k=ne(d);return await ie(i,k.url,k.parameters,r),k.stagedUploadKey}async function ee(e,n,a){return u({query:L,session:e,variables:{input:[{filename:n,fileSize:a.toString(),httpMethod:"POST",mimeType:"text/jsonl",resource:"BULK_MUTATION_VARIABLES"}]}})}function ne(e){if(!e.stagedUploadsCreate)throw new s("No response received from stagedUploadsCreate mutation");if(e.stagedUploadsCreate.userErrors.length>0){let i=e.stagedUploadsCreate.userErrors.map(r=>r.message).join(", ");throw new s(`Failed to create staged upload: ${i}`)}let n=e.stagedUploadsCreate.stagedTargets?.[0];if(!n)throw new s("No staged upload target returned from Shopify");if(!n.url||!n.resourceUrl)throw new s("Invalid staged upload target: missing required URLs");let a=n.parameters.find(i=>i.name==="key")?.value;if(!a)throw new s("No key parameter found in staged upload target");return{url:n.url,resourceUrl:n.resourceUrl,parameters:n.parameters,stagedUploadKey:a}}async function ie(e,n,a,i){let r=new FormData;for(let d of a)r.append(d.name,d.value);r.append("file",new Blob([new Uint8Array(e)],{type:"text/jsonl"}),i);let l=await N({title:o`Uploading bulk operation variables`,task:async()=>y(n,{method:"POST",body:r},"slow-request"),renderOptions:{stdout:process.stderr}});if(!l.ok){let d=await l.text();throw new s(`Failed to upload file to staged URL: ${l.statusText}
1
+ import{a as x}from"./chunk-6NO44HAQ.js";import{wa as D}from"./chunk-NKSLEPE2.js";import{b as u,d as B}from"./chunk-C2AA5NVP.js";import{k as W,r as y}from"./chunk-IAURXPUJ.js";import{B as A,I as N,T as F}from"./chunk-T3IMDY72.js";import{h as s,k as C}from"./chunk-4EHFK2OI.js";import{Ta as _,ma as T,qb as m,sb as o}from"./chunk-TNYPQ2UL.js";import{e as z,g as t}from"./chunk-VKWPEFWQ.js";t();var b=z(W(),1);function H(e){return e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/BulkOperation/${e}`:e}function J(e){return e.match(/^gid:\/\/shopify\/BulkOperation\/(\d+)$/)?.[1]??e}function g(e){let n;try{n=(0,b.parse)(e)}catch(i){throw i instanceof Error?new s(`Invalid GraphQL syntax: ${i.message}`):i}if(n.definitions.filter(i=>i.kind==="OperationDefinition").length!==1)throw new s("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.")}function X(e){let n;try{n=(0,b.parse)(e)}catch(i){throw i instanceof Error?new s(`Invalid GraphQL syntax: ${i.message}`):i}return n.definitions.find(i=>i.kind==="OperationDefinition")?.operation==="mutation"}async function Y(e){let{adminSession:n,userSpecifiedVersion:a,minimumDefaultVersion:i}=e;if(a==="unstable")return a;let r=await B(n);if(!a){let c=r.filter(v=>v.supported).map(v=>v.handle);i&&c.push(i);let f=c.sort().reverse()[0];if(!f)throw new s("No supported API versions available for this store.");return f}let l=r.map(c=>c.handle);if(l.includes(a))return a;let d=o`Invalid API version: ${a}`.value,k=o`Allowed versions: ${l.join(", ")}`.value;throw new s(d,k)}t();t();var p="2026-01";t();async function E(e){let n;if(e.query!==void 0){if(!e.query.trim())throw new s("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");n=e.query}else if(e.queryFile){if(!await _(e.queryFile))throw new s(o`Query file not found at ${m.path(e.queryFile)}. Please check the path and try again.`);let a=await T(e.queryFile,{encoding:"utf8"});if(!a.trim())throw new s(o`Query file at ${m.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);n=a}else throw new C("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.");return g(n),n}t();t();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BulkOperationRunQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperationRunQuery"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{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"}}]}}]}}]};async function Z(e){let{adminSession:n,query:a,version:i}=e;return(await u({query:R,session:n,variables:{query:a},...i&&{version:i}})).bulkOperationRunQuery}t();t();t();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StagedUploadsCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StagedUploadInput"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"stagedUploadsCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"stagedTargets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"resourceUrl"}},{kind:"Field",name:{kind:"Name",value:"parameters"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};async function h(e){let{adminSession:n,variablesJsonl:a}=e,i=Buffer.from(a??"","utf-8"),r="bulk-variables.jsonl",l=i.length,d=await ee(n,r,l),k=ne(d);return await ie(i,k.url,k.parameters,r),k.stagedUploadKey}async function ee(e,n,a){return u({query:L,session:e,variables:{input:[{filename:n,fileSize:a.toString(),httpMethod:"POST",mimeType:"text/jsonl",resource:"BULK_MUTATION_VARIABLES"}]}})}function ne(e){if(!e.stagedUploadsCreate)throw new s("No response received from stagedUploadsCreate mutation");if(e.stagedUploadsCreate.userErrors.length>0){let i=e.stagedUploadsCreate.userErrors.map(r=>r.message).join(", ");throw new s(`Failed to create staged upload: ${i}`)}let n=e.stagedUploadsCreate.stagedTargets?.[0];if(!n)throw new s("No staged upload target returned from Shopify");if(!n.url||!n.resourceUrl)throw new s("Invalid staged upload target: missing required URLs");let a=n.parameters.find(i=>i.name==="key")?.value;if(!a)throw new s("No key parameter found in staged upload target");return{url:n.url,resourceUrl:n.resourceUrl,parameters:n.parameters,stagedUploadKey:a}}async function ie(e,n,a,i){let r=new FormData;for(let d of a)r.append(d.name,d.value);r.append("file",new Blob([new Uint8Array(e)],{type:"text/jsonl"}),i);let l=await N({title:o`Uploading bulk operation variables`,task:async()=>y(n,{method:"POST",body:r},"slow-request"),renderOptions:{stdout:process.stderr}});if(!l.ok){let d=await l.text();throw new s(`Failed to upload file to staged URL: ${l.statusText}
2
2
  ${d}`)}}t();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BulkOperationRunMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"mutation"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"stagedUploadPath"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"clientIdentifier"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperationRunMutation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"mutation"},value:{kind:"Variable",name:{kind:"Name",value:"mutation"}}},{kind:"Argument",name:{kind:"Name",value:"stagedUploadPath"},value:{kind:"Variable",name:{kind:"Name",value:"stagedUploadPath"}}},{kind:"Argument",name:{kind:"Name",value:"clientIdentifier"},value:{kind:"Variable",name:{kind:"Name",value:"clientIdentifier"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{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"}}]}}]}}]};async function ae(e){let{adminSession:n,query:a,variablesJsonl:i,version:r}=e,l=await h({adminSession:n,variablesJsonl:i});return(await u({query:U,session:n,variables:{mutation:a,stagedUploadPath:l},...r&&{version:r}})).bulkOperationRunMutation}t();t();var S={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetBulkOperationById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};t();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListBulkOperations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sortKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BulkOperationsSortKeys"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"sortKey"},value:{kind:"Variable",name:{kind:"Name",value:"sortKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function te(e){let{adminSession:n,operationId:a,version:i}=e;return(await u({query:S,session:n,variables:{id:a},version:i??p})).bulkOperation}async function re(e){let{adminSession:n,version:a,sinceDays:i=7,first:r=100}=e,l=new Date(Date.now()-i*24*60*60*1e3).toISOString().split("T")[0];return(await u({query:q,session:n,variables:{query:`created_at:>=${l}`,first:r,sortKey:"CREATED_AT"},version:a??p})).bulkOperations.nodes}t();t();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BulkOperationCancel"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperationCancel"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"fileSize"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"rootObjectCount"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};async function oe(e){let{adminSession:n,operationId:a,version:i}=e;return(await u({query:P,session:n,variables:{id:a},version:i??p})).bulkOperationCancel}t();t();function O(e){switch(e.status){case"RUNNING":return o`Bulk operation in progress${e.objectCount>0?m.gray(` (${String(e.objectCount)} objects ${e.type==="MUTATION"?"written":"read"})`):""}`;case"CREATED":return o`Starting`;case"COMPLETED":return o`Bulk operation succeeded: ${m.gray(`${String(e.objectCount)} objects`)}`;case"FAILED":return o`Bulk operation failed. ${m.errorText(`Error: ${e.errorCode??"unknown"}`)}`;case"CANCELING":return o`Bulk operation canceling...`;case"CANCELED":return o`Bulk operation canceled.`;case"EXPIRED":return o`Bulk operation expired.`;default:return o`Bulk operation status: ${e.status}`}}function le(e,n){let a=e.map(i=>o`${i.field?.join(".")??"unknown"}: ${i.message}`.value).join(`
3
3
  `);A({headline:n,body:a})}function de(e){let n=O(e).value;switch(e.status){case"CANCELING":return{headline:"Bulk operation is being cancelled.",renderType:"success"};case"CANCELED":case"COMPLETED":case"FAILED":{let a=[o`ID: ${m.cyan(e.id)}`.value,o`Status: ${m.yellow(e.status)}`.value,o`Created at: ${m.gray(String(e.createdAt))}`.value,...e.completedAt?[o`Completed at: ${m.gray(String(e.completedAt))}`.value]:[]];return{headline:o`Bulk operation is already ${e.status.toLowerCase()}.`.value,body:o`This operation has already finished and can't be canceled.`.value,customSections:[{body:[{list:{items:a}}]}],renderType:"warning"}}case"CREATED":case"EXPIRED":case"RUNNING":return{headline:n,renderType:"info"}}}var se=["COMPLETED","FAILED","CANCELED","EXPIRED"],V=1,ue=5,M=10,$=3e3,Q=300;async function me(e,n){return N({title:o`Starting bulk operation`,task:async()=>{let a=Date.now(),i=j({adminSession:e,operationId:n,pollIntervalSeconds:Q/1e3,useAdaptivePolling:!1}),r;do{let{value:l,done:d}=await i.next();if(r=l,d)return r}while(Date.now()-a<$);return r},renderOptions:{stdout:process.stderr}})}async function ke(e,n,a,i){return N({title:o`Polling bulk operation`,task:async r=>{let l=j({adminSession:e,operationId:n,pollIntervalSeconds:ue,initialPollIntervalSeconds:V,initialPollCount:M,useAdaptivePolling:!0,abortSignal:a});for(;;){let{value:d,done:k}=await l.next();if(k)return d;r(O(d))}},onAbort:i,renderOptions:{stdout:process.stderr}})}async function*j({adminSession:e,operationId:n,pollIntervalSeconds:a,useAdaptivePolling:i=!1,initialPollIntervalSeconds:r=V,initialPollCount:l=M,abortSignal:d}){let k=0;for(;;){let c=await pe(e,n);if(!c.bulkOperation)throw new Error("bulk operation not found");let f=c.bulkOperation;if(se.includes(f.status)||d?.aborted)return f;yield f,k++;let v=a;if(i&&k<=l&&(v=r),d){let w,K=new Promise(G=>{let I=()=>G();d.addEventListener("abort",I,{once:!0}),w=()=>d.removeEventListener("abort",I)});await Promise.race([F(v),K]),w?.()}else await F(v)}}async function pe(e,n){return u({query:S,session:e,variables:{id:n},version:p})}t();async function ce(e){let n=await y(e);if(!n.ok)throw new s(`Failed to download bulk operation results: ${n.statusText}`);return n.text()}function ve(e){return e.trim().split(`
4
4
  `).filter(a=>a.trim().length>0).some(a=>{let i;try{i=JSON.parse(a)}catch(l){if(l instanceof SyntaxError)return!1;throw l}if(!i.data)return!1;let r=Object.values(i.data)[0];return r?.userErrors!==void 0&&r.userErrors.length>0})}t();async function fe(e){let n=await D({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),a=await x({appContextResult:n,storeFqdn:e.store,forceReselectStore:e.reset,storeTypes:["APP_DEVELOPMENT","DEVELOPMENT","DEVELOPMENT_SUPERSET","PRODUCTION"]});return{appContextResult:n,store:a}}async function Jn(e){let n=await E({query:e.query,queryFile:e["query-file"]}),{appContextResult:a,store:i}=await fe(e);return{query:n,appContextResult:a,store:i}}export{p as a,H as b,J as c,g as d,X as e,Y as f,E as g,Z as h,ae as i,te as j,re as k,oe as l,O as m,le as n,de as o,me as p,ke as q,ce as r,ve as s,fe as t,Jn as u};
@@ -1 +1 @@
1
- import{J as f,ka as v,l as d,la as A,o as w,w as m}from"./chunk-AINDVTMY.js";import{b as l}from"./chunk-Y6DYQWQK.js";import{h as p,k as F}from"./chunk-PSUNX2YX.js";import{qb as V,sb as h}from"./chunk-GYFRTLML.js";import{i as q}from"./chunk-DPNZWBT5.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e,o){let a="Admin",u=o??await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,u,r);return v({query:t,api:a,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:u,preferredBehaviour:n}=t,s=a??S.get(e.storeFqdn);s??=await b(e,n);let i=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=i,i=new m().host("app"));let D={url:x(i,s,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:u,unauthorizedHandler:y,preferredBehaviour:n})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:g,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${V.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
1
+ import{J as f,ka as v,l as d,la as A,o as w,w as m}from"./chunk-IAURXPUJ.js";import{b as l}from"./chunk-RM3XC2IX.js";import{h as p,k as F}from"./chunk-4EHFK2OI.js";import{qb as V,sb as h}from"./chunk-TNYPQ2UL.js";import{i as q}from"./chunk-DPNZWBT5.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e,o){let a="Admin",u=o??await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,u,r);return v({query:t,api:a,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:u,preferredBehaviour:n}=t,s=a??S.get(e.storeFqdn);s??=await b(e,n);let i=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=i,i=new m().host("app"));let D={url:x(i,s,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:u,unauthorizedHandler:y,preferredBehaviour:n})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:g,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${V.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
@@ -1 +1 @@
1
- import{a as m}from"./chunk-IMSPA67L.js";import{a as p}from"./chunk-3NVQXPTU.js";import{a as n}from"./chunk-36OXWMXZ.js";import{wa as r}from"./chunk-YAA7OGRM.js";import{b as s}from"./chunk-WJEVB67Y.js";import{wb as e}from"./chunk-GYFRTLML.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};
1
+ import{a as m}from"./chunk-XNMDPOYU.js";import{a as p}from"./chunk-NNCLTG6A.js";import{a as n}from"./chunk-RVEAQUUF.js";import{wa as r}from"./chunk-NKSLEPE2.js";import{b as s}from"./chunk-BR5CFKIN.js";import{wb as e}from"./chunk-TNYPQ2UL.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};