@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,4 @@
|
|
|
1
|
+
import{a as s}from"./chunk-T5MK7ZSF.js";import{a as r}from"./chunk-DCK2FX6J.js";import{Ca as n,Fa as p}from"./chunk-WCWNI3ZV.js";import{b as e}from"./chunk-4KRT35A2.js";import{r as g}from"./chunk-3YWUSKWF.js";import{e as m,g as a}from"./chunk-VPRTJUIN.js";a();var c=m(g(),1);var t,o=class extends s{async run(){let{flags:i}=await this.parse(t),f={directory:i.path,apiKey:i["client-id"],organizationId:i["organization-id"],configName:i.config},d=await n(f),{app:l}=await p({directory:i.path,clientId:void 0,forceRelink:!1,userProvidedConfigName:d.configFileName});return{app:l}}};t=o;o.summary="Fetch your app configuration from the Developer Dashboard.";o.descriptionWithMarkdown=`Pulls app configuration from the Developer Dashboard and creates or overwrites a configuration file. You can create a new app with this command to start with a default configuration file.
|
|
2
|
+
|
|
3
|
+
For more information on the format of the created TOML configuration file, refer to the [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration) page.
|
|
4
|
+
`;o.description=t.descriptionWithoutMarkdown();o.flags={...e,...r,"organization-id":c.Flags.string({hidden:!0,env:"SHOPIFY_FLAG_ORGANIZATION_ID",exclusive:["client-id"]})};var A=o;export{A as a};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{Ta as j,ma as w,ua as R}from"./chunk-
|
|
2
|
-
`,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],h=tomlType(r);if(i!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${h}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var L=f((St,ce)=>{"use strict";o();ce.exports=$e;function $e(e,t){if(e.pos==null||e.line==null)return e;let s=e.message;if(s+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
|
|
1
|
+
import{d as k}from"./chunk-BHWEA4V2.js";import{Ta as j,ma as w,ua as R}from"./chunk-VPL2NDH6.js";import{a as H,c as f,e as G,g as o}from"./chunk-VPRTJUIN.js";var ee=f((Tt,X)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;X.exports=A});var re=f((Rt,te)=>{"use strict";o();te.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((xt,se)=>{"use strict";o();se.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ne=f((Ht,ie)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};ie.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var oe=f((yt,ae)=>{"use strict";o();var he=y(),$e=global.Date,v=class extends $e{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${he(2,this.getUTCMonth()+1)}-${he(2,this.getUTCDate())}`}};ae.exports=e=>{let t=new v(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ce=f((It,le)=>{"use strict";o();var N=y(),W=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};le.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(ee());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=re(),createDateTimeFloat=ne(),createDate=oe(),createTime=ce(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
|
|
2
|
+
`,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],h=tomlType(r);if(i!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${h}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var L=f((Ot,ue)=>{"use strict";o();ue.exports=Ke;function Ke(e,t){if(e.pos==null||e.line==null)return e;let s=e.message;if(s+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
|
|
3
3
|
`,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,h=" ";for(;h.length<i;)h+=" ";for(let n=Math.max(0,e.line-1);n<Math.min(r.length,e.line+2);++n){let a=String(n+1);if(a.length<i&&(a=" "+a),e.line===n){s+=a+"> "+r[n]+`
|
|
4
4
|
`,s+=h+" ";for(let l=0;l<e.col;++l)s+=" ";s+=`^
|
|
5
5
|
`}else s+=a+": "+r[n]+`
|
|
6
6
|
`}}return e.message=s+`
|
|
7
|
-
`,e}});var
|
|
8
|
-
`)}function
|
|
7
|
+
`,e}});var pe=f((Mt,fe)=>{"use strict";o();fe.exports=qe;var ve=I(),We=L();function qe(e){global.Buffer&&global.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new ve;try{return t.parse(e),t.finish()}catch(s){throw We(s,e)}}});var me=f((Pt,de)=>{"use strict";o();de.exports=Je;var Qe=I(),_e=L();function Je(e,t){t||(t={});let s=0,r=t.blocksize||40960,i=new Qe;return new Promise((n,a)=>{setImmediate(h,s,r,n,a)});function h(n,a,l,d){if(n>=e.length)try{return l(i.finish())}catch(_){return d(_e(_,e))}try{i.parse(e.slice(n,n+a)),setImmediate(h,n+a,a,l,d)}catch(_){d(_e(_,e))}}}});var Te=f((Ft,Ce)=>{"use strict";o();Ce.exports=Ze;var Ve=H("stream"),ge=I();function Ze(e){return e?Ye(e):ze(e)}function Ye(e){let t=new ge;return e.setEncoding("utf8"),new Promise((s,r)=>{let i,h=!1,n=!1;function a(){if(h=!0,!i)try{s(t.finish())}catch(_){r(_)}}function l(_){n=!0,r(_)}e.once("end",a),e.once("error",l),d();function d(){i=!0;let _;for(;(_=e.read())!==null;)try{t.parse(_)}catch(Fe){return l(Fe)}if(i=!1,h)return a();n||e.once("readable",d)}})}function ze(){let e=new ge;return new Ve.Transform({objectMode:!0,transform(t,s,r){try{e.parse(t.toString(s))}catch(i){this.emit("error",i)}r()},flush(t){try{this.push(e.finish())}catch(s){this.emit("error",s)}t()}})}});var we=f((Kt,x)=>{"use strict";o();x.exports=pe();x.exports.async=me();x.exports.stream=Te();x.exports.prettyError=L()});var Ne=f((Wt,J)=>{"use strict";o();J.exports=Ge;J.exports.value=Q;function Ge(e){if(e===null)throw g("null");if(e===void 0)throw g("undefined");if(typeof e!="object")throw g(typeof e);if(typeof e.toJSON=="function"&&(e=e.toJSON()),e==null)return null;let t=p(e);if(t!=="table")throw g(t);return q("","",e)}function g(e){return new Error("Can only stringify objects, not "+e)}function je(){return new Error("Array values can't have mixed types")}function Re(e){return Object.keys(e).filter(t=>Ae(e[t]))}function ke(e){return Object.keys(e).filter(t=>!Ae(e[t]))}function S(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let s of Object.keys(e))e[s]&&typeof e[s].toJSON=="function"&&!("toISOString"in e[s])?t[s]=e[s].toJSON():t[s]=e[s];return t}function q(e,t,s){s=S(s);var r,i;r=Re(s),i=ke(s);var h=[],n=t||"";r.forEach(l=>{var d=p(s[l]);d!=="undefined"&&d!=="null"&&h.push(n+O(l)+" = "+He(s[l],!0))}),h.length>0&&h.push("");var a=e&&r.length>0?t+" ":"";return i.forEach(l=>{h.push(lt(e,a,l,s[l]))}),h.join(`
|
|
8
|
+
`)}function Ae(e){switch(p(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return e.length===0||p(e[0])!=="table";case"table":return Object.keys(e).length===0;default:return!1}}function p(e){return e===void 0?"undefined":e===null?"null":typeof e=="bigint"||Number.isInteger(e)&&!Object.is(e,-0)?"integer":typeof e=="number"?"float":typeof e=="boolean"?"boolean":typeof e=="string"?"string":"toISOString"in e?isNaN(e)?"undefined":"datetime":Array.isArray(e)?"array":"table"}function O(e){var t=String(e);return/^[-A-Za-z0-9_]+$/.test(t)?t:xe(t)}function xe(e){return'"'+be(e).replace(/"/g,'\\"')+'"'}function Xe(e){return"'"+e+"'"}function et(e,t){for(;t.length<e;)t="0"+t;return t}function be(e){return e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,t=>"\\u"+et(4,t.codePointAt(0).toString(16)))}function tt(e){let t=e.split(/\n/).map(s=>be(s).replace(/"(?="")/g,'\\"')).join(`
|
|
9
9
|
`);return t.slice(-1)==='"'&&(t+=`\\
|
|
10
10
|
`),`"""
|
|
11
|
-
`+t+'"""'}function
|
|
11
|
+
`+t+'"""'}function He(e,t){let s=p(e);return s==="string"&&(t&&/\n/.test(e)?s="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(s="string-literal")),Q(e,s)}function Q(e,t){switch(t||(t=p(e)),t){case"string-multiline":return tt(e);case"string":return xe(e);case"string-literal":return Xe(e);case"integer":return Ee(e);case"float":return rt(e);case"boolean":return st(e);case"datetime":return it(e);case"array":return at(e.filter(s=>p(s)!=="null"&&p(s)!=="undefined"&&p(s)!=="nan"));case"table":return ot(e);default:throw g(t)}}function Ee(e){return String(e).replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function rt(e){if(e===1/0)return"inf";if(e===-1/0)return"-inf";if(Object.is(e,NaN))return"nan";if(Object.is(e,-0))return"-0.0";var t=String(e).split("."),s=t[0],r=t[1]||0;return Ee(s)+"."+r}function st(e){return String(e)}function it(e){return e.toISOString()}function nt(e){return e==="float"||e==="integer"}function ht(e){var t=p(e[0]);return e.every(s=>p(s)===t)?t:e.every(s=>nt(p(s)))?"float":"mixed"}function ye(e){let t=ht(e);if(t==="mixed")throw je();return t}function at(e){e=S(e);let t=ye(e);var s="[",r=e.map(i=>Q(i,t));return r.join(", ").length>60||/\n/.test(r)?s+=`
|
|
12
12
|
`+r.join(`,
|
|
13
13
|
`)+`
|
|
14
|
-
`:s+=" "+r.join(", ")+(r.length>0?" ":""),s+"]"}function
|
|
14
|
+
`:s+=" "+r.join(", ")+(r.length>0?" ":""),s+"]"}function ot(e){e=S(e);var t=[];return Object.keys(e).forEach(s=>{t.push(O(s)+" = "+He(e[s],!1))}),"{ "+t.join(", ")+(t.length>0?" ":"")+"}"}function lt(e,t,s,r){var i=p(r);if(i==="array")return ct(e,t,s,r);if(i==="table")return ut(e,t,s,r);throw g(i)}function ct(e,t,s,r){r=S(r),ye(r);var i=p(r[0]);if(i!=="table")throw g(i);var h=e+O(s),n="";return r.forEach(a=>{n.length>0&&(n+=`
|
|
15
15
|
`),n+=t+"[["+h+`]]
|
|
16
|
-
`,n+=q(h+".",t,a)}),n}function
|
|
17
|
-
`),h+q(i+".",t,r)}});var
|
|
18
|
-
`);return D.parse(t)}function
|
|
19
|
-
`)[0]??"Invalid TOML";throw new $(this.path,`${r} at row ${s.line}, col ${s.col}`)}throw s}}};function
|
|
16
|
+
`,n+=q(h+".",t,a)}),n}function ut(e,t,s,r){var i=e+O(s),h="";return Re(r).length>0&&(h+=t+"["+i+`]
|
|
17
|
+
`),h+q(i+".",t,r)}});var Ie=f(V=>{"use strict";o();V.parse=we();V.stringify=Ne()});var Ue=f((Yt,u)=>{o();var Oe={};Oe.__wbindgen_placeholder__=u.exports;var c,{TextEncoder:ft,TextDecoder:pt}=H("util");function Z(e){return e==null}var T=null;function B(){return(T===null||T.buffer.detached===!0||T.buffer.detached===void 0&&T.buffer!==c.memory.buffer)&&(T=new DataView(c.memory.buffer)),T}var b=0,M=null;function U(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(c.memory.buffer)),M}var P=new ft("utf-8"),_t=typeof P.encodeInto=="function"?function(e,t){return P.encodeInto(e,t)}:function(e,t){let s=P.encode(e);return t.set(s),{read:e.length,written:s.length}};function Y(e,t,s){if(s===void 0){let a=P.encode(e),l=t(a.length,1)>>>0;return U().subarray(l,l+a.length).set(a),b=a.length,l}let r=e.length,i=t(r,1)>>>0,h=U(),n=0;for(;n<r;n++){let a=e.charCodeAt(n);if(a>127)break;h[i+n]=a}if(n!==r){n!==0&&(e=e.slice(n)),i=s(i,r,r=n+e.length*3,1)>>>0;let a=U().subarray(i+n,i+r),l=_t(e,a);n+=l.written,i=s(i,r,n,1)>>>0}return b=n,i}var De=new pt("utf-8",{ignoreBOM:!0,fatal:!0});De.decode();function F(e,t){return e=e>>>0,De.decode(U().subarray(e,e+t))}function Me(e){let t=c.__wbindgen_export_0.get(e);return c.__externref_table_dealloc(e),t}u.exports.echoToml=function(e){let t,s;try{let h=Y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),n=b,a=c.echoToml(h,n);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,Me(a[2]);return t=r,s=i,F(r,i)}finally{c.__wbindgen_free(t,s,1)}};u.exports.updateTomlValues=function(e,t){let s,r;try{let n=Y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=b,l=c.updateTomlValues(n,a,t);var i=l[0],h=l[1];if(l[3])throw i=0,h=0,Me(l[2]);return s=i,r=h,F(i,h)}finally{c.__wbindgen_free(s,r,1)}};u.exports.__wbg_from_2a5d3e218e67aa85=function(e){return Array.from(e)};u.exports.__wbg_get_b9b93047fe3cf45b=function(e,t){return e[t>>>0]};u.exports.__wbg_length_e2d2a49132c1b256=function(e){return e.length};u.exports.__wbindgen_boolean_get=function(e){let t=e;return typeof t=="boolean"?t?1:0:2};u.exports.__wbindgen_init_externref_table=function(){let e=c.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)};u.exports.__wbindgen_is_array=function(e){return Array.isArray(e)};u.exports.__wbindgen_is_undefined=function(e){return e===void 0};u.exports.__wbindgen_number_get=function(e,t){let s=t,r=typeof s=="number"?s:void 0;B().setFloat64(e+8,Z(r)?0:r,!0),B().setInt32(e+0,!Z(r),!0)};u.exports.__wbindgen_string_get=function(e,t){let s=t,r=typeof s=="string"?s:void 0;var i=Z(r)?0:Y(r,c.__wbindgen_malloc,c.__wbindgen_realloc),h=b;B().setInt32(e+4,h,!0),B().setInt32(e+0,i,!0)};u.exports.__wbindgen_string_new=function(e,t){return F(e,t)};u.exports.__wbindgen_throw=function(e,t){throw new Error(F(e,t))};var dt=H("path").join(__dirname,"toml_patch_bg.wasm"),mt=H("fs").readFileSync(dt),gt=new WebAssembly.Module(mt),Ct=new WebAssembly.Instance(gt,Oe);c=Ct.exports;u.exports.__wasm=c;c.__wbindgen_start()});o();o();var D=G(Ie(),1);function Le(e){let t=e.replace(/\r\n$/g,`
|
|
18
|
+
`);return D.parse(t)}function Se(e){return D.stringify(e)}var z=G(Ue()),$=class extends k{constructor(t,s){super(s),this.name="TomlFileError",this.path=t}},Pe=class e{static async read(t){if(!await j(t))throw new $(t,`TOML file not found: ${t}`);let s=await w(t),r=new e(t,{});return r.content=r.decode(s),r}constructor(t,s){this.errors=[],this.path=t,this.content=s}async patch(t){let s=Be(t),r=await w(this.path),i=(0,z.updateTomlValues)(r,s),h=this.decode(i);await R(this.path,i),this.content=h}async remove(t){let s=t.split("."),r=await w(this.path),i=(0,z.updateTomlValues)(r,[[s,void 0]]),h=this.decode(i);await R(this.path,i),this.content=h}async replace(t){let s=Se(t);this.decode(s),await R(this.path,s),this.content=t}async transformRaw(t){let s=await w(this.path),r=t(s),i=this.decode(r);await R(this.path,r),this.content=i}decode(t){try{return Le(t)}catch(s){if(s.line!==void 0&&s.col!==void 0){let r=String(s.message).split(`
|
|
19
|
+
`)[0]??"Invalid TOML";throw new $(this.path,`${r} at row ${s.line}, col ${s.col}`)}throw s}}};function Be(e,t=[]){let s=[];for(let[r,i]of Object.entries(e)){let h=[...t,r];i!==null&&typeof i=="object"&&!Array.isArray(i)?s.push(...Be(i,h)):s.push([h,i])}return s}export{Ue as a,$ as b,Pe as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-FP2NOZSD.js";import{g as t}from"./chunk-VPRTJUIN.js";t();var e=async()=>a.getAllSensitiveMetadata(),i=e;export{i as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as te,b as ne}from"./chunk-WNGV4JQS.js";import{b as T}from"./chunk-RL5BWZ7D.js";import{c as Y}from"./chunk-VYXVYOIJ.js";import{a as ee}from"./chunk-T5MK7ZSF.js";import{a as W}from"./chunk-DCK2FX6J.js";import{F as B,Fa as Z,H as K,S as Q,d as X,e as z}from"./chunk-WCWNI3ZV.js";import{e as H,g as J}from"./chunk-VICNWPLQ.js";import{a as E}from"./chunk-FP2NOZSD.js";import{C as R,p as F,x as L,y as P}from"./chunk-WUK5NQSX.js";import{b as V}from"./chunk-4KRT35A2.js";import{d as v}from"./chunk-JUVAGMIH.js";import{B as G,D as k,F as U,v as N,z as D}from"./chunk-MGL4YM3S.js";import{d as y}from"./chunk-BHWEA4V2.js";import{r as me}from"./chunk-3YWUSKWF.js";import{Gb as q,Oa as I,Ta as M,Ua as C,Wa as j,Y as f,ka as g,wa as A,ya as w}from"./chunk-VPL2NDH6.js";import{e as $}from"./chunk-UARVYVLN.js";import{d as u,n as S}from"./chunk-IU2ZQ6TE.js";import{e as fe,g as p}from"./chunk-VPRTJUIN.js";p();p();p();async function ae(e,t,r){let{templates:a,groupOrder:n}=await e.templateSpecifications(t);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:n}}p();function _(e){switch(e){case"vanilla-js":case"preact":case"react":case"typescript":case"typescript-react":return"javascript";case"rust":case"wasm":return e;case void 0:case"liquid":case"config-only":return}}async function re(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,a=e.extensionTemplate.supportedFlavors.find(s=>s.value===r),n=await ne({app:e.app,name:t}),i=e.cloneUrl??e.extensionTemplate.url,o={directory:n,url:i,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:a,onGetTemplateRepository:e.onGetTemplateRepository??(async(s,c)=>{await Y({repoUrl:s,destination:c,shallow:!0})})};return await ye(o),{directory:S(n),extensionTemplate:e.extensionTemplate}}async function ye(e){try{switch(e.type){case"theme":await he(e);break;case"function":await xe(e);break;default:await ge(e);break}let t=u(e.directory,H.lockFile);await w(t)}catch(t){throw await w(e.directory),t}}async function he({directory:e,url:t,type:r,name:a,extensionFlavor:n,onGetTemplateRepository:i}){return g(async o=>{let s=await b(t,n,o,i);await T(s,e,{name:a,type:r,uid:v(f(a))})})}async function xe({directory:e,url:t,app:r,project:a,name:n,extensionFlavor:i,onGetTemplateRepository:o}){let s=_(i?.value),c=[];c.push({title:"Generating function extension",task:async()=>{if(await g(async l=>{let d=await b(t,i,l,o);await T(d,e,{name:n,handle:f(n),flavor:i?.value,uid:v(f(n))})}),s==="javascript"){let l=ie(i?.value??"rust");await oe(e,l,"!(*.graphql)")}}}),s==="javascript"&&c.push({title:"Installing additional dependencies",task:async()=>{a.usesWorkspaces&&await F({packageManager:a.packageManager,directory:a.directory});let l=we(s);await P(l,{packageManager:a.packageManager,type:"prod",directory:a.usesWorkspaces?e:a.directory})}}),s==="javascript"&&c.push({title:"Building GraphQL types",task:async()=>{await z({directory:e,isJavaScript:!0},{stdout:process.stdout,stderr:process.stderr,app:r})}}),await k(c)}async function ge({directory:e,url:t,app:r,project:a,name:n,extensionFlavor:i,onGetTemplateRepository:o}){let s=_(i?.value),c=[{title:"Generating extension",task:async()=>{let l=ie(i?.value??"vanilla-js");await g(async d=>{let h=await b(t,i,d,o);await T(h,e,{srcFileExtension:l,name:n,handle:f(n),flavor:i?.value??"",uid:v(f(n))})}),s==="javascript"&&await oe(e,l)}},{title:"Installing dependencies",task:async()=>{let l=a.packageManager;if(a.usesWorkspaces)_(i?.value)==="javascript"&&await F({packageManager:l,directory:a.directory});else{await ve(a.directory,i?.value);let d=u(e,"package.json"),h=await Ee(d);await P(h,{packageManager:l,type:"prod",directory:a.directory}),await w(d)}}}];c.push({title:"Update shared type definition",task:async()=>{await K(r)}}),await k(c)}function ie(e){return{"vanilla-js":"js",preact:"jsx",react:"jsx",typescript:"ts","typescript-react":"tsx",rust:"rs",wasm:"wasm",liquid:"liquid","config-only":""}[e]??"js"}function we(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${X}.0.0`}),t}async function oe(e,t,r="*"){let a=await j(u(e,"src",r)),n=[];for(let i of a)n.push(I(i,`${i}.${t}`));await Promise.all(n)}async function ve(e,t){t==="typescript-react"&&await R(e,{"@types/react":J.reactTypes})}async function Ee(e){if(!await M(e))return[];let t=await L(e);return Object.entries(t?.dependencies??{}).map(([r,a])=>({name:r,version:a}))}async function b(e,t,r,a){let n=u(r,"download");return await A(n),await a(e,n),te(t,n)}p();function Te(e,t=[]){let r=[...e.map(n=>({label:n.name,value:n.identifier,group:n.group||"Other",sortPriority:n.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(n=>({label:`${n.name} (limit reached)`,value:n.identifier,group:n.group||"Other",disabled:!0,sortPriority:n.sortPriority??Number.MAX_SAFE_INTEGER}))],a=(n,i)=>n.sortPriority===i.sortPriority?n.label.localeCompare(i.label):n.sortPriority-i.sortPriority;return r.sort(a)}var Fe=async e=>{let t=e.extensionTemplates,r=e.templateType,a=e.extensionFlavor;if(!r){if(a&&(t=t.filter(c=>c.supportedFlavors.map(l=>l.value).includes(a))),t.length===0)throw new y("You have reached the limit for the number of extensions you can create.");r=await G({message:"Type of extension?",choices:Te(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let n=t.find(c=>c.identifier===r),i=e.name||await se(e.directory,n.defaultName),o=e.extensionFlavor??await Pe(n);return{extensionTemplate:n,extensionContent:{name:i,flavor:o}}};async function se(e,t,r=1){let a=t.includes(" ")?" ":"-",n=r<=1?t:`${t}${a}${r}`,i=u(e,f(n));return C(i)?se(e,t,r+1):U({message:"Name your extension:",defaultValue:n})}async function Pe(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:D({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var ce=Fe;async function ke(e){let{app:t,developerPlatformClient:r,remoteApp:a,specifications:n,template:i}=e,o=n.map(ue=>ue.identifier),{templates:s,groupOrder:c}=await ae(r,a,o),l=await _e(s,c,n,t,e),d=await ce(l);await Oe(d,i);let h=Se(d,t,e,r),de=await re(h);Ae(de,e.project.packageManager)}async function _e(e,t,r,a,n){let i=await Ce(n.template,a,e,r);Ie(i,n.flavor);let{validTemplates:o,templatesOverlimit:s}=be(e,r,a);return{templateType:i?.identifier,name:n.name,extensionFlavor:n.flavor,directory:u(n.directory,"extensions"),app:a,extensionTemplates:o??[],unavailableExtensions:s??[],reset:n.reset,groupOrder:t}}function be(e,t,r){return Q(e,n=>!le(r,t,n)?"validTemplates":"templatesOverlimit")}function le(e,t,r){let a=r.type,n=t.find(o=>o.identifier===a||o.externalIdentifier===a);return e.extensionsForType({identifier:a,externalIdentifier:a}).length>=(n?.registrationLimit??1)}async function Oe(e,t){let{extensionContent:r}=e;return E.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Se(e,t,r,a){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:a}}function Ae(e,t){let r=Me(e.extensionTemplate,e.directory,t);N(r)}function Ie(e,t){if(!t||!e)return;let r=e.supportedFlavors.map(a=>a.value);if(!r.includes(t))throw new y("Invalid template for extension type",`Expected template to be one of the following: ${r.join(", ")}.`)}function Me(e,t,r){let a={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&a.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:q(r,"shopify app dev")}]),e.supportLinks[0]&&a.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),a}async function Ce(e,t,r,a){if(!e)return;let n=r.find(i=>i.identifier===e);if(!n){let i=await $(),o=r.map(c=>c.identifier),s=i?"You might need to enable some flags on your Organization or App":void 0;throw new y(`Unknown extension type: ${e}.
|
|
2
|
+
The following extension types are supported: ${o.join(", ")}`,s)}if(le(t,a,n))throw new y(`Invalid extension type: ${e}`,`You have reached the limit of extension(s) of type ${n.type} per app`);return n}var pe=ke;var x=fe(me(),1);var O,m=class extends ee{async run(){let{flags:t}=await this.parse(O);await E.addPublicMetadata(()=>({cmd_scaffold_required_auth:!0,cmd_scaffold_template_custom:t["clone-url"]!==void 0,cmd_scaffold_type_owner:"@shopify/app"})),await B(t.path);let{app:r,project:a,specifications:n,remoteApp:i,developerPlatformClient:o}=await Z({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return await pe({directory:t.path,reset:t.reset,name:t.name,cloneUrl:t["clone-url"],template:t.template,flavor:t.flavor,app:r,project:a,specifications:n,remoteApp:i,developerPlatformClient:o}),{app:r}}};O=m;m.summary="Generate a new app Extension.";m.descriptionWithMarkdown=`Generates a new [app extension](https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).
|
|
3
|
+
|
|
4
|
+
Each new app extension is created in a folder under \`extensions/\`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.
|
|
5
|
+
`;m.description=O.descriptionWithoutMarkdown();m.flags={...V,...W,template:x.Flags.string({char:"t",hidden:!1,description:"Extension template",env:"SHOPIFY_FLAG_EXTENSION_TEMPLATE"}),name:x.Flags.string({char:"n",hidden:!1,description:"name of your Extension",env:"SHOPIFY_FLAG_NAME"}),"clone-url":x.Flags.string({hidden:!0,char:"u",description:"The Git URL to clone the function extensions templates from. Defaults to: https://github.com/Shopify/function-examples",env:"SHOPIFY_FLAG_CLONE_URL"}),flavor:x.Flags.string({hidden:!1,description:"Choose a starting template for your extension, where applicable",options:["vanilla-js","react","typescript","typescript-react","wasm","rust"],env:"SHOPIFY_FLAG_FLAVOR"})};var Tt=m;export{Tt as a};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{b as S,c as A,d as R}from"./chunk-CE6FKJFS.js";import{a as N}from"./chunk-UOQ75BL3.js";import{a as P}from"./chunk-DCK2FX6J.js";import{Ga as T,b as y,c as x}from"./chunk-WCWNI3ZV.js";import{b,c as g}from"./chunk-4KRT35A2.js";import{u as h}from"./chunk-MGL4YM3S.js";import{Fb as l,Hb as m,Lb as d}from"./chunk-VPL2NDH6.js";import{d as f}from"./chunk-IU2ZQ6TE.js";import{g as p}from"./chunk-VPRTJUIN.js";p();p();function C(n,t){let o={};return n.targeting?.forEach(e=>{e.target&&(o[e.target]={...e.input_query&&{inputQueryPath:`${t}/${e.input_query}`},...e.export&&{export:e.export}})}),o}function I(n,t,o,e,i,r){return JSON.stringify({handle:t.handle,name:n.name,apiVersion:t.api_version,targeting:o,schemaPath:r,wasmPath:i,functionRunnerPath:e},null,2)}function j(n,t){return{title:`CONFIGURATION
|
|
2
|
+
`,body:{tabularData:[["Handle",n.handle??"N/A"],["Name",t??"N/A"],["API Version",n.api_version??"N/A"]],firstColumnSubdued:!0}}}function O(n){if(Object.keys(n).length===0)return null;let t=[];return Object.entries(n).forEach(([o,e])=>{t.push([m`${l.cyan(o)}`.value,""]),e.inputQueryPath&&t.push([{subdued:" Input Query Path"},{filePath:e.inputQueryPath}]),e.export&&t.push([{subdued:" Export"},e.export])}),{title:`
|
|
3
|
+
TARGETING
|
|
4
|
+
`,body:{tabularData:t}}}function v(n,t){return{title:`
|
|
5
|
+
BUILD
|
|
6
|
+
`,body:{tabularData:[["Schema Path",{filePath:t??"N/A"}],["Wasm Path",{filePath:n}]],firstColumnSubdued:!0}}}function D(n){return{title:`
|
|
7
|
+
FUNCTION RUNNER
|
|
8
|
+
`,body:{tabularData:[["Path",{filePath:n}]],firstColumnSubdued:!0}}}function k(n,t,o,e,i,r){let a=[j(t,n.name)],s=O(o);return s&&a.push(s),a.push(v(i,r),D(e)),a}function w(n,t){let{format:o,functionRunnerPath:e,schemaPath:i}=t,r=n.configuration,a=C(r,n.directory),s=f(n.directory,r.build?.path??n.outputRelativePath);return o==="json"?I(n,r,a,e,s,i):k(n,r,a,e,s,i)}var c,u=class extends N{async run(){let{flags:t}=await this.parse(c),{app:o}=await T({directory:t.path,userProvidedConfigName:t.config}),e=await A(o,t.path),i=y();await x(i);let r=await R(e,t.path,t["client-id"],t.reset,t.config),a=w(e,{format:t.json?"json":"text",functionRunnerPath:i.path,schemaPath:r});return t.json?d(a):h({customSections:a}),{app:o}}};c=u;u.summary="Print basic information about your function.";u.descriptionWithMarkdown=`The information returned includes the following:
|
|
9
|
+
|
|
10
|
+
- The function handle
|
|
11
|
+
- The function name
|
|
12
|
+
- The function API version
|
|
13
|
+
- The targeting configuration
|
|
14
|
+
- The schema path
|
|
15
|
+
- The WASM path
|
|
16
|
+
- The function runner path`;u.description=c.descriptionWithoutMarkdown();u.flags={...b,...P,...S,...g};var H=u;export{H as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as T}from"./chunk-
|
|
1
|
+
import{r as T}from"./chunk-3YWUSKWF.js";import{Eb as x,Sb as P,vb as w}from"./chunk-VPL2NDH6.js";import{e as g}from"./chunk-IU2ZQ6TE.js";import{c as h,e as O,g as u}from"./chunk-VPRTJUIN.js";var M=h(a=>{"use strict";u();a.__esModule=void 0;a.__esModule=!0;var B=typeof Object.setPrototypeOf=="function",R=typeof Object.getPrototypeOf=="function",U=typeof Object.defineProperty=="function",q=typeof Object.create=="function",z=typeof Object.prototype.hasOwnProperty=="function",H=function(e,r){B?Object.setPrototypeOf(e,r):e.__proto__=r};a.setPrototypeOf=H;var L=function(e){return R?Object.getPrototypeOf(e):e.__proto__||e.prototype};a.getPrototypeOf=L;var j=!1,Y=function t(e,r,n){if(U&&!j)try{Object.defineProperty(e,r,n)}catch{j=!0,t(e,r,n)}else e[r]=n.value};a.defineProperty=Y;var k=function(e,r){return z?e.hasOwnProperty(e,r):e[r]===void 0};a.hasOwnProperty=k;var D=function(e,r){if(q)return Object.create(e,r);var n=function(){};n.prototype=e;var s=new n;if(typeof r>"u")return s;if(typeof r=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof r=="object")for(var o in r)k(r,o)&&(s[o]=r[o].value);return s};a.objectCreate=D});var S=h(f=>{"use strict";u();f.__esModule=void 0;f.__esModule=!0;var b=M(),G=b.setPrototypeOf,Z=b.getPrototypeOf,v=b.defineProperty,J=b.objectCreate,K=new Error().toString()==="[object Error]",m="";function p(t){var e=this.constructor,r=e.name||(function(){var y=e.toString().match(/^function\s*([^\s(]+)/);return y===null?m||"Error":y[1]})(),n=r==="Error",s=n?m:r,o=Error.apply(this,arguments);if(G(o,Z(this)),!(o instanceof e)||!(o instanceof p)){var o=this;Error.apply(this,arguments),v(o,"message",{configurable:!0,enumerable:!1,value:t,writable:!0})}if(v(o,"name",{configurable:!0,enumerable:!1,value:s,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(o,n?p:e),o.stack===void 0){var c=new Error(t);c.name=o.name,o.stack=c.stack}return K&&v(o,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),o}m=p.name||"ExtendableError";p.prototype=J(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}});f.ExtendableError=p;f.default=f.ExtendableError});u();var A=O(T()),V=O(S()),i;(function(t){t[t.Abort=0]="Abort",t[t.AbortSilent=1]="AbortSilent",t[t.Bug=2]="Bug"})(i||(i={}));var _=class extends Error{},l=class extends Error{constructor(e,r,n=null,s,o){let c=typeof e=="string"||"value"in e;super(c?P(e):w(e)),n?n instanceof x?this.tryMessage=P(n):this.tryMessage=n:this.tryMessage=null,this.type=r,this.nextSteps=s,this.customSections=o,this.skipOclifErrorHandling=!0,c||(this.formattedMessage=e)}},E=class extends l{constructor(e,r=null,n,s){super(e,i.Abort,r,n,s)}},I=class extends l{constructor(e,r,n,s=null){super(e,i.Abort,s),this.command=r,this.args=n}},C=class extends l{constructor(){super("",i.AbortSilent)}},d=class extends l{constructor(e,r=null){super(e,i.Bug,r)}};async function ne(t){let e;if(N(t))e=t;else if(typeof t=="string")e=new d(t);else if(t instanceof Error)e=new d(t.message),e.stack=t.stack;else{let n=t;e=new d(n?.message??"Unknown error"),n?.stack&&(e.stack=n?.stack)}let{renderFatalError:r}=await import("./ui-H62CMRLG.js");return r(e),Promise.resolve(t)}function oe(t){if(t instanceof A.Errors.CLIError){let e=new E(t.message);return e.stack=t.stack,Promise.resolve(e)}else return Promise.resolve(t)}function N(t){try{return Object.prototype.hasOwnProperty.call(t,"type")}catch{return!1}}function se(t){if(!N(t)){if(t instanceof Error){let e=t.message;return!Q(e)}return!0}return t.type===i.Bug}function ae(t){return g(t).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function Q(t){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>t.includes(n))}export{i as a,_ as b,l as c,E as d,I as e,C as f,d as g,ne as h,oe as i,se as j,ae as k,V as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-2YXKZWYW.js";import{a as I,b as w}from"./chunk-QFWIDATO.js";import{a as _}from"./chunk-7BFDUVOG.js";import{a,b as u,k as S,q as b}from"./chunk-HHXHOQQP.js";import{ua as f,xa as p}from"./chunk-4V4DQ6W7.js";import{b as T,c as g}from"./chunk-4KRT35A2.js";import{g as s,u as c}from"./chunk-MGL4YM3S.js";import{d as v}from"./chunk-BHWEA4V2.js";import{r as x}from"./chunk-3YWUSKWF.js";import{Lb as l}from"./chunk-VPL2NDH6.js";import{e as L,g as m}from"./chunk-VPRTJUIN.js";m();m();function A(o,e){return{theme:{id:o.id,name:o.name,role:o.role,shop:e.storeFqdn,preview_url:I(o,e),editor_url:w(o,e)}}}function D(o){let{platform:e,arch:n}=s(),t=a(),r=null;return t&&(r=Number(u())||null),{store:t??"Not configured",development_theme_id:r,cli_version:o.cliVersion,os:`${e}-${n}`,shell:process.env.SHELL??"unknown",node_version:process.version}}async function O(o,e){let n;if(e.development)n=await new E(o).findOrCreate();else{let t={filter:{theme:e.theme}};n=await _(o,t)}return n?A(n,o):void 0}async function y(o){return[M(),await j(o)]}function M(){let o=a()??"Not configured",e=u();return p(`theme-command:info:dev-theme-loaded:${e}`),N("Theme Configuration",[["Store",o],["Development Theme ID",e?`#${e}`:{subdued:"Not set"}]])}async function j(o){let{platform:e,arch:n}=s();return N("Tooling and System",[["Shopify CLI",o.cliVersion],["OS",`${e}-${n}`],["Shell",process.env.SHELL??"unknown"],["Node version",process.version]])}function N(o,e){return{title:o,body:{tabularData:e,firstColumnSubdued:!0}}}async function F(o,e){let n=Object.entries(o.theme).map(([t,r])=>{if(t==="editor_url"||t==="preview_url"){let C=String(r),$=t==="editor_url"?"Open in Theme Editor":"Preview Theme";return[d(t),{link:{url:C,label:$}}]}else return t==="id"?[d(t),`#${r}`]:[d(t),`${r}`]});return{customSections:[...e.environment?[{title:"Theme information",body:[{subdued:`Environment name: ${e.environment}`}]}]:[],{title:"Theme Details",body:{tabularData:n,firstColumnSubdued:!0}}]}}function d(o){return o.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var h=L(x(),1);var i=class extends b{async command(e,n){if(f("theme-command:info"),e.theme||e.development){let t=await O(n,e);if(!t)throw new v("Theme not found!");if(e.json)return l(JSON.stringify(t,null,2));let r=await F(t,e);c(r)}else{if(e.json)return l(JSON.stringify(D({cliVersion:this.config.version}),null,2));let t=await y({cliVersion:this.config.version});c({customSections:t})}f("theme-command:info")}};i.description="Displays information about your theme environment, including your current store. Can also retrieve information about a specific theme.";i.flags={...T,...g,...S,development:h.Flags.boolean({char:"d",description:"Retrieve info from your development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),theme:h.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})};i.multiEnvironmentsFlags=["store","password"];var k=i;export{k as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k}from"./chunk-UOQ75BL3.js";import{a as g}from"./chunk-DCBYHVKW.js";import{a as y}from"./chunk-DCK2FX6J.js";import{Ga as w,g as b}from"./chunk-WCWNI3ZV.js";import{b as h}from"./chunk-4KRT35A2.js";import{O as u,t as m,v as f}from"./chunk-MGL4YM3S.js";import{d}from"./chunk-6YAXFS6V.js";import{r as S}from"./chunk-3YWUSKWF.js";import{e as A,g as o}from"./chunk-VPRTJUIN.js";o();o();o();async function r(e,{web:i,stdout:t,stderr:a,signal:s,env:p={}}){let l=i.configuration.commands[e];if(!l)return;let[_,...v]=l.split(" ");await u(_,v,{cwd:i.directory,stdout:t,stderr:a,signal:s,env:p}),t.write("Web successfully built.")}async function P(e){!e.skipDependenciesInstallation&&!e.project.usesWorkspaces&&await g(e.project);let i={};e.apiKey&&(i.SHOPIFY_API_KEY=e.apiKey),await b(e.app),await m({processes:[...e.app.webs.map(t=>({prefix:["web",...t.configuration.roles].join("-"),action:async(a,s,p)=>{await r("build",{web:t,stdout:a,stderr:s,signal:p,env:i})}})),...e.app.allExtensions.map(t=>({prefix:t.localIdentifier,action:async(a,s,p)=>{await t.build({stdout:a,stderr:s,signal:p,app:e.app,environment:"production"})}}))],showTimestamps:!1}),f({headline:[{userInput:e.app.name},"built!"]})}var x=P;var I=A(S(),1);var c,n=class extends k{async run(){let{flags:i}=await this.parse(c),t=i["client-id"];await d(()=>({cmd_app_dependency_installation_skipped:i["skip-dependencies-installation"]}));let{app:a,project:s}=await w({directory:i.path,userProvidedConfigName:i.config});return await x({app:a,project:s,skipDependenciesInstallation:i["skip-dependencies-installation"],apiKey:t}),{app:a}}};c=n;n.summary="Build the app, including extensions.";n.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.";n.description=c.descriptionWithoutMarkdown();n.flags={...h,...y,"skip-dependencies-installation":I.Flags.boolean({hidden:!1,description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1})};var J=n;export{J as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as M}from"./chunk-T5MK7ZSF.js";import{a as S}from"./chunk-DCK2FX6J.js";import{A as b,B as A,D as C,E as x,Fa as V}from"./chunk-WCWNI3ZV.js";import{a as c}from"./chunk-FP2NOZSD.js";import{b as j,c as E}from"./chunk-4KRT35A2.js";import{v as y,x as u}from"./chunk-MGL4YM3S.js";import{d as g,f as o}from"./chunk-BHWEA4V2.js";import{Lb as s,Sb as w,Vb as h}from"./chunk-VPL2NDH6.js";import{g as m}from"./chunk-VPRTJUIN.js";m();m();async function N(f,t){let i=new Set(t.map(n=>n.file)).size;await c.addPublicMetadata(()=>({cmd_app_validate_valid:f,cmd_app_validate_issue_count:t.length,cmd_app_validate_file_count:i}))}async function J(f,t={json:!1}){let i=f.errors;if(!i||i.isEmpty()){if(await N(!0,[]),t.json){s(JSON.stringify({valid:!0,issues:[]},null,2));return}y({headline:"App configuration is valid."});return}let n=i.getErrors();if(await N(!1,n),t.json){let d=n.map(({file:p,message:a,path:r,code:e})=>({file:p,message:a,path:r,code:e}));throw s(JSON.stringify({valid:!1,issues:d},null,2)),new o}throw u({headline:"Validation errors found.",body:n.map(d=>`\u2022 ${x(d)}`).join(`
|
|
2
|
+
`)}),new o}var v;async function _(f,t){await c.addPublicMetadata(()=>({cmd_app_validate_valid:!1,cmd_app_validate_issue_count:f,cmd_app_validate_file_count:t}))}var l=class extends M{async run(){let{flags:t}=await this.parse(v);await c.addPublicMetadata(()=>({cmd_app_validate_json:t.json}));let i;try{i=await b.load(t.path)}catch(a){if(a instanceof g&&t.json){await _(1,1);let r=h(w(a.message)).trim();throw s(JSON.stringify({valid:!1,issues:[{message:r}]},null,2)),new o}throw a}let n;try{n=await C(i,t.config)}catch(a){if(a instanceof g&&t.json){await _(1,1);let r=h(w(a.message)).trim();throw s(JSON.stringify({valid:!1,issues:[{message:r}]},null,2)),new o}throw a}let d=A(i,n.file);if(d.length>0){let a=d.map(e=>({file:e.path,message:e.message})),r=new Set(d.map(e=>e.path)).size;throw await _(a.length,r),t.json?(s(JSON.stringify({valid:!1,issues:a},null,2)),new o):(u({headline:"Validation errors found.",body:a.map(e=>`\u2022 ${e.message}`).join(`
|
|
3
|
+
`)}),new o)}let p;try{p=(await V({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config,unsafeTolerateErrors:!0})).app}catch(a){let r=a instanceof g?h(w(a.message)).trim():"";throw r.startsWith("Validation errors in ")&&t.json?(await _(1,1),s(JSON.stringify({valid:!1,issues:[{message:r}]},null,2)),new o):a}return await J(p,{json:t.json}),{app:p}}};v=l;l.summary="Validate your app configuration and extensions.";l.descriptionWithMarkdown="Validates the selected app configuration file and all extension configurations against their schemas and reports any errors found.";l.description=v.descriptionWithoutMarkdown();l.flags={...j,...S,...E};var X=l;export{X as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as a}from"./chunk-4V4DQ6W7.js";import{d as o}from"./chunk-BHWEA4V2.js";import{g as u}from"./chunk-VPRTJUIN.js";u();var n={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},p={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function c(t,e){let r=h(t);return r===n.LOCALHOST&&e===n.HTTP?!0:r===e}function f(t){return p.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function E(t,e){if(!c(t,e))throw new o(`Can't deliver your webhook payload to this address using '${e}'`,"Use a valid URL for address",l(e));let r=e;return f(t)&&(r=n.LOCALHOST),[t.trim(),r]}function l(t){return t===n.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===n.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===n.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function g(t,e){if(e.includes(t))return t;throw new o(`Api Version '${t}' does not exist`,`Allowed values: ${e.join(", ")}`,["Try again with a valid api-version value"])}function L(t,e,r){if(r.length===0)throw new o(`No topics found for '${e}'`);let i=T(t.trim(),r);if(i===void 0)throw new o(`Topic '${t}' does not exist for ApiVersion '${e}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return i}function T(t,e){return e.includes(t)?t:e.find(r=>r.toUpperCase().replace("/","_")===t)}function h(t){if(t){if(t.startsWith("pubsub:"))return n.PUBSUB;if(t.startsWith("arn:aws:events:"))return n.EVENTBRIDGE;if(f(t))return n.LOCALHOST;if(p.HTTP.test(t))return n.HTTP}}u();async function H(t,e,r){let i={method:"POST",body:e,headers:{"Content-Type":"application/json",...JSON.parse(r)}},s=await a(t,i);return s.status>=200&&s.status<300}export{H as a,n as b,c,E as d,g as e,L as f,h as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as u,c as d}from"./chunk-CE6FKJFS.js";import{a as m}from"./chunk-UOQ75BL3.js";import{a}from"./chunk-DCK2FX6J.js";import{Ga as c,p}from"./chunk-WCWNI3ZV.js";import{b as e}from"./chunk-4KRT35A2.js";import{v as n}from"./chunk-MGL4YM3S.js";import{g as i}from"./chunk-VPRTJUIN.js";i();var s,o=class extends m{async run(){let{flags:t}=await this.parse(s),{app:r}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await d(r,t.path);return await p(l,{app:r,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),n({headline:"Function built successfully."}),{app:r}}};s=o;o.summary="Compile a function to wasm.";o.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";o.description=s.descriptionWithoutMarkdown();o.flags={...e,...a,...u};var k=o;export{k as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fa as x,o as A}from"./chunk-WCWNI3ZV.js";import{B as F}from"./chunk-MGL4YM3S.js";import{d as s}from"./chunk-BHWEA4V2.js";import{r as D}from"./chunk-3YWUSKWF.js";import{Hb as f,Lb as I,Mb as P,Ta as p,ua as v}from"./chunk-VPL2NDH6.js";import{a as S}from"./chunk-UARVYVLN.js";import{d as m,f as y,q as w}from"./chunk-IU2ZQ6TE.js";import{e as E,g as l}from"./chunk-VPRTJUIN.js";l();async function b(n){let{extension:e,stdout:o,developerPlatformClient:i,app:r,orgId:t}=n,c=r.configuration.client_id,{api_version:a,type:u,targeting:d}=e.configuration,T=await(!!d?.length?_({localIdentifier:e.localIdentifier,developerPlatformClient:i,apiKey:c,target:d[0].target,version:a,orgId:t}):$({localIdentifier:e.localIdentifier,developerPlatformClient:i,apiKey:c,type:u,version:a,orgId:t})),h=A(T,a);if(o)I(h);else{let g=m(e.directory,"schema.graphql");await v(g,h),P(`GraphQL Schema for ${e.localIdentifier} written to ${g}`)}}async function _({localIdentifier:n,developerPlatformClient:e,apiKey:o,target:i,version:r,orgId:t}){let c={handle:i,version:r},a=await e.targetSchemaDefinition(c,o,t);if(!a)throw new s(f`A schema could not be generated for ${n}`,f`Check that the Function targets and version are valid.`);return a}async function $({localIdentifier:n,developerPlatformClient:e,apiKey:o,version:i,type:r,orgId:t}){let c={version:i,type:r},a=await e.apiSchemaDefinition(c,o,t);if(!a)throw new s(f`A schema could not be generated for ${n}`,f`Check that the Function API type and version are valid.`);return a}l();var C=E(D(),1);var J={path:C.Flags.string({hidden:!1,description:"The path to your function directory.",parse:async n=>y(n),default:async()=>w(),noCacheDefault:!0,env:"SHOPIFY_FLAG_PATH"})};async function M(n,e){let o=n.allExtensions.filter(r=>r.isFunctionExtension),i=o.find(r=>r.directory===e);if(i)return i;if(o.length===1&&o[0])return o[0];if(S())return await F({message:"Which function?",choices:o.map(t=>({label:t.handle,value:t}))});throw new s("Run this command from a function directory or use `--path` to specify a function directory.")}async function N(n,e,o,i,r){let t=m(n.directory,"schema.graphql");if(await p(t))return t;let{app:c,developerPlatformClient:a,organization:u}=await x({directory:e,clientId:o,forceRelink:i,userProvidedConfigName:r});return await b({app:c,developerPlatformClient:a,extension:n,stdout:!1,orgId:u.id}),await p(t)?t:void 0}export{b as a,J as b,M as c,N as d};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{a as l}from"./chunk-LTWXTDDR.js";import{k as r,l as m,q as a}from"./chunk-HHXHOQQP.js";import{ua as i}from"./chunk-4V4DQ6W7.js";import{b as s,c as h}from"./chunk-4KRT35A2.js";import{r as v}from"./chunk-3YWUSKWF.js";import{e as f,g as n}from"./chunk-VPRTJUIN.js";n();var e=f(v(),1);var p,t=class extends a{async command(o,d,c,_,u){i("theme-command:push"),await l({...o,allowLive:o["allow-live"],noColor:o["no-color"],developmentContext:o["development-context"]},d,c,u),i("theme-command:push")}};p=t;t.summary="Uploads your local theme files to the connected store, overwriting the remote version if specified.";t.usage=["theme push","theme push --unpublished --json"];t.descriptionWithMarkdown=`Uploads your local theme files to Shopify, overwriting the remote version if specified.
|
|
2
|
+
|
|
3
|
+
If no theme is specified, then you're prompted to select the theme to overwrite from the list of the themes in your store.
|
|
4
|
+
|
|
5
|
+
You can run this command only in a directory that matches the [default Shopify theme folder structure](https://shopify.dev/docs/themes/tools/cli#directory-structure).
|
|
6
|
+
|
|
7
|
+
This command returns the following information:
|
|
8
|
+
|
|
9
|
+
- A link to the [editor](https://shopify.dev/docs/themes/tools/online-editor) for the theme in the Shopify admin.
|
|
10
|
+
- A [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with others.
|
|
11
|
+
|
|
12
|
+
If you use the \`--json\` flag, then theme information is returned in JSON format, which can be used as a machine-readable input for scripts or continuous integration.
|
|
13
|
+
|
|
14
|
+
Sample output:
|
|
15
|
+
|
|
16
|
+
\`\`\`json
|
|
17
|
+
{
|
|
18
|
+
"theme": {
|
|
19
|
+
"id": 108267175958,
|
|
20
|
+
"name": "MyTheme",
|
|
21
|
+
"role": "unpublished",
|
|
22
|
+
"shop": "mystore.myshopify.com",
|
|
23
|
+
"editor_url": "https://mystore.myshopify.com/admin/themes/108267175958/editor",
|
|
24
|
+
"preview_url": "https://mystore.myshopify.com/?preview_theme_id=108267175958"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
\`\`\`
|
|
28
|
+
`;t.description=p.descriptionWithoutMarkdown();t.flags={...s,...r,...m("upload"),...h,theme:e.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),development:e.Flags.boolean({char:"d",description:"Push theme files from your remote development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),"development-context":e.Flags.string({char:"c",description:"Unique identifier for a development theme context (e.g., PR number, branch name). Reuses an existing development theme with this context name, or creates one if none exists.",env:"SHOPIFY_FLAG_DEVELOPMENT_CONTEXT",dependsOn:["development"],exclusive:["theme"]}),live:e.Flags.boolean({char:"l",description:"Push theme files from your remote live theme.",env:"SHOPIFY_FLAG_LIVE"}),unpublished:e.Flags.boolean({char:"u",description:"Create a new unpublished theme and push to it.",env:"SHOPIFY_FLAG_UNPUBLISHED"}),nodelete:e.Flags.boolean({char:"n",description:"Prevent deleting remote files that don't exist locally.",env:"SHOPIFY_FLAG_NODELETE"}),"allow-live":e.Flags.boolean({char:"a",description:"Allow push to a live theme.",env:"SHOPIFY_FLAG_ALLOW_LIVE"}),publish:e.Flags.boolean({char:"p",description:"Publish as the live theme after uploading.",env:"SHOPIFY_FLAG_PUBLISH"}),force:e.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"}),strict:e.Flags.boolean({description:"Require theme check to pass without errors before pushing. Warnings are allowed.",env:"SHOPIFY_FLAG_STRICT_PUSH"}),listing:e.Flags.string({description:"The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.",env:"SHOPIFY_FLAG_LISTING"}),environment:r.environment};t.multiEnvironmentsFlags=["store","password","path",["live","development","theme"]];var L=t;export{L as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as T}from"./chunk-OYP7DKPU.js";import{a as de}from"./chunk-TXUTT6UA.js";import{b as te,c as re,d as oe,e as se,f as ne,h as ie,i as ae,k as le,l as ce,n as me}from"./chunk-X2TC7S57.js";import{a as j}from"./chunk-MA52QGHP.js";import{A as Q,B as b,J as X,c as Y,s as B,w as N,x as V,y as x}from"./chunk-IOQQUHST.js";import{c as Z,e as ee}from"./chunk-M4V2OQAX.js";import{k as v,l as z,n as k}from"./chunk-MZJRNFAU.js";import{n as C,p as P}from"./chunk-HHXHOQQP.js";import{ta as L,xa as _}from"./chunk-4V4DQ6W7.js";import{a as O}from"./chunk-JUVAGMIH.js";import{J as K,P as J,s as W,u as M,v as q,w as R,y as U,z as G}from"./chunk-MGL4YM3S.js";import{d as H,e as I}from"./chunk-6YAXFS6V.js";import{d as g}from"./chunk-BHWEA4V2.js";import{Fb as y,Hb as p,Mb as E,Pb as f}from"./chunk-VPL2NDH6.js";import{u as w}from"./chunk-7JESXDF2.js";import{g as m}from"./chunk-VPRTJUIN.js";m();m();m();m();var fe={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return fe;f("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=$e(o,r),a=i.length===0&&n.length===0&&l.length===0;if(_(`theme-service:theme-reconciliation:manual:${a}`),a)return f("Local and remote checksums match - no need to reconcile theme assets"),fe;let c=await Oe({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Fe(e,t,r,c)}}function $e(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:A(r,t),filesOnlyPresentLocally:A(i,t),filesWithConflictingChecksums:A(s,t)}}function A(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function S(e,t,o){if(e.length===0)return;M({body:{list:{title:t,items:e.map(s=>s.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:he}]})===D?o.remote.callback(e):o.local.callback(e)}async function Fe(e,t,o,r){let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:n}=r,l=s.map(d=>o.delete(d.key)),a=T(i,P,async d=>{let u=await v(e.id,d.map(h=>h.key),t);return Promise.all(u.map(h=>{if(h)return o.write(h)}))}),c=z(e.id,n.map(d=>d.key),t);await Promise.all([...l,...a,c])}async function Oe(e,t){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s}=e,i=[],n=[],l=[];return t.noDelete||await S(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:a=>{i.push(...a)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}}),await S(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:a=>{n.push(...a)}},local:{label:"Delete files from the remote theme",callback:a=>{l.push(...a)}}}),await S(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:a=>{n.push(...a)}},local:{label:"Keep the local version",callback:()=>{}}}),{localFilesToDelete:i,filesToDownload:n,remoteFilesToDelete:l}}m();var Le=3e3,$=class extends Error{};function ye(e,t,o,r,s,i){f("Listening for changes in the theme editor");let n=5,l=0,a="",c=o,d=async()=>{await new Promise(u=>setTimeout(u,Le)),c=await _e(e,t,c,r,s).then(u=>(l=0,a="",u)).catch(u=>{if(l++,u.message!==a&&(a=u.message,b("Error while polling for changes.",u)),l>=n){let h=new g("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");U(h),i(h)}return c})};setTimeout(async()=>{for(;;)await d()})}async function _e(e,t,o,r,s){let i=new Set(r.unsyncedFileKeys),n=pe(o,r,i),l=await k(e.id,t).then(d=>pe(d,r,i)),a=Ie(n,l),c=He(l,n);return await qe(r,a),await We(e,t,r,a),await Me(r,c,s),l}function He(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>o.get(s.key)===void 0)}function Ie(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 We(e,t,o,r){let s=r.filter(n=>o.files.get(n.key)?.checksum!==n.checksum),i=T(s,P,async n=>v(e.id,n.map(l=>l.key),t).then(l=>Promise.all(l.map(async a=>{a&&(await o.write(a),E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`download ${a.key} from remote theme`)}`))}))));await Promise.all(i)}async function Me(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(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`remove ${r.key} from local theme`)}`)})}))}async function qe(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 $(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function pe(e,t,o){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!o.has(s.key))}var he="local",D="remote";async function we(e,t,o,r,s,i){f("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 k(e.id,t);return ye(e,t,a,r,s,i),a}),workPromise:n}}m();function ge(){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 Ue}from"node:http";function ke(e,t){let{promise:o,resolve:r,reject:s}=ge(),i=ie(e,t),n=Ge(e,t,s),l=Promise.all([i,n.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),a=Je(e,t,l);return{workPromise:l,serverStart:a.start,dispatchEvent:a.dispatch,renderDevSetupProgress:n.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Ge(e,t,o){let r=a=>(b("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),i=k(e.id,t.session).then(a=>Ke(e,t,a,o)),n=i.then(async({updatedRemoteChecksumsPromise:a})=>{let c=await a;return de(e,t.session,c,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:c}=await i;await ee([{title:"Performing file synchronization. This may take a while...",task:async()=>{await c}}])}let{renderThemeSyncProgress:a}=await n;await a()}}}function Ke(e,t,o,r){return t.options.themeEditorSync?we(e,t.session,o,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve()})}function Je(e,t,o){let r=x(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];r.use(se(t.options.host,t.options.port)),r.use(V(async()=>(await o,N(n=>{n.node.req.headers.origin&&B(n,{origin:a=>s.includes(a),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&r.use(ae(e,t)),r.use(oe(e,t)),r.use(te(e,t)),r.use(re(e,t));let i=Ue(Q(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)})])}})))}}m();import{createServer as Te}from"net";var Pe=new Set;async function Re(e,t){if(e&&await F(e))return f(p`Port ${e.toString()} is free`),e;f(p`Getting a random port...`);let o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);for(let r=0;r<(t?.maxTries??5)&&Pe.has(o);r++)o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);return f(p`Random port obtained: ${y.raw(`${o}`)}`),Pe.add(o),o}async function F(e){return new Promise(t=>{let o=Te();o.unref(),o.once("error",()=>t(!1));try{o.listen(e,"localhost",()=>{o.close(()=>t(!0))})}catch(r){if(!(r instanceof RangeError))throw r;t(!1)}})}function ve(){return new Promise((e,t)=>{let o=Te();o.unref(),o.once("error",t),o.listen(0,"localhost",()=>{let r=o.address();if(r&&typeof r=="object"){let s=r.port;o.close(()=>e(s))}else o.close(()=>t(new Error("Unable to determine assigned port")))})})}async function be(e,t=5,o=1){let r=1;for(;;)try{return await e()}catch(s){if(r++<t)f(p`Unknown problem getting a random port: ${s.message}`),await J(o);else throw new g(s.message)}}import ze from"readline";var Ye="127.0.0.1",je=9292,Ee=!1;async function lr(e){if(!await me(e.directory)&&!await Z(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.",`
|
|
2
|
+
`,{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 le(e.directory,e.listing);let t=await Y(e.adminSession).then(De=>De?j(e.storePassword,e.adminSession.storeFqdn):void 0),o=ne(),r=ce(e.directory,{filters:e,listing:e.listing,noDelete:e.noDelete,notify:e.notify}),s=e.host??Ye,i;if(e.port){if(!await F(e.port))throw new g(`Port ${e.port} is not available. Try a different port or remove the --port flag to use an available port.`);i=e.port}else i=await Re(je);let n={local:`http://${s}:${i}`,giftCard:`http://${s}:${i}/gift_cards/[store_id]/preview`,themeEditor:`https://${e.store}/admin/themes/${e.theme.id}/editor?hr=${i}`,preview:`https://${e.store}/?preview_theme_id=${e.theme.id}`},l=await t,c={session:await X(e.theme.id.toString(),e.adminSession,e.password,l),localThemeFileSystem:r,localThemeExtensionFileSystem:o,directory:e.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:e["theme-editor-sync"],host:s,port:i,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:d,renderDevSetupProgress:u,backgroundJobPromise:h,resolveBackgroundJob:Ae}=ke(e.theme,c);ze.emitKeypressEvents(process.stdin);let Se=Ne(n,c,Ae);process.stdin.on("keypress",Se),await Promise.all([h,u().then(d).then(()=>{process.stdin.isTTY&&process.stdin.setRawMode(!0),xe(n),e.open&&Ce(n.local,"development server")})]),await Be(e.commandConfig,e.adminSession),process.exit(0)}async function Be(e,t){if(!Ee){Ee=!0;try{await H(()=>({store_fqdn_hash:O(t.storeFqdn)})),await I(()=>({store_fqdn:t.storeFqdn})),await L({config:e,exitMode:"ok"})}catch{}}}function Ne(e,t,o){let r=W(Ce,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 Ce(e,t){K(e).catch(Ve(t))}function Ve(e){return t=>{R({headline:`Failed to open ${e}.`,body:t.stack??t.message})}}function xe(e){q({body:[{list:{title:w.bold("Preview your theme ")+w.cyan("(t)"),items:[{link:{url:e.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${w.cyan("(p)")}`,url:e.preview}},{subdued:e.preview}],[{link:{label:`Customize your theme at the theme editor ${w.cyan("(e)")}`,url:e.themeEditor}}],[{link:{label:`Preview your gift cards ${w.cyan("(g)")}`,url:e.giftCard}}]]})}export{Re as a,F as b,lr as c,Ce as d};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{a as k,b as i,c as F,d as L,e as _,f as M,g as H}from"./chunk-C6ABJCRG.js";import{a as E}from"./chunk-T5MK7ZSF.js";import{a as P}from"./chunk-DCK2FX6J.js";import{Fa as I,ga as S}from"./chunk-WCWNI3ZV.js";import{N as b,O as T,P as A}from"./chunk-VICNWPLQ.js";import{B as g,F as v,z as p}from"./chunk-MGL4YM3S.js";import{r as q}from"./chunk-3YWUSKWF.js";import{Nb as h,Qb as m,Sb as w}from"./chunk-VPL2NDH6.js";import{j as y}from"./chunk-IU2ZQ6TE.js";import{e as G,g as a}from"./chunk-VPRTJUIN.js";a();a();a();a();async function V(e){let t=e.map(o=>({label:o,value:o}));return await g({message:"Webhook Topic",choices:t})}async function C(e){return p({message:"Webhook ApiVersion",choices:e.map(t=>({label:t,value:t}))})}async function R(){return p({message:"Delivery method",choices:[{label:"HTTP",value:i.HTTP},{label:"Google Pub/Sub",value:i.PUBSUB},{label:"Amazon EventBridge",value:i.EVENTBRIDGE}]})}async function D(e){return(await v({message:"Address for delivery",validate:r=>{let o=r.trim();if(o.length===0)return"Address can't be empty";if(!F(o,e))return`Invalid address.
|
|
2
|
+
${c(e)}`}})).trim()}function U(e){return e===i.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:e===i.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:e===i.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function c(e){return U(e).map(t=>` \xB7 ${w(t)}`).join(`
|
|
3
|
+
`)}async function O(e,t){let{clientSecret:r,clientId:o,remoteApp:s,app:l}=e;return r&&(o||t!==i.EVENTBRIDGE)?{clientSecret:r,apiKey:o}:(S({appName:s.title,configFile:y(l.configPath)}),{clientSecret:s.apiSecretKeys.find(f=>f.secret).secret,apiKey:s.apiKey})}async function x(e,t,r){let o=await T(e,r);return t?_(t,o):C(o)}async function B(e,t,r,o){let s=await A(e,t,o);return r?M(r,t,s):V(s)}async function Y(e,t){let r=e??H(t)??await R(),o=t??await D(r);return L(o,r)}async function N(e){let t=await W(e);await z(t)}async function W(e){let t=await x(e.developerPlatformClient,e.apiVersion,e.organizationId),r=await B(e.developerPlatformClient,t,e.topic,e.organizationId),[o,s]=await Y(e.deliveryMethod,e.address),l=await O(e,s);return{topic:r,apiVersion:t,deliveryMethod:s,address:o,apiKey:l.apiKey,clientSecret:l.clientSecret,developerPlatformClient:e.developerPlatformClient,organizationId:e.organizationId}}async function z(e){let t={topic:e.topic,api_version:e.apiVersion,address:e.address,delivery_method:e.deliveryMethod,shared_secret:e.clientSecret,api_key:e.apiKey},r=await b(e.developerPlatformClient,t,e.organizationId);if(!r.success){m(`Request errors:
|
|
4
|
+
${K(r.userErrors)}`);return}if(e.deliveryMethod===i.LOCALHOST){if(await k(e.address,r.samplePayload,r.headers)){h("Localhost delivery sucessful");return}m("Localhost delivery failed");return}r.samplePayload===JSON.stringify({})&&h("Webhook has been enqueued for delivery")}function K(e){try{return e.map(t=>JSON.parse(t.message).map(r=>` \xB7 ${r}`).join(`
|
|
5
|
+
`)).join(`
|
|
6
|
+
`)}catch{return JSON.stringify(e)}}var d=G(q(),1),u,n=class extends E{async run(){let{flags:t}=await this.parse(u),r=await I({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o={...r,topic:t.topic,apiVersion:t["api-version"],deliveryMethod:t["delivery-method"],address:t.address,clientId:t["client-id"],clientSecret:t["client-secret"],path:t.path,config:t.config,organizationId:r.organization.id};return await N(o),{app:r.app}}};u=n;n.summary="Trigger delivery of a sample webhook topic payload to a designated address.";n.descriptionWithMarkdown=`
|
|
7
|
+
Triggers the delivery of a sample Admin API event topic payload to a designated address.
|
|
8
|
+
|
|
9
|
+
You should use this command to experiment with webhooks, to initially test your webhook configuration, or for unit testing. However, to test your webhook configuration from end to end, you should always trigger webhooks by performing the related action in Shopify.
|
|
10
|
+
|
|
11
|
+
Because most webhook deliveries use remote endpoints, you can trigger the command from any directory where you can use Shopify CLI, and send the webhook to any of the supported endpoint types. For example, you can run the command from your app's local directory, but send the webhook to a staging environment endpoint.
|
|
12
|
+
|
|
13
|
+
To learn more about using webhooks in a Shopify app, refer to [Webhooks overview](https://shopify.dev/docs/apps/webhooks).
|
|
14
|
+
|
|
15
|
+
### Limitations
|
|
16
|
+
|
|
17
|
+
- Webhooks triggered using this method always have the same payload, so they can't be used to test scenarios that differ based on the payload contents.
|
|
18
|
+
- Webhooks triggered using this method aren't retried when they fail.
|
|
19
|
+
- Trigger requests are rate-limited using the [Partner API rate limit](https://shopify.dev/docs/api/partner#rate_limits).
|
|
20
|
+
- You can't use this method to validate your API webhook subscriptions.
|
|
21
|
+
`;n.description=u.descriptionWithoutMarkdown();n.flags={...P,help:d.Flags.help({required:!1,hidden:!1,env:"SHOPIFY_FLAG_HELP",description:"This help. When you run the trigger command the CLI will prompt you for any information that isn't passed using flags."}),topic:d.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_TOPIC",description:"The requested webhook topic."}),"api-version":d.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_API_VERSION",description:"The API Version of the webhook topic."}),"delivery-method":d.Flags.string({required:!1,hidden:!1,options:[i.HTTP,i.PUBSUB,i.EVENTBRIDGE],env:"SHOPIFY_FLAG_DELIVERY_METHOD",description:"Method chosen to deliver the topic payload. If not passed, it's inferred from the address."}),"client-secret":d.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_CLIENT_SECRET",description:"Your app's client secret. This secret allows us to return the X-Shopify-Hmac-SHA256 header that lets you validate the origin of the response that you receive."}),address:d.Flags.string({required:!1,hidden:!1,env:"SHOPIFY_FLAG_ADDRESS",description:`The URL where the webhook payload should be sent.
|
|
22
|
+
You will need a different address type for each delivery-method:
|
|
23
|
+
${c(i.HTTP)}
|
|
24
|
+
${c(i.PUBSUB)}
|
|
25
|
+
${c(i.EVENTBRIDGE)}`})};var be=n;export{be as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as n}from"./chunk-WUK5NQSX.js";import{D as s}from"./chunk-MGL4YM3S.js";import{g as a}from"./chunk-VPRTJUIN.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as r}from"./chunk-
|
|
1
|
+
import{z as r}from"./chunk-4V4DQ6W7.js";import{r as o}from"./chunk-3YWUSKWF.js";import{f as t,q as n}from"./chunk-IU2ZQ6TE.js";import{e as s,g as a}from"./chunk-VPRTJUIN.js";a();var e=s(o(),1);var c={path:e.Flags.string({description:"The path to your app directory.",parse:async i=>t(i),default:async()=>n(),noCacheDefault:!0,env:"SHOPIFY_FLAG_PATH"}),config:e.Flags.string({hidden:!1,char:"c",description:"The name of the app configuration.",env:"SHOPIFY_FLAG_APP_CONFIG"}),"client-id":e.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]}),reset:e.Flags.boolean({hidden:!1,description:"Reset all your settings.",env:"SHOPIFY_FLAG_RESET",default:!1,exclusive:["config"]})},p={query:e.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":e.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async i=>t(i),exactlyOne:["query","query-file"]}),variables:e.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":e.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async i=>t(i),exclusive:["variables"]}),store:e.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>r(i)}),watch:e.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":e.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:e.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})},h={query:e.Flags.string({char:"q",description:"The GraphQL query or mutation, as a string.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":e.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async i=>t(i),exactlyOne:["query","query-file"]}),variables:e.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES",exclusive:["variable-file"]}),"variable-file":e.Flags.string({description:"Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async i=>t(i),exclusive:["variables"]}),store:e.Flags.string({char:"s",description:"The myshopify.com domain of the store to execute against. The app must be installed on the store. If not specified, you will be prompted to select a store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>r(i)}),version:e.Flags.string({description:"The API version to use for the query or mutation. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"output-file":e.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE"})};export{c as a,p as b,h as c};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{a as C}from"./chunk-KFCGMT67.js";import{a as p}from"./chunk-M4V2OQAX.js";import{a as N}from"./chunk-QFWIDATO.js";import{a as v,b as J}from"./chunk-7BFDUVOG.js";import{r as E}from"./chunk-MZJRNFAU.js";import{k as c,m as F,q as S}from"./chunk-HHXHOQQP.js";import{O as w}from"./chunk-4V4DQ6W7.js";import{b as q,c as D}from"./chunk-4KRT35A2.js";import{A as T,S as O,v as I,x as u}from"./chunk-MGL4YM3S.js";import{r as M}from"./chunk-3YWUSKWF.js";import{Lb as a}from"./chunk-VPL2NDH6.js";import{e as A,g as h}from"./chunk-VPRTJUIN.js";h();h();async function _(t,o,e){let{name:r,verbose:d,noColor:l,json:m,force:x}=e,g=O()||x;if(C({verbose:d,noColor:l}),g&&!o){let s="A theme ID is required to duplicate a theme, specify one with the --theme flag";m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}let i=o?await J(t,o):await v(t,{header:"Select a theme to duplicate",filter:{theme:o}});if(!i){let s=`No theme with ID ${o} could be found. Use shopify theme list to find a theme ID.`;m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}if(i?.role==="development"){let s="Development themes can't be duplicated. Use shopify theme push to upload it to the store first.";m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}if(!g&&!await T({message:`Do you want to duplicate '${i.name}' on ${t.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${i.name}'`,cancellationMessage:"No, cancel duplicate"}))return;let b=await E(i.id,r,t);m?j(i,t,b):P(i,t,b)}function P(t,o,e){if(e.userErrors&&e.userErrors.length>0){let r=e.userErrors.map(d=>d.message).join(", ");u({body:["The theme",...p(t),"could not be duplicated due to errors: ",{subdued:r},{char:"."},...e.requestId?[`
|
|
2
|
+
Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?I({body:["The theme",...p(t),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:N(e.theme,o)}}]]}):u({body:["The theme",...p(t),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
|
|
3
|
+
Request ID: `,{subdued:e.requestId}]:[]]})}function j(t,o,e){if(e.userErrors&&e.userErrors.length>0)a(JSON.stringify({message:`The theme '${t.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId}));else if(e.theme){let{id:r,name:d,role:l}=e.theme,m={theme:{id:r,name:d,role:l,shop:o.storeFqdn}};a(JSON.stringify(m))}else a(JSON.stringify({message:`The theme '${t.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}))}var f=A(M(),1);var y,n=class extends S{async run(){let{flags:o}=await this.parse(y),e=F(o),r=await w(e,o.password);await _(r,o.theme,o)}};y=n;n.summary="Duplicates a theme from your theme library.";n.usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];n.descriptionWithMarkdown=`If you want to duplicate your local theme, you need to run \`shopify theme push\` first.
|
|
4
|
+
|
|
5
|
+
If no theme ID is specified, you're prompted to select the theme that you want to duplicate from the list of themes in your store. You're asked to confirm that you want to duplicate the specified theme.
|
|
6
|
+
|
|
7
|
+
Prompts and confirmations are not shown when duplicate is run in a CI environment or the \`--force\` flag is used, therefore you must specify a theme ID using the \`--theme\` flag.
|
|
8
|
+
|
|
9
|
+
You can optionally name the duplicated theme using the \`--name\` flag.
|
|
10
|
+
|
|
11
|
+
If you use the \`--json\` flag, then theme information is returned in JSON format, which can be used as a machine-readable input for scripts or continuous integration.
|
|
12
|
+
|
|
13
|
+
Sample JSON output:
|
|
14
|
+
|
|
15
|
+
\`\`\`json
|
|
16
|
+
{
|
|
17
|
+
"theme": {
|
|
18
|
+
"id": 108267175958,
|
|
19
|
+
"name": "A Duplicated Theme",
|
|
20
|
+
"role": "unpublished",
|
|
21
|
+
"shop": "mystore.myshopify.com"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
\`\`\`
|
|
25
|
+
|
|
26
|
+
\`\`\`json
|
|
27
|
+
{
|
|
28
|
+
"message": "The theme 'Summer Edition' could not be duplicated due to errors",
|
|
29
|
+
"errors": ["Maximum number of themes reached"],
|
|
30
|
+
"requestId": "12345-abcde-67890"
|
|
31
|
+
}
|
|
32
|
+
\`\`\``;n.description=y.descriptionWithoutMarkdown();n.flags={...q,...D,password:c.password,theme:f.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),name:f.Flags.string({char:"n",description:"Name of the newly duplicated theme.",env:"SHOPIFY_FLAG_NAME"}),store:c.store,environment:c.environment,force:f.Flags.boolean({char:"f",description:"Force the duplicate operation to run without prompts or confirmations.",env:"SHOPIFY_FLAG_FORCE"})};var ee=n;export{ee as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as h}from"./chunk-LTWXTDDR.js";import{k as m,q as a}from"./chunk-HHXHOQQP.js";import{ua as t}from"./chunk-4V4DQ6W7.js";import{b as s}from"./chunk-4KRT35A2.js";import{r as f}from"./chunk-3YWUSKWF.js";import{T as n}from"./chunk-VPL2NDH6.js";import{e as w,g as i}from"./chunk-VPRTJUIN.js";i();var o=w(f(),1);var d,e=class extends a{async command(r,p,c,y,l){let u={environment:r.environment,force:r.force,noColor:r["no-color"],password:r.password,path:r.path,store:r.store,theme:n("creative"),unpublished:!0,listing:r.listing};t("theme-command:share"),await h(u,p,c,l),t("theme-command:share")}};d=e;e.summary="Creates a shareable, unpublished, and new theme on your theme library with a randomized name.";e.descriptionWithMarkdown=`Uploads your theme as a new, unpublished theme in your theme library. The theme is given a randomized name.
|
|
2
|
+
|
|
3
|
+
This command returns a [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with others.`;e.description=d.descriptionWithoutMarkdown();e.flags={...s,...m,force:o.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"}),listing:o.Flags.string({description:"The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.",env:"SHOPIFY_FLAG_LISTING"})};e.multiEnvironmentsFlags=["store","password","path"];var I=e;export{I as a};
|