@shopify/cli 4.8.4 → 4.9.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-QK4RFCB6.js +1 -0
- package/dist/analytics-R6I5APDB.js +1 -0
- package/dist/assets/hydrogen/starter/package.json +1 -1
- package/dist/bootstrap.js +1 -3
- package/dist/chunk-22LJALHJ.js +7 -0
- package/dist/{chunk-APUYMORT.js → chunk-23K3B23N.js} +1 -1
- package/dist/chunk-2KLXRVGQ.js +317 -0
- package/dist/{chunk-QXR5DJC2.js → chunk-2LZQM5JG.js} +1 -1
- package/dist/chunk-2OHSGC4Q.js +1 -0
- package/dist/chunk-2Q3WIH7S.js +6 -0
- package/dist/{chunk-FRRA5MI2.js → chunk-2W6M7YDY.js} +1 -1
- package/dist/{chunk-NHOF2IN6.js → chunk-2YFB3PTV.js} +9 -9
- package/dist/chunk-2YRVHJEY.js +4 -0
- package/dist/{chunk-3CZ7DKE5.js → chunk-3AASYIOA.js} +3 -3
- package/dist/chunk-3DMDSAWK.js +20 -0
- package/dist/{chunk-KWQGJ3VC.js → chunk-3SG5EJFC.js} +1 -1
- package/dist/chunk-3T2WMZHC.js +1 -0
- package/dist/{chunk-773TIA5M.js → chunk-3VYOLEQE.js} +2 -2
- package/dist/chunk-3WVEL423.js +1 -0
- package/dist/{chunk-SVYHWGMI.js → chunk-3ZK5JZLY.js} +1 -1
- package/dist/chunk-44QTWXOJ.js +8 -0
- package/dist/{chunk-4QBJ5JBX.js → chunk-4A7FPJVT.js} +16 -15
- package/dist/chunk-4TQFTZVD.js +18 -0
- package/dist/chunk-4WACZNFF.js +1 -0
- package/dist/{chunk-RIM7FNP3.js → chunk-4XSYMLQG.js} +1 -1
- package/dist/{chunk-EJJPEWSB.js → chunk-4Y22EM45.js} +1 -1
- package/dist/chunk-53U6XS3J.js +1 -0
- package/dist/chunk-55NKAIIT.js +1 -0
- package/dist/chunk-55PABKRC.js +5 -0
- package/dist/chunk-5BLXN5WU.js +1 -0
- package/dist/{chunk-LAMTFOVF.js → chunk-5BYVVXGD.js} +1 -1
- package/dist/{chunk-Z5KYKXMH.js → chunk-5HEBS5DG.js} +3 -3
- package/dist/{chunk-LEW5IJK6.js → chunk-5HONV6NQ.js} +1 -1
- package/dist/chunk-5RL6DKWR.js +5 -0
- package/dist/chunk-5XO6PAMV.js +1 -0
- package/dist/chunk-6DHY67FO.js +6 -0
- package/dist/{chunk-6QADNGH4.js → chunk-6GA56I3E.js} +1 -1
- package/dist/chunk-6IL3B5Z5.js +4 -0
- package/dist/{chunk-RHBLXZGU.js → chunk-6ILP6QCH.js} +1 -1
- package/dist/{chunk-H7TDIRIU.js → chunk-6RBCFXJT.js} +1 -1
- package/dist/{chunk-WAJRWCZY.js → chunk-72HS7MHV.js} +1 -1
- package/dist/{chunk-SPNM3GES.js → chunk-74HXMIDM.js} +1 -1
- package/dist/{chunk-ZAH6QID2.js → chunk-77B77IGP.js} +1 -1
- package/dist/chunk-7DRKDQRT.js +1 -0
- package/dist/chunk-7HDJBEBP.js +3 -0
- package/dist/chunk-7IGMIDKK.js +15 -0
- package/dist/chunk-7QQPAT4L.js +1 -0
- package/dist/chunk-7Y4X5I6N.js +1 -0
- package/dist/{chunk-WGFGWDWP.js → chunk-7ZSN2QT5.js} +1 -1
- package/dist/chunk-A54V5UCD.js +5 -0
- package/dist/{chunk-VETLNJ56.js → chunk-AD4S2VEI.js} +1 -1
- package/dist/chunk-ADW7ECNU.js +7 -0
- package/dist/chunk-AS2O62JX.js +1 -0
- package/dist/chunk-ASUARYJD.js +1 -0
- package/dist/chunk-B4RPJYDH.js +1 -0
- package/dist/{chunk-ZCNNJCTQ.js → chunk-BJOJNAKH.js} +1 -1
- package/dist/chunk-BL5JWD3Y.js +16 -0
- package/dist/chunk-BOFCBTX7.js +1 -0
- package/dist/chunk-BPIQ4YTW.js +1 -0
- package/dist/chunk-C6FZII5S.js +1 -0
- package/dist/{chunk-NBXXTQWA.js → chunk-CACPRKUF.js} +1 -1
- package/dist/{chunk-QVO5CAJN.js → chunk-CHLSNYF7.js} +1 -1
- package/dist/chunk-CMICT4XI.js +1 -0
- package/dist/chunk-CPFAATMO.js +6 -0
- package/dist/{chunk-CSOCXWP6.js → chunk-CSRNHTHO.js} +2 -2
- package/dist/chunk-D3K42KBL.js +9 -0
- package/dist/chunk-DGMRL5DQ.js +1 -0
- package/dist/chunk-DKJPE42V.js +2 -0
- package/dist/{chunk-AIILEPSK.js → chunk-DYA5UUXL.js} +1 -1
- package/dist/chunk-E5ND6RBL.js +1 -0
- package/dist/{chunk-XKHKXUQY.js → chunk-E75DJTAF.js} +1 -1
- package/dist/chunk-ECEOBSGD.js +1 -0
- package/dist/{chunk-NDT3F2PR.js → chunk-EYSZRIUL.js} +1 -1
- package/dist/chunk-FCULF3JA.js +1 -0
- package/dist/chunk-FL34EOXG.js +1 -0
- package/dist/chunk-FW5HGFSZ.js +20 -0
- package/dist/{chunk-XRJCD3AO.js → chunk-G54BKNIX.js} +1 -1
- package/dist/{chunk-74CYT3VX.js → chunk-G7OIACY5.js} +1 -1
- package/dist/{chunk-IHH5XTPV.js → chunk-GALDYSEX.js} +1 -1
- package/dist/{chunk-A5U4KKNV.js → chunk-GDQLA5NB.js} +1 -1
- package/dist/{chunk-6A3TDSON.js → chunk-GJJBOCKD.js} +3 -3
- package/dist/{chunk-TAY7HU7X.js → chunk-GQZPGTG7.js} +20 -20
- package/dist/{chunk-XHXKPRF5.js → chunk-GVRFO4CV.js} +1 -1
- package/dist/chunk-HB3MJYBK.js +1 -0
- package/dist/{chunk-AEUCDGTB.js → chunk-HDQXFGYG.js} +1 -1
- package/dist/chunk-HSTNTHWM.js +1 -0
- package/dist/{chunk-A3U7JDUC.js → chunk-HSZC2LBB.js} +1 -1
- package/dist/chunk-I4FGM6UH.js +8 -0
- package/dist/chunk-I7GYNNCU.js +6 -0
- package/dist/{chunk-ZVA5F4QC.js → chunk-IBTQO3JD.js} +1 -1
- package/dist/{chunk-XWXAFJFC.js → chunk-IISE7SBT.js} +1 -1
- package/dist/chunk-IUZZWXJG.js +3 -0
- package/dist/chunk-IWML2HLC.js +5 -0
- package/dist/{chunk-CTNBSUVU.js → chunk-JA2QZ635.js} +2 -2
- package/dist/chunk-JOJRABPY.js +3 -0
- package/dist/chunk-JQKB3D37.js +1 -0
- package/dist/chunk-JROJL6RV.js +1 -0
- package/dist/{chunk-GINXNPAR.js → chunk-JTPVSO6Y.js} +1 -1
- package/dist/chunk-JWDUSMCA.js +1 -0
- package/dist/{chunk-CBMX6XI7.js → chunk-KLYJDAP6.js} +1 -1
- package/dist/{chunk-4HOJJCZ6.js → chunk-KVROYIUQ.js} +1 -1
- package/dist/chunk-L5XWYTHY.js +836 -0
- package/dist/chunk-LOTGSNS5.js +2 -0
- package/dist/{chunk-FGRW7GT4.js → chunk-LQLFMDVD.js} +1 -1
- package/dist/{chunk-7LZ34C4S.js → chunk-LSWFHTJT.js} +1 -1
- package/dist/{chunk-HYPY5WH6.js → chunk-LV2IWYGL.js} +1 -1
- package/dist/{chunk-W4SGAPPR.js → chunk-LYPNQFWX.js} +1 -1
- package/dist/{chunk-U6URYCC6.js → chunk-MRVQ6XRW.js} +1 -1
- package/dist/chunk-MVVHISCR.js +2 -0
- package/dist/{chunk-UJBMY5WR.js → chunk-N4DE5H65.js} +1 -1
- package/dist/{chunk-W6ST525S.js → chunk-N56BJ3F7.js} +1 -1
- package/dist/{chunk-W4SQE6NR.js → chunk-NF7MOA4K.js} +1 -1
- package/dist/{chunk-7KLPRSQR.js → chunk-NGN7U2UF.js} +1 -1
- package/dist/{chunk-TCFGEOE4.js → chunk-NTVEJYKI.js} +1 -1
- package/dist/chunk-NYABB6XW.js +1 -0
- package/dist/{chunk-DH3DMUE2.js → chunk-O6E7YL7N.js} +2 -2
- package/dist/chunk-OASB6XPV.js +16 -0
- package/dist/{chunk-WY7QF7VU.js → chunk-OBYY45BX.js} +1 -1
- package/dist/chunk-OETFY7FE.js +28 -0
- package/dist/{chunk-QZEDYQVT.js → chunk-OEZATTOS.js} +1 -1
- package/dist/{chunk-D6LQ56XT.js → chunk-OG7SF4FU.js} +1 -1
- package/dist/chunk-OM243CQ6.js +6 -0
- package/dist/chunk-P3Z5RLVV.js +3 -0
- package/dist/{chunk-HINK4QAR.js → chunk-PBBZNGS4.js} +1 -1
- package/dist/chunk-PGTKKP2B.js +11 -0
- package/dist/chunk-PK4ID32C.js +1 -0
- package/dist/{chunk-7FVCUY54.js → chunk-PVOWU77O.js} +1 -1
- package/dist/{chunk-66HW6J57.js → chunk-PXD2WJOI.js} +3 -3
- package/dist/chunk-PXXTSW6I.js +4 -0
- package/dist/{chunk-AU7GNCOK.js → chunk-PZHE37Z4.js} +1 -1
- package/dist/{chunk-TA2M37OB.js → chunk-Q34PKJRR.js} +1 -1
- package/dist/{chunk-S5H5U3PR.js → chunk-Q3O3AFZT.js} +1 -1
- package/dist/chunk-Q45XAEG2.js +16 -0
- package/dist/{chunk-QKTBYAUD.js → chunk-QAXFCAOV.js} +5 -5
- package/dist/{chunk-FY47X4NG.js → chunk-QBGSSUJP.js} +1 -1
- package/dist/chunk-QILWHHAQ.js +1 -0
- package/dist/chunk-QJST4LZX.js +1 -0
- package/dist/chunk-QQN4PJZD.js +1 -0
- package/dist/{chunk-6P5FGN6P.js → chunk-QSKOR3ED.js} +1 -1
- package/dist/{chunk-FRVRTOTF.js → chunk-QTEWTPAQ.js} +2 -2
- package/dist/chunk-QWDJRSJJ.js +1 -0
- package/dist/{chunk-GTAYTMCP.js → chunk-R757TSQ6.js} +1 -1
- package/dist/chunk-RCIU7NHA.js +1 -0
- package/dist/chunk-RGIUP4FW.js +1 -0
- package/dist/{chunk-RDS2WYQH.js → chunk-RHNFWHFY.js} +1 -1
- package/dist/{chunk-VG3YVCZW.js → chunk-S7536EWZ.js} +4 -4
- package/dist/{chunk-VBICZDA4.js → chunk-SDFO7P2M.js} +1 -1
- package/dist/{chunk-JQPPLSFT.js → chunk-SDJNAUU6.js} +1 -1
- package/dist/chunk-SGBLCVUX.js +1 -0
- package/dist/chunk-SJARQZVN.js +3 -0
- package/dist/chunk-SKRUMRB4.js +383 -0
- package/dist/{chunk-5Z6EW3FA.js → chunk-SW5EWGBJ.js} +1 -1
- package/dist/chunk-SXPWOYLT.js +7 -0
- package/dist/chunk-T234RERA.js +7 -0
- package/dist/chunk-TJJVX7CU.js +4 -0
- package/dist/{chunk-L4LDNEFK.js → chunk-TMV37ENR.js} +1 -1
- package/dist/{chunk-BYX7SQPM.js → chunk-TNXZWQZU.js} +1 -1
- package/dist/{chunk-67QK26HI.js → chunk-TO7TXDLU.js} +1 -1
- package/dist/chunk-TSLZNTFM.js +3 -0
- package/dist/{chunk-BG7QQU23.js → chunk-UFU2LGFK.js} +1 -1
- package/dist/chunk-VDDNDA5K.js +15 -0
- package/dist/{chunk-T4V7KOGJ.js → chunk-VFO5OYQ4.js} +1 -1
- package/dist/{chunk-HXVUDGLH.js → chunk-VFP3PUGZ.js} +24 -24
- package/dist/{chunk-6QDOCBD4.js → chunk-VZUHMW5E.js} +4 -3
- package/dist/chunk-W7CBJNXD.js +12 -0
- package/dist/chunk-WCAGYCT7.js +4 -0
- package/dist/{chunk-DPNZWBT5.js → chunk-WNO2V53C.js} +1 -1
- package/dist/{chunk-Y4BBTWM5.js → chunk-WPUQTUDX.js} +1 -1
- package/dist/chunk-WU7MSL3I.js +8 -0
- package/dist/chunk-WXV35TPE.js +1 -0
- package/dist/{chunk-2WATX3XV.js → chunk-XBSWZ6BT.js} +6 -6
- package/dist/chunk-XCNJL7ES.js +1 -0
- package/dist/{chunk-C4Y7PQDQ.js → chunk-XFZDFDZV.js} +1 -1
- package/dist/chunk-XTYSJIZY.js +1 -0
- package/dist/chunk-Y5ZN62VF.js +1 -0
- package/dist/{chunk-PNNW7YQG.js → chunk-YAH5WFYR.js} +3 -3
- package/dist/{chunk-DUNE3INK.js → chunk-YBQKJHZW.js} +1 -1
- package/dist/chunk-YD66PU3Y.js +1 -0
- package/dist/chunk-YGFEUXKQ.js +1 -0
- package/dist/chunk-YJWNM4XO.js +18 -0
- package/dist/{chunk-L3JBKCAS.js → chunk-YQQHBFMA.js} +1 -1
- package/dist/chunk-YRHFPXC3.js +1 -0
- package/dist/chunk-YTJ3EPD3.js +1 -0
- package/dist/chunk-YX5GRXRS.js +2368 -0
- package/dist/chunk-Z35PUKKP.js +7 -0
- package/dist/{chunk-7VQBIGJB.js → chunk-Z3XIZMEM.js} +1 -1
- package/dist/chunk-ZGASBRSQ.js +5 -0
- package/dist/{chunk-OY6L7J53.js → chunk-ZHJ6KA43.js} +1 -1
- package/dist/{chunk-YHTONNIZ.js → chunk-ZO4IBP4B.js} +1 -1
- package/dist/chunk-ZOYSMJ27.js +1 -0
- package/dist/chunk-ZPCCSPAE.js +3 -0
- package/dist/chunk-ZSJXZCAW.js +4 -0
- package/dist/{chunk-CP56F5UR.js → chunk-ZSVR5NEO.js} +1 -1
- package/dist/{chunk-JJJIRCQP.js → chunk-ZUVAHONX.js} +1 -1
- package/dist/chunk-ZVDFCUJT.js +2 -0
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import/channel-config.js +1 -0
- package/dist/cli/commands/app/import/custom-data-definitions.js +1 -0
- package/dist/cli/commands/app/import/dashboard-extensions.js +1 -0
- 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 -0
- package/dist/cli/commands/app/security/clean.js +1 -0
- package/dist/cli/commands/app/security/instructions.js +1 -0
- package/dist/cli/commands/app/security/record.js +1 -0
- package/dist/cli/commands/app/security/review.js +1 -0
- 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 +16 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.d.ts +16 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.d.ts +13 -0
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.d.ts +13 -0
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.d.ts +13 -0
- 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 +2 -0
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.d.ts +431 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.d.ts +11 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/send-analytics.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.d.ts +15 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.d.ts +5 -2
- package/dist/cli/help.js +6 -2
- package/dist/cli/services/commands/auth/login/types.d.ts +11 -0
- package/dist/cli/services/commands/auth/login/types.js +7 -0
- package/dist/cli/services/commands/config/autoupgrade/index.d.ts +3 -0
- package/dist/cli/services/commands/config/autoupgrade/index.js +9 -0
- package/dist/cli/services/commands/config/autoupgrade/result.d.ts +2 -0
- package/dist/cli/services/commands/config/autoupgrade/result.js +15 -0
- package/dist/cli/services/commands/config/autoupgrade/types.d.ts +10 -0
- package/dist/cli/services/commands/config/autoupgrade/types.js +7 -0
- package/dist/cli/services/commands/doc/fetch.d.ts +1 -1
- package/dist/cli/services/commands/doc/fetch.js +11 -2
- package/dist/cli/services/commands/help/index.d.ts +3 -0
- package/dist/cli/services/commands/help/index.js +51 -0
- package/dist/cli/services/commands/help/result.d.ts +2 -0
- package/dist/cli/services/commands/help/result.js +6 -0
- package/dist/cli/services/commands/help/types.d.ts +431 -0
- package/dist/cli/services/commands/help/types.js +71 -0
- package/dist/cli/services/commands/search/index.d.ts +2 -0
- package/dist/cli/services/commands/search/index.js +8 -0
- package/dist/cli/services/commands/search/result.d.ts +2 -0
- package/dist/cli/services/commands/search/result.js +12 -0
- package/dist/cli/services/commands/search/types.d.ts +10 -0
- package/dist/cli/services/commands/search/types.js +7 -0
- package/dist/cli/services/commands/version/index.d.ts +2 -0
- package/dist/cli/services/commands/version/index.js +5 -0
- package/dist/cli/services/commands/version/result.d.ts +2 -0
- package/dist/cli/services/commands/version/result.js +6 -0
- package/dist/cli/services/commands/version/types.d.ts +10 -0
- package/dist/cli/services/commands/version/types.js +7 -0
- package/dist/command-json-schema-Y3N2NUZN.js +1 -0
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-H3UAVGN5.js → conf-store-5ZA3ILWV.js} +1 -1
- package/dist/custom-oclif-loader-VQKMCXNH.js +1 -0
- package/dist/deprecations-PFQXWNF6.js +1 -0
- package/dist/dist-4X53WJBQ.js +1 -0
- package/dist/dist-5M2V3YCM.js +1 -0
- package/dist/environment-ZUTBXY7U.js +1 -0
- package/dist/environments-3RUZ7F4Q.js +1 -0
- package/dist/error-FBSXLW22.js +1 -0
- package/dist/error-handler-D5BURRJ7.js +1 -0
- package/dist/fs-ZLV5W4TV.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 +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/http-proxy-node16-D3JUYA5D.js +38 -0
- package/dist/index.js +13 -14
- package/dist/is-global-GZ5CIXQA.js +1 -0
- package/dist/json-error-2BL3UZ7H.js +1 -0
- package/dist/lib-AD2G3QH3.js +1 -0
- package/dist/lib-VEVNMHDE.js +1 -0
- package/dist/lib-ZQW4E7QU.js +1 -0
- package/dist/local-KAZJAYLX.js +1 -0
- package/dist/metadata-M3ZE24WB.js +1 -0
- package/dist/{morph-BMYYMQNX.js → morph-42EXMN3K.js} +3 -3
- package/dist/node-package-manager-RVPONQBY.js +1 -0
- package/dist/notifications-system-MYEMV7JF.js +1 -0
- package/dist/os-DRUILZZR.js +1 -0
- package/dist/output-SDE274Y5.js +1 -0
- package/dist/{path-MBXP7ZIC.js → path-6YMSTSWG.js} +1 -1
- package/dist/system-5FQ3L5PA.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-TEZZM7SE.js +1 -0
- package/dist/uncaught-error-handler.d.ts +6 -0
- package/dist/uncaught-error-handler.js +33 -0
- package/dist/upgrade-3PIVJYBL.js +1 -0
- package/dist/version-FMWTVLMF.js +1 -0
- package/dist/version-IAMVSP7U.js +1 -0
- package/dist/workerd-WRW4ZUYM.js +18 -0
- package/oclif.manifest.json +2646 -226
- package/package.json +17 -8
- package/dist/analytics-M4OC7RPG.js +0 -1
- package/dist/analytics-RGIJMP4U.js +0 -1
- package/dist/chunk-2HW6VRJT.js +0 -2
- package/dist/chunk-2HYR6EUD.js +0 -1
- package/dist/chunk-2IRRFPEY.js +0 -1
- package/dist/chunk-2KD4LHRT.js +0 -5
- package/dist/chunk-2SL443J6.js +0 -1
- package/dist/chunk-2VJ6NBPV.js +0 -15
- package/dist/chunk-2ZROBXJX.js +0 -11
- package/dist/chunk-3DIRCEXA.js +0 -1
- package/dist/chunk-3DT4NS4S.js +0 -4
- package/dist/chunk-3IQ6WXDD.js +0 -3
- package/dist/chunk-43FRAUV6.js +0 -19
- package/dist/chunk-44QD4QNO.js +0 -1
- package/dist/chunk-4DLRS7MT.js +0 -12
- package/dist/chunk-4F3XYIEY.js +0 -1
- package/dist/chunk-4OMKKYFC.js +0 -9
- package/dist/chunk-4ZTRKEA2.js +0 -1
- package/dist/chunk-5DMFEDKY.js +0 -28
- package/dist/chunk-66G2HJ2A.js +0 -3
- package/dist/chunk-6B727IUY.js +0 -5
- package/dist/chunk-6C5AVMKR.js +0 -375
- package/dist/chunk-6CR2EEZ3.js +0 -6
- package/dist/chunk-6V6UNUMM.js +0 -3
- package/dist/chunk-6XLFFOPK.js +0 -1
- package/dist/chunk-A3V2A2I4.js +0 -2
- package/dist/chunk-AQPOPSQ7.js +0 -1
- package/dist/chunk-BAWBC66R.js +0 -5
- package/dist/chunk-BHJ3TGS7.js +0 -1
- package/dist/chunk-BHTHUKHU.js +0 -1
- package/dist/chunk-BV62ZERJ.js +0 -6
- package/dist/chunk-CFQ5G2QS.js +0 -1
- package/dist/chunk-CNK3ZO2B.js +0 -836
- package/dist/chunk-CRALWNNO.js +0 -1
- package/dist/chunk-CVW2HMQO.js +0 -317
- package/dist/chunk-D6QTOQEJ.js +0 -6
- package/dist/chunk-DDZEYA2I.js +0 -8
- package/dist/chunk-DO4SRE4M.js +0 -3
- package/dist/chunk-DZZORIWL.js +0 -4
- package/dist/chunk-EQ2PD2ZA.js +0 -2
- package/dist/chunk-ERBXXVOZ.js +0 -2
- package/dist/chunk-FW3RORD7.js +0 -1
- package/dist/chunk-G2YTINLI.js +0 -6
- package/dist/chunk-GCN4O7HM.js +0 -1
- package/dist/chunk-GGPMDCCB.js +0 -8
- package/dist/chunk-GJHBAOGJ.js +0 -1
- package/dist/chunk-H2HR2AQE.js +0 -7
- package/dist/chunk-HYM3HBDG.js +0 -20
- package/dist/chunk-IHEBV2KO.js +0 -1
- package/dist/chunk-JWHQPDOK.js +0 -3
- package/dist/chunk-JXG2T76F.js +0 -6
- package/dist/chunk-K2DP5Z76.js +0 -1
- package/dist/chunk-KUZ5Z6HM.js +0 -1
- package/dist/chunk-KZU727AL.js +0 -1
- package/dist/chunk-L2DCUVZV.js +0 -1
- package/dist/chunk-L3M7PTHU.js +0 -15
- package/dist/chunk-LBA6FGKC.js +0 -3
- package/dist/chunk-LX5UXWZ7.js +0 -1
- package/dist/chunk-M7VQLMSW.js +0 -1
- package/dist/chunk-MBRFIXCU.js +0 -1705
- package/dist/chunk-MYLMGH7Y.js +0 -1
- package/dist/chunk-NKC3K3XP.js +0 -1
- package/dist/chunk-O72SHE3Q.js +0 -7
- package/dist/chunk-OAG72Q2O.js +0 -1
- package/dist/chunk-OPOPO7DG.js +0 -7
- package/dist/chunk-OUA6EOLX.js +0 -11
- package/dist/chunk-OYCAYEQE.js +0 -7
- package/dist/chunk-PGWQHSDV.js +0 -1
- package/dist/chunk-PM3HRKPR.js +0 -1
- package/dist/chunk-POMWFTBD.js +0 -16
- package/dist/chunk-R3GLEZSE.js +0 -4
- package/dist/chunk-RHNZA4IL.js +0 -5
- package/dist/chunk-SCLGMVNB.js +0 -1
- package/dist/chunk-TU47HMTL.js +0 -1
- package/dist/chunk-UPGRXCFS.js +0 -4
- package/dist/chunk-V2GLAK2W.js +0 -1
- package/dist/chunk-V4774HTF.js +0 -1
- package/dist/chunk-VDGTHMIQ.js +0 -3
- package/dist/chunk-VJ5YOXKL.js +0 -1
- package/dist/chunk-WGUCRVII.js +0 -3
- package/dist/chunk-X4V2CD2H.js +0 -8
- package/dist/chunk-XOYICV6P.js +0 -1
- package/dist/chunk-XYUTD6IU.js +0 -1
- package/dist/chunk-YNFXYVYN.js +0 -2
- package/dist/chunk-Z2HN5L6G.js +0 -6
- package/dist/chunk-ZVJD6CUY.js +0 -18
- package/dist/cli/commands/app/doctor/instructions.js +0 -1
- package/dist/cli/commands/app/doctor.js +0 -1
- package/dist/cli/commands/config/autoupgrade/constants.d.ts +0 -4
- package/dist/cli/commands/config/autoupgrade/constants.js +0 -1
- package/dist/cli/services/commands/search.d.ts +0 -1
- package/dist/cli/services/commands/search.js +0 -7
- package/dist/cli/services/commands/version.d.ts +0 -1
- package/dist/cli/services/commands/version.js +0 -6
- package/dist/custom-oclif-loader-BWAMUFQ4.js +0 -1
- package/dist/deprecations-TEUM7CML.js +0 -1
- package/dist/dist-62I5X3FS.js +0 -1
- package/dist/dist-YHZ5BTYD.js +0 -1
- package/dist/environments-LAFWOQWO.js +0 -1
- package/dist/error-6ZCGAC5E.js +0 -1
- package/dist/error-handler-JNCW56EC.js +0 -1
- package/dist/fs-QEWOWUPQ.js +0 -1
- package/dist/http-proxy-node16-A6AKKRQH.js +0 -38
- package/dist/is-global-UYMEAGDR.js +0 -1
- package/dist/lib-2BR2WN7L.js +0 -1
- package/dist/lib-M72BVWQ3.js +0 -1
- package/dist/lib-P3APEIHY.js +0 -1
- package/dist/local-Z4ZEMWE4.js +0 -1
- package/dist/metadata-ZCQMB5AB.js +0 -1
- package/dist/node-package-manager-HMOTOBDS.js +0 -1
- package/dist/notifications-system-RT3CY6LZ.js +0 -1
- package/dist/os-G6KDPJMC.js +0 -1
- package/dist/output-BJCZYDNG.js +0 -1
- package/dist/system-T4H2ISV6.js +0 -1
- package/dist/ui-4MQSY5IN.js +0 -1
- package/dist/upgrade-4234MIYJ.js +0 -1
- package/dist/version-FRSRSCRX.js +0 -1
- package/dist/version-RF7QQXRX.js +0 -1
- package/dist/workerd-7E4H2DM3.js +0 -18
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`)}var ke=class e extends
|
|
1
|
+
import{a as mt}from"./chunk-HDQXFGYG.js";import{a as pt,b as Er}from"./chunk-GQZPGTG7.js";import"./chunk-LQ7ENG4V.js";import"./chunk-VFP3PUGZ.js";import{a as Lr}from"./chunk-23K3B23N.js";import{a as An}from"./chunk-7QQPAT4L.js";import{a as Hr}from"./chunk-W7CBJNXD.js";import{a as un}from"./chunk-QWDJRSJJ.js";import{a as pn}from"./chunk-7HDJBEBP.js";import{a as mn}from"./chunk-2OHSGC4Q.js";import{a as dn}from"./chunk-FL34EOXG.js";import{a as ln}from"./chunk-JQKB3D37.js";import"./chunk-ZUVAHONX.js";import"./chunk-SDFO7P2M.js";import"./chunk-N4DE5H65.js";import"./chunk-4Y22EM45.js";import{a as fn}from"./chunk-PK4ID32C.js";import{a as hn}from"./chunk-XBSWZ6BT.js";import{a as H,b as ie,c as an}from"./chunk-MRVQ6XRW.js";import{a as jr}from"./chunk-DKJPE42V.js";import{a as Mr}from"./chunk-ZVDFCUJT.js";import{a as cn}from"./chunk-PXXTSW6I.js";import{a as $r}from"./chunk-2YRVHJEY.js";import"./chunk-HSTNTHWM.js";import{a as Ur}from"./chunk-55NKAIIT.js";import{a as zr}from"./chunk-3WVEL423.js";import"./chunk-OASB6XPV.js";import{a as Br}from"./chunk-7DRKDQRT.js";import"./chunk-HB3MJYBK.js";import"./chunk-RCIU7NHA.js";import"./chunk-QQN4PJZD.js";import"./chunk-YX5GRXRS.js";import{a as tn}from"./chunk-I4FGM6UH.js";import{a as Ir,b as Tr,c as Qr}from"./chunk-IUZZWXJG.js";import{a as vn}from"./chunk-Y5ZN62VF.js";import{a as rn}from"./chunk-YD66PU3Y.js";import"./chunk-AS2O62JX.js";import{a as kn}from"./chunk-T234RERA.js";import{a as bn}from"./chunk-6IL3B5Z5.js";import{a as on}from"./chunk-2LZQM5JG.js";import{a as nn}from"./chunk-VDDNDA5K.js";import{a as Jr}from"./chunk-IWML2HLC.js";import{a as Wr}from"./chunk-PZHE37Z4.js";import{a as Yr}from"./chunk-XCNJL7ES.js";import{a as wn}from"./chunk-YAH5WFYR.js";import{a as Kr}from"./chunk-PXD2WJOI.js";import{a as Xr}from"./chunk-E5ND6RBL.js";import"./chunk-G7OIACY5.js";import{a as Zr}from"./chunk-XTYSJIZY.js";import{a as en}from"./chunk-C6FZII5S.js";import"./chunk-AD4S2VEI.js";import{a as Cr}from"./chunk-ZSJXZCAW.js";import{a as Dr}from"./chunk-OBYY45BX.js";import{a as Pr}from"./chunk-JWDUSMCA.js";import{a as sn}from"./chunk-SJARQZVN.js";import{a as Rr}from"./chunk-4TQFTZVD.js";import"./chunk-MVVHISCR.js";import{a as ut,b as qr}from"./chunk-3DMDSAWK.js";import"./chunk-UOHNRH6E.js";import"./chunk-SXPWOYLT.js";import{a as va}from"./chunk-JOJRABPY.js";import"./chunk-OETFY7FE.js";import"./chunk-OM243CQ6.js";import"./chunk-ZPCCSPAE.js";import{a as Aa}from"./chunk-YBQKJHZW.js";import"./chunk-WU7MSL3I.js";import"./chunk-CSRNHTHO.js";import"./chunk-6ILP6QCH.js";import"./chunk-TSLZNTFM.js";import"./chunk-44QTWXOJ.js";import"./chunk-ADW7ECNU.js";import"./chunk-LQLFMDVD.js";import"./chunk-O6E7YL7N.js";import"./chunk-2YFB3PTV.js";import"./chunk-7IGMIDKK.js";import"./chunk-22LJALHJ.js";import"./chunk-GJJBOCKD.js";import"./chunk-E75DJTAF.js";import"./chunk-I7GYNNCU.js";import"./chunk-J3JPJCWP.js";import"./chunk-VFO5OYQ4.js";import"./chunk-NTVEJYKI.js";import"./chunk-JLGA3B7P.js";import"./chunk-QBGSSUJP.js";import"./chunk-ZHJ6KA43.js";import"./chunk-5HEBS5DG.js";import"./chunk-UFU2LGFK.js";import"./chunk-ECEOBSGD.js";import"./chunk-WPUQTUDX.js";import"./chunk-GVRFO4CV.js";import"./chunk-72HS7MHV.js";import"./chunk-YY6TFARF.js";import"./chunk-LYPNQFWX.js";import{b as ba}from"./chunk-SDJNAUU6.js";import"./chunk-R757TSQ6.js";import{a as B,b as sr,c as Y,d as he,e as Se}from"./chunk-P3Z5RLVV.js";import"./chunk-XFZDFDZV.js";import"./chunk-PVOWU77O.js";import"./chunk-QJST4LZX.js";import"./chunk-IISE7SBT.js";import"./chunk-PBBZNGS4.js";import"./chunk-Z3XIZMEM.js";import"./chunk-Q7BOSHWX.js";import"./chunk-CHLSNYF7.js";import"./chunk-VE35YELD.js";import"./chunk-KVROYIUQ.js";import"./chunk-55PABKRC.js";import"./chunk-TYMYIUIQ.js";import"./chunk-7Y4X5I6N.js";import"./chunk-TMV37ENR.js";import"./chunk-SW5EWGBJ.js";import"./chunk-ZI7LK3LW.js";import"./chunk-5BYVVXGD.js";import{a as yn}from"./chunk-A54V5UCD.js";import{a as Gr}from"./chunk-PGTKKP2B.js";import"./chunk-FKIVKNOV.js";import{a as nr}from"./chunk-CPFAATMO.js";import{a as ir}from"./chunk-2Q3WIH7S.js";import{a as ar}from"./chunk-6DHY67FO.js";import"./chunk-QILWHHAQ.js";import{a as Qo}from"./chunk-NGN7U2UF.js";import{a as _r}from"./chunk-ASUARYJD.js";import"./chunk-WXV35TPE.js";import"./chunk-Q3O3AFZT.js";import{a as Fr}from"./chunk-EYSZRIUL.js";import{a as Vr}from"./chunk-S7536EWZ.js";import{a as Nr}from"./chunk-QTEWTPAQ.js";import"./chunk-HSZC2LBB.js";import{a as se,b as cr,c as ge,e as ye,f as Fe,g as ur,h as pr,i as mr,j as dr,k as lr,l as fr,m as ct,n as hr,o as Sr,p as gr,q as yr,r as wr,s as Zt}from"./chunk-3AASYIOA.js";import"./chunk-JROJL6RV.js";import"./chunk-YGFEUXKQ.js";import"./chunk-3T2WMZHC.js";import"./chunk-JTPVSO6Y.js";import{a as Xo}from"./chunk-GDQLA5NB.js";import{a as Wo}from"./chunk-77B77IGP.js";import{a as Mo}from"./chunk-NF7MOA4K.js";import{a as Vo}from"./chunk-DYA5UUXL.js";import"./chunk-QSKOR3ED.js";import{a as Go}from"./chunk-Q34PKJRR.js";import"./chunk-2W6M7YDY.js";import"./chunk-VUMUCNI7.js";import{a as Jo}from"./chunk-3SG5EJFC.js";import"./chunk-Z35PUKKP.js";import{a as or}from"./chunk-OG7SF4FU.js";import{a as tr}from"./chunk-ZSVR5NEO.js";import"./chunk-ZO4IBP4B.js";import{a as Uo}from"./chunk-BOFCBTX7.js";import"./chunk-WCAGYCT7.js";import{a as qo}from"./chunk-B4RPJYDH.js";import{a as Ho}from"./chunk-4WACZNFF.js";import{a as Bo}from"./chunk-CMICT4XI.js";import{a as rr}from"./chunk-YQQHBFMA.js";import{a as jo}from"./chunk-LSWFHTJT.js";import{a as Yo}from"./chunk-TJJVX7CU.js";import{a as Ko}from"./chunk-RHNFWHFY.js";import{a as Sn}from"./chunk-CACPRKUF.js";import"./chunk-2KLXRVGQ.js";import"./chunk-LV2IWYGL.js";import"./chunk-YLQ3LNNY.js";import"./chunk-VJEKDBGZ.js";import{a as J,b as kr,c as br,d as vr,f as Ne,h as eo,i as A,j as ce,k as to,l as oo,m as Ar,n as xr,o as Or}from"./chunk-Q45XAEG2.js";import"./chunk-5HONV6NQ.js";import"./chunk-IBTQO3JD.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import"./chunk-F3TMLDLC.js";import{e as ae}from"./chunk-NYABB6XW.js";import"./chunk-4A7FPJVT.js";import"./chunk-KLYJDAP6.js";import"./chunk-7ZSN2QT5.js";import{a as gn}from"./chunk-4XSYMLQG.js";import"./chunk-6RBCFXJT.js";import{a as Ta}from"./chunk-3ZK5JZLY.js";import{d as Ia}from"./chunk-TNXZWQZU.js";import{a as Zo}from"./chunk-BPIQ4YTW.js";import{a as $o}from"./chunk-D3K42KBL.js";import{a as zo}from"./chunk-ZOYSMJ27.js";import{a as er,b as ka}from"./chunk-VZUHMW5E.js";import{a as Lo,b as y,c as w,e as Ro,f as st}from"./chunk-DGMRL5DQ.js";import"./chunk-LOTGSNS5.js";import{c as dt,d as Oa}from"./chunk-BL5JWD3Y.js";import{b as Q}from"./chunk-FW5HGFSZ.js";import"./chunk-LFOBYEWG.js";import{B as q,L as V,aa as le,b as wa,ba as oe,ga as Yt,ia as re,j as Vt,k as Wt,q as Qt,u as _}from"./chunk-L5XWYTHY.js";import"./chunk-ZDF5N422.js";import"./chunk-6GA56I3E.js";import"./chunk-MPW2YJWU.js";import{e as Io}from"./chunk-QAXFCAOV.js";import{a as Ht}from"./chunk-RGIUP4FW.js";import"./chunk-74HXMIDM.js";import"./chunk-T7KHS6RF.js";import{A as ne,B as W,F as _o,G as fe,I as z,K as Fo,M as nt,N as it,T as Co,V as at,Z as Po,a as Oo,y as I,z as T}from"./chunk-SKRUMRB4.js";import"./chunk-7Y7AZRL3.js";import"./chunk-53U6XS3J.js";import"./chunk-OEZATTOS.js";import"./chunk-5HBIIYSK.js";import"./chunk-GB3YC4TI.js";import{b as xo,d as ot}from"./chunk-YTJ3EPD3.js";import"./chunk-YRHFPXC3.js";import{a as x}from"./chunk-5RL6DKWR.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import{d as To,e as Eo}from"./chunk-G54BKNIX.js";import{i as c,k as No,l as G}from"./chunk-FCULF3JA.js";import{a as we,b as xa}from"./chunk-N56BJ3F7.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-TO7TXDLU.js";import"./chunk-BJOJNAKH.js";import{Cb as u,Eb as m,Ib as g,Kb as P,Mb as Do,Nb as f,Ob as Kt,Pb as Xt,R as vo,Xa as _e,Z as Ao,b as s,ba as te,c as jt,d as Mt,fa as Gt,ka as Jt,qa as Te,ya as Ee}from"./chunk-YJWNM4XO.js";import{i as rt}from"./chunk-B4OMIONW.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-SGBLCVUX.js";import{b as bo}from"./chunk-5XO6PAMV.js";import"./chunk-WNO2V53C.js";import{b as j}from"./chunk-JA2QZ635.js";import"./chunk-JD5P5RAJ.js";import{f as M}from"./chunk-3VYOLEQE.js";import"./chunk-TR4OWSEX.js";import"./chunk-ZGASBRSQ.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-ET2CGROE.js";import"./chunk-TOLPNBZK.js";import{e as R,g as n}from"./chunk-VKWPEFWQ.js";n();var ya=R(ka(),1);n();n();n();n();function ro(e){return sr(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 Ea=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function lt(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Ea.format(t)}function ft(e){let t=H(e);if(t)return t.split(".")[0]}function xn(){let e=ro().map(t=>({subdomain:ft(t.store)??t.store,connected:lt(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 ht=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:ht.optional()}),ke=x({name:"StoreAuthResult",schema:ue.omit({associatedUser:!0}).extend({hasRefreshToken:s.boolean(),associatedUser:ue.shape.associatedUser}),definitions:{StoreAuthAssociatedUser:ht}});var On=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.")}),St=x({name:"StoreAuthListResult",schema:s.object({sessions:s.array(On),message:s.string().optional()}),definitions:{StoreAuthListSession:On,StoreAuthAssociatedUser:ht}});function In(e,t){if(t==="json"){g(St.encode(e));return}Fa(e)}function Fa(e){if(e.sessions.length===0){P(e.message??"");return}fe({rows:e.sessions.map(({subdomain:t,connected:o})=>({subdomain:t,connected:o})),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}var Ce=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 description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w};static get jsonOutputSchema(){return St}async run(){let{flags:t}=await this.parse(e),o=xn();In(o,t.json?"json":"text")}};n();n();n();var Tn=13387,gt="/auth/callback",no="/auth/handoff";function En(e){return`http://127.0.0.1:${e}${gt}`}function _n(e,t){return`http://127.0.0.1:${e}${no}?nonce=${encodeURIComponent(t)}`}function D(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function Fn(e,t=300){return e.slice(0,t)}async function Nn(e){let t=`https://${e.store}/admin/oauth/access_token`;f(m`Exchanging authorization code for token at ${u.raw(t)}`);let o=await Vt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:B,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw f(m`Token exchange failed with HTTP ${u.raw(String(o.status))}: ${u.raw(Fn(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(m`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 Cn(e){let t=`https://${e.store}/admin/oauth/access_token`;f(m`Refreshing access token for ${u.raw(e.store)} using refresh_token=${u.raw(D(e.refreshToken))}`);let o=await Vt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:B,grant_type:"refresh_token",refresh_token:e.refreshToken})}),r=await o.text();if(!o.ok)throw f(m`Token refresh failed with HTTP ${u.raw(String(o.status))}: ${u.raw(Fn(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 Na=`#graphql
|
|
3
3
|
query CurrentAppInstallationAccessScopes {
|
|
4
4
|
currentAppInstallation {
|
|
5
5
|
accessScopes {
|
|
@@ -7,7 +7,7 @@ import{a as Xe}from"./chunk-AEUCDGTB.js";import{a as Ke,b as Ko}from"./chunk-TAY
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`;async function
|
|
10
|
+
`;async function Pn(e){f(m`Fetching current app installation scopes for ${u.raw(e.store)} using token ${u.raw(D(e.accessToken))}`);let t=await oe({query:Na,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 io="<comma-separated-scopes>";function Dn(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function Ca(e){return[[Dn(e,io)]]}function Ln(e,t,o){return[["Run",Dn(e,t),o]]}function Pa(e){return e.kind==="preview"?io:e.scopes.join(",")}function Rn(e){throw new c(`No stored app authentication found for ${e}.`,void 0,Ln(e,io,"to authenticate"))}function Pe(e,t){throw new c(e,void 0,Ln(t.store,Pa(t),"to re-authenticate"))}function yt(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.`;Pe(t,e)}function qn(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:`,Ca(e))}import{timingSafeEqual as Da}from"crypto";import{createServer as La}from"http";function Ra(e){let t=[e["sec-purpose"],e.purpose,e["x-moz"]].flat().join(" ");return t.includes("prefetch")||t.includes("prerender")}function $n(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,14 +76,14 @@ import{a as Xe}from"./chunk-AEUCDGTB.js";import{a as Ke,b as Ko}from"./chunk-TAY
|
|
|
76
76
|
</main>
|
|
77
77
|
</div>
|
|
78
78
|
</body>
|
|
79
|
-
</html>`}async function rn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let u=_(e);return new Promise((p,m)=>{let y=!1,x=!1,h=!1,F=setTimeout(()=>{A(new s("Timed out waiting for OAuth callback."))},r),O=$i((C,f)=>{let ze=new URL(C.url??"/",`http://127.0.0.1:${o}`);if(ze.pathname===Et&&a){let re=ze.searchParams.get("nonce");if(!re||!on(re,a.nonce)){f.statusCode=403,f.setHeader("Cache-Control","no-store"),f.setHeader("Connection","close"),f.end("Forbidden");return}if(h){f.statusCode=410,f.setHeader("Cache-Control","no-store"),f.setHeader("Connection","close"),f.end("Authorization handoff already used");return}h=!0,f.statusCode=302,f.setHeader("Location",a.authorizationUrl),f.setHeader("Cache-Control","no-store"),f.setHeader("Referrer-Policy","no-referrer"),f.setHeader("Connection","close"),f.end();return}if(ze.pathname!==ot){f.statusCode=404,f.end("Not found");return}let{searchParams:Me}=ze,fe=(re,bi)=>{let Bt=typeof re=="string"?new s(re,bi):re;f.statusCode=400,f.setHeader("Content-Type","text/html"),f.setHeader("Connection","close"),f.once("finish",()=>A(Bt)),f.end(tn("Authentication failed",Bt.message))},ht=Me.get("shop");if(l(d`Received OAuth callback for shop ${c.raw(ht??"unknown")}`),!ht){fe("OAuth callback store does not match the requested store.");return}let zt=_(ht);if(zt!==u){fe(en(zt));return}let Mt=Me.get("state");if(!Mt||!on(Mt,t)){fe("OAuth callback state does not match the original request.");return}let Ht=Me.get("error");if(Ht){fe(`Shopify returned an OAuth error: ${Ht}`);return}let gt=Me.get("code");if(!gt){fe("OAuth callback did not include an authorization code.");return}l(d`Received authorization code ${c.raw(D(gt))}`),f.statusCode=200,f.setHeader("Content-Type","text/html"),f.setHeader("Connection","close"),f.once("finish",()=>k(()=>p(gt))),f.end(tn("Authentication succeeded","Close this window and return to the terminal"))}),k=C=>{if(y)return;y=!0,clearTimeout(F);let f=()=>{C()};if(!x){f();return}O.close(()=>{x=!1,f()}),O.closeIdleConnections?.()},A=C=>{k(()=>m(C))};O.on("error",C=>{if(C.code==="EADDRINUSE"){A(new s(`Port ${o} is already in use.`,`Free port ${o} and re-run ${c.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}A(C)}),O.listen(o,"127.0.0.1",()=>{x=!0,l(d`PKCE callback server listening on http://127.0.0.1:${c.raw(String(o))}${c.raw(ot)}`),i&&Promise.resolve(i()).catch(C=>{A(C instanceof Error?C:new Error(String(C)))})})})}function on(e,t){return e.length!==t.length?!1:qi(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as Ui,randomBytes as nn}from"crypto";function zi(){return nn(32).toString("base64url")}function Mi(e){return Ui("sha256").update(e).digest("base64url")}function Hi(e){let t=new URLSearchParams;return t.set("client_id",U),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"),e.signup&&t.set("signup",e.signup),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function an(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Gr,u=Be(),p=jr(a),m=zi(),y=Mi(m),x=Hi({store:t,scopes:o,state:u,redirectUri:p,codeChallenge:y,signup:r}),h=r?nn(32).toString("base64url"):void 0,F=h?Vr(a,h):x;return l(d`Starting PKCE auth for ${c.raw(t)} with scopes ${c.raw(o.join(","))} (redirect_uri=${c.raw(p)})`),{authorization:{store:t,scopes:o,state:u,port:a,redirectUri:p,authorizationUrl:F,codeVerifier:m,signup:r},waitForAuthCodeOptions:{store:t,state:u,port:a,authorizationRedirect:h?{nonce:h,authorizationUrl:x}:void 0},exchangeCodeForToken:O=>i({store:t,code:O,codeVerifier:m,redirectUri:p})}}n();function Pt(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new s("At least one scope is required.","Pass --scopes as a comma-separated list.");return Gt(t)}function Ct(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 sn(e,t){let o=[...t],r=Ct(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of Ct([i]))r.add(a)}return o}function cn(e,t){if(!e.scope)return l(d`Token response did not include scope; falling back to requested scopes`),t;let o=Pt(e.scope),r=Ct(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new s("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 Bi=240*1e3;function Gi(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Bi<Date.now()}function ji(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 q(e){let t=V(e);if(t||Zr(e),l(d`Loaded stored session for ${c.raw(e)}: token=${c.raw(D(t.accessToken))}, expires=${c.raw(t.expiresAt??"unknown")}`),!Gi(t))return t;t.refreshToken||be(`No refresh token stored for ${t.store}.`,t),l(d`Refreshing expired token for ${c.raw(t.store)} (expired at ${c.raw(t.expiresAt??"unknown")}, refresh_token=${c.raw(D(t.refreshToken))})`);let o=t.accessToken,r;try{r=await Yr({store:t.store,refreshToken:t.refreshToken})}catch(i){throw ce(t.store,t.userId),i instanceof s&&i.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&be(i.message,t),i instanceof s&&i.message===`Token refresh returned an invalid response for ${t.store}.`&&be(i.message,t),i instanceof s&&i.message==="Received an invalid refresh response from Shopify.",i}return t=ji(t,r),l(d`Token refresh succeeded for ${c.raw(t.store)}: ${c.raw(D(o))} → ${c.raw(D(t.accessToken))}, new expiry ${c.raw(t.expiresAt??"unknown")}`),se(t),t}function dn(e,t=300){return e.slice(0,t)}function Vi(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 dn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return dn(e instanceof Error?e.message:String(e))}async function un(e){let t=_(e),o=V(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await q(t),i=await Jr({store:r.store,accessToken:r.accessToken});return l(d`Resolved current remote scopes for ${c.raw(t)}: ${c.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return l(d`Falling back to locally stored scopes for ${c.raw(t)} after remote scope lookup failed: ${c.raw(Vi(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Wi(e){return JSON.stringify(e,null,2)}function Qi(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 Yi(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function Ji(e,t={}){if(t.sensitive){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("");return}P("Browser did not open automatically. Open this URL manually:"),P(d`${c.link(e)}`),P("")}function Ki(e,t="text"){if(t==="json"){v(Wi(e));return}let o=Qi(e);o.completed.forEach(r=>ro(r)),o.info.forEach(r=>P(r))}function me(e="text"){return{openingBrowser:Yi,manualAuthUrl:Ji,success(t){Ki(t,e)}}}n();async function N(e,t,o){await Jt(()=>({store_fqdn:e})),await Yt(()=>({store_fqdn_hash:Wt(e),store_fqdn_validated:t,store_domain:e,store_id:jt(o)}))}var Xi={openURL:Ve,waitForStoreAuthCode:rn,exchangeStoreAuthCodeForToken:Qr,resolveExistingScopes:un,getCurrentStoredStoreAppSession:V,presenter:me("text")};async function nt(e,t={}){let o={...Xi,...t},r=_(e.store);Zi(r,o),await N(r,!1);let i=Pt(e.scopes),a=await o.resolveExistingScopes(r),u=sn(i,a.scopes),p=a.authoritative?u:i;a.scopes.length>0&&l(d`Merged requested scopes ${c.raw(i.join(","))} with existing scopes ${c.raw(a.scopes.join(","))} for ${c.raw(r)}`);let m=an({store:r,scopes:u,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:y}}=m;o.presenter.openingBrowser();let x=await o.waitForStoreAuthCode({...m.waitForAuthCodeOptions,onListening:async()=>{await o.openURL(y)||o.presenter.manualAuthUrl(y,{sensitive:!1})}}),h=await m.exchangeCodeForToken(x);await N(r,!0);let F=h.associated_user?.id?.toString();if(!F)throw new s("Shopify did not return associated user information for the online access token.");R(F);let O=Date.now(),k=h.expires_in?new Date(O+h.expires_in*1e3).toISOString():void 0,A={store:r,userId:F,scopes:cn(h,p),acquiredAt:new Date(O).toISOString(),expiresAt:k,refreshTokenExpiresAt:h.refresh_token_expires_in?new Date(O+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:U,userId:F,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:A.scopes,acquiredAt:A.acquiredAt,expiresAt:k,refreshTokenExpiresAt:A.refreshTokenExpiresAt,associatedUser:A.associatedUser}),l(d`Session persisted for ${c.raw(r)} (user ${c.raw(F)}, expires ${c.raw(k??"unknown")})`),o.presenter.success(A),A}function Zi(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 s("`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 zn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let p=_(e);return new Promise((d,l)=>{let S=!1,O=!1,h=!1,L=setTimeout(()=>{C(new c("Timed out waiting for OAuth callback."))},r),U=La((E,v)=>{let et=new URL(E.url??"/",`http://127.0.0.1:${o}`),ho=()=>{v.statusCode=404,v.setHeader("Cache-Control","no-store"),v.setHeader("Connection","close"),v.end("Not found")};if(et.pathname===no){let de=et.searchParams.get("nonce");if(!(a!==void 0&&!h&&E.method==="GET"&&de!==null&&Un(de,a.nonce))||Ra(E.headers)){ho();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(et.pathname!==gt){ho();return}let{searchParams:tt}=et,Ie=(de,wo)=>{let ko=typeof de=="string"?new c(de,wo):de;v.statusCode=400,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>C(ko)),v.end($n("Authentication failed",ko.message))},zt=tt.get("shop");if(f(m`Received OAuth callback for shop ${u.raw(zt??"unknown")}`),!zt){Ie("OAuth callback store does not match the requested store.");return}let So=_(zt);if(So!==p){Ie(qn(So));return}let go=tt.get("state");if(!go||!Un(go,t)){Ie("OAuth callback state does not match the original request.");return}let yo=tt.get("error");if(yo){Ie(`Shopify returned an OAuth error: ${yo}`);return}let Bt=tt.get("code");if(!Bt){Ie("OAuth callback did not include an authorization code.");return}f(m`Received authorization code ${u.raw(D(Bt))}`),v.statusCode=200,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>me(()=>d(Bt))),v.end($n("Authentication succeeded","Close this window and return to the terminal"))}),me=E=>{if(S)return;S=!0,clearTimeout(L);let v=()=>{E()};if(!O){v();return}U.close(()=>{O=!1,v()}),U.closeIdleConnections?.()},C=E=>{me(()=>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(m`PKCE callback server listening on http://127.0.0.1:${u.raw(String(o))}${u.raw(gt)}`),i&&Promise.resolve(i()).catch(E=>{C(E instanceof Error?E:new Error(String(E)))})})})}function Un(e,t){return e.length!==t.length?!1:Da(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as qa,randomBytes as Bn}from"crypto";function $a(){return Bn(32).toString("base64url")}function Ua(e){return qa("sha256").update(e).digest("base64url")}function za(e){let t=new URLSearchParams;return t.set("client_id",B),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 Ba(e,t){let o=new URL(e);return o.searchParams.set("signup",t),{nonce:Bn(32).toString("base64url"),authorizationUrl:o.toString()}}function Hn(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Tn,p=ot(),d=En(a),l=$a(),S=Ua(l),O=za({store:t,scopes:o,state:p,redirectUri:d,codeChallenge:S}),h=r?Ba(O,r):void 0,L=h?_n(a,h.nonce):O;return f(m`Starting PKCE auth for ${u.raw(t)} with scopes ${u.raw(o.join(","))} (redirect_uri=${u.raw(d)})`),{authorization:{store:t,scopes:o,state:p,port:a,redirectUri:d,authorizationUrl:L,codeVerifier:l},waitForAuthCodeOptions:{store:t,state:p,port:a,authorizationRedirect:h},exchangeCodeForToken:U=>i({store:t,code:U,codeVerifier:l,redirectUri:d})}}n();function so(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 vo(t)}function ao(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 jn(e,t){let o=[...t],r=ao(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of ao([i]))r.add(a)}return o}function Mn(e,t){if(!e.scope)return f(m`Token response did not include scope; falling back to requested scopes`),t;let o=so(e.scope),r=ao(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 Ha=240*1e3;function ja(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Ha<Date.now()}function Ma(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||Rn(e),f(m`Loaded stored session for ${u.raw(e)}: token=${u.raw(D(t.accessToken))}, expires=${u.raw(t.expiresAt??"unknown")}`),!ja(t))return t;t.refreshToken||Pe(`No refresh token stored for ${t.store}.`,t),f(m`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 Cn(r)}catch(a){throw Se(t.store,t.userId),a instanceof c&&a.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&Pe(a.message,t),a instanceof c&&a.message===`Token refresh returned an invalid response for ${t.store}.`&&Pe(a.message,t),a instanceof c&&a.message==="Received an invalid refresh response from Shopify.",a}return t=Ma(t,i),f(m`Token refresh succeeded for ${u.raw(t.store)}: ${u.raw(D(o))} → ${u.raw(D(t.accessToken))}, new expiry ${u.raw(t.expiresAt??"unknown")}`),he(t),t}function Gn(e,t=300){return e.slice(0,t)}function Ga(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 Gn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return Gn(e instanceof Error?e.message:String(e))}async function Jn(e){let t=_(e),o=Y(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await $(t),i=await Pn({store:r.store,accessToken:r.accessToken});return f(m`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(m`Falling back to locally stored scopes for ${u.raw(t)} after remote scope lookup failed: ${u.raw(Ga(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Ja(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 Va(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function Wa(e){return URL.canParse(e)?new URL(e).searchParams.has("signup"):!0}function Qa(e,t={}){return t.sensitive||Wa(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(m`${u.link(e)}`),P(""),!0)}function Ya(e,t="text"){if(t==="json"){g(ke.encode(e));return}let o=Ja(e);o.completed.forEach(r=>Do(r)),o.info.forEach(r=>P(r))}function be(e="text"){return{openingBrowser:Va,manualAuthUrl:Qa,success(t){Ya(t,e)}}}n();async function F(e,t,o){await Eo(()=>({store_fqdn:e})),await To(()=>({store_fqdn_hash:xo(e),store_fqdn_validated:t,store_domain:e,store_id:Ao(o)}))}var Ka={openURL:it,waitForStoreAuthCode:zn,exchangeStoreAuthCodeForToken:Nn,resolveExistingScopes:Jn,getCurrentStoredStoreAppSession:Y,presenter:be("text")};async function wt(e,t={}){let o={...Ka,...t},r=_(e.store);if(Xa(r,o),bo())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 F(r,!1);let i=so(e.scopes),a=await o.resolveExistingScopes(r),p=jn(i,a.scopes),d=a.authoritative?p:i;a.scopes.length>0&&f(m`Merged requested scopes ${u.raw(i.join(","))} with existing scopes ${u.raw(a.scopes.join(","))} for ${u.raw(r)}`);let l=Hn({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 F(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(),me=h.expires_in?new Date(U+h.expires_in*1e3).toISOString():void 0,C={store:r,userId:L,scopes:Mn(h,d),acquiredAt:new Date(U).toISOString(),expiresAt:me,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 he({store:r,clientId:B,userId:L,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:C.scopes,acquiredAt:C.acquiredAt,expiresAt:me,refreshTokenExpiresAt:C.refreshTokenExpiresAt,associatedUser:C.associatedUser}),f(m`Session persisted for ${u.raw(r)} (user ${u.raw(L)}, expires ${u.raw(me??"unknown")})`),o.presenter.success(C),C}function Xa(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
|
|
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 N=R(j(),1),Za="Country must be a two-letter country code, for example: US.";function es(e){return/^[A-Z]{2}$/.test(e)}var kt=N.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(!es(t))throw new c(Za);return t}}),b={store:N.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>_(e),required:!0}),"organization-id":N.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},Vn={env:"SHOPIFY_FLAG_ID",parse:async e=>cr(e)},Wn=N.Flags.string({...Vn,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."}),Qn=N.Flags.string({...Vn,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),Yn={query:N.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":N.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=>M(e),exactlyOne:["query","query-file"]}),variables:N.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":N.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=>M(e),exclusive:["variables"]}),watch:N.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":N.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:N.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":N.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var Kn=R(j(),1),De=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.
|
|
84
|
-
`,{command:`shopify store bulk status --id=${
|
|
85
|
-
`);if(t){if(!await
|
|
86
|
-
`,{command:`shopify store bulk status --id=${
|
|
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:Kn.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};static get jsonOutputSchema(){return ke}async run(){let{flags:t}=await this.parse(e);await wt({store:t.store,scopes:t.scopes},{presenter:be(t.json?"json":"text")})}};n();n();async function Xn(e){let t=await fr(e);return{store:e.adminSession.storeFqdn,apiVersion:e.version??se,operation:t?.bulkOperation??null,userErrors:t?.userErrors??[]}}n();async function ve(e){let t=await $(e);return await F(t.store,!0),q(t.userId),{token:t.accessToken,storeFqdn:t.store}}n();n();var ri=s.string().regex(/^gid:\/\/shopify\/BulkOperation\/[^/]+$/).describe("The Shopify global ID of a bulk operation."),pe=s.object({gid:ri,type:s.string(),status:s.string(),errorCode:s.string().nullable(),createdAt:jt,completedAt:jt.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(),ni=pe.omit({type:!0}),bt=s.object({storeDomain:s.string().regex(/^[^.]+\.myshopify\.com$/).nullable(),apiVersion:s.string().nullable().describe("The API version selected for the request.")}).strict(),vt=x({name:"CancelBulkOperationResult",schema:bt.extend({status:s.literal("success"),operation:pe}),definitions:{BulkOperation:pe}}),Zn=bt.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.")}),ei=s.object({path:s.string().describe("The absolute path of the downloaded results file."),format:s.literal("jsonl")}).strict(),Le=x({name:"ExecuteBulkOperationResult",schema:s.union([Zn,ei]),definitions:{BulkOperation:pe,ExecuteBulkOperationResult:Zn,BulkOperationFile:ei}}),ti=bt.extend({operationGid:ri,operation:pe.nullable()}),oi=bt.extend({operations:s.array(ni),pageInfo:s.object({hasNextPage:s.boolean().nullable().describe("Unknown when the API result reaches the fetch limit.")}).strict()}),At=x({name:"BulkOperationStatusResult",schema:s.union([ti,oi]),definitions:{GetBulkOperationStatusResult:ti,ListBulkOperationsResult:oi,BulkOperation:pe,ListedBulkOperation:ni}});n();function K(e){let t=ie(e.store);return{storeDomain:t?`${t}.myshopify.com`:null,apiVersion:e.apiVersion??null}}function X(e){if(typeof e.objectCount=="number"&&!Number.isSafeInteger(e.objectCount))throw new G("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:Mt(new Date(String(e.createdAt))),completedAt:e.completedAt?Mt(new Date(String(e.completedAt))):null,objectCount:String(e.objectCount),url:e.url??null,partialDataUrl:e.partialDataUrl??null}}function ii(e,t,o){if(o==="json"){if(e.userErrors.length||!e.operation){let i=new c("Failed to cancel bulk operation.");throw i.details={...K(e),operationGid:t,userErrors:e.userErrors},i}g(vt.encode({...K(e),status:"success",operation:X(e.operation)}));return}if(e.userErrors.length){hr(e.userErrors,"Failed to cancel bulk operation.");return}let r=e.operation;if(r){let i=Sr(r),a=r.status==="CANCELING"?[`This may take a few moments. Check the status with:
|
|
84
|
+
`,{command:`shopify store bulk status --id=${ge(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":ne(p);break;case"info":I(p);break}}else W({headline:"Bulk operation not found or could not be canceled.",body:m`ID: ${u.yellow(t)}`.value})}n();n();function ai(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function si(e,t=!1){if(ye(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 Ae(e,t){let o=[...t.operationId?[`ID: ${t.operationId}`]:[],...ai(t)];I({headline:e,body:[{list:{items:o}}]})}var Re=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 description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:Qn};static get jsonOutputSchema(){return vt}async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await ve(t.store);Ae("Canceling bulk operation.",{storeFqdn:r.storeFqdn,operationId:t.id});let i=await Xn({adminSession:r,operationId:t.id});ii(i,t.id,o)}};n();n();async function ts(e,t){if(e)return e.join(`
|
|
85
|
+
`);if(t){if(!await _e(t))throw new c(m`Variable file not found at ${u.path(t)}. Please check the path and try again.`);return Te(t,{encoding:"utf8"})}else return}async function ci(e){let{store:t,query:o,variables:r,variableFile:i,watch:a=!1,version:p,allowMutations:d=!1}=e;si(o,d);let{adminSession:l,version:S}=await z({title:m`Authenticating`,task:async()=>{let h=await ve(t),L=await Fe({adminSession:h,userSpecifiedVersion:p,minimumDefaultVersion:se});return{adminSession:h,version:L}},renderOptions:{stdout:process.stderr}}),O=await ts(r,i);return os(o,O),{adminSession:l,version:S,query:o,variablesJsonl:O,watch:a}}async function ui(e){let{adminSession:t,version:o,query:r,variablesJsonl:i,watch:a}=e,p=ye(r)?await mr({adminSession:t,query:r,variablesJsonl:i,version:o}):await pr({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 d=new Oo,l=a?await yr(t,p.bulkOperation.id,d.signal,()=>d.abort()):await gr(t,p.bulkOperation.id),S=a&&!d.signal.aborted&&l.status==="COMPLETED"&&l.url?await wr(l.url):void 0;return{store:t.storeFqdn,apiVersion:o,operation:l,userErrors:[],watchAborted:d.signal.aborted,results:S}}function os(e,t){if(ye(e)&&!t)throw new c(m`Bulk mutations require variables. Provide a JSONL file with ${u.yellow("--variable-file")} or individual JSON objects with ${u.yellow("--variables")}.`);if(!ye(e)&&t)throw new c(m`The ${u.yellow("--variables")} and ${u.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}n();async function pi(e,t){let{format:o,watch:r,outputFile:i}=t,{operation:a,userErrors:p,watchAborted:d,results:l}=e;if(!a&&p.length===0)throw ne({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new G("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={...K(e),operation:a?X(a):null,userErrors:p},h}if(!a)throw new G("Bulk operation response returned no operation.");let S=l!==void 0&&Zt(l),O=S?"partial":"success";if(d&&(O="cancelled"),S&&(process.exitCode=1),i&&l===void 0&&!d)throw new c("No results are available to write to the output file.");if(i&&l!==void 0){let h=M(i);await Ee(h,l),g(Le.encode({path:h,format:"jsonl"}))}else g(Le.encode({...K(e),status:O,...d?{reason:"watch-aborted"}:{},operation:X(a),...l===void 0?{}:{resultsJsonl:l}}));return}if(i&&l!==void 0&&await Ee(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&&(d?I({headline:`Bulk operation ${a.id} is still running in the background.`,body:xt(a.id)}):r||["FAILED","CANCELED","EXPIRED"].includes(a.status)?rs(a,l,i):T({headline:"Bulk operation is running.",body:xt(a.id),customSections:[{body:[{list:{items:[m`ID: ${u.cyan(a.id)}`.value]}}]}]}))}function rs(e,t,o){let r=ct(e).value,a=[{body:[{list:{items:[m`ID: ${u.cyan(e.id)}`.value,m`Status: ${u.yellow(e.status)}`.value,m`Created at: ${u.gray(String(e.createdAt))}`.value,...e.completedAt?[m`Completed at: ${u.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":T({headline:"Bulk operation started.",body:xt(e.id),customSections:a});break;case"RUNNING":T({headline:"Bulk operation is running.",body:xt(e.id),customSections:a});break;case"COMPLETED":if(t===void 0)T({headline:r,customSections:a});else{let p=Zt(t);o||g(t),p?ne({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 xt(e){return[`Monitor its progress with:
|
|
86
|
+
`,{command:`shopify store bulk status --id=${ge(e)}`}]}var qe=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.
|
|
89
89
|
|
|
@@ -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.descriptionWithoutMarkdown();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={...g,store:w.store,...fn};async run(){let{flags:t}=await this.parse(e),o=await Co({query:t.query,queryFile:t["query-file"]});await wn({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,outputFile:t["output-file"],allowMutations:t["allow-mutations"],...t.version&&{version:t.version}})}};n();n();async function kn(e){let{store:t,operationId:o}=e,r=await oe(t);b({headline:"Checking bulk operation status.",body:[{list:{items:te({storeFqdn:r.storeFqdn})}}]});let i=await Lo({adminSession:r,operationId:o,version:await Se({adminSession:r,minimumDefaultVersion:ye})});i?na(i):G({headline:"Bulk operation not found.",body:d`ID: ${c.yellow(o)}`.value})}async function bn(e){let{store:t}=e,o=await oe(t);b({headline:"Listing bulk operations.",body:[{list:{items:te({storeFqdn:o.storeFqdn})}}]});let i=(await Ro({adminSession:o,version:await Se({adminSession:o,minimumDefaultVersion:ye})})).map(a=>({id:de(a.id),status:aa(a.status),count:sa(a.objectCount),dateCreated:St(new Date(String(a.createdAt))),dateFinished:a.completedAt?St(new Date(String(a.completedAt))):"",results:ca(a.url??a.partialDataUrl)}));Tt(),i.length===0?b({body:"No bulk operations found in the last 7 days."}):ie({rows:i,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"}}}),Tt()}function na(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:u}=e,p=Ye(e).value,m=ia(r,i),y=d`ID: ${c.yellow(t)}\n${m}`.value;if(o==="COMPLETED"){let x=a?c.link("Download results",a):"";I({headline:p,body:d`${y}\n${x}`.value})}else if(o==="FAILED"){let x=u?c.link("Download partial results",u):"";G({headline:p,body:d`${y}\n${x}`.value})}else b({headline:p,body:y})}function ia(e,t){let o=new Date;return t?`Finished ${wt(new Date(String(t)),o)}`:`Started ${wt(new Date(String(e)),o)}`}function aa(e){return e==="COMPLETED"?Ge.green(e):e==="FAILED"?Ge.red(e):Ge.dim(e)}function sa(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ca(e){return e?d`${c.link("download",e)}`.value:""}var Te=class e extends S{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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...g,store:w.store,id:mn};async run(){let{flags:t}=await this.parse(e);t.id?await kn({store:t.store,operationId:t.id}):await bn({store:t.store})}};n();var Dt=L(z(),1),Ie=class e extends S{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.descriptionWithoutMarkdown();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={...g,...T,store:w.store,scopes:Dt.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:Dt.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=t.signup??await da();await nt({store:t.store,scopes:t.scopes,signup:o},{presenter:me(t.json?"json":"text")})}};async function da(e=process.stdin){let t=[];for await(let r of e)t.push(Buffer.isBuffer(r)?r:Buffer.from(r));let o=Buffer.concat(t).toString("utf8").trim();if(!o)throw new s("Missing signup JWT.","Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.");return o}n();n();n();var vn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var An=Vo,xn=Wo,Tn=Qo;var Oe=L(z(),1),_e=class e extends j{static summary="Create a new dev store.";static descriptionWithMarkdown="Creates a new dev store in your organization.";static description=this.descriptionWithoutMarkdown();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={...g,...T,name:Qe(Oe.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":Qe(w["organization-id"]),plan:Qe(Oe.Flags.string({description:"The Shopify plan to use for the new dev store.",options:Ot,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":Oe.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":Oe.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 we(t["organization-id"]?.toString()),r=t.name??await An(),i=t.plan??await xn(),a=t["demo-data"]??(We()?await Tn():!1);try{await _t({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:a,country:t.country,json:t.json})}catch(u){throw t.json&&u instanceof s&&(v(JSON.stringify({error:!0,message:u.message,nextSteps:u.nextSteps??[],exitCode:1},null,2)),process.exit(1)),u}}};n();n();n();var ua="X-Shopify-CLI-Instance",pa="X-Shopify-CLI-Version",In;function ma(){return In??=new Qt({projectName:"shopify-cli-store"}),In}var Ne=class extends s{status;constructor(t,o,r){super(o,r??null),this.status=t}};function On(e=ma()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=Be();return e.set("cliInstanceId",o),o}function _n(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${yt}`,[ua]:e,[pa]:yt}}function la(e){return _n(e)}function fa(e,t){return{..._n(e),authorization:t,"X-Shopify-Access-Token":t}}async function Nn(e,t={}){let r=`https://${await vt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await bt(r,{method:"POST",headers:la(On(t.storage)),body:i}),u=await a.text();if(!a.ok){let m=ha(a.status,u);throw new s(m.message,m.tryMessage)}let p;try{p=JSON.parse(u)}catch(m){let y=m instanceof Error?m.message:"Unknown error";throw new s("Preview store creation returned a non-JSON response.",`Parse error: ${y}. Body (truncated): ${st(u).slice(0,500)}`)}return ya(p)}async function En(e,t={}){let r=`https://${await vt()}/services/preview-stores/${e.shopId}`,i=await bt(r,{method:"GET",headers:fa(On(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let p=ga(i.status,a);throw new Ne(i.status,p.message,p.tryMessage)}let u;try{u=JSON.parse(a)}catch(p){let m=p instanceof Error?p.message:"Unknown error";throw new s("Preview store lookup returned a non-JSON response.",`Parse error: ${m}. Body (truncated): ${st(a).slice(0,500)}`)}return Sa(u)}function ha(e,t){let o=Fn(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=st(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Fn(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 ga(e,t){let o=Fn(t),r=st(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 ya(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,u=typeof e.access_url=="string"?e.access_url:void 0,p=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,m=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(y=>typeof y=="string"):void 0;if(!o||!r||!i||!a||!u||!m)throw new s("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(wa(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:m,accessUrl:u,...p?{placeholderAccountUuid:p}:{}}}function Sa(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,u=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new s("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(ka(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...u?{claimUrl:u}:{}}}function wa(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function st(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 ka(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var ba={createPreviewStore:Nn,setStoredStoreAppSession:se,recordStoreFqdnMetadata:N,setLastSeenUserId:R,now:()=>new Date};async function Cn(e,t={}){let o={...ba,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Aa(r,e.country,o)}function va(e){return e.placeholderAccountUuid??e.shop.id}async function Aa(e,t,o){let r=o.now().toISOString(),i=va(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:U,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}}}n();function Pn(e,t){if(t==="json"){v(JSON.stringify(xa(e),null,2));return}Ta(e)}function xa(e){return{status:e.status,message:e.message,store:e.store,next_steps:Dn(e).map(t=>t.json)}}function Dn(e){return[{json:`Use \`shopify store open --store ${e.store.subdomain}\` to preview the storefront.`,text:["Use ",{command:`shopify store open --store ${e.store.subdomain}`}," to preview the storefront."]},{json:`Use \`shopify store execute --store ${e.store.subdomain}\` to add products, collections, pages, and more.`,text:["Use ",{command:`shopify store execute --store ${e.store.subdomain}`}," to add products, collections, pages, and more."]},{json:`Use \`shopify theme pull --store ${e.store.subdomain}\` and \`shopify theme push --store ${e.store.subdomain}\` to edit your store design.`,text:["Use ",{command:`shopify theme pull --store ${e.store.subdomain}`}," and ",{command:`shopify theme push --store ${e.store.subdomain}`}," to edit your store design."]}]}function Ta(e){I({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:Dn(e).map(t=>t.text)}}}]})}var Ln=L(z(),1),Ee=class e extends S{static summary="Create a preview Shopify store.";static descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";static description=this.descriptionWithoutMarkdown();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={...g,...T,name:Ln.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 $({title:d`Creating store`,task:async()=>Cn({name:t.name,country:t.country})});Pn(o,t.json?"json":"text")}};n();n();n();n();n();var Rn={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 qn(e){let t=await Lt(e);if(!t)throw new s(`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 Lt(e){let t=e.token??await B([],{noPrompt:e.noPrompt}),o=H({noPrompt:e.noPrompt}),i=(await X({query:Rn,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),u=i.find(p=>M(p.node.primaryDomain)===a)?.node;if(u)return{shopifyShopId:u.shopifyShopId??void 0,name:u.name,primaryDomain:u.primaryDomain??void 0,storeType:u.storeType??void 0,developerPreviewHandle:u.developerPreviewHandle??void 0,planName:u.planName??void 0,ownerName:u.ownerDetails?.fullName??void 0,ownerEmail:u.ownerDetails?.email??void 0}}n();var $n={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 Un={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 Ia="cancelled",Oa=5,_a=300*1e3;async function Mn(e){let{organization:t,store:o}=e,r=await B(),i=H(),a=await zn({store:o,organizationId:t.id,token:r}),p=(await X({query:$n,token:r,organizationId:t.id,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!p)throw new s("Store deletion failed: unexpected empty response.");let m=p.userErrors;if(m&&m.length>0){let x=m.map(h=>h.message).join(", ");throw new s(`Failed to delete dev store: ${x}`)}if(p.success===!1)throw new s("Store deletion failed.");a??=await zn({store:o,organizationId:t.id,token:r});let y=a?await Ea({shopifyShopId:a,organizationId:t.id,token:r,unauthorizedHandler:i}):!1;e.json?v(Ca({store:o,organization:t,deletionConfirmed:y})):y?I({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):Z({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 zn(e){return(await Lt(e))?.shopifyShopId}function Na(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 Ea(e){let t=Na(e.shopifyShopId);return $({title:d`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>_a)return!1;if((await X({query:Un,token:e.token,organizationId:e.organizationId,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===Ia.toLowerCase())return!0;o(d`${Fa()}`),await oo(Oa)}},renderOptions:{stdout:process.stderr}})}function Fa(){return"Waiting for deletion confirmation"}function Ca(e){let{store:t,organization:o,deletionConfirmed:r}=e;return JSON.stringify({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."}},null,2)}n();n();n();var Hn={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 Bn={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 Fe=class extends s{};async function ct(e){let t=e.token??await B([],{noPrompt:e.noPrompt}),o=H({noPrompt:e.noPrompt}),r=M(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,p=((await At({query:Hn,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(y=>Da(y,r));if(!p)throw new Fe(`Couldn't find a store with domain ${e.store} for the current account.`,"Verify the domain (must be the canonical `myshopify.com` FQDN) and that you are signed in to an account with access to the store. Inactive shops are not searchable.");let m=await Pa(String(p.publicId),t,o);return{...m?{owningOrg:m}:{}}}async function Pa(e,t,o){try{let i=(await At({query:Bn,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){l(`No owning organization returned for destination ${e}.`);return}let a=i.id?Go(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){l(`Failed to resolve owning organization: ${La(r)}`);return}}function Da(e,t){return[e.primaryDomain,e.webUrl].some(o=>M(o)===t)}function La(e){return e instanceof Error?e.message:String(e)}async function Ra(e){let{store:t}=e;try{let r=(await ct(e)).owningOrg;if(!r?.id){l(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){l(`Could not infer the owning organization for ${t}: ${qa(o)}`);return}}function qa(e){return e instanceof Error?e.message:String(e)}async function Gn(e,t){if(t)return we(t);let o=We(),r=await Ra({store:e,noPrompt:!o});if(r)return r;if(!o)throw new s(`Could not determine which organization owns ${e}.`,"Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");return b({headline:`Could not determine which organization owns ${e}.`,body:["Select one below, or specify it with",{command:"--organization-id"},{char:"."}]}),we()}var jn=L(z(),1),Ce=class e extends j{static summary="Delete a dev store.";static descriptionWithMarkdown="Deletes a dev store from your organization.";static description=this.descriptionWithoutMarkdown();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={...g,...T,store:w.store,"organization-id":w["organization-id"],force:jn.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&&!je())throw new s(`Deleting the dev store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Gn(t.store,t["organization-id"]?.toString());if(!t.force&&!await Zt({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new to;await Mn({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof s&&(v(JSON.stringify({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1},null,2)),process.exit(1)),o}}};n();n();n();var Wn=L(vi(),1);async function $a(e){if(e.query!==void 0){if(!e.query.trim())throw new s("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await ge(e.queryFile))throw new s(d`Query file not found at ${c.path(e.queryFile)}. Please check the path and try again.`);let t=await he(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new s(d`Query file at ${c.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new ae("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Vn(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new s(d`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Ua(e,t){if(e!==void 0){if(!e.trim())throw new s(d`The ${c.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Vn(JSON.parse(e),c.yellow("--variables"))}catch(o){if(o instanceof s)throw o;let r=o instanceof Error?o.message:"Unknown error";throw new s(d`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await ge(t))throw new s(d`Variable file not found at ${c.path(t)}. Please check the path and try again.`);let o=await he(t,{encoding:"utf8"});try{return Vn(JSON.parse(o),c.path(t))}catch(r){if(r instanceof s)throw r;let i=r instanceof Error?r.message:"Unknown error";throw new s(d`Invalid JSON in variable file ${c.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function za(e){let t;try{t=(0,Wn.parse)(e)}catch(r){throw r instanceof Error?new s(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new s("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function Ma(e){return e.operationDefinition.operation==="mutation"}function Ha(e,t=!1){if(Ma(e)&&!t)throw new s("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Qn(e){let t=await $a({query:e.query,queryFile:e.queryFile}),o=za(t);Ha(o,e.allowMutations);let r=await Ua(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Rt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Yn(e){if(!Rt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Jn=["the user aborted a request","the operation was aborted"];function Ba(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Jn.some(o=>t.includes(o))}function Pe(e,t){if(Yn(e)===402)return new s(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(Ba(e))return new s(`Request to ${t} was aborted before it completed.`)}function De(e,t){let o=Yn(e);o!==401&&o!==404||(ce(t.store,t.userId),rt(t))}var Ga=`
|
|
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,...Yn};static get jsonOutputSchema(){return Le}async run(){let{flags:t}=await this.parse(e),o=await ur({query:t.query,queryFile:t["query-file"]}),r=await ci({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";Ae("Starting bulk operation.",{storeFqdn:r.adminSession.storeFqdn,version:r.version});let a=await ui(r);await pi(a,{format:i,watch:r.watch,outputFile:t["output-file"]})}};n();n();async function mi(e){let t=await Fe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await dr({...e,version:t});return{store:e.adminSession.storeFqdn,apiVersion:t,operationId:e.operationId,operation:o??null}}async function di(e){let t=await Fe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await lr({...e,version:t,first:100});return{store:e.adminSession.storeFqdn,apiVersion:t,operations:o}}n();function li(e,t){if(t==="json"){g(At.encode({...K(e),..."operation"in e?{operationGid:e.operationId,operation:e.operation?X(e.operation):null}:{operations:e.operations.map(X),pageInfo:{hasNextPage:e.operations.length<100?!1:null}}}));return}if("operation"in e){e.operation?ns(e.operation):W({headline:"Bulk operation not found.",body:m`ID: ${u.yellow(e.operationId)}`.value});return}let o=e.operations.map(r=>({id:ge(r.id),status:as(r.status),count:ss(r.objectCount),dateCreated:Gt(new Date(String(r.createdAt))),dateFinished:r.completedAt?Gt(new Date(String(r.completedAt))):"",results:cs(r.url??r.partialDataUrl)}));Xt(),o.length===0?I({body:"No bulk operations found in the last 7 days."}):fe({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"}}}),Xt()}function ns(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:p}=e,d=ct(e).value,l=is(r,i),S=m`ID: ${u.yellow(t)}\n${l}`.value;if(o==="COMPLETED"){let O=a?u.link("Download results",a):"";T({headline:d,body:m`${S}\n${O}`.value})}else if(o==="FAILED"){let O=p?u.link("Download partial results",p):"";W({headline:d,body:m`${S}\n${O}`.value})}else I({headline:d,body:S})}function is(e,t){let o=new Date;return t?`Finished ${Jt(new Date(String(t)),o)}`:`Started ${Jt(new Date(String(e)),o)}`}function as(e){return e==="COMPLETED"?rt.green(e):e==="FAILED"?rt.red(e):rt.dim(e)}function ss(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function cs(e){return e?m`${u.link("download",e)}`.value:""}var $e=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:Wn};static get jsonOutputSchema(){return At}async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await ve(t.store);Ae(t.id?"Checking bulk operation status.":"Listing bulk operations.",{storeFqdn:r.storeFqdn});let i=t.id?await mi({adminSession:r,operationId:t.id}):await di({adminSession:r});li(i,o)}};n();var co=R(j(),1),Ue=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:co.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:co.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 ke}async run(){let{flags:t}=await this.parse(e),o=ps(t.signup)??await ms();await wt({store:t.store,scopes:t.scopes,signup:o},{presenter:be(t.json?"json":"text")})}},us=8*1024,fi="Missing signup JWT.",hi="Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.";function ps(e){let t=e?.trim();return t===""?void 0:t}async function ms(e=process.stdin){if(e===process.stdin&&!Po())throw new c(fi,hi);let t=[],o=0;for await(let i of e){let a=Buffer.isBuffer(i)?i:Buffer.from(i);if(o+=a.length,o>us)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(fi,hi);return r}n();n();n();var xe=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 uo=x({name:"CreateDevStoreResult",schema:s.union([to.schema,xe]),definitions:{...to.definitions,StoreCommandError:xe}});n();var Si={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var gi=Ar,yi=xr,wi=Or;var ze=R(j(),1),Be=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:st(ze.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":st(b["organization-id"]),plan:st(ze.Flags.string({description:"The Shopify plan to use for the new dev store.",options:eo,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":ze.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":ze.Flags.boolean({description:"Populate the new dev store with demo data.",allowNo:!0,env:"SHOPIFY_FLAG_STORE_DEMO_DATA"}),country:kt};static get jsonOutputSchema(){return uo}async run(){let{flags:t}=await this.parse(e),o=await Ne(t["organization-id"]?.toString()),r=t.name??await gi(),i=t.plan??await yi(),a=t["demo-data"]??(at()?await wi():!1);try{await oo({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(uo.encode({error:!0,message:p.message,nextSteps:p.nextSteps??[],exitCode:1})),process.exit(1)),p}}};n();n();n();var ds="X-Shopify-CLI-Instance",ls="X-Shopify-CLI-Version",ki;function fs(){return ki??=new Io({projectName:"shopify-cli-store"}),ki}var He=class extends c{status;constructor(t,o,r){super(o,r??null),this.status=t}};function bi(e=fs()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=ot();return e.set("cliInstanceId",o),o}function vi(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${Ht}`,[ds]:e,[ls]:Ht}}function hs(e){return vi(e)}function Ss(e,t){return{...vi(e),authorization:t,"X-Shopify-Access-Token":t}}async function Ai(e,t={}){let r=`https://${await Qt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await Wt(r,{method:"POST",headers:hs(bi(t.storage)),body:i}),p=await a.text();if(!a.ok){let l=gs(a.status,p);throw new c(l.message,l.tryMessage)}let d;try{d=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): ${Ot(p).slice(0,500)}`)}return ws(d)}async function xi(e,t={}){let r=`https://${await Qt()}/services/preview-stores/${e.shopId}`,i=await Wt(r,{method:"GET",headers:Ss(bi(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let d=ys(i.status,a);throw new He(i.status,d.message,d.tryMessage)}let p;try{p=JSON.parse(a)}catch(d){let l=d instanceof Error?d.message:"Unknown error";throw new c("Preview store lookup returned a non-JSON response.",`Parse error: ${l}. Body (truncated): ${Ot(a).slice(0,500)}`)}return ks(p)}function gs(e,t){let o=Oi(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=Ot(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Oi(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 ys(e,t){let o=Oi(t),r=Ot(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 ws(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,d=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(bs(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:l,accessUrl:p,...d?{placeholderAccountUuid:d}:{}}}function ks(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(vs(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...p?{claimUrl:p}:{}}}function bs(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Ot(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 vs(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var As={createPreviewStore:Ai,setStoredStoreAppSession:he,recordStoreFqdnMetadata:F,setLastSeenUserId:q,now:()=>new Date};async function Ii(e,t={}){let o={...As,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Os(r,e.country,o)}function xs(e){return e.placeholderAccountUuid??e.shop.id}async function Os(e,t,o){let r=o.now().toISOString(),i=xs(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:B,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:Is(e.shop.domain)}}function Is(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 Ti=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.")}),It=x({name:"CreatePreviewStoreResult",schema:s.object({status:s.literal("success"),message:s.string(),store:Ti,next_steps:s.array(s.string())}),definitions:{PreviewStore:Ti}});function Ei(e,t){if(t==="json"){g(It.encode(e));return}Es(e)}function Ts(e){return e.split(/(`[^`]+`)/).map(t=>t.startsWith("`")&&t.endsWith("`")?{command:t.slice(1,-1)}:t)}function Es(e){T({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:e.next_steps.map(Ts)}}}]})}var _i=R(j(),1),je=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:_i.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:kt};static get jsonOutputSchema(){return It}async run(){let{flags:t}=await this.parse(e),o=await z({title:m`Creating store`,task:async()=>Ii({name:t.name,country:t.country})});Ei(o,t.json?"json":"text")}};n();n();var Fi=s.object({domain:A.shape.subdomain,deletionRequested:s.literal(!0),deletionConfirmed:s.boolean()}),Me=x({name:"DeleteDevStoreResult",schema:s.union([s.object({store:Fi,organization:ce,message:s.string().optional()}),xe]),definitions:{DeletedStore:Fi,StoreOrganization:ce,StoreCommandError:xe}});n();n();n();n();var Ni={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 Ci(e){let t=await po(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 po(e){let t=e.token??await V([],{noPrompt:e.noPrompt}),o=J({noPrompt:e.noPrompt}),i=(await re({query:Ni,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),p=i.find(d=>H(d.node.primaryDomain)===a)?.node;if(p)return{shopifyShopId:p.shopifyShopId??void 0,name:p.name,primaryDomain:p.primaryDomain??void 0,storeType:p.storeType??void 0,developerPreviewHandle:p.developerPreviewHandle??void 0,planName:p.planName??void 0,ownerName:p.ownerDetails?.fullName??void 0,ownerEmail:p.ownerDetails?.email??void 0}}n();var Pi={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 Di={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",Fs=5,Ns=300*1e3;async function Ri(e){let{organization:t,store:o}=e,r=await V(),i=J(),a=await Li({store:o,organizationId:t.id,token:r}),d=(await re({query:Pi,token:r,organizationId:t.id,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!d)throw new c("Store deletion failed: unexpected empty response.");let l=d.userErrors;if(l&&l.length>0){let O=l.map(h=>h.message).join(", ");throw new c(`Failed to delete dev store: ${O}`)}if(d.success===!1)throw new c("Store deletion failed.");a??=await Li({store:o,organizationId:t.id,token:r});let S=a?await Ps({shopifyShopId:a,organizationId:t.id,token:r,unauthorizedHandler:i}):!1;e.json?g(Ls({store:o,organization:t,deletionConfirmed:S})):S?T({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):ne({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 Li(e){return(await po(e))?.shopifyShopId}function Cs(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 Ps(e){let t=Cs(e.shopifyShopId);return z({title:m`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>Ns)return!1;if((await re({query:Di,token:e.token,organizationId:e.organizationId,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===_s.toLowerCase())return!0;o(m`${Ds()}`),await Co(Fs)}},renderOptions:{stdout:process.stderr}})}function Ds(){return"Waiting for deletion confirmation"}function Ls(e){let{store:t,organization:o,deletionConfirmed:r}=e;return Me.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 qi={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 $i={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 Ge=class extends c{};async function Tt(e){let t=e.token??await V([],{noPrompt:e.noPrompt}),o=J({noPrompt:e.noPrompt}),r=H(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,d=((await Yt({query:qi,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(S=>qs(S,r));if(!d)throw new Ge(`Couldn't find a store with domain ${e.store} for the current account.`,"Verify the domain (must be the canonical `myshopify.com` FQDN) and that you are signed in to an account with access to the store. Inactive shops are not searchable.");let l=await Rs(String(d.publicId),t,o);return{...l?{owningOrg:l}:{}}}async function Rs(e,t,o){try{let i=(await Yt({query:$i,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?kr(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${$s(r)}`);return}}function qs(e,t){return[e.primaryDomain,e.webUrl].some(o=>H(o)===t)}function $s(e){return e instanceof Error?e.message:String(e)}async function Us(e){let{store:t}=e;try{let r=(await Tt(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}: ${zs(o)}`);return}}function zs(e){return e instanceof Error?e.message:String(e)}async function Ui(e,t){if(t)return Ne(t);let o=at(),r=await Us({store:e,noPrompt:!o});if(r)return r;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:"."}]}),Ne()}var zi=R(j(),1),Je=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:zi.Flags.boolean({char:"f",description:"Skip confirmation. Required if non interactive.",env:"SHOPIFY_FLAG_FORCE",default:!1})};static get jsonOutputSchema(){return Me}async run(){let{flags:t}=await this.parse(e);try{if(!t.force&&!nt())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 Ui(t.store,t["organization-id"]?.toString());if(!t.force&&!await Fo({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new No;await Ri({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof c&&(g(Me.encode({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1})),process.exit(1)),o}}};n();n();n();var Hi=R(wa(),1);async function Bs(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 _e(e.queryFile))throw new c(m`Query file not found at ${u.path(e.queryFile)}. Please check the path and try again.`);let t=await Te(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new c(m`Query file at ${u.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new G("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Bi(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new c(m`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Hs(e,t){if(e!==void 0){if(!e.trim())throw new c(m`The ${u.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Bi(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(m`Invalid JSON in ${u.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await _e(t))throw new c(m`Variable file not found at ${u.path(t)}. Please check the path and try again.`);let o=await Te(t,{encoding:"utf8"});try{return Bi(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(m`Invalid JSON in variable file ${u.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function js(e){let t;try{t=(0,Hi.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 Ms(e){return e.operationDefinition.operation==="mutation"}function Gs(e,t=!1){if(Ms(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 ji(e){let t=await Bs({query:e.query,queryFile:e.queryFile}),o=js(t);Gs(o,e.allowMutations);let r=await Hs(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Et(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Mi(e){if(!Et(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Gi=["the user aborted a request","the operation was aborted"];function Js(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Gi.some(o=>t.includes(o))}function Ve(e,t){if(Mi(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(Js(e))return new c(`Request to ${t} was aborted before it completed.`)}function We(e,t){let o=Mi(e);o!==401&&o!==404||(Se(t.store,t.userId),yt(t))}var Vs=`
|
|
95
95
|
query StoreExecutePublicApiVersions {
|
|
96
96
|
publicApiVersions {
|
|
97
97
|
handle
|
|
98
98
|
supported
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
`;async function
|
|
101
|
+
`;async function Ji(e){try{return(await oe({query:Vs,api:"Admin",url:ae(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){We(t,e.session);let o=Ve(t,e.adminSession.storeFqdn);throw o||(Et(t)&&typeof t.response.status=="number"&&t.response.status>=500?new c(`Couldn't read the supported API versions for ${e.adminSession.storeFqdn}: the Admin API returned a server error (HTTP ${t.response.status}).`,"This is a problem on the Shopify side, not with your command. Wait a moment and run it again."):t)}}async function Vi(e){try{return await z({title:m`Executing GraphQL operation`,task:async()=>oe({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}}),renderOptions:{stdout:process.stderr}})}catch(t){We(t,e.context.session);let o=Ve(t,e.context.adminSession.storeFqdn);if(o)throw o;if(Et(t)&&t.response.errors){let r={errors:t.response.errors},i=new c("GraphQL operation failed.",JSON.stringify(r,null,2));throw i.details=r,i}throw t}}n();async function mo(e){let t=await $(_(e));return await F(t.store,!0),q(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function Ws(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await Ji({adminSession:o,session:t});if(!r)return i.filter(d=>d.supported).map(d=>d.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 Wi(e){let{adminSession:t,session:o}=await mo(e.store),r=await Ws({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var Qs={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>Wi({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>Vi({context:e,request:t})};function Qi(e){if(e==="admin")return Qs;throw new G(`Unsupported store GraphQL API target: ${e}`)}async function Yi(e){await F(e.store,!1);let t=Qi(e.api??"admin"),o=await ji({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await z({title:m`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();n();var _t=x({name:"StoreExecuteResult",schema:s.record(s.unknown()).nullable()});function Ki(e){if(e){T({headline:"Operation succeeded.",body:`Results written to ${e}`});return}T({headline:"Operation succeeded."})}async function Xi(e,t,o="text"){let r=_t.encode(e);if(t){await Ee(t,r),o==="text"&&Ki(t);return}o==="text"&&Ki(),g(r)}var Z=R(j(),1),Qe=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 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:Z.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":Z.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=>M(t),exactlyOne:["query","query-file"]}),variables:Z.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":Z.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=>M(t),exclusive:["variables"]}),store:b.store,version:Z.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":Z.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async t=>M(t)}),"allow-mutations":Z.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};static get jsonOutputSchema(){return _t}async run(){let{flags:t}=await this.parse(e),o=await Yi({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 Xi(o,t["output-file"],t.json?"json":"text")}};n();n();async function Zi(e){let t=Ys(e.store),o=Ir();await Tr({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,additionalReadyMessages:[m`Mutations are ${e.allowMutations?u.green("allowed"):u.yellow("blocked")}.`],abortSignal:e.abortSignal})}function Ys(e){return{getToken:async()=>(await $(e)).accessToken,refreshToken:async()=>(await $(e)).accessToken}}var Ft=R(j(),1),Ye=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 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,store:b.store,port:Ro({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":Ft.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:Ft.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:Ft.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);await Zi({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version})}};n();n();n();function Nt(e){if(e)return Si[e.toLowerCase()]}function ea(e){return e?te(e):""}n();var Ks={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client-transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function Ct(e){if(e)return Ks[e]}function ta(e){return e?te(e):""}var oa={dev:"development_superset",production:"production","client-transfer":"client_transfer",collaborator:"collaborator"},Pt=Object.keys(oa);function ra(e){return oa[e]}var Xs=`#graphql
|
|
102
102
|
query StoreInfoAdminShop {
|
|
103
103
|
shop {
|
|
104
104
|
id
|
|
@@ -112,9 +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 Dt(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=Y(t);if(oc(o)){await F(o.store,!0,o.preview.shopId),q(o.userId);let i=await rc(o);return pc({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await ec(t,{noPrompt:r})}catch(i){if(!r||!ic(i))throw i;return f(`BP store info lookup failed; falling back to stored store auth: ${sc(i)}`),Zs(t)}}async function Zs(e){let t=await $(e);await F(t.store,!0),q(t.userId);let o=await tc(t);return{...cc({store:t.store,shop:o}),authScopes:t.scopes}}async function ec(e,t={}){let o=await Tt({store:e,noPrompt:t.noPrompt}),r=await nc(o,e,{noPrompt:t.noPrompt});return uc({store:e,destinationsCtx:o,orgShop:r})}async function tc(e){try{let t=await oe({query:Xs,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){We(t,e);let o=Ve(t,e.store);throw o||t}}function oc(e){return e?.kind==="preview"&&e.preview!==void 0}async function rc(e){try{let t=await xi({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof He&&(t.status===401||t.status===404)&&(Se(e.store,e.userId),yt(e)),t}}async function nc(e,t,o={}){if(!e.owningOrg?.id){f("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await Ci({store:t,organizationId:e.owningOrg.id,noPrompt:o.noPrompt})}catch(r){f(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function ic(e){return e instanceof Ge||ac(e)}function ac(e){return e instanceof c&&e.message.includes("unable to prompt for reauthentication")}function sc(e){return e instanceof Error?e.message:String(e)}function cc(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:mc(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:ia(ie(r))};return{...le(i),subdomain:r}}function uc(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:na(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:dc(r),type:Ct(r?.storeType),plan:Nt(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:ia(ie(t))};return{...le(i),subdomain:t}}function pc(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:na(o.preview.shopId),displayName:o.preview.name,type:"preview",country:o.preview.country,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...le(i),subdomain:t,authScopes:o.scopes}}function na(e){if(e)return`gid://shopify/Shop/${e}`}function mc(e){let t=le({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function dc(e){if(!e)return;let t=le({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function ia(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();n();var aa=s.object({name:s.string().optional(),email:s.string().optional()}),Lt=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:aa.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:aa}});function sa(e,t){if(t==="json"){g(Lt.encode(e));return}let o=fc(e);I({customSections:[{title:"Store details",body:{tabularData:lc(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function lc(e){let t=[];return ee(t,"ID",e.id),ee(t,"Display Name",e.displayName),ee(t,"Subdomain",e.subdomain),ee(t,"Organization",e.organizationName),ee(t,"Store owner",hc(e.storeOwner)),ee(t,"Type",e.type?te(e.type):void 0),ee(t,"Plan",e.plan?te(e.plan):void 0),ee(t,"Feature Preview",e.featurePreview),t}function fc(e){let t=[];return lo(t,e.adminUrl,"Manage this store in the Shopify admin"),lo(t,e.accessUrl,"View your store"),lo(t,e.saveUrl,"Save your store"),t}function hc(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function ee(e,t,o){o&&e.push([t,o])}function lo(e,t,o){t&&e.push({link:{label:o,url:t}})}var Ke=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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];static flags={...g,...T,store:w.store};async run(){let{flags:t}=await this.parse(e),o=await mt({store:t.store});mi(o,t.json?"json":"text")}};n();n();n();n();n();var li={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 fi(e){let{entries:t,hasMore:o}=await fs(e.token,e.organization,e.storeType);return{entries:t.sort(ys),hasMore:o}}async function fs(e,t,o){let r=H(),a=(await X({query:li,token:e,organizationId:t.id,variables:{first:250,filters:hs(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let u=[];for(let p of a.edges){let m=gs(p.node,t);m&&u.push(m)}return{entries:u,hasMore:a.pageInfo.hasNextPage}}function hs(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:di(e)}),t}function gs(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:M(o)??o,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:pt(e.storeType),plan:ut(e.planName)}}function ys(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function hi(e={}){let t=await B(),o=await jo(t);if(!o.currentUserResolved)return{stores:[],source:"organization",notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[],source:"organization"};if(!e.organizationId&&o.organizations.length>1&&!je())throw new s("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 Ss(o.organizations,e.organizationId),i=await fi({token:t,organization:r,storeType:e.storeType}),{stores:a,truncated:u}=ks(i.entries,i.hasMore);return{stores:a,source:"organization",organization:ws(r),...e.storeType?{storeType:e.storeType}:{},...u?{truncated:!0}:{}}}async function Ss(e,t){if(t){let a=e.find(u=>u.id===t.toString());if(!a)throw new s(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(u=>`${u.businessName} (${u.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 Xt({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 ws(e){return{id:e.id,name:e.businessName}}function ks(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();var bs=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function gi(e,t){if(e.notice&&xt(e.notice),e.truncated&&xt(vs(e)),t==="json"){v(JSON.stringify({stores:e.stores,...e.organization?{organization:e.organization}:{},...e.storeType?{storeType:e.storeType}:{},...e.notice?{notice:e.notice}:{},...e.truncated?{truncated:!0}:{}},null,2));return}As(e)}function vs(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${yi(e.storeType)}${t}. More stores exist.`}function yi(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function As(e){b({headline:xs(e),customSections:[...Ts(e.organization),{body:bs}]}),e.stores.length>0&&Is(e.stores)}function xs(e){let t=yi(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function Ts(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function Is(e){ie({rows:e.map(t=>({subdomain:Os(t.store),name:t.name??"",type:ai(t.type),plan:ii(t.plan),created:et(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function Os(e){return tt(e)??e}var Ut=L(z(),1),$e=class e extends S{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.descriptionWithoutMarkdown();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={...g,...T,"organization-id":Ut.Flags.integer({description:`${w["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:Ut.Flags.string({description:"List only stores of this type.",options:ci,env:"SHOPIFY_FLAG_STORE_TYPE"})};async run(){let{flags:t}=await this.parse(e),o=await hi({organizationId:t["organization-id"],storeType:t.type});gi(o,t.json?"json":"text")}};n();n();var _s={getStoreInfo:mt,openURL:Ve};async function Si(e,t={}){let{getStoreInfo:o,openURL:r}={..._s,...t},i=await o({store:e.store}),a=Ns(i);if(await r(a)){b({headline:`Opening the storefront for ${e.store} in your browser.`});return}b({headline:"Browser didn't open automatically. Open the storefront manually:",body:[d`${c.link(a,a)}`.value]})}function Ns(e){return e.accessUrl??`https://${e.subdomain}`}var Ue=class e extends S{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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...g,store:w.store};async run(){let{flags:t}=await this.parse(e);await Si({store:t.store})}};var Es={"store:auth:list":ke,"store:auth":ve,"store:bulk:cancel":Ae,"store:bulk:execute":xe,"store:bulk:status":Te,"store:stripe-auth":Ie,"store:create:dev":_e,"store:create:preview":Ee,"store:delete":Ce,"store:execute":Le,"store:graphiql":Re,"store:info":qe,"store:list":$e,"store:open":Ue},lt=Es;n();var ft={"app:build":Xo,"app:bulk:cancel":Zo,"app:bulk:status":er,"app:deploy":ir,"app:dev":ar,"app:dev:clean":Rr,"app:doctor:instructions":sr,"app:doctor":cr,"app:logs":dr,"app:logs:sources":ur,"app:import-custom-data-definitions":$r,"app:import-extensions":vr,"app:info":Ar,"app:init":xr,"app:config:validate":Tr,"app:release":Ir,"app:subscription-migrations:cancel":Or,"app:subscription-migrations:list":_r,"app:subscription-migrations:schedule":Nr,"app:subscription-migrations:status":Er,"app:subscription-migrations:unschedule":Fr,"app:config:link":tr,"app:config:use":or,"app:config:pull":rr,"app:env:pull":pr,"app:env:show":mr,"app:execute":fr,"app:graphiql":hr,"app:bulk:execute":lr,"app:function:build":gr,"app:function:replay":yr,"app:function:run":Sr,"app:function:info":qr,"app:function:schema":wr,"app:function:typegen":kr,"app:generate:extension":br,"app:versions:list":Cr,"app:webhook:trigger":Pr,"demo:watcher":nr,"organization:list":Ur},Fs=Lr,Cs=Dr;import Ps from"fs";var Ry=Ko.init;(0,ki.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof eo?Kt(e):Ps.writeSync(process.stderr.fd,`${e.stack??e.message??e}
|
|
120
|
-
`),process.exit(1)});var Ds=["SIGINT","SIGTERM","SIGQUIT"];Ds.forEach(e=>{process.on(e,()=>{process.exit(1)})});var wi=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(wi)||(process.stdout.columns=wi);async function Ls({development:e}){await io({moduleURL:import.meta.url,development:e})}pe.plugins.hidden=!0;pe["plugins:install"].description="";var Rs=Object.keys(ft);Rs.forEach(e=>{ft[e].customPluginName="@shopify/app"});var qs=Object.keys(Je);qs.forEach(e=>{Je[e].customPluginName="@shopify/theme"});var $s=Object.keys(Ke);$s.forEach(e=>{Ke[e].customPluginName="@shopify/cli-hydrogen"});var Us=Object.keys(lt);Us.forEach(e=>{lt[e].customPluginName="@shopify/store"});var zs=Object.keys(Xe);zs.forEach(e=>{Xe[e].customPluginName="@oclif/plugin-commands"});var Ms=Object.keys(Ze);Ms.forEach(e=>{Ze[e].customPluginName="@shopify/plugin-did-you-mean"});var Hs=Object.keys(pe);Hs.forEach(e=>{pe[e].customPluginName="@oclif/plugin-plugins"});var qy={...ft,...Je,...pe,...Ze,...Xe,...Ke,...lt,search:so,upgrade:co,version:no,"send-analytics":uo,help:Ao,"auth:logout":po,"auth:login":mo,"debug:command-flags":lo,"kitchen-sink":yo,"kitchen-sink:async":fo,"kitchen-sink:prompts":ho,"kitchen-sink:static":go,"doctor-release":So,"doctor-release:theme":wo,"doc:fetch":ko,"doc:search":bo,"docs:generate":vo,"notifications:list":xo,"notifications:generate":To,"cache:clear":Io,"config:autoupgrade:off":Oo,"config:autoupgrade:on":_o,"config:autoupgrade:status":No},$y=Ls;export{Cs as AppPublicMetadataHook,Fs as AppSensitiveMetadataHook,qy as COMMANDS,_i as DidYouMeanHook,Ry as HydrogenInitHook,Oi as PluginHook,Ni as TunnelProviderHook,Ei as TunnelStartHook,$y as default,xi as fetchStoreThemes,Ti as pull,Ii as push};
|
|
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 Lt}async run(){let{flags:t}=await this.parse(e),o=await Dt({store:t.store});sa(o,t.json?"json":"text")}};n();n();n();n();n();var ca={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 ua(e){let{entries:t,hasMore:o}=await Sc(e.token,e.organization,e.storeType);return{entries:t.sort(wc),hasMore:o}}async function Sc(e,t,o){let r=J(),a=(await re({query:ca,token:e,organizationId:t.id,variables:{first:250,filters:gc(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let p=[];for(let d of a.edges){let l=yc(d.node,t);l&&p.push(l)}return{entries:p,hasMore:a.pageInfo.hasNextPage}}function gc(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:ra(e)}),t}function yc(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:H(o)??o,...e.primaryDomain?{primaryDomain:H(e.primaryDomain)??e.primaryDomain}:{},createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:Ct(e.storeType),plan:Nt(e.planName)}}function wc(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function ma(e={}){let t=await V();if(e.organizationId){let i=await vr(e.organizationId.toString(),t);if(i)return pa(t,i,e.storeType)}let o=await br(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&&!nt())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 kc(o.organizations,e.organizationId);return pa(t,r,e.storeType)}async function pa(e,t,o){let r=await ua({token:e,organization:t,storeType:o}),{stores:i,truncated:a}=vc(r.entries,r.hasMore);return{stores:i,organization:bc(t),...o?{storeType:o}:{},...a?{truncated:!0}:{}}}async function kc(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 _o({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 bc(e){return{id:e.id,name:e.businessName}}function vc(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();n();var da=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}),Rt=x({name:"StoreListResult",schema:s.object({stores:s.array(da),organization:ce.optional(),storeType:s.enum(Pt).optional(),notice:s.string().optional(),truncated:s.boolean().optional()}),definitions:{StoreListEntry:da,StoreListOrganization:ce}});var Ac=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function la(e,t){if(e.notice&&Kt(e.notice),e.truncated&&Kt(xc(e)),t==="json"){g(Rt.encode(e));return}Oc(e)}function xc(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${fa(e.storeType)}${t}. More stores exist.`}function fa(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function Oc(e){I({headline:Ic(e),customSections:[...Tc(e.organization),{body:Ac}]}),e.stores.length>0&&Ec(e.stores)}function Ic(e){let t=fa(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function Tc(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function Ec(e){fe({rows:e.map(t=>({subdomain:_c(t.store),name:t.name??"",type:ta(t.type),plan:ea(t.plan),created:lt(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function _c(e){return ft(e)??e}var fo=R(j(),1),Xe=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":fo.Flags.integer({description:`${b["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:fo.Flags.string({description:"List only stores of this type.",options:Pt,env:"SHOPIFY_FLAG_STORE_TYPE"})};static get jsonOutputSchema(){return Rt}async run(){let{flags:t}=await this.parse(e),o=await ma({organizationId:t["organization-id"],storeType:t.type});la(o,t.json?"json":"text")}};n();n();var Fc={getStoreInfo:Dt,openURL:it};async function ha(e,t={}){let{getStoreInfo:o,openURL:r}={...Fc,...t},i=await o({store:e.store}),a=Nc(i),p=await r(a),d=ie(i.subdomain);return{storeDomain:d?`${d}.myshopify.com`:null,url:a,opened:p}}function Nc(e){return e.accessUrl??`https://${e.subdomain}`}n();n();var qt=x({name:"OpenStoreResult",schema:s.object({storeDomain:s.string().regex(/^[^.]+\.myshopify\.com$/).nullable(),url:s.string().url(),opened:s.boolean()}).strict()});function Sa(e,t){if(t==="json"){g(qt.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:[m`${u.link(e.url,e.url)}`.value]})}var Ze=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 qt}async run(){let{flags:t}=await this.parse(e),o=await ha({store:t.store});Sa(o,t.json?"json":"text")}};var Cc={"store:auth:list":Ce,"store:auth":De,"store:bulk:cancel":Re,"store:bulk:execute":qe,"store:bulk:status":$e,"store:stripe-auth":Ue,"store:create:dev":Be,"store:create:preview":je,"store:delete":Je,"store:execute":Qe,"store:graphiql":Ye,"store:info":Ke,"store:list":Xe,"store:open":Ze},$t=Cc;n();var Ut={"app:build":_r,"app:bulk:cancel":Fr,"app:bulk:status":Nr,"app:deploy":Rr,"app:dev":qr,"app:dev:clean":yn,"app:security:check":$r,"app:security:clean":Ur,"app:security:instructions":zr,"app:security:record":Br,"app:security:review":Hr,"app:logs":jr,"app:logs:sources":Mr,"app:import:channel-config":kn,"app:import:custom-data-definitions":bn,"app:import:dashboard-extensions":on,"app:import-custom-data-definitions":vn,"app:import-extensions":rn,"app:info":nn,"app:init":an,"app:config:validate":sn,"app:release":cn,"app:subscription-migrations:cancel":un,"app:subscription-migrations:list":pn,"app:subscription-migrations:schedule":mn,"app:subscription-migrations:status":dn,"app:subscription-migrations:unschedule":ln,"app:config:link":Cr,"app:config:use":Pr,"app:config:pull":Dr,"app:env:pull":Gr,"app:env:show":Jr,"app:execute":Wr,"app:graphiql":Qr,"app:bulk:execute":Vr,"app:function:build":Yr,"app:function:replay":Kr,"app:function:run":Xr,"app:function:info":wn,"app:function:schema":Zr,"app:function:typegen":en,"app:generate:extension":tn,"app:versions:list":fn,"app:webhook:trigger":hn,"demo:watcher":Lr,"organization:list":An},Pc=gn,Dc=Sn;var jk=Er.init;(0,ya.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async e=>{await er(e),process.exit(1)});var Lc=["SIGINT","SIGTERM","SIGQUIT"];Lc.forEach(e=>{process.on(e,()=>{process.exit(1)})});var ga=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(ga)||(process.stdout.columns=ga);async function Rc({development:e}){await Lo({moduleURL:import.meta.url,development:e})}we.plugins.hidden=!0;we["plugins:install"].description="";var qc=Object.keys(Ut);qc.forEach(e=>{Ut[e].customPluginName="@shopify/app"});var $c=Object.keys(ut);$c.forEach(e=>{ut[e].customPluginName="@shopify/theme"});var Uc=Object.keys(pt);Uc.forEach(e=>{pt[e].customPluginName="@shopify/cli-hydrogen"});var zc=Object.keys($t);zc.forEach(e=>{$t[e].customPluginName="@shopify/store"});var Bc=Object.keys(mt);Bc.forEach(e=>{mt[e].customPluginName="@oclif/plugin-commands"});var Hc=Object.keys(dt);Hc.forEach(e=>{dt[e].customPluginName="@shopify/plugin-did-you-mean"});var jc=Object.keys(we);jc.forEach(e=>{we[e].customPluginName="@oclif/plugin-plugins"});var Mk={...Ut,...ut,...we,...dt,...mt,...pt,...$t,search:$o,upgrade:Uo,version:qo,"send-analytics":zo,help:Zo,"auth:logout":Bo,"auth:login":Ho,"debug:command-flags":jo,"kitchen-sink":Vo,"kitchen-sink:async":Mo,"kitchen-sink:prompts":Go,"kitchen-sink:static":Jo,"doctor-release":Wo,"doctor-release:theme":Qo,"doc:fetch":Yo,"doc:search":Ko,"docs:generate":Xo,"notifications:list":tr,"notifications:generate":or,"cache:clear":rr,"config:autoupgrade:off":nr,"config:autoupgrade:on":ir,"config:autoupgrade:status":ar},Gk=Rc;export{Dc as AppPublicMetadataHook,Pc as AppSensitiveMetadataHook,Mk as COMMANDS,Oa as DidYouMeanHook,jk as HydrogenInitHook,xa as PluginHook,Ia as TunnelProviderHook,Ta as TunnelStartHook,Gk as default,ba as fetchStoreThemes,va as pull,Aa as push};
|