shopify 5.0.2 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-23GM6KJU.js +1 -0
- package/dist/analytics-743FYOAE.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-RPCIFYCY.js → chunk-2EQRXSF6.js} +2 -2
- package/dist/{chunk-NXAEBGMO.js → chunk-2IXP3IPE.js} +1 -1
- package/dist/{chunk-T4XJKM6B.js → chunk-2KACAQJS.js} +1 -1
- package/dist/chunk-2KFYIYLI.js +1 -0
- package/dist/chunk-2OCSYLKZ.js +1 -0
- package/dist/{chunk-AQKWPRZE.js → chunk-2PILNMHJ.js} +2 -2
- package/dist/chunk-36S6MFJQ.js +47 -0
- package/dist/{chunk-TFPW2VGN.js → chunk-3DB4EC62.js} +1 -1
- package/dist/chunk-3GL3IT4K.js +16 -0
- package/dist/{chunk-C3RFAKWR.js → chunk-3JRB7Q3T.js} +1 -1
- package/dist/chunk-3KGN6N7E.js +1 -0
- package/dist/chunk-3OYMK5X6.js +11 -0
- package/dist/chunk-3PYDIBTX.js +1 -0
- package/dist/chunk-422BGHXN.js +1 -0
- package/dist/chunk-43C32FUQ.js +1 -0
- package/dist/chunk-4AN7ECPE.js +9 -0
- package/dist/chunk-4AWVU2OV.js +1 -0
- package/dist/chunk-4IP37MBX.js +1 -0
- package/dist/chunk-4KBOLN7Q.js +8 -0
- package/dist/chunk-4LJERO23.js +89 -0
- package/dist/chunk-4M5WHOZW.js +1 -0
- package/dist/chunk-4RO35FFQ.js +1 -0
- package/dist/chunk-4ZS5354G.js +3 -0
- package/dist/chunk-55AWBPKU.js +7 -0
- package/dist/chunk-5BUYR23E.js +1 -0
- package/dist/chunk-5EDA7PVE.js +11 -0
- package/dist/{chunk-UKWIWCOH.js → chunk-5P6OELKZ.js} +1 -1
- package/dist/chunk-5PVXLQNX.js +1 -0
- package/dist/{chunk-J5ERDFIC.js → chunk-5S2P4MHJ.js} +1 -1
- package/dist/{chunk-26PWHH3B.js → chunk-5TJJVSCI.js} +1 -1
- package/dist/chunk-5TOK5OJS.js +1 -0
- package/dist/chunk-5ZG2SWU2.js +1 -0
- package/dist/{chunk-SLY27GDC.js → chunk-62F4ZMSC.js} +2 -2
- package/dist/chunk-652NT7OW.js +1 -0
- package/dist/chunk-6B5KM3A4.js +97 -0
- package/dist/chunk-6LCESSY3.js +1 -0
- package/dist/chunk-6QHDMCAA.js +1 -0
- package/dist/{chunk-D2KIGKBI.js → chunk-7A4ZE5IS.js} +60 -60
- package/dist/{chunk-CGVROSPS.js → chunk-7AQZKPJU.js} +1 -1
- package/dist/chunk-7FBOMPO5.js +203 -0
- package/dist/chunk-7HECBXSP.js +1 -0
- package/dist/chunk-7UK565VJ.js +1 -0
- package/dist/{chunk-LHXFTFFM.js → chunk-A5BSUUNQ.js} +1 -1
- package/dist/chunk-ADGE7MKB.js +1 -0
- package/dist/chunk-AEWRZ7AE.js +1 -0
- package/dist/chunk-ALDJTWCO.js +1 -0
- package/dist/chunk-ARL5WBDK.js +1 -0
- package/dist/chunk-AXFEIJC7.js +1 -0
- package/dist/{chunk-KZRLZWOU.js → chunk-AYGL6F3P.js} +1 -1
- package/dist/{chunk-URXM5A2K.js → chunk-AYTTE7X5.js} +1 -1
- package/dist/{chunk-3ODQKAEA.js → chunk-BDIZUTKC.js} +1 -1
- package/dist/chunk-BQKF4SRH.js +6 -0
- package/dist/chunk-C2AOCLEZ.js +1 -0
- package/dist/{chunk-WRZWHT6M.js → chunk-C2SGJ5IG.js} +1 -1
- package/dist/chunk-C3S3UMV3.js +1 -0
- package/dist/{chunk-WBJ6ZHYH.js → chunk-C5DKLOW4.js} +37 -37
- package/dist/chunk-C72QNK6O.js +4 -0
- package/dist/{chunk-6ES4KRFW.js → chunk-CA3GVT4D.js} +1 -1
- package/dist/chunk-CCLU5ZRK.js +9 -0
- package/dist/chunk-CE6XQDAG.js +10 -0
- package/dist/chunk-CEJ5WS4I.js +5 -0
- package/dist/{chunk-VEUKT5EI.js → chunk-CIBBQO2L.js} +2 -2
- package/dist/{chunk-IILLQOUC.js → chunk-CKJXJ6HD.js} +1 -1
- package/dist/{chunk-MEYVUHQH.js → chunk-COGKVNQB.js} +1 -1
- package/dist/chunk-CQAD5WML.js +1 -0
- package/dist/chunk-CQPZOXWO.js +6 -0
- package/dist/{chunk-62EOM3Y2.js → chunk-CZYQIWNL.js} +1 -1
- package/dist/chunk-DA5RQFXA.js +10 -0
- package/dist/{chunk-7GHSE7SG.js → chunk-DDRP6QTC.js} +1 -1
- package/dist/{chunk-Q5IC3IYY.js → chunk-DESZFFOK.js} +1 -1
- package/dist/{chunk-PLSS456F.js → chunk-DKR7562G.js} +1 -1
- package/dist/{chunk-LGXI7EGM.js → chunk-DNNTAMC5.js} +2 -2
- package/dist/chunk-DUPQUQ2Z.js +1 -0
- package/dist/{chunk-Q4JYAUVL.js → chunk-DUTIWCJ2.js} +1 -1
- package/dist/chunk-E6JEBSHZ.js +20 -0
- package/dist/chunk-E6KNAPIY.js +4 -0
- package/dist/chunk-E7XCCLQH.js +1 -0
- package/dist/chunk-EE72PCKT.js +1 -0
- package/dist/chunk-EEYXBKR7.js +4 -0
- package/dist/{chunk-ZRI3SSLG.js → chunk-EGLA3WLZ.js} +2 -2
- package/dist/chunk-EVQPYZ7F.js +5 -0
- package/dist/chunk-FDFE3SSG.js +35 -0
- package/dist/{chunk-Q7BOSHWX.js → chunk-FDSNRKGQ.js} +1 -1
- package/dist/chunk-FI5TQHUA.js +1 -0
- package/dist/chunk-FIKZQ4RA.js +1 -0
- package/dist/chunk-FJOVMEPN.js +3 -0
- package/dist/{chunk-ER6C5WS3.js → chunk-FLARCZ5F.js} +1 -1
- package/dist/chunk-FOMMPAWZ.js +1 -0
- package/dist/{chunk-6PUU6ZNQ.js → chunk-FRWQJAW2.js} +1 -1
- package/dist/{chunk-HXZAY5OA.js → chunk-G3DXNSA2.js} +1 -1
- package/dist/{chunk-XWSWXQCC.js → chunk-G7JO3W2R.js} +1 -1
- package/dist/{chunk-WESTVWWD.js → chunk-GABIWYY3.js} +1 -1
- package/dist/chunk-GFSEU7PF.js +6 -0
- package/dist/chunk-GFVUWVEM.js +1 -0
- package/dist/{chunk-ISKQQXLZ.js → chunk-GHNSXX7R.js} +1 -1
- package/dist/{chunk-2L6AN3QA.js → chunk-GQ3LY7BY.js} +1 -1
- package/dist/{chunk-2A2JSAAA.js → chunk-H45S4MGC.js} +1 -1
- package/dist/chunk-HEB4YYM6.js +9 -0
- package/dist/{chunk-CXI3RHPW.js → chunk-HI5FTI3M.js} +1 -1
- package/dist/chunk-HJ24NEP5.js +1 -0
- package/dist/chunk-HQFXVVTB.js +1 -0
- package/dist/{chunk-TODZ3TJR.js → chunk-HR6R7JXN.js} +1 -1
- package/dist/chunk-HRHJA5ZP.js +3 -0
- package/dist/{chunk-QEKGGTMN.js → chunk-HT5JQJMB.js} +1 -1
- package/dist/chunk-HT7273V7.js +1 -0
- package/dist/{chunk-UXVXVI6O.js → chunk-HUB4HDWN.js} +78 -76
- package/dist/chunk-IATNIWOC.js +13 -0
- package/dist/chunk-IHVWDKDV.js +2 -0
- package/dist/{chunk-3KM5ZOW2.js → chunk-IKXUYCK7.js} +1 -1
- package/dist/chunk-IVQN2RUP.js +1 -0
- package/dist/chunk-IWNFPBH2.js +33 -0
- package/dist/{chunk-ESFCYB46.js → chunk-J324ZPO6.js} +1 -1
- package/dist/{chunk-KNWT7JLL.js → chunk-JJQ3DJG5.js} +2 -2
- package/dist/{chunk-7CCTPBCT.js → chunk-JLAN6JXJ.js} +1 -1
- package/dist/chunk-K2GCCCCV.js +1 -0
- package/dist/{chunk-NVKJ7ZLP.js → chunk-K4KKSBUW.js} +1 -1
- package/dist/{chunk-BAHIL37I.js → chunk-K4QJEQI4.js} +1 -1
- package/dist/{chunk-QDCLL5OI.js → chunk-K5UVCBIP.js} +1 -1
- package/dist/{chunk-64G5TGFF.js → chunk-KN2JIDNO.js} +1 -1
- package/dist/chunk-KORVOCNN.js +1 -0
- package/dist/chunk-KRQCQ57O.js +1 -0
- package/dist/{chunk-3MYDSQHF.js → chunk-KT2AMFVW.js} +1 -1
- package/dist/chunk-L23Q53FM.js +70 -0
- package/dist/{chunk-UBP3LQFY.js → chunk-L3DTONOI.js} +2 -2
- package/dist/{chunk-BN7ZXAZJ.js → chunk-LG3KEHGD.js} +2 -2
- package/dist/chunk-LRETOC6P.js +1 -0
- package/dist/chunk-LXFWK3O2.js +1 -0
- package/dist/chunk-LZ2TN7EZ.js +1 -0
- package/dist/chunk-MBAPM5HA.js +15 -0
- package/dist/{chunk-UUAKOX7E.js → chunk-MGZK5EQW.js} +2 -2
- package/dist/chunk-MKUXSM33.js +1 -0
- package/dist/chunk-MQ55QUOJ.js +276 -0
- package/dist/chunk-NAQJMRPT.js +2296 -0
- package/dist/{chunk-DZKFP6H2.js → chunk-NMXRDF4T.js} +1 -1
- package/dist/chunk-NOWM3CCG.js +1 -0
- package/dist/chunk-NVDFXEQ5.js +5 -0
- package/dist/{chunk-CX5CC6P5.js → chunk-O472FAYX.js} +1 -1
- package/dist/{chunk-B2O3ANRZ.js → chunk-OCILF2DD.js} +1 -1
- package/dist/{chunk-67L7FIB6.js → chunk-OGBMFGYC.js} +1 -1
- package/dist/chunk-OIQ5NQ5I.js +18 -0
- package/dist/chunk-OKRKVVTK.js +103 -0
- package/dist/chunk-ONNUEQGR.js +3 -0
- package/dist/chunk-OSASE35V.js +6 -0
- package/dist/chunk-OTMTS5L4.js +3 -0
- package/dist/chunk-OWPAHXDF.js +3 -0
- package/dist/chunk-P7HZGJRU.js +6 -0
- package/dist/chunk-PIU3GVJ4.js +1 -0
- package/dist/{chunk-2WJOTJOD.js → chunk-PSNCWS3Q.js} +2 -2
- package/dist/chunk-PSREELSQ.js +22 -0
- package/dist/{chunk-AQ6EVL73.js → chunk-Q2CKRCPM.js} +1 -1
- package/dist/chunk-QA2D7DT2.js +1 -0
- package/dist/chunk-QBRRFFMZ.js +1 -0
- package/dist/chunk-QDMTJKQ3.js +1 -0
- package/dist/{chunk-3Z3MADXZ.js → chunk-QIJ7D2JS.js} +1 -1
- package/dist/chunk-QLN6IOOY.js +1 -0
- package/dist/chunk-QU3USVKT.js +1 -0
- package/dist/chunk-R2E6TMBE.js +22 -0
- package/dist/chunk-R4E2E4NN.js +1 -0
- package/dist/chunk-R5COVIJM.js +1 -0
- package/dist/chunk-RFJ2LI64.js +81 -0
- package/dist/chunk-RNF6T6IO.js +5 -0
- package/dist/chunk-RSNFNZ6F.js +2 -0
- package/dist/{chunk-I4CEH7AK.js → chunk-RZ3UGOV4.js} +2 -2
- package/dist/{chunk-35XFNKNB.js → chunk-S23ZG2RG.js} +1 -1
- package/dist/{chunk-PF53E2DC.js → chunk-SAK42CAY.js} +1 -1
- package/dist/chunk-SBX7CMHM.js +1 -0
- package/dist/{chunk-S5P7KWY4.js → chunk-SGQTRKYZ.js} +1 -1
- package/dist/chunk-SNPJVVVE.js +5 -0
- package/dist/chunk-SNRGS3YU.js +1 -0
- package/dist/chunk-SUTSCIXU.js +7 -0
- package/dist/chunk-SWFCT5B7.js +2 -0
- package/dist/{chunk-4KECSZTL.js → chunk-SZ64GAVG.js} +2 -2
- package/dist/{chunk-WBVS5NBV.js → chunk-TDHIOONG.js} +2 -2
- package/dist/{chunk-W37IFK3P.js → chunk-TLN4BKXJ.js} +102 -102
- package/dist/{chunk-QW52RPAU.js → chunk-TXMZPF2U.js} +1 -1
- package/dist/chunk-TZHVCMZN.js +6 -0
- package/dist/{chunk-IHXGZW42.js → chunk-TZOB52QK.js} +1 -1
- package/dist/{chunk-N57Y7THE.js → chunk-U5BKU3OL.js} +1 -1
- package/dist/{chunk-Y55T4IIQ.js → chunk-UK3BDOHR.js} +1 -1
- package/dist/chunk-UORSJB4A.js +857 -0
- package/dist/chunk-UU6UQ2QY.js +1 -0
- package/dist/{chunk-PWAT52M4.js → chunk-UY44O4IZ.js} +1 -1
- package/dist/{chunk-QF5WKTPD.js → chunk-V3H6SYK3.js} +1 -1
- package/dist/{chunk-YTUUU33R.js → chunk-VBPMVVLV.js} +1 -1
- package/dist/{chunk-SNH4XZ6E.js → chunk-VGBCG3I5.js} +1 -1
- package/dist/{chunk-QEVTBD33.js → chunk-VHRUPKWH.js} +1 -1
- package/dist/chunk-VVHJ2AUF.js +3 -0
- package/dist/chunk-WB5GRBHW.js +1 -0
- package/dist/{chunk-YSWVYPWR.js → chunk-WBKQSSWW.js} +1 -1
- package/dist/{chunk-SIL6HPMK.js → chunk-WDXDT7XY.js} +2 -2
- package/dist/{chunk-SACNUF4I.js → chunk-WHOD5I7N.js} +1 -1
- package/dist/{chunk-Z2WAW6MM.js → chunk-WL3M63DG.js} +1 -1
- package/dist/{chunk-LEHBZKK3.js → chunk-WLJDMI7E.js} +1 -1
- package/dist/{chunk-PTSCGSQV.js → chunk-WZ3QWPK5.js} +2 -2
- package/dist/{chunk-H6GNKWYM.js → chunk-X5V7AGVU.js} +1 -1
- package/dist/{chunk-RPVZ2JON.js → chunk-X76AYO36.js} +1 -1
- package/dist/chunk-XB7H2RYV.js +31 -0
- package/dist/chunk-XHHAVKKV.js +1 -0
- package/dist/chunk-XKNDU62O.js +1 -0
- package/dist/chunk-XVJRGOJA.js +4 -0
- package/dist/chunk-Y3ZAQZPH.js +16 -0
- package/dist/chunk-YF4AXKM4.js +1 -0
- package/dist/chunk-YGN65N6W.js +16 -0
- package/dist/{chunk-HF4NDEX3.js → chunk-YR4J46US.js} +1 -1
- package/dist/chunk-YTC367JI.js +3 -0
- package/dist/{chunk-ZBL7XMJ6.js → chunk-Z2FGYMJ6.js} +2 -2
- package/dist/chunk-Z3QZNLT5.js +1 -0
- package/dist/chunk-ZC3EDADH.js +26 -0
- package/dist/chunk-ZLITAXPT.js +1 -0
- package/dist/{chunk-ACA2BGAD.js → chunk-ZNEPRGFY.js} +1 -1
- package/dist/chunk-ZNEQZV5K.js +3 -0
- package/dist/chunk-ZOU6SOXW.js +20 -0
- package/dist/{chunk-YV2TP44L.js → chunk-ZQNGYJKJ.js} +1 -1
- package/dist/chunk-ZRM7ESSS.js +4 -0
- package/dist/chunk-ZX33FUW3.js +5 -0
- 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/channel-config.js +1 -1
- package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import/dashboard-extensions.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/security/check.js +1 -1
- package/dist/cli/commands/app/security/clean.js +1 -1
- package/dist/cli/commands/app/security/instructions.js +1 -1
- package/dist/cli/commands/app/security/record.js +1 -1
- package/dist/cli/commands/app/security/review.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/unschedule.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.d.ts +10 -10
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.d.ts +7 -7
- 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.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -7
- 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.d.ts +21 -21
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.d.ts +23 -23
- 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.d.ts +90 -90
- 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.d.ts +7 -7
- 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.d.ts +24 -24
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.d.ts +7 -7
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli-version-check-BW2CUMX4.js +1 -0
- package/dist/{command-event-context-LFUZ7UCA.js → command-event-context-ILIANB5Q.js} +1 -1
- package/dist/command-json-schema-LGR44Q2G.js +1 -0
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-TODPQ2LC.js +1 -0
- package/dist/configs/all.yml +9 -0
- package/dist/configs/recommended.yml +9 -0
- package/dist/custom-oclif-loader-BPE2TH4B.js +1 -0
- package/dist/data/filters.json +41 -2
- package/dist/data/local_block_entry.json +1 -1
- package/dist/data/manifest_theme.json +1 -0
- package/dist/data/objects.json +279 -44
- package/dist/data/section.json +15 -1
- package/dist/data/setting.json +9 -5
- package/dist/data/shopify_system_translations.json +312 -32
- package/dist/data/strict_settings.json +24 -0
- package/dist/data/tags.json +57 -24
- package/dist/data/theme_block.json +1 -1
- package/dist/deprecations-5CSI24TV.js +1 -0
- package/dist/dist-LPKYTX3M.js +1 -0
- package/dist/dist-WT6MPTKJ.js +1 -0
- package/dist/environment-5P7JJ3GI.js +1 -0
- package/dist/environments-3HTT5CVC.js +1 -0
- package/dist/error-PFOKPWFX.js +1 -0
- package/dist/error-handler-23FASAEU.js +1 -0
- package/dist/fs-RA25PWSJ.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +2 -2
- 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/http-EVDTYINS.js +1 -0
- package/dist/http-proxy-node16-NZZ674YW.js +38 -0
- package/dist/index.js +12 -12
- package/dist/is-global-3DNAMKUU.js +1 -0
- package/dist/json-error-HGCRNJRF.js +1 -0
- package/dist/latest-version-75YEFEMK.js +9 -0
- package/dist/lib-4ZA53LTZ.js +1 -0
- package/dist/lib-F3MES3XF.js +1 -0
- package/dist/lib-XPJABU24.js +1 -0
- package/dist/{local-OKPVB4NH.js → local-LNGPIGLG.js} +1 -1
- package/dist/metadata-VHLSUKCW.js +1 -0
- package/dist/{morph-CRY35DIK.js → morph-H7XQP55V.js} +3 -3
- package/dist/node-package-manager-SSFNUVWB.js +1 -0
- package/dist/notifications-system-3NQRYYKW.js +1 -0
- package/dist/{npa-A4YSCQ5Q.js → npa-LVYMN7GE.js} +1 -1
- package/dist/os-KIKVJONE.js +1 -0
- package/dist/output-DUJTSURG.js +1 -0
- package/dist/{prettier-EGVCP5CY.js → prettier-NOE3TJJ5.js} +1 -1
- package/dist/registry-auth-token-EDH77OOW.js +1 -0
- package/dist/registry-url-JMNV3LLX.js +1 -0
- package/dist/semver-HHZRKD6Y.js +1 -0
- package/dist/system-CGOZSROX.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-YMBFS3NG.js +1 -0
- package/dist/upgrade-73RRPDSC.js +1 -0
- package/dist/version-AMUEEBIG.js +1 -0
- package/dist/version-S4MGCKDO.js +1 -0
- package/dist/workerd-DRWNY3S4.js +18 -0
- package/oclif.manifest.json +25618 -1167
- package/package.json +7 -7
- package/dist/analytics-NMMVOF4B.js +0 -1
- package/dist/analytics-UK77WNLG.js +0 -1
- package/dist/chunk-224UPIYS.js +0 -4
- package/dist/chunk-27NXPOAS.js +0 -1
- package/dist/chunk-2MT3LSMZ.js +0 -1
- package/dist/chunk-2T4HDR6R.js +0 -70
- package/dist/chunk-2ZBXHCQZ.js +0 -1
- package/dist/chunk-335BUVBP.js +0 -1
- package/dist/chunk-33ZE3DRQ.js +0 -16
- package/dist/chunk-34MOWGRL.js +0 -1
- package/dist/chunk-3JSKNXL7.js +0 -1
- package/dist/chunk-3MG4MTWQ.js +0 -1
- package/dist/chunk-3XRI3D44.js +0 -1
- package/dist/chunk-43R5VGKT.js +0 -1
- package/dist/chunk-4WYKPIN3.js +0 -1
- package/dist/chunk-5AEZJZNQ.js +0 -1
- package/dist/chunk-5ED7SOQZ.js +0 -20
- package/dist/chunk-5IDJALJH.js +0 -1
- package/dist/chunk-66TMIQMB.js +0 -1
- package/dist/chunk-74NRFUGQ.js +0 -1
- package/dist/chunk-7GUMJ5E4.js +0 -1
- package/dist/chunk-7NFTSBHQ.js +0 -10
- package/dist/chunk-ACZNWIRY.js +0 -1
- package/dist/chunk-AUE7LM32.js +0 -1
- package/dist/chunk-AXL2VIWA.js +0 -16
- package/dist/chunk-B3ZJGYZY.js +0 -3
- package/dist/chunk-BOAGJ6P5.js +0 -1
- package/dist/chunk-BWN2QG6D.js +0 -5
- package/dist/chunk-CCUQM4FX.js +0 -6
- package/dist/chunk-CLUUA3HX.js +0 -3
- package/dist/chunk-CYEEGTVZ.js +0 -11
- package/dist/chunk-DBDTE3EE.js +0 -5
- package/dist/chunk-DLVB3237.js +0 -31
- package/dist/chunk-DN6X7SHW.js +0 -2
- package/dist/chunk-E5COIKGY.js +0 -5
- package/dist/chunk-E6RONHMT.js +0 -1
- package/dist/chunk-EAZIQI2D.js +0 -1
- package/dist/chunk-EEY4FKAW.js +0 -1
- package/dist/chunk-EKFPTBXC.js +0 -1
- package/dist/chunk-F3CK3EJJ.js +0 -1
- package/dist/chunk-FEBOZ2XX.js +0 -31
- package/dist/chunk-FFSDGRAN.js +0 -1
- package/dist/chunk-FZCGRIOM.js +0 -1
- package/dist/chunk-GNCVDN7U.js +0 -1
- package/dist/chunk-GQLNG537.js +0 -836
- package/dist/chunk-GVI3DWSB.js +0 -4
- package/dist/chunk-GW7YIJPJ.js +0 -5
- package/dist/chunk-H6GYBLVQ.js +0 -2
- package/dist/chunk-HB3MJYBK.js +0 -1
- package/dist/chunk-HSKDFEXW.js +0 -1
- package/dist/chunk-HTRJU4R4.js +0 -1
- package/dist/chunk-I7PEEJVH.js +0 -1
- package/dist/chunk-IHMATNOR.js +0 -1
- package/dist/chunk-IJY3RJPJ.js +0 -47
- package/dist/chunk-J3JPJCWP.js +0 -1
- package/dist/chunk-J55GQLP4.js +0 -1
- package/dist/chunk-JLQRDFR5.js +0 -18
- package/dist/chunk-JPWRZ5SL.js +0 -16
- package/dist/chunk-K7ZSPQKL.js +0 -4
- package/dist/chunk-L5TSPCSY.js +0 -26
- package/dist/chunk-LUGMXSRI.js +0 -9
- package/dist/chunk-M2CWCOFU.js +0 -11
- package/dist/chunk-M5VIFG2V.js +0 -1
- package/dist/chunk-MADINS4Z.js +0 -1
- package/dist/chunk-MGHPF7HU.js +0 -6
- package/dist/chunk-MHR5OHT5.js +0 -10
- package/dist/chunk-MXEXP3HT.js +0 -15
- package/dist/chunk-OJULL7HT.js +0 -1
- package/dist/chunk-OMPQ7REW.js +0 -3
- package/dist/chunk-OR4IJ4BQ.js +0 -1
- package/dist/chunk-P2RMFHQP.js +0 -1
- package/dist/chunk-P4VZYOKO.js +0 -15
- package/dist/chunk-PDZBKVWL.js +0 -97
- package/dist/chunk-Q2KWXZQB.js +0 -12
- package/dist/chunk-QFSENE5T.js +0 -3
- package/dist/chunk-QFWWCZOI.js +0 -1
- package/dist/chunk-QFYLJVJW.js +0 -77
- package/dist/chunk-QQJNQNKP.js +0 -6
- package/dist/chunk-R4UVIYZP.js +0 -4
- package/dist/chunk-RLNIOJH3.js +0 -272
- package/dist/chunk-RW6G4ZPU.js +0 -1
- package/dist/chunk-S4LOWCGS.js +0 -1
- package/dist/chunk-SB27UOXX.js +0 -1
- package/dist/chunk-SHD4VV5V.js +0 -3
- package/dist/chunk-SK7EPN6C.js +0 -1
- package/dist/chunk-TAWCKJKP.js +0 -1
- package/dist/chunk-U2T5HPRD.js +0 -319
- package/dist/chunk-U6YOP562.js +0 -1
- package/dist/chunk-UPPO3BMT.js +0 -7
- package/dist/chunk-USXIXANP.js +0 -103
- package/dist/chunk-UV5GAGAD.js +0 -1
- package/dist/chunk-UY6W2EVZ.js +0 -1
- package/dist/chunk-UYELAINQ.js +0 -16
- package/dist/chunk-V75WUEFU.js +0 -1
- package/dist/chunk-VAVXDIUX.js +0 -6
- package/dist/chunk-VGSH52JM.js +0 -1
- package/dist/chunk-VHZ6RL67.js +0 -1
- package/dist/chunk-VQA3X7O3.js +0 -1
- package/dist/chunk-VZCMJRYV.js +0 -1
- package/dist/chunk-W56ZGEQQ.js +0 -2265
- package/dist/chunk-WCC52MR2.js +0 -1
- package/dist/chunk-WSDKCQH6.js +0 -6
- package/dist/chunk-X2PFXSU4.js +0 -1
- package/dist/chunk-X5NIAZA4.js +0 -1
- package/dist/chunk-XBMD3FEZ.js +0 -3
- package/dist/chunk-XDVPIGXE.js +0 -2
- package/dist/chunk-XLIJYJ6Q.js +0 -1
- package/dist/chunk-XUHGWIWW.js +0 -4
- package/dist/chunk-Y5CVX5LJ.js +0 -1
- package/dist/chunk-Y6J46XYF.js +0 -3
- package/dist/chunk-YKMINHYY.js +0 -3
- package/dist/chunk-ZDQO6CNY.js +0 -1
- package/dist/chunk-ZGASBRSQ.js +0 -5
- package/dist/chunk-ZGBTO46A.js +0 -1
- package/dist/chunk-ZJOX5HW4.js +0 -22
- package/dist/chunk-ZOOT3GBY.js +0 -5
- package/dist/command-json-schema-F5XF7XHL.js +0 -1
- package/dist/conf-store-5CBLWTOC.js +0 -1
- package/dist/custom-oclif-loader-UDVUFKMD.js +0 -1
- package/dist/deprecations-EOHPSTCS.js +0 -1
- package/dist/dist-RNV3GFZ7.js +0 -1
- package/dist/dist-ZFKWJVNB.js +0 -1
- package/dist/environment-O7ECODHU.js +0 -1
- package/dist/environments-4FLRZW4P.js +0 -1
- package/dist/error-JY2ADS6S.js +0 -1
- package/dist/error-handler-4GCXKC6I.js +0 -1
- package/dist/fs-XS5YF34R.js +0 -1
- package/dist/http-proxy-node16-D3JUYA5D.js +0 -38
- package/dist/is-global-27MUENOK.js +0 -1
- package/dist/json-error-S5XFS3UX.js +0 -1
- package/dist/latest-version-LDWU5F7A.js +0 -49
- package/dist/lib-PJHT4MKY.js +0 -1
- package/dist/lib-VKSQ65BQ.js +0 -1
- package/dist/lib-YEZOHXF3.js +0 -1
- package/dist/metadata-2YJBAKR7.js +0 -1
- package/dist/node-package-manager-B3OW3PFQ.js +0 -1
- package/dist/notifications-system-BWTDYBG2.js +0 -1
- package/dist/os-F6QKJCFW.js +0 -1
- package/dist/output-BRIPK7UC.js +0 -1
- package/dist/system-466QKFDI.js +0 -1
- package/dist/ui-VJTNGCS6.js +0 -1
- package/dist/upgrade-VHVJLXKX.js +0 -1
- package/dist/version-FETZRLZO.js +0 -1
- package/dist/version-T4XXTJMB.js +0 -1
- package/dist/workerd-32DMKLMN.js +0 -18
- /package/dist/{chunk-YLQ3LNNY.js → chunk-HVECVOIO.js} +0 -0
- /package/dist/{chunk-YRHFPXC3.js → chunk-Z2AV4BWZ.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{A as D,P as h,W as y,Y as J,Z as Ae,ba as Te,c as W,ca as Ie,d as _e,e as G,f as Ve,fa as we,ga as Q,h as De,ha as Re,ia as xe,ja as qe,ka as ze,t as x}from"./chunk-HEB4YYM6.js";import{d as ye}from"./chunk-LXFWK3O2.js";import{B as b,N as Ne,O as fe,R as $,f as pe,p as ke,q as B,sa as g,ta as H,wa as j,x as w,xa as Se,y as ve,ya as R,z as L}from"./chunk-UORSJB4A.js";import{w as K}from"./chunk-OSASE35V.js";import{b as ce}from"./chunk-CE6XQDAG.js";import{a as re}from"./chunk-EE72PCKT.js";import{e as O,f as ue}from"./chunk-2KFYIYLI.js";import{j as k,n as _}from"./chunk-FJOVMEPN.js";import{Eb as V,Fb as be,N as P,Sa as me,fa as I,la as le,tb as he,vb as Fe}from"./chunk-OIQ5NQ5I.js";import{b as m}from"./chunk-3PYDIBTX.js";import{g as ge}from"./chunk-A5BSUUNQ.js";import{e as M,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();function Ce(n){return pe`
|
|
2
|
+
query OrganizationBetaFlags($organizationId: OrganizationID!) {
|
|
3
|
+
organization(organizationId: $organizationId) {
|
|
4
|
+
id
|
|
5
|
+
${n.map(e=>`flag_${e}: hasFeatureFlag(handle: "${e}")`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
}
|
|
8
|
+
}`}d();var Ue={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationExpFlags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"flagHandles"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"enabledFlags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"flagHandles"},value:{kind:"Variable",name:{kind:"Name",value:"flagHandles"}}}]},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var Y=class extends k{},F=class extends k{constructor(e,i){let a="unknown",t=r=>`an ${r}`;fe(e)?(a=e.orgName,t=r=>`the ${r} organization`):Ne(e)&&(a=e.email,t=r=>`the ${r} user`);let o=Fe`${he.yellow(a)}`.value,l=[[`Your current active session is associated with ${t(o)} account. To start a new session with a different account, run`,{command:"shopify auth login"}],["Have you",{link:{label:"created a Shopify Partners organization",url:"https://partners.shopify.com/signup"}},{char:"?"}],["Does your account include",{subdued:"Manage app"},"permissions?, please contact the owner of the organization to grant you access."],"Have you confirmed your accounts from the emails you received?",["Need to connect to a different App or organization? Run the command again with",{command:"--reset"}]];i&&l.push(["Do you have access to the right Shopify Partners organization? The CLI is loading",{link:{label:"this organization",url:`https://partner.shopify.com/${i}`}}]),super("No Organization found",void 0,l)}};async function bi(){let n=Ee(),e=await n.organizations();if(e.length===0){let i=await n.session();throw new F(i.accountInfo)}return e}async function _i(n,e){let i=await e.orgFromId(n);if(!i)throw new F((await e.session()).accountInfo,n);return i}async function Vi(n,e,i,a=["APP_DEVELOPMENT"]){let t=await i.storeByDomain(n.id,e,a);if(!t){let l=a.length===1&&a[0]==="APP_DEVELOPMENT"?"Ensure you have provided the correct store domain, that the store is a dev store, and that you have access to the store.":"Ensure you have provided the correct store domain and that you have access to the store.";throw new Y(`Could not find store for domain ${e} in organization ${n.businessName}.`,l)}return t}d();var A=class extends k{versionTag;constructor(e){super(`Version ${e} could not be found.`),this.versionTag=e}};d();var q;(function(n){n.Partners="Partners",n.BusinessPlatform="BusinessPlatform"})(q||(q={}));var In="https://dev.shopify.com",wn=["SHOPIFY_SERVICE_ACCOUNT_TOKEN","SHOPIFY_APP_AUTOMATION_TOKEN","SHOPIFY_CLI_PARTNERS_TOKEN"],X=x.appClientSecret;async function Rn(n){let e=Me(n.apiSecretKeys);return e||Me(await n.developerPlatformClient.appClientSecrets(n))}async function xn(n){let e=O()[X];return e?(V(`Using the app's client secret from ${X}.`),e):Rn(n)}async function Ci(n,e){let i=await xn(n);if(i)return i;throw new k("This command needs the app's client secret, and the App Management API didn't return one for your credentials.",`${e??Pe()} ${qn()}`)}function qn(){return`To give the CLI the app's client secret directly, for example in CI, set ${X} to it.`}function Pe(){let n=O(),e=wn.filter(i=>n[i]!==void 0);return e.length>0?`The token in ${e[0]} might not have access to the app's client secret. To use your own account, unset ${e.join(" and ")}, log in with \`shopify auth login\`, and run the command again.`:`Check that your account can view the app's client credentials in the Developer Dashboard: ${In}`}function Ui(){be(`SHOPIFY_API_SECRET isn't included because the App Management API didn't return the app's client secret for your credentials. ${Pe()}`)}function Me(n){return n.find(e=>e.secret)?.secret}d();var zn=h.extend({application_url:D(m.string({required_error:"Valid URL is required"})),embedded:m.boolean({required_error:"Boolean is required",invalid_type_error:"Value must be Boolean"}),app_preferences:m.object({url:D(m.string().max(255,{message:"String must be less than 255 characters"}))}).optional()}),Cn={app_url:"application_url",embedded:"embedded",preferences_url:"app_preferences.url"},Z="app_home",Un=y({identifier:Z,schema:zn,transformConfig:Cn,patchWithAppDevURLs:(n,e)=>{n.application_url=e.applicationUrl},getDevSessionUpdateMessages:async n=>[`Using URL: ${n.application_url}`]}),$i=Un;d();var En=h.extend({name:m.string({required_error:"String is required"}).max(30,{message:"String must be less than 30 characters"}),handle:m.string({required_error:"String is required"}).max(256,{message:"String must be less than 256 characters long"}).refine(n=>n&&/^\w*(?!-)[_a-z0-9-]+(?<!-)$/.test(n),{message:"String can't contain special characters"}).optional()}),Mn={name:"name",app_handle:"handle"},ee="branding",Pn=y({identifier:ee,schema:En,transformConfig:Mn}),Ji=Pn;d();var On=m.object({scopes:m.string().transform(n=>I(n)??"").optional(),required_scopes:m.array(m.string()).optional(),optional_scopes:m.array(m.string()).optional(),use_legacy_install_flow:m.boolean().optional()}),Bn=m.object({redirect_urls:m.array(D(m.string()))}),Ln=h.extend({access:m.object({admin:m.object({direct_api_mode:m.union([m.literal("online"),m.literal("offline")]).optional(),embedded_app_direct_api_access:m.boolean().optional()}).optional()}).optional(),access_scopes:On.optional(),auth:Bn}),ne="app_access",Oe={access:"access",scopes:"access_scopes.scopes",required_scopes:"access_scopes.required_scopes",optional_scopes:"access_scopes.optional_scopes",use_legacy_install_flow:"access_scopes.use_legacy_install_flow",redirect_url_allowlist:"auth.redirect_urls"};function $n(n){let{shop_scopes:e,...i}=n,a=typeof e=="string"?I(e):void 0;if(!a)return i;let t=typeof i.scopes=="string"?i.scopes:"";return{...i,scopes:I([t,a].join(","))}}var Hn={forward:n=>J(n,Oe),reverse:n=>J($n(n),Oe,!0)},jn=y({identifier:ne,schema:Ln,transformConfig:Hn,getDevSessionUpdateMessages:async n=>{let e=n.access_scopes!==void 0,i=n.access_scopes?.use_legacy_install_flow===!0,a=n.access_scopes?.scopes==null&&n.access_scopes?.required_scopes==null;if(i||e&&a)return["Using legacy install flow - access scopes are not auto-granted"];let t=n.access_scopes?.scopes?n.access_scopes.scopes.split(",").map(o=>o.trim()).join(", "):n.access_scopes?.required_scopes?.join(", ");return t?[`Access scopes auto-granted: ${t}`]:["App has been installed"]},patchWithAppDevURLs:(n,e)=>{e.redirectUrlWhitelist&&(n.auth={redirect_urls:e.redirectUrlWhitelist})}}),aa=jn;d();var Be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"websocketUrl"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"assetsUrl"},value:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}}},{kind:"Argument",name:{kind:"Name",value:"websocketUrl"},value:{kind:"Variable",name:{kind:"Name",value:"websocketUrl"}}},{kind:"Argument",name:{kind:"Name",value:"isUnsafe"},value:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websocketUrl"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var Le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"manifest"}},type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"inheritedModuleUids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"assetsUrl"},value:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}}},{kind:"Argument",name:{kind:"Name",value:"manifest"},value:{kind:"Variable",name:{kind:"Name",value:"manifest"}}},{kind:"Argument",name:{kind:"Name",value:"inheritedModuleUids"},value:{kind:"Variable",name:{kind:"Name",value:"inheritedModuleUids"}}},{kind:"Argument",name:{kind:"Name",value:"isUnsafe"},value:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websocketUrl"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var $e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var He={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchStoreByDomain"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"domain"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filters"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopFilterInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"domain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"externalId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"shortName"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPermissions"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var je={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAppDevStores"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_TYPE"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"app_development",block:!1}}]},{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_STATUS"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"ACTIVE",block:!1}}]}]}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"externalId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"shortName"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPermissions"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var Ke={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DevStoreCapReached"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devStoreCapReached"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var We={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProvisionShopAccess"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationUserProvisionShopAccessInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationUserProvisionShopAccess"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationUserProvisionShopAccessInput"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var Ge={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ActiveAppReleaseFromApiKey"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"app"},name:{kind:"Name",value:"appByKey"},arguments:[{kind:"Argument",name:{kind:"Name",value:"key"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AppVersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"AppVersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"App"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"organizationId"}},{kind:"Field",name:{kind:"Name",value:"activeRoot"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"grantedShopifyApprovalScopes"}}]}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]}}]}}]};d();var Je={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppClientCredentials"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"app"},name:{kind:"Name",value:"appByKey"},arguments:[{kind:"Argument",name:{kind:"Name",value:"key"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"activeRoot"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientCredentials"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secrets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ReleaseVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appReleaseCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"versionId"},value:{kind:"Variable",name:{kind:"Name",value:"versionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"release"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var Qe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AppVersionInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"metadata"}},type:{kind:"NamedType",name:{kind:"Name",value:"VersionMetadataInput"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appVersionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}},{kind:"Argument",name:{kind:"Name",value:"metadata"},value:{kind:"Variable",name:{kind:"Name",value:"metadata"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}}]};d();var Ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAssetURL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sourceExtension"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SourceExtension"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appRequestSourceUploadUrl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sourceExtension"},value:{kind:"Variable",name:{kind:"Name",value:"sourceExtension"}}},{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sourceUploadUrl"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var Xe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"versionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"VersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Version"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}}]}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]};d();var Ze={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"versions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"20"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"createdBy"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"versionsCount"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var en={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppInstallCount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"installCount"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateApp"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"initialVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AppVersionInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"initialVersion"},value:{kind:"Variable",name:{kind:"Name",value:"initialVersion"}}},{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var an={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"fetchSpecifications"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"specifications"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"features"}},{kind:"Field",name:{kind:"Name",value:"uidStrategy"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"appModuleLimit"}},{kind:"Field",name:{kind:"Name",value:"isClientProvided"}}]}},{kind:"Field",name:{kind:"Name",value:"validationSchema"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jsonSchema"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var tn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"listApps"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appsConnection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var on={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"organizations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var dn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"availableTopics"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"availableTopics"},arguments:[{kind:"Argument",name:{kind:"Name",value:"apiVersion"},value:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}}}]}]}}]};d();var sn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CliTesting"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"address"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"deliveryMethod"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sharedSecret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topic"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cliTesting"},arguments:[{kind:"Argument",name:{kind:"Name",value:"address"},value:{kind:"Variable",name:{kind:"Name",value:"address"}}},{kind:"Argument",name:{kind:"Name",value:"apiKey"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}},{kind:"Argument",name:{kind:"Name",value:"apiVersion"},value:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}}},{kind:"Argument",name:{kind:"Name",value:"deliveryMethod"},value:{kind:"Variable",name:{kind:"Name",value:"deliveryMethod"}}},{kind:"Argument",name:{kind:"Name",value:"sharedSecret"},value:{kind:"Variable",name:{kind:"Name",value:"sharedSecret"}}},{kind:"Argument",name:{kind:"Name",value:"topic"},value:{kind:"Variable",name:{kind:"Name",value:"topic"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"headers"}},{kind:"Field",name:{kind:"Name",value:"samplePayload"}},{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var rn={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:"__typename"}}]}}]}}]};d();var ln={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SchemaDefinitionByTarget"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"handle"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"target"},arguments:[{kind:"Argument",name:{kind:"Name",value:"handle"},value:{kind:"Variable",name:{kind:"Name",value:"handle"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"api"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var mn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SchemaDefinitionByApiType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"api"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var ae="webhooks",Kn={forward:Te,reverse:n=>Ie(n)},Wn=y({identifier:ae,schema:we,transformConfig:Kn}),at=Wn;d();var un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionByTag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionTag"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"versionByTag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"tag"},value:{kind:"Variable",name:{kind:"Name",value:"versionTag"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"VersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Version"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}}]}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]};d();var pn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AppLogsSubscribe"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopIds"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appLogsSubscribe"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopIds"},value:{kind:"Variable",name:{kind:"Name",value:"shopIds"}}},{kind:"Argument",name:{kind:"Name",value:"apiKey"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jwtToken"}},{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};d();var kn=M(H()),Gn=new kn.default({minTime:150,maxConcurrent:10});async function cn(n){let e="App Dev",i=b(n.shopFqdn),t=`https://${await ve(i)}/app_dev/unstable/graphql.json`,o=ce()==="local"?{"x-forwarded-host":i}:void 0;return Gn.schedule(()=>g({query:n.query,api:e,url:t,token:n.token,addedHeaders:o,variables:n.variables,unauthorizedHandler:n.unauthorizedHandler,preferredBehaviour:n.requestOptions?.requestMode}))}d();var vn=M(H()),Jn=new vn.default({minTime:150,maxConcurrent:10});async function Qn(n,e,i){let a="Functions",o=`https://${await w()}/functions/unstable/organizations/${n}/${i}/graphql`;return{token:e,api:a,url:o,responseOptions:{onResponse:ze}}}async function Nn(n){return await Jn.schedule(async()=>g({...await Qn(n.organizationId,n.token,n.appId),query:n.query,variables:n.variables,unauthorizedHandler:n.unauthorizedHandler}))}d();var fn=M(H()),Yn=new fn.default({minTime:150,maxConcurrent:10});async function Sn(n){let e="Webhooks",a=`https://${await w()}/webhooks/unstable/organizations/${n.organizationId}/graphql.json`;return Yn.schedule(()=>g({query:n.query,api:e,url:a,token:n.token,variables:n.variables,unauthorizedHandler:n.unauthorizedHandler}))}import{randomUUID as Xn}from"crypto";var yn="https://cdn.shopify.com/static/cli/extensions/templates.json",Zn=Xn(),ei=m.object({statusCode:m.literal(200),errors:m.array(m.object({path:m.tuple([m.literal("versionByTag")]),extensions:m.object({app_errors:m.object({errors:m.array(m.object({category:m.literal("not_found")})).nonempty()})})})).nonempty()}),C=class n{static instance;static getInstance(e){return n.instance??=new n(e),n.instance}static resetInstance(){n.instance=void 0}clientName=U.AppManagement;webUiName="Developer Dashboard";organizationSource=q.BusinessPlatform;bundleFormat="br";_session;constructor(e){this._session=e}async subscribeToAppLogs(e,i){return this.appManagementRequest({query:pn,variables:{shopIds:e.shopIds,apiKey:e.apiKey}})}async appLogs(e,i){let a=await ui({organizationId:i,jwtToken:e.jwtToken,cursor:e.cursor,filters:e.filters});try{let t=await a.json();return a.ok?{app_logs:t.app_logs??[],cursor:t.cursor,status:a.status}:{errors:t.errors??[`Request failed with status ${a.status}`],status:a.status}}catch(t){return{errors:[`Failed to parse response: ${t}`],status:a.status}}}async channelSpecExport(e){let i=W(e.id)??e.id,a=await xe(e.organizationId,i),t=await B(a,{method:"GET",headers:Q(await this.token())}),o;try{o=await t.json()}catch{o=void 0}let l=typeof o=="object"&&o!==null&&!Array.isArray(o)?o:void 0;return t.ok&&l?{ok:!0,status:t.status,body:l}:{ok:!1,status:t.status,body:l}}async session(){if(!this._session){if(ge())throw new Error("AppManagementClient.session() should not be invoked dynamically in a unit test");let e=await $(),{appManagementToken:i,businessPlatformToken:a,userId:t}=e,o=await j({query:on,cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:t},token:a,unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")});if(ue()&&o.currentUserAccount){let l=o.currentUserAccount.organizations.nodes.map(r=>({name:r.name}));if(l.length>1)throw new _("Multiple organizations found for the CLI token");this._session={token:i,businessPlatformToken:a,accountInfo:{type:"ServiceAccount",orgName:l[0]?.name??"Unknown organization"},userId:t}}else o.currentUserAccount?this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UserAccount",email:o.currentUserAccount.email},userId:t}:this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UnknownAccount"},userId:t}}return this._session}async token(){return(await this.session()).token}async businessPlatformToken(){return(await this.session()).businessPlatformToken}async unsafeRefreshToken(){let e=await $({noPrompt:!0,forceRefresh:!0}),i=await this.session();return i.token=e.appManagementToken,i.businessPlatformToken=e.businessPlatformToken,i.token}async accountInfo(){return(await this.session()).accountInfo}async appFromIdentifiers(e){let{app:i}=await this.activeAppVersionRawResult(e);if(!i)return;let{name:a,appModules:t}=i.activeRelease.version,o=t.find(l=>l.specification.externalIdentifier==="app_home");return{id:i.id,title:a,apiKey:i.key,apiSecretKeys:[],organizationId:String(p(i.organizationId)),grantedScopes:i.activeRoot.grantedShopifyApprovalScopes,applicationUrl:o?.config?.app_url,embedded:o?.config?.embedded,flags:[],developerPlatformClient:this}}async appClientSecrets({apiKey:e}){let{app:i}=await this.appManagementRequest({query:Je,variables:{apiKey:e}});return i?.activeRoot.clientCredentials?.secrets.map(t=>({secret:t.key}))??[]}async organizations(){return(await Ve()).map(i=>({...i,source:this.organizationSource}))}async orgFromId(e){let i=await De(e,await this.businessPlatformToken(),this.createUnauthorizedHandler("businessPlatform"));if(i)return{...i,source:this.organizationSource}}async orgAndApps(e){let[i,{apps:a,hasMorePages:t}]=await Promise.all([this.orgFromId(e),this.appsForOrg(e)]);if(!i){let{accountInfo:o}=await this.session();throw new F(o,e)}return{organization:i,apps:a,hasMorePages:t}}async appsForOrg(e,i=""){let a=tn,t={query:i.split(" ").filter(r=>r).map(r=>`title:${r}`).join(" "),organizationId:e},o=await this.appManagementRequest({query:a,variables:t});if(!o.appsConnection)throw new _("Server failed to retrieve apps");return{apps:o.appsConnection.edges.map(r=>{let s=r.node;return{id:s.id,apiKey:s.key,title:s.activeRelease.version.name,organizationId:e}}),hasMorePages:o.appsConnection.pageInfo.hasNextPage}}async specifications({organizationId:e}){let i=an,a={organizationId:te(e)};return(await this.appManagementRequest({query:i,variables:a})).specifications.map(o=>({name:o.name,externalName:o.name,identifier:o.identifier,externalIdentifier:o.externalIdentifier,gated:!1,managementExperience:"cli",registrationLimit:o.uidStrategy.appModuleLimit,uidStrategy:mi(o.uidStrategy.__typename),experience:oe(o.experience,o.identifier),validationSchema:o.validationSchema}))}async templateSpecifications({organizationId:e},i={}){let a,{templatesJsonPath:t}=x,o=process.env[t];if(o){if(!await me(o))throw new k("There is no file at the path specified for template specifications");let u=await le(o);a=JSON.parse(u)}else try{a=await(await ke(yn)).json()}catch{throw new k(["Failed to fetch extension templates from",{link:{url:yn}},{char:"."},"This likely means a problem with your internet connection."])}let l=0,r=i.requestedTemplate?a.filter(u=>u.identifier===i.requestedTemplate):void 0,s=r&&r.length>0?r:a,v=(await li(s,async u=>this.organizationBetaFlags(e,u),async u=>this.organizationExpFlags(e,u))).map(u=>({...u,sortPriority:l++})),c=[];for(let u of a)u.group&&!c.includes(u.group)&&c.push(u.group);return{templates:v,groupOrder:c}}async createApp(e,i){let t=(await this.apiVersions(e.id)).publicApiVersions.filter(c=>c!=="unstable").sort().at(-1)??"unstable",o=ai(i,e.id,t),l=nn,r=await this.appManagementRequest({query:l,variables:o});if(!r.appCreate.app||r.appCreate.userErrors?.length>0){let c=r.appCreate.userErrors.map(u=>u.message).join(", ");throw new k(c)}let s=Vn([]),v=r.appCreate.app;return{...v,title:i.name,apiKey:v.key,apiSecretKeys:[],grantedScopes:i?.scopesArray??[],organizationId:e.id,newApp:!0,flags:s,developerPlatformClient:this}}async devStoresForOrg(e,i){let a=await this.businessPlatformOrganizationsRequest({query:je,organizationId:String(p(e)),variables:{searchTerm:i}}),t=a.organization;if(!t)throw new k("No organization found");let o=t.accessibleShops?.edges.map(r=>r.node)??[],l=_n(t.currentUser?.organizationPermissions??[]);return{stores:hn(o,l),hasMorePages:a.organization?.accessibleShops?.pageInfo.hasNextPage??!1}}async devStoreCapReached(e){return(await this.businessPlatformOrganizationsRequest({query:Ke,organizationId:String(p(e)),variables:{}})).organization?.devStoreCapReached??!1}async appExtensionRegistrations(e,i){let a=i??await this.activeAppVersion(e),t=[],o=[],l=[];return a.appModuleVersions.forEach(r=>{let s={id:r.registrationId,uuid:r.registrationUuid,title:r.handle,type:r.type,activeVersion:r.config?{config:JSON.stringify(r.config),...r.target&&{context:r.target}}:void 0};r.specification?.experience==="configuration"?t.push(s):r.specification?.options?.managementExperience==="dashboard"?l.push(s):o.push(s)}),{app:{dashboardManagedExtensionRegistrations:l,configurationRegistrations:t,extensionRegistrations:o}}}async appVersions({id:e,organizationId:i,title:a}){let t=Ze,o={appId:e},l=await this.appManagementRequest({query:t,variables:o});return l.app?{app:{id:l.app.id,organizationId:i,title:a,appVersions:{nodes:l.app.versions?.edges.map(r=>{let s=r.node;return{createdAt:s.createdAt,createdBy:{displayName:s.createdBy},versionTag:s.metadata.versionTag,status:s.id===l.app.activeRelease.version.id?"active":"inactive",versionId:s.id,message:s.metadata.message}})??[],pageInfo:{totalResults:l.app.versionsCount}}}}:{app:null}}async appInstallCount({id:e}){let i=en,a={appId:e};return(await this.appManagementRequest({query:i,variables:a})).app.installCount??0}async appVersionByTag({id:e,organizationId:i},a){let t=un,o={appId:e,versionTag:a},r=(await this.appManagementRequest({query:t,variables:o}).catch(s=>{throw ei.safeParse(s).success?new A(a):s})).versionByTag;if(!r)throw new A(a);return{id:parseInt(r.id,10),uuid:r.id,versionTag:r.metadata.versionTag,location:[await z({organizationId:i,id:e}),"versions",p(r.id)].join("/"),message:r.metadata.message??"",appModuleVersions:r.appModules.map(Fn)}}async appVersionsDiff(e,{versionId:i}){let a={versionId:i},[t,o]=await Promise.all([this.activeAppVersionRawResult(e.apiKey),this.appManagementRequest({query:Xe,variables:a})]),l=t.app.activeRelease.version.appModules,r=o.version.appModules,{added:s,removed:v,updated:c}=ri({currentModules:l,selectedVersionModules:r});function u(N){return{uuid:N.uuid,handle:N.handle,specification:{identifier:N.specification.identifier,experience:oe(N.specification.experience,N.specification.identifier),options:{managementExperience:"cli"}}}}return{app:{versionsDiff:{added:s.map(u),updated:c.map(u),removed:v.map(u)}}}}async activeAppVersion(e){let i=await this.activeAppVersionRawResult(e.apiKey);return{appModuleVersions:i.app.activeRelease.version.appModules.map(Fn),...i.app.activeRelease}}async generateSignedUploadUrl({apiKey:e,organizationId:i}){let a={sourceExtension:"BR",organizationId:te(i)},t=await this.appManagementRequest({query:Ye,variables:a,cacheOptions:{cacheTTL:{minutes:59},cacheExtraKey:`${e}-${Zn}`}});return{assetUrl:t.appRequestSourceUploadUrl.sourceUploadUrl,userErrors:t.appRequestSourceUploadUrl.userErrors}}async deploy({appManifest:e,appId:i,organizationId:a,versionTag:t,message:o,commitReference:l,bundleUrl:r,skipPublish:s}){let u={appId:i,version:r?{sourceUrl:r}:{source:e},metadata:{versionTag:t,message:o,sourceControlUrl:l}},N=await this.appManagementRequest({query:Qe,variables:u,requestOptions:{requestMode:"slow-request"}}),{version:f}=N.appVersionCreate,T=N.appVersionCreate.userErrors.map(bn)??[];if(!f)return{appDeploy:{userErrors:T}};let S={appDeploy:{appVersion:{uuid:f.id,id:parseInt(f.id,10),versionTag:f.metadata.versionTag,location:await si(a,i,f.id),appModuleVersions:f.appModules.map(se=>({uuid:se.uuid,registrationUuid:se.uuid,validationErrors:[]})),message:f.metadata.message},userErrors:T}};if(s)return S;let Tn={appId:i,versionId:f.id},E=await this.appManagementRequest({query:ie,variables:Tn});return E.appReleaseCreate.userErrors&&(S.appDeploy.userErrors=(S.appDeploy.userErrors??[]).concat(E.appReleaseCreate.userErrors.map(bn))),!E.appReleaseCreate.release&&S.appDeploy.userErrors.length===0&&S.appDeploy.userErrors.push({message:"The API did not return a release for the created app version.",category:"",details:[]}),S}async release({app:{id:e,organizationId:i},version:{versionId:a}}){let t={appId:e,versionId:a},o=await this.appManagementRequest({query:ie,variables:t});if(o.appReleaseCreate.release&&!o.appReleaseCreate.userErrors?.length)return{appRelease:{appVersion:{versionTag:o.appReleaseCreate.release.version.metadata.versionTag,message:o.appReleaseCreate.release.version.metadata.message,location:[await z({organizationId:i,id:e}),"versions",p(o.appReleaseCreate.release.version.id).toString()].join("/")}}};if(!o.appReleaseCreate.userErrors?.length)throw new k("The Developer Dashboard did not confirm the app version release.");return{appRelease:{userErrors:o.appReleaseCreate.userErrors?.map(l=>({field:l.field,message:l.message,category:l.category,details:[],on:l.on}))??[]}}}async storeByDomain(e,i,a){let o=(await Promise.all(a.map(s=>this.businessPlatformOrganizationsRequest({query:He,organizationId:String(p(e)),variables:{domain:i,filters:pi(s)}})))).map(s=>s.organization).filter(s=>s!=null);if(o.length===0)throw new k("No organization found");let l=o.flatMap(s=>{let v=s.accessibleShops?.edges.map(u=>u.node)??[],c=_n(s.currentUser?.organizationPermissions??[]);return hn(v,c)}),r=b(i);return l.find(s=>s.shopDomain===r)}async ensureUserAccessToStore(e,i){if(!i.provisionable)return;let t={input:{shopifyShopId:oi(i.shopId)}},l=(await R({query:We,token:await this.businessPlatformToken(),organizationId:String(p(e)),variables:t,unauthorizedHandler:this.createUnauthorizedHandler()})).organizationUserProvisionShopAccess;if(!l.success){let r=l.userErrors?.map(s=>s.message).join(", ")??"";throw new _(`Failed to provision user access to store: ${r}`)}}async sendSampleWebhook(e,i){let a=sn,t={address:e.address,apiKey:e.api_key,apiVersion:e.api_version,deliveryMethod:e.delivery_method,sharedSecret:e.shared_secret,topic:e.topic},o=await this.webhooksRequest({organizationId:i,query:a,variables:t}),l={samplePayload:"{}",headers:"{}",success:!1,userErrors:[]},r=o.cliTesting;return r&&(l={samplePayload:r.samplePayload??"{}",headers:r.headers??"{}",success:r.success,userErrors:r.errors.map(s=>({message:s,fields:[]}))}),{sendSampleWebhook:l}}async apiVersions(e){return{publicApiVersions:(await this.webhooksRequest({organizationId:e,query:rn,variables:{}})).publicApiVersions.map(a=>a.handle)}}async topics({api_version:e},i){let a=dn,t={apiVersion:e};return{webhookTopics:(await this.webhooksRequest({organizationId:i,query:a,variables:t})).availableTopics??[]}}async updateURLs(e){return V("\u26A0\uFE0F updateURLs is not implemented"),{appUpdate:{userErrors:[]}}}async targetSchemaDefinition(e,i,a){try{let{app:t}=await this.activeAppVersionRawResult(i),o=String(p(t.id));return(await this.functionsRequest({organizationId:a,query:ln,appId:o,variables:{handle:e.handle,version:e.version}}))?.target?.api?.schema?.definition??null}catch(t){throw new k(`Failed to fetch schema definition: ${t}`)}}async apiSchemaDefinition(e,i,a){try{let{app:t}=await this.activeAppVersionRawResult(i),o=String(p(t.id));return(await this.functionsRequest({organizationId:a,query:mn,appId:o,variables:e}))?.api?.schema?.definition??null}catch(t){throw new k(`Failed to fetch schema definition: ${t}`)}}toExtensionGraphQLType(e){return e.toLowerCase()}async appDeepLink({id:e,organizationId:i}){return z({id:e,organizationId:i})}async devSessionCreate({appId:e,assetsUrl:i,shopFqdn:a,websocketUrl:t,unsafeValidation:o}){let l=String(p(e));return this.appDevRequest({query:Be,shopFqdn:a,variables:{appId:l,assetsUrl:i??"",websocketUrl:t,unsafeValidation:o??!1},requestOptions:{requestMode:"slow-request"}})}async devSessionUpdate({appId:e,assetsUrl:i,shopFqdn:a,manifest:t,inheritedModuleUids:o,unsafeValidation:l}){let s={appId:String(p(e)),assetsUrl:i,manifest:JSON.stringify(t),inheritedModuleUids:o,unsafeValidation:l??!1};return this.appDevRequest({query:Le,shopFqdn:a,variables:s})}async devSessionDelete({appId:e,shopFqdn:i}){let a=String(p(e));return this.appDevRequest({query:$e,shopFqdn:i,variables:{appId:a}})}async getCreateDevStoreLink(e){let i=`https://${await L()}/dashboard/${e.id}/stores`;return[`Looks like you don't have any dev stores associated with ${e.businessName}'s Dev Dashboard.`,{link:{url:i,label:"Create a store in Dev Dashboard"}}]}async activeAppVersionRawResult(e){return this.appManagementRequest({query:Ge,variables:{apiKey:e}})}async organizationBetaFlags(e,i){let a={organizationId:gn(e)},t=await Se({query:Ce(i),token:await this.businessPlatformToken(),organizationId:e,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),o={};return i.forEach(l=>{o[l]=!!t.organization[`flag_${l}`]}),o}async organizationExpFlags(e,i){let a={organizationId:gn(e),flagHandles:i},t=await R({query:Ue,token:await this.businessPlatformToken(),organizationId:e,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),o={},l=t.organization?.enabledFlags??[];return i.forEach((r,s)=>{o[r]=!!l[s]}),o}async appManagementRequest(e){return qe({...e,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async appDevRequest(e){return cn({...e,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async businessPlatformRequest(e){return j({...e,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async businessPlatformOrganizationsRequest(e){return R({...e,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async functionsRequest(e){return Nn({...e,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async webhooksRequest(e){return Sn({...e,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}createUnauthorizedHandler(e="default"){return Dn(this,e)}},ni="https://shopify.dev/apps/default-app-home",ii="https://shopify.dev/apps/default-app-home/api/auth";function ai(n,e,i){let{isLaunchable:a,scopesArray:t,name:o}=n;return{initialVersion:{source:{source:{name:o,modules:[{type:Z,config:{app_url:a?"https://example.com":ni,embedded:!0}},{type:ee,config:{name:o}},{type:ae,config:{api_version:i}},{type:ne,config:{redirect_url_allowlist:[a?"https://example.com/api/auth":ii],...t&&{scopes:t.map(v=>v.trim()).join(",")}}}]}}.source},organizationId:te(e)}}function ti(n){let e=n.startsWith("gid://")?p(n):Number(n);if(Number.isNaN(e))throw new Error(`Invalid organization ID: ${n}`);return`gid://organization/Organization/${e}`}function gn(n){return G(ti(n))}function te(n){return`gid://shopify/Organization/${n.startsWith("gid://")?p(n):Number(n)}`}function oi(n){return G(`gid://organization/ShopifyShop/${n}`)}function di(n){let e=_e(n);if(e===void 0)throw new Error(`Invalid encoded GID: ${n}`);return e}function p(n){if(n.startsWith("gid://")){let e=W(n);if(e===void 0)throw new Error(`Invalid GID: ${n}`);return Number(e)}return Number(n)}async function z({id:n,organizationId:e}){let i=p(e).toString();return`https://${await L()}/dashboard/${i}/apps/${p(n)}`}async function si(n,e,i){return`${await z({organizationId:n,id:e})}/versions/${p(i)}`}function ri({currentModules:n,selectedVersionModules:e}){let i=n.map(s=>s.userIdentifier),a=e.map(s=>s.userIdentifier),t=e.filter(s=>!i.includes(s.userIdentifier)),o=n.filter(s=>!a.includes(s.userIdentifier)),l=o.map(s=>s.userIdentifier),r=n.filter(s=>!l.includes(s.userIdentifier));return{added:t,removed:o,updated:r}}async function li(n,e,i,a=re){let t=P(n.flatMap(s=>s.organizationBetaFlags??[])),o=P(n.flatMap(s=>s.organizationExpFlags??[])),[l,r]=await Promise.all([t.length>0?e(t):Promise.resolve({}),o.length>0?i(o):Promise.resolve({})]);return n.filter(s=>{let v=!s.organizationBetaFlags||s.organizationBetaFlags.every(S=>l[S]),c=!s.organizationExpFlags||s.organizationExpFlags.every(S=>r[S]),u=!s.minimumCliVersion||K(a,`>=${s.minimumCliVersion}`),N=!s.deprecatedFromCliVersion||K(a,`<${s.deprecatedFromCliVersion}`),f=u&&N,T=ye(a)&&s.deprecatedFromCliVersion===void 0;return v&&c&&(f||T)})}function oe(n,e){if(e===Ae)return"configuration";switch(n){case"extension":case"configuration":case"deprecated":return n;default:return V(`Unknown specification experience value "${n}", defaulting to "extension"`),"extension"}}function mi(n){switch(n){case"UidStrategiesDynamic":return"dynamic";case"UidStrategiesStatic":return"single";case"UidStrategiesClientProvided":return"uuid";default:return"uuid"}}function hn(n,e){return n.map(i=>{let{externalId:a,primaryDomain:t,name:o,url:l,storeType:r}=i,s=l??t;if(!s)throw new _("The selected store does not have a valid URL");return{shopId:a?di(a):void 0,link:t,shopDomain:b(s),shopName:o,transferDisabled:!0,convertableToPartnerTest:!0,provisionable:e,storeType:r}})}function Fn(n){return{registrationId:n.userIdentifier===n.uuid?"":n.userIdentifier,registrationUuid:n.uuid,handle:n.handle,type:n.specification.externalIdentifier,config:n.config,target:n.target??"",specification:{...n.specification,identifier:n.specification.identifier,options:{managementExperience:n.specification.managementExperience},experience:oe(n.specification.experience,n.specification.externalIdentifier)}}}var ui=async({organizationId:n,jwtToken:e,cursor:i,filters:a})=>{let t=await Re(n,i,a),o=Q(e);return B(t,{method:"GET",headers:o})};function bn(n){let e=[],i=n.on[0]?.user_identifier;return i&&e.push({extension_id:i}),{...n,details:e}}function pi(n){return[{field:"STORE_TYPE",operator:"EQUALS",value:n.toLowerCase()},{field:"STORE_STATUS",operator:"EQUALS",value:"ACTIVE"}]}function _n(n){return n.includes("ondemand_access_to_stores")}var U;(function(n){n.AppManagement="app-management",n.Partners="partners"})(U||(U={}));function Ee(){return C.getInstance()}var An;An||(An={});var ki={};function Vn(n=[]){let e=[],i=n.map(a=>ki[a]);return e.filter(a=>!i.includes(a))}var de=new WeakMap;function Dn(n,e="default"){return{type:"token_refresh",handler:async()=>{let i=de.get(n);if(i)await i;else try{i=n.unsafeRefreshToken(),de.set(n,i),await i}finally{de.delete(n)}let a=await n.session();return{token:e==="businessPlatform"?a.businessPlatformToken:a.token}}}}export{A as a,q as b,Rn as c,xn as d,Ci as e,qn as f,Pe as g,Ui as h,Z as i,$i as j,ee as k,Ji as l,On as m,Bn as n,ne as o,aa as p,ae as q,at as r,ti as s,U as t,Ee as u,Dn as v,Y as w,F as x,bi as y,_i as z,Vi as A};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{a as Zn}from"./chunk-CA3GVT4D.js";import{D as Fe,E as $e,H as ct,I as nt,K as ti,P as ei,Q as ni,T as ii,W as ri,Z as Ie,fa as oi,q as Kn,r as Yn,s as Qn,t as Se,u as J,v as at,z as Ht}from"./chunk-HEB4YYM6.js";import{a as Gr}from"./chunk-QLN6IOOY.js";import{a as Xn}from"./chunk-ZQNGYJKJ.js";import{da as zr}from"./chunk-MQ55QUOJ.js";import{a as Kr}from"./chunk-VJEKDBGZ.js";import{c as xt,d as H}from"./chunk-HR6R7JXN.js";import{a as $n,b as In}from"./chunk-LXFWK3O2.js";import{a as Gn}from"./chunk-2KACAQJS.js";import{a as qt}from"./chunk-U5BKU3OL.js";import{b as qr,fa as Mt,ga as Wt,ja as Q,p as Pn,s as Cn,v as En}from"./chunk-UORSJB4A.js";import{m as Bt,n as kn,s as Dn,t as jn,w as Vt,x as Jt}from"./chunk-OSASE35V.js";import{e as Sn,q as Fn}from"./chunk-CE6XQDAG.js";import{a as he}from"./chunk-EE72PCKT.js";import{a as tt,b as Lt}from"./chunk-ARL5WBDK.js";import{C as Rn,D as et,E as _e,G as Tn,I as bt,R as X,U as Mn,x as Un,y as ve,z as Nn}from"./chunk-7A4ZE5IS.js";import{b as wt,d as _n,e as Tt}from"./chunk-QBRRFFMZ.js";import{a as an}from"./chunk-LG3KEHGD.js";import{f as xe}from"./chunk-HI5FTI3M.js";import{j as v,m as Ln,n as Pe}from"./chunk-FJOVMEPN.js";import{Aa as mn,Da as K,Db as Jn,Ea as gn,Eb as _,Fb as Hn,Hb as qn,Ib as zn,Ja as yn,Ka as wn,L as st,N as B,Na as bn,Oa as xn,Q as Jr,R as Hr,Sa as x,Ta as L,Va as k,Wa as vn,X as z,Y as ge,_ as ye,_a as Y,aa as ln,ab as Nt,cb as Rt,da as pn,ja as we,kb as An,la as N,ma as Ot,na as yt,oa as V,pa as Ut,ta as T,tb as D,ua as fn,ub as Bn,va as M,vb as U,xa as dn,ya as hn,zb as Vn}from"./chunk-OIQ5NQ5I.js";import{i as On}from"./chunk-B4OMIONW.js";import{b as g,k as be}from"./chunk-3PYDIBTX.js";import{l as Ce,m as Ee,n as Wn}from"./chunk-A5BSUUNQ.js";import{a as mt}from"./chunk-JD5P5RAJ.js";import{c as u,d as Z,e as gt,f as F,g as Dt,h as E,i as $,j as jt,k as cn,m as un,s as me}from"./chunk-IWTNUJGY.js";import{a as ht,c as de,e as kt,f as Vr,g as f}from"./chunk-VKWPEFWQ.js";var wi=de((Gt,yi)=>{f();(function(t,e){typeof Gt=="object"&&typeof yi<"u"?e(Gt,(Hr(),Vr(Jr)),qr()):typeof define=="function"&&define.amd?define(["exports","tslib","graphql"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["graphql-tag"]={},t.tslib,t.graphql))})(Gt,(function(t,e,n){"use strict";var i=new Map,r=new Map,o=!0,s=!1;function a(C){return C.replace(/[\s,]+/g," ").trim()}function c(C){return a(C.source.body.substring(C.start,C.end))}function l(C){var A=new Set,S=[];return C.definitions.forEach(function(I){if(I.kind==="FragmentDefinition"){var j=I.name.value,W=c(I.loc),dt=r.get(j);dt&&!dt.has(W)?o&&console.warn("Warning: fragment with name "+j+` already exists.
|
|
2
|
+
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
3
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):dt||r.set(j,dt=new Set),dt.add(W),A.has(W)||(A.add(W),S.push(I))}else S.push(I)}),e.__assign(e.__assign({},C),{definitions:S})}function p(C){var A=new Set(C.definitions);A.forEach(function(I){I.loc&&delete I.loc,Object.keys(I).forEach(function(j){var W=I[j];W&&typeof W=="object"&&A.add(W)})});var S=C.loc;return S&&(delete S.startToken,delete S.endToken),C}function d(C){var A=a(C);if(!i.has(A)){var S=n.parse(C,{experimentalFragmentVariables:s,allowLegacyFragmentVariables:s,experimentalFragmentArguments:s});if(!S||S.kind!=="Document")throw new Error("Not a valid GraphQL document.");i.set(A,p(l(S)))}return i.get(A)}function m(C){for(var A=[],S=1;S<arguments.length;S++)A[S-1]=arguments[S];typeof C=="string"&&(C=[C]);var I=C[0];return A.forEach(function(j,W){j&&j.kind==="Document"?I+=j.loc.source.body:I+=j,I+=C[W+1]}),d(I)}function h(){i.clear(),r.clear()}function y(){o=!1}function P(){s=!0}function b(){s=!1}var w={gql:m,resetCaches:h,disableFragmentWarnings:y,enableExperimentalFragmentVariables:P,disableExperimentalFragmentVariables:b};(function(C){C.gql=w.gql,C.resetCaches=w.resetCaches,C.disableFragmentWarnings=w.disableFragmentWarnings,C.enableExperimentalFragmentVariables=w.enableExperimentalFragmentVariables,C.disableExperimentalFragmentVariables=w.disableExperimentalFragmentVariables})(m||(m={})),m.default=m;var R=m;t.default=R,t.disableExperimentalFragmentVariables=b,t.disableFragmentWarnings=y,t.enableExperimentalFragmentVariables=P,t.gql=m,t.resetCaches=h,Object.defineProperty(t,"__esModule",{value:!0})}))});var xi=de((Ta,bi)=>{f();bi.exports=wi().gql});var $i=de(Fi=>{f();var uo=Object.create,Kt=Object.defineProperty,lo=Object.getPrototypeOf,po=Object.prototype.hasOwnProperty,fo=Object.getOwnPropertyNames,ho=Object.getOwnPropertyDescriptor,_i=t=>Kt(t,"__esModule",{value:!0}),mo=(t,e)=>{_i(t);for(var n in e)Kt(t,n,{get:e[n],enumerable:!0})},go=(t,e,n)=>{if(_i(t),e&&typeof e=="object"||typeof e=="function")for(let i of fo(e))!po.call(t,i)&&i!=="default"&&Kt(t,i,{get:()=>e[i],enumerable:!(n=ho(e,i))||n.enumerable});return t},Yt=t=>t&&t.__esModule?t:go(Kt(t!=null?uo(lo(t)):{},"default",{value:t,enumerable:!0}),t);mo(Fi,{default:()=>Eo,generateContentsFromGraphqlString:()=>Si,generateGraphQLString:()=>Ci});var yo=Yt(ht("fs")),wo=Yt(xi()),bo=Yt(ht("readline")),vi=Yt(ht("path")),Pi=(t,e)=>{let n=e?e(t):t;return JSON.stringify(n,(i,r)=>r===void 0?"__undefined":r).replace(/"__undefined"/g,"undefined")},xo=(t,e)=>{let n=new Set,i=[],r=o=>{n.has(o)||(n.add(o),o.imports.forEach(s=>{let a=e[s.absolutePath];r(a)}),i.unshift(o))};return t.forEach(r),i},vo=t=>new Promise(e=>{let n=bo.default.createInterface({input:yo.default.createReadStream(t)}),i="",r=[],o=!1,s=(a,c)=>{let l=c.replace(a,""),p=l.replace(/"|'/g,""),d=vi.default.join(vi.default.dirname(t),p);r.push({absolutePath:d,relativePath:l})};n.on("line",a=>{a.startsWith("#import ")?s("#import ",a):a.startsWith("# import ")?s("# import ",a):o?i+=a+`
|
|
4
|
+
`:a[0]!=="#"&&a!==""&&(o=!0,i+=a+`
|
|
5
|
+
`)}),n.on("close",()=>{e({body:i.trim(),filePath:t,imports:r})})}),Ci=t=>{let e={},n=[],i=new Set,r=o=>e[o]?Promise.resolve(null):new Promise(s=>{vo(o).then(a=>{e[a.filePath]=a,a.imports.forEach(l=>{i.has(l.absolutePath)||(i.add(l.absolutePath),n.push(r(l.absolutePath)))});let c=n.shift();return c?c.then(s):s(null)})});return r(t).then(()=>xo(Object.values(e),e).reduce((a,c)=>c.body+`
|
|
6
|
+
|
|
7
|
+
`+a,""))},_o=(t,e,n)=>{let i={kind:"Document",definitions:[t,...e]};return Pi(i,n)},Po=t=>((n,i)=>(n.forEach(r=>{r.kind==="FragmentDefinition"&&(i[r.name.value]=r)}),i))(t.definitions,{}),Ei=(t,e)=>{let n=[],i=r=>{if(r.kind==="FragmentSpread"){let o=e[r.name.value],s=Ei(o,e);n.push(...s,r.name.value)}};return t.kind==="OperationDefinition"?t.selectionSet.selections.forEach(r=>{var o;r.kind==="Field"&&((o=r.selectionSet)==null||o.selections.forEach(i))}):t.selectionSet.selections.forEach(i),n},Si=(t,e)=>{let n=wo.default(t),i=Pi(n,e),r=Po(n),o=n.definitions.reduce((s,a)=>{if(a.kind==="OperationDefinition"&&a.name&&a.name.value){let c=a.name.value,p=Ei(a,r).map(m=>{let h=r[m];if(!h)throw new Error(`Expected to find fragment definition for ${m}`);return h}),d=_o(a,p,e);s.push(`export const ${c} = ${d};`)}return s},[`const documentNode = ${i};`]);return o.push("export default documentNode;"),o.join(`
|
|
8
|
+
`)},Co=(t={})=>({name:"graphql-loader",setup(e){e.onLoad({filter:t.filterRegex||/\.graphql$|\.gql$/},n=>Ci(n.path).then(i=>({contents:Si(i,t.mapDocumentNode)})))}}),Eo=Co});f();f();async function Ae(t,e,n=1){let i;try{return i=await t(),i}catch(r){if(n>0)return await e(),Ae(t,e,n-1);throw r}}import{pipeline as Yr}from"stream/promises";import si from"node:stream/promises";import*as ai from"node:zlib";import{fileURLToPath as Oe}from"node:url";var ci="9.2.3",ui="9.1.0",li="4",Qr="123.0.0",pi="1.0.2",fi="2.0.1";function di(t){return t==="0"||t==="1"?{functionRunner:"7.0.1",javy:"4.0.0",javyPlugin:"1"}:t==="2"?{functionRunner:ci,javy:ui,javyPlugin:li}:null}var vt=class{name;version;path;release;gitHubRepo;supportsWindowsOnArm;constructor(e,n,i,r,o=`v${n}`){this.name=e,this.version=n,this.release=o,this.supportsWindowsOnArm=r;let s;s=`${e}-${n}`,s=process.platform==="win32"?`${s}.exe`:s,this.path=u(E(Oe(import.meta.url)),"..","bin",s),this.gitHubRepo=i}downloadUrl(e,n){let i,r;switch(e.toLowerCase()){case"darwin":i="macos";break;case"linux":i="linux";break;case"win32":i="windows";break;default:throw Error(`Unsupported platform ${e}`)}switch(n.toLowerCase()){case"arm":case"arm64":r="arm";break;case"ia32":case"x64":r="x86_64";break;default:throw Error(`Unsupported architecture ${n}`)}let o=`${r}-${i}`,s=["arm-linux","arm-macos","x86_64-macos","x86_64-windows","x86_64-linux"];if(this.supportsWindowsOnArm&&s.push("arm-windows"),!s.includes(o))throw Error(`Unsupported platform/architecture combination ${e}/${n}`);return`https://github.com/${this.gitHubRepo}/releases/download/${this.release}/${this.name}-${o}-v${this.version}.gz`}async processResponse(e,n){return to(e,n)}},De=class{name;version;path;constructor(e){this.name=`shopify_functions_javy_v${e}`,this.version=e,this.path=u(E(Oe(import.meta.url)),"..","bin",`shopify_functions_javy_v${e}.wasm`)}downloadUrl(e,n){return`https://cdn.shopify.com/shopifycloud/shopify-functions-javy-plugin/shopify_functions_javy_v${this.version}.wasm`}async processResponse(e,n){return Yr(e,n)}},je=class{name;version;path;constructor(e,n){this.name=e,this.version=n,this.path=u(E(Oe(import.meta.url)),"..","bin",e)}downloadUrl(e,n){return`https://cdn.jsdelivr.net/npm/binaryen@${this.version}/bin/wasm-opt`}async processResponse(e,n){await si.pipeline(e,n)}},ke;function Ue(t=ui){return new vt("javy",t,"bytecodealliance/javy",Vt(t,">=7.0.0"))}function Ne(t=li){return new De(t)}function xa(t=ci){return new vt("function-runner",t,"Shopify/function-runner",Vt(t,">=9.1.1"))}function _t(){return ke||(ke=new je("wasm-opt.cjs",Qr)),ke}function hi(t){return new vt("shopify-function-trampoline",t,"Shopify/shopify-function-wasm-api",Vt(t,">=2.0.1"),`shopify_function_trampoline/v${t}`)}var zt=new Map;async function it(t){if(await x(t.path)&&!zt.has(t.path))return;let n=zt.get(t.path);if(n){await n;return}let i=Xr(t);zt.set(t.path,i);try{await i}finally{zt.delete(t.path)}}async function Xr(t){let e=t.downloadUrl(process.platform,process.arch);_(`Downloading ${t.name} ${t.version} from ${e} to ${t.path}`);let n=E(t.path);await x(n)||await M(n),await Ae(async()=>{let i=await Pn(e,void 0,"slow-request");if(i.status!==200)throw new Error(`Downloading ${t.name} failed with status code of ${i.status}`);let r=i.body;if(r===null)throw new Error(`Downloading ${t.name} failed with empty response body`);let o=`${t.path}.${_n()}.download`;try{let s=wn(o);await t.processResponse(r,s),await xn(o,509),await Zr(t,o)}finally{await dn(o)}},async()=>{},2)}async function Zr(t,e){try{await hn(e,t.path)}catch(n){if(await x(t.path)){_(`Using the ${t.name} binary that another process downloaded to ${t.path}`);return}throw n}}async function to(t,e){let n=ai.createGunzip();await si.pipeline(t,n,e)}f();f();import{brotliCompress as eo,constants as no}from"node:zlib";import{promisify as io}from"node:util";var ro=io(eo);async function oo(t){let e=await N(t),n=Buffer.byteLength(e),r=(await ro(Buffer.from(e),{params:{[no.BROTLI_PARAM_QUALITY]:11}})).byteLength;return{path:t,rawBytes:n,compressedBytes:r}}function mi(t){return t>=1024*1024?`${(t/(1024*1024)).toFixed(2)} MB`:`${(t/1024).toFixed(1)} KB`}async function gi(t){try{let{rawBytes:e,compressedBytes:n}=await oo(t);return` (${mi(e)} original, ~${mi(n)} compressed)`}catch(e){return _(`Failed to get bundle size for ${t}: ${e}`),""}}f();var ut=class extends v{constructor(e){super(`Couldn't find the build output at ${e}`,"If you passed --no-build, build the app first. Otherwise check that building the extension produces files at that path.")}};f();f();import{createInterface as so}from"readline";var ao=[".git",".hg",".bzr",".svn","_darcs","CVS",".sublime-(project|workspace)",".DS_Store",".sass-cache","Thumbs.db","desktop.ini","config.yml","node_modules",".gitkeep",".shopifyignore","*.toml"];async function Re(t){let n=u(t.directory,".shopifyignore"),i=ao.map(r=>u("*",r));if(L(n)){let r=await co(n);i.push(...r)}return k("*/*",{absolute:!0,cwd:t.directory,ignore:i})}function co(t){return new Promise((e,n)=>{let i=[],r=so({input:yn(t),crlfDelay:1/0});r.on("line",o=>{let s=o.trim();s.length>0&&!s.startsWith("#")&&i.push(s)}),r.on("close",()=>{e(i)}),r.on("error",o=>{n(o)})})}import{context as So,formatMessagesSync as Ii}from"esbuild";var Ai=kt($i(),1);async function Te(t,e=process.env){let n=Io(t,e),i=await So(n);try{let r=await i.rebuild();$o(r,t),await Fo(r,t.outputPath)}catch(r){throw be()==="json"&&r instanceof Error&&t.stderr.write(`${r.message}
|
|
9
|
+
`),r}finally{await i.dispose()}}async function Fo(t,e){if(!t?.metafile)return;let{dir:n,name:i}=cn(e),r=u(n,`${i}.metafile.json`);try{await T(r,JSON.stringify(t.metafile))}catch(o){Hn(`Failed to write metafile to ${r}: ${o}`)}}function $o(t,e){let n=t?.warnings??[],i=t?.errors??[];n.length>0&&Ii(n,{kind:"warning"}).forEach(o=>{e.stdout.write(o)}),i.length>0&&Ii(i,{kind:"error"}).forEach(o=>{e.stderr.write(o)})}function Io(t,e=process.env){let n=Wt(e,(s,a)=>Ht.test(a)&&s),i={...t.env,...n},r=Object.keys(i||{}).reduce((s,a)=>({...s,[`process.env.${a}`]:JSON.stringify(i[a])}),{"process.env.NODE_ENV":JSON.stringify(t.environment)}),o={outfile:t.outputPath,stdin:t.stdin,bundle:!0,define:r,jsx:"automatic",logLevel:be()==="json"?"silent":t.logLevel??"error",loader:{".esnext":"ts",".js":"jsx"},legalComments:"none",minify:t.minify,plugins:Ao(t.stdin.resolveDir,e),target:"es6",resolveExtensions:[".tsx",".ts",".js",".json",".esnext",".mjs",".ejs"]};if(t.sourceMaps&&(o.sourcemap=!0,o.sourceRoot=`${t.stdin.resolveDir}/src`),t.environment==="production"&&(o.metafile=!0),t.environment==="development"){let s=i[Se.disableMinificationOnDev];o.minify=!mt(s),o.logLevel="silent"}return o}function Ao(t,e=process.env){let n=[Ai.default.default()],i=mt(e[Se.skipEsbuildReactDedeuplication]);if(t&&!i){let r;try{r=ht.resolve("react",{paths:[t]})}catch{_(`Unable to load React in ${t}, skipping React de-duplication`)}r&&(_(`Deduplicating React dependency for ${t}, using ${r}`),n.push(ko(r)))}return n}function ko(t){return{name:"shopify:deduplicate-react",setup({onResolve:e}){e({filter:/^react$/},n=>({path:t}))}}}f();import{build as ji}from"esbuild";var Do="2",ki={defaultScalarType:"unknown",scalars:{Date:"string",DateTime:"string",DateTimeWithoutTimezone:"string",Decimal:"string",Handle:"string",ID:"string",JSON:"unknown",TimeWithoutTimezone:"string",URL:"string",Void:"null"}},Pt=class extends v{constructor(e){super(e,U`Make sure you have a compatible version of the ${D.yellow("@shopify/shopify_function")} library installed.`,[U`Add ${D.green(`"@shopify/shopify_function": "~${Do}.0.0"`)} to the dependencies section of the package.json file in your function's directory, if not already present.`.value,"Run your package manager's install command to update dependencies."])}};async function Oi(t,e){let n=To(t),i=n.length===0?Ro:new Me(n),r=await Ni(t);return e.useTasks?Oo(t,e,i,r):jo(t,e,i,r)}async function jo(t,e,n,i){e.signal?.aborted||(e.stdout.write(`Building function ${t.localIdentifier}...`),e.stdout.write(`Building GraphQL types...
|
|
10
|
+
`),await Ct(t,e)),e.signal?.aborted||(e.stdout.write(`Bundling JS function...
|
|
11
|
+
`),await n.bundle(t,e)),e.signal?.aborted||(e.stdout.write(`Running javy...
|
|
12
|
+
`),await n.compile(t,e,i)),e.signal?.aborted||e.stdout.write(`Done!
|
|
13
|
+
`)}async function Oo(t,e,n,i){await Tn([{title:"Building GraphQL types",task:async()=>{await Ct(t,e)}},{title:"Bundling JS function",task:async()=>{await n.bundle(t,e)}},{title:"Running javy",task:async()=>{await n.compile(t,e,i)}}])}async function Ct(t,e){if(t.typegenCommand){let o=t.typegenCommand.split(" ");return xe("cmd_all_timing_network_ms")(async()=>X(o[0],o.slice(1),{cwd:t.directory,stdout:e.stdout,stderr:e.stderr,signal:e.signal}))}if(!t.isJavaScript)throw new v("No typegen_command specified. Set build.typegen_command in your function extension TOML to generate GraphQL types for non-JavaScript functions.");let n=u(t.directory,"package.json");if(!await x(n))return Le(t,e,"package.json");let i=await Jt(n);if(!i.codegen)return Le(t,e,"package.json");let r={...i.codegen,config:{...ki,...i.codegen.config??{},scalars:{...ki.scalars,...i.codegen.config?.scalars??{}}}};return we(async o=>{let s=u(o,"codegen.json");return await T(s,JSON.stringify(r)),Le(t,e,s)})}async function Le(t,e,n){let i=await kn(t.directory,"graphql-code-generator","--config",n);return xe("cmd_all_timing_network_ms")(async()=>X(i.command,i.args,{cwd:t.directory,stderr:e.stderr,signal:e.signal}))}async function Ui(t){let e=await Y("node_modules/@shopify/shopify_function/index.ts",{type:"file",cwd:t.directory}),n=await Y("node_modules/@shopify/shopify_function/run.ts",{type:"file",cwd:t.directory});if(!e||!n)throw new Pt("Could not find the Shopify Functions JavaScript library.");if(!t.entrySourceFilePath)throw new v("Could not find your function entry point. It must be in src/index.js or src/index.ts");return e}async function Ni(t){let e=await Y("node_modules/@shopify/shopify_function/package.json",{type:"file",cwd:t.directory});if(!e)throw new Pt("Could not find the Shopify Functions JavaScript library.");let i=JSON.parse(await N(e)).version.split(".")[0],r=di(i);if(r===null)throw new Pt("The installed version of the Shopify Functions JavaScript library is not compatible with this version of Shopify CLI.");return r}async function Uo(t,e,n=process.env){let i=await Ui(t),r={...Ri(t.directory,t.entrySourceFilePath,e.app.dotenv?.variables??{},n),entryPoints:[i]};return ji(r)}function Ri(t,e,n,i=process.env){let r=Wt(i,(c,l)=>Ht.test(l)&&c),o={...n,...r},s=Object.keys(o||{}).reduce((c,l)=>({...c,[`process.env.${l}`]:JSON.stringify(o[l])}),{});return{outfile:u(t,"dist/function.js"),alias:{"user-function":e},define:s,logLevel:"silent",bundle:!0,legalComments:"none",target:"es2022",format:"esm"}}async function Ti(t){let e=_t();await it(e);let n=E(_t().path),i="node",r=[_t().name,t,"-Oz","--enable-bulk-memory","--enable-multimemory","--enable-nontrapping-float-to-int","--strip-debug","-o",t];_(`Wasm binary: ${_t().name}`),_("Optimizing this wasm binary using wasm-opt."),await X(i,r,{cwd:n})}async function Li(t){let e,n=await No(t);if(n.includes("shopify_function_v1")?e=pi:n.includes("shopify_function_v2")&&(e=fi),!e)return;let i=hi(e);await it(i);let r=i.path,o=["-i",t,"-o",t];_(`Applying trampoline to the wasm binary with command: ${r} ${o.join(" ")}`),await X(r,o)}async function No(t){let e=new Uint8Array(Ot(t));if(!WebAssembly.validate(e))return[];let i=new WebAssembly.Module(e),r=WebAssembly.Module.imports(i);return B(r.map(o=>o.module))}async function Mi(t,e,n,i=[]){let r=Ue(n.javy),o=Ne(n.javyPlugin);await Promise.all([it(r),it(o)]);let s=["build","-C","dynamic","-C",`plugin=${o.path}`,...i,"-o",t.outputPath,"dist/function.js"];return X(r.path,s,{cwd:t.directory,stdout:e.stdout,stderr:e.stderr,signal:e.signal})}async function hc(t){let n=t.allExtensions.filter(a=>a.features.includes("function")&&a.isJavaScript).map(a=>Ni(a)),i=await Promise.all(n),r=new Set,o=new Set;i.forEach(a=>{r.add(a.javy),o.add(a.javyPlugin)});let s=[];r.forEach(a=>{s.push(it(Ue(a)))}),o.forEach(a=>{s.push(it(Ne(a)))}),await Promise.all(s)}var Ro={async bundle(t,e){return Uo(t,e)},async compile(t,e,n){return Mi(t,e,n)}},Di="shopify-function",Me=class{exports;constructor(e){this.exports=e}async bundle(e,n,i=process.env){await Ui(e);let r=this.entrypointContents;_("Generating dist/function.js using generated module:"),_(r);let o={...Ri(e.directory,e.entrySourceFilePath,n.app.dotenv?.variables??{},i),stdin:{contents:r,loader:"ts",resolveDir:e.directory}};return ji(o)}async compile(e,n,i){let r=this.wit;return _("Generating world to use with Javy:"),_(r),we(async o=>{let s=u(o,"javy-world.wit");return await T(s,r),Mi(e,n,i,["-C",`wit=${s}`,"-C",`wit-world=${Di}`])})}get wit(){let e=this.exports.map(n=>`export %${ye(n)}: func();`);return`package function:impl;
|
|
14
|
+
|
|
15
|
+
world ${Di} {
|
|
16
|
+
${e.join(`
|
|
17
|
+
`)}
|
|
18
|
+
}`}get entrypointContents(){let e=`
|
|
19
|
+
import __runFunction from "@shopify/shopify_function/run"`,n=this.exports.map(i=>{let r=ge(i),o=ge(`run-${i}`);return`
|
|
20
|
+
import { ${r} as ${o} } from "user-function"
|
|
21
|
+
export function ${r}() { return __runFunction(${o}) }`});return`${e}
|
|
22
|
+
${n.join(`
|
|
23
|
+
`)}`}};function To(t){let e=t.configuration.targeting??[],n=e.filter(o=>!o.export),i=e.filter(o=>!!o.export);if(e.length>1&&n.length>0)throw new Error(`Can't infer export name for targets:
|
|
24
|
+
${n.map(({target:o})=>`- '${o}'`).join(`
|
|
25
|
+
`)}
|
|
26
|
+
All targets must have an export when multiple targets are present.`);let r=i.filter(o=>!o.export.match(/^[a-z0-9-]+$/));if(r.length>0){let o=[],s=r.map(a=>`'${a.export}'`);throw o.push(`Invalid export names: ${s.join(", ")}.
|
|
27
|
+
|
|
28
|
+
The TOML's exports must be kebab-case (lowercase, hyphen or numbers) to comply with WebAssembly's Component Model.
|
|
29
|
+
|
|
30
|
+
JavaScript exports with camelCase names are automatically mapped to kebab-case Wasm exports.
|
|
31
|
+
`),o.push("Suggested TOML changes:"),r.forEach(a=>{let c=a.export;o.push(`- Change export for '${a.target}' to '${ye(c)}'.`)}),new Error(o.join(`
|
|
32
|
+
`))}return i.map(o=>o.export)}f();var Qt="# api_version: ";function vc(t,e){return`${Qt}${e}
|
|
33
|
+
|
|
34
|
+
${t}`}async function Lo(t){if(!await x(t)){_(`Could not determine api_version: schema file not found at ${t}.`);return}let n=(await N(t)).split(`
|
|
35
|
+
`,1)[0];if(n.startsWith(Qt))return n.slice(Qt.length).trim();_(`Could not determine api_version from ${t}: missing '${Qt}' marker on the first line.`)}async function Wi({directory:t,localIdentifier:e,apiVersion:n}){let i=u(t,"schema.graphql"),r=await Lo(i);if(r!==void 0&&r!==n)throw new v(U`The ${D.cyan("schema.graphql")} file for ${D.cyan(e)} was generated for api_version ${D.yellow(r)} but your function is now on api_version ${D.yellow(n)}.`,U`Run ${D.genericShellCommand("shopify app function schema")} to refresh it.`)}var Vi=kt(Gr(),1);import{resolve as Bi}from"node:path";async function Ji(t,e){e.stdout.write(`Bundling UI extension ${t.localIdentifier}...`);let n=e.app.dotenv?.variables??{};e.appURL&&(n.APP_URL=e.appURL);let i=e.buildDirectory??"",r=u(t.directory,i,t.outputRelativePath),{main:o,assets:s}=t.getBundleExtensionStdinContent(),a=performance.now();if(!e.skipBuild)try{await Te({minify:!0,outputPath:r,stdin:{contents:o,resolveDir:t.directory,loader:"tsx"},environment:e.environment,env:n,stderr:e.stderr,stdout:e.stdout,sourceMaps:t.isSourceMapGeneratingExtension}),s&&await Promise.all(s.map(async p=>{await Te({minify:!0,outputPath:u(E(r),p.outputFileName),stdin:{contents:p.content,resolveDir:t.directory,loader:"tsx"},environment:e.environment,env:n,stderr:e.stderr,stdout:e.stdout})}))}catch(p){let d=p.message??"Unknown error occurred",m=new v(`Failed to bundle extension ${t.localIdentifier}. Please check the extension source code for errors.`,d);throw m.errors=p.errors,m}if(e.skipBuild&&!await x(r))throw new ut(r);await t.buildValidation({outputPath:r});let c=Math.round(performance.now()-a),l=await gi(r);return e.stdout.write(`${t.localIdentifier} successfully built in ${c}ms${l}`),r}async function Hi(t,e){let n=u(t.directory,".build-lock"),i;try{i=await Vi.default.lock(t.directory,{retries:20,lockfilePath:n,onCompromised:r=>_(`The function build lock was compromised: ${r.message}`)})}catch(r){throw _(`Failed to acquire function build lock: ${r.message}`),new v("Failed to build function.","This is likely due to another in-progress build.",["Ensure there are no other function builds in-progress.","Delete the `.build-lock` file in your function directory."])}try{let r=t.configuration,o=t.outputPath,s=r.build?.path??t.outputRelativePath;if(t.outputPath=u(t.directory,s),await Wi({directory:t.directory,localIdentifier:t.localIdentifier,apiVersion:r.api_version}),!e.skipBuild){t.isJavaScript?await Wo(t,e):await Bo(t,e);let c=t.configuration.build?.wasm_opt;L(t.outputPath)&&c&&await Ti(t.outputPath),L(t.outputPath)&&await Li(t.outputPath)}let a=u(t.directory,t.outputRelativePath);return L(t.outputPath)&&o!==t.outputPath&&o!==a&&E(o)!==E(t.outputPath)&&await Mo(t.outputPath,o),{status:"success",function:{handle:r.handle??null,name:t.name,directory:Bi(t.directory),wasmPath:L(t.outputPath)?Bi(t.outputPath):null}}}catch(r){if(r instanceof v)throw r;let o=r.message??"Unknown error occurred",s=new v("Failed to build function.",o);throw s.errors=r.errors,s}finally{await i().catch(r=>_(`Failed to release the function build lock: ${r.message}`))}}async function Mo(t,e){_(`Converting WASM from ${t} to base64 in ${e}`);let n=await N(t,{encoding:"base64"});await Ut(e),await T(e,n)}async function Wo(t,e){return t.buildCommand?(t.typegenCommand&&await Ct(t,e),qi(t.buildCommand,t,e)):Oi(t,e)}async function Bo(t,e){if(!t.buildCommand)throw e.stderr.write(`The function extension ${t.localIdentifier} doesn't have a build command or it's empty`),e.stderr.write(`
|
|
36
|
+
Edit the shopify.function.extension.toml configuration file and set how to build the extension.
|
|
37
|
+
|
|
38
|
+
[build]
|
|
39
|
+
command = "{COMMAND}"
|
|
40
|
+
|
|
41
|
+
Note that the command must output a dist/index.wasm file.
|
|
42
|
+
`),new Ln;return t.typegenCommand&&await Ct(t,e),qi(t.buildCommand,t,e)}async function qi(t,e,n){let i=t.split(" ");n.stdout.write(`Building function ${e.localIdentifier}...`),await X(i[0],i.slice(1),{stdout:n.stdout,stderr:n.stderr,cwd:e.directory,signal:n.signal})}f();var zi;function We(){return zi??=new Sn({projectName:"shopify-cli-app"}),zi}function Xt(t,e=We()){let n=Z(t);return _(U`Reading cached app information for directory ${D.path(n)}...`),e.get(n)}function Zt(t,e=We()){t.directory=Z(t.directory),_(U`Storing app information for directory ${D.path(t.directory)}:${D.json(t)}`);let n=e.get(t.directory);n?e.set(t.directory,{...n,...t}):e.set(t.directory,t)}function Gi(t,e=We()){let n=Z(t),i=e.get(n);i&&e.set(n,{...i,configFile:void 0})}f();f();var Ki=/^shopify\.app(\.[-\w]+)?\.toml$/,Et="shopify.app*.toml";function rt(t){return t?G(t)?t:`shopify.app.${z(t)}.toml`:J.app}function St(t){return $(t).match(Ki)?.[1]?.slice(1)}function G(t){return!!Ki.test(t)}var Vo="*.extension.toml",Jo="shopify.web.toml",Yi="extensions/*",Qi="**/node_modules/**",Ho=".env*",Ft=class t{static async load(e){let n=await qo(e),i=[],r=await zo(n,i);if(r.length===0)throw new v(`Could not find a Shopify app TOML file in ${n}`);let o=new Set;for(let b of r){let w=b.content.extension_directories;if(Array.isArray(w))for(let R of w)o.add(R);else o.add(Yi)}let s=await Go(n,[...o],i),a=new Set;for(let b of r){let w=b.content.web_directories;if(Array.isArray(w))for(let R of w)a.add(R)}let c=await Ko(n,a.size>0?[...a]:void 0,i),l=u(n,"package.json"),p=await x(l),d=p?await Bt(n):"unknown",m=p?await Dn(l):{},h=p?await jn(n):!1,y=await Yo(n),P=await Qo(n);return new t({directory:n,packageManager:d,nodeDependencies:m,usesWorkspaces:h,appConfigFiles:r,extensionConfigFiles:s,webConfigFiles:c,dotenvFiles:y,hiddenConfigRaw:P,errors:i})}directory;packageManager;nodeDependencies;usesWorkspaces;appConfigFiles;extensionConfigFiles;webConfigFiles;dotenvFiles;hiddenConfigRaw;errors;constructor(e){this.directory=e.directory,this.packageManager=e.packageManager,this.nodeDependencies=e.nodeDependencies,this.usesWorkspaces=e.usesWorkspaces,this.appConfigFiles=e.appConfigFiles,this.extensionConfigFiles=e.extensionConfigFiles,this.webConfigFiles=e.webConfigFiles,this.dotenvFiles=e.dotenvFiles,this.hiddenConfigRaw=e.hiddenConfigRaw,this.errors=e.errors}appConfigByName(e){return this.appConfigFiles.find(n=>$(n.path)===e)}appConfigByClientId(e){return this.appConfigFiles.find(n=>n.content.client_id===e)}get defaultAppConfig(){return this.appConfigByName(J.app)}},Be=class extends v{};async function qo(t){let e=await Y(async n=>{if((await k(u(n,Et))).some(r=>G($(r))))return n},{cwd:t,type:"directory"});if(!e)throw new Be(`Could not find a Shopify app configuration file. Looked in ${t} and parent directories.`);return e}async function zo(t,e){let n=u(t,Et),r=(await k(n)).filter(o=>G($(o)));return Ve(r,e)}async function Go(t,e,n){let r=(e.length>0?e:[Yi]).map(s=>u(t,s,Vo));r.push(`!${u(t,Qi)}`);let o=await k(r);return Ve(o,n)}async function Ko(t,e,n){let r=(e??["**"]).map(s=>u(t,s,Jo));r.push(`!${u(t,Qi)}`);let o=await k(r);return Ve(o,n)}async function Ve(t,e){let n=[];return await Promise.all(t.map(async i=>{try{n.push(await H.read(i))}catch(r){let o=r instanceof xt?r:new xt(i,`Failed to read ${i}`),s=new H(i,{});s.errors.push(o),n.push(s),e.push(o)}})),n}async function Yo(t){let e=u(t,Ho),i=(await k(e,{dot:!0})).filter(s=>{let a=$(s);return a===".env"||/^\.env\.[\w-]+$/.test(a)}),r=await Promise.all(i.map(async s=>{try{let a=await Zn(s);return[$(s),a]}catch{return}})),o=new Map;for(let s of r)s&&o.set(s[0],s[1]);return o}async function Qo(t){let e=u(t,J.hiddenFolder,J.hiddenConfig);try{if(await x(e)){let n=await N(e);return JSON.parse(n)}}catch{}return{}}f();f();f();f();f();function Xi(t,e){let n=t;if(!n.events?.subscription)return t;let i;e&&"application_url"in e&&(i=e?.application_url);let{handle:r,...o}=n,s=n.events.subscription,a=!Array.isArray(s),c=Zo(s).map(l=>{let{handle:p,...d}=l,m=a?d:l;return typeof m.uri=="string"?{...m,uri:ct(m.uri,i)}:m});return{...o,events:{...n.events,subscription:Array.isArray(s)?c:c[0]}}}function Zi(t,e){let{api_version:n,subscription:i}=Q(t,"events")??{},r=a=>{let{identifier:c,api_version:l,...p}=a;return l!==void 0&&l!==n?{...p,api_version:l}:p},o;if(Array.isArray(i))o=i.map(r);else if(i){let a=e?.handle??i.handle??Xo(i);o=[r({...i,handle:a})]}let s={};return n!==void 0&&(s.api_version=n),o!==void 0&&(s.subscription=o),{events:s}}function Xo(t){return z([t.topic,...t.actions].join("-")).slice(0,nt).replace(/-$/,"")}function Zo(t){return Array.isArray(t)?t:[t]}var $t="events",ts={forward:Xi,reverse:Zi},tr=g.string().trim().nonempty("Handle can't be empty").max(nt,`Handle can't exceed ${nt} characters`).regex(/^[a-zA-Z0-9_-]*$/,"Handle can only contain alphanumeric characters, underscores and hyphens").refine(t=>t!==$t,'The handle "events" is reserved for the legacy events module. Choose a different subscription handle.'),es=g.object({subscription:g.unknown().optional()}).passthrough(),ns=ei.extend({handle:tr.optional(),events:es.optional()}).superRefine((t,e)=>{let n=t.events?.subscription;if(n===void 0||Array.isArray(n))return;let i=tr.safeParse(t.handle);i.success||i.error.issues.forEach(r=>e.addIssue({...r,path:["handle"]}))}),is=g.preprocess(t=>{if(typeof t!="object"||t===null||Array.isArray(t)||!("handle"in t))return t;let e=Q(t,"events.subscription");if(e!==void 0&&!Array.isArray(e))return t;let{handle:n,...i}=t;return i},ns),rs=ri({identifier:$t,schema:is,transformConfig:ts,expandConfig:t=>{let e=t.events?.subscription;return Array.isArray(e)?e.map(n=>{let{handle:i,...r}=n;return{handle:i,events:{...t.events,subscription:r}}}):[t]},getIdentity:t=>{if(t.handle)return{handle:t.handle,uid:t.handle}},getTarget:t=>{let e=t.events?.subscription?.topic;return typeof e=="string"?e:void 0}}),hu=rs;f();function os(t,e){return e}async function te(t,e,n){let i={};try{let s=await N(t);i=JSON.parse(s)}catch{}let r={[e]:n},o=Mt(i,r,os);await T(t,JSON.stringify(o,null,2))}var ss=g.array(g.string()).optional().transform(as).transform(cs);function as(t){return t?.map(e=>e.replace(/[\/\\]+$/,""))}function cs(t){return t?.map(e=>e.replace(/([^\*])\*$/,"$1**"))}var ne=g.object({client_id:g.string(),build:g.object({automatically_update_urls_on_dev:g.boolean().optional(),dev_store_url:g.string().optional(),include_config_on_deploy:g.boolean().optional()}).optional(),extension_directories:ss,web_directories:g.array(g.string()).optional()}).passthrough();function rr(t,e=!0){let n=t.reduce((i,r)=>r.contributeToAppConfigurationSchema(i),ne);return e?n.passthrough():t.length>0?n.strict():n}function us(t){return t.access_scopes?.scopes??""}function ie(t){let e=us(t);return e.length?e.split(",").map(n=>n.trim()):[]}function ls(t){return u(t,J.hiddenFolder,J.hiddenConfig)}var O;(function(t){t.Frontend="frontend",t.Backend="backend",t.Background="background"})(O||(O={}));var er=g.preprocess(Fe,g.string()),nr=g.object({auth_callback_path:g.union([er,er.array()]).optional(),webhooks_path:g.preprocess(Fe,g.string()).optional(),port:g.number().max(65536).min(0).optional(),commands:g.object({build:g.string().optional(),predev:g.string().optional(),dev:g.string()}),name:g.string().optional(),hmr_server:g.object({http_paths:g.string().array()}).optional()}),ir=g.enum([O.Frontend,O.Backend,O.Background]).default(O.Frontend),or=g.union([nr.extend({roles:g.array(ir)}),nr.extend({type:ir})]),ee=class{name;idEnvironmentVariableName="SHOPIFY_API_KEY";directory;configPath;configuration;clientIdOverride;webs;dotenv;errors;specifications;configSchema;remoteFlags;realExtensions;devApplicationURLs;_hiddenConfig;constructor({name:e,directory:n,configPath:i,configuration:r,clientIdOverride:o,webs:s,modules:a,dotenv:c,errors:l,specifications:p,configSchema:d,remoteFlags:m,hiddenConfig:h,devApplicationURLs:y}){this.name=e,this.directory=n,this.configPath=i,this.configuration=r,this.clientIdOverride=o,this.webs=s,this.dotenv=c,this.realExtensions=a,this.errors=l??new It,this.specifications=p,this.configSchema=d??ne,this.remoteFlags=m??[],this._hiddenConfig=h,y&&this.setDevApplicationURLs(y)}get allExtensions(){return this.realExtensions}get nonConfigExtensions(){return this.realExtensions.filter(e=>!e.isAppConfigExtension)}setDevApplicationURLs(e){this.patchAppConfiguration(e),this.realExtensions.forEach(n=>n.patchWithAppDevURLs(e))}async manifest(e){let n=await Promise.all(this.realExtensions.map(async i=>{let r=await i.deployConfig({apiKey:String(this.configuration.client_id??""),appConfiguration:this.configuration});return{type:i.externalType,handle:i.handle,uid:i.uid,uuid:e?.[i.localIdentifier],assets:i.uid,target:i.contextValue,config:r??{}}}));return{name:this.name,handle:"",modules:st(n)}}get hiddenConfig(){return this._hiddenConfig}getLogsDir(){return u(this.directory,".shopify","logs")}async updateHiddenConfig(e){if(!this.configuration.client_id)return;this._hiddenConfig=Mt(this.hiddenConfig,e);let n=ls(this.directory);await te(n,String(this.configuration.client_id),this.hiddenConfig)}async preDeployValidation(){this.validateWebhookLegacyFlowCompatibility(),this.validateEventsLegacyFlowCompatibility();let e=this.allExtensions.filter(i=>i.isFunctionExtension&&i.configuration.ui?.handle);if(e.length>0){let i=ps(e,this.allExtensions);if(i)throw new v("Invalid function configuration",i.join(`
|
|
43
|
+
`))}let n=this.allExtensions.filter(i=>i.isEditorExtensionCollection);if(n.length>0){let i=fs(n,this.allExtensions);if(i)throw new v("Invalid editor extension collection configuration",i.join(`
|
|
44
|
+
|
|
45
|
+
`))}await Promise.all(this.allExtensions.map(i=>i.preDeployValidation()))}extensionsForType(e){return this.allExtensions.filter(n=>n.type===e.identifier||n.type===e.externalIdentifier)}updateExtensionUUIDS(e){this.allExtensions.forEach(n=>{n.devUUID=e[n.localIdentifier]??n.devUUID})}appIsLaunchable(){let e=this.webs.find(i=>q(i,O.Frontend)),n=this.webs.find(i=>q(i,O.Backend));return!!(e??n)}get appIsEmbedded(){return this.configuration.embedded}creationDefaultOptions(){return{isLaunchable:this.appIsLaunchable(),scopesArray:ie(this.configuration),name:this.name,isEmbedded:this.appIsEmbedded,directory:this.directory}}removeExtension(e){this.realExtensions=this.realExtensions.filter(n=>n.uid!==e)}async generateExtensionTypes(){let e=new Map;await Promise.all(this.allExtensions.map(n=>n.contributeToSharedTypeFile(e))),e.forEach((n,i)=>{let r=L(i);if(n.size===0){r&&mn(i);return}let o=r?Ot(i).toString():"",s=[`import '@shopify/ui-extensions';
|
|
46
|
+
`,...Array.from(n)].join(`
|
|
47
|
+
`);o!==s&&fn(i,s)})}patchAppConfiguration(e){this.devApplicationURLs=e,this.configuration.application_url=e.applicationUrl,e.appProxy&&(this.configuration.app_proxy={url:e.appProxy.proxyUrl,subpath:e.appProxy.proxySubPath,prefix:e.appProxy.proxySubPathPrefix}),this.configuration.auth?.redirect_urls&&(this.configuration.auth.redirect_urls=e.redirectUrlWhitelist)}validateEventsLegacyFlowCompatibility(){if(this.configuration.access_scopes?.use_legacy_install_flow!==!0)return;if(this.extensionsForType({identifier:$t,externalIdentifier:$t}).some(n=>{let i=Q(n.configuration,"events.subscription");return Array.isArray(i)?i.length>0:typeof i=="object"&&i!==null}))throw new v("Events subscriptions are not supported when use_legacy_install_flow is enabled.",`Migrate to Shopify-managed installation before using Events subscriptions.
|
|
48
|
+
Scopes in your TOML configuration are not managed by Shopify while 'use_legacy_install_flow = true'.
|
|
49
|
+
|
|
50
|
+
Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app-installation`)}validateWebhookLegacyFlowCompatibility(){let e=this.configuration.webhooks?.subscriptions?.some(i=>i.topics&&i.topics.length>0)??!1,n=this.configuration.access_scopes?.use_legacy_install_flow===!0;if(e&&n)throw new v("App-specific webhook subscriptions are not supported when use_legacy_install_flow is enabled.",`To use app-specific webhooks, you need to:
|
|
51
|
+
1. Remove 'use_legacy_install_flow = true' from your configuration
|
|
52
|
+
2. Run 'shopify app deploy' to sync your scopes with the Developer Dashboard
|
|
53
|
+
|
|
54
|
+
Alternatively, continue using shop-specific webhooks with the legacy install flow.
|
|
55
|
+
|
|
56
|
+
Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app-installation`)}};function ps(t,e){let n=[];return t.forEach(i=>{let r=i.configuration.ui.handle,o=sr(e,r);o?o.type!=="ui_extension"&&n.push(`[${i.name}] - Local app must contain one extension of type 'ui_extension' and handle '${r}'`):n.push(`[${i.name}] - Local app must contain a ui_extension with handle '${r}'`)}),n.length>0?n:void 0}function fs(t,e){let n=[],i=["ui_extension"];return t.forEach(r=>{r.configuration.inCollection.forEach(o=>{let s=sr(e,o.handle);s?i.includes(s.specification.identifier)?s.specification.identifier==="ui_extension"&&s.configuration.extension_points.forEach(c=>{c.target.startsWith("admin.")&&n.push(`[${r.handle}] editor extension collection: Remove extension '${s.configuration.handle}' with target '${c.target}' from this collection. This extension target is not supported in collections.`)}):n.push(`[${r.handle}] editor extension collection: Remove extension of type '${s.specification.identifier}' from this collection. This extension type is not supported in collections.`):n.push(`[${r.handle}] editor extension collection: Add extension with handle '${o.handle}' to local app. Local app must include extension with handle '${o.handle}'.`)})}),n.length>0?n:void 0}function sr(t,e){return t.find(n=>n.handle===e)}async function ju(t){let e=t.dependency;if(e)return ds(e,t.directory)}async function ds(t,e){let n=t.replace("-react","").split("/"),i=u("node_modules",n[0],n[1],"package.json"),r=await Y(i,{cwd:e,type:"file",allowSymlinks:!0});if(!r)return"not_found";r=await yt(r);let o=await Jt(r);return o.version?{name:t,version:o.version}:"not_found"}f();function hs(t){if(!t?.length)return null;let e=null,n=-1;for(let i of t){if(!i.issues?.length)continue;let r=0,o=0,s=0;for(let c of i.issues)c.message?.includes("Required")||c.message?.includes("required")?r++:c.message?.includes("Expected")&&c.message?.includes("received")?o++:s++;let a;r>0?a=1e3-r*10-o-s:o>0?a=100-o*5-s:a=50-s,a>n&&(n=a,e=i)}return e}function ar(t){let e=[];for(let n of t)if(n.code==="invalid_union"&&n.unionErrors){let i=hs(n.unionErrors);if(i?.issues?.length)for(let r of i.issues)e.push({path:r.path,message:r.message,code:n.code});else e.push({path:n.path,message:n.message??"Configuration doesn't match any expected format",code:n.code})}else e.push({path:n.path,message:n.message??"Unknown error",code:n.code});return e}f();f();f();f();f();f();f();async function lt(t,e,n){let[i,r]=await Promise.all([yt(t),yt(e)]),o=F(r,i);if(o.split(/[/\\]/,1)[0]===".."||Dt(o))throw new v(`Asset path '${n}' resolves outside the app directory.`,`Asset sources must be inside the app folder. Resolved to: ${i}`)}async function ur(t){let{key:e,baseDir:n,outputDir:i,context:r,appDirectory:o,destination:s,usedBasenames:a=new Set,preserveFilePaths:c=!1}=t,{stdout:l}=r.options,p=re(r.extension.configuration,e),d;typeof p=="string"?d=[p]:Array.isArray(p)?d=p.filter(b=>typeof b=="string"):d=[];for(let b of d)if(b.trim()==="")throw new v(`'${e}' can't be empty.`);if(d.length===0)return _(`No value for configKey '${e}', skipping
|
|
57
|
+
`,l),{filesCopied:0,pathMap:new Map};let m=s?u(i,s):i,h=B(d),y=new Map,P=0;for(let b of h){let w=u(n,b);if(!await x(w))throw new v(U`Couldn't find ${D.path(w)}\n Please check the path '${b}' in your configuration`.value);await lt(w,o,b);let C=await K(w),A=m;if(C){let S=await k(["**/*"],{cwd:w,absolute:!1}),I=S.map(j=>F(i,u(A,j)));if(c)for(let j of S)cr($(j),b,a);await Rt(w,A),l.write(`Included '${b}'
|
|
58
|
+
`);for(let j of S)a.add($(j));y.set(b,I),P+=S.length}else{await M(A);let S=$(w),I;c?(cr(S,b,a),I=S):I=ms(S,a),a.add(I);let j=F(i,u(A,I)),W=u(A,I);await V(w,W),l.write(`Included '${b}'
|
|
59
|
+
`),y.set(b,j),P+=1}}return{filesCopied:P,pathMap:y}}function cr(t,e,n){if(n.has(t))throw new v(`File collision: '${t}' from '${e}' would overwrite a file copied from a different source. Rename or relocate the conflicting file.`)}function ms(t,e){if(!e.has(t))return t;let n=jt(t),i=n?t.slice(0,-n.length):t,r=1e3,o=1;for(;e.has(`${i}-${o}${n}`);)if(o++,o>r)throw new Error(`Unable to find unique basename for '${t}' after ${r} attempts`);return`${i}-${o}${n}`}function Je(t){return t.split(".").map(e=>{let n=e.endsWith("[]");return{name:n?e.slice(0,-2):e,flatten:n}})}function re(t,e){let n=t;for(let{name:i,flatten:r}of Je(e)){if(n==null)return;if(Array.isArray(n)){let o=n.map(s=>s!==null&&typeof s=="object"?s[i]:void 0).filter(s=>s!==void 0);n=o.length>0?o:void 0}else if(typeof n=="object")n=n[i];else return;if(r){if(!Array.isArray(n))return;n=n.flat(1)}}return n}function ze(t){return jt(t)?E(t):t}async function lr(t,e,n,i){let{extension:r,options:o}=e,s=[],a=[];for(let p of t)typeof p.anchor=="string"&&typeof p.groupBy=="string"?s.push(p):a.push(p);if(s.length===0&&a.length===0&&i.length===0)return;let c={};for(let p of a){let d=ws(p.key),m=re(r.configuration,p.key);m!=null&&(c[d]=oe(m,n))}let l=new Map;for(let p of s){let d=`${p.anchor}||${p.groupBy}`,m=l.get(d);m?m.push(p):l.set(d,[p])}for(let p of l.values()){let{anchor:d,groupBy:m}=p[0],h=re(r.configuration,d);if(Array.isArray(h))for(let y of h){if(y===null||typeof y!="object"||Array.isArray(y))continue;let P=y,b=P[m];if(typeof b!="string")continue;let w=p.map(A=>{let S=gs(A.key,d),I=He(P,S);return oe(I,n)});w.some(qe)&&o.stdout.write(`Warning: manifest entry '${b}' contains unresolved paths \u2014 source files may be missing
|
|
60
|
+
`);let C=c[b]??{};c[b]=ys([C,...w])}}if(i.length>0&&(c.files=i),Object.keys(c).length===0){o.stdout.write(`Warning: no manifest entries produced \u2014 skipping manifest.json
|
|
61
|
+
`);return}await Ge(e,c)}async function Ge(t,e){let n=ze(t.extension.outputPath),i=u(n,"manifest.json");await x(n)||await M(n);let r={};if(await x(i))try{let o=await N(i);r=JSON.parse(o)}catch{_(`Warning: could not parse existing manifest.json, starting fresh
|
|
62
|
+
`,t.options.stdout)}for(let[o,s]of Object.entries(e)){let a=r[o];a&&typeof a=="object"&&!Array.isArray(a)&&typeof s=="object"&&!Array.isArray(s)?r[o]={...a,...s}:r[o]=s}await T(i,JSON.stringify(r,null,2)),_(`Updated manifest.json in ${n}
|
|
63
|
+
`,t.options.stdout)}function gs(t,e){if(e===t)return"";let n=`${e}.`;return t.startsWith(n)?t.slice(n.length):t}function He(t,e){if(e==="")return t;let n=Je(e),[i,...r]=n;if(!i)return t;let o=r.map(a=>`${a.name}${a.flatten?"[]":""}`).join("."),s=t[i.name];if(i.flatten){if(!Array.isArray(s))return{[i.name]:s};let a=s.map(c=>o?He(c,o):c);return{[i.name]:a}}return o&&s!==null&&s!==void 0&&typeof s=="object"&&!Array.isArray(s)?{[i.name]:He(s,o)}:{[i.name]:s}}function ys(t){return Object.assign({},...t)}function oe(t,e){if(typeof t=="string")return(t.startsWith(".")||t.includes("/")||t.includes("\\")||e.has(t)?e.get(t):void 0)??t;if(Array.isArray(t))return t.map(n=>oe(n,e));if(t!==null&&typeof t=="object"){let n={};for(let[i,r]of Object.entries(t))n[i]=oe(r,e);return n}return t}function ws(t){let e=t.split(".").at(-1)??t;return e.endsWith("[]")?e.slice(0,-2):e}function qe(t){return typeof t=="string"?t.startsWith("./")||t.startsWith("../"):Array.isArray(t)?t.some(qe):t!==null&&typeof t=="object"?Object.values(t).some(qe):!1}f();async function pr(t,e){let{sourceDir:n,outputDir:i,patterns:r,ignore:o,appDirectory:s,sourceDirConfigValue:a}=t;if(!await x(n))return{filesCopied:0,outputPaths:[]};await lt(n,s,a);let c=await k(r,{absolute:!0,cwd:n,ignore:o});if(c.length===0)return{filesCopied:0,outputPaths:[]};await M(i);let l=c,p=await Promise.all(l.map(async h=>{let y=F(n,h),P=u(i,y);return F(i,P).startsWith("..")?(e.stdout.write(`Warning: skipping '${h}' - resolved destination is outside the output directory
|
|
64
|
+
`),{count:0,path:null}):h===P?{count:0,path:null}:(await M(E(P)),await V(h,P),{count:1,path:y})})),d=p.reduce((h,y)=>h+y.count,0),m=p.flatMap(h=>h.path===null?[]:[h.path]);return e.stdout.write(`Included ${d} file(s)
|
|
65
|
+
`),{filesCopied:d,outputPaths:m}}f();async function fr(t,e){let{source:n,destination:i,baseDir:r,outputDir:o,appDirectory:s}=t,a=u(r,n);if(!await x(a))throw new Error(`Source does not exist: ${a}`);await lt(a,s,n);let c=await K(a),l,p;if(i===void 0?(l=u(o,$(a)),p=`Included ${n}
|
|
66
|
+
`):(l=u(o,i),p=`Included ${n}
|
|
67
|
+
`),c){let d=await k(["**/*"],{cwd:a,absolute:!1});await Rt(a,l),e.stdout.write(p);let m=F(o,l),h=m?d.map(y=>u(m,y)):d;return{filesCopied:d.length,outputPaths:h}}return await M(E(l)),await V(a,l),e.stdout.write(p),{filesCopied:1,outputPaths:[F(o,l)]}}var bs=g.object({type:g.literal("pattern"),baseDir:g.string().optional(),include:g.array(g.string()).default(["**/*"]),ignore:g.array(g.string()).optional(),destination:g.string().optional()}),xs=g.object({type:g.literal("static"),source:g.string(),destination:g.string().optional()}),vs=g.object({type:g.literal("configKey"),key:g.string(),destination:g.string().optional(),anchor:g.string().optional(),groupBy:g.string().optional(),preserveFilePaths:g.boolean().default(!1)}),_s=g.discriminatedUnion("type",[bs,xs,vs]),Ps=g.object({inclusions:g.array(_s),generatesAssetsManifest:g.boolean().default(!1)}).strict().superRefine((t,e)=>{for(let[n,i]of t.inclusions.entries())if(i.type==="configKey"){let r=i.anchor!==void 0,o=i.groupBy!==void 0;r!==o&&e.addIssue({code:g.ZodIssueCode.custom,message:"`anchor` and `groupBy` must both be set or both be omitted",path:["inclusions",n]})}});async function dr(t,e){let n=Ps.parse(t.config),{extension:i,options:r}=e,o=ze(i.outputPath),s=r.app.directory,a=new Map,c=new Set,l=0;for(let h of n.inclusions){if(h.type!=="configKey")continue;let y=R=>r.stdout.write(R),P=h.destination?me(h.destination,y):void 0,b=P===""?void 0:P,w=await ur({key:h.key,baseDir:i.directory,outputDir:o,context:e,appDirectory:s,destination:b,usedBasenames:c,preserveFilePaths:h.preserveFilePaths});w.pathMap.forEach((R,C)=>a.set(C,R)),l+=w.filesCopied}let p=await Promise.all(n.inclusions.filter(h=>h.type!=="configKey").map(async h=>{let y=w=>r.stdout.write(w),P=h.destination?me(h.destination,y):void 0,b=P===""?void 0:P;if(h.type==="pattern"){let w=h.baseDir?u(i.directory,h.baseDir):i.directory,R=b?u(o,b):o,C=await pr({sourceDir:w,outputDir:R,patterns:h.include,ignore:h.ignore??[],appDirectory:s,sourceDirConfigValue:h.baseDir??"."},r),A=b?C.outputPaths.map(S=>u(b,S)):C.outputPaths;return{filesCopied:C.filesCopied,outputPaths:A}}if(h.type==="static")return fr({source:h.source,destination:b,baseDir:i.directory,outputDir:o,appDirectory:s},r)})),d=n.generatesAssetsManifest?p.flatMap(h=>h?.outputPaths??[]):[],m=[l,...p.map(h=>h?.filesCopied??0)];if(n.generatesAssetsManifest){let h=n.inclusions.filter(y=>y.type==="configKey");await lr(h,e,a,d)}return{filesCopied:m.reduce((h,y)=>h+(y??0),0)}}f();f();var pt=kt(zr(),1);function Cs(t){return new Map(t.map(e=>[e.uri,e.source]))}function Es(t,e,n){let r=t.split(`
|
|
68
|
+
`).slice(e,n+1),o=r.length===1;return r.map((s,a)=>{let c=e+a+1,l=o?s.trim():s;return`${c} ${l}`}).join(`
|
|
69
|
+
`)}function Ss(t){switch(t){case pt.Severity.ERROR:return{error:`
|
|
70
|
+
[error]:`};case pt.Severity.WARNING:return{warn:`
|
|
71
|
+
[warning]:`};case pt.Severity.INFO:return{info:`
|
|
72
|
+
[info]:`}}}function Fs(t,e){return t.map((i,r)=>{let{message:o,uri:s,start:a,end:c,check:l,severity:p}=i,d=e.get(s),m=d===void 0?[]:[`
|
|
73
|
+
|
|
74
|
+
${Es(d,a.line,c.line)}`],h=r===t.length-1?"":`
|
|
75
|
+
|
|
76
|
+
`;return[Ss(p),{bold:l},{subdued:`
|
|
77
|
+
${o}`},...m,h]}).flat()}async function hr(t){let n=await x(u(t,".theme-check.yml"))?void 0:"theme-check:theme-app-extension",{offenses:i,theme:r}=await(0,pt.themeCheckRun)(t,n),o=Fs(i,Cs(r));return zn(o)}async function mr(t,e){let{extension:n,options:i}=e;i.stdout.write("Running theme check on your Theme app extension...");let r=await hr(n.directory);r&&i.stdout.write(r)}f();async function gr(t,e){let{extension:n,options:i}=e;i.stdout.write(`Bundling theme extension ${n.localIdentifier}...`);let r=await Re(n);return await Promise.all(r.map(async o=>{let s=F(n.directory,o),a=u(n.outputPath,s);o!==a&&await V(o,a)})),{filesCopied:r.length}}f();async function yr(t,e){let n=e.extension.configuration;e.options.buildDirectory=t.config?.bundleFolder??void 0;let i=await Ji(e.extension,e.options),r=E(i),o=t.config?.bundleFolder?u(E(e.extension.outputPath),t.config.bundleFolder):E(e.extension.outputPath);if(gt(r)===gt(o))return;if(!await x(r))throw new ut(r);let s=await k("**/*",{cwd:r,absolute:!0,ignore:["**/*.js.map"]});if(await Promise.all(s.map(async l=>{let p=u(o,F(r,l));await M(E(p)),await V(l,p)})),!t.config?.generatesAssetsManifest||!Array.isArray(n.extension_points))return;let a=n.extension_points.filter(l=>typeof l=="object"&&l.build_manifest),c=$s(a,t.config?.bundleFolder);Object.keys(c).length>0&&await Ge(e,c)}function $s(t,e){let n={};for(let{target:i,build_manifest:r}of t){if(!r?.assets)continue;let o={};for(let[s,a]of Object.entries(r.assets))a?.filepath&&(o[s]=e?u(e,a.filepath):a.filepath);Object.keys(o).length>0&&(n[i]=o)}return n}f();async function wr(t,e){await Hi(e.extension,e.options)}f();async function br(t,e){let{extension:n}=e;if(await x(n.outputPath)&&await K(n.outputPath))throw new Error(`outputPath '${n.outputPath}' is a directory \u2014 expected a file path for the tax stub`);await Ut(n.outputPath),await T(n.outputPath,"(()=>{})();")}async function xr(t,e){switch(t.type){case"include_assets":return dr(t,e);case"build_theme":return mr(t,e);case"bundle_theme":return gr(t,e);case"bundle_ui":return yr(t,e);case"build_function":return wr(t,e);case"create_tax_stub":return br(t,e);default:throw new Error(`Unknown build step type: ${t.type}`)}}async function vr(t,e){let n=Date.now();try{let i=await xr(t,e);return{id:t.id,success:!0,duration:Date.now()-n,output:i}}catch(i){let r=i;if(t.continueOnError)return e.options.stderr.write(`Warning: Step "${t.name}" failed but continuing: ${r.message}
|
|
78
|
+
`),{id:t.id,success:!1,duration:Date.now()-n,error:r};throw r.message=`Build step "${t.name}" failed: ${r.message}`,r}}f();import{openSync as Is,readSync as As,closeSync as ks}from"fs";var _r=128*1024,se=new Map,ae=new Map,ce=new Map;function ot(t){let e=ae.get(t);if(e!==void 0)return e;let n=L(t);return ae.set(t,n),n}function At(t){let e=ce.get(t);if(e!==void 0)return e;let n=gn(t);return ce.set(t,n),n}function Ds(t){let e=Is(t,"r");try{let n=Buffer.alloc(_r),i=As(e,n,0,_r,0);return n.subarray(0,i).toString()}finally{ks(e)}}function Pr(){se.clear(),ae.clear(),ce.clear()}function js(t){let e=se.get(t);if(e)return e;let n=Ds(t),i=t.substring(t.lastIndexOf(".")),r;switch(i){case".js":case".mjs":case".cjs":case".ts":case".tsx":case".jsx":r=Er(n,t);break;case".rs":r=Os(n,t);break;default:r=[]}return se.set(t,r),r}function Ke(t,e=new Set){if(e.has(t))return[];e.add(t);let n=js(t),i=[t,...n];for(let r of n)try{if(ot(r)&&!At(r)){let o=Ke(r,e);i.push(...o)}}catch(o){if(o instanceof Error&&o.message.includes("ENOENT"))continue;throw o}return B(i)}function Cr(){return{directImports:se.size,fileExists:ae.size,isDir:ce.size}}function Ye(t,e){return Er(t,e)}function Er(t,e){let n=[],i=[/import\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,/import\s+['"](\.\.?\/[^'"]+)['"]/g,/export\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,/import\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g,/require\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g];for(let r of i){let o;for(;(o=r.exec(t))!==null;){let s=o[1];if(s&&s.startsWith(".")){let a=Us(s,e);a&&n.push(a)}}}return B(n)}function Os(t,e){let n=[],i=/^\s*(?:pub\s+)?mod\s+([a-z_][a-z0-9_]*)\s*;/gm,r;for(;(r=i.exec(t))!==null;){let s=r[1];if(s){let a=Ns(s,e);a&&n.push(a)}}let o=/#\[path\s*=\s*"([^"]+)"\]/g;for(;(r=o.exec(t))!==null;){let s=r[1];if(s){let a=u(E(e),s);ot(a)&&n.push(a)}}return B(n)}function Us(t,e){let n=ot(e)&&At(e)?e:E(e),i=u(n,t);if(ot(i)&&At(i)){let o=[u(i,"index.js"),u(i,"index.ts"),u(i,"index.tsx"),u(i,"index.jsx")];for(let s of o)if(ot(s)&&!At(s))return s;return null}let r=[i,`${i}.js`,`${i}.ts`,`${i}.tsx`,`${i}.jsx`];for(let o of r)if(ot(o)&&!At(o))return o;return null}function Ns(t,e){let n=E(e),i=[u(n,`${t}.rs`),u(n,t,"mod.rs")];for(let r of i)if(ot(r))return r;return null}var Rs=250,Ts=["**/node_modules/**","**/.git/**","**/*.test.*","**/dist/**","**/*.swp","**/generated/**","**/.gitignore"],Ls="Extension initialized",ue=class{entrySourceFilePath;devUUID;localIdentifier;idEnvironmentVariableName;directory;configuration;configurationPath;outputPath;handle;specification;uid;cachedImportPaths;get graphQLType(){return(this.specification.graphQLType??this.specification.identifier).toUpperCase()}get type(){return this.specification.identifier}get humanName(){return this.specification.externalName}get name(){return this.configuration.name??this.specification.externalName}get dependency(){return this.specification.dependency}get externalType(){return this.specification.externalIdentifier}get surface(){return this.specification.surface}get isPreviewable(){return this.features.includes("ui_preview")}get isThemeExtension(){return this.features.includes("theme")}get isFunctionExtension(){return this.features.includes("function")}get isESBuildExtension(){return this.features.includes("esbuild")}get isSourceMapGeneratingExtension(){return this.features.includes("generates_source_maps")}get isAppConfigExtension(){return this.specification.experience==="configuration"}get isFlow(){return this.specification.identifier.includes("flow")}get isEditorExtensionCollection(){return this.specification.identifier==="editor_extension_collection"}get hasDeploySteps(){return this.specification.clientSteps?.some(e=>e.lifecycle==="deploy"&&e.steps.length>0)??!1}get features(){return this.specification.appModuleFeatures(this.configuration)}get outputFileName(){return $(this.outputRelativePath)}get outputRelativePath(){return this.specification.getOutputRelativePath?.(this)??""}get hasNoLocalDevOutput(){return this.features.length===0&&!this.hasDeploySteps&&this.outputRelativePath===""}constructor(e){this.configuration=e.configuration,this.configurationPath=e.configurationPath,this.entrySourceFilePath=e.entryPath??"",this.directory=e.directory,this.specification=e.specification;let n=this.specification.getIdentity?.(this.configuration);this.handle=n?.handle??this.buildHandle(),this.localIdentifier=this.handle,this.idEnvironmentVariableName=`SHOPIFY_${ln(this.localIdentifier)}_ID`,this.outputPath=u(this.directory,this.outputRelativePath),this.uid=n?.uid??this.buildUIDFromStrategy(),this.devUUID=`dev-${this.uid}`}get isUUIDStrategyExtension(){return this.specification.uidStrategy==="uuid"}get isSingleStrategyExtension(){return this.specification.uidStrategy==="single"}get isDynamicStrategyExtension(){return this.specification.uidStrategy==="dynamic"}get outputPrefix(){return this.handle}isSentToMetrics(){return!this.isAppConfigExtension}isReturnedAsInfo(){return!this.isAppConfigExtension}async deployConfig({apiKey:e,appConfiguration:n}){let i=await this.specification.deployConfig?.(this.configuration,this.directory,e,void 0,{appConfiguration:n}),r=this.specification.transformLocalToRemote?.(this.configuration,n),o=i??r??void 0;return o&&Object.keys(o).length>0?o:void 0}validate(){return this.specification.validate?this.specification.validate(this.configuration,this.configurationPath,this.directory):Promise.resolve(tt(void 0))}preDeployValidation(){return this.specification.preDeployValidation?this.specification.preDeployValidation(this):Promise.resolve()}buildValidation({outputPath:e}){return this.specification.buildValidation?this.specification.buildValidation(this,e):Promise.resolve()}async keepBuiltSourcemapsLocally(e){if(!this.isSourceMapGeneratingExtension)return Promise.resolve();let i=(await k(`**/${this.handle}.js.map`,{cwd:e,absolute:!0,followSymbolicLinks:!1}))[0];if(i===void 0)return Promise.resolve();let r=u(this.directory,F(e,i));await bn(i,r,{overwrite:!0}),_(`Source map for ${this.localIdentifier} created: ${r}`)}async publishURL(e){let n=await En(),i=this.specification.partnersWebIdentifier;return`https://${n}/${e.orgId}/apps/${e.appId}/extensions/${i}/${e.extensionId}`}getOutputFolderId(){return this.uid}getBundleExtensionStdinContent(){return this.specification.getBundleExtensionStdinContent?this.specification.getBundleExtensionStdinContent(this.configuration):{main:`import '.${this.entrySourceFilePath.replace(this.directory,"")}';`}}shouldFetchCartUrl(){return this.features.includes("cart_url")}hasExtensionPointTarget(e){return this.specification.hasExtensionPointTarget?.(this.configuration,e)??!1}get buildCommand(){return this.configuration.build?.command}get typegenCommand(){return this.configuration.build?.typegen_command}devSessionDefaultWatchPaths(){if(this.specification.identifier==="ui_extension"){let{main:e,assets:n}=this.getBundleExtensionStdinContent(),i=Ye(e,this.directory),r=n?.flatMap(o=>Ye(o.content,this.directory))??[];return i.concat(...r)}return[this.entrySourceFilePath]}get devSessionWatchConfig(){return this.specification.devSessionWatchConfig?this.specification.devSessionWatchConfig(this):this.isAppConfigExtension?{paths:[]}:void 0}async watchConfigurationPaths(){if(this.isAppConfigExtension)return[this.configurationPath];{let e=[];return await x(u(this.directory,"locales"))&&e.push(u(this.directory,"locales","**.json")),e.push(u(this.directory,"**.toml")),e}}get inputQueryPath(){return u(this.directory,"input.graphql")}get isJavaScript(){return!!(this.entrySourceFilePath.endsWith(".js")||this.entrySourceFilePath.endsWith(".ts"))}async build(e){let{clientSteps:n=[]}=this.specification,i={extension:this,options:e,stepResults:new Map},r=n.find(o=>o.lifecycle==="deploy")?.steps??[];for(let o of r){let s=await vr(o,i);i.stepResults.set(o.id,s)}}async buildForBundle(e,n){this.outputPath=this.getOutputPathForDirectory(n),await this.build(e);let i=u(n,this.getOutputFolderId());await this.keepBuiltSourcemapsLocally(i)}getOutputPathForDirectory(e){return u(e,this.getOutputFolderId(),this.outputRelativePath)}get singleTarget(){let e=Q(this.configuration,"targeting")??[];if(e.length===1)return e[0]?.target}get contextValue(){let e=this.specification.getTarget?.(this.configuration);if(e!==void 0)return e;let n=this.singleTarget??"";return this.isFlow&&(n=this.configuration.handle??""),n}async bundleConfig({appModuleUuids:e,developerPlatformClient:n,apiKey:i,appConfiguration:r}){let o=await this.deployConfig({apiKey:i,appConfiguration:r});if(!o)return;let s={config:JSON.stringify(o),context:this.contextValue,handle:this.handle},a=e[this.localIdentifier];return{...s,uid:this.uid,uuid:a,specificationIdentifier:n.toExtensionGraphQLType(this.graphQLType)}}async getDevSessionUpdateMessages(e){if(this.specification.getDevSessionUpdateMessages)return this.specification.getDevSessionUpdateMessages(this.configuration,e);if(e.status==="created"&&!this.isAppConfigExtension&&this.hasNoLocalDevOutput)return[Ls]}patchWithAppDevURLs(e){this.specification.patchWithAppDevURLs?.(this.configuration,e),this.resolveUIDWithApplicationUrl(e.applicationUrl)}resolveUIDWithApplicationUrl(e){this.isDynamicStrategyExtension&&(this.uid=this.buildUIDFromStrategy(e))}async contributeToSharedTypeFile(e){await this.specification.contributeToSharedTypeFile?.(this,e)}watchPatterns(){let e=this.devSessionWatchConfig;return{paths:e?.paths??["**/*"],ignore:e?.ignore??Ts}}watchedFiles(){let e=[],{paths:n,ignore:i}=this.watchPatterns(),r=n.flatMap(o=>vn(o,{cwd:this.directory,absolute:!0,followSymbolicLinks:!1,ignore:i}));if(e.push(...r.flat()),!this.devSessionWatchConfig){let o=this.scanImports();e.push(...o)}return B(e.map(o=>Z(o)))}async rescanImports(){let e=this.cachedImportPaths;return this.cachedImportPaths=void 0,Pr(),this.scanImports(),e!==this.cachedImportPaths}scanImports(){if(this.cachedImportPaths!==void 0)return this.cachedImportPaths;if(mt(process.env.SHOPIFY_CLI_DISABLE_IMPORT_SCANNING))return this.cachedImportPaths=[],this.cachedImportPaths;try{let e=performance.now(),n=this.devSessionDefaultWatchPaths(),i=n.flatMap(a=>Ke(a).map(c=>Z(gt(c))));this.cachedImportPaths=B(i)??[];let r=Math.round(performance.now()-e),o=Cr(),s=o?` (cache: ${o.directImports} parsed, ${o.fileExists} stats)`:"";return _(`Import scan for "${this.handle}": ${n.length} entries, ${this.cachedImportPaths.length} files, ${r}ms${s}`),this.cachedImportPaths}catch(e){return _(`Failed to scan imports for extension ${this.handle}: ${e}`),this.cachedImportPaths=[],this.cachedImportPaths}}buildHandle(){switch(this.specification.uidStrategy){case"single":return this.specification.identifier;case"uuid":return this.configuration.handle??z(this.name??"");case"dynamic":if("topic"in this.configuration&&"uri"in this.configuration){let e=this.configuration,n=`${e.topic}${e.uri}${e.filter}`;return wt(n).substring(0,nt)}else return Tt(JSON.stringify(this.configuration))}}buildUIDFromStrategy(e){switch(this.specification.uidStrategy){case"single":return this.specification.identifier;case"uuid":return this.configuration.uid??Tt(this.handle);case"dynamic":if("topic"in this.configuration&&"uri"in this.configuration){let n=this.configuration,i=ct(n.uri,e).substring(0,Rs);return`${n.topic}::${n.filter??""}::${i}`}else return Tt(JSON.stringify(this.configuration))}}};f();async function Op(t,e=""){let n=Ms(e),i=await bt(n);for(;await x(u(t,le(i)))&&await et({message:`Configuration file ${le(i)} already exists. Do you want to choose a different configuration name?`,confirmationMessage:"Yes, I'll choose a different name",cancellationMessage:"No, overwrite my existing configuration file"});)i=await bt(n);return le(i)}function le(t,e=!1){let n=z(t);return n===""?"shopify.app.toml":`shopify.app.${e?On.cyan(n):n}.toml`}async function Qe(t){return(await k(u(t,Et))).filter(n=>G($(n)))}async function Sr(t){let e=(await Qe(t)).map(i=>$(i));if(e.length===0)return Lt("Could not find any shopify.app.toml file in the directory.");if(e.length===1)return tt(e[0]);let n=await Rn({message:"Configuration file",choices:e.map(i=>({label:i,value:i}))});return tt(n)}function Ms(t){return{message:"Configuration file name:",initialAnswer:t,validate:Ws,preview:e=>`${le(e,!0)} will be generated in your root directory`}}function Ws(t){if(z(t).length>238)return"The file name is too long."}f();f();f();import{readdirSync as Bs}from"fs";async function Fr(t){if(!t||!await K(t))return{};let e={},n=Bs(t);return await Promise.all(n.map(async i=>{if(G(i)){let r=u(t,i),s=(await H.read(r)).content;s.client_id&&(e[s.client_id]=i)}})),e}function Kp(){return Kn()}function Yp(){return Yn()}function Qp(){return Qn()}async function Xp(t,e,n,i){let r=await Fr(i?.directory),o=c=>r[c?.apiKey]?{label:`${c.title} (${r[c.apiKey]})`,value:c.apiKey}:{label:c.title,value:c.apiKey},s=e,a=await _e({message:"Which existing app is this for?",choices:s.map(o),hasMorePages:n,search:async c=>{let l=await t(c);return s=l.apps,{data:s.map(o),meta:{hasNextPage:l.hasMorePages}}}});return s.find(c=>c.apiKey===a)}async function Zp({stores:t,hasMorePages:e=!1,onSearchForStoresByName:n,showDomainOnPrompt:i=!0,onCreateStoreWhenEmpty:r,onCreateStore:o}){if(t.length===0)return r?.();if(t.length===1&&!e&&!o)return Jn(`Using your default dev store, ${t[0].shopName}, to preview your project.`),t[0];let s=h=>{let y=h.shopName;return i&&h.shopDomain&&(y=`${h.shopName} (${h.shopDomain})`),{label:y,value:h.shopId}},a=t,c=new Map(t.map(h=>[h.shopId,h])),l="__create_new_dev_store__",p=()=>[...a.map(s),...o?[{label:"Create a new dev store",value:l}]:[]],d={};n&&(d.search=async h=>{let y=await n(h);return a=y.stores,a.length>0&&a.forEach(P=>c.set(P.shopId,P)),{data:p(),meta:{hasNextPage:y.hasMorePages}}});let m=await _e({message:"Which store would you like to use to view your project?",choices:p(),hasMorePages:e,...d});return m===l?o?.():c.get(m)}async function tf(t){return bt({message:"App name",defaultValue:t,validate:e=>{if(e.length===0)return"App name can't be empty";if(e.length>$e)return`Enter a shorter name (${$e} character max.)`;if(e.includes("shopify"))return`Name can't contain "shopify." Enter another name.`}})}async function ef(t){return et({message:"Finished creating a dev store?",confirmationMessage:`Yes, ${t.businessName} has a new dev store`,cancellationMessage:"No, cancel dev"})}async function nf(){return et({message:"Create this project as a new app on Shopify?",confirmationMessage:"Yes, create it as a new app",cancellationMessage:"No, connect it to an existing app"})}function $r(t,e){let n=["application_url","redirect_urls"];e.appProxy?.proxyUrl&&n.push("app_proxy");let i={"Currently released app URL":[t],"=> Dev URL":[e.applicationUrl],"Affected configurations":n};return et({message:"Have Shopify override your app URLs when running `app dev` against your dev store? This won't affect your app on other stores",confirmationMessage:"Yes, automatically update",cancellationMessage:"No, never",infoTable:i})}function rf(){return et({message:"--use-localhost requires a certificate for `localhost`. Generate it now?",confirmationMessage:"Yes, use mkcert to generate it",cancellationMessage:"No, I'll run `app dev` again without `--use-localhost`"})}async function gf(t){if(t.noTunnelUseLocalhost)return{frontendUrl:"https://localhost",frontendPort:t.port,usingLocalhost:!0};let e=4040,n="",i=t.noTunnelUseLocalhost;if(Ee())return n=`https://${Ee()}-${e}.${Wn()}`,{frontendUrl:n,frontendPort:e,usingLocalhost:i};if(Ce()){let r=Ce()?.replace("https://","");return n=`https://${e}-${r}`,{frontendUrl:n,frontendPort:e,usingLocalhost:i}}if(t.tunnelUrl){let r=t.tunnelUrl.match(/(https:\/\/[^:]+):([0-9]+)/);if(!r)throw new v(`Invalid tunnel URL: ${t.tunnelUrl}`,'Valid format: "https://my-tunnel-url:port"');return e=Number(r[2]),n=r[1],{frontendUrl:n,frontendPort:e,usingLocalhost:i}}return t.tunnelClient&&(e=t.tunnelClient.port,n=await Vs(t.tunnelClient)),{frontendUrl:n,frontendPort:e,usingLocalhost:i}}async function Vs(t){return new Promise((e,n)=>{let i=0,r=async()=>{let s=t.getTunnelStatus();if(_(`Polling tunnel status for ${t.provider} (attempt ${i}): ${s.status}`),s.status==="error")return n(new v(s.message,s.tryMessage));s.status==="connected"?e(s.url):(i+=1,o())},o=()=>{setTimeout(r,500)};r()})}function Ir(t,e,n){let i;e&&e.length>0?i=(Array.isArray(e)?e:[e]).reduce((s,a)=>(a&&a.length>0&&s.push(`${t}${a}`),s),[]):i=[`${t}/auth/callback`,`${t}/auth/shopify/callback`,`${t}/api/auth/callback`];let r=n?{appProxy:{proxyUrl:Js(ct(n.url,t),t),proxySubPath:n.subpath,proxySubPathPrefix:n.prefix}}:{};return{applicationUrl:t,redirectUrlWhitelist:i,...r}}function Js(t,e){let n=new URL(t),i=new URL(e);return n.host=i.host,n.toString().replace(/\/$/,"")}async function yf(t){let e={applicationUrl:t?.application_url??"",redirectUrlWhitelist:t?.auth?.redirect_urls??[]};return t?.app_proxy&&(e.appProxy={proxyUrl:t?.app_proxy.url,proxySubPath:t?.app_proxy.subpath,proxySubPathPrefix:t?.app_proxy.prefix}),e}async function wf(t){if(t.localApp&&t.localApp.configuration.client_id!==t.apiKey||(t.newApp??!Mn()))return!0;let e=t.cachedUpdateURLs===!0;if(t.cachedUpdateURLs===void 0)if(e=await $r(t.currentURLs.applicationUrl,t.newURLs),t.localApp){let n=t.localApp.configuration;n.build={...n.build,automatically_update_urls_on_dev:e},await(await H.read(t.localApp.configPath)).patch({build:{automatically_update_urls_on_dev:e}})}else Zt({directory:t.appDirectory,updateURLs:e});return e}async function bf(t,e,n){let i=await Cn(t,"tunnel_start",{port:e,provider:n}),r=Object.values(i).filter(s=>!s?.isErr()||s.error.type!=="invalid-provider");if(r.length>1)throw new Pe(`Multiple tunnel plugins for ${n} found`);let o=r[0];if(!o)throw new Pe(`We couldn't find the ${n} tunnel plugin`);if(o.isErr())throw new v(`${n} failed to start the tunnel.
|
|
79
|
+
${o.error.message}`,["What to try:",{list:{items:[["Try to run the command again"],["Add the flag",{command:"--tunnel-url {URL}"},"to use a custom tunnel URL"]]}}]);return o.value}f();f();f();f();var Ar=an({name:"AppConfigUseResult",schema:g.object({status:g.literal("success"),changed:g.boolean().describe("Whether the preferred configuration changed."),path:g.string().refine(Dt,"Expected an absolute filesystem path.").nullable().describe("The preferred configuration file, or null after clearing the preference."),clientId:g.string().min(1).nullable().describe("The public OAuth client identifier, or null after clearing the preference.")}).strict()});async function kr(t,e,n){if(n==="json"){Vn(Ar.encode(t));return}if(t.path===null){let i=await Bt(e);ve({headline:"Cleared current configuration.",body:["In order to set a new current configuration, please run",{command:Bn(i,"shopify app config use CONFIG_NAME")},{char:"."}]})}else ve({headline:`Using configuration file ${$(t.path)}`})}import{resolve as Hs}from"node:path";async function Xe({directory:t,configName:e,warningContent:n,shouldRenderSuccess:i=!0,reset:r=!1}){n&&!r&&Nn(n);let o=await qs({directory:t,configName:e,reset:r});return(r||i)&&await kr(o,t,"text"),o.path===null?void 0:$(o.path)}async function qs({directory:t,configName:e,reset:n=!1,previousConfigFile:i=Xt(t)?.configFile??null}){if(n)return Gi(t),{status:"success",changed:i!==null,path:null,clientId:null};let r=(await Gs(t,e)).valueOrAbort(),{activeConfig:o}=await ft(t,r);return zs(o.file.content,{configFileName:r,directory:t}),{status:"success",changed:i!==r,path:Hs(t,r),clientId:o.file.content.client_id}}function zs(t,e){let{configFileName:n,directory:i}=e;if(t.client_id)Zt({directory:i,configFile:n});else throw new v(`Configuration file ${n} needs a client_id.`)}async function Gs(t,e){if(e){let n=rt(e);return await x(u(t,n))?tt(n):Lt(`Could not find configuration file ${n}`)}return Sr(t)}async function jr(t,e,n){let i=e,r=n?.clientId?t.appConfigByClientId(n.clientId):void 0,o=Xt(t.directory)?.configFile,s=o?u(t.directory,o):null,a=!!(!i&&s&&!L(s));if(a&&!n?.skipPrompts){let m={headline:`Couldn't find ${o}`,body:["If you have multiple config files, select a new one. If you only have one config file, it's been selected as your default."]};i=await Xe({directory:t.directory,warningContent:m,shouldRenderSuccess:!1})}if(!i&&r)return Dr(t,r,"flag");if(!i&&n?.clientId)throw new v("The specified client ID couldn't be found in any TOML file, or the matching TOML file is malformed.");let c=i??(a?void 0:o),l;e?l="flag":c?l="cached":l="default";let p=rt(c),d=t.appConfigByName(p);if(!d)throw new v(U`Couldn't find ${p} in ${D.path(t.directory)}.`);return Dr(t,d,l)}async function Dr(t,e,n){let i=typeof e.content.client_id=="string"?e.content.client_id:void 0,r=!!i&&i!=="",o=pe(t,e.path),s=await fe(t,i);return{file:e,source:n,isLinked:r,dotenv:o,hiddenConfig:s}}f();async function Or(t,e){await Fn("warn-on-multiple-versions",{days:1},async()=>{if(!e["@shopify/cli"])return;let n=An(),i=n?he:await In();if(!i)return;let r=n?await $n(t):he;if(!r)return;let s={headline:`Two Shopify CLI installations found \u2013 using ${n?"global installation":"local dependency"}`,body:[`A global installation (v${i}) and a local dependency (v${r}) were detected.
|
|
80
|
+
We recommend removing the @shopify/cli and @shopify/app dependencies from your package.json, unless you want to use different versions across multiple apps.`],link:{label:"See Shopify CLI documentation.",url:"https://shopify.dev/docs/apps/build/cli-for-apps#switch-to-a-global-executable-or-local-dependency"}};Un(s)})}f();import{existsSync as Ks,readFileSync as Ys}from"fs";var Qs=[{name:"remix",detectors:{every:[{path:"package.json",matchContent:'"(dev)?(d|D)ependencies":\\s*{[^}]*"@remix-run\\/.*":\\s*".+?"[^}]*}'},{path:"package.json",matchContent:'"(dev)?(d|D)ependencies":\\s*{[^}]*"react":\\s*".+?"[^}]*}'}]}},{name:"nextjs",detectors:{every:[{path:"package.json",matchContent:'"(dev)?(d|D)ependencies":\\s*{[^}]*"next":\\s*".+?"[^}]*}'},{path:"package.json",matchContent:'"(dev)?(d|D)ependencies":\\s*{[^}]*"react":\\s*".+?"[^}]*}'}]}},{name:"express",detectors:{every:[{path:"package.json",matchContent:'"(dev)?(d|D)ependencies":\\s*{[^}]*"express":\\s*".+?"[^}]*}'}]}},{name:"rails",detectors:{every:[{path:"Gemfile",matchContent:'gem "rails"'}]}},{name:"flask",detectors:{every:[{path:"Pipfile",matchContent:"flask"}]}},{name:"django",detectors:{every:[{path:"Pipfile",matchContent:"django"}]}},{name:"laravel",detectors:{every:[{path:"composer.json",matchContent:'"require":\\s*{[^}]*"laravel/framework":\\s*".+?"[^}]*}'}]}},{name:"symfony",detectors:{every:[{path:"composer.json",matchContent:'"require":\\s*{[^}]*"symfony\\/.*":\\s*".+?"[^}]*}'}]}}];async function Rr(t){let e={},n=Qs.find(i=>(!i.detectors.some||i.detectors.some.reduce((r,o)=>Ur(o,Nr(t,o.path,e)),!1))&&(!i.detectors.every||i.detectors.every.reduce((r,o)=>r?Ur(o,Nr(t,o.path,e)):!1,!0)));return n?n.name:"unknown"}function Ur(t,e={}){return e[t.path]?!t.matchContent||new RegExp(t.matchContent).test(e[t.path]):!1}function Nr(t,e,n={}){if(n[e])return n;let i=u(t,e);if(!Ks(i))return n;let r=Ys(i,{encoding:"utf8"});return n[e]=r,n}var Mr=kt(Kr(),1),Ze=class extends v{configurationPath;errors;constructor(e,n){super(`Validation errors in ${e}:
|
|
81
|
+
|
|
82
|
+
${n.map(nn).join(`
|
|
83
|
+
`)}`),this.configurationPath=e,this.errors=n}};function Xs(t){if(t.file.endsWith(".toml")&&t.message==="Expected object, received array")return"Use a TOML table instead of an array. [table] defines a single table; [[table]] defines an array of tables."}function nn(t){let e=Xs(t),n=e?`${t.message}. ${e}`:t.message;return t.path?.length?`[${t.path.join(".")}]: ${n}`:n}async function rn(t,e,n){let i=n;if(!i)try{i=(await H.read(e)).content}catch(r){if(r instanceof xt)return{errors:[{file:e,message:r.message}]};throw r}return Wr(t,e,i)}function Wr(t,e,n){let i=t.safeParse(n);return i.success?{data:i.data}:{errors:ar(i.error.issues).map(r=>({file:e,message:r.message,path:r.path,code:r.code}))}}function Tr(t,e,n){let i=t.parseConfigurationObject(n);switch(i.state){case"ok":return{data:i.data};case"error":return{errors:i.errors.map(r=>({file:e,message:r.message??"Unknown error",path:r.path}))}}}var It=class{errors=[];addError(e){this.errors.push(e)}addErrors(e){this.errors.push(...e)}getErrors(e){return e?this.errors.filter(n=>n.file===e):[...this.errors]}isEmpty(){return this.errors.length===0}};async function Ld(t){if(!((await Qe(t)).length>0))throw new v(U`Couldn't find an app toml file at ${D.path(t)}, is this an app directory?`)}async function Md(t,e){let{project:n,activeConfig:i}=await ft(t),r=i.file.content,o=en(n,i.file),s=await Promise.all(o.map(d=>Br(d.path,d.content))),a=s.flatMap(d=>d.errors??[]);if(a.length>0)throw new v(a.map(nn).join(`
|
|
84
|
+
`));let l=s.filter(d=>"web"in d).map(d=>d.web).some(d=>q(d,O.Frontend)||q(d,O.Backend)),p=ie(r);return{isLaunchable:l,scopesArray:p,name:e,directory:n.directory,isEmbedded:l}}async function Br(t,e){let n=await rn(or,t,e);if(n.errors)return{errors:n.errors};let i=n.data,r=new Set("roles"in i?i.roles:[]);"type"in i&&r.add(i.type);let{type:o,...s}={...i,roles:Array.from(r),type:void 0};return{web:{directory:E(t),configuration:s,framework:await Rr(E(t))}}}async function Wd(t){let{project:e,activeConfig:n}=await ft(t.directory,t.userProvidedConfigName,t.skipPrompts?{skipPrompts:!0}:void 0);return on({project:e,activeConfig:n,specifications:t.specifications,remoteFlags:t.remoteFlags,ignoreUnknownExtensions:t.ignoreUnknownExtensions})}async function on(t){let{project:e,activeConfig:n,specifications:i,remoteFlags:r=[],ignoreUnknownExtensions:o,reloadState:s,clientIdOverride:a}=t,c={...n.file.content};a&&(c.client_id=a);let p=rr(i),d=n.file.path,m=$(d),h=await rn(p,d,c);if(h.errors)throw new Ze(d,h.errors);let y=h.data,P=na(e.appConfigFiles,{[m]:y.client_id}),b=!1;try{b=await ta(e.directory,d)}catch{}let w={allClientIdsByConfigName:P,usesLinkedConfig:!0,name:m,gitTracked:b,source:n.source,usesCliManagedUrls:y.build?.automatically_update_urls_on_dev},R={directory:e.directory,configPath:d,configuration:y,configurationLoadResultMetadata:w,clientIdOverride:a,configSchema:p,specifications:i,remoteFlags:r};return new tn({ignoreUnknownExtensions:o,loadedConfiguration:R,project:e,reloadState:s}).loaded()}function Zs(t){return t.access_scopes?.scopes??""}async function Bd(t){try{let{project:e,activeConfig:n}=await ft(t.directory,t.configName,t.skipPrompts?{skipPrompts:!0}:void 0),i=await on({project:e,activeConfig:n,specifications:t.specifications,remoteFlags:t.remoteFlags});return{state:"loaded-app",app:i,configuration:i.configuration,packageManager:e.packageManager}}catch{try{let e=await Ft.load(t.directory),{configurationPath:n}=await ea(e.directory,t.configName),r=(await H.read(n)).content;return{state:"loaded-template",rawConfig:r,scopes:Zs(r),appDirectory:e.directory,packageManager:e.packageManager}}catch{return{state:"error"}}}}async function Vd(t){let{project:e,activeConfig:n}=await ft(t.directory,$(t.configPath)),i={extensionDevUUIDs:new Map(t.allExtensions.map(o=>[o.handle,o.devUUID])),previousDevURLs:t.devApplicationURLs},r=await on({project:e,activeConfig:n,specifications:t.specifications,remoteFlags:t.remoteFlags??[],reloadState:i,clientIdOverride:t.clientIdOverride});if(!r.errors.isEmpty()){let o=r.errors.getErrors();throw new v(U`${D.errorText("Validation errors")}:\n\n${o.map(nn).join(`
|
|
85
|
+
`)}`)}return r}function Jd(t){let e=St(t);return e?`${at.production}.${e}`:at.production}var tn=class{ignoreUnknownExtensions;errors=new It;specifications;remoteFlags;loadedConfiguration;reloadState;project;constructor({ignoreUnknownExtensions:e,loadedConfiguration:n,reloadState:i,project:r}){this.ignoreUnknownExtensions=e??!1,this.specifications=n.specifications,this.remoteFlags=n.remoteFlags,this.loadedConfiguration=n,this.reloadState=i,this.project=r}get activeConfigFile(){let e=this.loadedConfiguration.configPath;return this.project.appConfigFiles.find(n=>n.path===e)}async loaded(){let{configuration:e,directory:n,configPath:i,configurationLoadResultMetadata:r,configSchema:o}=this.loadedConfiguration;await sa(r);let s=pe(this.project,i),a=await this.loadExtensions(n,e),c=e.name,p=e.handle??c??"",d=await fe(this.project,e.client_id);this.reloadState||await Or(n,this.project.nodeDependencies);let{webs:m,usedCustomLayout:h}=await this.loadWebs(n,e.web_directories),y=new ee({name:p,directory:n,configPath:i,configuration:e,clientIdOverride:this.loadedConfiguration.clientIdOverride,webs:m,modules:a,dotenv:s,errors:this.errors,specifications:this.specifications,configSchema:o,remoteFlags:this.remoteFlags,hiddenConfig:d,devApplicationURLs:this.getDevApplicationURLs(e,m)}),P=y.realExtensions.map(b=>b.type);return await Gn(P),await ra(y,this.project.usesWorkspaces,{usedCustomLayoutForWeb:h,usedCustomLayoutForExtensions:e.extension_directories!==void 0}),await y.generateExtensionTypes(),y}async loadWebs(e,n){let i=this.activeConfigFile,r=i?en(this.project,i):this.project.webConfigFiles,o=r.map(p=>p.path),s=await Promise.all(r.map(p=>Br(p.path,p.content))),a=[];for(let p of s)p.errors?this.errors.addErrors(p.errors):a.push(p.web);this.validateWebs(a);let c=o.every(p=>F(e,p).startsWith("web/"));return{webs:a,usedCustomLayout:n!==void 0||!c}}findSpecificationForType(e){return this.specifications.find(n=>n.identifier===e||n.externalIdentifier===e||n.additionalIdentifiers?.includes(e))}validateWebs(e){[O.Backend,O.Frontend].forEach(n=>{let i=e.filter(r=>r.configuration.roles.includes(n));if(i.length>1){let r=i.map(a=>u(a.directory,J.web)),o=r.map(a=>` ${a}`).join(`
|
|
86
|
+
`),s=r[r.length-1];this.errors.addError({file:s,message:`You can only have one "web" configuration file with the ${n} role in your app.
|
|
87
|
+
|
|
88
|
+
Conflicting configurations found at:
|
|
89
|
+
${o}`})}})}async createExtensionInstance(e,n,i,r){let o=this.findSpecificationForType(e),s,a=!1;if(o)a=!0;else{if(this.ignoreUnknownExtensions)return;this.errors.addError({file:i,message:`Invalid extension type "${e}" in "${un(i)}"`});return}let c=Tr(o,i,n);if(c.errors){this.errors.addErrors(c.errors);return}let l=c.data;a&&(s=await this.findEntryPath(r,o));let p=new ue({configuration:l,configurationPath:i,entryPath:s,directory:r,specification:o});if(this.reloadState&&l.handle){let d=this.reloadState.extensionDevUUIDs.get(l.handle);d&&(p.devUUID=d)}if(a){let d=await p.validate();d.isErr()&&this.errors.addError({file:i,message:qn(d.error).trim()})}return p}async loadExtensions(e,n){if(this.specifications.length===0)return[];let i=await this.createExtensionInstances(e),r=await this.createConfigExtensionInstances(e,n),o=this.createWebhookSubscriptionInstances(e,n),s=await Promise.all([...i,...r,...o]),a=st(s.flat()),c=new Set;return a.forEach(l=>{if(l.handle&&c.has(l.handle)){let p=a.filter(m=>m.handle===l.handle),d=pn(p.map(m=>m.name));this.errors.addError({file:l.configurationPath,message:`Duplicated handle "${l.handle}" in extensions ${d}. Handle needs to be unique per extension.`})}else l.handle&&c.add(l.handle)}),a}async createExtensionInstances(e){let n=this.activeConfigFile;return(n?Lr(this.project,n):this.project.extensionConfigFiles).map(async r=>{let o=r.path,s=E(o),a=r.content,c=ti.safeParse(a);if(!c.success)return this.errors.addError({file:o,message:`Invalid extension configuration at ${F(e,o)}`}),[];let{extensions:l,type:p}=c.data;if(l){let d=await rn(ni,o,r.content);if(d.errors)return this.errors.addErrors(d.errors),[];let m=d.data,h=m.extensions.map(async y=>{let P={...m,...y};return P.handle||(this.errors.addError({file:o,message:`Missing handle for extension "${P.name}" at ${F(e,o)}`}),P.handle="unknown-handle"),this.createExtensionInstance(P.type,P,o,s)});return Promise.all(h)}else{if(p)return this.createExtensionInstance(p,a,o,s);this.errors.addError({file:o,message:`Invalid extension type at "${F(e,o)}". Please specify a type.`});return}})}createWebhookSubscriptionInstances(e,n){let i=this.loadedConfiguration.configPath,r=this.findSpecificationForType(Ie);if(!r)return[];let o=Wr(oi,i,n);if(o.errors)return this.errors.addErrors(o.errors),[];let{api_version:s,subscriptions:a=[]}=o.data.webhooks;return st(a.flatMap(p=>{let{uri:d,topics:m,compliance_topics:h,...y}=p;return m?.map(P=>({api_version:s,uri:d,topic:P,...y}))})).map(async p=>{let d=await this.createExtensionInstance(r.identifier,p,i,e);return d?.resolveUIDWithApplicationUrl(n.application_url),d})}async createConfigExtensionInstances(e,n){let i=this.loadedConfiguration.configPath,r=await Promise.all(this.specifications.filter(s=>ii(s)).filter(s=>s.identifier!==Ie).map(async s=>{let a=Tr(s,i,n);if(a.errors)return this.errors.addErrors(a.errors),[[],[]];let c=a.data;if(Object.keys(c).length===0)return[[],Object.keys(c)];let l=s.expandConfig?.(c,{flags:this.remoteFlags})??[c];return[await Promise.all(l.map(async d=>{let m=await this.createExtensionInstance(s.identifier,d,i,e);return this.validateConfigurationExtensionInstance(n.client_id,n,m)})),Object.keys(c)]})),o=Object.keys(n).filter(s=>!r.some(([a,c])=>c.includes(s))).filter(s=>![...Object.keys(ne.shape),"organization_id"].includes(s));return o.length>0&&!this.ignoreUnknownExtensions&&this.errors.addError({file:i,message:`Unsupported section(s) in app configuration: ${o.sort().join(", ")}`}),st(r.flatMap(([s])=>s))}async validateConfigurationExtensionInstance(e,n,i){return i&&await i.deployConfig({apiKey:e,appConfiguration:n})?i:void 0}async findEntryPath(e,n){let i;return n.appModuleFeatures().includes("single_js_entry_path")?(i=(await Promise.all(["index"].flatMap(r=>[`${r}.js`,`${r}.jsx`,`${r}.ts`,`${r}.tsx`]).flatMap(r=>[`src/${r}`,r]).map(r=>u(e,r)).map(async r=>await x(r)?r:void 0))).find(r=>r!==void 0),i||this.errors.addError({file:e,message:`Couldn't find an index.{js,jsx,ts,tsx} file in the directories ${e} or ${u(e,"src")}`})):n.identifier==="function"&&(i=(await Promise.all(["src/index.js","src/index.ts","src/main.rs"].map(r=>u(e,r)).map(async r=>await x(r)?r:void 0))).find(r=>r!==void 0)),i}getDevApplicationURLs(e,n){let i=this.reloadState?.previousDevURLs;return i&&Ir(i.applicationUrl,n.map(({configuration:r})=>r.auth_callback_path).find(r=>r),e.app_proxy)}};async function ft(t,e,n){let i=await Ft.load(t),r=await jr(i,e,n);return{project:i,activeConfig:r}}async function ta(t,e){let n=u(t,".gitignore");if(!L(n))return!0;let i=await N(n),r=Mr.default.default().add(i),o=F(t,e);return!r.ignores(o)}async function ea(t,e){let n=rt(e),i=u(t,n);if(await x(i))return{configurationPath:i,configurationFileName:n};throw new v(U`Couldn't find ${n} in ${D.path(t)}.`)}function na(t,e){let n=t.map(i=>{let r=$(i.path);if(e[r]!==void 0&&typeof e[r]=="string")return[r,e[r]];let o=i.content.client_id;if(typeof o=="string"&&o!=="")return[r,o]}).filter(i=>i!==void 0);return Object.fromEntries(n)}async function ia(t){let e=t.filter(a=>q(a,O.Backend)),n=t.filter(a=>q(a,O.Frontend));if(e.length>1){_("Unable to decide project type as multiple web backends");return}else{if(e.length===0&&n.length>0)return"frontend";if(!e[0]){_("Unable to decide project type as no web backend");return}}let{directory:i}=e[0],r=u(i,"package.json"),o=u(i,"Gemfile"),s=u(i,"composer.json");if(await x(r))return"node";if(await x(o))return"ruby";if(await x(s))return"php"}function q(t,e){return t.configuration.roles.includes(e)}async function ra(t,e,n){let i=t.webs,r=t.allExtensions.filter(l=>l.isSentToMetrics()),o=t.name,s=t.directory,a=t.configuration.client_id,c=ie(t.configuration).sort();await oa(i,r,n,o,s,a,c,e)}async function oa(t,e,n,i,r,o,s,a){await qt.addPublicMetadata(async()=>{let c=await ia(t),l=e.filter(w=>w.isFunctionExtension).length,p=e.filter(w=>w.isESBuildExtension).length,d=e.filter(w=>w.isThemeExtension).length,m=e.length,h=t.filter(w=>q(w,O.Backend)).length,y=h===1?t.find(w=>q(w,O.Backend))?.framework:void 0,P=t.filter(w=>q(w,O.Frontend)).length,b={};for(let w of e)b[w.type]===void 0?b[w.type]=1:b[w.type]++;return{api_key:o,project_type:c,app_extensions_any:m>0,app_extensions_breakdown:JSON.stringify(b),app_extensions_count:m,app_extensions_custom_layout:n.usedCustomLayoutForExtensions,app_extensions_function_any:l>0,app_extensions_function_count:l,app_extensions_theme_any:d>0,app_extensions_theme_count:d,app_extensions_ui_any:p>0,app_extensions_ui_count:p,app_name_hash:wt(i),app_path_hash:wt(r),app_scopes:JSON.stringify(s),app_web_backend_any:h>0,app_web_backend_count:h,app_web_custom_layout:n.usedCustomLayoutForWeb,app_web_framework:y,app_web_frontend_any:P>0,app_web_frontend_count:P,env_package_manager_workspaces:a}}),await qt.addSensitiveMetadata(async()=>({app_name:i}))}async function sa(t){await qt.addPublicMetadata(async()=>({cmd_app_all_configs_any:Object.keys(t.allClientIdsByConfigName).length>0,cmd_app_all_configs_clients:JSON.stringify(t.allClientIdsByConfigName),cmd_app_linked_config_used:t.usesLinkedConfig,...t.usesLinkedConfig?{cmd_app_linked_config_name:t.name,cmd_app_linked_config_git_tracked:t.gitTracked,cmd_app_linked_config_source:t.source,cmd_app_linked_config_uses_cli_managed_urls:t.usesCliManagedUrls}:{}}))}f();var aa="project.json";async function sn(t){let e=await Xn(t),n=u(e,aa);return await x(n)||await T(n,JSON.stringify({})),n}function pe(t,e){let n=St(e);if(n){let i=`${at.production}.${n}`;return t.dotenvFiles.get(i)}return t.dotenvFiles.get(at.production)}async function fe(t,e){if(!e||typeof e!="string")return{};await sn(t.directory);let n=t.hiddenConfigRaw,i=n[e];if(i&&typeof i=="object")return i;if(typeof n.dev_store_url=="string"){try{let r=await sn(t.directory);await te(r,e,{dev_store_url:n.dev_store_url})}catch{}return{dev_store_url:n.dev_store_url}}return{}}function Lr(t,e){let n=e.content.extension_directories,r=(Array.isArray(n)&&n.length>0?n:["extensions/*"]).map(o=>`${o}/*.extension.toml`);return t.extensionConfigFiles.filter(o=>{let s=F(t.directory,o.path).replace(/\\/g,"/");return r.some(a=>Nt(s,a))})}function en(t,e){let n=e.content.web_directories;if(!Array.isArray(n)||n.length===0)return t.webConfigFiles;let i=n.map(r=>`${r}/shopify.web.toml`);return t.webConfigFiles.filter(r=>{let o=F(t.directory,r.path).replace(/\\/g,"/");return i.some(s=>Nt(o,s))})}function oh(t,e){let n=e.content.extension_directories,i=(Array.isArray(n)&&n.length>0?n:["extensions/*"]).map(a=>`${a}/*.extension.toml`),r=e.content.web_directories,o=Array.isArray(r)&&r.length>0?r.map(a=>`${a}/shopify.web.toml`):["**/shopify.web.toml"],s=[...i,...o];return t.errors.filter(a=>{if(a.path===e.path)return!0;let c=F(t.directory,a.path).replace(/\\/g,"/");return s.some(l=>Nt(c,l))})}export{Ae as a,xa as b,it as c,Do as d,Ct as e,Ni as f,hc as g,$t as h,hu as i,us as j,O as k,ju as l,ds as m,rt as n,St as o,G as p,ze as q,Re as r,vc as s,Hi as t,Op as u,Qe as v,Sr as w,Xt as x,Zt as y,gf as z,Ir as A,yf as B,wf as C,bf as D,Ft as E,Be as F,Lr as G,en as H,oh as I,Ar as J,kr as K,qs as L,zs as M,jr as N,Ze as O,nn as P,Ld as Q,Md as R,Wd as S,on as T,Bd as U,Vd as V,Jd as W,ft as X,q as Y,Fr as Z,Kp as _,Yp as $,Qp as aa,Xp as ba,Zp as ca,tf as da,ef as ea,nf as fa,rf as ga};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-U5BKU3OL.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();async function l(e){await i.addPublicMetadata(()=>e)}t();function c(e,n){return`${e} ${e===1?n:`${n}s`}`}function f(e){return e.length===1?String(e[0]):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function u(e){return`${c(e.withFindings,"check")} with findings`}function s(e,n){let d=e.passed-n;return[d>0?`${d} passed`:void 0,n>0?`${n} with no deterministic findings`:void 0,e.notApplicable>0?`${e.notApplicable} not applicable`:void 0,e.unresolved>0?`${e.unresolved} unresolved`:void 0].filter(a=>a!==void 0)}export{l as a,c as b,f as c,u as d,s as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,c as D,d as _,e as H}from"./chunk-ZLITAXPT.js";import{c as T,e as w,h as E}from"./chunk-7HECBXSP.js";import{g as R,p as j,v as x}from"./chunk-VVHJ2AUF.js";import{e as v}from"./chunk-CE6XQDAG.js";import{b as O,c as F}from"./chunk-IKXUYCK7.js";import{x as y}from"./chunk-7A4ZE5IS.js";import{Eb as p,vb as l,zb as u}from"./chunk-OIQ5NQ5I.js";import{b as o}from"./chunk-3PYDIBTX.js";import{b as q}from"./chunk-VBPMVVLV.js";import{e as P,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function I(e,t){let n=t.storeFqdn,s=new H({...f.reduce((h,a)=>(h[a]=e.role===a,h),{}),theme:e.id?.toString()??e.name}),m=!!e.json,i=await D(t,{allowEmpty:m});return s.any()&&(i=_(n,i,s,{allowEmpty:m})),i}r();r();var W=o.object({id:o.number(),name:o.string(),processing:o.boolean(),createdAtRuntime:o.boolean(),role:o.string()}),Y=o.array(W),c=w({name:"ThemeListResult",schema:o.object({themes:o.array(T.extend({processing:o.boolean()}).strict())}).strict().describe("The complete theme library after applying the requested filters."),definitions:{Theme:T},project(e){return{themes:Y.parse(e).map(t=>({...E(t),processing:t.processing}))}}});r();var A;function L(){return A??=new v({projectName:"shopify-cli-host-theme-conf"}),A}function $(e){return p(l`Getting host theme...`),L().get(e)}function Z(e,t){p(l`Setting host theme...`),L().set(e,t)}function ee(e){p(l`Removing host theme...`),L().delete(e)}function C(e,t){return{title:e,body:{tabularData:t}}}function G(e,t,n){if(t==="json"){u(c.encode(e));return}let s=R(),m=$(n.store),i=e.map(({id:a,name:J,role:b})=>{let g="";return b&&(g=`[${b}]`,[s,m].includes(`${a}`)&&(g+=" [current]")),[J,g,`#${a}`]}),h=[["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"],...i];y({customSections:[...n.environment?[{title:`${n.store} theme library`,body:[{subdued:`Environment name: ${n.environment}`}]}]:[],C("",h)]})}var d=P(q(),1);var S=class extends x{static jsonOutputSchema=c;static descriptionWithMarkdown="Lists the themes in your store, along with their IDs and statuses.";static description=this.descriptionForHelp();static flags={...O,...F,...j,role:d.Flags.custom({description:"Only list themes with the given role.",options:f,env:"SHOPIFY_FLAG_ROLE"})(),name:d.Flags.string({description:"Only list themes that contain the given name.",env:"SHOPIFY_FLAG_NAME"}),id:d.Flags.integer({description:"Only list theme with the given ID.",env:"SHOPIFY_FLAG_ID"})};static multiEnvironmentsFlags=["store","password"];async command(t,n,s=!1){let m=await I(t,n);if(t.json&&s)return m;G(m,t.json?"json":"text",{store:n.storeFqdn,environment:t.environment})}renderEnvironmentResults(t){u(c.encode({environments:t}))}};export{$ as a,Z as b,ee as c,S as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as t,b as p,d as h}from"./chunk-KORVOCNN.js";import{p as f,v as c}from"./chunk-VVHJ2AUF.js";import{b as d,c as l}from"./chunk-IKXUYCK7.js";import{j as a}from"./chunk-FJOVMEPN.js";import{zb as m}from"./chunk-OIQ5NQ5I.js";import{j as n}from"./chunk-3PYDIBTX.js";import{b as v}from"./chunk-VBPMVVLV.js";import{e as F,g as s}from"./chunk-VKWPEFWQ.js";s();var u=F(v(),1),i=class extends c{static jsonOutputSchema=t;static summary="Download metafields definitions from your shop into a local file.";static descriptionWithMarkdown=`Retrieves metafields from Shopify Admin.
|
|
2
|
+
|
|
3
|
+
If the metafields file already exists, it will be overwritten.`;static description=this.descriptionForHelp();static flags={...d,...l,...f,force:u.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=null;async command(e,b,w=!1){let y={path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"]},o=await h(y);if(o.status==="failed"){let r=new a("Failed to fetch metafield definitions.","Check your connection and permissions, then try again.");throw r.details={failedOwnerTypes:o.failedOwnerTypes},r}return o.status==="downloaded"&&o.failedOwnerTypes.length>0&&(process.exitCode=1,e.json&&n({type:"diagnostic",level:"error",message:`Failed to fetch metafield definitions for: ${o.failedOwnerTypes.join(", ")}.`})),(!w||!e.json)&&p(o,e.json?"json":"text"),o}renderEnvironmentResults(e){m(t.encode({environments:e}))}};export{i as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as j}from"./chunk-R5COVIJM.js";import{a as D}from"./chunk-K4KKSBUW.js";import{E as u,F as _,P as L}from"./chunk-7FBOMPO5.js";import{b as $,c as P}from"./chunk-IKXUYCK7.js";import{y as R,z as A}from"./chunk-7A4ZE5IS.js";import{a as S}from"./chunk-LG3KEHGD.js";import{j as a}from"./chunk-FJOVMEPN.js";import{Sa as O,ab as v,ta as E,va as N,zb as F}from"./chunk-OIQ5NQ5I.js";import{b as s}from"./chunk-3PYDIBTX.js";import{b as X}from"./chunk-VBPMVVLV.js";import{c as m,e as w,f,h as T,i as C}from"./chunk-IWTNUJGY.js";import{e as z,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();async function k({remoteApp:t,developerPlatformClient:e}){let n=await e.channelSpecExport(t);if(n.status===404)throw new a("The channel spec export endpoint is not available for this app.","Check that the app and organization are correct.");if(!n.ok){let r=typeof n.body?.reason=="string"?n.body.reason:void 0;if(n.status===426)throw new a(`Failed to fetch the channel spec export: ${r??"This version of the Shopify CLI is no longer supported."}`,"Upgrade the Shopify CLI and try again.");if(n.status===422)return{success:!1,reason:r??`http_${n.status}`};throw n.status===401||n.status===403?new a(`Failed to fetch the channel spec export: authentication failed (status ${n.status}).`,"Run `shopify auth logout` and try again."):new a(`Failed to fetch the channel spec export: the server responded with status ${n.status}.`,"Try again in a moment.")}let{handle:i,filename:p,toml:o,warnings:h}=n.body;if(typeof i!="string"||typeof p!="string"||typeof o!="string")throw new a("Failed to fetch the channel spec export: the response was missing required fields.");return{success:!0,handle:i,filename:p,toml:o,warnings:B(h)}}function B(t){return Array.isArray(t)?t.flatMap(e=>e&&typeof e=="object"&&typeof e.code=="string"&&typeof e.message=="string"?[e]:[]):[]}c();var M=s.object({code:s.string(),message:s.string()}).strict(),d=S({name:"ImportChannelConfigResult",schema:s.object({status:s.literal("success"),handle:s.string().min(1),filename:s.string().min(1),path:s.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/,"The path must be absolute.").describe("Absolute path of the written TOML file."),toml:s.string().describe("Native channel_config TOML content, unchanged from the export."),warnings:s.array(M).describe("Warnings returned with the channel spec export.")}).strict(),definitions:{ChannelSpecExportWarning:M}});var g=m("extensions","channel-config"),he=m(g,_),x="shopify.extension.toml",G=`name = "Channel config"
|
|
2
|
+
type = "${u}"
|
|
3
|
+
handle = "channel-config"
|
|
4
|
+
`,U=["extensions/*"],q={no_exportable_frozen_record:"This app doesn't have a channel spec that can be exported yet.",multiple_exportable_records:"This app has more than one channel spec, so it can't be exported automatically.",not_allowlisted:"This app isn't part of the channel spec export prototype yet.",contains_no_public_fields:"This app's channel spec has no public channel_config fields.",invalid_public_schema:"This app's channel spec doesn't match the public channel_config schema."};async function H(t){let{app:e,remoteApp:n,developerPlatformClient:i,force:p}=t,o=await k({remoteApp:n,developerPlatformClient:i});if(!o.success){let y=q[o.reason];throw y?new a(y):new a(`The channel spec for this app could not be exported (reason: ${o.reason}).`)}let{extensionDirectory:h,createExtension:r}=Z(e),l=w(h,_,C(o.filename));if(!p&&await O(l))throw new a(`A channel spec already exists at ${f(e.directory,l)}.`,"Re-run with `--force` to replace it.");let I=d.validate({status:"success",handle:o.handle,filename:C(o.filename),path:l,toml:o.toml,warnings:o.warnings.map(({code:y,message:Y})=>({code:y,message:Y}))});return await N(T(l)),r&&await E(m(h,x),G),await E(l,I.toml),{...I,extensionConfigurationPath:r?w(h,x):null}}function Z(t){let e=t.allExtensions.filter(r=>r.type===u);if(e.length>1){let r=e.map(l=>f(t.directory,l.directory)).join(", ");throw new a(`This app has more than one ${u} extension (${r}).`,"Only one is allowed. Remove the extras and try again.")}if(e.length===1)return{extensionDirectory:e[0].directory,createExtension:!1};let n=t.configuration.extension_directories,i=n&&n.length>0?n:U;if(!i.some(r=>v(`${g}/${x}`,`${r}/*.extension.toml`)))throw new a(`Your shopify.app.toml only loads extensions from ${i.join(", ")}, so a new extension at ${g} wouldn't be deployed.`,`Create a ${u} extension in one of those directories with a ${x} like:
|
|
5
|
+
|
|
6
|
+
${G}
|
|
7
|
+
then re-run this command.`);let o=m(t.directory,g),h=t.allExtensions.find(r=>r.directory===o);if(h)throw new a(`${g} already contains a ${h.type} extension.`,"Move that extension to another directory, then re-run this command.");return{extensionDirectory:o,createExtension:!0}}c();function W(t,e,n){if(t.warnings.forEach(i=>A({body:i.message})),n==="json"){F(d.encode({status:t.status,handle:t.handle,filename:t.filename,path:t.path,toml:t.toml,warnings:t.warnings.map(({code:i,message:p})=>({code:i,message:p}))}));return}R({headline:["Imported the channel spec for",{userInput:e.name},{char:"."}],body:["The spec was written to",{filePath:f(e.directory,t.path)},{char:"."},...t.extensionConfigurationPath?["Also created",{filePath:f(e.directory,t.extensionConfigurationPath)},"so the spec is included when your app is deployed."]:[]],nextSteps:["Review the generated spec and make any changes your channel needs.",["Run",{command:"shopify app dev"},"to try the spec on a development store before releasing it."],["Run",{command:"shopify app deploy"},"to deploy the spec as part of your app."]]})}var J=z(X(),1);var b=class t extends j{static hidden=!0;static summary="Import your app's default channel spec as a channel_config extension.";static descriptionWithMarkdown="Imports the Shopify-authored channel spec for your app as a `channel_config` extension.\n\n The generated TOML only includes public `channel_config` fields. Review it, then deploy it with `shopify app deploy`.";static jsonOutputSchema=d;static description=this.descriptionForHelp();static flags={...$,...D,...P,force:J.Flags.boolean({description:"Overwrite the existing channel spec file without prompting.",env:"SHOPIFY_FLAG_FORCE",default:!1})};async run(){let{flags:e}=await this.parse(t),{app:n,remoteApp:i,developerPlatformClient:p}=await L({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),o=await H({app:n,remoteApp:i,developerPlatformClient:p,force:e.force});return W(o,{directory:n.directory,name:i.title},e.json?"json":"text"),{app:n}}};export{b as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as o}from"./chunk-7FBOMPO5.js";import{c as i,h as n}from"./chunk-4KBOLN7Q.js";import{j as r}from"./chunk-4LJERO23.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function l(S,e,c){await o(e,c.source);let t=await i(e);return t||n(),{variables:[{name:"SHOPIFY_API_KEY",value:e.apiKey,isSecret:!1},t?{name:"SHOPIFY_API_SECRET",value:t,isSecret:!0}:{name:"SHOPIFY_API_SECRET",isSecret:!0},{name:"SCOPES",value:r(S.configuration),isSecret:!1}]}}export{l as a};
|