@shopify/cli 4.7.0 → 4.8.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 (324) hide show
  1. package/dist/analytics-3IIUBZ3B.js +1 -0
  2. package/dist/analytics-OOT5AB52.js +1 -0
  3. package/dist/assets/hydrogen/starter/AGENTS.md +5 -0
  4. package/dist/assets/hydrogen/starter/CHANGELOG.md +9 -0
  5. package/dist/assets/hydrogen/starter/CLAUDE.md +1 -0
  6. package/dist/assets/hydrogen/starter/package.json +3 -3
  7. package/dist/bootstrap.js +1 -1
  8. package/dist/{chunk-6ENBE43F.js → chunk-2AK44UYM.js} +1 -1
  9. package/dist/{chunk-XCBEYRQI.js → chunk-2CIZE537.js} +1 -1
  10. package/dist/{chunk-YHPBDS52.js → chunk-2EAFYCCS.js} +1 -1
  11. package/dist/{chunk-U2Z5NMXV.js → chunk-2KGPH7YG.js} +1 -1
  12. package/dist/{chunk-6VGJVXZI.js → chunk-2O224ZPO.js} +1 -1
  13. package/dist/{chunk-RY2SJVWM.js → chunk-2XDUJQQN.js} +3 -3
  14. package/dist/{chunk-GSCWZR22.js → chunk-36ROOKQB.js} +1 -1
  15. package/dist/{chunk-YIZZ5LZN.js → chunk-3DCN3N23.js} +1 -1
  16. package/dist/{chunk-YN6A26QL.js → chunk-3JXPOOFV.js} +39 -39
  17. package/dist/{chunk-KIYHEMHD.js → chunk-4QBJ5JBX.js} +15 -16
  18. package/dist/chunk-4ZNV5YSL.js +1 -0
  19. package/dist/chunk-5L63PRJL.js +2 -0
  20. package/dist/{chunk-MRCWOOSF.js → chunk-5N6HNQQ5.js} +1 -1
  21. package/dist/{chunk-4JY2P2A5.js → chunk-5SEEDOQ5.js} +1 -1
  22. package/dist/chunk-67Z34HN5.js +5 -0
  23. package/dist/chunk-6BDAJ6UD.js +5 -0
  24. package/dist/chunk-6CXG3XLP.js +1 -0
  25. package/dist/{chunk-QEB3HUQE.js → chunk-6MWWJZFN.js} +1 -1
  26. package/dist/{chunk-LRQYUWWB.js → chunk-6RQOEPEC.js} +1 -1
  27. package/dist/{chunk-LJM2DUXN.js → chunk-72ZY3KTF.js} +1 -1
  28. package/dist/{chunk-WKUGSFTB.js → chunk-742XXXGL.js} +1 -1
  29. package/dist/{chunk-37TEEITE.js → chunk-7HFHL5SO.js} +1 -1
  30. package/dist/{chunk-6VRXGEIW.js → chunk-7ISJRIPT.js} +1 -1
  31. package/dist/{chunk-CZJZCJRX.js → chunk-7LWUHQIF.js} +1 -1
  32. package/dist/{chunk-MLZLDL6B.js → chunk-7T6M7FAC.js} +1 -1
  33. package/dist/{chunk-LWJA2DQG.js → chunk-A6BMJISP.js} +1 -1
  34. package/dist/{chunk-TY4W7AYX.js → chunk-AWUX36VG.js} +1 -1
  35. package/dist/chunk-BWJIZYAG.js +1 -0
  36. package/dist/{chunk-EW55WWT7.js → chunk-BZ73NV3L.js} +1 -1
  37. package/dist/chunk-C3RUVXG2.js +6 -0
  38. package/dist/{chunk-QKGZWOOY.js → chunk-C4YLE3NS.js} +1 -1
  39. package/dist/chunk-CEYIZC3M.js +2 -0
  40. package/dist/{chunk-WCRZJY3P.js → chunk-CIWKN4HF.js} +1 -1
  41. package/dist/{chunk-P5MNNBSO.js → chunk-CULTZLC4.js} +1 -1
  42. package/dist/{chunk-X4XP2RQJ.js → chunk-CX75OKZK.js} +1 -1
  43. package/dist/{chunk-LDF4PQ3B.js → chunk-DASVZTAX.js} +46 -46
  44. package/dist/{chunk-UPJLZHHR.js → chunk-DX3JLOUA.js} +1 -1
  45. package/dist/{chunk-ZCNIR6YU.js → chunk-E55KS3GZ.js} +1 -1
  46. package/dist/{chunk-WHLGNDRE.js → chunk-E5FXOLQO.js} +1 -1
  47. package/dist/{chunk-JQ2B3VHR.js → chunk-E6N4PZZR.js} +1 -1
  48. package/dist/{chunk-CIH6LPTG.js → chunk-EB574SY6.js} +1 -1
  49. package/dist/chunk-EX5GVHGE.js +1 -0
  50. package/dist/chunk-F3NYCSXT.js +273 -0
  51. package/dist/{chunk-FWPJEL6Q.js → chunk-F6X6OXXB.js} +1 -1
  52. package/dist/{chunk-QPWMD2VR.js → chunk-FDBHQLFK.js} +1 -1
  53. package/dist/{chunk-TCTVI6PK.js → chunk-FDYW3UQC.js} +1 -1
  54. package/dist/{chunk-2SZOPJYI.js → chunk-FEDVVYK2.js} +1 -1
  55. package/dist/{chunk-SSJGWLCW.js → chunk-FJ6F4XRV.js} +1 -1
  56. package/dist/{chunk-E5T4YRGW.js → chunk-FOREMLFZ.js} +1 -1
  57. package/dist/{chunk-QXHENYJH.js → chunk-FUYDGK33.js} +1 -1
  58. package/dist/{chunk-CYOFLJ3Z.js → chunk-FX3L344E.js} +1 -1
  59. package/dist/{chunk-FCGKO2KY.js → chunk-G5XIGN5D.js} +1 -1
  60. package/dist/{chunk-HHVHVGRT.js → chunk-GAYKYEIM.js} +1 -1
  61. package/dist/{chunk-2U4P6UFZ.js → chunk-GCY7LPEF.js} +1 -1
  62. package/dist/{chunk-OORWOTAP.js → chunk-GNBRCK7L.js} +1 -1
  63. package/dist/{chunk-KOVAFUYN.js → chunk-GRPKF5ZB.js} +1 -1
  64. package/dist/{chunk-QZBSCOJV.js → chunk-GRSF7456.js} +1 -1
  65. package/dist/chunk-H2TQ4ODI.js +1 -0
  66. package/dist/{chunk-AMLWPYNA.js → chunk-H6XEESUN.js} +1 -1
  67. package/dist/{chunk-I3N6NPHF.js → chunk-HB347DXT.js} +1 -1
  68. package/dist/chunk-HFSCXTJQ.js +97 -0
  69. package/dist/chunk-HHN6KZXX.js +1 -0
  70. package/dist/{chunk-QBIVQXUJ.js → chunk-HP64ZTEJ.js} +1 -1
  71. package/dist/{chunk-U7R6LYPJ.js → chunk-IARCMH7G.js} +1 -1
  72. package/dist/{chunk-YOO7DLOT.js → chunk-IBI5UCJO.js} +1 -1
  73. package/dist/{chunk-UVQL7RUY.js → chunk-IKUSLRGD.js} +1 -1
  74. package/dist/{chunk-HLNJL4B6.js → chunk-IT4HYLTY.js} +1 -1
  75. package/dist/{chunk-GZ64KWHX.js → chunk-J4T73EAS.js} +1 -1
  76. package/dist/chunk-JG4HH54Q.js +1 -0
  77. package/dist/{chunk-DKL6N3L2.js → chunk-JIYSCWCG.js} +1 -1
  78. package/dist/chunk-JWRK5KLD.js +560 -0
  79. package/dist/{chunk-DHU57LKD.js → chunk-JX7FYWPO.js} +1 -1
  80. package/dist/{chunk-N6YTJXIS.js → chunk-K42WBNJQ.js} +1 -1
  81. package/dist/{chunk-5CR5YJTU.js → chunk-KDU7VW3L.js} +1 -1
  82. package/dist/{chunk-CTRXLZAJ.js → chunk-KWVOJWO7.js} +1 -1
  83. package/dist/{chunk-RUFQCXBX.js → chunk-LANUJ7LX.js} +1 -1
  84. package/dist/{chunk-PAAKBWSF.js → chunk-LUKQ5HLC.js} +1 -1
  85. package/dist/{chunk-3K6VHXC2.js → chunk-M2XHIN57.js} +1 -1
  86. package/dist/{chunk-TYIGOVRQ.js → chunk-MNOQAXJW.js} +1 -1
  87. package/dist/chunk-MYQUYU4U.js +2 -0
  88. package/dist/{chunk-T5JXQ7KO.js → chunk-N65F7ET2.js} +1 -1
  89. package/dist/{chunk-PWSI275S.js → chunk-N6RBRPGW.js} +1 -1
  90. package/dist/chunk-N75VOJHO.js +15 -0
  91. package/dist/{chunk-4W3UE2ZI.js → chunk-NBFMP5XQ.js} +1 -1
  92. package/dist/{chunk-CFWHR74L.js → chunk-NE3ZFSMS.js} +1 -1
  93. package/dist/{chunk-D2K2ZBKH.js → chunk-NGLMZYS7.js} +2 -2
  94. package/dist/{chunk-JQISGC7D.js → chunk-NHAUJWEG.js} +1 -1
  95. package/dist/chunk-NILETICC.js +11 -0
  96. package/dist/{chunk-SYADOUBB.js → chunk-NNZXKFOS.js} +1 -1
  97. package/dist/{chunk-E2W5OYYM.js → chunk-NQK2VCDA.js} +1 -1
  98. package/dist/{chunk-U6HYEGAE.js → chunk-NROVZETL.js} +1 -1
  99. package/dist/{chunk-TSLQZTXR.js → chunk-NW6NUGN7.js} +1 -1
  100. package/dist/{chunk-JZMRBJH3.js → chunk-O7DZXO3O.js} +1 -1
  101. package/dist/{chunk-5CADTCJE.js → chunk-OBYQSIYU.js} +1 -1
  102. package/dist/{chunk-5NO5OXYP.js → chunk-OEG3N5PG.js} +1 -1
  103. package/dist/{chunk-VRVP2GQL.js → chunk-OGBZTY2G.js} +1 -1
  104. package/dist/chunk-OMHR423H.js +1 -0
  105. package/dist/{chunk-XHZ5BWXL.js → chunk-OV6SRRXR.js} +1 -1
  106. package/dist/{chunk-2JDCVEFK.js → chunk-OVV5YGKN.js} +1 -1
  107. package/dist/{chunk-SEVSMWNX.js → chunk-OZL5FTT7.js} +1 -1
  108. package/dist/{chunk-JUKAWTYY.js → chunk-OZMQ2EJB.js} +1 -1
  109. package/dist/{chunk-7WTNEG2F.js → chunk-P57P7UAN.js} +1 -1
  110. package/dist/{chunk-JZXA3H5K.js → chunk-PATTG7YZ.js} +1 -1
  111. package/dist/{chunk-2HK4MFWP.js → chunk-PG5YNPJB.js} +1 -1
  112. package/dist/chunk-PP4L2JJ6.js +3 -0
  113. package/dist/{chunk-CZPGC2E7.js → chunk-Q5JX23QU.js} +1 -1
  114. package/dist/{chunk-L67BU25M.js → chunk-Q5KVMLBK.js} +1 -1
  115. package/dist/{chunk-ZRLEAF7M.js → chunk-Q5LIJGT7.js} +1 -1
  116. package/dist/{chunk-JQVXH26X.js → chunk-Q6ADIMJM.js} +1 -1
  117. package/dist/{chunk-YUVE2I3C.js → chunk-QERQARMC.js} +1 -1
  118. package/dist/{chunk-GLWQMLUC.js → chunk-QOV43E26.js} +1 -1
  119. package/dist/{chunk-KCS75ZM4.js → chunk-QTFUYKMF.js} +1 -1
  120. package/dist/{chunk-7DOWT5JZ.js → chunk-QTJCCOAG.js} +3 -3
  121. package/dist/{chunk-XAOYKECS.js → chunk-R6ICQT2D.js} +1 -1
  122. package/dist/{chunk-4LRG5YBS.js → chunk-R7T3LYJL.js} +1 -1
  123. package/dist/{chunk-DMXQLI35.js → chunk-RXQJCJDV.js} +1 -1
  124. package/dist/{chunk-BR6DBMQA.js → chunk-S2TLBBSS.js} +1 -1
  125. package/dist/{chunk-FULWTZS6.js → chunk-S5FOQY35.js} +1 -1
  126. package/dist/{chunk-6OFGSZD6.js → chunk-SYLHT42O.js} +1 -1
  127. package/dist/{chunk-CHMEDVDZ.js → chunk-T4AA6TSF.js} +1 -1
  128. package/dist/{chunk-XRT2W5Y2.js → chunk-T4QWK5GG.js} +1 -1
  129. package/dist/{chunk-63CIFL36.js → chunk-T7PJDT5O.js} +1 -1
  130. package/dist/{chunk-6EBLULOC.js → chunk-TEY4LRY7.js} +1 -1
  131. package/dist/{chunk-PANGX7SA.js → chunk-TFBRVLDN.js} +1 -1
  132. package/dist/{chunk-MB7E5GEY.js → chunk-TUVDJ3PG.js} +1 -1
  133. package/dist/{chunk-HZIX3DIT.js → chunk-U2DWBZK2.js} +1 -1
  134. package/dist/chunk-U53OLUOE.js +3 -0
  135. package/dist/{chunk-GKOBFX4A.js → chunk-UAETNFN4.js} +1 -1
  136. package/dist/{chunk-EOMCXBCS.js → chunk-UAFEFKAQ.js} +1 -1
  137. package/dist/{chunk-Q5DQGV3M.js → chunk-ULRJDKWQ.js} +1 -1
  138. package/dist/chunk-UZARYOLN.js +1 -0
  139. package/dist/chunk-VASGXHYA.js +1 -0
  140. package/dist/chunk-VD4XJ6BX.js +1 -0
  141. package/dist/{chunk-Y34LWI3S.js → chunk-VFM2KQRM.js} +3 -3
  142. package/dist/{chunk-CMYQXGLO.js → chunk-VSDRNYA5.js} +1 -1
  143. package/dist/{chunk-OE3F7XXU.js → chunk-VVZSYHDG.js} +1 -1
  144. package/dist/chunk-VXEYO3ZP.js +1 -0
  145. package/dist/{chunk-7JIQXGDE.js → chunk-VYDSOAV4.js} +1 -1
  146. package/dist/{chunk-DQFSKPKL.js → chunk-WBYAGS6B.js} +1 -1
  147. package/dist/chunk-WGAFCKGD.js +1 -0
  148. package/dist/{chunk-AH2ZGMDM.js → chunk-WYBTC356.js} +1 -1
  149. package/dist/{chunk-TTAPXLI5.js → chunk-XF2KTEID.js} +1 -1
  150. package/dist/{chunk-XUEMMLXK.js → chunk-XH5YGJQR.js} +1 -1
  151. package/dist/chunk-XHKWITLA.js +1705 -0
  152. package/dist/chunk-XOCB4KNX.js +2 -0
  153. package/dist/{chunk-2WJAAJVX.js → chunk-XUUAKGEX.js} +1 -1
  154. package/dist/{chunk-LQCR4TGH.js → chunk-XUYVJEZG.js} +1 -1
  155. package/dist/chunk-Y47C3LSX.js +3 -0
  156. package/dist/{chunk-KK24VGVE.js → chunk-Y5PRPHLQ.js} +1 -1
  157. package/dist/{chunk-K4KTNINH.js → chunk-YD2VQEN5.js} +1 -1
  158. package/dist/{chunk-KUNDCAQN.js → chunk-YESGYUEL.js} +1 -1
  159. package/dist/{chunk-JJJTPEMD.js → chunk-YEVGLC5X.js} +1 -1
  160. package/dist/{chunk-GMTNOCMS.js → chunk-YFINLODF.js} +3 -3
  161. package/dist/{chunk-LZ3GZ7NS.js → chunk-YKL3BLWC.js} +1 -1
  162. package/dist/{chunk-5HPBQ6U5.js → chunk-YLXPYXQP.js} +1 -1
  163. package/dist/{chunk-7AALWJAO.js → chunk-YNDIZCD2.js} +1 -1
  164. package/dist/{chunk-6WZYX5RO.js → chunk-YPWHD3NL.js} +1 -1
  165. package/dist/{chunk-4HV6A6UH.js → chunk-YSAFHVV6.js} +1 -1
  166. package/dist/{chunk-AGOEROAI.js → chunk-YZMY2CTU.js} +1 -1
  167. package/dist/{chunk-S3P5WWJD.js → chunk-Z4AFEO36.js} +1 -1
  168. package/dist/{chunk-7MHANY34.js → chunk-Z5WPP6ME.js} +1 -1
  169. package/dist/chunk-Z65E4UAP.js +1 -0
  170. package/dist/{chunk-V2HCVJYF.js → chunk-ZDRIQC7O.js} +1 -1
  171. package/dist/{chunk-2CYVZUYT.js → chunk-ZH44BDUR.js} +1 -1
  172. package/dist/{chunk-SJMTETSU.js → chunk-ZL5LU4U2.js} +1 -1
  173. package/dist/{chunk-DQCIORGH.js → chunk-ZYX7UHCQ.js} +1 -1
  174. package/dist/{chunk-ACTDYTAV.js → chunk-ZZRFG6ME.js} +114 -114
  175. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  176. package/dist/cli/commands/app/build.js +1 -1
  177. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  178. package/dist/cli/commands/app/bulk/execute.js +1 -1
  179. package/dist/cli/commands/app/bulk/status.js +1 -1
  180. package/dist/cli/commands/app/config/link.js +1 -1
  181. package/dist/cli/commands/app/config/pull.js +1 -1
  182. package/dist/cli/commands/app/config/use.js +1 -1
  183. package/dist/cli/commands/app/config/validate.js +1 -1
  184. package/dist/cli/commands/app/demo/watcher.js +1 -1
  185. package/dist/cli/commands/app/deploy.js +1 -1
  186. package/dist/cli/commands/app/dev/clean.js +1 -1
  187. package/dist/cli/commands/app/dev.js +1 -1
  188. package/dist/cli/commands/app/doctor/instructions.js +1 -0
  189. package/dist/cli/commands/app/doctor.js +1 -0
  190. package/dist/cli/commands/app/env/pull.js +1 -1
  191. package/dist/cli/commands/app/env/show.js +1 -1
  192. package/dist/cli/commands/app/execute.js +1 -1
  193. package/dist/cli/commands/app/function/build.js +1 -1
  194. package/dist/cli/commands/app/function/info.js +1 -1
  195. package/dist/cli/commands/app/function/replay.js +1 -1
  196. package/dist/cli/commands/app/function/run.js +1 -1
  197. package/dist/cli/commands/app/function/schema.js +1 -1
  198. package/dist/cli/commands/app/function/typegen.js +1 -1
  199. package/dist/cli/commands/app/generate/extension.js +1 -1
  200. package/dist/cli/commands/app/graphiql.js +1 -1
  201. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  202. package/dist/cli/commands/app/import-extensions.js +1 -1
  203. package/dist/cli/commands/app/info.js +1 -1
  204. package/dist/cli/commands/app/init.js +1 -1
  205. package/dist/cli/commands/app/logs.js +1 -1
  206. package/dist/cli/commands/app/release.js +1 -1
  207. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -0
  208. package/dist/cli/commands/app/subscription-migrations/list.js +1 -0
  209. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -0
  210. package/dist/cli/commands/app/subscription-migrations/status.js +1 -0
  211. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -0
  212. package/dist/cli/commands/app/versions/list.js +1 -1
  213. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  214. package/dist/cli/commands/auth/login.js +1 -1
  215. package/dist/cli/commands/auth/logout.js +1 -1
  216. package/dist/cli/commands/cache/clear.js +1 -1
  217. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  218. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  219. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  220. package/dist/cli/commands/debug/command-flags.js +1 -1
  221. package/dist/cli/commands/doc/fetch.js +1 -1
  222. package/dist/cli/commands/doc/search.js +1 -1
  223. package/dist/cli/commands/docs/generate.js +1 -1
  224. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  225. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  226. package/dist/cli/commands/help.js +1 -1
  227. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  228. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  229. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  230. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  231. package/dist/cli/commands/notifications/generate.js +1 -1
  232. package/dist/cli/commands/notifications/list.js +1 -1
  233. package/dist/cli/commands/organization/list.js +1 -1
  234. package/dist/cli/commands/search.js +1 -1
  235. package/dist/cli/commands/send-analytics.js +1 -1
  236. package/dist/cli/commands/theme/check.js +1 -1
  237. package/dist/cli/commands/theme/console.js +1 -1
  238. package/dist/cli/commands/theme/delete.js +1 -1
  239. package/dist/cli/commands/theme/dev.js +1 -1
  240. package/dist/cli/commands/theme/duplicate.js +1 -1
  241. package/dist/cli/commands/theme/info.js +1 -1
  242. package/dist/cli/commands/theme/init.js +1 -1
  243. package/dist/cli/commands/theme/language-server.js +1 -1
  244. package/dist/cli/commands/theme/list.js +1 -1
  245. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  246. package/dist/cli/commands/theme/open.js +1 -1
  247. package/dist/cli/commands/theme/package.js +1 -1
  248. package/dist/cli/commands/theme/preview.js +1 -1
  249. package/dist/cli/commands/theme/profile.js +1 -1
  250. package/dist/cli/commands/theme/publish.js +1 -1
  251. package/dist/cli/commands/theme/pull.js +1 -1
  252. package/dist/cli/commands/theme/push.js +1 -1
  253. package/dist/cli/commands/theme/rename.js +1 -1
  254. package/dist/cli/commands/theme/share.js +1 -1
  255. package/dist/cli/commands/upgrade.js +1 -1
  256. package/dist/cli/commands/version.js +1 -1
  257. package/dist/command-registry.js +1 -1
  258. package/dist/{conf-store-OAGJBITE.js → conf-store-ASDCTDQ4.js} +1 -1
  259. package/dist/configs/all.yml +60 -0
  260. package/dist/configs/recommended.yml +60 -0
  261. package/dist/data/filters.json +31 -2
  262. package/dist/data/setting.json +129 -4
  263. package/dist/data/shopify_system_translations.json +154 -13
  264. package/dist/{deprecations-K3NPRKBF.js → deprecations-VBQV7Q4O.js} +1 -1
  265. package/dist/dist-FZLOAKU7.js +1 -0
  266. package/dist/dist-HTY6UHG5.js +1 -0
  267. package/dist/environments-HSTNEQRG.js +1 -0
  268. package/dist/{error-YX56C43A.js → error-2LZYKRMA.js} +1 -1
  269. package/dist/error-handler-PIGEJ7BT.js +1 -0
  270. package/dist/{fs-SKHQZZTQ.js → fs-BJHNJDDK.js} +1 -1
  271. package/dist/hooks/did-you-mean.js +1 -1
  272. package/dist/hooks/hydrogen-init.js +1 -1
  273. package/dist/hooks/postrun.js +1 -1
  274. package/dist/hooks/prerun.js +1 -1
  275. package/dist/hooks/public-metadata.js +1 -1
  276. package/dist/hooks/sensitive-metadata.js +1 -1
  277. package/dist/hooks/tunnel-provider.js +1 -1
  278. package/dist/hooks/tunnel-start.js +1 -1
  279. package/dist/index.js +14 -16
  280. package/dist/{is-global-V5VORI3F.js → is-global-6SCOAJVG.js} +1 -1
  281. package/dist/{local-GX5AN6ZS.js → local-PZWPRFU7.js} +1 -1
  282. package/dist/{metadata-XUJUTBTB.js → metadata-VVBHB3HL.js} +1 -1
  283. package/dist/{node-package-manager-3WIYU7Y3.js → node-package-manager-ETYQN7OM.js} +1 -1
  284. package/dist/notifications-system-652OG5KL.js +1 -0
  285. package/dist/os-7D6NT4O3.js +1 -0
  286. package/dist/{output-X47P6ICP.js → output-74VDGYJD.js} +1 -1
  287. package/dist/{prettier-RVUAAWC7.js → prettier-EGVCP5CY.js} +1 -1
  288. package/dist/{system-SR5G7WEW.js → system-P5QIJALL.js} +1 -1
  289. package/dist/tsconfig.tsbuildinfo +1 -1
  290. package/dist/{ui-VYWSLAQ6.js → ui-H5I5YVKV.js} +1 -1
  291. package/dist/upgrade-34HSYBXI.js +1 -0
  292. package/dist/version-EKXEAF6Q.js +1 -0
  293. package/dist/{version-FK4ETQ22.js → version-J2PYO6M5.js} +1 -1
  294. package/dist/{workerd-NAPS5TA7.js → workerd-X4TGHEG3.js} +1 -1
  295. package/oclif.manifest.json +903 -133
  296. package/package.json +9 -8
  297. package/dist/analytics-6LI5GLWS.js +0 -1
  298. package/dist/analytics-UNRIIG4Y.js +0 -1
  299. package/dist/chunk-5CYJG63I.js +0 -1
  300. package/dist/chunk-6PDR2IUL.js +0 -11
  301. package/dist/chunk-F5HCSUXC.js +0 -16
  302. package/dist/chunk-H5KWM27L.js +0 -1
  303. package/dist/chunk-NEMPLS7C.js +0 -1
  304. package/dist/chunk-OUZGGWFN.js +0 -1
  305. package/dist/chunk-PIFW2R3S.js +0 -1382
  306. package/dist/chunk-QRT4A2RV.js +0 -3
  307. package/dist/chunk-R2R6JDNH.js +0 -1
  308. package/dist/chunk-RZFBGBNA.js +0 -1
  309. package/dist/chunk-V5SC2RYQ.js +0 -2
  310. package/dist/chunk-VKSR6MJG.js +0 -2
  311. package/dist/chunk-XLURZ6GL.js +0 -559
  312. package/dist/chunk-Z5K4J7HQ.js +0 -1
  313. package/dist/chunk-ZO74GSWC.js +0 -5
  314. package/dist/chunk-ZSFAURIH.js +0 -3
  315. package/dist/dist-EXJEE23W.js +0 -1
  316. package/dist/dist-S62Z6IFV.js +0 -1
  317. package/dist/environments-ALH2N36U.js +0 -1
  318. package/dist/error-handler-FDCH72NH.js +0 -1
  319. package/dist/notifications-system-RHULO564.js +0 -1
  320. package/dist/os-M6X7KOR4.js +0 -1
  321. package/dist/upgrade-PFQ7JMXG.js +0 -1
  322. package/dist/version-U4GM2LNG.js +0 -1
  323. /package/dist/{chunk-NJPL5BTN.js → chunk-YLQ3LNNY.js} +0 -0
  324. /package/dist/{morph-77RHJICZ.js → morph-BMYYMQNX.js} +0 -0
@@ -0,0 +1,5 @@
1
+ import{b as se}from"./chunk-H2TQ4ODI.js";import{a as ne,b as re,h as oe}from"./chunk-HFSCXTJQ.js";import{a as q,d as X}from"./chunk-3JXPOOFV.js";import{E as ee,_ as ie}from"./chunk-YFINLODF.js";import{h as A,j as te}from"./chunk-BWJIZYAG.js";import{Ta as Z,ma as Y}from"./chunk-VFM2KQRM.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var ve=/^gid:\/\/shopify\/Shop\/(\d+)$/,De=/^\d+$/,ae=250,Re=new Set(ne),Be=new Set(re);function ue(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Ae(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),fe(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),le(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&fe(w)&&le(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ce(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Le(i,r),canonicalInput:a,inputDigest:de(a)}}}function Ae(i){let e=i?.trim();if(!e)return;let o=De.test(e)?e:ve.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function fe(i){return i!==void 0&&Re.has(i)}function le(i){return Be.has(i)}function ce(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Le(i,e){let o=[];for(let t=0;t<e.length;t+=ae){let n=e.slice(t,t+ae),r=ce(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:de(r)})}return o}function de(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var _e=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var he=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Te(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Te=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var pe=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},$e=13,Me=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:_e(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
2
+ `,a).length:w,l?(s===null?0:s.length)+f.length:0,l?f.length+w:0);return S<O},parse:function(t,n,r,a){let{bom:s,comment_no_infix:f,delimiter_auto:l,encoding:h,from_line:w,ltrim:S,max_record_size:O,raw:L,relax_quotes:I,rtrim:E,skip_empty_lines:y,to:g,to_line:p}=this.options,{comment:x,escape:C,quote:N,record_delimiter:F}=this.options,{bomSkipped:Ne,delimiterDiscovered:Ee,delimiterBufPrevious:V,rawBuffer:xe,escapeIsQuote:Ce}=this.state;if(!Ee&&l){let m;if(V===void 0?m=t:V!==void 0&&t===void 0?m=V:m=Buffer.concat([V,t]),t=void 0,n||m.length>l.size)this.options.delimiter=[Buffer.from(he(m,this.options.delimiter_auto))],this.state.previousBuf=m,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=m;return}}let{previousBuf:P}=this.state,_;if(P===void 0)if(t===void 0){a();return}else _=t;else P!==void 0&&t===void 0?_=P:_=Buffer.concat([P,t]);if(Ne===!1)if(s===!1)this.state.bomSkipped=!0;else if(_.length<3){if(n===!1){this.state.previousBuf=_;return}}else{for(let m in $)if($[m].compare(_,0,$[m].length)===0){let D=$[m].length;this.state.bufBytesStart+=D,_=_.slice(D);let k=T({...this.original_options,encoding:m});for(let b in k)this.options[b]=k[b];({comment:x,escape:C,quote:N}=this.options);break}this.state.bomSkipped=!0}let U=_.length,u;for(u=0;u<U&&!this.__needMoreData(u,U,n);u++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),p!==-1&&this.info.lines>p){this.state.stop=!0,a();return}this.state.quoting===!1&&F.length===0&&this.__autoDiscoverRecordDelimiter(_,u)&&(F=this.options.record_delimiter);let m=_[u];if(L===!0&&xe.append(m),(m===$e||m===Me)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(C!==null&&this.state.quoting===!0&&this.__isEscape(_,u,m)&&u+C.length<U)if(Ce){if(this.__isQuote(_,u+C.length)){this.state.escaping=!0,u+=C.length-1;continue}}else{this.state.escaping=!0,u+=C.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(_,u))if(this.state.quoting===!0){let b=_[u+N.length],R=E&&this.__isCharTrimable(_,u+N.length),v=x!==null&&this.__compareBytes(x,_,u+N.length,b),B=this.__isDelimiter(_,u+N.length,b),J=F.length===0?this.__autoDiscoverRecordDelimiter(_,u+N.length):this.__isRecordDelimiter(b,_,u+N.length);if(C!==null&&this.__isEscape(_,u,m)&&this.__isQuote(_,u+C.length))u+=C.length-1;else if(!b||B||J||v||R){this.state.quoting=!1,this.state.wasQuoting=!0,u+=N.length-1;continue}else if(I===!1){let W=this.__error(new c("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(b)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(W!==void 0)return W}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(N),u+=N.length-1}else if(this.state.field.length!==0){if(I===!1){let b=this.__infoField(),R=Object.keys($).map(B=>$[B].equals(this.state.field.toString())?B:!1).filter(Boolean)[0],v=this.__error(new c("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(b.column)} at line ${b.lines}, value is ${JSON.stringify(this.state.field.toString(h))}`,R?`(${R} bom)`:void 0],this.options,b,{field:this.state.field}));if(v!==void 0)return v}}else{this.state.quoting=!0,u+=N.length-1;continue}if(this.state.quoting===!1){let b=this.__isRecordDelimiter(m,_,u);if(b!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=w){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),u+=b-1;continue}if(y===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,u+=b-1;continue}this.info.bytes=this.state.bufBytesStart+u;let B=this.__onField();if(B!==void 0)return B;this.info.bytes=this.state.bufBytesStart+u+b;let J=this.__onRecord(r);if(J!==void 0)return J;if(g!==-1&&this.info.records>=g){this.state.stop=!0,a();return}}this.state.commenting=!1,u+=b-1;continue}if(this.state.commenting)continue;if(x!==null&&(f===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(x,_,u,m)!==0){this.state.commenting=!0;continue}let R=this.__isDelimiter(_,u,m);if(R!==0){this.info.bytes=this.state.bufBytesStart+u;let v=this.__onField();if(v!==void 0)return v;u+=R-1;continue}}}if(this.state.commenting===!1&&O!==0&&this.state.record_length+this.state.field.length>O)return this.__error(new c("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${O}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let D=S===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(_,u),k=E===!1||this.state.wasQuoting===!1;if(D===!0&&k===!0)this.state.field.append(m);else{if(E===!0&&!this.__isCharTrimable(_,u))return this.__error(new c("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));D===!1&&(u+=this.__isCharTrimable(_,u)-1);continue}}if(n===!0)if(this.state.quoting===!0){let m=this.__error(new c("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(m!==void 0)return m}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+u;let m=this.__onField();if(m!==void 0)return m;let D=this.__onRecord(r);if(D!==void 0)return D}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=u,this.state.previousBuf=_.slice(u);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(t){let{columns:n,group_columns_by_name:r,encoding:a,info:s,from:f,relax_column_count:l,relax_column_count_less:h,relax_column_count_more:w,raw:S,skip_records_with_empty_values:O}=this.options,{enabled:L,record:I}=this.state;if(L===!1)return this.__resetRecord();let E=I.length;if(n===!0){if(O===!0&&pe(I)){this.__resetRecord();return}return this.__firstLineToColumns(I)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=E),E!==this.state.expectedRecordLength){let y=n===!1?new c("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I}):new c("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I});if(l===!0||h===!0&&E<this.state.expectedRecordLength||w===!0&&E>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=y;else{let g=this.__error(y);if(g)return g}}if(O===!0&&pe(I)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,f===1||this.info.records>=f){let{objname:y}=this.options;if(n!==!1){let g={};for(let p=0,x=I.length;p<x;p++)n[p]===void 0||n[p].disabled||(r===!0&&Object.hasOwn(g,n[p].name)?Array.isArray(g[n[p].name])?g[n[p].name]=g[n[p].name].concat(I[p]):g[n[p].name]=[g[n[p].name],I[p]]:Object.defineProperty(g,n[p].name,{value:I[p],enumerable:!0,writable:!0,configurable:!0}));if(S===!0||s===!0){let p=Object.assign({record:g},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),x=this.__push(y===void 0?p:[g[y],p],t);if(x)return x}else{let p=this.__push(y===void 0?g:[g[y],g],t);if(p)return p}}else if(S===!0||s===!0){let g=Object.assign({record:I},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),p=this.__push(y===void 0?g:[I[y],g],t);if(p)return p}else{let g=this.__push(y===void 0?I:[I[y],I],t);if(g)return g}}this.__resetRecord()},__firstLineToColumns:function(t){let{firstLineToHeaders:n}=this.state;try{let r=n===void 0?t:n.call(null,t);if(!Array.isArray(r))return this.__error(new c("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}));let a=z(r);this.state.expectedRecordLength=a.length,this.options.columns=a,this.__resetRecord();return}catch(r){return r}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:t,encoding:n,rtrim:r,max_record_size:a}=this.options,{enabled:s,wasQuoting:f}=this.state;if(s===!1)return this.__resetField();let l=this.state.field.toString(n);if(r===!0&&f===!1&&(l=l.trimRight()),t===!0){let[h,w]=this.__cast(l);if(h!==void 0)return h;l=w}this.state.record.push(l),a!==0&&typeof l=="string"&&(this.state.record_length+=l.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(t,n){let{on_record:r}=this.options;if(r!==void 0){let a=this.__infoRecord();try{t=r.call(null,t,a)}catch(s){return s}if(t==null)return}this.info.bytes_records+=this.info.bytes,n(t)},__cast:function(t){let{columns:n,relax_column_count:r}=this.options;if(Array.isArray(n)===!0&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let s=this.__infoField();return[void 0,this.state.castField.call(null,t,s)]}catch(s){return[s]}if(this.__isFloat(t))return[void 0,parseFloat(t)];if(this.options.cast_date!==!1){let s=this.__infoField();return[void 0,this.options.cast_date.call(null,t,s)]}return[void 0,t]},__compareBytes:function(t,n,r,a){if(t[0]!==a)return 0;let s=t.length;for(let f=1;f<s;f++)if(t[f]!==n[r+f])return 0;return s},__isCharTrimable:function(t,n){let{timchars:r,timcharFirstBytes:a}=this.state,s=t[n];if(s===void 0||a[s]===0)return 0;e:for(let f=0;f<r.length;f++){let l=r[f];for(let h=0;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}return 0},__isDelimiter:function(t,n,r){let{delimiter:a,ignore_last_delimiters:s}=this.options;if(s===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(s!==!1&&typeof s=="number"&&this.state.record.length===s-1)return 0;e:for(let f=0;f<a.length;f++){let l=a[f];if(l[0]===r){for(let h=1;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}}return 0},__isEscape:function(t,n,r){let{escape:a}=this.options;if(a===null)return!1;let s=a.length;if(a[0]===r){for(let f=0;f<s;f++)if(a[f]!==t[n+f])return!1;return!0}return!1},__isFloat:function(t){return t-parseFloat(t)+1>=0},__isQuote:function(t,n){let{quote:r}=this.options;if(r===null)return!1;let a=r.length;for(let s=0;s<a;s++)if(r[s]!==t[n+s])return!1;return!0},__isRecordDelimiter:function(t,n,r){let{record_delimiter:a}=this.options,s=a.length;e:for(let f=0;f<s;f++){let l=a[f],h=l.length;if(l[0]===t){for(let w=1;w<h;w++)if(l[w]!==n[r+w])continue e;return l.length}}return 0},__autoDiscoverRecordDelimiter:function(t,n){let{encoding:r}=this.options,a=[Buffer.from(`\r
3
+ `,r),Buffer.from(`
4
+ `,r),Buffer.from("\r",r)];e:for(let s=0;s<a.length;s++){let f=a[s].length;for(let l=0;l<f;l++)if(a[s][l]!==t[n+l])continue e;return this.options.record_delimiter.push(a[s]),this.state.recordDelimiterMaxLength=a[s].length,a[s].length}return 0},__error:function(t){let{encoding:n,raw:r,skip_records_with_error:a}=this.options,s=typeof t=="string"?new Error(t):t;if(a){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(s,r?this.state.rawBuffer.toString(n):void 0)}catch(f){return f}return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:t,raw:n,encoding:r}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:t===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(r):void 0}},__infoField:function(){let{columns:t}=this.options,n=Array.isArray(t),r=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:r,column:n===!0?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var ge=function(i,e={}){typeof i=="string"&&(i=Buffer.from(i));let o=e&&e.objname?Object.create(null):[],t=j(e),n=s=>{t.options.objname===void 0?o.push(s):o[s[0]]=s[1]},r=()=>{},a=t.parse(i,!0,n,r);if(a!==void 0)throw a;return o};var Ve=["shop_id","target_plan_handle","price_behavior","notification"],Pe={schedule:["shop_id","target_plan_handle","price_behavior"],unschedule:["shop_id"]};function be(i,e){if(i.trim()==="")return{ok:!1,errors:[{message:"The CSV is empty"}]};let o=[],t;try{t=ge(i,{bom:!0,columns:r=>(o=r,r),info:!0,skip_empty_lines:!0,trim:!0})}catch(r){if(!(r instanceof c))throw r;return{ok:!1,errors:[{message:`Invalid CSV: ${r.message}`}]}}let n=ke(o,e);return n.length>0?{ok:!1,errors:n}:t.length===0?{ok:!1,errors:[{message:"The CSV must contain at least one data row"}]}:{ok:!0,rows:t.map(({record:r,info:a})=>Je(r,a.lines,e))}}function ke(i,e){let o=[],t=new Set(Ve),n=new Set;for(let r of i)n.has(r)?o.push({field:r,message:`Duplicate CSV header: ${r}`}):n.add(r),t.has(r)||o.push({field:r,message:`Unknown CSV header: ${r}`});for(let r of Pe[e])i.includes(r)||o.push({field:r,message:`Missing required CSV header: ${r}`});return o}function Je(i,e,o){return o==="unschedule"?{sourceRow:e,shopId:i.shop_id}:{sourceRow:e,shopId:i.shop_id,...i.target_plan_handle===void 0?{}:{targetPlanHandle:i.target_plan_handle},...i.price_behavior===void 0?{}:{priceBehavior:i.price_behavior},...i.notification===void 0?{}:{notification:i.notification}}}d();var we={fileExists:Z,readFile:Y,readStdin:ie};async function G(i,e=we){let o={...we,...e};if(i!=="-"){if(!await o.fileExists(i))throw new A(`CSV file not found: ${i}`);try{return await o.readFile(i)}catch(n){if(n instanceof A)throw n;let r=n instanceof Error?n.message:String(n);throw new A(`Couldn't read CSV file ${i}: ${r}`)}}let t=await o.readStdin();if(t===void 0||t==="")throw new A("Provide --input <path> or pipe CSV data to stdin.");return t}async function Ie(i,e,o){let t=o?await G(e,o):await G(e),n=be(t,i);return n.ok?ue(i,n.rows):n}d();d();var qe="shopify-subscription-migration:v1";function ye(){return X()}function Oe({appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t}){let n=JSON.stringify({namespace:qe,appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t});return q(n).toString("hex")}var K=class extends Error{batchIndex;constructor(e){super(`Migration submission batch ${e} returned neither an operation nor user errors`),this.name="MigrationSubmissionProtocolError",this.batchIndex=e}};async function Se({clientId:i,plan:e,invocationId:o=ye(),createOperation:t=oe}){let n={clientId:i,action:e.action,inputDigest:e.inputDigest,total:e.rows.length,operations:[]};for(let r of e.batches){let a=Oe({appIdentifier:i,action:e.action,invocationId:o,canonicalBatchPayload:r.canonicalPayload}),s=await t({clientId:i,idempotencyKey:a,migrations:r.rows.map(ze)});if(s.operation&&n.operations.push({batchIndex:r.index,batchPayloadDigest:r.payloadDigest,operation:s.operation}),s.userErrors.length>0)return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:s.userErrors}};if(!s.operation)throw new K(r.index)}return{status:"success",submission:n}}function ze(i){return i.action==="unschedule"?{shopId:i.shopId,action:{cancelMigration:!0}}:{shopId:i.shopId,action:{scheduleMigration:je(i)}}}function je({targetPlanHandle:i,priceBehavior:e,notification:o}){return{targetPlanHandle:i,priceBehavior:e,notification:o}}async function ni(i){let e=await Ie(i.action,i.input);if(!e.ok)throw new A(Ue(e.errors));if(!i.skipConfirmation&&!await ee({message:`${i.action==="schedule"?"Schedule":"Unschedule"} ${e.plan.rows.length} subscriptions?`}))throw new te;let o=await Se({clientId:i.clientId,plan:e.plan});if(o.status==="failed"||!i.watch)return o;i.onSubmissionAccepted?.(o.submission);let t=await se({clientId:i.clientId,operationIds:o.submission.operations.map(({operation:a})=>a.id)}),n=Fe(o.submission,t),r=n.operations.filter(({operation:a})=>a.status==="FAILED").map(({operation:a})=>a.id);return r.length===0?{status:"success",submission:n}:{status:"failed",submission:n,failure:{type:"operations",operationIds:r}}}function Fe(i,e){let o=new Map(e.map(t=>[t.id,t]));return{...i,operations:i.operations.map(t=>({...t,operation:o.get(t.operation.id)??t.operation}))}}function Ue(i){return i.map(e=>{let o=[e.row===void 0?void 0:`row ${e.row}`,e.field].filter(t=>t!==void 0).join(", ");return o?`${o}: ${e.message}`:e.message}).join(`
5
+ `)}export{ni as a};
@@ -0,0 +1,5 @@
1
+ import{ba as a,i}from"./chunk-ZZRFG6ME.js";import{qb as e,sb as r}from"./chunk-VFM2KQRM.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();async function f(n,t,o){return c(n,t,o,"text")}async function c(n,t,o,S){return await a(t,o.source),S==="json"?r`${e.json({SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:i(n.configuration)})}`:r`
2
+ ${e.green("SHOPIFY_API_KEY")}=${t.apiKey}
3
+ ${e.green("SHOPIFY_API_SECRET")}=${t.apiSecretKeys[0]?.secret??""}
4
+ ${e.green("SCOPES")}=${i(n.configuration)}
5
+ `}export{f as a,c as b};
@@ -0,0 +1 @@
1
+ import{a as u,b as l}from"./chunk-H2TQ4ODI.js";import{f as d,i as m}from"./chunk-HFSCXTJQ.js";import{a as c}from"./chunk-UZARYOLN.js";import{wa as p}from"./chunk-ZZRFG6ME.js";import{h as s}from"./chunk-BWJIZYAG.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();async function f({clientId:a,operationIds:t,getOperation:n=m}){return Promise.all(t.map(async i=>{let e=await n({clientId:a,operationId:i});if(!e)throw new s(`Migration operation not found: ${i}`);return e}))}var r=class a extends c{static hidden=!0;static summary="Checks the status of app subscription migration operations.";static descriptionWithMarkdown="Checks app subscription migration operation status.\n\nRepeat `--id` for every operation GID returned by a multi-batch submission. With `--watch`, the command displays the current state while polling and outputs the final state after all requested operations reach a terminal status.\n\n`RUNNING` means an operation is still processing. `COMPLETED` means processing finished, but you must inspect the per-shop results to confirm each outcome. `FAILED` means the operation failed, and `CANCELED` means cancellation stopped further processing.\n\nUse `--json` to output every operation and its per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2> --watch","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...d};async run(){let{flags:t}=await this.parse(a),{app:n,remoteApp:i}=await p({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),e=t.watch?await l({clientId:i.apiKey,operationIds:t.id}):await f({clientId:i.apiKey,operationIds:t.id});return u(e,t.json),{app:n}}};export{r as a};
@@ -1,4 +1,4 @@
1
- import{p as C,v as Y}from"./chunk-OORWOTAP.js";import{$ as re,aa as H}from"./chunk-PIFW2R3S.js";import{b as U}from"./chunk-JJJTPEMD.js";import{r as L}from"./chunk-KK24VGVE.js";import{y as w,z as E}from"./chunk-GMTNOCMS.js";import{h as P}from"./chunk-R2R6JDNH.js";import{a as oe}from"./chunk-CTNBSUVU.js";import{$a as A,Ab as j,N as I,Ta as N,ua as T,wb as p,xb as $,yb as G}from"./chunk-Y34LWI3S.js";import{d as O,f as _,p as b}from"./chunk-773TIA5M.js";import{e as k,g as v}from"./chunk-VKWPEFWQ.js";v();v();var r=k(H(),1),l=k(re(),1);function se(e,t){return e instanceof Error&&"code"in e&&e.code==="ENOENT"&&"path"in e&&typeof e.path=="string"&&_(e.path)===_(t)}async function F(e,t){try{return await t()}catch(n){throw e!==void 0&&se(n,e)?new P(`Theme Check config file not found: ${e}`):n}}function ce(e){switch(e){case"error":return r.Severity.ERROR;case"suggestion":case"warning":return r.Severity.WARNING;case"style":case"info":return r.Severity.INFO;case"crash":return}}function W(e){switch(e){case r.Severity.ERROR:return"error";case r.Severity.WARNING:return"warning";case r.Severity.INFO:return"info"}}function ae(e){return new Map(e.map(t=>[t.uri,t.source]))}function ue(e,t,n){let o=e.split(`
1
+ import{p as C,v as Y}from"./chunk-GNBRCK7L.js";import{$ as re,aa as H}from"./chunk-F3NYCSXT.js";import{b as U}from"./chunk-YEVGLC5X.js";import{r as L}from"./chunk-Y5PRPHLQ.js";import{y as w,z as E}from"./chunk-YFINLODF.js";import{h as P}from"./chunk-BWJIZYAG.js";import{a as oe}from"./chunk-CTNBSUVU.js";import{$a as A,Ab as j,N as I,Ta as N,ua as T,wb as p,xb as $,yb as G}from"./chunk-VFM2KQRM.js";import{d as O,f as _,p as b}from"./chunk-773TIA5M.js";import{e as k,g as v}from"./chunk-VKWPEFWQ.js";v();v();var r=k(H(),1),l=k(re(),1);function se(e,t){return e instanceof Error&&"code"in e&&e.code==="ENOENT"&&"path"in e&&typeof e.path=="string"&&_(e.path)===_(t)}async function F(e,t){try{return await t()}catch(n){throw e!==void 0&&se(n,e)?new P(`Theme Check config file not found: ${e}`):n}}function ce(e){switch(e){case"error":return r.Severity.ERROR;case"suggestion":case"warning":return r.Severity.WARNING;case"style":case"info":return r.Severity.INFO;case"crash":return}}function W(e){switch(e){case r.Severity.ERROR:return"error";case r.Severity.WARNING:return"warning";case r.Severity.INFO:return"info"}}function ae(e){return new Map(e.map(t=>[t.uri,t.source]))}function ue(e,t,n){let o=e.split(`
2
2
  `).slice(t,n+1),s=o.length===1;return o.map((c,a)=>{let u=t+a+1,m=s?c.trim():c;return`${u} ${m}`}).join(`
3
3
  `)}function fe(e){switch(e){case r.Severity.ERROR:return{error:`
4
4
  [error]:`};case r.Severity.WARNING:return{warn:`
@@ -1 +1 @@
1
- import{O as i}from"./chunk-GMTNOCMS.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
1
+ import{O as i}from"./chunk-YFINLODF.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
@@ -1 +1 @@
1
- import{g as o}from"./chunk-JJJTPEMD.js";import{b as s}from"./chunk-RY2SJVWM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
1
+ import{g as o}from"./chunk-YEVGLC5X.js";import{b as s}from"./chunk-2XDUJQQN.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-J3JPJCWP.js";import{a as fe}from"./chunk-WHLGNDRE.js";import{b as re,c as oe,d as se,e as ne,f as ie,h as ae,i as le,k as ce,l as me,n as de}from"./chunk-MLZLDL6B.js";import{c as ee,e as te}from"./chunk-KOVAFUYN.js";import{a as X}from"./chunk-E2W5OYYM.js";import{c as Q,e as b,m as Z,n as x}from"./chunk-LZ3GZ7NS.js";import{k as P,l as V,n as w}from"./chunk-4JY2P2A5.js";import{s as C,u as k}from"./chunk-OORWOTAP.js";import{a as Y,b as B}from"./chunk-JUKAWTYY.js";import{o as J,s as K,t as j,u as z,w as N}from"./chunk-Q7BOSHWX.js";import{a as F,va as $,za as L}from"./chunk-YN6A26QL.js";import{A as T,C as q,D as G,N as U,w as W,y as I,z as M}from"./chunk-GMTNOCMS.js";import{d as _,e as H}from"./chunk-JQISGC7D.js";import{h as y}from"./chunk-R2R6JDNH.js";import{Ab as u,qb as g,sb as R,xb as E}from"./chunk-Y34LWI3S.js";import{i as p}from"./chunk-B4OMIONW.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();var he={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return he;u("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=Ee(o,r),a=i.length===0&&n.length===0&&l.length===0;if(L(`theme-service:theme-reconciliation:manual:${a}`),a)return u("Local and remote checksums match - no need to reconcile theme assets"),he;let m=await De({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Ae(e,t,r,m)}}function Ee(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:S(r,t),filesOnlyPresentLocally:S(i,t),filesWithConflictingChecksums:S(s,t)}}function S(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function A(e,t,o,r){if(e.length===0)return;if(r){Ce(e,o,r);return}I({body:{list:{title:t,items:e.map(i=>i.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:pe}]})===D?o.remote.callback(e):o.local.callback(e)}function Ce(e,t,o){switch(o){case"keep-remote":t.remote.callback(e);break;case"keep-local":t.local.callback(e);break;case"abort":break}}function Se(e){let t=[{title:"The files listed below are only present locally.",files:e.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:e.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:e.filesWithConflictingChecksums}];throw new y("Theme JSON files need reconciliation.",t.filter(o=>o.files.length>0).map(o=>`${o.title}
1
+ import{a as v}from"./chunk-J3JPJCWP.js";import{a as fe}from"./chunk-E5FXOLQO.js";import{b as re,c as oe,d as se,e as ne,f as ie,h as ae,i as le,k as ce,l as me,n as de}from"./chunk-7T6M7FAC.js";import{a as X}from"./chunk-NQK2VCDA.js";import{c as Q,e as b,m as Z,n as x}from"./chunk-YKL3BLWC.js";import{c as ee,e as te}from"./chunk-GRPKF5ZB.js";import{k as P,l as V,n as w}from"./chunk-5SEEDOQ5.js";import{s as C,u as k}from"./chunk-GNBRCK7L.js";import{a as Y,b as B}from"./chunk-OZMQ2EJB.js";import{o as J,s as K,t as j,u as z,w as N}from"./chunk-Q7BOSHWX.js";import{Aa as L,b as F,wa as $}from"./chunk-3JXPOOFV.js";import{A as T,C as q,D as G,N as U,w as W,y as I,z as M}from"./chunk-YFINLODF.js";import{d as _,e as H}from"./chunk-NHAUJWEG.js";import{h as y}from"./chunk-BWJIZYAG.js";import{Ab as u,qb as g,sb as R,xb as E}from"./chunk-VFM2KQRM.js";import{i as p}from"./chunk-B4OMIONW.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();var he={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return he;u("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=Ee(o,r),a=i.length===0&&n.length===0&&l.length===0;if(L(`theme-service:theme-reconciliation:manual:${a}`),a)return u("Local and remote checksums match - no need to reconcile theme assets"),he;let m=await De({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Ae(e,t,r,m)}}function Ee(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:S(r,t),filesOnlyPresentLocally:S(i,t),filesWithConflictingChecksums:S(s,t)}}function S(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function A(e,t,o,r){if(e.length===0)return;if(r){Ce(e,o,r);return}I({body:{list:{title:t,items:e.map(i=>i.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:pe}]})===D?o.remote.callback(e):o.local.callback(e)}function Ce(e,t,o){switch(o){case"keep-remote":t.remote.callback(e);break;case"keep-local":t.local.callback(e);break;case"abort":break}}function Se(e){let t=[{title:"The files listed below are only present locally.",files:e.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:e.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:e.filesWithConflictingChecksums}];throw new y("Theme JSON files need reconciliation.",t.filter(o=>o.files.length>0).map(o=>`${o.title}
2
2
  ${o.files.map(r=>`- ${r.key}`).join(`
3
3
  `)}`).join(`
4
4
 
@@ -1,2 +1,2 @@
1
- import{a as N,b as $,c as w}from"./chunk-V2HCVJYF.js";import{q as T}from"./chunk-YN6A26QL.js";import{S as P,T as k,a as F}from"./chunk-GMTNOCMS.js";import{a as D,b}from"./chunk-TTAPXLI5.js";import{k as A}from"./chunk-R2R6JDNH.js";import{Ab as u,Ia as U,La as I,N as x,Pa as O,Ua as p,xa as y,za as _}from"./chunk-Y34LWI3S.js";import{f as h}from"./chunk-XAOYKECS.js";import{d as m,i as l,j as S}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();import{fileURLToPath as q}from"url";import Y from"util";import{pipeline as j}from"stream";import{execSync as z,execFileSync as B}from"child_process";var H="2024.8.2",W=`https://github.com/cloudflare/cloudflared/releases/download/${H}/`,G={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},V={arm64:"cloudflared-darwin-arm64.tgz",x64:"cloudflared-darwin-amd64.tgz"},X={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-amd64.exe"},v={linux:G,darwin:V,win32:X};function Z(r=process.platform,t=process.arch){if(!Object.keys(v).includes(r))throw new Error(`Unsupported system platform: ${r}`);let n=v[r][t];if(n===void 0)throw new Error(`Unsupported system arch: ${t}`);return W+n}function J(r=process.env,t=process.platform){return r.SHOPIFY_CLI_CLOUDFLARED_PATH?r.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(q(import.meta.url)),"..","bin",t==="win32"?"cloudflared.exe":"cloudflared")}async function g(r=process.env,t=process.platform,e=process.arch){if(r.SHOPIFY_CLI_IGNORE_CLOUDFLARED){u("Skipping cloudflared installation because SHOPIFY_CLI_IGNORE_CLOUDFLARED is set");return}let n=Z(t,e),o=J(r,t);if(p(o))try{let i=B(o,["--version"],{encoding:"utf8"}).split(" "),a=i.length>2?i[2]:"0.0.0";if(!K(H,a)){u("cloudflared already installed, skipping");return}}catch{u("version check failed, reinstalling")}if(t==="linux")await Q(n,o);else if(t==="darwin")await rt(n,o);else if(t==="win32")await tt(n,o);else throw new Error(`Unsupported platform: ${t}`)}function K(r,t){let[e,n,o]=r.split(".").map(Number),[i,a,c]=t.split(".").map(Number);return e!==i?(e??0)>(i??0):n!==a?(n??0)>(a??0):(o??0)>(c??0)}async function Q(r,t){await C(r,t),await O(t,"755")}async function tt(r,t){await C(r,t)}async function rt(r,t){await C(r,`${t}.tgz`);let e=S(`${t}.tgz`);z(`tar -xzf ${e}`,{cwd:l(t)}),U(`${t}.tgz`),await _(`${l(t)}/cloudflared`,t)}async function C(r,t){p(l(t))||y(l(t));let e=Y.promisify(j),n=await T(r,{redirect:"follow"},"slow-request");if(!n.ok||!n.body)throw new Error(`Couldn't download file ${r} (${n.status} ${n.statusText})`);let o=I(t);return await e(n.body,o),t}import{Writable as et}from"stream";import{fileURLToPath as nt}from"url";var $t=$({provider:w,action:it}),ot=h()?.2:40,st=5;async function it(r){try{let t=new R(r);return await t.startTunnel(),D(t)}catch(t){let e=new N("unknown",t.message);return b(e)}}var R=class{port;provider=w;currentStatus={status:"not-started"};abortController=void 0;constructor(t){this.port=t}async startTunnel(){try{await g(),this.tunnel()}catch(t){this.currentStatus={status:"error",message:t.message,tryMessage:d()}}}getTunnelStatus(){return this.currentStatus}stopTunnel(){this.abortController?.abort()}tunnel(t=0){this.abortController=new F;let e=!1;if(t>=st){e=!0,this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: max retries reached.",tryMessage:d()};return}let n=["tunnel","--url",`http://localhost:${this.port}`,"--no-autoupdate"],o=[],i=!1,a;this.currentStatus={status:"starting"},setTimeout(()=>{if(!e){e=!0;let s=x(o).slice(-5).join(`
1
+ import{a as N,b as $,c as w}from"./chunk-ZDRIQC7O.js";import{r as T}from"./chunk-3JXPOOFV.js";import{S as P,T as k,a as F}from"./chunk-YFINLODF.js";import{a as D,b}from"./chunk-XF2KTEID.js";import{k as A}from"./chunk-BWJIZYAG.js";import{Ab as u,Ia as U,La as I,N as x,Pa as O,Ua as p,xa as y,za as _}from"./chunk-VFM2KQRM.js";import{f as h}from"./chunk-R6ICQT2D.js";import{d as m,i as l,j as S}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();import{fileURLToPath as q}from"url";import Y from"util";import{pipeline as j}from"stream";import{execSync as z,execFileSync as B}from"child_process";var H="2024.8.2",W=`https://github.com/cloudflare/cloudflared/releases/download/${H}/`,G={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},V={arm64:"cloudflared-darwin-arm64.tgz",x64:"cloudflared-darwin-amd64.tgz"},X={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-amd64.exe"},v={linux:G,darwin:V,win32:X};function Z(r=process.platform,t=process.arch){if(!Object.keys(v).includes(r))throw new Error(`Unsupported system platform: ${r}`);let n=v[r][t];if(n===void 0)throw new Error(`Unsupported system arch: ${t}`);return W+n}function J(r=process.env,t=process.platform){return r.SHOPIFY_CLI_CLOUDFLARED_PATH?r.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(q(import.meta.url)),"..","bin",t==="win32"?"cloudflared.exe":"cloudflared")}async function g(r=process.env,t=process.platform,e=process.arch){if(r.SHOPIFY_CLI_IGNORE_CLOUDFLARED){u("Skipping cloudflared installation because SHOPIFY_CLI_IGNORE_CLOUDFLARED is set");return}let n=Z(t,e),o=J(r,t);if(p(o))try{let i=B(o,["--version"],{encoding:"utf8"}).split(" "),a=i.length>2?i[2]:"0.0.0";if(!K(H,a)){u("cloudflared already installed, skipping");return}}catch{u("version check failed, reinstalling")}if(t==="linux")await Q(n,o);else if(t==="darwin")await rt(n,o);else if(t==="win32")await tt(n,o);else throw new Error(`Unsupported platform: ${t}`)}function K(r,t){let[e,n,o]=r.split(".").map(Number),[i,a,c]=t.split(".").map(Number);return e!==i?(e??0)>(i??0):n!==a?(n??0)>(a??0):(o??0)>(c??0)}async function Q(r,t){await C(r,t),await O(t,"755")}async function tt(r,t){await C(r,t)}async function rt(r,t){await C(r,`${t}.tgz`);let e=S(`${t}.tgz`);z(`tar -xzf ${e}`,{cwd:l(t)}),U(`${t}.tgz`),await _(`${l(t)}/cloudflared`,t)}async function C(r,t){p(l(t))||y(l(t));let e=Y.promisify(j),n=await T(r,{redirect:"follow"},"slow-request");if(!n.ok||!n.body)throw new Error(`Couldn't download file ${r} (${n.status} ${n.statusText})`);let o=I(t);return await e(n.body,o),t}import{Writable as et}from"stream";import{fileURLToPath as nt}from"url";var $t=$({provider:w,action:it}),ot=h()?.2:40,st=5;async function it(r){try{let t=new R(r);return await t.startTunnel(),D(t)}catch(t){let e=new N("unknown",t.message);return b(e)}}var R=class{port;provider=w;currentStatus={status:"not-started"};abortController=void 0;constructor(t){this.port=t}async startTunnel(){try{await g(),this.tunnel()}catch(t){this.currentStatus={status:"error",message:t.message,tryMessage:d()}}}getTunnelStatus(){return this.currentStatus}stopTunnel(){this.abortController?.abort()}tunnel(t=0){this.abortController=new F;let e=!1;if(t>=st){e=!0,this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: max retries reached.",tryMessage:d()};return}let n=["tunnel","--url",`http://localhost:${this.port}`,"--no-autoupdate"],o=[],i=!1,a;this.currentStatus={status:"starting"},setTimeout(()=>{if(!e){e=!0;let s=x(o).slice(-5).join(`
2
2
  `);s===""?this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: unknown error.",tryMessage:d()}:this.currentStatus={status:"error",message:s,tryMessage:d()},this.abortController?.abort()}},ot*1e3);let c=this,E=new et({write(s,mt,M){if(u(s.toString()),e)return;a??=at(s),ct(s)&&(i=!0),i&&(a?(e=!0,c.currentStatus={status:"connected",url:a}):c.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: URL not found."});let L=lt(s);L&&o.push(L),M()}});P(dt(),n,{stdout:E,stderr:E,signal:this.abortController.signal,externalErrorHandler:async s=>{if(e)throw new A(`Could not start Cloudflare tunnel: process crashed after stablishing a connection: ${s.message}`,d());u(`Cloudflare tunnel crashed: ${s.message}, restarting...`),h()||await k(1),this.tunnel(t+1)}})}};function d(){return["You can run the command again, or try networking with Shopify via",{command:"--use-localhost"},"or",{command:"--tunnel-url <custom tunnel>"},".",{link:{label:"See documentation for details.",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options"}}]}function at(r){let t=new RegExp(`(https:\\/\\/[^\\s]+\\.${ft()})`),e=r.toString().match(t)??void 0;return e&&e[1]}function lt(r){if([/failed to request quick Tunnel/,/failed to unmarshal quick Tunnel/,/failed to parse quick Tunnel ID/,/failed to provision routing/,/ERR Couldn't start tunnel/,/ERR Failed to serve quic connection/,/ERR Failed to create new quic connection error/].some(n=>n.test(r.toString())))return`Could not start Cloudflare tunnel: ${ut(r.toString())}`}function ut(r){let t=/^[0-9TZ:-]+ (ERR )?/g,e=/connIndex.*/g;return r.replace(t,"").replace(e,"")}function ct(r){let t=r.toString().match(/(INF Registered tunnel connection|INF Connection)/)??void 0;return t&&t[0]}function dt(){return process.env.SHOPIFY_CLI_CLOUDFLARED_PATH?process.env.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(nt(import.meta.url)),"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared")}function ft(){return process.env.SHOPIFY_CLI_CLOUDFLARED_DOMAIN??"trycloudflare.com"}export{$t as a};
@@ -1 +1 @@
1
- import{c as u}from"./chunk-KIYHEMHD.js";import{A as c}from"./chunk-GMTNOCMS.js";import{e as s}from"./chunk-JQISGC7D.js";import{$a as d}from"./chunk-Y34LWI3S.js";import{q as m}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();function o(e,n){n||c(e)}async function P(e,n,t){let r=await l(n,t);if(!r){o({body:"Environment file not found."},t?.silent);return}let a=(await u.read(r)).content.environments;if(!a){o({body:["No environments found in",{command:r},{char:"."}]},t?.silent);return}let i=a[e];if(!i){o({body:["Environment",{command:e},"not found."]},t?.silent);return}return await s(()=>({environmentFlags:JSON.stringify(i)})),i}async function l(e,n){let t=n?.from&&n.from!=="."?n.from:m();return d(e,{cwd:t,type:"file"})}export{P as a,l as b};
1
+ import{c as u}from"./chunk-CEYIZC3M.js";import{A as c}from"./chunk-YFINLODF.js";import{e as s}from"./chunk-NHAUJWEG.js";import{$a as d}from"./chunk-VFM2KQRM.js";import{q as m}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();function o(e,n){n||c(e)}async function P(e,n,t){let r=await l(n,t);if(!r){o({body:"Environment file not found."},t?.silent);return}let a=(await u.read(r)).content.environments;if(!a){o({body:["No environments found in",{command:r},{char:"."}]},t?.silent);return}let i=a[e];if(!i){o({body:["Environment",{command:e},"not found."]},t?.silent);return}return await s(()=>({environmentFlags:JSON.stringify(i)})),i}async function l(e,n){let t=n?.from&&n.from!=="."?n.from:m();return d(e,{cwd:t,type:"file"})}export{P as a,l as b};
@@ -1 +1 @@
1
- import{X as B}from"./chunk-YN6A26QL.js";import{u as O}from"./chunk-GMTNOCMS.js";import{F as w,f as m}from"./chunk-Y34LWI3S.js";import{c as g,e as s,g as o}from"./chunk-VKWPEFWQ.js";var f=g((Q,c)=>{o();function j(r,e,t,n){for(var a=-1,i=r==null?0:r.length;++a<i;){var u=r[a];e(n,u,t(u),r)}return n}c.exports=j});var A=g((S,h)=>{o();var l=O();function E(r,e,t,n){return l(r,function(a,i,u){e(n,a,t(a),u)}),n}h.exports=E});var p=g((U,q)=>{o();var G=f(),I=A(),V=w(),C=m();function D(r,e){return function(t,n){var a=C(t)?G:I,i=e?e():{};return a(t,r,V(n,2),i)}}q.exports=D});var x=g((X,v)=>{o();var F=B(),H=p(),J=Object.prototype,K=J.hasOwnProperty,L=H(function(r,e,t){K.call(r,t)?r[t].push(e):F(r,t,[e])});v.exports=L});var y=g((Z,b)=>{o();var M=p(),N=M(function(r,e,t){r[t?0:1].push(e)},function(){return[[],[]]});b.exports=N});o();var P=s(x()),d=s(y());function $(r,e){return(0,P.default)(r,e)}function k(r,e){return(0,d.default)(r,e)}export{$ as a,k as b};
1
+ import{Y as B}from"./chunk-3JXPOOFV.js";import{u as O}from"./chunk-YFINLODF.js";import{F as w,f as m}from"./chunk-VFM2KQRM.js";import{c as g,e as s,g as o}from"./chunk-VKWPEFWQ.js";var f=g((Q,c)=>{o();function j(r,e,t,n){for(var a=-1,i=r==null?0:r.length;++a<i;){var u=r[a];e(n,u,t(u),r)}return n}c.exports=j});var A=g((S,h)=>{o();var l=O();function E(r,e,t,n){return l(r,function(a,i,u){e(n,a,t(a),u)}),n}h.exports=E});var p=g((U,q)=>{o();var G=f(),I=A(),V=w(),C=m();function D(r,e){return function(t,n){var a=C(t)?G:I,i=e?e():{};return a(t,r,V(n,2),i)}}q.exports=D});var x=g((X,v)=>{o();var F=B(),H=p(),J=Object.prototype,K=J.hasOwnProperty,L=H(function(r,e,t){K.call(r,t)?r[t].push(e):F(r,t,[e])});v.exports=L});var y=g((Z,b)=>{o();var M=p(),N=M(function(r,e,t){r[t?0:1].push(e)},function(){return[[],[]]});b.exports=N});o();var P=s(x()),d=s(y());function $(r,e){return(0,P.default)(r,e)}function k(r,e){return(0,d.default)(r,e)}export{$ as a,k as b};
@@ -1,4 +1,4 @@
1
- import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-LZ3GZ7NS.js";import{a as M,l as gt,m as yt}from"./chunk-4JY2P2A5.js";import{s as ie,t as W}from"./chunk-OORWOTAP.js";import{a as O,b as N,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as $,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-PIFW2R3S.js";import{b as Ke,xa as L,za as H}from"./chunk-YN6A26QL.js";import{A as I,B as te,C as tt,T as st,y as et}from"./chunk-GMTNOCMS.js";import{h as se}from"./chunk-R2R6JDNH.js";import{Ab as F,Bb as D,O as Xe,Ta as P,Wa as C,Z as $e,bb as ke,ma as k,qb as j,sb as ne,ua as be,wa as Ze,xb as re,ya as Qe}from"./chunk-Y34LWI3S.js";import{d as E,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ge,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=_e(s),[a=[],p=[]]=_e(n),[m=[],c=[]]=_e(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),p.length>0&&(l=l.concat(e.filter(B(p,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,f=>f.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=E(e,rs);return await P(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function _e(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),I({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}h();import Ft from"fs/promises";var le=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),u=de(c,l),f=typeof l=="string"?l:"",T=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:u,value:f,attachment:T})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let u=V(e,l),f=o(u).then(()=>{let T=t.get(u);return s.add(T.key),T.value??T.attachment??""});st(5).then(()=>{s.delete(u)}).catch(()=>{}),r(c,{fileKey:u,onContent:T=>{f.then(v=>{v&&T(v)}).catch(()=>{})},onSync:T=>{}})},p=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:u=>u()})},m=new Set(Pt.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",p.bind(null))}}}h();h();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
1
+ import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-YKL3BLWC.js";import{a as M,l as gt,m as yt}from"./chunk-5SEEDOQ5.js";import{s as ie,t as W}from"./chunk-GNBRCK7L.js";import{a as O,b as N,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as $,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-F3NYCSXT.js";import{Aa as H,c as Ke,ya as L}from"./chunk-3JXPOOFV.js";import{A as I,B as te,C as tt,T as st,y as et}from"./chunk-YFINLODF.js";import{h as se}from"./chunk-BWJIZYAG.js";import{Ab as F,Bb as D,O as Xe,Ta as P,Wa as C,Z as $e,bb as ke,ma as k,qb as j,sb as ne,ua as be,wa as Ze,xb as re,ya as Qe}from"./chunk-VFM2KQRM.js";import{d as E,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ge,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=_e(s),[a=[],p=[]]=_e(n),[m=[],c=[]]=_e(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),p.length>0&&(l=l.concat(e.filter(B(p,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,f=>f.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=E(e,rs);return await P(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function _e(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),I({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}h();import Ft from"fs/promises";var le=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),u=de(c,l),f=typeof l=="string"?l:"",T=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:u,value:f,attachment:T})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let u=V(e,l),f=o(u).then(()=>{let T=t.get(u);return s.add(T.key),T.value??T.attachment??""});st(5).then(()=>{s.delete(u)}).catch(()=>{}),r(c,{fileKey:u,onContent:T=>{f.then(v=>{v&&T(v)}).catch(()=>{})},onSync:T=>{}})},p=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:u=>u()})},m=new Set(Pt.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",p.bind(null))}}}h();h();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
4
  <title>${e.title}</title>
@@ -1,4 +1,4 @@
1
- import{h as E}from"./chunk-R2R6JDNH.js";import{Ab as O,Ta as V,ma as N,qb as $,sb as T}from"./chunk-Y34LWI3S.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
1
+ import{h as E}from"./chunk-BWJIZYAG.js";import{Ab as O,Ta as V,ma as N,qb as $,sb as T}from"./chunk-VFM2KQRM.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
2
  `);let s;for(;(s=C.exec(r))!=null;){let a=s[1],t=s[2]||"";t=t.trim();let o=t[0];t=t.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(t=t.replace(/\\n/g,`
3
3
  `),t=t.replace(/\\r/g,"\r")),n[a]=t}return n}function U(e){e=e||{};let n=x(e);e.path=n;let r=l.configDotenv(e);if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw o.code="MISSING_DATA",o}let s=A(e).split(","),a=s.length,t;for(let o=0;o<a;o++)try{let i=s[o].trim(),f=M(r,i);t=l.decrypt(f.ciphertext,f.key);break}catch(i){if(o+1>=a)throw i}return l.parse(t)}function B(e){console.log(`[dotenv@${D}][WARN] ${e}`)}function v(e){console.log(`[dotenv@${D}][DEBUG] ${e}`)}function j(e){console.log(`[dotenv@${D}] ${e}`)}function A(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function M(e,n){let r;try{r=new URL(n)}catch(i){if(i.code==="ERR_INVALID_URL"){let f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw i}let s=r.password;if(!s){let i=new Error("INVALID_DOTENV_KEY: Missing key part");throw i.code="INVALID_DOTENV_KEY",i}let a=r.searchParams.get("environment");if(!a){let i=new Error("INVALID_DOTENV_KEY: Missing environment part");throw i.code="INVALID_DOTENV_KEY",i}let t=`DOTENV_VAULT_${a.toUpperCase()}`,o=e.parsed[t];if(!o){let i=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${t} in your .env.vault file.`);throw i.code="NOT_FOUND_DOTENV_ENVIRONMENT",i}return{ciphertext:o,key:s}}function x(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)b.existsSync(r)&&(n=r.endsWith(".vault")?r:`${r}.vault`);else n=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else n=y.resolve(process.cwd(),".env.vault");return b.existsSync(n)?n:null}function k(e){return e[0]==="~"?y.join(q.homedir(),e.slice(1)):e}function W(e){let n=!!(e&&e.debug),r=e&&"quiet"in e?e.quiet:!0;(n||!r)&&j("Loading env from encrypted .env.vault");let s=l._parseVault(e),a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),l.populate(a,s,e),{parsed:s}}function G(e){let n=y.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug),a=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?r=e.encoding:s&&v("No encoding is specified. UTF-8 is used by default");let t=[n];if(e&&e.path)if(!Array.isArray(e.path))t=[k(e.path)];else{t=[];for(let u of e.path)t.push(k(u))}let o,i={};for(let u of t)try{let c=l.parse(b.readFileSync(u,{encoding:r}));l.populate(i,c,e)}catch(c){s&&v(`Failed to load ${u} ${c.message}`),o=c}let f=process.env;if(e&&e.processEnv!=null&&(f=e.processEnv),l.populate(f,i,e),s||!a){let u=Object.keys(i).length,c=[];for(let p of t)try{let h=y.relative(process.cwd(),p);c.push(h)}catch(h){s&&v(`Failed to load ${p} ${h.message}`),o=h}j(`injecting env (${u}) from ${c.join(",")}`)}return o?{parsed:i,error:o}:{parsed:i}}function J(e){if(A(e).length===0)return l.configDotenv(e);let n=x(e);return n?l._configVault(e):(B(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),l.configDotenv(e))}function Q(e,n){let r=Buffer.from(n.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.subarray(0,12),t=s.subarray(-16);s=s.subarray(12,-16);try{let o=F.createDecipheriv("aes-256-gcm",r,a);return o.setAuthTag(t),`${o.update(s)}${o.final()}`}catch(o){let i=o instanceof RangeError,f=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||f){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw o}}function H(e,n,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof n!="object"){let t=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let t of Object.keys(n))Object.prototype.hasOwnProperty.call(e,t)?(a===!0&&(e[t]=n[t]),s&&v(a===!0?`"${t}" is already defined and WAS overwritten`:`"${t}" is already defined and was NOT overwritten`)):e[t]=n[t]}var l={configDotenv:G,_configVault:W,_parseVault:U,config:J,decrypt:Q,parse:S,populate:H};d.exports.configDotenv=l.configDotenv;d.exports._configVault=l._configVault;d.exports._parseVault=l._parseVault;d.exports.config=l.config;d.exports.decrypt=l.decrypt;d.exports.parse=l.parse;d.exports.populate=l.populate;d.exports=l});m();var L=Y(K());async function oe(e){if(O(T`Reading the .env file at ${$.path(e)}`),!await V(e))throw new E(`The environment file at ${e} does not exist.`);let n=await N(e);return{path:e,variables:(0,L.parse)(n)}}function se(e,n){let r=[],s=e===null?[]:e.split(`
4
4
  `),a=[],t;for(let o of s){if(t){if(o.endsWith(t.quote)){let u=_(t.key,t.value+o.slice(0,-1),t.quote),c=n[t.key];c&&(a.push(t.key),u=_(t.key,c)),r.push(u),t=void 0}else t.value+=`${o}
@@ -1 +1 @@
1
- import{a as h,b as w}from"./chunk-QKGZWOOY.js";import{q as f}from"./chunk-YN6A26QL.js";import{T as d}from"./chunk-GMTNOCMS.js";import{h as i}from"./chunk-R2R6JDNH.js";import{Ga as m,na as p}from"./chunk-Y34LWI3S.js";import{d as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
1
+ import{a as h,b as w}from"./chunk-C4YLE3NS.js";import{r as f}from"./chunk-3JXPOOFV.js";import{T as d}from"./chunk-YFINLODF.js";import{h as i}from"./chunk-BWJIZYAG.js";import{Ga as m,na as p}from"./chunk-VFM2KQRM.js";import{d as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
@@ -0,0 +1 @@
1
+ import{a as P}from"./chunk-CTNBSUVU.js";import{Db as f,eb as g,pb as E}from"./chunk-VFM2KQRM.js";import{e as m}from"./chunk-773TIA5M.js";import{e as A,g as p}from"./chunk-VKWPEFWQ.js";p();p();var w=new Set(["THROTTLED","429"]),I=new Set(["ACCESS_DENIED","access_denied"]);function b(e){return Array.isArray(e)?e.flatMap(t=>{let s=[],n=t,r=n?.extensions?.code;typeof r=="string"&&s.push(r);let c=n?.extensions?.app_errors?.errors;if(Array.isArray(c))for(let u of c){let d=u?.category;typeof d=="string"&&s.push(d)}return s}):[]}function C(e){return e!==void 0&&w.has(e)}function v(e){return e!==void 0&&I.has(e)}function h(e){return b(e).some(C)}var M=A(P(),1),o;(function(e){e[e.Abort=0]="Abort",e[e.AbortSilent=1]="AbortSilent",e[e.Bug=2]="Bug"})(o||(o={}));var x=class extends Error{},i=class extends Error{tryMessage;type;nextSteps;formattedMessage;customSections;skipOclifErrorHandling;constructor(t,s,n=null,r,c){let u=typeof t=="string"||"value"in t;super(u?f(t):g(t)),n?n instanceof E?this.tryMessage=f(n):this.tryMessage=n:this.tryMessage=null,this.type=s,this.nextSteps=r,this.customSections=c,this.skipOclifErrorHandling=!0,u||(this.formattedMessage=t)}},l=class extends i{constructor(t,s=null,n,r){super(t,o.Abort,s,n,r)}},y=class extends i{command;args;constructor(t,s,n,r=null){super(t,o.Abort,r),this.command=s,this.args=n}},S=class extends i{constructor(){super("",o.AbortSilent)}},a=class extends i{constructor(t,s=null){super(t,o.Bug,s)}};async function B(e){let t;if(k(e))t=e;else if(typeof e=="string")t=new a(e);else if(e instanceof Error)t=new a(e.message),t.stack=e.stack;else{let n=e;t=new a(n?.message??"Unknown error"),n?.stack&&(t.stack=n?.stack)}let{renderFatalError:s}=await import("./ui-H5I5YVKV.js");return s(t),Promise.resolve(e)}function H(e){if(e instanceof M.Errors.CLIError){let t=new l(e.message);return t.stack=e.stack,Promise.resolve(t)}else return Promise.resolve(e)}function k(e){try{return Object.prototype.hasOwnProperty.call(e,"type")}catch{return!1}}function j(e){if(!k(e)){if(e instanceof Error){if(O(e))return!1;let t=e.message;return!R(t)}return!0}return e.type===o.Bug}function O(e){let t=e;if(typeof t.response!="object"||t.response===null||t.request===void 0)return!1;let s=t.response.status;return s===401||s===429||s===502||s===503||s===504?!0:h(t.response.errors)}function q(e){return m(e).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function R(e){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>e.includes(n))}export{b as a,C as b,v as c,h as d,o as e,x as f,i as g,l as h,y as i,S as j,a as k,B as l,H as m,j as n,q as o};
@@ -1,2 +1,2 @@
1
- import{b as x,c as D,f as M}from"./chunk-QRT4A2RV.js";import{c as w}from"./chunk-YN6A26QL.js";import{D as s,G as h,J as e,z as y}from"./chunk-GMTNOCMS.js";import{a as o}from"./chunk-5CYJG63I.js";import{ua as u,xb as _}from"./chunk-Y34LWI3S.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();async function $(){let a=new Date,n=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${a.getDate().toString().padStart(2,"0")}`,i=w(),t=await s({message:"Type of message?",choices:[{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}]}),b=await e({message:"Title"}),E=await e({message:"Message"}),S=await s({message:"Frequency",choices:[{label:"Only once",value:"once"},{label:"Once a week",value:"once_a_week"},{label:"Once a day",value:"once_a_day"},{label:"Always",value:"always"}]}),r=await e({message:"Minimum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),l=await e({message:"Maximum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),m=await e({message:"Minimum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),c=await e({message:"Maximum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),f=await e({message:"Surface. E.g.: app, theme, hydrogen, theme_app_extension... (optional)",allowEmpty:!0}),g=await e({message:"Comma separated list of commands. E.g.: app:generate:extension (optional)",allowEmpty:!0}),T=await e({message:"Slack channel of the team who will own this notification"}),d=await x(),v={id:i,type:t,title:b,frequency:S,message:E,minVersion:r.length===0?void 0:r,maxVersion:l.length===0?void 0:l,minDate:m.length===0?void 0:m,maxDate:c.length===0?void 0:c,surface:f.length===0?void 0:f,commands:g.length===0?void 0:g.split(",").map(N=>N.trim()),ownerChannel:T};d.notifications.push(v),await u("./notifications.json",JSON.stringify(d)),y({headline:"notifications.json file updated successfully."})}async function j(){let a=await D(),n={type:{header:"Type",color:"dim"},title:{header:"Title",color:"dim"},message:{header:"Message",color:"dim"},filters:{header:"Filters",color:"dim"}},i=a.notifications.map(t=>({type:t.type,title:t.title??"",message:t.message,filters:M(t)}));h({rows:i,columns:n}),_(`
1
+ import{b as x,c as D,f as M}from"./chunk-U53OLUOE.js";import{d as w}from"./chunk-3JXPOOFV.js";import{D as s,G as h,J as e,z as y}from"./chunk-YFINLODF.js";import{a as o}from"./chunk-VASGXHYA.js";import{ua as u,xb as _}from"./chunk-VFM2KQRM.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();async function $(){let a=new Date,n=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${a.getDate().toString().padStart(2,"0")}`,i=w(),t=await s({message:"Type of message?",choices:[{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}]}),b=await e({message:"Title"}),E=await e({message:"Message"}),S=await s({message:"Frequency",choices:[{label:"Only once",value:"once"},{label:"Once a week",value:"once_a_week"},{label:"Once a day",value:"once_a_day"},{label:"Always",value:"always"}]}),r=await e({message:"Minimum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),l=await e({message:"Maximum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),m=await e({message:"Minimum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),c=await e({message:"Maximum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),f=await e({message:"Surface. E.g.: app, theme, hydrogen, theme_app_extension... (optional)",allowEmpty:!0}),g=await e({message:"Comma separated list of commands. E.g.: app:generate:extension (optional)",allowEmpty:!0}),T=await e({message:"Slack channel of the team who will own this notification"}),d=await x(),v={id:i,type:t,title:b,frequency:S,message:E,minVersion:r.length===0?void 0:r,maxVersion:l.length===0?void 0:l,minDate:m.length===0?void 0:m,maxDate:c.length===0?void 0:c,surface:f.length===0?void 0:f,commands:g.length===0?void 0:g.split(",").map(N=>N.trim()),ownerChannel:T};d.notifications.push(v),await u("./notifications.json",JSON.stringify(d)),y({headline:"notifications.json file updated successfully."})}async function j(){let a=await D(),n={type:{header:"Type",color:"dim"},title:{header:"Title",color:"dim"},message:{header:"Message",color:"dim"},filters:{header:"Filters",color:"dim"}},i=a.notifications.map(t=>({type:t.type,title:t.title??"",message:t.message,filters:M(t)}));h({rows:i,columns:n}),_(`
2
2
  `)}export{$ as a,j as b};
@@ -0,0 +1,6 @@
1
+ import{a as f,b as R,c as _,d as N,e as O,f as F,g as j,h as x,i as E,j as L}from"./chunk-XHKWITLA.js";import{a as $}from"./chunk-YESGYUEL.js";import{b as C,c as I}from"./chunk-YEVGLC5X.js";import{b as A}from"./chunk-2XDUJQQN.js";import{A as v,B as P,D as b,V as D,z as w}from"./chunk-YFINLODF.js";import{h as k}from"./chunk-BWJIZYAG.js";import{a as z}from"./chunk-CTNBSUVU.js";import{wb as S}from"./chunk-VFM2KQRM.js";import{d as a,f as c,g as y}from"./chunk-773TIA5M.js";import{e as q,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();import{randomBytes as U}from"node:crypto";import{lstat as p,mkdir as Q,realpath as T,rename as X,unlink as Z,writeFile as tt}from"node:fs/promises";function et(t){let e=a(t,".shopify","app-doctor");return{artifactDirectory:e,reviewPath:a(e,"review.json"),tracePath:a(e,"trace.json")}}async function B(t){let e=et(t.appRoot);return await nt(t.appRoot,e.artifactDirectory),await W(e.tracePath,`${JSON.stringify(t.trace,null,2)}
2
+ `),t.operation!=="scan"?{artifactDirectory:e.artifactDirectory,tracePath:e.tracePath}:(await W(e.reviewPath,`${JSON.stringify(t.reviewPack,null,2)}
3
+ `),e)}async function nt(t,e){let n=c(t),o=c(e);J(n,o);let r=await p(n);(r.isSymbolicLink()||!r.isDirectory())&&d(o);let s=n;for(let K of[".shopify","app-doctor"])s=a(s,K),await ot(s);let u=await T(n),V=await T(o);J(u,V)}async function ot(t){try{let n=await p(t);(n.isSymbolicLink()||!n.isDirectory())&&d(t);return}catch(n){if(n.code!=="ENOENT")throw n}await Q(t,{mode:448});let e=await p(t);(e.isSymbolicLink()||!e.isDirectory())&&d(t)}function J(t,e){let n=y(t,e);(!n||n.startsWith("..")||n.startsWith("/"))&&d(e)}function d(t){throw new k(`Refusing to write App Doctor artifacts through a symbolic link or outside the app: ${t}`,"Remove or replace the unsafe App Doctor artifact path, then run the command again.")}async function W(t,e){await h(t);let n=`${t}.${U(8).toString("hex")}.tmp`;await h(n);try{await tt(n,e,{encoding:"utf8",mode:384}),await h(t),await X(n,t)}catch(o){throw await Z(n).catch(()=>{}),o}}async function h(t){try{(await p(t)).isSymbolicLink()&&d(t)}catch(e){if(e.code==="ENOENT")return;throw e}}i();function H(t){return t.operation==="scan"?{operation:"scan",engine:t.engine,scan:t.scan,trace:t.trace,reviewPack:t.reviewPack}:{operation:"compile",engine:t.engine,scan:t.scan,trace:t.trace,findings:t.findings}}function Y(t){return`${JSON.stringify(t,null,2)}
4
+ `}i();var rt={high:"High",medium:"Medium",low:"Low"};function it(t){return{type:st(t),options:{headline:at(t),body:ct(t),...t.findings?{}:{nextSteps:ft(t.commands)},reference:[{subdued:`Engine: ${t.engine.name} ${t.engine.version}`},{subdued:`Ruleset: ${t.engine.ruleset}`}],customSections:dt(t)}}}function G(t){let{type:e,options:n}=it(t);if(e==="success"){w(n);return}if(e==="warning"){v(n);return}P(n)}function M(t){return t.scan.score===null||!t.scan.scan.coverage_complete||t.scan.scan.coverage_gaps.length>0}function st(t){return t.findings&&t.findings.rejected.length>0||t.scan.issues.some(e=>e.severity==="high")?"error":t.scan.issues.length>0||M(t)?"warning":"success"}function at(t){if(t.findings&&t.findings.rejected.length>0)return"App Doctor could not compile some agent findings.";let e=t.scan.issues.length;return e>0?`${e} security ${e===1?"issue":"issues"} found.`:M(t)?"Scan completed with coverage gaps.":"No security issues found."}function ct(t){let e=t.scan,n=[{userInput:f(e.app.name)},{char:"."},`${e.scan.files_scanned} files scanned in ${ht(t.elapsedMilliseconds)}.`],o=e.scan.checks_executed.filter(r=>r.status==="not_applicable").length;return o>0&&n.push({info:`
5
+ ${o} check${o===1?"":"s"} not applicable.`}),t.reviewCheckCount!==void 0&&n.push({info:`
6
+ ${t.reviewCheckCount} check${t.reviewCheckCount===1?"":"s"} ready for your coding agent.`}),n}function ft(t){return[["Investigate the review pack, then compile the trace with",{command:E(t.compile)}]]}function dt(t){let e=[];for(let n of ut(t.scan.issues))e.push({title:rt[n.severity],body:{list:{items:n.issues.map(o=>lt(o,t.verbose))}}});if(t.scan.scan.coverage_gaps.length>0){let n=t.scan.scan.coverage_gaps,o=n.slice(0,8).map(r=>f(r.message));n.length>8&&o.push({info:`${n.length-8} more coverage gaps`}),e.push({title:"Coverage gaps",body:{list:{items:o}}})}if(t.findings){let n=[t.findings.accepted===0&&t.findings.rejected.length>0?"No agent findings were merged.":`Merged ${t.findings.accepted} agent finding(s) into the trace.`,...t.findings.rejected.map(o=>({error:`Rejected: ${f(o)}`})),...(t.findings.warnings??[]).map(o=>({warn:f(o)})),["Trace written to",{filePath:t.tracePath}]];e.push({title:"Agent findings",body:{list:{items:n}}})}else t.reviewPath&&e.push({title:"Artifacts",body:{list:{items:[["Review pack:",{filePath:t.reviewPath}],["Trace:",{filePath:t.tracePath}]]}}});return t.verbose&&e.push({title:"Scan details",body:{tabularData:[["Framework",t.scan.detection.framework],["Surface",t.scan.detection.surface],["Languages",t.scan.detection.languages.map(n=>`${n.name} (${n.support})`).join(", ")||"none"],["Capabilities",pt(t.scan.capabilities)],["Rules run",String(t.scan.scan.rules_run)],["Not run",String(t.scan.scan.rules_skipped)],["Input hash",t.scan.scan.input_hash],["Result hash",t.scan.scan.result_hash]],firstColumnSubdued:!0}}),e}function lt(t,e){let n=R(t),o=n.location.line?`${n.location.file}:${n.location.line}`:n.location.file,r=[{bold:n.title},{subdued:n.id},{filePath:o}];return e&&(r.push({subdued:n.message},{subdued:`Fix: ${n.fix.description}`}),n.fix.guide&&(n.fix.guide.startsWith("https://")||n.fix.guide.startsWith("http://")?r.push({link:{label:"Docs",url:n.fix.guide}}):r.push({subdued:`Docs: ${n.fix.guide}`})),n.snippet&&r.push({subdued:`Code: ${n.snippet}`})),r}function ut(t){let e=[];for(let n of _(t)){let o=e[e.length-1];o?.severity===n.severity?o.issues.push(n):e.push({severity:n.severity,issues:[n]})}return e}function pt(t){let e=Object.entries(t).filter(([,n])=>n).map(([n])=>n);return e.length>0?e.join(", "):"none detected"}function ht(t){return t<1e3?`${Math.round(t)}ms`:`${(t/1e3).toFixed(1)}s`}var mt={message:"How would you like to hand the results to your coding agent?",choices:[{label:"Copy instructions to the clipboard",value:"copy"},{label:"Print instructions to the terminal",value:"print"},{label:"Nothing",value:"nothing"}],defaultValue:"copy"},gt={execute:async({directory:t,findingsPath:e})=>{let n=F(t),o=e?await O(e):void 0;return j({appRoot:n,findings:o})},writeArtifacts:B,canPrompt:D,selectInstructionsDestination:()=>b(mt),deliverInstructions:L,output:S,renderReport:G,setExitCode:t=>{process.exitCode=t}};async function yt(t,e){return t.json||t.skipInstructions||t.findingsPath?"nothing":t.yes?"print":e.canPrompt()?e.selectInstructionsDestination():"nothing"}function wt(t,e,n,o){return{scan:t.scan,engine:t.engine,verbose:n,elapsedMilliseconds:t.elapsedMilliseconds,commands:o,tracePath:e.tracePath,reviewPath:e.reviewPath,reviewCheckCount:t.operation==="scan"?t.reviewPack.checks.length:void 0,findings:t.operation==="compile"?t.findings:void 0}}async function m(t,e=gt){let n=await e.execute({directory:t.directory,findingsPath:t.findingsPath}),o=await e.writeArtifacts(n),r=x(n.appRoot);t.json?e.output(Y(H(n))):e.renderReport(wt(n,o,t.verbose,r));let s=await yt(t,e);s!=="nothing"&&await e.deliverInstructions({directory:t.directory,copy:s==="copy",scanComplete:!0,commands:r});let u=N(n,t.blocking);u!==0&&e.setExitCode(u)}var l=q(z(),1);var vt=["high","medium","low","none"],g=class t extends A{static hidden=!0;static summary="Check an app for Shopify-specific security issues.";static descriptionWithMarkdown="Runs Shopify App Doctor locally and creates its review pack and trace.\n\nPass `--findings` after completing the review pack to validate agent findings and compile them into the trace. In interactive terminals, the command offers to copy the coding-agent instructions, print them, or choose nothing; copying is the default. In CI and other non-interactive environments, instructions aren't offered unless you pass `--yes`, which prints them. JSON output never prompts or prints those instructions. You can also run `shopify app doctor instructions` to print, copy, or write them later.\n\nCVE detection runs `npm audit` (or the pnpm/yarn equivalent) in an isolated sandbox and sends package names and versions to the public npm registry at https://registry.npmjs.org/.";static description=this.descriptionWithoutMarkdown();static flags={...C,path:$.path,...I,findings:l.Flags.string({description:"Validate agent findings from a JSON file and compile them into the trace.",parse:async e=>c(e),env:"SHOPIFY_FLAG_APP_DOCTOR_FINDINGS"}),blocking:l.Flags.string({description:"The minimum finding severity that causes a non-zero exit code.",options:vt,default:"none",env:"SHOPIFY_FLAG_APP_DOCTOR_BLOCKING"}),yes:l.Flags.boolean({description:"Print coding-agent instructions without prompting.",default:!1,exclusive:["skip-instructions"],env:"SHOPIFY_FLAG_YES"}),"skip-instructions":l.Flags.boolean({description:"Don't offer to show coding-agent instructions.",default:!1,exclusive:["yes"],env:"SHOPIFY_FLAG_APP_DOCTOR_SKIP_INSTRUCTIONS"})};async run(){let{flags:e}=await this.parse(t);await m({directory:e.path,json:e.json,verbose:!!e.verbose,blocking:e.blocking,yes:e.yes,skipInstructions:e["skip-instructions"],findingsPath:e.findings})}};export{g as a};