shopify 4.7.0 → 4.7.1
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-5SII3GTA.js +1 -0
- package/dist/{analytics-6LI5GLWS.js → analytics-F56E2NGH.js} +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-LDF4PQ3B.js → chunk-22NROZ5X.js} +1 -1
- package/dist/{chunk-XHZ5BWXL.js → chunk-22NWEE5U.js} +1 -1
- package/dist/{chunk-2CYVZUYT.js → chunk-26DH5P7S.js} +1 -1
- package/dist/{chunk-CIH6LPTG.js → chunk-27UEK3FU.js} +1 -1
- package/dist/{chunk-7JIQXGDE.js → chunk-2F2DXTRI.js} +1 -1
- package/dist/{chunk-TSLQZTXR.js → chunk-2S3GOPRL.js} +1 -1
- package/dist/{chunk-LWJA2DQG.js → chunk-3HCWJRL6.js} +1 -1
- package/dist/{chunk-OORWOTAP.js → chunk-3KM2GKXH.js} +1 -1
- package/dist/{chunk-Q5DQGV3M.js → chunk-3MN3WLA2.js} +1 -1
- package/dist/{chunk-RY2SJVWM.js → chunk-3WV7DQMM.js} +3 -3
- package/dist/{chunk-JQ2B3VHR.js → chunk-46BKAF3F.js} +1 -1
- package/dist/{chunk-YUVE2I3C.js → chunk-4FCS6PJY.js} +1 -1
- package/dist/{chunk-L67BU25M.js → chunk-4FI2YBRF.js} +1 -1
- package/dist/{chunk-H5KWM27L.js → chunk-4I7TUB3K.js} +1 -1
- package/dist/chunk-4NXLDIW5.js +1 -0
- package/dist/{chunk-XAOYKECS.js → chunk-4VJ6YK7U.js} +1 -1
- package/dist/{chunk-7DOWT5JZ.js → chunk-4WGJUVXS.js} +1 -1
- package/dist/{chunk-6WZYX5RO.js → chunk-53IU36CL.js} +1 -1
- package/dist/{chunk-LZ3GZ7NS.js → chunk-5JW4JQWZ.js} +1 -1
- package/dist/{chunk-SYADOUBB.js → chunk-5MD7GNEY.js} +1 -1
- package/dist/chunk-5QZHJCZM.js +1 -0
- package/dist/{chunk-XRT2W5Y2.js → chunk-5WGT45CO.js} +1 -1
- package/dist/{chunk-V5SC2RYQ.js → chunk-6AV6GX5W.js} +1 -1
- package/dist/{chunk-N6YTJXIS.js → chunk-6ELAWKMY.js} +1 -1
- package/dist/{chunk-CTRXLZAJ.js → chunk-6G5TDB45.js} +1 -1
- package/dist/{chunk-JQISGC7D.js → chunk-6K3AJTNO.js} +1 -1
- package/dist/{chunk-QBIVQXUJ.js → chunk-6QJIGFQJ.js} +1 -1
- package/dist/{chunk-EW55WWT7.js → chunk-6R62DGJG.js} +1 -1
- package/dist/{chunk-ZO74GSWC.js → chunk-6SM4RY3I.js} +1 -1
- package/dist/chunk-76NEIDP5.js +1 -0
- package/dist/{chunk-5CADTCJE.js → chunk-77AC3OJQ.js} +1 -1
- package/dist/{chunk-MLZLDL6B.js → chunk-7EUIO4ZO.js} +1 -1
- package/dist/{chunk-YHPBDS52.js → chunk-7JIYJMRN.js} +1 -1
- package/dist/{chunk-VRVP2GQL.js → chunk-7S73765P.js} +1 -1
- package/dist/{chunk-AGOEROAI.js → chunk-AFT6ABDE.js} +1 -1
- package/dist/{chunk-DMXQLI35.js → chunk-AIA7JVSJ.js} +1 -1
- package/dist/{chunk-GKOBFX4A.js → chunk-AWHS336T.js} +1 -1
- package/dist/{chunk-R2R6JDNH.js → chunk-BI7LE6CZ.js} +1 -1
- package/dist/{chunk-WHLGNDRE.js → chunk-CNMJ6QXM.js} +1 -1
- package/dist/{chunk-LJM2DUXN.js → chunk-CRP4PQU2.js} +1 -1
- package/dist/{chunk-AH2ZGMDM.js → chunk-CUUCRIGC.js} +1 -1
- package/dist/{chunk-PWSI275S.js → chunk-DEMZRLX5.js} +1 -1
- package/dist/{chunk-HLNJL4B6.js → chunk-DLSUDLXD.js} +1 -1
- package/dist/{chunk-PAAKBWSF.js → chunk-DMFEYI4G.js} +1 -1
- package/dist/{chunk-4W3UE2ZI.js → chunk-ELSDVDT7.js} +1 -1
- package/dist/{chunk-7AALWJAO.js → chunk-EMETQFFJ.js} +1 -1
- package/dist/chunk-ESPT6CGE.js +1 -0
- package/dist/{chunk-UPJLZHHR.js → chunk-EULSSTWY.js} +1 -1
- package/dist/{chunk-E2W5OYYM.js → chunk-EWS2RNM6.js} +1 -1
- package/dist/{chunk-6PDR2IUL.js → chunk-FAXNGDWI.js} +1 -1
- package/dist/{chunk-2JDCVEFK.js → chunk-FELV7GWY.js} +1 -1
- package/dist/{chunk-VKSR6MJG.js → chunk-FQQXU5IN.js} +1 -1
- package/dist/{chunk-ACTDYTAV.js → chunk-GFWXVO72.js} +1 -1
- package/dist/{chunk-2SZOPJYI.js → chunk-GJ4A4QKE.js} +1 -1
- package/dist/{chunk-KK24VGVE.js → chunk-GW4JHUIA.js} +1 -1
- package/dist/{chunk-XLURZ6GL.js → chunk-GXOFJIKQ.js} +1 -1
- package/dist/{chunk-X4XP2RQJ.js → chunk-HCQABTQL.js} +1 -1
- package/dist/{chunk-TY4W7AYX.js → chunk-HOVIGRE4.js} +1 -1
- package/dist/{chunk-Y34LWI3S.js → chunk-HQUWYKSJ.js} +3 -3
- package/dist/{chunk-MRCWOOSF.js → chunk-HRHNJFAA.js} +1 -1
- package/dist/{chunk-U6HYEGAE.js → chunk-HU4GFVEN.js} +1 -1
- package/dist/{chunk-JZMRBJH3.js → chunk-I2LNQKIJ.js} +2 -2
- package/dist/{chunk-I3N6NPHF.js → chunk-I6XH7XDX.js} +1 -1
- package/dist/{chunk-QKGZWOOY.js → chunk-IA3XNJ56.js} +1 -1
- package/dist/{chunk-KIYHEMHD.js → chunk-IENBHP2S.js} +2 -2
- package/dist/{chunk-D2K2ZBKH.js → chunk-IF6EYTHG.js} +2 -2
- package/dist/{chunk-ZCNIR6YU.js → chunk-IQT6LOA2.js} +1 -1
- package/dist/{chunk-JJJTPEMD.js → chunk-IX4IGE5H.js} +1 -1
- package/dist/{chunk-WCRZJY3P.js → chunk-J2VRPZFC.js} +1 -1
- package/dist/{chunk-P5MNNBSO.js → chunk-JJSV7HNM.js} +1 -1
- package/dist/{chunk-E5T4YRGW.js → chunk-JNIPCLAF.js} +1 -1
- package/dist/{chunk-HZIX3DIT.js → chunk-JNVCCE6M.js} +1 -1
- package/dist/{chunk-LQCR4TGH.js → chunk-JQUEW7CB.js} +1 -1
- package/dist/{chunk-GSCWZR22.js → chunk-K3VLFPPI.js} +1 -1
- package/dist/{chunk-4JY2P2A5.js → chunk-K63FW7Q7.js} +1 -1
- package/dist/{chunk-CZJZCJRX.js → chunk-KBBITJSF.js} +1 -1
- package/dist/{chunk-4LRG5YBS.js → chunk-KDBKEVCF.js} +1 -1
- package/dist/{chunk-FWPJEL6Q.js → chunk-KNVHXIEB.js} +1 -1
- package/dist/{chunk-CMYQXGLO.js → chunk-KRLEEYLL.js} +1 -1
- package/dist/{chunk-2U4P6UFZ.js → chunk-KT5MDCII.js} +1 -1
- package/dist/{chunk-U2Z5NMXV.js → chunk-LBREJXT6.js} +1 -1
- package/dist/{chunk-ZRLEAF7M.js → chunk-LKQ3EJ6Z.js} +1 -1
- package/dist/{chunk-HHVHVGRT.js → chunk-LKZQSER3.js} +1 -1
- package/dist/{chunk-ZSFAURIH.js → chunk-M5Q74UZM.js} +1 -1
- package/dist/{chunk-V2HCVJYF.js → chunk-MK7MOLLI.js} +1 -1
- package/dist/{chunk-JUKAWTYY.js → chunk-MTTBBZSR.js} +1 -1
- package/dist/{chunk-LRQYUWWB.js → chunk-N4KDWHT2.js} +1 -1
- package/dist/{chunk-XCBEYRQI.js → chunk-N7425436.js} +1 -1
- package/dist/{chunk-5CR5YJTU.js → chunk-NSZHEXZK.js} +1 -1
- package/dist/{chunk-RUFQCXBX.js → chunk-O4G6TE26.js} +1 -1
- package/dist/{chunk-XUEMMLXK.js → chunk-O4RHWBBM.js} +1 -1
- package/dist/{chunk-AMLWPYNA.js → chunk-O53YIDJL.js} +1 -1
- package/dist/{chunk-DHU57LKD.js → chunk-OF6CV5R4.js} +1 -1
- package/dist/{chunk-QEB3HUQE.js → chunk-OJSJWGP2.js} +1 -1
- package/dist/{chunk-QRT4A2RV.js → chunk-OQWMCJLY.js} +1 -1
- package/dist/{chunk-7MHANY34.js → chunk-P5OQUFH6.js} +1 -1
- package/dist/{chunk-DQCIORGH.js → chunk-P5WLH64A.js} +1 -1
- package/dist/{chunk-OE3F7XXU.js → chunk-PE4TV5IJ.js} +1 -1
- package/dist/{chunk-CZPGC2E7.js → chunk-PEHLR7XP.js} +1 -1
- package/dist/{chunk-YN6A26QL.js → chunk-PK73ZSND.js} +4 -4
- package/dist/{chunk-FULWTZS6.js → chunk-PQG7XSQP.js} +1 -1
- package/dist/{chunk-3K6VHXC2.js → chunk-PS2UVFHP.js} +1 -1
- package/dist/{chunk-T5JXQ7KO.js → chunk-PU3NATV4.js} +1 -1
- package/dist/{chunk-6VRXGEIW.js → chunk-PV6T52KB.js} +1 -1
- package/dist/{chunk-JQVXH26X.js → chunk-QASOHYDS.js} +1 -1
- package/dist/{chunk-MB7E5GEY.js → chunk-QHLY2IID.js} +1 -1
- package/dist/{chunk-SJMTETSU.js → chunk-QT367CYF.js} +1 -1
- package/dist/{chunk-2WJAAJVX.js → chunk-R2RULBBV.js} +1 -1
- package/dist/{chunk-QXHENYJH.js → chunk-R5EGWWZH.js} +1 -1
- package/dist/{chunk-KUNDCAQN.js → chunk-RA3WWB2S.js} +1 -1
- package/dist/{chunk-GLWQMLUC.js → chunk-RM3B7AFT.js} +1 -1
- package/dist/{chunk-UVQL7RUY.js → chunk-RXUOQZ32.js} +1 -1
- package/dist/{chunk-GZ64KWHX.js → chunk-RY4MPX5A.js} +1 -1
- package/dist/{chunk-5NO5OXYP.js → chunk-RY4YUBG3.js} +1 -1
- package/dist/{chunk-DKL6N3L2.js → chunk-S2WUVD7V.js} +1 -1
- package/dist/{chunk-SSJGWLCW.js → chunk-SCXL5UQ4.js} +1 -1
- package/dist/{chunk-YIZZ5LZN.js → chunk-SGIMJQEM.js} +1 -1
- package/dist/{chunk-KCS75ZM4.js → chunk-SJGPJDGH.js} +1 -1
- package/dist/{chunk-F5HCSUXC.js → chunk-SPE2D366.js} +1 -1
- package/dist/{chunk-CFWHR74L.js → chunk-SYF6LGQB.js} +1 -1
- package/dist/{chunk-PIFW2R3S.js → chunk-TP4Z5OZT.js} +1 -1
- package/dist/{chunk-6ENBE43F.js → chunk-U3F6GPCE.js} +1 -1
- package/dist/{chunk-SEVSMWNX.js → chunk-U46RPVQA.js} +1 -1
- package/dist/{chunk-CYOFLJ3Z.js → chunk-UAJBQEGE.js} +1 -1
- package/dist/{chunk-QZBSCOJV.js → chunk-UK4WXL4G.js} +1 -1
- package/dist/{chunk-CHMEDVDZ.js → chunk-ULR25PTO.js} +1 -1
- package/dist/{chunk-7WTNEG2F.js → chunk-USBP7H7J.js} +1 -1
- package/dist/{chunk-4HV6A6UH.js → chunk-UZV5H2JI.js} +1 -1
- package/dist/{chunk-6EBLULOC.js → chunk-UZVON6GP.js} +1 -1
- package/dist/{chunk-Z5K4J7HQ.js → chunk-VI5FF6SW.js} +1 -1
- package/dist/{chunk-6VGJVXZI.js → chunk-VPY47DBW.js} +1 -1
- package/dist/{chunk-S3P5WWJD.js → chunk-VRH3HWYA.js} +1 -1
- package/dist/{chunk-37TEEITE.js → chunk-VXX4EZ7G.js} +1 -1
- package/dist/{chunk-WKUGSFTB.js → chunk-VXYABRFY.js} +1 -1
- package/dist/{chunk-KOVAFUYN.js → chunk-WEWLPJK2.js} +1 -1
- package/dist/{chunk-TTAPXLI5.js → chunk-WMZS3Y4Z.js} +1 -1
- package/dist/{chunk-JZXA3H5K.js → chunk-WOIAYH5U.js} +1 -1
- package/dist/{chunk-6OFGSZD6.js → chunk-WR6LRE4I.js} +1 -1
- package/dist/{chunk-GMTNOCMS.js → chunk-WSCSFFLH.js} +2 -2
- package/dist/{chunk-K4KTNINH.js → chunk-WTES5ZXR.js} +1 -1
- package/dist/{chunk-BR6DBMQA.js → chunk-WXSDPMIZ.js} +1 -1
- package/dist/{chunk-YOO7DLOT.js → chunk-X5JQU6T7.js} +1 -1
- package/dist/{chunk-2HK4MFWP.js → chunk-XMJFT4WP.js} +1 -1
- package/dist/{chunk-63CIFL36.js → chunk-XMQFQUUK.js} +1 -1
- package/dist/{chunk-EOMCXBCS.js → chunk-XTXYS7LB.js} +1 -1
- package/dist/{chunk-QPWMD2VR.js → chunk-Y6UZW73M.js} +1 -1
- package/dist/{chunk-FCGKO2KY.js → chunk-YCU7ZCIG.js} +1 -1
- package/dist/{chunk-TYIGOVRQ.js → chunk-YFKEESYB.js} +1 -1
- package/dist/{chunk-U7R6LYPJ.js → chunk-YXDIHVPY.js} +1 -1
- package/dist/{chunk-TCTVI6PK.js → chunk-Z66ZSXKB.js} +1 -1
- package/dist/{chunk-PANGX7SA.js → chunk-ZBSC2KZ7.js} +1 -1
- package/dist/{chunk-5HPBQ6U5.js → chunk-ZDDLEFVO.js} +1 -1
- package/dist/{chunk-DQFSKPKL.js → chunk-ZULQKYJ6.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/send-analytics.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/version.js +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-OAGJBITE.js → conf-store-QQ4DOFI3.js} +1 -1
- package/dist/{deprecations-K3NPRKBF.js → deprecations-43ZQ5RCE.js} +1 -1
- package/dist/dist-E7EGYE4D.js +1 -0
- package/dist/dist-WRUROUNV.js +1 -0
- package/dist/{environments-ALH2N36U.js → environments-RG64VB5R.js} +1 -1
- package/dist/{error-YX56C43A.js → error-26WTDNKZ.js} +1 -1
- package/dist/error-handler-XFH47Y75.js +1 -0
- package/dist/{fs-SKHQZZTQ.js → fs-Y7I3Y5IR.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 +15 -15
- package/dist/{is-global-V5VORI3F.js → is-global-WBIBPIVZ.js} +1 -1
- package/dist/{local-GX5AN6ZS.js → local-HF4T3FFE.js} +1 -1
- package/dist/{metadata-XUJUTBTB.js → metadata-CSQPNQP2.js} +1 -1
- package/dist/{node-package-manager-3WIYU7Y3.js → node-package-manager-CVEU22N7.js} +1 -1
- package/dist/notifications-system-L3FMN6EX.js +1 -0
- package/dist/os-VLZLRAHR.js +1 -0
- package/dist/{output-X47P6ICP.js → output-E6OGPGXL.js} +1 -1
- package/dist/{system-SR5G7WEW.js → system-ZETSJRKS.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-VYWSLAQ6.js → ui-7TVGGEWJ.js} +1 -1
- package/dist/upgrade-F77O4ZDT.js +1 -0
- package/dist/version-3L3ANUTL.js +1 -0
- package/dist/{version-FK4ETQ22.js → version-DL4Y6DRX.js} +1 -1
- package/dist/{workerd-NAPS5TA7.js → workerd-EHI5ZCEV.js} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
- package/dist/analytics-UNRIIG4Y.js +0 -1
- package/dist/chunk-5CYJG63I.js +0 -1
- package/dist/chunk-NEMPLS7C.js +0 -1
- package/dist/chunk-OUZGGWFN.js +0 -1
- package/dist/chunk-RZFBGBNA.js +0 -1
- package/dist/dist-EXJEE23W.js +0 -1
- package/dist/dist-S62Z6IFV.js +0 -1
- package/dist/error-handler-FDCH72NH.js +0 -1
- package/dist/notifications-system-RHULO564.js +0 -1
- package/dist/os-M6X7KOR4.js +0 -1
- package/dist/upgrade-PFQ7JMXG.js +0 -1
- package/dist/version-U4GM2LNG.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as j,S as X,_ as z,aa as v,ba as J,ca as A,da as W,ea as k,fa as q,ga as N,ha as B,ia as L,ja as K,ka as R,la as Q}from"./chunk-
|
|
1
|
+
import{$ as j,S as X,_ as z,aa as v,ba as J,ca as A,da as W,ea as k,fa as q,ga as N,ha as B,ia as L,ja as K,ka as R,la as Q}from"./chunk-GFWXVO72.js";import{f as T,i as G,p as l}from"./chunk-SPE2D366.js";import{c as H}from"./chunk-IENBHP2S.js";import{D as x,z as U}from"./chunk-WSCSFFLH.js";import{h as C,j as P}from"./chunk-BI7LE6CZ.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-HQUWYKSJ.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
|
|
2
2
|
`)})}s();async function Lt({developerPlatformClient:e,apiKey:t,organizationId:i,extensionTypes:o,onlyDashboardManaged:n=!1}){let r=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:i}),{dashboardManagedExtensionRegistrations:p,extensionRegistrations:a}=r.app;return(n?p:a.concat(p)).filter(u=>{let h=o.includes(u.type.toLowerCase()),f=u.activeVersion&&u.activeVersion.config,m=u.draftVersion&&u.draftVersion.config;return h&&(f??m)})}export{se as a,ft as b,vt as c,Ce as d,we as e,At as f,Lt as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ee,e as ne,f as te,g as oe}from"./chunk-
|
|
1
|
+
import{c as ee,e as ne,f as te,g as oe}from"./chunk-6AV6GX5W.js";import{a as J,c as Z,d as Q,e as X}from"./chunk-HOVIGRE4.js";import{b as I}from"./chunk-KBBITJSF.js";import{a as q}from"./chunk-ESPT6CGE.js";import{a as j}from"./chunk-RA3WWB2S.js";import{D as G,G as K,V as W,g as Y,sa as H}from"./chunk-GFWXVO72.js";import{a as z}from"./chunk-HU4GFVEN.js";import{b as V}from"./chunk-IX4IGE5H.js";import{E as U,H as B,M as $,x as O,y as F,z as M}from"./chunk-WSCSFFLH.js";import{d as L}from"./chunk-6K3AJTNO.js";import{h,j as N}from"./chunk-BI7LE6CZ.js";import{a as ce}from"./chunk-CTNBSUVU.js";import{Ca as R,Cb as C,L as D,rb as S,wa as E,xb as A}from"./chunk-HQUWYKSJ.js";import{d as x,i as T}from"./chunk-773TIA5M.js";import{e as pe,g}from"./chunk-VKWPEFWQ.js";g();g();g();async function ie(e){let n,t;e.bundlePath&&(n=await X(e.developerPlatformClient,{id:e.apiKey,apiKey:e.apiKey,organizationId:e.organizationId}),await Q(n,e.bundlePath));let o={appManifest:e.appManifest,appId:e.appId,apiKey:e.apiKey,name:e.name,organizationId:e.organizationId,skipPublish:!e.release,message:e.message,versionTag:e.version,commitReference:e.commitReference};n&&(o.bundleUrl=n),e.appModules.length>0&&(o.appModules=e.appModules);let a=await e.developerPlatformClient.deploy(o);if(!a.appDeploy.appVersion){let i=ue(a.appDeploy.userErrors??[],e.appModuleRegistrationIds,e.appModules,{version:e.version});throw new h({bold:"Version couldn't be created."},null,[],i)}return a.appDeploy.userErrors?.length>0&&(t=a.appDeploy.userErrors.map(i=>i.message).join(", ")),{validationErrors:a.appDeploy.appVersion.appModuleVersions.filter(i=>i.validationErrors.length>0).map(i=>({uuid:i.registrationUuid,errors:i.validationErrors})),versionTag:a.appDeploy.appVersion.versionTag,location:a.appDeploy.appVersion.location,message:a.appDeploy.appVersion.message,deployError:t}}var v=`
|
|
2
2
|
Validation errors`,k=`
|
|
3
3
|
`;function ue(e,n,t,o={}){let a=l=>l.details?.some(y=>y.extension_id)??!1,s=(l,y)=>{let b=l.details?.find(_=>typeof _.extension_id<"u")?.extension_id??"";return Object.values(y).includes(b.toString())},i=l=>{let y=l.on?l.on[0]:void 0;return t.some(b=>b.uid===y?.user_identifier)},[d,u]=I(e,l=>i(l)),[p,c]=I(u,l=>a(l)),[f,r]=I(p,l=>s(l,n));return[...me(c,{version:o.version}),...fe(f,n),...he(r),...ge(d,t)]}function me(e,n={}){return e.length>0?e.filter(t=>t.field&&t.field.includes("version_tag")&&t.message==="has already been taken").length>0&&n.version?[{body:["An app version with the name",{userInput:n.version},"already exists. Deploy again with a different version name."]}]:e.length===1?[{body:e[0]?.message??""}]:[{body:{list:{items:e.map(t=>t.message)}}}]:[]}function fe(e,n){return e.reduce((t,o)=>{let a=(o.field??["unknown"]).join(".").replace("extension_points","extensions.targeting"),s=a==="base"?o.message:`${a}: ${o.message}`,i=o.details.find(r=>typeof r.extension_title<"u")?.extension_title,d=o.details.find(r=>typeof r.specification_identifier<"u")?.specification_identifier,u=o.details.find(r=>typeof r.extension_id<"u")?.extension_id?.toString(),c=Object.keys(n).find(r=>n[r]===u)??i;d==="webhook_subscription"&&(c="Webhook Subscription");let f=t.find(r=>r.title===c);if(f){let r=f.body,m=o.category==="invalid"?r.find(l=>l.list.title===v):r.find(l=>l.list.title===k);m?m.list.items.includes(s)||m.list.items.push(s):r.push({list:{title:o.category==="invalid"?v:k,items:[s]}})}else t.push({title:c,body:[{list:{title:o.category==="invalid"?v:k,items:[s]}}]});return t.forEach(r=>{r.body.sort((m,l)=>m.list.title===v?1:l.list.title===v?-1:0)}),t},[])}function ge(e,n){return e.reduce((t,o)=>{let s=(o.on?o.on[0]:void 0)?.user_identifier,i=n.find(r=>r.uid===s),d=s?`Extension with uid: ${s}`:"Unknown Extension",u=i?.handle??d,c=`${(o.field??["unknown"]).join(".")}: ${o.message}`,f=t.find(r=>r.title===u);if(f){let m=f.body.find(l=>l.list.title===v);m&&(m.list.items.includes(c)||m.list.items.push(c))}else t.push({title:u,body:[{list:{title:v,items:[c]}}]});return t},[])}function he(e){return e.reduce((n,t)=>{let o=t.details.find(s=>typeof s.extension_title<"u")?.extension_title,a=n.find(s=>s.title===o);return a?a.errorCount+=1:n.push({title:o,errorCount:1}),n},[]).map(n=>({title:n.title,body:`
|
|
4
4
|
${n.errorCount} error${n.errorCount>1?"s":""} found in your extensions. Fix these issues and try deploying again.`}))}g();async function ae(e){let n=x(e.app.directory,".shopify","deploy-bundle");await R(n,{force:!0}),await E(n),await J(e.appManifest,n),e.skipBuild||await Y(e.app);let t=e.app.allExtensions.map(a=>({prefix:a.localIdentifier,action:async(s,i,d)=>{await a.buildForBundle({stderr:i,stdout:s,signal:d,app:e.app,environment:"production",skipBuild:e.skipBuild},n)}}));if(await O({processes:t,showTimestamps:!1}),e.app.allExtensions.some(a=>a.hasDeploySteps))return await Z(n,e.bundlePath),e.bundlePath}async function ye(e){let{app:n,remoteApp:t,developerPlatformClient:o,noRelease:a,allowUpdates:s,allowDeletes:i,extensions:d}=e,u=[a,s,i].some(Boolean),p=[`App can't be deployed until Partner Dashboard managed extensions are added to your version or removed from your app:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as f,ja as v,k as d,ka as A,n as w,v as m}from"./chunk-
|
|
1
|
+
import{I as f,ja as v,k as d,ka as A,n as w,v as m}from"./chunk-PK73ZSND.js";import{b as l}from"./chunk-AFT6ABDE.js";import{h as p,k as F}from"./chunk-BI7LE6CZ.js";import{qb as V,sb as h}from"./chunk-HQUWYKSJ.js";import{i as q}from"./chunk-DPNZWBT5.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e,o){let a="Admin",u=o??await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,u,r);return v({query:t,api:a,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:u,preferredBehaviour:n}=t,s=a??S.get(e.storeFqdn);s??=await b(e,n);let i=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=i,i=new m().host("app"));let D={url:x(i,s,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:u,unauthorizedHandler:y,preferredBehaviour:n})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:g,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${V.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as b}from"./chunk-
|
|
1
|
+
import{f as b}from"./chunk-4VJ6YK7U.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();import{performance as u}from"node:perf_hooks";function w(){return b()?"bubble":"mute-and-report"}function h(g={}){let i={sensitive:{},public:{...g}},p=t=>{Object.assign(i.public,t)},M=t=>{Object.assign(i.sensitive,t)},l=async(t,e,n)=>{let r=n==="auto"?w():n,s=async()=>{let c=await e();t(c)};if(r==="bubble")await s();else try{await s()}catch(c){let{sendErrorToBugsnag:o}=await import("./error-handler-XFH47Y75.js");await o(c,"unexpected_error")}},a=[];return{getAllPublicMetadata:()=>({...i.public}),getAllSensitiveMetadata:()=>({...i.sensitive}),addPublicMetadata:async(t,e="auto")=>l(p,t,e),addSensitiveMetadata:async(t,e="auto")=>l(M,t,e),runWithTimer:t=>async e=>{a.push(0);let n=u.now();try{return await e()}finally{let r=u.now();r=Math.max(n,r);let s=Math.max(r-n,0),c=a.pop(),o=Math.max(s-c,0);a.length>0&&(a[a.length-1]=(a[a.length-1]??0)+s),u.measure(`${t}#measurable`,{start:n,duration:o}),u.measure(`${t}#wall`,{start:n,end:r});let d=i.public[t]||0;d+=o,i.public[t]=d}}}}var y=h({cmd_all_timing_network_ms:0,cmd_all_timing_prompts_ms:0}),{getAllPublicMetadata:S,getAllSensitiveMetadata:f,addPublicMetadata:x,addSensitiveMetadata:A,runWithTimer:P}=y;export{h as a,S as b,f as c,x as d,A as e,P as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-P5WLH64A.js";import{a as p}from"./chunk-WEWLPJK2.js";import{f as c,o as v}from"./chunk-K63FW7Q7.js";import{p as l,v as d}from"./chunk-3KM2GKXH.js";import{b as s,f as h}from"./chunk-IX4IGE5H.js";import{z as a}from"./chunk-WSCSFFLH.js";import{a as w}from"./chunk-CTNBSUVU.js";import{e as F,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function u(e,n){let m=e.name??await c("New name for the theme"),i=await f(n,{header:"Select a theme to rename",filter:{theme:e.theme,development:e.development,live:e.live}});await v(i.id,{name:m},n),a({body:[...e.environment?[{subdued:`Environment: ${e.environment}
|
|
2
2
|
|
|
3
3
|
`}]:[],"The theme",...p(i),"was renamed to",`'${m}'`]})}var t=F(w(),1);var o=class extends d{static summary="Renames an existing theme.";static descriptionWithMarkdown=`Renames a theme in your store.
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as x,c as D,f as M}from"./chunk-
|
|
1
|
+
import{b as x,c as D,f as M}from"./chunk-OQWMCJLY.js";import{c as w}from"./chunk-PK73ZSND.js";import{D as s,G as h,J as e,z as y}from"./chunk-WSCSFFLH.js";import{a as o}from"./chunk-76NEIDP5.js";import{ua as u,xb as _}from"./chunk-HQUWYKSJ.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();async function $(){let a=new Date,n=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${a.getDate().toString().padStart(2,"0")}`,i=w(),t=await s({message:"Type of message?",choices:[{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}]}),b=await e({message:"Title"}),E=await e({message:"Message"}),S=await s({message:"Frequency",choices:[{label:"Only once",value:"once"},{label:"Once a week",value:"once_a_week"},{label:"Once a day",value:"once_a_day"},{label:"Always",value:"always"}]}),r=await e({message:"Minimum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),l=await e({message:"Maximum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),m=await e({message:"Minimum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),c=await e({message:"Maximum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),f=await e({message:"Surface. E.g.: app, theme, hydrogen, theme_app_extension... (optional)",allowEmpty:!0}),g=await e({message:"Comma separated list of commands. E.g.: app:generate:extension (optional)",allowEmpty:!0}),T=await e({message:"Slack channel of the team who will own this notification"}),d=await x(),v={id:i,type:t,title:b,frequency:S,message:E,minVersion:r.length===0?void 0:r,maxVersion:l.length===0?void 0:l,minDate:m.length===0?void 0:m,maxDate:c.length===0?void 0:c,surface:f.length===0?void 0:f,commands:g.length===0?void 0:g.split(",").map(N=>N.trim()),ownerChannel:T};d.notifications.push(v),await u("./notifications.json",JSON.stringify(d)),y({headline:"notifications.json file updated successfully."})}async function j(){let a=await D(),n={type:{header:"Type",color:"dim"},title:{header:"Title",color:"dim"},message:{header:"Message",color:"dim"},filters:{header:"Filters",color:"dim"}},i=a.notifications.map(t=>({type:t.type,title:t.title??"",message:t.message,filters:M(t)}));h({rows:i,columns:n}),_(`
|
|
2
2
|
`)}export{$ as a,j as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Z as a,i}from"./chunk-
|
|
1
|
+
import{Z as a,i}from"./chunk-GFWXVO72.js";import{qb as e,sb as r}from"./chunk-HQUWYKSJ.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();async function f(n,t,o){return c(n,t,o,"text")}async function c(n,t,o,S){return await a(t,o.source),S==="json"?r`${e.json({SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:i(n.configuration)})}`:r`
|
|
2
2
|
${e.green("SHOPIFY_API_KEY")}=${t.apiKey}
|
|
3
3
|
${e.green("SHOPIFY_API_SECRET")}=${t.apiSecretKeys[0]?.secret??""}
|
|
4
4
|
${e.green("SCOPES")}=${i(n.configuration)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as I}from"./chunk-VKWPEFWQ.js";I();var o="4.7.1";export{o as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as A,b as S,c as E,d as i,e as k,f as F,g as L,h as M,i as _}from"./chunk-
|
|
1
|
+
import{a as A,b as S,c as E,d as i,e as k,f as F,g as L,h as M,i as _}from"./chunk-PQG7XSQP.js";import{a as I}from"./chunk-ESPT6CGE.js";import{a as b}from"./chunk-RA3WWB2S.js";import{Y as P,sa as T}from"./chunk-GFWXVO72.js";import{f as l}from"./chunk-IX4IGE5H.js";import{D as p,F as g,J as v}from"./chunk-WSCSFFLH.js";import{a as G}from"./chunk-CTNBSUVU.js";import{Bb as u,Db as w,yb as h}from"./chunk-HQUWYKSJ.js";import{j as y}from"./chunk-773TIA5M.js";import{e as q,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();a();async function H(e,t,r){let o={api_version:t},{webhookTopics:s}=await e.topics(o,r);return s}a();async function V(e){let t=e.map(o=>({label:o,value:o}));return await g({message:"Webhook Topic",choices:t})}async function C(e){return p({message:"Webhook ApiVersion",choices:e.map(t=>({label:t,value:t}))})}async function R(){return p({message:"Delivery method",choices:[{label:"HTTP",value:i.HTTP},{label:"Google Pub/Sub",value:i.PUBSUB},{label:"Amazon EventBridge",value:i.EVENTBRIDGE}]})}async function D(e){return(await v({message:"Address for delivery",validate:r=>{let o=r.trim();if(o.length===0)return"Address can't be empty";if(!k(o,e))return`Invalid address.
|
|
2
2
|
${d(e)}`}})).trim()}function U(e){return e===i.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:e===i.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:e===i.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function d(e){return U(e).map(t=>` \xB7 ${w(t)}`).join(`
|
|
3
3
|
`)}async function x(e,t){let{clientSecret:r,clientId:o,remoteApp:s,app:c}=e;return r&&(o||t!==i.EVENTBRIDGE)?{clientSecret:r,apiKey:o}:(P({appName:s.title,configFile:y(c.configPath)}),{clientSecret:s.apiSecretKeys.find(f=>f.secret).secret,apiKey:s.apiKey})}async function O(e,t,r){let o=await A(e,r);return t?L(t,o):C(o)}async function B(e,t,r,o){let s=await H(e,t,o);return r?M(r,t,s):V(s)}async function N(e,t){let r=e??_(t)??await R(),o=t??await D(r);return F(o,r)}async function Y(e){let t=await W(e);await z(t)}async function W(e){let t=await O(e.developerPlatformClient,e.apiVersion,e.organizationId),r=await B(e.developerPlatformClient,t,e.topic,e.organizationId),[o,s]=await N(e.deliveryMethod,e.address),c=await x(e,s);return{topic:r,apiVersion:t,deliveryMethod:s,address:o,apiKey:c.apiKey,clientSecret:c.clientSecret,developerPlatformClient:e.developerPlatformClient,organizationId:e.organizationId}}async function z(e){let t={topic:e.topic,api_version:e.apiVersion,address:e.address,delivery_method:e.deliveryMethod,shared_secret:e.clientSecret,api_key:e.apiKey},r=await S(e.developerPlatformClient,t,e.organizationId);if(!r.success){u(`Request errors:
|
|
4
4
|
${K(r.userErrors)}`);return}if(e.deliveryMethod===i.LOCALHOST){if(await E(e.address,r.samplePayload,r.headers)){h("Localhost delivery sucessful");return}u("Localhost delivery failed");return}r.samplePayload===JSON.stringify({})&&h("Webhook has been enqueued for delivery")}function K(e){try{return e.map(t=>JSON.parse(t.message).map(r=>` \xB7 ${r}`).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-
|
|
1
|
+
import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-5JW4JQWZ.js";import{a as M,l as gt,m as yt}from"./chunk-K63FW7Q7.js";import{s as ie,t as W}from"./chunk-3KM2GKXH.js";import{a as O,b as N,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as $,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-TP4Z5OZT.js";import{b as Ke,xa as L,za as H}from"./chunk-PK73ZSND.js";import{A as I,B as te,C as tt,T as st,y as et}from"./chunk-WSCSFFLH.js";import{h as se}from"./chunk-BI7LE6CZ.js";import{Ab as F,Bb as D,O as Xe,Ta as P,Wa as C,Z as $e,bb as ke,ma as k,qb as j,sb as ne,ua as be,wa as Ze,xb as re,ya as Qe}from"./chunk-HQUWYKSJ.js";import{d as E,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ge,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=_e(s),[a=[],p=[]]=_e(n),[m=[],c=[]]=_e(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),p.length>0&&(l=l.concat(e.filter(B(p,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,f=>f.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=E(e,rs);return await P(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function _e(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),I({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}h();import Ft from"fs/promises";var le=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),u=de(c,l),f=typeof l=="string"?l:"",T=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:u,value:f,attachment:T})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let u=V(e,l),f=o(u).then(()=>{let T=t.get(u);return s.add(T.key),T.value??T.attachment??""});st(5).then(()=>{s.delete(u)}).catch(()=>{}),r(c,{fileKey:u,onContent:T=>{f.then(v=>{v&&T(v)}).catch(()=>{})},onSync:T=>{}})},p=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:u=>u()})},m=new Set(Pt.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",p.bind(null))}}}h();h();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title>${e.title}</title>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as N,c as S,d as A}from"./chunk-
|
|
1
|
+
import{b as N,c as S,d as A}from"./chunk-OF6CV5R4.js";import{a as T}from"./chunk-4NXLDIW5.js";import{a as g}from"./chunk-RA3WWB2S.js";import{b as P,c as y,ta as x}from"./chunk-GFWXVO72.js";import{b as d,c as b}from"./chunk-IX4IGE5H.js";import{y as f}from"./chunk-WSCSFFLH.js";import{qb as h,sb as l,wb as m}from"./chunk-HQUWYKSJ.js";import{d as p}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function w(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 C(n,t,o,e,r,i){return JSON.stringify({handle:t.handle,name:n.name,apiVersion:t.api_version,targeting:o,schemaPath:i,wasmPath:r,functionRunnerPath:e},null,2)}function I(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 j(n){if(Object.keys(n).length===0)return null;let t=[];return Object.entries(n).forEach(([o,e])=>{t.push([l`${h.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 O(n,t){return{title:`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-4I7TUB3K.js";import{a as l}from"./chunk-ESPT6CGE.js";import{a as m}from"./chunk-RA3WWB2S.js";import{sa as c}from"./chunk-GFWXVO72.js";import{b as d}from"./chunk-IX4IGE5H.js";import{C as a}from"./chunk-PK73ZSND.js";import{z as p}from"./chunk-WSCSFFLH.js";import{h as n}from"./chunk-BI7LE6CZ.js";import{a as C}from"./chunk-CTNBSUVU.js";import{e as g,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function v(t){let e=t.appContextResult.developerPlatformClient,o=t.appContextResult.remoteApp,r=await e.devSessionDelete({shopFqdn:t.store.shopDomain,appId:o.id});if(r.devSessionDelete?.userErrors.length){let u=r.devSessionDelete.userErrors.map(w=>w.message).join(`
|
|
2
2
|
`);throw new n(`Failed to stop the dev preview: ${u}`)}p({headline:"Dev preview stopped.",body:[`The dev preview has been stopped on ${t.store.shopDomain} and the app's active version has been restored.`,"You can start it again with",{command:"shopify app dev"}]})}var f=g(C(),1);var i=class t extends l{static summary="Cleans up the dev preview from the selected store.";static descriptionWithMarkdown=`Stop the dev preview that was started with \`shopify app dev\`.
|
|
3
3
|
|
|
4
4
|
It restores the app's active version to the selected development store.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as fo}from"./chunk-RJ5VF3QY.js";import{h as ho,k as po}from"./chunk-R2R6JDNH.js";import{a as Ic}from"./chunk-CX5CC6P5.js";import{Ab as Ve,Ra as Qr,Sa as cr,sb as Fe}from"./chunk-Y34LWI3S.js";import{f as mo}from"./chunk-XAOYKECS.js";import{a as uo,b as lo}from"./chunk-DPNZWBT5.js";import{i as ar}from"./chunk-773TIA5M.js";import{c as g,e as Zr,g as u}from"./chunk-VKWPEFWQ.js";var kt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var Ot=class{};q._CodeOrName=Ot;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ke=class extends Ot{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ke;var se=class extends Ot{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ke&&(r[n.str]=(r[n.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function Co(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hn(r,e[n]),r.push(t[++n]);return new se(r)}q._=Co;var fn=new se("+");function Do(t,...e){let r=[Tt(t[0])],n=0;for(;n<e.length;)r.push(fn),hn(r,e[n]),r.push(fn,Tt(t[++n]));return zc(r),new se(r)}q.str=Do;function hn(t,e){e instanceof se?t.push(...e._items):e instanceof Ke?t.push(e):t.push(Uc(e))}q.addCodeArg=hn;function zc(t){let e=1;for(;e<t.length-1;){if(t[e]===fn){let r=Fc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Fc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ke||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ke))return`"${t}${e.slice(1)}`}function Vc(t,e){return e.emptyStr()?t:t.emptyStr()?e:Do`${t}${e}`}q.strConcat=Vc;function Uc(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tt(Array.isArray(t)?t.join(","):t)}function Lc(t){return new se(Tt(t))}q.stringify=Lc;function Tt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Tt;function Kc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):Co`[${t}]`}q.getProperty=Kc;function Gc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=Gc;function Hc(t){return new se(t.toString())}q.regexpCode=Hc});var yn=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=kt(),pn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},fr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(fr||(Q.UsedValueState=fr={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var hr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=hr;var pr=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${n}]`}};Q.ValueScopeName=pr;var Wc=(0,Z._)`\n`,mn=class extends hr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Wc:Z.nil}}get(){return this._scope}name(e){return new pr(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(i);if(d)return d}else a=this._values[o]=new Map;a.set(i,s);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:o,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Z._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=Z.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,fr.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;o=(0,Z._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=s?.(l))o=(0,Z._)`${o}${d}${this.opts._n}`;else throw new pn(l);c.set(l,fr.Completed)})}return o}};Q.ValueScope=mn});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var O=kt(),le=yn(),ke=kt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return ke._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return ke.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return ke.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return ke.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return ke.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return ke.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return ke.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return ke.Name}});var gr=yn();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return gr.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return gr.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return gr.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return gr.varKinds}});P.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};var Pe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_n=class extends Pe{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?le.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ot(this.rhs,e,r)),this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}},mr=class extends Pe{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ot(this.rhs,e,r),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return _r(e,this.rhs)}},gn=class extends mr{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},$n=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},vn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},wn=class extends Pe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},En=class extends Pe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ot(this.code,e,r),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}},Rt=class extends Pe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Jc(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>We(e,r.names),{})}},Ne=class extends Rt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Sn=class extends Rt{},st=class extends Ne{};st.kind="else";var Ge=class t extends Ne{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new st(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ot(this.condition,e,r),this}get names(){let e=super.names;return _r(e,this.condition),this.else&&We(e,this.else.names),e}};Ge.kind="if";var He=class extends Ne{};He.kind="for";var bn=class extends He{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ot(this.iteration,e,r),this}get names(){return We(super.names,this.iteration.names)}},Pn=class extends He{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?le.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=_r(super.names,this.from);return _r(e,this.to)}},yr=class extends He{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ot(this.iterable,e,r),this}get names(){return We(super.names,this.iterable.names)}},jt=class extends Ne{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jt.kind="func";var qt=class extends Rt{render(e){return"return "+super.render(e)}};qt.kind="return";var Nn=class extends Ne{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&We(e,this.catch.names),this.finally&&We(e,this.finally.names),e}},At=class extends Ne{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};At.kind="catch";var Ct=class extends Ne{render(e){return"finally"+super.render(e)}};Ct.kind="finally";var In=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
1
|
+
import{a as fo}from"./chunk-RJ5VF3QY.js";import{h as ho,k as po}from"./chunk-BI7LE6CZ.js";import{a as Ic}from"./chunk-CX5CC6P5.js";import{Ab as Ve,Ra as Qr,Sa as cr,sb as Fe}from"./chunk-HQUWYKSJ.js";import{f as mo}from"./chunk-4VJ6YK7U.js";import{a as uo,b as lo}from"./chunk-DPNZWBT5.js";import{i as ar}from"./chunk-773TIA5M.js";import{c as g,e as Zr,g as u}from"./chunk-VKWPEFWQ.js";var kt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var Ot=class{};q._CodeOrName=Ot;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ke=class extends Ot{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ke;var se=class extends Ot{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ke&&(r[n.str]=(r[n.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function Co(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hn(r,e[n]),r.push(t[++n]);return new se(r)}q._=Co;var fn=new se("+");function Do(t,...e){let r=[Tt(t[0])],n=0;for(;n<e.length;)r.push(fn),hn(r,e[n]),r.push(fn,Tt(t[++n]));return zc(r),new se(r)}q.str=Do;function hn(t,e){e instanceof se?t.push(...e._items):e instanceof Ke?t.push(e):t.push(Uc(e))}q.addCodeArg=hn;function zc(t){let e=1;for(;e<t.length-1;){if(t[e]===fn){let r=Fc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Fc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ke||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ke))return`"${t}${e.slice(1)}`}function Vc(t,e){return e.emptyStr()?t:t.emptyStr()?e:Do`${t}${e}`}q.strConcat=Vc;function Uc(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tt(Array.isArray(t)?t.join(","):t)}function Lc(t){return new se(Tt(t))}q.stringify=Lc;function Tt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Tt;function Kc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):Co`[${t}]`}q.getProperty=Kc;function Gc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=Gc;function Hc(t){return new se(t.toString())}q.regexpCode=Hc});var yn=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=kt(),pn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},fr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(fr||(Q.UsedValueState=fr={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var hr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=hr;var pr=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${n}]`}};Q.ValueScopeName=pr;var Wc=(0,Z._)`\n`,mn=class extends hr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Wc:Z.nil}}get(){return this._scope}name(e){return new pr(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(i);if(d)return d}else a=this._values[o]=new Map;a.set(i,s);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:o,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Z._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=Z.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,fr.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;o=(0,Z._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=s?.(l))o=(0,Z._)`${o}${d}${this.opts._n}`;else throw new pn(l);c.set(l,fr.Completed)})}return o}};Q.ValueScope=mn});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var O=kt(),le=yn(),ke=kt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return ke._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return ke.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return ke.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return ke.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return ke.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return ke.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return ke.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return ke.Name}});var gr=yn();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return gr.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return gr.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return gr.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return gr.varKinds}});P.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};var Pe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_n=class extends Pe{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?le.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ot(this.rhs,e,r)),this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}},mr=class extends Pe{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ot(this.rhs,e,r),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return _r(e,this.rhs)}},gn=class extends mr{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},$n=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},vn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},wn=class extends Pe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},En=class extends Pe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ot(this.code,e,r),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}},Rt=class extends Pe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Jc(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>We(e,r.names),{})}},Ne=class extends Rt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Sn=class extends Rt{},st=class extends Ne{};st.kind="else";var Ge=class t extends Ne{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new st(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Mo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ot(this.condition,e,r),this}get names(){let e=super.names;return _r(e,this.condition),this.else&&We(e,this.else.names),e}};Ge.kind="if";var He=class extends Ne{};He.kind="for";var bn=class extends He{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ot(this.iteration,e,r),this}get names(){return We(super.names,this.iteration.names)}},Pn=class extends He{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?le.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=_r(super.names,this.from);return _r(e,this.to)}},yr=class extends He{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ot(this.iterable,e,r),this}get names(){return We(super.names,this.iterable.names)}},jt=class extends Ne{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jt.kind="func";var qt=class extends Rt{render(e){return"return "+super.render(e)}};qt.kind="return";var Nn=class extends Ne{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&We(e,this.catch.names),this.finally&&We(e,this.finally.names),e}},At=class extends Ne{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};At.kind="catch";var Ct=class extends Ne{render(e){return"finally"+super.render(e)}};Ct.kind="finally";var In=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
2
2
|
`:""},this._extScope=e,this._scope=new le.Scope({parent:e}),this._nodes=[new Sn]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new _n(e,o,n)),o}const(e,r,n){return this._def(le.varKinds.const,e,r,n)}let(e,r,n){return this._def(le.varKinds.let,e,r,n)}var(e,r,n){return this._def(le.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new mr(e,r,n))}add(e,r){return this._leafNode(new gn(e,P.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==O.nil&&this._leafNode(new En(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,O.addCodeArg)(r,s));return r.push("}"),new O._Code(r)}if(e,r,n){if(this._blockNode(new Ge(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ge(e))}else(){return this._elseNode(new st)}endIf(){return this._endBlockNode(Ge,st)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new bn(e),r)}forRange(e,r,n,s,o=this.opts.es5?le.varKinds.var:le.varKinds.let){let i=this._scope.toName(e);return this._for(new Pn(o,i,r,n),()=>s(i))}forOf(e,r,n,s=le.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof O.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,O._)`${i}.length`,a=>{this.var(o,(0,O._)`${i}[${a}]`),n(o)})}return this._for(new yr("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?le.varKinds.var:le.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,O._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new yr("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(He)}label(e){return this._leafNode(new $n(e))}break(e){return this._leafNode(new vn(e))}return(e){let r=new qt;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(qt)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new Nn;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new At(o),r(o)}return n&&(this._currNode=s.finally=new Ct,this.code(n)),this._endBlockNode(At,Ct)}throw(e){return this._leafNode(new wn(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=O.nil,n,s){return this._blockNode(new jt(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(jt)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ge))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};P.CodeGen=In;function We(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function _r(t,e){return e instanceof O._CodeOrName?We(t,e.names):t}function ot(t,e,r){if(t instanceof O.Name)return n(t);if(!s(t))return t;return new O._Code(t._items.reduce((o,i)=>(i instanceof O.Name&&(i=n(i)),i instanceof O._Code?o.push(...i._items):o.push(i),o),[]));function n(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function s(o){return o instanceof O._Code&&o._items.some(i=>i instanceof O.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function Jc(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Mo(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,O._)`!${On(t)}`}P.not=Mo;var Yc=xo(P.operators.AND);function Bc(...t){return t.reduce(Yc)}P.and=Bc;var Xc=xo(P.operators.OR);function Zc(...t){return t.reduce(Xc)}P.or=Zc;function xo(t){return(e,r)=>e===O.nil?r:r===O.nil?e:(0,O._)`${On(e)} ${t} ${On(r)}`}function On(t){return t instanceof O.Name?t:(0,O._)`(${t})`}});var k=g(N=>{"use strict";u();Object.defineProperty(N,"__esModule",{value:!0});N.checkStrictMode=N.getErrorPath=N.Type=N.useFunc=N.setEvaluated=N.evaluatedPropsToName=N.mergeEvaluated=N.eachItem=N.unescapeJsonPointer=N.escapeJsonPointer=N.escapeFragment=N.unescapeFragment=N.schemaRefOrVal=N.schemaHasRulesButRef=N.schemaHasRules=N.checkUnknownRules=N.alwaysValidSchema=N.toHash=void 0;var C=b(),Qc=kt();function eu(t){let e={};for(let r of t)e[r]=!0;return e}N.toHash=eu;function tu(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Vo(t,e),!Uo(e,t.self.RULES.all))}N.alwaysValidSchema=tu;function Vo(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||Go(t,`unknown keyword: "${o}"`)}N.checkUnknownRules=Vo;function Uo(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}N.schemaHasRules=Uo;function ru(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}N.schemaHasRulesButRef=ru;function nu({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,C._)`${r}`}return(0,C._)`${t}${e}${(0,C.getProperty)(n)}`}N.schemaRefOrVal=nu;function su(t){return Lo(decodeURIComponent(t))}N.unescapeFragment=su;function ou(t){return encodeURIComponent(kn(t))}N.escapeFragment=ou;function kn(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}N.escapeJsonPointer=kn;function Lo(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}N.unescapeJsonPointer=Lo;function iu(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}N.eachItem=iu;function zo({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof C.Name?(o instanceof C.Name?t(s,o,i):e(s,o,i),i):o instanceof C.Name?(e(s,i,o),o):r(o,i);return a===C.Name&&!(c instanceof C.Name)?n(s,c):c}}N.mergeEvaluated={props:zo({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,C._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,C._)`${r} || {}`).code((0,C._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,C._)`${r} || {}`),Rn(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Ko}),items:zo({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,C._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,C._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Ko(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,C._)`{}`);return e!==void 0&&Rn(t,r,e),r}N.evaluatedPropsToName=Ko;function Rn(t,e,r){Object.keys(r).forEach(n=>t.assign((0,C._)`${e}${(0,C.getProperty)(n)}`,!0))}N.setEvaluated=Rn;var Fo={};function au(t,e){return t.scopeValue("func",{ref:e,code:Fo[e.code]||(Fo[e.code]=new Qc._Code(e.code))})}N.useFunc=au;var Tn;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Tn||(N.Type=Tn={}));function cu(t,e,r){if(t instanceof C.Name){let n=e===Tn.Num;return r?n?(0,C._)`"[" + ${t} + "]"`:(0,C._)`"['" + ${t} + "']"`:n?(0,C._)`"/" + ${t}`:(0,C._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,C.getProperty)(t).toString():"/"+kn(t)}N.getErrorPath=cu;function Go(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}N.checkStrictMode=Go});var Ie=g(jn=>{"use strict";u();Object.defineProperty(jn,"__esModule",{value:!0});var H=b(),uu={data:new H.Name("data"),valCxt:new H.Name("valCxt"),instancePath:new H.Name("instancePath"),parentData:new H.Name("parentData"),parentDataProperty:new H.Name("parentDataProperty"),rootData:new H.Name("rootData"),dynamicAnchors:new H.Name("dynamicAnchors"),vErrors:new H.Name("vErrors"),errors:new H.Name("errors"),this:new H.Name("this"),self:new H.Name("self"),scope:new H.Name("scope"),json:new H.Name("json"),jsonPos:new H.Name("jsonPos"),jsonLen:new H.Name("jsonLen"),jsonPart:new H.Name("jsonPart")};jn.default=uu});var Dt=g(W=>{"use strict";u();Object.defineProperty(W,"__esModule",{value:!0});W.extendErrors=W.resetErrorsCount=W.reportExtraError=W.reportError=W.keyword$DataError=W.keywordError=void 0;var R=b(),$r=k(),Y=Ie();W.keywordError={message:({keyword:t})=>(0,R.str)`must pass "${t}" keyword validation`};W.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,R.str)`"${t}" keyword must be ${e} ($data)`:(0,R.str)`"${t}" keyword is invalid ($data)`};function lu(t,e=W.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:i,allErrors:a}=s,c=Jo(t,e,r);n??(i||a)?Ho(o,c):Wo(s,(0,R._)`[${c}]`)}W.reportError=lu;function du(t,e=W.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:i}=n,a=Jo(t,e,r);Ho(s,a),o||i||Wo(n,Y.default.vErrors)}W.reportExtraError=du;function fu(t,e){t.assign(Y.default.errors,e),t.if((0,R._)`${Y.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,R._)`${Y.default.vErrors}.length`,e),()=>t.assign(Y.default.vErrors,null)))}W.resetErrorsCount=fu;function hu({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",s,Y.default.errors,a=>{t.const(i,(0,R._)`${Y.default.vErrors}[${a}]`),t.if((0,R._)`${i}.instancePath === undefined`,()=>t.assign((0,R._)`${i}.instancePath`,(0,R.strConcat)(Y.default.instancePath,o.errorPath))),t.assign((0,R._)`${i}.schemaPath`,(0,R.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,R._)`${i}.schema`,r),t.assign((0,R._)`${i}.data`,n))})}W.extendErrors=hu;function Ho(t,e){let r=t.const("err",e);t.if((0,R._)`${Y.default.vErrors} === null`,()=>t.assign(Y.default.vErrors,(0,R._)`[${r}]`),(0,R._)`${Y.default.vErrors}.push(${r})`),t.code((0,R._)`${Y.default.errors}++`)}function Wo(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,R._)`new ${t.ValidationError}(${e})`):(r.assign((0,R._)`${n}.errors`,e),r.return(!1))}var Je={keyword:new R.Name("keyword"),schemaPath:new R.Name("schemaPath"),params:new R.Name("params"),propertyName:new R.Name("propertyName"),message:new R.Name("message"),schema:new R.Name("schema"),parentSchema:new R.Name("parentSchema")};function Jo(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,R._)`{}`:pu(t,e,r)}function pu(t,e,r={}){let{gen:n,it:s}=t,o=[mu(s,r),yu(t,r)];return _u(t,e,o),n.object(...o)}function mu({errorPath:t},{instancePath:e}){let r=e?(0,R.str)`${t}${(0,$r.getErrorPath)(e,$r.Type.Str)}`:t;return[Y.default.instancePath,(0,R.strConcat)(Y.default.instancePath,r)]}function yu({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,R.str)`${e}/${t}`;return r&&(s=(0,R.str)`${s}${(0,$r.getErrorPath)(r,$r.Type.Str)}`),[Je.schemaPath,s]}function _u(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=t,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;n.push([Je.keyword,s],[Je.params,typeof e=="function"?e(t):e||(0,R._)`{}`]),c.messages&&n.push([Je.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Je.schema,i],[Je.parentSchema,(0,R._)`${d}${f}`],[Y.default.data,o]),l&&n.push([Je.propertyName,l])}});var Bo=g(it=>{"use strict";u();Object.defineProperty(it,"__esModule",{value:!0});it.boolOrEmptySchema=it.topBoolOrEmptySchema=void 0;var gu=Dt(),$u=b(),vu=Ie(),wu={message:"boolean schema is false"};function Eu(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Yo(t,!1):typeof r=="object"&&r.$async===!0?e.return(vu.default.data):(e.assign((0,$u._)`${n}.errors`,null),e.return(!0))}it.topBoolOrEmptySchema=Eu;function Su(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Yo(t)):r.var(e,!0)}it.boolOrEmptySchema=Su;function Yo(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,gu.reportError)(s,wu,void 0,e)}});var qn=g(at=>{"use strict";u();Object.defineProperty(at,"__esModule",{value:!0});at.getRules=at.isJSONType=void 0;var bu=["string","number","integer","boolean","null","object","array"],Pu=new Set(bu);function Nu(t){return typeof t=="string"&&Pu.has(t)}at.isJSONType=Nu;function Iu(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}at.getRules=Iu});var An=g(Re=>{"use strict";u();Object.defineProperty(Re,"__esModule",{value:!0});Re.shouldUseRule=Re.shouldUseGroup=Re.schemaHasRulesForType=void 0;function Ou({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Xo(t,n)}Re.schemaHasRulesForType=Ou;function Xo(t,e){return e.rules.some(r=>Zo(t,r))}Re.shouldUseGroup=Xo;function Zo(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Re.shouldUseRule=Zo});var Mt=g(J=>{"use strict";u();Object.defineProperty(J,"__esModule",{value:!0});J.reportTypeError=J.checkDataTypes=J.checkDataType=J.coerceAndCheckDataType=J.getJSONTypes=J.getSchemaTypes=J.DataType=void 0;var Tu=qn(),ku=An(),Ru=Dt(),S=b(),Qo=k(),ct;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ct||(J.DataType=ct={}));function ju(t){let e=ei(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}J.getSchemaTypes=ju;function ei(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Tu.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}J.getJSONTypes=ei;function qu(t,e){let{gen:r,data:n,opts:s}=t,o=Au(e,s.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,ku.schemaHasRulesForType)(t,e[0]));if(i){let a=Dn(e,n,s.strictNumbers,ct.Wrong);r.if(a,()=>{o.length?Cu(t,e,o):Mn(t)})}return i}J.coerceAndCheckDataType=qu;var ti=new Set(["string","number","integer","boolean","null"]);function Au(t,e){return e?t.filter(r=>ti.has(r)||e==="array"&&r==="array"):[]}function Cu(t,e,r){let{gen:n,data:s,opts:o}=t,i=n.let("dataType",(0,S._)`typeof ${s}`),a=n.let("coerced",(0,S._)`undefined`);o.coerceTypes==="array"&&n.if((0,S._)`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,S._)`${s}[0]`).assign(i,(0,S._)`typeof ${s}`).if(Dn(e,s,o.strictNumbers),()=>n.assign(a,s))),n.if((0,S._)`${a} !== undefined`);for(let l of r)(ti.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),Mn(t),n.endIf(),n.if((0,S._)`${a} !== undefined`,()=>{n.assign(s,a),Du(t,a)});function c(l){switch(l){case"string":n.elseIf((0,S._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,S._)`"" + ${s}`).elseIf((0,S._)`${s} === null`).assign(a,(0,S._)`""`);return;case"number":n.elseIf((0,S._)`${i} == "boolean" || ${s} === null
|
|
3
3
|
|| (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,S._)`+${s}`);return;case"integer":n.elseIf((0,S._)`${i} === "boolean" || ${s} === null
|
|
4
4
|
|| (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,S._)`+${s}`);return;case"boolean":n.elseIf((0,S._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,S._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,S._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,S._)`${i} === "string" || ${i} === "number"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q,c as C}from"./chunk-
|
|
1
|
+
import{a as q,c as C}from"./chunk-U3F6GPCE.js";import{d as x,f as k,u as N}from"./chunk-SGIMJQEM.js";import{a as J}from"./chunk-ESPT6CGE.js";import{a as A,c as E}from"./chunk-RA3WWB2S.js";import{b}from"./chunk-6G5TDB45.js";import{b as O}from"./chunk-IX4IGE5H.js";import{j as I,k as y}from"./chunk-PK73ZSND.js";import{B as v,I as f,z as d}from"./chunk-WSCSFFLH.js";import{h as l}from"./chunk-BI7LE6CZ.js";import{Ta as g,ma as h,qb as c,sb as s,ua as w,wb as S}from"./chunk-HQUWYKSJ.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();var F=Q(I(),1);async function z(a,e){if(a)try{return JSON.parse(a)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new l(s`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await g(e))throw new l(s`Variable file not found at ${c.path(e)}. Please check the path and try again.`);let t=await h(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:"Unknown error";throw new l(s`Invalid JSON in variable file ${c.path(e)}: ${n}`,"Please provide valid JSON format.")}}}async function M(a){let{remoteApp:e,store:t,query:r,variables:n,variableFile:$,version:L,outputFile:u}=a,{adminSession:R,version:V}=await f({title:s`Authenticating`,task:async()=>{let o=await q(e,t.shopDomain),i=await k({adminSession:o,userSpecifiedVersion:L});return{adminSession:o,version:i}},renderOptions:{stdout:process.stderr}}),G=await z(n,$);x(r),C(r,t);try{let o=await f({title:s`Executing GraphQL operation`,task:async()=>b({query:(0,F.parse)(r),session:R,variables:G,version:V,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),i=JSON.stringify(o,null,2);u?(await w(u,i),d({headline:"Operation succeeded.",body:`Results written to ${u}`})):(d({headline:"Operation succeeded."}),S(i))}catch(o){if(o instanceof y){let i={errors:o.response.errors},P=JSON.stringify(i,null,2);v({headline:"GraphQL operation failed.",body:P});return}throw o}}var m=class a extends J{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static description=this.descriptionWithoutMarkdown();static flags={...O,...A,...E};async run(){let{flags:e}=await this.parse(a),{query:t,appContextResult:r,store:n}=await N(e);return await M({organization:r.organization,remoteApp:r.remoteApp,store:n,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{m as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-6R62DGJG.js";import{b as s}from"./chunk-3WV7DQMM.js";import{Ha as i}from"./chunk-PK73ZSND.js";import{a as m}from"./chunk-CTNBSUVU.js";import{e as d,g as e}from"./chunk-VKWPEFWQ.js";e();var n=d(m(),1);var t=class c extends s{static description="List current notifications configured for the CLI.";static hidden=!0;static flags={"ignore-errors":n.Flags.boolean({hidden:!1,description:"Don't fail if an error occurs.",env:"SHOPIFY_FLAG_IGNORE_ERRORS"})};async run(){let{flags:f}=await this.parse(c);try{await a()}catch(r){let o="Error fetching notifications";if(r instanceof Error&&(o=o.concat(`: ${r.message}`)),await i(o,"expected_error"),!f["ignore-errors"])throw r}}};export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-CTNBSUVU.js";import{Db as f,eb as g,pb as E}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-CTNBSUVU.js";import{Db as f,eb as g,pb as E}from"./chunk-HQUWYKSJ.js";import{e as m}from"./chunk-773TIA5M.js";import{e as A,g as p}from"./chunk-VKWPEFWQ.js";p();p();var w=new Set(["THROTTLED","429"]),I=new Set(["ACCESS_DENIED","access_denied"]);function b(e){return Array.isArray(e)?e.flatMap(t=>{let s=[],n=t,r=n?.extensions?.code;typeof r=="string"&&s.push(r);let c=n?.extensions?.app_errors?.errors;if(Array.isArray(c))for(let u of c){let d=u?.category;typeof d=="string"&&s.push(d)}return s}):[]}function C(e){return e!==void 0&&w.has(e)}function v(e){return e!==void 0&&I.has(e)}function h(e){return b(e).some(C)}var M=A(P()),o;(function(e){e[e.Abort=0]="Abort",e[e.AbortSilent=1]="AbortSilent",e[e.Bug=2]="Bug"})(o||(o={}));var x=class extends Error{},i=class extends Error{tryMessage;type;nextSteps;formattedMessage;customSections;skipOclifErrorHandling;constructor(t,s,n=null,r,c){let u=typeof t=="string"||"value"in t;super(u?f(t):g(t)),n?n instanceof E?this.tryMessage=f(n):this.tryMessage=n:this.tryMessage=null,this.type=s,this.nextSteps=r,this.customSections=c,this.skipOclifErrorHandling=!0,u||(this.formattedMessage=t)}},l=class extends i{constructor(t,s=null,n,r){super(t,o.Abort,s,n,r)}},y=class extends i{command;args;constructor(t,s,n,r=null){super(t,o.Abort,r),this.command=s,this.args=n}},S=class extends i{constructor(){super("",o.AbortSilent)}},a=class extends i{constructor(t,s=null){super(t,o.Bug,s)}};async function B(e){let t;if(k(e))t=e;else if(typeof e=="string")t=new a(e);else if(e instanceof Error)t=new a(e.message),t.stack=e.stack;else{let n=e;t=new a(n?.message??"Unknown error"),n?.stack&&(t.stack=n?.stack)}let{renderFatalError:s}=await import("./ui-7TVGGEWJ.js");return s(t),Promise.resolve(e)}function H(e){if(e instanceof M.Errors.CLIError){let t=new l(e.message);return t.stack=e.stack,Promise.resolve(t)}else return Promise.resolve(e)}function k(e){try{return Object.prototype.hasOwnProperty.call(e,"type")}catch{return!1}}function j(e){if(!k(e)){if(e instanceof Error){if(O(e))return!1;let t=e.message;return!R(t)}return!0}return e.type===o.Bug}function O(e){let t=e;if(typeof t.response!="object"||t.response===null||t.request===void 0)return!1;let s=t.response.status;return s===401||s===429?!0:h(t.response.errors)}function q(e){return m(e).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function R(e){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>e.includes(n))}export{b as a,C as b,v as c,h as d,o as e,x as f,i as g,l as h,y as i,S as j,a as k,B as l,H as m,j as n,q as o};
|
|
@@ -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-7EUIO4ZO.js";import{e as g}from"./chunk-WEWLPJK2.js";import{e as U,f as _}from"./chunk-5JW4JQWZ.js";import{l as v,m as w}from"./chunk-K63FW7Q7.js";import{za as E}from"./chunk-PK73ZSND.js";import{Ab as m}from"./chunk-HQUWYKSJ.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 +1 @@
|
|
|
1
|
-
import{g as o}from"./chunk-
|
|
1
|
+
import{g as o}from"./chunk-IX4IGE5H.js";import{b as s}from"./chunk-3WV7DQMM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as R}from"./chunk-
|
|
1
|
+
import{q as R}from"./chunk-PK73ZSND.js";import{f as G}from"./chunk-6K3AJTNO.js";import{a as T,b as k}from"./chunk-WMZS3Y4Z.js";import{h as l}from"./chunk-BI7LE6CZ.js";import{Ab as f,Oa as y,Pa as x,ka as $,qb as u,sb as h,ua as b,wa as g}from"./chunk-HQUWYKSJ.js";import{d,i as w}from"./chunk-773TIA5M.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();function U(a){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(a);if(!t){let v=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return k(new Error(`Parsing the url ${a} failed. Supported formats are ${v.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",r=e==="github"?"github.com":e,s=t[4],i=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),o=t[7],p=o?`#${o}`:"",c=`git@${r}:${s}/${i}`,H=`https://${r}/${s}/${i}`,P=["https:/",r,s,i,n].join("/").concat(p);return T({full:P,site:r,user:s,name:i,ref:o,subDirectory:n,ssh:c,http:H})}function A(a){let t=new URL(a),e=t.hash?t.hash.slice(1):void 0,[r,s,i,...n]=t.pathname.split("/"),o=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${s}/${i}`,branch:e,filePath:o}}async function B(a,t,e,r){let s=`https://github.com/${a}/releases/download/${t}/${e}`;return G("cmd_all_timing_network_ms")(async()=>{f(h`Downloading ${u.link(e,s)}`),await $(async i=>{let n=d(i,e),o;try{if(o=await R(s,void 0,"slow-request"),!o.ok)throw new l(`Failed to download ${e}: ${o.statusText}`)}catch(c){throw new l(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let p=await o.arrayBuffer();await b(n,Buffer.from(p)),await x(n,493),await g(w(r)),await y(n,r)}),f(h`${u.successIcon()} Successfully downloaded ${u.path(r)}`)})}export{U as a,A as b,B as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p,v as d}from"./chunk-
|
|
1
|
+
import{p,v as d}from"./chunk-3KM2GKXH.js";import{a as u}from"./chunk-IA3XNJ56.js";import{aa as w}from"./chunk-TP4Z5OZT.js";import{b as l}from"./chunk-IX4IGE5H.js";import{z as f}from"./chunk-WSCSFFLH.js";import{h as i}from"./chunk-BI7LE6CZ.js";import{Ta as c,ma as h}from"./chunk-HQUWYKSJ.js";import{f as r,n as m}from"./chunk-773TIA5M.js";import{e as _,g as o}from"./chunk-VKWPEFWQ.js";o();o();var g=_(w(),1),P=["assets/**","blocks/**","config/**","layout/**","listings/**/*","locales/**","sections/**","snippets/**","templates/**","templates/customers/**","release-notes.md","update_extension.json"].join("|");async function y(e){let t=await k(e),s=`${e}/${t}`,n=`${e}/(${P})`;await u({inputDirectory:e,outputZipPath:s,matchFilePattern:n}),f({body:["Your local theme was packaged in",{filePath:m(s)}]})}async function k(e){let t=r(e,"config/settings_schema.json");if(!await c(t))throw new i("Provide a config/settings_schema.json to package your theme.");let s=await v(t);if(s===void 0||s.theme_name===void 0)throw new i("Provide a theme_info.theme_name configuration in config/settings_schema.json.");return`${[s.theme_name,s.theme_version].filter(Boolean).join("-")}.zip`}async function v(e){let t=(0,g.parseJSON)(await h(e),null,!0);if(!t)throw new i("The file config/settings_schema.json contains an error. Please check if the file is valid JSON and includes the theme_info.theme_name configuration.");return t.find(s=>s.name==="theme_info")}var a=class extends d{static summary="Package your theme into a .zip file, ready to upload to the Online Store.";static descriptionWithMarkdown=`Packages your local theme files into a ZIP file that can be uploaded to Shopify.
|
|
2
2
|
|
|
3
3
|
Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-HU4GFVEN.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var e=async()=>a.getAllSensitiveMetadata(),i=e;export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l,c as b,d as D,e as _}from"./chunk-
|
|
1
|
+
import{a as l,c as b,d as D,e as _}from"./chunk-IQT6LOA2.js";import{g as T,p as y,v as O}from"./chunk-3KM2GKXH.js";import{b as L,c as S}from"./chunk-IX4IGE5H.js";import{e as d}from"./chunk-AFT6ABDE.js";import{y as v}from"./chunk-WSCSFFLH.js";import{a as G}from"./chunk-CTNBSUVU.js";import{Ab as a,sb as s,wb as F}from"./chunk-HQUWYKSJ.js";import{e as $,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();var w;function f(){return w??=new d({projectName:"shopify-cli-host-theme-conf"}),w}function E(t){return a(s`Getting host theme...`),f().get(t)}function Y(t,e){a(s`Setting host theme...`),f().set(t,e)}function C(t){a(s`Removing host theme...`),f().delete(t)}function j(t,e){return{title:t,body:{tabularData:e}}}async function I(t,e){let r=e.storeFqdn,p=new _({...l.reduce((n,i)=>(n[i]=t.role===i,n),{}),theme:t.id?.toString()??t.name}),m=await b(e),x=T(),H=E(r);if(p.any()&&(m=D(r,m,p)),t.json)return F(JSON.stringify(m,null,2));let A=m.map(({id:n,name:i,role:g})=>{let c="";return g&&(c=`[${g}]`,[x,H].includes(`${n}`)&&(c+=" [current]")),[i,c,`#${n}`]}),R=[["name","role","id"],["\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],...A];v({customSections:[...t.environment?[{title:`${r} theme library`,body:[{subdued:`Environment name: ${t.environment}`}]}]:[],j("",R)]})}var h=$(G(),1);var u=class extends O{static description="Lists the themes in your store, along with their IDs and statuses.";static flags={...L,...S,...y,role:h.Flags.custom({description:"Only list themes with the given role.",options:l,env:"SHOPIFY_FLAG_ROLE"})(),name:h.Flags.string({description:"Only list themes that contain the given name.",env:"SHOPIFY_FLAG_NAME"}),id:h.Flags.integer({description:"Only list theme with the given ID.",env:"SHOPIFY_FLAG_ID"})};static multiEnvironmentsFlags=["store","password"];async command(e,r){await I(e,r)}};export{E as a,Y as b,C as c,u as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,g as c,i as p,j as f}from"./chunk-
|
|
1
|
+
import{b as a,g as c,i as p,j as f}from"./chunk-K63FW7Q7.js";import{k as h}from"./chunk-BI7LE6CZ.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();i();i();function d(n){let e=/[^\p{Letter}\p{Number}\p{Mark}-]/gu;return n.replace(e,"-")}import{randomBytes as l}from"crypto";import{hostname as g}from"os";var T=50;function m(n){let e=g().split(".")[0],r=l(3).toString("hex"),t=`${n} ()`,s=T-t.length-r.length-1,o=d(`${r}-${e.substring(0,s)}`);return`${n} (${o})`}var u=class{adminSession;themeId;constructor(e){this.adminSession=e}async findOrCreate(e,r){let t=await this.fetch(e,r);return t?this.setTheme(t.id.toString()):t=await this.create(r,e),t}async fetch(e,r){if(!this.themeId&&!e)return;let t=e&&r===a?await p(e,this.adminSession):await c(parseInt(this.themeId,10),this.adminSession);return t||this.removeTheme(),t}generateThemeName(e){return m(e)}async create(e,r){let t=r??m(this.context),s=e??a,o=await f({name:t,role:s},this.adminSession);if(!o)throw new h(`Could not create theme with name "${t}" and role "${s}"`);return this.setTheme(o.id.toString()),o}};export{u as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-P5WLH64A.js";import{a as y}from"./chunk-WEWLPJK2.js";import{a as d}from"./chunk-YY6TFARF.js";import{p}from"./chunk-K63FW7Q7.js";import{p as f,v as u}from"./chunk-3KM2GKXH.js";import{b as l,f as m}from"./chunk-IX4IGE5H.js";import{E as c,z as s}from"./chunk-WSCSFFLH.js";import{a as g}from"./chunk-CTNBSUVU.js";import{e as b,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function w(o,t,i){let e=await v(o,{header:"Select a theme to publish",filter:{development:!1,live:!1,theme:t.theme}}),h=d({...e,role:"live"},o);!t.force&&!i&&!await c({message:`Do you want to make '${e.name}' the new live theme on ${o.storeFqdn}?`,confirmationMessage:`Yes, make '${e.name}' the new live theme`,cancellationMessage:"No, cancel publish"})||(await p(e.id,o),s({headline:t.environment?`Environment: ${t.environment}`:void 0,body:["The theme",...y(e),"is now live at",{link:{label:h,url:h}},{char:"."}]}))}var n=b(g(),1);var a=class extends u{static summary="Set a remote theme as the live theme.";static descriptionWithMarkdown=`Publishes an unpublished theme from your theme library.
|
|
2
2
|
|
|
3
3
|
If no theme ID is specified, then you're prompted to select the theme that you want to publish from the list of themes in your store.
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-2S3GOPRL.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as M}from"./chunk-
|
|
1
|
+
import{a as M}from"./chunk-4I7TUB3K.js";import{a as E}from"./chunk-ESPT6CGE.js";import{a as I}from"./chunk-RA3WWB2S.js";import{B as C,sa as j}from"./chunk-GFWXVO72.js";import{e as O}from"./chunk-6G5TDB45.js";import{a as z}from"./chunk-IENBHP2S.js";import{b as R}from"./chunk-IX4IGE5H.js";import{C as y,V as _,ha as h,ka as g}from"./chunk-PK73ZSND.js";import{H as T,I as k,y as A}from"./chunk-WSCSFFLH.js";import{k as D}from"./chunk-BI7LE6CZ.js";import{a as H}from"./chunk-CTNBSUVU.js";import{qb as p,sb as m,xb as f}from"./chunk-HQUWYKSJ.js";import{e as F,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};l();async function J(e){let i="Admin",n=O(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function P(e){return g({query:e.query,...await J(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}l();var w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var x=F(z(),1);var Q={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function $({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>P({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),s=[];for(s.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),s.push(...o.nodes);return{status:"ok",items:s}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function V(e,i){let n="";for(let t of e)n=(0,x.updateTomlValues)(n,t);return`# ${i}
|
|
2
2
|
${n}`}function Z(e,i){let n=i.map(oe).map(a=>{switch(a.status){case"ok":{let{typeName:o,patches:s}=a;return V(s,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:s})=>a.map(r=>({result:de(r,o),graphQLOwner:s}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:s,key:r,patches:N}=a;return V(N,`namespace: ${s==="app"?"$app":`$app:${s}`} key: ${r} owner_type: ${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null);return{tomlContent:[...n,...t].join(`
|
|
3
3
|
`),metafieldCount:t.length,metaobjectCount:n.length}}async function q(e){let i=await ae(e),n=i.storeFqdn,t=await ee(i),d=await ne(i);e.includeExistingDeclaredDefinitions||(t=ie(t,e.appConfiguration),d=te(d,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:s}=Z(t,d);X(o,s,n,a)}function X(e,i,n,t){A({headline:"Conversion to TOML complete.",body:["Converted",{warn:`${e} metafields`},"and",{warn:`${i} metaobjects`},"from",{warn:n},"into TOML, ready for you to copy."],orderedNextSteps:!0,nextSteps:["Review the suggested TOML carefully before applying.",["Missing sections? Make sure your app has the required access scopes to load metafields and metaobjects (e.g.",{command:"read_customers"},"to load customer metafields,",{command:"read_metaobject_definitions"},"to load metaobjects.)"],["Missing definitions? Only metafields and metaobjects that are app-reserved (using",{command:"$app"},") will be converted."],["When you're ready, add the generated TOML to your app's configuration file and test out changes with the",{command:"shopify app dev"},"command."]]}),ce(t)}async function ee(e){let i=[];return await T(Object.entries(Q).map(([n,t])=>({title:m`Loading ${p.green(n)} metafields`,task:async()=>{let d=await $({query:L,session:e,toNodes:a=>a.metafieldDefinitions,toVariables:a=>({ownerType:t,after:a})});i.push({metafields:d,ownerType:n,graphQLOwner:t})}}))),i.map(({metafields:n,ownerType:t,graphQLOwner:d})=>n.status==="ok"?{ownerType:t,items:n.items,graphQLOwner:d}:null).filter(n=>n!==null)}async function ne(e){let i=await k({title:m`Loading ${p.green("metaobjects")}`,task:async()=>$({query:w,session:e,toNodes:n=>n.metaobjectDefinitions,toVariables:n=>({after:n})})});return i.status==="ok"?i.items:[]}function ie(e,i){return e.map(n=>{let t=n.items.filter(d=>!K(i,[n.ownerType,"metafields",u(d.namespace)??"",d.key]));return t.length>0?{...n,items:t}:null}).filter(n=>n!==null)}function te(e,i){return e.filter(n=>!K(i,["metaobjects","app",u(n.type)??""]))}function K(e,i){let n=e;for(let t of i){if(!n[t])return!1;n=n[t]}return!0}async function ae(e){let{remoteApp:i,store:n}=e,t=i.apiSecretKeys[0]?.secret;if(!t)throw new D("No API secret keys found for app");return await _(n.shopDomain,i.apiKey,t)}function u(e){if(!e.match(/^app--\d+/))return null;let i="app";return e.match(/^app--\d+--/)&&(i=e.replace(/^app--\d+--/,"")),i}function de(e,i){let n=u(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,d=se(e),a=re(d,i,n,t);return{status:"ok",key:t,namespace:n,patches:a}}function oe(e){let i=u(e.type);if(!i)return{status:"not_app_reserved"};let n=le(e,i),t=me(n,i);return{status:"ok",typeName:i,patches:t}}function se(e){let i={name:e.name===e.key?void 0:e.name,type:e.type.name,description:e.description??void 0,capabilities:c({admin_filterable:e.capabilities.adminFilterable.enabled||void 0}),access:c({admin:W(e.access.admin),storefront:Y(e.access.storefront),customer_account:ue(e.access.customerAccount)}),validations:G(e.validations)},{type:n,validations:t}=U(i.type,i.validations);return i.type=n,i.validations=t,i}function le(e,i){return{name:e.name===i?void 0:e.name,description:e.description??void 0,display_name_field:e.displayNameKey??void 0,access:c({admin:W(e.access.admin),storefront:Y(e.access.storefront)}),capabilities:c({translatable:e.capabilities.translatable.enabled||void 0,publishable:e.capabilities.publishable.enabled||void 0,renderable:e.capabilities.renderable?.enabled||void 0,renderable_meta_title_field:e.capabilities.renderable?.data?.metaTitleKey??void 0,renderable_meta_description_field:e.capabilities.renderable?.data?.metaDescriptionKey??void 0}),fields:Object.fromEntries(e.fieldDefinitions.map(n=>{let t={type:n.type.name,description:n.description??void 0,name:n.name===n.key?void 0:n.name,required:n.required||void 0,validations:G(n.validations)},{type:d,validations:a}=U(t.type,t.validations);return t.type=d,t.validations=a,[n.key,t]}))}}function U(e,i){if(!i)return{type:e,validations:void 0};if(i.metaobject_definition_type&&typeof i.metaobject_definition_type=="string"){let n=u(i.metaobject_definition_type);return{type:`${e}<$app:${n}>`,validations:c({...i,metaobject_definition_type:void 0})}}if(i.metaobject_definition_types&&Array.isArray(i.metaobject_definition_types)&&i.metaobject_definition_types.every(n=>typeof n=="string")){let n=i.metaobject_definition_types.map(t=>u(t));return{type:`${e}<${n.map(t=>`$app:${t}`).join(",")}>`,validations:c({...i,metaobject_definition_types:void 0})}}return{type:e,validations:i}}function G(e){let i=n=>{try{return JSON.parse(n)}catch{return n}};return c(Object.fromEntries(e.filter(n=>n.value!==void 0&&n.name!=="metaobject_definition_id"&&n.name!=="metaobject_definition_ids").map(n=>[n.name,n.value?i(n.value):void 0])))}function re(e,i,n,t){let d=[[[i,"metafields",n,t,"name"],e.name],[[i,"metafields",n,t,"type"],e.type],[[i,"metafields",n,t,"description"],e.description]],a=[[[i,"metafields",n,t,"access","admin"],e.access?.admin],[[i,"metafields",n,t,"access","storefront"],e.access?.storefront],[[i,"metafields",n,t,"access","customer_account"],e.access?.customer_account],[[i,"metafields",n,t,"capabilities","admin_filterable"],e.capabilities?.admin_filterable||void 0]];return e.validations&&B(e.validations).forEach(({validationKey:s,actualValue:r})=>{d.push([[i,"metafields",n,t,"validations",s],r])}),[v(d),v(a)]}function me(e,i){let n=[[["metaobjects","app",i,"name"],e.name===i?void 0:e.name],[["metaobjects","app",i,"description"],e.description],[["metaobjects","app",i,"display_name_field"],e.display_name_field]],t=[[["metaobjects","app",i,"access","admin"],e.access?.admin],[["metaobjects","app",i,"access","storefront"],e.access?.storefront]];return e.capabilities?.translatable&&t.push([["metaobjects","app",i,"capabilities","translatable"],!0]),e.capabilities?.publishable&&t.push([["metaobjects","app",i,"capabilities","publishable"],!0]),e.capabilities?.renderable&&(t.push([["metaobjects","app",i,"capabilities","renderable"],!0]),e.capabilities?.renderable_meta_title_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_title_field"],e.capabilities.renderable_meta_title_field]),e.capabilities?.renderable_meta_description_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_description_field"],e.capabilities.renderable_meta_description_field])),Object.entries(e.fields).forEach(([d,a])=>{if(typeof a=="string")n.push([["metaobjects","app",i,"fields",d],a]);else{let o=Object.fromEntries(Object.entries(a).filter(([s,r])=>r!==void 0));Object.keys(o).length===1?n.push([["metaobjects","app",i,"fields",d],a.type]):(n.push([["metaobjects","app",i,"fields",d,"type"],a.type]),n.push([["metaobjects","app",i,"fields",d,"description"],a.description]),n.push([["metaobjects","app",i,"fields",d,"name"],a.name]),n.push([["metaobjects","app",i,"fields",d,"required"],a.required||void 0]),a.validations&&B(a.validations).forEach(({validationKey:r,actualValue:N})=>{n.push([["metaobjects","app",i,"fields",d,"validations",r],N])}))}}),[v(n),v(t)]}function B(e){return Object.entries(e).map(([i,n])=>{let t;return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&n.every(d=>typeof d=="string")?t=n:t=JSON.stringify(n),{validationKey:i,actualValue:t}})}function ce(e){let i=e.split(`
|
|
4
4
|
`);for(let n of i)n.match(/^\s*\[/)?f(m`${p.green(n)}`):n.match(/^\s*#/)?f(m`${p.gray(n)}`):f(m`${n}`)}function W(e){switch(e){case"MERCHANT_READ_WRITE":return"merchant_read_write";case"MERCHANT_READ":case"PRIVATE":case"PUBLIC_READ":case"PUBLIC_READ_WRITE":case null:case void 0:return}}function Y(e){switch(e){case"PUBLIC_READ":return"public_read";case"NONE":case null:case void 0:return}}function ue(e){switch(e){case"READ":return"read";case"READ_WRITE":return"read_write";case"NONE":case null:case void 0:return}}function c(e){if(e&&!h(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function v(e){return e.filter(([i,n])=>n!==void 0)}var b=F(H(),1);var S=class e extends E{static summary="Import metafield and metaobject definitions.";static descriptionWithMarkdown="Import metafield and metaobject definitions from your development store. [Read more about declarative custom data definitions](https://shopify.dev/docs/apps/build/custom-data/declarative-custom-data-definitions).";static description=this.descriptionWithoutMarkdown();static flags={...R,...I,store:b.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>y(i)}),"include-existing":b.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})};async run(){let{appContextResult:i,...n}=await k({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(e);await C(t.path);let d=await j({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await M({appContextResult:d,storeFqdn:t.store,forceReselectStore:t.reset});return{appContextResult:d,appConfiguration:d.app.configuration,remoteApp:d.remoteApp,store:a,includeExistingDeclaredDefinitions:t["include-existing"]}}});return await q(n),{app:i.app}}};export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t}from"./chunk-YY6TFARF.js";import{d as l}from"./chunk-
|
|
1
|
+
import{c as t}from"./chunk-YY6TFARF.js";import{d as l}from"./chunk-5JW4JQWZ.js";import{f as i,m,n as w,o as d,r as f}from"./chunk-3KM2GKXH.js";import{J as n}from"./chunk-WSCSFFLH.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function y(o,r,P){i()||f({store:r});let e=o??m()??await p(["Enter your",{link:{label:"store password",url:t(r)}}]),s=!1;for(;!await l(e,r,P);)s||(d(),s=!0),e=await p(["Incorrect",{link:{label:"store password",url:t(r)}},{char:"."},"Please try again"]);return w(e),e}async function p(o){return n({message:o,password:!0})}export{y as a};
|