@shopify/cli 4.6.0 → 4.7.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-6LI5GLWS.js +1 -0
- package/dist/analytics-UNRIIG4Y.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-4YCMEC5R.js → chunk-2CYVZUYT.js} +1 -1
- package/dist/{chunk-C256W7D2.js → chunk-2HK4MFWP.js} +3 -3
- package/dist/chunk-2JDCVEFK.js +1 -0
- package/dist/chunk-2SZOPJYI.js +1 -0
- package/dist/chunk-2U4P6UFZ.js +6 -0
- package/dist/{chunk-TAFOSPBW.js → chunk-2WJAAJVX.js} +1 -1
- package/dist/chunk-37TEEITE.js +2 -0
- package/dist/chunk-3K6VHXC2.js +4 -0
- package/dist/chunk-4HV6A6UH.js +8 -0
- package/dist/chunk-4JY2P2A5.js +1 -0
- package/dist/chunk-4LRG5YBS.js +3 -0
- package/dist/chunk-4W3UE2ZI.js +1 -0
- package/dist/chunk-5CADTCJE.js +25 -0
- package/dist/chunk-5CR5YJTU.js +11 -0
- package/dist/chunk-5CYJG63I.js +1 -0
- package/dist/chunk-5HBIIYSK.js +1 -0
- package/dist/chunk-5HPBQ6U5.js +1 -0
- package/dist/chunk-5NO5OXYP.js +15 -0
- package/dist/chunk-63CIFL36.js +6 -0
- package/dist/chunk-6EBLULOC.js +1 -0
- package/dist/{chunk-FMTPUYSH.js → chunk-6ENBE43F.js} +1 -1
- package/dist/chunk-6OFGSZD6.js +1 -0
- package/dist/chunk-6PDR2IUL.js +11 -0
- package/dist/chunk-6VGJVXZI.js +3 -0
- package/dist/{chunk-ILQXBASM.js → chunk-6VRXGEIW.js} +1 -1
- package/dist/chunk-6WZYX5RO.js +1 -0
- package/dist/chunk-7AALWJAO.js +7 -0
- package/dist/chunk-7DOWT5JZ.js +20 -0
- package/dist/chunk-7JIQXGDE.js +9 -0
- package/dist/chunk-7MHANY34.js +1 -0
- package/dist/chunk-7WTNEG2F.js +3 -0
- package/dist/chunk-7Y7AZRL3.js +10 -0
- package/dist/chunk-ACTDYTAV.js +317 -0
- package/dist/{chunk-Y2PC2BBJ.js → chunk-AEUCDGTB.js} +4 -4
- package/dist/chunk-AGOEROAI.js +10 -0
- package/dist/{chunk-WPRAJ25Z.js → chunk-AH2ZGMDM.js} +1 -1
- package/dist/chunk-AMLWPYNA.js +4 -0
- package/dist/chunk-B4OMIONW.js +5 -0
- package/dist/chunk-BR6DBMQA.js +5 -0
- package/dist/chunk-CFWHR74L.js +1 -0
- package/dist/chunk-CHMEDVDZ.js +15 -0
- package/dist/chunk-CIH6LPTG.js +6 -0
- package/dist/chunk-CMYQXGLO.js +1 -0
- package/dist/chunk-CTRXLZAJ.js +1 -0
- package/dist/{chunk-WWX265PC.js → chunk-CYOFLJ3Z.js} +1 -1
- package/dist/{chunk-HSKB5OTM.js → chunk-CZJZCJRX.js} +1 -1
- package/dist/chunk-CZPGC2E7.js +1 -0
- package/dist/{chunk-2I62GKIH.js → chunk-D2K2ZBKH.js} +8 -8
- package/dist/chunk-DHU57LKD.js +1 -0
- package/dist/chunk-DKL6N3L2.js +1 -0
- package/dist/chunk-DMXQLI35.js +1 -0
- package/dist/chunk-DPNZWBT5.js +1 -0
- package/dist/{chunk-QU5NL2QT.js → chunk-DQCIORGH.js} +1 -1
- package/dist/chunk-DQFSKPKL.js +6 -0
- package/dist/{chunk-6Q5VRSRN.js → chunk-E2W5OYYM.js} +1 -1
- package/dist/chunk-E5T4YRGW.js +1 -0
- package/dist/chunk-EOMCXBCS.js +5 -0
- package/dist/{chunk-LWRDNTAD.js → chunk-EW55WWT7.js} +1 -1
- package/dist/{chunk-6UTUJKKC.js → chunk-F5HCSUXC.js} +5 -5
- package/dist/{chunk-W2GMKXM7.js → chunk-FCGKO2KY.js} +1 -1
- package/dist/{chunk-7CPECP5P.js → chunk-FULWTZS6.js} +1 -1
- package/dist/chunk-FWPJEL6Q.js +3 -0
- package/dist/chunk-GKOBFX4A.js +1 -0
- package/dist/chunk-GLWQMLUC.js +1 -0
- package/dist/chunk-GMTNOCMS.js +375 -0
- package/dist/chunk-GSCWZR22.js +1 -0
- package/dist/chunk-GZ64KWHX.js +8 -0
- package/dist/{chunk-72GN655L.js → chunk-H5KWM27L.js} +1 -1
- package/dist/chunk-HHVHVGRT.js +1 -0
- package/dist/{chunk-EBZ6MDEM.js → chunk-HLNJL4B6.js} +1 -1
- package/dist/{chunk-OUUOML3D.js → chunk-HZIX3DIT.js} +1 -1
- package/dist/chunk-I3N6NPHF.js +2 -0
- package/dist/chunk-JD5P5RAJ.js +1 -0
- package/dist/chunk-JJJTPEMD.js +1 -0
- package/dist/{chunk-KRZABRYT.js → chunk-JLGA3B7P.js} +1 -1
- package/dist/chunk-JQ2B3VHR.js +7 -0
- package/dist/{chunk-VZKR2YFM.js → chunk-JQISGC7D.js} +1 -1
- package/dist/chunk-JQVXH26X.js +6 -0
- package/dist/{chunk-ERCJPRN3.js → chunk-JUKAWTYY.js} +1 -1
- package/dist/{chunk-JHRZCUBE.js → chunk-JZMRBJH3.js} +1 -1
- package/dist/chunk-JZXA3H5K.js +1 -0
- package/dist/chunk-K4KTNINH.js +1 -0
- package/dist/chunk-KCS75ZM4.js +1 -0
- package/dist/{chunk-AJ6VOBXU.js → chunk-KIYHEMHD.js} +7 -7
- package/dist/chunk-KK24VGVE.js +6 -0
- package/dist/{chunk-6BX62FFE.js → chunk-KOVAFUYN.js} +1 -1
- package/dist/{chunk-QG7TELFC.js → chunk-KUNDCAQN.js} +1 -1
- package/dist/{chunk-3NO6PWNL.js → chunk-L67BU25M.js} +1 -1
- package/dist/{chunk-4KZRP2JP.js → chunk-LDF4PQ3B.js} +18 -18
- package/dist/chunk-LFOBYEWG.js +1 -0
- package/dist/chunk-LJM2DUXN.js +1 -0
- package/dist/{chunk-XWPPBOGF.js → chunk-LQ7ENG4V.js} +1 -1
- package/dist/chunk-LQCR4TGH.js +3 -0
- package/dist/{chunk-UM3OHLCX.js → chunk-LRQYUWWB.js} +1 -1
- package/dist/{chunk-CXWLHQKA.js → chunk-LWJA2DQG.js} +1 -1
- package/dist/{chunk-IKYZ5L3F.js → chunk-LZ3GZ7NS.js} +1 -1
- package/dist/chunk-MB7E5GEY.js +2 -0
- package/dist/{chunk-XERJY4IG.js → chunk-MLZLDL6B.js} +8 -8
- package/dist/chunk-MRCWOOSF.js +8 -0
- package/dist/chunk-N6YTJXIS.js +18 -0
- package/dist/chunk-NEMPLS7C.js +1 -0
- package/dist/chunk-OE3F7XXU.js +4 -0
- package/dist/chunk-OORWOTAP.js +3 -0
- package/dist/chunk-OUZGGWFN.js +1 -0
- package/dist/chunk-P5MNNBSO.js +1 -0
- package/dist/chunk-PAAKBWSF.js +1 -0
- package/dist/{chunk-5EFQILLF.js → chunk-PANGX7SA.js} +1 -1
- package/dist/{chunk-DODCPRXT.js → chunk-PIFW2R3S.js} +1 -1
- package/dist/chunk-PWSI275S.js +7 -0
- package/dist/chunk-Q5DQGV3M.js +1 -0
- package/dist/chunk-QBIVQXUJ.js +6 -0
- package/dist/chunk-QEB3HUQE.js +19 -0
- package/dist/{chunk-E3RDAVJT.js → chunk-QKGZWOOY.js} +1 -1
- package/dist/chunk-QPWMD2VR.js +1 -0
- package/dist/chunk-QRT4A2RV.js +3 -0
- package/dist/chunk-QXHENYJH.js +2 -0
- package/dist/{chunk-FPWLEGKZ.js → chunk-QZBSCOJV.js} +1 -1
- package/dist/chunk-R2R6JDNH.js +1 -0
- package/dist/chunk-RUFQCXBX.js +16 -0
- package/dist/chunk-RY2SJVWM.js +12 -0
- package/dist/chunk-RZFBGBNA.js +1 -0
- package/dist/chunk-S3P5WWJD.js +1 -0
- package/dist/chunk-SEVSMWNX.js +1 -0
- package/dist/chunk-SJMTETSU.js +32 -0
- package/dist/chunk-SSJGWLCW.js +28 -0
- package/dist/chunk-SYADOUBB.js +7 -0
- package/dist/chunk-T5JXQ7KO.js +1 -0
- package/dist/chunk-TCTVI6PK.js +1 -0
- package/dist/chunk-TSLQZTXR.js +1 -0
- package/dist/chunk-TTAPXLI5.js +1 -0
- package/dist/{chunk-MDXSLAIC.js → chunk-TY4W7AYX.js} +1 -1
- package/dist/chunk-TYIGOVRQ.js +3 -0
- package/dist/{chunk-B6SY4BIK.js → chunk-U2Z5NMXV.js} +1 -1
- package/dist/{chunk-KGZH4RFA.js → chunk-U6HYEGAE.js} +1 -1
- package/dist/chunk-U7R6LYPJ.js +5 -0
- package/dist/chunk-UPJLZHHR.js +4 -0
- package/dist/chunk-UVQL7RUY.js +1 -0
- package/dist/chunk-V2HCVJYF.js +1 -0
- package/dist/chunk-V5SC2RYQ.js +2 -0
- package/dist/chunk-VKSR6MJG.js +2 -0
- package/dist/chunk-VRVP2GQL.js +5 -0
- package/dist/{chunk-XGRVAPLR.js → chunk-WCRZJY3P.js} +1 -1
- package/dist/{chunk-XGCJWCC4.js → chunk-WHLGNDRE.js} +1 -1
- package/dist/{chunk-E3RQCWSC.js → chunk-WKUGSFTB.js} +3 -3
- package/dist/chunk-X4XP2RQJ.js +1 -0
- package/dist/chunk-XAOYKECS.js +1 -0
- package/dist/chunk-XCBEYRQI.js +3 -0
- package/dist/chunk-XHZ5BWXL.js +5 -0
- package/dist/{chunk-2JFZ6GZC.js → chunk-XLURZ6GL.js} +52 -52
- package/dist/chunk-XRT2W5Y2.js +10 -0
- package/dist/chunk-XUEMMLXK.js +1 -0
- package/dist/chunk-Y34LWI3S.js +19 -0
- package/dist/chunk-YHPBDS52.js +16 -0
- package/dist/{chunk-JS3X6BDT.js → chunk-YIZZ5LZN.js} +1 -1
- package/dist/chunk-YN6A26QL.js +836 -0
- package/dist/chunk-YOO7DLOT.js +1 -0
- package/dist/chunk-YUVE2I3C.js +1 -0
- package/dist/chunk-YY6TFARF.js +1 -0
- package/dist/chunk-Z5K4J7HQ.js +1 -0
- package/dist/chunk-ZCNIR6YU.js +1 -0
- package/dist/{chunk-OTT73YUA.js → chunk-ZO74GSWC.js} +1 -1
- package/dist/{chunk-5Y2VD4I3.js → chunk-ZRLEAF7M.js} +1 -1
- package/dist/chunk-ZSFAURIH.js +3 -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-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/send-analytics.d.ts +5 -0
- package/dist/cli/commands/send-analytics.js +1 -0
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/services/doctor-release/theme/tests/init.js +4 -8
- package/dist/cli/services/doctor-release/theme/tests/push.js +3 -4
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-OAGJBITE.js +1 -0
- package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
- package/dist/deprecations-K3NPRKBF.js +1 -0
- package/dist/dist-EXJEE23W.js +1 -0
- package/dist/dist-S62Z6IFV.js +1 -0
- package/dist/environments-ALH2N36U.js +1 -0
- package/dist/error-YX56C43A.js +1 -0
- package/dist/error-handler-FDCH72NH.js +1 -0
- package/dist/fs-SKHQZZTQ.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +2 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -15
- package/dist/is-global-V5VORI3F.js +1 -0
- package/dist/lib-M72BVWQ3.js +1 -0
- package/dist/local-GX5AN6ZS.js +1 -0
- package/dist/metadata-XUJUTBTB.js +1 -0
- package/dist/{morph-ABSWZEVT.js → morph-77RHJICZ.js} +1 -1
- package/dist/node-package-manager-3WIYU7Y3.js +1 -0
- package/dist/notifications-system-RHULO564.js +1 -0
- package/dist/os-M6X7KOR4.js +1 -0
- package/dist/output-X47P6ICP.js +1 -0
- package/dist/{prettier-6ZMB2MMO.js → prettier-RVUAAWC7.js} +1 -1
- package/dist/system-SR5G7WEW.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-VYWSLAQ6.js +1 -0
- package/dist/upgrade-PFQ7JMXG.js +1 -0
- package/dist/version-FK4ETQ22.js +1 -0
- package/dist/version-U4GM2LNG.js +1 -0
- package/dist/workerd-NAPS5TA7.js +18 -0
- package/oclif.manifest.json +146 -120
- package/package.json +7 -8
- package/dist/analytics-6S5JVSRO.js +0 -1
- package/dist/analytics-E252SR3P.js +0 -1
- package/dist/chunk-2MCH43SL.js +0 -11
- package/dist/chunk-2SNT7U7B.js +0 -1
- package/dist/chunk-2VIUGNYO.js +0 -1
- package/dist/chunk-2Y6CYLKF.js +0 -1
- package/dist/chunk-3EHRA4LA.js +0 -1
- package/dist/chunk-3EPQ6UOK.js +0 -25
- package/dist/chunk-3TFUSDHY.js +0 -370
- package/dist/chunk-46NA23I7.js +0 -3
- package/dist/chunk-47URTBZF.js +0 -9
- package/dist/chunk-4FEBSLSU.js +0 -1
- package/dist/chunk-4HB4VZJQ.js +0 -4
- package/dist/chunk-4JARSKED.js +0 -32
- package/dist/chunk-4P7PWLUN.js +0 -1
- package/dist/chunk-53ZA2HD3.js +0 -1
- package/dist/chunk-57YF2UNT.js +0 -1
- package/dist/chunk-5JPV3HPJ.js +0 -1
- package/dist/chunk-5LJ5H4TD.js +0 -7
- package/dist/chunk-6FJBCRVK.js +0 -15
- package/dist/chunk-6SXB44CE.js +0 -1
- package/dist/chunk-6YCGMS7X.js +0 -28
- package/dist/chunk-7HAFBCL3.js +0 -2
- package/dist/chunk-7XPFLQEM.js +0 -1
- package/dist/chunk-A3JE5LX3.js +0 -7
- package/dist/chunk-A4SBXDZB.js +0 -14
- package/dist/chunk-B2WK53GH.js +0 -1
- package/dist/chunk-B34VYVGV.js +0 -1
- package/dist/chunk-BBEHNPKK.js +0 -7
- package/dist/chunk-BCTMBKAU.js +0 -7
- package/dist/chunk-BGUHH7AW.js +0 -10
- package/dist/chunk-DHU767C3.js +0 -1
- package/dist/chunk-DKHMLETG.js +0 -1
- package/dist/chunk-EJDWYASP.js +0 -1
- package/dist/chunk-ELJ7SKMH.js +0 -1
- package/dist/chunk-EQTULRM7.js +0 -2
- package/dist/chunk-ESZS7L6O.js +0 -11
- package/dist/chunk-ET2O5DAS.js +0 -1
- package/dist/chunk-EZ7EBYDT.js +0 -684
- package/dist/chunk-EZNJDFFK.js +0 -28
- package/dist/chunk-F34LB7M4.js +0 -20
- package/dist/chunk-FE24P4UQ.js +0 -6
- package/dist/chunk-FT4HLDK7.js +0 -1
- package/dist/chunk-G3YYMKWG.js +0 -3
- package/dist/chunk-G7QW5OSQ.js +0 -6
- package/dist/chunk-GCDEDRY7.js +0 -3
- package/dist/chunk-GEE5MXHT.js +0 -5
- package/dist/chunk-H4MYBJ6C.js +0 -1
- package/dist/chunk-HDXBZLHH.js +0 -8
- package/dist/chunk-HT6MOPLW.js +0 -1
- package/dist/chunk-HZXY7RWJ.js +0 -19
- package/dist/chunk-IDAWPBJM.js +0 -4
- package/dist/chunk-IDLDQ2JB.js +0 -1
- package/dist/chunk-IYU72M55.js +0 -3
- package/dist/chunk-J3IHP46B.js +0 -3
- package/dist/chunk-J4KJQHNS.js +0 -1
- package/dist/chunk-JIBLEZ57.js +0 -18
- package/dist/chunk-JIKIYMCT.js +0 -1
- package/dist/chunk-JJTGHARS.js +0 -3
- package/dist/chunk-JQP3ZCAG.js +0 -1
- package/dist/chunk-K7IZMKBR.js +0 -5
- package/dist/chunk-KO4FB4QU.js +0 -1
- package/dist/chunk-KPRKIZ5M.js +0 -3
- package/dist/chunk-KUN74JD4.js +0 -4
- package/dist/chunk-KURWC4A5.js +0 -16
- package/dist/chunk-L3D2CASO.js +0 -1
- package/dist/chunk-L7DZTIHJ.js +0 -1
- package/dist/chunk-LBDAYBIF.js +0 -1
- package/dist/chunk-LH3RIIOB.js +0 -8
- package/dist/chunk-LWWBU7ET.js +0 -6
- package/dist/chunk-M4BEPPA3.js +0 -1
- package/dist/chunk-M4YPMHIM.js +0 -1
- package/dist/chunk-M5KKLAM6.js +0 -3
- package/dist/chunk-MBLHXPGK.js +0 -1
- package/dist/chunk-MDHJJVXA.js +0 -2
- package/dist/chunk-NA2ERJIJ.js +0 -1
- package/dist/chunk-NOKCVDYD.js +0 -317
- package/dist/chunk-O6XSWAP2.js +0 -4
- package/dist/chunk-OB62WVZ5.js +0 -16
- package/dist/chunk-OT52JOML.js +0 -1
- package/dist/chunk-P7XC5HS2.js +0 -1
- package/dist/chunk-PALG4SNB.js +0 -1
- package/dist/chunk-PB37BTPE.js +0 -6
- package/dist/chunk-PWYRKTJ4.js +0 -1
- package/dist/chunk-PXSX63RF.js +0 -1
- package/dist/chunk-QDPDB5EP.js +0 -3
- package/dist/chunk-QV53BSQP.js +0 -6
- package/dist/chunk-QXXA2EQY.js +0 -15
- package/dist/chunk-QZ5FMWZS.js +0 -1
- package/dist/chunk-R26GJEH3.js +0 -1
- package/dist/chunk-RTW4RZWH.js +0 -6
- package/dist/chunk-SEV3S3WH.js +0 -8
- package/dist/chunk-STJ3LWFL.js +0 -1
- package/dist/chunk-TAV2ENJY.js +0 -1
- package/dist/chunk-TQNALMQH.js +0 -3
- package/dist/chunk-TUJNCWHZ.js +0 -1
- package/dist/chunk-U564K7SX.js +0 -1
- package/dist/chunk-UKQ7NE5V.js +0 -1
- package/dist/chunk-V65P572N.js +0 -10
- package/dist/chunk-VFIVXK53.js +0 -2
- package/dist/chunk-VVFPW4ZQ.js +0 -2
- package/dist/chunk-VYITPC34.js +0 -11
- package/dist/chunk-W4X3635B.js +0 -1
- package/dist/chunk-WEEYQX3M.js +0 -1
- package/dist/chunk-WO7LKJCJ.js +0 -1
- package/dist/chunk-WR2ZQGUR.js +0 -1
- package/dist/chunk-WW7TENNA.js +0 -1
- package/dist/chunk-XGMPC7KK.js +0 -2
- package/dist/chunk-Y4QC2YVE.js +0 -1
- package/dist/chunk-YNJZ2VXV.js +0 -5
- package/dist/chunk-Z5DDPQ26.js +0 -3
- package/dist/chunk-ZK7VJZ6V.js +0 -6
- package/dist/chunk-ZLT4DPHN.js +0 -5
- package/dist/chunk-ZOBQKNGK.js +0 -1
- package/dist/chunk-ZTE46E4Z.js +0 -153
- package/dist/conf-store-N5P2ZEAD.js +0 -1
- package/dist/custom-oclif-loader-4ZAXX5MR.js +0 -1
- package/dist/deprecations-4TY4DNME.js +0 -1
- package/dist/dist-6ZJS4I57.js +0 -1
- package/dist/dist-7W2KJOYN.js +0 -1
- package/dist/environments-TR5WW2MD.js +0 -1
- package/dist/error-VJQM4MFE.js +0 -1
- package/dist/error-handler-IYGE3Z72.js +0 -1
- package/dist/fs-EOQL26C3.js +0 -1
- package/dist/hooks/app-init.d.ts +0 -9
- package/dist/hooks/app-init.js +0 -1
- package/dist/is-global-RQCPBQA3.js +0 -1
- package/dist/is-wsl-UEMXYJPN.js +0 -1
- package/dist/lib-JKLF33A7.js +0 -1
- package/dist/local-TW3HCZ2S.js +0 -1
- package/dist/local-storage-T6FKS53K.js +0 -1
- package/dist/metadata-TYZDEER5.js +0 -1
- package/dist/node-package-manager-6SWUZILX.js +0 -1
- package/dist/notifications-system-SMHMV2UW.js +0 -1
- package/dist/output-JG5I2TEL.js +0 -1
- package/dist/system-D4Z32GDS.js +0 -1
- package/dist/ui-6M3XZ6MR.js +0 -1
- package/dist/upgrade-EKAG4IV7.js +0 -1
- package/dist/version-6UBWZCNS.js +0 -1
- package/dist/version-XRU7TEAI.js +0 -1
- package/dist/workerd-LXBSJULF.js +0 -18
- /package/dist/{chunk-VDN6MEYI.js → chunk-NJPL5BTN.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`)}var
|
|
1
|
+
import{a as Qe,b as jo}from"./chunk-D2K2ZBKH.js";import{a as Ye}from"./chunk-AEUCDGTB.js";import"./chunk-LQ7ENG4V.js";import"./chunk-LDF4PQ3B.js";import{a as rr}from"./chunk-QXHENYJH.js";import{a as kr}from"./chunk-3K6VHXC2.js";import{a as wr}from"./chunk-Z5K4J7HQ.js";import{a as vr}from"./chunk-5CADTCJE.js";import{a as Zo}from"./chunk-SEVSMWNX.js";import{a as Ir}from"./chunk-XUEMMLXK.js";import{a as pr}from"./chunk-GLWQMLUC.js";import{a as fr}from"./chunk-4HV6A6UH.js";import{a as Vo,b as Go,c as dr}from"./chunk-6VGJVXZI.js";import{a as Nr}from"./chunk-UPJLZHHR.js";import{a as hr}from"./chunk-P5MNNBSO.js";import{a as gr}from"./chunk-6PDR2IUL.js";import{a as H,b as Tt,c as Sr}from"./chunk-XRT2W5Y2.js";import{a as or}from"./chunk-VKSR6MJG.js";import{a as nr}from"./chunk-5CR5YJTU.js";import"./chunk-FKIVKNOV.js";import{a as ir}from"./chunk-6WZYX5RO.js";import"./chunk-ZO74GSWC.js";import{a as sr}from"./chunk-DMXQLI35.js";import{a as cr}from"./chunk-YOO7DLOT.js";import{a as Tr}from"./chunk-YHPBDS52.js";import{a as ur}from"./chunk-BR6DBMQA.js";import{a as mr}from"./chunk-KCS75ZM4.js";import"./chunk-GSCWZR22.js";import{a as lr}from"./chunk-2SZOPJYI.js";import"./chunk-DHU57LKD.js";import{a as Yo}from"./chunk-XHZ5BWXL.js";import{a as Jo}from"./chunk-OE3F7XXU.js";import{a as Xo}from"./chunk-YUVE2I3C.js";import{a as Ko}from"./chunk-CFWHR74L.js";import{a as yr}from"./chunk-FWPJEL6Q.js";import{a as er}from"./chunk-N6YTJXIS.js";import"./chunk-V5SC2RYQ.js";import{a as We,b as tr}from"./chunk-7DOWT5JZ.js";import"./chunk-UOHNRH6E.js";import"./chunk-7WTNEG2F.js";import"./chunk-MRCWOOSF.js";import"./chunk-PWSI275S.js";import"./chunk-X4XP2RQJ.js";import"./chunk-TYIGOVRQ.js";import"./chunk-7AALWJAO.js";import{a as di}from"./chunk-LQCR4TGH.js";import"./chunk-SSJGWLCW.js";import{a as ci}from"./chunk-2CYVZUYT.js";import"./chunk-QBIVQXUJ.js";import"./chunk-JQ2B3VHR.js";import"./chunk-2HK4MFWP.js";import"./chunk-WKUGSFTB.js";import"./chunk-J3JPJCWP.js";import"./chunk-WHLGNDRE.js";import"./chunk-SJMTETSU.js";import"./chunk-K4KTNINH.js";import"./chunk-CZPGC2E7.js";import"./chunk-DQCIORGH.js";import"./chunk-GZ64KWHX.js";import"./chunk-XLURZ6GL.js";import"./chunk-PAAKBWSF.js";import{b as si}from"./chunk-ZCNIR6YU.js";import"./chunk-4LRG5YBS.js";import"./chunk-QZBSCOJV.js";import"./chunk-MLZLDL6B.js";import"./chunk-JLGA3B7P.js";import"./chunk-QPWMD2VR.js";import"./chunk-KOVAFUYN.js";import"./chunk-FULWTZS6.js";import"./chunk-QEB3HUQE.js";import"./chunk-5NO5OXYP.js";import"./chunk-E2W5OYYM.js";import"./chunk-4W3UE2ZI.js";import"./chunk-YY6TFARF.js";import"./chunk-LZ3GZ7NS.js";import"./chunk-4JY2P2A5.js";import{a as U,b as Oo,c as G,d as re,e as Ge}from"./chunk-OORWOTAP.js";import"./chunk-6VRXGEIW.js";import"./chunk-FCGKO2KY.js";import"./chunk-JUKAWTYY.js";import"./chunk-Q7BOSHWX.js";import"./chunk-AH2ZGMDM.js";import"./chunk-ZSFAURIH.js";import"./chunk-JZMRBJH3.js";import"./chunk-VE35YELD.js";import"./chunk-63CIFL36.js";import"./chunk-TU47HMTL.js";import"./chunk-U7R6LYPJ.js";import"./chunk-TYMYIUIQ.js";import"./chunk-TY4W7AYX.js";import"./chunk-QKGZWOOY.js";import"./chunk-ZRLEAF7M.js";import"./chunk-ZI7LK3LW.js";import"./chunk-CZJZCJRX.js";import{a as xr}from"./chunk-VRVP2GQL.js";import{a as To}from"./chunk-CIH6LPTG.js";import{a as No}from"./chunk-JQVXH26X.js";import{a as Io}from"./chunk-DQFSKPKL.js";import"./chunk-GCN4O7HM.js";import{a as So}from"./chunk-S3P5WWJD.js";import{a as Wo}from"./chunk-UVQL7RUY.js";import"./chunk-OUZGGWFN.js";import"./chunk-PANGX7SA.js";import{a as Qo}from"./chunk-I3N6NPHF.js";import{a as ar}from"./chunk-SYADOUBB.js";import"./chunk-6ENBE43F.js";import{a as pe,b as _o,c as ne,e as ie,f as fe,g as Eo,h as Fo,i as Po,j as Do,k as Co,l as Lo,m as je,n as Ro,o as qo,p as $o,q as Uo,r as zo,s as Mo}from"./chunk-YIZZ5LZN.js";import"./chunk-H5KWM27L.js";import"./chunk-NEMPLS7C.js";import"./chunk-KUNDCAQN.js";import"./chunk-TSLQZTXR.js";import{a as wo}from"./chunk-CHMEDVDZ.js";import{a as go}from"./chunk-Q5DQGV3M.js";import{a as lo}from"./chunk-JZXA3H5K.js";import{a as ho}from"./chunk-7MHANY34.js";import"./chunk-HZIX3DIT.js";import{a as po}from"./chunk-TCTVI6PK.js";import"./chunk-6EBLULOC.js";import"./chunk-VUMUCNI7.js";import{a as fo}from"./chunk-T5JXQ7KO.js";import"./chunk-WCRZJY3P.js";import{a as Ao}from"./chunk-2JDCVEFK.js";import{a as bo}from"./chunk-GKOBFX4A.js";import"./chunk-EW55WWT7.js";import{a as ao}from"./chunk-5HPBQ6U5.js";import"./chunk-L67BU25M.js";import{a as oo}from"./chunk-HHVHVGRT.js";import{a as uo}from"./chunk-6OFGSZD6.js";import{a as co}from"./chunk-CMYQXGLO.js";import{a as xo}from"./chunk-LJM2DUXN.js";import{a as mo}from"./chunk-AMLWPYNA.js";import{a as yo}from"./chunk-XCBEYRQI.js";import{a as ko}from"./chunk-2U4P6UFZ.js";import{a as br}from"./chunk-CYOFLJ3Z.js";import"./chunk-ACTDYTAV.js";import"./chunk-LWJA2DQG.js";import"./chunk-NJPL5BTN.js";import"./chunk-VJEKDBGZ.js";import"./chunk-MB7E5GEY.js";import{a as Ho,b as Bo,d as he}from"./chunk-F5HCSUXC.js";import"./chunk-PIFW2R3S.js";import"./chunk-F3TMLDLC.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import{e as K}from"./chunk-CTRXLZAJ.js";import"./chunk-KIYHEMHD.js";import"./chunk-LRQYUWWB.js";import"./chunk-QRT4A2RV.js";import{a as Ar}from"./chunk-HLNJL4B6.js";import"./chunk-U6HYEGAE.js";import{a as pi}from"./chunk-37TEEITE.js";import{d as li}from"./chunk-V2HCVJYF.js";import{a as vo}from"./chunk-DKL6N3L2.js";import{a as io}from"./chunk-7JIQXGDE.js";import{a as so}from"./chunk-RZFBGBNA.js";import{a as ai}from"./chunk-6QDOCBD4.js";import{a as ro,b as y,c as x,e as no,f as Ve}from"./chunk-JJJTPEMD.js";import{c as Je,d as mi}from"./chunk-RUFQCXBX.js";import{b as V}from"./chunk-RY2SJVWM.js";import"./chunk-LFOBYEWG.js";import{C as O,J as R,T as P,a as Bt,c as Ue,ia as ee,j as ii,ja as Y,oa as bt,q as kt,qa as $,r as wt,y as vt}from"./chunk-YN6A26QL.js";import"./chunk-ZDF5N422.js";import"./chunk-KK24VGVE.js";import{e as Vt}from"./chunk-AGOEROAI.js";import{A as J,B,C as Wt,D as Qt,F as Yt,G as te,I as D,J as Jt,K as Kt,M as Me,N as He,T as Be,V as eo,a as Ht,y as N,z as A}from"./chunk-GMTNOCMS.js";import"./chunk-7Y7AZRL3.js";import"./chunk-7UNQOKZW.js";import"./chunk-EOMCXBCS.js";import"./chunk-5HBIIYSK.js";import"./chunk-RJ5VF3QY.js";import"./chunk-GB3YC4TI.js";import{a as gt}from"./chunk-5CYJG63I.js";import"./chunk-MPW2YJWU.js";import{d as Gt,e as jt}from"./chunk-JQISGC7D.js";import"./chunk-TTAPXLI5.js";import{g as Xt,h as s,j as Zt,k as oe}from"./chunk-R2R6JDNH.js";import"./chunk-T7KHS6RF.js";import{a as M}from"./chunk-CTNBSUVU.js";import{a as ae,b as ui}from"./chunk-W6ST525S.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-ET2CGROE.js";import"./chunk-TOLPNBZK.js";import"./chunk-E5T4YRGW.js";import"./chunk-U2Z5NMXV.js";import{Ab as h,Bb as At,Cb as xt,N as zt,Ta as le,V as Mt,Z as ue,ba as St,ga as yt,ma as me,qb as d,sb as c,ua as $e,wb as v,xb as F,zb as to}from"./chunk-Y34LWI3S.js";import{i as ze}from"./chunk-B4OMIONW.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-XAOYKECS.js";import"./chunk-DPNZWBT5.js";import"./chunk-JD5P5RAJ.js";import{f as Q}from"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import{e as L,g as n}from"./chunk-VKWPEFWQ.js";n();var ri=L(ai(),1);n();n();n();n();function Nt(e){return Oo(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))}function Or(){return{sessions:Nt().map(e=>({kind:"store",store:e.store,userId:e.userId,scopes:e.scopes,connectedAt:e.acquiredAt,...e.expiresAt?{expiresAt:e.expiresAt}:{},...e.refreshTokenExpiresAt?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...e.associatedUser?{associatedUser:e.associatedUser}:{}}))}}n();n();var fi=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function Ke(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":fi.format(t)}function Xe(e){let t=H(e);if(t)return t.split(".")[0]}function _r(e,t){if(t==="json"){v(JSON.stringify(hi(e),null,2));return}gi(e)}function hi(e){return{sessions:e.sessions.map(Er),...e.sessions.length===0?{message:Fr()}:{}}}function gi(e){if(e.sessions.length===0){F(Fr());return}te({rows:e.sessions.map(Er),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}function Er(e){return{subdomain:Xe(e.store)??e.store,connected:Ke(e.connectedAt)}}function Fr(){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
|
+
`)}var ge=class e extends V{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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...x};async run(){let{flags:t}=await this.parse(e),o=Or();_r(o,t.json?"json":"text")}};n();n();n();var Pr=13387,Ze="/auth/callback";function Dr(e){return`http://127.0.0.1:${e}${Ze}`}function C(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function Cr(e,t=300){return e.slice(0,t)}async function Lr(e){let t=`https://${e.store}/admin/oauth/access_token`;h(c`Exchanging authorization code for token at ${d.raw(t)}`);let o=await kt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:U,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw h(c`Token exchange failed with HTTP ${d.raw(String(o.status))}: ${d.raw(Cr(r||o.statusText))}`),new s(`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 s("Received an invalid token response from Shopify.")}return h(c`Token exchange succeeded: access_token=${d.raw(C(i.access_token))}, refresh_token=${d.raw(i.refresh_token?C(i.refresh_token):"none")}, expires_in=${d.raw(String(i.expires_in??"unknown"))}s, user=${d.raw(String(i.associated_user?.id??"unknown"))} (${d.raw(i.associated_user?.email??"no email")})`),i}async function Rr(e){let t=`https://${e.store}/admin/oauth/access_token`;h(c`Refreshing access token for ${d.raw(e.store)} using refresh_token=${d.raw(C(e.refreshToken))}`);let o=await kt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:U,grant_type:"refresh_token",refresh_token:e.refreshToken})}),r=await o.text();if(!o.ok)throw h(c`Token refresh failed with HTTP ${d.raw(String(o.status))}: ${d.raw(Cr(r||o.statusText))}`),new s(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let i;try{i=JSON.parse(r)}catch{throw new s("Received an invalid refresh response from Shopify.")}if(!i.access_token)throw new s(`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 Si=`#graphql
|
|
3
3
|
query CurrentAppInstallationAccessScopes {
|
|
4
4
|
currentAppInstallation {
|
|
5
5
|
accessScopes {
|
|
@@ -7,7 +7,7 @@ import{a as We,b as ir}from"./chunk-2I62GKIH.js";import"./chunk-4KZRP2JP.js";imp
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`;async function
|
|
10
|
+
`;async function qr(e){h(c`Fetching current app installation scopes for ${d.raw(e.store)} using token ${d.raw(C(e.accessToken))}`);let t=await Y({query:Si,api:"Admin",url:K(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 It="<comma-separated-scopes>";function $r(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function yi(e){return[[$r(e,It)]]}function Ur(e,t,o){return[["Run",$r(e,t),o]]}function ki(e){return e.kind==="preview"?It:e.scopes.join(",")}function zr(e){throw new s(`No stored app authentication found for ${e}.`,void 0,Ur(e,It,"to authenticate"))}function Se(e,t){throw new s(e,void 0,Ur(t.store,ki(t),"to re-authenticate"))}function et(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.`;Se(t,e)}function Mr(e){return new s("OAuth callback store does not match the requested store.",`Shopify returned ${e} during authentication. Re-run using the permanent store domain:`,yi(e))}import{timingSafeEqual as wi}from"crypto";import{createServer as vi}from"http";function Hr(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 We,b as ir}from"./chunk-2I62GKIH.js";import"./chunk-4KZRP2JP.js";imp
|
|
|
76
76
|
</main>
|
|
77
77
|
</div>
|
|
78
78
|
</body>
|
|
79
|
-
</html>`}async function
|
|
79
|
+
</html>`}async function Br({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i}){let a=O(e);return new Promise((u,m)=>{let p=!1,g=!1,b=setTimeout(()=>{I(new s("Timed out waiting for OAuth callback."))},r),f=vi((l,S)=>{let lt=new URL(l.url??"/",`http://127.0.0.1:${o}`);if(lt.pathname!==Ze){S.statusCode=404,S.end("Not found");return}let{searchParams:qe}=lt,ce=(ht,ni)=>{let Ut=typeof ht=="string"?new s(ht,ni):ht;S.statusCode=400,S.setHeader("Content-Type","text/html"),S.setHeader("Connection","close"),S.once("finish",()=>I(Ut)),S.end(Hr("Authentication failed",Ut.message))},pt=qe.get("shop");if(h(c`Received OAuth callback for shop ${d.raw(pt??"unknown")}`),!pt){ce("OAuth callback store does not match the requested store.");return}let Rt=O(pt);if(Rt!==a){ce(Mr(Rt));return}let qt=qe.get("state");if(!qt||!bi(qt,t)){ce("OAuth callback state does not match the original request.");return}let $t=qe.get("error");if($t){ce(`Shopify returned an OAuth error: ${$t}`);return}let ft=qe.get("code");if(!ft){ce("OAuth callback did not include an authorization code.");return}h(c`Received authorization code ${d.raw(C(ft))}`),S.statusCode=200,S.setHeader("Content-Type","text/html"),S.setHeader("Connection","close"),S.once("finish",()=>T(()=>u(ft))),S.end(Hr("Authentication succeeded","Close this window and return to the terminal"))}),T=l=>{if(p)return;p=!0,clearTimeout(b);let S=()=>{l()};if(!g){S();return}f.close(()=>{g=!1,S()}),f.closeIdleConnections?.()},I=l=>{T(()=>m(l))};f.on("error",l=>{if(l.code==="EADDRINUSE"){I(new s(`Port ${o} is already in use.`,`Free port ${o} and re-run ${d.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}I(l)}),f.listen(o,"127.0.0.1",()=>{g=!0,h(c`PKCE callback server listening on http://127.0.0.1:${d.raw(String(o))}${d.raw(Ze)}`),i&&Promise.resolve(i()).catch(l=>{I(l instanceof Error?l:new Error(String(l)))})})})}function bi(e,t){return e.length!==t.length?!1:wi(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as Ai,randomBytes as xi}from"crypto";function Ti(){return xi(32).toString("base64url")}function Ni(e){return Ai("sha256").update(e).digest("base64url")}function Ii(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 Vr(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Pr,u=Ue(),m=Dr(a),p=Ti(),g=Ni(p),b=Ii({store:t,scopes:o,state:u,redirectUri:m,codeChallenge:g,signup:r});return h(c`Starting PKCE auth for ${d.raw(t)} with scopes ${d.raw(o.join(","))} (redirect_uri=${d.raw(m)})`),{authorization:{store:t,scopes:o,state:u,port:a,redirectUri:m,authorizationUrl:b,codeVerifier:p,signup:r},waitForAuthCodeOptions:{store:t,state:u,port:a},exchangeCodeForToken:f=>i({store:t,code:f,codeVerifier:p,redirectUri:m})}}n();function _t(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 zt(t)}function Ot(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 Gr(e,t){let o=[...t],r=Ot(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of Ot([i]))r.add(a)}return o}function jr(e,t){if(!e.scope)return h(c`Token response did not include scope; falling back to requested scopes`),t;let o=_t(e.scope),r=Ot(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 Oi=240*1e3;function _i(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Oi<Date.now()}function Ei(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=G(e);if(t||zr(e),h(c`Loaded stored session for ${d.raw(e)}: token=${d.raw(C(t.accessToken))}, expires=${d.raw(t.expiresAt??"unknown")}`),!_i(t))return t;t.refreshToken||Se(`No refresh token stored for ${t.store}.`,t),h(c`Refreshing expired token for ${d.raw(t.store)} (expired at ${d.raw(t.expiresAt??"unknown")}, refresh_token=${d.raw(C(t.refreshToken))})`);let o=t.accessToken,r;try{r=await Rr({store:t.store,refreshToken:t.refreshToken})}catch(i){throw Ge(t.store,t.userId),i instanceof s&&i.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&Se(i.message,t),i instanceof s&&i.message===`Token refresh returned an invalid response for ${t.store}.`&&Se(i.message,t),i instanceof s&&i.message==="Received an invalid refresh response from Shopify.",i}return t=Ei(t,r),h(c`Token refresh succeeded for ${d.raw(t.store)}: ${d.raw(C(o))} → ${d.raw(C(t.accessToken))}, new expiry ${d.raw(t.expiresAt??"unknown")}`),re(t),t}function Wr(e,t=300){return e.slice(0,t)}function Fi(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 Wr(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return Wr(e instanceof Error?e.message:String(e))}async function Qr(e){let t=O(e),o=G(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await q(t),i=await qr({store:r.store,accessToken:r.accessToken});return h(c`Resolved current remote scopes for ${d.raw(t)}: ${d.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return h(c`Falling back to locally stored scopes for ${d.raw(t)} after remote scope lookup failed: ${d.raw(Fi(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Pi(e){return JSON.stringify(e,null,2)}function Di(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 Ci(){F("Shopify CLI will open the app authorization page in your browser."),F("")}function Li(e){F("Browser did not open automatically. Open this URL manually:"),F(c`${d.link(e)}`),F("")}function Ri(e,t="text"){if(t==="json"){v(Pi(e));return}let o=Di(e);o.completed.forEach(r=>to(r)),o.info.forEach(r=>F(r))}function se(e="text"){return{openingBrowser:Ci,manualAuthUrl:Li,success(t){Ri(t,e)}}}n();async function _(e,t,o){await jt(()=>({store_fqdn:e})),await Gt(()=>({store_fqdn_hash:Bt(e),store_fqdn_validated:t,store_domain:e,store_id:Mt(o)}))}var qi={openURL:He,waitForStoreAuthCode:Br,exchangeStoreAuthCodeForToken:Lr,resolveExistingScopes:Qr,getCurrentStoredStoreAppSession:G,presenter:se("text")};async function tt(e,t={}){let o={...qi,...t},r=O(e.store);$i(r,o),await _(r,!1);let i=_t(e.scopes),a=await o.resolveExistingScopes(r),u=Gr(i,a.scopes),m=a.authoritative?u:i;a.scopes.length>0&&h(c`Merged requested scopes ${d.raw(i.join(","))} with existing scopes ${d.raw(a.scopes.join(","))} for ${d.raw(r)}`);let p=Vr({store:r,scopes:u,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:g}}=p;o.presenter.openingBrowser();let b=await o.waitForStoreAuthCode({...p.waitForAuthCodeOptions,onListening:async()=>{await o.openURL(g)||o.presenter.manualAuthUrl(g)}}),f=await p.exchangeCodeForToken(b);await _(r,!0);let T=f.associated_user?.id?.toString();if(!T)throw new s("Shopify did not return associated user information for the online access token.");R(T);let I=Date.now(),l=f.expires_in?new Date(I+f.expires_in*1e3).toISOString():void 0,S={store:r,userId:T,scopes:jr(f,m),acquiredAt:new Date(I).toISOString(),expiresAt:l,refreshTokenExpiresAt:f.refresh_token_expires_in?new Date(I+f.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!f.refresh_token,associatedUser:f.associated_user?{id:f.associated_user.id,email:f.associated_user.email,firstName:f.associated_user.first_name,lastName:f.associated_user.last_name,accountOwner:f.associated_user.account_owner}:void 0};return re({store:r,clientId:U,userId:T,accessToken:f.access_token,refreshToken:f.refresh_token,scopes:S.scopes,acquiredAt:S.acquiredAt,expiresAt:l,refreshTokenExpiresAt:S.refreshTokenExpiresAt,associatedUser:S.associatedUser}),h(c`Session persisted for ${d.raw(r)} (user ${d.raw(T)}, expires ${d.raw(l??"unknown")})`),o.presenter.success(S),S}function $i(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}.
|
|
80
80
|
|
|
81
|
-
Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends
|
|
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 V{};n();var E=L(M(),1),Ui="Country must be a two-letter country code, for example: US.";function zi(e){return/^[A-Z]{2}$/.test(e)}var ot=E.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(!zi(t))throw new s(Ui);return t}}),w={store:E.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>O(e),required:!0}),"organization-id":E.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},Yr={env:"SHOPIFY_FLAG_ID",parse:async e=>_o(e)},Jr=E.Flags.string({...Yr,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."}),Kr=E.Flags.string({...Yr,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),Xr={query:E.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":E.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=>Q(e),exactlyOne:["query","query-file"]}),variables:E.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":E.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=>Q(e),exclusive:["variables"]}),watch:E.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":E.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:E.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":E.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var Zr=L(M(),1),ye=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.`;
|
|
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.descriptionWithoutMarkdown();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,...x,store:w.store,scopes:Zr.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};async run(){let{flags:t}=await this.parse(e);await tt({store:t.store,scopes:t.scopes},{presenter:se(t.json?"json":"text")})}};n();n();n();function X(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function en(e,t=!1){if(ie(e)&&!t)throw new s("Mutations are disabled by default for shopify store bulk execute.","Re-run with --allow-mutations if you intend to modify store data.")}n();async function Z(e){let t=await q(e);return await _(t.store,!0),R(t.userId),{token:t.accessToken,storeFqdn:t.store}}async function tn(e){let{store:t,operationId:o}=e,r=await Z(t);N({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${o}`,...X({storeFqdn:r.storeFqdn})]}}]});let i=await Lo({adminSession:r,operationId:o});if(i?.userErrors?.length){Ro(i.userErrors,"Failed to cancel bulk operation.");return}let a=i?.bulkOperation;if(a){let u=qo(a),m=a.status==="CANCELING"?[`This may take a few moments. Check the status with:
|
|
84
|
+
`,{command:`shopify store bulk status --id=${ne(a.id)}`}]:u.body,p={headline:u.headline,...m&&{body:m},...u.customSections&&{customSections:u.customSections}};switch(u.renderType){case"success":A(p);break;case"warning":J(p);break;case"info":N(p);break}}else B({headline:"Bulk operation not found or could not be canceled.",body:c`ID: ${d.yellow(o)}`.value})}var ke=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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,store:w.store,id:Kr};async run(){let{flags:t}=await this.parse(e);await tn({store:t.store,operationId:t.id})}};n();n();async function Mi(e,t){if(e)return e.join(`
|
|
85
|
+
`);if(t){if(!await le(t))throw new s(c`Variable file not found at ${d.path(t)}. Please check the path and try again.`);return me(t,{encoding:"utf8"})}else return}async function rn(e){let{store:t,query:o,variables:r,variableFile:i,outputFile:a,watch:u=!1,version:m,allowMutations:p=!1}=e;en(o,p);let{adminSession:g,version:b}=await D({title:c`Authenticating`,task:async()=>{let l=await Z(t),S=await fe({adminSession:l,userSpecifiedVersion:m,minimumDefaultVersion:pe});return{adminSession:l,version:S}},renderOptions:{stdout:process.stderr}}),f=await Mi(r,i);Hi(o,f),N({headline:"Starting bulk operation.",body:[{list:{items:X({storeFqdn:g.storeFqdn,version:b})}}]});let T=ie(o)?await Po({adminSession:g,query:o,variablesJsonl:f,version:b}):await Fo({adminSession:g,query:o,version:b});if(T?.userErrors?.length){B({headline:"Error creating bulk operation.",body:{list:{items:T.userErrors.map(l=>l.field?`${l.field.join(".")}: ${l.message}`:l.message)}}});return}let I=T?.bulkOperation;if(I)if(u){let l=new Ht,S=await Uo(g,I.id,l.signal,()=>l.abort());l.signal.aborted?N({headline:`Bulk operation ${S.id} is still running in the background.`,body:rt(S.id)}):await on(S,a)}else{let l=await $o(g,I.id);["FAILED","CANCELED","EXPIRED"].includes(l.status)?await on(l,a):A({headline:"Bulk operation is running.",body:rt(l.id),customSections:[{body:[{list:{items:[c`ID: ${d.cyan(l.id)}`.value]}}]}]})}else throw J({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new oe("Bulk operation response returned null with no error message.")}async function on(e,t){let o=je(e).value,i=[{body:[{list:{items:[c`ID: ${d.cyan(e.id)}`.value,c`Status: ${d.yellow(e.status)}`.value,c`Created at: ${d.gray(String(e.createdAt))}`.value,...e.completedAt?[c`Completed at: ${d.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":A({headline:"Bulk operation started.",body:rt(e.id),customSections:i});break;case"RUNNING":A({headline:"Bulk operation is running.",body:rt(e.id),customSections:i});break;case"COMPLETED":if(e.url){let a=await zo(e.url),u=Mo(a);t?await $e(t,a):v(a),u?J({headline:"Bulk operation completed with errors.",body:t?`Results written to ${t}. Check file for error details.`:"Check results for error details.",customSections:i}):A({headline:o,body:t?[`Results written to ${t}`]:void 0,customSections:i})}else A({headline:o,customSections:i});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":B({headline:o,customSections:i});break}}function Hi(e,t){if(ie(e)&&!t)throw new s(c`Bulk mutations require variables. Provide a JSONL file with ${d.yellow("--variable-file")} or individual JSON objects with ${d.yellow("--variables")}.`);if(!ie(e)&&t)throw new s(c`The ${d.yellow("--variables")} and ${d.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function rt(e){return[`Monitor its progress with:
|
|
86
|
+
`,{command:`shopify store bulk status --id=${ne(e)}`}]}var we=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.`;W.description=Pt.descriptionWithoutMarkdown();W.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"];W.flags={...y,store:w.store,...fn};var bn=W;n();n();async function An(e){let{store:t,operationId:o}=e,r=await pe(t);_({headline:"Checking bulk operation status.",body:[{list:{items:le({storeFqdn:r.storeFqdn})}}]});let i=await jo({adminSession:r,operationId:o,version:await Oe({adminSession:r,minimumDefaultVersion:Ie})});i?ga(i):re({headline:"Bulk operation not found.",body:c`ID: ${d.yellow(o)}`.value})}async function xn(e){let{store:t}=e,o=await pe(t);_({headline:"Listing bulk operations.",body:[{list:{items:le({storeFqdn:o.storeFqdn})}}]});let i=(await Wo({adminSession:o,version:await Oe({adminSession:o,minimumDefaultVersion:Ie})})).map(a=>({id:ke(a.id),status:ya(a.status),count:ka(a.objectCount),dateCreated:gt(new Date(String(a.createdAt))),dateFinished:a.completedAt?gt(new Date(String(a.completedAt))):"",results:wa(a.url??a.partialDataUrl)}));At(),i.length===0?_({body:"No bulk operations found in the last 7 days."}):ge({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"}}}),At()}function ga(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:u}=e,m=Ge(e).value,p=Sa(r,i),g=c`ID: ${d.yellow(t)}\n${p}`.value;if(o==="COMPLETED"){let b=a?d.link("Download results",a):"";A({headline:m,body:c`${g}\n${b}`.value})}else if(o==="FAILED"){let b=u?d.link("Download partial results",u):"";re({headline:m,body:c`${g}\n${b}`.value})}else _({headline:m,body:g})}function Sa(e,t){let o=new Date;return t?`Finished ${St(new Date(String(t)),o)}`:`Started ${St(new Date(String(e)),o)}`}function ya(e){return e==="COMPLETED"?ze.green(e):e==="FAILED"?ze.red(e):ze.dim(e)}function ka(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function wa(e){return e?c`${d.link("download",e)}`.value:""}var Ct,Q=class extends k{async run(){let{flags:t}=await this.parse(Ct);t.id?await An({store:t.store,operationId:t.id}):await xn({store:t.store})}};Ct=Q;Q.summary="Check the status of bulk operations on a store.";Q.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.";Q.description=Ct.descriptionWithoutMarkdown();Q.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];Q.flags={...y,store:w.store,id:ln};var Tn=Q;n();var Dt=q(oe(),1),Lt,z=class extends k{async run(){let{flags:t}=await this.parse(Lt);await et({store:t.store,scopes:t.scopes,signup:t.signup},{presenter:be(t.json?"json":"text")})}};Lt=z;z.hidden=!0;z.summary="Authenticate for store commands.";z.descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup.";z.description=Lt.descriptionWithoutMarkdown();z.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];z.flags={...y,...x,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.",env:"SHOPIFY_FLAG_SIGNUP",required:!0})};var _n=z;n();n();n();function M(e={}){return{type:"token_refresh",handler:async()=>({token:await va(e)})}}async function va(e){return P([],{noPrompt:e.noPrompt})}n();var Rt={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},rt=Object.keys(Rt),Nn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var In={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"country"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}},{kind:"Argument",name:{kind:"Name",value:"country"},value:{kind:"Variable",name:{kind:"Name",value:"country"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{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 On={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var ba=2,Aa=300*1e3;function xa(e){switch(e){case"CALLING_CORE":return"Initiating store creation";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready";case"FINALIZING":return"Finalizing store setup";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function En(e){let{organization:t,name:o,plan:r}=e,i=await P(),a=M(),m=(await $({query:In,token:i,organizationId:t.id,variables:{shopName:o,priceLookupKey:Rt[r],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview,country:e.country},unauthorizedHandler:a})).createAppDevelopmentStore;if(!m)throw new s("Store creation failed: unexpected empty response.");let p=m.userErrors;if(p&&p.length>0){let f=p.map(T=>T.message).join(", ");throw new s(`Failed to create development store: ${f}`)}let{shopDomain:g,shopAdminUrl:b}=m;if(!g)throw new s("Store creation succeeded but no shop domain was returned.");if(await C({title:c`Waiting for store to be ready`,task:async f=>{let T=Date.now();for(;;){if(Date.now()-T>Aa)throw new s("Store creation timed out after 5 minutes.");let l=(await $({query:On,token:i,organizationId:t.id,variables:{shopDomain:g},unauthorizedHandler:a})).organization?.storeCreation?.status;if(!l)throw new s("Unable to determine store creation status.");if(l==="COMPLETE")return;if(l==="FAILED"||l==="TIMED_OUT"||l==="USER_ERROR")throw new s(`Store creation failed with status: ${l}`);f(c`${xa(l)}`),await Be(ba)}},renderOptions:{stdout:process.stderr}}),e.json)v(JSON.stringify({store:{name:o,domain:g,adminUrl:b,plan:r,...e.featurePreview?{featurePreview:e.featurePreview}:{},...e.country?{country:e.country}:{},demoData:e.withDemoData??!1},organization:{id:t.id,name:t.businessName}},null,2));else{let f=[];Pe(f,"Domain",g),f.push(["Admin",b?{link:{label:b,url:b}}:"N/A"]),Pe(f,"Plan",r),Pe(f,"Feature preview",e.featurePreview),Pe(f,"Country",e.country),Pe(f,"Demo data",e.withDemoData?"enabled":"disabled"),A({headline:`Development store "${o}" created successfully.`,customSections:[{body:{tabularData:f,firstColumnSubdued:!0}}]})}}function Pe(e,t,o){o!=null&&o!==""&&e.push([t,o])}n();var Ta={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};async function Fn(){return mo({message:"Name for the new development store"})}async function Pn(){return co({message:"Which Shopify plan do you want to use?",choices:rt.map(e=>({label:Ta[e],value:e}))})}var Ce=q(oe(),1),qt,Y=class extends ne{async run(){let{flags:t}=await this.parse(qt);this.failMissingNonTTYFlags(t,["name","organization-id","plan"]);let o=await Ee(t["organization-id"]?.toString()),r=t.name??await Fn(),i=t.plan??await Pn();try{await En({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:t["with-demo-data"],country:t.country,json:t.json})}catch(a){throw t.json&&a instanceof s&&(v(JSON.stringify({error:!0,message:a.message,nextSteps:a.nextSteps??[],exitCode:1},null,2)),process.exit(1)),a}}};qt=Y;Y.hidden=!0;Y.summary="Create a new development store.";Y.descriptionWithMarkdown="Creates a new app development store in your organization.";Y.description=qt.descriptionWithoutMarkdown();Y.flags={...y,...x,name:Ce.Flags.string({description:"Name for the new development store.",env:"SHOPIFY_FLAG_STORE_NAME"}),"organization-id":w["organization-id"],plan:Ce.Flags.string({description:"The Shopify plan to use for the new development store.",options:rt,env:"SHOPIFY_FLAG_STORE_PLAN"}),"feature-preview":Ce.Flags.string({description:"The handle of a feature preview to enable on the new development store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"with-demo-data":Ce.Flags.boolean({description:"Populate the new development store with demo data.",default:!1,env:"SHOPIFY_FLAG_STORE_WITH_DEMO_DATA"}),country:tt};var Cn=Y;n();n();n();var _a="X-Shopify-CLI-Instance",Na="X-Shopify-CLI-Version",$t;function Ia(){return $t??($t=new no({projectName:"shopify-cli-store"})),$t}var De=class extends s{constructor(t,o,r){super(o,r??null),this.status=t}};function Dn(e=Ia()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=fe();return e.set("cliInstanceId",o),o}function Ln(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${ht}`,[_a]:e,[Na]:ht}}function Oa(e){return Ln(e)}function Ea(e,t){return{...Ln(e),authorization:t,"X-Shopify-Access-Token":t}}async function Rn(e,t={}){let r=`https://${await wt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await kt(r,{method:"POST",headers:Oa(Dn(t.storage)),body:i}),u=await a.text();if(!a.ok){let p=Fa(a.status,u);throw new s(p.message,p.tryMessage)}let m;try{m=JSON.parse(u)}catch(p){let g=p instanceof Error?p.message:"Unknown error";throw new s("Preview store creation returned a non-JSON response.",`Parse error: ${g}. Body (truncated): ${nt(u).slice(0,500)}`)}return Ca(m)}async function qn(e,t={}){let r=`https://${await wt()}/services/preview-stores/${e.shopId}`,i=await kt(r,{method:"GET",headers:Ea(Dn(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=Pa(i.status,a);throw new De(i.status,m.message,m.tryMessage)}let u;try{u=JSON.parse(a)}catch(m){let p=m instanceof Error?m.message:"Unknown error";throw new s("Preview store lookup returned a non-JSON response.",`Parse error: ${p}. Body (truncated): ${nt(a).slice(0,500)}`)}return Da(u)}function Fa(e,t){let o=$n(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=nt(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function $n(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 Pa(e,t){let o=$n(t),r=nt(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function Ca(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"?I(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,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,p=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(g=>typeof g=="string"):void 0;if(!o||!r||!i||!a||!u||!p)throw new s("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(La(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:p,accessUrl:u,...m?{placeholderAccountUuid:m}:{}}}function Da(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"?I(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(Ra(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...u?{claimUrl:u}:{}}}function La(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function nt(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function Ra(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var qa={createPreviewStore:Rn,setStoredStoreAppSession:ye,recordStoreFqdnMetadata:O,setLastSeenUserId:L,now:()=>new Date};async function Un(e,t={}){let o={...qa,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Ua(r,e.country,o)}function $a(e){return e.placeholderAccountUuid??e.shop.id}async function Ua(e,t,o){let r=o.now().toISOString(),i=$a(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 zn(e,t){if(t==="json"){v(JSON.stringify(za(e),null,2));return}Ma(e)}function za(e){return{status:e.status,message:e.message,store:e.store,next_steps:Mn(e).map(t=>t.json)}}function Mn(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 Ma(e){A({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:Mn(e).map(t=>t.text)}}}]})}var Hn=q(oe(),1),Ut,J=class extends k{async run(){let{flags:t}=await this.parse(Ut),o=await C({title:c`Creating store`,task:async()=>Un({name:t.name,country:t.country})});zn(o,t.json?"json":"text")}};Ut=J;J.summary="Create a preview Shopify store.";J.descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";J.description=Ut.descriptionWithoutMarkdown();J.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'];J.flags={...y,...x,name:Hn.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:tt};var Bn=J;n();n();n();n();var Vn={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 Gn(e){let t=await zt(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 zt(e){let t=e.token??await P([],{noPrompt:e.noPrompt}),o=M({noPrompt:e.noPrompt}),i=(await $({query:Vn,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),u=i.map(m=>m.node).find(m=>B(m.primaryDomain)===a);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 jn={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 Wn={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 Ha="cancelled",Ba=5,Va=300*1e3;async function Yn(e){let{organization:t,store:o}=e,r=await P(),i=M(),a=await Qn({store:o,organizationId:t.id,token:r}),m=(await $({query:jn,token:r,organizationId:t.id,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!m)throw new s("Store deletion failed: unexpected empty response.");let p=m.userErrors;if(p&&p.length>0){let b=p.map(f=>f.message).join(", ");throw new s(`Failed to delete development store: ${b}`)}if(m.success===!1)throw new s("Store deletion failed.");a??(a=await Qn({store:o,organizationId:t.id,token:r}));let g=a?await ja({shopifyShopId:a,organizationId:t.id,token:r,unauthorizedHandler:i}):!1;e.json?v(Qa({store:o,organization:t,deletionConfirmed:g})):g?A({headline:`Development store "${o}" deleted successfully.`,body:["The store was deleted."]}):ue({headline:`Development 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 Qn(e){return(await zt(e))?.shopifyShopId}function Ga(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 ja(e){let t=Ga(e.shopifyShopId);return C({title:c`Development store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>Va)return!1;if((await $({query:Wn,token:e.token,organizationId:e.organizationId,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===Ha.toLowerCase())return!0;o(c`${Wa()}`),await Be(Ba)}},renderOptions:{stdout:process.stderr}})}function Wa(){return"Waiting for deletion confirmation"}function Qa(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 Jn={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 Kn={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 Le=class extends s{};async function it(e){let t=e.token??await P([],{noPrompt:e.noPrompt}),o=M({noPrompt:e.noPrompt}),r=B(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await vt({query:Jn,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(g=>Ja(g,r));if(!m)throw new Le(`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 p=await Ya(String(m.publicId),t,o);return{...p?{owningOrg:p}:{}}}async function Ya(e,t,o){try{let i=(await vt({query:Kn,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){h(`No owning organization returned for destination ${e}.`);return}let a=i.id?tr(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){h(`Failed to resolve owning organization: ${Ka(r)}`);return}}function Ja(e,t){return[e.primaryDomain,e.webUrl].some(o=>B(o)===t)}function Ka(e){return e instanceof Error?e.message:String(e)}async function Xa(e){let{store:t}=e;try{let r=(await it(e)).owningOrg;if(!r?.id){h(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){h(`Could not infer the owning organization for ${t}: ${Za(o)}`);return}}function Za(e){return e instanceof Error?e.message:String(e)}async function Xn(e,t){if(t)return Ee(t);let o=ho(),r=await Xa({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 Ee()}var Zn=q(oe(),1),Mt,H=class extends ne{async run(){let{flags:t}=await this.parse(Mt);try{if(!t.force&&!Me())throw new s(`Deleting the development store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Xn(t.store,t["organization-id"]?.toString());if(!t.force&&!await lo({message:`Delete development store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new fo;await Yn({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}}};Mt=H;H.hidden=!0;H.summary="Delete a development store.";H.descriptionWithMarkdown="Deletes a development store from your organization.";H.description=Mt.descriptionWithoutMarkdown();H.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"];H.flags={...y,...x,store:w.store,"organization-id":w["organization-id"],force:Zn.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})};var ei=H;n();n();n();var ti=q(Pi(),1);async function es(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 Ne(e.queryFile))throw new s(c`Query file not found at ${d.path(e.queryFile)}. Please check the path and try again.`);let t=await _e(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new s(c`Query file at ${d.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new Se("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}async function ts(e,t){if(e)try{return JSON.parse(e)}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new s(c`Invalid JSON in ${d.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(t){if(!await Ne(t))throw new s(c`Variable file not found at ${d.path(t)}. Please check the path and try again.`);let o=await _e(t,{encoding:"utf8"});try{return JSON.parse(o)}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw new s(c`Invalid JSON in variable file ${d.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function os(e){let t;try{t=(0,ti.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 rs(e){return e.operationDefinition.operation==="mutation"}function ns(e,t=!1){if(rs(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 oi(e){let t=await es({query:e.query,queryFile:e.queryFile}),o=os(t);ns(o,e.allowMutations);let r=await ts(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Ht(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function ri(e){if(!Ht(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var ni=["the user aborted a request","the operation was aborted"];function is(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return ni.some(o=>t.includes(o))}function Re(e,t){if(ri(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(is(e))return new s(`Request to ${t} was aborted before it completed.`)}function qe(e,t){let o=ri(e);o!==401&&o!==404||(t.kind!=="preview"&&Ve(t.store,t.userId),Ze(t))}var as=`
|
|
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={...y,store:w.store,...Xr};async run(){let{flags:t}=await this.parse(e),o=await Eo({query:t.query,queryFile:t["query-file"]});await rn({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 nn(e){let{store:t,operationId:o}=e,r=await Z(t);N({headline:"Checking bulk operation status.",body:[{list:{items:X({storeFqdn:r.storeFqdn})}}]});let i=await Do({adminSession:r,operationId:o,version:await fe({adminSession:r,minimumDefaultVersion:pe})});i?Bi(i):B({headline:"Bulk operation not found.",body:c`ID: ${d.yellow(o)}`.value})}async function an(e){let{store:t}=e,o=await Z(t);N({headline:"Listing bulk operations.",body:[{list:{items:X({storeFqdn:o.storeFqdn})}}]});let i=(await Co({adminSession:o,version:await fe({adminSession:o,minimumDefaultVersion:pe})})).map(a=>({id:ne(a.id),status:Gi(a.status),count:ji(a.objectCount),dateCreated:St(new Date(String(a.createdAt))),dateFinished:a.completedAt?St(new Date(String(a.completedAt))):"",results:Wi(a.url??a.partialDataUrl)}));xt(),i.length===0?N({body:"No bulk operations found in the last 7 days."}):te({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"}}}),xt()}function Bi(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:u}=e,m=je(e).value,p=Vi(r,i),g=c`ID: ${d.yellow(t)}\n${p}`.value;if(o==="COMPLETED"){let b=a?d.link("Download results",a):"";A({headline:m,body:c`${g}\n${b}`.value})}else if(o==="FAILED"){let b=u?d.link("Download partial results",u):"";B({headline:m,body:c`${g}\n${b}`.value})}else N({headline:m,body:g})}function Vi(e,t){let o=new Date;return t?`Finished ${yt(new Date(String(t)),o)}`:`Started ${yt(new Date(String(e)),o)}`}function Gi(e){return e==="COMPLETED"?ze.green(e):e==="FAILED"?ze.red(e):ze.dim(e)}function ji(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Wi(e){return e?c`${d.link("download",e)}`.value:""}var ve=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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,store:w.store,id:Jr};async run(){let{flags:t}=await this.parse(e);t.id?await nn({store:t.store,operationId:t.id}):await an({store:t.store})}};n();var Et=L(M(),1),be=class e extends k{static hidden=!0;static summary="Authenticate for store commands.";static descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];static flags={...y,...x,store:w.store,scopes:Et.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:Et.Flags.string({description:"Provide JWT for the store.",env:"SHOPIFY_FLAG_SIGNUP",required:!0})};async run(){let{flags:t}=await this.parse(e);await tt({store:t.store,scopes:t.scopes,signup:t.signup},{presenter:se(t.json?"json":"text")})}};n();n();n();function z(e={}){return{type:"token_refresh",handler:async()=>({token:await Qi(e)})}}async function Qi(e){return P([],{noPrompt:e.noPrompt})}n();var Ft={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},nt=Object.keys(Ft),sn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var dn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"country"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}},{kind:"Argument",name:{kind:"Name",value:"country"},value:{kind:"Variable",name:{kind:"Name",value:"country"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{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 cn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Yi=2,Ji=300*1e3;function Ki(e){switch(e){case"CALLING_CORE":return"Initiating store creation";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready";case"FINALIZING":return"Finalizing store setup";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function un(e){let{organization:t,name:o,plan:r}=e,i=await P(),a=z(),m=(await $({query:dn,token:i,organizationId:t.id,variables:{shopName:o,priceLookupKey:Ft[r],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview,country:e.country},unauthorizedHandler:a})).createAppDevelopmentStore;if(!m)throw new s("Store creation failed: unexpected empty response.");let p=m.userErrors;if(p&&p.length>0){let f=p.map(T=>T.message).join(", ");throw new s(`Failed to create development store: ${f}`)}let{shopDomain:g,shopAdminUrl:b}=m;if(!g)throw new s("Store creation succeeded but no shop domain was returned.");if(await D({title:c`Waiting for store to be ready`,task:async f=>{let T=Date.now();for(;;){if(Date.now()-T>Ji)throw new s("Store creation timed out after 5 minutes.");let l=(await $({query:cn,token:i,organizationId:t.id,variables:{shopDomain:g},unauthorizedHandler:a})).organization?.storeCreation?.status;if(!l)throw new s("Unable to determine store creation status.");if(l==="COMPLETE")return;if(l==="FAILED"||l==="TIMED_OUT"||l==="USER_ERROR")throw new s(`Store creation failed with status: ${l}`);f(c`${Ki(l)}`),await Be(Yi)}},renderOptions:{stdout:process.stderr}}),e.json)v(JSON.stringify({store:{name:o,domain:g,adminUrl:b,plan:r,...e.featurePreview?{featurePreview:e.featurePreview}:{},...e.country?{country:e.country}:{},demoData:e.withDemoData??!1},organization:{id:t.id,name:t.businessName}},null,2));else{let f=[];Ae(f,"Domain",g),f.push(["Admin",b?{link:{label:b,url:b}}:"N/A"]),Ae(f,"Plan",r),Ae(f,"Feature preview",e.featurePreview),Ae(f,"Country",e.country),Ae(f,"Demo data",e.withDemoData?"enabled":"disabled"),A({headline:`Development store "${o}" created successfully.`,customSections:[{body:{tabularData:f,firstColumnSubdued:!0}}]})}}function Ae(e,t,o){o!=null&&o!==""&&e.push([t,o])}n();var Xi={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};async function mn(){return Jt({message:"Name for the new development store"})}async function ln(){return Qt({message:"Which Shopify plan do you want to use?",choices:nt.map(e=>({label:Xi[e],value:e}))})}var xe=L(M(),1),Te=class e extends V{static hidden=!0;static summary="Create a new development store.";static descriptionWithMarkdown="Creates a new app development store in your organization.";static description=this.descriptionWithoutMarkdown();static flags={...y,...x,name:Ve(xe.Flags.string({description:"Name for the new development store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":Ve(w["organization-id"]),plan:Ve(xe.Flags.string({description:"The Shopify plan to use for the new development store.",options:nt,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":xe.Flags.string({description:"The handle of a feature preview to enable on the new development store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"with-demo-data":xe.Flags.boolean({description:"Populate the new development store with demo data.",default:!1,env:"SHOPIFY_FLAG_STORE_WITH_DEMO_DATA"}),country:ot};async run(){let{flags:t}=await this.parse(e),o=await he(t["organization-id"]?.toString()),r=t.name??await mn(),i=t.plan??await ln();try{await un({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:t["with-demo-data"],country:t.country,json:t.json})}catch(a){throw t.json&&a instanceof s&&(v(JSON.stringify({error:!0,message:a.message,nextSteps:a.nextSteps??[],exitCode:1},null,2)),process.exit(1)),a}}};n();n();n();var Zi="X-Shopify-CLI-Instance",ea="X-Shopify-CLI-Version",pn;function ta(){return pn??=new Vt({projectName:"shopify-cli-store"}),pn}var Ne=class extends s{status;constructor(t,o,r){super(o,r??null),this.status=t}};function fn(e=ta()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=Ue();return e.set("cliInstanceId",o),o}function hn(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${gt}`,[Zi]:e,[ea]:gt}}function oa(e){return hn(e)}function ra(e,t){return{...hn(e),authorization:t,"X-Shopify-Access-Token":t}}async function gn(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 wt(r,{method:"POST",headers:oa(fn(t.storage)),body:i}),u=await a.text();if(!a.ok){let p=na(a.status,u);throw new s(p.message,p.tryMessage)}let m;try{m=JSON.parse(u)}catch(p){let g=p instanceof Error?p.message:"Unknown error";throw new s("Preview store creation returned a non-JSON response.",`Parse error: ${g}. Body (truncated): ${it(u).slice(0,500)}`)}return aa(m)}async function Sn(e,t={}){let r=`https://${await vt()}/services/preview-stores/${e.shopId}`,i=await wt(r,{method:"GET",headers:ra(fn(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=ia(i.status,a);throw new Ne(i.status,m.message,m.tryMessage)}let u;try{u=JSON.parse(a)}catch(m){let p=m instanceof Error?m.message:"Unknown error";throw new s("Preview store lookup returned a non-JSON response.",`Parse error: ${p}. Body (truncated): ${it(a).slice(0,500)}`)}return sa(u)}function na(e,t){let o=yn(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=it(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function yn(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 ia(e,t){let o=yn(t),r=it(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 aa(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"?O(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,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,p=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(g=>typeof g=="string"):void 0;if(!o||!r||!i||!a||!u||!p)throw new s("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(da(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:p,accessUrl:u,...m?{placeholderAccountUuid:m}:{}}}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"?O(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(ca(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...u?{claimUrl:u}:{}}}function da(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function it(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 ca(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var ua={createPreviewStore:gn,setStoredStoreAppSession:re,recordStoreFqdnMetadata:_,setLastSeenUserId:R,now:()=>new Date};async function kn(e,t={}){let o={...ua,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return la(r,e.country,o)}function ma(e){return e.placeholderAccountUuid??e.shop.id}async function la(e,t,o){let r=o.now().toISOString(),i=ma(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 wn(e,t){if(t==="json"){v(JSON.stringify(pa(e),null,2));return}fa(e)}function pa(e){return{status:e.status,message:e.message,store:e.store,next_steps:vn(e).map(t=>t.json)}}function vn(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 fa(e){A({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:vn(e).map(t=>t.text)}}}]})}var bn=L(M(),1),Ie=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.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={...y,...x,name:bn.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:ot};async run(){let{flags:t}=await this.parse(e),o=await D({title:c`Creating store`,task:async()=>kn({name:t.name,country:t.country})});wn(o,t.json?"json":"text")}};n();n();n();n();var An={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 xn(e){let t=await Pt(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 Pt(e){let t=e.token??await P([],{noPrompt:e.noPrompt}),o=z({noPrompt:e.noPrompt}),i=(await $({query:An,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),u=i.find(m=>H(m.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 Tn={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 Nn={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 ha="cancelled",ga=5,Sa=300*1e3;async function On(e){let{organization:t,store:o}=e,r=await P(),i=z(),a=await In({store:o,organizationId:t.id,token:r}),m=(await $({query:Tn,token:r,organizationId:t.id,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!m)throw new s("Store deletion failed: unexpected empty response.");let p=m.userErrors;if(p&&p.length>0){let b=p.map(f=>f.message).join(", ");throw new s(`Failed to delete development store: ${b}`)}if(m.success===!1)throw new s("Store deletion failed.");a??=await In({store:o,organizationId:t.id,token:r});let g=a?await ka({shopifyShopId:a,organizationId:t.id,token:r,unauthorizedHandler:i}):!1;e.json?v(va({store:o,organization:t,deletionConfirmed:g})):g?A({headline:`Development store "${o}" deleted successfully.`,body:["The store was deleted."]}):J({headline:`Development 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 In(e){return(await Pt(e))?.shopifyShopId}function ya(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 ka(e){let t=ya(e.shopifyShopId);return D({title:c`Development store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>Sa)return!1;if((await $({query:Nn,token:e.token,organizationId:e.organizationId,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===ha.toLowerCase())return!0;o(c`${wa()}`),await Be(ga)}},renderOptions:{stdout:process.stderr}})}function wa(){return"Waiting for deletion confirmation"}function va(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 _n={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 En={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 Oe=class extends s{};async function at(e){let t=e.token??await P([],{noPrompt:e.noPrompt}),o=z({noPrompt:e.noPrompt}),r=H(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await bt({query:_n,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(g=>Aa(g,r));if(!m)throw new Oe(`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 p=await ba(String(m.publicId),t,o);return{...p?{owningOrg:p}:{}}}async function ba(e,t,o){try{let i=(await bt({query:En,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){h(`No owning organization returned for destination ${e}.`);return}let a=i.id?Ho(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){h(`Failed to resolve owning organization: ${xa(r)}`);return}}function Aa(e,t){return[e.primaryDomain,e.webUrl].some(o=>H(o)===t)}function xa(e){return e instanceof Error?e.message:String(e)}async function Ta(e){let{store:t}=e;try{let r=(await at(e)).owningOrg;if(!r?.id){h(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){h(`Could not infer the owning organization for ${t}: ${Na(o)}`);return}}function Na(e){return e instanceof Error?e.message:String(e)}async function Fn(e,t){if(t)return he(t);let o=eo(),r=await Ta({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 he()}var Pn=L(M(),1),_e=class e extends V{static hidden=!0;static summary="Delete a development store.";static descriptionWithMarkdown="Deletes a development 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={...y,...x,store:w.store,"organization-id":w["organization-id"],force:Pn.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&&!Me())throw new s(`Deleting the development store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Fn(t.store,t["organization-id"]?.toString());if(!t.force&&!await Kt({message:`Delete development store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new Zt;await On({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 Dn=L(ii(),1);async function Ia(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 le(e.queryFile))throw new s(c`Query file not found at ${d.path(e.queryFile)}. Please check the path and try again.`);let t=await me(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new s(c`Query file at ${d.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new oe("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}async function Oa(e,t){if(e)try{return JSON.parse(e)}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new s(c`Invalid JSON in ${d.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(t){if(!await le(t))throw new s(c`Variable file not found at ${d.path(t)}. Please check the path and try again.`);let o=await me(t,{encoding:"utf8"});try{return JSON.parse(o)}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw new s(c`Invalid JSON in variable file ${d.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function _a(e){let t;try{t=(0,Dn.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 Ea(e){return e.operationDefinition.operation==="mutation"}function Fa(e,t=!1){if(Ea(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 Cn(e){let t=await Ia({query:e.query,queryFile:e.queryFile}),o=_a(t);Fa(o,e.allowMutations);let r=await Oa(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Dt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Ln(e){if(!Dt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Rn=["the user aborted a request","the operation was aborted"];function Pa(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Rn.some(o=>t.includes(o))}function Ee(e,t){if(Ln(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(Pa(e))return new s(`Request to ${t} was aborted before it completed.`)}function Fe(e,t){let o=Ln(e);o!==401&&o!==404||(t.kind!=="preview"&&Ge(t.store,t.userId),et(t))}var Da=`
|
|
95
95
|
query StoreExecutePublicApiVersions {
|
|
96
96
|
publicApiVersions {
|
|
97
97
|
handle
|
|
98
98
|
supported
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
`;async function
|
|
101
|
+
`;async function qn(e){try{return(await Y({query:Da,api:"Admin",url:K(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){Fe(t,e.session);let o=Ee(t,e.adminSession.storeFqdn);throw o||t}}async function $n(e){try{return await D({title:c`Executing GraphQL operation`,task:async()=>Y({query:e.request.query,api:"Admin",url:K(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){Fe(t,e.context.session);let o=Ee(t,e.context.adminSession.storeFqdn);throw o||(Dt(t)&&t.response.errors?new s("GraphQL operation failed.",JSON.stringify({errors:t.response.errors},null,2)):t)}}n();async function Ct(e){let t=await q(O(e));return await _(t.store,!0),R(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function Ca(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await qn({adminSession:o,session:t});if(!r)return i.filter(m=>m.supported).map(m=>m.handle).sort().reverse()[0];let a=i.map(u=>u.handle);if(a.includes(r))return r;throw new s(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function Un(e){let{adminSession:t,session:o}=await Ct(e.store),r=await Ca({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var La={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>Un({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>$n({context:e,request:t})};function zn(e){if(e==="admin")return La;throw new oe(`Unsupported store GraphQL API target: ${e}`)}async function Mn(e){await _(e.store,!1);let t=zn(e.api??"admin"),o=await Cn({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await D({title:c`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:r,request:o})}n();function Ra(e){return JSON.stringify(e,null,2)}function Hn(e){if(e){A({headline:"Operation succeeded.",body:`Results written to ${e}`});return}A({headline:"Operation succeeded."})}async function Bn(e,t,o="text"){let r=Ra(e);if(t){await $e(t,r),o==="text"&&Hn(t);return}o==="text"&&Hn(),v(r)}var j=L(M(),1),Pe=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.descriptionWithoutMarkdown();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,...x,query:j.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":j.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=>Q(t),exactlyOne:["query","query-file"]}),variables:j.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":j.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=>Q(t),exclusive:["variables"]}),store:w.store,version:j.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":j.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async t=>Q(t)}),"allow-mutations":j.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};async run(){let{flags:t}=await this.parse(e),o=await Mn({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 Bn(o,t["output-file"],t.json?"json":"text")}};n();n();async function Vn(e){let t=qa(e.store),o=Vo();await Go({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,additionalReadyMessages:[c`Mutations are ${e.allowMutations?d.green("allowed"):d.yellow("blocked")}.`],abortSignal:e.abortSignal})}function qa(e){return{getToken:async()=>(await q(e)).accessToken,refreshToken:async()=>(await q(e)).accessToken}}var st=L(M(),1),De=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.descriptionWithoutMarkdown();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:w.store,port:no({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":st.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:st.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:st.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 Vn({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version})}};n();n();n();function Gn(e){if(e)return sn[e.toLowerCase()]}n();var $a={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client_transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function dt(e){if(e)return $a[e]}function jn(e){return e?ue(e):""}var Ua=`#graphql
|
|
102
102
|
query StoreInfoAdminShop {
|
|
103
103
|
shop {
|
|
104
104
|
id
|
|
@@ -112,11 +112,11 @@ 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 ct(e){let t=e.store;if(!t)throw new s("No store specified.","Pass the `myshopify.com` domain via the `--store` flag, e.g. `shopify store info --store shop.myshopify.com`.");let o=G(t);if(Ba(o)){await _(o.store,!0,o.preview.shopId),R(o.userId);let i=await Va(o);return Ka({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await Ma(t,{noPrompt:r})}catch(i){if(!r||!ja(i))throw i;return h(`BP store info lookup failed; falling back to stored store auth: ${Qa(i)}`),za(t)}}async function za(e){let t=await q(e);await _(t.store,!0),R(t.userId);let o=await Ha(t);return Ya({store:t.store,shop:o})}async function Ma(e,t={}){let o=await at({store:e,noPrompt:t.noPrompt}),r=await Ga(o,e,{noPrompt:t.noPrompt});return Ja({store:e,destinationsCtx:o,orgShop:r})}async function Ha(e){try{let t=await Y({query:Ua,api:"Admin",url:K(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!t.shop)throw new s(`Shopify did not return store information for ${e.store}.`);return t.shop}catch(t){Fe(t,e);let o=Ee(t,e.store);throw o||t}}function Ba(e){return e?.kind==="preview"&&e.preview!==void 0}async function Va(e){try{let t=await Sn({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof Ne&&(t.status===401||t.status===404)&&et(e),t}}async function Ga(e,t,o={}){if(!e.owningOrg?.id){h("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await xn({store:t,organizationId:e.owningOrg.id,noPrompt:o.noPrompt})}catch(r){h(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function ja(e){return e instanceof Oe||Wa(e)}function Wa(e){return e instanceof s&&e.message.includes("unable to prompt for reauthentication")}function Qa(e){return e instanceof Error?e.message:String(e)}function Ya(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:Xa(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:Qn(Tt(r))};return{...ee(i),subdomain:r}}function Ja(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:Wn(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:Za(r),type:dt(r?.storeType),plan:Gn(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:Qn(Tt(t))};return{...ee(i),subdomain:t}}function Ka(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:Wn(o.preview.shopId),displayName:o.preview.name,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...ee(i),subdomain:t,authScopes:o.scopes}}function Wn(e){if(e)return`gid://shopify/Shop/${e}`}function Xa(e){let t=ee({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function Za(e){if(!e)return;let t=ee({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function Qn(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();function Yn(e,t){if(t==="json"){v(JSON.stringify(e,null,2));return}let o=ts(e);N({customSections:[{title:"Store details",body:{tabularData:es(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function es(e){let t=[];return W(t,"ID",e.id),W(t,"Display Name",e.displayName),W(t,"Subdomain",e.subdomain),W(t,"Organization",e.organizationName),W(t,"Store owner",os(e.storeOwner)),W(t,"Type",e.type?ue(e.type):void 0),W(t,"Plan",e.plan?ue(e.plan):void 0),W(t,"Feature Preview",e.featurePreview),t}function ts(e){let t=[];return Lt(t,e.adminUrl,"Manage this store in the Shopify admin"),Lt(t,e.accessUrl,"View your store"),Lt(t,e.saveUrl,"Save your store"),t}function os(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function W(e,t,o){o&&e.push([t,o])}function Lt(e,t,o){t&&e.push({link:{label:o,url:t}})}var Ce=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.`;
|
|
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={...y,...x,store:w.store};async run(){let{flags:t}=await this.parse(e),o=await ct({store:t.store});Yn(o,t.json?"json":"text")}};n();n();n();n();n();var Jn={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"}}}}],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:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_STATUS"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"active",block:!1}}]}]}}],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:"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 Kn(e){let{entries:t,hasMore:o}=await rs(e.token,e.organization);return{entries:t.sort(is),hasMore:o}}async function rs(e,t){let o=z(),i=(await $({query:Jn,token:e,organizationId:t.id,variables:{first:250},unauthorizedHandler:o})).organization?.accessibleShops;if(!i)return{entries:[],hasMore:!1};let a=[];for(let u of i.edges){let m=ns(u.node,t);m&&a.push(m)}return{entries:a,hasMore:i.pageInfo.hasNextPage}}function ns(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:H(o)??o,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:dt(e.storeType)}}function is(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function Xn(e={}){let t=await P(),o=await Bo(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&&!Me())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 as(o.organizations,e.organizationId),i=await Kn({token:t,organization:r}),{stores:a,truncated:u}=ds(i.entries,i.hasMore);return{stores:a,source:"organization",organization:ss(r),...u?{truncated:!0}:{}}}async function as(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 Yt({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 ss(e){return{id:e.id,name:e.businessName}}function ds(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();function Zn(e,t){if(e.notice&&At(e.notice),e.truncated&&At(cs(e)),t==="json"){v(JSON.stringify({stores:e.stores,...e.organization?{organization:e.organization}:{},...e.notice?{notice:e.notice}:{},...e.truncated?{truncated:!0}:{}},null,2));return}us(e)}function cs(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent stores${t}. More stores exist.`}function us(e){if(e.stores.length===0){F(ls(e));return}e.organization&&F(`Organization: ${e.organization.name} (${e.organization.id})`),ms(e.stores),F("To list stores authenticated directly with `shopify store auth`, run `shopify store auth list`.")}function ms(e){te({rows:e.map(t=>({subdomain:ps(t.store),name:t.name??"",type:jn(t.type),created:Ke(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},created:{header:"Created"}}})}function ls(e){return e.notice?["No stores were returned for the current CLI session.","","Run `shopify store auth list` to list stores authenticated directly with `shopify store auth`."].join(`
|
|
120
120
|
`):e.organization?`No stores found in ${e.organization.name}.`:["No stores found in your Shopify organization.","","Run `shopify store auth list` to list stores authenticated directly with `shopify store auth`."].join(`
|
|
121
|
-
`)}function
|
|
122
|
-
`),process.exit(1)});var
|
|
121
|
+
`)}function ps(e){return Xe(e)??e}var ei=L(M(),1),Le=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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...x,"organization-id":ei.Flags.integer({description:`${w["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"})};async run(){let{flags:t}=await this.parse(e),o=await Xn({organizationId:t["organization-id"]});Zn(o,t.json?"json":"text")}};n();n();var fs={getStoreInfo:ct,openURL:He};async function ti(e,t={}){let{getStoreInfo:o,openURL:r}={...fs,...t},i=await o({store:e.store}),a=hs(i);if(await r(a)){N({headline:`Opening the storefront for ${e.store} in your browser.`});return}N({headline:"Browser didn't open automatically. Open the storefront manually:",body:[c`${d.link(a,a)}`.value]})}function hs(e){return e.accessUrl??`https://${e.subdomain}`}var Re=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.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...y,store:w.store};async run(){let{flags:t}=await this.parse(e);await ti({store:t.store})}};var gs={"store:auth:list":ge,"store:auth":ye,"store:bulk:cancel":ke,"store:bulk:execute":we,"store:bulk:status":ve,"store:stripe-auth":be,"store:create:dev":Te,"store:create:preview":Ie,"store:delete":_e,"store:execute":Pe,"store:graphiql":De,"store:info":Ce,"store:list":Le,"store:open":Re},ut=gs;n();var mt={"app:build":Wo,"app:bulk:cancel":Qo,"app:bulk:status":Yo,"app:deploy":er,"app:dev":tr,"app:dev:clean":xr,"app:logs":or,"app:logs:sources":rr,"app:import-custom-data-definitions":Nr,"app:import-extensions":hr,"app:info":gr,"app:init":Sr,"app:config:validate":yr,"app:release":kr,"app:config:link":Jo,"app:config:use":Ko,"app:config:pull":Xo,"app:env:pull":nr,"app:env:show":ir,"app:execute":sr,"app:graphiql":dr,"app:bulk:execute":ar,"app:function:build":cr,"app:function:replay":ur,"app:function:run":mr,"app:function:info":Tr,"app:function:schema":lr,"app:function:typegen":pr,"app:generate:extension":fr,"app:versions:list":wr,"app:webhook:trigger":vr,"demo:watcher":Zo,"organization:list":Ir},Ss=Ar,ys=br;import ks from"fs";var vS=jo.init;(0,ri.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof Xt?Wt(e):ks.writeSync(process.stderr.fd,`${e.stack??e.message??e}
|
|
122
|
+
`),process.exit(1)});var ws=["SIGINT","SIGTERM","SIGQUIT"];ws.forEach(e=>{process.on(e,()=>{process.exit(1)})});var oi=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(oi)||(process.stdout.columns=oi);async function vs({development:e}){await ro({moduleURL:import.meta.url,development:e})}ae.plugins.hidden=!0;ae["plugins:install"].description="";var bs=Object.keys(mt);bs.forEach(e=>{mt[e].customPluginName="@shopify/app"});var As=Object.keys(We);As.forEach(e=>{We[e].customPluginName="@shopify/theme"});var xs=Object.keys(Qe);xs.forEach(e=>{Qe[e].customPluginName="@shopify/cli-hydrogen"});var Ts=Object.keys(ut);Ts.forEach(e=>{ut[e].customPluginName="@shopify/store"});var Ns=Object.keys(Ye);Ns.forEach(e=>{Ye[e].customPluginName="@oclif/plugin-commands"});var Is=Object.keys(Je);Is.forEach(e=>{Je[e].customPluginName="@shopify/plugin-did-you-mean"});var Os=Object.keys(ae);Os.forEach(e=>{ae[e].customPluginName="@oclif/plugin-plugins"});var bS={...mt,...We,...ae,...Je,...Ye,...Qe,...ut,search:io,upgrade:ao,version:oo,"send-analytics":so,help:vo,"auth:logout":co,"auth:login":uo,"debug:command-flags":mo,"kitchen-sink":ho,"kitchen-sink:async":lo,"kitchen-sink:prompts":po,"kitchen-sink:static":fo,"doctor-release":go,"doctor-release:theme":So,"doc:fetch":yo,"doc:search":ko,"docs:generate":wo,"notifications:list":bo,"notifications:generate":Ao,"cache:clear":xo,"config:autoupgrade:off":To,"config:autoupgrade:on":No,"config:autoupgrade:status":Io},AS=vs;export{ys as AppPublicMetadataHook,Ss as AppSensitiveMetadataHook,bS as COMMANDS,mi as DidYouMeanHook,vS as HydrogenInitHook,ui as PluginHook,li as TunnelProviderHook,pi as TunnelStartHook,AS as default,si as fetchStoreThemes,di as pull,ci as push};
|