@shopify/cli 4.6.0 → 4.7.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 (426) hide show
  1. package/dist/analytics-6LI5GLWS.js +1 -0
  2. package/dist/analytics-UNRIIG4Y.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-4YCMEC5R.js → chunk-2CYVZUYT.js} +1 -1
  5. package/dist/{chunk-C256W7D2.js → chunk-2HK4MFWP.js} +3 -3
  6. package/dist/chunk-2JDCVEFK.js +1 -0
  7. package/dist/chunk-2SZOPJYI.js +1 -0
  8. package/dist/chunk-2U4P6UFZ.js +6 -0
  9. package/dist/{chunk-TAFOSPBW.js → chunk-2WJAAJVX.js} +1 -1
  10. package/dist/chunk-37TEEITE.js +2 -0
  11. package/dist/chunk-3K6VHXC2.js +4 -0
  12. package/dist/chunk-4HV6A6UH.js +8 -0
  13. package/dist/chunk-4JY2P2A5.js +1 -0
  14. package/dist/chunk-4LRG5YBS.js +3 -0
  15. package/dist/chunk-4W3UE2ZI.js +1 -0
  16. package/dist/chunk-5CADTCJE.js +25 -0
  17. package/dist/chunk-5CR5YJTU.js +11 -0
  18. package/dist/chunk-5CYJG63I.js +1 -0
  19. package/dist/chunk-5HBIIYSK.js +1 -0
  20. package/dist/chunk-5HPBQ6U5.js +1 -0
  21. package/dist/chunk-5NO5OXYP.js +15 -0
  22. package/dist/chunk-63CIFL36.js +6 -0
  23. package/dist/chunk-6EBLULOC.js +1 -0
  24. package/dist/{chunk-FMTPUYSH.js → chunk-6ENBE43F.js} +1 -1
  25. package/dist/chunk-6OFGSZD6.js +1 -0
  26. package/dist/chunk-6PDR2IUL.js +11 -0
  27. package/dist/chunk-6VGJVXZI.js +3 -0
  28. package/dist/{chunk-ILQXBASM.js → chunk-6VRXGEIW.js} +1 -1
  29. package/dist/chunk-6WZYX5RO.js +1 -0
  30. package/dist/chunk-7AALWJAO.js +7 -0
  31. package/dist/chunk-7DOWT5JZ.js +20 -0
  32. package/dist/chunk-7JIQXGDE.js +9 -0
  33. package/dist/chunk-7MHANY34.js +1 -0
  34. package/dist/chunk-7WTNEG2F.js +3 -0
  35. package/dist/chunk-7Y7AZRL3.js +10 -0
  36. package/dist/chunk-ACTDYTAV.js +317 -0
  37. package/dist/{chunk-Y2PC2BBJ.js → chunk-AEUCDGTB.js} +4 -4
  38. package/dist/chunk-AGOEROAI.js +10 -0
  39. package/dist/{chunk-WPRAJ25Z.js → chunk-AH2ZGMDM.js} +1 -1
  40. package/dist/chunk-AMLWPYNA.js +4 -0
  41. package/dist/chunk-B4OMIONW.js +5 -0
  42. package/dist/chunk-BR6DBMQA.js +5 -0
  43. package/dist/chunk-CFWHR74L.js +1 -0
  44. package/dist/chunk-CHMEDVDZ.js +15 -0
  45. package/dist/chunk-CIH6LPTG.js +6 -0
  46. package/dist/chunk-CMYQXGLO.js +1 -0
  47. package/dist/chunk-CTRXLZAJ.js +1 -0
  48. package/dist/{chunk-WWX265PC.js → chunk-CYOFLJ3Z.js} +1 -1
  49. package/dist/{chunk-HSKB5OTM.js → chunk-CZJZCJRX.js} +1 -1
  50. package/dist/chunk-CZPGC2E7.js +1 -0
  51. package/dist/{chunk-2I62GKIH.js → chunk-D2K2ZBKH.js} +8 -8
  52. package/dist/chunk-DHU57LKD.js +1 -0
  53. package/dist/chunk-DKL6N3L2.js +1 -0
  54. package/dist/chunk-DMXQLI35.js +1 -0
  55. package/dist/chunk-DPNZWBT5.js +1 -0
  56. package/dist/{chunk-QU5NL2QT.js → chunk-DQCIORGH.js} +1 -1
  57. package/dist/chunk-DQFSKPKL.js +6 -0
  58. package/dist/{chunk-6Q5VRSRN.js → chunk-E2W5OYYM.js} +1 -1
  59. package/dist/chunk-E5T4YRGW.js +1 -0
  60. package/dist/chunk-EOMCXBCS.js +5 -0
  61. package/dist/{chunk-LWRDNTAD.js → chunk-EW55WWT7.js} +1 -1
  62. package/dist/{chunk-6UTUJKKC.js → chunk-F5HCSUXC.js} +5 -5
  63. package/dist/{chunk-W2GMKXM7.js → chunk-FCGKO2KY.js} +1 -1
  64. package/dist/{chunk-7CPECP5P.js → chunk-FULWTZS6.js} +1 -1
  65. package/dist/chunk-FWPJEL6Q.js +3 -0
  66. package/dist/chunk-GKOBFX4A.js +1 -0
  67. package/dist/chunk-GLWQMLUC.js +1 -0
  68. package/dist/chunk-GMTNOCMS.js +375 -0
  69. package/dist/chunk-GSCWZR22.js +1 -0
  70. package/dist/chunk-GZ64KWHX.js +8 -0
  71. package/dist/{chunk-72GN655L.js → chunk-H5KWM27L.js} +1 -1
  72. package/dist/chunk-HHVHVGRT.js +1 -0
  73. package/dist/{chunk-EBZ6MDEM.js → chunk-HLNJL4B6.js} +1 -1
  74. package/dist/{chunk-OUUOML3D.js → chunk-HZIX3DIT.js} +1 -1
  75. package/dist/chunk-I3N6NPHF.js +2 -0
  76. package/dist/chunk-JD5P5RAJ.js +1 -0
  77. package/dist/chunk-JJJTPEMD.js +1 -0
  78. package/dist/{chunk-KRZABRYT.js → chunk-JLGA3B7P.js} +1 -1
  79. package/dist/chunk-JQ2B3VHR.js +7 -0
  80. package/dist/{chunk-VZKR2YFM.js → chunk-JQISGC7D.js} +1 -1
  81. package/dist/chunk-JQVXH26X.js +6 -0
  82. package/dist/{chunk-ERCJPRN3.js → chunk-JUKAWTYY.js} +1 -1
  83. package/dist/{chunk-JHRZCUBE.js → chunk-JZMRBJH3.js} +1 -1
  84. package/dist/chunk-JZXA3H5K.js +1 -0
  85. package/dist/chunk-K4KTNINH.js +1 -0
  86. package/dist/chunk-KCS75ZM4.js +1 -0
  87. package/dist/{chunk-AJ6VOBXU.js → chunk-KIYHEMHD.js} +7 -7
  88. package/dist/chunk-KK24VGVE.js +6 -0
  89. package/dist/{chunk-6BX62FFE.js → chunk-KOVAFUYN.js} +1 -1
  90. package/dist/{chunk-QG7TELFC.js → chunk-KUNDCAQN.js} +1 -1
  91. package/dist/{chunk-3NO6PWNL.js → chunk-L67BU25M.js} +1 -1
  92. package/dist/{chunk-4KZRP2JP.js → chunk-LDF4PQ3B.js} +18 -18
  93. package/dist/chunk-LFOBYEWG.js +1 -0
  94. package/dist/chunk-LJM2DUXN.js +1 -0
  95. package/dist/{chunk-XWPPBOGF.js → chunk-LQ7ENG4V.js} +1 -1
  96. package/dist/chunk-LQCR4TGH.js +3 -0
  97. package/dist/{chunk-UM3OHLCX.js → chunk-LRQYUWWB.js} +1 -1
  98. package/dist/{chunk-CXWLHQKA.js → chunk-LWJA2DQG.js} +1 -1
  99. package/dist/{chunk-IKYZ5L3F.js → chunk-LZ3GZ7NS.js} +1 -1
  100. package/dist/chunk-MB7E5GEY.js +2 -0
  101. package/dist/{chunk-XERJY4IG.js → chunk-MLZLDL6B.js} +8 -8
  102. package/dist/chunk-MRCWOOSF.js +8 -0
  103. package/dist/chunk-N6YTJXIS.js +18 -0
  104. package/dist/chunk-NEMPLS7C.js +1 -0
  105. package/dist/chunk-OE3F7XXU.js +4 -0
  106. package/dist/chunk-OORWOTAP.js +3 -0
  107. package/dist/chunk-OUZGGWFN.js +1 -0
  108. package/dist/chunk-P5MNNBSO.js +1 -0
  109. package/dist/chunk-PAAKBWSF.js +1 -0
  110. package/dist/{chunk-5EFQILLF.js → chunk-PANGX7SA.js} +1 -1
  111. package/dist/{chunk-DODCPRXT.js → chunk-PIFW2R3S.js} +1 -1
  112. package/dist/chunk-PWSI275S.js +7 -0
  113. package/dist/chunk-Q5DQGV3M.js +1 -0
  114. package/dist/chunk-QBIVQXUJ.js +6 -0
  115. package/dist/chunk-QEB3HUQE.js +19 -0
  116. package/dist/{chunk-E3RDAVJT.js → chunk-QKGZWOOY.js} +1 -1
  117. package/dist/chunk-QPWMD2VR.js +1 -0
  118. package/dist/chunk-QRT4A2RV.js +3 -0
  119. package/dist/chunk-QXHENYJH.js +2 -0
  120. package/dist/{chunk-FPWLEGKZ.js → chunk-QZBSCOJV.js} +1 -1
  121. package/dist/chunk-R2R6JDNH.js +1 -0
  122. package/dist/chunk-RUFQCXBX.js +16 -0
  123. package/dist/chunk-RY2SJVWM.js +12 -0
  124. package/dist/chunk-RZFBGBNA.js +1 -0
  125. package/dist/chunk-S3P5WWJD.js +1 -0
  126. package/dist/chunk-SEVSMWNX.js +1 -0
  127. package/dist/chunk-SJMTETSU.js +32 -0
  128. package/dist/chunk-SSJGWLCW.js +28 -0
  129. package/dist/chunk-SYADOUBB.js +7 -0
  130. package/dist/chunk-T5JXQ7KO.js +1 -0
  131. package/dist/chunk-TCTVI6PK.js +1 -0
  132. package/dist/chunk-TSLQZTXR.js +1 -0
  133. package/dist/chunk-TTAPXLI5.js +1 -0
  134. package/dist/{chunk-MDXSLAIC.js → chunk-TY4W7AYX.js} +1 -1
  135. package/dist/chunk-TYIGOVRQ.js +3 -0
  136. package/dist/{chunk-B6SY4BIK.js → chunk-U2Z5NMXV.js} +1 -1
  137. package/dist/{chunk-KGZH4RFA.js → chunk-U6HYEGAE.js} +1 -1
  138. package/dist/chunk-U7R6LYPJ.js +5 -0
  139. package/dist/chunk-UPJLZHHR.js +4 -0
  140. package/dist/chunk-UVQL7RUY.js +1 -0
  141. package/dist/chunk-V2HCVJYF.js +1 -0
  142. package/dist/chunk-V5SC2RYQ.js +2 -0
  143. package/dist/chunk-VKSR6MJG.js +2 -0
  144. package/dist/chunk-VRVP2GQL.js +5 -0
  145. package/dist/{chunk-XGRVAPLR.js → chunk-WCRZJY3P.js} +1 -1
  146. package/dist/{chunk-XGCJWCC4.js → chunk-WHLGNDRE.js} +1 -1
  147. package/dist/{chunk-E3RQCWSC.js → chunk-WKUGSFTB.js} +3 -3
  148. package/dist/chunk-X4XP2RQJ.js +1 -0
  149. package/dist/chunk-XAOYKECS.js +1 -0
  150. package/dist/chunk-XCBEYRQI.js +3 -0
  151. package/dist/chunk-XHZ5BWXL.js +5 -0
  152. package/dist/{chunk-2JFZ6GZC.js → chunk-XLURZ6GL.js} +52 -52
  153. package/dist/chunk-XRT2W5Y2.js +10 -0
  154. package/dist/chunk-XUEMMLXK.js +1 -0
  155. package/dist/chunk-Y34LWI3S.js +19 -0
  156. package/dist/chunk-YHPBDS52.js +16 -0
  157. package/dist/{chunk-JS3X6BDT.js → chunk-YIZZ5LZN.js} +1 -1
  158. package/dist/chunk-YN6A26QL.js +836 -0
  159. package/dist/chunk-YOO7DLOT.js +1 -0
  160. package/dist/chunk-YUVE2I3C.js +1 -0
  161. package/dist/chunk-YY6TFARF.js +1 -0
  162. package/dist/chunk-Z5K4J7HQ.js +1 -0
  163. package/dist/chunk-ZCNIR6YU.js +1 -0
  164. package/dist/{chunk-OTT73YUA.js → chunk-ZO74GSWC.js} +1 -1
  165. package/dist/{chunk-5Y2VD4I3.js → chunk-ZRLEAF7M.js} +1 -1
  166. package/dist/chunk-ZSFAURIH.js +3 -0
  167. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  168. package/dist/cli/commands/app/build.js +1 -1
  169. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  170. package/dist/cli/commands/app/bulk/execute.js +1 -1
  171. package/dist/cli/commands/app/bulk/status.js +1 -1
  172. package/dist/cli/commands/app/config/link.js +1 -1
  173. package/dist/cli/commands/app/config/pull.js +1 -1
  174. package/dist/cli/commands/app/config/use.js +1 -1
  175. package/dist/cli/commands/app/config/validate.js +1 -1
  176. package/dist/cli/commands/app/demo/watcher.js +1 -1
  177. package/dist/cli/commands/app/deploy.js +1 -1
  178. package/dist/cli/commands/app/dev/clean.js +1 -1
  179. package/dist/cli/commands/app/dev.js +1 -1
  180. package/dist/cli/commands/app/env/pull.js +1 -1
  181. package/dist/cli/commands/app/env/show.js +1 -1
  182. package/dist/cli/commands/app/execute.js +1 -1
  183. package/dist/cli/commands/app/function/build.js +1 -1
  184. package/dist/cli/commands/app/function/info.js +1 -1
  185. package/dist/cli/commands/app/function/replay.js +1 -1
  186. package/dist/cli/commands/app/function/run.js +1 -1
  187. package/dist/cli/commands/app/function/schema.js +1 -1
  188. package/dist/cli/commands/app/function/typegen.js +1 -1
  189. package/dist/cli/commands/app/generate/extension.js +1 -1
  190. package/dist/cli/commands/app/graphiql.js +1 -1
  191. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  192. package/dist/cli/commands/app/import-extensions.js +1 -1
  193. package/dist/cli/commands/app/info.js +1 -1
  194. package/dist/cli/commands/app/init.js +1 -1
  195. package/dist/cli/commands/app/logs.js +1 -1
  196. package/dist/cli/commands/app/release.js +1 -1
  197. package/dist/cli/commands/app/versions/list.js +1 -1
  198. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  199. package/dist/cli/commands/auth/login.js +1 -1
  200. package/dist/cli/commands/auth/logout.js +1 -1
  201. package/dist/cli/commands/cache/clear.js +1 -1
  202. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  203. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  204. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  205. package/dist/cli/commands/debug/command-flags.js +1 -1
  206. package/dist/cli/commands/doc/fetch.js +1 -1
  207. package/dist/cli/commands/doc/search.js +1 -1
  208. package/dist/cli/commands/docs/generate.js +1 -1
  209. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  210. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  211. package/dist/cli/commands/help.js +1 -1
  212. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  213. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  214. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  215. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  216. package/dist/cli/commands/notifications/generate.js +1 -1
  217. package/dist/cli/commands/notifications/list.js +1 -1
  218. package/dist/cli/commands/organization/list.js +1 -1
  219. package/dist/cli/commands/search.js +1 -1
  220. package/dist/cli/commands/send-analytics.d.ts +5 -0
  221. package/dist/cli/commands/send-analytics.js +1 -0
  222. package/dist/cli/commands/theme/check.js +1 -1
  223. package/dist/cli/commands/theme/console.js +1 -1
  224. package/dist/cli/commands/theme/delete.js +1 -1
  225. package/dist/cli/commands/theme/dev.js +1 -1
  226. package/dist/cli/commands/theme/duplicate.js +1 -1
  227. package/dist/cli/commands/theme/info.js +1 -1
  228. package/dist/cli/commands/theme/init.js +1 -1
  229. package/dist/cli/commands/theme/language-server.js +1 -1
  230. package/dist/cli/commands/theme/list.js +1 -1
  231. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  232. package/dist/cli/commands/theme/open.js +1 -1
  233. package/dist/cli/commands/theme/package.js +1 -1
  234. package/dist/cli/commands/theme/preview.js +1 -1
  235. package/dist/cli/commands/theme/profile.js +1 -1
  236. package/dist/cli/commands/theme/publish.js +1 -1
  237. package/dist/cli/commands/theme/pull.js +1 -1
  238. package/dist/cli/commands/theme/push.js +1 -1
  239. package/dist/cli/commands/theme/rename.js +1 -1
  240. package/dist/cli/commands/theme/share.js +1 -1
  241. package/dist/cli/commands/upgrade.js +1 -1
  242. package/dist/cli/commands/version.js +1 -1
  243. package/dist/cli/help.js +1 -1
  244. package/dist/cli/services/doctor-release/theme/tests/init.js +4 -8
  245. package/dist/cli/services/doctor-release/theme/tests/push.js +3 -4
  246. package/dist/command-registry.js +1 -1
  247. package/dist/conf-store-OAGJBITE.js +1 -0
  248. package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
  249. package/dist/deprecations-K3NPRKBF.js +1 -0
  250. package/dist/dist-EXJEE23W.js +1 -0
  251. package/dist/dist-S62Z6IFV.js +1 -0
  252. package/dist/environments-ALH2N36U.js +1 -0
  253. package/dist/error-YX56C43A.js +1 -0
  254. package/dist/error-handler-FDCH72NH.js +1 -0
  255. package/dist/fs-SKHQZZTQ.js +1 -0
  256. package/dist/hooks/did-you-mean.js +1 -1
  257. package/dist/hooks/hydrogen-init.js +1 -1
  258. package/dist/hooks/postrun.js +1 -1
  259. package/dist/hooks/prerun.js +2 -1
  260. package/dist/hooks/public-metadata.js +1 -1
  261. package/dist/hooks/sensitive-metadata.js +1 -1
  262. package/dist/hooks/tunnel-provider.js +1 -1
  263. package/dist/hooks/tunnel-start.js +1 -1
  264. package/dist/index.d.ts +1 -1
  265. package/dist/index.js +15 -15
  266. package/dist/is-global-V5VORI3F.js +1 -0
  267. package/dist/lib-M72BVWQ3.js +1 -0
  268. package/dist/local-GX5AN6ZS.js +1 -0
  269. package/dist/metadata-XUJUTBTB.js +1 -0
  270. package/dist/{morph-ABSWZEVT.js → morph-77RHJICZ.js} +1 -1
  271. package/dist/node-package-manager-3WIYU7Y3.js +1 -0
  272. package/dist/notifications-system-RHULO564.js +1 -0
  273. package/dist/os-M6X7KOR4.js +1 -0
  274. package/dist/output-X47P6ICP.js +1 -0
  275. package/dist/{prettier-6ZMB2MMO.js → prettier-RVUAAWC7.js} +1 -1
  276. package/dist/system-SR5G7WEW.js +1 -0
  277. package/dist/tsconfig.tsbuildinfo +1 -1
  278. package/dist/ui-VYWSLAQ6.js +1 -0
  279. package/dist/upgrade-PFQ7JMXG.js +1 -0
  280. package/dist/version-FK4ETQ22.js +1 -0
  281. package/dist/version-U4GM2LNG.js +1 -0
  282. package/dist/workerd-NAPS5TA7.js +18 -0
  283. package/oclif.manifest.json +146 -120
  284. package/package.json +7 -8
  285. package/dist/analytics-6S5JVSRO.js +0 -1
  286. package/dist/analytics-E252SR3P.js +0 -1
  287. package/dist/chunk-2MCH43SL.js +0 -11
  288. package/dist/chunk-2SNT7U7B.js +0 -1
  289. package/dist/chunk-2VIUGNYO.js +0 -1
  290. package/dist/chunk-2Y6CYLKF.js +0 -1
  291. package/dist/chunk-3EHRA4LA.js +0 -1
  292. package/dist/chunk-3EPQ6UOK.js +0 -25
  293. package/dist/chunk-3TFUSDHY.js +0 -370
  294. package/dist/chunk-46NA23I7.js +0 -3
  295. package/dist/chunk-47URTBZF.js +0 -9
  296. package/dist/chunk-4FEBSLSU.js +0 -1
  297. package/dist/chunk-4HB4VZJQ.js +0 -4
  298. package/dist/chunk-4JARSKED.js +0 -32
  299. package/dist/chunk-4P7PWLUN.js +0 -1
  300. package/dist/chunk-53ZA2HD3.js +0 -1
  301. package/dist/chunk-57YF2UNT.js +0 -1
  302. package/dist/chunk-5JPV3HPJ.js +0 -1
  303. package/dist/chunk-5LJ5H4TD.js +0 -7
  304. package/dist/chunk-6FJBCRVK.js +0 -15
  305. package/dist/chunk-6SXB44CE.js +0 -1
  306. package/dist/chunk-6YCGMS7X.js +0 -28
  307. package/dist/chunk-7HAFBCL3.js +0 -2
  308. package/dist/chunk-7XPFLQEM.js +0 -1
  309. package/dist/chunk-A3JE5LX3.js +0 -7
  310. package/dist/chunk-A4SBXDZB.js +0 -14
  311. package/dist/chunk-B2WK53GH.js +0 -1
  312. package/dist/chunk-B34VYVGV.js +0 -1
  313. package/dist/chunk-BBEHNPKK.js +0 -7
  314. package/dist/chunk-BCTMBKAU.js +0 -7
  315. package/dist/chunk-BGUHH7AW.js +0 -10
  316. package/dist/chunk-DHU767C3.js +0 -1
  317. package/dist/chunk-DKHMLETG.js +0 -1
  318. package/dist/chunk-EJDWYASP.js +0 -1
  319. package/dist/chunk-ELJ7SKMH.js +0 -1
  320. package/dist/chunk-EQTULRM7.js +0 -2
  321. package/dist/chunk-ESZS7L6O.js +0 -11
  322. package/dist/chunk-ET2O5DAS.js +0 -1
  323. package/dist/chunk-EZ7EBYDT.js +0 -684
  324. package/dist/chunk-EZNJDFFK.js +0 -28
  325. package/dist/chunk-F34LB7M4.js +0 -20
  326. package/dist/chunk-FE24P4UQ.js +0 -6
  327. package/dist/chunk-FT4HLDK7.js +0 -1
  328. package/dist/chunk-G3YYMKWG.js +0 -3
  329. package/dist/chunk-G7QW5OSQ.js +0 -6
  330. package/dist/chunk-GCDEDRY7.js +0 -3
  331. package/dist/chunk-GEE5MXHT.js +0 -5
  332. package/dist/chunk-H4MYBJ6C.js +0 -1
  333. package/dist/chunk-HDXBZLHH.js +0 -8
  334. package/dist/chunk-HT6MOPLW.js +0 -1
  335. package/dist/chunk-HZXY7RWJ.js +0 -19
  336. package/dist/chunk-IDAWPBJM.js +0 -4
  337. package/dist/chunk-IDLDQ2JB.js +0 -1
  338. package/dist/chunk-IYU72M55.js +0 -3
  339. package/dist/chunk-J3IHP46B.js +0 -3
  340. package/dist/chunk-J4KJQHNS.js +0 -1
  341. package/dist/chunk-JIBLEZ57.js +0 -18
  342. package/dist/chunk-JIKIYMCT.js +0 -1
  343. package/dist/chunk-JJTGHARS.js +0 -3
  344. package/dist/chunk-JQP3ZCAG.js +0 -1
  345. package/dist/chunk-K7IZMKBR.js +0 -5
  346. package/dist/chunk-KO4FB4QU.js +0 -1
  347. package/dist/chunk-KPRKIZ5M.js +0 -3
  348. package/dist/chunk-KUN74JD4.js +0 -4
  349. package/dist/chunk-KURWC4A5.js +0 -16
  350. package/dist/chunk-L3D2CASO.js +0 -1
  351. package/dist/chunk-L7DZTIHJ.js +0 -1
  352. package/dist/chunk-LBDAYBIF.js +0 -1
  353. package/dist/chunk-LH3RIIOB.js +0 -8
  354. package/dist/chunk-LWWBU7ET.js +0 -6
  355. package/dist/chunk-M4BEPPA3.js +0 -1
  356. package/dist/chunk-M4YPMHIM.js +0 -1
  357. package/dist/chunk-M5KKLAM6.js +0 -3
  358. package/dist/chunk-MBLHXPGK.js +0 -1
  359. package/dist/chunk-MDHJJVXA.js +0 -2
  360. package/dist/chunk-NA2ERJIJ.js +0 -1
  361. package/dist/chunk-NOKCVDYD.js +0 -317
  362. package/dist/chunk-O6XSWAP2.js +0 -4
  363. package/dist/chunk-OB62WVZ5.js +0 -16
  364. package/dist/chunk-OT52JOML.js +0 -1
  365. package/dist/chunk-P7XC5HS2.js +0 -1
  366. package/dist/chunk-PALG4SNB.js +0 -1
  367. package/dist/chunk-PB37BTPE.js +0 -6
  368. package/dist/chunk-PWYRKTJ4.js +0 -1
  369. package/dist/chunk-PXSX63RF.js +0 -1
  370. package/dist/chunk-QDPDB5EP.js +0 -3
  371. package/dist/chunk-QV53BSQP.js +0 -6
  372. package/dist/chunk-QXXA2EQY.js +0 -15
  373. package/dist/chunk-QZ5FMWZS.js +0 -1
  374. package/dist/chunk-R26GJEH3.js +0 -1
  375. package/dist/chunk-RTW4RZWH.js +0 -6
  376. package/dist/chunk-SEV3S3WH.js +0 -8
  377. package/dist/chunk-STJ3LWFL.js +0 -1
  378. package/dist/chunk-TAV2ENJY.js +0 -1
  379. package/dist/chunk-TQNALMQH.js +0 -3
  380. package/dist/chunk-TUJNCWHZ.js +0 -1
  381. package/dist/chunk-U564K7SX.js +0 -1
  382. package/dist/chunk-UKQ7NE5V.js +0 -1
  383. package/dist/chunk-V65P572N.js +0 -10
  384. package/dist/chunk-VFIVXK53.js +0 -2
  385. package/dist/chunk-VVFPW4ZQ.js +0 -2
  386. package/dist/chunk-VYITPC34.js +0 -11
  387. package/dist/chunk-W4X3635B.js +0 -1
  388. package/dist/chunk-WEEYQX3M.js +0 -1
  389. package/dist/chunk-WO7LKJCJ.js +0 -1
  390. package/dist/chunk-WR2ZQGUR.js +0 -1
  391. package/dist/chunk-WW7TENNA.js +0 -1
  392. package/dist/chunk-XGMPC7KK.js +0 -2
  393. package/dist/chunk-Y4QC2YVE.js +0 -1
  394. package/dist/chunk-YNJZ2VXV.js +0 -5
  395. package/dist/chunk-Z5DDPQ26.js +0 -3
  396. package/dist/chunk-ZK7VJZ6V.js +0 -6
  397. package/dist/chunk-ZLT4DPHN.js +0 -5
  398. package/dist/chunk-ZOBQKNGK.js +0 -1
  399. package/dist/chunk-ZTE46E4Z.js +0 -153
  400. package/dist/conf-store-N5P2ZEAD.js +0 -1
  401. package/dist/custom-oclif-loader-4ZAXX5MR.js +0 -1
  402. package/dist/deprecations-4TY4DNME.js +0 -1
  403. package/dist/dist-6ZJS4I57.js +0 -1
  404. package/dist/dist-7W2KJOYN.js +0 -1
  405. package/dist/environments-TR5WW2MD.js +0 -1
  406. package/dist/error-VJQM4MFE.js +0 -1
  407. package/dist/error-handler-IYGE3Z72.js +0 -1
  408. package/dist/fs-EOQL26C3.js +0 -1
  409. package/dist/hooks/app-init.d.ts +0 -9
  410. package/dist/hooks/app-init.js +0 -1
  411. package/dist/is-global-RQCPBQA3.js +0 -1
  412. package/dist/is-wsl-UEMXYJPN.js +0 -1
  413. package/dist/lib-JKLF33A7.js +0 -1
  414. package/dist/local-TW3HCZ2S.js +0 -1
  415. package/dist/local-storage-T6FKS53K.js +0 -1
  416. package/dist/metadata-TYZDEER5.js +0 -1
  417. package/dist/node-package-manager-6SWUZILX.js +0 -1
  418. package/dist/notifications-system-SMHMV2UW.js +0 -1
  419. package/dist/output-JG5I2TEL.js +0 -1
  420. package/dist/system-D4Z32GDS.js +0 -1
  421. package/dist/ui-6M3XZ6MR.js +0 -1
  422. package/dist/upgrade-EKAG4IV7.js +0 -1
  423. package/dist/version-6UBWZCNS.js +0 -1
  424. package/dist/version-XRU7TEAI.js +0 -1
  425. package/dist/workerd-LXBSJULF.js +0 -18
  426. /package/dist/{chunk-VDN6MEYI.js → chunk-NJPL5BTN.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import{a as E}from"./chunk-DQCIORGH.js";import{e as R}from"./chunk-KOVAFUYN.js";import{a as j}from"./chunk-E2W5OYYM.js";import{c as O,i as k,o as x}from"./chunk-LZ3GZ7NS.js";import{p as v,v as A}from"./chunk-OORWOTAP.js";import{b as F,c as L}from"./chunk-JJJTPEMD.js";import{N as y}from"./chunk-GMTNOCMS.js";import{h as T}from"./chunk-R2R6JDNH.js";import{a as D}from"./chunk-CTNBSUVU.js";import{$a as $,Ab as n,la as w,ua as P,wb as S}from"./chunk-Y34LWI3S.js";import{d as l,i as u}from"./chunk-773TIA5M.js";import{e as q,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();import{fileURLToPath as U}from"node:url";async function _(...r){let e=await $("package.json",{cwd:U(import.meta.url),type:"file"});if(!e)throw new Error("Failed to find CLI root path");return e.endsWith("/packages/theme/package.json")?l(u(e),"assets",...r):l(u(e),"dist","assets",...r)}async function b(r,e,i,t,a,m){let c=await O(r)?await j(m,r.storeFqdn):void 0;if(a)throw new T("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let f=await x(e,r,a,c),o=await k(f,{method:"GET",path:i,query:[],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(o.status!==200){let h=await o.text();throw new Error(`Bad response: ${o.status}: ${h}`)}let s=await o.text();t?S(s):await I(s)}async function I(r){let e=process.env.WSL_DISTRO_NAME,i=e?`//wsl$/${e}`:"",t=await _("speedscope","index.html");n(`[Theme Profile] Resolved URL to open: ${t}`);let a="liquid-profile",m=Buffer.from(r).toString("base64"),c=`speedscope.loadFileFromBase64(${JSON.stringify(a)}, ${JSON.stringify(m)})`,f=`speedscope-${Number(new Date)}-${process.pid}`,o=l(w(),`${f}.js`);n(`[Theme Profile] writing JS file to: ${o}`),await P(o,c),n(`[Theme Profile] JS file created successfully: ${o}`),t=`${i}${t}`,o=`${i}${o}`,t+=`#localProfilePath=${o}`;let s=l(w(),`${f}.html`);n(`[Theme Profile] writing HTML file to: ${s}`),await P(s,`<script>window.location=${JSON.stringify(t)}</script>`),n(`[Theme Profile] HTML file created successfully: ${s}`),s=`${i}${s}`,t=`file://${s}`,n(`[Theme Profile] Opening URL: ${t}`);let h=await y(t);n(`[Theme Profile] URL opened successfully: ${h}`)}var d=q(D(),1);var g=class extends A{static summary="Profile the Liquid rendering of a theme page.";static usage=["theme profile","theme profile --url /products/classic-leather-jacket"];static descriptionWithMarkdown=`Profile the Shopify Liquid on a given page.
2
+
3
+ This command will open a web page with the Speedscope profiler detailing the time spent executing Liquid on the given page.`;static description=this.descriptionWithoutMarkdown();static flags={...F,...v,theme:d.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),url:d.Flags.string({description:"The url to be used as context",env:"SHOPIFY_FLAG_URL",default:"/"}),"store-password":d.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),...L};static multiEnvironmentsFlags=null;async command(e,i){let{password:t}=e,a;e.theme?a={filter:{theme:e.theme}}:a={filter:{live:!0}};let m=await E(i,a),c=[{title:`Generating Liquid profile for ${i.storeFqdn} ${e.url}`,task:async()=>{await b(i,m.id.toString(),e.url,e.json,t,e["store-password"])}}];await R(c)}};export{g as a};
@@ -1,2 +1,2 @@
1
- import{Pb as d}from"./chunk-3TFUSDHY.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
1
+ import{Ab as d}from"./chunk-Y34LWI3S.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
2
2
  `).forEach(function(a){let l=a.match(/^(\d+)\s(.*)$/);if(l){let u=l[1],E=l[2];s[n].push(u),s[u]=[],d(`Killing process ${u}: ${E}`),e.add(u),h(u,s,e,i,o)}})};t.on("close",c)}export{b as a};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-VZKR2YFM.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=e({cmd_app_warning_api_key_deprecation_displayed:!1}),i=t;export{i as a};
1
+ import{a as e}from"./chunk-JQISGC7D.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=e({cmd_app_warning_api_key_deprecation_displayed:!1}),i=t;export{i as a};
@@ -0,0 +1,5 @@
1
+ import{o as R}from"./chunk-GMTNOCMS.js";import{h as E}from"./chunk-R2R6JDNH.js";import{Ab as i,Bb as m,Y as b,ca as N}from"./chunk-Y34LWI3S.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var l=class{export;input;inputBytes;output;outputBytes;logs;functionId;fuelConsumed;target;errorMessage;errorType;inputQueryVariablesMetafieldValue;inputQueryVariablesMetafieldNamespace;inputQueryVariablesMetafieldKey;constructor({export:e,input:r,inputBytes:o,output:n,outputBytes:s,logs:a,functionId:h,fuelConsumed:u,target:A,errorMessage:S,errorType:g,inputQueryVariablesMetafieldValue:w,inputQueryVariablesMetafieldNamespace:M,inputQueryVariablesMetafieldKey:I}){this.export=e,this.input=r,this.inputBytes=o,this.output=n,this.outputBytes=s,this.logs=a,this.functionId=h,this.fuelConsumed=u,this.target=A,this.errorMessage=S,this.errorType=g,this.inputQueryVariablesMetafieldValue=w,this.inputQueryVariablesMetafieldNamespace=M,this.inputQueryVariablesMetafieldKey=I}},f=class{cacheEntryEpochMs;cacheTtlMs;httpRequest;httpResponse;constructor({cacheEntryEpochMs:e,cacheTtlMs:r,httpRequest:o,httpResponse:n}){this.cacheEntryEpochMs=e,this.cacheTtlMs=r,this.httpRequest=o,this.httpResponse=n}},_;(function(t){t[t.NoCachedResponse=0]="NoCachedResponse",t[t.CacheAboutToExpire=1]="CacheAboutToExpire",t[t.Unknown=2]="Unknown"})(_||(_={}));var d=class{reason;httpRequest;constructor({reason:e,httpRequest:r}){this.reason=e,this.httpRequest=r}},y=class{attempt;connectTimeMs;writeReadTimeMs;httpRequest;httpResponse;error;constructor({attempt:e,connectTimeMs:r,writeReadTimeMs:o,httpRequest:n,httpResponse:s,error:a}){this.attempt=e,this.connectTimeMs=r,this.writeReadTimeMs=o,this.httpRequest=n,this.httpResponse=s,this.error=a}};c();function O(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function C(t,e){return e?.deep&&O(t)||e?.deep&&Array.isArray(t)?p(t,e):t}function p(t,e){if(Array.isArray(t))return t.map(r=>e?.deep?p(r,e):r);if(O(t)){let r={};for(let[o,n]of Object.entries(t))r[b(o)]=C(n,e);return r}return t}var L=450,P=5*1e3,T=60*1e3,H=5,W=1e6,V="function_run",z="function_network_access",U="function_network_access.response_from_cache",q="function_network_access.request_execution_in_background",J="function_network_access.request_execution",Z="no_cached_response",ee="cached_response_about_to_expire";function te(t){let e=JSON.parse(t),r=e.input_query_variables_metafield_value&&x(e.input_query_variables_metafield_value);return new l({export:e.export,input:e.input,inputBytes:e.input_bytes,output:e.output,outputBytes:e.output_bytes,logs:e.logs,functionId:e.function_id,fuelConsumed:e.fuel_consumed,target:e.target,errorMessage:e.error_message,errorType:e.error_type,inputQueryVariablesMetafieldValue:r,inputQueryVariablesMetafieldNamespace:e.input_query_variables_metafield_namespace,inputQueryVariablesMetafieldKey:e.input_query_variables_metafield_key})}function re(t){let e=JSON.parse(t);return new f({cacheEntryEpochMs:e.cache_entry_epoch_ms,cacheTtlMs:e.cache_ttl_ms,httpRequest:e.http_request,httpResponse:e.http_response})}var Q={no_cached_response:_.NoCachedResponse,cached_response_about_to_expire:_.CacheAboutToExpire};function se(t){let e=JSON.parse(t);return new d({reason:Q[e.reason]??_.Unknown,httpRequest:e.http_request})}function oe(t){let e=JSON.parse(t);return new y({attempt:e.attempt,connectTimeMs:e.connect_time_ms??null,writeReadTimeMs:e.write_read_time_ms??null,httpRequest:e.http_request,httpResponse:e.http_response??null,error:e.error??null})}var ne=async t=>{let{errors:e}=t.response,r=L,o=null,n="not_attempted";if(e.length>0)if(i(`Errors: ${e.map(s=>s.message).join(", ")}`),e.some(s=>s.status===401))try{o=await t.onResubscribe(),n="succeeded"}catch(s){i(`Failed to resubscribe to app logs: ${s}`),r=T,n="failed",t.onThrottle(r)}else e.some(s=>s.status===429)?(r=T,t.onThrottle(r)):(r=P,t.onUnknownError(r));return{retryIntervalMs:r,nextJwtToken:o,resubscribeResult:n}};function ae(t){return t.allExtensions.flatMap(e=>e.isFunctionExtension?[`extensions.${e.configuration.handle}`]:[])}var ie=({appLog:t,appLogPayload:e,storeName:r,prettyPrint:o=!0})=>{let{cursor:n,...s}=t,a=p({...s,payload:e,localTime:N(t.log_timestamp),storeName:r});return e instanceof l&&(a.payload.logs=e.logs.split(`
2
+ `).filter(Boolean),a.payload.inputQueryVariablesMetafieldValue&&(a.payload.inputQueryVariablesMetafieldValue=x(a.payload.inputQueryVariablesMetafieldValue))),o?JSON.stringify(a,null,2):JSON.stringify(a)},pe=(t,e)=>{let r=p(JSON.parse(t));return e===V?new l(r):e===U?new f(r):e===q?new d(r):e===J?new y(r):r},ue=async(t,e,r,o)=>{let n=await t.subscribeToAppLogs(e,r);if(!n.appLogsSubscribe)throw new E("Failed to subscribe to app logs: No response received");let{jwtToken:s,success:a,errors:h}=n.appLogsSubscribe;if(i(`Token: ${s}
3
+ `),i(`API Key: ${e.apiKey}
4
+ `),h&&h.length>0){let u=h.join(", ");throw await R({stripAnsi:!1},()=>{m(`Errors subscribing to app logs: ${u}`,o),m("App log streaming is not available in this session.",o)}),new E(u)}else{if(!s)throw new E("Failed to subscribe to app logs: No response received");let u=Array.isArray(e.shopIds)?e.shopIds:[e.shopIds];i(`Subscribed to App Events for shop ID(s) ${u.join(", ")}`),a!==void 0&&i(`Success: ${a}
5
+ `)}return s};function ce(t){try{if(typeof t=="string"){let e=JSON.parse(t);return JSON.stringify(e,null,2)}else return typeof t=="object"&&t!==null?JSON.stringify(t,null,2):void 0}catch(e){throw new Error(`Error parsing JSON: ${e}`)}}var x=t=>{try{return JSON.parse(t)}catch{return t}};export{l as a,f as b,_ as c,d,y as e,p as f,L as g,P as h,H as i,W as j,V as k,z as l,U as m,q as n,J as o,Z as p,ee as q,te as r,re as s,se as t,oe as u,ne as v,ae as w,ie as x,pe as y,ue as z,ce as A};
@@ -0,0 +1,4 @@
1
+ import{a as M}from"./chunk-H5KWM27L.js";import{a as E}from"./chunk-NEMPLS7C.js";import{a as I}from"./chunk-KUNDCAQN.js";import{B as C,sa as j}from"./chunk-ACTDYTAV.js";import{e as O}from"./chunk-CTRXLZAJ.js";import{a as z}from"./chunk-KIYHEMHD.js";import{b as R}from"./chunk-JJJTPEMD.js";import{C as y,V as _,ha as h,ka as g}from"./chunk-YN6A26QL.js";import{H as T,I as k,y as A}from"./chunk-GMTNOCMS.js";import{k as D}from"./chunk-R2R6JDNH.js";import{a as H}from"./chunk-CTNBSUVU.js";import{qb as p,sb as m,xb as f}from"./chunk-Y34LWI3S.js";import{e as F,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};l();async function J(e){let i="Admin",n=O(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function P(e){return g({query:e.query,...await J(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}l();var w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var x=F(z(),1);var Q={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function $({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>P({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),s=[];for(s.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),s.push(...o.nodes);return{status:"ok",items:s}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function V(e,i){let n="";for(let t of e)n=(0,x.updateTomlValues)(n,t);return`# ${i}
2
+ ${n}`}function Z(e,i){let n=i.map(oe).map(a=>{switch(a.status){case"ok":{let{typeName:o,patches:s}=a;return V(s,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:s})=>a.map(r=>({result:de(r,o),graphQLOwner:s}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:s,key:r,patches:N}=a;return V(N,`namespace: ${s==="app"?"$app":`$app:${s}`} key: ${r} owner_type: ${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null);return{tomlContent:[...n,...t].join(`
3
+ `),metafieldCount:t.length,metaobjectCount:n.length}}async function q(e){let i=await ae(e),n=i.storeFqdn,t=await ee(i),d=await ne(i);e.includeExistingDeclaredDefinitions||(t=ie(t,e.appConfiguration),d=te(d,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:s}=Z(t,d);X(o,s,n,a)}function X(e,i,n,t){A({headline:"Conversion to TOML complete.",body:["Converted",{warn:`${e} metafields`},"and",{warn:`${i} metaobjects`},"from",{warn:n},"into TOML, ready for you to copy."],orderedNextSteps:!0,nextSteps:["Review the suggested TOML carefully before applying.",["Missing sections? Make sure your app has the required access scopes to load metafields and metaobjects (e.g.",{command:"read_customers"},"to load customer metafields,",{command:"read_metaobject_definitions"},"to load metaobjects.)"],["Missing definitions? Only metafields and metaobjects that are app-reserved (using",{command:"$app"},") will be converted."],["When you're ready, add the generated TOML to your app's configuration file and test out changes with the",{command:"shopify app dev"},"command."]]}),ce(t)}async function ee(e){let i=[];return await T(Object.entries(Q).map(([n,t])=>({title:m`Loading ${p.green(n)} metafields`,task:async()=>{let d=await $({query:L,session:e,toNodes:a=>a.metafieldDefinitions,toVariables:a=>({ownerType:t,after:a})});i.push({metafields:d,ownerType:n,graphQLOwner:t})}}))),i.map(({metafields:n,ownerType:t,graphQLOwner:d})=>n.status==="ok"?{ownerType:t,items:n.items,graphQLOwner:d}:null).filter(n=>n!==null)}async function ne(e){let i=await k({title:m`Loading ${p.green("metaobjects")}`,task:async()=>$({query:w,session:e,toNodes:n=>n.metaobjectDefinitions,toVariables:n=>({after:n})})});return i.status==="ok"?i.items:[]}function ie(e,i){return e.map(n=>{let t=n.items.filter(d=>!K(i,[n.ownerType,"metafields",u(d.namespace)??"",d.key]));return t.length>0?{...n,items:t}:null}).filter(n=>n!==null)}function te(e,i){return e.filter(n=>!K(i,["metaobjects","app",u(n.type)??""]))}function K(e,i){let n=e;for(let t of i){if(!n[t])return!1;n=n[t]}return!0}async function ae(e){let{remoteApp:i,store:n}=e,t=i.apiSecretKeys[0]?.secret;if(!t)throw new D("No API secret keys found for app");return await _(n.shopDomain,i.apiKey,t)}function u(e){if(!e.match(/^app--\d+/))return null;let i="app";return e.match(/^app--\d+--/)&&(i=e.replace(/^app--\d+--/,"")),i}function de(e,i){let n=u(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,d=se(e),a=re(d,i,n,t);return{status:"ok",key:t,namespace:n,patches:a}}function oe(e){let i=u(e.type);if(!i)return{status:"not_app_reserved"};let n=le(e,i),t=me(n,i);return{status:"ok",typeName:i,patches:t}}function se(e){let i={name:e.name===e.key?void 0:e.name,type:e.type.name,description:e.description??void 0,capabilities:c({admin_filterable:e.capabilities.adminFilterable.enabled||void 0}),access:c({admin:W(e.access.admin),storefront:Y(e.access.storefront),customer_account:ue(e.access.customerAccount)}),validations:G(e.validations)},{type:n,validations:t}=U(i.type,i.validations);return i.type=n,i.validations=t,i}function le(e,i){return{name:e.name===i?void 0:e.name,description:e.description??void 0,display_name_field:e.displayNameKey??void 0,access:c({admin:W(e.access.admin),storefront:Y(e.access.storefront)}),capabilities:c({translatable:e.capabilities.translatable.enabled||void 0,publishable:e.capabilities.publishable.enabled||void 0,renderable:e.capabilities.renderable?.enabled||void 0,renderable_meta_title_field:e.capabilities.renderable?.data?.metaTitleKey??void 0,renderable_meta_description_field:e.capabilities.renderable?.data?.metaDescriptionKey??void 0}),fields:Object.fromEntries(e.fieldDefinitions.map(n=>{let t={type:n.type.name,description:n.description??void 0,name:n.name===n.key?void 0:n.name,required:n.required||void 0,validations:G(n.validations)},{type:d,validations:a}=U(t.type,t.validations);return t.type=d,t.validations=a,[n.key,t]}))}}function U(e,i){if(!i)return{type:e,validations:void 0};if(i.metaobject_definition_type&&typeof i.metaobject_definition_type=="string"){let n=u(i.metaobject_definition_type);return{type:`${e}<$app:${n}>`,validations:c({...i,metaobject_definition_type:void 0})}}if(i.metaobject_definition_types&&Array.isArray(i.metaobject_definition_types)&&i.metaobject_definition_types.every(n=>typeof n=="string")){let n=i.metaobject_definition_types.map(t=>u(t));return{type:`${e}<${n.map(t=>`$app:${t}`).join(",")}>`,validations:c({...i,metaobject_definition_types:void 0})}}return{type:e,validations:i}}function G(e){let i=n=>{try{return JSON.parse(n)}catch{return n}};return c(Object.fromEntries(e.filter(n=>n.value!==void 0&&n.name!=="metaobject_definition_id"&&n.name!=="metaobject_definition_ids").map(n=>[n.name,n.value?i(n.value):void 0])))}function re(e,i,n,t){let d=[[[i,"metafields",n,t,"name"],e.name],[[i,"metafields",n,t,"type"],e.type],[[i,"metafields",n,t,"description"],e.description]],a=[[[i,"metafields",n,t,"access","admin"],e.access?.admin],[[i,"metafields",n,t,"access","storefront"],e.access?.storefront],[[i,"metafields",n,t,"access","customer_account"],e.access?.customer_account],[[i,"metafields",n,t,"capabilities","admin_filterable"],e.capabilities?.admin_filterable||void 0]];return e.validations&&B(e.validations).forEach(({validationKey:s,actualValue:r})=>{d.push([[i,"metafields",n,t,"validations",s],r])}),[v(d),v(a)]}function me(e,i){let n=[[["metaobjects","app",i,"name"],e.name===i?void 0:e.name],[["metaobjects","app",i,"description"],e.description],[["metaobjects","app",i,"display_name_field"],e.display_name_field]],t=[[["metaobjects","app",i,"access","admin"],e.access?.admin],[["metaobjects","app",i,"access","storefront"],e.access?.storefront]];return e.capabilities?.translatable&&t.push([["metaobjects","app",i,"capabilities","translatable"],!0]),e.capabilities?.publishable&&t.push([["metaobjects","app",i,"capabilities","publishable"],!0]),e.capabilities?.renderable&&(t.push([["metaobjects","app",i,"capabilities","renderable"],!0]),e.capabilities?.renderable_meta_title_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_title_field"],e.capabilities.renderable_meta_title_field]),e.capabilities?.renderable_meta_description_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_description_field"],e.capabilities.renderable_meta_description_field])),Object.entries(e.fields).forEach(([d,a])=>{if(typeof a=="string")n.push([["metaobjects","app",i,"fields",d],a]);else{let o=Object.fromEntries(Object.entries(a).filter(([s,r])=>r!==void 0));Object.keys(o).length===1?n.push([["metaobjects","app",i,"fields",d],a.type]):(n.push([["metaobjects","app",i,"fields",d,"type"],a.type]),n.push([["metaobjects","app",i,"fields",d,"description"],a.description]),n.push([["metaobjects","app",i,"fields",d,"name"],a.name]),n.push([["metaobjects","app",i,"fields",d,"required"],a.required||void 0]),a.validations&&B(a.validations).forEach(({validationKey:r,actualValue:N})=>{n.push([["metaobjects","app",i,"fields",d,"validations",r],N])}))}}),[v(n),v(t)]}function B(e){return Object.entries(e).map(([i,n])=>{let t;return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&n.every(d=>typeof d=="string")?t=n:t=JSON.stringify(n),{validationKey:i,actualValue:t}})}function ce(e){let i=e.split(`
4
+ `);for(let n of i)n.match(/^\s*\[/)?f(m`${p.green(n)}`):n.match(/^\s*#/)?f(m`${p.gray(n)}`):f(m`${n}`)}function W(e){switch(e){case"MERCHANT_READ_WRITE":return"merchant_read_write";case"MERCHANT_READ":case"PRIVATE":case"PUBLIC_READ":case"PUBLIC_READ_WRITE":case null:case void 0:return}}function Y(e){switch(e){case"PUBLIC_READ":return"public_read";case"NONE":case null:case void 0:return}}function ue(e){switch(e){case"READ":return"read";case"READ_WRITE":return"read_write";case"NONE":case null:case void 0:return}}function c(e){if(e&&!h(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function v(e){return e.filter(([i,n])=>n!==void 0)}var b=F(H(),1);var S=class e extends E{static summary="Import metafield and metaobject definitions.";static descriptionWithMarkdown="Import metafield and metaobject definitions from your development store. [Read more about declarative custom data definitions](https://shopify.dev/docs/apps/build/custom-data/declarative-custom-data-definitions).";static description=this.descriptionWithoutMarkdown();static flags={...R,...I,store:b.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>y(i)}),"include-existing":b.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})};async run(){let{appContextResult:i,...n}=await k({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(e);await C(t.path);let d=await j({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await M({appContextResult:d,storeFqdn:t.store,forceReselectStore:t.reset});return{appContextResult:d,appConfiguration:d.app.configuration,remoteApp:d.remoteApp,store:a,includeExistingDeclaredDefinitions:t["include-existing"]}}});return await q(n),{app:i.app}}};export{S as a};
@@ -0,0 +1 @@
1
+ import{a as w}from"./chunk-OUZGGWFN.js";import{a as y}from"./chunk-PANGX7SA.js";import{a as h}from"./chunk-KUNDCAQN.js";import{g,ta as b}from"./chunk-ACTDYTAV.js";import{b as u}from"./chunk-JJJTPEMD.js";import{S as f,x as d,z as m}from"./chunk-GMTNOCMS.js";import{d as l}from"./chunk-JQISGC7D.js";import{a as A}from"./chunk-CTNBSUVU.js";import{e as _,g as s}from"./chunk-VKWPEFWQ.js";s();s();s();async function p(e,{web:i,stdout:t,stderr:a,signal:n,env:o={}}){let c=i.configuration.commands[e];if(!c)return;let[I,...v]=c.split(" ");await f(I,v,{cwd:i.directory,stdout:t,stderr:a,signal:n,env:o}),t.write("Web successfully built.")}async function S(e){!e.skipDependenciesInstallation&&!e.project.usesWorkspaces&&await y(e.project);let i={};e.apiKey&&(i.SHOPIFY_API_KEY=e.apiKey),await g(e.app),await d({processes:[...e.app.webs.map(t=>({prefix:["web",...t.configuration.roles].join("-"),action:async(a,n,o)=>{await p("build",{web:t,stdout:a,stderr:n,signal:o,env:i})}})),...e.app.allExtensions.map(t=>({prefix:t.localIdentifier,action:async(a,n,o)=>{await t.build({stdout:a,stderr:n,signal:o,app:e.app,environment:"production"})}}))],showTimestamps:!1}),m({headline:[{userInput:e.app.name},"built!"]})}var k=S;var x=_(A(),1);var r=class e extends w{static summary="Build the app, including extensions.";static descriptionWithMarkdown="This command executes the build script specified in the element's TOML file. You can specify a custom script in the file. To learn about configuration files in Shopify apps, refer to [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration).\n\n If you're building a [theme app extension](https://shopify.dev/docs/apps/online-store/theme-app-extensions), then running the `build` command runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) against your extension to ensure that it's valid.";static description=this.descriptionWithoutMarkdown();static flags={...u,...h,"skip-dependencies-installation":x.Flags.boolean({hidden:!1,description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1})};async run(){let{flags:i}=await this.parse(e),t=i["client-id"];await l(()=>({cmd_app_dependency_installation_skipped:i["skip-dependencies-installation"]}));let{app:a,project:n}=await b({directory:i.path,userProvidedConfigName:i.config});return await k({app:a,project:n,skipDependenciesInstallation:i["skip-dependencies-installation"],apiKey:t}),{app:a}}};export{r as a};
@@ -0,0 +1 @@
1
+ import{b as n}from"./chunk-TTAPXLI5.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends Error{type;constructor(e,p){super(p),this.type=e}},i=r=>async()=>r,s=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var d="cloudflare",v=i({name:d});export{o as a,s as b,d as c,v as d};
@@ -0,0 +1,2 @@
1
+ import{$ as j,S as X,_ as z,aa as v,ba as J,ca as A,da as W,ea as k,fa as q,ga as N,ha as B,ia as L,ja as K,ka as R,la as Q}from"./chunk-ACTDYTAV.js";import{f as T,i as G,p as l}from"./chunk-F5HCSUXC.js";import{c as H}from"./chunk-KIYHEMHD.js";import{D as x,z as U}from"./chunk-GMTNOCMS.js";import{h as C,j as P}from"./chunk-R2R6JDNH.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-Y34LWI3S.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
2
+ `)})}s();async function Lt({developerPlatformClient:e,apiKey:t,organizationId:i,extensionTypes:o,onlyDashboardManaged:n=!1}){let r=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:i}),{dashboardManagedExtensionRegistrations:p,extensionRegistrations:a}=r.app;return(n?p:a.concat(p)).filter(u=>{let h=o.includes(u.type.toLowerCase()),f=u.activeVersion&&u.activeVersion.config,m=u.draftVersion&&u.draftVersion.config;return h&&(f??m)})}export{se as a,ft as b,vt as c,Ce as d,we as e,At as f,Lt as g};
@@ -0,0 +1,2 @@
1
+ import{A as x,a as oe,b as ne,c as M,d as ie,e as ae,g as L,i as P,j as le,k as ce,m as ue,n as pe,o as me,r as fe,s as de,t as ge,u as Ee,v,w as he,x as ye,y as Te,z as S}from"./chunk-U7R6LYPJ.js";import{a as se}from"./chunk-H5KWM27L.js";import{a as re}from"./chunk-NEMPLS7C.js";import{a as K}from"./chunk-KUNDCAQN.js";import{B as W,R as Z,T as ee,l as z,sa as te}from"./chunk-ACTDYTAV.js";import{ba as X}from"./chunk-F5HCSUXC.js";import{b as Q,c as Y}from"./chunk-JJJTPEMD.js";import{C as $}from"./chunk-YN6A26QL.js";import{d as _,e as f,f as o,l as G,y as H}from"./chunk-GMTNOCMS.js";import{h as N}from"./chunk-R2R6JDNH.js";import{a as Ne}from"./chunk-CTNBSUVU.js";import{ca as V,wb as F,xb as I}from"./chunk-Y34LWI3S.js";import{j}from"./chunk-773TIA5M.js";import{e as k,g as E}from"./chunk-VKWPEFWQ.js";E();E();E();E();E();E();var C=k(_(),1);function we(t){let s=(0,C.useRef)(t);(0,C.useEffect)(()=>{s.current=t},[t]),(0,C.useEffect)(()=>{let n;function i(){s.current().then(({retryIntervalMs:a})=>{a&&(n=setTimeout(i,a))}).catch(()=>{})}return n=setTimeout(i,0),()=>n&&clearTimeout(n)},[])}E();var U=async({pollOptions:{jwtToken:t,cursor:s,filters:n},developerPlatformClient:i,organizationId:l})=>{let a=await i.appLogs({jwtToken:t,cursor:s},l),{errors:p,status:u}=a;if(u!==200){if(u===401||u===429||u>=500)return{errors:p.map(T=>({status:u,message:T}))};throw new N(`${p.join(", ")} while fetching app logs`)}let{cursor:r,app_logs:c}=a,d=Ce(c,n);return{cursor:r,appLogs:d}};function Ce(t,s){let n=t;return(s.status!==void 0||s.sources!==void 0)&&(n=n.filter(i=>{let l=s.status===void 0?!0:i.status===s.status,a=s.sources===void 0?!0:s.sources.includes(`${i.source_namespace}.${i.source}`);return l&&a})),n}var b=k(_(),1);async function _e({jwtToken:t,cursor:s,filters:n,storeNameById:i,organizationId:l,setErrors:a,setAppLogOutputs:p,resubscribeCallback:u,developerPlatformClient:r}){let c=t,d=L,T=s,R=await U({pollOptions:{jwtToken:t,cursor:s,filters:n},developerPlatformClient:r,organizationId:l}),m="not_attempted",w=R;if(w.errors){let h=await v({response:w,onThrottle:g=>{a(["Request throttled while polling app logs.",`Retrying in ${g/1e3}s`])},onUnknownError:g=>{a(["Error while polling app logs",`Retrying in ${g/1e3}s`])},onResubscribe:()=>u()});m=h.resubscribeResult,h.nextJwtToken&&(c=h.nextJwtToken),d=h.retryIntervalMs}else{a(g=>g.length?[]:g);let{appLogs:h}=R;if(T=R.cursor,h)for(let g of h){let y,A,O,J=i.get(g.shop_id.toString());if(J===void 0)continue;switch(g.log_type){case ce:y=fe(g.payload),A=`export "${y.export}" executed in ${(y.fuelConsumed/le).toFixed(4)}M instructions`;break;case ue:y=de(g.payload),A="network access response retrieved from cache";break;case pe:y=ge(g.payload),A="network access request executing in background";break;case me:y=Ee(g.payload),O=y.connectTimeMs&&y.writeReadTimeMs?y.connectTimeMs+y.writeReadTimeMs:null,A=`network access request executed${O?` in ${O} ms`:""}`;break;default:continue}let Ae={status:g.status==="success"?"Success":"Failure",source:g.source,storeName:J,description:A,logTimestamp:V(g.log_timestamp)};y&&p(ke=>[...ke,{appLog:y,prefix:Ae}])}}return{nextJwtToken:c,retryIntervalMs:d,cursor:T??s,resubscribeResult:m}}function be({initialJwt:t,filters:s,resubscribeCallback:n,storeNameById:i,developerPlatformClient:l,organizationId:a}){let[p,u]=(0,b.useState)([]),[r,c]=(0,b.useState)([]),d=(0,b.useRef)(t),T=(0,b.useRef)(0),R=(0,b.useRef)(""),m=(0,b.useRef)(0),w=(0,b.useCallback)(async()=>{let h=await _e({jwtToken:d.current,cursor:R.current,filters:s,storeNameById:i,setErrors:u,setAppLogOutputs:c,resubscribeCallback:n,developerPlatformClient:l,organizationId:a});if(h.resubscribeResult==="failed"){if(m.current+=1,m.current>=P)return u(["App log streaming session has expired. Please restart your dev session."]),{retryIntervalMs:0}}else h.resubscribeResult==="succeeded"&&(m.current=0);return d.current=h.nextJwtToken,R.current=h.cursor,T.current=h.retryIntervalMs,{retryIntervalMs:T.current}},[]);return we(w),{appLogOutputs:r,errors:p}}var e=k(_(),1);var Fe=t=>{switch(t){case M.NoCachedResponse:return"No cached response available";case M.CacheAboutToExpire:return"Cache is about to expire";case M.Unknown:return"Unknown reason"}},Re=({pollOptions:{jwtToken:t,filters:s},resubscribeCallback:n,storeNameById:i,developerPlatformClient:l,organizationId:a})=>{let{appLogOutputs:p,errors:u}=be({filters:s,initialJwt:t,resubscribeCallback:n,storeNameById:i,developerPlatformClient:l,organizationId:a});return e.default.createElement(e.default.Fragment,null,p.map(({appLog:r,prefix:c},d)=>e.default.createElement(f,{flexDirection:"column",key:d},e.default.createElement(f,{flexDirection:"row",gap:1},e.default.createElement(o,null,e.default.createElement(o,{color:"green"},c.logTimestamp," "),e.default.createElement(o,{color:"blueBright"},`${c.storeName.split(".")[0]}`," "),e.default.createElement(o,{color:"blueBright"},c.source," "),e.default.createElement(o,{color:c.status==="Success"?"green":"red"},c.status," "),e.default.createElement(o,null,c.description))),e.default.createElement(f,{flexDirection:"column",marginLeft:4},r instanceof oe&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,r.logs),r.inputQueryVariablesMetafieldKey&&r.inputQueryVariablesMetafieldNamespace?e.default.createElement(f,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Input Query Variables:"),e.default.createElement(f,{flexDirection:"row",marginLeft:1,marginTop:1},e.default.createElement(o,{dimColor:!0},"Namespace:"),e.default.createElement(o,null," ",r.inputQueryVariablesMetafieldNamespace)),e.default.createElement(f,{flexDirection:"row",marginLeft:1},e.default.createElement(o,{dimColor:!0},"Key:"),e.default.createElement(o,null," ",r.inputQueryVariablesMetafieldKey)),e.default.createElement(f,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.inputQueryVariablesMetafieldValue)??e.default.createElement(o,{color:"red"},"Metafield is not set")))):null,r.input?e.default.createElement(f,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Input ",e.default.createElement(o,{dimColor:!0},"(",r.inputBytes," bytes):")),e.default.createElement(f,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.input)))):null,r.output?e.default.createElement(f,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Output ",e.default.createElement(o,{dimColor:!0},"(",r.outputBytes," bytes):")),e.default.createElement(f,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.output)))):null),r instanceof ne&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"Cache write time: ",new Date(r.cacheEntryEpochMs).toISOString()),e.default.createElement(o,null,"Cache TTL: ",r.cacheTtlMs/1e3," s"),e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest)),e.default.createElement(o,null,"HTTP response:"),e.default.createElement(o,null,x(r.httpResponse))),r instanceof ie&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"Reason: ",Fe(r.reason)),e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest))),r instanceof ae&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"Attempt: ",r.attempt),r.connectTimeMs?e.default.createElement(o,null,"Connect time: ",r.connectTimeMs," ms"):null,r.writeReadTimeMs?e.default.createElement(o,null,"Write read time: ",r.writeReadTimeMs," ms"):null,e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest)),r.httpResponse?e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"HTTP response:"),e.default.createElement(o,null,x(r.httpResponse))):null,r.error?e.default.createElement(o,null,"Error: ",r.error):null)))),u.length>0&&e.default.createElement(f,{flexDirection:"column"},u.map((r,c)=>e.default.createElement(f,{key:c},e.default.createElement(o,{color:"red"},r)))))};var xe=k(_(),1);async function Ie({pollOptions:t,options:{variables:s,developerPlatformClient:n},storeNameById:i,organizationId:l}){let a=async()=>S(n,s,l);return G(xe.default.createElement(Re,{pollOptions:t,resubscribeCallback:a,storeNameById:i,developerPlatformClient:n,organizationId:l}))}E();async function q({pollOptions:t,options:{variables:s,developerPlatformClient:n},storeNameById:i,organizationId:l,consecutiveResubscribeFailures:a=0}){let p=await U({pollOptions:t,developerPlatformClient:n,organizationId:l}),u=L,r=t.jwtToken,c=a,d=p;if(d.errors){let m=await v({response:d,onThrottle:w=>{I(JSON.stringify({message:"Request throttled while polling app logs.",retry_in_ms:w}))},onUnknownError:w=>{I(JSON.stringify({message:"Error while polling app logs.",retry_in_ms:w}))},onResubscribe:()=>S(n,s,l)});if(m.resubscribeResult==="failed"){if(c+=1,c>=P){I(JSON.stringify({message:"App log streaming session has expired. Please restart your dev session."}));return}}else m.resubscribeResult==="succeeded"&&(c=0);m.nextJwtToken&&(r=m.nextJwtToken),u=m.retryIntervalMs}else c=0;let{cursor:T,appLogs:R}=p;R&&R.forEach(m=>{let w=i.get(m.shop_id?.toString());w!==void 0&&F(ye({appLog:m,appLogPayload:Te(m.payload,m.log_type),storeName:w,prettyPrint:!1}))}),setTimeout(()=>{q({options:{variables:s,developerPlatformClient:n},pollOptions:{jwtToken:r||t.jwtToken,cursor:T??t.cursor,filters:t.filters},storeNameById:i,organizationId:l,consecutiveResubscribeFailures:c}).catch(m=>{throw m})},u)}async function Se(t){let{app:s,remoteApp:n,developerPlatformClient:i}=t,l=await Me(t),a=he(s);if(a.length===0)throw new N("This app has no log sources. Learn more about app logs at https://shopify.dev/docs/api/shopify-cli/app/app-logs");if(t.sources){let d=t.sources.filter(T=>!a.includes(T));if(d.length)throw new N(`Invalid sources: ${d.join(", ")}. Valid sources are: ${a.join(", ")}`)}let p={shopIds:l.storeIds.map(Number),apiKey:n.apiKey},u=await S(i,p,t.organization.id),r={status:t.status,sources:t.sources},c={jwtToken:u,filters:r};t.format==="json"?(F(JSON.stringify({subscribedToStores:t.storeFqdns})),I(JSON.stringify({message:"Waiting for app logs..."})),await q({options:{variables:p,developerPlatformClient:i},pollOptions:c,storeNameById:l.storeNameById,organizationId:t.organization.id})):(I(`Waiting for app logs...
2
+ `),await Ie({options:{variables:p,developerPlatformClient:i},pollOptions:c,storeNameById:l.storeNameById,organizationId:t.organization.id}))}async function Me(t){let{app:s,remoteApp:n,developerPlatformClient:i,primaryStore:l,organization:a}=t,p=j(s.configPath);t.format==="text"&&Le(n.title,l.shopDomain,t.storeFqdns,p,a.businessName);let u=new Map;return u.set(l.shopId,l.shopDomain),t.storeFqdns&&t.storeFqdns.length>1&&await Promise.all(t.storeFqdns?.slice(1).map(async c=>{let d=await X(a,c,i);u.set(d.shopId,c)})),{storeIds:Array.from(u.keys()),storeNameById:u}}function Le(t,s,n,i,l){let a=[];n&&n.length>0?n.forEach(u=>a.push(u)):a.push(s);let p=i?z(i):void 0;H({headline:i?`Using ${p} for default values:`:"Using these settings:",body:Z({appName:t,org:l,devStores:a,messages:[ee]})})}var B=k(Ne(),1);var D=class t extends re{static summary="Stream detailed logs for your Shopify app.";static descriptionWithMarkdown="\n Opens a real-time stream of detailed app logs from the selected app and store.\n Use the `--source` argument to limit output to a particular log source, such as a specific Shopify Function handle. Use the `shopify app logs sources` command to view a list of sources.\n Use the `--status` argument to filter on status, either `success` or `failure`.\n ```\n shopify app logs --status=success --source=extension.discount-function\n ```\n ";static description=this.descriptionWithoutMarkdown();static flags={...Q,...K,...Y,store:B.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",multiple:!0,parse:async s=>$(s)}),source:B.Flags.string({description:"Filters output to the specified log source.",env:"SHOPIFY_FLAG_SOURCE",multiple:!0}),status:B.Flags.string({description:"Filters output to the specified status (success or failure).",options:["success","failure"],env:"SHOPIFY_FLAG_STATUS"})};async run(){let{flags:s}=await this.parse(t);await W(s.path);let n=await te({directory:s.path,clientId:s["client-id"],forceRelink:s.reset,userProvidedConfigName:s.config}),i=await se({appContextResult:n,storeFqdn:s.store?.[0],forceReselectStore:s.reset}),l={...n,primaryStore:i,storeFqdns:s.store,sources:s.source,status:s.status,format:s.json?"json":"text"};return await Se(l),{app:n.app}}};export{D as a};
@@ -0,0 +1,5 @@
1
+ import{a as h}from"./chunk-H5KWM27L.js";import{a as l}from"./chunk-NEMPLS7C.js";import{a as m}from"./chunk-KUNDCAQN.js";import{sa as c}from"./chunk-ACTDYTAV.js";import{b as d}from"./chunk-JJJTPEMD.js";import{C as a}from"./chunk-YN6A26QL.js";import{z as p}from"./chunk-GMTNOCMS.js";import{h as n}from"./chunk-R2R6JDNH.js";import{a as C}from"./chunk-CTNBSUVU.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 n(`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 f=g(C(),1);var i=class t extends l{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.descriptionWithoutMarkdown();static flags={...d,...m,store:f.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 c({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),r=await h({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset});return await v({appContextResult:o,store:r}),{app:o.app}}};export{i as a};
@@ -1,4 +1,4 @@
1
- import{C as s,u as e,v as o,w as n,x as i,y as t}from"./chunk-6YCGMS7X.js";import{m as d,p as l}from"./chunk-ZTE46E4Z.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();async function u(){e({headline:"CLI update available.",body:["Run",{command:"npm run shopify upgrade"},{char:"."}]}),e({headline:["To connect this project to your shopify store cd into:",{filePath:"/my-store/hydrogen.config.js"},{char:"."}],body:["You can also try the following steps:",{list:{items:[["Run",{command:"shopify project connect"}],["Run",{command:"hydrogen start"}]]}}]}),e({headline:"About your app.",customSections:[{body:{tabularData:[["Configuration file",{filePath:"shopify.app.scalable-transaction-app.toml"}],["App name",{userInput:"scalable-transaction-app"}],["Access scopes","read_products,write_products"]],firstColumnSubdued:!0}}]}),e({headline:[{userInput:"my-app"},"initialized and ready to build."],nextSteps:[["Run",{command:"cd verification-app"}],["To preview your project, run",{command:"npm app dev"}],["To add extensions, run",{command:"npm generate extension"}]],reference:[["Run",{command:"npm shopify help"}],{link:{label:"Dev docs",url:"https://shopify.dev"}}],customSections:[{title:"Custom section",body:{list:{items:[{link:{label:"Item 1",url:"https://shopify.com"}},"Item 2",{link:{url:"https://community.shopify.com/"}}]}}},{title:"Custom section 2",body:{list:{items:["Item 1","Item 2","Item 3"]}}}]}),o({headline:"CLI updated.",body:"You are now running version 3.47."}),o({headline:"Deployment successful.",body:"Your extensions have been uploaded to your Shopify Partners Dashboard.",nextSteps:[{link:{label:"See your deployment and set it live",url:"https://partners.shopify.com/1797046/apps/4523695/deployments"}}]}),n({headline:"You have reached your limit of checkout extensions for this app.",body:"You can free up space for a new one by deleting an existing one."}),n({headline:"Required access scope update.",body:"The deadline for re-selecting your app scopes is May 1, 2022.",reference:[{link:{label:"Dev docs",url:"https://shopify.dev/app/scopes"}}]});let a=new l("Something went wrong.");a.stack=`
1
+ import{A as n,B as i,C as t,G as s,y as e,z as o}from"./chunk-GMTNOCMS.js";import{h as d,k as l}from"./chunk-R2R6JDNH.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();async function u(){e({headline:"CLI update available.",body:["Run",{command:"npm run shopify upgrade"},{char:"."}]}),e({headline:["To connect this project to your shopify store cd into:",{filePath:"/my-store/hydrogen.config.js"},{char:"."}],body:["You can also try the following steps:",{list:{items:[["Run",{command:"shopify project connect"}],["Run",{command:"hydrogen start"}]]}}]}),e({headline:"About your app.",customSections:[{body:{tabularData:[["Configuration file",{filePath:"shopify.app.scalable-transaction-app.toml"}],["App name",{userInput:"scalable-transaction-app"}],["Access scopes","read_products,write_products"]],firstColumnSubdued:!0}}]}),e({headline:[{userInput:"my-app"},"initialized and ready to build."],nextSteps:[["Run",{command:"cd verification-app"}],["To preview your project, run",{command:"npm app dev"}],["To add extensions, run",{command:"npm generate extension"}]],reference:[["Run",{command:"npm shopify help"}],{link:{label:"Dev docs",url:"https://shopify.dev"}}],customSections:[{title:"Custom section",body:{list:{items:[{link:{label:"Item 1",url:"https://shopify.com"}},"Item 2",{link:{url:"https://community.shopify.com/"}}]}}},{title:"Custom section 2",body:{list:{items:["Item 1","Item 2","Item 3"]}}}]}),o({headline:"CLI updated.",body:"You are now running version 3.47."}),o({headline:"Deployment successful.",body:"Your extensions have been uploaded to your Shopify Partners Dashboard.",nextSteps:[{link:{label:"See your deployment and set it live",url:"https://partners.shopify.com/1797046/apps/4523695/deployments"}}]}),n({headline:"You have reached your limit of checkout extensions for this app.",body:"You can free up space for a new one by deleting an existing one."}),n({headline:"Required access scope update.",body:"The deadline for re-selecting your app scopes is May 1, 2022.",reference:[{link:{label:"Dev docs",url:"https://shopify.dev/app/scopes"}}]});let a=new l("Something went wrong.");a.stack=`
2
2
  Error: Unexpected error
3
3
  at Module._compile (internal/modules/cjs/loader.js:1137:30)
4
4
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
@@ -1,4 +1,4 @@
1
- import{a as B,j as C,m as P}from"./chunk-XERJY4IG.js";import{e as g}from"./chunk-6BX62FFE.js";import{e as U,f as _}from"./chunk-IKYZ5L3F.js";import{l as v,m as w}from"./chunk-HT6MOPLW.js";import{ua as E}from"./chunk-EZ7EBYDT.js";import{Pb as m}from"./chunk-3TFUSDHY.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var $=20,J=1024*1024,A=2;function oe(t,e,r,s,o={},l){let n=B(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=R(t,e,n),h=Promise.all([s.ready(),u]).then(()=>q(n,s,t,e,i)),p=h.then(a=>a.promise).then(()=>j(n,s,t,e,o,i)),k=o?.deferPartialWork?u:p.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([u,h.then(a=>a.promise),p.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:d}=await h,f=o.multiEnvironment?4e3:1e3;await g(b({promise:d,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment);let{progress:y,promise:F}=await p;await g(b({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(y)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment),await g([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),H(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&o()}})};return o(),s}function j(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=L(t,e),i=x(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let p=0;p<i.length;p+=$){let k=i.slice(p,p+$),a=v(r.id,k.map(d=>d.key),s).then(d=>{d.forEach(f=>{if(l.set(f.key,f),!f.success){let y=f.errors?.asset?.map(F=>`-${F}`).join(`
1
+ import{a as B,j as C,m as P}from"./chunk-MLZLDL6B.js";import{e as g}from"./chunk-KOVAFUYN.js";import{e as U,f as _}from"./chunk-LZ3GZ7NS.js";import{l as v,m as w}from"./chunk-4JY2P2A5.js";import{za as E}from"./chunk-YN6A26QL.js";import{Ab as m}from"./chunk-Y34LWI3S.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var $=20,J=1024*1024,A=2;function oe(t,e,r,s,o={},l){let n=B(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=R(t,e,n),h=Promise.all([s.ready(),u]).then(()=>q(n,s,t,e,i)),p=h.then(a=>a.promise).then(()=>j(n,s,t,e,o,i)),k=o?.deferPartialWork?u:p.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([u,h.then(a=>a.promise),p.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:d}=await h,f=o.multiEnvironment?4e3:1e3;await g(b({promise:d,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment);let{progress:y,promise:F}=await p;await g(b({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(y)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment),await g([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),H(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&o()}})};return o(),s}function j(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=L(t,e),i=x(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let p=0;p<i.length;p+=$){let k=i.slice(p,p+$),a=v(r.id,k.map(d=>d.key),s).then(d=>{d.forEach(f=>{if(l.set(f.key,f),!f.success){let y=f.errors?.asset?.map(F=>`-${F}`).join(`
2
2
  `);_(f.key,"delete")(new Error(`Failed to delete ${f.key}: ${y}`))}}),c.current+=k.length});u.push(a)}let h=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:h}}function L(t,e){let s=e.applyIgnoreFilters(t).filter(o=>!e.files.has(o.key));return m(`Files to be deleted:
3
3
  ${s.map(o=>`-${o.key}`).join(`
4
4
  `)}`),s}function x(t){let e=P(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configSchemaFile,...e.staticAssetFiles]}var D=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function R(t,e,r){let s=new Set(r.map(l=>l.key)),o=D.filter(({key:l})=>!s.has(l));o.length>0&&await w(t.id,o,e)}function q(t,e,r,s,o){let l=I(e,t);e.unsyncedFileKeys.clear(),l.forEach(a=>e.unsyncedFileKeys.add(a.key));let{independentFiles:n,dependentFiles:i}=z(l),c={current:0,total:l.length},u=a=>a.length===0?Promise.resolve():Promise.all(S(a).map(d=>N(d,e,s,r.id,o).then(()=>{c.current+=d.length,d.forEach(f=>e.unsyncedFileKeys.delete(f.key))}))).then(()=>{}),h=i.reduce((a,d)=>a.then(()=>u(d)),Promise.resolve()),p=Promise.resolve().then(()=>u(n.flat())),k=Promise.all([h,p]).then(()=>{c.current=c.total});return{progress:c,promise:k}}function I(t,e){let r=K(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
@@ -1,6 +1,6 @@
1
- import{a as b}from"./chunk-J3JPJCWP.js";import{a as fe}from"./chunk-XGCJWCC4.js";import{b as re,c as oe,d as se,e as ne,f as ie,h as ae,i as le,k as ce,l as me,n as de}from"./chunk-XERJY4IG.js";import{c as ee,e as te}from"./chunk-6BX62FFE.js";import{a as X}from"./chunk-6Q5VRSRN.js";import{c as Q,e as v,m as Z,n as x}from"./chunk-IKYZ5L3F.js";import{k as P,l as V,n as w}from"./chunk-HT6MOPLW.js";import{s as C,u as k}from"./chunk-Z5DDPQ26.js";import{a as Y,b as B}from"./chunk-ERCJPRN3.js";import{o as J,s as K,t as j,u as z,w as N}from"./chunk-Q7BOSHWX.js";import{a as F,qa as $,ua as L}from"./chunk-EZ7EBYDT.js";import{J as U,s as W,u as I,v as M,w as R,y as q,z as G}from"./chunk-6YCGMS7X.js";import{d as _,e as H}from"./chunk-VZKR2YFM.js";import{m as y}from"./chunk-ZTE46E4Z.js";import{Fb as g,Hb as T,Mb as E,Pb as u}from"./chunk-3TFUSDHY.js";import{u as p}from"./chunk-A4SBXDZB.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();var he={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return he;u("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=Ce(o,r),a=i.length===0&&n.length===0&&l.length===0;if(L(`theme-service:theme-reconciliation:manual:${a}`),a)return u("Local and remote checksums match - no need to reconcile theme assets"),he;let m=await Oe({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:De(e,t,r,m)}}function Ce(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:S(r,t),filesOnlyPresentLocally:S(i,t),filesWithConflictingChecksums:S(s,t)}}function S(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function A(e,t,o,r){if(e.length===0)return;if(r){Se(e,o,r);return}I({body:{list:{title:t,items:e.map(i=>i.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:pe}]})===D?o.remote.callback(e):o.local.callback(e)}function Se(e,t,o){switch(o){case"keep-remote":t.remote.callback(e);break;case"keep-local":t.local.callback(e);break;case"abort":break}}function Ae(e){let t=[{title:"The files listed below are only present locally.",files:e.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:e.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:e.filesWithConflictingChecksums}];throw new y("Theme JSON files need reconciliation.",t.filter(o=>o.files.length>0).map(o=>`${o.title}
1
+ import{a as v}from"./chunk-J3JPJCWP.js";import{a as fe}from"./chunk-WHLGNDRE.js";import{b as re,c as oe,d as se,e as ne,f as ie,h as ae,i as le,k as ce,l as me,n as de}from"./chunk-MLZLDL6B.js";import{c as ee,e as te}from"./chunk-KOVAFUYN.js";import{a as X}from"./chunk-E2W5OYYM.js";import{c as Q,e as b,m as Z,n as x}from"./chunk-LZ3GZ7NS.js";import{k as P,l as V,n as w}from"./chunk-4JY2P2A5.js";import{s as C,u as k}from"./chunk-OORWOTAP.js";import{a as Y,b as B}from"./chunk-JUKAWTYY.js";import{o as J,s as K,t as j,u as z,w as N}from"./chunk-Q7BOSHWX.js";import{a as F,va as $,za as L}from"./chunk-YN6A26QL.js";import{A as T,C as q,D as G,N as U,w as W,y as I,z as M}from"./chunk-GMTNOCMS.js";import{d as _,e as H}from"./chunk-JQISGC7D.js";import{h as y}from"./chunk-R2R6JDNH.js";import{Ab as u,qb as g,sb as R,xb as E}from"./chunk-Y34LWI3S.js";import{i as p}from"./chunk-B4OMIONW.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();var he={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return he;u("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=Ee(o,r),a=i.length===0&&n.length===0&&l.length===0;if(L(`theme-service:theme-reconciliation:manual:${a}`),a)return u("Local and remote checksums match - no need to reconcile theme assets"),he;let m=await De({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Ae(e,t,r,m)}}function Ee(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:S(r,t),filesOnlyPresentLocally:S(i,t),filesWithConflictingChecksums:S(s,t)}}function S(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function A(e,t,o,r){if(e.length===0)return;if(r){Ce(e,o,r);return}I({body:{list:{title:t,items:e.map(i=>i.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:pe}]})===D?o.remote.callback(e):o.local.callback(e)}function Ce(e,t,o){switch(o){case"keep-remote":t.remote.callback(e);break;case"keep-local":t.local.callback(e);break;case"abort":break}}function Se(e){let t=[{title:"The files listed below are only present locally.",files:e.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:e.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:e.filesWithConflictingChecksums}];throw new y("Theme JSON files need reconciliation.",t.filter(o=>o.files.length>0).map(o=>`${o.title}
2
2
  ${o.files.map(r=>`- ${r.key}`).join(`
3
3
  `)}`).join(`
4
4
 
5
- `))}async function De(e,t,o,r){let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:n}=r,l=s.map(d=>o.delete(d.key)),a=b(i,k,async d=>{let c=await P(e.id,d.map(h=>h.key),t);return Promise.all(c.map(h=>{if(h)return o.write(h)}))}),m=V(e.id,n.map(d=>d.key),t);await Promise.all([...l,...a,m])}async function Oe(e,t){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s}=e,{reconciliationStrategy:i}=t,n=[],l=[],a=[],m={filesOnlyPresentLocally:t.noDelete?[]:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s},d=Object.values(m).some(c=>c.length>0);return i==="abort"&&d&&Ae(m),t.noDelete||await A(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:c=>{n.push(...c)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}},i),await A(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:c=>{l.push(...c)}},local:{label:"Delete files from the remote theme",callback:c=>{a.push(...c)}}},i),await A(s,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:c=>{l.push(...c)}},local:{label:"Keep the local version",callback:c=>{a.push(...c)}}},i),{localFilesToDelete:n,filesToDownload:l,remoteFilesToDelete:a}}f();var Fe=3e3,O=class extends Error{};function we(e,t,o,r,s,i){u("Listening for changes in the theme editor");let n=5,l=0,a="",m=o,d=async()=>{await new Promise(c=>setTimeout(c,Fe)),m=await $e(e,t,m,r,s).then(c=>(l=0,a="",c)).catch(c=>{if(l++,c.message!==a&&(a=c.message,v("Error while polling for changes.",c)),l>=n){let h=new y("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");q(h),i(h)}return m})};setTimeout(async()=>{for(;;)await d()})}async function $e(e,t,o,r,s){let i=new Set(r.unsyncedFileKeys),n=ye(o,r,i),l=await w(e.id,t).then(d=>ye(d,r,i)),a=_e(n,l),m=Le(l,n);return await Ie(r,a),await He(e,t,r,a),await We(r,m,s),l}function Le(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>o.get(s.key)===void 0)}function _e(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>{let i=o.get(s.key);if(!i||i.checksum!==s.checksum)return!0})}async function He(e,t,o,r){let s=r.filter(n=>o.files.get(n.key)?.checksum!==n.checksum),i=b(s,k,async n=>P(e.id,n.map(l=>l.key),t).then(l=>Promise.all(l.map(async a=>{a&&(await o.write(a),E(T`• ${C.format(new Date)} Synced ${g.raw("\xBB")} ${g.gray(`download ${a.key} from remote theme`)}`))}))));await Promise.all(i)}async function We(e,t,o){if(!o.noDelete)return Promise.all(t.map(r=>{if(e.files.get(r.key))return e.delete(r.key).then(()=>{E(T`• ${C.format(new Date)} Synced ${g.raw("\xBB")} ${g.gray(`remove ${r.key} from local theme`)}`)})}))}async function Ie(e,t){let o=new Map(e.files);await Promise.all(t.map(r=>e.read(r.key)));for(let r of t){let s=o.get(r.key)?.checksum,i=e.files.get(r.key)?.checksum;if(s!==i)throw new O(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function ye(e,t,o){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!o.has(s.key))}var pe="local",D="remote";async function ge(e,t,o,r,s,i){u("Initiating theme asset reconciliation process"),await r.ready();let{workPromise:n}=await ue(e,t,o,r,s);return{updatedRemoteChecksumsPromise:n.then(async()=>{let a=await w(e.id,t);return we(e,t,a,r,s,i),a}),workPromise:n}}f();function ke(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}import{createServer as Me}from"node:http";function Pe(e,t){let{promise:o,resolve:r,reject:s}=ke(),i=ae(e,t),n=qe(e,t,s),l=Promise.all([i,n.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),a=Ue(e,t,l);return{workPromise:l,serverStart:a.start,dispatchEvent:a.dispatch,renderDevSetupProgress:n.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function qe(e,t,o){let r=a=>(v("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),i=w(e.id,t.session).then(a=>Ge(e,t,a,o)),n=i.then(async({updatedRemoteChecksumsPromise:a})=>{let m=await a;return fe(e,t.session,m,t.localThemeFileSystem,{nodelete:t.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})});return{workPromise:n.then(a=>a.workPromise).catch(r),renderProgress:async()=>{if(t.options.themeEditorSync){let{workPromise:m}=await i;await te([{title:"Performing file synchronization. This may take a while...",task:async()=>{await m}}])}let{renderThemeSyncProgress:a}=await n;await a()}}}function Ge(e,t,o,r){return t.options.themeEditorSync?ge(e,t.session,o,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only,reconciliationStrategy:t.options.reconciliationStrategy},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve()})}function Ue(e,t,o){let r=z(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];r.use(ne(t.options.host,t.options.port)),r.use(j(async()=>(await o,K(n=>{n.node.req.headers.origin&&J(n,{origin:a=>s.includes(a),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&r.use(le(e,t)),r.use(se(e,t)),r.use(re(e,t)),r.use(oe(e,t));let i=Me(N(r));return{dispatch:r.handler.bind(r),start:async()=>new Promise(n=>i.listen({port:t.options.port,host:t.options.host},()=>n({close:async()=>{await Promise.all([new Promise(l=>{i.closeAllConnections(),i.close(l)})])}})))}}import Je from"readline";var Ke="127.0.0.1",je=9292,ve=!1;async function rr(e){if(!await de(e.directory)&&!await ee(e.force))return;e.password?.startsWith("shpat_")&&R({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
6
- `,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),e.listing&&await ce(e.directory,e.listing);let[t,o]=await Promise.all([Z(e.adminSession),Q(e.adminSession)]),r=o?await X(e.storePassword,e.adminSession.storeFqdn,t):void 0,s=ie(),i=me(e.directory,{filters:e,listing:e.listing,noDelete:e.noDelete,notify:e.notify}),n=e.host??Ke,l;if(e.port){if(!await B(e.port))throw new y(`Port ${e.port} is not available. Try a different port or remove the --port flag to use an available port.`);l=e.port}else l=await Y(je);let a={local:`http://${n}:${l}`,giftCard:`http://${n}:${l}/gift_cards/[store_id]/preview`,themeEditor:`https://${e.store}/admin/themes/${e.theme.id}/editor?hr=${l}`,preview:`https://${e.store}/?preview_theme_id=${e.theme.id}`},d={session:await x(e.theme.id.toString(),e.adminSession,e.password,r,t),localThemeFileSystem:i,localThemeExtensionFileSystem:s,directory:e.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:e["theme-editor-sync"],reconciliationStrategy:e.reconciliationStrategy,host:n,port:l,open:e.open,liveReload:e["live-reload"],standardEventsDevBundle:!0,standardEventsInspector:e["standard-events-inspector"],noDelete:e.noDelete,ignore:e.ignore,only:e.only,errorOverlay:e["error-overlay"]}},{serverStart:c,renderDevSetupProgress:h,backgroundJobPromise:Re,resolveBackgroundJob:Te}=Pe(e.theme,d);Je.emitKeypressEvents(process.stdin);let Ee=Ne(a,d,Te);process.stdin.on("keypress",Ee),await Promise.all([Re,h().then(c).then(()=>{process.stdin.isTTY&&process.stdin.setRawMode(!0),Be(a),e.open&&be(a.local,"development server")})]),await ze(e.commandConfig,e.adminSession),process.exit(0)}async function ze(e,t){if(!ve){ve=!0;try{await _(()=>({store_fqdn_hash:F(t.storeFqdn)})),await H(()=>({store_fqdn:t.storeFqdn})),await $({config:e,exitMode:"ok"})}catch{}}}function Ne(e,t,o){let r=W(be,100,{leading:!0,trailing:!1});return(s,i)=>{if(i.ctrl&&i.name==="c"){o();return}switch(i.name){case void 0:break;case"t":r(e.local,"localhost");break;case"p":r(e.preview,"theme preview");break;case"e":r(t.lastRequestedPath==="/"?e.themeEditor:`${e.themeEditor}&previewPath=${encodeURIComponent(t.lastRequestedPath)}`,"theme editor");break;case"g":r(e.giftCard,"gift card preview");break;default:break}}}function be(e,t){U(e).catch(Ye(t))}function Ye(e){return t=>{R({headline:`Failed to open ${e}.`,body:t.stack??t.message})}}function Be(e){M({body:[{list:{title:p.bold("Preview your theme ")+p.cyan("(t)"),items:[{link:{url:e.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${p.cyan("(p)")}`,url:e.preview}},{subdued:e.preview}],[{link:{label:`Customize your theme at the theme editor ${p.cyan("(e)")}`,url:e.themeEditor}}],[{link:{label:`Preview your gift cards ${p.cyan("(g)")}`,url:e.giftCard}}]]})}export{rr as a,be as b};
5
+ `))}async function Ae(e,t,o,r){let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:n}=r,l=s.map(d=>o.delete(d.key)),a=v(i,k,async d=>{let c=await P(e.id,d.map(h=>h.key),t);return Promise.all(c.map(h=>{if(h)return o.write(h)}))}),m=V(e.id,n.map(d=>d.key),t);await Promise.all([...l,...a,m])}async function De(e,t){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s}=e,{reconciliationStrategy:i}=t,n=[],l=[],a=[],m={filesOnlyPresentLocally:t.noDelete?[]:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s},d=Object.values(m).some(c=>c.length>0);return i==="abort"&&d&&Se(m),t.noDelete||await A(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:c=>{n.push(...c)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}},i),await A(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:c=>{l.push(...c)}},local:{label:"Delete files from the remote theme",callback:c=>{a.push(...c)}}},i),await A(s,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:c=>{l.push(...c)}},local:{label:"Keep the local version",callback:c=>{a.push(...c)}}},i),{localFilesToDelete:n,filesToDownload:l,remoteFilesToDelete:a}}f();var Oe=3e3,O=class extends Error{};function we(e,t,o,r,s,i){u("Listening for changes in the theme editor");let n=5,l=0,a="",m=o,d=async()=>{await new Promise(c=>setTimeout(c,Oe)),m=await Fe(e,t,m,r,s).then(c=>(l=0,a="",c)).catch(c=>{if(l++,c.message!==a&&(a=c.message,b("Error while polling for changes.",c)),l>=n){let h=new y("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");q(h),i(h)}return m})};setTimeout(async()=>{for(;;)await d()})}async function Fe(e,t,o,r,s){let i=new Set(r.unsyncedFileKeys),n=ye(o,r,i),l=await w(e.id,t).then(d=>ye(d,r,i)),a=Le(n,l),m=$e(l,n);return await We(r,a),await _e(e,t,r,a),await He(r,m,s),l}function $e(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>o.get(s.key)===void 0)}function Le(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>{let i=o.get(s.key);if(!i||i.checksum!==s.checksum)return!0})}async function _e(e,t,o,r){let s=r.filter(n=>o.files.get(n.key)?.checksum!==n.checksum),i=v(s,k,async n=>P(e.id,n.map(l=>l.key),t).then(l=>Promise.all(l.map(async a=>{a&&(await o.write(a),E(R`• ${C.format(new Date)} Synced ${g.raw("\xBB")} ${g.gray(`download ${a.key} from remote theme`)}`))}))));await Promise.all(i)}async function He(e,t,o){if(!o.noDelete)return Promise.all(t.map(r=>{if(e.files.get(r.key))return e.delete(r.key).then(()=>{E(R`• ${C.format(new Date)} Synced ${g.raw("\xBB")} ${g.gray(`remove ${r.key} from local theme`)}`)})}))}async function We(e,t){let o=new Map(e.files);await Promise.all(t.map(r=>e.read(r.key)));for(let r of t){let s=o.get(r.key)?.checksum,i=e.files.get(r.key)?.checksum;if(s!==i)throw new O(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function ye(e,t,o){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!o.has(s.key))}var pe="local",D="remote";async function ge(e,t,o,r,s,i){u("Initiating theme asset reconciliation process"),await r.ready();let{workPromise:n}=await ue(e,t,o,r,s);return{updatedRemoteChecksumsPromise:n.then(async()=>{let a=await w(e.id,t);return we(e,t,a,r,s,i),a}),workPromise:n}}import{createServer as Ie}from"node:http";function ke(e,t){let{promise:o,resolve:r,reject:s}=Promise.withResolvers(),i=ae(e,t),n=Me(e,t,s),l=Promise.all([i,n.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),a=Ge(e,t,l);return{workPromise:l,serverStart:a.start,dispatchEvent:a.dispatch,renderDevSetupProgress:n.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Me(e,t,o){let r=a=>(b("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),i=w(e.id,t.session).then(a=>qe(e,t,a,o)),n=i.then(async({updatedRemoteChecksumsPromise:a})=>{let m=await a;return fe(e,t.session,m,t.localThemeFileSystem,{nodelete:t.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})});return{workPromise:n.then(a=>a.workPromise).catch(r),renderProgress:async()=>{if(t.options.themeEditorSync){let{workPromise:m}=await i;await te([{title:"Performing file synchronization. This may take a while...",task:async()=>{await m}}])}let{renderThemeSyncProgress:a}=await n;await a()}}}function qe(e,t,o,r){return t.options.themeEditorSync?ge(e,t.session,o,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only,reconciliationStrategy:t.options.reconciliationStrategy},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve()})}function Ge(e,t,o){let r=z(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];r.use(ne(t.options.host,t.options.port)),r.use(j(async()=>(await o,K(n=>{n.node.req.headers.origin&&J(n,{origin:a=>s.includes(a),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&r.use(le(e,t)),r.use(se(e,t)),r.use(re(e,t)),r.use(oe(e,t));let i=Ie(N(r));return{dispatch:r.handler.bind(r),start:async()=>new Promise(n=>i.listen({port:t.options.port,host:t.options.host},()=>n({close:async()=>{await Promise.all([new Promise(l=>{i.closeAllConnections(),i.close(l)})])}})))}}import Ue from"readline";var Je="127.0.0.1",Ke=9292,Pe=!1;async function Zt(e){if(!await de(e.directory)&&!await ee(e.force))return;e.password?.startsWith("shpat_")&&T({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
6
+ `,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),e.listing&&await ce(e.directory,e.listing);let[t,o]=await Promise.all([Z(e.adminSession),Q(e.adminSession)]),r=o?await X(e.storePassword,e.adminSession.storeFqdn,t):void 0,s=ie(),i=me(e.directory,{filters:e,listing:e.listing,noDelete:e.noDelete,notify:e.notify}),n=e.host??Je,l;if(e.port){if(!await B(e.port))throw new y(`Port ${e.port} is not available. Try a different port or remove the --port flag to use an available port.`);l=e.port}else l=await Y(Ke);let a={local:`http://${n}:${l}`,giftCard:`http://${n}:${l}/gift_cards/[store_id]/preview`,themeEditor:`https://${e.store}/admin/themes/${e.theme.id}/editor?hr=${l}`,preview:`https://${e.store}/?preview_theme_id=${e.theme.id}`},d={session:await x(e.theme.id.toString(),e.adminSession,e.password,r,t),localThemeFileSystem:i,localThemeExtensionFileSystem:s,directory:e.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:e["theme-editor-sync"],reconciliationStrategy:e.reconciliationStrategy,host:n,port:l,open:e.open,liveReload:e["live-reload"],standardEventsDevBundle:!0,standardEventsInspector:e["standard-events-inspector"],noDelete:e.noDelete,ignore:e.ignore,only:e.only,errorOverlay:e["error-overlay"]}},{serverStart:c,renderDevSetupProgress:h,backgroundJobPromise:ve,resolveBackgroundJob:Te}=ke(e.theme,d);Ue.emitKeypressEvents(process.stdin);let Re=ze(a,d,Te);process.stdin.on("keypress",Re),await Promise.all([ve,h().then(c).then(()=>{process.stdin.isTTY&&process.stdin.setRawMode(!0),Ye(a),e.open&&be(a.local,"development server")})]),await je(e.commandConfig,e.adminSession),process.exit(0)}async function je(e,t){if(!Pe){Pe=!0;try{await _(()=>({store_fqdn_hash:F(t.storeFqdn)})),await H(()=>({store_fqdn:t.storeFqdn})),await $({config:e,exitMode:"ok"})}catch{}}}function ze(e,t,o){let r=W(be,100,{leading:!0,trailing:!1});return(s,i)=>{if(i.ctrl&&i.name==="c"){o();return}switch(i.name){case void 0:break;case"t":r(e.local,"localhost");break;case"p":r(e.preview,"theme preview");break;case"e":r(t.lastRequestedPath==="/"?e.themeEditor:`${e.themeEditor}&previewPath=${encodeURIComponent(t.lastRequestedPath)}`,"theme editor");break;case"g":r(e.giftCard,"gift card preview");break;default:break}}}function be(e,t){U(e).catch(Ne(t))}function Ne(e){return t=>{T({headline:`Failed to open ${e}.`,body:t.stack??t.message})}}function Ye(e){M({body:[{list:{title:p.bold("Preview your theme ")+p.cyan("(t)"),items:[{link:{url:e.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${p.cyan("(p)")}`,url:e.preview}},{subdued:e.preview}],[{link:{label:`Customize your theme at the theme editor ${p.cyan("(e)")}`,url:e.themeEditor}}],[{link:{label:`Preview your gift cards ${p.cyan("(g)")}`,url:e.giftCard}}]]})}export{Zt as a,be as b};
@@ -0,0 +1 @@
1
+ import{b}from"./chunk-WKUGSFTB.js";import{a as F}from"./chunk-DQCIORGH.js";import{j as c,l as f,o as T}from"./chunk-LZ3GZ7NS.js";import{p as y,v as O}from"./chunk-OORWOTAP.js";import{b as I}from"./chunk-JJJTPEMD.js";import{r as v,wa as w}from"./chunk-YN6A26QL.js";import{z as S}from"./chunk-GMTNOCMS.js";import{h as a}from"./chunk-R2R6JDNH.js";import{a as A}from"./chunk-CTNBSUVU.js";import{Ua as l,ma as u,xb as _}from"./chunk-Y34LWI3S.js";import{e as x,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function P({session:e,overridesContent:r,themeId:t}){w("theme-preview:create");let m=`${f(e)}/theme_preview.json?preview_theme_id=${t}`,o=await c(e,{headers:{"Content-Type":"application/json"}}),i=await v(m,{method:"POST",body:r,headers:o});if(!i.ok)throw new a(`Theme preview request failed with status ${i.status}: ${i.statusText}`);let n=await J(i);return w("theme-preview:create"),n}async function g({session:e,overridesContent:r,themeId:t,previewIdentifier:s}){w("theme-preview:update");let o=`${f(e)}/theme_preview.json?preview_theme_id=${t}&preview_identifier=${encodeURIComponent(s)}`,i=await c(e,{headers:{"Content-Type":"application/json"}}),n=await v(o,{method:"POST",body:r,headers:i});if(!n.ok)throw new a(`Theme preview request failed with status ${n.status}: ${n.statusText}`);let E=await J(n);return w("theme-preview:update"),E}async function J(e){let r=await e.json();if(r.error)throw new a(`Theme preview failed: ${r.error}`);if(!r.url||!r.preview_identifier)throw new a("Theme preview returned an unexpected response");return{url:r.url,preview_identifier:r.preview_identifier}}async function $(e){if(!l(e.overrideJson))throw new a(`Override file not found: ${e.overrideJson}`);let r=await u(e.overrideJson),t;try{t=JSON.parse(r)}catch(i){let n=i instanceof Error?i.message:String(i);throw new a(`Failed to parse override file: ${e.overrideJson}`,n)}let s=await T(e.themeId,e.adminSession,e.password),m=JSON.stringify(t),o=e.previewIdentifier?await g({session:s,overridesContent:m,themeId:e.themeId,previewIdentifier:e.previewIdentifier}):await P({session:s,overridesContent:m,themeId:e.themeId});e.json?_(JSON.stringify({url:o.url,preview_identifier:o.preview_identifier})):S({body:[{list:{title:e.previewIdentifier?"Preview updated":"Preview is ready",items:[{link:{url:o.url}},`Preview ID: ${o.preview_identifier}`]}}]}),e.open&&b(o.url,"theme preview")}var p=x(A(),1);var h=class extends O{static summary="Applies JSON overrides to a theme and returns a preview URL.";static descriptionWithMarkdown="Applies a JSON overrides file to a theme and creates or updates a preview. This lets you quickly preview changes.\n\n The command returns a preview URL and a preview identifier. You can reuse the preview identifier with `--preview-id` to update an existing preview instead of creating a new one.";static description=this.descriptionWithoutMarkdown();static flags={...I,...y,theme:p.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",required:!0}),overrides:p.Flags.string({description:"Path to a JSON overrides file.",env:"SHOPIFY_FLAG_OVERRIDES",required:!0}),"preview-id":p.Flags.string({description:"An existing preview identifier to update instead of creating a new preview.",env:"SHOPIFY_FLAG_PREVIEW_ID"}),open:p.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),json:p.Flags.boolean({description:"Output the preview URL and identifier as JSON.",env:"SHOPIFY_FLAG_JSON",default:!1})};static multiEnvironmentsFlags=null;async command(r,t){let s=await F(t,{filter:{theme:r.theme}});await $({adminSession:t,overrideJson:r.overrides,themeId:s.id.toString(),previewIdentifier:r["preview-id"],open:r.open,password:r.password,json:r.json})}};export{h as a};
@@ -0,0 +1 @@
1
+ import{b as r,c as u,e as I}from"./chunk-DPNZWBT5.js";import{a as o}from"./chunk-JD5P5RAJ.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();function i(t){return!(t===void 0||t.trim()==="")}function s(t,e){switch(t){case"bitbucket":return{branch:e.BITBUCKET_BRANCH,build:e.BITBUCKET_BUILD_NUMBER,commitSha:e.BITBUCKET_COMMIT,run:e.BITBUCKET_BUILD_NUMBER,url:`https://bitbucket.org/${e.BITBUCKET_WORKSPACE}/${e.BITBUCKET_REPO_SLUG}/pipelines/results/${e.BITBUCKET_BUILD_NUMBER}`};case"circleci":return{actor:e.CIRCLE_USERNAME,branch:e.CIRCLE_BRANCH,build:e.CIRCLE_BUILD_NUM,commitSha:e.CIRCLE_SHA1,run:e.CIRCLE_WORKFLOW_ID,url:e.CIRCLE_BUILD_URL};case"github":return{actor:e.GITHUB_ACTOR,attempt:e.GITHUB_RUN_ATTEMPT,branch:e.GITHUB_REF_NAME,build:e.GITHUB_RUN_ID,commitSha:e.GITHUB_SHA,run:e.GITHUB_RUN_ID,runNumber:e.GITHUB_RUN_NUMBER,url:`${e.GITHUB_SERVER_URL}/${e.GITHUB_REPOSITORY}/actions/runs/${e.GITHUB_RUN_ID}`};case"gitlab":return{actor:e.GITLAB_USER_LOGIN,branch:e.CI_COMMIT_REF_NAME,build:e.CI_PIPELINE_ID,commitSha:e.CI_COMMIT_SHA,commitMessage:e.CI_COMMIT_MESSAGE,run:e.CI_RUNNER_ID,url:e.CI_PIPELINE_URL};case"buildkite":return{branch:e.BUILDKITE_BRANCH,build:e.BUILDKITE_BUILD_NUMBER,commitSha:e.BUILDKITE_COMMIT,commitMessage:e.BUILDKITE_MESSAGE,run:e.BUILDKITE_BUILD_NUMBER,url:e.BUILDKITE_BUILD_URL};default:return{}}}import{randomUUID as p}from"crypto";import{homedir as l,networkInterfaces as m}from"os";async function f(t){let{fileExists:e}=await import("./fs-SKHQZZTQ.js");return e(t)}async function U(t,e){let{exec:a}=await import("./system-SR5G7WEW.js");await a(t,e)}function M(){return!!(process.stdout.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function x(){return l()}var _,T;function B(t=process.env){return t[r.env]==="development"}function N(t=process.env){return t===process.env?_??=o(t[r.verbose])||process.argv.includes("--verbose"):o(t[r.verbose])||process.argv.includes("--verbose")}async function A(t=process.env){return Object.prototype.hasOwnProperty.call(t,r.runAsUser)?!o(t[r.runAsUser]):await f(I.executables.dev)}function y(t=process.env){return t===process.env?T??=o(t[r.unitTest]):o(t[r.unitTest])}function g(t=process.env){return o(t[r.noAnalytics])||o(t[r.optOutInstrumentation])||B(t)}function S(t=process.env){return o(t[r.alwaysLogAnalytics])}function K(t=process.env){return o(t[r.alwaysLogMetrics])}function G(t=process.env){return o(t[r.doctor])}function O(t=process.env){return t[r.gitpod]}function H(t=process.env){return t[r.codespaceName]}function w(t=process.env){return t[r.codespacePortForwardingDomain]}function P(t=process.env){return d(t).platform!=="localhost"}function k(t=process.env){return t[r.themeToken]}function d(t=process.env){return i(t[r.codespaces])?{platform:"codespaces",editor:!0}:i(t[r.gitpod])?{platform:"gitpod",editor:!0}:i(t[r.cloudShell])?{platform:"cloudShell",editor:!0}:{platform:"localhost",editor:!1}}async function F(){try{return await U("git",["--version"]),!0}catch{return!1}}function z(t=process.env){if(o(t.CI)){let e="unknown";return i(t.BITBUCKET_BUILD_NUMBER)?e="bitbucket":o(t.CIRCLECI)?e="circleci":i(t.GITHUB_ACTION)?e="github":o(t.GITLAB_CI)?e="gitlab":i(t.BUILDKITE)&&(e="buildkite"),{isCI:!0,name:e,metadata:s(e,t)}}else if(o(t.TF_BUILD))return{isCI:!0,name:"azure",metadata:s("azure",t)};return{isCI:!1}}async function $(){let t="00:00:00:00:00:00",e=Object.values(m()).flat().filter(n=>!!(n&&n.mac!==t));return(e.find(n=>!n.internal)??e[0])?.mac??p()}function V(t=process.env){let e=t[r.themeKitAccessDomain];return i(e)?e:u}function W(t=process.env){let e=t[r.otelURL];return i(e)?e:"https://otlp-http-production-cli.shopifysvc.com"}export{M as a,x as b,B as c,N as d,A as e,y as f,g,S as h,K as i,G as j,O as k,H as l,w as m,P as n,k as o,d as p,F as q,z as r,$ as s,V as t,W as u};
@@ -0,0 +1,3 @@
1
+ import{b as g}from"./chunk-JJJTPEMD.js";import{b as y}from"./chunk-RY2SJVWM.js";import{q as u}from"./chunk-YN6A26QL.js";import{h as r}from"./chunk-R2R6JDNH.js";import{a as R}from"./chunk-CTNBSUVU.js";import{ua as l,wa as m,wb as v,xb as w}from"./chunk-Y34LWI3S.js";import{f as p,i as h}from"./chunk-773TIA5M.js";import{e as A,g as s}from"./chunk-VKWPEFWQ.js";s();s();var U="text/markdown",L="X-Shopify-Surface",E="cli",F=["shopify.dev"];async function S(t,e){let c;try{c=new URL(t)}catch{throw new r(`Invalid URL: ${t}`)}let{hostname:d}=c;if(!F.some(o=>d===o||d.endsWith(`.${o}`)))throw new r(`Only documents from the following hosts can be fetched: ${F.join(", ")}.`);let i=await u(t,{headers:{Accept:U,[L]:E}});if(!i.ok)throw new r(`Failed to fetch ${t}: ${i.status} ${i.statusText}`);let f=await i.text();if(e){let o=p(e);await m(h(o)),await l(o,f),w(`Saved ${t} to ${o}`);return}v(f)}var n=A(R(),1),a=class t extends y{static description="Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim \u2014 for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `doc search`.";static examples=[`# fetch the Markdown version of a Shopify.dev page
2
+ shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli`,`# save the document to a file instead of printing it
3
+ shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli --output docs/shopify-cli.md`];static flags={...g,url:n.Flags.string({description:"The shopify.dev URL to fetch.",env:"SHOPIFY_FLAG_URL",required:!0}),output:n.Flags.string({description:"Write the document to this file path instead of printing it to stdout.",env:"SHOPIFY_FLAG_OUTPUT"})};async run(){let{flags:e}=await this.parse(t);await S(e.url,e.output)}};export{a};
@@ -0,0 +1,5 @@
1
+ import{b as S}from"./chunk-6ENBE43F.js";import{a as A,b as B,c as L,f as I,j as x,k as $,m as N,t as q}from"./chunk-YIZZ5LZN.js";import{a as P}from"./chunk-NEMPLS7C.js";import{a as z}from"./chunk-KUNDCAQN.js";import{b as C}from"./chunk-JJJTPEMD.js";import{C as E,V as g}from"./chunk-YN6A26QL.js";import{B as w,G as T,y as u,z as v}from"./chunk-GMTNOCMS.js";import{k as D}from"./chunk-R2R6JDNH.js";import{a as K}from"./chunk-CTNBSUVU.js";import{Cb as b,ba as k,ga as y,qb as l,sb as d}from"./chunk-Y34LWI3S.js";import{i as m}from"./chunk-B4OMIONW.js";import{e as _,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function M(e){let{organization:o,storeFqdn:t,operationId:r,remoteApp:a}=e;u({headline:"Checking bulk operation status.",body:[{list:{items:S({organization:o,remoteApp:a,storeFqdn:t})}}]});let s=a.apiSecretKeys[0]?.secret;if(!s)throw new D("No API secret keys found for app");let p=await g(t,a.apiKey,s),i=await x({adminSession:p,operationId:r,version:await I({adminSession:p,minimumDefaultVersion:A})});i?U(i):w({headline:"Bulk operation not found.",body:d`ID: ${l.yellow(r)}`.value})}async function R(e){let{organization:o,storeFqdn:t,remoteApp:r}=e;u({headline:"Listing bulk operations.",body:[{list:{items:S({organization:o,remoteApp:r,storeFqdn:t})}}]});let a=r.apiSecretKeys[0]?.secret;if(!a)throw new D("No API secret keys found for app");let s=await g(t,r.apiKey,a),i=(await $({adminSession:s,version:await I({adminSession:s,minimumDefaultVersion:A})})).map(n=>({id:L(n.id),status:G(n.status),count:H(n.objectCount),dateCreated:k(new Date(String(n.createdAt))),dateFinished:n.completedAt?k(new Date(String(n.completedAt))):"",results:W(n.url??n.partialDataUrl)}));b(),i.length===0?u({body:"No bulk operations found in the last 7 days."}):T({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),b()}function U(e){let{id:o,status:t,createdAt:r,completedAt:a,url:s,partialDataUrl:p}=e,i=N(e).value,n=V(r,a),f=d`ID: ${l.yellow(o)}\n${n}`.value;if(t==="COMPLETED"){let h=s?l.link("Download results",s):"";v({headline:i,body:d`${f}\n${h}`.value})}else if(t==="FAILED"){let h=p?l.link("Download partial results",p):"";w({headline:i,body:d`${f}\n${h}`.value})}else u({headline:i,body:f})}function V(e,o){let t=new Date;return o?`Finished ${y(new Date(String(o)),t)}`:`Started ${y(new Date(String(e)),t)}`}function G(e){return e==="COMPLETED"?m.green(e):e==="FAILED"?m.red(e):m.dim(e)}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function W(e){return e?d`${l.link("download",e)}`.value:""}var F=_(K(),1);var O=class e extends P{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
2
+
3
+ Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
4
+
5
+ Use [\`bulk execute\`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) to start a new bulk operation.`;static description=this.descriptionWithoutMarkdown();static flags={...C,...z,id:F.Flags.string({description:"The bulk operation ID (numeric ID or full GID). If not provided, lists all bulk operations belonging to this app on this store in the last 7 days.",env:"SHOPIFY_FLAG_ID"}),store:F.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async o=>E(o)})};async run(){let{flags:o}=await this.parse(e),{appContextResult:t,store:r}=await q(o);return o.id?await M({organization:t.organization,storeFqdn:r.shopDomain,operationId:B(o.id),remoteApp:t.remoteApp}):await R({organization:t.organization,storeFqdn:r.shopDomain,remoteApp:t.remoteApp}),{app:t.app}}};export{O as a};