@shopify/cli 0.0.0-snapshot-20260722190906 → 0.0.0-snapshot-20260722210655
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/dist/{analytics-CDAYWXD5.js → analytics-JBPJLL57.js} +1 -1
- package/dist/analytics-QVTQTZFT.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-GUXXVO66.js → chunk-22YTDD56.js} +1 -1
- package/dist/{chunk-AXXDNFZC.js → chunk-2CMSXRZ5.js} +1 -1
- package/dist/{chunk-VNMMVZL4.js → chunk-2FNJZPYC.js} +2 -2
- package/dist/{chunk-BAG27DQB.js → chunk-2OBG4WT7.js} +1 -1
- package/dist/{chunk-X324F4FS.js → chunk-2RLFO4KD.js} +1 -1
- package/dist/{chunk-6S4LWAKY.js → chunk-2VVXGQ36.js} +1 -1
- package/dist/{chunk-UFBY4IJ2.js → chunk-32KQUYFF.js} +1 -1
- package/dist/{chunk-AOZJVY2C.js → chunk-33AVVFWW.js} +1 -1
- package/dist/{chunk-J3P2JYNE.js → chunk-34CCAMTT.js} +1 -1
- package/dist/{chunk-XLD2SPNN.js → chunk-35Z5TIZM.js} +1 -1
- package/dist/{chunk-RZPQK4OF.js → chunk-3GPUBV4D.js} +1 -1
- package/dist/{chunk-4IHADX7W.js → chunk-3GQ6AVHU.js} +1 -1
- package/dist/{chunk-DBZXDUAL.js → chunk-3I6ZVKZ2.js} +1 -1
- package/dist/{chunk-VP3PA6DV.js → chunk-3PFIBTES.js} +3 -3
- package/dist/{chunk-2DXH72MI.js → chunk-3R45SEUK.js} +1 -1
- package/dist/{chunk-NTLYH6PR.js → chunk-3RUWUOIR.js} +1 -1
- package/dist/{chunk-EIEMLLMV.js → chunk-3XBPV64S.js} +1 -1
- package/dist/{chunk-S56IA3NZ.js → chunk-4GWHZ4RW.js} +1 -1
- package/dist/{chunk-P5GRGEW4.js → chunk-4NSHAMD3.js} +1 -1
- package/dist/{chunk-67MWN74X.js → chunk-5EDRU7YU.js} +2 -2
- package/dist/{chunk-6YQTYIZ5.js → chunk-5HGRHX2Z.js} +1 -1
- package/dist/{chunk-LCE3TAI7.js → chunk-5N6YKJLU.js} +1 -1
- package/dist/{chunk-4COZ6ZCQ.js → chunk-5RMFBXP6.js} +1 -1
- package/dist/{chunk-MGMUHABT.js → chunk-5VKFEYZK.js} +1 -1
- package/dist/{chunk-6T3VKU4R.js → chunk-5Y33JTFD.js} +1 -1
- package/dist/{chunk-XJQHJ3OJ.js → chunk-65H3LZJA.js} +1 -1
- package/dist/{chunk-PYD6H55X.js → chunk-6CZ7WGE2.js} +1 -1
- package/dist/{chunk-OPPBTECX.js → chunk-6NRRHHK5.js} +1 -1
- package/dist/{chunk-2PEMBCOR.js → chunk-6SVMZEJO.js} +1 -1
- package/dist/{chunk-C7D2P7VE.js → chunk-74DZVIJF.js} +1 -1
- package/dist/{chunk-OQPDE63R.js → chunk-A35F74KC.js} +1 -1
- package/dist/{chunk-LAOIEVSU.js → chunk-AK4NPOQG.js} +1 -1
- package/dist/{chunk-IAZMS3IK.js → chunk-ALKT4HX7.js} +1 -1
- package/dist/{chunk-XHFQ6LOF.js → chunk-AMLHR2HO.js} +1 -1
- package/dist/{chunk-U4ROOL5O.js → chunk-AROEKWUX.js} +1 -1
- package/dist/{chunk-LSZF6IW6.js → chunk-B3XKHB4G.js} +1 -1
- package/dist/{chunk-ZG4255HY.js → chunk-BKMZCB6M.js} +1 -1
- package/dist/{chunk-BJLBQAYG.js → chunk-BPRY3O4N.js} +1 -1
- package/dist/{chunk-DOAKDW2X.js → chunk-BQ2752RO.js} +1 -1
- package/dist/{chunk-KKR23IH2.js → chunk-CFXL555E.js} +1 -1
- package/dist/{chunk-7ZLFWJYO.js → chunk-CFZVZFVH.js} +1 -1
- package/dist/{chunk-VAMY76ON.js → chunk-CNOGRHAB.js} +1 -1
- package/dist/{chunk-6SK3JXPL.js → chunk-CT5MMCRM.js} +1 -1
- package/dist/{chunk-YQ4OHBET.js → chunk-DC3JYNAG.js} +1 -1
- package/dist/{chunk-EDZ3YWOD.js → chunk-E7Z7KYBR.js} +1 -1
- package/dist/{chunk-7UMDQ3ZG.js → chunk-EI6ZQXTF.js} +1 -1
- package/dist/{chunk-EXRSWJ5H.js → chunk-EIEHPIWJ.js} +1 -1
- package/dist/{chunk-SZY56H6W.js → chunk-EL5U7452.js} +1 -1
- package/dist/{chunk-BEN4UG4L.js → chunk-FDQNY7RF.js} +1 -1
- package/dist/{chunk-MQDJJICB.js → chunk-FFC42T6R.js} +1 -1
- package/dist/{chunk-GWNAVCHY.js → chunk-FOQ2RDEI.js} +1 -1
- package/dist/{chunk-B6G644TV.js → chunk-FS37ZPWQ.js} +1 -1
- package/dist/{chunk-2RJFPJ7A.js → chunk-FS4HIL62.js} +1 -1
- package/dist/{chunk-NDBM7LRH.js → chunk-FVQG4KLI.js} +1 -1
- package/dist/{chunk-MX4LFIME.js → chunk-FW732EHN.js} +1 -1
- package/dist/chunk-G3CPHVML.js +1 -0
- package/dist/{chunk-CTEETGYW.js → chunk-GAUJKBLY.js} +1 -1
- package/dist/{chunk-FDWA7JDW.js → chunk-GJGKVHUR.js} +1 -1
- package/dist/{chunk-TBU3OWTQ.js → chunk-GVHVEYNG.js} +1 -1
- package/dist/{chunk-S6U77A5P.js → chunk-GWUDVP3Q.js} +1 -1
- package/dist/{chunk-NAJQU2AY.js → chunk-H2Z3SST2.js} +1 -1
- package/dist/{chunk-YLK2AI7U.js → chunk-H3QSHKNT.js} +1 -1
- package/dist/{chunk-BJCRXR56.js → chunk-HFGB7XAM.js} +1 -1
- package/dist/{chunk-XD7NZHSK.js → chunk-HG5QVQ2T.js} +1 -1
- package/dist/{chunk-JK63EUM5.js → chunk-HJH672U6.js} +1 -1
- package/dist/{chunk-C7RESSLY.js → chunk-HPH7WWMW.js} +1 -1
- package/dist/{chunk-FIXLZ6WB.js → chunk-HS7TCC4I.js} +1 -1
- package/dist/{chunk-Z6XAKBEX.js → chunk-HXJ7HJFS.js} +1 -1
- package/dist/{chunk-U5EOE3DT.js → chunk-I7QJGHS6.js} +1 -1
- package/dist/{chunk-AQ6NXOX6.js → chunk-IDMJWVJC.js} +1 -1
- package/dist/{chunk-ELC7ATKB.js → chunk-IDRP7BXW.js} +1 -1
- package/dist/{chunk-NTE2CLJ6.js → chunk-IKP2EM5F.js} +1 -1
- package/dist/{chunk-TDSOYZI3.js → chunk-IP2ZMDG4.js} +1 -1
- package/dist/{chunk-X3BIUZFH.js → chunk-IPKYIHDV.js} +1 -1
- package/dist/{chunk-FSAECCAG.js → chunk-ISVXQQ4E.js} +1 -1
- package/dist/{chunk-HUZJXCY4.js → chunk-IV3S4JU6.js} +1 -1
- package/dist/{chunk-HDC7GGTP.js → chunk-IZCDEDIM.js} +1 -1
- package/dist/{chunk-GBTY5THR.js → chunk-J2JMKTPR.js} +1 -1
- package/dist/{chunk-CBEKGTMO.js → chunk-J5D222UG.js} +1 -1
- package/dist/{chunk-RLXN7RR4.js → chunk-JBIXZWT6.js} +1 -1
- package/dist/{chunk-PQAZNEQ4.js → chunk-JNAAHGJ6.js} +1 -1
- package/dist/{chunk-X3EISCDF.js → chunk-KHOW6SXW.js} +1 -1
- package/dist/{chunk-UHI4NMIL.js → chunk-KNLPWHHJ.js} +3 -3
- package/dist/{chunk-QCK3CBEG.js → chunk-L6C3DLKN.js} +1 -1
- package/dist/{chunk-B2WYFLOD.js → chunk-L6VQZJM4.js} +1 -1
- package/dist/{chunk-54NHTRQI.js → chunk-LANGOUPS.js} +1 -1
- package/dist/{chunk-PKBGOPEK.js → chunk-LX3NHWCT.js} +1 -1
- package/dist/{chunk-XQGRKXWZ.js → chunk-LZO2JTZS.js} +1 -1
- package/dist/{chunk-BSIAJUNS.js → chunk-M3FOYFPN.js} +1 -1
- package/dist/{chunk-5ZBT5PFX.js → chunk-MH6UDGGS.js} +1 -1
- package/dist/{chunk-C4BN2RVQ.js → chunk-MSDNBGRH.js} +1 -1
- package/dist/{chunk-SH3WYVVB.js → chunk-MTGARKCQ.js} +1 -1
- package/dist/{chunk-AYIXAB2S.js → chunk-MXATGPGZ.js} +1 -1
- package/dist/{chunk-O3BC33IK.js → chunk-N2UVYELM.js} +1 -1
- package/dist/{chunk-PHWCCRTF.js → chunk-N54QOQ2V.js} +1 -1
- package/dist/{chunk-3SANRXLX.js → chunk-NDVET7BL.js} +1 -1
- package/dist/{chunk-OJ4M2CJM.js → chunk-NIQWXTKA.js} +1 -1
- package/dist/{chunk-4Z3NOOAC.js → chunk-NUCUZBO3.js} +1 -1
- package/dist/{chunk-C5IUWPRN.js → chunk-O5FUKS5D.js} +1 -1
- package/dist/{chunk-OUPJTPTH.js → chunk-O6BUPYXH.js} +2 -2
- package/dist/{chunk-SEME74TB.js → chunk-O7HL63YP.js} +1 -1
- package/dist/{chunk-ZLMC33FE.js → chunk-OLQN2OBC.js} +1 -1
- package/dist/{chunk-BDOXVQSL.js → chunk-OM3YN7ZK.js} +1 -1
- package/dist/{chunk-YU2JTVM2.js → chunk-ONCEFPYP.js} +1 -1
- package/dist/{chunk-ZX36Y46Q.js → chunk-OPHCAOPB.js} +1 -1
- package/dist/{chunk-REQPTZOU.js → chunk-OQ6WYWG4.js} +3 -3
- package/dist/{chunk-SW4MYG6X.js → chunk-OYOTLGGD.js} +1 -1
- package/dist/{chunk-N6CEKL2T.js → chunk-P4LA3M5S.js} +1 -1
- package/dist/{chunk-AXJRLUTS.js → chunk-P5KLFBCI.js} +1 -1
- package/dist/{chunk-PEC3D242.js → chunk-PNCF5LNZ.js} +1 -1
- package/dist/{chunk-O5V6OEPI.js → chunk-PNYIQOOE.js} +1 -1
- package/dist/{chunk-RM3X5Z4U.js → chunk-POYWH3PD.js} +1 -1
- package/dist/{chunk-2ECP5WXO.js → chunk-PPHJ4F2Z.js} +1 -1
- package/dist/{chunk-YEFFCLHX.js → chunk-Q37I33P7.js} +1 -1
- package/dist/{chunk-JQSXYJQH.js → chunk-Q3DRVTVJ.js} +1 -1
- package/dist/{chunk-TIO5BQ5N.js → chunk-QAMPDFZB.js} +1 -1
- package/dist/{chunk-RFG3WS2K.js → chunk-R56CBH7G.js} +1 -1
- package/dist/{chunk-GZJCF3TC.js → chunk-ROBYXQMW.js} +1 -1
- package/dist/{chunk-HVZNEOXS.js → chunk-RUV5AE3N.js} +1 -1
- package/dist/chunk-RXO77IC5.js +1 -0
- package/dist/{chunk-TFR5G7OX.js → chunk-SACH2YSZ.js} +1 -1
- package/dist/{chunk-TA6MIE6F.js → chunk-SH5VEQ7F.js} +1 -1
- package/dist/{chunk-CEDQRZEQ.js → chunk-SNK55FY2.js} +1 -1
- package/dist/{chunk-67HZVVWI.js → chunk-SP7NSQ6G.js} +1 -1
- package/dist/{chunk-WNPRFDZX.js → chunk-SQVJGTTD.js} +2 -2
- package/dist/{chunk-BFPZJCA7.js → chunk-SUOXR2CE.js} +1 -1
- package/dist/{chunk-EIIBCSJT.js → chunk-SW3DP3GU.js} +1 -1
- package/dist/{chunk-EWO2KZV5.js → chunk-SXWAECCX.js} +1 -1
- package/dist/{chunk-LKTP7WTV.js → chunk-SY3LXLT2.js} +1 -1
- package/dist/{chunk-M3QGQP74.js → chunk-UA2432YR.js} +1 -1
- package/dist/{chunk-B7I4QETW.js → chunk-UMMEUYHM.js} +1 -1
- package/dist/{chunk-AD74MYJN.js → chunk-UZR7JB5B.js} +1 -1
- package/dist/{chunk-IGIYN3V4.js → chunk-V4CPWXJP.js} +1 -1
- package/dist/{chunk-K6G2EZGV.js → chunk-VBL7DLY7.js} +1 -1
- package/dist/{chunk-DNUTKXN2.js → chunk-VFU5YYTM.js} +1 -1
- package/dist/{chunk-FQA2F2XJ.js → chunk-VQ44LFBY.js} +1 -1
- package/dist/{chunk-VJIB5EKO.js → chunk-VSPM4VES.js} +1 -1
- package/dist/{chunk-B57QEQBY.js → chunk-VURVVLVE.js} +1 -1
- package/dist/{chunk-P4QZ7WOH.js → chunk-W2RZY64W.js} +1 -1
- package/dist/{chunk-HEP7LOAV.js → chunk-W6BBFBOM.js} +1 -1
- package/dist/{chunk-I7BYVLDU.js → chunk-W6KRZTDH.js} +1 -1
- package/dist/{chunk-4ZQTYDNB.js → chunk-WFCP2AG5.js} +1 -1
- package/dist/{chunk-P427M44L.js → chunk-WKJNCJUV.js} +1 -1
- package/dist/chunk-WMKVFUMY.js +1 -0
- package/dist/{chunk-F4GFFJEQ.js → chunk-WYT437LJ.js} +1 -1
- package/dist/{chunk-HDE4C5VI.js → chunk-X2NVFYY6.js} +1 -1
- package/dist/chunk-X2ZCC772.js +1 -0
- package/dist/{chunk-UBZ7LRWO.js → chunk-X4JRQETX.js} +1 -1
- package/dist/{chunk-XC2X34PK.js → chunk-X5GZF33W.js} +1 -1
- package/dist/{chunk-7D6UVALL.js → chunk-XBFXB6S6.js} +1 -1
- package/dist/{chunk-ZCMXP6ZW.js → chunk-XEHMXJ5J.js} +1 -1
- package/dist/{chunk-CUWFMJYZ.js → chunk-XGJH3HBA.js} +1 -1
- package/dist/{chunk-LMLBN3DB.js → chunk-XKMLKEYX.js} +1 -1
- package/dist/{chunk-6NJ7C5DF.js → chunk-XYV4QXQT.js} +1 -1
- package/dist/{chunk-ITL4KB5G.js → chunk-YKAMTVJM.js} +1 -1
- package/dist/{chunk-ZZN4WRWZ.js → chunk-YZQYDTO7.js} +1 -1
- package/dist/{chunk-YLSBNV6G.js → chunk-ZDKGQCIZ.js} +1 -1
- package/dist/{chunk-GPF56HPM.js → chunk-ZKIIMXKC.js} +1 -1
- package/dist/{chunk-RELON3IF.js → chunk-ZKNONN2F.js} +1 -1
- package/dist/{chunk-ZHVFR23B.js → chunk-ZZ5M5IMF.js} +1 -1
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- 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 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- 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 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- 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 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- 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 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- 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/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.js +1 -1
- 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/skill/install.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- 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 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/validate/components.js +1 -1
- package/dist/cli/commands/validate/functions.js +1 -1
- package/dist/cli/commands/validate/graphql.js +1 -1
- package/dist/cli/commands/validate/theme.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-OHJSRXSL.js +1 -0
- package/dist/{deprecations-K6GECE76.js → deprecations-SA4HEVBI.js} +1 -1
- package/dist/{dist-ZTEUCMI5.js → dist-MIUGJGUW.js} +1 -1
- package/dist/dist-XVWDWM2Y.js +1 -0
- package/dist/{environments-ZDUNX7L4.js → environments-LDSGQHXC.js} +1 -1
- package/dist/{error-GGW3G47B.js → error-YY774ESQ.js} +1 -1
- package/dist/{error-handler-JTALOJ5N.js → error-handler-QHCOZUC7.js} +1 -1
- package/dist/{fs-JBSOQ2AU.js → fs-EIM4AORY.js} +1 -1
- 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/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/index.js +1 -1
- package/dist/{is-global-L7OWSCP5.js → is-global-USYUXR55.js} +1 -1
- package/dist/{local-OOLA5THA.js → local-INRMOHAI.js} +1 -1
- package/dist/{local-storage-VXGHOQKX.js → local-storage-7THURD3W.js} +1 -1
- package/dist/{metadata-V4D6FTBS.js → metadata-WJ637XA2.js} +1 -1
- package/dist/{node-package-manager-EDPK5PL6.js → node-package-manager-4X2YQGFC.js} +1 -1
- package/dist/{notifications-system-MBSJKSNZ.js → notifications-system-ZSZWUJIZ.js} +1 -1
- package/dist/{output-QVUM5IYS.js → output-CLCX5WU7.js} +1 -1
- package/dist/skills-OXV2TD42.js +1 -0
- package/dist/{system-B76AUER2.js → system-J4OPHQAQ.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-ENHCMZJZ.js → ui-ZC5QZT4J.js} +1 -1
- package/dist/upgrade-VSILBOCY.js +1 -0
- package/dist/{version-VXADDZFR.js → version-EYLYG4JK.js} +1 -1
- package/dist/version-FEVNX3F6.js +1 -0
- package/dist/{workerd-4O3TCHAO.js → workerd-VC3MCYDV.js} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -9
- package/bin/postinstall.js +0 -14
- package/dist/analytics-Q4RKFOXN.js +0 -1
- package/dist/chunk-24YSAAPP.js +0 -1
- package/dist/chunk-2POI27PW.js +0 -1
- package/dist/chunk-AGWNS3XW.js +0 -1
- package/dist/chunk-EB2SLRLG.js +0 -1
- package/dist/conf-store-WHIZYNW7.js +0 -1
- package/dist/dist-CNXOMJ4W.js +0 -1
- package/dist/upgrade-NCYY4Q7D.js +0 -1
- package/dist/version-E6Y3YQZ3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as B,j as C,m as P}from"./chunk-
|
|
1
|
+
import{a as B,j as C,m as P}from"./chunk-GVHVEYNG.js";import{e as U,f as _}from"./chunk-HS7TCC4I.js";import{e as g}from"./chunk-OYOTLGGD.js";import{l as v,m as w}from"./chunk-VQ44LFBY.js";import{xa as E}from"./chunk-OQ6WYWG4.js";import{Pb as m}from"./chunk-KNLPWHHJ.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var $=20,J=1024*1024,A=2;function oe(t,e,r,s,o={},l){let n=B(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=R(t,e,n),h=Promise.all([s.ready(),u]).then(()=>q(n,s,t,e,i)),p=h.then(a=>a.promise).then(()=>j(n,s,t,e,o,i)),k=o?.deferPartialWork?u:p.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([u,h.then(a=>a.promise),p.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:d}=await h,f=o.multiEnvironment?4e3:1e3;await g(b({promise:d,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment);let{progress:y,promise:F}=await p;await g(b({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(y)}`,updateInterval:f}),l?.stderr,o?.multiEnvironment),await g([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),H(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&o()}})};return o(),s}function j(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=L(t,e),i=x(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let p=0;p<i.length;p+=$){let k=i.slice(p,p+$),a=v(r.id,k.map(d=>d.key),s).then(d=>{d.forEach(f=>{if(l.set(f.key,f),!f.success){let y=f.errors?.asset?.map(F=>`-${F}`).join(`
|
|
2
2
|
`);_(f.key,"delete")(new Error(`Failed to delete ${f.key}: ${y}`))}}),c.current+=k.length});u.push(a)}let h=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:h}}function L(t,e){let s=e.applyIgnoreFilters(t).filter(o=>!e.files.has(o.key));return m(`Files to be deleted:
|
|
3
3
|
${s.map(o=>`-${o.key}`).join(`
|
|
4
4
|
`)}`),s}function x(t){let e=P(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configSchemaFile,...e.staticAssetFiles]}var D=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function R(t,e,r){let s=new Set(r.map(l=>l.key)),o=D.filter(({key:l})=>!s.has(l));o.length>0&&await w(t.id,o,e)}function q(t,e,r,s,o){let l=I(e,t);e.unsyncedFileKeys.clear(),l.forEach(a=>e.unsyncedFileKeys.add(a.key));let{independentFiles:n,dependentFiles:i}=z(l),c={current:0,total:l.length},u=a=>a.length===0?Promise.resolve():Promise.all(S(a).map(d=>N(d,e,s,r.id,o).then(()=>{c.current+=d.length,d.forEach(f=>e.unsyncedFileKeys.delete(f.key))}))).then(()=>{}),h=i.reduce((a,d)=>a.then(()=>u(d)),Promise.resolve()),p=Promise.resolve().then(()=>u(n.flat())),k=Promise.all([h,p]).then(()=>{c.current=c.total});return{progress:c,promise:k}}function I(t,e){let r=K(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-ONCEFPYP.js";import{a as c,b as v}from"./chunk-STJ3LWFL.js";import{a as y}from"./chunk-XEHMXJ5J.js";import{a as w}from"./chunk-OYOTLGGD.js";import{p as d,v as f}from"./chunk-5VKFEYZK.js";import{b as s}from"./chunk-BPRY3O4N.js";import{J as h,u as p}from"./chunk-SQVJGTTD.js";import{a as O}from"./chunk-M5GXA5W4.js";import{e as I,g as m}from"./chunk-VKWPEFWQ.js";m();m();async function F(o,t){let i=new u(o),E=(await(t.development?i.find():i.fetch()))?.id,n=await y(o,{header:"Select a theme to open",filter:{live:t.live,theme:t.development?`${E}`:t.theme}}),l=c(n,o),a=v(n,o);p({body:["Preview information for theme",...w(n),`
|
|
2
2
|
|
|
3
3
|
`,{list:{items:[{link:{label:"Preview your theme",url:l}},{link:{label:"Customize your theme at the theme editor",url:a}}]}}]}),t.editor?await h(a):await h(l)}var r=I(O(),1);var g,e=class extends f{async command(t,i){await F(i,t)}};g=e;e.summary="Opens the preview of your remote theme.";e.descriptionWithMarkdown=`Returns links that let you preview the specified theme. The following links are returned:
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as S,c as A,d as R}from"./chunk-
|
|
1
|
+
import{b as S,c as A,d as R}from"./chunk-BQ2752RO.js";import{a as N}from"./chunk-G3CPHVML.js";import{a as P}from"./chunk-33AVVFWW.js";import{b as y,c as x,xa as T}from"./chunk-LANGOUPS.js";import{b,c as g}from"./chunk-BPRY3O4N.js";import{u as h}from"./chunk-SQVJGTTD.js";import{Fb as l,Hb as m,Lb as d}from"./chunk-KNLPWHHJ.js";import{d as f}from"./chunk-773TIA5M.js";import{g as p}from"./chunk-VKWPEFWQ.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
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
3
|
TARGETING
|
|
4
4
|
`,body:{tabularData:t}}}function v(n,t){return{title:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p}from"./chunk-GPF56HPM.js";import{ua as b,va as k,xa as s}from"./chunk-REQPTZOU.js";import{F as w}from"./chunk-WNPRFDZX.js";import{f as E,m as N}from"./chunk-OUPJTPTH.js";import{Pb as V,S as _}from"./chunk-UHI4NMIL.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ie="live",ae="unpublished";function te(e){return e.role===g}async function de(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function se(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",c={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function sn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await p({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),k(i),V(`Error fetching theme with ID: ${e}`)}}async function un(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await T({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await T({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw k(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function cn(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await T({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:c});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw k(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function pn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await T({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let u=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async u=>{let{attachment:h,value:v}=await J(u.body);return{attachment:h,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function vn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await p({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:c});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:h}=o;u&&u.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(k(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function Nn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);b("theme-api:upload-files");let o=await K(e,m,a);b("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return p({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:c})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),k(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function hn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await T({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw k(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function fn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await p({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:c});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let u=d.userErrors.map(h=>h.message).join(", ");throw k(new N(u))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function yn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await p({query:O,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function Sn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await p({query:x,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),!0}async function Fn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await p({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:c,responseOptions:{onResponse:u=>{i=u.headers.get("x-request-id")??void 0}}});if(!t)return k("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Tn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await p({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await p({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw k(new N(e))}async function T(e){try{return await p(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw k(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:Z(i)}function Z(e){return e.trim().replace(/\.$/,"").replace(/^The user needs\s+/i,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function J(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw k(new N(`Error downloading content from URL: ${e.url}`))}}}export{se as a,g as b,ie as c,ae as d,te as e,de as f,sn as g,un as h,kn as i,cn as j,pn as k,vn as l,Nn as m,hn as n,fn as o,yn as p,Sn as q,Fn as r,Tn as s,bn as t};
|
|
1
|
+
import{b as p}from"./chunk-ZKIIMXKC.js";import{ua as b,va as k,xa as s}from"./chunk-OQ6WYWG4.js";import{F as w}from"./chunk-SQVJGTTD.js";import{f as E,m as N}from"./chunk-O6BUPYXH.js";import{Pb as V,S as _}from"./chunk-KNLPWHHJ.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ie="live",ae="unpublished";function te(e){return e.role===g}async function de(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function se(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",c={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function sn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await p({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),k(i),V(`Error fetching theme with ID: ${e}`)}}async function un(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await T({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await T({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw k(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function cn(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await T({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:c});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw k(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function pn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await T({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let u=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async u=>{let{attachment:h,value:v}=await J(u.body);return{attachment:h,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function vn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await p({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:c});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:h}=o;u&&u.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(k(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function Nn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);b("theme-api:upload-files");let o=await K(e,m,a);b("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return p({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:c})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),k(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function hn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await T({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw k(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function fn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await p({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:c});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let u=d.userErrors.map(h=>h.message).join(", ");throw k(new N(u))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function yn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await p({query:O,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function Sn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await p({query:x,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),!0}async function Fn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await p({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:c,responseOptions:{onResponse:u=>{i=u.headers.get("x-request-id")??void 0}}});if(!t)return k("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Tn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await p({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await p({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw k(new N(e))}async function T(e){try{return await p(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw k(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:Z(i)}function Z(e){return e.trim().replace(/\.$/,"").replace(/^The user needs\s+/i,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function J(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw k(new N(`Error downloading content from URL: ${e.url}`))}}}export{se as a,g as b,ie as c,ae as d,te as e,de as f,sn as g,un as h,kn as i,cn as j,pn as k,vn as l,Nn as m,hn as n,fn as o,yn as p,Sn as q,Fn as r,Tn as s,bn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as w}from"./chunk-
|
|
1
|
+
import{a as h,b as w}from"./chunk-M3FOYFPN.js";import{m as f}from"./chunk-OQ6WYWG4.js";import{P as d}from"./chunk-SQVJGTTD.js";import{m as i}from"./chunk-O6BUPYXH.js";import{Ga as m,na as p}from"./chunk-KNLPWHHJ.js";import{d as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as gI,e as nA,f as mI,h as oA,l as y7,n as Bu,s as $5,u as iA,v as lA,w as cA}from"./chunk-Q7BOSHWX.js";import{a as fI}from"./chunk-
|
|
1
|
+
import{c as gI,e as nA,f as mI,h as oA,l as y7,n as Bu,s as $5,u as iA,v as lA,w as cA}from"./chunk-Q7BOSHWX.js";import{a as fI}from"./chunk-I7QJGHS6.js";import{a as aA}from"./chunk-LANGOUPS.js";import{c as tA,e as rA}from"./chunk-ZKIIMXKC.js";import{S as pCe,m as R4,y as tf,z as vI}from"./chunk-OQ6WYWG4.js";import{g as $F}from"./chunk-SQVJGTTD.js";import{a as jF}from"./chunk-UA2432YR.js";import{d as mCe,m as eA}from"./chunk-O6BUPYXH.js";import{Pb as b7,eb as b}from"./chunk-KNLPWHHJ.js";import{a as j5,c as m,e as ps,g as o}from"./chunk-VKWPEFWQ.js";var uA=m(Vi=>{"use strict";o();var bCe=b();function sA(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e1(){}var Gi={d:{f:e1,r:function(){throw Error(sA(522))},D:e1,C:e1,L:e1,m:e1,X:e1,S:e1,M:e1},p:0,findDOMNode:null},yCe=Symbol.for("react.portal");function ICe(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yCe,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}var rf=bCe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function k4(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Vi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gi;Vi.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(sA(299));return ICe(e,t,null,r)};Vi.flushSync=function(e){var t=rf.T,r=Gi.p;try{if(rf.T=null,Gi.p=2,e)return e()}finally{rf.T=t,Gi.p=r,Gi.d.f()}};Vi.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Gi.d.C(e,t))};Vi.prefetchDNS=function(e){typeof e=="string"&&Gi.d.D(e)};Vi.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,a=k4(r,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?Gi.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:i}):r==="script"&&Gi.d.X(e,{crossOrigin:a,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Vi.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=k4(t.as,t.crossOrigin);Gi.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Gi.d.M(e)};Vi.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,a=k4(r,t.crossOrigin);Gi.d.L(e,r,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Vi.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=k4(t.as,t.crossOrigin);Gi.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Gi.d.m(e)};Vi.requestFormReset=function(e){Gi.d.r(e)};Vi.unstable_batchedUpdates=function(e,t){return e(t)};Vi.useFormState=function(e,t,r){return rf.H.useFormState(e,t,r)};Vi.useFormStatus=function(){return rf.H.useHostTransitionStatus()};Vi.version="19.2.4"});var dA=m(Yi=>{"use strict";o();process.env.NODE_ENV!=="production"&&(function(){function e(){}function t(y){return""+y}function r(y,S,E){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(w);var M=!1}catch{M=!0}return M&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object"),t(w)),{$$typeof:f,key:w==null?null:""+w,children:y,containerInfo:S,implementation:E}}function a(y,S){if(y==="font")return"";if(typeof S=="string")return S==="use-credentials"?S:""}function n(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":'something with type "'+typeof y+'"'}function i(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":typeof y=="string"?JSON.stringify(y):typeof y=="number"?"`"+y+"`":'something with type "'+typeof y+'"'}function u(){var y=I.H;return y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
2
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
3
|
2. You might be breaking the Rules of Hooks
|
|
4
4
|
3. You might have more than one copy of React in the same app
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as ye}from"./chunk-
|
|
1
|
+
import{b as ye}from"./chunk-ROBYXQMW.js";import{a as ue,c as he}from"./chunk-AK4NPOQG.js";import{b as de}from"./chunk-I7QJGHS6.js";import{a as Fe}from"./chunk-X2ZCC772.js";import{D as be,I as ve,K as Pe,M as Ae,Y as Ce,_ as xe,h as we,ta as Re,wa as Le}from"./chunk-LANGOUPS.js";import{Z as ke,ca as Ie,o as ge}from"./chunk-FDQNY7RF.js";import{b as fe}from"./chunk-BPRY3O4N.js";import{B as oe,D as re,E as ie,f as R,g as ee,i as te,p as ae}from"./chunk-SH5VEQ7F.js";import{D as ce,f as ne,u as pe,v as le,z as S}from"./chunk-SQVJGTTD.js";import{b as Q}from"./chunk-JNAAHGJ6.js";import{a as M}from"./chunk-UA2432YR.js";import{d as se}from"./chunk-4NSHAMD3.js";import{m}from"./chunk-O6BUPYXH.js";import{$a as Z,Ab as J,Ca as I,Fb as h,Gb as L,Hb as g,Ja as K,Oa as B,Ta as C,Ua as x,Va as W,Wa as q,_ as H,ka as O,ma as V,sa as _,ua as $,wa as Y,zb as X}from"./chunk-KNLPWHHJ.js";import{e as me}from"./chunk-E7Z7KYBR.js";import{d as p,e as k,f as U,p as D,q as z}from"./chunk-773TIA5M.js";import{a as ze}from"./chunk-M5GXA5W4.js";import{e as De,g as c}from"./chunk-VKWPEFWQ.js";c();c();var b={reactRouter:{url:"https://github.com/Shopify/shopify-app-template-react-router",label:"Build a React Router app (recommended)",visible:!0,branches:{prompt:"For your React Router template, which language do you want?",options:{javascript:{branch:"javascript-cli",label:"JavaScript"},typescript:{branch:"main-cli",label:"TypeScript"}}}},remix:{url:"https://github.com/Shopify/shopify-app-template-remix",label:"Build a Remix app",visible:!1,branches:{prompt:"For your Remix template, which language do you want?",options:{javascript:{branch:"javascript",label:"JavaScript"},typescript:{branch:"main",label:"TypeScript"}}}},none:{url:"https://github.com/Shopify/shopify-app-template-extension-only",label:"Build an extension-only app",visible:!0},node:{url:"https://github.com/Shopify/shopify-app-template-node",visible:!1},ruby:{url:"https://github.com/Shopify/shopify-app-template-ruby",visible:!1}},G=Object.keys(b),F=G.filter(e=>b[e].visible),He=["reactRouter","none"],Oe=async e=>{let t=e.template,a=e.flavor,r={template:b.reactRouter.url};t??(t=await S({choices:He.map(i=>({label:b[i].label||i,value:i})),message:"Get started building your app:",defaultValue:G.find(i=>b[i].url===r.template)}));let o={...e,template:t,templateType:T(t)?t:"custom",globalCLIResult:{install:!1,alreadyInstalled:!1}},n,s;if(o.templateType!=="custom"){let i=b[o.templateType];n=i.url,i.branches&&(a?s=i.branches.options[a]?.branch:s=await S({message:i.branches.prompt||"Choose a flavor:",choices:Object.entries(i.branches.options).map(([f,u])=>({value:u.branch,label:u.label}))}))}return s&&(n=`${n}#${s}`),o.template=n||o.template||r.template,o.globalCLIResult=await J(),o},Te=Oe;function T(e){return G.includes(e)}c();c();import{platform as Ve}from"os";async function _e({packageJSON:e,local:t,useGlobalCLI:a}){if(e.dependencies=e.dependencies??{},a?delete e.dependencies["@shopify/cli"]:e.dependencies["@shopify/cli"]=M,delete e.dependencies["@shopify/app"],t){let r=await Ye("cli");e.dependencies["@shopify/cli"]=r;let o={"@shopify/cli":r};e.overrides=e.overrides?{...e.overrides,...o}:o,e.resolutions=e.resolutions?{...e.resolutions,...o}:o}return e}async function Ye(e){return`file:${await Z(`packages/${e}`,{type:"directory",cwd:D(import.meta.url)})}`}async function $e({from:e,packageManager:t}){let a=Ve()==="win32"&&t==="yarn"?["--network-concurrency","1"]:[];return ae({directory:k(e),packageManager:t,args:a})}c();async function E(e,t){let r=(await q([p(e,"**",".git"),p(e,"**",".github"),p(e,"**",".gitmodules"),p(e,"**",".cli-liquid-bypass"),p(e,"LICENSE*"),p(e,"**","frontend/LICENSE*"),p(e,"package.json.cli2")],{dot:!0,onlyFiles:!1,onlyDirectories:!1,ignore:["**/node_modules/**"]})).map(s=>I(s,{force:!0})),o=new Set(ee[t]),n=R.filter(s=>!o.has(s)).map(s=>{let i=p(e,s);if(x(i))return K(i)});return Promise.all([...r,...n])}async function Ke(e){let t=e.packageManager,a=H(e.name),r=p(e.directory,a),o=ye(e.template);await Se(r,a),await Be(r),pe({body:["Initializing project with",{command:t},`
|
|
2
2
|
Use the`,{command:"--package-manager"},"flag to select a different package manager."]}),await O(async i=>{let f=p(i,"download"),u=o.filePath?p(f,o.filePath):f,d=p(i,"app"),A=o.branch?`${o.baseURL}#${o.branch}`:o.baseURL;await Y(f);let w=[{title:`Downloading template from ${A}`,task:async()=>{await he({repoUrl:A,destination:f,shallow:!0})}}];w.push({title:"Parsing liquid",task:async()=>{await de(u,d,{dependency_manager:t,app_name:e.name})}},{title:"Updating package.json",task:async()=>{let l=(await oe(d)).content;l.name=a,l.author=await ne()??"",l.private=!0;let v=["extensions/*"].concat(We(d));switch(t){case"npm":case"yarn":case"bun":l.workspaces=v;break;case"pnpm":{await qe(d,v),await _(p(d,".npmrc"),`auto-install-peers=true
|
|
3
3
|
`);break}case"homebrew":case"unknown":throw new te}await _e({packageJSON:l,local:e.local,directory:d,useGlobalCLI:e.useGlobalCLI}),await re(d,l)}}),e.postCloneActions.removeLockfilesFromGitignore&&w.push({title:"Removing lockfiles from .gitignore",task:async()=>{let l=p(d,".gitignore");if(await C(l)){let v=await V(l);R.forEach(Me=>{let Ue=new RegExp(`^${Me.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`,"gm");v=v.replace(Ue,"")}),await $(l,v.trim())}}}),await me()&&w.push({title:"[Shopifolks-only] Configuring the project's NPM registry",task:async()=>{let l=p(d,".npmrc");await _(l,`@shopify:registry=https://registry.npmjs.org
|
|
4
4
|
`)}});let N=!1;w.push({title:"Preparing project directory",task:async()=>{await Se(r,a),N=!0,await B(d,r)}}),w.push({title:`Installing dependencies with ${t}`,task:async()=>{await $e({from:r,packageManager:t})}},{title:"Cleaning up",task:async()=>{await E(r,t)}},{title:"Initializing a Git repository...",task:async()=>{await ue(r)}});try{await ce(w)}catch(l){throw N&&await I(r).catch(()=>{}),l}});let n;if(e.selectedAppOrNameResult.result==="new"){let i=await be(r,e.name),f=e.selectedAppOrNameResult.org;n=await e.developerPlatformClient.createApp(f,i)}else n=e.selectedAppOrNameResult.app;await Re({directory:r,apiKey:n.apiKey,appId:n.id,organizationId:n.organizationId,configName:"shopify.app.toml",developerPlatformClient:e.developerPlatformClient,isNewApp:!0},!1);let s=await Le({directory:r,clientId:void 0,forceRelink:!1,userProvidedConfigName:void 0});return le({headline:[{userInput:a},"is ready for you to build!"],nextSteps:[["Run",{command:`cd ${a}`}],["For extensions, run",{command:L(t,"shopify app generate extension")}],["To see your app, run",{command:L(t,"shopify app dev")}]],reference:[{link:{label:"Shopify docs",url:"https://shopify.dev"}},[{link:{label:"Shopify Dev MCP,",url:"https://shopify.dev/docs/apps/build/devmcp"}},"connect your AI assistant to development resources"],["For an overview of commands, run",{command:L(t,"shopify app","--help")}]]}),{app:s.app}}async function Se(e,t){if(await C(e))throw new m(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fb as e,Hb as r,Pb as n,Ta as o,ua as g,wa as d}from"./chunk-
|
|
1
|
+
import{Fb as e,Hb as r,Pb as n,Ta as o,ua as g,wa as d}from"./chunk-KNLPWHHJ.js";import{d as i}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var f=".shopify";async function E(p){let t=i(p,f),a=i(t,".gitignore"),[h,u]=await Promise.all([o(t),o(a)]);return h||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await d(t)),u||(n(r`Creating .gitignore in ${e.path(t)}...`),await g(a,`# Ignore the entire ${f} directory
|
|
2
2
|
*`)),t}export{E as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-IV3S4JU6.js";import{a as M}from"./chunk-X2ZCC772.js";import{a as C}from"./chunk-33AVVFWW.js";import{C as j,wa as E}from"./chunk-LANGOUPS.js";import{e as I}from"./chunk-ZKIIMXKC.js";import{a as J}from"./chunk-5EDRU7YU.js";import{b as O}from"./chunk-BPRY3O4N.js";import{R as h,da as g,ga as A,y}from"./chunk-OQ6WYWG4.js";import{D,E as f,u as T}from"./chunk-SQVJGTTD.js";import{p as R}from"./chunk-O6BUPYXH.js";import{Fb as k,Hb as m,Mb as v}from"./chunk-KNLPWHHJ.js";import{a as z}from"./chunk-M5GXA5W4.js";import{e as _,g as s}from"./chunk-VKWPEFWQ.js";s();s();s();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};s();async function Q(e){let i="Admin",n=I(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function w(e){return A({query:e.query,...await Q(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}s();var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var $=_(J(),1);var Z={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function q({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>w({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),l=[];for(l.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),l.push(...o.nodes);return{status:"ok",items:l}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function x(e,i){let n="";for(let t of e)n=(0,$.updateTomlValues)(n,t);return`# ${i}
|
|
2
2
|
${n}`}function X(e,i){let n=i.map(le).map(a=>{switch(a.status){case"ok":{let{typeName:o,patches:l}=a;return x(l,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:l})=>a.map(r=>({result:oe(r,o),graphQLOwner:l}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:l,key:r,patches:b}=a;return x(b,`namespace: ${l==="app"?"$app":`$app:${l}`} key: ${r} owner_type: ${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null);return{tomlContent:[...n,...t].join(`
|
|
3
3
|
`),metafieldCount:t.length,metaobjectCount:n.length}}async function K(e){let i=await de(e),n=i.storeFqdn,t=await ne(i),d=await ie(i);e.includeExistingDeclaredDefinitions||(t=te(t,e.appConfiguration),d=ae(d,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:l}=X(t,d);ee(o,l,n,a)}function ee(e,i,n,t){T({headline:"Conversion to TOML complete.",body:["Converted",{warn:`${e} metafields`},"and",{warn:`${i} metaobjects`},"from",{warn:n},"into TOML, ready for you to copy."],orderedNextSteps:!0,nextSteps:["Review the suggested TOML carefully before applying.",["Missing sections? Make sure your app has the required access scopes to load metafields and metaobjects (e.g.",{command:"read_customers"},"to load customer metafields,",{command:"read_metaobject_definitions"},"to load metaobjects.)"],["Missing definitions? Only metafields and metaobjects that are app-reserved (using",{command:"$app"},") will be converted."],["When you're ready, add the generated TOML to your app's configuration file and test out changes with the",{command:"shopify app dev"},"command."]]}),ue(t)}async function ne(e){let i=[];return await D(Object.entries(Z).map(([n,t])=>({title:m`Loading ${k.green(n)} metafields`,task:async()=>{let d=await q({query:P,session:e,toNodes:a=>a.metafieldDefinitions,toVariables:a=>({ownerType:t,after:a})});i.push({metafields:d,ownerType:n,graphQLOwner:t})}}))),i.map(({metafields:n,ownerType:t,graphQLOwner:d})=>n.status==="ok"?{ownerType:t,items:n.items,graphQLOwner:d}:null).filter(n=>n!==null)}async function ie(e){let i=await f({title:m`Loading ${k.green("metaobjects")}`,task:async()=>q({query:V,session:e,toNodes:n=>n.metaobjectDefinitions,toVariables:n=>({after:n})})});return i.status==="ok"?i.items:[]}function te(e,i){return e.map(n=>{let t=n.items.filter(d=>!U(i,[n.ownerType,"metafields",p(d.namespace)??"",d.key]));return t.length>0?{...n,items:t}:null}).filter(n=>n!==null)}function ae(e,i){return e.filter(n=>!U(i,["metaobjects","app",p(n.type)??""]))}function U(e,i){let n=e;for(let t of i){if(!n[t])return!1;n=n[t]}return!0}async function de(e){let{remoteApp:i,store:n}=e,t=i.apiSecretKeys[0]?.secret;if(!t)throw new R("No API secret keys found for app");return await h(n.shopDomain,i.apiKey,t)}function p(e){if(!e.match(/^app--\d+/))return null;let i="app";return e.match(/^app--\d+--/)&&(i=e.replace(/^app--\d+--/,"")),i}function oe(e,i){let n=p(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,d=se(e),a=me(d,i,n,t);return{status:"ok",key:t,namespace:n,patches:a}}function le(e){let i=p(e.type);if(!i)return{status:"not_app_reserved"};let n=re(e,i),t=ce(n,i);return{status:"ok",typeName:i,patches:t}}function se(e){let i={name:e.name===e.key?void 0:e.name,type:e.type.name,description:e.description??void 0,capabilities:u({admin_filterable:e.capabilities.adminFilterable.enabled||void 0}),access:u({admin:Y(e.access.admin),storefront:H(e.access.storefront),customer_account:pe(e.access.customerAccount)}),validations:B(e.validations)},{type:n,validations:t}=G(i.type,i.validations);return i.type=n,i.validations=t,i}function re(e,i){return{name:e.name===i?void 0:e.name,description:e.description??void 0,display_name_field:e.displayNameKey??void 0,access:u({admin:Y(e.access.admin),storefront:H(e.access.storefront)}),capabilities:u({translatable:e.capabilities.translatable.enabled||void 0,publishable:e.capabilities.publishable.enabled||void 0,renderable:e.capabilities.renderable?.enabled||void 0,renderable_meta_title_field:e.capabilities.renderable?.data?.metaTitleKey??void 0,renderable_meta_description_field:e.capabilities.renderable?.data?.metaDescriptionKey??void 0}),fields:Object.fromEntries(e.fieldDefinitions.map(n=>{let t={type:n.type.name,description:n.description??void 0,name:n.name===n.key?void 0:n.name,required:n.required||void 0,validations:B(n.validations)},{type:d,validations:a}=G(t.type,t.validations);return t.type=d,t.validations=a,[n.key,t]}))}}function G(e,i){if(!i)return{type:e,validations:void 0};if(i.metaobject_definition_type&&typeof i.metaobject_definition_type=="string"){let n=p(i.metaobject_definition_type);return{type:`${e}<$app:${n}>`,validations:u({...i,metaobject_definition_type:void 0})}}if(i.metaobject_definition_types&&Array.isArray(i.metaobject_definition_types)&&i.metaobject_definition_types.every(n=>typeof n=="string")){let n=i.metaobject_definition_types.map(t=>p(t));return{type:`${e}<${n.map(t=>`$app:${t}`).join(",")}>`,validations:u({...i,metaobject_definition_types:void 0})}}return{type:e,validations:i}}function B(e){let i=n=>{try{return JSON.parse(n)}catch{return n}};return u(Object.fromEntries(e.filter(n=>n.value!==void 0&&n.name!=="metaobject_definition_id"&&n.name!=="metaobject_definition_ids").map(n=>[n.name,n.value?i(n.value):void 0])))}function me(e,i,n,t){let d=[[[i,"metafields",n,t,"name"],e.name],[[i,"metafields",n,t,"type"],e.type],[[i,"metafields",n,t,"description"],e.description]],a=[[[i,"metafields",n,t,"access","admin"],e.access?.admin],[[i,"metafields",n,t,"access","storefront"],e.access?.storefront],[[i,"metafields",n,t,"access","customer_account"],e.access?.customer_account],[[i,"metafields",n,t,"capabilities","admin_filterable"],e.capabilities?.admin_filterable||void 0]];return e.validations&&W(e.validations).forEach(({validationKey:l,actualValue:r})=>{d.push([[i,"metafields",n,t,"validations",l],r])}),[N(d),N(a)]}function ce(e,i){let n=[[["metaobjects","app",i,"name"],e.name===i?void 0:e.name],[["metaobjects","app",i,"description"],e.description],[["metaobjects","app",i,"display_name_field"],e.display_name_field]],t=[[["metaobjects","app",i,"access","admin"],e.access?.admin],[["metaobjects","app",i,"access","storefront"],e.access?.storefront]];return e.capabilities?.translatable&&t.push([["metaobjects","app",i,"capabilities","translatable"],!0]),e.capabilities?.publishable&&t.push([["metaobjects","app",i,"capabilities","publishable"],!0]),e.capabilities?.renderable&&(t.push([["metaobjects","app",i,"capabilities","renderable"],!0]),e.capabilities?.renderable_meta_title_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_title_field"],e.capabilities.renderable_meta_title_field]),e.capabilities?.renderable_meta_description_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_description_field"],e.capabilities.renderable_meta_description_field])),Object.entries(e.fields).forEach(([d,a])=>{if(typeof a=="string")n.push([["metaobjects","app",i,"fields",d],a]);else{let o=Object.fromEntries(Object.entries(a).filter(([l,r])=>r!==void 0));Object.keys(o).length===1?n.push([["metaobjects","app",i,"fields",d],a.type]):(n.push([["metaobjects","app",i,"fields",d,"type"],a.type]),n.push([["metaobjects","app",i,"fields",d,"description"],a.description]),n.push([["metaobjects","app",i,"fields",d,"name"],a.name]),n.push([["metaobjects","app",i,"fields",d,"required"],a.required||void 0]),a.validations&&W(a.validations).forEach(({validationKey:r,actualValue:b})=>{n.push([["metaobjects","app",i,"fields",d,"validations",r],b])}))}}),[N(n),N(t)]}function W(e){return Object.entries(e).map(([i,n])=>{let t;return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&n.every(d=>typeof d=="string")?t=n:t=JSON.stringify(n),{validationKey:i,actualValue:t}})}function ue(e){let i=e.split(`
|
|
4
4
|
`);for(let n of i)n.match(/^\s*\[/)?v(m`${k.green(n)}`):n.match(/^\s*#/)?v(m`${k.gray(n)}`):v(m`${n}`)}function Y(e){switch(e){case"MERCHANT_READ_WRITE":return"merchant_read_write";case"MERCHANT_READ":case"PRIVATE":case"PUBLIC_READ":case"PUBLIC_READ_WRITE":case null:case void 0:return}}function H(e){switch(e){case"PUBLIC_READ":return"public_read";case"NONE":case null:case void 0:return}}function pe(e){switch(e){case"READ":return"read";case"READ_WRITE":return"read_write";case"NONE":case null:case void 0:return}}function u(e){if(e&&!g(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function N(e){return e.filter(([i,n])=>n!==void 0)}var S=_(z(),1);var F,c=class extends M{async run(){let{appContextResult:i,...n}=await f({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(F);await j(t.path);let d=await E({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await L({appContextResult:d,storeFqdn:t.store,forceReselectStore:t.reset});return{appContextResult:d,appConfiguration:d.app.configuration,remoteApp:d.remoteApp,store:a,includeExistingDeclaredDefinitions:t["include-existing"]}}});return await K(n),{app:i.app}}};F=c;c.summary="Import metafield and metaobject definitions.";c.descriptionWithMarkdown="Import metafield and metaobject definitions from your development store. [Read more about declarative custom data definitions](https://shopify.dev/docs/apps/build/custom-data/declarative-custom-data-definitions).";c.description=F.descriptionWithoutMarkdown();c.flags={...O,...C,store:S.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>y(e)}),"include-existing":S.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})};var Ke=c;export{Ke as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Pb as m}from"./chunk-
|
|
1
|
+
import{Pb as m}from"./chunk-KNLPWHHJ.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as h}from"child_process";function g(e=process.pid,i="SIGTERM",r=!0,s){k(e,i,r,s??(n=>{n&&m(`Failed to kill process ${e}: ${n}`)}))}function k(e,i,r,s){let t=typeof e=="number"?e.toString():e;if(!/^\d+$/.test(t))if(s){s(new Error("pid must be a number"));return}else throw new Error("pid must be a number");let n={};n[t]=[];let o=new Set;switch(o.add(t),process.platform){case"win32":{h("taskkill",["/pid",t,"/T","/F"]).on("close",u=>{s&&(u===0?s():s(new Error(`taskkill exited with code ${u}`)))});break}case"darwin":l(t,n,o,function(f){return h("pgrep",["-lfP",f])},function(){w(n,i,t,r,s)});break;default:l(t,n,o,function(f){return h("ps",["-o","pid command","--no-headers","--ppid",f])},function(){w(n,i,t,r,s)});break}}function w(e,i,r,s,t){let n=new Set;try{Object.keys(e).forEach(function(o){e[o].forEach(function(f){n.has(f)||(E(f,i),n.add(f))}),o===r&&s&&!n.has(o)&&(E(o,i),n.add(o))})}catch(o){if(t){t(o);return}else throw o}t&&t()}function E(e,i){try{process.kill(parseInt(e,10),i)}catch(r){if(r.code!=="ESRCH")throw r}}function l(e,i,r,s,t){let n=s(e),o="";n.stdout?.on("data",function(u){let a=u.toString("ascii");o+=a});let f=u=>{if(r.delete(e),u!==0){if(r.size===0){t();return}return}o.trim().split(`
|
|
2
2
|
`).forEach(function(a){let d=a.match(/^(\d+)\s(.*)$/);if(d){let c=d[1],$=d[2];i[e].push(c),i[c]=[],m(`Killing process ${c}: ${$}`),r.add(c),l(c,i,r,s,t)}})};n.on("close",f)}export{g as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-3GQ6AVHU.js";import{a as v}from"./chunk-5Y33JTFD.js";import{a as m}from"./chunk-ONCEFPYP.js";import{a as u}from"./chunk-XEHMXJ5J.js";import{d as f}from"./chunk-OYOTLGGD.js";import{p,v as c}from"./chunk-5VKFEYZK.js";import{b as h,e as d}from"./chunk-BPRY3O4N.js";import{xa as l}from"./chunk-OQ6WYWG4.js";import{a as F}from"./chunk-M5GXA5W4.js";import{e as O,g as a}from"./chunk-VKWPEFWQ.js";a();var t=O(F(),1);var w,o=class extends c{async command(r,n){let{ignore:g=[],only:_=[]}=r;l("theme-command:dev:single-env:authenticated");let i,e;if(r.theme){let s={filter:{theme:r.theme}};i=await u(n,s),e={...r,theme:i.id.toString(),store:n.storeFqdn}}else{i=await new m(n).findOrCreate();let s=r["theme-editor-sync"]&&i.createdAtRuntime;e={...r,theme:i.id.toString(),store:n.storeFqdn,"overwrite-json":s}}await f(i,"start development mode",r["allow-live"])&&(await v({adminSession:n,commandConfig:this.config,directory:e.path,store:e.store,password:e.password,storePassword:e["store-password"],theme:i,listing:e.listing,host:e.host,port:e.port,"live-reload":e["live-reload"],"error-overlay":e["error-overlay"],force:e.force,open:e.open,"theme-editor-sync":e["theme-editor-sync"],"standard-events-inspector":e["standard-events-inspector"],reconciliationStrategy:e["reconciliation-strategy"],noDelete:e.nodelete,ignore:g,only:_,notify:e.notify}),await y({path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"],silent:!0}))}};w=o;o.summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";o.descriptionWithMarkdown=`
|
|
2
2
|
Uploads the current theme as the specified theme, or a [development theme](https://shopify.dev/docs/themes/tools/cli#development-themes), to a store so you can preview it.
|
|
3
3
|
|
|
4
4
|
This command returns the following information:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as h}from"./chunk-JNAAHGJ6.js";import{Hb as a,Pb as u}from"./chunk-KNLPWHHJ.js";import{f as A}from"./chunk-E7Z7KYBR.js";import{c as I}from"./chunk-UKQ7NE5V.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();var p;(function(e){e.Local="local",e.Production="production"})(p||(p={}));function k(e=process.env){return e[I.serviceEnv]==="local"?p.Local:p.Production}function v(e=process.env){return k(e)===p.Local}var S;function n(){return S??(S=new h({projectName:`shopify-cli-kit${A()?"-test":""}`})),S}function g(){return v()?"devSessionStore":"sessionStore"}function x(){return v()?"currentDevSessionId":"currentSessionId"}function M(e=n()){return u(a`Getting session store...`),e.get(g())}function N(e,t=n()){u(a`Setting session store...`),t.set(g(),e)}function O(e=n()){u(a`Removing session store...`),e.delete(g())}function F(e=n()){return u(a`Getting current session ID...`),e.get(x())}function T(e,t=n()){u(a`Setting current session ID...`),t.set(x(),e)}function V(e=n()){u(a`Removing current session ID...`),e.delete(x())}async function W(e,t,o,r=n()){let c=P(e,r);if(c?.value!==void 0&&(o===void 0||Date.now()-c.timestamp<o))return c.value;let i=await t();return L(e,i,r),i}function L(e,t,o=n()){let r=o.get("cache")??{};r[e]={value:t,timestamp:Date.now()},o.set("cache",r)}function P(e,t=n()){return(t.get("cache")??{})[e]}function _(e=n()){e.delete("cache")}function C({days:e=0,hours:t=0,minutes:o=0,seconds:r=0}){return(e*24*60*60+t*60*60+o*60+r)*1e3}async function q(e,t,o,r=n()){let c=r.get("cache")??{},i=`most-recent-occurrence-${e}`,s=c[i];return s?.value!==void 0&&Date.now()-s.timestamp<C(t)?!1:(await o(),c[i]={value:!0,timestamp:Date.now()},r.set("cache",c),!0)}async function z(e,t=n()){let{key:o,limit:r,timeout:c,task:i}=e,s=t.get("cache")??{},m=`rate-limited-occurrences-${o}`,w=s[m],l=Date.now();if(w?.value){let y=l-C(c),d=w.value.filter(E=>E>=y);if(d.length>=r)return s[m]={value:d,timestamp:Date.now()},t.set("cache",s),!1;await i(),s[m]={value:[...d,l],timestamp:l}}else await i(),s[m]={value:[l],timestamp:l};return t.set("cache",s),!0}function B(e=n()){return e.get("autoUpgradeEnabled")??!0}function H(e,t=n()){t.set("autoUpgradeEnabled",e)}function J(e=n()){return e.get("skillAutoInstallCompleted")??!1}function Q(e=n()){e.set("skillAutoInstallCompleted",!0)}function D(){return new h({projectName:"shopify-cli-kit-partner-status"})}function X(e){return e&&D().get(e)?!0:null}function Y(e){D().set(e,{status:!0,checkedAt:new Date().toISOString()})}export{p as a,k as b,v as c,M as d,N as e,O as f,F as g,T as h,V as i,W as j,L as k,P as l,_ as m,C as n,q as o,z as p,B as q,H as r,J as s,Q as t,D as u,X as v,Y as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as xt}from"./chunk-UOHNRH6E.js";import{a as br}from"./chunk-2ECP5WXO.js";import{a as Ur}from"./chunk-4COZ6ZCQ.js";import{b as Tr}from"./chunk-OQPDE63R.js";import{a as Ar}from"./chunk-7ZLFWJYO.js";import{a as _r}from"./chunk-MQDJJICB.js";import{a as Cr}from"./chunk-B2WYFLOD.js";import{a as fr}from"./chunk-O3BC33IK.js";import{a as hr}from"./chunk-LSZF6IW6.js";import{a as gr}from"./chunk-C4BN2RVQ.js";import{a as wr,b as yr,c as vr,d as Pr}from"./chunk-XHFQ6LOF.js";import{a as Sr}from"./chunk-EXRSWJ5H.js";import{a as xr}from"./chunk-K6G2EZGV.js";import{a as Er}from"./chunk-XC2X34PK.js";import{a as Rr}from"./chunk-TIO5BQ5N.js";import{a as uo,b as mo}from"./chunk-XQGRKXWZ.js";import{a as ar}from"./chunk-NAJQU2AY.js";import{a as lr}from"./chunk-O5V6OEPI.js";import{a as pr}from"./chunk-RLXN7RR4.js";import{a as dr}from"./chunk-P427M44L.js";import{g as ur}from"./chunk-TBU3OWTQ.js";import{a as Ze}from"./chunk-EIEMLLMV.js";import{c as Xe,m as et}from"./chunk-FIXLZ6WB.js";import{a as cr}from"./chunk-CTEETGYW.js";import{a as mr}from"./chunk-AD74MYJN.js";import{b as ir,g as Ce,j as Je}from"./chunk-FQA2F2XJ.js";import{c as kr}from"./chunk-GZJCF3TC.js";import{a as to,b as rt,c as te,d as ro}from"./chunk-PEC3D242.js";import{a as ho,f as go,g as wo,h as nt,i as yo,j as vo,k as Po,l as xo,m as Eo,n as bo,o as Uo,p as So,q as Ro,v as To,x as Ao,z as st}from"./chunk-4Z3NOOAC.js";import{a as nr,b as sr,c as co,d as lo,e as ot,f as po,g as fo}from"./chunk-B57QEQBY.js";import{a as $,b as Qe}from"./chunk-ZHVFR23B.js";import{a as Xt,b as Zt,d as Ae,f as er,m as _e,n as H,s as O,u as tr,v as rr,w as or}from"./chunk-Q7BOSHWX.js";import{a as Jt}from"./chunk-U5EOE3DT.js";import{a as oo,b as no,c as so,d as ao,e as io}from"./chunk-VJIB5EKO.js";import{a as Lr}from"./chunk-2PEMBCOR.js";import{a as eo}from"./chunk-HUZJXCY4.js";import{a as Zr}from"./chunk-EB2SLRLG.js";import{a as Ir}from"./chunk-AOZJVY2C.js";import{a as _o}from"./chunk-6YQTYIZ5.js";import{$ as Jr,C as Br,E as Kr,G as ee,N as jr,O as Yr,R as Vr,S as Qr,i as $r,j as N,k as Mr,m as Fr,p as tt,q as Or,qa as Ie,ra as Le,s as Nr,t as qr,u as Wr,v as Hr,w as Gr,wa as Xr}from"./chunk-54NHTRQI.js";import{Y as zr,e as ke,j as ce,p as Dr}from"./chunk-BEN4UG4L.js";import{c as Vt}from"./chunk-67MWN74X.js";import{a as j}from"./chunk-LMLBN3DB.js";import{b as Qt,e as Te}from"./chunk-BJLBQAYG.js";import{$ as $t,N as Lt,Z as X,a as ze,c as Rt,e as Tt,g as At,k as _t,m as Ct,p as kt,s as It,t as xe,ta as Mt,y as Ee}from"./chunk-REQPTZOU.js";import{D as Ue,H as Gt,J as Se,O as Re,P as ie,Q as Ve,R as Kt,T as jt,a as St,i as Ft,j as Ot,k as Nt,l as D,m as qt,n as Ye,o as Wt,p as Ht,u as be,w as ae}from"./chunk-WNPRFDZX.js";import{a as Cn}from"./chunk-7UNQOKZW.js";import{d as Dt}from"./chunk-P5GRGEW4.js";import{f as Ut,m as T,p as Z,u as Bt}from"./chunk-OUPJTPTH.js";import{$a as vt,Ea as yt,Fb as P,Hb as b,Mb as K,Na as ge,P as Ke,Pb as h,Qb as C,Ta as W,Wa as we,cb as Pt,eb as ye,fb as k,gb as L,jb as ve,kb as Pe,ma as I,mb as Et,nb as bt,tb as je,ua as fe,wa as he}from"./chunk-UHI4NMIL.js";import{d as zt,f as Yt}from"./chunk-EDZ3YWOD.js";import{a as ft}from"./chunk-UKQ7NE5V.js";import{d as S,f as Be,g as ht,i as de,k as me,o as gt,p as wt}from"./chunk-773TIA5M.js";import{a as _n}from"./chunk-M5GXA5W4.js";import{e as J,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var kn=300*1e3,In='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Co(t,e,r=Date.now()){for(;await Ln(t,e,r););}async function Ln(t,e,r){let o=await Ce(t,e);if(!o||$n(o,r))throw new T(In);return await ie(3),o.processing}function $n(t,e){return t.processing&&Date.now()-e>=kn}var Mn="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",Dn="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",at=3,$e=class extends cr{constructor(e,r={devPreview:!1}){super(e),this.context="App Ext. Host",this.themeId=wr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??(e=this.devPreview?await this.createHostTheme():await this.create()),e}setTheme(e){yr(this.adminSession.storeFqdn,e)}removeTheme(){vr(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:ir,name:this.generateThemeName(this.context),src:Mn};for(let o=0;o<at;o++){h(`Attempt ${o}/${at}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await Je(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),h(`Waiting for theme with id "${n.id}" to be processed`),await Co(n.id,this.adminSession),n;throw new Error}catch{h(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}h(`Theme creation failed after ${at} retries. Creating theme using fallback theme zip`);let r=await Je({...e,src:Dn},this.adminSession);if(!r)throw h("Theme creation failed. Exiting process."),new Z(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var Fn={"theme:init":hr,"theme:check":ar,"theme:console":lr,"theme:delete":pr,"theme:dev":dr,"theme:duplicate":mr,"theme:info":fr,"theme:language-server":gr,"theme:list":Pr,"theme:metafields:pull":Sr,"theme:open":xr,"theme:package":Er,"theme:profile":br,"theme:publish":Ur,"theme:preview":Rr,"theme:pull":Tr,"theme:push":Ar,"theme:rename":_r,"theme:share":Cr},Ca=Fn;async function ko(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(U=>U.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[c,d]=await Promise.all([Lt(t.storeFqdn),qn(e)]),l=c.storeFqdn,[u,g]=await Promise.all([et(c),Xe(c)]),w=g?await Ze(t.storePassword,l,u):void 0,m=await Nn(c,t.theme),f=m.id.toString();return be({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${l}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:On,options:{theme:m,adminSession:c,storefrontPassword:w,crawlerSignatureHeaders:u,themeExtensionDirectory:a,themeExtensionPort:i}}}var On=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await ur(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function Nn(t,e){let r;if(e)h(`Fetching theme with provided id ${e}`),r=await Ce(parseInt(e,10),t);else{let o=new $e(t,{devPreview:!0});await Ue([{title:"Configuring host theme for theme app extension",task:async()=>{h("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new T("Could not find or create a host theme for theme app extensions");return r}async function qn(t){return t.developerPlatformClient?.clientName===zr.AppManagement?`https://${await xe()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await It()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function Wn(t){let e=S(t.directory,"locales");return we([S(e,"*.json")])}async function Io(t,e){let r=await Wn(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),Hn(a,s,o,t,e)})),o.lastUpdated=Date.now(),h(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function Hn(t,e,r,o,n){let s;try{s=await I(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw C(i,n.stderr),new Bt.ExtendableError(i)}}p();function Me(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}async function re(t,e,r,o){return D({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await Io(t,r),c=await Mr(t),d=t.outputRelativePath?de(n):n,l=await Gn(t,s,d,o),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=t.configuration.metafields),{assets:{main:le(l)&&l[0]?.assets?.main?l[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await ge(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:Me(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:l,localization:a??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:c?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function Gn(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),le(s)){let a=await Bn(r);return Promise.all(s.map(async i=>{let{target:c,resource:d}=i,l={...i,surface:Le(c),root:{url:`${e}/${c}`},resource:d||{url:""}},u=a?.[c];if(!u)return l;let w=await Vn(u,{target:c,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...l,...w}}))}return s}async function Bn(t){try{let e=S(t,"manifest.json"),r=await I(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function Kn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,c=e[s];if(typeof c=="string"){let w=await De(s,i,typeof a=="string"?a:c,r,o,n,typeof a=="string"?c:void 0);return{assets:{[w.name]:w}}}let l=e.build_manifest?.assets?.[s];if(l?.filepath){let u=await De(s,i,l.filepath,r,o,n,l.module);return{assets:{[u.name]:u}}}return{}}async function jn({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await ge(S(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function zn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,c)=>{let d=i.schema,l=s[c]?.schema,u=typeof l=="string"?l:d,g=typeof l=="string"?d:void 0;return{...i,schema:await De("schema",`${t}/intents/${c}/schema`,u,r,o,n,g)}}))}:{}}async function Yn({target:t,url:e,extension:r,resolver:o},n,s){let a=await De(n,`${t}/${n}`,s,e,r,o);return{assets:{[a.name]:a}}}async function Vn(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return Qn(o,n)?zn(e,n):Jn(o,n)?Yn(e,o,n):Xn(o,n)?jn(e,o,n):Kn(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function le(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function De(t,e,r,o,n,s,a){let i=`${e}${me(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await ge(S(n.directory,a??r))??0}}function Qn(t,e){return t==="intents"&&Array.isArray(e)}function Jn(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function Xn(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as Zn}from"events";var pe;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(pe||(pe={}));async function Lo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:co(t.storeFqdn,t.apiKey),mobileUrl:po(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>re(n,e,t,r&&it(r,n.devUUID))))}}function it(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var Fe=class extends Zn{constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=X(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(le(n.extensionPoints)&&le(o.extensionPoints)){let s=n.extensionPoints.reduce((c,d)=>({...c,[d.target]:d}),{});o.extensionPoints=X(o.extensionPoints,n.extensionPoints,c=>c.map(d=>{let l=s[d.target];return l?X(d,l,(u,g)=>g):d}));let{extensionPoints:a,...i}=n;return X(o,i)}return X(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){h(b`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await re(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},it(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await re(e,r,this.options,it(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(pe.Update,e)}};p();p();var z;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(z||(z={}));function $o(t,e){return(r,o,n)=>{r.url==="/extensions"&&(h("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,es(t,e)))}}function es(t,e){return r=>{h("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};h(b`Sending connected payload: ${P.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",ss(t,e))}}function ts(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?P.json(o).output():String(o)).join(" ");return b`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var rs={debug:t=>P.gray(t),warn:t=>P.yellow(t),error:t=>P.errorText(t)};function os({type:t,message:e}){let r=ts(e);switch(t){case"debug":case"warn":case"error":return b`${rs[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function ns(t,e){D({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(os(t))})}function ss(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(h(b`Received websocket message with event type ${n} and data:
|
|
1
|
+
import{a as xt}from"./chunk-UOHNRH6E.js";import{a as br}from"./chunk-PPHJ4F2Z.js";import{a as Ur}from"./chunk-5RMFBXP6.js";import{b as Tr}from"./chunk-A35F74KC.js";import{a as Ar}from"./chunk-CFZVZFVH.js";import{a as _r}from"./chunk-FFC42T6R.js";import{a as Cr}from"./chunk-L6VQZJM4.js";import{a as fr}from"./chunk-N2UVYELM.js";import{a as hr}from"./chunk-B3XKHB4G.js";import{a as gr}from"./chunk-MSDNBGRH.js";import{a as wr,b as yr,c as vr,d as Pr}from"./chunk-AMLHR2HO.js";import{a as Sr}from"./chunk-EIEHPIWJ.js";import{a as xr}from"./chunk-VBL7DLY7.js";import{a as Er}from"./chunk-X5GZF33W.js";import{a as Rr}from"./chunk-QAMPDFZB.js";import{a as uo,b as mo}from"./chunk-LZO2JTZS.js";import{a as ar}from"./chunk-H2Z3SST2.js";import{a as lr}from"./chunk-PNYIQOOE.js";import{a as pr}from"./chunk-JBIXZWT6.js";import{a as dr}from"./chunk-WKJNCJUV.js";import{g as ur}from"./chunk-GVHVEYNG.js";import{a as Ze}from"./chunk-3XBPV64S.js";import{c as Xe,m as et}from"./chunk-HS7TCC4I.js";import{a as cr}from"./chunk-GAUJKBLY.js";import{a as mr}from"./chunk-UZR7JB5B.js";import{b as ir,g as Ce,j as Je}from"./chunk-VQ44LFBY.js";import{c as kr}from"./chunk-ROBYXQMW.js";import{a as to,b as rt,c as te,d as ro}from"./chunk-PNCF5LNZ.js";import{a as ho,f as go,g as wo,h as nt,i as yo,j as vo,k as Po,l as xo,m as Eo,n as bo,o as Uo,p as So,q as Ro,v as To,x as Ao,z as st}from"./chunk-NUCUZBO3.js";import{a as nr,b as sr,c as co,d as lo,e as ot,f as po,g as fo}from"./chunk-VURVVLVE.js";import{a as $,b as Qe}from"./chunk-ZZ5M5IMF.js";import{a as Xt,b as Zt,d as Ae,f as er,m as _e,n as H,s as O,u as tr,v as rr,w as or}from"./chunk-Q7BOSHWX.js";import{a as Jt}from"./chunk-I7QJGHS6.js";import{a as oo,b as no,c as so,d as ao,e as io}from"./chunk-VSPM4VES.js";import{a as Lr}from"./chunk-6SVMZEJO.js";import{a as eo}from"./chunk-IV3S4JU6.js";import{a as Zr}from"./chunk-X2ZCC772.js";import{a as Ir}from"./chunk-33AVVFWW.js";import{a as _o}from"./chunk-5HGRHX2Z.js";import{$ as Jr,C as Br,E as Kr,G as ee,N as jr,O as Yr,R as Vr,S as Qr,i as $r,j as N,k as Mr,m as Fr,p as tt,q as Or,qa as Ie,ra as Le,s as Nr,t as qr,u as Wr,v as Hr,w as Gr,wa as Xr}from"./chunk-LANGOUPS.js";import{Y as zr,e as ke,j as ce,p as Dr}from"./chunk-FDQNY7RF.js";import{c as Vt}from"./chunk-5EDRU7YU.js";import{a as j}from"./chunk-XKMLKEYX.js";import{b as Qt,e as Te}from"./chunk-BPRY3O4N.js";import{$ as $t,N as Lt,Z as X,a as ze,c as Rt,e as Tt,g as At,k as _t,m as Ct,p as kt,s as It,t as xe,ta as Mt,y as Ee}from"./chunk-OQ6WYWG4.js";import{D as Ue,H as Gt,J as Se,O as Re,P as ie,Q as Ve,R as Kt,T as jt,a as St,i as Ft,j as Ot,k as Nt,l as D,m as qt,n as Ye,o as Wt,p as Ht,u as be,w as ae}from"./chunk-SQVJGTTD.js";import{a as Cn}from"./chunk-7UNQOKZW.js";import{d as Dt}from"./chunk-4NSHAMD3.js";import{f as Ut,m as T,p as Z,u as Bt}from"./chunk-O6BUPYXH.js";import{$a as vt,Ea as yt,Fb as P,Hb as b,Mb as K,Na as ge,P as Ke,Pb as h,Qb as C,Ta as W,Wa as we,cb as Pt,eb as ye,fb as k,gb as L,jb as ve,kb as Pe,ma as I,mb as Et,nb as bt,tb as je,ua as fe,wa as he}from"./chunk-KNLPWHHJ.js";import{d as zt,f as Yt}from"./chunk-E7Z7KYBR.js";import{a as ft}from"./chunk-UKQ7NE5V.js";import{d as S,f as Be,g as ht,i as de,k as me,o as gt,p as wt}from"./chunk-773TIA5M.js";import{a as _n}from"./chunk-M5GXA5W4.js";import{e as J,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var kn=300*1e3,In='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Co(t,e,r=Date.now()){for(;await Ln(t,e,r););}async function Ln(t,e,r){let o=await Ce(t,e);if(!o||$n(o,r))throw new T(In);return await ie(3),o.processing}function $n(t,e){return t.processing&&Date.now()-e>=kn}var Mn="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",Dn="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",at=3,$e=class extends cr{constructor(e,r={devPreview:!1}){super(e),this.context="App Ext. Host",this.themeId=wr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??(e=this.devPreview?await this.createHostTheme():await this.create()),e}setTheme(e){yr(this.adminSession.storeFqdn,e)}removeTheme(){vr(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:ir,name:this.generateThemeName(this.context),src:Mn};for(let o=0;o<at;o++){h(`Attempt ${o}/${at}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await Je(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),h(`Waiting for theme with id "${n.id}" to be processed`),await Co(n.id,this.adminSession),n;throw new Error}catch{h(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}h(`Theme creation failed after ${at} retries. Creating theme using fallback theme zip`);let r=await Je({...e,src:Dn},this.adminSession);if(!r)throw h("Theme creation failed. Exiting process."),new Z(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var Fn={"theme:init":hr,"theme:check":ar,"theme:console":lr,"theme:delete":pr,"theme:dev":dr,"theme:duplicate":mr,"theme:info":fr,"theme:language-server":gr,"theme:list":Pr,"theme:metafields:pull":Sr,"theme:open":xr,"theme:package":Er,"theme:profile":br,"theme:publish":Ur,"theme:preview":Rr,"theme:pull":Tr,"theme:push":Ar,"theme:rename":_r,"theme:share":Cr},Ca=Fn;async function ko(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(U=>U.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[c,d]=await Promise.all([Lt(t.storeFqdn),qn(e)]),l=c.storeFqdn,[u,g]=await Promise.all([et(c),Xe(c)]),w=g?await Ze(t.storePassword,l,u):void 0,m=await Nn(c,t.theme),f=m.id.toString();return be({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${l}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:On,options:{theme:m,adminSession:c,storefrontPassword:w,crawlerSignatureHeaders:u,themeExtensionDirectory:a,themeExtensionPort:i}}}var On=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await ur(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function Nn(t,e){let r;if(e)h(`Fetching theme with provided id ${e}`),r=await Ce(parseInt(e,10),t);else{let o=new $e(t,{devPreview:!0});await Ue([{title:"Configuring host theme for theme app extension",task:async()=>{h("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new T("Could not find or create a host theme for theme app extensions");return r}async function qn(t){return t.developerPlatformClient?.clientName===zr.AppManagement?`https://${await xe()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await It()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function Wn(t){let e=S(t.directory,"locales");return we([S(e,"*.json")])}async function Io(t,e){let r=await Wn(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),Hn(a,s,o,t,e)})),o.lastUpdated=Date.now(),h(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function Hn(t,e,r,o,n){let s;try{s=await I(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw C(i,n.stderr),new Bt.ExtendableError(i)}}p();function Me(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}async function re(t,e,r,o){return D({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await Io(t,r),c=await Mr(t),d=t.outputRelativePath?de(n):n,l=await Gn(t,s,d,o),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=t.configuration.metafields),{assets:{main:le(l)&&l[0]?.assets?.main?l[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await ge(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:Me(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:l,localization:a??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:c?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function Gn(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),le(s)){let a=await Bn(r);return Promise.all(s.map(async i=>{let{target:c,resource:d}=i,l={...i,surface:Le(c),root:{url:`${e}/${c}`},resource:d||{url:""}},u=a?.[c];if(!u)return l;let w=await Vn(u,{target:c,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...l,...w}}))}return s}async function Bn(t){try{let e=S(t,"manifest.json"),r=await I(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function Kn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,c=e[s];if(typeof c=="string"){let w=await De(s,i,typeof a=="string"?a:c,r,o,n,typeof a=="string"?c:void 0);return{assets:{[w.name]:w}}}let l=e.build_manifest?.assets?.[s];if(l?.filepath){let u=await De(s,i,l.filepath,r,o,n,l.module);return{assets:{[u.name]:u}}}return{}}async function jn({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await ge(S(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function zn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,c)=>{let d=i.schema,l=s[c]?.schema,u=typeof l=="string"?l:d,g=typeof l=="string"?d:void 0;return{...i,schema:await De("schema",`${t}/intents/${c}/schema`,u,r,o,n,g)}}))}:{}}async function Yn({target:t,url:e,extension:r,resolver:o},n,s){let a=await De(n,`${t}/${n}`,s,e,r,o);return{assets:{[a.name]:a}}}async function Vn(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return Qn(o,n)?zn(e,n):Jn(o,n)?Yn(e,o,n):Xn(o,n)?jn(e,o,n):Kn(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function le(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function De(t,e,r,o,n,s,a){let i=`${e}${me(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await ge(S(n.directory,a??r))??0}}function Qn(t,e){return t==="intents"&&Array.isArray(e)}function Jn(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function Xn(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as Zn}from"events";var pe;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(pe||(pe={}));async function Lo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:co(t.storeFqdn,t.apiKey),mobileUrl:po(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>re(n,e,t,r&&it(r,n.devUUID))))}}function it(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var Fe=class extends Zn{constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=X(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(le(n.extensionPoints)&&le(o.extensionPoints)){let s=n.extensionPoints.reduce((c,d)=>({...c,[d.target]:d}),{});o.extensionPoints=X(o.extensionPoints,n.extensionPoints,c=>c.map(d=>{let l=s[d.target];return l?X(d,l,(u,g)=>g):d}));let{extensionPoints:a,...i}=n;return X(o,i)}return X(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){h(b`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await re(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},it(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await re(e,r,this.options,it(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(pe.Update,e)}};p();p();var z;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(z||(z={}));function $o(t,e){return(r,o,n)=>{r.url==="/extensions"&&(h("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,es(t,e)))}}function es(t,e){return r=>{h("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};h(b`Sending connected payload: ${P.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",ss(t,e))}}function ts(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?P.json(o).output():String(o)).join(" ");return b`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var rs={debug:t=>P.gray(t),warn:t=>P.yellow(t),error:t=>P.errorText(t)};function os({type:t,message:e}){let r=ts(e);switch(t){case"debug":case"warn":case"error":return b`${rs[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function ns(t,e){D({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(os(t))})}function ss(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(h(b`Received websocket message with event type ${n} and data:
|
|
2
2
|
${P.json(s)}
|
|
3
3
|
`,e.stdout),n===z.Update){let a=e.payloadStore.getRawPayload().app.apiKey,i=s.app?.apiKey;if(s.app){if(a!==i)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(n===z.Dispatch){let a=as(o,e);Do(t,a,e)}else n===z.Log&&ns(s,e)}}function Mo(t,e){return r=>{let o={event:z.Update,version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};h(b`Sending websocket update event to the websocket clients:
|
|
4
4
|
${P.json(o)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as de,b as pe,c as fe,d as j,e as Y,f as ge,g as me,j as he,k as Se,l as C,m as ye,n as B,o as W,p as Ee,q as Ce}from"./chunk-
|
|
1
|
+
import{a as de,b as pe,c as fe,d as j,e as Y,f as ge,g as me,j as he,k as Se,l as C,m as ye,n as B,o as W,p as Ee,q as Ce}from"./chunk-O5FUKS5D.js";import{a as h,b as ve}from"./chunk-P4LA3M5S.js";import{b as ce,c as ue}from"./chunk-BPRY3O4N.js";import{b as le}from"./chunk-3PFIBTES.js";import{v as oe,w as ie,x as re}from"./chunk-SQVJGTTD.js";import{o as J}from"./chunk-O6BUPYXH.js";import{Lb as ae,ma as se}from"./chunk-KNLPWHHJ.js";import{d as x,f as te,i as ne}from"./chunk-773TIA5M.js";import{a as $e}from"./chunk-M5GXA5W4.js";import{e as Oe,g as f}from"./chunk-VKWPEFWQ.js";f();f();f();f();import{tmpdir as ke}from"node:os";function xe(e,t,n){return{target:e.ScriptTarget.ESNext,module:e.ModuleKind.ESNext,jsx:e.JsxEmit.ReactJSX,jsxImportSource:t??"preact",strict:!0,strictNullChecks:!1,esModuleInterop:!0,skipLibCheck:!0,moduleResolution:e.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,lib:["es2020","dom"],allowJs:!0,checkJs:!1,...n?{baseUrl:n,paths:{"@shopify/ui-extensions/src/surfaces/*":["node_modules/@shopify/ui-extensions/build/ts/surfaces/*"]}}:{}}}function Me(){return te(ke(),"shopify-cli-validate-components-vfs")}function je(e,t,n){let o=n.get(t);if(o!==void 0)return e.ScriptSnapshot.fromString(o);try{let s=e.sys.readFile(t);return s?e.ScriptSnapshot.fromString(s):void 0}catch{return}}function Ue(e,t,n,o){return{getScriptFileNames:()=>Array.from(t.virtualFiles.keys()),getScriptVersion:s=>t.fileVersions.get(s)?.toString()??"0",getScriptSnapshot:s=>je(e,s,t.virtualFiles),getCurrentDirectory:()=>n,getCompilationSettings:()=>xe(e,o,n),getDefaultLibFileName:s=>e.getDefaultLibFilePath(s),fileExists:s=>t.virtualFiles.has(s)||e.sys.fileExists(s),readFile:s=>t.virtualFiles.get(s)??e.sys.readFile(s),readDirectory:e.sys.readDirectory,getDirectories:e.sys.getDirectories,directoryExists:s=>{let i=s.endsWith("/")?s:`${s}/`;for(let a of t.virtualFiles.keys())if(a.startsWith(i))return!0;return e.sys.directoryExists(s)},getNewLine:()=>`
|
|
2
2
|
`}}function Te(e,t){let n=new Map,o=new Map,s=Me(),i=Ue(e,{fileVersions:n,virtualFiles:o},s,t),a=e.createLanguageService(i,e.createDocumentRegistry()),r=ne(e.getDefaultLibFilePath(xe(e,t,s))),l=["lib.es5.d.ts","lib.es2020.d.ts","lib.dom.d.ts"];for(let g of l)try{let u=x(r,g),S=e.sys.readFile(u);S&&(o.set(u,S),n.set(u,1))}catch{}return{languageService:a,servicesHost:i,fileVersions:n,virtualFiles:o}}function Ge(e,t){let n=(e.get(t)??0)+1;return e.set(t,n),n}function O(e,t,n){e.virtualFiles.set(t,n),Ge(e.fileVersions,t)}f();f();function be(e,t){if(!t)return[];switch(t){case"@shopify/polaris-types":case"@shopify/ui-extensions":return Je(e);case"@shopify/ui-extensions-react":return Be(e);case"@shopify/app-bridge-types":return Ye(e);case"@shopify/hydrogen":return We(e);case"@shopify/app-bridge-react":return He(e);default:return[]}}function He(e){let t=[],n=/(?:export\s+)?declare\s+const\s+(\w+)\s*:\s*React\.(?:ComponentType|ForwardRefExoticComponent)\b/g,o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return[...new Set(t)]}function Je(e){let t=[],n=/declare\s+const\s+tagName\$?\w*\s*=\s*['"]([^'"]+)['"]/g,o=/\[['"]([a-z]+-[a-z-]+)['"]\]\s*:/g,s;for(;(s=n.exec(e))!==null||(s=o.exec(e))!==null;)t.push(s[1]);return[...new Set(t)]}function Ye(e){let t=[],n=e.match(/interface\s+AppBridgeElements\s*\{([^}]+)\}/);if(n){let o=/['"]([a-z]+-[a-z-]+)['"]\s*:/g,s;for(;(s=o.exec(n[1]))!==null;)t.push(s[1])}return t}function Be(e){let t=new Set,n=/export\s+declare\s+const\s+([A-Z]\w*)\s*:\s*"\1"\s*&/g,o;for(;(o=n.exec(e))!==null;)t.add(o[1]);let s=/export\s+(?!type\b)\{([^}]+)\}/g;for(;(o=s.exec(e))!==null;)for(let i of o[1].split(",")){let a=i.trim();if(!a||/^type\s/.test(a))continue;let r=a.split(/\s+as\s+/),l=r[r.length-1].trim();/^[A-Z]\w*$/.test(l)&&t.add(l)}return[...t]}function We(e){let t=[],n,o=/declare\s+function\s+(\w+)\s*(?:<[^>]*>)?\s*\([^)]*\)\s*:\s*(?:react_jsx_runtime\.)?JSX\.Element/g;for(;(n=o.exec(e))!==null;)t.push(n[1]);let s=/declare\s+function\s+(\w+)\s*(?:<[^>]*>)?\s*\([^)]*\)\s*:\s*ReturnType<FC>/g;for(;(n=s.exec(e))!==null;)t.push(n[1]);let i=/declare\s+function\s+(\w+)\s*(?:<[^>]*>)?\s*\([^)]*\)\s*:\s*react\.FunctionComponentElement/g;for(;(n=i.exec(e))!==null;)t.push(n[1]);let a=/declare\s+const\s+(\w+)\s*:\s*react\.ForwardRefExoticComponent/g;for(;(n=a.exec(e))!==null;)t.push(n[1]);let r=/declare\s+const\s+(\w+)\s*:\s*react\.Provider/g;for(;(n=r.exec(e))!==null;)t.push(n[1]);return[...new Set(t)]}function Pe(e,t){return e==="hydrogen"||/^\s*(?:import|export)\b[^'"]*['"]@shopify\/ui-extensions-react(?:\/[^'"]*)?['"]/m.test(t)?"react":"preact"}function ze(e,t,n){return x(e,"node_modules",t,n)}function I(e,t,n,o,s,i){let a=ze(t,n,o);if(O(e,a,s),i)for(let r of be(s,n))i.add(r)}function Xe(e,t,n,o){for(let s of B(e)){if(s.startsWith(".")||s==="node_modules")continue;let i=x(e,s);if(C(i,"package.json")!==void 0)continue;let r;if(C(i,x("src","index.d.ts"))!==void 0?r="./src/index.d.ts":C(i,"index.d.ts")!==void 0&&(r="./index.d.ts"),!r)continue;let l=JSON.stringify({name:`${t}/${s}`,types:r});I(n,o,t,`${s}/package.json`,l)}}var qe={"customer-account":["checkout"]};function z(e){let t=[e,...qe[e]??[]],n=new Set(t.map(i=>`build/ts/surfaces/${i}.d.ts`)),o=t.map(i=>`build/ts/surfaces/${i}/`),s="build/ts/";return i=>!!(n.has(i)||o.some(a=>i.startsWith(a))||i.startsWith(s)&&i.endsWith(".d.ts")&&!i.slice(s.length).includes("/"))}function R(e,t,n,o,s,i){for(let{relPath:a}of ye(e,i)){let r=C(e,a);r&&I(n,o,t,a,r,s)}}function Ke(e){let t=[],n=/import\s+['"]\.\.\/components\/(\w+)\.d\.ts['"]/g,o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function Ze(e){let t=new Set;for(let n of W(e)){let o=n.endsWith(".gz")?n.slice(0,-3):n;o.endsWith(".d.ts")&&t.add(o.slice(0,-5))}return[...t].sort()}function Qe(e,t,n,o,s,i,a){let r=`build/ts/surfaces/${s}`,l=x(e,r,"targets"),g=`${r}/targets/${i}.d.ts`,u=C(e,g);if(!u)return W(l).length>0||B(l).length>0?{hasTargetSubpath:!1,invalidTarget:{target:i,surface:s,supported:Ze(l)}}:(R(e,t,n,o,a,z(s)),{hasTargetSubpath:!1});let S=`${r}.d.ts`,T=C(e,S);T&&I(n,o,t,S,T,a),I(n,o,t,g,u,a);let b=`${r}/components`;for(let m of Ke(u)){let p=`${b}/${m}.d.ts`,c=C(e,p);c&&I(n,o,t,p,c,a)}for(let m of["shared.d.ts","components-shared.d.ts"]){let p=`${b}/${m}`,c=C(e,p);c&&I(n,o,t,p,c,a)}for(let m of["api","types","event"]){let p=`${r}/${m}`;R(e,t,n,o,a,c=>c===p||c.startsWith(`${p}/`))}for(let m of["extension-targets.d.ts","globals.d.ts","api.d.ts","extension.d.ts"]){let p=`${r}/${m}`,c=C(e,p);c&&I(n,o,t,p,c,a)}return R(e,t,n,o,a,m=>{if(!m.startsWith("build/ts/"))return!1;let p=m.slice(9);return p.endsWith(".d.ts")&&!p.includes("/")}),{hasTargetSubpath:!0}}function et(e,t){let n=x(t,"__shims__","app-bridge-preact-jsx.d.ts"),o=['import type { AppBridgeElements } from "@shopify/app-bridge-types/dist/shopify";','declare module "preact" {'," namespace createElement.JSX {"," interface IntrinsicElements extends AppBridgeElements {}"," }","}",""].join(`
|
|
3
3
|
`);O(e,n,o)}function Ae(e){let{api:t,apiConfig:n,apiVersion:o,virtualEnv:s,extensionTarget:i,dataDir:a,catalog:r}=e,l=[],g=[],u=new Set,S=!1,T,b=n.versioned===!0,m=n.extensionSurfaceName,p=he(a),c=Se(a),w=c[t],A=(r[t]??[]).map(d=>d.name),E;if(b){if(o&&A.length>0&&!A.includes(o))return{missingPackages:l,searchedPaths:g,shopifyWebComponents:u,applicablePackageNames:[],hasTargetSubpath:S,unsupportedVersion:{requested:o,supported:A}};E=o??r[t]?.find(d=>d.latestVersion)?.name}else E="_";let V=b?E:void 0,v=n.publicPackages.filter(d=>Y(d,V)),F=v.map(j),L=new Set(n.publicPackages.filter(d=>!Y(d,V)).map(j)),k=(E?w?.[E]??[]:[]).filter(d=>!L.has(d.package));if(k.length===0&&v.length>0)for(let d of v){let M=j(d);l.push(M),g.push(x(p,M,E??"<unknown-version>"))}let D=c._always_loaded??[],G=[...k,...D],P=s.servicesHost.getCurrentDirectory();for(let{package:d,version:M}of G){let _=x(p,d,M),ee=C(_,"package.json");if(ee===void 0){l.push(d),g.push(_);continue}if(I(s,P,d,"package.json",ee),Xe(_,d,s,P),d==="@shopify/ui-extensions"&&m)if(i){let H=Qe(_,d,s,P,m,i,u);S=H.hasTargetSubpath,H.invalidTarget&&(T=H.invalidTarget)}else R(_,d,s,P,u,z(m));else d==="@shopify/ui-extensions-react"&&m?R(_,d,s,P,u,z(m)):R(_,d,s,P,u);d==="@shopify/app-bridge-types"&&et(s,P)}return{missingPackages:l,searchedPaths:g,shopifyWebComponents:u,applicablePackageNames:F,hasTargetSubpath:S,invalidTarget:T}}f();function tt(e,t){return e.map(n=>t&&n.includes("@shopify/ui-extensions")?`import '${n}/${t}';`:`import '${n}';`).join(`
|
|
4
4
|
`)}function nt(e,t,n){if(t.includes("@shopify/ui-extensions")&&!n)throw new Error("Invalid input: extensionTarget is required");let o=tt(t,n);if(e&&(e.includes("const shopify =")||e.includes("globalThis.shopify")))return o;let s=t.find(i=>i.includes("@shopify/ui-extensions"))&&n?`interface ShopifyApiOverride extends Omit<import('@shopify/ui-extensions/${n}').Api, 'query'> { query: (...args: any[]) => Promise<{ data: any; errors?: any[] }>; } const shopify: ShopifyApiOverride = (globalThis as any).shopify;`:"";return`${o}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-OM3YN7ZK.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
|