@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
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License">
6
6
  <a href="https://github.com/Shopify/cli/actions/workflows/shopify-cli.yml">![badge](https://github.com/Shopify/cli/actions/workflows/shopify-cli.yml/badge.svg)</a>
7
7
 
8
- With the Shopify command line interface (Shopify CLI 3.0), you can:
8
+ With the Shopify command line interface (Shopify CLI), you can:
9
9
  - initialize, build, dev, and deploy Shopify apps, extensions, functions and themes
10
10
  - build custom storefronts and manage their hosting
11
11
 
@@ -39,7 +39,7 @@ To work with themes, the CLI needs to be installed globally with:
39
39
 
40
40
  - `npm install -g @shopify/cli`
41
41
 
42
- You can also use do it through Homebrew on macOS: `brew tap shopify/shopify && brew install shopify-cli`
42
+ You can also install it through Homebrew on macOS: `brew tap shopify/shopify && brew install shopify-cli`
43
43
 
44
44
  Learn more in the docs: [Shopify CLI for themes](https://shopify.dev/docs/storefronts/themes/tools/cli)
45
45
 
@@ -0,0 +1 @@
1
+ import{qa as a,ra as b,sa as c}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"./chunk-3TNEIDOD.js";import"./chunk-MHWV5RQV.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"./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"./chunk-VPRTJUIN.js";export{b as getEnvironmentData,c as getSensitiveEnvironmentData,a as startAnalytics};
@@ -0,0 +1 @@
1
+ import{ta as a,ua as b,va as c,wa as d,xa as e,ya 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"./chunk-3TNEIDOD.js";import"./chunk-MHWV5RQV.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"./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"./chunk-VPRTJUIN.js";export{f as compileData,c as recordError,e as recordEvent,d as recordRetry,b as recordTiming,a as reportAnalyticsEvent};
package/dist/bootstrap.js CHANGED
@@ -1,3 +1,3 @@
1
- import{a as p}from"./chunk-6HBRBQAN.js";import{a as e}from"./chunk-323UTVMM.js";import"./chunk-3TNEIDOD.js";import{a as s}from"./chunk-OUOYKNMY.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-N7RBSKYT.js";import"./chunk-IU2ZQ6TE.js";import"./chunk-PIBY5DDZ.js";import{e as m,g as t}from"./chunk-VPRTJUIN.js";t();var r=m(p(),1);import n from"fs";(0,r.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async o=>{try{let{FatalError:c}=await import("./error-IJGNYKZ3.js");if(o instanceof c){let{renderFatalError:i}=await import("./ui-GHG3UGB3.js");i(o)}else n.writeSync(process.stderr.fd,`${o.stack??o.message??o}
1
+ import{a as p}from"./chunk-6HBRBQAN.js";import{a as e}from"./chunk-XR6GMMEU.js";import"./chunk-3TNEIDOD.js";import{a as s}from"./chunk-VICYNG2W.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-ULQG3XQS.js";import"./chunk-IU2ZQ6TE.js";import"./chunk-PIBY5DDZ.js";import{e as m,g as t}from"./chunk-VPRTJUIN.js";t();var r=m(p(),1);import n from"fs";(0,r.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async o=>{try{let{FatalError:c}=await import("./error-ZRLNNGIQ.js");if(o instanceof c){let{renderFatalError:i}=await import("./ui-WRS2IDPP.js");i(o)}else n.writeSync(process.stderr.fd,`${o.stack??o.message??o}
2
2
  `)}catch{n.writeSync(process.stderr.fd,`${o.stack??o.message??o}
3
3
  `)}process.exit(1)});var f=["SIGINT","SIGTERM","SIGQUIT"];f.forEach(o=>{process.on(o,()=>{process.exit(1)})});var a=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(a)||(process.stdout.columns=a);async function l({development:o}){await e({moduleURL:import.meta.url,development:o,lazyCommandLoader:s})}var S=l;export{S as default};
@@ -1,4 +1,4 @@
1
- import{C as s,u as e,v as o,w as n,x as i,y as t}from"./chunk-BDVAE5MS.js";import{d,g as l}from"./chunk-JPGO36XP.js";import{g as r}from"./chunk-VPRTJUIN.js";r();async function u(){e({headline:"CLI update available.",body:["Run",{command:"npm run shopify upgrade"},{char:"."}]}),e({headline:["To connect this project to your shopify store cd into:",{filePath:"/my-store/hydrogen.config.js"},{char:"."}],body:["You can also try the following steps:",{list:{items:[["Run",{command:"shopify project connect"}],["Run",{command:"hydrogen start"}]]}}]}),e({headline:"About your app.",customSections:[{body:{tabularData:[["Configuration file",{filePath:"shopify.app.scalable-transaction-app.toml"}],["App name",{userInput:"scalable-transaction-app"}],["Access scopes","read_products,write_products"]],firstColumnSubdued:!0}}]}),e({headline:[{userInput:"my-app"},"initialized and ready to build."],nextSteps:[["Run",{command:"cd verification-app"}],["To preview your project, run",{command:"npm app dev"}],["To add extensions, run",{command:"npm generate extension"}]],reference:[["Run",{command:"npm shopify help"}],{link:{label:"Dev docs",url:"https://shopify.dev"}}],customSections:[{title:"Custom section",body:{list:{items:[{link:{label:"Item 1",url:"https://shopify.com"}},"Item 2",{link:{url:"https://community.shopify.com/"}}]}}},{title:"Custom section 2",body:{list:{items:["Item 1","Item 2","Item 3"]}}}]}),o({headline:"CLI updated.",body:"You are now running version 3.47."}),o({headline:"Deployment successful.",body:"Your extensions have been uploaded to your Shopify Partners Dashboard.",nextSteps:[{link:{label:"See your deployment and set it live",url:"https://partners.shopify.com/1797046/apps/4523695/deployments"}}]}),n({headline:"You have reached your limit of checkout extensions for this app.",body:"You can free up space for a new one by deleting an existing one."}),n({headline:"Required access scope update.",body:"The deadline for re-selecting your app scopes is May 1, 2022.",reference:[{link:{label:"Dev docs",url:"https://shopify.dev/app/scopes"}}]});let a=new l("Something went wrong.");a.stack=`
1
+ import{C as s,u as e,v as o,w as n,x as i,y as t}from"./chunk-6G6TMKXF.js";import{d,g as l}from"./chunk-M56NDIMD.js";import{g as r}from"./chunk-VPRTJUIN.js";r();async function u(){e({headline:"CLI update available.",body:["Run",{command:"npm run shopify upgrade"},{char:"."}]}),e({headline:["To connect this project to your shopify store cd into:",{filePath:"/my-store/hydrogen.config.js"},{char:"."}],body:["You can also try the following steps:",{list:{items:[["Run",{command:"shopify project connect"}],["Run",{command:"hydrogen start"}]]}}]}),e({headline:"About your app.",customSections:[{body:{tabularData:[["Configuration file",{filePath:"shopify.app.scalable-transaction-app.toml"}],["App name",{userInput:"scalable-transaction-app"}],["Access scopes","read_products,write_products"]],firstColumnSubdued:!0}}]}),e({headline:[{userInput:"my-app"},"initialized and ready to build."],nextSteps:[["Run",{command:"cd verification-app"}],["To preview your project, run",{command:"npm app dev"}],["To add extensions, run",{command:"npm generate extension"}]],reference:[["Run",{command:"npm shopify help"}],{link:{label:"Dev docs",url:"https://shopify.dev"}}],customSections:[{title:"Custom section",body:{list:{items:[{link:{label:"Item 1",url:"https://shopify.com"}},"Item 2",{link:{url:"https://community.shopify.com/"}}]}}},{title:"Custom section 2",body:{list:{items:["Item 1","Item 2","Item 3"]}}}]}),o({headline:"CLI updated.",body:"You are now running version 3.47."}),o({headline:"Deployment successful.",body:"Your extensions have been uploaded to your Shopify Partners Dashboard.",nextSteps:[{link:{label:"See your deployment and set it live",url:"https://partners.shopify.com/1797046/apps/4523695/deployments"}}]}),n({headline:"You have reached your limit of checkout extensions for this app.",body:"You can free up space for a new one by deleting an existing one."}),n({headline:"Required access scope update.",body:"The deadline for re-selecting your app scopes is May 1, 2022.",reference:[{link:{label:"Dev docs",url:"https://shopify.dev/app/scopes"}}]});let a=new l("Something went wrong.");a.stack=`
2
2
  Error: Unexpected error
3
3
  at Module._compile (internal/modules/cjs/loader.js:1137:30)
4
4
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
@@ -1 +1 @@
1
- import{a as i}from"./chunk-A74GETYC.js";import{b as e}from"./chunk-YZDDTYTU.js";import{g as o}from"./chunk-VPRTJUIN.js";o();var t=class extends e{static{this.description="View the UI kit components prompts"}static{this.hidden=!0}async run(){await i()}};export{t as a};
1
+ import{a as i}from"./chunk-KHSYW7I4.js";import{b as e}from"./chunk-XOTA6JTZ.js";import{g as o}from"./chunk-VPRTJUIN.js";o();var t=class extends e{static{this.description="View the UI kit components prompts"}static{this.hidden=!0}async run(){await i()}};export{t as a};
@@ -1,2 +1,2 @@
1
- import{X as j,ha as H,ia as G,ja as w,ka as X,la as A,ma as B,na as v,oa as J,pa as F,qa as W,ra as k,sa as q,ta as R,ua as K}from"./chunk-SBEZBZM7.js";import{b as T,e as $,l}from"./chunk-DJQVNH7P.js";import{c as z}from"./chunk-HUZUORYM.js";import{v as I,z as x}from"./chunk-BDVAE5MS.js";import{d as _,f as V}from"./chunk-JPGO36XP.js";import{$ as E,Ib as U,Ta as O,Y as a,qa as N,wa as S,ya as M}from"./chunk-GFEAKSGV.js";import{d as y,j as L}from"./chunk-IU2ZQ6TE.js";import{g as s}from"./chunk-VPRTJUIN.js";s();s();function Q(e){switch(e){case"payments_app":return w;case"payments_app_credit_card":return k;case"payments_app_custom_credit_card":return F;case"payments_app_custom_onsite":return v;case"payments_app_redeemable":return A;case"payments_app_card_present":return R}}function Y(e,i){let t=e.activeVersion?.context??e.draftVersion?.context??Q(e.type);switch(t){case w:return C(e,i,X);case k:return C(e,i,q);case F:return C(e,i,W);case v:return C(e,i,J);case A:return C(e,i,B);case R:return C(e,i,K);default:throw new Error(`Unsupported extension: ${t}`)}}function C(e,i,t){let o=(e.activeVersion??e.draftVersion)?.config;if(!o)throw new Error("No config found for extension");let r=JSON.parse(o),p=t(r,i);p&&delete p.api_version;let c=e.activeVersion?.context??e.draftVersion?.context??Q(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:a(e.title.substring(0,l)),...p,targeting:[{target:`${c}`}]}]}}s();s();var pe=new Map(G.map(e=>[e[1],e[0]])),ce=(e,i)=>{let t=pe.get(e.uiType);if(!t)throw new _(`Field type ${e.uiType} is not supported`);let n={key:e.name,description:e.description??void 0,type:t};return i==="flow_action_definition"&&(n.name=e.label,n.required=e.required),n},me=(e,i)=>{let o={type:i==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return i==="flow_action_definition"&&(o.required=e.required),e.uiType==="marketing-activity-id"&&(o.marketingActivityCreateUrl=e.marketingActivityCreateUrl,o.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),o},Z=(e,i)=>i?i.map(n=>n.uiType==="commerce-object-id"||n.uiType==="marketing-activity-id"||H.includes(n.uiType)?me(n,e):ce(n,e)):[];function ee(e){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let t=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,n;if(e.type==="flow_trigger_discovery_webhook"){let o=JSON.parse(i);n={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:a(e.title.substring(0,l)),url:o.url}]}}else{let o=JSON.parse(i),r=Z(e.type,o.fields??[]);n={extensions:[{type:e.type.replace("_definition",""),name:o.title,handle:a(e.title.substring(0,l)),description:o.description,runtime_url:o.url??t,config_page_url:o.custom_configuration_page_url,config_page_preview_url:o.custom_configuration_page_preview_url,validation_url:o.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return n}s();s();var ie=e=>{let i=e.split("#");if(i.length!==2||i.some(p=>p===""||p===void 0))throw new Error("Invalid context");let t="admin",n=ue(i[0]??""),o=de(i[1]??""),r="link";return o==="selection"?[t,`${n}-index`,`${o}-action`,r].join("."):[t,`${n}-${o}`,"action",r].join(".")},de=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},ue=e=>e.toLocaleLowerCase()==="variants"?"product-variant":E(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function te(e,i,t){let n=e.activeVersion?.config??e.draftVersion?.config;if(!n)throw new Error("No config found for extension");let o=e.activeVersion?.context??e.draftVersion?.context;if(!o)throw new Error("No context found for link extension");let r=JSON.parse(n);if(t.embedded)try{let c=new URL(r.url),m=c.pathname.startsWith("/")?c.pathname.substring(1):c.pathname,d=new URL(`app://${m}`);d.search=c.search,d.hash=c.hash,r.url=d.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:a(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(o)}]}]}}s();var fe={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},ge={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let i=new URL(e);return i.pathname+i.search+i.hash}function ne(e){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let t=JSON.parse(i);return{extensions:[{type:"marketing_activity",name:e.title,handle:a(e.title.substring(0,l)),title:t.title,description:t.description,api_path:ye(t.app_api_url),tactic:t.tactic,marketing_channel:fe[t.platform]??"",referring_domain:ge[t.platform]??"",is_automation:t.is_automation,use_external_editor:t.use_external_editor,preview_data:t.preview_data,fields:t.fields.map(({id:o,...r})=>r)}]}}s();function oe(e){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let t=JSON.parse(i);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:a(e.title.substring(0,l)),pattern:t.pattern}]}}var P=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Y},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:ee},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:ne},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:oe},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:te}];function re(e){return P.filter(i=>i.extensionTypes.some(t=>e.some(n=>n.type.toLowerCase()===t.toLowerCase())))}async function yi(e){if(e.length===1&&e[0])return e[0];let i=e.map(o=>({label:o.label,value:o.value})),t=await x({message:"Extension type to migrate",choices:i}),n=e.find(o=>o.value===t);if(n===void 0)throw new _("Invalid migration choice");return n}s();var Di=P.flatMap(e=>e.extensionTypes);async function _e({name:e,app:i}){let t=E(e),n=y(i.directory,$.extensions.directoryName,t);if(await O(n)){let o=[{label:"Overwrite local TOML with remote configuration",value:"write"},{label:"Keep local TOML",value:"skip"},{label:"Cancel",value:"cancel"}],r=await x({message:`Directory "${t}" already exists. What would you like to do?`,choices:o});if(r==="cancel")throw new V;return{directory:n,action:r}}return await S(n),await N(y(n,T.lockFile)),{directory:n,action:"write"}}async function Ce(e){let{app:i,remoteApp:t,developerPlatformClient:n,extensionTypes:o,extensions:r,buildExtensionConfig:p,all:c}=e,m=r.filter(u=>o.includes(u.type.toLowerCase()));if(m=xe(i,m),m.length===0)throw new _("No extensions to migrate");if(!c){let u=m.map(g=>({label:g.title,value:g.uuid}));m.length>1&&u.push({label:"All",value:"All"});let f=await x({message:"Extensions to migrate",choices:u});f!=="All"&&(m=[m.find(g=>g?.uuid===f)])}let d={},b=m.map(async u=>{let{directory:f,action:g}=await _e({app:i,name:u.title}),se=a(u.title.substring(0,l));if(d[se]=u.uuid,g==="write"){let D=p(u,r,i.configuration),ae=y(f,"shopify.extension.toml");await new z(ae,D).replace(D);let le=y(f,T.lockFile);await M(le)}return{extension:u,directory:y("extensions",L(f))}}),h=await Promise.all(b);Ee(h),await j({app:i,identifiers:{extensions:d,app:t.apiKey},command:"import-extensions",developerPlatformClient:n})}function xe(e,i){let t=e.dotenv?.variables??{},n=e.allExtensions.map(o=>t[o.idEnvironmentVariableName]);return i.filter(o=>!n.includes(o.uuid))}async function Li(e){let i=re(e.extensions);await Promise.all(i.map(async t=>Ce({...e,extensionTypes:t.extensionTypes,buildExtensionConfig:t.buildExtensionConfig,all:!0})))}function Ee(e){I({headline:["Imported the following extensions from the dashboard:"],body:e.map(i=>U`• "${i.extension.title}" at: ${i.directory}`.value).join(`
1
+ import{X as j,ha as H,ia as G,ja as w,ka as X,la as A,ma as B,na as v,oa as J,pa as F,qa as W,ra as k,sa as q,ta as R,ua as K}from"./chunk-54CAKCYR.js";import{b as T,e as $,l}from"./chunk-7ESSIN27.js";import{c as z}from"./chunk-4DCQNGUV.js";import{v as I,z as x}from"./chunk-6G6TMKXF.js";import{d as _,f as V}from"./chunk-M56NDIMD.js";import{$ as E,Ib as U,Ta as O,Y as a,qa as N,wa as S,ya as M}from"./chunk-N5PQPIBF.js";import{d as y,j as L}from"./chunk-IU2ZQ6TE.js";import{g as s}from"./chunk-VPRTJUIN.js";s();s();function Q(e){switch(e){case"payments_app":return w;case"payments_app_credit_card":return k;case"payments_app_custom_credit_card":return F;case"payments_app_custom_onsite":return v;case"payments_app_redeemable":return A;case"payments_app_card_present":return R}}function Y(e,i){let t=e.activeVersion?.context??e.draftVersion?.context??Q(e.type);switch(t){case w:return C(e,i,X);case k:return C(e,i,q);case F:return C(e,i,W);case v:return C(e,i,J);case A:return C(e,i,B);case R:return C(e,i,K);default:throw new Error(`Unsupported extension: ${t}`)}}function C(e,i,t){let o=(e.activeVersion??e.draftVersion)?.config;if(!o)throw new Error("No config found for extension");let r=JSON.parse(o),p=t(r,i);p&&delete p.api_version;let c=e.activeVersion?.context??e.draftVersion?.context??Q(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:a(e.title.substring(0,l)),...p,targeting:[{target:`${c}`}]}]}}s();s();var pe=new Map(G.map(e=>[e[1],e[0]])),ce=(e,i)=>{let t=pe.get(e.uiType);if(!t)throw new _(`Field type ${e.uiType} is not supported`);let n={key:e.name,description:e.description??void 0,type:t};return i==="flow_action_definition"&&(n.name=e.label,n.required=e.required),n},me=(e,i)=>{let o={type:i==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return i==="flow_action_definition"&&(o.required=e.required),e.uiType==="marketing-activity-id"&&(o.marketingActivityCreateUrl=e.marketingActivityCreateUrl,o.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),o},Z=(e,i)=>i?i.map(n=>n.uiType==="commerce-object-id"||n.uiType==="marketing-activity-id"||H.includes(n.uiType)?me(n,e):ce(n,e)):[];function ee(e){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let t=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,n;if(e.type==="flow_trigger_discovery_webhook"){let o=JSON.parse(i);n={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:a(e.title.substring(0,l)),url:o.url}]}}else{let o=JSON.parse(i),r=Z(e.type,o.fields??[]);n={extensions:[{type:e.type.replace("_definition",""),name:o.title,handle:a(e.title.substring(0,l)),description:o.description,runtime_url:o.url??t,config_page_url:o.custom_configuration_page_url,config_page_preview_url:o.custom_configuration_page_preview_url,validation_url:o.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return n}s();s();var ie=e=>{let i=e.split("#");if(i.length!==2||i.some(p=>p===""||p===void 0))throw new Error("Invalid context");let t="admin",n=ue(i[0]??""),o=de(i[1]??""),r="link";return o==="selection"?[t,`${n}-index`,`${o}-action`,r].join("."):[t,`${n}-${o}`,"action",r].join(".")},de=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},ue=e=>e.toLocaleLowerCase()==="variants"?"product-variant":E(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function te(e,i,t){let n=e.activeVersion?.config??e.draftVersion?.config;if(!n)throw new Error("No config found for extension");let o=e.activeVersion?.context??e.draftVersion?.context;if(!o)throw new Error("No context found for link extension");let r=JSON.parse(n);if(t.embedded)try{let c=new URL(r.url),m=c.pathname.startsWith("/")?c.pathname.substring(1):c.pathname,d=new URL(`app://${m}`);d.search=c.search,d.hash=c.hash,r.url=d.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:a(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(o)}]}]}}s();var fe={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},ge={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let i=new URL(e);return i.pathname+i.search+i.hash}function ne(e){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let t=JSON.parse(i);return{extensions:[{type:"marketing_activity",name:e.title,handle:a(e.title.substring(0,l)),title:t.title,description:t.description,api_path:ye(t.app_api_url),tactic:t.tactic,marketing_channel:fe[t.platform]??"",referring_domain:ge[t.platform]??"",is_automation:t.is_automation,use_external_editor:t.use_external_editor,preview_data:t.preview_data,fields:t.fields.map(({id:o,...r})=>r)}]}}s();function oe(e){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let t=JSON.parse(i);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:a(e.title.substring(0,l)),pattern:t.pattern}]}}var P=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Y},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:ee},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:ne},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:oe},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:te}];function re(e){return P.filter(i=>i.extensionTypes.some(t=>e.some(n=>n.type.toLowerCase()===t.toLowerCase())))}async function yi(e){if(e.length===1&&e[0])return e[0];let i=e.map(o=>({label:o.label,value:o.value})),t=await x({message:"Extension type to migrate",choices:i}),n=e.find(o=>o.value===t);if(n===void 0)throw new _("Invalid migration choice");return n}s();var Di=P.flatMap(e=>e.extensionTypes);async function _e({name:e,app:i}){let t=E(e),n=y(i.directory,$.extensions.directoryName,t);if(await O(n)){let o=[{label:"Overwrite local TOML with remote configuration",value:"write"},{label:"Keep local TOML",value:"skip"},{label:"Cancel",value:"cancel"}],r=await x({message:`Directory "${t}" already exists. What would you like to do?`,choices:o});if(r==="cancel")throw new V;return{directory:n,action:r}}return await S(n),await N(y(n,T.lockFile)),{directory:n,action:"write"}}async function Ce(e){let{app:i,remoteApp:t,developerPlatformClient:n,extensionTypes:o,extensions:r,buildExtensionConfig:p,all:c}=e,m=r.filter(u=>o.includes(u.type.toLowerCase()));if(m=xe(i,m),m.length===0)throw new _("No extensions to migrate");if(!c){let u=m.map(g=>({label:g.title,value:g.uuid}));m.length>1&&u.push({label:"All",value:"All"});let f=await x({message:"Extensions to migrate",choices:u});f!=="All"&&(m=[m.find(g=>g?.uuid===f)])}let d={},b=m.map(async u=>{let{directory:f,action:g}=await _e({app:i,name:u.title}),se=a(u.title.substring(0,l));if(d[se]=u.uuid,g==="write"){let D=p(u,r,i.configuration),ae=y(f,"shopify.extension.toml");await new z(ae,D).replace(D);let le=y(f,T.lockFile);await M(le)}return{extension:u,directory:y("extensions",L(f))}}),h=await Promise.all(b);Ee(h),await j({app:i,identifiers:{extensions:d,app:t.apiKey},command:"import-extensions",developerPlatformClient:n})}function xe(e,i){let t=e.dotenv?.variables??{},n=e.allExtensions.map(o=>t[o.idEnvironmentVariableName]);return i.filter(o=>!n.includes(o.uuid))}async function Li(e){let i=re(e.extensions);await Promise.all(i.map(async t=>Ce({...e,extensionTypes:t.extensionTypes,buildExtensionConfig:t.buildExtensionConfig,all:!0})))}function Ee(e){I({headline:["Imported the following extensions from the dashboard:"],body:e.map(i=>U`• "${i.extension.title}" at: ${i.directory}`.value).join(`
2
2
  `)})}s();async function Mi({developerPlatformClient:e,apiKey:i,organizationId:t,extensionTypes:n,onlyDashboardManaged:o=!1}){let r=await e.appExtensionRegistrations({id:i,apiKey:i,organizationId:t}),{dashboardManagedExtensionRegistrations:p,extensionRegistrations:c}=r.app;return(o?p:c.concat(p)).filter(d=>{let b=n.includes(d.type.toLowerCase()),h=d.activeVersion&&d.activeVersion.config,u=d.draftVersion&&d.draftVersion.config;return b&&(h??u)})}export{re as a,yi as b,Di as c,Ce as d,xe as e,Li as f,Mi as g};
@@ -1 +1 @@
1
- import{a as r,b as c,e as s}from"./chunk-SBEZBZM7.js";import{O as o}from"./chunk-BDVAE5MS.js";import{d as a}from"./chunk-IU2ZQ6TE.js";import{g as u}from"./chunk-VPRTJUIN.js";u();async function h(n){if(n.features.includes("function")&&n.isJavaScript){let i=await s(n);return r(i.functionRunner)}return r()}function p(n){return n.configuration.build?.path?a(n.directory,n.configuration.build.path):n.outputPath}async function P(n){let i=n.functionExtension,e=await h(i);await c(e);let t=[];n.inputPath&&t.push("--input",n.inputPath),n.export&&t.push("--export",n.export),n.json&&t.push("--json"),n.schemaPath&&n.queryPath&&(t.push("--schema-path",n.schemaPath),t.push("--query-path",n.queryPath));let f=p(i);return o(e.path,["-f",f,...t],{cwd:n.functionExtension.directory,stdin:n.stdin,stdout:n.stdout??"inherit",stderr:n.stderr??"inherit",input:n.input})}export{P as a};
1
+ import{a as r,b as c,e as s}from"./chunk-54CAKCYR.js";import{O as o}from"./chunk-6G6TMKXF.js";import{d as a}from"./chunk-IU2ZQ6TE.js";import{g as u}from"./chunk-VPRTJUIN.js";u();async function h(n){if(n.features.includes("function")&&n.isJavaScript){let i=await s(n);return r(i.functionRunner)}return r()}function p(n){return n.configuration.build?.path?a(n.directory,n.configuration.build.path):n.outputPath}async function P(n){let i=n.functionExtension,e=await h(i);await c(e);let t=[];n.inputPath&&t.push("--input",n.inputPath),n.export&&t.push("--export",n.export),n.json&&t.push("--json"),n.schemaPath&&n.queryPath&&(t.push("--schema-path",n.schemaPath),t.push("--query-path",n.queryPath));let f=p(i);return o(e.path,["-f",f,...t],{cwd:n.functionExtension.directory,stdin:n.stdin,stdout:n.stdout??"inherit",stderr:n.stderr??"inherit",input:n.input})}export{P as a};
@@ -1,4 +1,4 @@
1
- import{Ta as j,ma as w,ua as R}from"./chunk-GFEAKSGV.js";import{a as H,c as f,e as G,g as o}from"./chunk-VPRTJUIN.js";var X=f((Ct,k)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;k.exports=A});var te=f((wt,ee)=>{"use strict";o();ee.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((At,re)=>{"use strict";o();re.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ie=f((bt,se)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};se.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ae=f((Et,he)=>{"use strict";o();var ne=y(),Fe=global.Date,v=class extends Fe{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${ne(2,this.getUTCMonth()+1)}-${ne(2,this.getUTCDate())}`}};he.exports=e=>{let t=new v(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var le=f((Nt,oe)=>{"use strict";o();var N=y(),W=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};oe.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(X());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=te(),createDateTimeFloat=ie(),createDate=ae(),createTime=le(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
1
+ import{Ta as j,ma as w,ua as R}from"./chunk-N5PQPIBF.js";import{a as H,c as f,e as G,g as o}from"./chunk-VPRTJUIN.js";var X=f((Ct,k)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;k.exports=A});var te=f((wt,ee)=>{"use strict";o();ee.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((At,re)=>{"use strict";o();re.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ie=f((bt,se)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};se.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ae=f((Et,he)=>{"use strict";o();var ne=y(),Fe=global.Date,v=class extends Fe{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${ne(2,this.getUTCMonth()+1)}-${ne(2,this.getUTCDate())}`}};he.exports=e=>{let t=new v(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var le=f((Nt,oe)=>{"use strict";o();var N=y(),W=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};oe.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(X());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=te(),createDateTimeFloat=ie(),createDate=ae(),createTime=le(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
2
2
  `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],h=tomlType(r);if(i!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${h}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var L=f((St,ce)=>{"use strict";o();ce.exports=$e;function $e(e,t){if(e.pos==null||e.line==null)return e;let s=e.message;if(s+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
3
3
  `,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,h=" ";for(;h.length<i;)h+=" ";for(let n=Math.max(0,e.line-1);n<Math.min(r.length,e.line+2);++n){let a=String(n+1);if(a.length<i&&(a=" "+a),e.line===n){s+=a+"> "+r[n]+`
4
4
  `,s+=h+" ";for(let l=0;l<e.col;++l)s+=" ";s+=`^
@@ -1 +1 @@
1
- import{B as l,C as f,D as m,E as d,J as p,y as u}from"./chunk-B2EHO7ZC.js";import{h as n}from"./chunk-GOJ2QHSR.js";import{b as g}from"./chunk-YZDDTYTU.js";import{F as S,z as h}from"./chunk-BDVAE5MS.js";import{r as C}from"./chunk-LDGAHMS7.js";import{Pb as w}from"./chunk-GFEAKSGV.js";import{e as L,g as i}from"./chunk-VPRTJUIN.js";i();i();var r="NEW_LOGIN";function N(e,t){let s=[],o=e[t];if(o)for(let[c,I]of Object.entries(o))s.push({label:I.identity.alias??c,value:c});return s}async function b(){let e=await p({},{forceNewSession:!0}),t=await f(e.userId);if(!t){let s=await S({message:"Enter an alias for this account (e.g. your email or a nickname)"});return await m(e.userId,s),s}return t}async function v(){let e=await l(),t=await u(),s=[];return e&&s.push(...N(e,t)),s.length>0&&s.push({label:"Log in with a different account",value:r}),s}async function y(e){if(e){let o=await d(e);if(o)return n(o),e}let t=await v(),s=r;return t.length>0&&(s=await h({message:"Which account would you like to use?",choices:t})),s===r?b():(n(s),t.find(o=>o.value===s)?.label??s)}var A=L(C(),1);var a=class e extends g{static{this.description="Logs you in to your Shopify account."}static{this.flags={alias:A.Flags.string({description:"Alias of the session you want to login to.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})}}async run(){let{flags:t}=await this.parse(e),s=await y(t.alias);w(`Current account: ${s}.`)}};export{a};
1
+ import{B as l,C as f,D as m,E as d,J as p,y as u}from"./chunk-XONFGLJQ.js";import{h as n}from"./chunk-ZSBA6VIC.js";import{b as g}from"./chunk-XOTA6JTZ.js";import{F as S,z as h}from"./chunk-6G6TMKXF.js";import{r as C}from"./chunk-LDGAHMS7.js";import{Pb as w}from"./chunk-N5PQPIBF.js";import{e as L,g as i}from"./chunk-VPRTJUIN.js";i();i();var r="NEW_LOGIN";function N(e,t){let s=[],o=e[t];if(o)for(let[c,I]of Object.entries(o))s.push({label:I.identity.alias??c,value:c});return s}async function b(){let e=await p({},{forceNewSession:!0}),t=await f(e.userId);if(!t){let s=await S({message:"Enter an alias for this account (e.g. your email or a nickname)"});return await m(e.userId,s),s}return t}async function v(){let e=await l(),t=await u(),s=[];return e&&s.push(...N(e,t)),s.length>0&&s.push({label:"Log in with a different account",value:r}),s}async function y(e){if(e){let o=await d(e);if(o)return n(o),e}let t=await v(),s=r;return t.length>0&&(s=await h({message:"Which account would you like to use?",choices:t})),s===r?b():(n(s),t.find(o=>o.value===s)?.label??s)}var A=L(C(),1);var a=class e extends g{static{this.description="Logs you in to your Shopify account."}static{this.flags={alias:A.Flags.string({description:"Alias of the session you want to login to.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})}}async run(){let{flags:t}=await this.parse(e),s=await y(t.alias);w(`Current account: ${s}.`)}};export{a};
@@ -1,4 +1,4 @@
1
- import{A as Bt,B as Io,C as J,D as To,E as ko,F as Fo,G as $t,K as Mo,L as Do,M as Ro,N as Oo,O as Uo,P as Bo,Q as $o,S as Lo,T as jo,V as No,X as Wo,a as bn,b as z,c as Oe,g as Ot,h as Eo,i as Cn,j as wn,l as Ut,m as So,n as ye,o as Po,p as En,q as vo,r as R,s as Ue,t as Be,u as Ao,v as ie,w as $e,x as k,y as oe,z as he}from"./chunk-DJQVNH7P.js";import{a as go,b as Pp,c as vp,d as yo,e as ho,f as _o,g as xn,h as xo,i as bo,j as nt,k as Co,l as Ap,m as Rt,n as wo}from"./chunk-66RJ5T7A.js";import{a as fo,b as mo}from"./chunk-ELYP4KFP.js";import{b as uo,o as Sp}from"./chunk-7MUKLZOL.js";import{a as Ep}from"./chunk-VBUZWRUL.js";import{a as lo}from"./chunk-R466TU3N.js";import{aa as wp}from"./chunk-UGXYQ23Y.js";import{a as co}from"./chunk-TQYMC7TH.js";import{b as tt,c as U}from"./chunk-HUZUORYM.js";import{a as ao}from"./chunk-XLELNRFF.js";import{$ as It,H as Wi,I as Vi,N as zi,Z as fe,_ as me,aa as Ji,ba as W,da as Ze,ea as qi,j as Bi,n as $i,p as Li,r as p,t as ji,z as Ni}from"./chunk-B2EHO7ZC.js";import{m as Tt,n as Ki,s as Hi,t as Gi,w as kt,x as Yi}from"./chunk-LAZJ47DZ.js";import{a as le,b as ve}from"./chunk-XNO6DZYP.js";import{b as gn}from"./chunk-4HHXSMD7.js";import{b as po}from"./chunk-YZDDTYTU.js";import{a as Ye,c as Ui,d as At}from"./chunk-JUVAGMIH.js";import{A as $,B as De,D as eo,F as et,G as to,I as no,O as ge,R as io,u as Qe,v as Xe,w as Ft,x as Qi,z as Xi}from"./chunk-BDVAE5MS.js";import{a as Zi,f as yn}from"./chunk-IASVAERO.js";import{d as b,f as V,g as Q}from"./chunk-JPGO36XP.js";import{$ as mn,$a as te,Ba as Fi,Ea as de,Ga as Et,Gb as v,Hb as Mt,Ib as A,Ka as Mi,L as Pe,La as Di,N as Ii,Nb as Re,O as un,Oa as St,P as dn,Pa as Ri,Pb as Dt,Qb as S,Rb as ue,Ta as w,Tb as ro,Ua as H,Ub as so,W as He,Wa as D,Xa as Oi,Y as j,Z as fn,ba as bt,bb as Pt,db as vt,ea as Ti,fa as Me,ka as Ct,ma as F,na as ce,oa as Ge,pa as N,qa as wt,tb as ne,ua as B,va as ki,wa as Z}from"./chunk-GFEAKSGV.js";import{m as hn,n as _n,o as oo}from"./chunk-YC6G4MHD.js";import{a as Ke}from"./chunk-N7RBSKYT.js";import{d as y,e as Se,f as pe,g as I,h as Pi,i as P,j as T,k as _t,l as vi,n as xt,s as Ai,t as ln}from"./chunk-IU2ZQ6TE.js";import{a as Si,e as qe,g as u}from"./chunk-VPRTJUIN.js";u();import{pipeline as Ip}from"stream/promises";import Vo from"node:stream/promises";import*as zo from"node:zlib";import{fileURLToPath as An}from"node:url";var Jo="9.1.2",qo="7.0.1",Ko="3",Tp="123.0.0",Ho="1.0.2",Go="2.0.1";function Yo(e){return e==="0"||e==="1"?{functionRunner:"7.0.1",javy:"4.0.0",javyPlugin:"1"}:e==="2"?{functionRunner:Jo,javy:qo,javyPlugin:Ko}:null}var it=class{constructor(t,n,i,o,r=`v${n}`){this.name=t,this.version=n,this.release=r,this.supportsWindowsOnArm=o;let s;s=`${t}-${n}`,s=process.platform==="win32"?`${s}.exe`:s,this.path=y(P(An(import.meta.url)),"..","bin",s),this.gitHubRepo=i}downloadUrl(t,n){let i,o;switch(t.toLowerCase()){case"darwin":i="macos";break;case"linux":i="linux";break;case"win32":i="windows";break;default:throw Error(`Unsupported platform ${t}`)}switch(n.toLowerCase()){case"arm":case"arm64":o="arm";break;case"ia32":case"x64":o="x86_64";break;default:throw Error(`Unsupported architecture ${n}`)}let r=`${o}-${i}`,s=["arm-linux","arm-macos","x86_64-macos","x86_64-windows","x86_64-linux"];if(this.supportsWindowsOnArm&&s.push("arm-windows"),!s.includes(r))throw Error(`Unsupported platform/architecture combination ${t}/${n}`);return`https://github.com/${this.gitHubRepo}/releases/download/${this.release}/${this.name}-${r}-v${this.version}.gz`}async processResponse(t,n){return Fp(t,n)}},Pn=class{constructor(t){this.name=`shopify_functions_javy_v${t}`,this.version=t,this.path=y(P(An(import.meta.url)),"..","bin",`shopify_functions_javy_v${t}.wasm`)}downloadUrl(t,n){return`https://cdn.shopify.com/shopifycloud/shopify-functions-javy-plugin/shopify_functions_javy_v${this.version}.wasm`}async processResponse(t,n){return Ip(t,n)}},vn=class{constructor(t,n){this.name=t,this.version=n,this.path=y(P(An(import.meta.url)),"..","bin",t)}downloadUrl(t,n){return`https://cdn.jsdelivr.net/npm/binaryen@${this.version}/bin/wasm-opt`}async processResponse(t,n){await Vo.pipeline(t,n)}},Sn;function In(e=qo){return new it("javy",e,"bytecodealliance/javy",kt(e,">=7.0.0"))}function Tn(e=Ko){return new Pn(e)}function Zd(e=Jo){return new it("function-runner",e,"Shopify/function-runner",kt(e,">=9.1.1"))}function ot(){return Sn||(Sn=new vn("wasm-opt.cjs",Tp)),Sn}function Zo(e){return new it("shopify-function-trampoline",e,"Shopify/shopify-function-wasm-api",kt(e,">=2.0.1"),`shopify_function_trampoline/v${e}`)}var Lt=new Map;async function Ae(e){if(await w(e.path)&&!Lt.has(e.path))return;let n=Lt.get(e.path);if(n){await n;return}let i=kp(e);Lt.set(e.path,i);try{await i}finally{Lt.delete(e.path)}}async function kp(e){let t=e.downloadUrl(process.platform,process.arch);S(`Downloading ${e.name} ${e.version} from ${t} to ${e.path}`);let n=P(e.path);await w(n)||await Z(n),await go(async()=>{let i=await $i(t,void 0,"slow-request");if(i.status!==200)throw new Error(`Downloading ${e.name} failed with status code of ${i.status}`);let o=i.body;if(o===null)throw new Error(`Downloading ${e.name} failed with empty response body`);await Ct(async r=>{let s=y(r,"binary"),a=Di(s);await e.processResponse(o,a),await Ri(s,509),await St(s,e.path,{overwrite:!0})})},async()=>{},2)}async function Fp(e,t){let n=zo.createGunzip();await Vo.pipeline(e,n,t)}u();import{build as Xo}from"esbuild";var Mp="2",rt=class extends b{constructor(t){super(t,A`Make sure you have a compatible version of the ${v.yellow("@shopify/shopify_function")} library installed.`,[A`Add ${v.green(`"@shopify/shopify_function": "~${Mp}.0.0"`)} to the dependencies section of the package.json file in your function's directory, if not already present.`.value,"Run your package manager's install command to update dependencies."])}};async function er(e,t){let n=$p(e),i=n.length===0?Bp:new kn(n),o=await nr(e);return t.useTasks?Rp(e,t,i,o):Dp(e,t,i,o)}async function Dp(e,t,n,i){t.signal?.aborted||(t.stdout.write(`Building function ${e.localIdentifier}...`),t.stdout.write(`Building GraphQL types...
1
+ import{A as Bt,B as Io,C as J,D as To,E as ko,F as Fo,G as $t,K as Mo,L as Do,M as Ro,N as Oo,O as Uo,P as Bo,Q as $o,S as Lo,T as jo,V as No,X as Wo,a as bn,b as z,c as Oe,g as Ot,h as Eo,i as Cn,j as wn,l as Ut,m as So,n as ye,o as Po,p as En,q as vo,r as R,s as Ue,t as Be,u as Ao,v as ie,w as $e,x as k,y as oe,z as he}from"./chunk-7ESSIN27.js";import{a as go,b as Pp,c as vp,d as yo,e as ho,f as _o,g as xn,h as xo,i as bo,j as nt,k as Co,l as Ap,m as Rt,n as wo}from"./chunk-GZS44BUW.js";import{a as fo,b as mo}from"./chunk-7QIOUDCX.js";import{b as uo,o as Sp}from"./chunk-7MUKLZOL.js";import{a as Ep}from"./chunk-VBUZWRUL.js";import{a as lo}from"./chunk-KR6QDE7D.js";import{aa as wp}from"./chunk-UXVZ2P63.js";import{a as co}from"./chunk-EKXY5COY.js";import{b as tt,c as U}from"./chunk-4DCQNGUV.js";import{a as ao}from"./chunk-FQWB2F75.js";import{$ as It,H as Wi,I as Vi,N as zi,Z as fe,_ as me,aa as Ji,ba as W,da as Ze,ea as qi,j as Bi,n as $i,p as Li,r as p,t as ji,z as Ni}from"./chunk-XONFGLJQ.js";import{m as Tt,n as Ki,s as Hi,t as Gi,w as kt,x as Yi}from"./chunk-L2MGAEV3.js";import{a as le,b as ve}from"./chunk-XULPJ6UG.js";import{b as gn}from"./chunk-MHWV5RQV.js";import{b as po}from"./chunk-XOTA6JTZ.js";import{a as Ye,c as Ui,d as At}from"./chunk-JUVAGMIH.js";import{A as $,B as De,D as eo,F as et,G as to,I as no,O as ge,R as io,u as Qe,v as Xe,w as Ft,x as Qi,z as Xi}from"./chunk-6G6TMKXF.js";import{a as Zi,f as yn}from"./chunk-WSDN25F5.js";import{d as b,f as V,g as Q}from"./chunk-M56NDIMD.js";import{$ as mn,$a as te,Ba as Fi,Ea as de,Ga as Et,Gb as v,Hb as Mt,Ib as A,Ka as Mi,L as Pe,La as Di,N as Ii,Nb as Re,O as un,Oa as St,P as dn,Pa as Ri,Pb as Dt,Qb as S,Rb as ue,Ta as w,Tb as ro,Ua as H,Ub as so,W as He,Wa as D,Xa as Oi,Y as j,Z as fn,ba as bt,bb as Pt,db as vt,ea as Ti,fa as Me,ka as Ct,ma as F,na as ce,oa as Ge,pa as N,qa as wt,tb as ne,ua as B,va as ki,wa as Z}from"./chunk-N5PQPIBF.js";import{l as hn,m as _n,n as oo}from"./chunk-YTNDFQJT.js";import{a as Ke}from"./chunk-ULQG3XQS.js";import{d as y,e as Se,f as pe,g as I,h as Pi,i as P,j as T,k as _t,l as vi,n as xt,s as Ai,t as ln}from"./chunk-IU2ZQ6TE.js";import{a as Si,e as qe,g as u}from"./chunk-VPRTJUIN.js";u();import{pipeline as Ip}from"stream/promises";import Vo from"node:stream/promises";import*as zo from"node:zlib";import{fileURLToPath as An}from"node:url";var Jo="9.1.2",qo="7.0.1",Ko="3",Tp="123.0.0",Ho="1.0.2",Go="2.0.1";function Yo(e){return e==="0"||e==="1"?{functionRunner:"7.0.1",javy:"4.0.0",javyPlugin:"1"}:e==="2"?{functionRunner:Jo,javy:qo,javyPlugin:Ko}:null}var it=class{constructor(t,n,i,o,r=`v${n}`){this.name=t,this.version=n,this.release=r,this.supportsWindowsOnArm=o;let s;s=`${t}-${n}`,s=process.platform==="win32"?`${s}.exe`:s,this.path=y(P(An(import.meta.url)),"..","bin",s),this.gitHubRepo=i}downloadUrl(t,n){let i,o;switch(t.toLowerCase()){case"darwin":i="macos";break;case"linux":i="linux";break;case"win32":i="windows";break;default:throw Error(`Unsupported platform ${t}`)}switch(n.toLowerCase()){case"arm":case"arm64":o="arm";break;case"ia32":case"x64":o="x86_64";break;default:throw Error(`Unsupported architecture ${n}`)}let r=`${o}-${i}`,s=["arm-linux","arm-macos","x86_64-macos","x86_64-windows","x86_64-linux"];if(this.supportsWindowsOnArm&&s.push("arm-windows"),!s.includes(r))throw Error(`Unsupported platform/architecture combination ${t}/${n}`);return`https://github.com/${this.gitHubRepo}/releases/download/${this.release}/${this.name}-${r}-v${this.version}.gz`}async processResponse(t,n){return Fp(t,n)}},Pn=class{constructor(t){this.name=`shopify_functions_javy_v${t}`,this.version=t,this.path=y(P(An(import.meta.url)),"..","bin",`shopify_functions_javy_v${t}.wasm`)}downloadUrl(t,n){return`https://cdn.shopify.com/shopifycloud/shopify-functions-javy-plugin/shopify_functions_javy_v${this.version}.wasm`}async processResponse(t,n){return Ip(t,n)}},vn=class{constructor(t,n){this.name=t,this.version=n,this.path=y(P(An(import.meta.url)),"..","bin",t)}downloadUrl(t,n){return`https://cdn.jsdelivr.net/npm/binaryen@${this.version}/bin/wasm-opt`}async processResponse(t,n){await Vo.pipeline(t,n)}},Sn;function In(e=qo){return new it("javy",e,"bytecodealliance/javy",kt(e,">=7.0.0"))}function Tn(e=Ko){return new Pn(e)}function Zd(e=Jo){return new it("function-runner",e,"Shopify/function-runner",kt(e,">=9.1.1"))}function ot(){return Sn||(Sn=new vn("wasm-opt.cjs",Tp)),Sn}function Zo(e){return new it("shopify-function-trampoline",e,"Shopify/shopify-function-wasm-api",kt(e,">=2.0.1"),`shopify_function_trampoline/v${e}`)}var Lt=new Map;async function Ae(e){if(await w(e.path)&&!Lt.has(e.path))return;let n=Lt.get(e.path);if(n){await n;return}let i=kp(e);Lt.set(e.path,i);try{await i}finally{Lt.delete(e.path)}}async function kp(e){let t=e.downloadUrl(process.platform,process.arch);S(`Downloading ${e.name} ${e.version} from ${t} to ${e.path}`);let n=P(e.path);await w(n)||await Z(n),await go(async()=>{let i=await $i(t,void 0,"slow-request");if(i.status!==200)throw new Error(`Downloading ${e.name} failed with status code of ${i.status}`);let o=i.body;if(o===null)throw new Error(`Downloading ${e.name} failed with empty response body`);await Ct(async r=>{let s=y(r,"binary"),a=Di(s);await e.processResponse(o,a),await Ri(s,509),await St(s,e.path,{overwrite:!0})})},async()=>{},2)}async function Fp(e,t){let n=zo.createGunzip();await Vo.pipeline(e,n,t)}u();import{build as Xo}from"esbuild";var Mp="2",rt=class extends b{constructor(t){super(t,A`Make sure you have a compatible version of the ${v.yellow("@shopify/shopify_function")} library installed.`,[A`Add ${v.green(`"@shopify/shopify_function": "~${Mp}.0.0"`)} to the dependencies section of the package.json file in your function's directory, if not already present.`.value,"Run your package manager's install command to update dependencies."])}};async function er(e,t){let n=$p(e),i=n.length===0?Bp:new kn(n),o=await nr(e);return t.useTasks?Rp(e,t,i,o):Dp(e,t,i,o)}async function Dp(e,t,n,i){t.signal?.aborted||(t.stdout.write(`Building function ${e.localIdentifier}...`),t.stdout.write(`Building GraphQL types...
2
2
  `),await st(e,t)),t.signal?.aborted||(t.stdout.write(`Bundling JS function...
3
3
  `),await n.bundle(e,t)),t.signal?.aborted||(t.stdout.write(`Running javy...
4
4
  `),await n.compile(e,t,i)),t.signal?.aborted||t.stdout.write(`Done!
@@ -78,7 +78,7 @@ ${r}`})}})}async createExtensionInstance(t,n,i,o){let r=this.findSpecificationFo
78
78
  `);async function gs(e,t,n,i,o){let r=e.length===0;if(r||(r=await ns()),r){let s=await ts(o.name);return i.createApp(n,{...o,name:s})}else{let a=Zt()?.tomls??{};for(let d=0;d<ms;d++){let l=await es(ar(i,n.id),e,t,{directory:o.directory});if(l){let f=a[l.apiKey];f&&Qr(f);let _=await i.appFromIdentifiers(l.apiKey);if(_)return _}else{d<ms-1&&Re("App selection failed. Retrying...");continue}}let c=["Unable to select an app: the selection prompt failed multiple times.","",`Available apps: ${e.length}`].join(`
79
79
  `);throw new Q(c,nl)}}u();u();u();u();async function ys(e,t,n="extension"){return $({message:`Match ${e.handle} (local name) with ${t.title} (name on Shopify Partners, ID: ${t.id})?`,confirmationMessage:`Yes, match to existing ${n}`,cancellationMessage:`No, create as a new ${n}`})}async function hs(e,t){let n=t.map(o=>({label:`Match it to ${o.title} (ID: ${o.id} on Shopify Partners)`,value:o.uuid}));n.push({label:"Create new extension",value:"create"});let i=await De({message:`How would you like to deploy your "${e.handle}"?`,choices:n});return t.find(o=>o.uuid===i)}async function Ie(e,t=!0){let n=e.map(({local:a})=>`"${a.handle}"`).join(", "),i=e.map(({remote:a})=>a.type.toLocaleLowerCase()),o=i.filter((a,c)=>i.indexOf(a)===c).map(a=>`"${a}"`).join(", "),r=e.map(({local:a})=>`"${a.type}"`).join(", ");Qe({headline:"Extension migrations can't be undone.",body:`Your ${n} configuration has been updated. Migrating gives you access to new features and won't impact the end user experience. All previous extension versions will reflect this change.`});let s=t?`Yes, confirm migration from ${o} to ${r}`:"Yes, confirm migration";return $({message:`Migrate ${n}?`,confirmationMessage:s,cancellationMessage:"No, cancel"})}async function _s(e){let t={},n=e.remote,i=e.local;for(let o of e.local){let r=n.filter(a=>a.type===o.graphQLType);if(r.length===0)continue;let s=await hs(o,r);s&&(t[o.localIdentifier]=s.uuid,n=n.filter(a=>a.uuid!==s.uuid),i=i.filter(a=>a.localIdentifier!==o.localIdentifier))}return{identifiers:t,toCreate:i,onlyRemote:n}}u();var il=(e,t)=>(t.type.toLowerCase()===e.graphQLType.toLowerCase()||t.type.toLowerCase()===e.externalType.toLowerCase()||t.type.toLowerCase()===e.type.toLowerCase())&&j(t.title)===j(e.handle);function xs(e,t){let n=un(e,l=>[l.graphQLType,l.handle]),i=un(t,l=>[l.type,l.title]),o={};n.forEach(l=>{let f=i.find(_=>il(l,_));f&&(o[l.localIdentifier]=f.uuid)});let r=e.filter(l=>!o[l.localIdentifier]),s=t.filter(l=>!Object.values(o).includes(l.uuid)),{toConfirm:a,toCreate:c,toManualMatch:d}=sl(r,s);return{matched:o,toCreate:c,toConfirm:a,toManualMatch:d}}function ol(e,t,n){let i={},o=[],r={};e.forEach(g=>{let m=t.find(x=>x.id===g.uid),h=t.find(x=>x.uuid===n[g.localIdentifier]);m?i[g.localIdentifier]=m.id:h&&h.id.length===0?r[g.localIdentifier]=h.uuid:o.push(g)});let s=t.filter(g=>!Object.values(r).includes(g.uuid)&&!Object.values(i).includes(g.id)&&g.id.length===0),{matched:a,toCreate:c,toConfirm:d,toManualMatch:l}=xs(o,s),f={...r,...a},_=e.filter(g=>f[g.localIdentifier]);return rl(_),{matched:{...i,...f},toCreate:c,toConfirm:d,toManualMatch:l}}function rl(e){if(e.length===0)return;let t=[ne.cyan,ne.magenta,ne.blue,ne.green,ne.yellow,ne.red],n=e.reduce((i,o)=>Math.max(i,o.handle.length),0);Re(`Generating extension IDs
80
80
  `),e.forEach((i,o)=>{let r=t[o%t.length]??ne.white;Re(`${r(i.handle.padStart(n))} | Added ID: ${i.uid}`)}),Re(`
81
- `)}function sl(e,t){let n=nt(e,"graphQLType"),i=Object.values(me(n,(g,m)=>g.length===1)).flat(),o=t.map(g=>({...g,type:g.type.toLowerCase()})),r=nt(o,"type"),s=me(r,(g,m)=>g.length===1),a=[],c=[];for(let g of i){let m=s[g.graphQLType.toLowerCase()];m&&m[0]?a.push({local:g,remote:m[0]}):c.push(g)}let d=dn(e,i),l=dn(o,a.map(g=>g.remote)),[f,_]=Co(d,g=>l.map(m=>m.type.toLowerCase()).includes(g.graphQLType.toLowerCase()));return c.push(..._),{toCreate:c,toConfirm:a,toManualMatch:{local:f,remote:l}}}async function bs(e,t,n,i){let o=i.supportsAtomicDeployments,r=Gn(e,n),s=Object.values(r),a=m=>t.some(h=>h.type!==i.toExtensionGraphQLType(m.graphQLType)?!1:r[m.localIdentifier]===h.uuid),c=e.filter(m=>!a(m)),d=t.filter(m=>!s.includes(m.uuid)),{matched:l,toCreate:f,toConfirm:_,toManualMatch:g}=o?ol(e,t,r):xs(c,d);return{identifiers:{...r,...l},toConfirm:_,toCreate:f,toManualMatch:g}}function Gn(e,t){let n=e.map(i=>i.localIdentifier);return me(t,(i,o)=>n.includes(o))}u();async function Yn(e,t,n,i,o){let r={apiKey:e,type:t,title:n,config:JSON.stringify({}),context:o??null,handle:n},s=await i.createExtension(r);if(s.extensionCreate.userErrors?.length>0){let a=s.extensionCreate.userErrors.map(c=>c.message).join(", ");throw new b(a)}return s.extensionCreate.extensionRegistration}u();async function Cs(e){let{extensionsToMigrate:t,appId:n,remoteExtensions:i,migrationClient:o}=e;return await Promise.all(t.map(({remote:r})=>al({apiKey:n,registrationId:void 0,registrationUuid:r.uuid,migrationClient:o}))),i.map(r=>t.some(({remote:s})=>s.uuid===r.uuid)?{...r,type:"UI_EXTENSION"}:r)}async function al(e){let{apiKey:t,registrationId:n,registrationUuid:i,migrationClient:o}=e,r={apiKey:t,registrationId:n,registrationUuid:i},s=await o.migrateToUiExtension(r);if(s?.migrateToUiExtension?.userErrors?.length>0){let a=s.migrateToUiExtension.userErrors.map(c=>c.message).join(", ");throw new b(a)}if(!s?.migrateToUiExtension?.migratedToUiExtension)throw new b("Couldn't migrate to UI extension")}u();async function ws(e){let{extensionsToMigrate:t,appId:n,remoteExtensions:i,migrationClient:o}=e;await Promise.all(t.map(({remote:a})=>pl({apiKey:n,registrationId:void 0,registrationUuid:a.uuid,migrationClient:o})));let r=new Map([["flow_action_definition","FLOW_ACTION"],["flow_trigger_definition","FLOW_TRIGGER"]]),s=t.map(({remote:a})=>a.uuid);return i.filter(a=>s.includes(a.uuid)).map(a=>({...a,type:r.get(a.type)??a.type}))}async function pl(e){let{apiKey:t,registrationId:n,registrationUuid:i,migrationClient:o}=e,r={apiKey:t,registrationId:n,registrationUuid:i},s=await o.migrateFlowExtension(r);if(s?.migrateFlowExtension?.userErrors?.length>0){let a=s.migrateFlowExtension.userErrors.map(c=>c.message).join(", ");throw new b(a)}if(!s?.migrateFlowExtension?.migratedFlowExtension)throw new b("Couldn't migrate to Flow extension");return n}u();var Es={payments_extension:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable"]},Ss={marketing_activity:["marketing_activity_extension"]},Ps={flow_action:["flow_action_definition"],flow_trigger:["flow_trigger_definition"],flow_trigger_lifecycle_callback:["flow_trigger_discovery_webhook"]},vs={ui_extension:["CHECKOUT_UI_EXTENSION","POS_UI_EXTENSION"]},As={subscription_link_extension:["subscription_link"]},Is={admin_link:["app_link","bulk_action"]};function Te(e,t,n,i){let o=Gn(e,n),r=Object.keys(i),s=Object.values(i).flat(),a=e.filter(l=>r.includes(l.type)),c=t.filter(l=>s.includes(l.type)),d=new Map;return c.forEach(l=>{d.set(l.uuid,l),d.set(j(l.title.substring(0,Ut)),l)}),a.reduce((l,f)=>{let _=o[f.localIdentifier]??"unknown",g=d.get(_)??d.get(f.localIdentifier.toLowerCase()),m=i[f.type]?.includes(g?.type??"undefined");return g&&m&&l.push({local:f,remote:g}),l},[])}async function ft(e){let{extensionsToMigrate:t,appId:n,type:i,remoteExtensions:o,migrationClient:r}=e;await Promise.all(t.map(({remote:a})=>cl({apiKey:n,registrationId:void 0,registrationUuid:a.uuid,type:i,migrationClient:r})));let s=t.map(({remote:a})=>a.uuid);return o.filter(a=>s.includes(a.uuid)).map(a=>({...a,type:i.toUpperCase()}))}async function cl(e){let{apiKey:t,registrationId:n,registrationUuid:i,type:o,migrationClient:r}=e,s={apiKey:t,registrationId:n,registrationUuid:i,type:o},a=await r.migrateAppModule(s);if(a?.migrateAppModule?.userErrors?.length>0){let c=a.migrateAppModule.userErrors.map(d=>d.message).join(", ");throw new b(c)}if(!a?.migrateAppModule?.migratedAppModule)throw new b(`Couldn't migrate to app module ${o}`);return n}async function Ts(e,{extensionRegistrations:t,dashboardManagedExtensionRegistrations:n}){let i=t,o=e.envIdentifiers.extensions??{},r=e.app.allExtensions.filter(E=>!E.isAppConfigExtension),s=Te(r,i,o,vs),a=Te(r,n,o,Ps),c=Te(r,n,o,Es),d=Te(r,n,o,Ss),l=Te(r,n,o,As),f=Te(r,n,o,Is),g=e.developerPlatformClient.clientName==="partners"?e.developerPlatformClient:Mo.getInstance(),m=!1;if(s.length>0){if(!await Ie(s))throw new V;i=await Cs({extensionsToMigrate:s,appId:e.appId,remoteExtensions:i,migrationClient:g}),m=!0}if(a.length>0){if(!await Ie(a,!1))throw new V;let M=await ws({extensionsToMigrate:a,appId:e.appId,remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(d.length>0){if(!await Ie(d,!1))throw new V;let M=await ft({extensionsToMigrate:d,appId:e.appId,type:"marketing_activity",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(c.length>0){if(!await Ie(c,!1))throw new V;let M=await ft({extensionsToMigrate:c,appId:e.appId,type:"payments_extension",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(l.length>0){if(!await Ie(l,!1))throw new V;let M=await ft({extensionsToMigrate:l,appId:e.appId,type:"subscription_link_extension",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(f.length>0){if(!await Ie(f,!1))throw new V;let M=await ft({extensionsToMigrate:f,appId:e.appId,type:"admin_link",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}let h=await bs(r,i,o,e.developerPlatformClient),x=h.identifiers,C=h.toCreate??[];for(let E of h.toConfirm)await ys(E.local,E.remote)?x[E.local.localIdentifier]=E.remote.uuid:C.push(E.local);if(h.toManualMatch.local.length>0){let E=await _s(h.toManualMatch);x={...x,...E.identifiers},C.push(...E.toCreate)}return{validMatches:x,extensionsToCreate:C,dashboardOnlyExtensions:n,didMigrateDashboardExtensions:m}}async function ks(e,t,n,{validMatches:i,extensionsToCreate:o}){let{uuidUidStrategyExtensions:r,singleAndDynamicStrategyExtensions:s}=fl(t,n,e.app.specifications||[]),{extensionsNonUuidManaged:a,extensionsIdsNonUuidManaged:c}=await dl(s,e.app,e.appId,e.includeDraftExtensions,e.developerPlatformClient),d={};if(o.length>0){let l=await Fs(o,e.appId,e.developerPlatformClient);for(let[f,_]of Object.entries(l))i[f]=_.uuid,d[f]=_.id}for(let[l,f]of Object.entries(i)){let _=r.find(g=>g.uuid===f);_&&(d[l]=_.id)}return{extensions:i,extensionIds:{...d,...c},extensionsNonUuidManaged:a}}function ll(e,t){let n=e.activeVersion?.config,i=n?JSON.parse(n):{},o=t.configuration,r=i.uri??"";return i.topic===o.topic&&r.endsWith(o.uri)&&i.filter===o.filter}function ul(e,t,n,i,o,r){n.forEach(s=>{let a=e.filter(d=>d.type===t.toExtensionGraphQLType(s.graphQLType)),c;s.isSingleStrategyExtension&&a.length===1?c=a[0]:s.isDynamicStrategyExtension&&(c=a.find(d=>ll(d,s))),c?(o[s.localIdentifier]=c.uuid,r[s.localIdentifier]=c.id):i.push(s)})}async function dl(e,t,n,i=!1,o){let r=i?t.draftableExtensions:t.allExtensions;r=r.filter(d=>!d.isUUIDStrategyExtension);let s=[],a={},c={};if(ul(e,o,r,s,a,c),s.length>0){let d=await Fs(s,n,o,!1);for(let[l,f]of Object.entries(d))a[l]=f.uuid,c[l]=f.id}return{extensionsNonUuidManaged:a,extensionsIdsNonUuidManaged:c}}async function Fs(e,t,n,i=!0){let o={};for(let r of e)if(n.supportsAtomicDeployments)o[r.localIdentifier]={id:r.uid,uuid:r.uid,type:r.type,title:r.handle};else{let s=await Yn(t,r.graphQLType,r.handle,n,r.contextValue);i&&Dt(`Created extension ${r.handle}.`),o[r.localIdentifier]=s}return o}function fl(e,t,n){let i=n.filter(a=>a.uidStrategy==="dynamic").map(a=>a.identifier),r=nt(e,a=>i.includes(a.type.toLowerCase())),s=t.concat(r.true??[]);return{uuidUidStrategyExtensions:r.false??[],singleAndDynamicStrategyExtensions:s}}u();u();async function Ms(e,t,n){let i=await ml(e,t,n),{app:{versionsDiff:o}}=await n.appVersionsDiff(e,{versionId:i.uuid,appVersionId:i.id});return{versionsDiff:o,versionDetails:i}}async function ml(e,t,n){try{return await n.appVersionByTag(e,t)}catch{throw Qi({headline:"Version couldn't be released.",body:["Version",{userInput:t},"could not be found."]}),new V}}u();function gl(e,t){return t?e.find(i=>i.identifier===t||i.externalIdentifier===t||i.additionalIdentifiers?.includes(t))?.uidStrategy:void 0}async function en(e,t,n,i,o){let s=(o??await t.activeAppVersion(e))?.appModuleVersions.filter(c=>gl(n,c.specification?.identifier)!=="uuid")??[];return s.length===0?void 0:Zn(s,n,i)}function Zn(e,t,n){let i={},o=t.filter($e);return e.forEach(r=>{let s=o.find(c=>c.identifier===r.specification?.identifier.toLowerCase());if(!s)return;let a=r.config;a&&(i=fe(i,s.transformRemoteToLocal?.(a,{flags:n})??a))}),{...i}}u();async function Ds(e,t){S(`Writing app configuration to ${t}`);let n=hl(structuredClone(e)),i=Qn(n),o=new U(t,{});await o.replace(i),await o.transformRaw(yl)}function Qn(e){if(e==null)return e;if(Array.isArray(e))return e.map(Qn);if(typeof e=="object"){let t={};for(let[n,i]of Object.entries(e)){let o=Qn(i);typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length===0||(t[n]=o)}return t}return e}var ke=(e,t)=>{if(e==null)return null;if(e instanceof p.ZodNullable||e instanceof p.ZodOptional)return ke(e.unwrap(),t);if(e instanceof p.ZodArray)return t.map(n=>ke(e.element,n));if(e instanceof p.ZodEffects)return ke(e._def.schema,t);if(e instanceof p.ZodObject){let n=Object.entries(e.shape),i=t,o={};n.forEach(([s,a])=>{if(i!==void 0&&i[s]!==void 0){let c=ke(a,i[s]);!(c instanceof Array)&&c instanceof Object&&Object.keys(c).length===0&&(c=void 0),o={...o,[s]:c}}});let r=["scopes"];return Object.entries(i).filter(([s])=>!r.includes(s)).sort(([s,a])=>s.localeCompare(s)).forEach(([s,a])=>{n.map(([c])=>c).includes(s)||(o={...o,[s]:a})}),o}return t};function yl(e){let t=`# Learn more about configuring your app at https://shopify.dev/docs/apps/tools/cli/configuration
81
+ `)}function sl(e,t){let n=nt(e,"graphQLType"),i=Object.values(me(n,(g,m)=>g.length===1)).flat(),o=t.map(g=>({...g,type:g.type.toLowerCase()})),r=nt(o,"type"),s=me(r,(g,m)=>g.length===1),a=[],c=[];for(let g of i){let m=s[g.graphQLType.toLowerCase()];m&&m[0]?a.push({local:g,remote:m[0]}):c.push(g)}let d=dn(e,i),l=dn(o,a.map(g=>g.remote)),[f,_]=Co(d,g=>l.map(m=>m.type.toLowerCase()).includes(g.graphQLType.toLowerCase()));return c.push(..._),{toCreate:c,toConfirm:a,toManualMatch:{local:f,remote:l}}}async function bs(e,t,n,i){let o=i.supportsAtomicDeployments,r=Gn(e,n),s=Object.values(r),a=m=>t.some(h=>h.type!==i.toExtensionGraphQLType(m.graphQLType)?!1:r[m.localIdentifier]===h.uuid),c=e.filter(m=>!a(m)),d=t.filter(m=>!s.includes(m.uuid)),{matched:l,toCreate:f,toConfirm:_,toManualMatch:g}=o?ol(e,t,r):xs(c,d);return{identifiers:{...r,...l},toConfirm:_,toCreate:f,toManualMatch:g}}function Gn(e,t){let n=e.map(i=>i.localIdentifier);return me(t,(i,o)=>n.includes(o))}u();async function Yn(e,t,n,i,o){let r={apiKey:e,type:t,title:n,config:JSON.stringify({}),context:o??null,handle:n},s=await i.createExtension(r);if(s.extensionCreate.userErrors?.length>0){let a=s.extensionCreate.userErrors.map(c=>c.message).join(", ");throw new b(a)}return s.extensionCreate.extensionRegistration}u();async function Cs(e){let{extensionsToMigrate:t,appId:n,remoteExtensions:i,migrationClient:o}=e;return await Promise.all(t.map(({remote:r})=>al({apiKey:n,registrationId:void 0,registrationUuid:r.uuid,migrationClient:o}))),i.map(r=>t.some(({remote:s})=>s.uuid===r.uuid)?{...r,type:"UI_EXTENSION"}:r)}async function al(e){let{apiKey:t,registrationId:n,registrationUuid:i,migrationClient:o}=e,r={apiKey:t,registrationId:n,registrationUuid:i},s=await o.migrateToUiExtension(r);if(s?.migrateToUiExtension?.userErrors?.length>0){let a=s.migrateToUiExtension.userErrors.map(c=>c.message).join(", ");throw new b(a)}if(!s?.migrateToUiExtension?.migratedToUiExtension)throw new b("Couldn't migrate to UI extension")}u();async function ws(e){let{extensionsToMigrate:t,appId:n,remoteExtensions:i,migrationClient:o}=e;await Promise.all(t.map(({remote:a})=>pl({apiKey:n,registrationId:void 0,registrationUuid:a.uuid,migrationClient:o})));let r=new Map([["flow_action_definition","FLOW_ACTION"],["flow_trigger_definition","FLOW_TRIGGER"]]),s=t.map(({remote:a})=>a.uuid);return i.filter(a=>s.includes(a.uuid)).map(a=>({...a,type:r.get(a.type)??a.type}))}async function pl(e){let{apiKey:t,registrationId:n,registrationUuid:i,migrationClient:o}=e,r={apiKey:t,registrationId:n,registrationUuid:i},s=await o.migrateFlowExtension(r);if(s?.migrateFlowExtension?.userErrors?.length>0){let a=s.migrateFlowExtension.userErrors.map(c=>c.message).join(", ");throw new b(a)}if(!s?.migrateFlowExtension?.migratedFlowExtension)throw new b("Couldn't migrate to Flow extension");return n}u();var Es={payments_extension:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable"]},Ss={marketing_activity:["marketing_activity_extension"]},Ps={flow_action:["flow_action_definition"],flow_trigger:["flow_trigger_definition"],flow_trigger_lifecycle_callback:["flow_trigger_discovery_webhook"]},vs={ui_extension:["CHECKOUT_UI_EXTENSION","POS_UI_EXTENSION"]},As={subscription_link_extension:["subscription_link"]},Is={admin_link:["app_link","bulk_action"]};function Te(e,t,n,i){let o=Gn(e,n),r=Object.keys(i),s=Object.values(i).flat(),a=e.filter(l=>r.includes(l.type)),c=t.filter(l=>s.includes(l.type)),d=new Map;return c.forEach(l=>{d.set(l.uuid,l),d.set(j(l.title.substring(0,Ut)),l)}),a.reduce((l,f)=>{let _=o[f.localIdentifier]??"unknown",g=d.get(_)??d.get(f.localIdentifier.toLowerCase()),m=i[f.type]?.includes(g?.type??"undefined");return g&&m&&l.push({local:f,remote:g}),l},[])}async function ft(e){let{extensionsToMigrate:t,appId:n,type:i,remoteExtensions:o,migrationClient:r}=e;await Promise.all(t.map(({remote:a})=>cl({apiKey:n,registrationId:void 0,registrationUuid:a.uuid,type:i,migrationClient:r})));let s=t.map(({remote:a})=>a.uuid);return o.filter(a=>s.includes(a.uuid)).map(a=>({...a,type:i.toUpperCase()}))}async function cl(e){let{apiKey:t,registrationId:n,registrationUuid:i,type:o,migrationClient:r}=e,s={apiKey:t,registrationId:n,registrationUuid:i,type:o},a=await r.migrateAppModule(s);if(a?.migrateAppModule?.userErrors?.length>0){let c=a.migrateAppModule.userErrors.map(d=>d.message).join(", ");throw new b(c)}if(!a?.migrateAppModule?.migratedAppModule)throw new b(`Couldn't migrate to app module ${o}`);return n}async function Ts(e,{extensionRegistrations:t,dashboardManagedExtensionRegistrations:n}){let i=t,o=e.envIdentifiers.extensions??{},r=e.app.allExtensions.filter(E=>!E.isAppConfigExtension),s=Te(r,i,o,vs),a=Te(r,n,o,Ps),c=Te(r,n,o,Es),d=Te(r,n,o,Ss),l=Te(r,n,o,As),f=Te(r,n,o,Is),g=e.developerPlatformClient.clientName==="partners"?e.developerPlatformClient:Mo.getInstance(),m=!1;if(s.length>0){if(!await Ie(s))throw new V;i=await Cs({extensionsToMigrate:s,appId:e.appId,remoteExtensions:i,migrationClient:g}),m=!0}if(a.length>0){if(!await Ie(a,!1))throw new V;let M=await ws({extensionsToMigrate:a,appId:e.appId,remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(d.length>0){if(!await Ie(d,!1))throw new V;let M=await ft({extensionsToMigrate:d,appId:e.appId,type:"marketing_activity",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(c.length>0){if(!await Ie(c,!1))throw new V;let M=await ft({extensionsToMigrate:c,appId:e.appId,type:"payments_extension",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(l.length>0){if(!await Ie(l,!1))throw new V;let M=await ft({extensionsToMigrate:l,appId:e.appId,type:"subscription_link_extension",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}if(f.length>0){if(!await Ie(f,!1))throw new V;let M=await ft({extensionsToMigrate:f,appId:e.appId,type:"admin_link",remoteExtensions:n,migrationClient:g});i=i.concat(M),m=!0}let h=await bs(r,i,o,e.developerPlatformClient),x=h.identifiers,C=h.toCreate??[];for(let E of h.toConfirm)await ys(E.local,E.remote)?x[E.local.localIdentifier]=E.remote.uuid:C.push(E.local);if(h.toManualMatch.local.length>0){let E=await _s(h.toManualMatch);x={...x,...E.identifiers},C.push(...E.toCreate)}return{validMatches:x,extensionsToCreate:C,dashboardOnlyExtensions:n,didMigrateDashboardExtensions:m}}async function ks(e,t,n,{validMatches:i,extensionsToCreate:o}){let{uuidUidStrategyExtensions:r,singleAndDynamicStrategyExtensions:s}=fl(t,n,e.app.specifications||[]),{extensionsNonUuidManaged:a,extensionsIdsNonUuidManaged:c}=await dl(s,e.app,e.appId,e.includeDraftExtensions,e.developerPlatformClient),d={};if(o.length>0){let l=await Fs(o,e.appId,e.developerPlatformClient);for(let[f,_]of Object.entries(l))i[f]=_.uuid,d[f]=_.id}for(let[l,f]of Object.entries(i)){let _=r.find(g=>g.uuid===f);_&&(d[l]=_.id)}return{extensions:i,extensionIds:{...d,...c},extensionsNonUuidManaged:a}}function ll(e,t){let n=e.activeVersion?.config,i=n?JSON.parse(n):{},o=t.configuration,r=i.uri??"";return i.topic===o.topic&&r.endsWith(o.uri)&&i.filter===o.filter}function ul(e,t,n,i,o,r){n.forEach(s=>{let a=e.filter(d=>d.type===t.toExtensionGraphQLType(s.graphQLType)),c;s.isSingleStrategyExtension&&a.length===1?c=a[0]:s.isDynamicStrategyExtension&&(c=a.find(d=>ll(d,s))),c?(o[s.localIdentifier]=c.uuid,r[s.localIdentifier]=c.id):i.push(s)})}async function dl(e,t,n,i=!1,o){let r=i?t.draftableExtensions:t.allExtensions;r=r.filter(d=>!d.isUUIDStrategyExtension);let s=[],a={},c={};if(ul(e,o,r,s,a,c),s.length>0){let d=await Fs(s,n,o,!1);for(let[l,f]of Object.entries(d))a[l]=f.uuid,c[l]=f.id}return{extensionsNonUuidManaged:a,extensionsIdsNonUuidManaged:c}}async function Fs(e,t,n,i=!0){let o={};for(let r of e)if(n.supportsAtomicDeployments)o[r.localIdentifier]={id:r.uid,uuid:r.uid,type:r.type,title:r.handle};else{let s=await Yn(t,r.graphQLType,r.handle,n,r.contextValue);i&&Dt(`Created extension ${r.handle}.`),o[r.localIdentifier]=s}return o}function fl(e,t,n){let i=n.filter(a=>a.uidStrategy==="dynamic").map(a=>a.identifier),r=nt(e,a=>i.includes(a.type.toLowerCase())),s=t.concat(r.true??[]);return{uuidUidStrategyExtensions:r.false??[],singleAndDynamicStrategyExtensions:s}}u();u();async function Ms(e,t,n){let i=await ml(e,t,n),{app:{versionsDiff:o}}=await n.appVersionsDiff(e,{versionId:i.uuid,appVersionId:i.id});return{versionsDiff:o,versionDetails:i}}async function ml(e,t,n){try{return await n.appVersionByTag(e,t)}catch{throw Qi({headline:"Version couldn't be released.",body:["Version",{userInput:t},"could not be found."]}),new V}}u();function gl(e,t){return t?e.find(i=>i.identifier===t||i.externalIdentifier===t||i.additionalIdentifiers?.includes(t))?.uidStrategy:void 0}async function en(e,t,n,i,o){let s=(o??await t.activeAppVersion(e))?.appModuleVersions.filter(c=>gl(n,c.specification?.identifier)!=="uuid")??[];return s.length===0?void 0:Zn(s,n,i)}function Zn(e,t,n){let i={},o=t.filter($e);return e.forEach(r=>{let s=o.find(c=>c.identifier===r.specification?.identifier.toLowerCase());if(!s)return;let a=r.config;a&&(i=fe(i,s.transformRemoteToLocal?.(a,{flags:n})??a))}),{...i}}u();async function Ds(e,t){S(`Writing app configuration to ${t}`);let n=hl(structuredClone(e)),i=Qn(n),o=new U(t,{});await o.replace(i),await o.transformRaw(yl)}function Qn(e){if(e==null)return e;if(Array.isArray(e))return e.map(Qn);if(typeof e=="object"){let t={};for(let[n,i]of Object.entries(e)){let o=Qn(i);typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length===0||(t[n]=o)}return t}return e}var ke=(e,t)=>{if(e==null)return null;if(e instanceof p.ZodNullable||e instanceof p.ZodOptional)return ke(e.unwrap(),t);if(e instanceof p.ZodArray)return t.map(n=>ke(e.element,n));if(e instanceof p.ZodEffects)return ke(e._def.schema,t);if(e instanceof p.ZodObject){let n=Object.entries(e.shape),i=t,o={};n.forEach(([s,a])=>{if(i!==void 0&&i[s]!==void 0){let c=ke(a,i[s]);!(c instanceof Array)&&c instanceof Object&&Object.keys(c).length===0&&(c=void 0),o={...o,[s]:c}}});let r=["scopes"];return Object.entries(i).filter(([s])=>!r.includes(s)).sort(([s],[a])=>s.localeCompare(a)).forEach(([s,a])=>{n.map(([c])=>c).includes(s)||(o={...o,[s]:a})}),o}return t};function yl(e){let t=`# Learn more about configuring your app at https://shopify.dev/docs/apps/tools/cli/configuration
82
82
  `,n=`
83
83
  # Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes`,i=e.split(/(\r\n|\r|\n)/);return i.unshift(`
84
84
  `),i.unshift(t),i.forEach((o,r)=>{o==="[access_scopes]"&&i.splice(r+1,0,n)}),i.join("")}function hl(e){let t=e.webhooks;if(Array.isArray(t?.subscriptions)&&t.subscriptions.length){let n=J(e?.application_url);t.subscriptions=Fo(t.subscriptions),t.subscriptions=t.subscriptions.map(({uri:i,...o})=>({uri:n&&i.includes(n)?i.replace(n,""):i,...o}))}return e}u();function Rs(){let e=["Your app has extensions which need to be assigned",{command:"uid"},"identifiers."],t=["You must first map IDs to your existing extensions by running",{command:"shopify app deploy"},"interactively, without",{command:"--allow-updates"},"or",{command:"--allow-deletes"},", to finish the migration."],n={title:"Reference",body:{list:{items:[{link:{label:"Migrating from the Partner Dashboard",url:"https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners"}}]}}};throw new b(e,void 0,[t],[n])}function Fe(e,t){return{title:e,uid:t,experience:"extension"}}function mt(e){return{title:e,uid:void 0,experience:"dashboard"}}async function Us(e){let t=await Os(e);e.force&&!e.developerPlatformClient.supportsDashboardManagedExtensions&&t.app.extensionRegistrations.filter(r=>!r.id).length>0&&Rs();let n=await Ts(e,t.app);if(n.didMigrateDashboardExtensions){let o=await e.developerPlatformClient.activeAppVersion(e.remoteApp);e.activeAppVersion=o}n.dashboardOnlyExtensions.length>0&&(t=await Os({...e,activeAppVersion:void 0}));let i=Cl(n);return e.release&&(i=await wl(e.developerPlatformClient,e.remoteApp,n.validMatches,n.extensionsToCreate,n.dashboardOnlyExtensions,e.app.specifications??[],e.activeAppVersion)??i),{extensionIdentifiersBreakdown:i,extensionsToConfirm:n,remoteExtensionsRegistrations:t.app}}async function Lb(e,t,n){let{versionsDiff:i,versionDetails:o}=await Ms(t,n,e),r=c=>c.filter(d=>d.specification.experience==="extension"&&d.specification.identifier!=="webhook_subscription").map(d=>Fe(d.registrationTitle,void 0)),s=c=>c.filter(d=>d.specification.options.managementExperience==="dashboard").map(d=>mt(d.registrationTitle));return{extensionIdentifiersBreakdown:{onlyRemote:[...r(i.removed),...s(i.removed)],toCreate:[...r(i.added),...s(i.added)],toUpdate:[],unchanged:[...r(i.updated),...s(i.updated)]},versionDetails:o}}async function Bs({developerPlatformClient:e,remoteApp:t,localApp:n,versionAppModules:i,release:o,activeAppVersion:r}){if(n.allExtensions.filter(s=>s.isAppConfigExtension).length!==0)return o?xl(e,t,n,i,r):_l(n)}function _l(e){return{existingFieldNames:On(e.configuration),existingUpdatedFieldNames:[],newFieldNames:[],deletedFieldNames:[]}}async function Os(e){return e.developerPlatformClient.appExtensionRegistrations(e.remoteApp,e.activeAppVersion)}async function xl(e,t,n,i,o){let r=await en(t,e,n.specifications??[],n.remoteFlags,o)??{},s=i?Zn(i,n.specifications??[],n.remoteFlags):n.configuration;s?.webhooks?.subscriptions?.length&&(s.webhooks.subscriptions=s.webhooks.subscriptions.map(h=>(h.uri.startsWith("/")&&(h.uri=`${J(s.application_url)}${h.uri}`),h)),s.webhooks.subscriptions.sort((h,x)=>{let C=h.uri+(h.topics?.sort().join(",")??""),E=x.uri+(x.topics?.sort().join(",")??"");return C.localeCompare(E)}),r.webhooks?.subscriptions?.sort((h,x)=>{let C=h.uri+(h.topics?.sort().join(",")??""),E=x.uri+(x.topics?.sort().join(",")??"");return C.localeCompare(E)}));let a=bl(s,r,n.configSchema),c=On(s),d=a?.baselineFieldNames??[],l=a?.updatedFieldNames??[],f=c.filter(h=>!d.includes(h)&&!l.includes(h)),_=c.filter(h=>d.includes(h)&&l.includes(h)),g=l.filter(h=>!d.includes(h)&&c.includes(h)),m=d.filter(h=>!l.includes(h)&&h!=="handle");return{existingFieldNames:f,existingUpdatedFieldNames:_,newFieldNames:g,deletedFieldNames:m}}function bl(e,t,n){let[i,o]=Ji({...ke(n,e),build:void 0},{...ke(n,t),build:void 0});if(It(i,o))return;let r=s=>Object.entries(s).filter(([a,c])=>c!==void 0).map(([a])=>a);return{updatedFieldNames:r(i),baselineFieldNames:r(o)}}function Cl({validMatches:e,extensionsToCreate:t,dashboardOnlyExtensions:n}){let i=Object.keys(e).map(s=>Fe(s,void 0)),o=t.map(s=>Fe(s.localIdentifier,void 0)),r=n.filter(s=>!Object.values(e).includes(s.uuid)).map(s=>mt(s.title));return{onlyRemote:[],toCreate:[],toUpdate:[],unchanged:[...i,...o,...r]}}async function wl(e,t,n,i,o,r,s){let a=s??await e.activeAppVersion(t);if(!a)return;let c=El(a,n,i,r,e),d=o.filter(f=>!Object.values(n).includes(f.uuid)&&!i.map(_=>_.localIdentifier).includes(f.uuid)),l=Sl(d,a);return{onlyRemote:[...c.onlyRemote,...l.onlyRemote],toCreate:[...c.toCreate,...l.toCreate],toUpdate:[...c.toUpdate,...l.toUpdate],unchanged:[...c.unchanged,...l.unchanged]}}function El(e,t,n,i,o){let r=e?.appModuleVersions.filter(m=>{let h=i.find(x=>x.identifier===m.specification?.identifier||x.externalIdentifier===m.specification?.identifier);return h&&!$e(h)});function s(m,h){let x=m.registrationUuid===h,C=m.registrationId===h,E=m.registrationId.length===0;return o.supportsAtomicDeployments?C||E&&x:x}let a=Object.entries(t).filter(([m,h])=>r.some(x=>s(x,h))).map(([m,h])=>m),c=r.filter(m=>m.registrationId===""),d=a.filter(m=>c.some(h=>h.registrationUuid===t[m])),l=a.filter(m=>!c.some(h=>h.registrationUuid===t[m])),f=Object.entries(t).filter(([m,h])=>!r.some(x=>s(x,h))).map(([m,h])=>({title:m,uid:h}));return n.map(m=>({title:m.localIdentifier,uid:m.uid})).forEach(m=>{let h=f.findIndex(x=>x.title===m.title);h===-1?f.push(m):f[h]=m}),{onlyRemote:r.filter(m=>!Object.values(t).some(h=>s(m,h))&&!n.map(h=>h.localIdentifier).some(h=>s(m,h))).map(m=>({title:m.registrationTitle,uid:m.registrationId})).map(({title:m,uid:h})=>Fe(m,h)),toCreate:f.map(({title:m,uid:h})=>Fe(m,h)),toUpdate:d.map(m=>Fe(m,void 0)),unchanged:l.map(m=>Fe(m,void 0))}}function Sl(e,t){let n=t?.appModuleVersions.filter(d=>d.specification.options.managementExperience==="dashboard")||[],i=d=>!e.map(l=>l.uuid).includes(d.registrationUuid),o=n.filter(i).map(d=>mt(d.registrationTitle)),r=d=>n.map(l=>l.registrationUuid).includes(d.uuid),s=d=>!r(d),a=e.filter(s).map(d=>mt(d.title)),c=e.filter(r).map(d=>mt(d.title));return{onlyRemote:o,toCreate:a,toUpdate:[],unchanged:c}}u();u();var Pl={bullet:"+",color:"green",suffix:"(new)"},vl={color:"#FF8800",suffix:"(updated)"},Al={bullet:"-",color:"red",suffix:"(removed)"};function ei(e){return[...e.new.map(t=>Xn(t,Pl)),...e.updated?e.updated.map(t=>Xn(t,vl)):[],...e.unchanged,...e.removed.map(t=>Xn(t,Al))]}function Xn(e,t){let n=typeof e=="string"?[e,{subdued:t.suffix??""}]:e;return{...t.bullet?{bullet:t.bullet}:{},item:n,color:t.color}}function Il({force:e,allowUpdates:t,allowDeletes:n,extensionIdentifiersBreakdown:i,configExtensionIdentifiersBreakdown:o}){if(e||t&&n)return!0;let r=i.onlyRemote.length>0,s=(o?.deletedFieldNames.length??0)>0,a=r||s,c=i.toCreate.length>0||i.toUpdate.length>0,d=(o?.newFieldNames.length??0)>0||(o?.existingUpdatedFieldNames.length??0)>0,l=c||d;if(t&&!a||n&&!l)return!0;if(!no()&&(a||l)){let f=[];throw l&&f.push("--allow-updates"),a&&f.push("--allow-deletes"),new b("This deployment includes changes that require confirmation.",["Run the command with",{command:f.join(" ")},"to deploy without confirmation."])}return!1}async function $s({force:e,allowUpdates:t,allowDeletes:n,extensionIdentifiersBreakdown:i,configExtensionIdentifiersBreakdown:o,appTitle:r,release:s,installCount:a}){if(await q.addPublicMetadata(()=>Ml(o)),Il({force:e,allowUpdates:t,allowDeletes:n,extensionIdentifiersBreakdown:i,configExtensionIdentifiersBreakdown:o}))return!0;let d=await kl(i),l=await Fl(s,o);return Tl({appTitle:r,extensionsContentPrompt:d,configContentPrompt:l,release:s,installCount:a})}async function Tl({appTitle:e,extensionsContentPrompt:{extensionsInfoTable:t,hasDeletedExtensions:n},configContentPrompt:i,release:o,installCount:r}){let s=new Date().valueOf(),a=!0,c=[];i&&c.push(i.configInfoTable.items.length===0?{...i.configInfoTable,emptyItemsText:"No changes",items:[]}:i.configInfoTable);let d=e!==void 0&&n;t?c.push(d?{...t,helperText:"Removing extensions can permanently delete app user data"}:t):c.push({header:"Extensions:",emptyItemsText:"None",items:[]});let l=`${o?"Release":"Create"} a new version${e?` of ${e}`:""}?`,f=n&&r!==void 0&&r>0;d?a=await to({message:l,infoTable:c,confirmation:e,...f?{warningItem:["This release removes extensions and related data from",{error:r.toString()},`app installations.
@@ -1 +1 @@
1
- import{l as T}from"./chunk-2VQJQ36C.js";import{a as A}from"./chunk-2I4PRX2I.js";import{c as C}from"./chunk-KNVM7N3U.js";import{m as b}from"./chunk-DFMQWJQ3.js";import{s as w}from"./chunk-RFG5RMPL.js";import{a as P}from"./chunk-R466TU3N.js";import{O as u}from"./chunk-B2EHO7ZC.js";import{v as h,x as y}from"./chunk-BDVAE5MS.js";import{Qb as O,va as p}from"./chunk-GFEAKSGV.js";import{d,q as m}from"./chunk-IU2ZQ6TE.js";import{g as c}from"./chunk-VPRTJUIN.js";c();async function q(e){A({verbose:e.verbose,noColor:e.noColor});let o=b({store:e.store}),t=await u(o,e.password);await v(t,{path:e.path??m(),force:e.force??!1,silent:e.silent??!1})}var g={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",variant:"PRODUCTVARIANT",shop:"SHOP"};async function v(e,o){let{force:t,path:i,silent:n}=o;if(!await T(i)&&(process.env.SHOPIFY_LANGUAGE_SERVER==="1"||!await C(t)))return;let l=[],r=[];for(let[a,s]of Object.entries(g))l.push(w(s,e).catch(f=>(r.push(s),[])).then(f=>({[a]:f})));let S=(await Promise.all(l)).reduce((a,s)=>({...a,...s}));if(r.length===Object.values(g).length){n||y({body:"Failed to fetch metafield definitions.",nextSteps:["Check your network connection and try again.","Ensure you have the permission to fetch metafield definitions."],reference:[{link:{label:"Metafield Definition API",url:"https://shopify.dev/docs/api/admin-graphql/latest/queries/metafieldDefinition"}}]});return}await D(i,S),r.length>0&&O(`Failed to fetch metafield definitions for the following owner types: ${r.join(", ")}`),n||h({body:"Metafield definitions have been successfully downloaded."})}async function D(e,o){let t=await P(e),i=d(t,"metafields.json"),n=JSON.stringify(o,null,2);p(i,n)}export{q as a};
1
+ import{l as T}from"./chunk-OY3PNHPZ.js";import{a as A}from"./chunk-Y7JGYGV7.js";import{c as C}from"./chunk-GVQIPEZT.js";import{m as b}from"./chunk-XITQULK4.js";import{s as w}from"./chunk-CBXSPL4W.js";import{a as P}from"./chunk-KR6QDE7D.js";import{O as u}from"./chunk-XONFGLJQ.js";import{v as h,x as y}from"./chunk-6G6TMKXF.js";import{Qb as O,va as p}from"./chunk-N5PQPIBF.js";import{d,q as m}from"./chunk-IU2ZQ6TE.js";import{g as c}from"./chunk-VPRTJUIN.js";c();async function q(e){A({verbose:e.verbose,noColor:e.noColor});let o=b({store:e.store}),t=await u(o,e.password);await v(t,{path:e.path??m(),force:e.force??!1,silent:e.silent??!1})}var g={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",variant:"PRODUCTVARIANT",shop:"SHOP"};async function v(e,o){let{force:t,path:i,silent:n}=o;if(!await T(i)&&(process.env.SHOPIFY_LANGUAGE_SERVER==="1"||!await C(t)))return;let l=[],r=[];for(let[a,s]of Object.entries(g))l.push(w(s,e).catch(f=>(r.push(s),[])).then(f=>({[a]:f})));let S=(await Promise.all(l)).reduce((a,s)=>({...a,...s}));if(r.length===Object.values(g).length){n||y({body:"Failed to fetch metafield definitions.",nextSteps:["Check your network connection and try again.","Ensure you have the permission to fetch metafield definitions."],reference:[{link:{label:"Metafield Definition API",url:"https://shopify.dev/docs/api/admin-graphql/latest/queries/metafieldDefinition"}}]});return}await D(i,S),r.length>0&&O(`Failed to fetch metafield definitions for the following owner types: ${r.join(", ")}`),n||h({body:"Metafield definitions have been successfully downloaded."})}async function D(e,o){let t=await P(e),i=d(t,"metafields.json"),n=JSON.stringify(o,null,2);p(i,n)}export{q as a};
@@ -1 +1 @@
1
- import{b as e}from"./chunk-YZDDTYTU.js";import{r}from"./chunk-LDGAHMS7.js";import{e as c,g as t}from"./chunk-VPRTJUIN.js";t();var s=c(r(),1);var a=class o extends e{static{this.args={command:s.Args.string({description:"Command to show help for.",required:!1})}}static{this.description="Display help for Shopify CLI"}static{this.usage="help [command] [flags]"}static{this.flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})}}static{this.strict=!1}async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
1
+ import{b as e}from"./chunk-XOTA6JTZ.js";import{r}from"./chunk-LDGAHMS7.js";import{e as c,g as t}from"./chunk-VPRTJUIN.js";t();var s=c(r(),1);var a=class o extends e{static{this.args={command:s.Args.string({description:"Command to show help for.",required:!1})}}static{this.description="Display help for Shopify CLI"}static{this.usage="help [command] [flags]"}static{this.flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})}}static{this.strict=!1}async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-7BGM2GAH.js";import{b as e}from"./chunk-YZDDTYTU.js";import{Mb as t}from"./chunk-GFEAKSGV.js";import{g as o}from"./chunk-VPRTJUIN.js";o();o();async function s(){t(i)}var r=class extends e{static{this.description="Shopify CLI version currently installed."}async run(){await s()}};export{r as a};
1
+ import{a as i}from"./chunk-F2QU6WWX.js";import{b as e}from"./chunk-XOTA6JTZ.js";import{Mb as t}from"./chunk-N5PQPIBF.js";import{g as o}from"./chunk-VPRTJUIN.js";o();o();async function s(){t(i)}var r=class extends e{static{this.description="Shopify CLI version currently installed."}async run(){await s()}};export{r as a};
@@ -1,4 +1,4 @@
1
- import{b as t}from"./chunk-YZDDTYTU.js";import{J as o}from"./chunk-BDVAE5MS.js";import{r as p}from"./chunk-LDGAHMS7.js";import{e as h,g as e}from"./chunk-VPRTJUIN.js";e();e();async function i(r){let a=new URLSearchParams;a.append("search",r??""),await o(`https://shopify.dev?${a.toString()}`)}var c=h(p(),1),s=class r extends t{static{this.description="Starts a search on shopify.dev."}static{this.usage="search [query]"}static{this.examples=[`# open the search modal on Shopify.dev
1
+ import{b as t}from"./chunk-XOTA6JTZ.js";import{J as o}from"./chunk-6G6TMKXF.js";import{r as p}from"./chunk-LDGAHMS7.js";import{e as h,g as e}from"./chunk-VPRTJUIN.js";e();e();async function i(r){let a=new URLSearchParams;a.append("search",r??""),await o(`https://shopify.dev?${a.toString()}`)}var c=h(p(),1),s=class r extends t{static{this.description="Starts a search on shopify.dev."}static{this.usage="search [query]"}static{this.examples=[`# open the search modal on Shopify.dev
2
2
  shopify search
3
3
 
4
4
  # search for a term on Shopify.dev