@shopify/cli 4.8.1 → 4.8.2

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 (299) hide show
  1. package/dist/analytics-3SII67XF.js +1 -0
  2. package/dist/{analytics-TQHJN5PY.js → analytics-5K4B2DE4.js} +1 -1
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-WLGEAJBU.js → chunk-26LLUNJJ.js} +1 -1
  5. package/dist/{chunk-PJTRZSH4.js → chunk-2AJKHY5T.js} +1 -1
  6. package/dist/{chunk-5CC4QYN4.js → chunk-2D46X762.js} +1 -1
  7. package/dist/{chunk-UBX3HUMH.js → chunk-2GDXU42J.js} +1 -1
  8. package/dist/{chunk-F2DO3R6R.js → chunk-2JORC3Q5.js} +1 -1
  9. package/dist/{chunk-AVX7CIDJ.js → chunk-2JXH2CQB.js} +1 -1
  10. package/dist/{chunk-3NYK63U4.js → chunk-2MMJVHYZ.js} +1 -1
  11. package/dist/{chunk-GVEJO3WM.js → chunk-2ZGU7VWR.js} +1 -1
  12. package/dist/{chunk-AICVQH4V.js → chunk-36ZTFNMR.js} +1 -1
  13. package/dist/{chunk-WIBPVYPN.js → chunk-3EO3UEPZ.js} +1 -1
  14. package/dist/{chunk-T24RA3WI.js → chunk-3NSZBIHE.js} +1 -1
  15. package/dist/{chunk-SAKMJGXL.js → chunk-3NVQTA2F.js} +1 -1
  16. package/dist/{chunk-SEGZQCXZ.js → chunk-3QF47EX2.js} +1 -1
  17. package/dist/{chunk-IPSY5EEL.js → chunk-44OAVCF6.js} +1 -1
  18. package/dist/{chunk-X4JCATEE.js → chunk-472T4YTY.js} +1 -1
  19. package/dist/{chunk-7DJNASBC.js → chunk-4Y7WHAJX.js} +1 -1
  20. package/dist/{chunk-HKSRCMQ7.js → chunk-4YMU5WAG.js} +1 -1
  21. package/dist/{chunk-TCP4OG3D.js → chunk-564CWTLZ.js} +1 -1
  22. package/dist/{chunk-LJO22Z6S.js → chunk-5AFM6CVE.js} +1 -1
  23. package/dist/{chunk-3FTP36HH.js → chunk-5EW33K5C.js} +1 -1
  24. package/dist/{chunk-T74ECTO7.js → chunk-5FHTBBDR.js} +1 -1
  25. package/dist/{chunk-ZYEGQSF5.js → chunk-5GBIXC2Y.js} +1 -1
  26. package/dist/{chunk-6U4BOZ73.js → chunk-5GK7UKIP.js} +1 -1
  27. package/dist/{chunk-32IIURQB.js → chunk-5LGEBELU.js} +1 -1
  28. package/dist/{chunk-6633X2JU.js → chunk-5NT2BNMB.js} +1 -1
  29. package/dist/{chunk-GTIBT4V6.js → chunk-65YY4727.js} +1 -1
  30. package/dist/{chunk-R4YJM7KY.js → chunk-6BNOQJHH.js} +1 -1
  31. package/dist/{chunk-YY2JHCIG.js → chunk-6F6LL5UM.js} +1 -1
  32. package/dist/{chunk-5PWJTOWK.js → chunk-6ZCPQOWW.js} +1 -1
  33. package/dist/{chunk-PSH4QKUX.js → chunk-73MCDHWW.js} +1 -1
  34. package/dist/{chunk-7JG3CKDE.js → chunk-76PGSVVM.js} +1 -1
  35. package/dist/{chunk-UBJYXNCN.js → chunk-7BYWIVUZ.js} +1 -1
  36. package/dist/{chunk-565SON6A.js → chunk-7CV75WGB.js} +1 -1
  37. package/dist/{chunk-YAA7OGRM.js → chunk-7LW23M5C.js} +1 -1
  38. package/dist/{chunk-L6OBJDYK.js → chunk-7MFISB2R.js} +1 -1
  39. package/dist/{chunk-O2X6EVXQ.js → chunk-7MZEOTFK.js} +1 -1
  40. package/dist/{chunk-GCTCRKET.js → chunk-7SHHNWHL.js} +1 -1
  41. package/dist/{chunk-4QXDDAMD.js → chunk-7VW2J53A.js} +2 -2
  42. package/dist/{chunk-562EV2EJ.js → chunk-A27WKAFQ.js} +1 -1
  43. package/dist/{chunk-J3PS4JF2.js → chunk-A6FO2ZZW.js} +2 -2
  44. package/dist/{chunk-YUNINHOR.js → chunk-AAEJL2TP.js} +1 -1
  45. package/dist/{chunk-QPT6DUMC.js → chunk-AD6BC3N6.js} +1 -1
  46. package/dist/{chunk-QMYCJ2TM.js → chunk-AEUVT7IU.js} +1 -1
  47. package/dist/{chunk-CKZOLGWI.js → chunk-AFA4NLPV.js} +1 -1
  48. package/dist/{chunk-22JJHQVU.js → chunk-AGKG5G6X.js} +1 -1
  49. package/dist/{chunk-AXMSJ46T.js → chunk-AHFOIPEK.js} +1 -1
  50. package/dist/{chunk-HZDEDEAS.js → chunk-ATFKBLMQ.js} +1 -1
  51. package/dist/{chunk-RRQYOGEA.js → chunk-ATMII5E5.js} +1 -1
  52. package/dist/{chunk-NV4SPMQS.js → chunk-AXZG7H2F.js} +1 -1
  53. package/dist/{chunk-Y6DYQWQK.js → chunk-BC42C35S.js} +1 -1
  54. package/dist/{chunk-ODFOSJU3.js → chunk-BCWKIFNX.js} +1 -1
  55. package/dist/chunk-BFL74TW2.js +1 -0
  56. package/dist/{chunk-WSJ5PUK6.js → chunk-BPI25I3Q.js} +1 -1
  57. package/dist/{chunk-KEUMU5TQ.js → chunk-BZC3KLVQ.js} +1 -1
  58. package/dist/{chunk-7USNGNVI.js → chunk-CAT3FQ6U.js} +1 -1
  59. package/dist/{chunk-4ARQFW35.js → chunk-CEDXFKIK.js} +1 -1
  60. package/dist/{chunk-UMZG254H.js → chunk-CGYVLQCZ.js} +1 -1
  61. package/dist/{chunk-HFRWZQOF.js → chunk-CLUMXUR5.js} +1 -1
  62. package/dist/{chunk-6T5AZZUI.js → chunk-D3DCP4OT.js} +1 -1
  63. package/dist/{chunk-VFQW2QL2.js → chunk-D7S4HEQE.js} +1 -1
  64. package/dist/{chunk-GYFRTLML.js → chunk-DD7FQDTB.js} +3 -3
  65. package/dist/{chunk-RNFZJQVV.js → chunk-DJGDJSXS.js} +1 -1
  66. package/dist/{chunk-TVQVZHNP.js → chunk-DLCJRY3W.js} +1 -1
  67. package/dist/chunk-DWI2BHXZ.js +1 -0
  68. package/dist/{chunk-YZKBG7UZ.js → chunk-DY64LYXB.js} +1 -1
  69. package/dist/{chunk-5THZTE44.js → chunk-EEKB5GN6.js} +1 -1
  70. package/dist/{chunk-UCJ3NHJH.js → chunk-EJCBL2W2.js} +1 -1
  71. package/dist/{chunk-LIH7CQO7.js → chunk-ESTXKKAB.js} +1 -1
  72. package/dist/{chunk-JDEOBIXA.js → chunk-EUSOP35K.js} +1 -1
  73. package/dist/{chunk-U42P3F7Y.js → chunk-EVIITVUM.js} +1 -1
  74. package/dist/{chunk-OBRMBYTG.js → chunk-EZ6VGZXC.js} +1 -1
  75. package/dist/{chunk-XSUX2XAW.js → chunk-F2X7F5QX.js} +1 -1
  76. package/dist/{chunk-XRVMKP53.js → chunk-F4HKZVXJ.js} +3 -3
  77. package/dist/{chunk-IMSPA67L.js → chunk-F6SKKCKZ.js} +1 -1
  78. package/dist/{chunk-XZUL2HVC.js → chunk-FGZNKGW5.js} +1 -1
  79. package/dist/chunk-GJ34J3XJ.js +7 -0
  80. package/dist/{chunk-WVQZOLZJ.js → chunk-GV2JI5PS.js} +1 -1
  81. package/dist/{chunk-WJEVB67Y.js → chunk-GZKEIUJT.js} +1 -1
  82. package/dist/{chunk-7DLMETRR.js → chunk-H72B4Y5L.js} +1 -1
  83. package/dist/{chunk-S5FGFQHD.js → chunk-HCTPSLRL.js} +1 -1
  84. package/dist/{chunk-2R6KOKWG.js → chunk-HGJIYWXY.js} +1 -1
  85. package/dist/{chunk-DS7OKDQN.js → chunk-HGRTQIGQ.js} +1 -1
  86. package/dist/{chunk-3A2HLI4D.js → chunk-HQHKCLIU.js} +1 -1
  87. package/dist/{chunk-RHJLAYNK.js → chunk-I2PSC3VF.js} +1 -1
  88. package/dist/chunk-ID3AR4VW.js +1 -0
  89. package/dist/{chunk-F5BTQI5W.js → chunk-IGRDJ4EC.js} +1 -1
  90. package/dist/{chunk-XNKAPGJD.js → chunk-JADBWMQS.js} +1 -1
  91. package/dist/{chunk-EDHR546O.js → chunk-JIZ3BECO.js} +1 -1
  92. package/dist/{chunk-H7IQZNKR.js → chunk-JP4O56VD.js} +1 -1
  93. package/dist/{chunk-7CPYFKFK.js → chunk-JVZ3VF4D.js} +1 -1
  94. package/dist/{chunk-B3I7OMRN.js → chunk-KANWS6HC.js} +1 -1
  95. package/dist/{chunk-KPJRLS53.js → chunk-KKUA7VMA.js} +1 -1
  96. package/dist/{chunk-33PLVLCE.js → chunk-KLXOMT3K.js} +1 -1
  97. package/dist/{chunk-OYFNB5RY.js → chunk-KQJBTX6K.js} +1 -1
  98. package/dist/{chunk-XNP7PMGC.js → chunk-KTILY5HE.js} +1 -1
  99. package/dist/{chunk-PCL4UWAE.js → chunk-LHLYEFO7.js} +1 -1
  100. package/dist/{chunk-BHDFVO2R.js → chunk-LQJMBNVQ.js} +1 -1
  101. package/dist/chunk-LX7W4GUD.js +1 -0
  102. package/dist/{chunk-3ACZB27E.js → chunk-LY7PSCG4.js} +1 -1
  103. package/dist/{chunk-2BHYBR2F.js → chunk-LZC2EJLI.js} +1 -1
  104. package/dist/{chunk-PROWADZL.js → chunk-M47E7LE5.js} +1 -1
  105. package/dist/{chunk-KAAC4VIW.js → chunk-M6KOCZVH.js} +1 -1
  106. package/dist/{chunk-E7I5YT53.js → chunk-M6Z6NXCE.js} +1 -1
  107. package/dist/{chunk-MNTJZ6JO.js → chunk-MJ3WNVMQ.js} +1 -1
  108. package/dist/{chunk-TBEG57SV.js → chunk-MWJVYQVC.js} +1 -1
  109. package/dist/{chunk-XH66VYZA.js → chunk-N4N35AQP.js} +1 -1
  110. package/dist/{chunk-TQNGFSCI.js → chunk-N4WEI6JA.js} +1 -1
  111. package/dist/{chunk-FZUPL5YO.js → chunk-N6A3ISBE.js} +1 -1
  112. package/dist/{chunk-PPC3RJDZ.js → chunk-N6SZTZNB.js} +1 -1
  113. package/dist/{chunk-36OXWMXZ.js → chunk-N7VI7OWJ.js} +1 -1
  114. package/dist/{chunk-JLR6X5NA.js → chunk-NAIXUSEF.js} +1 -1
  115. package/dist/{chunk-AXLLN6DZ.js → chunk-NEREVIKL.js} +1 -1
  116. package/dist/{chunk-WT2KJHUO.js → chunk-NL7WDQSR.js} +1 -1
  117. package/dist/{chunk-AINDVTMY.js → chunk-NYHGIWKZ.js} +4 -4
  118. package/dist/{chunk-VM6EBNGR.js → chunk-O2FGO4CJ.js} +1 -1
  119. package/dist/{chunk-SIVRBIKH.js → chunk-OCT65FRG.js} +1 -1
  120. package/dist/{chunk-UPTF2HK6.js → chunk-PEWR7SF6.js} +1 -1
  121. package/dist/chunk-PIYTMQRC.js +1 -0
  122. package/dist/{chunk-6HMTAB2V.js → chunk-PKGJTTCP.js} +1 -1
  123. package/dist/{chunk-OTVZU5AQ.js → chunk-PPWJM7KE.js} +1 -1
  124. package/dist/{chunk-RAOMLN5A.js → chunk-Q4BTAXLS.js} +1 -1
  125. package/dist/{chunk-3LBHSZSR.js → chunk-QB6J3J6O.js} +1 -1
  126. package/dist/{chunk-LH7KQZDD.js → chunk-QD2KPFUT.js} +1 -1
  127. package/dist/{chunk-LTRJWOI6.js → chunk-QJW6UIRU.js} +1 -1
  128. package/dist/{chunk-OJE7S6D4.js → chunk-QYV62H24.js} +1 -1
  129. package/dist/{chunk-BMDCOBUR.js → chunk-R5EBKVQR.js} +1 -1
  130. package/dist/{chunk-5U4UTFA4.js → chunk-R5ONMTHY.js} +1 -1
  131. package/dist/{chunk-ZLMXR2XV.js → chunk-R7XKECV5.js} +1 -1
  132. package/dist/{chunk-5AMPXLKT.js → chunk-RB7J7C3A.js} +1 -1
  133. package/dist/{chunk-PVZE65R7.js → chunk-RF54RVOL.js} +1 -1
  134. package/dist/{chunk-6USL7BKQ.js → chunk-RFYFI72S.js} +1 -1
  135. package/dist/{chunk-4QAM7ROJ.js → chunk-ROIASQF4.js} +1 -1
  136. package/dist/{chunk-LC2BDU4B.js → chunk-RR4KN46J.js} +1 -1
  137. package/dist/{chunk-HEIZ3RSD.js → chunk-S67RM4AH.js} +1 -1
  138. package/dist/{chunk-U7ELUEH2.js → chunk-SNAIF3ST.js} +1 -1
  139. package/dist/{chunk-VPRDI4TT.js → chunk-T4UZOUVM.js} +1 -1
  140. package/dist/{chunk-DQVNW6EQ.js → chunk-T6M5V6RH.js} +1 -1
  141. package/dist/{chunk-PSYQTFPK.js → chunk-T7RMEJNE.js} +1 -1
  142. package/dist/{chunk-PGBXHL2G.js → chunk-THEONODK.js} +1 -1
  143. package/dist/{chunk-YMS6RVE5.js → chunk-TQRKW6W3.js} +1 -1
  144. package/dist/{chunk-BKYTBTQ5.js → chunk-UXDW37V5.js} +1 -1
  145. package/dist/{chunk-CSAVYME2.js → chunk-UXFTZHBG.js} +1 -1
  146. package/dist/{chunk-U63A4OUA.js → chunk-VEVKY5LR.js} +1 -1
  147. package/dist/{chunk-VRO6QBVN.js → chunk-VNW2YMPM.js} +1 -1
  148. package/dist/{chunk-NQRSFMS7.js → chunk-W25XMFZJ.js} +1 -1
  149. package/dist/{chunk-ZJ6DWT36.js → chunk-WAVWKGSF.js} +1 -1
  150. package/dist/{chunk-QH7QOLZK.js → chunk-WJ6GLVIM.js} +1 -1
  151. package/dist/{chunk-JVXKDM2E.js → chunk-WKCXSP6V.js} +1 -1
  152. package/dist/{chunk-3GAN6KS6.js → chunk-WSPQWLOS.js} +1 -1
  153. package/dist/{chunk-FM6VJLE7.js → chunk-WU5HO6FZ.js} +1 -1
  154. package/dist/{chunk-EIBQRJTQ.js → chunk-X3PGH5S4.js} +1 -1
  155. package/dist/{chunk-GZEPWYMP.js → chunk-XLEGKHUM.js} +1 -1
  156. package/dist/{chunk-4ASQQTCD.js → chunk-XLSKATCP.js} +1 -1
  157. package/dist/{chunk-6JC2PM43.js → chunk-XMQJUFVE.js} +1 -1
  158. package/dist/{chunk-HEWKCSY7.js → chunk-XQIPACFV.js} +3 -3
  159. package/dist/{chunk-LQGF3RKX.js → chunk-XS6EKKTD.js} +1 -1
  160. package/dist/{chunk-ILHEVBNU.js → chunk-XTPBKTAX.js} +1 -1
  161. package/dist/{chunk-X3KYRBGE.js → chunk-XZSSBNGP.js} +1 -1
  162. package/dist/{chunk-D2R7HPCT.js → chunk-YAPH7GMC.js} +1 -1
  163. package/dist/{chunk-LEPENRGG.js → chunk-YP35VTKI.js} +1 -1
  164. package/dist/{chunk-3R7OHZ4C.js → chunk-YRRGHHTP.js} +1 -1
  165. package/dist/{chunk-5G2W7QKA.js → chunk-YXS4SFIN.js} +1 -1
  166. package/dist/{chunk-H6HILX7D.js → chunk-ZG3I4COP.js} +1 -1
  167. package/dist/{chunk-FH36PGZH.js → chunk-ZKWJX5GE.js} +12 -12
  168. package/dist/{chunk-UXL2A5UK.js → chunk-ZQ4KG6U2.js} +1 -1
  169. package/dist/{chunk-7DGVNVW3.js → chunk-ZQQDUU3T.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-OFRC7GO7.js} +1 -1
  254. package/dist/{deprecations-2SG4PB2W.js → deprecations-PSCEZAQH.js} +1 -1
  255. package/dist/dist-733YLWJN.js +1 -0
  256. package/dist/dist-KOFJQ4RY.js +1 -0
  257. package/dist/{environments-B4OWPMPR.js → environments-FFWXZPU5.js} +1 -1
  258. package/dist/{error-5YQYW3V2.js → error-UHLTMPVC.js} +1 -1
  259. package/dist/error-handler-PVVDX7WF.js +1 -0
  260. package/dist/{fs-FM6YDE2U.js → fs-N6AHVL6I.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-DDGO2AWZ.js} +1 -1
  271. package/dist/{local-W73VIWHZ.js → local-JZRBCKAH.js} +1 -1
  272. package/dist/{metadata-OGQEI47Y.js → metadata-KYBVCKB5.js} +1 -1
  273. package/dist/{node-package-manager-GSHLPD5X.js → node-package-manager-O3DQCYJC.js} +1 -1
  274. package/dist/notifications-system-O7JENRRD.js +1 -0
  275. package/dist/os-ZZ47F6CA.js +1 -0
  276. package/dist/{output-MG7RJ37P.js → output-VAVFLR73.js} +1 -1
  277. package/dist/{system-3HTWCGQH.js → system-3PB7N6PP.js} +1 -1
  278. package/dist/tsconfig.tsbuildinfo +1 -1
  279. package/dist/{ui-T22J7MQF.js → ui-YTGKLMHA.js} +1 -1
  280. package/dist/upgrade-XYGE5PDR.js +1 -0
  281. package/dist/{version-KWF3XRSN.js → version-5OTQ3U3D.js} +1 -1
  282. package/dist/version-P72VURM3.js +1 -0
  283. package/dist/{workerd-RB5ZS43X.js → workerd-GHAVFNOO.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-MA6QRENS.js +0 -1
  291. package/dist/chunk-PSUNX2YX.js +0 -1
  292. package/dist/chunk-V6UCVTJT.js +0 -7
  293. package/dist/dist-L4A3SGNF.js +0 -1
  294. package/dist/dist-XXCZFNRC.js +0 -1
  295. package/dist/error-handler-3PBXTHYY.js +0 -1
  296. package/dist/notifications-system-HQNQUKLF.js +0 -1
  297. package/dist/os-6HP4QG7V.js +0 -1
  298. package/dist/upgrade-FZ35KTBW.js +0 -1
  299. package/dist/version-LJOGYA5H.js +0 -1
@@ -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-5AFM6CVE.js";import{a as E}from"./chunk-ID3AR4VW.js";import{a as I}from"./chunk-N7VI7OWJ.js";import{B as C,wa as j}from"./chunk-7LW23M5C.js";import{e as O}from"./chunk-WKCXSP6V.js";import{a as z}from"./chunk-NEREVIKL.js";import{b as R}from"./chunk-GZKEIUJT.js";import{D as y,W as _,ia as h,la as g}from"./chunk-NYHGIWKZ.js";import{H as T,I as k,y as A}from"./chunk-ESTXKKAB.js";import{k as D}from"./chunk-BFL74TW2.js";import{a as H}from"./chunk-CTNBSUVU.js";import{qb as p,sb as m,xb as f}from"./chunk-DD7FQDTB.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 +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-7SHHNWHL.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-4Y7WHAJX.js";import{J as n}from"./chunk-ESTXKKAB.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,3 +1,3 @@
1
- import{a as L,b as g,d as P,g as w}from"./chunk-33PLVLCE.js";import{a as A}from"./chunk-PGBXHL2G.js";import{t as F}from"./chunk-RNFZJQVV.js";import{a as G}from"./chunk-3NVQXPTU.js";import{a as S}from"./chunk-36OXWMXZ.js";import{b as v,e as b}from"./chunk-WJEVB67Y.js";import{D as d,y as l}from"./chunk-AINDVTMY.js";import{N as u,a as c}from"./chunk-LIH7CQO7.js";import{a as q}from"./chunk-CTNBSUVU.js";import{Bb as y,qb as f,sb as h,xb as i}from"./chunk-GYFRTLML.js";import{e as Q,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();import{randomBytes as x}from"crypto";function K(){return x(32).toString("hex")}function C(r){let e=new URL(`http://localhost:${r.port}/graphiql`);return e.searchParams.set("key",r.key),r.query&&e.searchParams.set("query",r.query),r.variables&&e.searchParams.set("variables",r.variables),r.apiVersion&&e.searchParams.set("api_version",r.apiVersion),e.toString()}async function k(r){let e=await A(r.port),t=g({stdout:r.stdout??process.stdout,port:e,storeFqdn:r.storeFqdn,tokenProvider:r.tokenProvider,key:r.key,appContext:r.appContext,protectMutations:r.protectMutations}),a=C({port:e,key:r.key,query:r.query,variables:r.variables,apiVersion:r.apiVersion});try{i(h`GraphiQL is running at ${f.link(a)}`),r.additionalReadyMessages?.forEach(s=>i(s)),i("Press Ctrl+C to stop."),await u(a)||y("Browser did not open automatically. Open the URL above manually."),await T(r.abortSignal)}finally{t.close()}}async function T(r){let e=new c,t=()=>e.abort();process.once("SIGINT",t);try{await new Promise(a=>{if(e.signal.aborted||r?.aborted){a();return}e.signal.addEventListener("abort",()=>a(),{once:!0}),r?.addEventListener("abort",()=>e.abort(),{once:!0})})}finally{process.removeListener("SIGINT",t)}}async function I(r){let e=r.remoteApp.apiSecretKeys[0]?.secret??"",t=L(void 0,e,r.store),a=w({apiKey:r.remoteApp.apiKey,apiSecret:e,storeFqdn:r.store}),m=await l(),s=P(r.store,r.remoteApp.apiKey,m);await k({port:r.port,storeFqdn:r.store,tokenProvider:a,key:t,appContext:{appName:r.remoteApp.title,appUrl:s,apiSecret:e},variables:r.variables,apiVersion:r.apiVersion,abortSignal:r.abortSignal})}var n=Q(q(),1),p=class r extends G{static summary="Open a local GraphiQL UI for your app and store.";static descriptionWithMarkdown=`Opens an authenticated Admin API GraphiQL UI for your app and selected store.
1
+ import{a as L,b as g,d as P,g as w}from"./chunk-KLXOMT3K.js";import{a as A}from"./chunk-THEONODK.js";import{t as F}from"./chunk-DJGDJSXS.js";import{a as G}from"./chunk-ID3AR4VW.js";import{a as S}from"./chunk-N7VI7OWJ.js";import{b as v,e as b}from"./chunk-GZKEIUJT.js";import{D as d,y as l}from"./chunk-NYHGIWKZ.js";import{N as u,a as c}from"./chunk-ESTXKKAB.js";import{a as q}from"./chunk-CTNBSUVU.js";import{Bb as y,qb as f,sb as h,xb as i}from"./chunk-DD7FQDTB.js";import{e as Q,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();import{randomBytes as x}from"crypto";function K(){return x(32).toString("hex")}function C(r){let e=new URL(`http://localhost:${r.port}/graphiql`);return e.searchParams.set("key",r.key),r.query&&e.searchParams.set("query",r.query),r.variables&&e.searchParams.set("variables",r.variables),r.apiVersion&&e.searchParams.set("api_version",r.apiVersion),e.toString()}async function k(r){let e=await A(r.port),t=g({stdout:r.stdout??process.stdout,port:e,storeFqdn:r.storeFqdn,tokenProvider:r.tokenProvider,key:r.key,appContext:r.appContext,protectMutations:r.protectMutations}),a=C({port:e,key:r.key,query:r.query,variables:r.variables,apiVersion:r.apiVersion});try{i(h`GraphiQL is running at ${f.link(a)}`),r.additionalReadyMessages?.forEach(s=>i(s)),i("Press Ctrl+C to stop."),await u(a)||y("Browser did not open automatically. Open the URL above manually."),await T(r.abortSignal)}finally{t.close()}}async function T(r){let e=new c,t=()=>e.abort();process.once("SIGINT",t);try{await new Promise(a=>{if(e.signal.aborted||r?.aborted){a();return}e.signal.addEventListener("abort",()=>a(),{once:!0}),r?.addEventListener("abort",()=>e.abort(),{once:!0})})}finally{process.removeListener("SIGINT",t)}}async function I(r){let e=r.remoteApp.apiSecretKeys[0]?.secret??"",t=L(void 0,e,r.store),a=w({apiKey:r.remoteApp.apiKey,apiSecret:e,storeFqdn:r.store}),m=await l(),s=P(r.store,r.remoteApp.apiKey,m);await k({port:r.port,storeFqdn:r.store,tokenProvider:a,key:t,appContext:{appName:r.remoteApp.title,appUrl:s,apiSecret:e},variables:r.variables,apiVersion:r.apiVersion,abortSignal:r.abortSignal})}var n=Q(q(),1),p=class r extends G{static summary="Open a local GraphiQL UI for your app and store.";static descriptionWithMarkdown=`Opens an authenticated Admin API GraphiQL UI for your app and selected store.
2
2
 
3
3
  The app must be installed on the store.`;static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];static flags={...v,...S,store:n.Flags.string({char:"s",description:"The myshopify.com domain of the store to open GraphiQL against. The app must be installed on the store. If not specified, you will be prompted to select a store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>d(e)}),port:b({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),variables:n.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:n.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};async run(){let{flags:e}=await this.parse(r),{appContextResult:t,store:a}=await F(e);return await I({remoteApp:t.remoteApp,store:a.shopDomain,port:e.port,variables:e.variables,apiVersion:e.version}),{app:t.app}}};export{K as a,k as b,p as c};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-XQIPACFV.js";import{va as r}from"./chunk-NYHGIWKZ.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static hidden=!0;async run(){await r()}};export{t as a};
@@ -1,2 +1,2 @@
1
- import{W as X,ca as z,da as j,ea as v,fa as J,ga as A,ha as W,ia as k,ja as q,ka as N,la as B,ma as L,na as K,oa as R,pa as Q}from"./chunk-YAA7OGRM.js";import{c as H}from"./chunk-AXLLN6DZ.js";import{b as T,e as G,m as l}from"./chunk-WT2KJHUO.js";import{D as x,z as U}from"./chunk-LIH7CQO7.js";import{h as C,j as P}from"./chunk-PSUNX2YX.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-GYFRTLML.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
1
+ import{W as X,ca as z,da as j,ea as v,fa as J,ga as A,ha as W,ia as k,ja as q,ka as N,la as B,ma as L,na as K,oa as R,pa as Q}from"./chunk-7LW23M5C.js";import{c as H}from"./chunk-NEREVIKL.js";import{b as T,e as G,m as l}from"./chunk-NL7WDQSR.js";import{D as x,z as U}from"./chunk-ESTXKKAB.js";import{h as C,j as P}from"./chunk-BFL74TW2.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-DD7FQDTB.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
2
2
  `)})}s();async function Lt({developerPlatformClient:e,apiKey:t,organizationId:i,extensionTypes:o,onlyDashboardManaged:n=!1}){let r=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:i}),{dashboardManagedExtensionRegistrations:p,extensionRegistrations:a}=r.app;return(n?p:a.concat(p)).filter(u=>{let h=o.includes(u.type.toLowerCase()),f=u.activeVersion&&u.activeVersion.config,m=u.draftVersion&&u.draftVersion.config;return h&&(f??m)})}export{se as a,ft as b,vt as c,Ce as d,we as e,At as f,Lt as g};
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-J3JPJCWP.js";import{a as fe}from"./chunk-XRVMKP53.js";import{b as re,c as oe,d as se,e as ne,f as ie,h as ae,i as le,k as ce,l as me,n as de}from"./chunk-FH36PGZH.js";import{a as X}from"./chunk-SIVRBIKH.js";import{c as Q,e as b,m as Z,n as x}from"./chunk-GCTCRKET.js";import{c as ee,e as te}from"./chunk-UXL2A5UK.js";import{k as P,l as V,n as w}from"./chunk-ZYEGQSF5.js";import{s as C,u as k}from"./chunk-7DJNASBC.js";import{a as Y,b as B}from"./chunk-PGBXHL2G.js";import{o as J,s as K,t as j,u as z,w as N}from"./chunk-Q7BOSHWX.js";import{Aa as L,b as F,wa as $}from"./chunk-AINDVTMY.js";import{A as T,C as q,D as G,N as U,w as W,y as I,z as M}from"./chunk-LIH7CQO7.js";import{d as _,e as H}from"./chunk-VRO6QBVN.js";import{h as y}from"./chunk-PSUNX2YX.js";import{Ab as u,qb as g,sb as R,xb as E}from"./chunk-GYFRTLML.js";import{i as p}from"./chunk-B4OMIONW.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();var he={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return he;u("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=Ee(o,r),a=i.length===0&&n.length===0&&l.length===0;if(L(`theme-service:theme-reconciliation:manual:${a}`),a)return u("Local and remote checksums match - no need to reconcile theme assets"),he;let m=await De({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Ae(e,t,r,m)}}function Ee(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:S(r,t),filesOnlyPresentLocally:S(i,t),filesWithConflictingChecksums:S(s,t)}}function S(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function A(e,t,o,r){if(e.length===0)return;if(r){Ce(e,o,r);return}I({body:{list:{title:t,items:e.map(i=>i.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:pe}]})===D?o.remote.callback(e):o.local.callback(e)}function Ce(e,t,o){switch(o){case"keep-remote":t.remote.callback(e);break;case"keep-local":t.local.callback(e);break;case"abort":break}}function Se(e){let t=[{title:"The files listed below are only present locally.",files:e.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:e.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:e.filesWithConflictingChecksums}];throw new y("Theme JSON files need reconciliation.",t.filter(o=>o.files.length>0).map(o=>`${o.title}
1
+ import{a as v}from"./chunk-J3JPJCWP.js";import{a as fe}from"./chunk-F4HKZVXJ.js";import{b as re,c as oe,d as se,e as ne,f as ie,h as ae,i as le,k as ce,l as me,n as de}from"./chunk-ZKWJX5GE.js";import{a as X}from"./chunk-OCT65FRG.js";import{c as Q,e as b,m as Z,n as x}from"./chunk-7SHHNWHL.js";import{c as ee,e as te}from"./chunk-ZQ4KG6U2.js";import{k as P,l as V,n as w}from"./chunk-5GBIXC2Y.js";import{s as C,u as k}from"./chunk-4Y7WHAJX.js";import{a as Y,b as B}from"./chunk-THEONODK.js";import{o as J,s as K,t as j,u as z,w as N}from"./chunk-Q7BOSHWX.js";import{Aa as L,b as F,wa as $}from"./chunk-NYHGIWKZ.js";import{A as T,C as q,D as G,N as U,w as W,y as I,z as M}from"./chunk-ESTXKKAB.js";import{d as _,e as H}from"./chunk-VNW2YMPM.js";import{h as y}from"./chunk-BFL74TW2.js";import{Ab as u,qb as g,sb as R,xb as E}from"./chunk-DD7FQDTB.js";import{i as p}from"./chunk-B4OMIONW.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();var he={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return he;u("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=Ee(o,r),a=i.length===0&&n.length===0&&l.length===0;if(L(`theme-service:theme-reconciliation:manual:${a}`),a)return u("Local and remote checksums match - no need to reconcile theme assets"),he;let m=await De({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Ae(e,t,r,m)}}function Ee(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:S(r,t),filesOnlyPresentLocally:S(i,t),filesWithConflictingChecksums:S(s,t)}}function S(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function A(e,t,o,r){if(e.length===0)return;if(r){Ce(e,o,r);return}I({body:{list:{title:t,items:e.map(i=>i.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:pe}]})===D?o.remote.callback(e):o.local.callback(e)}function Ce(e,t,o){switch(o){case"keep-remote":t.remote.callback(e);break;case"keep-local":t.local.callback(e);break;case"abort":break}}function Se(e){let t=[{title:"The files listed below are only present locally.",files:e.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:e.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:e.filesWithConflictingChecksums}];throw new y("Theme JSON files need reconciliation.",t.filter(o=>o.files.length>0).map(o=>`${o.title}
2
2
  ${o.files.map(r=>`- ${r.key}`).join(`
3
3
  `)}`).join(`
4
4
 
@@ -1,2 +1,2 @@
1
- import{Ab as d}from"./chunk-GYFRTLML.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
1
+ import{Ab as d}from"./chunk-DD7FQDTB.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
2
2
  `).forEach(function(a){let l=a.match(/^(\d+)\s(.*)$/);if(l){let u=l[1],E=l[2];s[n].push(u),s[u]=[],d(`Killing process ${u}: ${E}`),e.add(u),h(u,s,e,i,o)}})};t.on("close",c)}export{b as a};
@@ -1,4 +1,4 @@
1
- import{b as S}from"./chunk-6JC2PM43.js";import{a as A,b as B,c as L,f as I,j as x,k as $,m as N,t as q}from"./chunk-RNFZJQVV.js";import{a as P}from"./chunk-3NVQXPTU.js";import{a as z}from"./chunk-36OXWMXZ.js";import{b as C}from"./chunk-WJEVB67Y.js";import{D as E,W as g}from"./chunk-AINDVTMY.js";import{B as w,G as T,y as u,z as v}from"./chunk-LIH7CQO7.js";import{k as D}from"./chunk-PSUNX2YX.js";import{a as K}from"./chunk-CTNBSUVU.js";import{Cb as b,ba as k,ga as y,qb as l,sb as d}from"./chunk-GYFRTLML.js";import{i as m}from"./chunk-B4OMIONW.js";import{e as _,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function M(e){let{organization:o,storeFqdn:t,operationId:r,remoteApp:a}=e;u({headline:"Checking bulk operation status.",body:[{list:{items:S({organization:o,remoteApp:a,storeFqdn:t})}}]});let s=a.apiSecretKeys[0]?.secret;if(!s)throw new D("No API secret keys found for app");let p=await g(t,a.apiKey,s),i=await x({adminSession:p,operationId:r,version:await I({adminSession:p,minimumDefaultVersion:A})});i?U(i):w({headline:"Bulk operation not found.",body:d`ID: ${l.yellow(r)}`.value})}async function R(e){let{organization:o,storeFqdn:t,remoteApp:r}=e;u({headline:"Listing bulk operations.",body:[{list:{items:S({organization:o,remoteApp:r,storeFqdn:t})}}]});let a=r.apiSecretKeys[0]?.secret;if(!a)throw new D("No API secret keys found for app");let s=await g(t,r.apiKey,a),i=(await $({adminSession:s,version:await I({adminSession:s,minimumDefaultVersion:A})})).map(n=>({id:L(n.id),status:G(n.status),count:H(n.objectCount),dateCreated:k(new Date(String(n.createdAt))),dateFinished:n.completedAt?k(new Date(String(n.completedAt))):"",results:W(n.url??n.partialDataUrl)}));b(),i.length===0?u({body:"No bulk operations found in the last 7 days."}):T({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),b()}function U(e){let{id:o,status:t,createdAt:r,completedAt:a,url:s,partialDataUrl:p}=e,i=N(e).value,n=V(r,a),f=d`ID: ${l.yellow(o)}\n${n}`.value;if(t==="COMPLETED"){let h=s?l.link("Download results",s):"";v({headline:i,body:d`${f}\n${h}`.value})}else if(t==="FAILED"){let h=p?l.link("Download partial results",p):"";w({headline:i,body:d`${f}\n${h}`.value})}else u({headline:i,body:f})}function V(e,o){let t=new Date;return o?`Finished ${y(new Date(String(o)),t)}`:`Started ${y(new Date(String(e)),t)}`}function G(e){return e==="COMPLETED"?m.green(e):e==="FAILED"?m.red(e):m.dim(e)}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function W(e){return e?d`${l.link("download",e)}`.value:""}var F=_(K(),1);var O=class e extends P{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
1
+ import{b as S}from"./chunk-XMQJUFVE.js";import{a as A,b as B,c as L,f as I,j as x,k as $,m as N,t as q}from"./chunk-DJGDJSXS.js";import{a as P}from"./chunk-ID3AR4VW.js";import{a as z}from"./chunk-N7VI7OWJ.js";import{b as C}from"./chunk-GZKEIUJT.js";import{D as E,W as g}from"./chunk-NYHGIWKZ.js";import{B as w,G as T,y as u,z as v}from"./chunk-ESTXKKAB.js";import{k as D}from"./chunk-BFL74TW2.js";import{a as K}from"./chunk-CTNBSUVU.js";import{Cb as b,ba as k,ga as y,qb as l,sb as d}from"./chunk-DD7FQDTB.js";import{i as m}from"./chunk-B4OMIONW.js";import{e as _,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function M(e){let{organization:o,storeFqdn:t,operationId:r,remoteApp:a}=e;u({headline:"Checking bulk operation status.",body:[{list:{items:S({organization:o,remoteApp:a,storeFqdn:t})}}]});let s=a.apiSecretKeys[0]?.secret;if(!s)throw new D("No API secret keys found for app");let p=await g(t,a.apiKey,s),i=await x({adminSession:p,operationId:r,version:await I({adminSession:p,minimumDefaultVersion:A})});i?U(i):w({headline:"Bulk operation not found.",body:d`ID: ${l.yellow(r)}`.value})}async function R(e){let{organization:o,storeFqdn:t,remoteApp:r}=e;u({headline:"Listing bulk operations.",body:[{list:{items:S({organization:o,remoteApp:r,storeFqdn:t})}}]});let a=r.apiSecretKeys[0]?.secret;if(!a)throw new D("No API secret keys found for app");let s=await g(t,r.apiKey,a),i=(await $({adminSession:s,version:await I({adminSession:s,minimumDefaultVersion:A})})).map(n=>({id:L(n.id),status:G(n.status),count:H(n.objectCount),dateCreated:k(new Date(String(n.createdAt))),dateFinished:n.completedAt?k(new Date(String(n.completedAt))):"",results:W(n.url??n.partialDataUrl)}));b(),i.length===0?u({body:"No bulk operations found in the last 7 days."}):T({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),b()}function U(e){let{id:o,status:t,createdAt:r,completedAt:a,url:s,partialDataUrl:p}=e,i=N(e).value,n=V(r,a),f=d`ID: ${l.yellow(o)}\n${n}`.value;if(t==="COMPLETED"){let h=s?l.link("Download results",s):"";v({headline:i,body:d`${f}\n${h}`.value})}else if(t==="FAILED"){let h=p?l.link("Download partial results",p):"";w({headline:i,body:d`${f}\n${h}`.value})}else u({headline:i,body:f})}function V(e,o){let t=new Date;return o?`Finished ${y(new Date(String(o)),t)}`:`Started ${y(new Date(String(e)),t)}`}function G(e){return e==="COMPLETED"?m.green(e):e==="FAILED"?m.red(e):m.dim(e)}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function W(e){return e?d`${l.link("download",e)}`.value:""}var F=_(K(),1);var O=class e extends P{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
2
2
 
3
3
  Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
4
4
 
@@ -1,2 +1,2 @@
1
- import{Ab as n,Ta as o,qb as e,sb as r,ua as d,wa as f}from"./chunk-GYFRTLML.js";import{d as i}from"./chunk-773TIA5M.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var g=".shopify";async function c(h){let t=i(h,g),a=i(t,".gitignore");return await o(t)||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await f(t)),await o(a)||(n(r`Creating .gitignore in ${e.path(t)}...`),await d(a,`# Ignore the entire ${g} directory
1
+ import{Ab as n,Ta as o,qb as e,sb as r,ua as d,wa as f}from"./chunk-DD7FQDTB.js";import{d as i}from"./chunk-773TIA5M.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var g=".shopify";async function c(h){let t=i(h,g),a=i(t,".gitignore");return await o(t)||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await f(t)),await o(a)||(n(r`Creating .gitignore in ${e.path(t)}...`),await d(a,`# Ignore the entire ${g} directory
2
2
  *`)),t}export{c as a};
@@ -1,4 +1,4 @@
1
- import{b as $}from"./chunk-IMSPA67L.js";import{a as O}from"./chunk-3NVQXPTU.js";import{a as I}from"./chunk-36OXWMXZ.js";import{i as T,wa as k}from"./chunk-YAA7OGRM.js";import{b as f}from"./chunk-WT2KJHUO.js";import{b as N,c as P}from"./chunk-WJEVB67Y.js";import{M as S,N as b}from"./chunk-AINDVTMY.js";import{y as E}from"./chunk-LIH7CQO7.js";import{d as v}from"./chunk-QMYCJ2TM.js";import{a as m}from"./chunk-4IG7WG6V.js";import{a as W}from"./chunk-CTNBSUVU.js";import{Hb as _,L as g,N as y,rb as C,sb as w,wb as A}from"./chunk-GYFRTLML.js";import{g as p,j as h}from"./chunk-773TIA5M.js";import{e as U,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function x(r,e,t,o,i){return i.webEnv?F(r,e,t,i):R(r,e,t,o,i)}async function F(r,e,t,{format:o}){return $(r,e,t,o)}async function R(r,e,t,o,i){if(i.format==="json"){let n=j(r.allExtensions.filter(a=>a.isReturnedAsInfo())),s={...r,packageManager:o.packageManager,nodeDependencies:o.nodeDependencies,usesWorkspaces:o.usesWorkspaces,organization:{id:t.id,businessName:t.businessName},allExtensions:n};return"realExtensions"in s&&(s.realExtensions=j(s.realExtensions)),"specifications"in s&&(s={...s,specifications:s.specifications?.map(a=>D(a))}),w`${JSON.stringify(Object.fromEntries(Object.entries(s).filter(([a])=>a!=="configSchema")),null,2)}`}else return new l(r,e,t,o,i).output()}function D(r){if("schema"in r){let{schema:e,...t}=r;return t}return r}function j(r){return r.map(e=>{if("specification"in e&&e.specification){let t=e.specification,o=D(t);return{...e,specification:o}}else return e})}var M="unknown",u={subdued:"Not yet configured"},z="NOT LOADED",l=class{app;remoteApp;organization;project;options;constructor(e,t,o,i,n){this.app=e,this.remoteApp=t,this.organization=o,this.project=i,this.options=n}async output(){return[...await this.devConfigsSection(),this.projectSettingsSection(),...await this.appComponentsSection(),await this.systemInfoSection()]}async devConfigsSection(){let e=u;this.app.configuration.build?.automatically_update_urls_on_dev!==void 0&&(e=this.app.configuration.build.automatically_update_urls_on_dev?"Yes":"No");let t=["User","unknown"],o=await this.options.developerPlatformClient.accountInfo();return b(o)?t=["Service account",o.orgName]:S(o)&&(t[1]=o.email),[this.tableSection("Current app configuration",[["Configuration file",{filePath:h(this.app.configPath)||f.app}],["App name",this.remoteApp.title?{userInput:this.remoteApp.title}:u],["Client ID",this.remoteApp.apiKey||u],["Organization",`${this.organization.businessName} (${this.organization.id})`],["Access scopes",T(this.app.configuration)],["Dev store",this.app.configuration.build?.dev_store_url??this.app.hiddenConfig.dev_store_url??u],["Update URLs",e],t],{isFirstItem:!0}),{body:["\u{1F4A1} To change these, run",{command:C(this.project.packageManager,"shopify app config link")}]}]}projectSettingsSection(){return this.tableSection("Your Project",[["Root location",{filePath:this.app.directory}]])}async appComponentsSection(){let e=this.webComponentsSection();return[{title:`
1
+ import{b as $}from"./chunk-F6SKKCKZ.js";import{a as O}from"./chunk-ID3AR4VW.js";import{a as I}from"./chunk-N7VI7OWJ.js";import{i as T,wa as k}from"./chunk-7LW23M5C.js";import{b as f}from"./chunk-NL7WDQSR.js";import{b as N,c as P}from"./chunk-GZKEIUJT.js";import{M as S,N as b}from"./chunk-NYHGIWKZ.js";import{y as E}from"./chunk-ESTXKKAB.js";import{d as v}from"./chunk-AEUVT7IU.js";import{a as m}from"./chunk-LX7W4GUD.js";import{a as W}from"./chunk-CTNBSUVU.js";import{Hb as _,L as g,N as y,rb as C,sb as w,wb as A}from"./chunk-DD7FQDTB.js";import{g as p,j as h}from"./chunk-773TIA5M.js";import{e as U,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function x(r,e,t,o,i){return i.webEnv?F(r,e,t,i):R(r,e,t,o,i)}async function F(r,e,t,{format:o}){return $(r,e,t,o)}async function R(r,e,t,o,i){if(i.format==="json"){let n=j(r.allExtensions.filter(a=>a.isReturnedAsInfo())),s={...r,packageManager:o.packageManager,nodeDependencies:o.nodeDependencies,usesWorkspaces:o.usesWorkspaces,organization:{id:t.id,businessName:t.businessName},allExtensions:n};return"realExtensions"in s&&(s.realExtensions=j(s.realExtensions)),"specifications"in s&&(s={...s,specifications:s.specifications?.map(a=>D(a))}),w`${JSON.stringify(Object.fromEntries(Object.entries(s).filter(([a])=>a!=="configSchema")),null,2)}`}else return new l(r,e,t,o,i).output()}function D(r){if("schema"in r){let{schema:e,...t}=r;return t}return r}function j(r){return r.map(e=>{if("specification"in e&&e.specification){let t=e.specification,o=D(t);return{...e,specification:o}}else return e})}var M="unknown",u={subdued:"Not yet configured"},z="NOT LOADED",l=class{app;remoteApp;organization;project;options;constructor(e,t,o,i,n){this.app=e,this.remoteApp=t,this.organization=o,this.project=i,this.options=n}async output(){return[...await this.devConfigsSection(),this.projectSettingsSection(),...await this.appComponentsSection(),await this.systemInfoSection()]}async devConfigsSection(){let e=u;this.app.configuration.build?.automatically_update_urls_on_dev!==void 0&&(e=this.app.configuration.build.automatically_update_urls_on_dev?"Yes":"No");let t=["User","unknown"],o=await this.options.developerPlatformClient.accountInfo();return b(o)?t=["Service account",o.orgName]:S(o)&&(t[1]=o.email),[this.tableSection("Current app configuration",[["Configuration file",{filePath:h(this.app.configPath)||f.app}],["App name",this.remoteApp.title?{userInput:this.remoteApp.title}:u],["Client ID",this.remoteApp.apiKey||u],["Organization",`${this.organization.businessName} (${this.organization.id})`],["Access scopes",T(this.app.configuration)],["Dev store",this.app.configuration.build?.dev_store_url??this.app.hiddenConfig.dev_store_url??u],["Update URLs",e],t],{isFirstItem:!0}),{body:["\u{1F4A1} To change these, run",{command:C(this.project.packageManager,"shopify app config link")}]}]}projectSettingsSection(){return this.tableSection("Your Project",[["Root location",{filePath:this.app.directory}]])}async appComponentsSection(){let e=this.webComponentsSection();return[{title:`
2
2
  Directory components`.toUpperCase(),body:""},...e?[e]:[],...this.extensionsSections()]}webComponentsSection(){let e=[],t=[];if(this.app.webs[0])return this.app.webs.forEach(o=>{if(o.configuration)if(o.configuration.name){let{name:i,roles:n}=o.configuration,s=p(this.app.directory,o.directory);t.push([` \u{1F4C2} ${i}`,{filePath:s||"/"}]),n.length>0&&t.push([" roles",n.join(", ")])}else o.configuration.roles.forEach(i=>{t.push([` \u{1F4C2} ${i}`,{filePath:p(this.app.directory,o.directory)}])});else t.push([{subdued:` \u{1F4C2} ${M}`},{filePath:p(this.app.directory,o.directory)}]);if(!this.app.errors.isEmpty()){let i=this.app.errors.getErrors(`${o.directory}/${f.web}`);e.push(...i.map(n=>n.message))}}),this.subtableSection("web",[["\u{1F4C2} web",""],...t,...e.map(o=>[{error:"error"},{error:this.formattedError(o)}])])}extensionsSections(){let e=this.app.allExtensions.filter(i=>i.isReturnedAsInfo()),o=y(e.map(i=>i.type)).map(i=>{let n=e.filter(s=>s.type===i);if(n[0])return this.subtableSection(n[0].externalType,n.flatMap(s=>this.extensionSubSection(s)))});return g(o)}extensionSubSection(e){let t=e.configuration,o=[[`\u{1F4C2} ${e.handle||z}`,{filePath:p(this.app.directory,e.directory)}],[" config file",{filePath:p(e.directory,e.configurationPath)}]];t&&"metafields"in t&&Array.isArray(t.metafields)&&t.metafields.length>0&&o.push([" metafields",`${t.metafields.length}`]);let i=this.app.errors.getErrors(e.configurationPath);for(let n of i)o.push([{error:" error"},{error:this.formattedError(n.message)}]);return o}formattedError(e){let t=e.trim();if(_())return t;let[o,...i]=t.split(`
3
3
  `);return[`! ${o}`,...i.map(n=>` ${n}`)].join(`
4
4
  `)}async systemInfoSection(){let{platform:e,arch:t}=v();return this.tableSection("Tooling and System",[["Shopify CLI",m],["Package manager",this.project.packageManager],["OS",`${e}-${t}`],["Shell",process.env.SHELL??"unknown"],["Node version",process.version]])}tableSection(e,t,{isFirstItem:o=!1}={}){return{title:`${o?"":`
@@ -1 +1 @@
1
- import{b as e}from"./chunk-HEWKCSY7.js";import{a as i}from"./chunk-4IG7WG6V.js";import{wb as t}from"./chunk-GYFRTLML.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();async function s(){t(i)}var r=class extends e{static description="Shopify CLI version currently installed.";async run(){await s()}};export{r as a};
1
+ import{b as e}from"./chunk-XQIPACFV.js";import{a as i}from"./chunk-LX7W4GUD.js";import{wb as t}from"./chunk-DD7FQDTB.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();async function s(){t(i)}var r=class extends e{static description="Shopify CLI version currently installed.";async run(){await s()}};export{r as a};
@@ -1 +1 @@
1
- import{Y as B}from"./chunk-AINDVTMY.js";import{u as O}from"./chunk-LIH7CQO7.js";import{F as w,f as m}from"./chunk-GYFRTLML.js";import{c as g,e as s,g as o}from"./chunk-VKWPEFWQ.js";var f=g((Q,c)=>{o();function j(r,e,t,n){for(var a=-1,i=r==null?0:r.length;++a<i;){var u=r[a];e(n,u,t(u),r)}return n}c.exports=j});var A=g((S,h)=>{o();var l=O();function E(r,e,t,n){return l(r,function(a,i,u){e(n,a,t(a),u)}),n}h.exports=E});var p=g((U,q)=>{o();var G=f(),I=A(),V=w(),C=m();function D(r,e){return function(t,n){var a=C(t)?G:I,i=e?e():{};return a(t,r,V(n,2),i)}}q.exports=D});var x=g((X,v)=>{o();var F=B(),H=p(),J=Object.prototype,K=J.hasOwnProperty,L=H(function(r,e,t){K.call(r,t)?r[t].push(e):F(r,t,[e])});v.exports=L});var y=g((Z,b)=>{o();var M=p(),N=M(function(r,e,t){r[t?0:1].push(e)},function(){return[[],[]]});b.exports=N});o();var P=s(x()),d=s(y());function $(r,e){return(0,P.default)(r,e)}function k(r,e){return(0,d.default)(r,e)}export{$ as a,k as b};
1
+ import{Y as B}from"./chunk-NYHGIWKZ.js";import{u as O}from"./chunk-ESTXKKAB.js";import{F as w,f as m}from"./chunk-DD7FQDTB.js";import{c as g,e as s,g as o}from"./chunk-VKWPEFWQ.js";var f=g((Q,c)=>{o();function j(r,e,t,n){for(var a=-1,i=r==null?0:r.length;++a<i;){var u=r[a];e(n,u,t(u),r)}return n}c.exports=j});var A=g((S,h)=>{o();var l=O();function E(r,e,t,n){return l(r,function(a,i,u){e(n,a,t(a),u)}),n}h.exports=E});var p=g((U,q)=>{o();var G=f(),I=A(),V=w(),C=m();function D(r,e){return function(t,n){var a=C(t)?G:I,i=e?e():{};return a(t,r,V(n,2),i)}}q.exports=D});var x=g((X,v)=>{o();var F=B(),H=p(),J=Object.prototype,K=J.hasOwnProperty,L=H(function(r,e,t){K.call(r,t)?r[t].push(e):F(r,t,[e])});v.exports=L});var y=g((Z,b)=>{o();var M=p(),N=M(function(r,e,t){r[t?0:1].push(e)},function(){return[[],[]]});b.exports=N});o();var P=s(x()),d=s(y());function $(r,e){return(0,P.default)(r,e)}function k(r,e){return(0,d.default)(r,e)}export{$ as a,k as b};
@@ -1 +1 @@
1
- import{O as i}from"./chunk-LIH7CQO7.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
1
+ import{O as i}from"./chunk-ESTXKKAB.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
@@ -1 +1 @@
1
- import{b as e}from"./chunk-HEWKCSY7.js";import{a as r}from"./chunk-CTNBSUVU.js";import{e as c,g as t}from"./chunk-VKWPEFWQ.js";t();var s=c(r(),1);var a=class o extends e{static args={command:s.Args.string({description:"Command to show help for.",required:!1})};static description="Display help for Shopify CLI";static usage="help [command] [flags]";static flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})};static strict=!1;async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
1
+ import{b as e}from"./chunk-XQIPACFV.js";import{a as r}from"./chunk-CTNBSUVU.js";import{e as c,g as t}from"./chunk-VKWPEFWQ.js";t();var s=c(r(),1);var a=class o extends e{static args={command:s.Args.string({description:"Command to show help for.",required:!1})};static description="Display help for Shopify CLI";static usage="help [command] [flags]";static flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})};static strict=!1;async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
@@ -1,4 +1,4 @@
1
- import{a as D}from"./chunk-HZDEDEAS.js";import{a as _,c as b}from"./chunk-SEGZQCXZ.js";import{a as h,b as I}from"./chunk-UXL2A5UK.js";import{e as y,q as F}from"./chunk-ZYEGQSF5.js";import{i as w,p as g,v as T}from"./chunk-7DJNASBC.js";import{b as u,f as v}from"./chunk-WJEVB67Y.js";import{E as p,z as d}from"./chunk-LIH7CQO7.js";import{a as C}from"./chunk-CTNBSUVU.js";import{U as c}from"./chunk-GYFRTLML.js";import{e as E,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function O(t,e,r){let n=e.themes;e.development&&(n=[(await new D(t).find()).id.toString()]);let m=t.storeFqdn,i=await L(t,{...e,themes:n,development:!1});if(!e.force&&!r&&!await M(i,m))return;await Promise.all(i.map(o=>(y(o)&&w(),F(o.id,t))));let l=e.environment?[{subdued:`Environment: ${e.environment}
1
+ import{a as D}from"./chunk-ATFKBLMQ.js";import{a as _,c as b}from"./chunk-3QF47EX2.js";import{a as h,b as I}from"./chunk-ZQ4KG6U2.js";import{e as y,q as F}from"./chunk-5GBIXC2Y.js";import{i as w,p as g,v as T}from"./chunk-4Y7WHAJX.js";import{b as u,f as v}from"./chunk-GZKEIUJT.js";import{E as p,z as d}from"./chunk-ESTXKKAB.js";import{a as C}from"./chunk-CTNBSUVU.js";import{U as c}from"./chunk-DD7FQDTB.js";import{e as E,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function O(t,e,r){let n=e.themes;e.development&&(n=[(await new D(t).find()).id.toString()]);let m=t.storeFqdn,i=await L(t,{...e,themes:n,development:!1});if(!e.force&&!r&&!await M(i,m))return;await Promise.all(i.map(o=>(y(o)&&w(),F(o.id,t))));let l=e.environment?[{subdued:`Environment: ${e.environment}
2
2
 
3
3
  `}]:[];d({body:c(i,o=>[...l,`The following themes were deleted from ${m}:`,I(o)],o=>[...l,"The theme",...h(o),`was deleted from ${m}.`])})}async function L(t,e){if(e.selectTheme||e.themes.length>0)return b(t,e);let r=t.storeFqdn;return[await _(t,{header:`Select a theme to delete from ${r}`,filter:{development:e.development}})]}async function M(t,e){let n={message:c(t,m=>[`Delete the following themes from ${e}?`],m=>["Delete",...h(m),`from ${e}?`]),confirmationMessage:"Yes, confirm changes",cancellationMessage:"Cancel"};return t.length>1&&(n.infoTable={"":t.map(h)}),p(n)}var s=E(C(),1);var f=class extends T{static summary="Delete remote themes from the connected store. This command can't be undone.";static descriptionWithMarkdown=`Deletes a theme from your store.
4
4
 
@@ -1 +1 @@
1
- import{g as i,h as t}from"./chunk-PSUNX2YX.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();var o=e=>new a(e),s=e=>new u(e),a=class{value;constructor(r){this.value=r}isErr(){return!1}doOnOk(r){return r(this.value),o(this.value)}valueOrBug(){return this.value}valueOrAbort(){return this.value}map(r){return o(r(this.value))}mapError(r){return o(this.value)}},u=class{error;constructor(r){this.error=r}isErr(){return!0}doOnOk(r){return s(this.error)}valueOrBug(){throw this.error}valueOrAbort(){if(this.error instanceof i)throw this.error;if(this.error instanceof Error){let r=new t(this.error.message);throw r.stack=this.error.stack,r}else throw new t(`${this.error}`)}map(r){return s(this.error)}mapError(r){return s(r(this.error))}};export{o as a,s as b};
1
+ import{g as i,h as t}from"./chunk-BFL74TW2.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();var o=e=>new a(e),s=e=>new u(e),a=class{value;constructor(r){this.value=r}isErr(){return!1}doOnOk(r){return r(this.value),o(this.value)}valueOrBug(){return this.value}valueOrAbort(){return this.value}map(r){return o(r(this.value))}mapError(r){return o(this.value)}},u=class{error;constructor(r){this.error=r}isErr(){return!0}doOnOk(r){return s(this.error)}valueOrBug(){throw this.error}valueOrAbort(){if(this.error instanceof i)throw this.error;if(this.error instanceof Error){let r=new t(this.error.message);throw r.stack=this.error.stack,r}else throw new t(`${this.error}`)}map(r){return s(this.error)}mapError(r){return s(r(this.error))}};export{o as a,s as b};
@@ -1,4 +1,4 @@
1
- import{c as J}from"./chunk-YZKBG7UZ.js";import{b as F}from"./chunk-4QXDDAMD.js";import{a as ae}from"./chunk-BMDCOBUR.js";import{a as ne}from"./chunk-3NVQXPTU.js";import{a as z}from"./chunk-36OXWMXZ.js";import{B as Z,D as ee,d as K,e as Q,wa as te}from"./chunk-YAA7OGRM.js";import{b as T,d as X,e as B}from"./chunk-WT2KJHUO.js";import{a as k}from"./chunk-RHJLAYNK.js";import{b as H,f as O}from"./chunk-WJEVB67Y.js";import{e as E}from"./chunk-AINDVTMY.js";import{C as G,p as P,x as L,y as _}from"./chunk-JLR6X5NA.js";import{D as q,F as U,H as b,J as V,z as $}from"./chunk-LIH7CQO7.js";import{h as m}from"./chunk-PSUNX2YX.js";import{a as xe}from"./chunk-CTNBSUVU.js";import{Oa as j,Ta as h,Ua as R,Wa as D,X as f,_ as M,ka as w,qa as N,rb as W,wa as g,ya as v}from"./chunk-GYFRTLML.js";import{e as Y}from"./chunk-VFQW2QL2.js";import{d as p,n as C}from"./chunk-773TIA5M.js";import{e as he,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function re(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}d();d();async function ie(e,t){let r=e?.path??"",n=p(t,r);if(!await h(n))throw new m(`
1
+ import{c as J}from"./chunk-DY64LYXB.js";import{b as F}from"./chunk-7VW2J53A.js";import{a as ae}from"./chunk-R5EBKVQR.js";import{a as ne}from"./chunk-ID3AR4VW.js";import{a as z}from"./chunk-N7VI7OWJ.js";import{B as Z,D as ee,d as K,e as Q,wa as te}from"./chunk-7LW23M5C.js";import{b as T,d as X,e as B}from"./chunk-NL7WDQSR.js";import{a as k}from"./chunk-I2PSC3VF.js";import{b as H,f as O}from"./chunk-GZKEIUJT.js";import{e as E}from"./chunk-NYHGIWKZ.js";import{C as G,p as P,x as L,y as _}from"./chunk-NAIXUSEF.js";import{D as q,F as U,H as b,J as V,z as $}from"./chunk-ESTXKKAB.js";import{h as m}from"./chunk-BFL74TW2.js";import{a as xe}from"./chunk-CTNBSUVU.js";import{Oa as j,Ta as h,Ua as R,Wa as D,X as f,_ as M,ka as w,qa as N,rb as W,wa as g,ya as v}from"./chunk-DD7FQDTB.js";import{e as Y}from"./chunk-D7S4HEQE.js";import{d as p,n as C}from"./chunk-773TIA5M.js";import{e as he,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function re(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}d();d();async function ie(e,t){let r=e?.path??"",n=p(t,r);if(!await h(n))throw new m(`
2
2
  The extension is not available for ${e?.value}`);return n}async function oe({name:e,app:t}){let r=M(e),n=p(t.directory,B.extensions.directoryName,r);if(await h(n))throw new m(`
3
3
  A directory with this name (${r}) already exists.
4
4
  Choose a new name for your extension.`);return await g(n),await N(p(n,T.lockFile)),n}function A(e){switch(e){case"vanilla-js":case"preact":case"react":case"typescript":case"typescript-react":return"javascript";case"rust":case"wasm":return e;case void 0:case"liquid":case"config-only":return}}async function se(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,n=e.extensionTemplate.supportedFlavors.find(o=>o.value===r),a=await oe({app:e.app,name:t}),i=e.cloneUrl??e.extensionTemplate.url,s={directory:a,url:i,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:n,onGetTemplateRepository:e.onGetTemplateRepository??(async(o,c)=>{await J({repoUrl:o,destination:c,shallow:!0})})};return await we(s),{directory:C(a),extensionTemplate:e.extensionTemplate}}async function we(e){try{switch(e.type){case"theme":await ge(e);break;case"function":await ve(e);break;default:await Ee(e);break}let t=p(e.directory,T.lockFile);await v(t)}catch(t){throw await v(e.directory),t}}async function ge({directory:e,url:t,type:r,name:n,extensionFlavor:a,onGetTemplateRepository:i}){return w(async s=>{let o=await I(t,a,s,i);await F(o,e,{name:n,type:r,uid:E(f(n))})})}async function ve({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=A(i?.value),c=[];c.push({title:"Generating function extension",task:async()=>{if(await w(async l=>{let u=await I(t,i,l,s);await F(u,e,{name:a,handle:f(a),flavor:i?.value,uid:E(f(a))})}),o==="javascript"){let l=ce(i?.value??"rust");await le(e,l,"!(*.graphql)")}}}),o==="javascript"&&c.push({title:"Installing additional dependencies",task:async()=>{n.usesWorkspaces&&await P({packageManager:n.packageManager,directory:n.directory});let l=Fe(o);await _(l,{packageManager:n.packageManager,type:"prod",directory:n.usesWorkspaces?e:n.directory})}}),o==="javascript"&&c.push({title:"Building GraphQL types",task:async()=>{await Q({directory:e,isJavaScript:!0},{stdout:process.stdout,stderr:process.stderr,app:r})}}),await b(c)}async function Ee({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=A(i?.value),c=[{title:"Generating extension",task:async()=>{let l=ce(i?.value??"vanilla-js");await w(async u=>{let y=await I(t,i,u,s);await F(y,e,{srcFileExtension:l,name:a,handle:f(a),flavor:i?.value??"",uid:E(f(a))})}),o==="javascript"&&await le(e,l)}},{title:"Installing dependencies",task:async()=>{let l=n.packageManager;if(n.usesWorkspaces)A(i?.value)==="javascript"&&await P({packageManager:l,directory:n.directory});else{await Te(n.directory,i?.value);let u=p(e,"package.json"),y=await ke(u);await _(y,{packageManager:l,type:"prod",directory:n.directory}),await v(u)}}}];c.push({title:"Update shared type definition",task:async()=>{await ee(r)}}),await b(c)}function ce(e){return{"vanilla-js":"js",preact:"jsx",react:"jsx",typescript:"ts","typescript-react":"tsx",rust:"rs",wasm:"wasm",liquid:"liquid","config-only":""}[e]??"js"}function Fe(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${K}.0.0`}),t}async function le(e,t,r="*"){let n=await D(p(e,"src",r)),a=[];for(let i of n)a.push(j(i,`${i}.${t}`));await Promise.all(a)}async function Te(e,t){t==="typescript-react"&&await G(e,{"@types/react":X.reactTypes})}async function ke(e){if(!await h(e))return[];let t=await L(e);return Object.entries(t?.dependencies??{}).map(([r,n])=>({name:r,version:n}))}async function I(e,t,r,n){let a=p(r,"download");return await g(a),await n(e,a),ie(t,a)}d();function Pe(e,t=[]){let r=[...e.map(a=>({label:a.name,value:a.identifier,group:a.group||"Other",sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(a=>({label:`${a.name} (limit reached)`,value:a.identifier,group:a.group||"Other",disabled:!0,sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER}))],n=(a,i)=>a.sortPriority===i.sortPriority?a.label.localeCompare(i.label):a.sortPriority-i.sortPriority;return r.sort(n)}var _e=async e=>{let t=e.extensionTemplates,r=e.templateType,n=e.extensionFlavor;if(!r){if(n&&(t=t.filter(c=>c.supportedFlavors.map(l=>l.value).includes(n))),t.length===0)throw new m("You have reached the limit for the number of extensions you can create.");r=await U({message:"Type of extension?",choices:Pe(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let a=t.find(c=>c.identifier===r),i=e.name||await pe(e.directory,a.defaultName),s=e.extensionFlavor??await be(a);return{extensionTemplate:a,extensionContent:{name:i,flavor:s}}};async function pe(e,t,r=1){let n=t.includes(" ")?" ":"-",a=r<=1?t:`${t}${n}${r}`,i=p(e,f(a));return R(i)?pe(e,t,r+1):V({message:"Name your extension:",defaultValue:a})}async function be(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:q({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var de=_e;async function Oe(e){let{app:t,developerPlatformClient:r,remoteApp:n,specifications:a,template:i}=e,s=a.map(ye=>ye.identifier),{templates:o,groupOrder:c}=await re(r,n,s,{requestedTemplate:i}),l=await Ae(o,c,a,t,e),u=await de(l);await Se(u,i);let y=Ce(u,t,e,r),fe=await se(y);Me(fe,e.project.packageManager)}async function Ae(e,t,r,n,a){let i=await Re(a.template,n,e,r);Ne(i,a.flavor);let{validTemplates:s,templatesOverlimit:o}=Ie(e,r,n);return{templateType:i?.identifier,name:a.name,extensionFlavor:a.flavor,directory:p(a.directory,"extensions"),app:n,extensionTemplates:s??[],unavailableExtensions:o??[],reset:a.reset,groupOrder:t}}function Ie(e,t,r){return ae(e,a=>!ue(r,t,a)?"validTemplates":"templatesOverlimit")}function ue(e,t,r){let n=r.type,a=t.find(s=>s.identifier===n||s.externalIdentifier===n);return e.extensionsForType({identifier:n,externalIdentifier:n}).length>=(a?.registrationLimit??1)}async function Se(e,t){let{extensionContent:r}=e;return k.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Ce(e,t,r,n){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:n}}function Me(e,t){let r=je(e.extensionTemplate,e.directory,t);$(r)}function Ne(e,t){if(!t||!e)return;let r=e.supportedFlavors.map(n=>n.value);if(!r.includes(t))throw new m("Invalid template for extension type",`Expected template to be one of the following: ${r.join(", ")}.`)}function je(e,t,r){let n={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&n.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:W(r,"shopify app dev")}]),e.supportLinks[0]&&n.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),n}async function Re(e,t,r,n){if(!e)return;let a=r.find(i=>i.identifier===e);if(!a){let i=await Y(),s=r.map(c=>c.identifier),o=i?"You might need to enable some flags on your Organization or App":void 0;throw new m(`Unknown extension type: ${e}.
@@ -1,4 +1,4 @@
1
- import{a}from"./chunk-3ACZB27E.js";import{p as n,q as m,v as l}from"./chunk-7DJNASBC.js";import{b as s,c as h}from"./chunk-WJEVB67Y.js";import{xa as o}from"./chunk-AINDVTMY.js";import{a as v}from"./chunk-CTNBSUVU.js";import{e as c,g as r}from"./chunk-VKWPEFWQ.js";r();var e=c(v(),1);var i=class extends l{static summary="Uploads your local theme files to the connected store, overwriting the remote version if specified.";static usage=["theme push","theme push --unpublished --json"];static descriptionWithMarkdown=`Uploads your local theme files to Shopify, overwriting the remote version if specified.
1
+ import{a}from"./chunk-LY7PSCG4.js";import{p as n,q as m,v as l}from"./chunk-4Y7WHAJX.js";import{b as s,c as h}from"./chunk-GZKEIUJT.js";import{xa as o}from"./chunk-NYHGIWKZ.js";import{a as v}from"./chunk-CTNBSUVU.js";import{e as c,g as r}from"./chunk-VKWPEFWQ.js";r();var e=c(v(),1);var i=class extends l{static summary="Uploads your local theme files to the connected store, overwriting the remote version if specified.";static usage=["theme push","theme push --unpublished --json"];static descriptionWithMarkdown=`Uploads your local theme files to Shopify, overwriting the remote version if specified.
2
2
 
3
3
  If no theme is specified, then you're prompted to select the theme to overwrite from the list of the themes in your store.
4
4
 
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-OTVZU5AQ.js";import{a as y}from"./chunk-22JJHQVU.js";import{a as m}from"./chunk-HZDEDEAS.js";import{a as u}from"./chunk-SEGZQCXZ.js";import{d as f}from"./chunk-UXL2A5UK.js";import{p as c,v as p}from"./chunk-7DJNASBC.js";import{b as h,e as d}from"./chunk-WJEVB67Y.js";import{Aa as l}from"./chunk-AINDVTMY.js";import{a as O}from"./chunk-CTNBSUVU.js";import{e as _,g as a}from"./chunk-VKWPEFWQ.js";a();var t=_(O(),1);var s=class extends p{static get requiresSyncAnalytics(){return!0}static summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";static descriptionWithMarkdown=`
1
+ import{a as v}from"./chunk-PPWJM7KE.js";import{a as y}from"./chunk-AGKG5G6X.js";import{a as m}from"./chunk-ATFKBLMQ.js";import{a as u}from"./chunk-3QF47EX2.js";import{d as f}from"./chunk-ZQ4KG6U2.js";import{p as c,v as p}from"./chunk-4Y7WHAJX.js";import{b as h,e as d}from"./chunk-GZKEIUJT.js";import{Aa as l}from"./chunk-NYHGIWKZ.js";import{a as O}from"./chunk-CTNBSUVU.js";import{e as _,g as a}from"./chunk-VKWPEFWQ.js";a();var t=_(O(),1);var s=class extends p{static get requiresSyncAnalytics(){return!0}static summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";static descriptionWithMarkdown=`
2
2
  Uploads the current theme as the specified theme, or a [development theme](https://shopify.dev/docs/themes/tools/cli#development-themes), to a store so you can preview it.
3
3
 
4
4
  This command returns the following information:
@@ -1 +1 @@
1
- import{o as n}from"./chunk-JLR6X5NA.js";import{H as s}from"./chunk-LIH7CQO7.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
1
+ import{o as n}from"./chunk-NAIXUSEF.js";import{H as s}from"./chunk-ESTXKKAB.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
@@ -1,4 +1,4 @@
1
- import{b as l}from"./chunk-WJEVB67Y.js";import{b as u}from"./chunk-HEWKCSY7.js";import{s as f}from"./chunk-AINDVTMY.js";import{h as n}from"./chunk-PSUNX2YX.js";import{a as g}from"./chunk-CTNBSUVU.js";import{wb as m}from"./chunk-GYFRTLML.js";import{e as v,g as o}from"./chunk-VKWPEFWQ.js";o();o();var S="https://shopify.dev/assistant/search",w="X-Shopify-Surface",A="cli";async function y(s,e,p){let i=new URLSearchParams({query:s});e&&i.append("api_name",e),p&&i.append("api_version",p);let r;try{r=await f(`${S}?${i.toString()}`,{headers:{Accept:"application/json",[w]:A}})}catch{throw new n("Could not reach shopify.dev to run the search.","Check your network connection and try again.")}let h=await r.text();if(!r.ok){let d=`${r.status} ${r.statusText}`;try{let t=JSON.parse(h);t?.error&&(d=t.error)}catch(t){if(!(t instanceof SyntaxError))throw t}throw new n(`Search failed: ${d}`)}m(h)}var a=v(g(),1),c=class s extends u{static description="Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static examples=[`# search shopify.dev for a topic
1
+ import{b as l}from"./chunk-GZKEIUJT.js";import{b as u}from"./chunk-XQIPACFV.js";import{s as f}from"./chunk-NYHGIWKZ.js";import{h as n}from"./chunk-BFL74TW2.js";import{a as g}from"./chunk-CTNBSUVU.js";import{wb as m}from"./chunk-DD7FQDTB.js";import{e as v,g as o}from"./chunk-VKWPEFWQ.js";o();o();var S="https://shopify.dev/assistant/search",w="X-Shopify-Surface",A="cli";async function y(s,e,p){let i=new URLSearchParams({query:s});e&&i.append("api_name",e),p&&i.append("api_version",p);let r;try{r=await f(`${S}?${i.toString()}`,{headers:{Accept:"application/json",[w]:A}})}catch{throw new n("Could not reach shopify.dev to run the search.","Check your network connection and try again.")}let h=await r.text();if(!r.ok){let d=`${r.status} ${r.statusText}`;try{let t=JSON.parse(h);t?.error&&(d=t.error)}catch(t){if(!(t instanceof SyntaxError))throw t}throw new n(`Search failed: ${d}`)}m(h)}var a=v(g(),1),c=class s extends u{static description="Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static examples=[`# search shopify.dev for a topic
2
2
  shopify doc search --query "subscribe to webhooks"
3
3
 
4
4
  # narrow the search to a specific API and version
@@ -1,4 +1,4 @@
1
- import{b as se}from"./chunk-T24RA3WI.js";import{a as ne,b as re,h as oe}from"./chunk-EDHR546O.js";import{a as q,d as X}from"./chunk-AINDVTMY.js";import{E as ee,_ as ie}from"./chunk-LIH7CQO7.js";import{h as A,j as te}from"./chunk-PSUNX2YX.js";import{Ta as Z,ma as Y}from"./chunk-GYFRTLML.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var ve=/^gid:\/\/shopify\/Shop\/(\d+)$/,De=/^\d+$/,ae=250,Re=new Set(ne),Be=new Set(re);function ue(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Ae(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),fe(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),le(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&fe(w)&&le(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ce(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Le(i,r),canonicalInput:a,inputDigest:de(a)}}}function Ae(i){let e=i?.trim();if(!e)return;let o=De.test(e)?e:ve.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function fe(i){return i!==void 0&&Re.has(i)}function le(i){return Be.has(i)}function ce(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Le(i,e){let o=[];for(let t=0;t<e.length;t+=ae){let n=e.slice(t,t+ae),r=ce(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:de(r)})}return o}function de(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var _e=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var he=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Te(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Te=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var pe=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},$e=13,Me=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:_e(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
1
+ import{b as se}from"./chunk-3NSZBIHE.js";import{a as ne,b as re,h as oe}from"./chunk-JIZ3BECO.js";import{a as q,d as X}from"./chunk-NYHGIWKZ.js";import{E as ee,_ as ie}from"./chunk-ESTXKKAB.js";import{h as A,j as te}from"./chunk-BFL74TW2.js";import{Ta as Z,ma as Y}from"./chunk-DD7FQDTB.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var ve=/^gid:\/\/shopify\/Shop\/(\d+)$/,De=/^\d+$/,ae=250,Re=new Set(ne),Be=new Set(re);function ue(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Ae(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),fe(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),le(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&fe(w)&&le(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ce(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Le(i,r),canonicalInput:a,inputDigest:de(a)}}}function Ae(i){let e=i?.trim();if(!e)return;let o=De.test(e)?e:ve.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function fe(i){return i!==void 0&&Re.has(i)}function le(i){return Be.has(i)}function ce(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Le(i,e){let o=[];for(let t=0;t<e.length;t+=ae){let n=e.slice(t,t+ae),r=ce(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:de(r)})}return o}function de(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var _e=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var he=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Te(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Te=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var pe=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},$e=13,Me=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:_e(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
2
2
  `,a).length:w,l?(s===null?0:s.length)+f.length:0,l?f.length+w:0);return S<O},parse:function(t,n,r,a){let{bom:s,comment_no_infix:f,delimiter_auto:l,encoding:h,from_line:w,ltrim:S,max_record_size:O,raw:L,relax_quotes:I,rtrim:E,skip_empty_lines:y,to:g,to_line:p}=this.options,{comment:x,escape:C,quote:N,record_delimiter:F}=this.options,{bomSkipped:Ne,delimiterDiscovered:Ee,delimiterBufPrevious:V,rawBuffer:xe,escapeIsQuote:Ce}=this.state;if(!Ee&&l){let m;if(V===void 0?m=t:V!==void 0&&t===void 0?m=V:m=Buffer.concat([V,t]),t=void 0,n||m.length>l.size)this.options.delimiter=[Buffer.from(he(m,this.options.delimiter_auto))],this.state.previousBuf=m,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=m;return}}let{previousBuf:P}=this.state,_;if(P===void 0)if(t===void 0){a();return}else _=t;else P!==void 0&&t===void 0?_=P:_=Buffer.concat([P,t]);if(Ne===!1)if(s===!1)this.state.bomSkipped=!0;else if(_.length<3){if(n===!1){this.state.previousBuf=_;return}}else{for(let m in $)if($[m].compare(_,0,$[m].length)===0){let D=$[m].length;this.state.bufBytesStart+=D,_=_.slice(D);let k=T({...this.original_options,encoding:m});for(let b in k)this.options[b]=k[b];({comment:x,escape:C,quote:N}=this.options);break}this.state.bomSkipped=!0}let U=_.length,u;for(u=0;u<U&&!this.__needMoreData(u,U,n);u++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),p!==-1&&this.info.lines>p){this.state.stop=!0,a();return}this.state.quoting===!1&&F.length===0&&this.__autoDiscoverRecordDelimiter(_,u)&&(F=this.options.record_delimiter);let m=_[u];if(L===!0&&xe.append(m),(m===$e||m===Me)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(C!==null&&this.state.quoting===!0&&this.__isEscape(_,u,m)&&u+C.length<U)if(Ce){if(this.__isQuote(_,u+C.length)){this.state.escaping=!0,u+=C.length-1;continue}}else{this.state.escaping=!0,u+=C.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(_,u))if(this.state.quoting===!0){let b=_[u+N.length],R=E&&this.__isCharTrimable(_,u+N.length),v=x!==null&&this.__compareBytes(x,_,u+N.length,b),B=this.__isDelimiter(_,u+N.length,b),J=F.length===0?this.__autoDiscoverRecordDelimiter(_,u+N.length):this.__isRecordDelimiter(b,_,u+N.length);if(C!==null&&this.__isEscape(_,u,m)&&this.__isQuote(_,u+C.length))u+=C.length-1;else if(!b||B||J||v||R){this.state.quoting=!1,this.state.wasQuoting=!0,u+=N.length-1;continue}else if(I===!1){let W=this.__error(new c("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(b)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(W!==void 0)return W}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(N),u+=N.length-1}else if(this.state.field.length!==0){if(I===!1){let b=this.__infoField(),R=Object.keys($).map(B=>$[B].equals(this.state.field.toString())?B:!1).filter(Boolean)[0],v=this.__error(new c("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(b.column)} at line ${b.lines}, value is ${JSON.stringify(this.state.field.toString(h))}`,R?`(${R} bom)`:void 0],this.options,b,{field:this.state.field}));if(v!==void 0)return v}}else{this.state.quoting=!0,u+=N.length-1;continue}if(this.state.quoting===!1){let b=this.__isRecordDelimiter(m,_,u);if(b!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=w){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),u+=b-1;continue}if(y===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,u+=b-1;continue}this.info.bytes=this.state.bufBytesStart+u;let B=this.__onField();if(B!==void 0)return B;this.info.bytes=this.state.bufBytesStart+u+b;let J=this.__onRecord(r);if(J!==void 0)return J;if(g!==-1&&this.info.records>=g){this.state.stop=!0,a();return}}this.state.commenting=!1,u+=b-1;continue}if(this.state.commenting)continue;if(x!==null&&(f===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(x,_,u,m)!==0){this.state.commenting=!0;continue}let R=this.__isDelimiter(_,u,m);if(R!==0){this.info.bytes=this.state.bufBytesStart+u;let v=this.__onField();if(v!==void 0)return v;u+=R-1;continue}}}if(this.state.commenting===!1&&O!==0&&this.state.record_length+this.state.field.length>O)return this.__error(new c("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${O}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let D=S===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(_,u),k=E===!1||this.state.wasQuoting===!1;if(D===!0&&k===!0)this.state.field.append(m);else{if(E===!0&&!this.__isCharTrimable(_,u))return this.__error(new c("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));D===!1&&(u+=this.__isCharTrimable(_,u)-1);continue}}if(n===!0)if(this.state.quoting===!0){let m=this.__error(new c("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(m!==void 0)return m}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+u;let m=this.__onField();if(m!==void 0)return m;let D=this.__onRecord(r);if(D!==void 0)return D}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=u,this.state.previousBuf=_.slice(u);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(t){let{columns:n,group_columns_by_name:r,encoding:a,info:s,from:f,relax_column_count:l,relax_column_count_less:h,relax_column_count_more:w,raw:S,skip_records_with_empty_values:O}=this.options,{enabled:L,record:I}=this.state;if(L===!1)return this.__resetRecord();let E=I.length;if(n===!0){if(O===!0&&pe(I)){this.__resetRecord();return}return this.__firstLineToColumns(I)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=E),E!==this.state.expectedRecordLength){let y=n===!1?new c("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I}):new c("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I});if(l===!0||h===!0&&E<this.state.expectedRecordLength||w===!0&&E>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=y;else{let g=this.__error(y);if(g)return g}}if(O===!0&&pe(I)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,f===1||this.info.records>=f){let{objname:y}=this.options;if(n!==!1){let g={};for(let p=0,x=I.length;p<x;p++)n[p]===void 0||n[p].disabled||(r===!0&&Object.hasOwn(g,n[p].name)?Array.isArray(g[n[p].name])?g[n[p].name]=g[n[p].name].concat(I[p]):g[n[p].name]=[g[n[p].name],I[p]]:Object.defineProperty(g,n[p].name,{value:I[p],enumerable:!0,writable:!0,configurable:!0}));if(S===!0||s===!0){let p=Object.assign({record:g},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),x=this.__push(y===void 0?p:[g[y],p],t);if(x)return x}else{let p=this.__push(y===void 0?g:[g[y],g],t);if(p)return p}}else if(S===!0||s===!0){let g=Object.assign({record:I},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),p=this.__push(y===void 0?g:[I[y],g],t);if(p)return p}else{let g=this.__push(y===void 0?I:[I[y],I],t);if(g)return g}}this.__resetRecord()},__firstLineToColumns:function(t){let{firstLineToHeaders:n}=this.state;try{let r=n===void 0?t:n.call(null,t);if(!Array.isArray(r))return this.__error(new c("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}));let a=z(r);this.state.expectedRecordLength=a.length,this.options.columns=a,this.__resetRecord();return}catch(r){return r}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:t,encoding:n,rtrim:r,max_record_size:a}=this.options,{enabled:s,wasQuoting:f}=this.state;if(s===!1)return this.__resetField();let l=this.state.field.toString(n);if(r===!0&&f===!1&&(l=l.trimRight()),t===!0){let[h,w]=this.__cast(l);if(h!==void 0)return h;l=w}this.state.record.push(l),a!==0&&typeof l=="string"&&(this.state.record_length+=l.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(t,n){let{on_record:r}=this.options;if(r!==void 0){let a=this.__infoRecord();try{t=r.call(null,t,a)}catch(s){return s}if(t==null)return}this.info.bytes_records+=this.info.bytes,n(t)},__cast:function(t){let{columns:n,relax_column_count:r}=this.options;if(Array.isArray(n)===!0&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let s=this.__infoField();return[void 0,this.state.castField.call(null,t,s)]}catch(s){return[s]}if(this.__isFloat(t))return[void 0,parseFloat(t)];if(this.options.cast_date!==!1){let s=this.__infoField();return[void 0,this.options.cast_date.call(null,t,s)]}return[void 0,t]},__compareBytes:function(t,n,r,a){if(t[0]!==a)return 0;let s=t.length;for(let f=1;f<s;f++)if(t[f]!==n[r+f])return 0;return s},__isCharTrimable:function(t,n){let{timchars:r,timcharFirstBytes:a}=this.state,s=t[n];if(s===void 0||a[s]===0)return 0;e:for(let f=0;f<r.length;f++){let l=r[f];for(let h=0;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}return 0},__isDelimiter:function(t,n,r){let{delimiter:a,ignore_last_delimiters:s}=this.options;if(s===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(s!==!1&&typeof s=="number"&&this.state.record.length===s-1)return 0;e:for(let f=0;f<a.length;f++){let l=a[f];if(l[0]===r){for(let h=1;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}}return 0},__isEscape:function(t,n,r){let{escape:a}=this.options;if(a===null)return!1;let s=a.length;if(a[0]===r){for(let f=0;f<s;f++)if(a[f]!==t[n+f])return!1;return!0}return!1},__isFloat:function(t){return t-parseFloat(t)+1>=0},__isQuote:function(t,n){let{quote:r}=this.options;if(r===null)return!1;let a=r.length;for(let s=0;s<a;s++)if(r[s]!==t[n+s])return!1;return!0},__isRecordDelimiter:function(t,n,r){let{record_delimiter:a}=this.options,s=a.length;e:for(let f=0;f<s;f++){let l=a[f],h=l.length;if(l[0]===t){for(let w=1;w<h;w++)if(l[w]!==n[r+w])continue e;return l.length}}return 0},__autoDiscoverRecordDelimiter:function(t,n){let{encoding:r}=this.options,a=[Buffer.from(`\r
3
3
  `,r),Buffer.from(`
4
4
  `,r),Buffer.from("\r",r)];e:for(let s=0;s<a.length;s++){let f=a[s].length;for(let l=0;l<f;l++)if(a[s][l]!==t[n+l])continue e;return this.options.record_delimiter.push(a[s]),this.state.recordDelimiterMaxLength=a[s].length,a[s].length}return 0},__error:function(t){let{encoding:n,raw:r,skip_records_with_error:a}=this.options,s=typeof t=="string"?new Error(t):t;if(a){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(s,r?this.state.rawBuffer.toString(n):void 0)}catch(f){return f}return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:t,raw:n,encoding:r}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:t===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(r):void 0}},__infoField:function(){let{columns:t}=this.options,n=Array.isArray(t),r=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:r,column:n===!0?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var ge=function(i,e={}){typeof i=="string"&&(i=Buffer.from(i));let o=e&&e.objname?Object.create(null):[],t=j(e),n=s=>{t.options.objname===void 0?o.push(s):o[s[0]]=s[1]},r=()=>{},a=t.parse(i,!0,n,r);if(a!==void 0)throw a;return o};var Ve=["shop_id","target_plan_handle","price_behavior","notification"],Pe={schedule:["shop_id","target_plan_handle","price_behavior"],unschedule:["shop_id"]};function be(i,e){if(i.trim()==="")return{ok:!1,errors:[{message:"The CSV is empty"}]};let o=[],t;try{t=ge(i,{bom:!0,columns:r=>(o=r,r),info:!0,skip_empty_lines:!0,trim:!0})}catch(r){if(!(r instanceof c))throw r;return{ok:!1,errors:[{message:`Invalid CSV: ${r.message}`}]}}let n=ke(o,e);return n.length>0?{ok:!1,errors:n}:t.length===0?{ok:!1,errors:[{message:"The CSV must contain at least one data row"}]}:{ok:!0,rows:t.map(({record:r,info:a})=>Je(r,a.lines,e))}}function ke(i,e){let o=[],t=new Set(Ve),n=new Set;for(let r of i)n.has(r)?o.push({field:r,message:`Duplicate CSV header: ${r}`}):n.add(r),t.has(r)||o.push({field:r,message:`Unknown CSV header: ${r}`});for(let r of Pe[e])i.includes(r)||o.push({field:r,message:`Missing required CSV header: ${r}`});return o}function Je(i,e,o){return o==="unschedule"?{sourceRow:e,shopId:i.shop_id}:{sourceRow:e,shopId:i.shop_id,...i.target_plan_handle===void 0?{}:{targetPlanHandle:i.target_plan_handle},...i.price_behavior===void 0?{}:{priceBehavior:i.price_behavior},...i.notification===void 0?{}:{notification:i.notification}}}d();var we={fileExists:Z,readFile:Y,readStdin:ie};async function G(i,e=we){let o={...we,...e};if(i!=="-"){if(!await o.fileExists(i))throw new A(`CSV file not found: ${i}`);try{return await o.readFile(i)}catch(n){if(n instanceof A)throw n;let r=n instanceof Error?n.message:String(n);throw new A(`Couldn't read CSV file ${i}: ${r}`)}}let t=await o.readStdin();if(t===void 0||t==="")throw new A("Provide --input <path> or pipe CSV data to stdin.");return t}async function Ie(i,e,o){let t=o?await G(e,o):await G(e),n=be(t,i);return n.ok?ue(i,n.rows):n}d();d();var qe="shopify-subscription-migration:v1";function ye(){return X()}function Oe({appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t}){let n=JSON.stringify({namespace:qe,appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t});return q(n).toString("hex")}var K=class extends Error{batchIndex;constructor(e){super(`Migration submission batch ${e} returned neither an operation nor user errors`),this.name="MigrationSubmissionProtocolError",this.batchIndex=e}};async function Se({clientId:i,plan:e,invocationId:o=ye(),createOperation:t=oe}){let n={clientId:i,action:e.action,inputDigest:e.inputDigest,total:e.rows.length,operations:[]};for(let r of e.batches){let a=Oe({appIdentifier:i,action:e.action,invocationId:o,canonicalBatchPayload:r.canonicalPayload}),s=await t({clientId:i,idempotencyKey:a,migrations:r.rows.map(ze)});if(s.operation&&n.operations.push({batchIndex:r.index,batchPayloadDigest:r.payloadDigest,operation:s.operation}),s.userErrors.length>0)return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:s.userErrors}};if(!s.operation)throw new K(r.index)}return{status:"success",submission:n}}function ze(i){return i.action==="unschedule"?{shopId:i.shopId,action:{cancelMigration:!0}}:{shopId:i.shopId,action:{scheduleMigration:je(i)}}}function je({targetPlanHandle:i,priceBehavior:e,notification:o}){return{targetPlanHandle:i,priceBehavior:e,notification:o}}async function ni(i){let e=await Ie(i.action,i.input);if(!e.ok)throw new A(Ue(e.errors));if(!i.skipConfirmation&&!await ee({message:`${i.action==="schedule"?"Schedule":"Unschedule"} ${e.plan.rows.length} subscriptions?`}))throw new te;let o=await Se({clientId:i.clientId,plan:e.plan});if(o.status==="failed"||!i.watch)return o;i.onSubmissionAccepted?.(o.submission);let t=await se({clientId:i.clientId,operationIds:o.submission.operations.map(({operation:a})=>a.id)}),n=Fe(o.submission,t),r=n.operations.filter(({operation:a})=>a.status==="FAILED").map(({operation:a})=>a.id);return r.length===0?{status:"success",submission:n}:{status:"failed",submission:n,failure:{type:"operations",operationIds:r}}}function Fe(i,e){let o=new Map(e.map(t=>[t.id,t]));return{...i,operations:i.operations.map(t=>({...t,operation:o.get(t.operation.id)??t.operation}))}}function Ue(i){return i.map(e=>{let o=[e.row===void 0?void 0:`row ${e.row}`,e.field].filter(t=>t!==void 0).join(", ");return o?`${o}: ${e.message}`:e.message}).join(`
@@ -1 +1 @@
1
- import{b as u,c as d}from"./chunk-H6HILX7D.js";import{a as c}from"./chunk-MA6QRENS.js";import{a as e}from"./chunk-36OXWMXZ.js";import{e as n,xa as p}from"./chunk-YAA7OGRM.js";import{b as i}from"./chunk-WJEVB67Y.js";import{z as s}from"./chunk-LIH7CQO7.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var r=class f extends c{static summary="Generate GraphQL types for a function.";static descriptionWithMarkdown="Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.";static description=this.descriptionWithoutMarkdown();static flags={...i,...e,...u};async run(){let{flags:t}=await this.parse(f),{app:o}=await p({directory:t.path,userProvidedConfigName:t.config}),m=await d(o,t.path);return await n(m,{stdout:process.stdout,stderr:process.stderr,app:o}),s({headline:"GraphQL types generated successfully."}),{app:o}}};export{r as a};
1
+ import{b as u,c as d}from"./chunk-ZG3I4COP.js";import{a as c}from"./chunk-DWI2BHXZ.js";import{a as e}from"./chunk-N7VI7OWJ.js";import{e as n,xa as p}from"./chunk-7LW23M5C.js";import{b as i}from"./chunk-GZKEIUJT.js";import{z as s}from"./chunk-ESTXKKAB.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var r=class f extends c{static summary="Generate GraphQL types for a function.";static descriptionWithMarkdown="Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.";static description=this.descriptionWithoutMarkdown();static flags={...i,...e,...u};async run(){let{flags:t}=await this.parse(f),{app:o}=await p({directory:t.path,userProvidedConfigName:t.config}),m=await d(o,t.path);return await n(m,{stdout:process.stdout,stderr:process.stderr,app:o}),s({headline:"GraphQL types generated successfully."}),{app:o}}};export{r as a};
@@ -1 +1 @@
1
- import{a as q,c as C}from"./chunk-6JC2PM43.js";import{d as x,f as k,u as N}from"./chunk-RNFZJQVV.js";import{a as J}from"./chunk-3NVQXPTU.js";import{a as A,c as E}from"./chunk-36OXWMXZ.js";import{b}from"./chunk-JVXKDM2E.js";import{b as O}from"./chunk-WJEVB67Y.js";import{k as I,l as y}from"./chunk-AINDVTMY.js";import{B as v,I as f,z as d}from"./chunk-LIH7CQO7.js";import{h as l}from"./chunk-PSUNX2YX.js";import{Ta as g,ma as h,qb as c,sb as s,ua as w,wb as S}from"./chunk-GYFRTLML.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();var F=Q(I(),1);async function z(a,e){if(a)try{return JSON.parse(a)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new l(s`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await g(e))throw new l(s`Variable file not found at ${c.path(e)}. Please check the path and try again.`);let t=await h(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:"Unknown error";throw new l(s`Invalid JSON in variable file ${c.path(e)}: ${n}`,"Please provide valid JSON format.")}}}async function M(a){let{remoteApp:e,store:t,query:r,variables:n,variableFile:$,version:L,outputFile:u}=a,{adminSession:R,version:V}=await f({title:s`Authenticating`,task:async()=>{let o=await q(e,t.shopDomain),i=await k({adminSession:o,userSpecifiedVersion:L});return{adminSession:o,version:i}},renderOptions:{stdout:process.stderr}}),G=await z(n,$);x(r),C(r,t);try{let o=await f({title:s`Executing GraphQL operation`,task:async()=>b({query:(0,F.parse)(r),session:R,variables:G,version:V,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),i=JSON.stringify(o,null,2);u?(await w(u,i),d({headline:"Operation succeeded.",body:`Results written to ${u}`})):(d({headline:"Operation succeeded."}),S(i))}catch(o){if(o instanceof y){let i={errors:o.response.errors},P=JSON.stringify(i,null,2);v({headline:"GraphQL operation failed.",body:P});return}throw o}}var m=class a extends J{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static description=this.descriptionWithoutMarkdown();static flags={...O,...A,...E};async run(){let{flags:e}=await this.parse(a),{query:t,appContextResult:r,store:n}=await N(e);return await M({organization:r.organization,remoteApp:r.remoteApp,store:n,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{m as a};
1
+ import{a as q,c as C}from"./chunk-XMQJUFVE.js";import{d as x,f as k,u as N}from"./chunk-DJGDJSXS.js";import{a as J}from"./chunk-ID3AR4VW.js";import{a as A,c as E}from"./chunk-N7VI7OWJ.js";import{b}from"./chunk-WKCXSP6V.js";import{b as O}from"./chunk-GZKEIUJT.js";import{k as I,l as y}from"./chunk-NYHGIWKZ.js";import{B as v,I as f,z as d}from"./chunk-ESTXKKAB.js";import{h as l}from"./chunk-BFL74TW2.js";import{Ta as g,ma as h,qb as c,sb as s,ua as w,wb as S}from"./chunk-DD7FQDTB.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();var F=Q(I(),1);async function z(a,e){if(a)try{return JSON.parse(a)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new l(s`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await g(e))throw new l(s`Variable file not found at ${c.path(e)}. Please check the path and try again.`);let t=await h(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:"Unknown error";throw new l(s`Invalid JSON in variable file ${c.path(e)}: ${n}`,"Please provide valid JSON format.")}}}async function M(a){let{remoteApp:e,store:t,query:r,variables:n,variableFile:$,version:L,outputFile:u}=a,{adminSession:R,version:V}=await f({title:s`Authenticating`,task:async()=>{let o=await q(e,t.shopDomain),i=await k({adminSession:o,userSpecifiedVersion:L});return{adminSession:o,version:i}},renderOptions:{stdout:process.stderr}}),G=await z(n,$);x(r),C(r,t);try{let o=await f({title:s`Executing GraphQL operation`,task:async()=>b({query:(0,F.parse)(r),session:R,variables:G,version:V,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),i=JSON.stringify(o,null,2);u?(await w(u,i),d({headline:"Operation succeeded.",body:`Results written to ${u}`})):(d({headline:"Operation succeeded."}),S(i))}catch(o){if(o instanceof y){let i={errors:o.response.errors},P=JSON.stringify(i,null,2);v({headline:"GraphQL operation failed.",body:P});return}throw o}}var m=class a extends J{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static description=this.descriptionWithoutMarkdown();static flags={...O,...A,...E};async run(){let{flags:e}=await this.parse(a),{query:t,appContextResult:r,store:n}=await N(e);return await M({organization:r.organization,remoteApp:r.remoteApp,store:n,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{m as a};
@@ -1 +1 @@
1
- import{T as m}from"./chunk-LIH7CQO7.js";import{h as c}from"./chunk-PSUNX2YX.js";import{Ab as a,qb as l,sb as n}from"./chunk-GYFRTLML.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
1
+ import{T as m}from"./chunk-ESTXKKAB.js";import{h as c}from"./chunk-BFL74TW2.js";import{Ab as a,qb as l,sb as n}from"./chunk-DD7FQDTB.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
@@ -1 +1 @@
1
- import{b as a,g as c,i as p,j as f}from"./chunk-ZYEGQSF5.js";import{k as h}from"./chunk-PSUNX2YX.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();i();i();function d(n){let e=/[^\p{Letter}\p{Number}\p{Mark}-]/gu;return n.replace(e,"-")}import{randomBytes as l}from"crypto";import{hostname as g}from"os";var T=50;function m(n){let e=g().split(".")[0],r=l(3).toString("hex"),t=`${n} ()`,s=T-t.length-r.length-1,o=d(`${r}-${e.substring(0,s)}`);return`${n} (${o})`}var u=class{adminSession;themeId;constructor(e){this.adminSession=e}async findOrCreate(e,r){let t=await this.fetch(e,r);return t?this.setTheme(t.id.toString()):t=await this.create(r,e),t}async fetch(e,r){if(!this.themeId&&!e)return;let t=e&&r===a?await p(e,this.adminSession):await c(parseInt(this.themeId,10),this.adminSession);return t||this.removeTheme(),t}generateThemeName(e){return m(e)}async create(e,r){let t=r??m(this.context),s=e??a,o=await f({name:t,role:s},this.adminSession);if(!o)throw new h(`Could not create theme with name "${t}" and role "${s}"`);return this.setTheme(o.id.toString()),o}};export{u as a};
1
+ import{b as a,g as c,i as p,j as f}from"./chunk-5GBIXC2Y.js";import{k as h}from"./chunk-BFL74TW2.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();i();i();function d(n){let e=/[^\p{Letter}\p{Number}\p{Mark}-]/gu;return n.replace(e,"-")}import{randomBytes as l}from"crypto";import{hostname as g}from"os";var T=50;function m(n){let e=g().split(".")[0],r=l(3).toString("hex"),t=`${n} ()`,s=T-t.length-r.length-1,o=d(`${r}-${e.substring(0,s)}`);return`${n} (${o})`}var u=class{adminSession;themeId;constructor(e){this.adminSession=e}async findOrCreate(e,r){let t=await this.fetch(e,r);return t?this.setTheme(t.id.toString()):t=await this.create(r,e),t}async fetch(e,r){if(!this.themeId&&!e)return;let t=e&&r===a?await p(e,this.adminSession):await c(parseInt(this.themeId,10),this.adminSession);return t||this.removeTheme(),t}generateThemeName(e){return m(e)}async create(e,r){let t=r??m(this.context),s=e??a,o=await f({name:t,role:s},this.adminSession);if(!o)throw new h(`Could not create theme with name "${t}" and role "${s}"`);return this.setTheme(o.id.toString()),o}};export{u as a};