@shopify/cli 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +2 -2
  2. package/dist/analytics-5TEIW43T.js +1 -0
  3. package/dist/analytics-GG7CYCGL.js +1 -0
  4. package/dist/bootstrap.js +1 -1
  5. package/dist/{chunk-MBAFWQSZ.js → chunk-2AJ5FI2K.js} +1 -1
  6. package/dist/{chunk-SRCQVUMC.js → chunk-2GK56X53.js} +1 -1
  7. package/dist/{chunk-3F6NZK7S.js → chunk-3D4JXJPS.js} +1 -1
  8. package/dist/{chunk-YI232QLS.js → chunk-3NBK56IK.js} +1 -1
  9. package/dist/{chunk-HUZUORYM.js → chunk-4DCQNGUV.js} +1 -1
  10. package/dist/{chunk-6TZAAS5H.js → chunk-4IC626OL.js} +1 -1
  11. package/dist/{chunk-SBEZBZM7.js → chunk-54CAKCYR.js} +2 -2
  12. package/dist/{chunk-VWYM4OWK.js → chunk-5UHQVR2Z.js} +1 -1
  13. package/dist/{chunk-D6JARNEH.js → chunk-5WVAHE5E.js} +1 -1
  14. package/dist/{chunk-Y5JKV2AI.js → chunk-67MH4AXG.js} +1 -1
  15. package/dist/{chunk-3DQIVE24.js → chunk-6CYMJ76C.js} +1 -1
  16. package/dist/chunk-6G6TMKXF.js +28 -0
  17. package/dist/{chunk-MQNYGGAM.js → chunk-6ITDI2SD.js} +1 -1
  18. package/dist/{chunk-WZBSLU4Q.js → chunk-6RE2SNCU.js} +1 -1
  19. package/dist/{chunk-KL5Z3T6L.js → chunk-6SF3ZETE.js} +1 -1
  20. package/dist/chunk-6WL4GA2M.js +15 -0
  21. package/dist/{chunk-DU4WR4OP.js → chunk-76R52ODR.js} +1 -1
  22. package/dist/{chunk-DJQVNH7P.js → chunk-7ESSIN27.js} +1 -1
  23. package/dist/{chunk-UGDBJTLP.js → chunk-7NH7CHVI.js} +1 -1
  24. package/dist/{chunk-ELYP4KFP.js → chunk-7QIOUDCX.js} +1 -1
  25. package/dist/{chunk-GD7FWXJ5.js → chunk-7ZT57XT7.js} +1 -1
  26. package/dist/{chunk-RF2DPBA6.js → chunk-AGNMOFJS.js} +1 -1
  27. package/dist/{chunk-WXVZJJOR.js → chunk-BS3BKORT.js} +1 -1
  28. package/dist/{chunk-K5YV6UVF.js → chunk-C2IK2HY3.js} +1 -1
  29. package/dist/{chunk-22PCRFG4.js → chunk-C7BTJ32Z.js} +1 -1
  30. package/dist/{chunk-RFG5RMPL.js → chunk-CBXSPL4W.js} +1 -1
  31. package/dist/{chunk-B2IVY4V5.js → chunk-CEIQFLCN.js} +1 -1
  32. package/dist/{chunk-XBXMPFXM.js → chunk-DCPBRWVC.js} +1 -1
  33. package/dist/{chunk-26D72ZNV.js → chunk-DN2IE3VY.js} +1 -1
  34. package/dist/{chunk-Q7ING5F5.js → chunk-DRFGABEB.js} +1 -1
  35. package/dist/{chunk-DJONKJSZ.js → chunk-E3EMHAJB.js} +1 -1
  36. package/dist/{chunk-TQYMC7TH.js → chunk-EKXY5COY.js} +1 -1
  37. package/dist/{chunk-4G7J6HIV.js → chunk-EQU4MUQJ.js} +1 -1
  38. package/dist/chunk-F2QU6WWX.js +1 -0
  39. package/dist/{chunk-AIV5RI3X.js → chunk-FKMC5OFF.js} +1 -1
  40. package/dist/{chunk-XLELNRFF.js → chunk-FQWB2F75.js} +1 -1
  41. package/dist/{chunk-JHPRFW5B.js → chunk-FYFNUDOC.js} +1 -1
  42. package/dist/chunk-G4BPGWJC.js +1 -0
  43. package/dist/{chunk-KNVM7N3U.js → chunk-GVQIPEZT.js} +1 -1
  44. package/dist/{chunk-66RJ5T7A.js → chunk-GZS44BUW.js} +61 -61
  45. package/dist/{chunk-J3KVONB3.js → chunk-HIBX234C.js} +1 -1
  46. package/dist/{chunk-OHY4ZL3U.js → chunk-HRUGYZZ4.js} +1 -1
  47. package/dist/{chunk-ZV6NCNI4.js → chunk-HUIJMGVJ.js} +1 -1
  48. package/dist/{chunk-ALKTLKQ6.js → chunk-IZ3C5J7G.js} +1 -1
  49. package/dist/{chunk-RVNMVBPM.js → chunk-JAO53IH2.js} +1 -1
  50. package/dist/chunk-JCL2RRU6.js +1 -0
  51. package/dist/{chunk-74HYYXXE.js → chunk-JQJBBXMX.js} +1 -1
  52. package/dist/{chunk-HSK7YMRE.js → chunk-JXW374CL.js} +1 -1
  53. package/dist/{chunk-KWJ562F2.js → chunk-K6CTUBFC.js} +1 -1
  54. package/dist/{chunk-A74GETYC.js → chunk-KHSYW7I4.js} +1 -1
  55. package/dist/{chunk-LX3ZOW52.js → chunk-KHTV6PBV.js} +1 -1
  56. package/dist/{chunk-TFSBQ4RY.js → chunk-KKTW6ZCA.js} +1 -1
  57. package/dist/{chunk-JGXWQULI.js → chunk-KN3WTTHZ.js} +1 -1
  58. package/dist/{chunk-R466TU3N.js → chunk-KR6QDE7D.js} +1 -1
  59. package/dist/{chunk-GFJ7UV74.js → chunk-KZOBF55B.js} +1 -1
  60. package/dist/{chunk-LAZJ47DZ.js → chunk-L2MGAEV3.js} +2 -2
  61. package/dist/{chunk-JVIKCGDY.js → chunk-M2D7USAX.js} +1 -1
  62. package/dist/{chunk-INEU4XKS.js → chunk-M2ZHFKPN.js} +1 -1
  63. package/dist/{chunk-LXFJDCNG.js → chunk-M3RYUB22.js} +1 -1
  64. package/dist/{chunk-JPGO36XP.js → chunk-M56NDIMD.js} +1 -1
  65. package/dist/{chunk-GNPS5SBU.js → chunk-MCVRONUY.js} +1 -1
  66. package/dist/{chunk-4HHXSMD7.js → chunk-MHWV5RQV.js} +1 -1
  67. package/dist/{chunk-LW7U753G.js → chunk-MWGBTOO3.js} +1 -1
  68. package/dist/{chunk-JLBH7RCF.js → chunk-MWY3A7O3.js} +1 -1
  69. package/dist/{chunk-GFEAKSGV.js → chunk-N5PQPIBF.js} +40 -40
  70. package/dist/{chunk-2APPXD5Z.js → chunk-NMBBTTIH.js} +1 -1
  71. package/dist/{chunk-VY6SNDKW.js → chunk-NPEVESCV.js} +1 -1
  72. package/dist/{chunk-V2CNCPIE.js → chunk-OBEWZXOQ.js} +1 -1
  73. package/dist/{chunk-6BMMB2UO.js → chunk-OTY24J2W.js} +1 -1
  74. package/dist/{chunk-2VQJQ36C.js → chunk-OY3PNHPZ.js} +1 -1
  75. package/dist/{chunk-VS3T5YOG.js → chunk-PAP22IQO.js} +2 -2
  76. package/dist/{chunk-LALIKZPS.js → chunk-PYVAWAUO.js} +1 -1
  77. package/dist/{chunk-LNHLDRC5.js → chunk-Q33IBIVJ.js} +1 -1
  78. package/dist/chunk-Q4T2T2QE.js +15 -0
  79. package/dist/{chunk-NRAFVIU3.js → chunk-QA23HIH4.js} +1 -1
  80. package/dist/{chunk-52GC6XUT.js → chunk-QBSKKQBN.js} +1 -1
  81. package/dist/{chunk-KGXQS7LS.js → chunk-S6EJHWJL.js} +1 -1
  82. package/dist/{chunk-P5VVOLGV.js → chunk-SIMFNECG.js} +1 -1
  83. package/dist/{chunk-YMWHHINU.js → chunk-SXTMSGUE.js} +1 -1
  84. package/dist/{chunk-IOLVEXM6.js → chunk-T542UQBY.js} +1 -1
  85. package/dist/{chunk-QRRNOVJ3.js → chunk-TQ6HYDVC.js} +1 -1
  86. package/dist/chunk-TYZXGSHO.js +3 -0
  87. package/dist/{chunk-IIIVWD4R.js → chunk-UHJYPEY2.js} +1 -1
  88. package/dist/{chunk-KBQ4LGFB.js → chunk-UJVH7FZS.js} +1 -1
  89. package/dist/{chunk-6B53BWJW.js → chunk-UJXUSRQK.js} +1 -1
  90. package/dist/{chunk-OXPWCC7I.js → chunk-ULFWK45W.js} +1 -1
  91. package/dist/chunk-ULQG3XQS.js +1 -0
  92. package/dist/{chunk-RM5SJJN6.js → chunk-URZPVSJZ.js} +1 -1
  93. package/dist/{chunk-UGXYQ23Y.js → chunk-UXVZ2P63.js} +1 -1
  94. package/dist/{chunk-72F3YBNA.js → chunk-UYXEA3Y6.js} +1 -1
  95. package/dist/{chunk-OUOYKNMY.js → chunk-VICYNG2W.js} +1 -1
  96. package/dist/{chunk-IASVAERO.js → chunk-WSDN25F5.js} +1 -1
  97. package/dist/{chunk-DFMQWJQ3.js → chunk-XITQULK4.js} +1 -1
  98. package/dist/{chunk-B2EHO7ZC.js → chunk-XONFGLJQ.js} +4 -4
  99. package/dist/{chunk-YZDDTYTU.js → chunk-XOTA6JTZ.js} +3 -3
  100. package/dist/{chunk-323UTVMM.js → chunk-XR6GMMEU.js} +1 -1
  101. package/dist/{chunk-XNO6DZYP.js → chunk-XULPJ6UG.js} +1 -1
  102. package/dist/{chunk-3LVGAQB4.js → chunk-XXVEHDVO.js} +1 -1
  103. package/dist/chunk-Y7JGYGV7.js +1 -0
  104. package/dist/chunk-YTNDFQJT.js +3 -0
  105. package/dist/{chunk-N5YIPQ6J.js → chunk-ZBRRJDGW.js} +1 -1
  106. package/dist/{chunk-ELVFJ7BR.js → chunk-ZGK3LGCH.js} +1 -1
  107. package/dist/{chunk-GOJ2QHSR.js → chunk-ZSBA6VIC.js} +1 -1
  108. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  109. package/dist/cli/commands/app/build.js +1 -1
  110. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  111. package/dist/cli/commands/app/bulk/execute.js +1 -1
  112. package/dist/cli/commands/app/bulk/status.js +1 -1
  113. package/dist/cli/commands/app/config/link.js +1 -1
  114. package/dist/cli/commands/app/config/pull.js +1 -1
  115. package/dist/cli/commands/app/config/use.js +1 -1
  116. package/dist/cli/commands/app/config/validate.js +1 -1
  117. package/dist/cli/commands/app/demo/watcher.js +1 -1
  118. package/dist/cli/commands/app/deploy.js +1 -1
  119. package/dist/cli/commands/app/dev/clean.js +1 -1
  120. package/dist/cli/commands/app/dev.js +1 -1
  121. package/dist/cli/commands/app/env/pull.js +1 -1
  122. package/dist/cli/commands/app/env/show.js +1 -1
  123. package/dist/cli/commands/app/execute.js +1 -1
  124. package/dist/cli/commands/app/function/build.js +1 -1
  125. package/dist/cli/commands/app/function/info.js +1 -1
  126. package/dist/cli/commands/app/function/replay.js +1 -1
  127. package/dist/cli/commands/app/function/run.js +1 -1
  128. package/dist/cli/commands/app/function/schema.js +1 -1
  129. package/dist/cli/commands/app/function/typegen.js +1 -1
  130. package/dist/cli/commands/app/generate/extension.js +1 -1
  131. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  132. package/dist/cli/commands/app/import-extensions.js +1 -1
  133. package/dist/cli/commands/app/info.js +1 -1
  134. package/dist/cli/commands/app/init.js +9 -9
  135. package/dist/cli/commands/app/logs.js +1 -1
  136. package/dist/cli/commands/app/release.js +1 -1
  137. package/dist/cli/commands/app/versions/list.js +1 -1
  138. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  139. package/dist/cli/commands/auth/login.js +1 -1
  140. package/dist/cli/commands/auth/logout.js +1 -1
  141. package/dist/cli/commands/cache/clear.js +1 -1
  142. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  143. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  144. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  145. package/dist/cli/commands/debug/command-flags.js +1 -1
  146. package/dist/cli/commands/docs/generate.d.ts +0 -8
  147. package/dist/cli/commands/docs/generate.js +1 -1
  148. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  149. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  150. package/dist/cli/commands/help.js +1 -1
  151. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  152. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  153. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  154. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  155. package/dist/cli/commands/notifications/generate.js +1 -1
  156. package/dist/cli/commands/notifications/list.js +1 -1
  157. package/dist/cli/commands/organization/list.js +1 -1
  158. package/dist/cli/commands/search.js +1 -1
  159. package/dist/cli/commands/theme/check.js +1 -1
  160. package/dist/cli/commands/theme/console.js +1 -1
  161. package/dist/cli/commands/theme/delete.js +1 -1
  162. package/dist/cli/commands/theme/dev.js +1 -1
  163. package/dist/cli/commands/theme/duplicate.js +1 -1
  164. package/dist/cli/commands/theme/info.js +1 -1
  165. package/dist/cli/commands/theme/init.js +1 -1
  166. package/dist/cli/commands/theme/language-server.js +1 -1
  167. package/dist/cli/commands/theme/list.js +1 -1
  168. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  169. package/dist/cli/commands/theme/open.js +1 -1
  170. package/dist/cli/commands/theme/package.js +1 -1
  171. package/dist/cli/commands/theme/preview.js +1 -1
  172. package/dist/cli/commands/theme/profile.js +1 -1
  173. package/dist/cli/commands/theme/publish.js +1 -1
  174. package/dist/cli/commands/theme/pull.js +1 -1
  175. package/dist/cli/commands/theme/push.js +1 -1
  176. package/dist/cli/commands/theme/rename.js +1 -1
  177. package/dist/cli/commands/theme/share.js +1 -1
  178. package/dist/cli/commands/upgrade.js +1 -1
  179. package/dist/cli/commands/version.js +1 -1
  180. package/dist/command-registry.js +1 -1
  181. package/dist/{conf-store-U5ZITKJN.js → conf-store-BMZFATRQ.js} +1 -1
  182. package/dist/{deprecations-TU5UQJVV.js → deprecations-7LHRXPXU.js} +1 -1
  183. package/dist/dist-LDXPBYSZ.js +1 -0
  184. package/dist/dist-V63ILV6L.js +1 -0
  185. package/dist/{environments-Z5PR7DSI.js → environments-5X7S2O5U.js} +1 -1
  186. package/dist/{error-IJGNYKZ3.js → error-ZRLNNGIQ.js} +1 -1
  187. package/dist/error-handler-PRZFHPRG.js +1 -0
  188. package/dist/{fs-5BDEA2KD.js → fs-H7V6IRSH.js} +1 -1
  189. package/dist/hooks/app-init.js +1 -1
  190. package/dist/hooks/did-you-mean.js +1 -1
  191. package/dist/hooks/hydrogen-init.js +1 -1
  192. package/dist/hooks/postrun.js +1 -1
  193. package/dist/hooks/prerun.js +1 -1
  194. package/dist/hooks/public-metadata.js +1 -1
  195. package/dist/hooks/sensitive-metadata.js +1 -1
  196. package/dist/hooks/tunnel-provider.js +1 -1
  197. package/dist/hooks/tunnel-start.js +1 -1
  198. package/dist/index.js +165 -165
  199. package/dist/is-global-IOWPCT2U.js +1 -0
  200. package/dist/local-MTKXSZ3I.js +1 -0
  201. package/dist/{local-storage-JLXBZVWO.js → local-storage-CYEL4MXF.js} +1 -1
  202. package/dist/{metadata-UDMOTRS7.js → metadata-NOVBMKLM.js} +1 -1
  203. package/dist/{node-package-manager-HAFRYGUM.js → node-package-manager-N5CVNHA3.js} +1 -1
  204. package/dist/notifications-system-YX2GPLDW.js +1 -0
  205. package/dist/{output-YGMHXEIS.js → output-Q46DT46U.js} +1 -1
  206. package/dist/{system-KLXD4FXF.js → system-E6Q3OBX3.js} +1 -1
  207. package/dist/tsconfig.tsbuildinfo +1 -1
  208. package/dist/{ui-GHG3UGB3.js → ui-WRS2IDPP.js} +1 -1
  209. package/dist/upgrade-TKUN2M5P.js +1 -0
  210. package/dist/{version-D5PJZIRW.js → version-5W5RVAPA.js} +1 -1
  211. package/dist/version-BQJ3FPXD.js +1 -0
  212. package/dist/{workerd-L2EJKIAQ.js → workerd-GOK6GWEX.js} +1 -1
  213. package/oclif.manifest.json +1 -1
  214. package/package.json +7 -7
  215. package/dist/analytics-6IHHYAV6.js +0 -1
  216. package/dist/analytics-KKVP5DT3.js +0 -1
  217. package/dist/chunk-2I4PRX2I.js +0 -1
  218. package/dist/chunk-7BGM2GAH.js +0 -1
  219. package/dist/chunk-BDVAE5MS.js +0 -28
  220. package/dist/chunk-D3TSJA5S.js +0 -1
  221. package/dist/chunk-N7RBSKYT.js +0 -1
  222. package/dist/chunk-ODNGDO4H.js +0 -50
  223. package/dist/chunk-P7R7FBY2.js +0 -3
  224. package/dist/chunk-SGQ6D3LU.js +0 -15
  225. package/dist/chunk-YC6G4MHD.js +0 -3
  226. package/dist/chunk-ZVJVDCIM.js +0 -1
  227. package/dist/dist-2Z5TND4U.js +0 -1
  228. package/dist/dist-GYHFDHKP.js +0 -1
  229. package/dist/error-handler-WSCGNS2P.js +0 -1
  230. package/dist/is-global-V4ZRHQG2.js +0 -1
  231. package/dist/local-6QPX4GCJ.js +0 -1
  232. package/dist/notifications-system-MP7WDOCS.js +0 -1
  233. package/dist/upgrade-OPZGPM5J.js +0 -1
  234. package/dist/version-KRQBMYCH.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as An,b as Un}from"../../../chunk-AIV5RI3X.js";import{a as Cn}from"../../../chunk-J3KVONB3.js";import{a as kn,e as Dn,f as Tn,g as kt,h as Ln,i as In,j as On,k as Mn,l as _n,m as Rn,n as $n,o as Fn,p as Wn,u as Nn,w as qn,y as Dt}from"../../../chunk-ALKTLKQ6.js";import{c as Bn}from"../../../chunk-K5YV6UVF.js";import{a as wn,b as xn,c as bn,d as Sn,e as En}from"../../../chunk-6BMMB2UO.js";import{a as qr}from"../../../chunk-N5YIPQ6J.js";import{a as Pn}from"../../../chunk-QRRNOVJ3.js";import{a as yn}from"../../../chunk-D3TSJA5S.js";import{a as Nr}from"../../../chunk-RF2DPBA6.js";import{Ba as vn,D as rn,F as nn,H as ve,P as on,Q as ln,R as cn,V as dn,Y as un,ba as mn,ea as fn,f as Br,fa as gn,ga as hn,h as Gr,i as zr,j as jr,l as ee,m as Kr,p as Qr,q as Ut,r as Vr,s as Yr,t as Jr,u as Xr,v as Zr,va as et,w as en,wa as tt,x as tn}from"../../../chunk-SBEZBZM7.js";import{H as sn,I as an,W as pn,a as Ze,f as Te,l as Hr}from"../../../chunk-DJQVNH7P.js";import{a as br,b as Er,d as Dr,h as Rr,i as $r,j as Fr,k as Ct,l as At,m as Wr}from"../../../chunk-ZV6NCNI4.js";import{a as Qt}from"../../../chunk-AKML26N3.js";import"../../../chunk-RM5SJJN6.js";import{a as Tr,b as Lr,c as Ir}from"../../../chunk-4G7J6HIV.js";import{a as Z,b as St}from"../../../chunk-KL5Z3T6L.js";import"../../../chunk-3VZEETAV.js";import{a as Cr,b as Ar,c as bt,d as Ae,e as Ur,f as Ue,h as kr,l as ke,m as Qe,n as z,s as R,u as Ve,v as Ye,w as Je}from"../../../chunk-IX5ICOBV.js";import{a as Sr}from"../../../chunk-YMWHHINU.js";import"../../../chunk-QFWIDATO.js";import{b as xr,g as Ke,j as xt}from"../../../chunk-RFG5RMPL.js";import"../../../chunk-KBQ4LGFB.js";import{c as Or}from"../../../chunk-DJONKJSZ.js";import"../../../chunk-UWJ73J4B.js";import{a as _r,b as Et}from"../../../chunk-WFXRSKRK.js";import"../../../chunk-YOZNRLFC.js";import"../../../chunk-XEFQQPL4.js";import{a as De}from"../../../chunk-SGQ6D3LU.js";import"../../../chunk-P7R7FBY2.js";import"../../../chunk-OXPWCC7I.js";import"../../../chunk-LX3ZOW52.js";import"../../../chunk-NKQBEFPS.js";import{a as Mr}from"../../../chunk-66RJ5T7A.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-ELYP4KFP.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-XBXMPFXM.js";import"../../../chunk-R466TU3N.js";import"../../../chunk-UGXYQ23Y.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import{c as Pr,e as wr}from"../../../chunk-TQYMC7TH.js";import{c as vr}from"../../../chunk-HUZUORYM.js";import"../../../chunk-4ZGSSQC6.js";import"../../../chunk-52GC6XUT.js";import"../../../chunk-XLELNRFF.js";import{$ as ir,A as vt,N as sr,Z as ge,a as Zt,c as er,h as tr,l as rr,n as Ee,q as nr,t as or,ta as pr,u as Fe,z as re}from"../../../chunk-B2EHO7ZC.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-LAZJ47DZ.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-GOJ2QHSR.js";import{a as Ht}from"../../../chunk-7BGM2GAH.js";import"../../../chunk-XNO6DZYP.js";import{b as yr}from"../../../chunk-323UTVMM.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-4HHXSMD7.js";import"../../../chunk-YZDDTYTU.js";import"../../../chunk-MOA33ZFO.js";import{a as ht,c as Xt}from"../../../chunk-JUVAGMIH.js";import{D as He,H as dr,J as se,O as Ge,P as Ce,Q as wt,R as mr,T as fr,a as Jt,g as ar,i as yt,j as We,k as J,l as X,m as Ne,n as Pt,o as cr,p as qe,u as Be,w as ae}from"../../../chunk-BDVAE5MS.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import{a as ss}from"../../../chunk-QUTQDXSL.js";import{d as lr}from"../../../chunk-IASVAERO.js";import{d as O,g as he,l as ur}from"../../../chunk-JPGO36XP.js";import"../../../chunk-PD5ZHJWI.js";import{r as os}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import{a as Xe}from"../../../chunk-KGXQS7LS.js";import"../../../chunk-V2CNCPIE.js";import{$a as Se,Ea as jt,Gb as U,Hb as hr,Ib as T,Na as Re,Nb as ne,Q as gt,Qb as y,Rb as G,Ta as oe,Wa as $e,cb as Kt,eb as ie,fb as N,gb as A,jb as ue,kb as me,ma as W,mb as Vt,nb as Yt,ua as Me,ub as fe,wa as _e}from"../../../chunk-GFEAKSGV.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import{d as gr,f as ze,k as je}from"../../../chunk-YC6G4MHD.js";import{a as Ie}from"../../../chunk-N7RBSKYT.js";import{d as I,f as ft,g as ce,h as Gt,i as de,j as zt,k as Oe,p as be}from"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as Y,g as c}from"../../../chunk-VPRTJUIN.js";c();c();c();c();c();c();var is=300*1e3,as='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Hn(t,e,r=Date.now()){for(;await ps(t,e,r););}async function ps(t,e,r){let n=await Ke(t,e);if(!n||ls(n,r))throw new O(as);return await Ce(3),n.processing}function ls(t,e){return t.processing&&Date.now()-e>=is}var cs="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",ds="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",Tt=3,rt=class extends Sr{constructor(r,n={devPreview:!1}){super(r);this.context="App Ext. Host";this.themeId=Tr(r.storeFqdn),this.devPreview=n.devPreview}async findOrCreate(){let r=await this.fetch();return r??=this.devPreview?await this.createHostTheme():await this.create(),r}setTheme(r){Lr(this.adminSession.storeFqdn,r)}removeTheme(){Ir(this.adminSession.storeFqdn)}async createHostTheme(){let r={role:xr,name:this.generateThemeName(this.context),src:cs};for(let o=0;o<Tt;o++){y(`Attempt ${o}/${Tt}: Creating theme with name "${r.name}" and role "${r.role}"`);try{let s=await xt(r,this.adminSession);if(s)return this.setTheme(s.id.toString()),y(`Waiting for theme with id "${s.id}" to be processed`),await Hn(s.id,this.adminSession),s;throw new Error}catch{y(`Failed to create theme with name "${r.name}" and role "${r.role}". Retrying...`)}}y(`Theme creation failed after ${Tt} retries. Creating theme using fallback theme zip`);let n=await xt({...r,src:ds},this.adminSession);if(!n)throw y("Theme creation failed. Exiting process."),new he(`Could not create theme with name "${r.name}" and role "${r.role}"`);return n}};async function Gn(t){let{remoteApp:e,localApp:r}=t,o=r.allExtensions.filter(m=>m.isThemeExtension);if(o.length===0)return;let i=o[0].directory,a=t.themeExtensionPort??9293,[l,d]=await Promise.all([sr(t.storeFqdn),fs(e)]),p=l.storeFqdn,u=await br(l)?await Er("",p):void 0,f=await ms(l,t.theme),h=f.id.toString();return Be({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${p}/admin/themes/${h}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${a}`,url:`http://127.0.0.1:${a}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:us,options:{theme:f,adminSession:l,storefrontPassword:u,themeExtensionDirectory:i,themeExtensionPort:a}}}var us=async(t,{theme:e,adminSession:r,storefrontPassword:n,themeExtensionDirectory:o,themeExtensionPort:s})=>{await(await Dr(e,{adminSession:r,storefrontPassword:n,themeExtensionDirectory:o,themeExtensionPort:s})).start()};async function ms(t,e){let r;if(e)y(`Fetching theme with provided id ${e}`),r=await Ke(parseInt(e,10),t);else{let n=new rt(t,{devPreview:!0});await He([{title:"Configuring host theme for theme app extension",task:async()=>{y("Finding or creating host theme for theme app extensions"),r=await n.findOrCreate()}}])}if(!r)throw new O("Could not find or create a host theme for theme app extensions");return r}async function fs(t){return t.developerPlatformClient?.clientName==="app-management"?`https://${await Fe()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await or()}/${t.organizationId}/apps/${t.id}/test`}c();c();c();c();c();c();async function gs(t){let e=I(t.directory,"locales");return $e([I(e,"*.json")])}async function zn(t,e){let r=await gs(t);if(!r.length)return{localization:void 0,status:""};let n=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},o="success";try{await Promise.all(r.map(async s=>{let[i,...a]=s.split("/").pop().split(".");if(i)return a[0]==="default"&&(n.defaultLocale=i),hs(i,s,n,t,e)})),n.lastUpdated=Date.now(),y(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{o="error"}return{localization:n,status:o}}async function hs(t,e,r,n,o){let s;try{s=await W(e),r.translations[t]=JSON.parse(s)}catch(i){let a=`Error parsing ${t} locale for ${n.handle} at ${e}: ${i.message}`;throw G(a,o.stderr),new ur.ExtendableError(a)}}c();function nt(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}async function ye(t,e,r,n){return X({outputPrefix:t.outputPrefix},async()=>{n?.clear();let o=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:i,status:a}=await zn(t,r),l=await jr(t),d=t.outputRelativePath?de(o):o,p=await vs(t,s,d,n),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=t.configuration.metafields),{assets:{main:Le(p)&&p[0]?.assets?.main?p[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await Re(o)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:nt(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:a,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:p,localization:i??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:l?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function vs(t,e,r,n){let o=t.configuration,s=o.extension_points??o.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),Le(s)){let i=await ys(r);return Promise.all(s.map(async a=>{let{target:l,resource:d}=a,p={...a,surface:tt(l),root:{url:`${e}/${l}`},resource:d||{url:""}},u=i?.[l];if(!u)return p;let h=await Ss(u,{target:l,extensionPoint:a,url:e,extension:t,buildDirectory:r,resolver:n});return{...p,...h}}))}return s}async function ys(t){try{let e=I(t,"manifest.json"),r=await W(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function Ps({target:t,extensionPoint:e,url:r,extension:n,resolver:o},s,i){let a=`${t}/${s}`,l=e[s];if(typeof l=="string"){let h=await ot(s,a,typeof i=="string"?i:l,r,n,o,typeof i=="string"?l:void 0);return{assets:{[h.name]:h}}}let p=e.build_manifest?.assets?.[s];if(p?.filepath){let u=await ot(s,a,p.filepath,r,n,o,p.module);return{assets:{[u.name]:u}}}return{}}async function ws({target:t,url:e,buildDirectory:r,resolver:n},o,s){if(s.length===0)return{};for(let a of s)n?.set(`${t}/${a}`,a);let i=await Promise.all(s.map(async a=>await Re(I(r,a))??0));return{assets:{[o]:{name:o,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...i)}}}}async function xs({target:t,extensionPoint:e,url:r,extension:n,resolver:o},s){return e.intents?{intents:await Promise.all(e.intents.map(async(a,l)=>{let d=a.schema,p=s[l]?.schema,u=typeof p=="string"?p:d,f=typeof p=="string"?d:void 0;return{...a,schema:await ot("schema",`${t}/intents/${l}/schema`,u,r,n,o,f)}}))}:{}}async function bs({target:t,url:e,extension:r,resolver:n},o,s){let i=await ot(o,`${t}/${o}`,s,e,r,n);return{assets:{[i.name]:i}}}async function Ss(t,e){return(await Promise.all(Object.keys(t).map(async n=>{let o=t[n];return Es(n,o)?xs(e,o):Cs(n,o)?bs(e,n,o):As(n,o)?ws(e,n,o):Ps(e,n,o)}))).reduce((n,o)=>({...n,...o,assets:{...n.assets,...o.assets}}),{})}function Le(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function ot(t,e,r,n,o,s,i){let a=`${e}${Oe(r)}`;return s?.set(a,r),{name:t,url:`${n}/assets/${a}`,lastUpdated:await Re(I(o.directory,i??r))??0}}function Es(t,e){return t==="intents"&&Array.isArray(e)}function Cs(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function As(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}c();function st(t,e){let r=re(t);return`https://${vt(r)}/admin/oauth/redirect_from_cli?client_id=${e}`}function jn(t,e,r){let o=re(t).split(".")[0];return`https://${r}/store/${o}/apps/${e}?dev-console=show`}function Lt(t){return`https://${re(t)}/admin?dev-console=show`}function Kn(t,e){let r=re(t),o=`${vt(r)}/admin/apps/${e}`,s=Buffer.from(o).toString("base64").replace(/[=]/g,"");return`https://${o}?shop=${r}&host=${s}`}import{EventEmitter as Us}from"events";async function Qn(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:st(t.storeFqdn,t.apiKey),mobileUrl:Kn(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(o=>o.isPreviewable).map(o=>ye(o,e,t,r&&It(r,o.devUUID))))}}function It(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var it=class extends Us{constructor(e,r,n=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=n}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=ge(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(n=>{let o=e.find(s=>s.uuid===n.uuid);if(o){if(Le(o.extensionPoints)&&Le(n.extensionPoints)){let s=o.extensionPoints.reduce((l,d)=>({...l,[d.target]:d}),{});n.extensionPoints=ge(n.extensionPoints,o.extensionPoints,l=>l.map(d=>{let p=s[d.target];return p?ge(d,p,(u,f)=>f):d}));let{extensionPoints:i,...a}=o;return ge(n,a)}return ge(n,o)}return n});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(n=>n.uuid))}async updateExtension(e,r,n,o){let s=this.rawPayload.extensions,i=s.findIndex(a=>a.uuid===e.devUUID);if(i===-1){y(T`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[i]=await ye(e,n,{...this.options,currentDevelopmentPayload:o??{status:s[i]?.development.status},currentLocalizationPayload:s[i]?.localization},It(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(n=>n.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await ye(e,r,this.options,It(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit("PayloadUpdatedEvent:UPDATE",e)}};c();c();function Vn(t,e){return(r,n,o)=>{r.url==="/extensions"&&(y("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,n,o,ks(t,e)))}}function ks(t,e){return r=>{y("Websocket connection successfully established",e.stdout);let n={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};y(T`Sending connected payload: ${U.json(n)}`,e.stdout),r.send(JSON.stringify(n)),r.on("message",Os(t,e))}}function Ds(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(n=>typeof n=="object"&&n!==null?U.json(n).output():String(n)).join(" ");return T`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var Ts={debug:t=>U.gray(t),warn:t=>U.yellow(t),error:t=>U.errorText(t)};function Ls({type:t,message:e}){let r=Ds(e);switch(t){case"debug":case"warn":case"error":return T`${Ts[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function Is(t,e){X({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(Ls(t))})}function Os(t,e){return r=>{let n=JSON.parse(r.toString()),{event:o,data:s}=n;if(y(T`Received websocket message with event type ${o} and data:
1
+ import{a as An,b as Un}from"../../../chunk-FKMC5OFF.js";import{a as Cn}from"../../../chunk-HIBX234C.js";import{a as kn,e as Dn,f as Tn,g as kt,h as Ln,i as In,j as On,k as Mn,l as _n,m as Rn,n as $n,o as Fn,p as Wn,u as Nn,w as qn,y as Dt}from"../../../chunk-IZ3C5J7G.js";import{c as Bn}from"../../../chunk-C2IK2HY3.js";import{a as wn,b as xn,c as bn,d as Sn,e as En}from"../../../chunk-OTY24J2W.js";import{a as qr}from"../../../chunk-ZBRRJDGW.js";import{a as Pn}from"../../../chunk-TQ6HYDVC.js";import{a as yn}from"../../../chunk-JCL2RRU6.js";import{a as Nr}from"../../../chunk-AGNMOFJS.js";import{Ba as vn,D as rn,F as nn,H as ve,P as on,Q as ln,R as cn,V as dn,Y as un,ba as mn,ea as fn,f as Br,fa as gn,ga as hn,h as Gr,i as zr,j as jr,l as ee,m as Kr,p as Qr,q as Ut,r as Vr,s as Yr,t as Jr,u as Xr,v as Zr,va as et,w as en,wa as tt,x as tn}from"../../../chunk-54CAKCYR.js";import{H as sn,I as an,W as pn,a as Ze,f as Te,l as Hr}from"../../../chunk-7ESSIN27.js";import{a as br,b as Er,d as Dr,h as Rr,i as $r,j as Fr,k as Ct,l as At,m as Wr}from"../../../chunk-HUIJMGVJ.js";import{a as Qt}from"../../../chunk-AKML26N3.js";import"../../../chunk-URZPVSJZ.js";import{a as Tr,b as Lr,c as Ir}from"../../../chunk-EQU4MUQJ.js";import{a as Z,b as St}from"../../../chunk-6SF3ZETE.js";import"../../../chunk-3VZEETAV.js";import{a as Cr,b as Ar,c as bt,d as Ae,e as Ur,f as Ue,h as kr,l as ke,m as Qe,n as z,s as R,u as Ve,v as Ye,w as Je}from"../../../chunk-IX5ICOBV.js";import{a as Sr}from"../../../chunk-SXTMSGUE.js";import"../../../chunk-QFWIDATO.js";import{b as xr,g as Ke,j as xt}from"../../../chunk-CBXSPL4W.js";import"../../../chunk-UJVH7FZS.js";import{c as Or}from"../../../chunk-E3EMHAJB.js";import"../../../chunk-UWJ73J4B.js";import{a as _r,b as Et}from"../../../chunk-WFXRSKRK.js";import"../../../chunk-YOZNRLFC.js";import"../../../chunk-XEFQQPL4.js";import{a as De}from"../../../chunk-6WL4GA2M.js";import"../../../chunk-TYZXGSHO.js";import"../../../chunk-ULFWK45W.js";import"../../../chunk-KHTV6PBV.js";import"../../../chunk-NKQBEFPS.js";import{a as Mr}from"../../../chunk-GZS44BUW.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-7QIOUDCX.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-DCPBRWVC.js";import"../../../chunk-KR6QDE7D.js";import"../../../chunk-UXVZ2P63.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import{c as Pr,e as wr}from"../../../chunk-EKXY5COY.js";import{c as vr}from"../../../chunk-4DCQNGUV.js";import"../../../chunk-4ZGSSQC6.js";import"../../../chunk-QBSKKQBN.js";import"../../../chunk-FQWB2F75.js";import{$ as ir,A as vt,N as sr,Z as ge,a as Zt,c as er,h as tr,l as rr,n as Ee,q as nr,t as or,ta as pr,u as Fe,z as re}from"../../../chunk-XONFGLJQ.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-L2MGAEV3.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-ZSBA6VIC.js";import{a as Ht}from"../../../chunk-F2QU6WWX.js";import"../../../chunk-XULPJ6UG.js";import{b as yr}from"../../../chunk-XR6GMMEU.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-MHWV5RQV.js";import"../../../chunk-XOTA6JTZ.js";import"../../../chunk-MOA33ZFO.js";import{a as ht,c as Xt}from"../../../chunk-JUVAGMIH.js";import{D as He,H as dr,J as se,O as Ge,P as Ce,Q as wt,R as mr,T as fr,a as Jt,g as ar,i as yt,j as We,k as J,l as X,m as Ne,n as Pt,o as cr,p as qe,u as Be,w as ae}from"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import{a as ss}from"../../../chunk-QUTQDXSL.js";import{d as lr}from"../../../chunk-WSDN25F5.js";import{d as O,g as he,l as ur}from"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import{r as os}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import{a as Xe}from"../../../chunk-S6EJHWJL.js";import"../../../chunk-OBEWZXOQ.js";import{$a as Se,Ea as jt,Gb as U,Hb as hr,Ib as T,Na as Re,Nb as ne,Q as gt,Qb as y,Rb as G,Ta as oe,Wa as $e,cb as Kt,eb as ie,fb as N,gb as A,jb as ue,kb as me,ma as W,mb as Vt,nb as Yt,ua as Me,ub as fe,wa as _e}from"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import{d as gr,f as ze,j as je}from"../../../chunk-YTNDFQJT.js";import{a as Ie}from"../../../chunk-ULQG3XQS.js";import{d as I,f as ft,g as ce,h as Gt,i as de,j as zt,k as Oe,p as be}from"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as Y,g as c}from"../../../chunk-VPRTJUIN.js";c();c();c();c();c();c();var is=300*1e3,as='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Hn(t,e,r=Date.now()){for(;await ps(t,e,r););}async function ps(t,e,r){let n=await Ke(t,e);if(!n||ls(n,r))throw new O(as);return await Ce(3),n.processing}function ls(t,e){return t.processing&&Date.now()-e>=is}var cs="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",ds="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",Tt=3,rt=class extends Sr{constructor(r,n={devPreview:!1}){super(r);this.context="App Ext. Host";this.themeId=Tr(r.storeFqdn),this.devPreview=n.devPreview}async findOrCreate(){let r=await this.fetch();return r??=this.devPreview?await this.createHostTheme():await this.create(),r}setTheme(r){Lr(this.adminSession.storeFqdn,r)}removeTheme(){Ir(this.adminSession.storeFqdn)}async createHostTheme(){let r={role:xr,name:this.generateThemeName(this.context),src:cs};for(let o=0;o<Tt;o++){y(`Attempt ${o}/${Tt}: Creating theme with name "${r.name}" and role "${r.role}"`);try{let s=await xt(r,this.adminSession);if(s)return this.setTheme(s.id.toString()),y(`Waiting for theme with id "${s.id}" to be processed`),await Hn(s.id,this.adminSession),s;throw new Error}catch{y(`Failed to create theme with name "${r.name}" and role "${r.role}". Retrying...`)}}y(`Theme creation failed after ${Tt} retries. Creating theme using fallback theme zip`);let n=await xt({...r,src:ds},this.adminSession);if(!n)throw y("Theme creation failed. Exiting process."),new he(`Could not create theme with name "${r.name}" and role "${r.role}"`);return n}};async function Gn(t){let{remoteApp:e,localApp:r}=t,o=r.allExtensions.filter(m=>m.isThemeExtension);if(o.length===0)return;let i=o[0].directory,a=t.themeExtensionPort??9293,[l,d]=await Promise.all([sr(t.storeFqdn),fs(e)]),p=l.storeFqdn,u=await br(l)?await Er("",p):void 0,f=await ms(l,t.theme),h=f.id.toString();return Be({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${p}/admin/themes/${h}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${a}`,url:`http://127.0.0.1:${a}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:us,options:{theme:f,adminSession:l,storefrontPassword:u,themeExtensionDirectory:i,themeExtensionPort:a}}}var us=async(t,{theme:e,adminSession:r,storefrontPassword:n,themeExtensionDirectory:o,themeExtensionPort:s})=>{await(await Dr(e,{adminSession:r,storefrontPassword:n,themeExtensionDirectory:o,themeExtensionPort:s})).start()};async function ms(t,e){let r;if(e)y(`Fetching theme with provided id ${e}`),r=await Ke(parseInt(e,10),t);else{let n=new rt(t,{devPreview:!0});await He([{title:"Configuring host theme for theme app extension",task:async()=>{y("Finding or creating host theme for theme app extensions"),r=await n.findOrCreate()}}])}if(!r)throw new O("Could not find or create a host theme for theme app extensions");return r}async function fs(t){return t.developerPlatformClient?.clientName==="app-management"?`https://${await Fe()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await or()}/${t.organizationId}/apps/${t.id}/test`}c();c();c();c();c();c();async function gs(t){let e=I(t.directory,"locales");return $e([I(e,"*.json")])}async function zn(t,e){let r=await gs(t);if(!r.length)return{localization:void 0,status:""};let n=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},o="success";try{await Promise.all(r.map(async s=>{let[i,...a]=s.split("/").pop().split(".");if(i)return a[0]==="default"&&(n.defaultLocale=i),hs(i,s,n,t,e)})),n.lastUpdated=Date.now(),y(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{o="error"}return{localization:n,status:o}}async function hs(t,e,r,n,o){let s;try{s=await W(e),r.translations[t]=JSON.parse(s)}catch(i){let a=`Error parsing ${t} locale for ${n.handle} at ${e}: ${i.message}`;throw G(a,o.stderr),new ur.ExtendableError(a)}}c();function nt(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}async function ye(t,e,r,n){return X({outputPrefix:t.outputPrefix},async()=>{n?.clear();let o=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:i,status:a}=await zn(t,r),l=await jr(t),d=t.outputRelativePath?de(o):o,p=await vs(t,s,d,n),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=t.configuration.metafields),{assets:{main:Le(p)&&p[0]?.assets?.main?p[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await Re(o)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:nt(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:a,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:p,localization:i??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:l?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function vs(t,e,r,n){let o=t.configuration,s=o.extension_points??o.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),Le(s)){let i=await ys(r);return Promise.all(s.map(async a=>{let{target:l,resource:d}=a,p={...a,surface:tt(l),root:{url:`${e}/${l}`},resource:d||{url:""}},u=i?.[l];if(!u)return p;let h=await Ss(u,{target:l,extensionPoint:a,url:e,extension:t,buildDirectory:r,resolver:n});return{...p,...h}}))}return s}async function ys(t){try{let e=I(t,"manifest.json"),r=await W(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function Ps({target:t,extensionPoint:e,url:r,extension:n,resolver:o},s,i){let a=`${t}/${s}`,l=e[s];if(typeof l=="string"){let h=await ot(s,a,typeof i=="string"?i:l,r,n,o,typeof i=="string"?l:void 0);return{assets:{[h.name]:h}}}let p=e.build_manifest?.assets?.[s];if(p?.filepath){let u=await ot(s,a,p.filepath,r,n,o,p.module);return{assets:{[u.name]:u}}}return{}}async function ws({target:t,url:e,buildDirectory:r,resolver:n},o,s){if(s.length===0)return{};for(let a of s)n?.set(`${t}/${a}`,a);let i=await Promise.all(s.map(async a=>await Re(I(r,a))??0));return{assets:{[o]:{name:o,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...i)}}}}async function xs({target:t,extensionPoint:e,url:r,extension:n,resolver:o},s){return e.intents?{intents:await Promise.all(e.intents.map(async(a,l)=>{let d=a.schema,p=s[l]?.schema,u=typeof p=="string"?p:d,f=typeof p=="string"?d:void 0;return{...a,schema:await ot("schema",`${t}/intents/${l}/schema`,u,r,n,o,f)}}))}:{}}async function bs({target:t,url:e,extension:r,resolver:n},o,s){let i=await ot(o,`${t}/${o}`,s,e,r,n);return{assets:{[i.name]:i}}}async function Ss(t,e){return(await Promise.all(Object.keys(t).map(async n=>{let o=t[n];return Es(n,o)?xs(e,o):Cs(n,o)?bs(e,n,o):As(n,o)?ws(e,n,o):Ps(e,n,o)}))).reduce((n,o)=>({...n,...o,assets:{...n.assets,...o.assets}}),{})}function Le(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function ot(t,e,r,n,o,s,i){let a=`${e}${Oe(r)}`;return s?.set(a,r),{name:t,url:`${n}/assets/${a}`,lastUpdated:await Re(I(o.directory,i??r))??0}}function Es(t,e){return t==="intents"&&Array.isArray(e)}function Cs(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function As(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}c();function st(t,e){let r=re(t);return`https://${vt(r)}/admin/oauth/redirect_from_cli?client_id=${e}`}function jn(t,e,r){let o=re(t).split(".")[0];return`https://${r}/store/${o}/apps/${e}?dev-console=show`}function Lt(t){return`https://${re(t)}/admin?dev-console=show`}function Kn(t,e){let r=re(t),o=`${vt(r)}/admin/apps/${e}`,s=Buffer.from(o).toString("base64").replace(/[=]/g,"");return`https://${o}?shop=${r}&host=${s}`}import{EventEmitter as Us}from"events";async function Qn(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:st(t.storeFqdn,t.apiKey),mobileUrl:Kn(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(o=>o.isPreviewable).map(o=>ye(o,e,t,r&&It(r,o.devUUID))))}}function It(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var it=class extends Us{constructor(e,r,n=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=n}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=ge(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(n=>{let o=e.find(s=>s.uuid===n.uuid);if(o){if(Le(o.extensionPoints)&&Le(n.extensionPoints)){let s=o.extensionPoints.reduce((l,d)=>({...l,[d.target]:d}),{});n.extensionPoints=ge(n.extensionPoints,o.extensionPoints,l=>l.map(d=>{let p=s[d.target];return p?ge(d,p,(u,f)=>f):d}));let{extensionPoints:i,...a}=o;return ge(n,a)}return ge(n,o)}return n});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(n=>n.uuid))}async updateExtension(e,r,n,o){let s=this.rawPayload.extensions,i=s.findIndex(a=>a.uuid===e.devUUID);if(i===-1){y(T`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[i]=await ye(e,n,{...this.options,currentDevelopmentPayload:o??{status:s[i]?.development.status},currentLocalizationPayload:s[i]?.localization},It(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(n=>n.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await ye(e,r,this.options,It(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit("PayloadUpdatedEvent:UPDATE",e)}};c();c();function Vn(t,e){return(r,n,o)=>{r.url==="/extensions"&&(y("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,n,o,ks(t,e)))}}function ks(t,e){return r=>{y("Websocket connection successfully established",e.stdout);let n={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};y(T`Sending connected payload: ${U.json(n)}`,e.stdout),r.send(JSON.stringify(n)),r.on("message",Os(t,e))}}function Ds(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(n=>typeof n=="object"&&n!==null?U.json(n).output():String(n)).join(" ");return T`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var Ts={debug:t=>U.gray(t),warn:t=>U.yellow(t),error:t=>U.errorText(t)};function Ls({type:t,message:e}){let r=Ds(e);switch(t){case"debug":case"warn":case"error":return T`${Ts[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function Is(t,e){X({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(Ls(t))})}function Os(t,e){return r=>{let n=JSON.parse(r.toString()),{event:o,data:s}=n;if(y(T`Received websocket message with event type ${o} and data:
2
2
  ${U.json(s)}
3
3
  `,e.stdout),o==="update"){let i=e.payloadStore.getRawPayload().app.apiKey,a=s.app?.apiKey;if(s.app){if(i!==a)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(o==="dispatch"){let i=Ms(n,e);Jn(t,i,e)}else o==="log"&&Is(s,e)}}function Yn(t,e){return r=>{let n={event:"update",version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};y(T`Sending websocket update event to the websocket clients:
4
4
  ${U.json(n)}
@@ -1,4 +1,4 @@
1
- import{a as F}from"../../../../chunk-D3TSJA5S.js";import{a as C}from"../../../../chunk-RF2DPBA6.js";import{Ba as A,G as w,da as P,h as O}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import{a as E}from"../../../../chunk-WDC3KIZT.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import{b as l}from"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as v}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import{r as L}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import{Gb as a,Ib as s,Mb as h,Ta as g,ma as u,ua as m}from"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import{d as c}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as I,g as p}from"../../../../chunk-VPRTJUIN.js";p();p();async function k({app:d,remoteApp:t,organization:n,envFile:e}){await P(t,n.source);let o={SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:O(d.configuration)};if(await g(e)){let i=await u(e),r=l(i,o);if(r===i)return s`No changes to ${a.path(e)}`;{await m(e,r);let y=E(i??"",r);return s`Updated ${a.path(e)} to be:
1
+ import{a as F}from"../../../../chunk-JCL2RRU6.js";import{a as C}from"../../../../chunk-AGNMOFJS.js";import{Ba as A,G as w,da as P,h as O}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import{a as E}from"../../../../chunk-WDC3KIZT.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import{b as l}from"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as v}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import{r as L}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import{Gb as a,Ib as s,Mb as h,Ta as g,ma as u,ua as m}from"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import{d as c}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as I,g as p}from"../../../../chunk-VPRTJUIN.js";p();p();async function k({app:d,remoteApp:t,organization:n,envFile:e}){await P(t,n.source);let o={SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:O(d.configuration)};if(await g(e)){let i=await u(e),r=l(i,o);if(r===i)return s`No changes to ${a.path(e)}`;{await m(e,r);let y=E(i??"",r);return s`Updated ${a.path(e)} to be:
2
2
 
3
3
  ${r}
4
4
 
@@ -1 +1 @@
1
- import{a as m}from"../../../../chunk-LALIKZPS.js";import{a as r}from"../../../../chunk-D3TSJA5S.js";import{a as p}from"../../../../chunk-RF2DPBA6.js";import{Ba as s}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as n}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import{Mb as e}from"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as o}from"../../../../chunk-VPRTJUIN.js";o();var i=class d extends r{static{this.summary="Display app and extensions environment variables."}static{this.descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...n,...p}}async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await s({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as default};
1
+ import{a as m}from"../../../../chunk-PYVAWAUO.js";import{a as r}from"../../../../chunk-JCL2RRU6.js";import{a as p}from"../../../../chunk-AGNMOFJS.js";import{Ba as s}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as n}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import{Mb as e}from"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as o}from"../../../../chunk-VPRTJUIN.js";o();var i=class d extends r{static{this.summary="Display app and extensions environment variables."}static{this.descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...n,...p}}async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await s({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as default};
@@ -1 +1 @@
1
- import{a as E,b as z,c as C,f as F,h as J}from"../../../chunk-LXFJDCNG.js";import"../../../chunk-QRRNOVJ3.js";import{a as x}from"../../../chunk-D3TSJA5S.js";import{a as k,c as b}from"../../../chunk-RF2DPBA6.js";import"../../../chunk-SBEZBZM7.js";import"../../../chunk-DJQVNH7P.js";import"../../../chunk-66RJ5T7A.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-ELYP4KFP.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-XBXMPFXM.js";import"../../../chunk-R466TU3N.js";import"../../../chunk-UGXYQ23Y.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import{b as A}from"../../../chunk-TQYMC7TH.js";import"../../../chunk-HUZUORYM.js";import"../../../chunk-52GC6XUT.js";import"../../../chunk-XLELNRFF.js";import{g as G,h as v}from"../../../chunk-B2EHO7ZC.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-LAZJ47DZ.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-GOJ2QHSR.js";import"../../../chunk-7BGM2GAH.js";import"../../../chunk-XNO6DZYP.js";import{b as S}from"../../../chunk-323UTVMM.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-4HHXSMD7.js";import"../../../chunk-YZDDTYTU.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{E as m,v as c,x as O}from"../../../chunk-BDVAE5MS.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-IASVAERO.js";import{d as u}from"../../../chunk-JPGO36XP.js";import"../../../chunk-PD5ZHJWI.js";import"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-V2CNCPIE.js";import{Gb as l,Ib as a,Mb as y,Ta as w,ma as g,ua as h}from"../../../chunk-GFEAKSGV.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YC6G4MHD.js";import"../../../chunk-N7RBSKYT.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as V,g as p}from"../../../chunk-VPRTJUIN.js";p();p();var N=V(G(),1);async function Q(i,e){if(i)try{return JSON.parse(i)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new u(a`Invalid JSON in ${l.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await w(e))throw new u(a`Variable file not found at ${l.path(e)}. Please check the path and try again.`);let t=await g(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let s=r instanceof Error?r.message:"Unknown error";throw new u(a`Invalid JSON in variable file ${l.path(e)}: ${s}`,"Please provide valid JSON format.")}}}async function P(i){let{remoteApp:e,store:t,query:r,variables:s,variableFile:q,version:L,outputFile:d}=i,{adminSession:M,version:$}=await m({title:a`Authenticating`,task:async()=>{let o=await E(e,t.shopDomain),n=await C({adminSession:o,userSpecifiedVersion:L});return{adminSession:o,version:n}},renderOptions:{stdout:process.stderr}}),I=await Q(s,q);z(r),F(r,t);try{let o=await m({title:a`Executing GraphQL operation`,task:async()=>A({query:(0,N.parse)(r),session:M,variables:I,version:$,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),n=JSON.stringify(o,null,2);d?(await h(d,n),c({headline:"Operation succeeded.",body:`Results written to ${d}`})):(c({headline:"Operation succeeded."}),y(n))}catch(o){if(o instanceof v){let n={errors:o.response.errors},R=JSON.stringify(n,null,2);O({headline:"GraphQL operation failed.",body:R});return}throw o}}var f=class i extends x{static{this.summary="Execute GraphQL queries and mutations."}static{this.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{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...S,...k,...b}}async run(){let{flags:e}=await this.parse(i),{query:t,appContextResult:r,store:s}=await J(e);return await P({organization:r.organization,remoteApp:r.remoteApp,store:s,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{f as default};
1
+ import{a as E,b as z,c as C,f as F,h as J}from"../../../chunk-M3RYUB22.js";import"../../../chunk-TQ6HYDVC.js";import{a as x}from"../../../chunk-JCL2RRU6.js";import{a as k,c as b}from"../../../chunk-AGNMOFJS.js";import"../../../chunk-54CAKCYR.js";import"../../../chunk-7ESSIN27.js";import"../../../chunk-GZS44BUW.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-7QIOUDCX.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-DCPBRWVC.js";import"../../../chunk-KR6QDE7D.js";import"../../../chunk-UXVZ2P63.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import{b as A}from"../../../chunk-EKXY5COY.js";import"../../../chunk-4DCQNGUV.js";import"../../../chunk-QBSKKQBN.js";import"../../../chunk-FQWB2F75.js";import{g as G,h as v}from"../../../chunk-XONFGLJQ.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-L2MGAEV3.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-ZSBA6VIC.js";import"../../../chunk-F2QU6WWX.js";import"../../../chunk-XULPJ6UG.js";import{b as S}from"../../../chunk-XR6GMMEU.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-MHWV5RQV.js";import"../../../chunk-XOTA6JTZ.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{E as m,v as c,x as O}from"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-WSDN25F5.js";import{d as u}from"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-OBEWZXOQ.js";import{Gb as l,Ib as a,Mb as y,Ta as w,ma as g,ua as h}from"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YTNDFQJT.js";import"../../../chunk-ULQG3XQS.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as V,g as p}from"../../../chunk-VPRTJUIN.js";p();p();var N=V(G(),1);async function Q(i,e){if(i)try{return JSON.parse(i)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new u(a`Invalid JSON in ${l.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await w(e))throw new u(a`Variable file not found at ${l.path(e)}. Please check the path and try again.`);let t=await g(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let s=r instanceof Error?r.message:"Unknown error";throw new u(a`Invalid JSON in variable file ${l.path(e)}: ${s}`,"Please provide valid JSON format.")}}}async function P(i){let{remoteApp:e,store:t,query:r,variables:s,variableFile:q,version:L,outputFile:d}=i,{adminSession:M,version:$}=await m({title:a`Authenticating`,task:async()=>{let o=await E(e,t.shopDomain),n=await C({adminSession:o,userSpecifiedVersion:L});return{adminSession:o,version:n}},renderOptions:{stdout:process.stderr}}),I=await Q(s,q);z(r),F(r,t);try{let o=await m({title:a`Executing GraphQL operation`,task:async()=>A({query:(0,N.parse)(r),session:M,variables:I,version:$,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),n=JSON.stringify(o,null,2);d?(await h(d,n),c({headline:"Operation succeeded.",body:`Results written to ${d}`})):(c({headline:"Operation succeeded."}),y(n))}catch(o){if(o instanceof v){let n={errors:o.response.errors},R=JSON.stringify(n,null,2);O({headline:"GraphQL operation failed.",body:R});return}throw o}}var f=class i extends x{static{this.summary="Execute GraphQL queries and mutations."}static{this.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{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...S,...k,...b}}async run(){let{flags:e}=await this.parse(i),{query:t,appContextResult:r,store:s}=await J(e);return await P({organization:r.organization,remoteApp:r.remoteApp,store:s,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{f as default};
@@ -1 +1 @@
1
- import{b as m,c as u}from"../../../../chunk-IIIVWD4R.js";import{a as c}from"../../../../chunk-ZVJVDCIM.js";import{a as e}from"../../../../chunk-RF2DPBA6.js";import{Ca as p,o as a}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as n}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{v as r}from"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as i}from"../../../../chunk-VPRTJUIN.js";i();var s=class d extends c{static{this.summary="Compile a function to wasm."}static{this.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...n,...e,...m}}async run(){let{flags:t}=await this.parse(d),{app:o}=await p({directory:t.path,userProvidedConfigName:t.config}),l=await u(o,t.path);return await a(l,{app:o,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),r({headline:"Function built successfully."}),{app:o}}};export{s as default};
1
+ import{b as m,c as u}from"../../../../chunk-UHJYPEY2.js";import{a as c}from"../../../../chunk-G4BPGWJC.js";import{a as e}from"../../../../chunk-AGNMOFJS.js";import{Ca as p,o as a}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as n}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{v as r}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as i}from"../../../../chunk-VPRTJUIN.js";i();var s=class d extends c{static{this.summary="Compile a function to wasm."}static{this.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...n,...e,...m}}async run(){let{flags:t}=await this.parse(d),{app:o}=await p({directory:t.path,userProvidedConfigName:t.config}),l=await u(o,t.path);return await a(l,{app:o,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),r({headline:"Function built successfully."}),{app:o}}};export{s as default};
@@ -1,4 +1,4 @@
1
- import{b as A,c as S,d as I}from"../../../../chunk-IIIVWD4R.js";import{a as b}from"../../../../chunk-ZVJVDCIM.js";import{a as y}from"../../../../chunk-RF2DPBA6.js";import{Ca as C,a as P,b as x}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as h,c as d}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{u as f}from"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import{Gb as l,Ib as m,Mb as g}from"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import{d as p}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as s}from"../../../../chunk-VPRTJUIN.js";s();s();function k(n,t){let r={};return n.targeting?.forEach(i=>{i.target&&(r[i.target]={...i.input_query&&{inputQueryPath:`${t}/${i.input_query}`},...i.export&&{export:i.export}})}),r}function F(n,t,r,i,e,o){return JSON.stringify({handle:t.handle,name:n.name,apiVersion:t.api_version,targeting:r,schemaPath:o,wasmPath:e,functionRunnerPath:i},null,2)}function N(n,t){return{title:`CONFIGURATION
1
+ import{b as A,c as S,d as I}from"../../../../chunk-UHJYPEY2.js";import{a as b}from"../../../../chunk-G4BPGWJC.js";import{a as y}from"../../../../chunk-AGNMOFJS.js";import{Ca as C,a as P,b as x}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as h,c as d}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{u as f}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import{Gb as l,Ib as m,Mb as g}from"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import{d as p}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as s}from"../../../../chunk-VPRTJUIN.js";s();s();function k(n,t){let r={};return n.targeting?.forEach(i=>{i.target&&(r[i.target]={...i.input_query&&{inputQueryPath:`${t}/${i.input_query}`},...i.export&&{export:i.export}})}),r}function F(n,t,r,i,e,o){return JSON.stringify({handle:t.handle,name:n.name,apiVersion:t.api_version,targeting:r,schemaPath:o,wasmPath:e,functionRunnerPath:i},null,2)}function N(n,t){return{title:`CONFIGURATION
2
2
  `,body:{tabularData:[["Handle",n.handle??"N/A"],["Name",t??"N/A"],["API Version",n.api_version??"N/A"]],firstColumnSubdued:!0}}}function O(n){if(Object.keys(n).length===0)return null;let t=[];return Object.entries(n).forEach(([r,i])=>{t.push([m`${l.cyan(r)}`.value,""]),i.inputQueryPath&&t.push([{subdued:" Input Query Path"},{filePath:i.inputQueryPath}]),i.export&&t.push([{subdued:" Export"},i.export])}),{title:`
3
3
  TARGETING
4
4
  `,body:{tabularData:t}}}function R(n,t){return{title:`
@@ -1,4 +1,4 @@
1
- import{a as S}from"../../../../chunk-YI232QLS.js";import{b as nn,c as tn}from"../../../../chunk-IIIVWD4R.js";import{a as Z}from"../../../../chunk-J3KVONB3.js";import{z as O}from"../../../../chunk-ALKTLKQ6.js";import{a as X}from"../../../../chunk-D3TSJA5S.js";import{a as V}from"../../../../chunk-RF2DPBA6.js";import{Ba as Q}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-UWJ73J4B.js";import"../../../../chunk-WFXRSKRK.js";import"../../../../chunk-YOZNRLFC.js";import"../../../../chunk-XEFQQPL4.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-4ZGSSQC6.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as z,c as Y}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{B as U,a as C,i as J,j as K,k as b,p as T}from"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import{d as B}from"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import{r as yn}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import{a as G}from"../../../../chunk-V2CNCPIE.js";import{eb as P,fb as c,gb as u,ib as $,jb as j,kb as H,ma as E}from"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import{f as q}from"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import{d as A}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as R,g as a}from"../../../../chunk-VPRTJUIN.js";a();a();a();a();a();var y=R(P(),1);import{Writable as on}from"stream";function en({selectedRun:n,abortController:t,app:r,extension:e,appWatcher:i}){let s={type:"functionRun",input:n.payload.input,output:n.payload.output,logs:n.payload.logs,name:n.source,size:0,memory_usage:0,instructions:n.payload.fuelConsumed},[p,f]=(0,y.useState)([]),[m,l]=(0,y.useState)([s,s]),[h,g]=(0,y.useState)(void 0),{input:F,export:M}=n.payload,[mn,L]=(0,y.useState)(`Watching for changes to ${n.source}...`);return(0,y.useEffect)(()=>{let I=new C;t.signal.addEventListener("abort",()=>{I.abort()});let _=async()=>{let x=await hn(e,JSON.stringify(F),M);l(d=>[x,d[0]]),L(`Watching for changes to ${n.source}...`),f(d=>[...d,x])},fn=async()=>{L("Replaying log with local function..."),await _()},gn=async()=>{i.onEvent(async d=>{let w=d.extensionEvents.find(k=>k.extension.handle===e.handle);if(!(!w||w.type!=="changed")){if(w.buildResult?.status==="error"){g(`Error while reloading and building extension: ${w.buildResult?.error}`);return}g(void 0),L("Re-running with latest changes..."),await _()}});let x=new on({write(d,w,k){f(dn=>[...dn,{type:"systemMessage",message:d.toString()}]),k()}});await i.start({stdout:x,stderr:x,signal:I.signal},!1)};return fn().then(()=>{gn()}),()=>{I.abort()}},[F,M,r,e]),T(t.signal,async()=>{setTimeout(()=>{q()||G(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:p,statusMessage:mn,recentFunctionRuns:m,error:h}}async function hn(n,t,r){let e="",i=new on({write(p,f,m){e+=p,m()}});return await S({functionExtension:n,input:t,export:r,stdout:i,json:!0}),{...JSON.parse(e),type:"functionRun"}}var o=R(P(),1);var rn=({selectedRun:n,abortController:t,app:r,extension:e})=>{let{isAborted:i}=T(t.signal),{isRawModeSupported:s}=j(),p=new Z(r),{logs:f,statusMessage:m,recentFunctionRuns:l,error:h}=en({selectedRun:n,abortController:t,app:r,extension:e,appWatcher:p});return H((g,F)=>{K(g,F,()=>t.abort()),g==="q"&&t.abort()},{isActive:!!s}),o.default.createElement(o.default.Fragment,null,o.default.createElement($,{items:f},(g,F)=>o.default.createElement(c,{key:`replayOutputScrollerLog${F}`,flexDirection:"column"},o.default.createElement(Cn,{log:g}))),i?null:o.default.createElement(c,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},s?o.default.createElement(c,{flexDirection:"column"},o.default.createElement(c,{flexDirection:"row"},o.default.createElement(u,null,b.pointerSmall," ",m)),o.default.createElement(Rn,{recentFunctionRuns:l}),o.default.createElement(u,null,b.pointerSmall," Press ",o.default.createElement(u,{bold:!0},"q")," ",b.lineVertical," quit")):null,h?o.default.createElement(u,{color:"red"},h):null))};function D({title:n,backgroundColor:t}){let r=Math.max(Math.round((28-n.length)/2),0),e=" ".repeat(r);return o.default.createElement(u,{backgroundColor:t,color:"black"},`
1
+ import{a as S}from"../../../../chunk-3NBK56IK.js";import{b as nn,c as tn}from"../../../../chunk-UHJYPEY2.js";import{a as Z}from"../../../../chunk-HIBX234C.js";import{z as O}from"../../../../chunk-IZ3C5J7G.js";import{a as X}from"../../../../chunk-JCL2RRU6.js";import{a as V}from"../../../../chunk-AGNMOFJS.js";import{Ba as Q}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-UWJ73J4B.js";import"../../../../chunk-WFXRSKRK.js";import"../../../../chunk-YOZNRLFC.js";import"../../../../chunk-XEFQQPL4.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-4ZGSSQC6.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as z,c as Y}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{B as U,a as C,i as J,j as K,k as b,p as T}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import{d as B}from"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import{r as yn}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import{a as G}from"../../../../chunk-OBEWZXOQ.js";import{eb as P,fb as c,gb as u,ib as $,jb as j,kb as H,ma as E}from"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import{f as q}from"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import{d as A}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as R,g as a}from"../../../../chunk-VPRTJUIN.js";a();a();a();a();a();var y=R(P(),1);import{Writable as on}from"stream";function en({selectedRun:n,abortController:t,app:r,extension:e,appWatcher:i}){let s={type:"functionRun",input:n.payload.input,output:n.payload.output,logs:n.payload.logs,name:n.source,size:0,memory_usage:0,instructions:n.payload.fuelConsumed},[p,f]=(0,y.useState)([]),[m,l]=(0,y.useState)([s,s]),[h,g]=(0,y.useState)(void 0),{input:F,export:M}=n.payload,[mn,L]=(0,y.useState)(`Watching for changes to ${n.source}...`);return(0,y.useEffect)(()=>{let I=new C;t.signal.addEventListener("abort",()=>{I.abort()});let _=async()=>{let x=await hn(e,JSON.stringify(F),M);l(d=>[x,d[0]]),L(`Watching for changes to ${n.source}...`),f(d=>[...d,x])},fn=async()=>{L("Replaying log with local function..."),await _()},gn=async()=>{i.onEvent(async d=>{let w=d.extensionEvents.find(k=>k.extension.handle===e.handle);if(!(!w||w.type!=="changed")){if(w.buildResult?.status==="error"){g(`Error while reloading and building extension: ${w.buildResult?.error}`);return}g(void 0),L("Re-running with latest changes..."),await _()}});let x=new on({write(d,w,k){f(dn=>[...dn,{type:"systemMessage",message:d.toString()}]),k()}});await i.start({stdout:x,stderr:x,signal:I.signal},!1)};return fn().then(()=>{gn()}),()=>{I.abort()}},[F,M,r,e]),T(t.signal,async()=>{setTimeout(()=>{q()||G(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:p,statusMessage:mn,recentFunctionRuns:m,error:h}}async function hn(n,t,r){let e="",i=new on({write(p,f,m){e+=p,m()}});return await S({functionExtension:n,input:t,export:r,stdout:i,json:!0}),{...JSON.parse(e),type:"functionRun"}}var o=R(P(),1);var rn=({selectedRun:n,abortController:t,app:r,extension:e})=>{let{isAborted:i}=T(t.signal),{isRawModeSupported:s}=j(),p=new Z(r),{logs:f,statusMessage:m,recentFunctionRuns:l,error:h}=en({selectedRun:n,abortController:t,app:r,extension:e,appWatcher:p});return H((g,F)=>{K(g,F,()=>t.abort()),g==="q"&&t.abort()},{isActive:!!s}),o.default.createElement(o.default.Fragment,null,o.default.createElement($,{items:f},(g,F)=>o.default.createElement(c,{key:`replayOutputScrollerLog${F}`,flexDirection:"column"},o.default.createElement(Cn,{log:g}))),i?null:o.default.createElement(c,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},s?o.default.createElement(c,{flexDirection:"column"},o.default.createElement(c,{flexDirection:"row"},o.default.createElement(u,null,b.pointerSmall," ",m)),o.default.createElement(Rn,{recentFunctionRuns:l}),o.default.createElement(u,null,b.pointerSmall," Press ",o.default.createElement(u,{bold:!0},"q")," ",b.lineVertical," quit")):null,h?o.default.createElement(u,{color:"red"},h):null))};function D({title:n,backgroundColor:t}){let r=Math.max(Math.round((28-n.length)/2),0),e=" ".repeat(r);return o.default.createElement(u,{backgroundColor:t,color:"black"},`
2
2
 
3
3
  `,e,n,e,`
4
4
  `)}function Fn({input:n}){return o.default.createElement(c,{flexDirection:"column"},o.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),o.default.createElement(u,null,O(n)))}function xn({logs:n}){return o.default.createElement(c,{flexDirection:"column"},o.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),o.default.createElement(u,null,n))}function wn({output:n}){return o.default.createElement(c,{flexDirection:"column"},o.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),o.default.createElement(u,null,O(n)))}function bn({functionRun:n}){return o.default.createElement(c,{flexDirection:"column"},o.default.createElement(D,{title:"Benchmark Results",backgroundColor:"green"}),o.default.createElement(u,null,"Name: ",n.name),o.default.createElement(u,null,"Linear Memory Usage: ",n.memory_usage,"KB"),o.default.createElement(u,null,"Instructions: ",n.instructions/1e3,"K"),o.default.createElement(u,null,"Size: ",n.size,"KB"))}function Rn({recentFunctionRuns:n}){let t=n[0].instructions-n[1].instructions;return o.default.createElement(c,{flexDirection:"column"},o.default.createElement(u,null,b.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Cn({log:n}){switch(n.type){case"functionRun":return o.default.createElement(c,{flexDirection:"column"},o.default.createElement(Fn,{input:n.input}),o.default.createElement(xn,{logs:n.logs}),o.default.createElement(wn,{output:n.output}),o.default.createElement(bn,{functionRun:n}),o.default.createElement(u,null,"\xA0"));case"systemMessage":return o.default.createElement(u,null,n.message);default:return null}}var sn=R(P(),1);async function un({selectedRun:n,abortController:t,app:r,extension:e}){return J(sn.default.createElement(rn,{selectedRun:n,abortController:t,app:r,extension:e}),{exitOnCtrlC:!1})}a();async function an(n){if(n.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),r=n.map(t);return await U({message:"Which function run would you like to replay locally?",choices:r})}import{existsSync as Tn,readdirSync as Sn}from"fs";var v=100;async function cn(n){let{watch:t,extension:r,app:e}=n,i=new C;try{let s=e.getLogsDir(),p=n.log?await Dn(s,r.handle,n.log):await In(s,r.handle),{input:f,export:m}=p.payload;t?await un({selectedRun:p,abortController:i,app:e,extension:r}):await S({functionExtension:r,json:n.json,input:JSON.stringify(f),export:m})}catch(s){throw i.abort(),s}}async function Dn(n,t,r){let e=await Ln(n,t,r);if(e===void 0)throw new B(`No log found for '${r}'.
@@ -1 +1 @@
1
- import{a as U}from"../../../../chunk-YI232QLS.js";import{b as F,c as P,d as w}from"../../../../chunk-IIIVWD4R.js";import{a as y}from"../../../../chunk-ZVJVDCIM.js";import{a as h}from"../../../../chunk-RF2DPBA6.js";import{Ca as x}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as l,c as m}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{B as g,I as d}from"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import{r as k}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import{Qb as n}from"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as b,g as f}from"../../../../chunk-VPRTJUIN.js";f();var a=b(k(),1);var r="_start",s=class v extends y{static{this.summary="Run a function locally for testing."}static{this.descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors)."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...l,...h,...F,...m,input:a.Flags.string({char:"i",description:"The input JSON to pass to the function. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),export:a.Flags.string({char:"e",hidden:!1,description:"Name of the WebAssembly export to invoke.",env:"SHOPIFY_FLAG_EXPORT"})}}async run(){let{flags:t}=await this.parse(v),o=r,{app:p}=await x({directory:t.path,userProvidedConfigName:t.config}),e=await P(p,t.path);if(t.export!==void 0)n(`Using export ${t.export} from the --export flag.`),o=t.export;else if(e.configuration.targeting!==void 0&&e.configuration.targeting.length>0){let i=e.configuration.targeting;if(i.length>1&&d({})){let T=i.map(u=>({label:u.target,value:u.export||r}));o=await g({message:"Which target would you like to execute?",choices:T})}else o=i?.[0]?.export||r,n(`Using export '${o}'. Use the --export flag or an interactive terminal to select a different export.`)}else n(`No targeting information found. Using the default export '${o}'. Use the --export flag or an interactive terminal to select a different export.`);let c=e?.configuration.targeting?.[0]?.input_query,A=c&&`${e?.directory}/${c}`,O=await w(e,t.path,t["client-id"],t.reset,t.config);return await U({functionExtension:e,json:t.json,inputPath:t.input,export:o,stdin:"inherit",schemaPath:O,queryPath:A}),{app:p}}};export{s as default};
1
+ import{a as U}from"../../../../chunk-3NBK56IK.js";import{b as F,c as P,d as w}from"../../../../chunk-UHJYPEY2.js";import{a as y}from"../../../../chunk-G4BPGWJC.js";import{a as h}from"../../../../chunk-AGNMOFJS.js";import{Ca as x}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as l,c as m}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{B as g,I as d}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import{r as k}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import{Qb as n}from"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as b,g as f}from"../../../../chunk-VPRTJUIN.js";f();var a=b(k(),1);var r="_start",s=class v extends y{static{this.summary="Run a function locally for testing."}static{this.descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors)."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...l,...h,...F,...m,input:a.Flags.string({char:"i",description:"The input JSON to pass to the function. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),export:a.Flags.string({char:"e",hidden:!1,description:"Name of the WebAssembly export to invoke.",env:"SHOPIFY_FLAG_EXPORT"})}}async run(){let{flags:t}=await this.parse(v),o=r,{app:p}=await x({directory:t.path,userProvidedConfigName:t.config}),e=await P(p,t.path);if(t.export!==void 0)n(`Using export ${t.export} from the --export flag.`),o=t.export;else if(e.configuration.targeting!==void 0&&e.configuration.targeting.length>0){let i=e.configuration.targeting;if(i.length>1&&d({})){let T=i.map(u=>({label:u.target,value:u.export||r}));o=await g({message:"Which target would you like to execute?",choices:T})}else o=i?.[0]?.export||r,n(`Using export '${o}'. Use the --export flag or an interactive terminal to select a different export.`)}else n(`No targeting information found. Using the default export '${o}'. Use the --export flag or an interactive terminal to select a different export.`);let c=e?.configuration.targeting?.[0]?.input_query,A=c&&`${e?.directory}/${c}`,O=await w(e,t.path,t["client-id"],t.reset,t.config);return await U({functionExtension:e,json:t.json,inputPath:t.input,export:o,stdin:"inherit",schemaPath:O,queryPath:A}),{app:p}}};export{s as default};
@@ -1 +1 @@
1
- import{a as p,b as c,c as d}from"../../../../chunk-IIIVWD4R.js";import{a as r}from"../../../../chunk-D3TSJA5S.js";import{a as n}from"../../../../chunk-RF2DPBA6.js";import{Ba as s}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as a}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import{r as y}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as g,g as i}from"../../../../chunk-VPRTJUIN.js";i();var m=g(y(),1);var o=class u extends r{static{this.summary="Fetch the latest GraphQL schema for a function."}static{this.descriptionWithMarkdown="Generates the latest [GraphQL schema](https://shopify.dev/docs/apps/functions/input-output#graphql-schema) for a function in your app. Run this command from the function directory.\n\n This command uses the API type and version of your function, as defined in your extension TOML file, to generate the latest GraphQL schema. The schema is written to the `schema.graphql` file."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...a,...n,...c,stdout:m.Flags.boolean({description:"Output the schema to stdout instead of writing to a file.",required:!1,default:!1,env:"SHOPIFY_FLAG_STDOUT"})}}async run(){let{flags:t}=await this.parse(u),{app:e,developerPlatformClient:f,organization:h}=await s({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),l=await d(e,t.path);return await p({app:e,extension:l,stdout:t.stdout,developerPlatformClient:f,orgId:h.id}),{app:e}}};export{o as default};
1
+ import{a as p,b as c,c as d}from"../../../../chunk-UHJYPEY2.js";import{a as r}from"../../../../chunk-JCL2RRU6.js";import{a as n}from"../../../../chunk-AGNMOFJS.js";import{Ba as s}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as a}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import{r as y}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as g,g as i}from"../../../../chunk-VPRTJUIN.js";i();var m=g(y(),1);var o=class u extends r{static{this.summary="Fetch the latest GraphQL schema for a function."}static{this.descriptionWithMarkdown="Generates the latest [GraphQL schema](https://shopify.dev/docs/apps/functions/input-output#graphql-schema) for a function in your app. Run this command from the function directory.\n\n This command uses the API type and version of your function, as defined in your extension TOML file, to generate the latest GraphQL schema. The schema is written to the `schema.graphql` file."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...a,...n,...c,stdout:m.Flags.boolean({description:"Output the schema to stdout instead of writing to a file.",required:!1,default:!1,env:"SHOPIFY_FLAG_STDOUT"})}}async run(){let{flags:t}=await this.parse(u),{app:e,developerPlatformClient:f,organization:h}=await s({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),l=await d(e,t.path);return await p({app:e,extension:l,stdout:t.stdout,developerPlatformClient:f,orgId:h.id}),{app:e}}};export{o as default};
@@ -1 +1 @@
1
- import{b as c,c as d}from"../../../../chunk-IIIVWD4R.js";import{a as u}from"../../../../chunk-ZVJVDCIM.js";import{a as p}from"../../../../chunk-RF2DPBA6.js";import{Ca as e,d as n}from"../../../../chunk-SBEZBZM7.js";import"../../../../chunk-DJQVNH7P.js";import"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as i}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{v as s}from"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as r}from"../../../../chunk-VPRTJUIN.js";r();var a=class m extends u{static{this.summary="Generate GraphQL types for a function."}static{this.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{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...i,...p,...c}}async run(){let{flags:t}=await this.parse(m),{app:o}=await e({directory:t.path,userProvidedConfigName:t.config}),f=await d(o,t.path);return await n(f,{stdout:process.stdout,stderr:process.stderr,app:o}),s({headline:"GraphQL types generated successfully."}),{app:o}}};export{a as default};
1
+ import{b as c,c as d}from"../../../../chunk-UHJYPEY2.js";import{a as u}from"../../../../chunk-G4BPGWJC.js";import{a as p}from"../../../../chunk-AGNMOFJS.js";import{Ca as e,d as n}from"../../../../chunk-54CAKCYR.js";import"../../../../chunk-7ESSIN27.js";import"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as i}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import"../../../../chunk-JUVAGMIH.js";import{v as s}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{g as r}from"../../../../chunk-VPRTJUIN.js";r();var a=class m extends u{static{this.summary="Generate GraphQL types for a function."}static{this.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{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...i,...p,...c}}async run(){let{flags:t}=await this.parse(m),{app:o}=await e({directory:t.path,userProvidedConfigName:t.config}),f=await d(o,t.path);return await n(f,{stdout:process.stdout,stderr:process.stderr,app:o}),s({headline:"GraphQL types generated successfully."}),{app:o}}};export{a as default};
@@ -1,4 +1,4 @@
1
- import{a as ee,b as te}from"../../../../chunk-K5YV6UVF.js";import{a as Z}from"../../../../chunk-D3TSJA5S.js";import{a as W}from"../../../../chunk-RF2DPBA6.js";import{Ba as Q,D as B,F as K,c as J,d as X,l as w}from"../../../../chunk-SBEZBZM7.js";import{b as z,d as H}from"../../../../chunk-DJQVNH7P.js";import{b as v}from"../../../../chunk-SGQ6D3LU.js";import{c as q}from"../../../../chunk-P7R7FBY2.js";import{j as Y}from"../../../../chunk-66RJ5T7A.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-ELYP4KFP.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-XBXMPFXM.js";import"../../../../chunk-R466TU3N.js";import"../../../../chunk-UGXYQ23Y.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-TQYMC7TH.js";import"../../../../chunk-HUZUORYM.js";import"../../../../chunk-52GC6XUT.js";import"../../../../chunk-XLELNRFF.js";import"../../../../chunk-B2EHO7ZC.js";import"../../../../chunk-4LNCYIS3.js";import{C as L,p as T,x as j,y as P}from"../../../../chunk-LAZJ47DZ.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-GOJ2QHSR.js";import"../../../../chunk-7BGM2GAH.js";import"../../../../chunk-XNO6DZYP.js";import{b as $}from"../../../../chunk-323UTVMM.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-4HHXSMD7.js";import"../../../../chunk-YZDDTYTU.js";import"../../../../chunk-MOA33ZFO.js";import{d as h}from"../../../../chunk-JUVAGMIH.js";import{B as D,D as F,F as V,v as M,z as R}from"../../../../chunk-BDVAE5MS.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-IASVAERO.js";import{d as f}from"../../../../chunk-JPGO36XP.js";import"../../../../chunk-PD5ZHJWI.js";import{r as ue}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-V2CNCPIE.js";import{Hb as U,Oa as C,Ta as S,Ua as b,Wa as _,Y as u,ka as g,wa as G,ya as E}from"../../../../chunk-GFEAKSGV.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import{e as N}from"../../../../chunk-YC6G4MHD.js";import"../../../../chunk-N7RBSKYT.js";import{d,n as I}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as de,g as c}from"../../../../chunk-VPRTJUIN.js";c();c();c();async function ne(e,t,r){let{templates:i,groupOrder:n}=await e.templateSpecifications(t);return{templates:i.filter(a=>r.includes(a.identifier)||r.includes(a.type)),groupOrder:n}}c();function O(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 ie(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,i=e.extensionTemplate.supportedFlavors.find(s=>s.value===r),n=await te({app:e.app,name:t}),o=e.cloneUrl??e.extensionTemplate.url,a={directory:n,url:o,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:i,onGetTemplateRepository:e.onGetTemplateRepository??(async(s,p)=>{await q({repoUrl:s,destination:p,shallow:!0})})};return await fe(a),{directory:I(n),extensionTemplate:e.extensionTemplate}}async function fe(e){try{switch(e.type){case"theme":await xe(e);break;case"function":await ye(e);break;default:await ge(e);break}let t=d(e.directory,z.lockFile);await E(t)}catch(t){throw await E(e.directory),t}}async function xe({directory:e,url:t,type:r,name:i,extensionFlavor:n,onGetTemplateRepository:o}){return g(async a=>{let s=await A(t,n,a,o);await v(s,e,{name:i,type:r,uid:h(u(i))})})}async function ye({directory:e,url:t,app:r,project:i,name:n,extensionFlavor:o,onGetTemplateRepository:a}){let s=O(o?.value),p=[];p.push({title:"Generating function extension",task:async()=>{if(await g(async l=>{let m=await A(t,o,l,a);await v(m,e,{name:n,handle:u(n),flavor:o?.value,uid:h(u(n))})}),s==="javascript"){let l=re(o?.value??"rust");await oe(e,l,"!(*.graphql)")}}}),s==="javascript"&&p.push({title:"Installing additional dependencies",task:async()=>{i.usesWorkspaces&&await T({packageManager:i.packageManager,directory:i.directory});let l=Ee(s);await P(l,{packageManager:i.packageManager,type:"prod",directory:i.usesWorkspaces?e:i.directory})}}),s==="javascript"&&p.push({title:"Building GraphQL types",task:async()=>{await X({directory:e,isJavaScript:!0},{stdout:process.stdout,stderr:process.stderr,app:r})}}),await F(p)}async function ge({directory:e,url:t,app:r,project:i,name:n,extensionFlavor:o,onGetTemplateRepository:a}){let s=O(o?.value),p=[{title:"Generating extension",task:async()=>{let l=re(o?.value??"vanilla-js");await g(async m=>{let x=await A(t,o,m,a);await v(x,e,{srcFileExtension:l,name:n,handle:u(n),flavor:o?.value??"",uid:h(u(n))})}),s==="javascript"&&await oe(e,l)}},{title:"Installing dependencies",task:async()=>{let l=i.packageManager;if(i.usesWorkspaces)O(o?.value)==="javascript"&&await T({packageManager:l,directory:i.directory});else{await he(i.directory,o?.value);let m=d(e,"package.json"),x=await ve(m);await P(x,{packageManager:l,type:"prod",directory:i.directory}),await E(m)}}}];p.push({title:"Update shared type definition",task:async()=>{await K(r)}}),await F(p)}function re(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 Ee(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${J}.0.0`}),t}async function oe(e,t,r="*"){let i=await _(d(e,"src",r)),n=[];for(let o of i)n.push(C(o,`${o}.${t}`));await Promise.all(n)}async function he(e,t){t==="typescript-react"&&await L(e,{"@types/react":H.reactTypes})}async function ve(e){if(!await S(e))return[];let t=await j(e);return Object.entries(t?.dependencies??{}).map(([r,i])=>({name:r,version:i}))}async function A(e,t,r,i){let n=d(r,"download");return await G(n),await i(e,n),ee(t,n)}c();function we(e,t=[]){let r=[...e.map(n=>({label:n.name,value:n.identifier,group:n.group||"Other",sortPriority:n.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(n=>({label:`${n.name} (limit reached)`,value:n.identifier,group:n.group||"Other",disabled:!0,sortPriority:n.sortPriority??Number.MAX_SAFE_INTEGER}))],i=(n,o)=>n.sortPriority===o.sortPriority?n.label.localeCompare(o.label):n.sortPriority-o.sortPriority;return r.sort(i)}var Te=async e=>{let t=e.extensionTemplates,r=e.templateType,i=e.extensionFlavor;if(!r){if(i&&(t=t.filter(p=>p.supportedFlavors.map(l=>l.value).includes(i))),t.length===0)throw new f("You have reached the limit for the number of extensions you can create.");r=await D({message:"Type of extension?",choices:we(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let n=t.find(p=>p.identifier===r),o=e.name||await ae(e.directory,n.defaultName),a=e.extensionFlavor??await Pe(n);return{extensionTemplate:n,extensionContent:{name:o,flavor:a}}};async function ae(e,t,r=1){let i=t.includes(" ")?" ":"-",n=r<=1?t:`${t}${i}${r}`,o=d(e,u(n));return b(o)?ae(e,t,r+1):V({message:"Name your extension:",defaultValue:n})}async function Pe(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:R({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var se=Te;async function Fe(e){let{app:t,developerPlatformClient:r,remoteApp:i,specifications:n,template:o}=e,a=n.map(me=>me.identifier),{templates:s,groupOrder:p}=await ne(r,i,a),l=await Oe(s,p,n,t,e),m=await se(l);await ke(m,o);let x=Ie(m,t,e,r),ce=await ie(x);Ge(ce,e.project.packageManager)}async function Oe(e,t,r,i,n){let o=await be(n.template,i,e,r);Ce(o,n.flavor);let{validTemplates:a,templatesOverlimit:s}=Ae(e,r,i);return{templateType:o?.identifier,name:n.name,extensionFlavor:n.flavor,directory:d(n.directory,"extensions"),app:i,extensionTemplates:a??[],unavailableExtensions:s??[],reset:n.reset,groupOrder:t}}function Ae(e,t,r){return Y(e,n=>!pe(r,t,n)?"validTemplates":"templatesOverlimit")}function pe(e,t,r){let i=r.type,n=t.find(a=>a.identifier===i||a.externalIdentifier===i);return e.extensionsForType({identifier:i,externalIdentifier:i}).length>=(n?.registrationLimit??1)}async function ke(e,t){let{extensionContent:r}=e;return w.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Ie(e,t,r,i){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:i}}function Ge(e,t){let r=Se(e.extensionTemplate,e.directory,t);M(r)}function Ce(e,t){if(!t||!e)return;let r=e.supportedFlavors.map(i=>i.value);if(!r.includes(t))throw new f("Invalid template for extension type",`Expected template to be one of the following: ${r.join(", ")}.`)}function Se(e,t,r){let i={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&i.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:U(r,"shopify app dev")}]),e.supportLinks[0]&&i.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),i}async function be(e,t,r,i){if(!e)return;let n=r.find(o=>o.identifier===e);if(!n){let o=await N(),a=r.map(p=>p.identifier),s=o?"You might need to enable some flags on your Organization or App":void 0;throw new f(`Unknown extension type: ${e}.
1
+ import{a as ee,b as te}from"../../../../chunk-C2IK2HY3.js";import{a as Z}from"../../../../chunk-JCL2RRU6.js";import{a as W}from"../../../../chunk-AGNMOFJS.js";import{Ba as Q,D as B,F as K,c as J,d as X,l as w}from"../../../../chunk-54CAKCYR.js";import{b as z,d as H}from"../../../../chunk-7ESSIN27.js";import{b as v}from"../../../../chunk-6WL4GA2M.js";import{c as q}from"../../../../chunk-TYZXGSHO.js";import{j as Y}from"../../../../chunk-GZS44BUW.js";import"../../../../chunk-K2WUCOQJ.js";import"../../../../chunk-7QIOUDCX.js";import"../../../../chunk-7MUKLZOL.js";import"../../../../chunk-VBUZWRUL.js";import"../../../../chunk-DCPBRWVC.js";import"../../../../chunk-KR6QDE7D.js";import"../../../../chunk-UXVZ2P63.js";import"../../../../chunk-QSTEVZFQ.js";import"../../../../chunk-5Y7GIF2W.js";import"../../../../chunk-EKXY5COY.js";import"../../../../chunk-4DCQNGUV.js";import"../../../../chunk-QBSKKQBN.js";import"../../../../chunk-FQWB2F75.js";import"../../../../chunk-XONFGLJQ.js";import"../../../../chunk-4LNCYIS3.js";import{C as L,p as T,x as j,y as P}from"../../../../chunk-L2MGAEV3.js";import"../../../../chunk-PRKBO42R.js";import"../../../../chunk-ZSBA6VIC.js";import"../../../../chunk-F2QU6WWX.js";import"../../../../chunk-XULPJ6UG.js";import{b as $}from"../../../../chunk-XR6GMMEU.js";import"../../../../chunk-3TNEIDOD.js";import"../../../../chunk-MHWV5RQV.js";import"../../../../chunk-XOTA6JTZ.js";import"../../../../chunk-MOA33ZFO.js";import{d as h}from"../../../../chunk-JUVAGMIH.js";import{B as D,D as F,F as V,v as M,z as R}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import{d as f}from"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import{r as ue}from"../../../../chunk-LDGAHMS7.js";import"../../../../chunk-ZR76GGZ6.js";import"../../../../chunk-EENHXSWU.js";import"../../../../chunk-FUOIGXI4.js";import"../../../../chunk-6M3ZYNGO.js";import"../../../../chunk-QYR5VPQA.js";import"../../../../chunk-OBEWZXOQ.js";import{Hb as U,Oa as C,Ta as S,Ua as b,Wa as _,Y as u,ka as g,wa as G,ya as E}from"../../../../chunk-N5PQPIBF.js";import"../../../../chunk-CERXUPGC.js";import"../../../../chunk-T4M5CWAO.js";import"../../../../chunk-PRVQAHWI.js";import{e as N}from"../../../../chunk-YTNDFQJT.js";import"../../../../chunk-ULQG3XQS.js";import{d,n as I}from"../../../../chunk-IU2ZQ6TE.js";import"../../../../chunk-PIBY5DDZ.js";import{e as de,g as c}from"../../../../chunk-VPRTJUIN.js";c();c();c();async function ne(e,t,r){let{templates:i,groupOrder:n}=await e.templateSpecifications(t);return{templates:i.filter(a=>r.includes(a.identifier)||r.includes(a.type)),groupOrder:n}}c();function O(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 ie(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,i=e.extensionTemplate.supportedFlavors.find(s=>s.value===r),n=await te({app:e.app,name:t}),o=e.cloneUrl??e.extensionTemplate.url,a={directory:n,url:o,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:i,onGetTemplateRepository:e.onGetTemplateRepository??(async(s,p)=>{await q({repoUrl:s,destination:p,shallow:!0})})};return await fe(a),{directory:I(n),extensionTemplate:e.extensionTemplate}}async function fe(e){try{switch(e.type){case"theme":await xe(e);break;case"function":await ye(e);break;default:await ge(e);break}let t=d(e.directory,z.lockFile);await E(t)}catch(t){throw await E(e.directory),t}}async function xe({directory:e,url:t,type:r,name:i,extensionFlavor:n,onGetTemplateRepository:o}){return g(async a=>{let s=await A(t,n,a,o);await v(s,e,{name:i,type:r,uid:h(u(i))})})}async function ye({directory:e,url:t,app:r,project:i,name:n,extensionFlavor:o,onGetTemplateRepository:a}){let s=O(o?.value),p=[];p.push({title:"Generating function extension",task:async()=>{if(await g(async l=>{let m=await A(t,o,l,a);await v(m,e,{name:n,handle:u(n),flavor:o?.value,uid:h(u(n))})}),s==="javascript"){let l=re(o?.value??"rust");await oe(e,l,"!(*.graphql)")}}}),s==="javascript"&&p.push({title:"Installing additional dependencies",task:async()=>{i.usesWorkspaces&&await T({packageManager:i.packageManager,directory:i.directory});let l=Ee(s);await P(l,{packageManager:i.packageManager,type:"prod",directory:i.usesWorkspaces?e:i.directory})}}),s==="javascript"&&p.push({title:"Building GraphQL types",task:async()=>{await X({directory:e,isJavaScript:!0},{stdout:process.stdout,stderr:process.stderr,app:r})}}),await F(p)}async function ge({directory:e,url:t,app:r,project:i,name:n,extensionFlavor:o,onGetTemplateRepository:a}){let s=O(o?.value),p=[{title:"Generating extension",task:async()=>{let l=re(o?.value??"vanilla-js");await g(async m=>{let x=await A(t,o,m,a);await v(x,e,{srcFileExtension:l,name:n,handle:u(n),flavor:o?.value??"",uid:h(u(n))})}),s==="javascript"&&await oe(e,l)}},{title:"Installing dependencies",task:async()=>{let l=i.packageManager;if(i.usesWorkspaces)O(o?.value)==="javascript"&&await T({packageManager:l,directory:i.directory});else{await he(i.directory,o?.value);let m=d(e,"package.json"),x=await ve(m);await P(x,{packageManager:l,type:"prod",directory:i.directory}),await E(m)}}}];p.push({title:"Update shared type definition",task:async()=>{await K(r)}}),await F(p)}function re(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 Ee(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${J}.0.0`}),t}async function oe(e,t,r="*"){let i=await _(d(e,"src",r)),n=[];for(let o of i)n.push(C(o,`${o}.${t}`));await Promise.all(n)}async function he(e,t){t==="typescript-react"&&await L(e,{"@types/react":H.reactTypes})}async function ve(e){if(!await S(e))return[];let t=await j(e);return Object.entries(t?.dependencies??{}).map(([r,i])=>({name:r,version:i}))}async function A(e,t,r,i){let n=d(r,"download");return await G(n),await i(e,n),ee(t,n)}c();function we(e,t=[]){let r=[...e.map(n=>({label:n.name,value:n.identifier,group:n.group||"Other",sortPriority:n.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(n=>({label:`${n.name} (limit reached)`,value:n.identifier,group:n.group||"Other",disabled:!0,sortPriority:n.sortPriority??Number.MAX_SAFE_INTEGER}))],i=(n,o)=>n.sortPriority===o.sortPriority?n.label.localeCompare(o.label):n.sortPriority-o.sortPriority;return r.sort(i)}var Te=async e=>{let t=e.extensionTemplates,r=e.templateType,i=e.extensionFlavor;if(!r){if(i&&(t=t.filter(p=>p.supportedFlavors.map(l=>l.value).includes(i))),t.length===0)throw new f("You have reached the limit for the number of extensions you can create.");r=await D({message:"Type of extension?",choices:we(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let n=t.find(p=>p.identifier===r),o=e.name||await ae(e.directory,n.defaultName),a=e.extensionFlavor??await Pe(n);return{extensionTemplate:n,extensionContent:{name:o,flavor:a}}};async function ae(e,t,r=1){let i=t.includes(" ")?" ":"-",n=r<=1?t:`${t}${i}${r}`,o=d(e,u(n));return b(o)?ae(e,t,r+1):V({message:"Name your extension:",defaultValue:n})}async function Pe(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:R({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var se=Te;async function Fe(e){let{app:t,developerPlatformClient:r,remoteApp:i,specifications:n,template:o}=e,a=n.map(me=>me.identifier),{templates:s,groupOrder:p}=await ne(r,i,a),l=await Oe(s,p,n,t,e),m=await se(l);await ke(m,o);let x=Ie(m,t,e,r),ce=await ie(x);Ge(ce,e.project.packageManager)}async function Oe(e,t,r,i,n){let o=await be(n.template,i,e,r);Ce(o,n.flavor);let{validTemplates:a,templatesOverlimit:s}=Ae(e,r,i);return{templateType:o?.identifier,name:n.name,extensionFlavor:n.flavor,directory:d(n.directory,"extensions"),app:i,extensionTemplates:a??[],unavailableExtensions:s??[],reset:n.reset,groupOrder:t}}function Ae(e,t,r){return Y(e,n=>!pe(r,t,n)?"validTemplates":"templatesOverlimit")}function pe(e,t,r){let i=r.type,n=t.find(a=>a.identifier===i||a.externalIdentifier===i);return e.extensionsForType({identifier:i,externalIdentifier:i}).length>=(n?.registrationLimit??1)}async function ke(e,t){let{extensionContent:r}=e;return w.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Ie(e,t,r,i){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:i}}function Ge(e,t){let r=Se(e.extensionTemplate,e.directory,t);M(r)}function Ce(e,t){if(!t||!e)return;let r=e.supportedFlavors.map(i=>i.value);if(!r.includes(t))throw new f("Invalid template for extension type",`Expected template to be one of the following: ${r.join(", ")}.`)}function Se(e,t,r){let i={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&i.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:U(r,"shopify app dev")}]),e.supportLinks[0]&&i.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),i}async function be(e,t,r,i){if(!e)return;let n=r.find(o=>o.identifier===e);if(!n){let o=await N(),a=r.map(p=>p.identifier),s=o?"You might need to enable some flags on your Organization or App":void 0;throw new f(`Unknown extension type: ${e}.
2
2
  The following extension types are supported: ${a.join(", ")}`,s)}if(pe(t,i,n))throw new f(`Invalid extension type: ${e}`,`You have reached the limit of extension(s) of type ${n.type} per app`);return n}var le=Fe;var y=de(ue(),1);var k=class e extends Z{static{this.summary="Generate a new app Extension."}static{this.descriptionWithMarkdown=`Generates a new [app extension](https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).
3
3
 
4
4
  Each new app extension is created in a folder under \`extensions/\`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.
@@ -1,4 +1,4 @@
1
- import{a as P}from"../../../chunk-QRRNOVJ3.js";import{a as C}from"../../../chunk-D3TSJA5S.js";import{a as O}from"../../../chunk-RF2DPBA6.js";import{Ba as j,D as R}from"../../../chunk-SBEZBZM7.js";import"../../../chunk-DJQVNH7P.js";import"../../../chunk-66RJ5T7A.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-ELYP4KFP.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-XBXMPFXM.js";import"../../../chunk-R466TU3N.js";import"../../../chunk-UGXYQ23Y.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import{e as I}from"../../../chunk-TQYMC7TH.js";import{a as z}from"../../../chunk-HUZUORYM.js";import"../../../chunk-52GC6XUT.js";import"../../../chunk-XLELNRFF.js";import{R as S,da as T,ga as _,z as F}from"../../../chunk-B2EHO7ZC.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-LAZJ47DZ.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-GOJ2QHSR.js";import"../../../chunk-7BGM2GAH.js";import"../../../chunk-XNO6DZYP.js";import{b as D}from"../../../chunk-323UTVMM.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-4HHXSMD7.js";import"../../../chunk-YZDDTYTU.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{D as h,E as f,u as A}from"../../../chunk-BDVAE5MS.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-IASVAERO.js";import{g as M}from"../../../chunk-JPGO36XP.js";import"../../../chunk-PD5ZHJWI.js";import{r as Y}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-V2CNCPIE.js";import{Gb as p,Ib as m,Nb as k}from"../../../chunk-GFEAKSGV.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YC6G4MHD.js";import"../../../chunk-N7RBSKYT.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as v,g as r}from"../../../chunk-VPRTJUIN.js";r();r();r();var w={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"}}]}}]}}]};r();async function H(e){let i="Admin",n=I(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function E(e){return _({query:e.query,...await H(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}r();var V={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=v(z(),1);var J={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 q({query:e,session:i,toNodes:n,toVariables:t,performQuery:s=a=>E({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await s(t(a))),d=[];for(d.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await s(t(a))),d.push(...o.nodes);return{status:"ok",items:d}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function L(e,i){let n="";for(let t of e)n=(0,x.updateTomlValues)(n,t);return`# ${i}
1
+ import{a as P}from"../../../chunk-TQ6HYDVC.js";import{a as C}from"../../../chunk-JCL2RRU6.js";import{a as O}from"../../../chunk-AGNMOFJS.js";import{Ba as j,D as R}from"../../../chunk-54CAKCYR.js";import"../../../chunk-7ESSIN27.js";import"../../../chunk-GZS44BUW.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-7QIOUDCX.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-DCPBRWVC.js";import"../../../chunk-KR6QDE7D.js";import"../../../chunk-UXVZ2P63.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import{e as I}from"../../../chunk-EKXY5COY.js";import{a as z}from"../../../chunk-4DCQNGUV.js";import"../../../chunk-QBSKKQBN.js";import"../../../chunk-FQWB2F75.js";import{R as S,da as T,ga as _,z as F}from"../../../chunk-XONFGLJQ.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-L2MGAEV3.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-ZSBA6VIC.js";import"../../../chunk-F2QU6WWX.js";import"../../../chunk-XULPJ6UG.js";import{b as D}from"../../../chunk-XR6GMMEU.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-MHWV5RQV.js";import"../../../chunk-XOTA6JTZ.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{D as h,E as f,u as A}from"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-WSDN25F5.js";import{g as M}from"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import{r as Y}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-OBEWZXOQ.js";import{Gb as p,Ib as m,Nb as k}from"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YTNDFQJT.js";import"../../../chunk-ULQG3XQS.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as v,g as r}from"../../../chunk-VPRTJUIN.js";r();r();r();var w={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"}}]}}]}}]};r();async function H(e){let i="Admin",n=I(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function E(e){return _({query:e.query,...await H(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}r();var V={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=v(z(),1);var J={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 q({query:e,session:i,toNodes:n,toVariables:t,performQuery:s=a=>E({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await s(t(a))),d=[];for(d.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await s(t(a))),d.push(...o.nodes);return{status:"ok",items:d}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function L(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:d}=a;return L(d,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:d})=>a.map(l=>({result:se(l,o),graphQLOwner:d}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:d,key:l,patches:y}=a;return L(y,`namespace: ${d==="app"?"$app":`$app:${d}`} key: ${l} 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 $(e){let i=await ae(e),n=i.storeFqdn,t=await ee(i),s=await ne(i);e.includeExistingDeclaredDefinitions||(t=ie(t,e.appConfiguration),s=te(s,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:d}=Z(t,s);X(o,d,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 h(Object.entries(J).map(([n,t])=>({title:m`Loading ${p.green(n)} metafields`,task:async()=>{let s=await q({query:w,session:e,toNodes:a=>a.metafieldDefinitions,toVariables:a=>({ownerType:t,after:a})});i.push({metafields:s,ownerType:n,graphQLOwner:t})}}))),i.map(({metafields:n,ownerType:t,graphQLOwner:s})=>n.status==="ok"?{ownerType:t,items:n.items,graphQLOwner:s}:null).filter(n=>n!==null)}async function ne(e){let i=await f({title:m`Loading ${p.green("metaobjects")}`,task:async()=>q({query:V,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(s=>!K(i,[n.ownerType,"metafields",u(s.namespace)??"",s.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 M("No API secret keys found for app");return await S(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 se(e,i){let n=u(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,s=de(e),a=le(s,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=re(e,i),t=me(n,i);return{status:"ok",typeName:i,patches:t}}function de(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:B(e.access.storefront),customer_account:ue(e.access.customerAccount)}),validations:U(e.validations)},{type:n,validations:t}=Q(i.type,i.validations);return i.type=n,i.validations=t,i}function re(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:B(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:U(n.validations)},{type:s,validations:a}=Q(t.type,t.validations);return t.type=s,t.validations=a,[n.key,t]}))}}function Q(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 U(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 le(e,i,n,t){let s=[[[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&&G(e.validations).forEach(({validationKey:d,actualValue:l})=>{s.push([[i,"metafields",n,t,"validations",d],l])}),[b(s),b(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(([s,a])=>{if(typeof a=="string")n.push([["metaobjects","app",i,"fields",s],a]);else{let o=Object.fromEntries(Object.entries(a).filter(([d,l])=>l!==void 0));Object.keys(o).length===1?n.push([["metaobjects","app",i,"fields",s],a.type]):(n.push([["metaobjects","app",i,"fields",s,"type"],a.type]),n.push([["metaobjects","app",i,"fields",s,"description"],a.description]),n.push([["metaobjects","app",i,"fields",s,"name"],a.name]),n.push([["metaobjects","app",i,"fields",s,"required"],a.required||void 0]),a.validations&&G(a.validations).forEach(({validationKey:l,actualValue:y})=>{n.push([["metaobjects","app",i,"fields",s,"validations",l],y])}))}}),[b(n),b(t)]}function G(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(s=>typeof s=="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*\[/)?k(m`${p.green(n)}`):n.match(/^\s*#/)?k(m`${p.gray(n)}`):k(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 B(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&&!T(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function b(e){return e.filter(([i,n])=>n!==void 0)}var N=v(Y(),1);var g=class e extends C{static{this.summary="Import metafield and metaobject definitions."}static{this.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{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...D,...O,store:N.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>F(i)}),"include-existing":N.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})}}async run(){let{appContextResult:i,...n}=await f({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(e);await R(t.path);let s=await j({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await P({appContextResult:s,storeFqdn:t.store,forceReselectStore:t.reset});return{appContextResult:s,appConfiguration:s.app.configuration,remoteApp:s.remoteApp,store:a,includeExistingDeclaredDefinitions:t["include-existing"]}}});return await $(n),{app:i.app}}};export{g as default};
@@ -1 +1 @@
1
- import{a as c,b as f,c as g,d as C,g as x}from"../../../chunk-3F6NZK7S.js";import{a as d}from"../../../chunk-D3TSJA5S.js";import{a as m}from"../../../chunk-RF2DPBA6.js";import{Ba as l}from"../../../chunk-SBEZBZM7.js";import"../../../chunk-DJQVNH7P.js";import"../../../chunk-66RJ5T7A.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-ELYP4KFP.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-XBXMPFXM.js";import"../../../chunk-R466TU3N.js";import"../../../chunk-UGXYQ23Y.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import"../../../chunk-TQYMC7TH.js";import"../../../chunk-HUZUORYM.js";import"../../../chunk-52GC6XUT.js";import"../../../chunk-XLELNRFF.js";import"../../../chunk-B2EHO7ZC.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-LAZJ47DZ.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-GOJ2QHSR.js";import"../../../chunk-7BGM2GAH.js";import"../../../chunk-XNO6DZYP.js";import{b as p}from"../../../chunk-323UTVMM.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-4HHXSMD7.js";import"../../../chunk-YZDDTYTU.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{v as s}from"../../../chunk-BDVAE5MS.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-IASVAERO.js";import"../../../chunk-JPGO36XP.js";import"../../../chunk-PD5ZHJWI.js";import{r as A}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-V2CNCPIE.js";import"../../../chunk-GFEAKSGV.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YC6G4MHD.js";import"../../../chunk-N7RBSKYT.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as y,g as r}from"../../../chunk-VPRTJUIN.js";r();var u=y(A(),1);var o=class h extends d{static{this.description="Import dashboard-managed extensions into your app."}static{this.flags={...p,...m,"client-id":u.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})}}async run(){let{flags:i}=await this.parse(h),e=await l({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),t=await x({developerPlatformClient:e.developerPlatformClient,apiKey:e.remoteApp.apiKey,organizationId:e.remoteApp.organizationId,extensionTypes:g}),n=c(t);if(n.length===0)s({headline:["No extensions to migrate."]});else{let a=await f(n);await C({...e,extensions:t,extensionTypes:a.extensionTypes,buildExtensionConfig:a.buildExtensionConfig})}return{app:e.app}}};export{o as default};
1
+ import{a as c,b as f,c as g,d as C,g as x}from"../../../chunk-3D4JXJPS.js";import{a as d}from"../../../chunk-JCL2RRU6.js";import{a as m}from"../../../chunk-AGNMOFJS.js";import{Ba as l}from"../../../chunk-54CAKCYR.js";import"../../../chunk-7ESSIN27.js";import"../../../chunk-GZS44BUW.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-7QIOUDCX.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-DCPBRWVC.js";import"../../../chunk-KR6QDE7D.js";import"../../../chunk-UXVZ2P63.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import"../../../chunk-EKXY5COY.js";import"../../../chunk-4DCQNGUV.js";import"../../../chunk-QBSKKQBN.js";import"../../../chunk-FQWB2F75.js";import"../../../chunk-XONFGLJQ.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-L2MGAEV3.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-ZSBA6VIC.js";import"../../../chunk-F2QU6WWX.js";import"../../../chunk-XULPJ6UG.js";import{b as p}from"../../../chunk-XR6GMMEU.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-MHWV5RQV.js";import"../../../chunk-XOTA6JTZ.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{v as s}from"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-WSDN25F5.js";import"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import{r as A}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-OBEWZXOQ.js";import"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YTNDFQJT.js";import"../../../chunk-ULQG3XQS.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as y,g as r}from"../../../chunk-VPRTJUIN.js";r();var u=y(A(),1);var o=class h extends d{static{this.description="Import dashboard-managed extensions into your app."}static{this.flags={...p,...m,"client-id":u.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})}}async run(){let{flags:i}=await this.parse(h),e=await l({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),t=await x({developerPlatformClient:e.developerPlatformClient,apiKey:e.remoteApp.apiKey,organizationId:e.remoteApp.organizationId,extensionTypes:g}),n=c(t);if(n.length===0)s({headline:["No extensions to migrate."]});else{let a=await f(n);await C({...e,extensions:t,extensionTypes:a.extensionTypes,buildExtensionConfig:a.buildExtensionConfig})}return{app:e.app}}};export{o as default};