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
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as gt}from"./chunk-IILLQOUC.js";import{a as ht,b as Dr}from"./chunk-SIL6HPMK.js";import"./chunk-LQ7ENG4V.js";import"./chunk-UUAKOX7E.js";import{a as En}from"./chunk-UV5GAGAD.js";import{a as fn}from"./chunk-7GUMJ5E4.js";import{a as hn}from"./chunk-Y6J46XYF.js";import{a as gn}from"./chunk-VQA3X7O3.js";import{a as Sn}from"./chunk-VZCMJRYV.js";import{a as yn}from"./chunk-ACZNWIRY.js";import"./chunk-QEKGGTMN.js";import"./chunk-62EOM3Y2.js";import"./chunk-J5ERDFIC.js";import"./chunk-PDZBKVWL.js";import{a as wn}from"./chunk-UY6W2EVZ.js";import{a as kn}from"./chunk-ZBL7XMJ6.js";import{a as Br}from"./chunk-4WYKPIN3.js";import{a as dn}from"./chunk-7NFTSBHQ.js";import{a as Qr}from"./chunk-WCC52MR2.js";import{a as ln}from"./chunk-R4UVIYZP.js";import{a as Mr}from"./chunk-GVI3DWSB.js";import{a as Gr}from"./chunk-HTRJU4R4.js";import{a as Jr}from"./chunk-34MOWGRL.js";import"./chunk-JPWRZ5SL.js";import{a as Vr}from"./chunk-IHMATNOR.js";import{a as Wr}from"./chunk-Q2KWXZQB.js";import"./chunk-V75WUEFU.js";import"./chunk-HB3MJYBK.js";import"./chunk-X5NIAZA4.js";import"./chunk-66TMIQMB.js";import"./chunk-W56ZGEQQ.js";import{a as sn}from"./chunk-LGXI7EGM.js";import{a as Cr,b as Pr,c as en}from"./chunk-B3ZJGYZY.js";import{a as In}from"./chunk-WESTVWWD.js";import{a as un}from"./chunk-ISKQQXLZ.js";import"./chunk-PLSS456F.js";import{a as On}from"./chunk-UPPO3BMT.js";import{a as Tn}from"./chunk-XUHGWIWW.js";import{a as cn}from"./chunk-3MG4MTWQ.js";import{a as pn}from"./chunk-M2CWCOFU.js";import{a as Kr}from"./chunk-74NRFUGQ.js";import"./chunk-67L7FIB6.js";import{a as Zr}from"./chunk-RW6G4ZPU.js";import{a as tn}from"./chunk-EKFPTBXC.js";import{a as xn}from"./chunk-AXL2VIWA.js";import{a as on}from"./chunk-BWN2QG6D.js";import{a as rn}from"./chunk-I7PEEJVH.js";import"./chunk-EAZIQI2D.js";import{a as nn}from"./chunk-ZGBTO46A.js";import{a as an}from"./chunk-5AEZJZNQ.js";import"./chunk-S4LOWCGS.js";import{a as $r}from"./chunk-224UPIYS.js";import{a as zr}from"./chunk-OR4IJ4BQ.js";import{a as Ur}from"./chunk-X2PFXSU4.js";import{a as mn}from"./chunk-QFSENE5T.js";import{a as Hr}from"./chunk-SLY27GDC.js";import"./chunk-QF5WKTPD.js";import{a as ft,b as jr}from"./chunk-L5TSPCSY.js";import"./chunk-UOHNRH6E.js";import{a as Ea}from"./chunk-PF53E2DC.js";import"./chunk-DLVB3237.js";import"./chunk-AQKWPRZE.js";import"./chunk-UBP3LQFY.js";import{h as _a}from"./chunk-SHD4VV5V.js";import"./chunk-UXVXVI6O.js";import"./chunk-OJULL7HT.js";import"./chunk-OMPQ7REW.js";import"./chunk-KNWT7JLL.js";import"./chunk-QDCLL5OI.js";import"./chunk-2ZBXHCQZ.js";import"./chunk-RPCIFYCY.js";import"./chunk-AQ6EVL73.js";import"./chunk-5ED7SOQZ.js";import"./chunk-MXEXP3HT.js";import"./chunk-2WJOTJOD.js";import"./chunk-HF4NDEX3.js";import"./chunk-FEBOZ2XX.js";import"./chunk-J3JPJCWP.js";import"./chunk-MEYVUHQH.js";import"./chunk-MADINS4Z.js";import"./chunk-USXIXANP.js";import"./chunk-JLGA3B7P.js";import"./chunk-TFPW2VGN.js";import"./chunk-IJY3RJPJ.js";import"./chunk-XBMD3FEZ.js";import"./chunk-6PUU6ZNQ.js";import"./chunk-PWAT52M4.js";import"./chunk-QW52RPAU.js";import"./chunk-2A2JSAAA.js";import"./chunk-CGVROSPS.js";import"./chunk-IHXGZW42.js";import"./chunk-YY6TFARF.js";import"./chunk-2L6AN3QA.js";import{b as Ia}from"./chunk-3JSKNXL7.js";import"./chunk-QFWWCZOI.js";import"./chunk-H6GYBLVQ.js";import"./chunk-WBVS5NBV.js";import{a as j,b as mr,c as Y,d as ge,e as Se}from"./chunk-YKMINHYY.js";import"./chunk-Z2WAW6MM.js";import"./chunk-KZRLZWOU.js";import"./chunk-SACNUF4I.js";import"./chunk-PTSCGSQV.js";import"./chunk-W37IFK3P.js";import"./chunk-H6GNKWYM.js";import"./chunk-Q7BOSHWX.js";import"./chunk-P4VZYOKO.js";import"./chunk-C3RFAKWR.js";import"./chunk-ZOOT3GBY.js";import"./chunk-MGHPF7HU.js";import"./chunk-HXZAY5OA.js";import"./chunk-2T4HDR6R.js";import"./chunk-UWHAOGO4.js";import"./chunk-ZI7LK3LW.js";import"./chunk-ACA2BGAD.js";import"./chunk-26PWHH3B.js";import{a as An}from"./chunk-E5COIKGY.js";import{a as Yr}from"./chunk-CYEEGTVZ.js";import"./chunk-FKIVKNOV.js";import"./chunk-XLIJYJ6Q.js";import"./chunk-7GHSE7SG.js";import{a as ur}from"./chunk-WSDKCQH6.js";import{a as pr}from"./chunk-CCUQM4FX.js";import{a as dr}from"./chunk-VAVXDIUX.js";import"./chunk-XWSWXQCC.js";import{a as er}from"./chunk-35XFNKNB.js";import{a as Lr}from"./chunk-P2RMFHQP.js";import"./chunk-VGSH52JM.js";import"./chunk-7CCTPBCT.js";import{a as Rr}from"./chunk-DN6X7SHW.js";import{a as Xr}from"./chunk-4KECSZTL.js";import{a as qr}from"./chunk-DBDTE3EE.js";import"./chunk-CLUUA3HX.js";import"./chunk-AUE7LM32.js";import{a as se,b as lr,c as ye,e as we,f as Pe,g as fr,h as hr,i as gr,j as Sr,k as yr,l as wr,m as dt,n as kr,o as br,p as vr,q as Ar,r as xr,s as ro}from"./chunk-DZKFP6H2.js";import"./chunk-J55GQLP4.js";import"./chunk-VHZ6RL67.js";import"./chunk-3MYDSQHF.js";import"./chunk-NVKJ7ZLP.js";import{a as rr}from"./chunk-B2O3ANRZ.js";import{a as Zo}from"./chunk-QEVTBD33.js";import{a as Qo}from"./chunk-UKWIWCOH.js";import{a as Xo}from"./chunk-3Z3MADXZ.js";import"./chunk-64G5TGFF.js";import{a as Yo}from"./chunk-ER6C5WS3.js";import"./chunk-TAWCKJKP.js";import"./chunk-VUMUCNI7.js";import{a as Ko}from"./chunk-SNH4XZ6E.js";import"./chunk-Y55T4IIQ.js";import{a as sr}from"./chunk-WRZWHT6M.js";import{a as ar}from"./chunk-S5P7KWY4.js";import"./chunk-XDVPIGXE.js";import{a as Mo}from"./chunk-27NXPOAS.js";import"./chunk-K7ZSPQKL.js";import"./chunk-U6YOP562.js";import{a as Ho}from"./chunk-E6RONHMT.js";import{a as Vo}from"./chunk-3XRI3D44.js";import{a as Jo}from"./chunk-2MT3LSMZ.js";import{a as cr}from"./chunk-Q4JYAUVL.js";import{a as Wo}from"./chunk-RPVZ2JON.js";import{a as tr}from"./chunk-ZRI3SSLG.js";import{a as or}from"./chunk-VEUKT5EI.js";import"./chunk-BAHIL37I.js";import{a as bn}from"./chunk-EEY4FKAW.js";import"./chunk-U2T5HPRD.js";import"./chunk-6ES4KRFW.js";import"./chunk-YLQ3LNNY.js";import{a as V,b as K,d as Or,e as Tr,f as mt,g as Ir,h as Er,i as lt,k as no,l as A,m as ce,n as io,o as ao,p as _r,q as Nr,r as Fr}from"./chunk-33ZE3DRQ.js";import"./chunk-YV2TP44L.js";import"./chunk-RLNIOJH3.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import{e as ae}from"./chunk-SK7EPN6C.js";import"./chunk-VJEKDBGZ.js";import"./chunk-TODZ3TJR.js";import"./chunk-Y5CVX5LJ.js";import"./chunk-T4XJKM6B.js";import{a as vn}from"./chunk-3ODQKAEA.js";import"./chunk-N57Y7THE.js";import{a as Pa}from"./chunk-YSWVYPWR.js";import{d as Ca}from"./chunk-URXM5A2K.js";import{a as nr}from"./chunk-GNCVDN7U.js";import{a as jo}from"./chunk-LUGMXSRI.js";import{a as Go}from"./chunk-SB27UOXX.js";import{a as ir,b as Ta}from"./chunk-I4CEH7AK.js";import"./chunk-Q5IC3IYY.js";import{c as St,d as Fa}from"./chunk-UYELAINQ.js";import{b as Q}from"./chunk-ZJOX5HW4.js";import"./chunk-LFOBYEWG.js";import{C as z,D as re,E as q,O as B,P as it,Q as le,b as Oa,fa as fe,ha as ne,j as Kt,k as Xt,ma as eo,q as Zt,u as _}from"./chunk-GQLNG537.js";import"./chunk-ZDF5N422.js";import"./chunk-QQJNQNKP.js";import"./chunk-MPW2YJWU.js";import{e as Fo}from"./chunk-MHR5OHT5.js";import{a as Jt}from"./chunk-HSKDFEXW.js";import"./chunk-F3CK3EJJ.js";import{a as zo,b as y,c as w,e as Bo,f as pt}from"./chunk-3KM5ZOW2.js";import"./chunk-T7KHS6RF.js";import{A as I,B as ie,C as W,G as Do,H as he,J as H,L as Lo,N as st,O as ct,U as qo,W as ut,_ as $o,a as No,z as T}from"./chunk-D2KIGKBI.js";import"./chunk-7Y7AZRL3.js";import"./chunk-LEHBZKK3.js";import"./chunk-GW7YIJPJ.js";import"./chunk-5HBIIYSK.js";import"./chunk-GB3YC4TI.js";import{b as _o,d as nt}from"./chunk-335BUVBP.js";import"./chunk-YRHFPXC3.js";import{a as x}from"./chunk-BN7ZXAZJ.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import{d as Co,e as Po}from"./chunk-CXI3RHPW.js";import{h as c,j as Ro,k as J}from"./chunk-M5VIFG2V.js";import{a as ke,b as Na}from"./chunk-WBJ6ZHYH.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-5IDJALJH.js";import"./chunk-NXAEBGMO.js";import{Ab as Uo,Bb as f,Cb as to,Db as oo,N as Io,Sa as Ce,V as Eo,Z as oe,ba as Qt,ga as Yt,la as Ne,qb as u,sb as d,ta as Fe,wb as S,yb as P}from"./chunk-JLQRDFR5.js";import{i as at}from"./chunk-B4OMIONW.js";import"./chunk-BOAGJ6P5.js";import"./chunk-5B76DT7X.js";import"./chunk-JJZNUFPD.js";import{b as s,c as Vt,d as Wt}from"./chunk-FZCGRIOM.js";import"./chunk-LHXFTFFM.js";import{b as To}from"./chunk-43R5VGKT.js";import"./chunk-ZDQO6CNY.js";import{b as M}from"./chunk-YTUUU33R.js";import"./chunk-JD5P5RAJ.js";import{e as G}from"./chunk-IWTNUJGY.js";import"./chunk-QFYLJVJW.js";import"./chunk-ZGASBRSQ.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-IGE4Y5SE.js";import"./chunk-JFBCE4HN.js";import{e as R,g as n}from"./chunk-VKWPEFWQ.js";n();var xa=R(Ta(),1);n();n();n();n();function so(e){return mr(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}n();var Da=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function yt(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Da.format(t)}function wt(e){let t=z(e);if(t)return t.split(".")[0]}function _n(){let e=so().map(t=>({subdomain:wt(t.store)??t.store,connected:yt(t.acquiredAt),store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}}));return{sessions:e,...e.length===0?{message:La()}:{}}}function La(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
|
|
2
|
-
`)}n();n();n();var
|
|
1
|
+
import{a as gt}from"./chunk-CKJXJ6HD.js";import{a as St,b as qr}from"./chunk-WDXDT7XY.js";import"./chunk-LQ7ENG4V.js";import"./chunk-MGZK5EQW.js";import{a as Fn}from"./chunk-AXFEIJC7.js";import{a as gn}from"./chunk-NOWM3CCG.js";import{a as yn}from"./chunk-YTC367JI.js";import{a as wn}from"./chunk-FI5TQHUA.js";import{a as kn}from"./chunk-GFVUWVEM.js";import{a as bn}from"./chunk-FIKZQ4RA.js";import"./chunk-HT5JQJMB.js";import"./chunk-CZYQIWNL.js";import"./chunk-5S2P4MHJ.js";import"./chunk-6B5KM3A4.js";import{a as vn}from"./chunk-KRQCQ57O.js";import{a as An}from"./chunk-Z2FGYMJ6.js";import{a as Mr}from"./chunk-QU3USVKT.js";import{a as fn}from"./chunk-DA5RQFXA.js";import{a as Xr}from"./chunk-E6JEBSHZ.js";import{a as Sn}from"./chunk-XVJRGOJA.js";import{a as Vr}from"./chunk-ZRM7ESSS.js";import{a as Wr}from"./chunk-5PVXLQNX.js";import{a as Qr}from"./chunk-E7XCCLQH.js";import"./chunk-3GL3IT4K.js";import{a as Yr}from"./chunk-C2AOCLEZ.js";import{a as Kr}from"./chunk-ZC3EDADH.js";import"./chunk-SUTSCIXU.js";import"./chunk-4M5WHOZW.js";import"./chunk-43C32FUQ.js";import"./chunk-SBX7CMHM.js";import"./chunk-NAQJMRPT.js";import{a as pn}from"./chunk-DNNTAMC5.js";import{a as Dr,b as Lr,c as Rr,d as rn}from"./chunk-ONNUEQGR.js";import{a as Nn}from"./chunk-GABIWYY3.js";import{a as mn}from"./chunk-GHNSXX7R.js";import"./chunk-DKR7562G.js";import{a as En}from"./chunk-55AWBPKU.js";import{a as _n}from"./chunk-EEYXBKR7.js";import{a as dn}from"./chunk-HQFXVVTB.js";import{a as ln}from"./chunk-5EDA7PVE.js";import{a as en}from"./chunk-ADGE7MKB.js";import"./chunk-OGBMFGYC.js";import{a as on}from"./chunk-IVQN2RUP.js";import{a as nn}from"./chunk-DUPQUQ2Z.js";import{a as Tn}from"./chunk-YGN65N6W.js";import{a as an}from"./chunk-CCLU5ZRK.js";import{a as sn}from"./chunk-422BGHXN.js";import"./chunk-QDMTJKQ3.js";import{a as cn}from"./chunk-SNRGS3YU.js";import{a as un}from"./chunk-AEWRZ7AE.js";import"./chunk-PIU3GVJ4.js";import{a as Br}from"./chunk-E6KNAPIY.js";import{a as Hr}from"./chunk-6LCESSY3.js";import{a as jr}from"./chunk-XKNDU62O.js";import{a as hn}from"./chunk-ZNEQZV5K.js";import{a as Gr}from"./chunk-62F4ZMSC.js";import"./chunk-V3H6SYK3.js";import{a as ht,b as Jr}from"./chunk-R2E6TMBE.js";import"./chunk-UOHNRH6E.js";import{a as Fa}from"./chunk-SAK42CAY.js";import"./chunk-XB7H2RYV.js";import"./chunk-2PILNMHJ.js";import"./chunk-L3DTONOI.js";import{h as Ca}from"./chunk-OWPAHXDF.js";import"./chunk-HUB4HDWN.js";import"./chunk-4RO35FFQ.js";import"./chunk-4ZS5354G.js";import"./chunk-JJQ3DJG5.js";import"./chunk-K5UVCBIP.js";import"./chunk-5TOK5OJS.js";import"./chunk-2EQRXSF6.js";import"./chunk-Q2CKRCPM.js";import"./chunk-ZOU6SOXW.js";import"./chunk-LZ2TN7EZ.js";import"./chunk-IATNIWOC.js";import"./chunk-PSNCWS3Q.js";import"./chunk-YR4J46US.js";import"./chunk-FDFE3SSG.js";import"./chunk-YF4AXKM4.js";import"./chunk-COGKVNQB.js";import"./chunk-KORVOCNN.js";import"./chunk-OKRKVVTK.js";import"./chunk-JLGA3B7P.js";import"./chunk-3DB4EC62.js";import"./chunk-36S6MFJQ.js";import"./chunk-HRHJA5ZP.js";import"./chunk-FRWQJAW2.js";import"./chunk-UY44O4IZ.js";import"./chunk-TXMZPF2U.js";import"./chunk-H45S4MGC.js";import"./chunk-7AQZKPJU.js";import"./chunk-TZOB52QK.js";import"./chunk-YY6TFARF.js";import"./chunk-GQ3LY7BY.js";import{b as Na}from"./chunk-ZLITAXPT.js";import"./chunk-RSNFNZ6F.js";import"./chunk-7HECBXSP.js";import"./chunk-TDHIOONG.js";import{a as H,b as lr,c as Y,d as Se,e as ge}from"./chunk-VVHJ2AUF.js";import"./chunk-WL3M63DG.js";import"./chunk-AYGL6F3P.js";import"./chunk-WHOD5I7N.js";import"./chunk-WZ3QWPK5.js";import"./chunk-TLN4BKXJ.js";import"./chunk-X5V7AGVU.js";import"./chunk-FDSNRKGQ.js";import"./chunk-MBAPM5HA.js";import"./chunk-3JRB7Q3T.js";import"./chunk-NVDFXEQ5.js";import"./chunk-BQKF4SRH.js";import"./chunk-4IP37MBX.js";import"./chunk-G3DXNSA2.js";import"./chunk-L23Q53FM.js";import"./chunk-UWHAOGO4.js";import"./chunk-ZI7LK3LW.js";import"./chunk-ZNEPRGFY.js";import"./chunk-5TJJVSCI.js";import{a as In}from"./chunk-ZX33FUW3.js";import{a as Zr}from"./chunk-3OYMK5X6.js";import"./chunk-FKIVKNOV.js";import"./chunk-5BUYR23E.js";import"./chunk-DDRP6QTC.js";import{a as pr}from"./chunk-GFSEU7PF.js";import{a as dr}from"./chunk-P7HZGJRU.js";import{a as mr}from"./chunk-CQPZOXWO.js";import"./chunk-G7JO3W2R.js";import{a as tr}from"./chunk-S23ZG2RG.js";import{a as $r}from"./chunk-7UK565VJ.js";import"./chunk-HT7273V7.js";import"./chunk-JLAN6JXJ.js";import{a as Ur}from"./chunk-IHVWDKDV.js";import{a as tn}from"./chunk-SZ64GAVG.js";import{a as zr}from"./chunk-CEJ5WS4I.js";import"./chunk-OTMTS5L4.js";import"./chunk-652NT7OW.js";import{a as se,b as hr,c as ye,e as we,f as Pe,g as Sr,h as gr,i as yr,j as wr,k as kr,l as br,m as mt,n as vr,o as Ar,p as xr,q as Or,r as Ir,s as no}from"./chunk-NMXRDF4T.js";import"./chunk-Z3QZNLT5.js";import"./chunk-R5COVIJM.js";import"./chunk-KT2AMFVW.js";import"./chunk-K4KKSBUW.js";import{a as nr}from"./chunk-OCILF2DD.js";import{a as er}from"./chunk-VHRUPKWH.js";import{a as Yo}from"./chunk-5P6OELKZ.js";import{a as Zo}from"./chunk-QIJ7D2JS.js";import"./chunk-KN2JIDNO.js";import{a as Ko}from"./chunk-FLARCZ5F.js";import"./chunk-MKUXSM33.js";import"./chunk-VUMUCNI7.js";import{a as Xo}from"./chunk-VGBCG3I5.js";import"./chunk-UK3BDOHR.js";import{a as cr}from"./chunk-C2SGJ5IG.js";import{a as sr}from"./chunk-SGQTRKYZ.js";import"./chunk-SWFCT5B7.js";import{a as Go}from"./chunk-C3S3UMV3.js";import"./chunk-SNPJVVVE.js";import"./chunk-5ZG2SWU2.js";import"./chunk-FOMMPAWZ.js";import{a as Ho}from"./chunk-K2GCCCCV.js";import{a as Wo}from"./chunk-ALDJTWCO.js";import{a as Vo}from"./chunk-LRETOC6P.js";import{a as ur}from"./chunk-DUTIWCJ2.js";import{a as Qo}from"./chunk-X76AYO36.js";import{a as or}from"./chunk-EGLA3WLZ.js";import{a as rr}from"./chunk-CIBBQO2L.js";import"./chunk-K4QJEQI4.js";import{a as xn}from"./chunk-QA2D7DT2.js";import"./chunk-7FBOMPO5.js";import"./chunk-HVECVOIO.js";import"./chunk-4KBOLN7Q.js";import{d as fr,f as ae}from"./chunk-XHHAVKKV.js";import"./chunk-4LJERO23.js";import"./chunk-CA3GVT4D.js";import{a as V,b as K,d as Tr,f as Er,g as lt,h as _r,i as Nr,j as ft,l as io,m as A,n as ce,o as ao,p as so,q as Fr,r as Cr,s as Pr}from"./chunk-HEB4YYM6.js";import"./chunk-QLN6IOOY.js";import"./chunk-ZQNGYJKJ.js";import"./chunk-MQ55QUOJ.js";import"./chunk-IWOTLFOY.js";import"./chunk-VJEKDBGZ.js";import"./chunk-HR6R7JXN.js";import"./chunk-LXFWK3O2.js";import"./chunk-2KACAQJS.js";import{a as On}from"./chunk-BDIZUTKC.js";import"./chunk-U5BKU3OL.js";import{a as Ra}from"./chunk-WBKQSSWW.js";import{d as La}from"./chunk-AYTTE7X5.js";import{a as ir}from"./chunk-2OCSYLKZ.js";import{a as Mo}from"./chunk-4AN7ECPE.js";import{a as Jo}from"./chunk-6QHDMCAA.js";import{a as ar,b as _a}from"./chunk-RZ3UGOV4.js";import"./chunk-DESZFFOK.js";import{c as yt,d as Da}from"./chunk-Y3ZAQZPH.js";import{b as Q}from"./chunk-PSREELSQ.js";import"./chunk-LFOBYEWG.js";import{B as _,J as z,K as re,L as q,V as B,W as at,X as le,b as Ea,ma as fe,p as Xt,q as Zt,ra as ne,wa as to,x as eo}from"./chunk-UORSJB4A.js";import"./chunk-ZDF5N422.js";import"./chunk-OSASE35V.js";import"./chunk-WB5GRBHW.js";import{e as Co}from"./chunk-CE6XQDAG.js";import"./chunk-MPW2YJWU.js";import{a as Vt}from"./chunk-EE72PCKT.js";import"./chunk-ARL5WBDK.js";import{a as Bo,b as y,c as w,e as jo,f as dt}from"./chunk-IKXUYCK7.js";import"./chunk-T7KHS6RF.js";import{A as W,E as Lo,F as he,H as j,J as Ro,L as ct,M as ut,S as $o,U as pt,Y as Uo,a as Fo,x as I,y as T,z as ie}from"./chunk-7A4ZE5IS.js";import"./chunk-7Y7AZRL3.js";import"./chunk-WLJDMI7E.js";import"./chunk-RNF6T6IO.js";import"./chunk-5HBIIYSK.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import"./chunk-GB3YC4TI.js";import"./chunk-2KFYIYLI.js";import{b as No,d as it}from"./chunk-QBRRFFMZ.js";import"./chunk-Z2AV4BWZ.js";import{a as x}from"./chunk-LG3KEHGD.js";import{d as Po,e as Do}from"./chunk-HI5FTI3M.js";import{j as c,m as qo,n as J}from"./chunk-FJOVMEPN.js";import{a as ke,b as Pa}from"./chunk-C5DKLOW4.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-EVQPYZ7F.js";import"./chunk-636CTEW7.js";import"./chunk-HJ24NEP5.js";import"./chunk-2IXP3IPE.js";import{Bb as P,Db as zo,Eb as f,Fb as oo,Gb as ro,N as Eo,Sa as Ce,V as _o,Z as oe,ba as Yt,ga as Kt,la as Ne,ta as Fe,tb as u,vb as d,zb as g}from"./chunk-OIQ5NQ5I.js";import{i as st}from"./chunk-B4OMIONW.js";import"./chunk-UU6UQ2QY.js";import"./chunk-5B76DT7X.js";import"./chunk-JJZNUFPD.js";import{b as s,c as nt,d as Wt,e as Qt}from"./chunk-3PYDIBTX.js";import"./chunk-A5BSUUNQ.js";import{b as To}from"./chunk-4AWVU2OV.js";import"./chunk-R4E2E4NN.js";import{b as M}from"./chunk-VBPMVVLV.js";import"./chunk-JD5P5RAJ.js";import{e as G}from"./chunk-IWTNUJGY.js";import"./chunk-3KGN6N7E.js";import"./chunk-RFJ2LI64.js";import"./chunk-CQAD5WML.js";import"./chunk-I5A6BPCP.js";import"./chunk-O472FAYX.js";import"./chunk-IGE4Y5SE.js";import"./chunk-JFBCE4HN.js";import{e as R,g as n}from"./chunk-VKWPEFWQ.js";n();var Ta=R(_a(),1);n();n();n();n();function co(e){return lr(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}n();var qa=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function wt(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":qa.format(t)}function kt(e){let t=z(e);if(t)return t.split(".")[0]}function Cn(){let e=co().map(t=>({subdomain:kt(t.store)??t.store,connected:wt(t.acquiredAt),store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}}));return{sessions:e,...e.length===0?{message:$a()}:{}}}function $a(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
|
|
2
|
+
`)}n();n();n();var bt=s.object({id:s.number(),email:s.string().optional(),firstName:s.string().optional(),lastName:s.string().optional(),accountOwner:s.boolean().optional()}),ue=s.object({store:s.string(),userId:s.string(),scopes:s.array(s.string()),acquiredAt:s.string(),expiresAt:s.string().optional(),refreshTokenExpiresAt:s.string().optional(),associatedUser:bt.optional()}),be=x({name:"StoreAuthResult",schema:ue.omit({associatedUser:!0}).extend({hasRefreshToken:s.boolean(),associatedUser:ue.shape.associatedUser}),definitions:{StoreAuthAssociatedUser:bt}});var Pn=s.object({subdomain:s.string(),connected:s.string(),...ue.partial().shape,acquiredAt:ue.shape.acquiredAt.optional().describe("When the stored token was acquired, in ISO 8601 format."),expiresAt:ue.shape.expiresAt.describe("When the stored access token expires, in ISO 8601 format."),refreshTokenExpiresAt:ue.shape.refreshTokenExpiresAt.describe("When the stored refresh token expires, in ISO 8601 format.")}),vt=x({name:"StoreAuthListResult",schema:s.object({sessions:s.array(Pn),message:s.string().optional()}),definitions:{StoreAuthListSession:Pn,StoreAuthAssociatedUser:bt}});function Dn(e,t){if(t==="json"){g(vt.encode(e));return}Ua(e)}function Ua(e){if(e.sessions.length===0){P(e.message??"");return}he({rows:e.sessions.map(({subdomain:t,connected:o})=>({subdomain:t,connected:o})),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}var De=class e extends Q{static summary="List stores authenticated directly with store auth.";static descriptionWithMarkdown="Lists stores authenticated directly on this machine with `shopify store auth`.\n\nUse this command to find stores that can be used with store-authenticated commands such as `shopify store execute`.\nTo list stores in a Shopify organization, run `shopify store list`.";static jsonOutputSchema=vt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w};async run(){let{flags:t}=await this.parse(e),o=Cn();Dn(o,t.json?"json":"text")}};n();n();n();var Ln=13387,At="/auth/callback",uo="/auth/handoff";function Rn(e){return`http://127.0.0.1:${e}${At}`}function qn(e,t){return`http://127.0.0.1:${e}${uo}?nonce=${encodeURIComponent(t)}`}function D(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function $n(e,t=300){return e.slice(0,t)}async function Un(e){let t=`https://${e.store}/admin/oauth/access_token`;f(d`Exchanging authorization code for token at ${u.raw(t)}`);let o=await Xt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:H,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw f(d`Token exchange failed with HTTP ${u.raw(String(o.status))}: ${u.raw($n(r||o.statusText))}`),new c(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,r||o.statusText);let i;try{i=JSON.parse(r)}catch{throw new c("Received an invalid token response from Shopify.")}return f(d`Token exchange succeeded: access_token=${u.raw(D(i.access_token))}, refresh_token=${u.raw(i.refresh_token?D(i.refresh_token):"none")}, expires_in=${u.raw(String(i.expires_in??"unknown"))}s, user=${u.raw(String(i.associated_user?.id??"unknown"))} (${u.raw(i.associated_user?.email??"no email")})`),i}async function zn(e){let t=`https://${e.store}/admin/oauth/access_token`;f(d`Refreshing access token for ${u.raw(e.store)} using refresh_token=${u.raw(D(e.refreshToken))}`);let o=await Xt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:H,grant_type:"refresh_token",refresh_token:e.refreshToken}),signal:e.signal}),r=await o.text();if(!o.ok)throw f(d`Token refresh failed with HTTP ${u.raw(String(o.status))}: ${u.raw($n(r||o.statusText))}`),new c(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let i;try{i=JSON.parse(r)}catch{throw new c("Received an invalid refresh response from Shopify.")}if(!i.access_token)throw new c(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresIn:i.expires_in,refreshTokenExpiresIn:i.refresh_token_expires_in}}var za=`#graphql
|
|
3
3
|
query CurrentAppInstallationAccessScopes {
|
|
4
4
|
currentAppInstallation {
|
|
5
5
|
accessScopes {
|
|
@@ -7,7 +7,7 @@ import{a as gt}from"./chunk-IILLQOUC.js";import{a as ht,b as Dr}from"./chunk-SIL
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`;async function
|
|
10
|
+
`;async function Bn(e){f(d`Fetching current app installation scopes for ${u.raw(e.store)} using token ${u.raw(D(e.accessToken))}`);let t=await ne({query:za,api:"Admin",url:ae(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!Array.isArray(t.currentAppInstallation?.accessScopes))throw new Error("Shopify did not return currentAppInstallation.accessScopes.");return t.currentAppInstallation.accessScopes.flatMap(o=>typeof o.handle=="string"?[o.handle]:[])}n();n();var po="<comma-separated-scopes>";function jn(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function Ba(e){return[[jn(e,po)]]}function Hn(e,t,o){return[["Run",jn(e,t),o]]}function ja(e){return e.kind==="preview"?po:e.scopes.join(",")}function Mn(e){throw new c(`No stored app authentication found for ${e}.`,void 0,Hn(e,po,"to authenticate"))}function Le(e,t){throw new c(e,void 0,Hn(t.store,ja(t),"to re-authenticate"))}function xt(e){let t=e.kind==="preview"?`The preview store ${e.store} has likely been claimed, so its stored authentication is no longer valid.`:`Stored app authentication for ${e.store} is no longer valid.`;Le(t,e)}function Gn(e){return new c("OAuth callback store does not match the requested store.",`Shopify returned ${e} during authentication. Re-run using the permanent store domain:`,Ba(e))}import{timingSafeEqual as Ha}from"crypto";import{createServer as Ma}from"http";function Ga(e){let t=[e["sec-purpose"],e.purpose,e["x-moz"]].flat().join(" ");return t.includes("prefetch")||t.includes("prerender")}function Jn(e,t){let o=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return`<!doctype html>
|
|
11
11
|
<html lang="en">
|
|
12
12
|
<head>
|
|
13
13
|
<meta charset="utf-8" />
|
|
@@ -76,13 +76,13 @@ import{a as gt}from"./chunk-IILLQOUC.js";import{a as ht,b as Dr}from"./chunk-SIL
|
|
|
76
76
|
</main>
|
|
77
77
|
</div>
|
|
78
78
|
</body>
|
|
79
|
-
</html>`}async function Gn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let p=_(e);return new Promise((m,l)=>{let g=!1,O=!1,h=!1,L=setTimeout(()=>{C(new c("Timed out waiting for OAuth callback."))},r),U=Ba((E,v)=>{let ot=new URL(E.url??"/",`http://127.0.0.1:${o}`),ko=()=>{v.statusCode=404,v.setHeader("Cache-Control","no-store"),v.setHeader("Connection","close"),v.end("Not found")};if(ot.pathname===co){let me=ot.searchParams.get("nonce");if(!(a!==void 0&&!h&&E.method==="GET"&&me!==null&&Mn(me,a.nonce))||Ha(E.headers)){ko();return}h=!0,v.statusCode=302,v.setHeader("Location",a.authorizationUrl),v.setHeader("Cache-Control","no-store"),v.setHeader("Referrer-Policy","no-referrer"),v.setHeader("Connection","close"),v.end();return}if(ot.pathname!==vt){ko();return}let{searchParams:rt}=ot,_e=(me,xo)=>{let Oo=typeof me=="string"?new c(me,xo):me;v.statusCode=400,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>C(Oo)),v.end(jn("Authentication failed",Oo.message))},Mt=rt.get("shop");if(f(d`Received OAuth callback for shop ${u.raw(Mt??"unknown")}`),!Mt){_e("OAuth callback store does not match the requested store.");return}let bo=_(Mt);if(bo!==p){_e(Hn(bo));return}let vo=rt.get("state");if(!vo||!Mn(vo,t)){_e("OAuth callback state does not match the original request.");return}let Ao=rt.get("error");if(Ao){_e(`Shopify returned an OAuth error: ${Ao}`);return}let Gt=rt.get("code");if(!Gt){_e("OAuth callback did not include an authorization code.");return}f(d`Received authorization code ${u.raw(D(Gt))}`),v.statusCode=200,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>de(()=>m(Gt))),v.end(jn("Authentication succeeded","Close this window and return to the terminal"))}),de=E=>{if(g)return;g=!0,clearTimeout(L);let v=()=>{E()};if(!O){v();return}U.close(()=>{O=!1,v()}),U.closeIdleConnections?.()},C=E=>{de(()=>l(E))};U.on("error",E=>{if(E.code==="EADDRINUSE"){C(new c(`Port ${o} is already in use.`,`Free port ${o} and re-run ${u.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}C(E)}),U.listen(o,"127.0.0.1",()=>{O=!0,f(d`PKCE callback server listening on http://127.0.0.1:${u.raw(String(o))}${u.raw(vt)}`),i&&Promise.resolve(i()).catch(E=>{C(E instanceof Error?E:new Error(String(E)))})})})}function Mn(e,t){return e.length!==t.length?!1:za(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as ja,randomBytes as Jn}from"crypto";function Ma(){return Jn(32).toString("base64url")}function Ga(e){return ja("sha256").update(e).digest("base64url")}function Ja(e){let t=new URLSearchParams;return t.set("client_id",j),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function Va(e,t){let o=new URL(e);return o.searchParams.set("signup",t),{nonce:Jn(32).toString("base64url"),authorizationUrl:o.toString()}}function Vn(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Cn,p=nt(),m=Pn(a),l=Ma(),g=Ga(l),O=Ja({store:t,scopes:o,state:p,redirectUri:m,codeChallenge:g}),h=r?Va(O,r):void 0,L=h?Dn(a,h.nonce):O;return f(d`Starting PKCE auth for ${u.raw(t)} with scopes ${u.raw(o.join(","))} (redirect_uri=${u.raw(m)})`),{authorization:{store:t,scopes:o,state:p,port:a,redirectUri:m,authorizationUrl:L,codeVerifier:l},waitForAuthCodeOptions:{store:t,state:p,port:a,authorizationRedirect:h},exchangeCodeForToken:U=>i({store:t,code:U,codeVerifier:l,redirectUri:m})}}n();function mo(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new c("At least one scope is required.","Pass --scopes as a comma-separated list.");return Io(t)}function po(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function Wn(e,t){let o=[...t],r=po(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of po([i]))r.add(a)}return o}function Qn(e,t){if(!e.scope)return f(d`Token response did not include scope; falling back to requested scopes`),t;let o=mo(e.scope),r=po(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new c("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var Wa=240*1e3;function Qa(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Wa<Date.now()}function Ya(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function $(e){let t=Y(e);if(t||Bn(e),f(d`Loaded stored session for ${u.raw(e)}: token=${u.raw(D(t.accessToken))}, expires=${u.raw(t.expiresAt??"unknown")}`),!Qa(t))return t;t.refreshToken||Le(`No refresh token stored for ${t.store}.`,t),f(d`Refreshing expired token for ${u.raw(t.store)} (expired at ${u.raw(t.expiresAt??"unknown")}, refresh_token=${u.raw(D(t.refreshToken))})`);let o=t.accessToken,r={store:t.store,refreshToken:t.refreshToken},i;try{i=await qn(r)}catch(a){throw Se(t.store,t.userId),a instanceof c&&a.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&Le(a.message,t),a instanceof c&&a.message===`Token refresh returned an invalid response for ${t.store}.`&&Le(a.message,t),a instanceof c&&a.message==="Received an invalid refresh response from Shopify.",a}return t=Ya(t,i),f(d`Token refresh succeeded for ${u.raw(t.store)}: ${u.raw(D(o))} → ${u.raw(D(t.accessToken))}, new expiry ${u.raw(t.expiresAt??"unknown")}`),ge(t),t}function Yn(e,t=300){return e.slice(0,t)}function Ka(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return Yn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return Yn(e instanceof Error?e.message:String(e))}async function Kn(e){let t=_(e),o=Y(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await $(t),i=await $n({store:r.store,accessToken:r.accessToken});return f(d`Resolved current remote scopes for ${u.raw(t)}: ${u.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return f(d`Falling back to locally stored scopes for ${u.raw(t)} after remote scope lookup failed: ${u.raw(Ka(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Xa(e){return{completed:["Logged in.",`Authenticated${e.associatedUser?.email?` as ${e.associatedUser.email}`:""} against ${e.store}.`],info:["","To verify that authentication worked, run:",`shopify store execute --store ${e.store} --query 'query { shop { name id } }'`]}}function Za(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function es(e){return URL.canParse(e)?new URL(e).searchParams.has("signup"):!0}function ts(e,t={}){return t.sensitive||es(e)?(P("Browser did not open automatically. The manual authorization URL contains sensitive credentials and was not printed."),P("Run this command again in an environment where Shopify CLI can open a browser automatically."),P(""),!1):(P("Browser did not open automatically. Open this URL manually:"),P(d`${u.link(e)}`),P(""),!0)}function os(e,t="text"){if(t==="json"){S(be.encode(e));return}let o=Xa(e);o.completed.forEach(r=>Uo(r)),o.info.forEach(r=>P(r))}function ve(e="text"){return{openingBrowser:Za,manualAuthUrl:ts,success(t){os(t,e)}}}n();async function N(e,t,o){await Po(()=>({store_fqdn:e})),await Co(()=>({store_fqdn_hash:_o(e),store_fqdn_validated:t,store_domain:e,store_id:Eo(o)}))}var rs={openURL:ct,waitForStoreAuthCode:Gn,exchangeStoreAuthCodeForToken:Rn,resolveExistingScopes:Kn,getCurrentStoredStoreAppSession:Y,presenter:ve("text")};async function xt(e,t={}){let o={...rs,...t},r=_(e.store);if(ns(r,o),To())throw new c("Store authentication requires browser interaction, but user input is disabled.","Remove `--no-input` and run the command in an interactive terminal.");await N(r,!1);let i=mo(e.scopes),a=await o.resolveExistingScopes(r),p=Wn(i,a.scopes),m=a.authoritative?p:i;a.scopes.length>0&&f(d`Merged requested scopes ${u.raw(i.join(","))} with existing scopes ${u.raw(a.scopes.join(","))} for ${u.raw(r)}`);let l=Vn({store:r,scopes:p,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:g}}=l;o.presenter.openingBrowser();let O=await o.waitForStoreAuthCode({...l.waitForAuthCodeOptions,onListening:async()=>{if(await o.openURL(g))return;if(!o.presenter.manualAuthUrl(g))throw new c("Authentication can't continue without a browser.")}}),h=await l.exchangeCodeForToken(O);await N(r,!0);let L=h.associated_user?.id?.toString();if(!L)throw new c("Shopify did not return associated user information for the online access token.");q(L);let U=Date.now(),de=h.expires_in?new Date(U+h.expires_in*1e3).toISOString():void 0,C={store:r,userId:L,scopes:Qn(h,m),acquiredAt:new Date(U).toISOString(),expiresAt:de,refreshTokenExpiresAt:h.refresh_token_expires_in?new Date(U+h.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!h.refresh_token,associatedUser:h.associated_user?{id:h.associated_user.id,email:h.associated_user.email,firstName:h.associated_user.first_name,lastName:h.associated_user.last_name,accountOwner:h.associated_user.account_owner}:void 0};return ge({store:r,clientId:j,userId:L,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:C.scopes,acquiredAt:C.acquiredAt,expiresAt:de,refreshTokenExpiresAt:C.refreshTokenExpiresAt,associatedUser:C.associatedUser}),f(d`Session persisted for ${u.raw(r)} (user ${u.raw(L)}, expires ${u.raw(de??"unknown")})`),o.presenter.success(C),C}function ns(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new c("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
|
|
79
|
+
</html>`}async function Wn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let p=_(e);return new Promise((m,l)=>{let S=!1,O=!1,h=!1,L=setTimeout(()=>{C(new c("Timed out waiting for OAuth callback."))},r),U=Ma((E,v)=>{let ot=new URL(E.url??"/",`http://127.0.0.1:${o}`),bo=()=>{v.statusCode=404,v.setHeader("Cache-Control","no-store"),v.setHeader("Connection","close"),v.end("Not found")};if(ot.pathname===uo){let me=ot.searchParams.get("nonce");if(!(a!==void 0&&!h&&E.method==="GET"&&me!==null&&Vn(me,a.nonce))||Ga(E.headers)){bo();return}h=!0,v.statusCode=302,v.setHeader("Location",a.authorizationUrl),v.setHeader("Cache-Control","no-store"),v.setHeader("Referrer-Policy","no-referrer"),v.setHeader("Connection","close"),v.end();return}if(ot.pathname!==At){bo();return}let{searchParams:rt}=ot,_e=(me,Oo)=>{let Io=typeof me=="string"?new c(me,Oo):me;v.statusCode=400,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>C(Io)),v.end(Jn("Authentication failed",Io.message))},Gt=rt.get("shop");if(f(d`Received OAuth callback for shop ${u.raw(Gt??"unknown")}`),!Gt){_e("OAuth callback store does not match the requested store.");return}let vo=_(Gt);if(vo!==p){_e(Gn(vo));return}let Ao=rt.get("state");if(!Ao||!Vn(Ao,t)){_e("OAuth callback state does not match the original request.");return}let xo=rt.get("error");if(xo){_e(`Shopify returned an OAuth error: ${xo}`);return}let Jt=rt.get("code");if(!Jt){_e("OAuth callback did not include an authorization code.");return}f(d`Received authorization code ${u.raw(D(Jt))}`),v.statusCode=200,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>de(()=>m(Jt))),v.end(Jn("Authentication succeeded","Close this window and return to the terminal"))}),de=E=>{if(S)return;S=!0,clearTimeout(L);let v=()=>{E()};if(!O){v();return}U.close(()=>{O=!1,v()}),U.closeIdleConnections?.()},C=E=>{de(()=>l(E))};U.on("error",E=>{if(E.code==="EADDRINUSE"){C(new c(`Port ${o} is already in use.`,`Free port ${o} and re-run ${u.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}C(E)}),U.listen(o,"127.0.0.1",()=>{O=!0,f(d`PKCE callback server listening on http://127.0.0.1:${u.raw(String(o))}${u.raw(At)}`),i&&Promise.resolve(i()).catch(E=>{C(E instanceof Error?E:new Error(String(E)))})})})}function Vn(e,t){return e.length!==t.length?!1:Ha(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as Ja,randomBytes as Qn}from"crypto";function Va(){return Qn(32).toString("base64url")}function Wa(e){return Ja("sha256").update(e).digest("base64url")}function Qa(e){let t=new URLSearchParams;return t.set("client_id",H),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function Ya(e,t){let o=new URL(e);return o.searchParams.set("signup",t),{nonce:Qn(32).toString("base64url"),authorizationUrl:o.toString()}}function Yn(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Ln,p=it(),m=Rn(a),l=Va(),S=Wa(l),O=Qa({store:t,scopes:o,state:p,redirectUri:m,codeChallenge:S}),h=r?Ya(O,r):void 0,L=h?qn(a,h.nonce):O;return f(d`Starting PKCE auth for ${u.raw(t)} with scopes ${u.raw(o.join(","))} (redirect_uri=${u.raw(m)})`),{authorization:{store:t,scopes:o,state:p,port:a,redirectUri:m,authorizationUrl:L,codeVerifier:l},waitForAuthCodeOptions:{store:t,state:p,port:a,authorizationRedirect:h},exchangeCodeForToken:U=>i({store:t,code:U,codeVerifier:l,redirectUri:m})}}n();function lo(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new c("At least one scope is required.","Pass --scopes as a comma-separated list.");return Eo(t)}function mo(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function Kn(e,t){let o=[...t],r=mo(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of mo([i]))r.add(a)}return o}function Xn(e,t){if(!e.scope)return f(d`Token response did not include scope; falling back to requested scopes`),t;let o=lo(e.scope),r=mo(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new c("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var Ka=240*1e3;function Xa(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Ka<Date.now()}function Za(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function $(e,t){t?.throwIfAborted();let o=Y(e);if(o||Mn(e),f(d`Loaded stored session for ${u.raw(e)}: token=${u.raw(D(o.accessToken))}, expires=${u.raw(o.expiresAt??"unknown")}`),!Xa(o))return o;o.refreshToken||Le(`No refresh token stored for ${o.store}.`,o),f(d`Refreshing expired token for ${u.raw(o.store)} (expired at ${u.raw(o.expiresAt??"unknown")}, refresh_token=${u.raw(D(o.refreshToken))})`);let r=o.accessToken,i={store:o.store,refreshToken:o.refreshToken,...t?{signal:t}:{}},a;try{a=await zn(i)}catch(p){throw t?.aborted||(ge(o.store,o.userId),p instanceof c&&p.message.startsWith(`Token refresh failed for ${o.store} (HTTP `)&&Le(p.message,o),p instanceof c&&p.message===`Token refresh returned an invalid response for ${o.store}.`&&Le(p.message,o),p instanceof c&&p.message==="Received an invalid refresh response from Shopify."),p}return o=Za(o,a),f(d`Token refresh succeeded for ${u.raw(o.store)}: ${u.raw(D(r))} → ${u.raw(D(o.accessToken))}, new expiry ${u.raw(o.expiresAt??"unknown")}`),Se(o),o}function Zn(e,t=300){return e.slice(0,t)}function es(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return Zn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return Zn(e instanceof Error?e.message:String(e))}async function ei(e){let t=_(e),o=Y(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await $(t),i=await Bn({store:r.store,accessToken:r.accessToken});return f(d`Resolved current remote scopes for ${u.raw(t)}: ${u.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return f(d`Falling back to locally stored scopes for ${u.raw(t)} after remote scope lookup failed: ${u.raw(es(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function ts(e){return{completed:["Logged in.",`Authenticated${e.associatedUser?.email?` as ${e.associatedUser.email}`:""} against ${e.store}.`],info:["","To verify that authentication worked, run:",`shopify store execute --store ${e.store} --query 'query { shop { name id } }'`]}}function os(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function rs(e){return URL.canParse(e)?new URL(e).searchParams.has("signup"):!0}function ns(e,t={}){return t.sensitive||rs(e)?(P("Browser did not open automatically. The manual authorization URL contains sensitive credentials and was not printed."),P("Run this command again in an environment where Shopify CLI can open a browser automatically."),P(""),!1):(P("Browser did not open automatically. Open this URL manually:"),P(d`${u.link(e)}`),P(""),!0)}function is(e,t="text"){if(t==="json"){g(be.encode(e));return}let o=ts(e);o.completed.forEach(r=>zo(r)),o.info.forEach(r=>P(r))}function ve(e="text"){return{openingBrowser:os,manualAuthUrl:ns,success(t){is(t,e)}}}n();async function N(e,t,o){await Do(()=>({store_fqdn:e})),await Po(()=>({store_fqdn_hash:No(e),store_fqdn_validated:t,store_domain:e,store_id:_o(o)}))}var as={openURL:ut,waitForStoreAuthCode:Wn,exchangeStoreAuthCodeForToken:Un,resolveExistingScopes:ei,getCurrentStoredStoreAppSession:Y,presenter:ve("text")};async function Ot(e,t={}){let o={...as,...t},r=_(e.store);if(ss(r,o),To())throw new c("Store authentication requires browser interaction, but user input is disabled.","Remove `--no-input` and run the command in an interactive terminal.");await N(r,!1);let i=lo(e.scopes),a=await o.resolveExistingScopes(r),p=Kn(i,a.scopes),m=a.authoritative?p:i;a.scopes.length>0&&f(d`Merged requested scopes ${u.raw(i.join(","))} with existing scopes ${u.raw(a.scopes.join(","))} for ${u.raw(r)}`);let l=Yn({store:r,scopes:p,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:S}}=l;o.presenter.openingBrowser();let O=await o.waitForStoreAuthCode({...l.waitForAuthCodeOptions,onListening:async()=>{if(await o.openURL(S))return;if(!o.presenter.manualAuthUrl(S))throw new c("Authentication can't continue without a browser.")}}),h=await l.exchangeCodeForToken(O);await N(r,!0);let L=h.associated_user?.id?.toString();if(!L)throw new c("Shopify did not return associated user information for the online access token.");q(L);let U=Date.now(),de=h.expires_in?new Date(U+h.expires_in*1e3).toISOString():void 0,C={store:r,userId:L,scopes:Xn(h,m),acquiredAt:new Date(U).toISOString(),expiresAt:de,refreshTokenExpiresAt:h.refresh_token_expires_in?new Date(U+h.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!h.refresh_token,associatedUser:h.associated_user?{id:h.associated_user.id,email:h.associated_user.email,firstName:h.associated_user.first_name,lastName:h.associated_user.last_name,accountOwner:h.associated_user.account_owner}:void 0};return Se({store:r,clientId:H,userId:L,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:C.scopes,acquiredAt:C.acquiredAt,expiresAt:de,refreshTokenExpiresAt:C.refreshTokenExpiresAt,associatedUser:C.associatedUser}),f(d`Session persisted for ${u.raw(r)} (user ${u.raw(L)}, expires ${u.raw(de??"unknown")})`),o.presenter.success(C),C}function ss(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new c("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
|
|
80
80
|
|
|
81
|
-
Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends Q{};n();var F=R(M(),1),
|
|
81
|
+
Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends Q{};n();var F=R(M(),1),cs="Country must be a two-letter country code, for example: US.";function us(e){return/^[A-Z]{2}$/.test(e)}var It=F.Flags.string({description:"Two-letter country code for the store, such as US, CA, or GB. Follows the ISO 3166-1 alpha-2 standard.",env:"SHOPIFY_FLAG_STORE_COUNTRY",required:!1,parse:async e=>{let t=e.trim().toUpperCase();if(!us(t))throw new c(cs);return t}}),b={store:F.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>_(e),required:!0}),"organization-id":F.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},ti={env:"SHOPIFY_FLAG_ID",parse:async e=>hr(e)},oi=F.Flags.string({...ti,description:"The bulk operation ID (numeric ID or full GID). If not provided, lists all bulk operations on this store in the last 7 days."}),ri=F.Flags.string({...ti,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),ni={query:F.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":F.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>G(e),exactlyOne:["query","query-file"]}),variables:F.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":F.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>G(e),exclusive:["variables"]}),watch:F.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":F.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:F.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"allow-mutations":F.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var ii=R(M(),1),Re=class e extends k{static summary="Authenticate an app against a store for store commands.";static descriptionWithMarkdown=`Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
|
|
82
82
|
|
|
83
|
-
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];static flags={...y,...w,store:b.store,scopes:
|
|
84
|
-
`,{command:`shopify store bulk status --id=${ye(r.id)}`}]:i.body,p={headline:i.headline,...a&&{body:a},...i.customSections&&{customSections:i.customSections}};switch(i.renderType){case"success":
|
|
85
|
-
`);if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);return Ne(t,{encoding:"utf8"})}else return}async function
|
|
83
|
+
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;static jsonOutputSchema=be;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];static flags={...y,...w,store:b.store,scopes:ii.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};async run(){let{flags:t}=await this.parse(e);await Ot({store:t.store,scopes:t.scopes},{presenter:ve(t.json?"json":"text")})}};n();n();async function ai(e){let t=await br(e);return{store:e.adminSession.storeFqdn,apiVersion:e.version??se,operation:t?.bulkOperation??null,userErrors:t?.userErrors??[]}}n();async function Ae(e){le();let t=await $(e);return await N(t.store,!0),q(t.userId),{token:t.accessToken,storeFqdn:t.store}}n();n();var di=s.string().regex(/^gid:\/\/shopify\/BulkOperation\/[^/]+$/).describe("The Shopify global ID of a bulk operation."),pe=s.object({gid:di,type:s.string(),status:s.string(),errorCode:s.string().nullable(),createdAt:Wt,completedAt:Wt.nullable(),objectCount:s.string().regex(/^\d+$/).describe("A nonnegative decimal count, without loss of integer precision."),url:s.string().url().nullable(),partialDataUrl:s.string().url().nullable()}).strict(),mi=pe.omit({type:!0}),Tt=s.object({storeDomain:nt.nullable(),apiVersion:s.string().nullable().describe("The API version selected for the request.")}).strict(),Et=x({name:"CancelBulkOperationResult",schema:Tt.extend({status:s.literal("success"),operation:pe}),definitions:{BulkOperation:pe}}),si=Tt.extend({status:s.enum(["success","partial","cancelled"]),reason:s.literal("watch-aborted").optional(),operation:pe,resultsJsonl:s.string().optional().describe("Downloaded results in their native JSONL format.")}),ci=s.object({path:s.string().describe("The absolute path of the downloaded results file."),format:s.literal("jsonl")}).strict(),qe=x({name:"ExecuteBulkOperationResult",schema:s.union([si,ci]),definitions:{BulkOperation:pe,ExecuteBulkOperationResult:si,BulkOperationFile:ci}}),ui=Tt.extend({operationGid:di,operation:pe.nullable()}),pi=Tt.extend({operations:s.array(mi),pageInfo:s.object({hasNextPage:s.boolean().nullable().describe("Unknown when the API result reaches the fetch limit.")}).strict()}),_t=x({name:"BulkOperationStatusResult",schema:s.union([ui,pi]),definitions:{GetBulkOperationStatusResult:ui,ListBulkOperationsResult:pi,BulkOperation:pe,ListedBulkOperation:mi}});n();function X(e){let t=re(e.store);return{storeDomain:t?`${t}.myshopify.com`:null,apiVersion:e.apiVersion??null}}function Z(e){if(typeof e.objectCount=="number"&&!Number.isSafeInteger(e.objectCount))throw new J("Shopify returned a bulk operation count that can't be represented exactly.");return{gid:e.id,..."type"in e?{type:e.type}:{},status:e.status,errorCode:e.errorCode??null,createdAt:Qt(new Date(String(e.createdAt))),completedAt:e.completedAt?Qt(new Date(String(e.completedAt))):null,objectCount:String(e.objectCount),url:e.url??null,partialDataUrl:e.partialDataUrl??null}}function li(e,t,o){if(o==="json"){if(e.userErrors.length||!e.operation){let i=new c("Failed to cancel bulk operation.");throw i.details={...X(e),operationGid:t,userErrors:e.userErrors},i}g(Et.encode({...X(e),status:"success",operation:Z(e.operation)}));return}if(e.userErrors.length){vr(e.userErrors,"Failed to cancel bulk operation.");return}let r=e.operation;if(r){let i=Ar(r),a=r.status==="CANCELING"?[`This may take a few moments. Check the status with:
|
|
84
|
+
`,{command:`shopify store bulk status --id=${ye(r.id)}`}]:i.body,p={headline:i.headline,...a&&{body:a},...i.customSections&&{customSections:i.customSections}};switch(i.renderType){case"success":T(p);break;case"warning":ie(p);break;case"info":I(p);break}}else W({headline:"Bulk operation not found or could not be canceled.",body:d`ID: ${u.yellow(t)}`.value})}n();n();function fi(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function hi(e,t=!1){if(we(e)&&!t)throw new c("Mutations are disabled by default for shopify store bulk execute.","Re-run with --allow-mutations if you intend to modify store data.")}function xe(e,t){let o=[...t.operationId?[`ID: ${t.operationId}`]:[],...fi(t)];I({headline:e,body:[{list:{items:o}}]})}var $e=class e extends k{static summary="Cancel a bulk operation on a store.";static descriptionWithMarkdown="Cancels a running bulk operation by ID, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.";static jsonOutputSchema=Et;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:ri};async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await Ae(t.store);xe("Canceling bulk operation.",{storeFqdn:r.storeFqdn,operationId:t.id});let i=await ai({adminSession:r,operationId:t.id});li(i,t.id,o)}};n();n();async function ps(e,t){if(e)return e.join(`
|
|
85
|
+
`);if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);return Ne(t,{encoding:"utf8"})}else return}async function Si(e){let{store:t,query:o,variables:r,variableFile:i,watch:a=!1,version:p,allowMutations:m=!1}=e;hi(o,m);let{adminSession:l,version:S}=await j({title:d`Authenticating`,task:async()=>{let h=await Ae(t),L=await Pe({adminSession:h,userSpecifiedVersion:p,minimumDefaultVersion:se});return{adminSession:h,version:L}},renderOptions:{stdout:process.stderr}}),O=await ps(r,i);return ds(o,O),{adminSession:l,version:S,query:o,variablesJsonl:O,watch:a}}async function gi(e){let{adminSession:t,version:o,query:r,variablesJsonl:i,watch:a}=e,p=we(r)?await yr({adminSession:t,query:r,variablesJsonl:i,version:o}):await gr({adminSession:t,query:r,version:o});if(p?.userErrors?.length||!p?.bulkOperation)return{store:t.storeFqdn,apiVersion:o,operation:p?.bulkOperation??null,userErrors:p?.userErrors??[],watchAborted:!1};let m=new Fo,l=a?await Or(t,p.bulkOperation.id,m.signal,()=>m.abort()):await xr(t,p.bulkOperation.id),S=a&&!m.signal.aborted&&l.status==="COMPLETED"&&l.url?await Ir(l.url):void 0;return{store:t.storeFqdn,apiVersion:o,operation:l,userErrors:[],watchAborted:m.signal.aborted,results:S}}function ds(e,t){if(we(e)&&!t)throw new c(d`Bulk mutations require variables. Provide a JSONL file with ${u.yellow("--variable-file")} or individual JSON objects with ${u.yellow("--variables")}.`);if(!we(e)&&t)throw new c(d`The ${u.yellow("--variables")} and ${u.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}n();async function yi(e,t){let{format:o,watch:r,outputFile:i}=t,{operation:a,userErrors:p,watchAborted:m,results:l}=e;if(!a&&p.length===0)throw ie({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new J("Bulk operation response returned null with no error message.");if(o==="json"){if(p.length||a&&["FAILED","CANCELED","EXPIRED"].includes(a.status)){let h=new c("Bulk operation failed.");throw h.details={...X(e),operation:a?Z(a):null,userErrors:p},h}if(!a)throw new J("Bulk operation response returned no operation.");let S=l!==void 0&&no(l),O=S?"partial":"success";if(m&&(O="cancelled"),S&&(process.exitCode=1),i&&l===void 0&&!m)throw new c("No results are available to write to the output file.");if(i&&l!==void 0){let h=G(i);await Fe(h,l),g(qe.encode({path:h,format:"jsonl"}))}else g(qe.encode({...X(e),status:O,...m?{reason:"watch-aborted"}:{},operation:Z(a),...l===void 0?{}:{resultsJsonl:l}}));return}if(i&&l!==void 0&&await Fe(i,l),p.length){W({headline:"Error creating bulk operation.",body:{list:{items:p.map(S=>S.field?`${S.field.join(".")}: ${S.message}`:S.message)}}});return}a&&(m?I({headline:`Bulk operation ${a.id} is still running in the background.`,body:Nt(a.id)}):r||["FAILED","CANCELED","EXPIRED"].includes(a.status)?ms(a,l,i):T({headline:"Bulk operation is running.",body:Nt(a.id),customSections:[{body:[{list:{items:[d`ID: ${u.cyan(a.id)}`.value]}}]}]}))}function ms(e,t,o){let r=mt(e).value,a=[{body:[{list:{items:[d`ID: ${u.cyan(e.id)}`.value,d`Status: ${u.yellow(e.status)}`.value,d`Created at: ${u.gray(String(e.createdAt))}`.value,...e.completedAt?[d`Completed at: ${u.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":T({headline:"Bulk operation started.",body:Nt(e.id),customSections:a});break;case"RUNNING":T({headline:"Bulk operation is running.",body:Nt(e.id),customSections:a});break;case"COMPLETED":if(t===void 0)T({headline:r,customSections:a});else{let p=no(t);o||g(t),p?ie({headline:"Bulk operation completed with errors.",body:o?`Results written to ${o}. Check file for error details.`:"Check results for error details.",customSections:a}):T({headline:r,body:o?[`Results written to ${o}`]:void 0,customSections:a})}break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":W({headline:r,customSections:a});break}}function Nt(e){return[`Monitor its progress with:
|
|
86
86
|
`,{command:`shopify store bulk status --id=${ye(e)}`}]}var Ue=class e extends k{static summary="Execute bulk operations on a store.";static descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store as a bulk operation, using previously stored app authentication.
|
|
87
87
|
|
|
88
88
|
Run \`shopify store auth\` first to create stored auth for the store.
|
|
@@ -91,14 +91,14 @@ Re-run this command if the stored token is missing, expires, or no longer has th
|
|
|
91
91
|
|
|
92
92
|
Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.
|
|
93
93
|
|
|
94
|
-
Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];static flags={...y,...w,store:b.store,...ti};static get jsonOutputSchema(){return qe}async run(){let{flags:t}=await this.parse(e),o=await fr({query:t.query,queryFile:t["query-file"]}),r=await li({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,allowMutations:t["allow-mutations"],...t.version&&{version:t.version}}),i=t.json?"json":"text";xe("Starting bulk operation.",{storeFqdn:r.adminSession.storeFqdn,version:r.version});let a=await fi(r);await hi(a,{format:i,watch:r.watch,outputFile:t["output-file"]})}};n();n();async function gi(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await Sr({...e,version:t});return{store:e.adminSession.storeFqdn,apiVersion:t,operationId:e.operationId,operation:o??null}}async function Si(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await yr({...e,version:t,first:100});return{store:e.adminSession.storeFqdn,apiVersion:t,operations:o}}n();function yi(e,t){if(t==="json"){S(Et.encode({...X(e),..."operation"in e?{operationGid:e.operationId,operation:e.operation?Z(e.operation):null}:{operations:e.operations.map(Z),pageInfo:{hasNextPage:e.operations.length<100?!1:null}}}));return}if("operation"in e){e.operation?ps(e.operation):W({headline:"Bulk operation not found.",body:d`ID: ${u.yellow(e.operationId)}`.value});return}let o=e.operations.map(r=>({id:ye(r.id),status:ms(r.status),count:ls(r.objectCount),dateCreated:Qt(new Date(String(r.createdAt))),dateFinished:r.completedAt?Qt(new Date(String(r.completedAt))):"",results:fs(r.url??r.partialDataUrl)}));oo(),o.length===0?T({body:"No bulk operations found in the last 7 days."}):he({rows:o,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),oo()}function ps(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:p}=e,m=dt(e).value,l=ds(r,i),g=d`ID: ${u.yellow(t)}\n${l}`.value;if(o==="COMPLETED"){let O=a?u.link("Download results",a):"";I({headline:m,body:d`${g}\n${O}`.value})}else if(o==="FAILED"){let O=p?u.link("Download partial results",p):"";W({headline:m,body:d`${g}\n${O}`.value})}else T({headline:m,body:g})}function ds(e,t){let o=new Date;return t?`Finished ${Yt(new Date(String(t)),o)}`:`Started ${Yt(new Date(String(e)),o)}`}function ms(e){return e==="COMPLETED"?at.green(e):e==="FAILED"?at.red(e):at.dim(e)}function ls(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function fs(e){return e?d`${u.link("download",e)}`.value:""}var ze=class e extends k{static summary="Check the status of bulk operations on a store.";static descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:Zn};static get jsonOutputSchema(){return Et}async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await Ae(t.store);xe(t.id?"Checking bulk operation status.":"Listing bulk operations.",{storeFqdn:r.storeFqdn});let i=t.id?await gi({adminSession:r,operationId:t.id}):await Si({adminSession:r});yi(i,o)}};n();var lo=R(M(),1),Be=class e extends k{static hidden=!0;static summary="Authenticate for store commands.";static descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup or stdin.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","printf %s <signup-jwt> | <%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];static flags={...y,...w,store:b.store,scopes:lo.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:lo.Flags.string({description:"Provide JWT for the store. When omitted, the JWT is read from stdin.",env:"SHOPIFY_FLAG_SIGNUP",required:!1})};static get jsonOutputSchema(){return be}async run(){let{flags:t}=await this.parse(e),o=gs(t.signup)??await Ss();await xt({store:t.store,scopes:t.scopes,signup:o},{presenter:ve(t.json?"json":"text")})}},hs=8*1024,wi="Missing signup JWT.",ki="Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.";function gs(e){let t=e?.trim();return t===""?void 0:t}async function Ss(e=process.stdin){if(e===process.stdin&&!$o())throw new c(wi,ki);let t=[],o=0;for await(let i of e){let a=Buffer.isBuffer(i)?i:Buffer.from(i);if(o+=a.length,o>hs)throw new c("The input piped to stdin is too large to be a signup JWT.","Pipe only the signup JWT.");t.push(a)}let r=Buffer.concat(t).toString("utf8").trim();if(!r)throw new c(wi,ki);return r}n();n();n();var Oe=s.object({error:s.literal(!0),message:s.string(),nextSteps:s.array(s.unknown()).describe("Suggested next steps, as text or formatted UI tokens."),exitCode:s.literal(1)});var fo=x({name:"CreateDevStoreResult",schema:s.union([io.schema,Oe]),definitions:{...io.definitions,StoreCommandError:Oe}});n();var bi={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var vi=_r,Ai=Nr,xi=Fr;var He=R(M(),1),je=class e extends Q{static summary="Create a new dev store.";static descriptionWithMarkdown="Creates a new dev store in your organization.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>",'<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --demo-data','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --json'];static flags={...y,...w,name:pt(He.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":pt(b["organization-id"]),plan:pt(He.Flags.string({description:"The Shopify plan to use for the new dev store.",options:no,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":He.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":He.Flags.boolean({description:"Populate the new dev store with demo data.",allowNo:!0,env:"SHOPIFY_FLAG_STORE_DEMO_DATA"}),country:Ot};static get jsonOutputSchema(){return fo}async run(){let{flags:t}=await this.parse(e),o=await lt(t["organization-id"]?.toString()),r=t.name??await vi(),i=t.plan??await Ai(),a=t["demo-data"]??(ut()?await xi():!1);try{await ao({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:a,country:t.country,json:t.json})}catch(p){throw t.json&&p instanceof c&&(S(fo.encode({error:!0,message:p.message,nextSteps:p.nextSteps??[],exitCode:1})),process.exit(1)),p}}};n();n();n();var ys="X-Shopify-CLI-Instance",ws="X-Shopify-CLI-Version",Oi;function ks(){return Oi??=new Fo({projectName:"shopify-cli-store"}),Oi}var Me=class extends c{status;constructor(t,o,r){super(o,r??null),this.status=t}};function Ti(e=ks()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=nt();return e.set("cliInstanceId",o),o}function Ii(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${Jt}`,[ys]:e,[ws]:Jt}}function bs(e){return Ii(e)}function vs(e,t){return{...Ii(e),authorization:t,"X-Shopify-Access-Token":t}}async function Ei(e,t={}){let r=`https://${await Zt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await Xt(r,{method:"POST",headers:bs(Ti(t.storage)),body:i}),p=await a.text();if(!a.ok){let l=As(a.status,p);throw new c(l.message,l.tryMessage)}let m;try{m=JSON.parse(p)}catch(l){let g=l instanceof Error?l.message:"Unknown error";throw new c("Preview store creation returned a non-JSON response.",`Parse error: ${g}. Body (truncated): ${Nt(p).slice(0,500)}`)}return Os(m)}async function _i(e,t={}){let r=`https://${await Zt()}/services/preview-stores/${e.shopId}`,i=await Xt(r,{method:"GET",headers:vs(Ti(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=xs(i.status,a);throw new Me(i.status,m.message,m.tryMessage)}let p;try{p=JSON.parse(a)}catch(m){let l=m instanceof Error?m.message:"Unknown error";throw new c("Preview store lookup returned a non-JSON response.",`Parse error: ${l}. Body (truncated): ${Nt(a).slice(0,500)}`)}return Ts(p)}function As(e,t){let o=Ni(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=Nt(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Ni(e){if(e.length===0)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object")return{};let o=t;return{...typeof o.error_code=="string"?{error_code:o.error_code}:{},...typeof o.message=="string"?{message:o.message}:{}}}catch(t){if(t instanceof SyntaxError)return{};throw t}}function xs(e,t){let o=Ni(t),r=Nt(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function Os(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,p=typeof e.access_url=="string"?e.access_url:void 0,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,l=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(g=>typeof g=="string"):void 0;if(!o||!r||!i||!a||!p||!l)throw new c("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(Is(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:l,accessUrl:p,...m?{placeholderAccountUuid:m}:{}}}function Ts(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,p=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new c("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(Es(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...p?{claimUrl:p}:{}}}function Is(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Nt(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function Es(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var _s={createPreviewStore:Ei,setStoredStoreAppSession:ge,recordStoreFqdnMetadata:N,setLastSeenUserId:q,now:()=>new Date};async function Fi(e,t={}){let o={..._s,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Fs(r,e.country,o)}function Ns(e){return e.placeholderAccountUuid??e.shop.id}async function Fs(e,t,o){let r=o.now().toISOString(),i=Ns(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:j,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl,type:"preview",authScopes:e.adminApiScopes},next_steps:Cs(e.shop.domain)}}function Cs(e){return[`Use \`shopify store open --store ${e}\` to preview the storefront.`,`Use \`shopify store execute --store ${e}\` to add products, collections, pages, and more.`,`Use \`shopify theme pull --store ${e}\` and \`shopify theme push --store ${e}\` to edit your store design.`]}n();n();var Ci=A.pick({id:!0,name:!0,subdomain:!0,country:!0}).extend({storefrontUrl:s.string(),type:s.literal("preview").optional(),authScopes:A.shape.authScopes.describe("Preapproved Admin API scopes for the preview store.")}),Ft=x({name:"CreatePreviewStoreResult",schema:s.object({status:s.literal("success"),message:s.string(),store:Ci,next_steps:s.array(s.string())}),definitions:{PreviewStore:Ci}});function Pi(e,t){if(t==="json"){S(Ft.encode(e));return}Ds(e)}function Ps(e){return e.split(/(`[^`]+`)/).map(t=>t.startsWith("`")&&t.endsWith("`")?{command:t.slice(1,-1)}:t)}function Ds(e){I({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:e.next_steps.map(Ps)}}}]})}var Di=R(M(),1),Ge=class e extends k{static summary="Create a preview Shopify store.";static descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];static flags={...y,...w,name:Di.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:Ot};static get jsonOutputSchema(){return Ft}async run(){let{flags:t}=await this.parse(e),o=await H({title:d`Creating store`,task:async()=>Fi({name:t.name,country:t.country})});Pi(o,t.json?"json":"text")}};n();n();var Li=s.object({domain:A.shape.subdomain,deletionRequested:s.literal(!0),deletionConfirmed:s.boolean()}),Je=x({name:"DeleteDevStoreResult",schema:s.union([s.object({store:Li,organization:ce,message:s.string().optional()}),Oe]),definitions:{DeletedStore:Li,StoreOrganization:ce,StoreCommandError:Oe}});n();n();n();n();var Ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},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:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"5"}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}],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:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"developerPreviewHandle"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"ownerDetails"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"email"}},{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:"__typename"}}]}}]}}]};async function qi(e){let t=await Ve(e);if(!t)throw new c(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return t}async function Ve(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r={id:e.organizationId,businessName:e.organizationName},a=(await K(r,{query:Ri,token:t,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],p=e.store.toLowerCase(),m=a.find(l=>z(l.node.primaryDomain)===p)?.node;if(m)return{shopifyShopId:m.shopifyShopId??void 0,name:m.name,primaryDomain:m.primaryDomain??void 0,storeType:m.storeType??void 0,developerPreviewHandle:m.developerPreviewHandle??void 0,planName:m.planName??void 0,ownerName:m.ownerDetails?.fullName??void 0,ownerEmail:m.ownerDetails?.email??void 0}}n();var $i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"storeFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}}}],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:"code"}},{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"}}]}}]}}]};n();var Ui={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationAccessibleShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopifyShopID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShop"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ls="cancelled",Rs=5,qs=300*1e3;async function Bi(e){let{organization:t,store:o}=e,r=await B([],{allowAutomationToken:!0}),i=V(),a=await zi({store:o,organization:t,token:r}),m=(await K(t,{query:$i,token:r,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!m)throw new c("Store deletion failed: unexpected empty response.");let l=m.userErrors;if(l&&l.length>0){let O=l.map(h=>h.message).join(", ");throw new c(`Failed to delete dev store: ${O}`)}if(m.success===!1)throw new c("Store deletion failed.");a??=await zi({store:o,organization:t,token:r});let g=a?await Us({shopifyShopId:a,organization:t,token:r,unauthorizedHandler:i}):!1;e.json?S(Bs({store:o,organization:t,deletionConfirmed:g})):g?I({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):ie({headline:`Dev store "${o}" deletion was requested, but not confirmed.`,body:["Shopify accepted the deletion request, but deletion was not confirmed before the CLI stopped waiting.","The store may still finish deleting asynchronously."]})}async function zi(e){let{store:t,organization:o,token:r}=e;return(await Ve({store:t,organizationId:o.id,organizationName:o.businessName,token:r}))?.shopifyShopId}function $s(e){let t=String(e),o=t.match(/^(?:gid:\/\/shopify\/Shop\/)?(\d+)$/)?.[1];if(!o)throw new Error(`Invalid Shopify shop ID: ${t}`);return Buffer.from(`gid://organization/ShopifyShop/${o}`).toString("base64url")}async function Us(e){let t=$s(e.shopifyShopId);return H({title:d`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>qs)return!1;if((await K(e.organization,{query:Ui,token:e.token,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===Ls.toLowerCase())return!0;o(d`${zs()}`),await qo(Rs)}},renderOptions:{stdout:process.stderr}})}function zs(){return"Waiting for deletion confirmation"}function Bs(e){let{store:t,organization:o,deletionConfirmed:r}=e;return Je.encode({store:{domain:t,deletionRequested:!0,deletionConfirmed:r},organization:{id:o.id,name:o.businessName},...r?{}:{message:"Deletion was requested, but has not been confirmed yet. The store may still finish deleting asynchronously."}})}n();n();n();var Hi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Te=class extends c{};async function Ct(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r=z(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await eo({query:Hi,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(g=>Ms(g,r));if(!m)throw new Te(`Couldn't find a store with domain ${e.store} for the current account.`,Hs());let l=await js(String(m.publicId),t,o);return{...l?{owningOrg:l}:{}}}function Hs(){let e="Check the domain (it must be the permanent `myshopify.com` domain)";return it()?`${e} and that the service account has access to the store: it can open the stores it created, or any store in an organization where it has Dev store management access. Inactive stores aren't searchable.`:`${e} and that you're logged in to an account with access to the store. Inactive stores aren't searchable.`}async function js(e,t,o){try{let i=(await eo({query:ji,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?Or(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${Gs(r)}`);return}}function Ms(e,t){return[e.primaryDomain,e.webUrl].some(o=>z(o)===t)}function Gs(e){return e instanceof Error?e.message:String(e)}async function Js(e){let{store:t}=e;try{let r=(await Ct(e)).owningOrg;if(!r?.id){f(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){f(`Could not infer the owning organization for ${t}: ${Vs(o)}`);return}}function Vs(e){return e instanceof Error?e.message:String(e)}async function Mi(e,t){if(t)return lt(t);let o=ut(),r=await Js({store:e,noPrompt:!o});if(r)return r;let i=await B([],{noPrompt:!o,allowAutomationToken:!0}),{organizations:a}=await mt(i);if(a.length===1)return f(`Using ${a[0].businessName}, the only organization the account belongs to, for ${e}.`),a[0];if(a.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(!o)throw new c(`Could not determine which organization owns ${e}.`,"Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");return T({headline:`Could not determine which organization owns ${e}.`,body:["Select one below, or specify it with",{command:"--organization-id"},{char:"."}]}),Er(a)}var Gi=R(M(),1),We=class e extends Q{static summary="Delete a dev store.";static descriptionWithMarkdown="Deletes a dev store from your organization.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --json","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --force"];static flags={...y,...w,store:b.store,"organization-id":b["organization-id"],force:Gi.Flags.boolean({char:"f",description:"Skip confirmation. Required if non interactive.",env:"SHOPIFY_FLAG_FORCE",default:!1})};static get jsonOutputSchema(){return Je}async run(){let{flags:t}=await this.parse(e);try{if(!t.force&&!st())throw new c(`Deleting the dev store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Mi(t.store,t["organization-id"]?.toString());if(!t.force&&!await Lo({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new Ro;await Bi({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof c&&(S(Je.encode({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1})),process.exit(1)),o}}};n();n();n();var Vi=R(Oa(),1);async function Ws(e){if(e.query!==void 0){if(!e.query.trim())throw new c("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await Ce(e.queryFile))throw new c(d`Query file not found at ${u.path(e.queryFile)}. Please check the path and try again.`);let t=await Ne(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new c(d`Query file at ${u.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new J("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Ji(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new c(d`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Qs(e,t){if(e!==void 0){if(!e.trim())throw new c(d`The ${u.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Ji(JSON.parse(e),u.yellow("--variables"))}catch(o){if(o instanceof c)throw o;let r=o instanceof Error?o.message:"Unknown error";throw new c(d`Invalid JSON in ${u.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);let o=await Ne(t,{encoding:"utf8"});try{return Ji(JSON.parse(o),u.path(t))}catch(r){if(r instanceof c)throw r;let i=r instanceof Error?r.message:"Unknown error";throw new c(d`Invalid JSON in variable file ${u.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function Ys(e){let t;try{t=(0,Vi.parse)(e)}catch(r){throw r instanceof Error?new c(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new c("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function Ks(e){return e.operationDefinition.operation==="mutation"}function Xs(e,t=!1){if(Ks(e)&&!t)throw new c("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Wi(e){let t=await Ws({query:e.query,queryFile:e.queryFile}),o=Ys(t);Xs(o,e.allowMutations);let r=await Qs(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();var Ie=x({name:"StoreExecuteResult",schema:s.object({data:s.record(s.unknown()).nullable().describe("GraphQL response data, preserving query fields and aliases."),extensions:s.record(s.unknown()).optional().describe("Response-level GraphQL metadata, when returned by the API.")}).strict()});n();function Pt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Qi(e){if(!Pt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Yi=["the user aborted a request","the operation was aborted"];function Zs(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Yi.some(o=>t.includes(o))}function Qe(e,t){if(Qi(e)===402)return new c(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(Zs(e))return new c(`Request to ${t} was aborted before it completed.`)}function Ye(e,t){let o=Qi(e);o!==401&&o!==404||(Se(t.store,t.userId),At(t))}var ec=`
|
|
94
|
+
Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;static jsonOutputSchema=qe;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];static flags={...y,...w,store:b.store,...ni};async run(){let{flags:t}=await this.parse(e),o=await Sr({query:t.query,queryFile:t["query-file"]}),r=await Si({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,allowMutations:t["allow-mutations"],...t.version&&{version:t.version}}),i=t.json?"json":"text";xe("Starting bulk operation.",{storeFqdn:r.adminSession.storeFqdn,version:r.version});let a=await gi(r);await yi(a,{format:i,watch:r.watch,outputFile:t["output-file"]})}};n();n();async function wi(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await wr({...e,version:t});return{store:e.adminSession.storeFqdn,apiVersion:t,operationId:e.operationId,operation:o??null}}async function ki(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await kr({...e,version:t,first:100});return{store:e.adminSession.storeFqdn,apiVersion:t,operations:o}}n();function bi(e,t){if(t==="json"){g(_t.encode({...X(e),..."operation"in e?{operationGid:e.operationId,operation:e.operation?Z(e.operation):null}:{operations:e.operations.map(Z),pageInfo:{hasNextPage:e.operations.length<100?!1:null}}}));return}if("operation"in e){e.operation?ls(e.operation):W({headline:"Bulk operation not found.",body:d`ID: ${u.yellow(e.operationId)}`.value});return}let o=e.operations.map(r=>({id:ye(r.id),status:hs(r.status),count:Ss(r.objectCount),dateCreated:Yt(new Date(String(r.createdAt))),dateFinished:r.completedAt?Yt(new Date(String(r.completedAt))):"",results:gs(r.url??r.partialDataUrl)}));ro(),o.length===0?I({body:"No bulk operations found in the last 7 days."}):he({rows:o,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),ro()}function ls(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:p}=e,m=mt(e).value,l=fs(r,i),S=d`ID: ${u.yellow(t)}\n${l}`.value;if(o==="COMPLETED"){let O=a?u.link("Download results",a):"";T({headline:m,body:d`${S}\n${O}`.value})}else if(o==="FAILED"){let O=p?u.link("Download partial results",p):"";W({headline:m,body:d`${S}\n${O}`.value})}else I({headline:m,body:S})}function fs(e,t){let o=new Date;return t?`Finished ${Kt(new Date(String(t)),o)}`:`Started ${Kt(new Date(String(e)),o)}`}function hs(e){return e==="COMPLETED"?st.green(e):e==="FAILED"?st.red(e):st.dim(e)}function Ss(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function gs(e){return e?d`${u.link("download",e)}`.value:""}var ze=class e extends k{static summary="Check the status of bulk operations on a store.";static descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";static jsonOutputSchema=_t;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:oi};async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await Ae(t.store);xe(t.id?"Checking bulk operation status.":"Listing bulk operations.",{storeFqdn:r.storeFqdn});let i=t.id?await wi({adminSession:r,operationId:t.id}):await ki({adminSession:r});bi(i,o)}};n();var fo=R(M(),1),Be=class e extends k{static hidden=!0;static summary="Authenticate for store commands.";static descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup or stdin.";static jsonOutputSchema=be;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","printf %s <signup-jwt> | <%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];static flags={...y,...w,store:b.store,scopes:fo.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:fo.Flags.string({description:"Provide JWT for the store. When omitted, the JWT is read from stdin.",env:"SHOPIFY_FLAG_SIGNUP",required:!1})};async run(){let{flags:t}=await this.parse(e),o=ws(t.signup)??await ks();await Ot({store:t.store,scopes:t.scopes,signup:o},{presenter:ve(t.json?"json":"text")})}},ys=8*1024,vi="Missing signup JWT.",Ai="Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.";function ws(e){let t=e?.trim();return t===""?void 0:t}async function ks(e=process.stdin){if(e===process.stdin&&!Uo())throw new c(vi,Ai);let t=[],o=0;for await(let i of e){let a=Buffer.isBuffer(i)?i:Buffer.from(i);if(o+=a.length,o>ys)throw new c("The input piped to stdin is too large to be a signup JWT.","Pipe only the signup JWT.");t.push(a)}let r=Buffer.concat(t).toString("utf8").trim();if(!r)throw new c(vi,Ai);return r}n();n();n();var Oe=s.object({error:s.literal(!0),message:s.string(),nextSteps:s.array(s.unknown()).describe("Suggested next steps, as text or formatted UI tokens."),exitCode:s.literal(1)});var ho=x({name:"CreateDevStoreResult",schema:s.union([ao.schema,Oe]),definitions:{...ao.definitions,StoreCommandError:Oe}});n();var xi={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var Oi=Fr,Ii=Cr,Ti=Pr;var je=R(M(),1),He=class e extends Q{static summary="Create a new dev store.";static descriptionWithMarkdown="Creates a new dev store in your organization.";static jsonOutputSchema=ho;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>",'<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --demo-data','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --json'];static flags={...y,...w,name:dt(je.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":dt(b["organization-id"]),plan:dt(je.Flags.string({description:"The Shopify plan to use for the new dev store.",options:io,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":je.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":je.Flags.boolean({description:"Populate the new dev store with demo data.",allowNo:!0,env:"SHOPIFY_FLAG_STORE_DEMO_DATA"}),country:It};async run(){let{flags:t}=await this.parse(e),o=await ft(t["organization-id"]?.toString()),r=t.name??await Oi(),i=t.plan??await Ii(),a=t["demo-data"]??(pt()?await Ti():!1);try{await so({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:a,country:t.country,json:t.json})}catch(p){throw t.json&&p instanceof c&&(g(ho.encode({error:!0,message:p.message,nextSteps:p.nextSteps??[],exitCode:1})),process.exit(1)),p}}};n();n();n();var bs="X-Shopify-CLI-Instance",vs="X-Shopify-CLI-Version",Ei;function As(){return Ei??=new Co({projectName:"shopify-cli-store"}),Ei}var Me=class extends c{status;constructor(t,o,r){super(o,r??null),this.status=t}};function _i(e=As()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=it();return e.set("cliInstanceId",o),o}function Ni(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${Vt}`,[bs]:e,[vs]:Vt}}function xs(e){return Ni(e)}function Os(e,t){return{...Ni(e),authorization:t,"X-Shopify-Access-Token":t}}async function Fi(e,t={}){let r=`https://${await eo()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await Zt(r,{method:"POST",headers:xs(_i(t.storage)),body:i}),p=await a.text();if(!a.ok){let l=Is(a.status,p);throw new c(l.message,l.tryMessage)}let m;try{m=JSON.parse(p)}catch(l){let S=l instanceof Error?l.message:"Unknown error";throw new c("Preview store creation returned a non-JSON response.",`Parse error: ${S}. Body (truncated): ${Ft(p).slice(0,500)}`)}return Es(m)}async function Ci(e,t={}){let r=`https://${await eo()}/services/preview-stores/${e.shopId}`,i=await Zt(r,{method:"GET",headers:Os(_i(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=Ts(i.status,a);throw new Me(i.status,m.message,m.tryMessage)}let p;try{p=JSON.parse(a)}catch(m){let l=m instanceof Error?m.message:"Unknown error";throw new c("Preview store lookup returned a non-JSON response.",`Parse error: ${l}. Body (truncated): ${Ft(a).slice(0,500)}`)}return _s(p)}function Is(e,t){let o=Pi(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=Ft(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Pi(e){if(e.length===0)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object")return{};let o=t;return{...typeof o.error_code=="string"?{error_code:o.error_code}:{},...typeof o.message=="string"?{message:o.message}:{}}}catch(t){if(t instanceof SyntaxError)return{};throw t}}function Ts(e,t){let o=Pi(t),r=Ft(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function Es(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,p=typeof e.access_url=="string"?e.access_url:void 0,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,l=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(S=>typeof S=="string"):void 0;if(!o||!r||!i||!a||!p||!l)throw new c("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(Ns(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:l,accessUrl:p,...m?{placeholderAccountUuid:m}:{}}}function _s(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,p=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new c("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(Fs(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...p?{claimUrl:p}:{}}}function Ns(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Ft(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function Fs(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var Cs={createPreviewStore:Fi,setStoredStoreAppSession:Se,recordStoreFqdnMetadata:N,setLastSeenUserId:q,now:()=>new Date};async function Di(e,t={}){let o={...Cs,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Ds(r,e.country,o)}function Ps(e){return e.placeholderAccountUuid??e.shop.id}async function Ds(e,t,o){let r=o.now().toISOString(),i=Ps(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:H,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl,type:"preview",authScopes:e.adminApiScopes},next_steps:Ls(e.shop.domain)}}function Ls(e){return[`Use \`shopify store open --store ${e}\` to preview the storefront.`,`Use \`shopify store execute --store ${e}\` to add products, collections, pages, and more.`,`Use \`shopify theme pull --store ${e}\` and \`shopify theme push --store ${e}\` to edit your store design.`]}n();n();var Li=A.pick({id:!0,name:!0,subdomain:!0,country:!0}).extend({storefrontUrl:s.string(),type:s.literal("preview").optional(),authScopes:A.shape.authScopes.describe("Preapproved Admin API scopes for the preview store.")}),Ct=x({name:"CreatePreviewStoreResult",schema:s.object({status:s.literal("success"),message:s.string(),store:Li,next_steps:s.array(s.string())}),definitions:{PreviewStore:Li}});function Ri(e,t){if(t==="json"){g(Ct.encode(e));return}qs(e)}function Rs(e){return e.split(/(`[^`]+`)/).map(t=>t.startsWith("`")&&t.endsWith("`")?{command:t.slice(1,-1)}:t)}function qs(e){T({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:e.next_steps.map(Rs)}}}]})}var qi=R(M(),1),Ge=class e extends k{static summary="Create a preview Shopify store.";static descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";static jsonOutputSchema=Ct;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];static flags={...y,...w,name:qi.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:It};async run(){let{flags:t}=await this.parse(e),o=await j({title:d`Creating store`,task:async()=>Di({name:t.name,country:t.country})});Ri(o,t.json?"json":"text")}};n();n();var $i=s.object({domain:A.shape.subdomain,deletionRequested:s.literal(!0),deletionConfirmed:s.boolean()}),Je=x({name:"DeleteDevStoreResult",schema:s.union([s.object({store:$i,organization:ce,message:s.string().optional()}),Oe]),definitions:{DeletedStore:$i,StoreOrganization:ce,StoreCommandError:Oe}});n();n();n();n();var Ui={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},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:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"5"}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}],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:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"developerPreviewHandle"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"ownerDetails"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"email"}},{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:"__typename"}}]}}]}}]};async function zi(e){let t=await Ve(e);if(!t)throw new c(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return t}async function Ve(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r={id:e.organizationId,businessName:e.organizationName},a=(await K(r,{query:Ui,token:t,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],p=e.store.toLowerCase(),m=a.find(l=>z(l.node.primaryDomain)===p)?.node;if(m)return{shopifyShopId:m.shopifyShopId??void 0,name:m.name,primaryDomain:m.primaryDomain??void 0,storeType:m.storeType??void 0,developerPreviewHandle:m.developerPreviewHandle??void 0,planName:m.planName??void 0,ownerName:m.ownerDetails?.fullName??void 0,ownerEmail:m.ownerDetails?.email??void 0}}n();var Bi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"storeFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}}}],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:"code"}},{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"}}]}}]}}]};n();var ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationAccessibleShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopifyShopID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShop"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var $s="cancelled",Us=5,zs=300*1e3;async function Mi(e){let{organization:t,store:o}=e,r=await B([],{allowAutomationToken:!0}),i=V(),a=await Hi({store:o,organization:t,token:r}),m=(await K(t,{query:Bi,token:r,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!m)throw new c("Store deletion failed: unexpected empty response.");let l=m.userErrors;if(l&&l.length>0){let O=l.map(h=>h.message).join(", ");throw new c(`Failed to delete dev store: ${O}`)}if(m.success===!1)throw new c("Store deletion failed.");a??=await Hi({store:o,organization:t,token:r});let S=a?await js({shopifyShopId:a,organization:t,token:r,unauthorizedHandler:i}):!1;e.json?g(Ms({store:o,organization:t,deletionConfirmed:S})):S?T({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):ie({headline:`Dev store "${o}" deletion was requested, but not confirmed.`,body:["Shopify accepted the deletion request, but deletion was not confirmed before the CLI stopped waiting.","The store may still finish deleting asynchronously."]})}async function Hi(e){let{store:t,organization:o,token:r}=e;return(await Ve({store:t,organizationId:o.id,organizationName:o.businessName,token:r}))?.shopifyShopId}function Bs(e){let t=String(e),o=t.match(/^(?:gid:\/\/shopify\/Shop\/)?(\d+)$/)?.[1];if(!o)throw new Error(`Invalid Shopify shop ID: ${t}`);return Buffer.from(`gid://organization/ShopifyShop/${o}`).toString("base64url")}async function js(e){let t=Bs(e.shopifyShopId);return j({title:d`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>zs)return!1;if((await K(e.organization,{query:ji,token:e.token,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===$s.toLowerCase())return!0;o(d`${Hs()}`),await $o(Us)}},renderOptions:{stdout:process.stderr}})}function Hs(){return"Waiting for deletion confirmation"}function Ms(e){let{store:t,organization:o,deletionConfirmed:r}=e;return Je.encode({store:{domain:t,deletionRequested:!0,deletionConfirmed:r},organization:{id:o.id,name:o.businessName},...r?{}:{message:"Deletion was requested, but has not been confirmed yet. The store may still finish deleting asynchronously."}})}n();n();n();var Gi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var Ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ie=class extends c{};async function Pt(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r=z(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await to({query:Gi,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(S=>Vs(S,r));if(!m)throw new Ie(`Couldn't find a store with domain ${e.store} for the current account.`,Gs());let l=await Js(String(m.publicId),t,o);return{...l?{owningOrg:l}:{}}}function Gs(){let e="Check the domain (it must be the permanent `myshopify.com` domain)";return at()?`${e} and that the service account has access to the store: it can open the stores it created, or any store in an organization where it has Dev store management access. Inactive stores aren't searchable.`:`${e} and that you're logged in to an account with access to the store. Inactive stores aren't searchable.`}async function Js(e,t,o){try{let i=(await to({query:Ji,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?Tr(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${Ws(r)}`);return}}function Vs(e,t){return[e.primaryDomain,e.webUrl].some(o=>z(o)===t)}function Ws(e){return e instanceof Error?e.message:String(e)}async function Qs(e){let{store:t}=e;try{let r=(await Pt(e)).owningOrg;if(!r?.id){f(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){f(`Could not infer the owning organization for ${t}: ${Ys(o)}`);return}}function Ys(e){return e instanceof Error?e.message:String(e)}async function Vi(e,t){if(t)return ft(t);let o=pt(),r=await Qs({store:e,noPrompt:!o});if(r)return r;let i=await B([],{noPrompt:!o,allowAutomationToken:!0}),{organizations:a}=await lt(i);if(a.length===1)return f(`Using ${a[0].businessName}, the only organization the account belongs to, for ${e}.`),a[0];if(a.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(!o)throw new c(`Could not determine which organization owns ${e}.`,"Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");return I({headline:`Could not determine which organization owns ${e}.`,body:["Select one below, or specify it with",{command:"--organization-id"},{char:"."}]}),Nr(a)}var Wi=R(M(),1),We=class e extends Q{static summary="Delete a dev store.";static descriptionWithMarkdown="Deletes a dev store from your organization.";static jsonOutputSchema=Je;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --json","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --force"];static flags={...y,...w,store:b.store,"organization-id":b["organization-id"],force:Wi.Flags.boolean({char:"f",description:"Skip confirmation. Required if non interactive.",env:"SHOPIFY_FLAG_FORCE",default:!1})};async run(){let{flags:t}=await this.parse(e);try{if(!t.force&&!ct())throw new c(`Deleting the dev store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Vi(t.store,t["organization-id"]?.toString());if(!t.force&&!await Ro({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new qo;await Mi({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof c&&(g(Je.encode({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1})),process.exit(1)),o}}};n();n();n();var Yi=R(Ea(),1);async function Ks(e){if(e.query!==void 0){if(!e.query.trim())throw new c("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await Ce(e.queryFile))throw new c(d`Query file not found at ${u.path(e.queryFile)}. Please check the path and try again.`);let t=await Ne(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new c(d`Query file at ${u.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new J("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Qi(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new c(d`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Xs(e,t){if(e!==void 0){if(!e.trim())throw new c(d`The ${u.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Qi(JSON.parse(e),u.yellow("--variables"))}catch(o){if(o instanceof c)throw o;let r=o instanceof Error?o.message:"Unknown error";throw new c(d`Invalid JSON in ${u.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);let o=await Ne(t,{encoding:"utf8"});try{return Qi(JSON.parse(o),u.path(t))}catch(r){if(r instanceof c)throw r;let i=r instanceof Error?r.message:"Unknown error";throw new c(d`Invalid JSON in variable file ${u.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function Zs(e){let t;try{t=(0,Yi.parse)(e)}catch(r){throw r instanceof Error?new c(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new c("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function ec(e){return e.operationDefinition.operation==="mutation"}function tc(e,t=!1){if(ec(e)&&!t)throw new c("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Ki(e){let t=await Ks({query:e.query,queryFile:e.queryFile}),o=Zs(t);tc(o,e.allowMutations);let r=await Xs(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();var Te=x({name:"StoreExecuteResult",schema:s.object({data:s.record(s.unknown()).nullable().describe("GraphQL response data, preserving query fields and aliases."),extensions:s.record(s.unknown()).optional().describe("Response-level GraphQL metadata, when returned by the API.")}).strict()});n();function Dt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Xi(e){if(!Dt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Zi=["the user aborted a request","the operation was aborted"];function oc(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Zi.some(o=>t.includes(o))}function Qe(e,t){if(Xi(e)===402)return new c(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(oc(e))return new c(`Request to ${t} was aborted before it completed.`)}function Ye(e,t){let o=Xi(e);o!==401&&o!==404||(ge(t.store,t.userId),xt(t))}var rc=`
|
|
95
95
|
query StoreExecutePublicApiVersions {
|
|
96
96
|
publicApiVersions {
|
|
97
97
|
handle
|
|
98
98
|
supported
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
`;async function
|
|
101
|
+
`;async function ea(e){try{return(await ne({query:rc,api:"Admin",url:ae(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){Ye(t,e.session);let o=Qe(t,e.adminSession.storeFqdn);throw o||(Dt(t)&&typeof t.response.status=="number"&&t.response.status>=500?new fr(e.adminSession.storeFqdn,t.response.status):t)}}async function ta(e){try{return await j({title:d`Executing GraphQL operation`,task:async()=>{let t,o=await ne({query:e.request.query,api:"Admin",url:ae(e.context.adminSession.storeFqdn,e.context.version,e.context.adminSession),token:e.context.adminSession.token,variables:e.request.parsedVariables,responseOptions:{handleErrors:!1,onResponse:r=>{t=r.extensions}}});return Te.validate({data:o,...t===void 0?{}:{extensions:t}})},renderOptions:{stdout:process.stderr}})}catch(t){Ye(t,e.context.session);let o=Qe(t,e.context.adminSession.storeFqdn);if(o)throw o;if(Dt(t)&&t.response.errors){let{errors:r,extensions:i,data:a}=t.response,p={errors:r,...i===void 0?{}:{extensions:i},...a===void 0?{}:{data:a}},m=new c("GraphQL operation failed.",JSON.stringify({errors:r},null,2));throw m.details=p,m}throw t}}n();async function So(e){le();let t=await $(_(e));return await N(t.store,!0),q(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function nc(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await ea({adminSession:o,session:t});if(!r)return i.filter(m=>m.supported).map(m=>m.handle).sort().reverse()[0];let a=i.map(p=>p.handle);if(a.includes(r))return r;throw new c(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function oa(e){let{adminSession:t,session:o}=await So(e.store),r=await nc({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var ic={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>oa({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>ta({context:e,request:t})};function ra(e){if(e==="admin")return ic;throw new J(`Unsupported store GraphQL API target: ${e}`)}async function na(e){await N(e.store,!1);let t=ra(e.api??"admin"),o=await Ki({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await j({title:d`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:r,request:o})}n();function ia(e){if(e){T({headline:"Operation succeeded.",body:`Results written to ${e}`});return}T({headline:"Operation succeeded."})}async function aa(e,t,o="text"){let r=o==="json"?Te.encode(e):JSON.stringify(e.data,null,2);if(t){await Fe(t,r),o==="text"&&ia(t);return}o==="text"&&ia(),g(r)}var ee=R(M(),1),Ke=class e extends k{static summary="Execute GraphQL queries and mutations on a store.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";static jsonOutputSchema=Te;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',`<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,'<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations','<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json'];static flags={...y,...w,query:ee.Flags.string({char:"q",description:"The GraphQL query or mutation, as a string.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":ee.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async t=>G(t),exactlyOne:["query","query-file"]}),variables:ee.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES",exclusive:["variable-file"]}),"variable-file":ee.Flags.string({description:"Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async t=>G(t),exclusive:["variables"]}),store:b.store,version:ee.Flags.string({description:"The API version to use for the query or mutation. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"output-file":ee.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async t=>G(t)}),"allow-mutations":ee.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};async run(){let{flags:t}=await this.parse(e),o=await na({store:t.store,query:t.query,queryFile:t["query-file"],variables:t.variables,variableFile:t["variable-file"],version:t.version,allowMutations:t["allow-mutations"]});await aa(o,t["output-file"],t.json?"json":"text")}};n();n();async function sa(e){le();let t=ac(e.store),o=Lr();await Rr({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,outputFormat:e.outputFormat,additionalReadyMessages:[d`Mutations are ${e.allowMutations?u.green("allowed"):u.yellow("blocked")}.`],abortSignal:e.abortSignal})}function ac(e){return{getToken:async t=>(await $(e,t)).accessToken,refreshToken:async t=>(await $(e,t)).accessToken}}var Lt=R(M(),1);var Xe=class e extends k{static summary="Open a local GraphiQL UI for a store.";static descriptionWithMarkdown="Opens an authenticated Admin API GraphiQL UI for the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";static jsonOutputSchema=Dr;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --allow-mutations","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];static flags={...y,...w,store:b.store,port:jo({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":Lt.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:Lt.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:Lt.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};async run(){let{flags:t}=await this.parse(e);return this.runWithParsedOutput(t,async()=>{await sa({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version,outputFormat:t.json?"json":"text"})})}};n();n();n();function Rt(e){if(e)return xi[e.toLowerCase()]}function ca(e){return e?oe(e):""}n();var sc={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client-transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function qt(e){if(e)return sc[e]}function ua(e){return e?oe(e):""}var pa={dev:"development_superset",production:"production","client-transfer":"client_transfer",collaborator:"collaborator"},$t=Object.keys(pa);function da(e){return pa[e]}var cc=`#graphql
|
|
102
102
|
query StoreInfoAdminShop {
|
|
103
103
|
shop {
|
|
104
104
|
id
|
|
@@ -112,8 +112,8 @@ Re-run this command if the stored token is missing, expires, or no longer has th
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
`;async function
|
|
115
|
+
`;async function Ut(e){let t=e.store;if(!t)throw new c("No store specified.","Pass the `myshopify.com` domain via the `--store` flag, e.g. `shopify store info --store shop.myshopify.com`.");let o=at()?void 0:Y(t);if(lc(o)){await N(o.store,!0,o.preview.shopId),q(o.userId);let i=await fc(o);return wc({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await pc(t,{noPrompt:r})}catch(i){if(!r||!Sc(i))throw i;return f(`BP store info lookup failed; falling back to stored store auth: ${go(i)}`),uc(t)}}async function uc(e){let t=await $(e);await N(t.store,!0),q(t.userId);let o=await mc(t);return{...yc({store:t.store,shop:o}),authScopes:t.scopes}}async function pc(e,t={}){let o;try{o=await Pt({store:e,noPrompt:t.noPrompt})}catch(i){if(!(i instanceof Ie))throw i;let a=await dc(e,t);if(!a)throw i;return a}let r=await hc(o,e,{noPrompt:t.noPrompt});return ma({store:e,destinationsCtx:o,orgShop:r})}async function dc(e,t){let o;try{let i=await Er();if(i.length!==1)return;o=i[0]}catch(i){f(`Could not list the account's organizations: ${go(i)}`);return}let r;try{r=await Ve({store:e,organizationId:o.id,noPrompt:t.noPrompt})}catch(i){f(`BP Organizations shop lookup in ${o.businessName} failed: ${go(i)}`);return}if(r)return f(`Found ${e} in ${o.businessName}, the only organization the account belongs to.`),ma({store:e,destinationsCtx:{owningOrg:{id:o.id,name:o.businessName}},orgShop:r})}async function mc(e){try{let t=await ne({query:cc,api:"Admin",url:ae(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!t.shop)throw new c(`Shopify did not return store information for ${e.store}.`);return t.shop}catch(t){Ye(t,e);let o=Qe(t,e.store);throw o||t}}function lc(e){return e?.kind==="preview"&&e.preview!==void 0}async function fc(e){try{let t=await Ci({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof Me&&(t.status===401||t.status===404)&&(ge(e.store,e.userId),xt(e)),t}}async function hc(e,t,o={}){if(!e.owningOrg?.id){f("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await zi({store:t,organizationId:e.owningOrg.id,organizationName:e.owningOrg.name,noPrompt:o.noPrompt})}catch(r){f(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function Sc(e){return e instanceof Ie||gc(e)}function gc(e){return e instanceof c&&e.message.includes("unable to prompt for reauthentication")}function go(e){return e instanceof Error?e.message:String(e)}function yc(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:kc(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:fa(re(r))};return{...fe(i),subdomain:r}}function ma(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:la(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:bc(r),type:qt(r?.storeType),plan:Rt(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:fa(re(t))};return{...fe(i),subdomain:t}}function wc(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:la(o.preview.shopId),displayName:o.preview.name,type:"preview",country:o.preview.country,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...fe(i),subdomain:t,authScopes:o.scopes}}function la(e){if(e)return`gid://shopify/Shop/${e}`}function kc(e){let t=fe({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function bc(e){if(!e)return;let t=fe({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function fa(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();n();var ha=s.object({name:s.string().optional(),email:s.string().optional()}),zt=x({name:"StoreInfoResult",schema:s.object({id:A.shape.id.optional(),displayName:A.shape.name.optional(),subdomain:A.shape.subdomain,organizationId:A.shape.organizationId.optional(),organizationName:A.shape.organizationName.optional(),storeOwner:ha.optional(),type:A.shape.type,country:A.shape.country.describe("The country selected when creating the preview store, if specified."),plan:A.shape.plan,featurePreview:s.string().optional(),adminUrl:s.string().optional(),accessUrl:s.string().optional(),saveUrl:s.string().optional(),authScopes:A.shape.authScopes}),definitions:{StoreInfoStoreOwner:ha}});function Sa(e,t){if(t==="json"){g(zt.encode(e));return}let o=Ac(e);I({customSections:[{title:"Store details",body:{tabularData:vc(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function vc(e){let t=[];return te(t,"ID",e.id),te(t,"Display Name",e.displayName),te(t,"Subdomain",e.subdomain),te(t,"Organization",e.organizationName),te(t,"Store owner",xc(e.storeOwner)),te(t,"Type",e.type?oe(e.type):void 0),te(t,"Plan",e.plan?oe(e.plan):void 0),te(t,"Feature Preview",e.featurePreview),t}function Ac(e){let t=[];return yo(t,e.adminUrl,"Manage this store in the Shopify admin"),yo(t,e.accessUrl,"View your store"),yo(t,e.saveUrl,"Save your store"),t}function xc(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function te(e,t,o){o&&e.push([t,o])}function yo(e,t,o){t&&e.push({link:{label:o,url:t}})}var Ze=class e extends k{static summary="Surface metadata about a Shopify store.";static descriptionWithMarkdown=`Returns available metadata about a store you have access to, such as its id, display name, subdomain, organization, store owner, type, plan, feature preview, admin URL, and access and save URLs for preview stores.
|
|
116
116
|
|
|
117
117
|
Some details may be omitted when they are not available for the store.
|
|
118
118
|
|
|
119
|
-
Use \`--json\` for machine-readable output.`;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];static flags={...y,...w,store:b.store};static get jsonOutputSchema(){return Ut}async run(){let{flags:t}=await this.parse(e),o=await $t({store:t.store});la(o,t.json?"json":"text")}};n();n();n();n();n();var fa={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{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:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}}],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:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{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:"__typename"}}]}}]}}]};async function ha(e){let{entries:t,hasMore:o}=await vc(e.token,e.organization,e.storeType);return{entries:t.sort(Oc),hasMore:o}}async function vc(e,t,o){let r=V(),a=(await K(t,{query:fa,token:e,variables:{first:250,filters:Ac(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let p=[];for(let m of a.edges){let l=xc(m.node,t);l&&p.push(l)}return{entries:p,hasMore:a.pageInfo.hasNextPage}}function Ac(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:ca(e)}),t}function xc(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:z(o)??o,...e.primaryDomain?{primaryDomain:z(e.primaryDomain)??e.primaryDomain}:{},createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:Rt(e.storeType),plan:Lt(e.planName)}}function Oc(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function Sa(e={}){let t=await B([],{allowAutomationToken:!0});if(e.organizationId){let i=await Ir(e.organizationId.toString(),t);if(i)return ga(t,i,e.storeType)}let o=await mt(t);if(!o.currentUserResolved)return{stores:[],notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[]};if(!e.organizationId&&o.organizations.length>1&&!st())throw new c("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await Tc(o.organizations,e.organizationId);return ga(t,r,e.storeType)}async function ga(e,t,o){let r=await ha({token:e,organization:t,storeType:o}),{stores:i,truncated:a}=Ec(r.entries,r.hasMore);return{stores:i,organization:Ic(t),...o?{storeType:o}:{},...a?{truncated:!0}:{}}}async function Tc(e,t){if(t){let a=e.find(p=>p.id===t.toString());if(!a)throw new c(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(p=>`${p.businessName} (${p.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await Do({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function Ic(e){return{id:e.id,name:e.businessName}}function Ec(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();n();var ya=s.object({id:A.shape.id.optional(),store:A.shape.subdomain,primaryDomain:s.string().optional().describe("The primary storefront hostname, which may be a custom domain."),createdAt:s.string(),organizationId:A.shape.organizationId,organizationName:A.shape.organizationName,name:A.shape.name.optional(),type:A.shape.type,plan:A.shape.plan}),zt=x({name:"StoreListResult",schema:s.object({stores:s.array(ya),organization:ce.optional(),storeType:s.enum(qt).optional(),notice:s.string().optional(),truncated:s.boolean().optional()}),definitions:{StoreListEntry:ya,StoreListOrganization:ce}});var _c=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function wa(e,t){if(e.notice&&to(e.notice),e.truncated&&to(Nc(e)),t==="json"){S(zt.encode(e));return}Fc(e)}function Nc(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${ka(e.storeType)}${t}. More stores exist.`}function ka(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function Fc(e){T({headline:Cc(e),customSections:[...Pc(e.organization),{body:_c}]}),e.stores.length>0&&Dc(e.stores)}function Cc(e){let t=ka(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function Pc(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function Dc(e){he({rows:e.map(t=>({subdomain:Lc(t.store),name:t.name??"",type:aa(t.type),plan:ia(t.plan),created:yt(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function Lc(e){return wt(e)??e}var yo=R(M(),1),et=class e extends k{static summary="List stores in a Shopify organization.";static descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`. In that case, `--organization-id` is required in non-interactive environments.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --type dev","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w,"organization-id":yo.Flags.integer({description:`${b["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:yo.Flags.string({description:"List only stores of this type.",options:qt,env:"SHOPIFY_FLAG_STORE_TYPE"})};static get jsonOutputSchema(){return zt}async run(){let{flags:t}=await this.parse(e),o=await Sa({organizationId:t["organization-id"],storeType:t.type});wa(o,t.json?"json":"text")}};n();n();var Rc={getStoreInfo:$t,openURL:ct};async function ba(e,t={}){let{getStoreInfo:o,openURL:r}={...Rc,...t},i=await o({store:e.store}),a=qc(i),p=await r(a),m=re(i.subdomain);return{storeDomain:m?`${m}.myshopify.com`:null,url:a,opened:p}}function qc(e){return e.accessUrl??`https://${e.subdomain}`}n();n();var Bt=x({name:"OpenStoreResult",schema:s.object({storeDomain:s.string().regex(/^[^.]+\.myshopify\.com$/).nullable(),url:s.string().url(),opened:s.boolean()}).strict()});function va(e,t){if(t==="json"){S(Bt.encode(e));return}if(e.opened){T({headline:`Opening the storefront for ${e.storeDomain??e.url} in your browser.`});return}T({headline:"Browser didn't open automatically. Open the storefront manually:",body:[d`${u.link(e.url,e.url)}`.value]})}var tt=class e extends k{static summary="Open your Shopify store in the default web browser.";static descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...y,...w,store:b.store};static get jsonOutputSchema(){return Bt}async run(){let{flags:t}=await this.parse(e),o=await ba({store:t.store});va(o,t.json?"json":"text")}};var $c={"store:auth:list":De,"store:auth":Re,"store:bulk:cancel":$e,"store:bulk:execute":Ue,"store:bulk:status":ze,"store:stripe-auth":Be,"store:create:dev":je,"store:create:preview":Ge,"store:delete":We,"store:execute":Ke,"store:graphiql":Xe,"store:info":Ze,"store:list":et,"store:open":tt},Ht=$c;n();var jt={"app:build":Lr,"app:bulk:cancel":Rr,"app:bulk:status":qr,"app:deploy":Hr,"app:dev":jr,"app:dev:clean":An,"app:security:check":Mr,"app:security:clean":Gr,"app:security:instructions":Jr,"app:security:record":Vr,"app:security:review":Wr,"app:logs":Qr,"app:import:channel-config":On,"app:import:custom-data-definitions":Tn,"app:import:dashboard-extensions":cn,"app:import-custom-data-definitions":In,"app:import-extensions":un,"app:info":pn,"app:init":dn,"app:config:validate":mn,"app:release":ln,"app:subscription-migrations:cancel":fn,"app:subscription-migrations:list":hn,"app:subscription-migrations:schedule":gn,"app:subscription-migrations:status":Sn,"app:subscription-migrations:unschedule":yn,"app:config:link":$r,"app:config:use":Ur,"app:config:pull":zr,"app:env:pull":Yr,"app:env:show":Kr,"app:execute":Zr,"app:graphiql":en,"app:bulk:execute":Xr,"app:function:build":tn,"app:function:replay":on,"app:function:run":rn,"app:function:info":xn,"app:function:schema":nn,"app:function:typegen":an,"app:generate:extension":sn,"app:versions:list":wn,"app:webhook:trigger":kn,"demo:watcher":Br,"organization:list":En},Uc=vn,zc=bn;var Yk=Dr.init;(0,xa.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async e=>{await ir(e),process.exit(1)});var Bc=process,wo=!1,Hc=["SIGINT","SIGTERM","SIGQUIT"];Hc.forEach(e=>{process.on(e,()=>{wo||(wo=Bc.emit("shopify:signal",e),wo||process.exit(1))})});var Aa=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(Aa)||(process.stdout.columns=Aa);async function jc({development:e}){await zo({moduleURL:import.meta.url,development:e})}ke.plugins.hidden=!0;ke["plugins:install"].description="";var Mc=Object.keys(jt);Mc.forEach(e=>{jt[e].customPluginName="@shopify/app"});var Gc=Object.keys(ft);Gc.forEach(e=>{ft[e].customPluginName="@shopify/theme"});var Jc=Object.keys(ht);Jc.forEach(e=>{ht[e].customPluginName="@shopify/cli-hydrogen"});var Vc=Object.keys(Ht);Vc.forEach(e=>{Ht[e].customPluginName="@shopify/store"});var Wc=Object.keys(gt);Wc.forEach(e=>{gt[e].customPluginName="@oclif/plugin-commands"});var Qc=Object.keys(St);Qc.forEach(e=>{St[e].customPluginName="@shopify/plugin-did-you-mean"});var Yc=Object.keys(ke);Yc.forEach(e=>{ke[e].customPluginName="@oclif/plugin-plugins"});var Kk={...jt,...ft,...ke,...St,...gt,...ht,...Ht,search:jo,upgrade:Mo,version:Ho,"send-analytics":Go,help:nr,"auth:logout":Jo,"auth:login":Vo,"debug:command-flags":Wo,"kitchen-sink":Xo,"kitchen-sink:async":Qo,"kitchen-sink:prompts":Yo,"kitchen-sink:static":Ko,"doctor-release":Zo,"doctor-release:theme":er,"doc:fetch":tr,"doc:search":or,"docs:generate":rr,"notifications:list":ar,"notifications:generate":sr,"cache:clear":cr,"config:autoupgrade:off":ur,"config:autoupgrade:on":pr,"config:autoupgrade:status":dr},Xk=jc;export{zc as AppPublicMetadataHook,Uc as AppSensitiveMetadataHook,Kk as COMMANDS,Fa as DidYouMeanHook,Yk as HydrogenInitHook,Na as PluginHook,Ca as TunnelProviderHook,Pa as TunnelStartHook,Xk as default,Ia as fetchStoreThemes,Ea as pull,_a as push};
|
|
119
|
+
Use \`--json\` for machine-readable output.`;static jsonOutputSchema=zt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];static flags={...y,...w,store:b.store};async run(){let{flags:t}=await this.parse(e),o=await Ut({store:t.store});Sa(o,t.json?"json":"text")}};n();n();n();n();n();var ga={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{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:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}}],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:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{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:"__typename"}}]}}]}}]};async function ya(e){let{entries:t,hasMore:o}=await Oc(e.token,e.organization,e.storeType);return{entries:t.sort(Ec),hasMore:o}}async function Oc(e,t,o){let r=V(),a=(await K(t,{query:ga,token:e,variables:{first:250,filters:Ic(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let p=[];for(let m of a.edges){let l=Tc(m.node,t);l&&p.push(l)}return{entries:p,hasMore:a.pageInfo.hasNextPage}}function Ic(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:da(e)}),t}function Tc(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:z(o)??o,...e.primaryDomain?{primaryDomain:z(e.primaryDomain)??e.primaryDomain}:{},createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:qt(e.storeType),plan:Rt(e.planName)}}function Ec(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function ka(e={}){let t=await B([],{allowAutomationToken:!0});if(e.organizationId){let i=await _r(e.organizationId.toString(),t);if(i)return wa(t,i,e.storeType)}let o=await lt(t);if(!o.currentUserResolved)return{stores:[],notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[]};if(!e.organizationId&&o.organizations.length>1&&!ct())throw new c("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await _c(o.organizations,e.organizationId);return wa(t,r,e.storeType)}async function wa(e,t,o){let r=await ya({token:e,organization:t,storeType:o}),{stores:i,truncated:a}=Fc(r.entries,r.hasMore);return{stores:i,organization:Nc(t),...o?{storeType:o}:{},...a?{truncated:!0}:{}}}async function _c(e,t){if(t){let a=e.find(p=>p.id===t.toString());if(!a)throw new c(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(p=>`${p.businessName} (${p.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await Lo({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function Nc(e){return{id:e.id,name:e.businessName}}function Fc(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();n();var ba=s.object({id:A.shape.id.optional(),store:A.shape.subdomain,primaryDomain:s.string().optional().describe("The primary storefront hostname, which may be a custom domain."),createdAt:s.string(),organizationId:A.shape.organizationId,organizationName:A.shape.organizationName,name:A.shape.name.optional(),type:A.shape.type,plan:A.shape.plan}),Bt=x({name:"StoreListResult",schema:s.object({stores:s.array(ba),organization:ce.optional(),storeType:s.enum($t).optional(),notice:s.string().optional(),truncated:s.boolean().optional()}),definitions:{StoreListEntry:ba,StoreListOrganization:ce}});var Cc=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function va(e,t){if(e.notice&&oo(e.notice),e.truncated&&oo(Pc(e)),t==="json"){g(Bt.encode(e));return}Dc(e)}function Pc(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${Aa(e.storeType)}${t}. More stores exist.`}function Aa(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function Dc(e){I({headline:Lc(e),customSections:[...Rc(e.organization),{body:Cc}]}),e.stores.length>0&&qc(e.stores)}function Lc(e){let t=Aa(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function Rc(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function qc(e){he({rows:e.map(t=>({subdomain:$c(t.store),name:t.name??"",type:ua(t.type),plan:ca(t.plan),created:wt(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function $c(e){return kt(e)??e}var wo=R(M(),1),et=class e extends k{static summary="List stores in a Shopify organization.";static descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`. In that case, `--organization-id` is required in non-interactive environments.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";static jsonOutputSchema=Bt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --type dev","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w,"organization-id":wo.Flags.integer({description:`${b["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:wo.Flags.string({description:"List only stores of this type.",options:$t,env:"SHOPIFY_FLAG_STORE_TYPE"})};async run(){let{flags:t}=await this.parse(e),o=await ka({organizationId:t["organization-id"],storeType:t.type});va(o,t.json?"json":"text")}};n();n();var Uc={getStoreInfo:Ut,openURL:ut};async function xa(e,t={}){let{getStoreInfo:o,openURL:r}={...Uc,...t},i=await o({store:e.store}),a=zc(i),p=await r(a),m=re(i.subdomain);return{storeDomain:m?`${m}.myshopify.com`:null,url:a,opened:p}}function zc(e){return e.accessUrl??`https://${e.subdomain}`}n();n();var jt=x({name:"OpenStoreResult",schema:s.object({storeDomain:nt.nullable(),url:s.string().url(),opened:s.boolean()}).strict()});function Oa(e,t){if(t==="json"){g(jt.encode(e));return}if(e.opened){I({headline:`Opening the storefront for ${e.storeDomain??e.url} in your browser.`});return}I({headline:"Browser didn't open automatically. Open the storefront manually:",body:[d`${u.link(e.url,e.url)}`.value]})}var tt=class e extends k{static summary="Open your Shopify store in the default web browser.";static descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";static jsonOutputSchema=jt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...y,...w,store:b.store};async run(){let{flags:t}=await this.parse(e),o=await xa({store:t.store});Oa(o,t.json?"json":"text")}};var Bc={"store:auth:list":De,"store:auth":Re,"store:bulk:cancel":$e,"store:bulk:execute":Ue,"store:bulk:status":ze,"store:stripe-auth":Be,"store:create:dev":He,"store:create:preview":Ge,"store:delete":We,"store:execute":Ke,"store:graphiql":Xe,"store:info":Ze,"store:list":et,"store:open":tt},Ht=Bc;n();var Mt={"app:build":$r,"app:bulk:cancel":Ur,"app:bulk:status":zr,"app:deploy":Gr,"app:dev":Jr,"app:dev:clean":In,"app:security:check":Vr,"app:security:clean":Wr,"app:security:instructions":Qr,"app:security:record":Yr,"app:security:review":Kr,"app:logs":Xr,"app:import:channel-config":En,"app:import:custom-data-definitions":_n,"app:import:dashboard-extensions":dn,"app:import-custom-data-definitions":Nn,"app:import-extensions":mn,"app:info":ln,"app:init":fn,"app:config:validate":hn,"app:release":Sn,"app:subscription-migrations:cancel":gn,"app:subscription-migrations:list":yn,"app:subscription-migrations:schedule":wn,"app:subscription-migrations:status":kn,"app:subscription-migrations:unschedule":bn,"app:config:link":Br,"app:config:use":jr,"app:config:pull":Hr,"app:env:pull":Zr,"app:env:show":en,"app:execute":on,"app:graphiql":rn,"app:bulk:execute":tn,"app:function:build":nn,"app:function:replay":an,"app:function:run":sn,"app:function:info":Tn,"app:function:schema":cn,"app:function:typegen":un,"app:generate:extension":pn,"app:versions:list":vn,"app:webhook:trigger":An,"demo:watcher":Mr,"organization:list":Fn},jc=On,Hc=xn;var eb=qr.init;(0,Ta.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async e=>{await ar(e),process.exit(1)});var Mc=process,ko=!1,Gc=["SIGINT","SIGTERM","SIGQUIT"];Gc.forEach(e=>{process.on(e,()=>{ko||(ko=Mc.emit("shopify:signal",e),ko||process.exit(1))})});var Ia=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(Ia)||(process.stdout.columns=Ia);async function Jc({development:e}){await Bo({moduleURL:import.meta.url,development:e})}ke.plugins.hidden=!0;ke["plugins:install"].description="";var Vc=Object.keys(Mt);Vc.forEach(e=>{Mt[e].customPluginName="@shopify/app"});var Wc=Object.keys(ht);Wc.forEach(e=>{ht[e].customPluginName="@shopify/theme"});var Qc=Object.keys(St);Qc.forEach(e=>{St[e].customPluginName="@shopify/cli-hydrogen"});var Yc=Object.keys(Ht);Yc.forEach(e=>{Ht[e].customPluginName="@shopify/store"});var Kc=Object.keys(gt);Kc.forEach(e=>{gt[e].customPluginName="@oclif/plugin-commands"});var Xc=Object.keys(yt);Xc.forEach(e=>{yt[e].customPluginName="@shopify/plugin-did-you-mean"});var Zc=Object.keys(ke);Zc.forEach(e=>{ke[e].customPluginName="@oclif/plugin-plugins"});var tb={...Mt,...ht,...ke,...yt,...gt,...St,...Ht,search:Mo,upgrade:Go,version:Ho,"send-analytics":Jo,help:ir,"auth:logout":Vo,"auth:login":Wo,"debug:command-flags":Qo,"kitchen-sink":Zo,"kitchen-sink:async":Yo,"kitchen-sink:prompts":Ko,"kitchen-sink:static":Xo,"doctor-release":er,"doctor-release:theme":tr,"doc:fetch":or,"doc:search":rr,"docs:generate":nr,"notifications:list":sr,"notifications:generate":cr,"cache:clear":ur,"config:autoupgrade:off":pr,"config:autoupgrade:on":dr,"config:autoupgrade:status":mr},ob=Jc;export{Hc as AppPublicMetadataHook,jc as AppSensitiveMetadataHook,tb as COMMANDS,Da as DidYouMeanHook,eb as HydrogenInitHook,Pa as PluginHook,La as TunnelProviderHook,Ra as TunnelStartHook,ob as default,Na as fetchStoreThemes,Fa as pull,Ca as push};
|