@shopify/cli 4.0.0 → 4.2.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.
- package/README.md +2 -2
- package/dist/analytics-CX22YIUZ.js +1 -0
- package/dist/analytics-UBWQIQYF.js +1 -0
- package/dist/angular-UTTM4Y4S.js +4 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-DU4WR4OP.js → chunk-23AMFHXC.js} +1 -1
- package/dist/{chunk-LNHLDRC5.js → chunk-2EJCY4CE.js} +1 -1
- package/dist/{chunk-YMWHHINU.js → chunk-2KH2S7PI.js} +1 -1
- package/dist/chunk-2N4O33VM.js +6 -0
- package/dist/{chunk-WZBSLU4Q.js → chunk-2VLMN5QZ.js} +1 -1
- package/dist/chunk-2WNODIWJ.js +1 -0
- package/dist/chunk-2YXKZWYW.js +1 -0
- package/dist/{chunk-GFJ7UV74.js → chunk-3BRUCKZ2.js} +1 -1
- package/dist/{chunk-RM5SJJN6.js → chunk-3V63X7WZ.js} +66 -66
- package/dist/chunk-3YWUSKWF.js +159 -0
- package/dist/chunk-42RMKTCJ.js +8 -0
- package/dist/{chunk-V2CNCPIE.js → chunk-4EXYYBQ6.js} +1 -1
- package/dist/chunk-4KRT35A2.js +1 -0
- package/dist/chunk-4V4DQ6W7.js +836 -0
- package/dist/chunk-4Z2WYNTE.js +1 -0
- package/dist/chunk-57N2DFIF.js +1 -0
- package/dist/chunk-5TIJLYZU.js +3 -0
- package/dist/{chunk-GNPS5SBU.js → chunk-6AJZKIZ3.js} +1 -1
- package/dist/{chunk-XNO6DZYP.js → chunk-6HZTMQD6.js} +1 -1
- package/dist/chunk-6LK6ZP3Q.js +1 -0
- package/dist/chunk-6SXOUZ7V.js +1 -0
- package/dist/chunk-6TEXPRI2.js +2 -0
- package/dist/{chunk-OUOYKNMY.js → chunk-6TORWTD7.js} +1 -1
- package/dist/{chunk-IASVAERO.js → chunk-6YAXFS6V.js} +1 -1
- package/dist/chunk-6YHJ554P.js +6 -0
- package/dist/chunk-6ZIOYXEF.js +3 -0
- package/dist/chunk-7BFDUVOG.js +1 -0
- package/dist/chunk-7DVOSOEP.js +11 -0
- package/dist/chunk-7JESXDF2.js +14 -0
- package/dist/chunk-7KJ5TBWG.js +5 -0
- package/dist/{chunk-7MUKLZOL.js → chunk-A3VYI4LO.js} +2 -2
- package/dist/{chunk-4HHXSMD7.js → chunk-A5SQCM63.js} +2 -2
- package/dist/chunk-A6X2IVGT.js +4 -0
- package/dist/{chunk-HUZUORYM.js → chunk-AP3RFOPL.js} +10 -10
- package/dist/{chunk-3LVGAQB4.js → chunk-ATPFTRCC.js} +1 -1
- package/dist/chunk-AWQ5AR2K.js +5 -0
- package/dist/chunk-BECEP46I.js +16 -0
- package/dist/{chunk-JPGO36XP.js → chunk-BHWEA4V2.js} +1 -1
- package/dist/chunk-BPVZ7E63.js +1 -0
- package/dist/chunk-C2FFA4O4.js +1 -0
- package/dist/chunk-C3LZPAAH.js +3 -0
- package/dist/chunk-C6ABJCRG.js +1 -0
- package/dist/chunk-CCEA5CUX.js +1 -0
- package/dist/chunk-CE6FKJFS.js +1 -0
- package/dist/chunk-CW7WJZKR.js +28 -0
- package/dist/chunk-D3DDLLNF.js +2 -0
- package/dist/chunk-D656BV5Z.js +25 -0
- package/dist/chunk-DCBYHVKW.js +1 -0
- package/dist/{chunk-RF2DPBA6.js → chunk-DCK2FX6J.js} +1 -1
- package/dist/chunk-DERA4K6A.js +32 -0
- package/dist/chunk-DNLOSMHL.js +3 -0
- package/dist/chunk-E2YBU6D3.js +294 -0
- package/dist/{chunk-INEU4XKS.js → chunk-F47MFBKM.js} +1 -1
- package/dist/chunk-F6T3UBBL.js +1 -0
- package/dist/{chunk-WXVZJJOR.js → chunk-FBVBO5YQ.js} +1 -1
- package/dist/chunk-FD5S2O6M.js +7 -0
- package/dist/chunk-FFYYJKF7.js +1 -0
- package/dist/{chunk-LX3ZOW52.js → chunk-FGVC22EY.js} +1 -1
- package/dist/{chunk-NRAFVIU3.js → chunk-FP2NOZSD.js} +1 -1
- package/dist/chunk-FQDRVPCY.js +2 -0
- package/dist/{chunk-IOLVEXM6.js → chunk-FSTCEWXX.js} +1 -1
- package/dist/chunk-FTN7Y6HD.js +7 -0
- package/dist/{chunk-52GC6XUT.js → chunk-GVITHCQJ.js} +1 -1
- package/dist/chunk-H4W4DFKK.js +1 -0
- package/dist/{chunk-72F3YBNA.js → chunk-HD5TYIDZ.js} +1 -1
- package/dist/chunk-HHXHOQQP.js +3 -0
- package/dist/chunk-HJSYHK4S.js +8 -0
- package/dist/chunk-HLMFVORT.js +1 -0
- package/dist/chunk-HSYRYSX4.js +3 -0
- package/dist/chunk-I3LX25MB.js +1 -0
- package/dist/chunk-INFBVFMU.js +4 -0
- package/dist/chunk-IOQQUHST.js +18 -0
- package/dist/chunk-IVGWFPMA.js +19 -0
- package/dist/chunk-IWCPQD7X.js +1382 -0
- package/dist/chunk-IWE4RUI7.js +1 -0
- package/dist/chunk-IXUVSFW2.js +1 -0
- package/dist/chunk-J6VTZEE2.js +15 -0
- package/dist/{chunk-MQNYGGAM.js → chunk-K3PGC6DC.js} +1 -1
- package/dist/{chunk-MBAFWQSZ.js → chunk-K77WAKOB.js} +1 -1
- package/dist/{chunk-UGDBJTLP.js → chunk-K7K6GNF6.js} +1 -1
- package/dist/chunk-KFCGMT67.js +1 -0
- package/dist/chunk-KLA7AWG6.js +7 -0
- package/dist/{chunk-6B53BWJW.js → chunk-KQU6HOJ3.js} +1 -1
- package/dist/{chunk-A74GETYC.js → chunk-KU5OPV7U.js} +1 -1
- package/dist/chunk-L2VSSINY.js +1 -0
- package/dist/chunk-LCCMXY6N.js +1 -0
- package/dist/{chunk-GOJ2QHSR.js → chunk-LITB5QQX.js} +1 -1
- package/dist/chunk-LKS47US7.js +8 -0
- package/dist/{chunk-DJONKJSZ.js → chunk-LQMSF3F7.js} +1 -1
- package/dist/chunk-LTWXTDDR.js +5 -0
- package/dist/{chunk-D6JARNEH.js → chunk-M2TJICTB.js} +1 -1
- package/dist/chunk-M4LOKANA.js +1 -0
- package/dist/chunk-M4V2OQAX.js +1 -0
- package/dist/chunk-MA52QGHP.js +1 -0
- package/dist/chunk-MFLBTJO7.js +1 -0
- package/dist/chunk-MGL4YM3S.js +28 -0
- package/dist/{chunk-6TZAAS5H.js → chunk-MIO2CV3Q.js} +1 -1
- package/dist/{chunk-2APPXD5Z.js → chunk-MKE434RB.js} +1 -1
- package/dist/chunk-MZJRNFAU.js +1 -0
- package/dist/{chunk-HSK7YMRE.js → chunk-N3YWHJMB.js} +11 -11
- package/dist/{chunk-TQYMC7TH.js → chunk-N5ROZKPZ.js} +1 -1
- package/dist/chunk-NBYS6YQ2.js +5 -0
- package/dist/chunk-NEZEHBT2.js +1 -0
- package/dist/chunk-NO5KVFTV.js +22 -0
- package/dist/{chunk-3DQIVE24.js → chunk-NP4UFPAX.js} +1 -1
- package/dist/chunk-NPM3MFB3.js +7 -0
- package/dist/{chunk-JVIKCGDY.js → chunk-NXL6LDJU.js} +1 -1
- package/dist/chunk-OA4P6AKS.js +1 -0
- package/dist/chunk-OKNBZSGN.js +2 -0
- package/dist/chunk-OKOYLEA7.js +278 -0
- package/dist/chunk-OLOBQ42K.js +1 -0
- package/dist/chunk-OYP7DKPU.js +1 -0
- package/dist/{chunk-7UYZQN4V.js → chunk-PBTXPBI6.js} +2 -2
- package/dist/chunk-PLQFX5ZP.js +9 -0
- package/dist/{chunk-JLBH7RCF.js → chunk-PS25FEBF.js} +1 -1
- package/dist/{chunk-OLZHWPZP.js → chunk-PSQFZAF3.js} +1 -1
- package/dist/chunk-PUTZFF2Z.js +613 -0
- package/dist/chunk-QLQGHMVU.js +15 -0
- package/dist/{chunk-XLELNRFF.js → chunk-QTGMS62F.js} +1 -1
- package/dist/chunk-R6JNXEB3.js +1 -0
- package/dist/chunk-RAH5NW3R.js +1 -0
- package/dist/{chunk-R466TU3N.js → chunk-RGNAWKD7.js} +1 -1
- package/dist/chunk-RL5BWZ7D.js +15 -0
- package/dist/{chunk-Y5JKV2AI.js → chunk-RVMB5LC2.js} +1 -1
- package/dist/chunk-SSM346XI.js +5 -0
- package/dist/chunk-T5MK7ZSF.js +1 -0
- package/dist/{chunk-22PCRFG4.js → chunk-TGACBJIY.js} +1 -1
- package/dist/{chunk-KBQ4LGFB.js → chunk-TLSAQ6FG.js} +1 -1
- package/dist/chunk-TNQXTZAX.js +32 -0
- package/dist/{chunk-ELVFJ7BR.js → chunk-TQGTEVSR.js} +1 -1
- package/dist/chunk-TXUTT6UA.js +17 -0
- package/dist/chunk-U3ZG675O.js +5 -0
- package/dist/chunk-UARVYVLN.js +3 -0
- package/dist/chunk-UBKVCI7A.js +3 -0
- package/dist/{chunk-SRCQVUMC.js → chunk-UCLSPAVX.js} +1 -1
- package/dist/chunk-ULQG3XQS.js +1 -0
- package/dist/chunk-UOQ75BL3.js +1 -0
- package/dist/{chunk-OXPWCC7I.js → chunk-UOQQNAHX.js} +2 -2
- package/dist/chunk-UURFVUAH.js +11 -0
- package/dist/chunk-VA5IUGZV.js +2 -0
- package/dist/{chunk-YZDDTYTU.js → chunk-VEDZUOVI.js} +3 -3
- package/dist/chunk-VICNWPLQ.js +567 -0
- package/dist/chunk-VPL2NDH6.js +370 -0
- package/dist/chunk-VT77EFRL.js +10 -0
- package/dist/chunk-VYXVYOIJ.js +3 -0
- package/dist/chunk-WCWNI3ZV.js +283 -0
- package/dist/chunk-WNGV4JQS.js +4 -0
- package/dist/chunk-WUK5NQSX.js +6 -0
- package/dist/chunk-X2TC7S57.js +103 -0
- package/dist/chunk-X4CV6TRE.js +1 -0
- package/dist/chunk-XDAOLCPN.js +4 -0
- package/dist/chunk-XFKCDWXB.js +5 -0
- package/dist/chunk-XP6IRAZN.js +1 -0
- package/dist/{chunk-JGXWQULI.js → chunk-XX343DDG.js} +1 -1
- package/dist/{chunk-Q7ING5F5.js → chunk-XXE7667M.js} +1 -1
- package/dist/chunk-YGMVL6NZ.js +6 -0
- package/dist/chunk-YJB7P2HC.js +1 -0
- package/dist/{chunk-P6XE4MH5.js → chunk-YS6VOQ7I.js} +1 -1
- package/dist/chunk-ZZYFG22L.js +26 -0
- package/dist/cli/commands/app/app-logs/sources.js +1 -2
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -9
- package/dist/cli/commands/app/bulk/status.js +1 -5
- package/dist/cli/commands/app/config/link.js +1 -4
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -3
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -22
- package/dist/cli/commands/app/dev/clean.js +1 -5
- package/dist/cli/commands/app/dev.js +1 -320
- package/dist/cli/commands/app/env/pull.js +1 -11
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -16
- package/dist/cli/commands/app/function/replay.js +1 -5
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -5
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -4
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -11
- package/dist/cli/commands/app/init.js +1 -10
- package/dist/cli/commands/app/logs.js +1 -2
- package/dist/cli/commands/app/release.js +1 -4
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -25
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/docs/generate.d.ts +0 -8
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -15
- package/dist/cli/commands/theme/delete.js +1 -7
- package/dist/cli/commands/theme/dev.js +1 -26
- package/dist/cli/commands/theme/duplicate.js +1 -32
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -8
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -3
- package/dist/cli/commands/theme/open.js +1 -8
- package/dist/cli/commands/theme/package.js +1 -7
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -3
- package/dist/cli/commands/theme/publish.js +1 -7
- package/dist/cli/commands/theme/pull.js +1 -3
- package/dist/cli/commands/theme/push.js +1 -28
- package/dist/cli/commands/theme/rename.js +1 -6
- package/dist/cli/commands/theme/share.js +1 -3
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-6QNH5BID.js +1 -0
- package/dist/configs/all.yml +3 -0
- package/dist/configs/recommended.yml +3 -0
- package/dist/{custom-oclif-loader-DVFFWCBV.js → custom-oclif-loader-TSPWW5YF.js} +1 -1
- package/dist/data/filters.json +60 -0
- package/dist/data/latest.json +1 -1
- package/dist/data/setting.json +29 -9
- package/dist/data/shopify_system_translations.json +71 -19
- package/dist/data/tags.json +3 -3
- package/dist/deprecations-F6JWVV2W.js +1 -0
- package/dist/{devtools-OLOT2NY4.js → devtools-HCKYP7DQ.js} +1 -1
- package/dist/{devtools-UFRKBFGI.js → devtools-VEZNCV6W.js} +1 -1
- package/dist/dist-4BD6KOLR.js +1 -0
- package/dist/dist-AUABCVPI.js +1 -0
- package/dist/environments-RGLI75HN.js +1 -0
- package/dist/error-OZALZZ3U.js +1 -0
- package/dist/error-handler-V7LSEXHM.js +1 -0
- package/dist/{estree-KI7NUW53.js → estree-BYYJYS3A.js} +1 -1
- package/dist/fs-YMUQ6JLE.js +1 -0
- package/dist/hooks/app-init.js +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/html-HETICZ2F.js +25 -0
- package/dist/index.js +9 -1182
- package/dist/is-global-BLIZ57HQ.js +1 -0
- package/dist/is-wsl-TN2CXYI7.js +1 -0
- package/dist/{latest-version-EFWBOTWM.js → latest-version-6OAYLOBL.js} +1 -1
- package/dist/{lib-QB6I6CTC.js → lib-AK5EOIKR.js} +1 -1
- package/dist/{lib-C3VO2BQW.js → lib-LVUMLZ4H.js} +1 -1
- package/dist/lib-ME6554NA.js +1 -0
- package/dist/local-GPDAXHE6.js +1 -0
- package/dist/local-storage-P66KJG6I.js +1 -0
- package/dist/{markdown-PLKL4IZK.js → markdown-5TVCXM53.js} +1 -1
- package/dist/{metadata-UDMOTRS7.js → metadata-TRH25EHU.js} +1 -1
- package/dist/{morph-EMYAITFM.js → morph-I35VYPBH.js} +4 -4
- package/dist/node-package-manager-GO4ZRTKQ.js +1 -0
- package/dist/notifications-system-HM6JZ6WJ.js +1 -0
- package/dist/{npa-ICFSA3NL.js → npa-VNALV7XY.js} +1 -1
- package/dist/output-7IYOMPSA.js +1 -0
- package/dist/{postcss-3FJQPJI2.js → postcss-IIK6CGAW.js} +1 -1
- package/dist/{prettier-NVRHEAFO.js → prettier-ZSBNNQTK.js} +1 -1
- package/dist/system-X5C4EQQH.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-H62CMRLG.js +1 -0
- package/dist/upgrade-EEOPH464.js +1 -0
- package/dist/version-76NBQR4K.js +1 -0
- package/dist/version-IGSEISUA.js +1 -0
- package/dist/{workerd-L2EJKIAQ.js → workerd-ST6XJKUN.js} +1 -1
- package/oclif.manifest.json +142 -7
- package/package.json +14 -11
- package/dist/analytics-6IHHYAV6.js +0 -1
- package/dist/analytics-KKVP5DT3.js +0 -1
- package/dist/angular-VRDO2DBE.js +0 -4
- package/dist/chunk-26D72ZNV.js +0 -1
- package/dist/chunk-2I4PRX2I.js +0 -1
- package/dist/chunk-2VQJQ36C.js +0 -103
- package/dist/chunk-323UTVMM.js +0 -1
- package/dist/chunk-3F6NZK7S.js +0 -2
- package/dist/chunk-4G7J6HIV.js +0 -1
- package/dist/chunk-66RJ5T7A.js +0 -102
- package/dist/chunk-6BMMB2UO.js +0 -1
- package/dist/chunk-6HBRBQAN.js +0 -6
- package/dist/chunk-74HYYXXE.js +0 -17
- package/dist/chunk-7BGM2GAH.js +0 -1
- package/dist/chunk-AIV5RI3X.js +0 -1
- package/dist/chunk-AKML26N3.js +0 -7
- package/dist/chunk-ALKTLKQ6.js +0 -5
- package/dist/chunk-B2EHO7ZC.js +0 -847
- package/dist/chunk-B2IVY4V5.js +0 -1
- package/dist/chunk-BDVAE5MS.js +0 -28
- package/dist/chunk-CERXUPGC.js +0 -14
- package/dist/chunk-D3TSJA5S.js +0 -1
- package/dist/chunk-DFMQWJQ3.js +0 -3
- package/dist/chunk-DJQVNH7P.js +0 -567
- package/dist/chunk-ELYP4KFP.js +0 -8
- package/dist/chunk-FFQ5EWII.js +0 -294
- package/dist/chunk-FUOIGXI4.js +0 -1
- package/dist/chunk-GD7FWXJ5.js +0 -2
- package/dist/chunk-GFEAKSGV.js +0 -374
- package/dist/chunk-IIIVWD4R.js +0 -1
- package/dist/chunk-IX5ICOBV.js +0 -7
- package/dist/chunk-J3KVONB3.js +0 -6
- package/dist/chunk-JHPRFW5B.js +0 -19
- package/dist/chunk-K2WUCOQJ.js +0 -32
- package/dist/chunk-K5YV6UVF.js +0 -4
- package/dist/chunk-KGXQS7LS.js +0 -1
- package/dist/chunk-KL5Z3T6L.js +0 -1
- package/dist/chunk-KNVM7N3U.js +0 -1
- package/dist/chunk-KWJ562F2.js +0 -12
- package/dist/chunk-LALIKZPS.js +0 -5
- package/dist/chunk-LAZJ47DZ.js +0 -6
- package/dist/chunk-LDGAHMS7.js +0 -159
- package/dist/chunk-LW7U753G.js +0 -1
- package/dist/chunk-LXFJDCNG.js +0 -1
- package/dist/chunk-N5YIPQ6J.js +0 -1
- package/dist/chunk-N7RBSKYT.js +0 -1
- package/dist/chunk-NF2ABOOU.js +0 -1
- package/dist/chunk-ODNGDO4H.js +0 -50
- package/dist/chunk-OHY4ZL3U.js +0 -2
- package/dist/chunk-P5VVOLGV.js +0 -1
- package/dist/chunk-P7R7FBY2.js +0 -3
- package/dist/chunk-QRRNOVJ3.js +0 -1
- package/dist/chunk-RFG5RMPL.js +0 -1
- package/dist/chunk-RVNMVBPM.js +0 -1
- package/dist/chunk-SBEZBZM7.js +0 -144
- package/dist/chunk-SGQ6D3LU.js +0 -15
- package/dist/chunk-TFSBQ4RY.js +0 -5
- package/dist/chunk-UGXYQ23Y.js +0 -1411
- package/dist/chunk-VS3T5YOG.js +0 -264
- package/dist/chunk-VWYM4OWK.js +0 -1
- package/dist/chunk-VY6SNDKW.js +0 -3
- package/dist/chunk-WFXRSKRK.js +0 -1
- package/dist/chunk-XBXMPFXM.js +0 -1
- package/dist/chunk-YC6G4MHD.js +0 -3
- package/dist/chunk-YI232QLS.js +0 -1
- package/dist/chunk-ZTMSBSYD.js +0 -1
- package/dist/chunk-ZV6NCNI4.js +0 -586
- package/dist/chunk-ZVJVDCIM.js +0 -1
- package/dist/conf-store-U5ZITKJN.js +0 -1
- package/dist/deprecations-TU5UQJVV.js +0 -1
- package/dist/dist-2Z5TND4U.js +0 -1
- package/dist/dist-GYHFDHKP.js +0 -1
- package/dist/environments-Z5PR7DSI.js +0 -1
- package/dist/error-IJGNYKZ3.js +0 -1
- package/dist/error-handler-WSCGNS2P.js +0 -1
- package/dist/fs-5BDEA2KD.js +0 -1
- package/dist/html-VSSXOZOQ.js +0 -25
- package/dist/is-global-V4ZRHQG2.js +0 -1
- package/dist/is-wsl-FVUIXDOK.js +0 -1
- package/dist/lib-5L7UKDEK.js +0 -1
- package/dist/local-6QPX4GCJ.js +0 -1
- package/dist/local-storage-JLXBZVWO.js +0 -1
- package/dist/node-package-manager-HAFRYGUM.js +0 -1
- package/dist/notifications-system-MP7WDOCS.js +0 -1
- package/dist/output-YGMHXEIS.js +0 -1
- package/dist/system-KLXD4FXF.js +0 -1
- package/dist/ui-GHG3UGB3.js +0 -1
- package/dist/upgrade-OPZGPM5J.js +0 -1
- package/dist/version-D5PJZIRW.js +0 -1
- package/dist/version-KRQBMYCH.js +0 -1
- /package/dist/{acorn-LOOAJL3S.js → acorn-QBS5IYTX.js} +0 -0
- /package/dist/{babel-URCL33XX.js → babel-JS32NLHY.js} +0 -0
- /package/dist/{flow-MLHT7MTJ.js → flow-M3Q2HPQT.js} +0 -0
- /package/dist/{glimmer-HAJ4HQCW.js → glimmer-3DEJJGOJ.js} +0 -0
- /package/dist/{graphql-F7IHGXDT.js → graphql-A4HHE3MB.js} +0 -0
- /package/dist/{meriyah-AYZQ3BGY.js → meriyah-23OZNYWC.js} +0 -0
- /package/dist/{typescript-ODJ335NU.js → typescript-YKZ232QT.js} +0 -0
- /package/dist/{yaml-BIHS2GQW.js → yaml-SJKIH3VD.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as b}from"./chunk-D3DDLLNF.js";import{G as h,I as u,K as T}from"./chunk-IOQQUHST.js";import{a as F}from"./chunk-7BFDUVOG.js";import{k as y,q as O}from"./chunk-HHXHOQQP.js";import{o as f,ua as v}from"./chunk-4V4DQ6W7.js";import{b as I}from"./chunk-4KRT35A2.js";import{v as _}from"./chunk-MGL4YM3S.js";import{d as s}from"./chunk-BHWEA4V2.js";import{r as U}from"./chunk-3YWUSKWF.js";import{Mb as S,Ua as l,ma as c}from"./chunk-VPL2NDH6.js";import{e as A,g as p}from"./chunk-VPRTJUIN.js";p();p();p();async function P({session:e,overridesContent:r,themeId:t}){v("theme-preview:create");let w=`${u(e)}/theme_preview.json?preview_theme_id=${t}`,o=await h(e,{headers:{"Content-Type":"application/json"}}),i=await f(w,{method:"POST",body:r,headers:o});if(!i.ok)throw new s(`Theme preview request failed with status ${i.status}: ${i.statusText}`);let a=await J(i);return v("theme-preview:create"),a}async function g({session:e,overridesContent:r,themeId:t,previewIdentifier:d}){v("theme-preview:update");let o=`${u(e)}/theme_preview.json?preview_theme_id=${t}&preview_identifier=${encodeURIComponent(d)}`,i=await h(e,{headers:{"Content-Type":"application/json"}}),a=await f(o,{method:"POST",body:r,headers:i});if(!a.ok)throw new s(`Theme preview request failed with status ${a.status}: ${a.statusText}`);let x=await J(a);return v("theme-preview:update"),x}async function J(e){let r=await e.json();if(r.error)throw new s(`Theme preview failed: ${r.error}`);if(!r.url||!r.preview_identifier)throw new s("Theme preview returned an unexpected response");return{url:r.url,preview_identifier:r.preview_identifier}}async function $(e){if(!l(e.overrideJson))throw new s(`Override file not found: ${e.overrideJson}`);let r=await c(e.overrideJson),t;try{t=JSON.parse(r)}catch(i){let a=i instanceof Error?i.message:String(i);throw new s(`Failed to parse override file: ${e.overrideJson}`,a)}let d=await T(e.themeId,e.adminSession,e.password),w=JSON.stringify(t),o=e.previewIdentifier?await g({session:d,overridesContent:w,themeId:e.themeId,previewIdentifier:e.previewIdentifier}):await P({session:d,overridesContent:w,themeId:e.themeId});e.json?S(JSON.stringify({url:o.url,preview_identifier:o.preview_identifier})):_({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 m=A(U(),1);var E,n=class extends O{async command(r,t){let d=await F(t,{filter:{theme:r.theme}});await $({adminSession:t,overrideJson:r.overrides,themeId:d.id.toString(),previewIdentifier:r["preview-id"],open:r.open,password:r.password,json:r.json})}};E=n;n.summary="Applies JSON overrides to a theme and returns a preview URL.";n.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.";n.description=E.descriptionWithoutMarkdown();n.flags={...I,...y,theme:m.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",required:!0}),overrides:m.Flags.string({description:"Path to a JSON overrides file.",env:"SHOPIFY_FLAG_OVERRIDES",required:!0}),"preview-id":m.Flags.string({description:"An existing preview identifier to update instead of creating a new preview.",env:"SHOPIFY_FLAG_PREVIEW_ID"}),open:m.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),json:m.Flags.boolean({description:"Output the preview URL and identifier as JSON.",env:"SHOPIFY_FLAG_JSON",default:!1})};n.multiEnvironmentsFlags=null;var ee=n;export{ee as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as L}from"./chunk-LCCMXY6N.js";import{a as M}from"./chunk-T5MK7ZSF.js";import{a as C}from"./chunk-DCK2FX6J.js";import{F as j,Fa as E}from"./chunk-WCWNI3ZV.js";import{e as I}from"./chunk-N5ROZKPZ.js";import{a as J}from"./chunk-AP3RFOPL.js";import{R as h,da as g,ga as A,z as y}from"./chunk-4V4DQ6W7.js";import{b as O}from"./chunk-4KRT35A2.js";import{D,E as f,u as T}from"./chunk-MGL4YM3S.js";import{g as R}from"./chunk-BHWEA4V2.js";import{r as z}from"./chunk-3YWUSKWF.js";import{Fb as k,Hb as m,Mb as v}from"./chunk-VPL2NDH6.js";import{e as _,g as s}from"./chunk-VPRTJUIN.js";s();s();s();var P={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"}}]}}]}}]};s();async function Q(e){let i="Admin",n=I(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function w(e){return A({query:e.query,...await Q(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}s();var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var $=_(J(),1);var Z={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function q({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>w({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),l=[];for(l.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),l.push(...o.nodes);return{status:"ok",items:l}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function x(e,i){let n="";for(let t of e)n=(0,$.updateTomlValues)(n,t);return`# ${i}
|
|
2
|
+
${n}`}function X(e,i){let n=i.map(le).map(a=>{switch(a.status){case"ok":{let{typeName:o,patches:l}=a;return x(l,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:l})=>a.map(r=>({result:oe(r,o),graphQLOwner:l}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:l,key:r,patches:b}=a;return x(b,`namespace: ${l==="app"?"$app":`$app:${l}`} 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 K(e){let i=await de(e),n=i.storeFqdn,t=await ne(i),d=await ie(i);e.includeExistingDeclaredDefinitions||(t=te(t,e.appConfiguration),d=ae(d,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:l}=X(t,d);ee(o,l,n,a)}function ee(e,i,n,t){T({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."]]}),ue(t)}async function ne(e){let i=[];return await D(Object.entries(Z).map(([n,t])=>({title:m`Loading ${k.green(n)} metafields`,task:async()=>{let d=await q({query:P,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 ie(e){let i=await f({title:m`Loading ${k.green("metaobjects")}`,task:async()=>q({query:V,session:e,toNodes:n=>n.metaobjectDefinitions,toVariables:n=>({after:n})})});return i.status==="ok"?i.items:[]}function te(e,i){return e.map(n=>{let t=n.items.filter(d=>!U(i,[n.ownerType,"metafields",p(d.namespace)??"",d.key]));return t.length>0?{...n,items:t}:null}).filter(n=>n!==null)}function ae(e,i){return e.filter(n=>!U(i,["metaobjects","app",p(n.type)??""]))}function U(e,i){let n=e;for(let t of i){if(!n[t])return!1;n=n[t]}return!0}async function de(e){let{remoteApp:i,store:n}=e,t=i.apiSecretKeys[0]?.secret;if(!t)throw new R("No API secret keys found for app");return await h(n.shopDomain,i.apiKey,t)}function p(e){if(!e.match(/^app--\d+/))return null;let i="app";return e.match(/^app--\d+--/)&&(i=e.replace(/^app--\d+--/,"")),i}function oe(e,i){let n=p(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,d=se(e),a=me(d,i,n,t);return{status:"ok",key:t,namespace:n,patches:a}}function le(e){let i=p(e.type);if(!i)return{status:"not_app_reserved"};let n=re(e,i),t=ce(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:u({admin_filterable:e.capabilities.adminFilterable.enabled||void 0}),access:u({admin:Y(e.access.admin),storefront:H(e.access.storefront),customer_account:pe(e.access.customerAccount)}),validations:B(e.validations)},{type:n,validations:t}=G(i.type,i.validations);return i.type=n,i.validations=t,i}function re(e,i){return{name:e.name===i?void 0:e.name,description:e.description??void 0,display_name_field:e.displayNameKey??void 0,access:u({admin:Y(e.access.admin),storefront:H(e.access.storefront)}),capabilities:u({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:B(n.validations)},{type:d,validations:a}=G(t.type,t.validations);return t.type=d,t.validations=a,[n.key,t]}))}}function G(e,i){if(!i)return{type:e,validations:void 0};if(i.metaobject_definition_type&&typeof i.metaobject_definition_type=="string"){let n=p(i.metaobject_definition_type);return{type:`${e}<$app:${n}>`,validations:u({...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=>p(t));return{type:`${e}<${n.map(t=>`$app:${t}`).join(",")}>`,validations:u({...i,metaobject_definition_types:void 0})}}return{type:e,validations:i}}function B(e){let i=n=>{try{return JSON.parse(n)}catch{return n}};return u(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 me(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&&W(e.validations).forEach(({validationKey:l,actualValue:r})=>{d.push([[i,"metafields",n,t,"validations",l],r])}),[N(d),N(a)]}function ce(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(([l,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&&W(a.validations).forEach(({validationKey:r,actualValue:b})=>{n.push([["metaobjects","app",i,"fields",d,"validations",r],b])}))}}),[N(n),N(t)]}function W(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 ue(e){let i=e.split(`
|
|
4
|
+
`);for(let n of i)n.match(/^\s*\[/)?v(m`${k.green(n)}`):n.match(/^\s*#/)?v(m`${k.gray(n)}`):v(m`${n}`)}function Y(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 H(e){switch(e){case"PUBLIC_READ":return"public_read";case"NONE":case null:case void 0:return}}function pe(e){switch(e){case"READ":return"read";case"READ_WRITE":return"read_write";case"NONE":case null:case void 0:return}}function u(e){if(e&&!g(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function N(e){return e.filter(([i,n])=>n!==void 0)}var S=_(z(),1);var F,c=class extends M{async run(){let{appContextResult:i,...n}=await f({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(F);await j(t.path);let d=await E({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await L({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 K(n),{app:i.app}}};F=c;c.summary="Import metafield and metaobject definitions.";c.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).";c.description=F.descriptionWithoutMarkdown();c.flags={...O,...C,store:S.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>y(e)}),"include-existing":S.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})};var Ke=c;export{Ke as a};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{k as we,t as ge}from"./chunk-MZJRNFAU.js";import{M as fe,O as de,o as L,va as y,xa as C}from"./chunk-4V4DQ6W7.js";import{a as ue}from"./chunk-YJB7P2HC.js";import{P as pe,x as le,y as he}from"./chunk-MGL4YM3S.js";import{d as R}from"./chunk-BHWEA4V2.js";import{Fb as F,Hb as ye,Pb as h}from"./chunk-VPL2NDH6.js";import{u as me}from"./chunk-UARVYVLN.js";import{g as l}from"./chunk-VPRTJUIN.js";l();l();function _e(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,n);for(let[r,n]of Object.entries(e.replaceExtensionTemplates??[])){let o=r.split("/")[0];t.append(`replace_extension_templates[${o}][${r}]`,n)}return t.append("_method",e.method),t}function S(){return{"User-Agent":`Shopify CLI; v=${ue}`}}function W(e){return delete e.cookie,delete e.authorization,e}l();function T(e){let t={};return e.split(";").forEach(r=>{let n=r.match(/(.*?)=(.*)$/)??[],o=n[1]?.trim(),s=n[2]?.trim()??"";o&&(t[o]=s)}),t}function I(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var k=class extends R{};async function $r(e){return ge(e)}async function jr(e,t){let r=Ce(t),n=new URLSearchParams;n.append("form_type","storefront_password"),n.append("utf8","\u2713"),n.append("password",e??""),C("theme-service:storefront-session:check-storefront-password");let o=await L(`${r}/password`,{headers:{"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded"},body:n.toString(),method:"POST",redirect:"manual"});if(o.status===429)throw y(new R(`Too many incorrect password attempts. Please try again after ${o.headers.get("retry-after")} seconds.`));return Ee(o,r)}async function Re(e,t,r,n,o={}){let s={},a=await be(e,r,o),c=Ce(t);if(s._shopify_essential=a,C(`theme-service:storefront-session:is-password-protected:${!!n}`),!n)return s;let i=await rt(a,e,c,n,o);return{...s,...i}}async function be(e,t,r,n=1){let o=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),s=`${e}?${o}`;C("theme-service:storefront-session:get-session-essential-cookie");let a=await L(s,{method:"HEAD",redirect:"manual",headers:{...r,...S()}}),c=a.headers.raw()["set-cookie"]??[],i=z(c,"_shopify_essential");if(!i){if(h(`Failed to obtain _shopify_essential cookie.
|
|
2
|
+
|
|
3
|
+
-Request ID: ${a.headers.get("x-request-id")??"unknown"}
|
|
4
|
+
|
|
5
|
+
-Body: ${await a.text()}
|
|
6
|
+
|
|
7
|
+
-Status: ${a.status}
|
|
8
|
+
`),n>3)throw y(new k('Your development session could not be created because the "_shopify_essential" could not be defined. Please, check your internet connection.'));return h("Retrying to obtain the _shopify_essential cookie..."),await pe(n),be(e,t,r,n+1)}return i}async function rt(e,t,r,n,o){let s=new URLSearchParams({password:n}),a=await L(`${t}/password`,{method:"POST",redirect:"manual",body:s,headers:{...o,...S(),Cookie:I({_shopify_essential:e})}});if(!Ee(a,r))throw y(new R("Your development session could not be created because the store password is invalid. Please, retry with a different password."));let c=a.headers.raw()["set-cookie"]??[],i=z(c,"storefront_digest"),u=z(c,"_shopify_essential"),f={};return i&&(f.storefront_digest=i),u&&(f._shopify_essential=u),f}function Ee(e,t){let r=e.headers.get("location")??"",n;try{n=new URL(r,t)}catch(s){if(s instanceof TypeError)return!1;throw s}let o=new URL(t).origin;return e.status===302&&n.origin===o}function z(e,t){let r=e.find(o=>T(o)[t]);return r?T(r)[t]:void 0}function Ce(e){return`https://${e}`}l();l();l();l();var Br=String.fromCharCode;var Ae=/\+/g;var nt=/%2f/gi;function H(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}function G(e){return H(e.replace(nt,"%252F"))}function ot(e){return H(e.replace(Ae," "))}function st(e){return H(e.replace(Ae," "))}function at(e=""){let t=Object.create(null);e[0]==="?"&&(e=e.slice(1));for(let r of e.split("&")){let n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;let o=ot(n[1]);if(o==="__proto__"||o==="constructor")continue;let s=st(n[2]||"");t[o]===void 0?t[o]=s:Array.isArray(t[o])?t[o].push(s):t[o]=[t[o],s]}return t}var it=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,ct=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,ut=/^([/\\]\s*){2,}[^/\\]/;var ft=/\/$|\/\?|\/#/,dt=/^\.?\//;function lt(e,t={}){return typeof t=="boolean"&&(t={acceptRelative:t}),t.strict?it.test(e):ct.test(e)||(t.acceptRelative?ut.test(e):!1)}function V(e="",t){return t?ft.test(e):e.endsWith("/")}function J(e="",t){if(!t)return(V(e)?e.slice(0,-1):e)||"/";if(!V(e,!0))return e||"/";let r=e,n="",o=e.indexOf("#");o!==-1&&(r=e.slice(0,o),n=e.slice(o));let[s,...a]=r.split("?");return((s.endsWith("/")?s.slice(0,-1):s)||"/")+(a.length>0?`?${a.join("?")}`:"")+n}function ht(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(V(e,!0))return e||"/";let r=e,n="",o=e.indexOf("#");if(o!==-1&&(r=e.slice(0,o),n=e.slice(o),!r))return n;let[s,...a]=r.split("?");return s+"/"+(a.length>0?`?${a.join("?")}`:"")+n}function pt(e=""){return e.startsWith("/")}function Q(e=""){return pt(e)?e:"/"+e}function xe(e){return at(P(e).search)}function mt(e){return e&&e!=="/"}function Te(e,...t){let r=e||"";for(let n of t.filter(o=>mt(o)))if(r){let o=n.replace(dt,"");r=ht(r)+o}else r=n;return r}var yt=Symbol.for("ufo:protocolRelative");function P(e="",t){let r=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){let[,d,p=""]=r;return{protocol:d.toLowerCase(),pathname:p,href:d+p,auth:"",host:"",search:"",hash:""}}if(!lt(e,{acceptRelative:!0}))return t?P(t+e):Se(e);let[,n="",o,s=""]=e.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,a="",c=""]=s.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(c=c.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:i,search:u,hash:f}=Se(c);return{protocol:n.toLowerCase(),auth:o?o.slice(0,Math.max(0,o.length-1)):"",host:a,pathname:i,search:u,hash:f,[yt]:!n}}function Se(e=""){let[t="",r="",n=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:r,hash:n}}l();var wt=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function ke(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");let r=new wt,n=t||{},o=n.decode||gt,s=0;for(;s<e.length;){let a=e.indexOf("=",s);if(a===-1)break;let c=e.indexOf(";",s);if(c===-1)c=e.length;else if(c<a){s=e.lastIndexOf(";",a-1)+1;continue}let i=e.slice(s,a).trim();if(n?.filter&&!n?.filter(i)){s=c+1;continue}if(r[i]===void 0){let u=e.slice(a+1,c).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),r[i]=_t(u,o)}s=c+1}return r}function gt(e){return e.includes("%")?decodeURIComponent(e):e}function _t(e,t){try{return t(e)}catch{return e}}l();var g={NORMAL:0,WILDCARD:1,PLACEHOLDER:2};function Oe(e={}){let t={options:e,rootNode:Ne(),staticRoutesMap:{}},r=n=>e.strictTrailingSlash?n:n.replace(/\/$/,"")||"/";if(e.routes)for(let n in e.routes)He(t,r(n),e.routes[n]);return{ctx:t,lookup:n=>Rt(t,r(n)),insert:(n,o)=>He(t,r(n),o),remove:n=>bt(t,r(n))}}function Rt(e,t){let r=e.staticRoutesMap[t];if(r)return r.data;let n=t.split("/"),o={},s=!1,a=null,c=e.rootNode,i=null;for(let u=0;u<n.length;u++){let f=n[u];c.wildcardChildNode!==null&&(a=c.wildcardChildNode,i=n.slice(u).join("/"));let d=c.children.get(f);if(d===void 0){if(c&&c.placeholderChildren.length>1){let p=n.length-u;c=c.placeholderChildren.find(B=>B.maxDepth===p)||null}else c=c.placeholderChildren[0]||null;if(!c)break;c.paramName&&(o[c.paramName]=f),s=!0}else c=d}return(c===null||c.data===null)&&a!==null&&(c=a,o[c.paramName||"_"]=i,s=!0),c?s?{...c.data,params:s?o:void 0}:c.data:null}function He(e,t,r){let n=!0,o=t.split("/"),s=e.rootNode,a=0,c=[s];for(let i of o){let u;if(u=s.children.get(i))s=u;else{let f=Et(i);u=Ne({type:f,parent:s}),s.children.set(i,u),f===g.PLACEHOLDER?(u.paramName=i==="*"?`_${a++}`:i.slice(1),s.placeholderChildren.push(u),n=!1):f===g.WILDCARD&&(s.wildcardChildNode=u,u.paramName=i.slice(3)||"_",n=!1),c.push(u),s=u}}for(let[i,u]of c.entries())u.maxDepth=Math.max(c.length-i,u.maxDepth||0);return s.data=r,n===!0&&(e.staticRoutesMap[t]=s),s}function bt(e,t){let r=!1,n=t.split("/"),o=e.rootNode;for(let s of n)if(o=o.children.get(s),!o)return r;if(o.data){let s=n.at(-1)||"";o.data=null,Object.keys(o.children).length===0&&o.parent&&(o.parent.children.delete(s),o.parent.wildcardChildNode=null,o.parent.placeholderChildren=[]),r=!0}return r}function Ne(e={}){return{type:e.type||g.NORMAL,maxDepth:0,parent:e.parent||null,children:new Map,data:e.data||null,paramName:e.paramName||null,wildcardChildNode:null,placeholderChildren:[]}}function Et(e){return e.startsWith("**")?g.WILDCARD:e[0]===":"||e==="*"?g.PLACEHOLDER:g.NORMAL}function qe(e){let t=Le("",e.ctx.rootNode);return Ct(t,e.ctx.options.strictTrailingSlash)}function Ct(e,t){return{ctx:{table:e},matchAll:r=>Me(r,e,t)}}function St(){return{static:new Map,wildcard:new Map,dynamic:new Map}}function Me(e,t,r){r!==!0&&e.endsWith("/")&&(e=e.slice(0,-1)||"/");let n=[];for(let[s,a]of Pe(t.wildcard))(e===s||e.startsWith(s+"/"))&&n.push(a);for(let[s,a]of Pe(t.dynamic))if(e.startsWith(s+"/")){let c="/"+e.slice(s.length).split("/").splice(2).join("/");n.push(...Me(c,a))}let o=t.static.get(e);return o&&n.push(o),n.filter(Boolean)}function Pe(e){return[...e.entries()].sort((t,r)=>t[0].length-r[0].length)}function Le(e,t){let r=St();function n(o,s){if(o){if(s.type===g.NORMAL&&!(o.includes("*")||o.includes(":")))s.data&&r.static.set(o,s.data);else if(s.type===g.WILDCARD)r.wildcard.set(o.replace("/**",""),s.data);else if(s.type===g.PLACEHOLDER){let a=Le("",s);s.data&&a.static.set("/",s.data),r.dynamic.set(o.replace(/\/\*|\/:\w+/,""),a);return}}for(let[a,c]of s.children.entries())n(`${o}/${a}`.replace("//","/"),c)}return n(e,t),r}l();function K(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function X(e,t,r=".",n){if(!K(t))return X(e,{},r,n);let o={...t};for(let s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;let a=e[s];a!=null&&(n&&n(o,s,a,r)||(Array.isArray(a)&&Array.isArray(o[s])?o[s]=[...a,...o[s]]:K(a)&&K(o[s])?o[s]=X(a,o[s],(r?`${r}.`:"")+s.toString(),n):o[s]=a))}return o}function Y(e){return(...t)=>t.reduce((r,n)=>X(r,n,"",e),{})}var Ie=Y(),Qr=Y((e,t,r)=>{if(e[t]!==void 0&&typeof r=="function")return e[t]=r(e[t]),!0}),Kr=Y((e,t,r)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});l();var At=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,xt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Tt=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function kt(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Ht(e);return}return t}function Ht(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function $e(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Tt.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(At.test(e)||xt.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,kt)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function x(e,t){try{return t in e}catch{return!1}}var j=class extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(t,r={}){super(t,r),r.cause&&!this.cause&&(this.cause=r.cause)}toJSON(){let t={message:this.message,statusCode:E(this.statusCode,500)};return this.statusMessage&&(t.statusMessage=D(this.statusMessage)),this.data!==void 0&&(t.data=this.data),t}};function m(e){if(typeof e=="string")return new j(e);if(oe(e))return e;let t=new j(e.message??e.statusMessage??"",{cause:e.cause||e});if(x(e,"stack"))try{Object.defineProperty(t,"stack",{get(){return e.stack}})}catch{try{t.stack=e.stack}catch{}}if(e.data&&(t.data=e.data),e.statusCode?t.statusCode=E(e.statusCode,t.statusCode):e.status&&(t.statusCode=E(e.status,t.statusCode)),e.statusMessage?t.statusMessage=e.statusMessage:e.statusText&&(t.statusMessage=e.statusText),t.statusMessage){let r=t.statusMessage;D(t.statusMessage)!==r&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return e.fatal!==void 0&&(t.fatal=e.fatal),e.unhandled!==void 0&&(t.unhandled=e.unhandled),t}function Pt(e,t,r){if(e.handled)return;let n=oe(t)?t:m(t),o={statusCode:n.statusCode,statusMessage:n.statusMessage,stack:[],data:n.data};if(r&&(o.stack=(n.stack||"").split(`
|
|
9
|
+
`).map(a=>a.trim())),e.handled)return;let s=Number.parseInt(n.statusCode);q(e,s,n.statusMessage),e.node.res.setHeader("content-type",N.json),e.node.res.end(JSON.stringify(o,void 0,2))}function oe(e){return e?.constructor?.__h3_error__===!0}function un(e){return xe(e.path||"")}function fn(e,t={}){let r=e.context.params||{};if(t.decode){r={...r};for(let n in r)r[n]=H(r[n])}return r}function Ot(e,t,r){if(r&&e.method==="HEAD")return!0;if(typeof t=="string"){if(e.method===t)return!0}else if(t.includes(e.method))return!0;return!1}function Nt(e,t,r){if(!Ot(e,t,r))throw m({statusCode:405,statusMessage:"HTTP method is not allowed."})}function Fe(e){let t={};for(let r in e.node.req.headers){let n=e.node.req.headers[r];t[r]=Array.isArray(n)?n.filter(Boolean).join(", "):n}return t}function _(e,t){return Fe(e)[t.toLowerCase()]}var je=_;function dn(e,t={}){if(e.context.clientAddress)return e.context.clientAddress;if(t.xForwardedFor){let r=_(e,"x-forwarded-for")?.split(",").shift()?.trim();if(r)return r}if(e.node.req.socket.remoteAddress)return e.node.req.socket.remoteAddress}var ee=Symbol.for("h3RawBody"),Z=Symbol.for("h3ParsedBody"),We=["PATCH","POST","PUT","DELETE"];function ze(e,t="utf8"){Nt(e,We);let r=e._requestBody||e.web?.request?.body||e.node.req[ee]||e.node.req.rawBody||e.node.req.body;if(r){let s=Promise.resolve(r).then(a=>Buffer.isBuffer(a)?a:typeof a.pipeTo=="function"?new Promise((c,i)=>{let u=[];a.pipeTo(new WritableStream({write(f){u.push(f)},close(){c(Buffer.concat(u))},abort(f){i(f)}})).catch(i)}):typeof a.pipe=="function"?new Promise((c,i)=>{let u=[];a.on("data",f=>{u.push(f)}).on("end",()=>{c(Buffer.concat(u))}).on("error",i)}):a.constructor===Object?Buffer.from(JSON.stringify(a)):a instanceof URLSearchParams?Buffer.from(a.toString()):a instanceof FormData?new Response(a).bytes().then(c=>Buffer.from(c)):Buffer.from(a));return t?s.then(a=>a.toString(t)):s}if(!Number.parseInt(e.node.req.headers["content-length"]||"")&&!/\bchunked\b/i.test(String(e.node.req.headers["transfer-encoding"]??"")))return Promise.resolve(void 0);let n=e.node.req[ee]=new Promise((s,a)=>{let c=[];e.node.req.on("error",i=>{a(i)}).on("data",i=>{c.push(i)}).on("end",()=>{s(Buffer.concat(c))})});return t?n.then(s=>s.toString(t)):n}async function ln(e,t={}){let r=e.node.req;if(x(r,Z))return r[Z];let n=r.headers["content-type"]||"",o=await ze(e),s;return n==="application/json"?s=De(o,t.strict??!0):n.startsWith("application/x-www-form-urlencoded")?s=qt(o):n.startsWith("text/")?s=o:s=De(o,t.strict??!1),r[Z]=s,s}function hn(e){if(!We.includes(e.method))return;let t=e.web?.request?.body||e._requestBody;return t||(ee in e.node.req||"rawBody"in e.node.req||"body"in e.node.req||"__unenv__"in e.node.req?new ReadableStream({async start(n){let o=await ze(e,!1);o&&n.enqueue(o),n.close()}}):new ReadableStream({start:n=>{e.node.req.on("data",o=>{n.enqueue(o)}),e.node.req.on("end",()=>{n.close()}),e.node.req.on("error",o=>{n.error(o)})}}))}function De(e="",t){if(e)try{return $e(e,{strict:t})}catch{throw m({statusCode:400,statusMessage:"Bad Request",message:"Invalid JSON body"})}}function qt(e){let t=new URLSearchParams(e),r=Object.create(null);for(let[n,o]of t.entries())x(r,n)?(Array.isArray(r[n])||(r[n]=[r[n]]),r[n].push(o)):r[n]=o;return r}var N={html:"text/html",json:"application/json"},Mt=/[^\u0009\u0020-\u007E]/g;function D(e=""){return e.replace(Mt,"")}function E(e,t=200){return!e||(typeof e=="string"&&(e=Number.parseInt(e,10)),e<100||e>999)?t:e}function Lt(e){return ke(e.node.req.headers.cookie||"")}function pn(e,t){return Lt(e)[t]}function Ve(e){if(Array.isArray(e))return e.flatMap(f=>Ve(f));if(typeof e!="string")return[];let t=[],r=0,n,o,s,a,c,i=()=>{for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length},u=()=>(o=e.charAt(r),o!=="="&&o!==";"&&o!==",");for(;r<e.length;){for(n=r,c=!1;i();)if(o=e.charAt(r),o===","){for(s=r,r+=1,i(),a=r;r<e.length&&u();)r+=1;r<e.length&&e.charAt(r)==="="?(c=!0,r=a,t.push(e.slice(n,s)),n=r):r=s+1}else r+=1;(!c||r>=e.length)&&t.push(e.slice(n))}return t}var It=typeof setImmediate>"u"?e=>e():setImmediate;function w(e,t,r){return r&&$t(e,r),new Promise(n=>{It(()=>{e.handled||e.node.res.end(t),n()})})}function Ge(e,t){if(e.handled)return;!t&&e.node.res.statusCode!==200&&(t=e.node.res.statusCode);let r=E(t,204);r===204&&e.node.res.removeHeader("content-length"),e.node.res.writeHead(r),e.node.res.end()}function q(e,t,r){t&&(e.node.res.statusCode=E(t,e.node.res.statusCode)),r&&(e.node.res.statusMessage=D(r))}function $t(e,t){t&&e.node.res.statusCode!==304&&!e.node.res.getHeader("content-type")&&e.node.res.setHeader("content-type",t)}function mn(e,t,r=302){e.node.res.statusCode=E(r,e.node.res.statusCode),e.node.res.setHeader("location",t);let o=`<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${t.replace(/"/g,"%22")}"></head></html>`;return w(e,o,N.html)}function O(e,t){return e.node.res.getHeader(t)}function jt(e,t){for(let[r,n]of Object.entries(t))e.node.res.setHeader(r,n)}function A(e,t,r){e.node.res.setHeader(t,r)}function Dt(e,t){for(let[r,n]of Object.entries(t))Ut(e,r,n)}var b=Dt;function Ut(e,t,r){let n=e.node.res.getHeader(t);if(!n){e.node.res.setHeader(t,r);return}Array.isArray(n)||(n=[n.toString()]),e.node.res.setHeader(t,[...n,r])}function Je(e){return!e||typeof e!="object"?!1:typeof e.pipe=="function"&&(typeof e._read=="function"||typeof e.abort=="function")||typeof e.pipeTo=="function"}function Bt(e){return typeof Response<"u"&&e instanceof Response}function U(e,t){if(!t||typeof t!="object")throw new Error("[h3] Invalid stream provided.");if(e.node.res._data=t,!e.node.res.socket)return e._handled=!0,Promise.resolve();if(x(t,"pipeTo")&&typeof t.pipeTo=="function")return t.pipeTo(new WritableStream({write(r){e.node.res.write(r)}})).then(()=>{e.node.res.end()});if(x(t,"pipe")&&typeof t.pipe=="function")return new Promise((r,n)=>{t.pipe(e.node.res),t.on&&(t.on("end",()=>{e.node.res.end(),r()}),t.on("error",o=>{n(o)})),e.node.res.on("close",()=>{t.abort&&t.abort()})});throw new Error("[h3] Invalid or incompatible stream provided.")}function Qe(e,t){for(let[r,n]of t.headers)r==="set-cookie"?e.node.res.appendHeader(r,Ve(n)):e.node.res.setHeader(r,n);if(t.status&&(e.node.res.statusCode=E(t.status,e.node.res.statusCode)),t.statusText&&(e.node.res.statusMessage=D(t.statusText)),t.redirected&&e.node.res.setHeader("location",t.url),!t.body){e.node.res.end();return}return U(e,t.body)}function Ft(e={}){return Ie(e,{origin:"*",methods:"*",allowHeaders:"*",exposeHeaders:"*",credentials:!1,maxAge:!1,preflight:{statusCode:204}})}function Wt(e){let t=_(e,"origin"),r=_(e,"access-control-request-method");return e.method==="OPTIONS"&&!!t&&!!r}function zt(e,t){let{origin:r}=t;return!e||!r||r==="*"||r==="null"?!0:Array.isArray(r)?r.some(n=>n instanceof RegExp?n.test(e):e===n):r(e)}function Ke(e,t){let{origin:r}=t,n=_(e,"origin");return!n||!r||r==="*"?{"access-control-allow-origin":"*"}:typeof r=="string"?{"access-control-allow-origin":r,vary:"origin"}:zt(n,t)?{"access-control-allow-origin":n,vary:"origin"}:{}}function Vt(e){let{methods:t}=e;return t?t==="*"?{"access-control-allow-methods":"*"}:t.length>0?{"access-control-allow-methods":t.join(",")}:{}:{}}function Xe(e){let{credentials:t}=e;return t?{"access-control-allow-credentials":"true"}:{}}function Gt(e,t){let{allowHeaders:r}=t;if(!r||r==="*"||r.length===0){let n=_(e,"access-control-request-headers");return n?{"access-control-allow-headers":n,vary:"access-control-request-headers"}:{}}return{"access-control-allow-headers":r.join(","),vary:"access-control-request-headers"}}function Ye(e){let{exposeHeaders:t}=e;return t?t==="*"?{"access-control-expose-headers":t}:{"access-control-expose-headers":t.join(",")}:{}}function Jt(e,t){b(e,Ke(e,t)),b(e,Xe(t)),b(e,Ye(t)),b(e,Vt(t)),b(e,Gt(e,t))}function Qt(e,t){b(e,Ke(e,t)),b(e,Xe(t)),b(e,Ye(t))}function yn(e,t){let r=Ft(t);return Wt(e)?(Jt(e,t),Ge(e,r.preflight.statusCode),!0):(Qt(e,t),!1)}var Kt=new Set(["transfer-encoding","accept-encoding","connection","keep-alive","upgrade","expect","host","accept"]);function wn(e,t){let r=Object.create(null),n=Fe(e);for(let o in n)(!Kt.has(o)||o==="host"&&t?.host)&&(r[o]=n[o]);return r}function $(e){let t="";e.id&&(t+=`id: ${Ue(e.id)}
|
|
10
|
+
`),e.event&&(t+=`event: ${Ue(e.event)}
|
|
11
|
+
`),typeof e.retry=="number"&&Number.isInteger(e.retry)&&(t+=`retry: ${e.retry}
|
|
12
|
+
`);let r=typeof e.data=="string"?e.data:"";for(let n of r.split(/\r\n|\r|\n/))t+=`data: ${n}
|
|
13
|
+
`;return t+=`
|
|
14
|
+
`,t}function Ue(e){return e.replace(/[\n\r]/g,"")}function Xt(e){let t="";for(let r of e)t+=$(r);return t}function Yt(e){let t={"Content-Type":"text/event-stream","Cache-Control":"private, no-cache, no-store, no-transform, must-revalidate, max-age=0","X-Accel-Buffering":"no"};Zt(e)||(t.Connection="keep-alive"),jt(e,t)}function Zt(e){return je(e,":path")!==void 0&&je(e,":method")!==void 0}var te=class{_h3Event;_transformStream=new TransformStream;_writer;_encoder=new TextEncoder;_writerIsClosed=!1;_paused=!1;_unsentData;_disposed=!1;_handled=!1;constructor(t,r={}){this._h3Event=t,this._writer=this._transformStream.writable.getWriter(),this._writer.closed.then(()=>{this._writerIsClosed=!0}),r.autoclose!==!1&&this._h3Event.node.req.on("close",()=>this.close())}async push(t){if(typeof t=="string"){await this._sendEvent({data:t});return}if(Array.isArray(t)){if(t.length===0)return;if(typeof t[0]=="string"){let r=[];for(let n of t)r.push({data:n});await this._sendEvents(r);return}await this._sendEvents(t);return}await this._sendEvent(t)}async _sendEvent(t){if(!this._writerIsClosed){if(this._paused&&!this._unsentData){this._unsentData=$(t);return}if(this._paused){this._unsentData+=$(t);return}await this._writer.write(this._encoder.encode($(t))).catch()}}async _sendEvents(t){if(this._writerIsClosed)return;let r=Xt(t);if(this._paused&&!this._unsentData){this._unsentData=r;return}if(this._paused){this._unsentData+=r;return}await this._writer.write(this._encoder.encode(r)).catch()}pause(){this._paused=!0}get isPaused(){return this._paused}async resume(){this._paused=!1,await this.flush()}async flush(){this._writerIsClosed||this._unsentData?.length&&(await this._writer.write(this._encoder.encode(this._unsentData)),this._unsentData=void 0)}async close(){if(!this._disposed){if(!this._writerIsClosed)try{await this._writer.close()}catch{}this._h3Event._handled&&this._handled&&!this._h3Event.node.res.closed&&this._h3Event.node.res.end(),this._disposed=!0}}onClosed(t){this._writer.closed.then(t)}async send(){Yt(this._h3Event),q(this._h3Event,200),this._h3Event._handled=!0,this._handled=!0,await U(this._h3Event,this._transformStream.readable)}};function gn(e,t){return new te(e,t)}async function _n(e,t){if(e.method!=="GET"&&e.method!=="HEAD"){if(!t.fallthrough)throw m({statusMessage:"Method Not Allowed",statusCode:405});return!1}let r=Q(J(P(e.path).pathname));if(/(^|[\\/])(\.\.|%2e%2e|%2e\.|\.%2e)($|[\\/])/i.test(r)){if(!t.fallthrough)throw m({statusCode:404});return!1}let n=vt(_(e,"accept-encoding"),t.encodings);n.length>1&&A(e,"vary","accept-encoding");let o=r,s,a=er(r,n,t.indexNames||["/index.html"]);for(let u of a){let f=await t.getMeta(u);if(f){s=f,o=u;break}}if(!s){if(!t.fallthrough)throw m({statusCode:404});return!1}if(s.etag&&!O(e,"etag")&&A(e,"etag",s.etag),s.etag&&_(e,"if-none-match")===s.etag)return q(e,304,"Not Modified"),w(e,"");if(s.mtime){let u=new Date(s.mtime),f=_(e,"if-modified-since");if(f&&new Date(f)>=u)return q(e,304,"Not Modified"),w(e,null);O(e,"last-modified")||A(e,"last-modified",u.toUTCString())}if(s.type&&!O(e,"content-type")&&A(e,"content-type",s.type),s.encoding&&!O(e,"content-encoding")&&A(e,"content-encoding",s.encoding),s.size!==void 0&&s.size>0&&!O(e,"content-length")&&A(e,"content-length",s.size),e.method==="HEAD")return w(e,null);let i=await t.getContents(o);return Je(i)?U(e,i):w(e,i)}function vt(e,t){return!t||!e?[]:String(e||"").split(",").map(r=>t[r.trim()]).filter(Boolean)}function er(e,t,r){let n=[];for(let o of["",...r])for(let s of[...t,""])n.push(`${e}${o}${s}`);return n}var re=class{__is_event__=!0;node;web;context={};_method;_path;_headers;_requestBody;_handled=!1;_onBeforeResponseCalled;_onAfterResponseCalled;constructor(t,r){this.node={req:t,res:r}}get method(){return this._method||(this._method=(this.node.req.method||"GET").toUpperCase()),this._method}get path(){return this._path||this.node.req.url||"/"}get headers(){return this._headers||(this._headers=rr(this.node.req.headers)),this._headers}get handled(){return this._handled||this.node.res.writableEnded||this.node.res.headersSent}respondWith(t){return Promise.resolve(t).then(r=>Qe(this,r))}toString(){return`[${this.method}] ${this.path}`}toJSON(){return this.toString()}get req(){return this.node.req}get res(){return this.node.res}};function tr(e,t){return new re(e,t)}function rr(e){let t=new Headers;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let o of n)t.append(r,o);else n&&t.set(r,n);return t}function nr(e){if(typeof e=="function")return e.__is_handler__=!0,e;let t={onRequest:Be(e.onRequest),onBeforeResponse:Be(e.onBeforeResponse)},r=n=>or(n,e.handler,t);return r.__is_handler__=!0,r.__resolve__=e.handler.__resolve__,r.__websocket__=e.websocket,r}function Be(e){return e?Array.isArray(e)?e:[e]:void 0}async function or(e,t,r){if(r.onRequest){for(let s of r.onRequest)if(await s(e),e.handled)return}let o={body:await t(e)};if(r.onBeforeResponse)for(let s of r.onBeforeResponse)await s(e,o);return o.body}var se=nr;function sr(e){return x(e,"__is_handler__")}function ae(e,t,r){return e}function ar(e){let t,r,n=()=>r?Promise.resolve(r):(t||(t=Promise.resolve(e()).then(s=>{let a=s.default||s;if(typeof a!="function")throw new TypeError("Invalid lazy handler result. It should be a function:",a);return r={handler:ae(s.default||s)},r})),t),o=se(s=>r?r.handler(s):n().then(a=>a.handler(s)));return o.__resolve__=n,o}var ir=ar,Rn=globalThis.Headers,bn=globalThis.Response;function En(e={}){let t=[],r=cr(t,e),n=ur(t);r.__resolve__=n;let o=dr(()=>hr(n,e)),s={use:(a,c,i)=>ne(s,a,c,i),resolve:n,handler:r,stack:t,options:e,get websocket(){return o()}};return s}function ne(e,t,r,n){if(Array.isArray(t))for(let o of t)ne(e,o,r,n);else if(Array.isArray(r))for(let o of r)ne(e,t,o,n);else typeof t=="string"?e.stack.push(v({...n,route:t,handler:r})):typeof t=="function"?e.stack.push(v({...r,handler:t})):e.stack.push(v({...t}));return e}function cr(e,t){let r=t.debug?2:void 0;return se(async n=>{n.node.req.originalUrl=n.node.req.originalUrl||n.node.req.url||"/";let o=n.node.req.url||"/",s=lr(n._path||o);n._path=s;let a=s!==o,c;t.onRequest&&await t.onRequest(n);for(let i of e){if(i.route.length>1){if(!s.startsWith(i.route))continue;c=s.slice(i.route.length)||"/"}else c=s;if(i.match&&!i.match(c,n))continue;n._path=c,n.node.req.url=a?i.route.length>1?o.slice(i.route.length)||"/":o:c;let u=await i.handler(n),f=u===void 0?void 0:await u;if(f!==void 0){let d={body:f};t.onBeforeResponse&&(n._onBeforeResponseCalled=!0,await t.onBeforeResponse(n,d)),await fr(n,d.body,r),t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,d));return}if(n.handled){t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0));return}}if(!n.handled)throw m({statusCode:404,statusMessage:`Cannot find any path matching ${n.path||"/"}.`});t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0))})}function ur(e){return async t=>{let r;for(let n of e){if(n.route==="/"&&!n.handler.__resolve__||!t.startsWith(n.route)||(r=t.slice(n.route.length)||"/",n.match&&!n.match(r,void 0)))continue;let o={route:n.route,handler:n.handler};if(o.handler.__resolve__){let s=await o.handler.__resolve__(r);if(!s)continue;o={...o,...s,route:Te(o.route||"/",s.route||"/")}}return o}}}function v(e){let t=e.handler;return t.handler&&(t=t.handler),e.lazy?t=ir(t):sr(t)||(t=ae(t,void 0,e.route)),{route:J(e.route),match:e.match,handler:t}}function fr(e,t,r){if(t===null)return Ge(e);if(t){if(Bt(t))return Qe(e,t);if(Je(t))return U(e,t);if(t.buffer)return w(e,t);if(t.arrayBuffer&&typeof t.arrayBuffer=="function")return t.arrayBuffer().then(o=>w(e,Buffer.from(o),t.type));if(t instanceof Error)throw m(t);if(typeof t.end=="function")return!0}let n=typeof t;if(n==="string")return w(e,t,N.html);if(n==="object"||n==="boolean"||n==="number")return w(e,JSON.stringify(t,void 0,r),N.json);if(n==="bigint")return w(e,t.toString(),N.json);throw m({statusCode:500,statusMessage:`[h3] Cannot send ${n} as response.`})}function dr(e){let t;return()=>(t||(t=e()),t)}function lr(e){let t=e.indexOf("?"),r=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return(r.includes("%25")?G(r.replace(/%25/g,"%2525")):G(r))+n}function hr(e,t){return{...t.websocket,async resolve(r){let n=r.request?.url||r.url||"/",{pathname:o}=typeof n=="string"?P(n):n;return(await e(o))?.handler?.__websocket__||{}}}}var pr=["connect","delete","get","head","options","post","put","trace","patch"];function Cn(e={}){let t=Oe({}),r={},n,o={},s=(i,u,f)=>{let d=r[i];if(d||(r[i]=d={path:i,handlers:{}},t.insert(i,d)),Array.isArray(f))for(let p of f)s(i,u,p);else d.handlers[f]=ae(u);return o};o.use=o.add=(i,u,f)=>s(i,u,f||"all");for(let i of pr)o[i]=(u,f)=>o.add(u,f,i);let a=(i="/",u="get")=>{let f=i.indexOf("?");f!==-1&&(i=i.slice(0,Math.max(0,f)));let d=t.lookup(i);if(!d||!d.handlers)return{error:m({statusCode:404,name:"Not Found",statusMessage:`Cannot find any route matching ${i||"/"}.`})};let p=d.handlers[u]||d.handlers.all;if(!p){n||(n=qe(t));let B=n.matchAll(i).reverse();for(let M of B){if(M.handlers[u]){p=M.handlers[u],d.handlers[u]=d.handlers[u]||p;break}if(M.handlers.all){p=M.handlers.all,d.handlers.all=d.handlers.all||p;break}}}return p?{matched:d,handler:p}:{error:m({statusCode:405,name:"Method Not Allowed",statusMessage:`Method ${u} is not allowed on this route.`})}},c=e.preemptive||e.preemtive;return o.handler=se(i=>{let u=a(i.path,i.method.toLowerCase());if("error"in u){if(c)throw u.error;return}i.context.matchedRoute=u.matched;let f=u.matched.params||{};return i.context.params=f,Promise.resolve(u.handler(i)).then(d=>d===void 0&&c?null:d)}),o.handler.__resolve__=async i=>{i=Q(i);let u=a(i);if("error"in u)return;let f={route:u.matched.path,handler:u.handler};if(u.handler.__resolve__){let d=await u.handler.__resolve__(i);if(!d)return;f={...f,...d}}return f},o}function Sn(e){return async function(r,n){let o=tr(r,n);try{await e.handler(o)}catch(s){let a=m(s);if(oe(s)||(a.unhandled=!0),q(o,a.statusCode,a.statusMessage),e.options.onError&&await e.options.onError(a,o),o.handled)return;(a.unhandled||a.fatal)&&console.error("[h3]",a.fatal?"[fatal]":"[unhandled]",a),e.options.onBeforeResponse&&!o._onBeforeResponseCalled&&await e.options.onBeforeResponse(o,{body:a}),await Pt(o,a,!!e.options.debug),e.options.onAfterResponse&&!o._onAfterResponseCalled&&await e.options.onAfterResponse(o,{body:a})}}}function mr(e,t){y(t),t instanceof R?(t.message=`${e}
|
|
15
|
+
${t.message}`,he(t)):(le({headline:e,body:t.message}),h(`${e}
|
|
16
|
+
${t.stack??t.message}`))}function Nn(e,t){let r={delete:`Failed to delete file "${e}" from remote theme.`,upload:`Failed to upload file "${e}" to remote theme.`,default:e}[t??"default"]??e;return n=>{mr(r,n)}}function ie(e,t){return m({status:e.status??502,statusText:e.statusText??"Bad Gateway",cause:e,data:{url:(t??e.url)?.toString(),requestId:e.headers?.get("x-request-id")??void 0}})}function qn(e,t="Unexpected error during fetch"){let r=e,n=r.statusCode??502,o=r.statusMessage??"Bad Gateway",s=`${t.replace(/\.$/,"")} with status ${n} (${o}).`;r.data?.requestId&&(s+=`
|
|
17
|
+
Request ID: ${r.data.requestId}`),r.data?.url&&(s+=`
|
|
18
|
+
URL: ${r.data.url}`);let a=r.cause??e;return{headline:s,body:a.stack??r.stack??r.message??o,status:n,statusText:o,cause:a,requestId:r.data?.requestId,url:r.data?.url}}async function Fn(e,t){let r=_r(e,t),n=await yr(e,t),o,s=Object.keys({...t.replaceTemplates,...t.replaceExtensionTemplates});if(s.length>0){h(`\u2192 Rendering ${r} (with ${s})...`);let u=_e(t);o=await fetch(r,{method:"POST",body:u,redirect:"manual",headers:{...n,...S()}}).catch(f=>{throw ie(y(f),r)})}else h(`\u2192 Rendering ${r}...`),o=await fetch(r,{method:t.method,redirect:"manual",headers:{...n,...S()}}).catch(u=>{throw ie(y(u),r)});let a=o.headers.get("x-request-id");h(`\u2190 ${o.status} (request_id: ${a})`);let i=o.headers.get("Content-Type")?.includes("application/json");return o=new Response(o.body,o),i||o.headers.delete("Content-Type"),o}async function yr(e,t){return ve(e)?gr(e,t):wr(e,t)}async function wr(e,t){let r=await Ze(e,t),n=e.storefrontToken;return W({...t.headers,Authorization:`Bearer ${n}`,Cookie:r})}async function gr(e,t){let r=await Ze(e,t),n=e.storefrontToken,o={},s=["ACCEPT","CONTENT-TYPE","CONTENT-LENGTH"];for(let[a,c]of Object.entries(t.headers))s.includes(a.toUpperCase())&&(o[a]=c);return W({...o,...Rr(e),Authorization:`Bearer ${n}`,Cookie:r})}function Ze(e,t){let r=T(t.headers.cookie??t.headers.Cookie??""),n=e.sessionCookies??{};return I({...r,...n})}function _r(e,{path:t,sectionId:r,appBlockId:n,query:o}){let a=`${ce(e)}${t}`,c=new URLSearchParams({_fd:"0",pb:"0"});for(let[i,u]of o)c.append(i,u);return r?c.append("section_id",r):n&&c.append("app_block_id",n),`${a}?${c}`}function ce(e){return ve(e)?`https://${me()}/cli/sfr`:`https://${e.storeFqdn}`}function ve(e){return e.token.startsWith("shptka_")}function Rr(e){return{"X-Shopify-Shop":e.storeFqdn,"X-Shopify-Access-Token":e.token}}l();var br=1800*1e3,et=["layout/theme.liquid","config/settings_schema.json"];async function Zn(e,t,r,n){let o=await tt(e,t,r,n);return o.refresh=async()=>{h("Refreshing theme session...");let s=await tt(e,t,r,n);return C("theme-service:session:refreshed"),Object.assign(o,s),s},setInterval(()=>{o.refresh&&o.refresh().then(()=>h("Refreshed theme session via auto-refresher...")).catch(()=>h("Session could not be refreshed."))},br),o}async function tt(e,t,r,n){let o=ce(t),s=await de(t.storeFqdn,r,[],{forceRefresh:!1,noPrompt:!0}),a=await fe([],r,{forceRefresh:!1,noPrompt:!0}),c=await Er(o,e,t,a,n);return{...s,sessionCookies:c,storefrontToken:a}}async function Er(e,t,r,n,o){try{return await Re(e,r.storeFqdn,t,o,{"X-Shopify-Shop":r.storeFqdn,"X-Shopify-Access-Token":r.token,Authorization:`Bearer ${n}`})}catch(s){throw s instanceof k&&await Cr(t,r),s}}async function Cr(e,t){if(h(`Verifying if theme with id ${e} has required files...`),(await we(Number(e),et,t)).length!==et.length)throw y(new R(ye`Theme ${F.cyan(e)} is missing required files. Run ${F.cyan(`shopify theme delete -t ${e}`)} to delete it, then try your command again.`.value));h(`Theme with id ${e} has required files.`)}export{S as a,W as b,$r as c,jr as d,m as e,Pt as f,un as g,fn as h,Fe as i,_ as j,dn as k,ln as l,hn as m,pn as n,w as o,q as p,mn as q,A as r,yn as s,wn as t,gn as u,_n as v,nr as w,ar as x,En as y,Cn as z,Sn as A,mr as B,Nn as C,ie as D,qn as E,Fn as F,yr as G,Ze as H,ce as I,Zn as J,tt as K};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{k as S,q as E}from"./chunk-HHXHOQQP.js";import{$ as re,aa as G}from"./chunk-IWCPQD7X.js";import{r as C}from"./chunk-WUK5NQSX.js";import{b as $}from"./chunk-4KRT35A2.js";import{u as w,v as N}from"./chunk-MGL4YM3S.js";import{r as oe}from"./chunk-3YWUSKWF.js";import{$a as A,Lb as l,Mb as P,N as x,Nb as T,Pb as L,Ta as b,na as R,ua as _}from"./chunk-VPL2NDH6.js";import{d as F,p as I}from"./chunk-IU2ZQ6TE.js";import{e as O,g as k}from"./chunk-VPRTJUIN.js";k();k();var i=O(G(),1),y=O(re(),1);function ie(t){switch(t){case"error":return i.Severity.ERROR;case"suggestion":case"warning":return i.Severity.WARNING;case"style":case"info":return i.Severity.INFO;case"crash":return}}function j(t){switch(t){case i.Severity.ERROR:return"error";case i.Severity.WARNING:return"warning";case i.Severity.INFO:return"info"}}function se(t,e,n){let o=i.path.fsPath(t),c=R(o).toString().split(`
|
|
2
|
+
`).slice(e,n+1),a=c.length===1;return c.map((u,h)=>{let f=e+h+1,d=a?u.trim():u;return`${f} ${d}`}).join(`
|
|
3
|
+
`)}function ce(t){switch(t){case i.Severity.ERROR:return{error:`
|
|
4
|
+
[error]:`};case i.Severity.WARNING:return{warn:`
|
|
5
|
+
[warning]:`};case i.Severity.INFO:return{info:`
|
|
6
|
+
[info]:`}}}function ae(t){return t.map((n,o)=>{let{message:r,uri:s,start:c,end:a,check:u,severity:h}=n,f=se(s,c.line,a.line),d=o===t.length-1?"":`
|
|
7
|
+
|
|
8
|
+
`;return[ce(h),{bold:u},{subdued:`
|
|
9
|
+
${r}`},`
|
|
10
|
+
|
|
11
|
+
${f}`,d]}).flat()}var ue=(t,e)=>t.severity-e.severity;function Y(t){let e=t.reduce((n,o)=>{let{uri:r}=o,s=i.path.fsPath(r);return n[s]??(n[s]=[]),n[s].push(o),n},{});return Object.keys(e).reduce((n,o)=>(n[o]=e[o].sort(ue),n),{})}function U(t){return t.reduce((e,n)=>(!Object.prototype.hasOwnProperty.call(e,n.severity)&&(e[n.severity]=0),e[n.severity]++,e),{})}function W(t,e,n){let o=[`${n.length} files inspected`];if(t.length===0)o.push("with no offenses found.");else{o.push(`with ${t.length} total offenses found across ${Object.keys(e).length} files.`);let r=U(t);r[i.Severity.ERROR]&&o.push(`
|
|
12
|
+
${r[i.Severity.ERROR]} errors.`),r[i.Severity.WARNING]&&o.push(`
|
|
13
|
+
${r[i.Severity.WARNING]} warnings.`),r[i.Severity.INFO]&&o.push(`
|
|
14
|
+
${r[i.Severity.INFO]} info issues.`)}return o}function q(t,e,n){Object.keys(t).sort().forEach(r=>{let s=r.replace(e,"").slice(1);w({headline:n?`[${n}] ${s}`:s,body:ae(t[r])})})}function H(t,e){return Object.entries(t).map(([n,o])=>{let r=o.map(c=>({check:c.check,severity:j(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=U(o);return{environment:e,path:n,offenses:r,errorCount:s[i.Severity.ERROR]??0,warningCount:s[i.Severity.WARNING]??0,infoCount:s[i.Severity.INFO]??0}})}function B(t,e){e||process.exit(0);let n=ie(e),o=n!==void 0&&t.some(r=>r.severity<=n);process.exit(o?1:0)}function fe(t){return t.split(`
|
|
15
|
+
`).map(e=>`# ${e}`).join(`
|
|
16
|
+
`)}async function D(t){let e=".theme-check.yml",n=F(t,e);if(await b(n)){P(`${e} already exists at ${t}`);return}let{settings:o}=await(0,i.loadConfig)(void 0,t),r=fe(y.default.stringify(o)),s=y.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await _(n,`${s}${r}`),T(`Created ${e} at ${t}`)}var de=async(t,e)=>{let n=(0,i.applyFixToString)(t.source,e),o=i.path.fsPath(t.uri);await _(o,n)};async function M(t,e){await(0,i.autofix)(t,e,de)}async function J(t,e,n){let{ignore:o,settings:r,rootUri:s}=await(0,i.loadConfig)(e,t),c={extends:[],ignore:x(o??[]),rootUri:s,...r},a=n?{[n]:c}:c;l(y.default.stringify(a))}async function V(t,e,n){let{settings:o,ignore:r,checks:s}=await(0,i.loadConfig)(e,t),c=x(r??[]),u=Object.keys(o).reduce((f,d)=>{let{severity:Q,enabled:X,...Z}=o[d];if(!X)return f;let ee=j(Q??i.Severity.INFO),v=s.find(ne=>ne.meta.code===d),te=v&&v.meta?{description:v.meta.docs.description,doc:v.meta.docs.url}:{};return f[d]={severity:ee,...te,ignored_patterns:`[${c.join(", ")}]`,...Z},f},{}),h=n?{[n]:u}:u;l(y.default.stringify(h))}function z(t){return"_handle"in t&&typeof t._handle=="object"&&t._handle!==null&&typeof t._handle.setBlocking=="function"}var m=O(oe(),1);var g=O(G(),1);var K,p=class extends E{async command(e,n,o){let r=e.path,s=e.environment?.[0],a=e.config?.startsWith(":")&&g.LegacyIdentifiers.has(e.config.slice(1))?g.LegacyIdentifiers.get(e.config.slice(1)):e.config;if(e.init){await D(r);return}if(e.version){let f=await A(F("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:I(import.meta.url)}),d="unknown";f&&(d=await C(f)??"unknown"),l(d);return}if(e.print){await J(r,a,s);return}if(e.list){await V(r,a,s);return}let{offenses:u,theme:h}=await me(r,e.output,a,s);if(e["auto-correct"]&&await M(h,u),!o)return B(u,e["fail-level"])}};K=p;p.summary="Validate the theme.";p.descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";p.description=K.descriptionWithoutMarkdown();p.flags={...$,path:S.path,"auto-correct":m.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:m.Flags.string({char:"C",required:!1,description:`Use the config provided, overriding .theme-check.yml if present
|
|
17
|
+
Supports all theme-check: config values, e.g., theme-check:theme-app-extension,
|
|
18
|
+
theme-check:recommended, theme-check:all
|
|
19
|
+
For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":m.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:m.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:m.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:m.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:m.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:m.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:S.environment};p.multiEnvironmentsFlags=["path"];var Ae=p;async function me(t,e,n,o){let{offenses:r,theme:s}=await(0,g.themeCheckRun)(t,n,a=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&L(a)}),c=Y(r);if(e==="text"&&(q(c,t,o),(r.length?w:N)({headline:o?`[${o}] Theme Check Summary.`:"Theme Check Summary.",body:W(r,c,s)})),e==="json"){let a=process.stdout;z(a)&&a._handle.setBlocking(!0),l(JSON.stringify(H(c,o)))}return{offenses:r,theme:s}}export{Ae as a,me as b};
|