@shopify/cli 4.9.4 → 5.0.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 (501) hide show
  1. package/dist/analytics-Q6QDIDYT.js +1 -0
  2. package/dist/analytics-VKKJNJ62.js +1 -0
  3. package/dist/assets/hydrogen/starter/CHANGELOG.md +7 -0
  4. package/dist/assets/hydrogen/starter/package.json +2 -2
  5. package/dist/assets/hydrogen/vite/package.json +3 -4
  6. package/dist/assets/hydrogen/vite/vite.config.js +3 -3
  7. package/dist/bootstrap.js +1 -1
  8. package/dist/{chunk-LKXFHYLI.js → chunk-24NUJTIH.js} +1 -1
  9. package/dist/chunk-2CMEKSI7.js +1 -0
  10. package/dist/chunk-2DID73ML.js +1 -0
  11. package/dist/chunk-2ORRV7GH.js +1 -0
  12. package/dist/chunk-2VSNFOKD.js +1 -0
  13. package/dist/chunk-335BUVBP.js +1 -0
  14. package/dist/{chunk-UEBUGSBT.js → chunk-3A3DZVEJ.js} +1 -1
  15. package/dist/chunk-3C6VLJ5D.js +319 -0
  16. package/dist/{chunk-PB5ZZET5.js → chunk-3G4HJO72.js} +30 -30
  17. package/dist/chunk-3LVCG4JB.js +1 -0
  18. package/dist/chunk-43KLFFP7.js +1 -0
  19. package/dist/chunk-43R5VGKT.js +1 -0
  20. package/dist/chunk-46MSIQ6Z.js +1 -0
  21. package/dist/chunk-4ARCB6DT.js +1 -0
  22. package/dist/chunk-4C2DAX5T.js +1 -0
  23. package/dist/chunk-4CRBTSVP.js +2 -0
  24. package/dist/chunk-4GCI2YCZ.js +8 -0
  25. package/dist/chunk-4GOJQKY5.js +1 -0
  26. package/dist/chunk-4RDFMBRG.js +9 -0
  27. package/dist/chunk-4SS6DXC7.js +5 -0
  28. package/dist/{chunk-J4J2YXH3.js → chunk-4TI7U2PN.js} +1 -1
  29. package/dist/{chunk-67EBF76X.js → chunk-52FDK2LC.js} +1 -1
  30. package/dist/chunk-53BG3NLH.js +3 -0
  31. package/dist/{chunk-LD6ZCTZ3.js → chunk-5B76DT7X.js} +1 -1
  32. package/dist/{chunk-A2VCTDKH.js → chunk-5NEGOQT6.js} +1 -1
  33. package/dist/{chunk-MW3JKGJH.js → chunk-5OMJFPQW.js} +1 -1
  34. package/dist/chunk-5TB52UUV.js +2 -0
  35. package/dist/chunk-5UWMXOHM.js +7 -0
  36. package/dist/chunk-6BNKBCCU.js +1 -0
  37. package/dist/chunk-6DXP7PQ7.js +1 -0
  38. package/dist/chunk-6PUU6ZNQ.js +1 -0
  39. package/dist/chunk-7GHSE7SG.js +1 -0
  40. package/dist/{chunk-7556AIVG.js → chunk-7IFE4UQY.js} +1 -1
  41. package/dist/chunk-7LAKWAKX.js +25 -0
  42. package/dist/chunk-7MVWDCI3.js +1 -0
  43. package/dist/chunk-7NSK77WG.js +3 -0
  44. package/dist/chunk-7QUZWCJZ.js +3 -0
  45. package/dist/chunk-7RPFJZLP.js +1 -0
  46. package/dist/{chunk-LJIJEGND.js → chunk-7UOA4DI7.js} +2 -2
  47. package/dist/chunk-7WPUV7GY.js +6 -0
  48. package/dist/chunk-7Y7AZRL3.js +10 -0
  49. package/dist/{chunk-NGSEF3UX.js → chunk-ACA2BGAD.js} +1 -1
  50. package/dist/chunk-AJMDF3QC.js +1 -0
  51. package/dist/{chunk-R7YJNDXW.js → chunk-AXC2MHHO.js} +1 -1
  52. package/dist/{chunk-DEF2G7S4.js → chunk-AYL6KBPE.js} +1 -1
  53. package/dist/chunk-BAHIL37I.js +1 -0
  54. package/dist/{chunk-RSC5NQAT.js → chunk-BCYTZ7LM.js} +1 -1
  55. package/dist/{chunk-AVMNIZAJ.js → chunk-BJPDJIS4.js} +1 -1
  56. package/dist/{chunk-7VAKNVFD.js → chunk-BN7ZXAZJ.js} +1 -1
  57. package/dist/chunk-BVSKBX7T.js +16 -0
  58. package/dist/chunk-BWRNXCVN.js +4 -0
  59. package/dist/{chunk-XNPUZRWP.js → chunk-C3KEDG33.js} +1 -1
  60. package/dist/{chunk-WEXOA4C4.js → chunk-C7V755IT.js} +1 -1
  61. package/dist/chunk-CCMDZX35.js +7 -0
  62. package/dist/chunk-CCQNP5YR.js +1 -0
  63. package/dist/chunk-CEIJKJOF.js +11 -0
  64. package/dist/chunk-CIK5BF7V.js +1 -0
  65. package/dist/{chunk-6YDLNP4G.js → chunk-CVVQQLCF.js} +1 -1
  66. package/dist/chunk-CW2T7EOQ.js +1 -0
  67. package/dist/chunk-CZ22VZDA.js +376 -0
  68. package/dist/{chunk-3G2ZQ2EF.js → chunk-D7NB7YR6.js} +1 -1
  69. package/dist/{chunk-DYPZX7MW.js → chunk-DFQ4WTET.js} +2 -2
  70. package/dist/chunk-DJAZBPYA.js +3 -0
  71. package/dist/chunk-DNMXVMJM.js +47 -0
  72. package/dist/{chunk-CLD3NZYD.js → chunk-EGCWR5AS.js} +1 -1
  73. package/dist/{chunk-BOE2ST6J.js → chunk-EITIW5OX.js} +1 -1
  74. package/dist/chunk-EMSF57ZB.js +1 -0
  75. package/dist/{chunk-ZEBMW5KS.js → chunk-EXFBZPZS.js} +1 -1
  76. package/dist/chunk-FDXHQZTO.js +26 -0
  77. package/dist/{chunk-Q2XLIWG4.js → chunk-FFHH5LOR.js} +1 -1
  78. package/dist/{chunk-MMQZO2W2.js → chunk-FNLECT7B.js} +1 -1
  79. package/dist/{chunk-PO5T44H3.js → chunk-FWB3GLMW.js} +1 -1
  80. package/dist/chunk-FZCGRIOM.js +1 -0
  81. package/dist/{chunk-G7JW4UIM.js → chunk-G6ZMSWEU.js} +1 -1
  82. package/dist/chunk-GAMC2BNY.js +7 -0
  83. package/dist/chunk-GB6E3ATN.js +4 -0
  84. package/dist/chunk-GCNA3HXH.js +8 -0
  85. package/dist/{chunk-IGDVKRB4.js → chunk-GFVKTWFT.js} +1 -1
  86. package/dist/chunk-GQNOVEKP.js +2 -0
  87. package/dist/{chunk-5BTLE67Z.js → chunk-GRGFA26K.js} +1 -1
  88. package/dist/chunk-GXORLBVN.js +2 -0
  89. package/dist/{chunk-3V4VL3SD.js → chunk-H4V55Y3Z.js} +118 -118
  90. package/dist/chunk-HCZG7YJ6.js +16 -0
  91. package/dist/chunk-HF4NDEX3.js +1 -0
  92. package/dist/chunk-HIRTL45Q.js +1 -0
  93. package/dist/chunk-I4OVLRQR.js +1 -0
  94. package/dist/{chunk-ENQXB532.js → chunk-I6FRVYGE.js} +1 -1
  95. package/dist/chunk-IEQ4UOH3.js +4 -0
  96. package/dist/{chunk-PIZDYS7T.js → chunk-IILLQOUC.js} +60 -60
  97. package/dist/{chunk-45SZ5PSE.js → chunk-IQVRP7CT.js} +1 -1
  98. package/dist/chunk-IUP7POIE.js +6 -0
  99. package/dist/chunk-IUTZIN2T.js +10 -0
  100. package/dist/chunk-IWEKM5Y3.js +1 -0
  101. package/dist/chunk-IWTNUJGY.js +2 -0
  102. package/dist/chunk-J6TW43TG.js +1 -0
  103. package/dist/chunk-JDR6UVZA.js +8 -0
  104. package/dist/{chunk-CVFPY2SH.js → chunk-JEA3C7ON.js} +1 -1
  105. package/dist/chunk-JOJV5E2K.js +1 -0
  106. package/dist/chunk-JYMDWR25.js +1 -0
  107. package/dist/{chunk-TPHHQAUD.js → chunk-KDPQXURV.js} +1 -1
  108. package/dist/{chunk-MW3IMZJ5.js → chunk-KGRIYAMA.js} +1 -1
  109. package/dist/chunk-KJQDS5HI.js +1 -0
  110. package/dist/chunk-KKPOOIE4.js +2 -0
  111. package/dist/{chunk-VS7QVU3Z.js → chunk-KSDU4YOB.js} +1 -1
  112. package/dist/chunk-L7MSPGDS.js +5 -0
  113. package/dist/{chunk-43URS56H.js → chunk-LDU5T3DN.js} +1 -1
  114. package/dist/chunk-LHKVXJPX.js +1 -0
  115. package/dist/{chunk-EO4YJFMY.js → chunk-LMQGNECW.js} +86 -200
  116. package/dist/{chunk-TQ7URMGS.js → chunk-LQ7ENG4V.js} +1 -1
  117. package/dist/chunk-LVLAOBJM.js +103 -0
  118. package/dist/chunk-LWCTKI4Z.js +18 -0
  119. package/dist/chunk-M3ACZWMR.js +1 -0
  120. package/dist/chunk-M4BVLMPH.js +31 -0
  121. package/dist/{chunk-NCRWOW6F.js → chunk-M5TGCSUK.js} +1 -1
  122. package/dist/chunk-M7LPHCP2.js +274 -0
  123. package/dist/{chunk-IDKRJ2F4.js → chunk-MDRVCBDO.js} +1 -1
  124. package/dist/chunk-MR2AUT7Q.js +1 -0
  125. package/dist/chunk-MXJAH2GW.js +5 -0
  126. package/dist/{chunk-UU6BRRYS.js → chunk-MYAIWSOO.js} +1 -1
  127. package/dist/{chunk-NT4A37HG.js → chunk-N2RFDHRY.js} +1 -1
  128. package/dist/{chunk-GSE6FXZU.js → chunk-NB4BRW3H.js} +1 -1
  129. package/dist/chunk-NDKSG4CC.js +97 -0
  130. package/dist/chunk-NK2MGR6A.js +1 -0
  131. package/dist/chunk-NOH63WC6.js +12 -0
  132. package/dist/{chunk-BVB3DTNE.js → chunk-OGWPS55W.js} +1 -1
  133. package/dist/chunk-OQ5CLM2H.js +4 -0
  134. package/dist/{chunk-PVAZCZSY.js → chunk-OQU3HLAE.js} +1 -1
  135. package/dist/chunk-OVWUGAEU.js +11 -0
  136. package/dist/chunk-OX7UVDSU.js +6 -0
  137. package/dist/chunk-P33TONYG.js +1 -0
  138. package/dist/chunk-PEVIRAMR.js +6 -0
  139. package/dist/{chunk-YPCXVZ2N.js → chunk-PGLWZMJU.js} +4 -4
  140. package/dist/chunk-PIAD3F6M.js +16 -0
  141. package/dist/chunk-PMHP57MH.js +20 -0
  142. package/dist/{chunk-F3PZGSOY.js → chunk-POKY4RWR.js} +1 -1
  143. package/dist/chunk-PSSYLJG4.js +2 -0
  144. package/dist/chunk-PYIICTLX.js +1 -0
  145. package/dist/chunk-PZUGDE7N.js +2 -0
  146. package/dist/{chunk-NU5WLZ6Y.js → chunk-Q2SZCZE7.js} +1 -1
  147. package/dist/{chunk-MUM34KUM.js → chunk-Q2XRITUG.js} +1 -1
  148. package/dist/chunk-Q5MEFIMV.js +4 -0
  149. package/dist/chunk-Q66CI37F.js +7 -0
  150. package/dist/chunk-QFWWCZOI.js +1 -0
  151. package/dist/{chunk-TR4OWSEX.js → chunk-QFYLJVJW.js} +1 -1
  152. package/dist/chunk-QKVVJXWS.js +3 -0
  153. package/dist/chunk-QN3774QI.js +1 -0
  154. package/dist/chunk-R2BDABJD.js +213 -0
  155. package/dist/{chunk-7HWMURCW.js → chunk-R7EMV77H.js} +1 -1
  156. package/dist/chunk-RFGEM5JC.js +3 -0
  157. package/dist/{chunk-7A3RW2VM.js → chunk-RVQV6G5M.js} +1 -1
  158. package/dist/chunk-S67I4E7M.js +5 -0
  159. package/dist/chunk-SFPXYHHL.js +1 -0
  160. package/dist/{chunk-4OCVXE5Y.js → chunk-SFQEHDJY.js} +1 -1
  161. package/dist/chunk-SL3VBI62.js +3 -0
  162. package/dist/{chunk-LOWSU4BB.js → chunk-SNNZ4U2W.js} +1 -1
  163. package/dist/chunk-T2IUXXCT.js +1 -0
  164. package/dist/chunk-TPSA4JN5.js +1 -0
  165. package/dist/chunk-TTEF7GTX.js +1 -0
  166. package/dist/{chunk-FQL2WEKX.js → chunk-U25W35TX.js} +1 -1
  167. package/dist/chunk-UIQL5ZF3.js +1 -0
  168. package/dist/chunk-UK6576EO.js +1 -0
  169. package/dist/chunk-ULD7CIOY.js +4 -0
  170. package/dist/{chunk-D3KFKT4D.js → chunk-UOS2XLGG.js} +1 -1
  171. package/dist/{chunk-EMH7OHCW.js → chunk-UVRKTMF7.js} +1 -1
  172. package/dist/{chunk-ZTICX3AO.js → chunk-UWMZ5CSB.js} +1 -1
  173. package/dist/chunk-UZROQRLX.js +2 -0
  174. package/dist/{chunk-5BGUKF7L.js → chunk-V75WUEFU.js} +1 -1
  175. package/dist/chunk-VB7YQMAM.js +5 -0
  176. package/dist/chunk-VHUD3CBC.js +3 -0
  177. package/dist/chunk-VMMUJN4T.js +17 -0
  178. package/dist/{chunk-S36VGP37.js → chunk-VW6QS7DO.js} +1 -1
  179. package/dist/chunk-VWH3VPYI.js +1 -0
  180. package/dist/{chunk-4TF7ER72.js → chunk-WBJ6ZHYH.js} +1 -1
  181. package/dist/chunk-WDFCOZAY.js +16 -0
  182. package/dist/chunk-WFWISGLS.js +1 -0
  183. package/dist/chunk-WGUOLSMG.js +1 -0
  184. package/dist/{chunk-PFXNBHQQ.js → chunk-WJSUIUBW.js} +2 -2
  185. package/dist/{chunk-TFXUDHCP.js → chunk-WMAFG2JD.js} +1 -1
  186. package/dist/chunk-X2H6I2WW.js +5 -0
  187. package/dist/{chunk-DSS4ECIH.js → chunk-X7HVAVSZ.js} +1 -1
  188. package/dist/{chunk-NYYXH2SX.js → chunk-XBQDMGUN.js} +1 -1
  189. package/dist/chunk-XITZIDCL.js +18 -0
  190. package/dist/chunk-XKRJKUA7.js +1 -0
  191. package/dist/{chunk-FEQHCE2E.js → chunk-XM7YUXTF.js} +2 -2
  192. package/dist/chunk-XMODGI45.js +1 -0
  193. package/dist/{chunk-B3M3KIOU.js → chunk-XNNKLUTN.js} +1 -1
  194. package/dist/chunk-XTREQ4A2.js +1 -0
  195. package/dist/chunk-YGYEM6QO.js +1 -0
  196. package/dist/{chunk-LWU5TKNA.js → chunk-YKS7MH3F.js} +9 -6
  197. package/dist/chunk-YTUDXZLN.js +1 -0
  198. package/dist/{chunk-I3J63RFV.js → chunk-YTUUU33R.js} +1 -1
  199. package/dist/chunk-YVVU4J5O.js +3 -0
  200. package/dist/{chunk-4TZCRMBJ.js → chunk-YVY32DNA.js} +1 -1
  201. package/dist/chunk-Z5SILNH2.js +7 -0
  202. package/dist/chunk-ZAA2DXK5.js +5 -0
  203. package/dist/chunk-ZDQO6CNY.js +1 -0
  204. package/dist/chunk-ZGV3HNEV.js +1 -0
  205. package/dist/chunk-ZQDDRIBA.js +22 -0
  206. package/dist/{chunk-QTLGMJDW.js → chunk-ZT5WFUKJ.js} +4 -4
  207. package/dist/chunk-ZYQ2XWC5.js +5 -0
  208. package/dist/cli/commands/app/build.js +1 -1
  209. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  210. package/dist/cli/commands/app/bulk/execute.js +1 -1
  211. package/dist/cli/commands/app/bulk/status.js +1 -1
  212. package/dist/cli/commands/app/config/link.js +1 -1
  213. package/dist/cli/commands/app/config/pull.js +1 -1
  214. package/dist/cli/commands/app/config/use.js +1 -1
  215. package/dist/cli/commands/app/config/validate.js +1 -1
  216. package/dist/cli/commands/app/demo/watcher.js +1 -1
  217. package/dist/cli/commands/app/deploy.js +1 -1
  218. package/dist/cli/commands/app/dev/clean.js +1 -1
  219. package/dist/cli/commands/app/dev.js +1 -1
  220. package/dist/cli/commands/app/env/pull.js +1 -1
  221. package/dist/cli/commands/app/env/show.js +1 -1
  222. package/dist/cli/commands/app/execute.js +1 -1
  223. package/dist/cli/commands/app/function/build.js +1 -1
  224. package/dist/cli/commands/app/function/info.js +1 -1
  225. package/dist/cli/commands/app/function/replay.js +1 -1
  226. package/dist/cli/commands/app/function/run.js +1 -1
  227. package/dist/cli/commands/app/function/schema.js +1 -1
  228. package/dist/cli/commands/app/function/typegen.js +1 -1
  229. package/dist/cli/commands/app/generate/extension.js +1 -1
  230. package/dist/cli/commands/app/graphiql.js +1 -1
  231. package/dist/cli/commands/app/import/channel-config.js +1 -1
  232. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  233. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  234. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  235. package/dist/cli/commands/app/import-extensions.js +1 -1
  236. package/dist/cli/commands/app/info.js +1 -1
  237. package/dist/cli/commands/app/init.js +1 -1
  238. package/dist/cli/commands/app/logs.js +1 -1
  239. package/dist/cli/commands/app/release.js +1 -1
  240. package/dist/cli/commands/app/security/check.js +1 -1
  241. package/dist/cli/commands/app/security/clean.js +1 -1
  242. package/dist/cli/commands/app/security/instructions.js +1 -1
  243. package/dist/cli/commands/app/security/record.js +1 -1
  244. package/dist/cli/commands/app/security/review.js +1 -1
  245. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  246. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  247. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  248. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  249. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  250. package/dist/cli/commands/app/versions/list.js +1 -1
  251. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  252. package/dist/cli/commands/auth/login.js +1 -1
  253. package/dist/cli/commands/auth/logout.js +1 -1
  254. package/dist/cli/commands/cache/clear.js +1 -1
  255. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  256. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  257. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  258. package/dist/cli/commands/debug/command-flags.js +1 -1
  259. package/dist/cli/commands/doc/fetch.d.ts +34 -1
  260. package/dist/cli/commands/doc/fetch.js +1 -1
  261. package/dist/cli/commands/doc/search.d.ts +53 -1
  262. package/dist/cli/commands/doc/search.js +1 -1
  263. package/dist/cli/commands/docs/generate.js +1 -1
  264. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  265. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  266. package/dist/cli/commands/help.d.ts +6 -6
  267. package/dist/cli/commands/help.js +1 -1
  268. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  269. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  270. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  271. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  272. package/dist/cli/commands/notifications/generate.js +1 -1
  273. package/dist/cli/commands/notifications/list.js +1 -1
  274. package/dist/cli/commands/organization/list.js +1 -1
  275. package/dist/cli/commands/search.js +1 -1
  276. package/dist/cli/commands/send-analytics.js +1 -1
  277. package/dist/cli/commands/theme/check.js +1 -1
  278. package/dist/cli/commands/theme/console.js +1 -1
  279. package/dist/cli/commands/theme/delete.js +1 -1
  280. package/dist/cli/commands/theme/dev.js +1 -1
  281. package/dist/cli/commands/theme/duplicate.js +1 -1
  282. package/dist/cli/commands/theme/info.js +1 -1
  283. package/dist/cli/commands/theme/init.js +1 -1
  284. package/dist/cli/commands/theme/language-server.js +1 -1
  285. package/dist/cli/commands/theme/list.js +1 -1
  286. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  287. package/dist/cli/commands/theme/open.js +1 -1
  288. package/dist/cli/commands/theme/package.js +1 -1
  289. package/dist/cli/commands/theme/preview.js +1 -1
  290. package/dist/cli/commands/theme/profile.js +1 -1
  291. package/dist/cli/commands/theme/publish.js +1 -1
  292. package/dist/cli/commands/theme/pull.js +1 -1
  293. package/dist/cli/commands/theme/push.js +1 -1
  294. package/dist/cli/commands/theme/rename.js +1 -1
  295. package/dist/cli/commands/theme/share.js +1 -1
  296. package/dist/cli/commands/upgrade.d.ts +64 -0
  297. package/dist/cli/commands/upgrade.js +1 -1
  298. package/dist/cli/commands/version.js +1 -1
  299. package/dist/cli/help.js +1 -1
  300. package/dist/cli/services/commands/doc/fetch-result.d.ts +2 -0
  301. package/dist/cli/services/commands/doc/fetch-result.js +22 -0
  302. package/dist/cli/services/commands/doc/fetch.d.ts +2 -1
  303. package/dist/cli/services/commands/doc/fetch.js +2 -15
  304. package/dist/cli/services/commands/doc/search-result.d.ts +2 -0
  305. package/dist/cli/services/commands/doc/search-result.js +14 -0
  306. package/dist/cli/services/commands/doc/search.d.ts +9 -1
  307. package/dist/cli/services/commands/doc/search.js +27 -2
  308. package/dist/cli/services/commands/doc/types.d.ts +107 -0
  309. package/dist/cli/services/commands/doc/types.js +47 -0
  310. package/dist/cli/services/commands/help/types.d.ts +6 -6
  311. package/dist/command-event-context-LFUZ7UCA.js +1 -0
  312. package/dist/command-json-schema-2UMKY7MY.js +1 -0
  313. package/dist/command-registry.js +1 -1
  314. package/dist/conf-store-RI3TL6I4.js +1 -0
  315. package/dist/custom-oclif-loader-IZCKN67O.js +1 -0
  316. package/dist/deprecations-IFVUXXDB.js +1 -0
  317. package/dist/dist-4H2B7BMN.js +1 -0
  318. package/dist/dist-QNWOGQN3.js +1 -0
  319. package/dist/{environment-RSUK27TA.js → environment-O7ECODHU.js} +1 -1
  320. package/dist/environments-CYMEN7NV.js +1 -0
  321. package/dist/error-IL6WQMSW.js +1 -0
  322. package/dist/error-handler-74HKA23T.js +1 -0
  323. package/dist/fs-AINFLJ2E.js +1 -0
  324. package/dist/hooks/did-you-mean.js +1 -1
  325. package/dist/hooks/hydrogen-init.js +1 -1
  326. package/dist/hooks/plugin-plugins.js +1 -1
  327. package/dist/hooks/postrun.js +1 -1
  328. package/dist/hooks/prerun.js +1 -1
  329. package/dist/hooks/public-metadata.js +1 -1
  330. package/dist/hooks/sensitive-metadata.js +1 -1
  331. package/dist/hooks/tunnel-provider.js +1 -1
  332. package/dist/hooks/tunnel-start.js +1 -1
  333. package/dist/index.js +13 -13
  334. package/dist/is-global-2VLKV46Q.js +1 -0
  335. package/dist/json-error-HZB5YIHV.js +1 -0
  336. package/dist/{lib-TYM5B75S.js → lib-PJHT4MKY.js} +1 -1
  337. package/dist/{lib-55QUD4AJ.js → lib-VKSQ65BQ.js} +1 -1
  338. package/dist/{lib-PH52G55H.js → lib-YEZOHXF3.js} +1 -1
  339. package/dist/{local-R3UAQN7T.js → local-KOZETREJ.js} +1 -1
  340. package/dist/{metadata-JWJG4JV4.js → metadata-IBPHZB7N.js} +1 -1
  341. package/dist/{morph-BABFBRSW.js → morph-CRY35DIK.js} +1 -1
  342. package/dist/node-package-manager-DXSRNEDC.js +1 -0
  343. package/dist/notifications-system-XA3EBOGJ.js +1 -0
  344. package/dist/os-X73O7BAB.js +1 -0
  345. package/dist/out-B2GISN65.js +1 -0
  346. package/dist/output-3OYXK3Z5.js +1 -0
  347. package/dist/{path-CPAYTWQW.js → path-3L2QRACZ.js} +1 -1
  348. package/dist/system-JWYYT4PM.js +1 -0
  349. package/dist/tsconfig.tsbuildinfo +1 -1
  350. package/dist/ui-PCG5D6RZ.js +1 -0
  351. package/dist/upgrade-7U2TUNC4.js +1 -0
  352. package/dist/version-7DGU2KYH.js +1 -0
  353. package/dist/version-SXQTRBXB.js +1 -0
  354. package/dist/workerd-MQZ3NKJI.js +18 -0
  355. package/oclif.manifest.json +1664 -427
  356. package/package.json +8 -8
  357. package/dist/analytics-APDNTBDE.js +0 -1
  358. package/dist/analytics-LX52KYSE.js +0 -1
  359. package/dist/chunk-2PDVBGQH.js +0 -7
  360. package/dist/chunk-2YVSZFXJ.js +0 -4
  361. package/dist/chunk-35WQTGN3.js +0 -5
  362. package/dist/chunk-37BGAWAW.js +0 -2
  363. package/dist/chunk-3C4WVKSO.js +0 -6
  364. package/dist/chunk-3LHE4GIX.js +0 -1
  365. package/dist/chunk-47IQIIFX.js +0 -383
  366. package/dist/chunk-4ES7BJEK.js +0 -1
  367. package/dist/chunk-4IFY7V7W.js +0 -1
  368. package/dist/chunk-4JGWKUJN.js +0 -2
  369. package/dist/chunk-4O5GQ3DS.js +0 -7
  370. package/dist/chunk-4O7LK5RG.js +0 -26
  371. package/dist/chunk-4TFJ5RW7.js +0 -8
  372. package/dist/chunk-4ZNBEMRT.js +0 -20
  373. package/dist/chunk-5JIJDUXX.js +0 -20
  374. package/dist/chunk-66YRAUWX.js +0 -3
  375. package/dist/chunk-6A4H3HPY.js +0 -7
  376. package/dist/chunk-6HPUOCFF.js +0 -1
  377. package/dist/chunk-6IDEDOXW.js +0 -2
  378. package/dist/chunk-6IMHGT7F.js +0 -8
  379. package/dist/chunk-6MC2BEW4.js +0 -1
  380. package/dist/chunk-73D5O7A3.js +0 -1
  381. package/dist/chunk-7E4MJCVE.js +0 -10
  382. package/dist/chunk-7HNRK2CR.js +0 -1
  383. package/dist/chunk-7SJHVJ3W.js +0 -5
  384. package/dist/chunk-ALK66U3O.js +0 -3
  385. package/dist/chunk-AMLCWRHU.js +0 -4
  386. package/dist/chunk-AYIU6Z4C.js +0 -1
  387. package/dist/chunk-BIWG3FQQ.js +0 -5
  388. package/dist/chunk-BQ3U3CQV.js +0 -1
  389. package/dist/chunk-C6IBY7NW.js +0 -16
  390. package/dist/chunk-CQF5NDTJ.js +0 -4
  391. package/dist/chunk-DMDLJRLW.js +0 -1
  392. package/dist/chunk-DMNWSUKV.js +0 -5
  393. package/dist/chunk-FK7GA4QQ.js +0 -1
  394. package/dist/chunk-FO2R6KHG.js +0 -1
  395. package/dist/chunk-FOAV642V.js +0 -1
  396. package/dist/chunk-GE4MLO3C.js +0 -5
  397. package/dist/chunk-GM4EFJJF.js +0 -7
  398. package/dist/chunk-GN66BRYF.js +0 -1
  399. package/dist/chunk-GPRZYFDE.js +0 -1
  400. package/dist/chunk-GZ7VGCVW.js +0 -3
  401. package/dist/chunk-HASIOUH2.js +0 -3
  402. package/dist/chunk-HILYTMVA.js +0 -1
  403. package/dist/chunk-HJHS23Q3.js +0 -1
  404. package/dist/chunk-HLPAVELJ.js +0 -1
  405. package/dist/chunk-HPM3HF7A.js +0 -1
  406. package/dist/chunk-HQJ62PII.js +0 -3
  407. package/dist/chunk-HQY6JM6G.js +0 -6
  408. package/dist/chunk-HSYMUYEZ.js +0 -359
  409. package/dist/chunk-I5PQZRYM.js +0 -32
  410. package/dist/chunk-IPZ6LUJV.js +0 -4
  411. package/dist/chunk-J4NBPC57.js +0 -1
  412. package/dist/chunk-J6LQR2F6.js +0 -7
  413. package/dist/chunk-JYGZD4HM.js +0 -1
  414. package/dist/chunk-K3HUQLIC.js +0 -6
  415. package/dist/chunk-K7D53KSJ.js +0 -1
  416. package/dist/chunk-KQFA5YTT.js +0 -97
  417. package/dist/chunk-KTD7VLHL.js +0 -2
  418. package/dist/chunk-L4DFMMOI.js +0 -1
  419. package/dist/chunk-LJZTSQRD.js +0 -11
  420. package/dist/chunk-LLPB6JN5.js +0 -9
  421. package/dist/chunk-LYIXRMQJ.js +0 -46
  422. package/dist/chunk-MCNK5SJ6.js +0 -2
  423. package/dist/chunk-MJZSSCGD.js +0 -5
  424. package/dist/chunk-N55MSO3X.js +0 -12
  425. package/dist/chunk-N5AZZYQA.js +0 -4
  426. package/dist/chunk-NCVGCVQ5.js +0 -6
  427. package/dist/chunk-O5FFMTJE.js +0 -25
  428. package/dist/chunk-OE3HSNSE.js +0 -16
  429. package/dist/chunk-ONF7XXEL.js +0 -1
  430. package/dist/chunk-PG4S5HJJ.js +0 -5
  431. package/dist/chunk-PHG4DASY.js +0 -18
  432. package/dist/chunk-PP4VCR4Y.js +0 -1
  433. package/dist/chunk-PWS4VFSD.js +0 -1
  434. package/dist/chunk-Q37WAD6F.js +0 -1
  435. package/dist/chunk-Q43LBSPT.js +0 -1
  436. package/dist/chunk-QAJZUJR5.js +0 -1
  437. package/dist/chunk-QO5RNGWA.js +0 -1
  438. package/dist/chunk-QPQS2YU3.js +0 -1
  439. package/dist/chunk-QUXQM3S3.js +0 -1
  440. package/dist/chunk-R3KSOCMB.js +0 -6
  441. package/dist/chunk-R74WHKHH.js +0 -15
  442. package/dist/chunk-RJSQMKKS.js +0 -1
  443. package/dist/chunk-RK2V6OIJ.js +0 -2
  444. package/dist/chunk-RUHQNF2W.js +0 -1
  445. package/dist/chunk-RXTLNUPF.js +0 -1
  446. package/dist/chunk-SNE4RHM4.js +0 -1
  447. package/dist/chunk-SQAS5RVZ.js +0 -10
  448. package/dist/chunk-SZI6G247.js +0 -103
  449. package/dist/chunk-TVCWDEVS.js +0 -1
  450. package/dist/chunk-TYMYIUIQ.js +0 -1
  451. package/dist/chunk-UIC7K2HX.js +0 -7
  452. package/dist/chunk-UNHT4ZFP.js +0 -317
  453. package/dist/chunk-UQ6ALA3Y.js +0 -3
  454. package/dist/chunk-UWI76E2L.js +0 -18
  455. package/dist/chunk-VE35YELD.js +0 -1
  456. package/dist/chunk-VGBUN3CZ.js +0 -17
  457. package/dist/chunk-VMNOSVPT.js +0 -8
  458. package/dist/chunk-VNFUCH6T.js +0 -1
  459. package/dist/chunk-W4KE7AO6.js +0 -1
  460. package/dist/chunk-WEPO4J2F.js +0 -19
  461. package/dist/chunk-WLWHCUPZ.js +0 -1
  462. package/dist/chunk-XGKCPD6W.js +0 -1
  463. package/dist/chunk-XNVOKAF2.js +0 -1
  464. package/dist/chunk-XSMCQLJW.js +0 -1
  465. package/dist/chunk-XUUIBSLW.js +0 -1
  466. package/dist/chunk-XWQM2NZ2.js +0 -2
  467. package/dist/chunk-Y3PY5LP7.js +0 -3
  468. package/dist/chunk-Y62EMOQA.js +0 -1
  469. package/dist/chunk-Y743UVBS.js +0 -16
  470. package/dist/chunk-YBSX53QP.js +0 -1
  471. package/dist/chunk-YHCP326A.js +0 -16
  472. package/dist/chunk-YHESTFMZ.js +0 -4
  473. package/dist/chunk-YT27FIQN.js +0 -275
  474. package/dist/chunk-YTR5JHNJ.js +0 -2
  475. package/dist/chunk-YYA5VGDW.js +0 -1
  476. package/dist/chunk-Z6X2GT6Q.js +0 -1
  477. package/dist/chunk-ZEE32UH6.js +0 -1
  478. package/dist/cli/commands/app/app-logs/sources.js +0 -1
  479. package/dist/command-json-schema-SS4GDJTQ.js +0 -1
  480. package/dist/conf-store-54YJCIDK.js +0 -1
  481. package/dist/custom-oclif-loader-3UBH7Q7R.js +0 -1
  482. package/dist/deprecations-ZX7ZKF6L.js +0 -1
  483. package/dist/dist-JMNE7MP6.js +0 -1
  484. package/dist/dist-M2AXGBOL.js +0 -1
  485. package/dist/environments-KD2IDYPG.js +0 -1
  486. package/dist/error-AA6LW3PN.js +0 -1
  487. package/dist/error-handler-4VW3AV2G.js +0 -1
  488. package/dist/fs-4QZCAEP7.js +0 -1
  489. package/dist/is-global-FKG327CG.js +0 -1
  490. package/dist/json-error-32ETFU3V.js +0 -1
  491. package/dist/node-package-manager-M4XHUTQR.js +0 -1
  492. package/dist/notifications-system-QVM2JWKB.js +0 -1
  493. package/dist/os-FEHBQQKP.js +0 -1
  494. package/dist/out-53ABAVL7.js +0 -1
  495. package/dist/output-2LS5AOAH.js +0 -1
  496. package/dist/system-TMD2LYZM.js +0 -1
  497. package/dist/ui-FNPICAAH.js +0 -1
  498. package/dist/upgrade-YYPP5VZY.js +0 -1
  499. package/dist/version-OX3MORI6.js +0 -1
  500. package/dist/version-P7D5ME4Z.js +0 -1
  501. package/dist/workerd-TKVRZK2F.js +0 -18
@@ -1,32 +0,0 @@
1
- import{a as J}from"./chunk-VS7QVU3Z.js";import{a as p}from"./chunk-QO5RNGWA.js";import{a as v}from"./chunk-YY6TFARF.js";import{a as E,b as C}from"./chunk-QUXQM3S3.js";import{r as S}from"./chunk-3LHE4GIX.js";import{p as h,r as D,v as N}from"./chunk-Y3PY5LP7.js";import{b as q,c as F,f as O}from"./chunk-NU5WLZ6Y.js";import{K as b}from"./chunk-3V4VL3SD.js";import{B as m,E as T,W as d,z as w}from"./chunk-47IQIIFX.js";import{Ib as n}from"./chunk-UWI76E2L.js";import{b as Y}from"./chunk-I3J63RFV.js";import{e as P,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function x(t,o,e){let{name:r,verbose:u,noColor:l,json:a,force:A}=e,y=d()||A;if(J({verbose:u,noColor:l}),y&&!o){let i="A theme ID is required to duplicate a theme, specify one with the --theme flag";a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}let s=o?await C(t,o):await E(t,{header:"Select a theme to duplicate",filter:{theme:o}});if(!s){let i=`No theme with ID ${o} could be found. Use shopify theme list to find a theme ID.`;a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}if(s?.role==="development"){let i="Development themes can't be duplicated. Use shopify theme push to upload it to the store first.";a?n(JSON.stringify({message:i,errors:[]})):m({body:[i]});return}if(!y&&!await T({message:`Do you want to duplicate '${s.name}' on ${t.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${s.name}'`,cancellationMessage:"No, cancel duplicate"}))return;let I=await S(s.id,r,t);a?M(s,t,I):j(s,t,I)}function j(t,o,e){if(e.userErrors&&e.userErrors.length>0){let r=e.userErrors.map(u=>u.message).join(", ");m({body:["The theme",...p(t),"could not be duplicated due to errors: ",{subdued:r},{char:"."},...e.requestId?[`
2
- Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?w({body:["The theme",...p(t),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:v(e.theme,o)}}]]}):m({body:["The theme",...p(t),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
3
- Request ID: `,{subdued:e.requestId}]:[]]})}function M(t,o,e){if(e.userErrors&&e.userErrors.length>0)n(JSON.stringify({message:`The theme '${t.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId}));else if(e.theme){let{id:r,name:u,role:l}=e.theme,a={theme:{id:r,name:u,role:l,shop:o.storeFqdn}};n(JSON.stringify(a))}else n(JSON.stringify({message:`The theme '${t.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}))}var f=P(Y(),1);var g=class t extends N{static summary="Duplicates a theme from your theme library.";static usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];static descriptionWithMarkdown=`If you want to duplicate your local theme, you need to run \`shopify theme push\` first.
4
-
5
- If no theme ID is specified, you're prompted to select the theme that you want to duplicate from the list of themes in your store. You're asked to confirm that you want to duplicate the specified theme.
6
-
7
- Prompts and confirmations are not shown when duplicate is run in a CI environment or the \`--force\` flag is used, therefore you must specify a theme ID using the \`--theme\` flag.
8
-
9
- You can optionally name the duplicated theme using the \`--name\` flag.
10
-
11
- If you use the \`--json\` flag, then theme information is returned in JSON format, which can be used as a machine-readable input for scripts or continuous integration.
12
-
13
- Sample JSON output:
14
-
15
- \`\`\`json
16
- {
17
- "theme": {
18
- "id": 108267175958,
19
- "name": "A Duplicated Theme",
20
- "role": "unpublished",
21
- "shop": "mystore.myshopify.com"
22
- }
23
- }
24
- \`\`\`
25
-
26
- \`\`\`json
27
- {
28
- "message": "The theme 'Summer Edition' could not be duplicated due to errors",
29
- "errors": ["Maximum number of themes reached"],
30
- "requestId": "12345-abcde-67890"
31
- }
32
- \`\`\``;static description=this.descriptionForHelp();static flags={...q,...F,password:h.password,theme:O(f.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})),name:f.Flags.string({char:"n",description:"Name of the newly duplicated theme.",env:"SHOPIFY_FLAG_NAME"}),store:h.store,environment:h.environment,force:f.Flags.boolean({char:"f",description:"Force the duplicate operation to run without prompts or confirmations. Required if non interactive outside CI.",env:"SHOPIFY_FLAG_FORCE"})};static nonTTYFlagRequirements(){return[{flags:["force"],when:()=>!d()}]}async run(){let{flags:o}=await this.parse(t),e=D(o),r=await b(e,o.password);await x(r,o.theme,o)}};export{g as a};
@@ -1,4 +0,0 @@
1
- import{a as U}from"./chunk-5BGUKF7L.js";import{a as J}from"./chunk-C6IBY7NW.js";import{a as X}from"./chunk-GSE6FXZU.js";import{B,C as m,D as y,F as H,G as K,H as V,I as q,J as Q,K as z,L as h,a as L,c as O,d as k,g as j,i as M,p as W,u as Y}from"./chunk-EO4YJFMY.js";import{b as N}from"./chunk-NU5WLZ6Y.js";import{b as T}from"./chunk-4ZNBEMRT.js";import{A as g,B as D,D as G,V as R,y as F,z as $}from"./chunk-47IQIIFX.js";import{Ib as E,sa as _}from"./chunk-UWI76E2L.js";import{b as de}from"./chunk-I3J63RFV.js";import{f as d,p as A}from"./chunk-6IDEDOXW.js";import{e as ue,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();function Z(e,t){return t==="none"?0:e.scan.issues.some(o=>k[o.severity]>=k[t])?1:0}async function ee({includeDirs:e,excludePatterns:t,noGitIgnore:i,...o}){let n=Date.now();return{...await M(o,{includeDirs:e,excludePatterns:t,noGitIgnore:i}),elapsedMilliseconds:Date.now()-n}}function te({includeDirs:e,excludePatterns:t,noGitIgnore:i,...o}){return j(o,{includeDirs:e,excludePatterns:t,noGitIgnore:i})}a();var pe={high:"High",medium:"Medium",low:"Low"},v=3,w=8;function he(e){let t=fe(e),i=W(e.scan.issues);return{type:t,options:{headline:ge(e,i),body:me(e),reference:[{subdued:`Engine: ${e.engine.name} ${e.engine.version}`},{subdued:`Ruleset: ${e.engine.ruleset}`},...i.some(o=>o.issues.length>1)&&!e.verbose?[{subdued:"Use --verbose for every occurrence and fix. deterministic-findings.json retains all file and line details."}]:[]],customSections:ve(e,i)}}}function ie(e){let{type:t,options:i}=he(e);if(t==="success"){$(i);return}if(t==="warning"){g(i);return}D(i)}function ne(e){return e.scan.scan.coverage_gaps.length>0}function fe(e){return e.scan.issues.some(t=>t.severity==="high")?"error":e.scan.issues.length>0||ne(e)?"warning":"success"}function ge(e,t){let i=e.scan.issues.length;return t.length<i?`${t.length} security issue ${t.length===1?"group":"groups"} found (${i} occurrences).`:i>0?`${i} security ${i===1?"issue":"issues"} found.`:ne(e)?"Scan completed with coverage gaps.":"No security issues found."}function me(e){let t=e.scan,i=[{userInput:t.app.name},{char:"."},`${t.scan.files_scanned} files scanned in ${Ce(e.elapsedMilliseconds)}.`],o=t.scan.checks_executed.filter(n=>n.status==="not_applicable").length;return o>0&&i.push({info:`
2
- ${o} check${o===1?"":"s"} not applicable.`}),i.push({info:`
3
- ${e.agentCheckCount} check${e.agentCheckCount===1?"":"s"} ready for your coding agent.`}),i}function ye(e){return[["Have your coding agent run the agent checks"],["Record the agent results with",{command:h(e.commands.record)}],["Review the results with",{command:h(e.commands.review)}]]}function be(e){let t=m(e)??"not linked";return e.kind==="config"&&e.clientIdOverride?`${t} (from --client-id)`:t}function ke(e){let{selection:t}=e;return{title:"Selection",body:{tabularData:[["App directory",t.appDirectory],["Config file",B(t)??"none"],["Client ID",be(t)],["Scan directories",e.scanDirectories.map(({directory:i})=>d(t.appDirectory,i)||".").join(", ")]],firstColumnSubdued:!0}}}function ve(e,t){let i=[ke(e)];for(let n of["high","medium","low"]){let s=t.filter(r=>r.severity===n);s.length!==0&&i.push({title:pe[n],body:{list:{items:s.flatMap(r=>[Se(r),...e.verbose?r.issues.map(we):[]])}}})}if(e.scan.scan.coverage_gaps.length>0){let n=e.scan.scan.coverage_gaps,s=n.slice(0,w).map(r=>r.message);n.length>w&&s.push({info:`${n.length-w} more coverage gaps`}),i.push({title:"Coverage gaps",body:{list:{items:s}}})}let{appDirectory:o}=e.selection;return i.push({title:"Artifacts",body:{list:{items:[["Deterministic findings:",{filePath:d(o,e.deterministicFindingsPath)}],["Agent security check instructions:",{filePath:d(o,e.agentChecksPath)}]]}}}),i.push({title:"Next steps",body:{list:{items:ye(e),ordered:!0}}}),e.verbose&&i.push({title:"Scan details",body:{tabularData:[["Framework",e.scan.detection.framework],["Surface",e.scan.detection.surface],["Languages",e.scan.detection.languages.map(n=>`${n.name} (${n.support})`).join(", ")||"none"],["Capabilities",Ie(e.scan.capabilities)],["Rules run",String(e.scan.scan.rules_run)],["Not run",String(e.scan.scan.rules_skipped)]],firstColumnSubdued:!0}}),i}function we(e){let t=e.location.line?`${e.location.file}:${e.location.line}`:e.location.file,i=[{bold:e.title},oe(e.id),{filePath:t}];return i.push({subdued:e.message},{subdued:`Fix: ${e.fix.description}`}),e.fix.guide&&(e.fix.guide.startsWith("https://")||e.fix.guide.startsWith("http://")?i.push({link:{label:"Guide",url:e.fix.guide}}):i.push({subdued:`Guide: ${e.fix.guide}`})),e.snippet&&i.push({subdued:`Code: ${e.snippet}`}),i}function Se(e){let t=e.issues[0],i=e.issues.length,o=e.files.length,n=e.files.slice(0,v).map(s=>{let r=e.issues.find(f=>f.location.file===s);return{filePath:r.location.line?`${s}:${r.location.line}`:s}});return[{bold:t.title},oe(t.id),`${i} ${i===1?"occurrence":"occurrences"} across ${o} ${o===1?"file":"files"}`,...n,...o>v?[{subdued:`+${o-v} more files`}]:[]]}function oe(e){let t=O(e);return t?{link:{label:e,url:t}}:{subdued:e}}function Ie(e){let t=Object.entries(e).filter(([,i])=>i).map(([i])=>i);return t.length>0?t.join(", "):"none detected"}function Ce(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function xe(e){return{message:`${e} recommended agent ${e===1?"check":"checks"} available to complete your scan. How do you want to pass that prompt to your agent?`,choices:[{label:"Copy instructions to the clipboard",value:"copy"},{label:"Print instructions to the terminal",value:"print"},{label:"Nothing",value:"nothing"}],defaultValue:"copy"}}var Pe={resolveSelection:H,execute:ee,listFiles:te,writeArtifacts:Y,canPrompt:R,selectInstructionsDestination:e=>G(xe(e)),deliverInstructions:J,output:E,renderInfo:F,renderWarning:g,renderReport:ie,setExitCode:e=>{process.exitCode=e},recordMetadata:X};async function Ae(e,t,i,o){return e.skipInstructions?"nothing":e.printInstructions?"print":i?t.selectInstructionsDestination(o):"nothing"}function _e(e,t,i,o,n,s){return{scan:e.scan,selection:n,scanDirectories:s,engine:e.engine,verbose:i,elapsedMilliseconds:e.elapsedMilliseconds,commands:o,deterministicFindingsPath:t.deterministicFindingsPath,agentChecksPath:t.agentChecksPath,agentCheckCount:e.agentChecks.checks.length}}function Fe(e){return e.replace(/[?*()[\]{}!#\\]/g,"\\$&")}async function se(e,t){if(e.ignoredScanDirectories.length===0&&e.otherAppDirectories.length===0)return;let i=await _(A()),o=n=>d(i,n)||".";for(let n of e.ignoredScanDirectories)t.renderWarning({headline:`${o(n)} is ignored by Git, so only the files Git tracks in it are scanned.`,body:["Use",{command:"--no-git-ignore"},"to scan everything in it."]});for(let n of e.otherAppDirectories){let s=o(n);t.renderWarning({headline:`${s} holds another app's configuration, so its files are scanned as part of this app.`,body:["Use",{command:`--exclude ${z(Fe(s),Q())}`},"to leave it out."]})}}async function S(e,t=Pe){let i=await K(e.includeDirs),o=!e.listFiles&&t.canPrompt(),n=await t.resolveSelection({path:e.directory,config:e.configName,clientId:e.clientId,withoutAppConfig:e.withoutAppConfig,allowPrompts:o,validateClientIdFlag:!0}),{appDirectory:s}=n,r={include_dirs:[...e.includeDirs],excludes:[...e.excludePatterns],no_git_ignore:e.noGitIgnore},p=q(n,e.directory,r),f={selection:n,resultsKey:y(n),commands:p};(n.kind==="no-config"?!e.withoutAppConfig:n.appConfigFilePicked===!0)&&t.renderInfo({headline:"To skip these prompts next time, run:",body:[{command:h(p.scan)}]});let re=n.kind==="config"?n.appConfigDirectories??[]:[],{scanDirectories:b,requestedScanDirectories:ce}=V(s,i,re),C={appDirectory:s,scanDirectories:b.map(({directory:c})=>c),requestedScanDirectories:ce,appConfigDirectories:b.filter(({origin:c})=>c==="app_config_directory").map(({directory:c})=>c),appConfigFilePath:n.kind==="config"?n.appConfigFilePath:void 0,clientId:m(n),includeDirs:e.includeDirs,excludePatterns:e.excludePatterns,noGitIgnore:e.noGitIgnore};if(e.listFiles){let{paths:c,...le}=await t.listFiles(C);return await se(le,t),c.length>0&&t.output(c.join(`
4
- `)),f}let u=await t.execute(C);await se(u,t),await t.recordMetadata({num_security_findings:u.scan.issues.length});let ae=await t.writeArtifacts(s,y(n),{deterministicFindings:u.deterministicFindings,agentChecks:u.agentChecks});t.renderReport(_e(u,ae,e.verbose,p,n,b));let x=await Ae(e,t,o,u.agentChecks.checks.length);x!=="nothing"&&await t.deliverInstructions({appDirectory:s,resultsKey:y(n),copy:x==="copy",scanScope:r,commands:p});let P=Z(u,e.blocking);return P!==0&&t.setExitCode(P),f}var l=ue(de(),1);var I=class e extends T{static summary="Check an app for Shopify-specific security issues and write deterministic-findings.json and agent-checks.json.";static descriptionWithMarkdown="Runs an app security check locally and writes `deterministic-findings.json` and `agent-checks.json` to the results directory, `.shopify/app-security/<results key>/`. The results key is `--client-id` when you pass it, and otherwise the name of the app configuration file without `.toml`; the other `app security` commands take the same selection flags and find the same directory. Every run replaces both files, so it's always safe to run the check again.\n\n`deterministic-findings.json` holds the deterministic scan results. `agent-checks.json` holds the checks for your coding agent to investigate; the agent's results are recorded with `shopify app security record`. Use `--config` to select a specific app configuration when the project has multiple `shopify.app*.toml` files; the check inspects only that configuration. Use `--client-id` to replace the configuration's client ID for this run. `--client-id` is checked against your Shopify account before anything is scanned, so it needs you to be logged in. When no app configuration exists, use `--without-app-config --client-id <client-id>` to scan `--path` anyway with config checks skipped; in an interactive terminal the command offers to do this.\n\nThe check scans the app directory and each `--include-dir`. Git ignore rules apply by default: a file or directory that Git ignores is skipped, using the rules of the repository that contains it, while files that Git tracks are always scanned. Use `--no-git-ignore` to turn Git ignore rules off for every scanned directory. When the check uses Git, it requires Git 2.38.0 or later.\n\nUse `--exclude` to skip more paths. Each value is a glob that is matched against the path relative to the working directory, so a path above it starts with `../`, and a name at any depth needs `**/`, for example `--exclude '**/generated'`. Repeat the flag to add globs. An exclusion can't remove the selected app configuration file. Quote each value so your shell doesn't expand `*`. The coding-agent instructions this check offers repeat the globs. Other `app security` commands don't take `--exclude` or `--no-git-ignore`, so pass the same flags each time you run the check.\n\nUse `--list-files` to check the scope before scanning: it prints the files the check would gather, one path per line and relative to the app directory, and then stops. It writes no results and never prompts. `--client-id` is still checked, but doesn't change the list.\n\nIn 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 `--print-instructions`, which prints them. You can also run `shopify app security instructions` to print, copy, or write them later.\n\nReports the number of findings to Shopify as usage telemetry, but not finding details. See [usage reporting](https://shopify.dev/docs/api/shopify-cli#usage-reporting) for details.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --include-dir ../backend","<%= config.bin %> <%= command.id %> --path extensions --config production --include-dir .","<%= config.bin %> <%= command.id %> --without-app-config --client-id <client-id>",'<%= config.bin %> <%= command.id %> --path app --include-dir . --exclude marketing --exclude "**/generated"',"<%= config.bin %> <%= command.id %> --no-git-ignore --exclude local-data","<%= config.bin %> <%= command.id %> --include-dir ../backend --list-files"];static flags={...N,...L,"include-dir":l.Flags.string({description:"Also scan this directory, relative to the working directory. Repeat the flag to add directories. Use it for code that lives outside the app directory, such as a backend or a shared library.",multiple:!0}),exclude:l.Flags.string({description:"Skip paths that match this glob, relative to the working directory. Repeat the flag to add globs. The selected app configuration file can't be excluded.",multiple:!0}),"no-git-ignore":l.Flags.boolean({description:"Turn off Git ignore rules for every scanned directory, so files that Git ignores are scanned too. Files that Git tracks are always scanned.",env:"SHOPIFY_FLAG_NO_GIT_IGNORE"}),"list-files":l.Flags.boolean({description:"Print the files the check would gather, one path per line, and stop. Nothing is scanned, no results are written, and nothing is prompted for.",env:"SHOPIFY_FLAG_LIST_FILES",exclusive:["print-instructions","skip-instructions","blocking"]}),...U,"print-instructions":l.Flags.boolean({description:"Print coding-agent instructions without prompting for how to deliver them.",default:!1,exclusive:["skip-instructions"],env:"SHOPIFY_FLAG_APP_SECURITY_PRINT_INSTRUCTIONS"}),yes:l.Flags.boolean({description:"Print coding-agent instructions without prompting.",hidden:!0,deprecated:{to:"--print-instructions"},exclusive:["skip-instructions","list-files"],env:"SHOPIFY_FLAG_YES"}),"skip-instructions":l.Flags.boolean({description:"Don't offer the coding-agent instructions after the scan. Use it when you want only the deterministic scan results.",default:!1,exclusive:["print-instructions"],env:"SHOPIFY_FLAG_APP_SECURITY_SKIP_INSTRUCTIONS"})};async run(){let{flags:t}=await this.parse(e);await S({directory:t.path,configName:t.config,clientId:t["client-id"],withoutAppConfig:!!t["without-app-config"],verbose:!!t.verbose,blocking:t.blocking,printInstructions:!!(t["print-instructions"]||t.yes),skipInstructions:t["skip-instructions"],includeDirs:t["include-dir"]??[],excludePatterns:t.exclude??[],noGitIgnore:!!t["no-git-ignore"],listFiles:!!t["list-files"]})}};export{I as a};
@@ -1 +0,0 @@
1
- import{b as a,c}from"./chunk-NU5WLZ6Y.js";import{b as u}from"./chunk-4ZNBEMRT.js";import{a as i}from"./chunk-XUUIBSLW.js";import{a as p}from"./chunk-7VAKNVFD.js";import{Ib as m,b as r}from"./chunk-UWI76E2L.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();async function f(){return{version:i}}t();t();var o=p({name:"VersionResult",schema:r.object({version:r.string()})});function l(e,s){m(s==="json"?o.encode(e):e.version)}var n=class e extends u{static descriptionWithMarkdown="Shopify CLI version currently installed.";static description=this.descriptionForHelp();static flags={...a,...c};static get jsonOutputSchema(){return o}async run(){let{flags:s}=await this.parse(e),v=await f();l(v,s.json?"json":"text")}};export{n as a};
@@ -1,7 +0,0 @@
1
- import{p,v as d}from"./chunk-Y3PY5LP7.js";import{a as u}from"./chunk-YPCXVZ2N.js";import{da as w}from"./chunk-NCRWOW6F.js";import{b as l}from"./chunk-NU5WLZ6Y.js";import{z as f}from"./chunk-47IQIIFX.js";import{i}from"./chunk-Q37WAD6F.js";import{Xa as c,qa as h}from"./chunk-UWI76E2L.js";import{e as r,m}from"./chunk-6IDEDOXW.js";import{e as _,g as o}from"./chunk-VKWPEFWQ.js";o();o();var g=_(w(),1),P=["AGENTS.md","DESIGN.md","assets/**","blocks/**","config/**","layout/**","listings/**/*","locales/**","sections/**","snippets/**","templates/**","templates/customers/**","release-notes.md","update_extension.json"].join("|");async function y(e){let t=await k(e),s=`${e}/${t}`,n=`${e}/(${P})`;await u({inputDirectory:e,outputZipPath:s,matchFilePattern:n}),f({body:["Your local theme was packaged in",{filePath:m(s)}]})}async function k(e){let t=r(e,"config/settings_schema.json");if(!await c(t))throw new i("Provide a config/settings_schema.json to package your theme.");let s=await v(t);if(s===void 0||s.theme_name===void 0)throw new i("Provide a theme_info.theme_name configuration in config/settings_schema.json.");return`${[s.theme_name,s.theme_version].filter(Boolean).join("-")}.zip`}async function v(e){let t=(0,g.parseJSON)(await h(e),null,!0);if(!t)throw new i("The file config/settings_schema.json contains an error. Please check if the file is valid JSON and includes the theme_info.theme_name configuration.");return t.find(s=>s.name==="theme_info")}var a=class extends d{static summary="Package your theme into a .zip file, ready to upload to the Online Store.";static descriptionWithMarkdown=`Packages your local theme files into a ZIP file that can be uploaded to Shopify.
2
-
3
- Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
4
-
5
- The package includes the \`listings\` directory if present (required for multi-preset themes per [Theme Store requirements](https://shopify.dev/docs/storefronts/themes/store/requirements#adding-presets-to-your-theme-zip-submission)).
6
-
7
- The ZIP file uses the name \`theme_name-theme_version.zip\`, based on parameters in your [settings_schema.json](https://shopify.dev/docs/storefronts/themes/architecture/config/settings-schema-json) file.`;static description=this.descriptionForHelp();static flags={...l,path:p.path};static multiEnvironmentsFlags=null;async command(t){await y(t.path)}};export{a};
@@ -1 +0,0 @@
1
- import{a as C}from"./chunk-PWS4VFSD.js";import{a as y}from"./chunk-PO5T44H3.js";import{Ca as k,Fa as w,Ga as A,Ha as P}from"./chunk-UNHT4ZFP.js";import{b as h}from"./chunk-NU5WLZ6Y.js";import{z as g}from"./chunk-47IQIIFX.js";import{i as u}from"./chunk-Q37WAD6F.js";import{i as r}from"./chunk-6IDEDOXW.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();n();async function s(p){let{directory:t,configName:o,configPath:e,configuration:a,remoteApp:i}=p;if(!a.client_id)throw new u("The selected configuration is not linked to a remote app.","Run `shopify app config link` first to link this configuration to a Shopify app.");let c=i.developerPlatformClient,l=await k({developerPlatformClient:c,app:i}),m=i.flags,b={directory:t,configName:o,developerPlatformClient:c,apiKey:a.client_id},d=await w(b,l,m,i.apiKey),v=r(e),x=await A({remoteApp:i,developerPlatformClient:c,specifications:l,flags:m,configFileName:v,appDirectory:d.appDirectory??t,localAppOptions:d});return{configPath:e,configuration:x,remoteApp:i}}var f=class p extends C{static summary="Refresh an already-linked app configuration without prompts.";static descriptionWithMarkdown="Pulls the latest configuration from the already-linked Shopify app and updates the selected configuration file.\n\nThis command reuses the existing linked app and organization and skips all interactive prompts. Use `--config` to target a specific configuration file, or omit it to use the default one.";static description=this.descriptionForHelp();static flags={...h,...y};async run(){let{flags:t}=await this.parse(p),{app:o,remoteApp:e}=await P({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),{configuration:a,configPath:i}=await s({directory:t.path,configName:t.config,configPath:o.configPath,configuration:o.configuration,remoteApp:e});return g({headline:`Pulled latest configuration for "${a.name}"`,body:`Updated ${r(i)} with the remote data.`}),{app:o}}};export{f as a};
@@ -1,6 +0,0 @@
1
- import{b as l}from"./chunk-NU5WLZ6Y.js";import{b as u}from"./chunk-4ZNBEMRT.js";import{k as f}from"./chunk-3V4VL3SD.js";import{i as n}from"./chunk-Q37WAD6F.js";import{Ib as m}from"./chunk-UWI76E2L.js";import{b as g}from"./chunk-I3J63RFV.js";import{e as v,g as o}from"./chunk-VKWPEFWQ.js";o();o();var S="https://shopify.dev/assistant/search",w="X-Shopify-Surface",A="cli";async function y(s,e,p){let i=new URLSearchParams({query:s});e&&i.append("api_name",e),p&&i.append("api_version",p);let r;try{r=await f(`${S}?${i.toString()}`,{headers:{Accept:"application/json",[w]:A}})}catch{throw new n("Could not reach shopify.dev to run the search.","Check your network connection and try again.")}let h=await r.text();if(!r.ok){let d=`${r.status} ${r.statusText}`;try{let t=JSON.parse(h);t?.error&&(d=t.error)}catch(t){if(!(t instanceof SyntaxError))throw t}throw new n(`Search failed: ${d}`)}m(h)}var a=v(g(),1),c=class s extends u{static description="Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static examples=[`# search shopify.dev for a topic
2
- shopify doc search --query "subscribe to webhooks"
3
-
4
- # narrow the search to a specific API and version
5
- shopify doc search --query "create a product" --api-name admin --api-version latest
6
- `];static flags={...l,query:a.Flags.string({description:"The search query.",env:"SHOPIFY_FLAG_QUERY",required:!0}),"api-name":a.Flags.string({description:"Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.",env:"SHOPIFY_FLAG_API_NAME"}),"api-version":a.Flags.string({description:"Limit results to a specific API version (for example: 2025-10, latest, current).",env:"SHOPIFY_FLAG_API_VERSION"})};async run(){let{flags:e}=await this.parse(s);await y(e.query,e["api-name"],e["api-version"])}};export{c as a};
@@ -1 +0,0 @@
1
- import{a as u,b as l}from"./chunk-7HNRK2CR.js";import{f as d,i as m}from"./chunk-KQFA5YTT.js";import{a as c}from"./chunk-PWS4VFSD.js";import{Ha as p}from"./chunk-UNHT4ZFP.js";import{i as s}from"./chunk-Q37WAD6F.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();e();async function f({clientId:a,operationIds:t,getOperation:n=m}){return Promise.all(t.map(async i=>{let o=await n({clientId:a,operationId:i});if(!o)throw new s(`Migration operation not found: ${i}`);return o}))}var r=class a extends c{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}),o=t.watch?await l({clientId:i.apiKey,operationIds:t.id}):await f({clientId:i.apiKey,operationIds:t.id});return u(o,t.json),{app:n}}};export{r as a};
@@ -1,97 +0,0 @@
1
- import{a as d}from"./chunk-PO5T44H3.js";import{_ as a}from"./chunk-UNHT4ZFP.js";import{b as l,c as g,f as S}from"./chunk-NU5WLZ6Y.js";import{e as o}from"./chunk-3V4VL3SD.js";import{b as C}from"./chunk-I3J63RFV.js";import{e as h,g as e}from"./chunk-VKWPEFWQ.js";e();e();var P=["HONOR_BILLING_PRICE","PLAN_PRICE"],T=["OPT_OUT","WHEN_REQUIRED"],f=["UNSCHEDULED","SCHEDULED","MIGRATED"];var r=h(C(),1);var u={...l,...d,...g},F={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final outcome when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},y={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final state when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},R={...u,status:r.Flags.option({description:"Filter subscriptions by migration status.",env:"SHOPIFY_FLAG_STATUS",options:[...f]})()},L={...u,input:r.Flags.string({char:"i",description:"Path to the migration CSV. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),force:S(r.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})),...F},_={...u,id:r.Flags.string({description:"The app subscription migration operation ID. Can be specified multiple times.",env:"SHOPIFY_FLAG_ID",required:!0,multiple:!0})},v={..._,...y};e();e();var I=o`
2
- query MigratableAppSubscriptions(
3
- $apiKey: String!
4
- $first: Int!
5
- $after: String
6
- $status: AppSubscriptionMigrationStatus
7
- ) {
8
- migratableAppSubscriptions(apiKey: $apiKey, first: $first, after: $after, status: $status) {
9
- edges {
10
- cursor
11
- node {
12
- shopId
13
- status
14
- manualSubscriptionName
15
- manualSubscriptionPrice {
16
- amount
17
- currencyCode
18
- }
19
- manualSubscriptionInterval
20
- targetPlanHandle
21
- notification {
22
- kind
23
- optOutDeadline
24
- sentAt
25
- }
26
- priceBehavior
27
- effectiveDate
28
- lastFailureReason
29
- }
30
- }
31
- pageInfo {
32
- hasNextPage
33
- endCursor
34
- }
35
- }
36
- }
37
- `,b=o`
38
- mutation AppSubscriptionMigrationOperationCreate($input: AppSubscriptionMigrationOperationCreateInput!) {
39
- appSubscriptionMigrationOperationCreate(input: $input) {
40
- operation {
41
- id
42
- status
43
- total
44
- results(first: 250) {
45
- edges {
46
- node {
47
- shopId
48
- code
49
- }
50
- }
51
- }
52
- }
53
- userErrors {
54
- message
55
- field
56
- }
57
- }
58
- }
59
- `,m=o`
60
- query AppSubscriptionMigrationOperation($apiKey: String!, $id: ID!) {
61
- appSubscriptionMigrationOperation(apiKey: $apiKey, id: $id) {
62
- id
63
- status
64
- total
65
- results(first: 250) {
66
- edges {
67
- node {
68
- shopId
69
- code
70
- }
71
- }
72
- }
73
- }
74
- }
75
- `,O=o`
76
- mutation AppSubscriptionMigrationOperationCancel($input: AppSubscriptionMigrationOperationCancelInput!) {
77
- appSubscriptionMigrationOperationCancel(input: $input) {
78
- operation {
79
- id
80
- status
81
- total
82
- results(first: 250) {
83
- edges {
84
- node {
85
- shopId
86
- code
87
- }
88
- }
89
- }
90
- }
91
- userErrors {
92
- message
93
- field
94
- }
95
- }
96
- }
97
- `;function A(t){return t===null?null:{...t,results:{edges:t.results?.edges?.filter(i=>i!==null)??[]}}}function M(t){return{operation:A(t.operation),userErrors:t.userErrors??[]}}async function Q({clientId:t,first:i,after:n,status:s}){let p=(await a.getInstance().request(I,{apiKey:t,first:i,after:n,status:s})).migratableAppSubscriptions;return p===null?null:{subscriptions:p.edges?.flatMap(c=>c===null?[]:[c.node])??[],pageInfo:p.pageInfo}}async function W({clientId:t,idempotencyKey:i,migrations:n}){let s=await a.getInstance().request(b,{input:{apiKey:t,idempotencyKey:i,migrations:n}});return M(s.appSubscriptionMigrationOperationCreate)}async function k({clientId:t,operationId:i}){let n=await a.getInstance().request(m,{apiKey:t,id:i});return A(n.appSubscriptionMigrationOperation)}async function z({clientId:t,operationId:i}){let n=await a.getInstance().request(O,{input:{apiKey:t,id:i}});return M(n.appSubscriptionMigrationOperationCancel)}export{P as a,T as b,R as c,L as d,_ as e,v as f,Q as g,W as h,k as i,z as j};
@@ -1,2 +0,0 @@
1
- import{a as N,b as $,c as w}from"./chunk-MUM34KUM.js";import{j as T}from"./chunk-3V4VL3SD.js";import{a as D,b}from"./chunk-5BTLE67Z.js";import{S as P,T as k,a as F}from"./chunk-47IQIIFX.js";import{l as A}from"./chunk-Q37WAD6F.js";import{Ba as y,Da as _,Ma as U,Nb as u,Pa as I,R as x,Ta as O,Ya as p}from"./chunk-UWI76E2L.js";import{g as h}from"./chunk-UEBUGSBT.js";import{c as m,h as l,i as S}from"./chunk-6IDEDOXW.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
- `);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 +0,0 @@
1
- import{b as s}from"./chunk-I3J63RFV.js";import{a as o}from"./chunk-JD5P5RAJ.js";import{e as i,g as n}from"./chunk-VKWPEFWQ.js";n();var t=i(s()),a={"no-input":t.Flags.boolean({description:"Disable interactive prompts and browser authentication.",env:"SHOPIFY_FLAG_NO_INPUT"})};function u(r=process.argv,e=process.env){return r.includes("--no-input")||o(e.SHOPIFY_FLAG_NO_INPUT)}export{a,u as b};
@@ -1,11 +0,0 @@
1
- import{a as E}from"./chunk-FKIVKNOV.js";import{a as P}from"./chunk-PWS4VFSD.js";import{a as w}from"./chunk-PO5T44H3.js";import{Ha as y,L as F,i as C,ja as x}from"./chunk-UNHT4ZFP.js";import{b as f}from"./chunk-LJIJEGND.js";import{b as v}from"./chunk-NU5WLZ6Y.js";import{Cb as o,Eb as p,Ib as h,Xa as g,qa as u,ya as l}from"./chunk-UWI76E2L.js";import{b as $}from"./chunk-I3J63RFV.js";import{e as c}from"./chunk-6IDEDOXW.js";import{e as _,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function S({app:d,remoteApp:t,organization:a,envFile:e}){await x(t,a.source);let n={SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:C(d.configuration)};if(await g(e)){let i=await u(e),r=f(i,n);if(r===i)return p`No changes to ${o.path(e)}`;{await l(e,r);let I=E(i??"",r);return p`Updated ${o.path(e)} to be:
2
-
3
- ${r}
4
-
5
- Here's what changed:
6
-
7
- ${o.linesDiff(I)}
8
- `}}else{let i=f(null,n);return await l(e,i),p`Created ${o.path(e)}:
9
-
10
- ${i}
11
- `}}var b=_($(),1);var m=class d extends P{static summary="Pull app and extensions environment variables.";static descriptionWithMarkdown="Creates or updates an `.env` files that contains app and app extension environment variables.\n\n When an existing `.env` file is updated, changes to the variables are displayed in the terminal output. Existing variables and commented variables are preserved.";static description=this.descriptionForHelp();static flags={...v,...w,"env-file":b.Flags.string({hidden:!1,description:"Specify an environment file to update if the update flag is set",env:"SHOPIFY_FLAG_ENV_FILE"})};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:e,organization:n}=await y({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),i=c(a.directory,t["env-file"]??F(a.configPath));return h(await S({app:a,remoteApp:e,organization:n,envFile:i})),{app:a}}};export{m as a};
@@ -1,9 +0,0 @@
1
- import{b as u,c as m}from"./chunk-NU5WLZ6Y.js";import{b as h}from"./chunk-4ZNBEMRT.js";import{N as i}from"./chunk-47IQIIFX.js";import{a as n}from"./chunk-7VAKNVFD.js";import{Ib as p,b as s}from"./chunk-UWI76E2L.js";import{b as g}from"./chunk-I3J63RFV.js";import{e as S,g as e}from"./chunk-VKWPEFWQ.js";e();e();async function f(t){let r=new URLSearchParams;return r.append("search",t??""),{url:`https://shopify.dev/docs?${r.toString()}`}}e();e();var o=n({name:"SearchResult",schema:s.object({url:s.string().url()})});async function l(t,r){r==="json"?p(o.encode(t)):await i(t.url)}var d=S(g(),1),a=class t extends h{static descriptionWithMarkdown="Search shopify.dev for the most relevant content matching a query. Best for discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static description=this.descriptionForHelp();static usage="search [query]";static examples=[`# open the search modal on Shopify.dev
2
- shopify search
3
-
4
- # search for a term on Shopify.dev
5
- shopify search <query>
6
-
7
- # search for a phrase on Shopify.dev
8
- shopify search "<a search query separated by spaces>"
9
- `];static args={query:d.Args.string()};static flags={...u,...m};static get jsonOutputSchema(){return o}async run(){let{args:r,flags:c}=await this.parse(t),y=await f(r.query);await l(y,c.json?"json":"text")}};export{a};
@@ -1,46 +0,0 @@
1
- import{k as P,t as F}from"./chunk-3LHE4GIX.js";import{a as N}from"./chunk-Q7BOSHWX.js";import{a as T}from"./chunk-WLWHCUPZ.js";import{I as H,K as q,k as $,pa as d,ra as h}from"./chunk-3V4VL3SD.js";import{a as x}from"./chunk-XUUIBSLW.js";import{B as I,C as L,T as v}from"./chunk-47IQIIFX.js";import{i as l}from"./chunk-Q37WAD6F.js";import{Cb as C,Eb as U,Nb as c}from"./chunk-UWI76E2L.js";import{u as O}from"./chunk-UEBUGSBT.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();p();function D(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,o);for(let[r,o]of Object.entries(e.replaceExtensionTemplates??[])){let n=r.split("/")[0];t.append(`replace_extension_templates[${n}][${r}]`,o)}return t.append("_method",e.method),t}function w(){return{"User-Agent":`Shopify CLI; v=${x}`}}function k(e){return delete e.cookie,delete e.authorization,e}p();function S(e){let t={};return e.split(";").forEach(r=>{let o=r.match(/(.*?)=(.*)$/)??[],n=o[1]?.trim(),s=o[2]?.trim()??"";n&&(t[n]=s)}),t}function E(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var y=class extends l{};async function Re(e){return F(e)}async function be(e,t,r){let o=M(t),n=new URLSearchParams;n.append("form_type","storefront_password"),n.append("utf8","\u2713"),n.append("password",e??""),h("theme-service:storefront-session:check-storefront-password");let s={"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded",...r},a=await $(`${o}/password`,{headers:s,body:n.toString(),method:"POST",redirect:"manual"});if(a.status===429)throw d(new l(`Too many incorrect password attempts. Please try again after ${a.headers.get("retry-after")} seconds.`));return B(a,o)}async function j(e,t,r,o,n={}){let s={},a=await G(e,r,n),i=M(t);if(s._shopify_essential=a,h(`theme-service:storefront-session:is-password-protected:${!!o}`),!o)return s;let u=await ee(a,e,i,o,n);return{...s,...u}}async function G(e,t,r,o=1){let n=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),s=`${e}?${n}`;h("theme-service:storefront-session:get-session-essential-cookie");let a={...r,...w()},i=await $(s,{method:"HEAD",redirect:"manual",headers:a}),u=i.headers.raw()["set-cookie"]??[],f=_(u,"_shopify_essential");if(!f){if(c(`Failed to obtain _shopify_essential cookie.
2
-
3
- -Request ID: ${i.headers.get("x-request-id")??"unknown"}
4
-
5
- -Body: ${await i.text()}
6
-
7
- -Status: ${i.status}
8
- `),o>3)throw d(new y('Your development session could not be created because the "_shopify_essential" could not be defined. Please, check your internet connection.'));return c("Retrying to obtain the _shopify_essential cookie..."),await v(o),G(e,t,r,o+1)}return f}async function ee(e,t,r,o,n){let s=new URLSearchParams({password:o}),a={...n,...w(),Cookie:E({_shopify_essential:e})},i=await $(`${t}/password`,{method:"POST",redirect:"manual",body:s,headers:a});if(!B(i,r))throw d(new l("Your development session could not be created because the store password is invalid. Please, retry with a different password."));let u=i.headers.raw()["set-cookie"]??[],f=_(u,"storefront_digest"),m=_(u,"_shopify_essential"),g={};return f&&(g.storefront_digest=f),m&&(g._shopify_essential=m),g}function B(e,t){let r=e.headers.get("location")??"",o;try{o=new URL(r,t)}catch(s){if(s instanceof TypeError)return!1;throw s}let n=new URL(t).origin;return e.status===302&&o.origin===n}function _(e,t){let r=e.find(n=>S(n)[t]);return r?S(r)[t]:void 0}function M(e){return`https://${e}`}p();p();function te(e,t){d(t),t instanceof l?(t.message=`${e}
9
- ${t.message}`,L(t)):(I({headline:e,body:t.message}),c(`${e}
10
- ${t.stack??t.message}`))}function Oe(e,t){let r={delete:`Failed to delete file "${e}" from remote theme.`,upload:`Failed to upload file "${e}" to remote theme.`,default:e}[t??"default"]??e;return o=>{te(r,o)}}function R(e,t){return N({status:e.status??502,statusText:e.statusText??"Bad Gateway",cause:e,data:{url:(t??e.url)?.toString(),requestId:e.headers?.get("x-request-id")??void 0}})}function Ue(e,t="Unexpected error during fetch"){let r=e,o=r.statusCode??502,n=r.statusMessage??"Bad Gateway",s=`${t.replace(/\.$/,"")} with status ${o} (${n}).`;r.data?.requestId&&(s+=`
11
- Request ID: ${r.data.requestId}`),r.data?.url&&(s+=`
12
- URL: ${r.data.url}`);let a=r.cause??e;return{headline:s,body:a.stack??r.stack??r.message??n,status:o,statusText:n,cause:a,requestId:r.data?.requestId,url:r.data?.url}}async function ze(e,t){let r=se(e,t),n={...await re(e,t),...w()},s,a=Object.keys({...t.replaceTemplates,...t.replaceExtensionTemplates});if(a.length>0){c(`\u2192 Rendering ${r} (with ${a})...`);let m=D(t);s=await fetch(r,{method:"POST",body:m,redirect:"manual",headers:n}).catch(g=>{throw R(d(g),r)})}else c(`\u2192 Rendering ${r}...`),s=await fetch(r,{method:t.method,redirect:"manual",headers:n}).catch(m=>{throw R(d(m),r)});let i=s.headers.get("x-request-id");c(`\u2190 ${s.status} (request_id: ${i})`);let f=s.headers.get("Content-Type")?.includes("application/json");return s=new Response(s.body,s),f||s.headers.delete("Content-Type"),s}async function re(e,t){return W(e)?ne(e,t):oe(e,t)}async function oe(e,t){let r=await z(e,t),o=e.storefrontToken;return k({...t.headers,...e.crawlerSignatureHeaders,Authorization:`Bearer ${o}`,Cookie:r})}async function ne(e,t){let r=await z(e,t),o=e.storefrontToken,n={},s=["ACCEPT","CONTENT-TYPE","CONTENT-LENGTH"];for(let[a,i]of Object.entries(t.headers))s.includes(a.toUpperCase())&&(n[a]=i);return k({...n,...ae(e),...e.crawlerSignatureHeaders,Authorization:`Bearer ${o}`,Cookie:r})}function z(e,t){let r=S(t.headers.cookie??t.headers.Cookie??""),o=e.sessionCookies??{};return E({...r,...o})}function se(e,{path:t,sectionId:r,appBlockId:o,query:n}){let a=`${b(e)}${t}`,i=new URLSearchParams({_fd:"0",pb:"0"});for(let[u,f]of n)i.append(u,f);return r?i.append("section_id",r):o&&i.append("app_block_id",o),`${a}?${i}`}function b(e){return W(e)?`https://${O()}/cli/sfr`:`https://${e.storeFqdn}`}function W(e){return e.token.startsWith("shptka_")}function ae(e){return{"X-Shopify-Shop":e.storeFqdn,"X-Shopify-Access-Token":e.token}}p();var A="Shopify CLI",ie=720*60*60,V=["Signature","Signature-Input","Signature-Agent"],X="unstable",ce=`
13
- query StorefrontCrawlerSignatures($first: Int!, $expired: Boolean, $cli: Boolean, $domain: String) {
14
- storefrontCrawlerSignatures(first: $first, expired: $expired, cli: $cli, domain: $domain) {
15
- edges {
16
- node {
17
- id
18
- name
19
- domainHost
20
- signature
21
- signatureInput
22
- signatureAgent
23
- expiresAt
24
- }
25
- }
26
- }
27
- }
28
- `,ue=`
29
- mutation StorefrontCrawlerSignatureGenerate($timeToLive: Int!, $name: String!, $domainHost: String!, $cli: Boolean) {
30
- storefrontCrawlerSignatureGenerate(timeToLive: $timeToLive, name: $name, domainHost: $domainHost, cli: $cli) {
31
- id
32
- signature
33
- signatureInput
34
- signatureAgent
35
- name
36
- expiresAt
37
- domainHost
38
- userErrors {
39
- field
40
- message
41
- code
42
- }
43
- }
44
- }
45
- `;async function Q(e,t=e.storeFqdn){try{let o=(await T(ce,e,{first:1,expired:!1,cli:!0,domain:t},X)).storefrontCrawlerSignatures;if(!o)throw d(new l("Could not fetch Shopify CLI crawler signatures."));let n=o.edges[0]?.node;if(n){h("theme-service:crawler-signature:reused");let u=K(n);return c(`Reusing crawler signature "${A}" for ${n.domainHost} (${Y(u)}).`),u}let a=(await T(ue,e,{timeToLive:ie,name:A,domainHost:t,cli:!0},X)).storefrontCrawlerSignatureGenerate;if(!a)throw d(new l("Could not create a Shopify CLI crawler signature."));if(a.userErrors.length>0){let u=a.userErrors.map(f=>{let m=f.field?.join(".");return m?`${m}: ${f.message}`:f.message}).join(`
46
- `);throw d(new l("Could not create a Shopify CLI crawler signature.",u))}h("theme-service:crawler-signature:created");let i=K(a);return c(`Created crawler signature "${A}" for ${a.domainHost} expiring at ${a.expiresAt} (${Y(i)}).`),i}catch(r){let o=r instanceof Error?r.message:String(r);c(`Could not obtain crawler signature headers; continuing without them. ${o}`);return}}function Y(e){let t=Object.keys(e),r=V.filter(n=>t.some(s=>s.toLowerCase()===n.toLowerCase())),o=V.filter(n=>!r.includes(n));return`present: ${r.join(", ")||"none"}; missing: ${o.join(", ")||"none"}`}function K(e){if(!e.signature||!e.signatureInput||!e.signatureAgent)throw d(new l("The Shopify CLI crawler signature response did not include all required headers."));return{Signature:e.signature,"Signature-Input":e.signatureInput,"Signature-Agent":e.signatureAgent}}p();var de=1800*1e3,J=["layout/theme.liquid","config/settings_schema.json"];async function ct(e,t,r,o,n){let s=await Z(e,t,r,o,n);return s.refresh=async()=>{c("Refreshing theme session...");let a=await Z(e,t,r,o,s.crawlerSignatureHeaders);return h("theme-service:session:refreshed"),Object.assign(s,a),a},setInterval(()=>{s.refresh&&s.refresh().then(()=>c("Refreshed theme session via auto-refresher...")).catch(()=>c("Session could not be refreshed."))},de),s}async function Z(e,t,r,o,n){let s=b(t),a=n??await Q(t),i=await q(t.storeFqdn,r,[],{forceRefresh:!1,noPrompt:!0}),u=await H([],r,{forceRefresh:!1,noPrompt:!0}),f=await fe(s,e,t,u,o,a);return{...i,sessionCookies:f,storefrontToken:u,crawlerSignatureHeaders:a}}async function fe(e,t,r,o,n,s){try{return await j(e,r.storeFqdn,t,n,{"X-Shopify-Shop":r.storeFqdn,"X-Shopify-Access-Token":r.token,Authorization:`Bearer ${o}`,...s})}catch(a){throw a instanceof y&&await pe(t,r),a}}async function pe(e,t){if(c(`Verifying if theme with id ${e} has required files...`),(await P(Number(e),J,t)).length!==J.length)throw d(new l(U`Theme ${C.cyan(e)} is missing required files. Run ${C.cyan(`shopify theme delete -t ${e}`)} to delete it, then try your command again.`.value));c(`Theme with id ${e} has required files.`)}export{w as a,k as b,Re as c,be as d,te as e,Oe as f,R as g,Ue as h,ze as i,re as j,z as k,b as l,Q as m,ct as n,Z as o};
@@ -1,2 +0,0 @@
1
- import{a as c}from"./chunk-7VAKNVFD.js";import{l as m}from"./chunk-Q37WAD6F.js";import{Ib as u,b as e}from"./chunk-UWI76E2L.js";import{b as H}from"./chunk-I3J63RFV.js";import{e as b,g as n}from"./chunk-VKWPEFWQ.js";n();var p=e.object({id:e.string(),summary:e.string().optional(),hidden:e.boolean().default(!1)}),l=e.object({name:e.string(),description:e.string().optional(),hidden:e.boolean().default(!1)}),g=e.object({name:e.string(),description:e.string().optional(),required:e.boolean().default(!1),hidden:e.boolean().default(!1),options:e.array(e.string()).optional(),default:e.unknown().optional()}),h=e.object({name:e.string(),type:e.enum(["boolean","option"]),char:e.string().optional(),summary:e.string().optional(),description:e.string().optional(),env:e.string().optional(),required:e.boolean().default(!1),hidden:e.boolean().default(!1),options:e.array(e.string()).optional(),default:e.unknown().optional(),multiple:e.boolean().optional(),allowNo:e.boolean().optional(),aliases:e.array(e.string()).optional(),dependsOn:e.array(e.string()).optional(),exclusive:e.array(e.string()).optional(),exactlyOne:e.array(e.string()).optional()}),f=p.extend({description:e.string().optional(),aliases:e.array(e.string()),usage:e.union([e.string(),e.array(e.string())]).optional(),examples:e.array(e.union([e.string(),e.object({description:e.string(),command:e.string()})])).optional(),strict:e.boolean().default(!0),args:e.record(g),flags:e.record(h)}),a={commands:e.array(p),topics:e.array(l)},s=c({name:"HelpResult",schema:e.discriminatedUnion("kind",[e.object({kind:e.literal("root"),...a}),e.object({kind:e.literal("topic"),topic:l,...a}),e.object({kind:e.literal("command"),command:f,...a})]),definitions:{HelpCommandSummary:p,HelpTopic:l,HelpArgument:g,HelpFlag:h,HelpCommand:f}});n();var y=b(H(),1);async function k(r,o,i=!1){let t=new d(r,{all:i});if(await t.showHelp(o),!t.result)throw new m("Oclif did not resolve a help subject.");return t.result}var d=class extends y.Help{result;async showCommandHelp(o){let i=t=>this.opts.all===!0||!t.hidden;this.result=s.validate({kind:"command",command:{...o,args:Object.fromEntries(Object.entries(o.args).filter(([,t])=>i(t))),flags:Object.fromEntries(Object.entries(o.flags).filter(([,t])=>i(t)))},...this.listings(o.id)})}async showRootHelp(){this.result=s.validate({kind:"root",...this.listings()})}async showTopicHelp(o){this.result=s.validate({kind:"topic",topic:o,...this.listings(o.name)})}listings(o){let i=t=>o===void 0?this.opts.all===!0||!t.includes(":"):t.startsWith(`${o}:`)&&t.split(":").length===o.split(":").length+1;return{commands:this.sortedCommands.filter(t=>t.id&&i(t.id)).map(t=>({id:t.id,summary:t.summary??t.description?.split(`
2
- `)[0],hidden:t.hidden??!1})),topics:this.sortedTopics.filter(t=>i(t.name))}}};n();function T(r){u(s.encode(r))}export{s as a,k as b,T as c};
@@ -1,5 +0,0 @@
1
- import{a as C}from"./chunk-YBSX53QP.js";import{b as ne,c as re}from"./chunk-YYA5VGDW.js";import{c as ee,d as te}from"./chunk-NCVGCVQ5.js";import{A as M}from"./chunk-GE4MLO3C.js";import{a as Z}from"./chunk-PWS4VFSD.js";import{a as Q}from"./chunk-PO5T44H3.js";import{Ha as X}from"./chunk-UNHT4ZFP.js";import{b as z,c as Y,f as V}from"./chunk-NU5WLZ6Y.js";import{F as K,a as b,d as v,e as l,f as s,g as j,h as H,i as G,l as J,m as q,n as x,t as R}from"./chunk-47IQIIFX.js";import{i as O}from"./chunk-Q37WAD6F.js";import{a as B}from"./chunk-4JGWKUJN.js";import{qa as N}from"./chunk-UWI76E2L.js";import{g as U}from"./chunk-UEBUGSBT.js";import{b as ye}from"./chunk-I3J63RFV.js";import{c as I}from"./chunk-6IDEDOXW.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(v(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,h.useState)([]),[p,m]=(0,h.useState)([a,a]),[y,d]=(0,h.useState)(void 0),{input:E,export:_}=e.payload,[fe,k]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let A=new b;t.signal.addEventListener("abort",()=>{A.abort()});let $=async()=>{let w=await Ee(r,JSON.stringify(E),_);m(g=>[w,g[0]]),k(`Watching for changes to ${e.source}...`),f(g=>[...g,w])},de=async()=>{k("Replaying log with local function..."),await $()},ge=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==ee.Updated)){if(F.buildResult?.status==="error"){d(`Error while reloading and building extension: ${F.buildResult?.error}`);return}d(void 0),k("Re-running with latest changes..."),await $()}});let w=new oe({write(g,F,L){f(he=>[...he,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:w,stderr:w,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[E,_,o,r]),R(t.signal,async()=>{setTimeout(()=>{U()||B(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:y}}async function Ee(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await C({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(v(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=R(t.signal),{isRawModeSupported:a}=H(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:y}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return G((d,E)=>{q(d,E,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,E)=>n.default.createElement(l,{key:`replayOutputScrollerLog${E}`,flexDirection:"column"},n.default.createElement(Re,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",p)),n.default.createElement(be,{recentFunctionRuns:m}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
2
-
3
- `,r,e,r,`
4
- `)}function we({input:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,M(e)))}function Fe({logs:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function xe({output:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,M(e)))}function Se({functionRun:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Benchmark Results",backgroundColor:"green"}),n.default.createElement(s,null,"Name: ",e.name),n.default.createElement(s,null,"Linear Memory Usage: ",e.memory_usage,"KB"),n.default.createElement(s,null,"Instructions: ",e.instructions/1e3,"K"),n.default.createElement(s,null,"Size: ",e.size,"KB"))}function be({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(s,null,x.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Re({log:e}){switch(e.type){case"functionRun":return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(we,{input:e.input}),n.default.createElement(Fe,{logs:e.logs}),n.default.createElement(xe,{output:e.output}),n.default.createElement(Se,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var se=S(v(),1);async function ce({selectedRun:e,abortController:t,app:o,extension:r}){return J(se.default.createElement(ae,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function le(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await K({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as Ce,readdirSync as De}from"fs";var T=100;async function ue(e){let{watch:t,extension:o,app:r}=e,i=new b;try{let a=r.getLogsDir(),u=e.log?await ke(a,o.handle,e.log):await Le(a,o.handle),{input:f,export:p}=u.payload;t?await ce({selectedRun:u,abortController:i,app:r,extension:o}):await C({functionExtension:o,json:e.json,input:JSON.stringify(f),export:p})}catch(a){throw i.abort(),a}}async function ke(e,t,o){let r=await Ae(e,t,o);if(r===void 0)throw new O(`No log found for '${o}'.
5
- Searched ${e} for function ${t}.`);let i=await N(r);return JSON.parse(i)}function me(e){let t=e.split(/[_.]/);if(!(t.length<6))return{namespace:t[3],functionHandle:t[4],identifier:t[5]}}async function Ae(e,t,o){let r=pe(e).find(i=>{let a=me(i);return a?.namespace==="extensions"&&a?.functionHandle===t&&a?.identifier===o});return r?I(e,r):void 0}async function Le(e,t){let o=await Ie(e,t),r=await le(o);if(r===void 0)throw new O(`No logs found in ${e}`);return r}async function Ie(e,t){let o=pe(e).filter(i=>{let a=me(i);return a?.namespace==="extensions"&&a?.functionHandle===t}).reverse(),r=[];for(let i=0;i<o.length&&r.length<T;i+=T){let u=o.slice(i,i+T).map(m=>I(e,m)),p=(await Promise.all(u.map(async m=>{let y=await N(m);return{...JSON.parse(y),identifier:Ne(m)}}))).filter(m=>m.payload.input!=null);r=r.concat(p)}return r}function Ne(e){return e.split("_").pop().substring(0,6)}function pe(e){return Ce(e)?De(e):[]}var P=S(ye(),1),W=class e extends Z{static get requiresSyncAnalytics(){return!0}static summary="Replays a function run from an app log.";static descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";static description=this.descriptionForHelp();static flags={...z,...Q,...ne,...Y,log:V(P.Flags.string({char:"l",description:"Specifies a log identifier to replay instead of selecting from a list. The identifier is provided in the output of `shopify app dev` and is the suffix of the log file name.",env:"SHOPIFY_FLAG_LOG"})),watch:P.Flags.boolean({char:"w",hidden:!1,allowNo:!0,default:!0,description:"Re-run the function when the source code changes.",env:"SHOPIFY_FLAG_WATCH"})};async run(){let{flags:t}=await this.parse(e),{app:o}=await X({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),r=await re(o,t.path);return await ue({app:o,extension:r,path:t.path,log:t.log,json:t.json,watch:t.watch}),{app:o}}};export{W as a};
@@ -1,12 +0,0 @@
1
- import{a as E}from"./chunk-5BGUKF7L.js";import{a as u,b as U,c as W}from"./chunk-HB3MJYBK.js";import{a as M}from"./chunk-GSE6FXZU.js";import{b as P}from"./chunk-HJHS23Q3.js";import{D as T,F as j,I as B,L as O,a as D,d as g,k as d,l as x,m as p,n as I,o as b,q as L,t as N}from"./chunk-EO4YJFMY.js";import{b as F}from"./chunk-NU5WLZ6Y.js";import{b as R}from"./chunk-4ZNBEMRT.js";import{A as C,B as A,y as S,z as $}from"./chunk-47IQIIFX.js";import{i as _}from"./chunk-Q37WAD6F.js";import{ka as w}from"./chunk-UWI76E2L.js";import{b as te}from"./chunk-I3J63RFV.js";import{e as ee,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var Y={high:"High",medium:"Medium",low:"Low"},ne={executed:"passed",not_applicable:"not applicable",unresolved:"unresolved"},se={executed:"executed",not_applicable:"not applicable",unresolved:"unresolved"},f=["deterministic","agent"],ie={deterministic:"deterministic-findings.json",agent:"agent-findings.json"},H=3,oe="Agent findings were recorded for a different scope than the latest scan.",q="agent result stale",re="The agent result is older than the deterministic result, so both are shown.",ce={info:S,success:$,warning:C,error:A};function J(e){for(let t of ue(e))ce[t.type](t.options)}function ue(e){let{checks:t}=e.result,n=t.filter(i=>i.status==="unresolved"&&d(i).length===0),s=t.filter(i=>i.status!=="unresolved"&&d(i).length===0),o=t.filter(i=>d(i).length>0);return[...n.length>0?[Se(n,e.verbose)]:[],...s.length>0?[$e(s,e.verbose)]:[],...o.map(i=>Ae(i,e.verbose,e.now)),ve(de(e))]}function de(e){let{result:t}=e,n=t.sources.deterministic!==null||t.sources.agent!==null,s=b(t.checks),o=t.sources.deterministic?.document,i=t.blocking.blockedChecks>0,r=t.checks.filter(p).length;return{type:le(t.checks,s,n),headline:pe(t.checks,s,n),...t.filter&&n?{filterLine:`Showing ${t.checks.length} of ${t.allChecks.length} checks (--check-id).`}:{},checksWithFindings:t.checks.filter(c=>d(c).length>0).map(fe),otherChecks:ge(s),...r>0?{staleAgentResults:ae(r)}:{},...o?{coverage:be(o)}:{},scopeLines:me(t.sources),...t.scopeDiffers?{scopeNote:oe}:{},resultsFiles:{directory:t.resultsDirectory,rows:f.map(c=>ye(c,t.sources[c]?.document,e.now))},...i?{blocking:`${u(t.blocking.blockedChecks,"check")} at or above ${t.blocking.level} (--blocking ${t.blocking.level}).`}:{nextSteps:ke(t,s,n,r,e.commands)}}}function ae(e){let t=e===1?"shows":"show";return`${u(e,"check")} ${t} both sources because the agent results are older than the deterministic results.`}function le(e,t,n){return n?e.some(s=>s.severity==="high"&&d(s).length>0)?"error":t.withFindings>0||t.unresolved>0?"warning":"success":"info"}function pe(e,t,n){if(!n)return"No app security check results to review.";if(t.withFindings===0)return`No findings in ${u(e.length,"check")}.`;let s=t.unresolved>0?` ${u(t.unresolved,"check")} unresolved.`:"";return`${U(t)}.${s}`}function fe(e){return{severity:Y[e.severity],id:e.id,counts:he(e)}}function he(e){let t=d(e);return f.map(n=>[n,t.filter(s=>s.source===n).length]).filter(([,n])=>n>0).map(([n,s])=>`${s} ${n}`).join(", ")}function ge(e){return[h(W(e)),V(e)].filter(t=>t!=="")}function V(e){return h([e.suppressed>0?`${u(e.suppressed,"finding")} suppressed`:void 0,e.superseded>0?`${u(e.superseded,"finding")} superseded`:void 0])}function m(e){return V(b([e]))}function h(e){return e.filter(t=>t!==void 0).join(" \xB7 ")}function be(e){let t=e.coverage.files_skipped,{too_large:n,unreadable:s}=L(t),o=[n>0?`${n} too large`:void 0,s>0?`${s} unreadable`:void 0].filter(a=>a!==void 0),i=t.length===0?"none skipped":`${t.length} skipped (${o.join(", ")})`,r=e.detection.languages.filter(a=>a.support==="unsupported"),c=r.length===0?"":` Unsupported ${r.length===1?"language":"languages"}: ${r.map(a=>`${a.name} (${u(a.files.length,"file")})`).join(", ")}.`;return`Deterministic coverage: ${u(e.coverage.files_scanned,"file")} scanned, ${i}.${c}`}function K(e){let t=[...e.include_dirs.map(n=>`--include-dir ${n}`),...e.excludes.map(n=>`--exclude ${n}`),...e.no_git_ignore?["--no-git-ignore"]:[]];return t.length===0?"none":t.join(" ")}function me({deterministic:e,agent:t}){return[...e?[`Scan directories: ${e.document.coverage.scan_directories.map(({directory:n})=>n).join(", ")}`,`Scan scope: ${K(e.document.coverage.scope)}`]:[],...t?[`Scope reported by the agent: ${K(t.document.scope)}`]:[]]}function ye(e,t,n){let s=ie[e];return t?{name:s,updated:z(t.generated_at,n),engine:t.engine.version}:{name:s,updated:"not found"}}function z(e,t){let n=Date.parse(e);return Number.isNaN(n)?"unknown":w(new Date(n),t)}function ke(e,t,n,s,o){let i={command:O(o.scan)};if(!n)return[["Run",i,"or have your coding agent run it."]];let r=[];if(t.withFindings>0){let c=["Fix the issues, then run",i,"again."];e.sources.agent===null?r.push(c,"For a deeper review, have your agent run the same command and record its findings."):s>0?r.push(c):r.push([...c,"To refresh agent findings, have your agent run the command and record its findings."])}return s>0?r.push(["Agent results are older than the deterministic results. Have your coding agent run",i,"and record its findings again to refresh them."]):t.withFindings===0&&e.sources.agent===null&&r.push(["For a deeper review, have your coding agent run",i,{char:"."}]),r}function ve(e){let t=[];return e.filterLine&&t.push({body:{subdued:e.filterLine}}),e.checksWithFindings.length>0&&t.push({title:"Checks with findings",body:{tabularData:e.checksWithFindings.map(n=>[n.severity,n.id,n.counts]),firstColumnSubdued:!0}}),e.otherChecks.length>0&&t.push({title:"Other checks",body:e.otherChecks.join(`
2
- `)}),e.staleAgentResults&&t.push({body:e.staleAgentResults}),e.coverage&&t.push({body:{subdued:e.coverage}}),e.scopeLines.length>0&&t.push({body:{subdued:e.scopeLines.join(`
3
- `)}}),e.scopeNote&&t.push({body:e.scopeNote}),t.push({title:`Results files in ${e.resultsFiles.directory}`,body:{tabularData:[["",{subdued:"Updated"},{subdued:"Engine"}],...e.resultsFiles.rows.map(we)]}}),e.blocking===void 0?e.nextSteps.length>0&&t.push({title:"Next steps",body:{list:{items:e.nextSteps}}}):t.push({title:"Blocking",body:e.blocking}),{type:e.type,options:{headline:e.headline,customSections:t}}}function we(e){return e.engine===void 0?[e.name,{subdued:e.updated}]:[e.name,e.updated,e.engine]}function Se(e,t){return{type:"warning",options:{headline:`${u(e.length,"check")} unresolved.`,customSections:e.flatMap(n=>[{title:`${n.id} \xB7 ${n.title}`,body:{tabularData:X(n,{withDispositions:!0}),firstColumnSubdued:!0}},...t?n.findings.map(s=>y(s,t,`${n.id} \xB7 `)):[]])}}}function $e(e,t){let n=e.filter(x).length,s=e.length-n;return{type:"info",options:{headline:[n>0?`${u(n,"check")} passed.`:void 0,s>0?`${u(s,"check")} not applicable.`:void 0].filter(i=>i!==void 0).join(" "),customSections:[{body:{tabularData:e.map(Ce)}},...t?e.flatMap(i=>i.findings.map(r=>y(r,t,`${i.id} \xB7 `))):[]]}}}function Ce(e){let t=m(e);return[e.id,h([ne[e.status],t===""?void 0:t,p(e)?q:void 0])]}function Ae(e,t,n){let s=m(e),o=t?e.findings:d(e);return{type:e.severity==="high"?"error":"warning",options:{headline:`${Y[e.severity]} \xB7 ${e.id} \xB7 ${e.title}`,...s===""?{}:{body:{subdued:s}},...e.docs_url?{link:{label:`${e.id} on shopify.dev`,url:e.docs_url}}:{},customSections:[..._e(e,n),...o.map(i=>y(i,t))]}}}function _e(e,t){if(p(e))return[{body:{tabularData:f.flatMap(r=>{let c=e.by_source[r];return c?[[r,Q(c),z(c.generated_at,t)]]:[]}),firstColumnSubdued:!0}},{body:{subdued:re}}];let{deterministic:n,agent:s}=e.by_source;return n!==null&&s!==null&&n.status!==s.status?[{body:{tabularData:X(e,{withDispositions:!1}),firstColumnSubdued:!0}}]:[]}function X(e,t){let n=p(e),s=f.flatMap(i=>{let r=e.by_source[i];if(!r)return[];let c=n&&i==="agent"?q:void 0;return[[i,h([Q(r),c])]]}),o=t.withDispositions?m(e):"";return o===""?s:[...s,["findings",o]]}function Q(e){let t=se[e.status];return e.reason?`${t} \u2014 ${e.reason.message}`:t}function y(e,t,n=""){let s=e.disposition==="active"?"":` (${e.disposition})`,o=[e.message];if(e.snippet&&o.push({subdued:`
4
- Code: ${e.snippet}`}),e.source==="deterministic"){e.fix&&o.push({subdued:`
5
- Fix: ${e.fix.description}`});let i=e.fix?.guide;i&&o.push({subdued:`
6
- Guide: ${i}`})}else e.confidence&&o.push({subdued:`
7
- Confidence: ${e.confidence}`}),e.reasoning&&o.push({subdued:`
8
- Reasoning: ${t?e.reasoning:Re(e.reasoning)}`});return t&&(o.push(...e.evidence.map(i=>({subdued:`
9
- Evidence: ${G(i.location)}${i.quote?` \u2014 ${i.quote}`:""}`}))),I(e,e.source)&&e.suppression&&o.push({subdued:`
10
- Suppressed: ${e.suppression.justification}`})),{title:`${n}${e.source} \xB7 ${G(e.location)}${s}`,body:o}}function Re(e){let t=e.split(`
11
- `);return t.length<=H?e:`${t.slice(0,H).join(`
12
- `)}\u2026`}function G(e){return e.line===void 0?e.file:`${e.file}:${e.line}`}var Fe={resolveSelection:j,loadResults:P,render:J,now:()=>new Date,setExitCode:e=>{process.exitCode=e},recordMetadata:M};function Ee(e){return e.blocking.blockedChecks>0}function De(e,t){let n=t.checkIds.length>0?{checkIds:t.checkIds}:null,s=e.sources.deterministic!==null||e.sources.agent!==null;n&&s&&Le(n.checkIds,e.checks);let o=n?e.checks.filter(i=>n.checkIds.includes(i.id)):e.checks;return{resultsDirectory:t.resultsDirectory,sources:e.sources,allChecks:e.checks,checks:o,filter:n,scopeDiffers:xe(e.sources),blocking:{level:t.blocking,blockedChecks:Ie(o,t.blocking)}}}function xe({deterministic:e,agent:t}){return!e||!t?!1:JSON.stringify(e.document.coverage.scope)!==JSON.stringify(t.document.scope)}function Ie(e,t){return t==="none"?0:e.filter(n=>d(n).length>0&&g[n.severity]>=g[t]).length}function Le(e,t){let n=new Set(t.map(i=>i.id)),s=e.filter(i=>!n.has(i));if(s.length===0)return;let o=s.length===1?"check ID":"check IDs";throw new _(`Unknown ${o}: ${s.join(", ")}.`,"Pass --check-id with one of the checks in the results files.",[],[{title:"Available check IDs",body:{list:{items:t.map(i=>i.id)}}}])}async function k(e,t=Fe){let n=await t.resolveSelection({path:e.directory,config:e.configName,clientId:e.clientId,withoutAppConfig:e.withoutAppConfig,allowPrompts:!1,validateClientIdFlag:!0}),s=await t.loadResults(n,e.directory),o=De(s,{resultsDirectory:N(n.appDirectory,T(n)).resultsDirectory,checkIds:e.checkIds,blocking:e.blocking});if(o.sources.deterministic!==null||o.sources.agent!==null){let i=o.allChecks.reduce((r,c)=>r+d(c).length,0);await t.recordMetadata({num_security_findings:i})}t.render({result:o,verbose:e.verbose,now:t.now(),commands:B(n,e.directory,s.sources.deterministic?.document.coverage.scope)}),Ee(o)&&t.setExitCode(1)}var Z=ee(te(),1);var v=class e extends R{static summary="Show the combined app security check results.";static descriptionWithMarkdown="Combines the deterministic results (`deterministic-findings.json`, written by `shopify app security check`) with the recorded agent results (`agent-findings.json`, written by `shopify app security record`) and shows one view of every check: its findings, status and source. Both files are in the results directory, `.shopify/app-security/<results key>/`. `--client-id` is checked against your Shopify account before any results are read, so it needs you to be logged in.\n\nThe summary shows the scan directories and the scope of the latest scan, and the scope the agent reported. It notes when the agent findings were recorded for a different scope than the latest scan; that doesn't change the exit code.\n\nThe agent results are optional. Use `--check-id` to narrow the review to specific checks, `--verbose` for full reasoning, evidence and suppressed findings, and `--blocking` to exit with code 1 when a check with findings is at or above a severity.\n\nReports the number of findings to Shopify as usage telemetry, but not finding details. See [usage reporting](https://shopify.dev/docs/api/shopify-cli#usage-reporting) for details.";static description=this.descriptionForHelp();static flags={...F,...D,"check-id":Z.Flags.string({description:"Show only this check. Repeat the flag to show several checks.",env:"SHOPIFY_FLAG_CHECK_ID",multiple:!0}),...E};async run(){let{flags:t}=await this.parse(e);await k({directory:t.path,configName:t.config,clientId:t["client-id"],withoutAppConfig:!!t["without-app-config"],verbose:!!t.verbose,checkIds:t["check-id"]??[],blocking:t.blocking})}};export{v as a};
@@ -1,4 +0,0 @@
1
- import{a as d}from"./chunk-PWS4VFSD.js";import{a as f}from"./chunk-PO5T44H3.js";import{Da as c,Ha as s}from"./chunk-UNHT4ZFP.js";import{b as r,f as a}from"./chunk-NU5WLZ6Y.js";import{i as n}from"./chunk-Q37WAD6F.js";import{b as u}from"./chunk-I3J63RFV.js";import{e as h,g as t}from"./chunk-VKWPEFWQ.js";t();var i=h(u(),1);var o=class l extends d{static summary="Fetch your app configuration from the Developer Dashboard.";static descriptionWithMarkdown=`Pulls app configuration from the Developer Dashboard and creates or overwrites a configuration file. You can create a new app with this command to start with a default configuration file.
2
-
3
- For more information on the format of the created TOML configuration file, refer to the [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration) page.
4
- `;static description=this.descriptionForHelp();static flags={...r,...f,config:i.Flags.string({hidden:!1,char:"c",description:"The name of the local app configuration to read and overwrite. Use --file-name instead when specifying --client-id.",env:"SHOPIFY_FLAG_APP_CONFIG"}),"organization-id":i.Flags.string({hidden:!0,env:"SHOPIFY_FLAG_ORGANIZATION_ID",exclusive:["client-id"]}),"client-id":a(i.Flags.string({hidden:!1,description:"The Client ID of the remote app to link. Use --file-name to specify the destination configuration file.",env:"SHOPIFY_FLAG_CLIENT_ID"})),"file-name":i.Flags.string({hidden:!1,description:"The name of the app configuration file to create or overwrite. Requires --force to overwrite an existing file.",env:"SHOPIFY_FLAG_APP_CONFIG_FILE_NAME",exclusive:["config"]}),force:i.Flags.boolean({hidden:!1,description:"Overwrite an existing configuration file without prompting.",env:"SHOPIFY_FLAG_FORCE",dependsOn:["file-name"]})};async run(){let{flags:e}=await this.parse(l);if(e.config!==void 0&&e["client-id"]!==void 0)throw new n("The --config and --client-id flags can't be used together.","Use --file-name instead of --config to choose the configuration file to create or overwrite.");let p={directory:e.path,apiKey:e["client-id"],organizationId:e["organization-id"],configName:e.config,fileName:e["file-name"],force:e.force??!1},g=await c(p),{app:m}=await s({directory:e.path,clientId:void 0,forceRelink:!1,userProvidedConfigName:g.configFileName});return{app:m}}};export{o as a};
@@ -1,6 +0,0 @@
1
- import{a as U}from"./chunk-NYYXH2SX.js";import{K as H}from"./chunk-UNHT4ZFP.js";import{a as q}from"./chunk-VJEKDBGZ.js";import{q as I}from"./chunk-Y743UVBS.js";import{a as O,o as D,w as k}from"./chunk-47IQIIFX.js";import{i as N}from"./chunk-Q37WAD6F.js";import{Aa as g,Ga as F,Nb as h,Xa as A,Ya as P,fb as y,ra as R}from"./chunk-UWI76E2L.js";import{g as S}from"./chunk-UEBUGSBT.js";import{c as x,d as E,f as v,h as C}from"./chunk-6IDEDOXW.js";import{e as X,g as m}from"./chunk-VKWPEFWQ.js";m();function w(){return process.hrtime()}function M(r){let t=process.hrtime(r);return(t[0]*1e3+t[1]/1e6).toFixed(2)}m();m();var $=X(q(),1),G=200,K=6e4,L=200,Q=500,_=class{currentEvents=[];extensionPaths=[];app;options;onChangeCallback;watcher;debouncedEmit;ignored={};extensionWatchedFiles=new Map;constructor(t,e,s=G){this.app=t,this.options=e,this.debouncedEmit=k(this.emitEvents.bind(this),s,{leading:!0,trailing:!0}),this.updateApp(t)}onChange(t){this.onChangeCallback=t}async start(){let e=[...this.app.configuration.extension_directories??["extensions"]].map(n=>x(this.app.directory,n));await Promise.all(e.map(async n=>{try{await g(n.replace(/\/\*+$/,""))}catch{}}));let s=[this.app.configPath,...e],i=this.getAllWatchedFiles();s.push(...i),this.close();let{default:o}=await import("./chokidar-5RWEYTNQ.js");this.watcher=o.watch(s,{ignored:["**/node_modules/**","**/.git/**"],persistent:!0,ignoreInitial:!0}),this.watcher.on("all",this.handleFileEvent),this.addAbortListener(),h(`File watcher started with ${s.length} paths`,this.options.stdout)}updateApp(t){this.app=t,this.extensionPaths=this.app.nonConfigExtensions.map(e=>E(e.directory)).filter(e=>e!==this.app.directory),this.extensionPaths.forEach(e=>{this.ignored[e]??=this.createIgnoreInstance(e)})}addAbortListener(){this.options.signal.removeEventListener("abort",this.close),this.options.signal.addEventListener("abort",this.close)}getAllWatchedFiles(){this.extensionWatchedFiles.clear();let t=this.app.realExtensions.map(s=>({extension:s,watchedFiles:s.watchedFiles()})),e=new Set;for(let{extension:s,watchedFiles:i}of t)for(let o of i){let n=E(o);e.add(n);let a=this.extensionWatchedFiles.get(n)??new Set;a.add(s.handle),this.extensionWatchedFiles.set(n,a)}return Array.from(e)}emitEvents=()=>{let t=this.currentEvents;this.currentEvents=[];let e=`\u{1F509} ${t.length} EVENTS EMITTED in files: ${t.map(s=>s.path).join(`
2
- `)}`;h(e,this.options.stdout),this.onChangeCallback?.(t)};pushEvent(t){this.shouldIgnoreEvent(t)||(t.type==="extension_folder_created"&&(this.ignored[t.path]=this.createIgnoreInstance(t.path)),!this.currentEvents.some(e=>e.path===t.path&&e.type===t.type&&e.extensionHandle===t.extensionHandle)&&this.currentEvents.push(t))}shouldIgnoreEvent(t){if(t.type==="extension_folder_deleted"||t.type==="extension_folder_created"||t.extensionHandle&&this.extensionWatchedFiles.get(E(t.path))?.has(t.extensionHandle))return!1;let s=(t.extensionHandle?this.app.realExtensions.find(o=>o.handle===t.extensionHandle):void 0)?.watchedFiles(),i=this.ignored[t.extensionPath];if(s)return!s.some(n=>y(t.path,n));if(i){let o=v(t.extensionPath,t.path);return i.ignores(o)}return!1}handleFileEvent=(t,e)=>{let s=w(),i=E(e),o=e===this.app.configPath,n=e.endsWith(".extension.toml");if(h(`\u{1F300}: ${t} ${e.replace(this.app.directory,"")}
3
- `),o)this.handleEventForExtension(t,e,this.app.directory,s,!1);else{let a=this.extensionWatchedFiles.get(i),d=a===void 0||a.size===0;if(d&&t==="add"&&!n){let c=this.discoverFileOwners(i);c.size>0&&(this.extensionWatchedFiles.set(i,c),a=c,d=!1)}if(d&&!n&&!o){h(`\u{1F300}: File ${e} is not watched by any extension`,this.options.stdout);return}for(let c of a??[]){let l=this.app.realExtensions.find(f=>f.handle===c),u=l?E(l.directory):this.app.directory;this.handleEventForExtension(t,e,u,s,!1,c)}d&&this.handleEventForExtension(t,e,this.app.directory,s,!0)}this.debouncedEmit()};discoverFileOwners(t){let e=new Set;for(let s of this.app.realExtensions){let i=E(s.directory);i!==this.app.directory&&t.startsWith(`${i}/`)&&this.pathMatchesWatchPatterns(t,s)&&e.add(s.handle)}return e}pathMatchesWatchPatterns(t,e){let{paths:s,ignore:i}=e.watchPatterns(),o=v(E(e.directory),t);return i.some(n=>y(o,n))?!1:s.some(n=>y(o,n))}handleEventForExtension(t,e,s,i,o,n){let a=e.endsWith(".extension.toml"),d=e===this.app.configPath;switch(t){case"change":if(o)break;a||d?this.pushEvent({type:"extensions_config_updated",path:e,extensionPath:s,extensionHandle:n,startTime:i}):this.pushEvent({type:"file_updated",path:e,extensionPath:s,extensionHandle:n,startTime:i});break;case"add":if(!a){this.pushEvent({type:"file_created",path:e,extensionPath:s,extensionHandle:n,startTime:i});break}let c=0,l=C(e),u=setInterval(()=>{P(x(l,I.lockFile))?(h(`Waiting for extension to complete creation: ${e}
4
- `),c+=L):(clearInterval(u),this.extensionPaths.push(l),this.pushEvent({type:"extension_folder_created",path:l,extensionPath:s,startTime:i}),this.debouncedEmit()),c>=K&&(clearInterval(u),this.options.stderr.write(`Error loading new extension at path: ${e}.
5
- Please restart the process.`))},L);break;case"unlink":if(e.endsWith(I.lockFile))break;d?this.pushEvent({type:"app_config_deleted",path:e,extensionPath:s,startTime:i}):a?(this.extensionPaths=this.extensionPaths.filter(f=>f!==s),this.pushEvent({type:"extension_folder_deleted",path:s,extensionPath:s,startTime:i})):setTimeout(()=>{this.extensionPaths.includes(s)&&(this.pushEvent({type:"file_deleted",path:e,extensionPath:s,extensionHandle:n,startTime:i}),this.extensionWatchedFiles.delete(E(e)),this.debouncedEmit())},Q);break;case"addDir":case"unlinkDir":break}}close=()=>{this.watcher&&(h("Closing file watcher",this.options.stdout),this.watcher.close().then(()=>h("File watching closed",this.options.stdout)).catch(t=>h(`File watching failed to close: ${t.message}`,this.options.stderr)))};createIgnoreInstance(t){let e=x(t,".gitignore");if(!P(e))return;let s=R(e).toString().split(`
6
- `).map(i=>i.trim()).filter(i=>i!==""&&!i.startsWith("#"));return $.default.default().add(s)}};m();m();function B(r,t,e=!0){let s=r.realExtensions,i=s.map(l=>l.uid),o=t.realExtensions,n=o.map(l=>l.uid),a=o.filter(l=>!i.includes(l.uid)),d=s.filter(l=>!n.includes(l.uid)),c;return e&&(c=o.filter(l=>{let u=s.find(b=>b.uid===l.uid);if(!u)return!1;let f=JSON.stringify(u.configuration)!==JSON.stringify(l.configuration),W=u.configurationPath!==l.configurationPath;return f||W})),{created:a,updated:c??[],deleted:d}}async function V(r,t,e){if(r[0]===void 0)return;let s=r.some(n=>j.includes(n.type)),i=r.filter(n=>!j.includes(n.type));if(s)return et({event:r[0],app:t,options:e,extensions:[]});let o={app:t,extensionEvents:[],path:r[0].path,startTime:r[0].startTime};for(let n of i){let a=n.extensionHandle?t.realExtensions.filter(c=>c.handle===n.extensionHandle):t.realExtensions.filter(c=>c.directory===n.extensionPath),d=Y[n.type]({event:n,app:o.app,extensions:a,options:e});o.extensionEvents.push(...d.extensionEvents)}return o}var j=["extensions_config_updated","extension_folder_created"],Y={extension_folder_deleted:Z,file_created:T,file_deleted:T,file_updated:T,app_config_deleted:tt,extension_folder_created:z,extensions_config_updated:z};function Z({event:r,app:t,extensions:e}){let s=e.map(i=>(t.removeExtension(i.uid),{type:p.Deleted,extension:i}));return{app:t,extensionEvents:s,startTime:r.startTime,path:r.path}}function T({event:r,app:t,extensions:e}){let s=e.map(i=>({type:p.Updated,extension:i}));return{app:t,extensionEvents:s,startTime:r.startTime,path:r.path}}function z(r){return{app:r.app,extensionEvents:[],startTime:r.event.startTime,path:r.event.path}}function tt(r){throw new N("The active app.toml was deleted, exiting")}async function et({event:r,app:t}){let e=await st(t),s=B(t,e,!0),i=s.created.map(d=>({type:p.Created,extension:d})),o=s.deleted.map(d=>({type:p.Deleted,extension:d})),n=s.updated.map(d=>({type:p.Updated,extension:d})),a=[...i,...o,...n];return{app:e,extensionEvents:a,startTime:r.startTime,path:r.path,appWasReloaded:!0}}async function st(r){let t=w();try{let e=await H(r);return h(`App reloaded [${M(t)}ms]`),e}catch(e){let s=new Error(`Error reloading app: ${e.message}`);throw s.cause="validation-error",s}}import{formatMessagesSync as it}from"esbuild";import nt from"events";var p;(function(r){r.Updated="changed",r.Deleted="deleted",r.Created="created"})(p||(p={}));var J=class extends nt{buildOutputPath;app;options;appURL;started=!1;ready=!1;initialEvents=[];fileWatcher;constructor(t,e,s,i){super(),this.app=t,this.appURL=e,this.buildOutputPath=s??x(t.directory,".shopify","dev-bundle"),this.options={stdout:process.stdout,stderr:process.stderr,signal:new O().signal},this.fileWatcher=i}async start(t,e=!0){this.started||(this.started=!0,this.options=t??this.options,await A(this.buildOutputPath)&&await F(this.buildOutputPath,{force:!0}),await g(this.buildOutputPath),e&&(this.initialEvents=this.app.realExtensions.map(s=>({type:p.Updated,extension:s})),await this.buildExtensions(this.initialEvents)),this.fileWatcher=this.fileWatcher??new _(this.app,this.options),this.fileWatcher.onChange(s=>{V(s,this.app,this.options).then(async i=>{if(i?.extensionEvents.length===0&&h("Change detected, but no extensions were affected"),!i)return;this.app=i.app,i.appWasReloaded&&this.fileWatcher?.updateApp(this.app),await this.rescanImports(i);let o=i.extensionEvents.filter(n=>n.type!==p.Deleted);await this.buildExtensions(o),i.appWasReloaded||await this.app.generateExtensionTypes(),await this.deleteExtensionsBuildOutput(i),this.emit("all",i)}).catch(i=>{this.emit("error",i)})}),await this.fileWatcher.start(),this.ready=!0,this.emit("ready",{app:this.app,extensionEvents:this.initialEvents}))}onEvent(t){return this.addListener("all",t),this}onStart(t){if(this.ready){let e={app:this.app,extensionEvents:this.initialEvents,startTime:[0,0],path:""};t(e)?.catch(()=>{})}else this.once("ready",t);return this}onError(t){return this.addListener("error",t),this}async deleteExtensionsBuildOutput(t){let s=t.extensionEvents.filter(i=>i.type===p.Deleted).map(i=>i.extension).map(async i=>{let o=x(this.buildOutputPath,i.getOutputFolderId());return F(o,{force:!0})});await Promise.all(s)}async buildExtensions(t){let e=U(t,o=>o.extension.uid),s=[];for(let o of Object.values(e))o.length>0&&o[0]&&s.push({extension:o[0].extension,events:o});let i=s.map(async({extension:o,events:n})=>D({outputPrefix:o.handle,stripAnsi:!1},async()=>{try{await this.buildExtension(o);let a={status:"ok",uid:o.uid};n.forEach(d=>{d.buildResult=a})}catch(a){let d=a.errors??[],c=a.message,l;if(d.length){let f=d[0];c=f?.text,l=f?.location?.file,it(d,{kind:"error",color:!S()}).forEach(b=>{this.options.stderr.write(b)})}else this.options.stderr.write(a.message);let u={status:"error",error:c,file:l,uid:o.uid};n.forEach(f=>{f.buildResult=u})}}));return Promise.all(i)}async buildExtension(t){let e={app:this.app,stdout:this.options.stdout,stderr:this.options.stderr,useTasks:!1,environment:"development",appURL:this.appURL};await t.buildForBundle(e,this.buildOutputPath)}async rescanImports(t){if(t.path.endsWith(".toml"))return;let s=t.extensionEvents.filter(i=>i.type!==p.Deleted).map(i=>i.extension);s.length>0&&(await Promise.all(s.map(async n=>n.rescanImports()))).some(n=>n)&&await this.fileWatcher?.start()}};export{w as a,M as b,p as c,J as d};
@@ -1,25 +0,0 @@
1
- import{a as A,b as S,c as E,d as i,e as k,f as F,g as L,h as H,i as _}from"./chunk-FQL2WEKX.js";import{a as I}from"./chunk-PWS4VFSD.js";import{a as b}from"./chunk-PO5T44H3.js";import{Ha as T,ia as P}from"./chunk-UNHT4ZFP.js";import{f as l}from"./chunk-NU5WLZ6Y.js";import{D as p,F as g,J as v}from"./chunk-47IQIIFX.js";import{Lb as h,Ob as m,Qb as w}from"./chunk-UWI76E2L.js";import{b as G}from"./chunk-I3J63RFV.js";import{i as y}from"./chunk-6IDEDOXW.js";import{e as q,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();a();async function M(e,t,r){let o={api_version:t},{webhookTopics:s}=await e.topics(o,r);return s}a();async function V(e){let t=e.map(o=>({label:o,value:o}));return await g({message:"Webhook Topic",choices:t})}async function C(e){return p({message:"Webhook ApiVersion",choices:e.map(t=>({label:t,value:t}))})}async function R(){return p({message:"Delivery method",choices:[{label:"HTTP",value:i.HTTP},{label:"Google Pub/Sub",value:i.PUBSUB},{label:"Amazon EventBridge",value:i.EVENTBRIDGE}]})}async function D(e){return(await v({message:"Address for delivery",validate:r=>{let o=r.trim();if(o.length===0)return"Address can't be empty";if(!k(o,e))return`Invalid address.
2
- ${d(e)}`}})).trim()}function U(e){return e===i.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:e===i.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:e===i.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function d(e){return U(e).map(t=>` \xB7 ${w(t)}`).join(`
3
- `)}async function x(e,t){let{clientSecret:r,clientId:o,remoteApp:s,app:c}=e;return r&&(o||t!==i.EVENTBRIDGE)?{clientSecret:r,apiKey:o}:(P({appName:s.title,configFile:y(c.configPath)}),{clientSecret:s.apiSecretKeys.find(f=>f.secret).secret,apiKey:s.apiKey})}async function O(e,t,r){let o=await A(e,r);return t?L(t,o):C(o)}async function B(e,t,r,o){let s=await M(e,t,o);return r?H(r,t,s):V(s)}async function N(e,t){let r=e??_(t)??await R(),o=t??await D(r);return F(o,r)}async function Y(e){let t=await z(e);await W(t)}async function z(e){let t=await O(e.developerPlatformClient,e.apiVersion,e.organizationId),r=await B(e.developerPlatformClient,t,e.topic,e.organizationId),[o,s]=await N(e.deliveryMethod,e.address),c=await x(e,s);return{topic:r,apiVersion:t,deliveryMethod:s,address:o,apiKey:c.apiKey,clientSecret:c.clientSecret,developerPlatformClient:e.developerPlatformClient,organizationId:e.organizationId}}async function W(e){let t={topic:e.topic,api_version:e.apiVersion,address:e.address,delivery_method:e.deliveryMethod,shared_secret:e.clientSecret,api_key:e.apiKey},r=await S(e.developerPlatformClient,t,e.organizationId);if(!r.success){m(`Request errors:
4
- ${K(r.userErrors)}`);return}if(e.deliveryMethod===i.LOCALHOST){if(await E(e.address,r.samplePayload,r.headers)){h("Localhost delivery sucessful");return}m("Localhost delivery failed");return}r.samplePayload===JSON.stringify({})&&h("Webhook has been enqueued for delivery")}function K(e){try{return e.map(t=>JSON.parse(t.message).map(r=>` \xB7 ${r}`).join(`
5
- `)).join(`
6
- `)}catch{return JSON.stringify(e)}}var n=q(G(),1);var u=class e extends I{static summary="Trigger delivery of a sample webhook topic payload to a designated address.";static descriptionWithMarkdown=`
7
- Triggers the delivery of a sample Admin API event topic payload to a designated address.
8
-
9
- You should use this command to experiment with webhooks, to initially test your webhook configuration, or for unit testing. However, to test your webhook configuration from end to end, you should always trigger webhooks by performing the related action in Shopify.
10
-
11
- Because most webhook deliveries use remote endpoints, you can trigger the command from any directory where you can use Shopify CLI, and send the webhook to any of the supported endpoint types. For example, you can run the command from your app's local directory, but send the webhook to a staging environment endpoint.
12
-
13
- To learn more about using webhooks in a Shopify app, refer to [Webhooks overview](https://shopify.dev/docs/apps/webhooks).
14
-
15
- ### Limitations
16
-
17
- - Webhooks triggered using this method always have the same payload, so they can't be used to test scenarios that differ based on the payload contents.
18
- - Webhooks triggered using this method aren't retried when they fail.
19
- - Trigger requests are rate-limited using the [Partner API rate limit](https://shopify.dev/docs/api/partner#rate_limits).
20
- - You can't use this method to validate your API webhook subscriptions.
21
- `;static description=this.descriptionForHelp();static flags={...b,help:n.Flags.help({required:!1,hidden:!1,env:"SHOPIFY_FLAG_HELP",description:"This help. When you run the trigger command the CLI will prompt you for any information that isn't passed using flags."}),topic:l(n.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_TOPIC",description:"The requested webhook topic."})),"api-version":l(n.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_API_VERSION",description:"The API Version of the webhook topic."})),"delivery-method":n.Flags.string({required:!1,hidden:!1,options:[i.HTTP,i.PUBSUB,i.EVENTBRIDGE],env:"SHOPIFY_FLAG_DELIVERY_METHOD",description:"Method chosen to deliver the topic payload. If not passed, it's inferred from the address."}),"client-secret":n.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_CLIENT_SECRET",description:"Your app's client secret. This secret allows us to return the X-Shopify-Hmac-SHA256 header that lets you validate the origin of the response that you receive."}),address:l(n.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_ADDRESS",description:`The URL where the webhook payload should be sent.
22
- You will need a different address type for each delivery-method:
23
- ${d(i.HTTP)}
24
- ${d(i.PUBSUB)}
25
- ${d(i.EVENTBRIDGE)}`}))};async run(){let{flags:t}=await this.parse(e),r=await T({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o={...r,topic:t.topic,apiVersion:t["api-version"],deliveryMethod:t["delivery-method"],address:t.address,clientId:t["client-id"],clientSecret:t["client-secret"],path:t.path,config:t.config,organizationId:r.organization.id};return await Y(o),{app:r.app}}};export{u as a};
@@ -1,16 +0,0 @@
1
- import{b as s}from"./chunk-4ZNBEMRT.js";import{e as w}from"./chunk-QTLGMJDW.js";import{C,E as x,y as a}from"./chunk-47IQIIFX.js";import{i as S}from"./chunk-Q37WAD6F.js";import{Nb as I}from"./chunk-UWI76E2L.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();n();n();var m={on:"Autocorrect on. The system will automatically run commands even when you mistype them.",off:"Autocorrect off. You'll need to confirm corrections for mistyped commands."};n();function p(o=v()){return!!o.get("autocorrectEnabled")}function y(o,e=v()){e.set("autocorrectEnabled",o)}function v(){return A??=new w({projectName:"did-you-mean"}),A}var A;var u=class extends s{static summary="Enable autocorrect. Off by default.";static descriptionWithMarkdown=`Enable autocorrect. Off by default.
2
-
3
- When autocorrection is enabled, Shopify CLI automatically runs a corrected version of your command if a correction is available.
4
-
5
- When autocorrection is disabled, you need to confirm that you want to run corrections for mistyped commands.
6
- `;static description=this.descriptionForHelp();async run(){y(!0),a({body:m.on})}};n();var d=class extends s{static summary="Disable autocorrect. Off by default.";static descriptionWithMarkdown=`Disable autocorrect. Off by default.
7
-
8
- When autocorrection is enabled, Shopify CLI automatically runs a corrected version of your command if a correction is available.
9
-
10
- When autocorrection is disabled, you need to confirm that you want to run corrections for mistyped commands.
11
- `;static description=this.descriptionForHelp();async run(){y(!1),a({body:m.off})}};n();var f=class extends s{static summary="Check whether autocorrect is enabled or disabled. On by default.";static descriptionWithMarkdown=`Check whether autocorrect is enabled or disabled. On by default.
12
-
13
- When autocorrection is enabled, Shopify CLI automatically runs a corrected version of your command if a correction is available.
14
-
15
- When autocorrection is disabled, you need to confirm that you want to run corrections for mistyped commands.
16
- `;static description=this.descriptionForHelp();async run(){p()?a({body:m.on}):a({body:m.off})}};n();var b=E(2),Z=E(3);function E(o){if(typeof o!="number"||Number.isNaN(o)||o<1||o===Number.POSITIVE_INFINITY)throw new Error("`"+o+"` is not a valid argument for `n-gram`");return e;function e(t){let i=[];if(t==null)return i;let c=typeof t.slice=="function"?t:String(t),r=c.length-o+1;if(r<1)return i;for(;r--;)i[r]=c.slice(r,r+o);return i}}function h(o){return o.replace(/:/g," ")}function W(o,e){let t=new Map;for(let c of o)t.set(c,(t.get(c)??0)+1);let i=0;for(let c of e){let r=t.get(c)??0;r>0&&(i+=1,t.set(c,r-1))}return i}function D(o){if(o.id.length<2)return;let e=new Set(o.config.commands.filter(r=>r.hidden).map(r=>r.id)),t=Array.from(new Set([...o.config.commandIDs,...o.config.commands.flatMap(r=>r.aliases)].filter(r=>!e.has(r)))),i=b(o.id),c=t.map(r=>{let l=b(r);return{score:W(l,i),cmd:r}}).filter(({score:r})=>r>=2).sort((r,l)=>{let g=l.score-r.score;return g!==0?g:r.cmd.length-l.cmd.length});if(I(`'Did you mean' options: ${JSON.stringify(c)}`),c.length>0){let{cmd:r}=c[0];return r}}async function F(o,e){return p()?(a({body:["Autocorrecting",{command:h(e)},"to",{command:h(o)},{char:"."}]}),!0):x({message:["Command",{command:e},"not found. Did you mean",{command:h(o)},{char:"?"}]})}var uo={"config:autocorrect:off":d,"config:autocorrect:status":f,"config:autocorrect:on":u},fo=async function(o){let e=D(o),t=h(o.id);if(o.argv&&(o.argv.includes("-f")||o.argv.includes("--force"))||!e){C(new S(`Command '${t}' not found.`));return}await F(e,t)&&await this.config.runCommand(e,o.argv)};export{D as a,F as b,uo as c,fo as d};
@@ -1 +0,0 @@
1
- import{a as d,b as f,c as g,d as x,g as C}from"./chunk-RK2V6OIJ.js";import{a as c}from"./chunk-PWS4VFSD.js";import{a as l}from"./chunk-PO5T44H3.js";import{Ha as m}from"./chunk-UNHT4ZFP.js";import{b as p}from"./chunk-NU5WLZ6Y.js";import{z as s}from"./chunk-47IQIIFX.js";import{b as I}from"./chunk-I3J63RFV.js";import{e as y,g as a}from"./chunk-VKWPEFWQ.js";a();var h=y(I(),1);var o=class u extends c{static description="Import dashboard-managed extensions into your app.";static flags={...p,...l,"client-id":h.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};async run(){let{flags:i}=await this.parse(u),e=await m({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),t=await C({developerPlatformClient:e.developerPlatformClient,apiKey:e.remoteApp.apiKey,organizationId:e.remoteApp.organizationId,extensionTypes:g}),n=d(t);if(n.length===0)s({headline:["No extensions to migrate."]});else{let r=await f(n);await x({...e,extensions:t,extensionTypes:r.extensionTypes,buildExtensionConfig:r.buildExtensionConfig})}return{app:e.app}}};export{o as a};
@@ -1,5 +0,0 @@
1
- import{a as f}from"./chunk-EMH7OHCW.js";import{a as h}from"./chunk-PWS4VFSD.js";import{a as c}from"./chunk-PO5T44H3.js";import{Ha as m}from"./chunk-UNHT4ZFP.js";import{b as l}from"./chunk-NU5WLZ6Y.js";import{u as a}from"./chunk-3V4VL3SD.js";import{z as p}from"./chunk-47IQIIFX.js";import{i as d}from"./chunk-Q37WAD6F.js";import{b as C}from"./chunk-I3J63RFV.js";import{e as g,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function v(t){let e=t.appContextResult.developerPlatformClient,o=t.appContextResult.remoteApp,r=await e.devSessionDelete({shopFqdn:t.store.shopDomain,appId:o.id});if(r.devSessionDelete?.userErrors.length){let u=r.devSessionDelete.userErrors.map(w=>w.message).join(`
2
- `);throw new d(`Failed to stop the dev preview: ${u}`)}p({headline:"Dev preview stopped.",body:[`The dev preview has been stopped on ${t.store.shopDomain} and the app's active version has been restored.`,"You can start it again with",{command:"shopify app dev"}]})}var i=g(C(),1);var n=class t extends h{static summary="Cleans up the dev preview from the selected store.";static descriptionWithMarkdown=`Stop the dev preview that was started with \`shopify app dev\`.
3
-
4
- It restores the app's active version to the selected development store.
5
- `;static description=this.descriptionForHelp();static flags={...l,...c,"client-id":i.Flags.string({hidden:!1,description:"The Client ID of your app. Use with --config to clean up the dev preview for a different app than the one it is linked to.",env:"SHOPIFY_FLAG_CLIENT_ID"}),store:i.Flags.string({hidden:!1,char:"s",description:"Store URL. Must be an existing development store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>a(e)})};async run(){let{flags:e}=await this.parse(t),o=await m({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),r=await f({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset});return await v({appContextResult:o,store:r}),{app:o.app}}};export{n as a};
@@ -1,18 +0,0 @@
1
- import{c as ee,e as ne,f as te,g as ie}from"./chunk-RK2V6OIJ.js";import{a as J,c as Z,d as Q,e as X}from"./chunk-XSMCQLJW.js";import{b as I}from"./chunk-NYYXH2SX.js";import{a as q}from"./chunk-PWS4VFSD.js";import{a as j}from"./chunk-PO5T44H3.js";import{Ha as W,K as z,N as H,ea as K,g as Y}from"./chunk-UNHT4ZFP.js";import{a as G}from"./chunk-45SZ5PSE.js";import{b as V}from"./chunk-NU5WLZ6Y.js";import{E as U,H as B,M as N,x as O,y as F,z as M}from"./chunk-47IQIIFX.js";import{d as L}from"./chunk-DSS4ECIH.js";import{i as h,k as $}from"./chunk-Q37WAD6F.js";import{Aa as E,Db as S,Ga as R,Kb as A,P as D,Pb as C}from"./chunk-UWI76E2L.js";import{b as ce}from"./chunk-I3J63RFV.js";import{c as x,h as P}from"./chunk-6IDEDOXW.js";import{e as pe,g}from"./chunk-VKWPEFWQ.js";g();g();g();async function oe(e){let n,t;e.bundlePath&&(n=await X(e.developerPlatformClient,{id:e.apiKey,apiKey:e.apiKey,organizationId:e.organizationId}),await Q(n,e.bundlePath));let i={appManifest:e.appManifest,appId:e.appId,apiKey:e.apiKey,name:e.name,organizationId:e.organizationId,skipPublish:!e.release,message:e.message,versionTag:e.version,commitReference:e.commitReference};n&&(i.bundleUrl=n),e.appModules.length>0&&(i.appModules=e.appModules);let a=await e.developerPlatformClient.deploy(i);if(!a.appDeploy.appVersion){let o=ue(a.appDeploy.userErrors??[],e.appModuleRegistrationIds,e.appModules,{version:e.version});throw new h({bold:"Version couldn't be created."},null,[],o)}return a.appDeploy.userErrors?.length>0&&(t=a.appDeploy.userErrors.map(o=>o.message).join(", ")),{validationErrors:a.appDeploy.appVersion.appModuleVersions.filter(o=>o.validationErrors.length>0).map(o=>({uuid:o.registrationUuid,errors:o.validationErrors})),versionTag:a.appDeploy.appVersion.versionTag,location:a.appDeploy.appVersion.location,message:a.appDeploy.appVersion.message,deployError:t}}var w=`
2
- Validation errors`,k=`
3
- `;function ue(e,n,t,i={}){let a=l=>l.details?.some(y=>y.extension_id)??!1,s=(l,y)=>{let b=l.details?.find(_=>typeof _.extension_id<"u")?.extension_id??"";return Object.values(y).includes(b.toString())},o=l=>{let y=l.on?l.on[0]:void 0;return t.some(b=>b.uid===y?.user_identifier)},[d,u]=I(e,l=>o(l)),[p,c]=I(u,l=>a(l)),[m,r]=I(p,l=>s(l,n));return[...fe(c,{version:i.version}),...me(m,n),...he(r),...ge(d,t)]}function fe(e,n={}){return e.length>0?e.filter(t=>t.field&&t.field.includes("version_tag")&&t.message==="has already been taken").length>0&&n.version?[{body:["An app version with the name",{userInput:n.version},"already exists. Deploy again with a different version name."]}]:e.length===1?[{body:e[0]?.message??""}]:[{body:{list:{items:e.map(t=>t.message)}}}]:[]}function me(e,n){return e.reduce((t,i)=>{let a=(i.field??["unknown"]).join(".").replace("extension_points","extensions.targeting"),s=a==="base"?i.message:`${a}: ${i.message}`,o=i.details.find(r=>typeof r.extension_title<"u")?.extension_title,d=i.details.find(r=>typeof r.specification_identifier<"u")?.specification_identifier,u=i.details.find(r=>typeof r.extension_id<"u")?.extension_id?.toString(),c=Object.keys(n).find(r=>n[r]===u)??o;d==="webhook_subscription"&&(c="Webhook Subscription");let m=t.find(r=>r.title===c);if(m){let r=m.body,f=i.category==="invalid"?r.find(l=>l.list.title===w):r.find(l=>l.list.title===k);f?f.list.items.includes(s)||f.list.items.push(s):r.push({list:{title:i.category==="invalid"?w:k,items:[s]}})}else t.push({title:c,body:[{list:{title:i.category==="invalid"?w:k,items:[s]}}]});return t.forEach(r=>{r.body.sort((f,l)=>f.list.title===w?1:l.list.title===w?-1:0)}),t},[])}function ge(e,n){return e.reduce((t,i)=>{let s=(i.on?i.on[0]:void 0)?.user_identifier,o=n.find(r=>r.uid===s),d=s?`Extension with uid: ${s}`:"Unknown Extension",u=o?.handle??d,c=`${(i.field??["unknown"]).join(".")}: ${i.message}`,m=t.find(r=>r.title===u);if(m){let f=m.body.find(l=>l.list.title===w);f&&(f.list.items.includes(c)||f.list.items.push(c))}else t.push({title:u,body:[{list:{title:w,items:[c]}}]});return t},[])}function he(e){return e.reduce((n,t)=>{let i=t.details.find(s=>typeof s.extension_title<"u")?.extension_title,a=n.find(s=>s.title===i);return a?a.errorCount+=1:n.push({title:i,errorCount:1}),n},[]).map(n=>({title:n.title,body:`
4
- ${n.errorCount} error${n.errorCount>1?"s":""} found in your extensions. Fix these issues and try deploying again.`}))}g();async function ae(e){let n=x(e.app.directory,".shopify","deploy-bundle");await R(n,{force:!0}),await E(n),await J(e.appManifest,n),e.skipBuild||await Y(e.app);let t=e.app.allExtensions.map(a=>({prefix:a.localIdentifier,action:async(s,o,d)=>{await a.buildForBundle({stderr:o,stdout:s,signal:d,app:e.app,environment:"production",skipBuild:e.skipBuild},n)}}));if(await O({processes:t,showTimestamps:!1}),e.app.allExtensions.some(a=>a.hasDeploySteps))return await Z(n,e.bundlePath),e.bundlePath}async function ye(e){let{app:n,remoteApp:t,developerPlatformClient:i,noRelease:a,allowUpdates:s,allowDeletes:o,extensions:d}=e,u=[a,s,o].some(Boolean),p=[`App can't be deployed until Partner Dashboard managed extensions are added to your version or removed from your app:
5
- `,d.map(f=>` - ${f.title}`).join(`
6
- `)],c=[`
7
-
8
- Run `,{command:"shopify app import dashboard-extensions"}," to add legacy extensions."];if(u||!N())throw new h(p,c);let m=[`
9
-
10
- Run `,{command:"shopify app import dashboard-extensions"}," to add legacy extensions now?"];if(await U({message:[...p,...m],confirmationMessage:"Yes, add legacy extensions and deploy",cancellationMessage:"No, don't add legacy extensions"}))return await te({app:n,remoteApp:t,developerPlatformClient:i,extensions:d}),z(n);throw new $}async function ve(e){let{app:n,remoteApp:t,developerPlatformClient:i}=e,a=await ie({developerPlatformClient:i,apiKey:t.apiKey,organizationId:t.organizationId,extensionTypes:ee,onlyDashboardManaged:!0}),s=ne(e.app,a);return s.length===0?n:ye({...e,extensions:s})}async function se(e){let{remoteApp:n,developerPlatformClient:t,noRelease:i,allowUpdates:a,allowDeletes:s}=e,o=await ve({app:e.app,remoteApp:n,developerPlatformClient:t,noRelease:i,allowUpdates:a,allowDeletes:s}),{deployIdentifiers:d,didMigrateExtensionsToDevDash:u}=await K({...e,app:o,developerPlatformClient:t,allowUpdates:a,allowDeletes:s}),p=!i,c=n.apiKey;C(),p?A(`Releasing a new app version as part of ${n.title}`):A(`Creating a new app version as part of ${n.title}`),C();let m,r=x(e.app.directory,".shopify",`deploy-bundle.${t.bundleFormat}`);await E(P(r));let f=await o.manifest(be(o,d.appModuleUuids)),l=await ae({app:o,appManifest:f,bundlePath:r,skipBuild:e.skipBuild}),y;return p?y="Releasing an app version":y="Creating an app version",await B([{title:"Running validation",task:async()=>{await o.preDeployValidation()}},{title:y,task:async()=>{let _=await Promise.all(o.allExtensions.flatMap(de=>de.bundleConfig({appModuleUuids:d.appModuleUuids,developerPlatformClient:t,apiKey:c,appConfiguration:o.configuration})));m=await oe({appManifest:f,appId:n.id,apiKey:c,name:o.name,organizationId:n.organizationId,bundlePath:l,appModules:D(_),release:p,developerPlatformClient:t,appModuleRegistrationIds:d.appModuleRegistrationIds,message:e.message,version:e.version,commitReference:e.commitReference})}}]),await we({app:o,project:e.project,release:p,uploadExtensionsBundleResult:m,didMigrateExtensionsToDevDash:u}),{app:o}}async function we({app:e,project:n,release:t,uploadExtensionsBundleResult:i,didMigrateExtensionsToDevDash:a}){let s=[{link:{label:i.versionTag??"version",url:i.location}},i.message?`
11
- ${i.message}`:""],o=[];if(a){let d=await H(e.directory),u=Object.values(d).filter(c=>c!==d[e.configuration.client_id]),p=[];u.length>0&&p.push("\u2022 Map extension IDs to other copies of your app by running",{command:S(n.packageManager,"shopify app deploy")},"for: ",{list:{items:u}}),p.push("\u2022 Commit to source control to ensure your extension IDs aren't regenerated on the next deploy."),o=[{title:"Next steps",body:p},{title:"Reference",body:["\u2022 ",{link:{label:"Migrating from the Partner Dashboard",url:"https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners"}}]}]}return t?i.deployError?F({headline:"New version created, but not released.",body:[...s,`
12
-
13
- ${i.deployError}`],customSections:o}):M({headline:"New version released to users.",body:s,customSections:o}):M({headline:"New version created.",body:s,customSections:o,nextSteps:[["Run",{command:S(n.packageManager,"shopify app release",`--version=${i.versionTag}`)},"to release this version to users."]]})}function be(e,n){return Object.fromEntries(e.allExtensions.filter(t=>t.isUUIDStrategyExtension).map(t=>[t.localIdentifier,n[t.localIdentifier]]))}g();function re(e){if(typeof e>"u")return;let n=["Invalid version name:",{userInput:e}],t=100;if(e.length>t)throw new h(n,`Version name must be ${t} characters or less.`);let i=[".",".."];if(i.find(s=>e===s))throw new h(n,`Version name may not be any of: ${i.map(s=>`'${s}'`).join(" , ")}`);let a=/^[a-zA-Z0-9.\-_]+$/;if(!e.match(a))throw new h(n,["Version name can only contain alphanumeric characters, periods, hyphens, and underscores"])}g();function le(e){if(typeof e>"u")return;let n=["Invalid message:",{userInput:e}],t=200;if(e.length>t)throw new h(n,`Message name must be ${t} characters or less.`)}var v=pe(ce(),1);var T=class e extends q{static summary="Deploy your Shopify app.";static descriptionWithMarkdown=`[Builds the app](https://shopify.dev/docs/api/shopify-cli/app/app-build), then deploys your app configuration and extensions.
14
-
15
- This command creates an app version, which is a snapshot of your app configuration and all extensions. This version is then released to users.
16
-
17
- This command doesn't deploy your [web app](https://shopify.dev/docs/apps/tools/cli/structure#web-components). You need to [deploy your web app](https://shopify.dev/docs/apps/deployment/web) to your own hosting solution.
18
- `;static description=this.descriptionForHelp();static flags={...V,...j,"client-id":v.Flags.string({hidden:!1,description:"The Client ID of your app. Use with --config to deploy that configuration to a different app than the one it is linked to.",env:"SHOPIFY_FLAG_CLIENT_ID"}),"allow-updates":v.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. In non-interactive environments, provide this flag, --allow-deletes, or --no-release.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":v.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. In non-interactive environments, provide this flag, --allow-updates, or --no-release.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),"no-release":v.Flags.boolean({hidden:!1,description:"Creates a version but doesn't release it - it's not made available to merchants. With this flag, a user confirmation is not required. In non-interactive environments, provide this flag, --allow-updates, or --allow-deletes.",env:"SHOPIFY_FLAG_NO_RELEASE",default:!1,exclusive:["allow-updates","allow-deletes"]}),"no-build":v.Flags.boolean({description:"Use with caution: Skips building any elements of the app that require building. You should ensure your app has been prepared in advance, such as by running `shopify app build` or by caching build artifacts.",env:"SHOPIFY_FLAG_NO_BUILD",default:!1}),message:v.Flags.string({hidden:!1,description:"Optional message that will be associated with this version. This is for internal use only and won't be available externally.",env:"SHOPIFY_FLAG_MESSAGE"}),version:v.Flags.string({hidden:!1,description:"Optional version tag that will be associated with this app version. If not provided, an auto-generated identifier will be generated for this app version.",env:"SHOPIFY_FLAG_VERSION"}),"source-control-url":v.Flags.string({hidden:!1,description:"URL associated with the new app version.",env:"SHOPIFY_FLAG_SOURCE_CONTROL_URL"})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes","no-release"]}]}async run(){let{flags:n}=await this.parse(e);await G.addPublicMetadata(()=>({cmd_deploy_flag_message_used:!!n.message,cmd_deploy_flag_version_used:!!n.version,cmd_deploy_flag_source_url_used:!!n["source-control-url"]})),re(n.version),le(n.message);let t=n["client-id"];await L(()=>({cmd_app_reset_used:n.reset}));let{app:i,project:a,remoteApp:s,developerPlatformClient:o,organization:d}=await W({directory:n.path,clientId:t,forceRelink:n.reset,userProvidedConfigName:n.config}),u=n["no-release"]||n["allow-updates"],p=n["no-release"]||n["allow-deletes"];return{app:(await se({app:i,project:a,remoteApp:s,organization:d,developerPlatformClient:o,reset:n.reset,allowUpdates:u,allowDeletes:p,noRelease:n["no-release"],message:n.message,version:n.version,commitReference:n["source-control-url"],skipBuild:n["no-build"]})).app}}};export{T as a};