@shopify/cli 4.2.0 → 4.3.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/{acorn-QBS5IYTX.js → acorn-7M27BPGP.js} +1 -1
- package/dist/analytics-JH64XI2J.js +1 -0
- package/dist/analytics-MEGKKFGF.js +1 -0
- package/dist/{angular-UTTM4Y4S.js → angular-DW5TQVCM.js} +1 -1
- package/dist/{babel-JS32NLHY.js → babel-I2RLWM7N.js} +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/{chokidar-G4ONJSK4.js → chokidar-VDIVGBZH.js} +1 -1
- package/dist/{chunk-NBYS6YQ2.js → chunk-25HJX3L2.js} +1 -1
- package/dist/{chunk-ZZYFG22L.js → chunk-2EHBJWC6.js} +1 -1
- package/dist/{chunk-INFBVFMU.js → chunk-2GAFKG64.js} +1 -1
- package/dist/{chunk-F6T3UBBL.js → chunk-2GU7OY3H.js} +1 -1
- package/dist/{chunk-MIO2CV3Q.js → chunk-2K7FGAT6.js} +1 -1
- package/dist/{chunk-PRVQAHWI.js → chunk-2O22LZKV.js} +1 -1
- package/dist/{chunk-MKE434RB.js → chunk-2RBIR3NM.js} +1 -1
- package/dist/{chunk-4Z2WYNTE.js → chunk-2TMQG2UT.js} +1 -1
- package/dist/{chunk-FTN7Y6HD.js → chunk-2XZBQZ5R.js} +1 -1
- package/dist/{chunk-J6VTZEE2.js → chunk-33OHQUHZ.js} +1 -1
- package/dist/chunk-3AOQKI4B.js +1 -0
- package/dist/{chunk-4EXYYBQ6.js → chunk-3SPDFV5D.js} +1 -1
- package/dist/{chunk-X2TC7S57.js → chunk-3YDYZ232.js} +2 -2
- package/dist/{chunk-FFYYJKF7.js → chunk-4FFPTEKD.js} +1 -1
- package/dist/{chunk-IWCPQD7X.js → chunk-4J32OHLY.js} +1 -1
- package/dist/chunk-4QTEPWEJ.js +283 -0
- package/dist/{chunk-QLQGHMVU.js → chunk-57PPQKJT.js} +1 -1
- package/dist/{chunk-DCK2FX6J.js → chunk-5BKCIDMS.js} +1 -1
- package/dist/{chunk-JUVAGMIH.js → chunk-5C7HDTHJ.js} +1 -1
- package/dist/{chunk-A6X2IVGT.js → chunk-5FFHQTRC.js} +1 -1
- package/dist/{chunk-UCLSPAVX.js → chunk-5FVB7JHP.js} +1 -1
- package/dist/{chunk-HD5TYIDZ.js → chunk-5H3VTG77.js} +1 -1
- package/dist/{chunk-6TEXPRI2.js → chunk-5O43334U.js} +1 -1
- package/dist/{chunk-MZJRNFAU.js → chunk-5XDQ76DQ.js} +1 -1
- package/dist/{chunk-PD5ZHJWI.js → chunk-636CTEW7.js} +1 -1
- package/dist/chunk-6JKGUQRD.js +1 -0
- package/dist/chunk-6KETAPWL.js +1 -0
- package/dist/{chunk-UOQQNAHX.js → chunk-6LWOWDF4.js} +1 -1
- package/dist/{chunk-CE6FKJFS.js → chunk-7572RLUP.js} +1 -1
- package/dist/{chunk-XFKCDWXB.js → chunk-762JWOWJ.js} +1 -1
- package/dist/{chunk-IU2ZQ6TE.js → chunk-773TIA5M.js} +1 -1
- package/dist/{chunk-23AMFHXC.js → chunk-7D45IAMQ.js} +1 -1
- package/dist/{chunk-VPL2NDH6.js → chunk-7FQFEB33.js} +5 -5
- package/dist/{chunk-BPVZ7E63.js → chunk-7LV55VWE.js} +1 -1
- package/dist/{chunk-QUTQDXSL.js → chunk-7UNQOKZW.js} +1 -1
- package/dist/{chunk-IWE4RUI7.js → chunk-A27NZMWB.js} +1 -1
- package/dist/{chunk-7JESXDF2.js → chunk-A4SBXDZB.js} +1 -1
- package/dist/{chunk-AP3RFOPL.js → chunk-A5HKAMAC.js} +1 -1
- package/dist/{chunk-Z35BTAM6.js → chunk-AAK376RT.js} +1 -1
- package/dist/{chunk-DNLOSMHL.js → chunk-AERKD4TO.js} +1 -1
- package/dist/{chunk-WUK5NQSX.js → chunk-ANBOLDON.js} +2 -2
- package/dist/{chunk-TLSAQ6FG.js → chunk-AO3RFGNV.js} +1 -1
- package/dist/{chunk-KU5OPV7U.js → chunk-ATSMK66C.js} +1 -1
- package/dist/{chunk-LTWXTDDR.js → chunk-AU5EZQW7.js} +1 -1
- package/dist/{chunk-2YXKZWYW.js → chunk-AVD3INWF.js} +1 -1
- package/dist/chunk-AWEB5AQM.js +1 -0
- package/dist/{chunk-X4CV6TRE.js → chunk-AXNAGI32.js} +1 -1
- package/dist/{chunk-FQDRVPCY.js → chunk-BL46CZ2M.js} +1 -1
- package/dist/{chunk-OKOYLEA7.js → chunk-BQWK3C47.js} +3 -3
- package/dist/{chunk-C3LZPAAH.js → chunk-CEHXOWA6.js} +1 -1
- package/dist/{chunk-N5ROZKPZ.js → chunk-CFOXXOO2.js} +1 -1
- package/dist/{chunk-PIBY5DDZ.js → chunk-CRALWNNO.js} +1 -1
- package/dist/{chunk-NO5KVFTV.js → chunk-CV5EQGES.js} +3 -3
- package/dist/{chunk-H4W4DFKK.js → chunk-CX5CC6P5.js} +1 -1
- package/dist/{chunk-OKNBZSGN.js → chunk-DCLUZFT7.js} +1 -1
- package/dist/{chunk-2EJCY4CE.js → chunk-DNXYKGV2.js} +1 -1
- package/dist/{chunk-IOQQUHST.js → chunk-DTIWUT2T.js} +1 -1
- package/dist/{chunk-6TORWTD7.js → chunk-DYNH5SKT.js} +1 -1
- package/dist/{chunk-D3DDLLNF.js → chunk-DZQYG32N.js} +1 -1
- package/dist/{chunk-QTGMS62F.js → chunk-E7DHELFH.js} +1 -1
- package/dist/{chunk-PUTZFF2Z.js → chunk-EH7ZTFS4.js} +3 -3
- package/dist/{chunk-YS6VOQ7I.js → chunk-EJDWYASP.js} +1 -1
- package/dist/chunk-EKVTNWHM.js +1 -0
- package/dist/{chunk-6M3ZYNGO.js → chunk-ET2CGROE.js} +1 -1
- package/dist/{chunk-6ZIOYXEF.js → chunk-EVZA2TCI.js} +1 -1
- package/dist/{chunk-QSTEVZFQ.js → chunk-F3TMLDLC.js} +1 -1
- package/dist/{chunk-CW7WJZKR.js → chunk-FIYAECXH.js} +1 -1
- package/dist/{chunk-WDC3KIZT.js → chunk-FKIVKNOV.js} +1 -1
- package/dist/{chunk-7DVOSOEP.js → chunk-FOFJBRSL.js} +1 -1
- package/dist/{chunk-D656BV5Z.js → chunk-FQ5ZZX2G.js} +1 -1
- package/dist/{chunk-6YHJ554P.js → chunk-G2LVUM7N.js} +1 -1
- package/dist/{chunk-NPM3MFB3.js → chunk-G2OHWAY2.js} +1 -1
- package/dist/chunk-G3JJLXPH.js +1 -0
- package/dist/{chunk-57N2DFIF.js → chunk-G3RWLAOG.js} +1 -1
- package/dist/{chunk-4V4DQ6W7.js → chunk-G4OQABDT.js} +30 -30
- package/dist/{chunk-KLMDWDT2.js → chunk-GB3YC4TI.js} +1 -1
- package/dist/{chunk-OCOY5MV2.js → chunk-GCN4O7HM.js} +1 -1
- package/dist/{chunk-2N4O33VM.js → chunk-GDHD3TGC.js} +1 -1
- package/dist/{chunk-N3YWHJMB.js → chunk-GJXINXSU.js} +2 -2
- package/dist/{chunk-RAH5NW3R.js → chunk-GWHV62YT.js} +1 -1
- package/dist/{chunk-VA5IUGZV.js → chunk-HCTZN7L4.js} +1 -1
- package/dist/{chunk-LITB5QQX.js → chunk-HDC5V7RY.js} +1 -1
- package/dist/{chunk-K7K6GNF6.js → chunk-HIQHYPLU.js} +1 -1
- package/dist/{chunk-VEDZUOVI.js → chunk-HOSFU6UP.js} +3 -3
- package/dist/{chunk-HSYRYSX4.js → chunk-I22ZTRKK.js} +1 -1
- package/dist/{chunk-KLA7AWG6.js → chunk-I4R7TML2.js} +1 -1
- package/dist/{chunk-EENHXSWU.js → chunk-I5A6BPCP.js} +1 -1
- package/dist/{chunk-TNQXTZAX.js → chunk-IWOTLFOY.js} +1 -1
- package/dist/{chunk-PBTXPBI6.js → chunk-J3H4LPN6.js} +3 -3
- package/dist/{chunk-6HZTMQD6.js → chunk-J3HX6ZGD.js} +1 -1
- package/dist/{chunk-OYP7DKPU.js → chunk-J3JPJCWP.js} +1 -1
- package/dist/{chunk-E2YBU6D3.js → chunk-J5BRKYGE.js} +2 -2
- package/dist/{chunk-5TIJLYZU.js → chunk-JAWKLBOB.js} +1 -1
- package/dist/{chunk-6AJZKIZ3.js → chunk-JAWOP4HJ.js} +1 -1
- package/dist/{chunk-TQGTEVSR.js → chunk-JCIN73BE.js} +1 -1
- package/dist/{chunk-C6ABJCRG.js → chunk-JEZ3PGVC.js} +1 -1
- package/dist/{chunk-TGACBJIY.js → chunk-JJ6RM54S.js} +1 -1
- package/dist/{chunk-TXUTT6UA.js → chunk-JK3NIHTX.js} +1 -1
- package/dist/{chunk-OLOBQ42K.js → chunk-JLE4NBMT.js} +1 -1
- package/dist/{chunk-7KJ5TBWG.js → chunk-JSOGPMWB.js} +1 -1
- package/dist/{chunk-L2VSSINY.js → chunk-JUYJZUYU.js} +1 -1
- package/dist/chunk-KRQGLK2Q.js +3 -0
- package/dist/{chunk-3VZEETAV.js → chunk-KRZABRYT.js} +1 -1
- package/dist/{chunk-FBVBO5YQ.js → chunk-L2PC4MUV.js} +1 -1
- package/dist/{chunk-SSM346XI.js → chunk-LCZDC6EE.js} +1 -1
- package/dist/{chunk-NEZEHBT2.js → chunk-LXVORHCQ.js} +1 -1
- package/dist/{chunk-DERA4K6A.js → chunk-M2YINBHF.js} +1 -1
- package/dist/{chunk-VT77EFRL.js → chunk-M7YFD4EV.js} +6 -6
- package/dist/{chunk-DCBYHVKW.js → chunk-MEIEEENL.js} +1 -1
- package/dist/{chunk-7BFDUVOG.js → chunk-MIDYZPO4.js} +1 -1
- package/dist/{chunk-I3LX25MB.js → chunk-MINZGZ4N.js} +1 -1
- package/dist/{chunk-U3ZG675O.js → chunk-MMIHHCMW.js} +1 -1
- package/dist/{chunk-PRKBO42R.js → chunk-MPW2YJWU.js} +1 -1
- package/dist/{chunk-C2FFA4O4.js → chunk-MRS6LAY7.js} +1 -1
- package/dist/{chunk-IVGWFPMA.js → chunk-N3CNWCC2.js} +1 -1
- package/dist/{chunk-NXL6LDJU.js → chunk-N3NE4MVN.js} +1 -1
- package/dist/{chunk-WNGV4JQS.js → chunk-N3YTDGFY.js} +1 -1
- package/dist/{chunk-A5SQCM63.js → chunk-N5LVGFDS.js} +1 -1
- package/dist/{chunk-GVITHCQJ.js → chunk-NILXAUUT.js} +1 -1
- package/dist/{chunk-5Y7GIF2W.js → chunk-NJOO5XJV.js} +1 -1
- package/dist/{chunk-ULQG3XQS.js → chunk-NNOSZ447.js} +1 -1
- package/dist/{chunk-MGL4YM3S.js → chunk-NTRAWIEJ.js} +4 -4
- package/dist/{chunk-2WNODIWJ.js → chunk-NWXDOCL5.js} +1 -1
- package/dist/{chunk-K77WAKOB.js → chunk-OU3M32A2.js} +1 -1
- package/dist/chunk-OU4SKQTC.js +5 -0
- package/dist/{chunk-4KRT35A2.js → chunk-OXJBYKMX.js} +1 -1
- package/dist/{chunk-LCCMXY6N.js → chunk-OZBY45KT.js} +1 -1
- package/dist/{chunk-75VPUOC5.js → chunk-P2OI2P2M.js} +1 -1
- package/dist/{chunk-XP6IRAZN.js → chunk-PCCK4YTE.js} +1 -1
- package/dist/{chunk-2VLMN5QZ.js → chunk-PFGYC53K.js} +1 -1
- package/dist/{chunk-YGMVL6NZ.js → chunk-PMS4MNHB.js} +2 -2
- package/dist/{chunk-OA4P6AKS.js → chunk-PNP5OKNZ.js} +1 -1
- package/dist/{chunk-XX343DDG.js → chunk-PXHY753L.js} +1 -1
- package/dist/{chunk-UURFVUAH.js → chunk-Q73GEVSJ.js} +1 -1
- package/dist/{chunk-M2TJICTB.js → chunk-Q77MM2N2.js} +1 -1
- package/dist/{chunk-XDAOLCPN.js → chunk-Q7C44DX5.js} +1 -1
- package/dist/chunk-QDVJJKLB.js +1 -0
- package/dist/{chunk-5CH3B62S.js → chunk-RJ5VF3QY.js} +1 -1
- package/dist/{chunk-LQMSF3F7.js → chunk-RKDZGK5K.js} +1 -1
- package/dist/{chunk-VYXVYOIJ.js → chunk-RSRYC5ZF.js} +1 -1
- package/dist/{chunk-HLMFVORT.js → chunk-S22NCNAJ.js} +1 -1
- package/dist/{chunk-UARVYVLN.js → chunk-S5IFJ737.js} +2 -2
- package/dist/{chunk-42RMKTCJ.js → chunk-S6B2ADVR.js} +1 -1
- package/dist/chunk-S7F5KFQP.js +1 -0
- package/dist/{chunk-UBKVCI7A.js → chunk-SSCYLDSX.js} +1 -1
- package/dist/{chunk-QFWIDATO.js → chunk-STJ3LWFL.js} +1 -1
- package/dist/{chunk-LKS47US7.js → chunk-T3ERXB7F.js} +1 -1
- package/dist/{chunk-PLQFX5ZP.js → chunk-T4IV643Z.js} +1 -1
- package/dist/{chunk-BECEP46I.js → chunk-T4NS63K4.js} +1 -1
- package/dist/{chunk-3YWUSKWF.js → chunk-T6CC5WUU.js} +1 -1
- package/dist/{chunk-3TNEIDOD.js → chunk-T7KHS6RF.js} +1 -1
- package/dist/{chunk-QYR5VPQA.js → chunk-TOLPNBZK.js} +1 -1
- package/dist/{chunk-XXE7667M.js → chunk-TP7E54WN.js} +1 -1
- package/dist/chunk-TPCG6DCA.js +1 -0
- package/dist/{chunk-2KH2S7PI.js → chunk-TRYWVIVJ.js} +1 -1
- package/dist/chunk-TU47HMTL.js +1 -0
- package/dist/{chunk-HHXHOQQP.js → chunk-TUNUEOHO.js} +1 -1
- package/dist/{chunk-PS25FEBF.js → chunk-TY6BZTG3.js} +1 -1
- package/dist/chunk-TYMYIUIQ.js +1 -0
- package/dist/chunk-UB26DGTR.js +6 -0
- package/dist/{chunk-HJSYHK4S.js → chunk-UC7KMA6W.js} +1 -1
- package/dist/{chunk-FD5S2O6M.js → chunk-UOHNRH6E.js} +1 -1
- package/dist/{chunk-ZR76GGZ6.js → chunk-UQWFDL3F.js} +1 -1
- package/dist/{chunk-M4LOKANA.js → chunk-USLYL5AC.js} +1 -1
- package/dist/{chunk-VICNWPLQ.js → chunk-UTO4Z6P6.js} +12 -12
- package/dist/{chunk-F47MFBKM.js → chunk-UU5P2IYU.js} +1 -1
- package/dist/chunk-UYSF234H.js +1 -0
- package/dist/chunk-VE35YELD.js +1 -0
- package/dist/{chunk-6YAXFS6V.js → chunk-VI34CKV6.js} +1 -1
- package/dist/{chunk-M4V2OQAX.js → chunk-VJ6KDRZI.js} +1 -1
- package/dist/{chunk-VBUZWRUL.js → chunk-VJEKDBGZ.js} +1 -1
- package/dist/chunk-VKWPEFWQ.js +1 -0
- package/dist/chunk-VPPWSKOY.js +1 -0
- package/dist/chunk-VRJTLVG3.js +1 -0
- package/dist/chunk-VUMUCNI7.js +1 -0
- package/dist/chunk-W7DDV2EY.js +1 -0
- package/dist/{chunk-RL5BWZ7D.js → chunk-WA3YC5W4.js} +1 -1
- package/dist/{chunk-MFLBTJO7.js → chunk-WHNWE7P2.js} +1 -1
- package/dist/{chunk-R6JNXEB3.js → chunk-WVRGCNBZ.js} +1 -1
- package/dist/{chunk-MOA33ZFO.js → chunk-WW7TENNA.js} +1 -1
- package/dist/{chunk-HZA6IAA4.js → chunk-XVUHUA36.js} +1 -1
- package/dist/{chunk-PSQFZAF3.js → chunk-XWPPBOGF.js} +1 -1
- package/dist/chunk-YIRFEW5M.js +1 -0
- package/dist/{chunk-RGNAWKD7.js → chunk-YL3TYQGT.js} +1 -1
- package/dist/{chunk-A3VYI4LO.js → chunk-YLQ3LNNY.js} +3 -3
- package/dist/{chunk-MA52QGHP.js → chunk-YMAWEIUR.js} +1 -1
- package/dist/{chunk-6LK6ZP3Q.js → chunk-YPBCSDFQ.js} +1 -1
- package/dist/{chunk-3BRUCKZ2.js → chunk-YSIBRY6C.js} +1 -1
- package/dist/{chunk-FGVC22EY.js → chunk-YVQXEPHY.js} +1 -1
- package/dist/{chunk-4LNCYIS3.js → chunk-ZDF5N422.js} +1 -1
- package/dist/{chunk-T4M5CWAO.js → chunk-ZG7BVVT2.js} +1 -1
- package/dist/chunk-ZGJ3DFTQ.js +9 -0
- package/dist/{chunk-NKQBEFPS.js → chunk-ZI7LK3LW.js} +1 -1
- package/dist/{chunk-IXUVSFW2.js → chunk-ZM75DSIW.js} +1 -1
- package/dist/{chunk-3V63X7WZ.js → chunk-ZUKLGZOU.js} +1 -1
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/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/constants.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.d.ts +12 -0
- package/dist/cli/commands/doc/fetch.js +1 -0
- package/dist/cli/commands/doc/search.d.ts +13 -0
- package/dist/cli/commands/doc/search.js +1 -0
- 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.d.ts +4 -0
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/services/commands/doc/fetch.d.ts +1 -0
- package/dist/cli/services/commands/doc/fetch.js +45 -0
- package/dist/cli/services/commands/doc/search.d.ts +1 -0
- package/dist/cli/services/commands/doc/search.js +47 -0
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-6QNH5BID.js → conf-store-UY3MDGGA.js} +1 -1
- package/dist/{custom-oclif-loader-TSPWW5YF.js → custom-oclif-loader-3AICQCNU.js} +1 -1
- package/dist/deprecations-KNUMDRIU.js +1 -0
- package/dist/{devtools-HCKYP7DQ.js → devtools-37DE4MUR.js} +1 -1
- package/dist/{devtools-VEZNCV6W.js → devtools-WAWU5KQL.js} +1 -1
- package/dist/dist-C5IV2YDQ.js +1 -0
- package/dist/dist-VL4KZWV2.js +1 -0
- package/dist/environments-YPRVO2CF.js +1 -0
- package/dist/error-XRBQTNFM.js +1 -0
- package/dist/error-handler-NI7D6GSY.js +1 -0
- package/dist/{estree-BYYJYS3A.js → estree-JV5M77BA.js} +1 -1
- package/dist/{flow-M3Q2HPQT.js → flow-N4JYPYMQ.js} +1 -1
- package/dist/{fs-YMUQ6JLE.js → fs-LJWVNO4H.js} +1 -1
- package/dist/{glimmer-3DEJJGOJ.js → glimmer-JEV3BXHR.js} +1 -1
- package/dist/{graphql-A4HHE3MB.js → graphql-DTF6MHYF.js} +1 -1
- package/dist/hooks/app-init.js +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/{html-HETICZ2F.js → html-LVOJ3RQS.js} +1 -1
- package/dist/{http-proxy-node16-Q5DZMBHC.js → http-proxy-node16-X2WAMUT5.js} +1 -1
- package/dist/index.js +28 -7
- package/dist/is-global-W6ALVC5L.js +1 -0
- package/dist/{is-wsl-TN2CXYI7.js → is-wsl-UEMXYJPN.js} +1 -1
- package/dist/{latest-version-6OAYLOBL.js → latest-version-32HXMWJ7.js} +1 -1
- package/dist/lib-AIKYSHWL.js +1 -0
- package/dist/lib-O5EZ4NVT.js +1 -0
- package/dist/lib-Q4PWEMFD.js +1 -0
- package/dist/lib-QJDPPAWN.js +1 -0
- package/dist/{local-GPDAXHE6.js → local-GKEWZAIV.js} +1 -1
- package/dist/local-storage-ZOZMA22B.js +1 -0
- package/dist/{markdown-5TVCXM53.js → markdown-J6CE6POI.js} +1 -1
- package/dist/{meriyah-23OZNYWC.js → meriyah-PNQQZQYI.js} +1 -1
- package/dist/metadata-UEUN64TK.js +1 -0
- package/dist/{morph-I35VYPBH.js → morph-CGOZEPPZ.js} +1 -1
- package/dist/{multipart-parser-Q4QJZK3V.js → multipart-parser-5NSSTW27.js} +1 -1
- package/dist/{node-package-manager-GO4ZRTKQ.js → node-package-manager-4ASQQIIF.js} +1 -1
- package/dist/notifications-system-HLXJCAMG.js +1 -0
- package/dist/{npa-VNALV7XY.js → npa-A4YSCQ5Q.js} +1 -1
- package/dist/{open-VA7TLUIL.js → open-KLSGXBIW.js} +1 -1
- package/dist/out-CDCY25QC.js +1 -0
- package/dist/{output-7IYOMPSA.js → output-S6E37GJQ.js} +1 -1
- package/dist/{path-CWUNINMX.js → path-MBXP7ZIC.js} +1 -1
- package/dist/{postcss-IIK6CGAW.js → postcss-Q36SHOML.js} +1 -1
- package/dist/{prettier-ZSBNNQTK.js → prettier-EGVCP5CY.js} +1 -1
- package/dist/{source-map-3K6Y2OMO.js → source-map-E7FCCJL7.js} +1 -1
- package/dist/system-YQZNGSWB.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typescript-5R4Y7PXE.js +1 -0
- package/dist/{typescript-YKZ232QT.js → typescript-WYPDGPSV.js} +1 -1
- package/dist/ui-D2FFWRK7.js +1 -0
- package/dist/upgrade-TVTCFMXM.js +1 -0
- package/dist/version-J6MDN7BZ.js +1 -0
- package/dist/version-RIRW5EXQ.js +1 -0
- package/dist/{workerd-ST6XJKUN.js → workerd-QOTT6UCO.js} +1 -1
- package/dist/{yaml-SJKIH3VD.js → yaml-6KWCJ64X.js} +1 -1
- package/oclif.manifest.json +304 -6
- package/package.json +11 -8
- package/dist/analytics-CX22YIUZ.js +0 -1
- package/dist/analytics-UBWQIQYF.js +0 -1
- package/dist/chunk-4ZGSSQC6.js +0 -1
- package/dist/chunk-6SXOUZ7V.js +0 -1
- package/dist/chunk-ATPFTRCC.js +0 -1
- package/dist/chunk-AWQ5AR2K.js +0 -5
- package/dist/chunk-BHWEA4V2.js +0 -1
- package/dist/chunk-CCEA5CUX.js +0 -1
- package/dist/chunk-FP2NOZSD.js +0 -1
- package/dist/chunk-FSTCEWXX.js +0 -1
- package/dist/chunk-K3PGC6DC.js +0 -1
- package/dist/chunk-KFCGMT67.js +0 -1
- package/dist/chunk-KQU6HOJ3.js +0 -1
- package/dist/chunk-NP4UFPAX.js +0 -9
- package/dist/chunk-RVMB5LC2.js +0 -1
- package/dist/chunk-T5MK7ZSF.js +0 -1
- package/dist/chunk-UOQ75BL3.js +0 -1
- package/dist/chunk-UWJ73J4B.js +0 -1
- package/dist/chunk-VPRTJUIN.js +0 -1
- package/dist/chunk-WCWNI3ZV.js +0 -283
- package/dist/chunk-XEFQQPL4.js +0 -1
- package/dist/chunk-YJB7P2HC.js +0 -1
- package/dist/chunk-YOZNRLFC.js +0 -1
- package/dist/deprecations-F6JWVV2W.js +0 -1
- package/dist/dist-4BD6KOLR.js +0 -1
- package/dist/dist-AUABCVPI.js +0 -1
- package/dist/environments-RGLI75HN.js +0 -1
- package/dist/error-OZALZZ3U.js +0 -1
- package/dist/error-handler-V7LSEXHM.js +0 -1
- package/dist/is-global-BLIZ57HQ.js +0 -1
- package/dist/lib-AK5EOIKR.js +0 -1
- package/dist/lib-LVUMLZ4H.js +0 -1
- package/dist/lib-ME6554NA.js +0 -1
- package/dist/lib-WU3FEA6I.js +0 -1
- package/dist/local-storage-P66KJG6I.js +0 -1
- package/dist/metadata-TRH25EHU.js +0 -1
- package/dist/notifications-system-HM6JZ6WJ.js +0 -1
- package/dist/out-WLY6KV4B.js +0 -1
- package/dist/system-X5C4EQQH.js +0 -1
- package/dist/typescript-K5CWIA4V.js +0 -1
- package/dist/ui-H62CMRLG.js +0 -1
- package/dist/upgrade-EEOPH464.js +0 -1
- package/dist/version-76NBQR4K.js +0 -1
- package/dist/version-IGSEISUA.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-E2YBU6D3.js";import{a as ie,b as At}from"./chunk-OKOYLEA7.js";import"./chunk-PSQFZAF3.js";import"./chunk-N3YWHJMB.js";import{a as Ct}from"./chunk-M4LOKANA.js";import{a as ro}from"./chunk-6SXOUZ7V.js";import{a as Bt}from"./chunk-HLMFVORT.js";import{a as Qt}from"./chunk-7DVOSOEP.js";import{a as W,b as xt,c as Yt}from"./chunk-VT77EFRL.js";import{a as Dt}from"./chunk-OKNBZSGN.js";import{a as qt}from"./chunk-VA5IUGZV.js";import{a as Jt}from"./chunk-XDAOLCPN.js";import{a as Kt}from"./chunk-F6T3UBBL.js";import{a as Zt}from"./chunk-D656BV5Z.js";import{a as zt}from"./chunk-CCEA5CUX.js";import{a as oo}from"./chunk-BECEP46I.js";import{a as Mt}from"./chunk-7KJ5TBWG.js";import{a as Ht}from"./chunk-6LK6ZP3Q.js";import"./chunk-2WNODIWJ.js";import{a as Vt}from"./chunk-57N2DFIF.js";import{a as jt}from"./chunk-4Z2WYNTE.js";import"./chunk-CE6FKJFS.js";import{a as Gt}from"./chunk-AWQ5AR2K.js";import{a as no}from"./chunk-INFBVFMU.js";import{a as It}from"./chunk-FFYYJKF7.js";import{a as Wt}from"./chunk-C3LZPAAH.js";import{a as Ft}from"./chunk-NO5KVFTV.js";import"./chunk-6TEXPRI2.js";import{a as re,b as Pt}from"./chunk-PUTZFF2Z.js";import"./chunk-FD5S2O6M.js";import"./chunk-NPM3MFB3.js";import{a as nn}from"./chunk-6ZIOYXEF.js";import"./chunk-CW7WJZKR.js";import"./chunk-6YHJ554P.js";import"./chunk-DNLOSMHL.js";import{a as rn}from"./chunk-LTWXTDDR.js";import"./chunk-HJSYHK4S.js";import"./chunk-3V63X7WZ.js";import"./chunk-RAH5NW3R.js";import"./chunk-5TIJLYZU.js";import"./chunk-LKS47US7.js";import"./chunk-KLA7AWG6.js";import"./chunk-I3LX25MB.js";import"./chunk-UBKVCI7A.js";import"./chunk-IVGWFPMA.js";import"./chunk-QLQGHMVU.js";import"./chunk-FTN7Y6HD.js";import"./chunk-ZZYFG22L.js";import"./chunk-MFLBTJO7.js";import"./chunk-D3DDLLNF.js";import"./chunk-OYP7DKPU.js";import"./chunk-TXUTT6UA.js";import"./chunk-X2TC7S57.js";import"./chunk-3VZEETAV.js";import"./chunk-MA52QGHP.js";import"./chunk-IOQQUHST.js";import"./chunk-DERA4K6A.js";import"./chunk-KFCGMT67.js";import"./chunk-M4V2OQAX.js";import"./chunk-BPVZ7E63.js";import"./chunk-2YXKZWYW.js";import"./chunk-2KH2S7PI.js";import"./chunk-QFWIDATO.js";import"./chunk-7BFDUVOG.js";import{b as on}from"./chunk-L2VSSINY.js";import"./chunk-MZJRNFAU.js";import"./chunk-HHXHOQQP.js";import"./chunk-TLSAQ6FG.js";import"./chunk-LQMSF3F7.js";import"./chunk-C6ABJCRG.js";import"./chunk-UWJ73J4B.js";import"./chunk-YGMVL6NZ.js";import"./chunk-YOZNRLFC.js";import"./chunk-NBYS6YQ2.js";import"./chunk-XEFQQPL4.js";import"./chunk-WNGV4JQS.js";import"./chunk-RL5BWZ7D.js";import"./chunk-VYXVYOIJ.js";import"./chunk-NEZEHBT2.js";import"./chunk-UOQQNAHX.js";import"./chunk-FGVC22EY.js";import"./chunk-NKQBEFPS.js";import{a as to}from"./chunk-SSM346XI.js";import{a as $t}from"./chunk-UURFVUAH.js";import"./chunk-WDC3KIZT.js";import{a as Lt}from"./chunk-IXUVSFW2.js";import"./chunk-U3ZG675O.js";import{a as Ut}from"./chunk-OLOBQ42K.js";import{a as yt}from"./chunk-K7K6GNF6.js";import{a as mt}from"./chunk-R6JNXEB3.js";import{a as Tt}from"./chunk-C2FFA4O4.js";import"./chunk-UOQ75BL3.js";import"./chunk-DCBYHVKW.js";import{a as Nt}from"./chunk-X4CV6TRE.js";import{a as Rt}from"./chunk-PLQFX5ZP.js";import{a as _t}from"./chunk-XFKCDWXB.js";import"./chunk-HSYRYSX4.js";import"./chunk-IWE4RUI7.js";import"./chunk-LCCMXY6N.js";import{a as Et}from"./chunk-A6X2IVGT.js";import{a as Ot}from"./chunk-OA4P6AKS.js";import"./chunk-T5MK7ZSF.js";import"./chunk-DCK2FX6J.js";import{t as bt}from"./chunk-WCWNI3ZV.js";import"./chunk-42RMKTCJ.js";import"./chunk-A3VYI4LO.js";import"./chunk-VBUZWRUL.js";import{a as wt,c as vt}from"./chunk-VICNWPLQ.js";import"./chunk-RGNAWKD7.js";import"./chunk-IWCPQD7X.js";import"./chunk-TNQXTZAX.js";import"./chunk-QSTEVZFQ.js";import{e as Y}from"./chunk-N5ROZKPZ.js";import"./chunk-AP3RFOPL.js";import{a as ct}from"./chunk-K3PGC6DC.js";import{a as at}from"./chunk-UCLSPAVX.js";import"./chunk-KU5OPV7U.js";import"./chunk-4ZGSSQC6.js";import{a as st}from"./chunk-6AJZKIZ3.js";import"./chunk-K77WAKOB.js";import{a as ht}from"./chunk-3BRUCKZ2.js";import{a as ft}from"./chunk-TGACBJIY.js";import"./chunk-MKE434RB.js";import{a as kt}from"./chunk-F47MFBKM.js";import{a as St}from"./chunk-2VLMN5QZ.js";import"./chunk-OCOY5MV2.js";import{a as Xe}from"./chunk-RVMB5LC2.js";import{a as nt}from"./chunk-MIO2CV3Q.js";import{a as ot}from"./chunk-KQU6HOJ3.js";import{a as gt}from"./chunk-XXE7667M.js";import{a as rt}from"./chunk-PS25FEBF.js";import{a as pt}from"./chunk-J6VTZEE2.js";import{a as dt}from"./chunk-XX343DDG.js";import{a as it}from"./chunk-23AMFHXC.js";import"./chunk-NXL6LDJU.js";import{a as Xt}from"./chunk-FSTCEWXX.js";import{a as eo}from"./chunk-ATPFTRCC.js";import"./chunk-FP2NOZSD.js";import{a as dn}from"./chunk-FQDRVPCY.js";import{d as cn}from"./chunk-HD5TYIDZ.js";import{a as lt}from"./chunk-M2TJICTB.js";import{a as et}from"./chunk-NP4UFPAX.js";import{a as tt}from"./chunk-2EJCY4CE.js";import"./chunk-TQGTEVSR.js";import"./chunk-GVITHCQJ.js";import"./chunk-QTGMS62F.js";import{G as oe,P as T,ea as Ae,fa as G,g as en,n as xe,na as be,pa as B,z as b}from"./chunk-4V4DQ6W7.js";import"./chunk-4LNCYIS3.js";import"./chunk-WUK5NQSX.js";import"./chunk-PRKBO42R.js";import"./chunk-LITB5QQX.js";import"./chunk-YJB7P2HC.js";import"./chunk-6HZTMQD6.js";import{a as tn}from"./chunk-2N4O33VM.js";import{a as ut,b as F,c as P}from"./chunk-4KRT35A2.js";import"./chunk-3TNEIDOD.js";import{c as se,d as sn}from"./chunk-FBVBO5YQ.js";import{b as je}from"./chunk-A5SQCM63.js";import{b as ne}from"./chunk-VEDZUOVI.js";import"./chunk-MOA33ZFO.js";import{a as Ve,c as te}from"./chunk-JUVAGMIH.js";import{E as M,J as Je,P as Ke,u as Qe,v as Q,y as Ye}from"./chunk-MGL4YM3S.js";import"./chunk-YS6VOQ7I.js";import"./chunk-KLMDWDT2.js";import"./chunk-5CH3B62S.js";import"./chunk-QUTQDXSL.js";import{d as Ge,e as Be}from"./chunk-6YAXFS6V.js";import{c as We,d as s,g as H}from"./chunk-BHWEA4V2.js";import{a as V,b as an}from"./chunk-PBTXPBI6.js";import"./chunk-Z35BTAM6.js";import"./chunk-75VPUOC5.js";import"./chunk-HZA6IAA4.js";import"./chunk-PD5ZHJWI.js";import{r as ee}from"./chunk-3YWUSKWF.js";import"./chunk-ZR76GGZ6.js";import"./chunk-EENHXSWU.js";import"./chunk-H4W4DFKK.js";import"./chunk-6M3ZYNGO.js";import"./chunk-QYR5VPQA.js";import"./chunk-XP6IRAZN.js";import"./chunk-4EXYYBQ6.js";import{Fb as a,Hb as c,Lb as v,Mb as L,N as Me,Ob as Ze,Pb as m,Ta as ve,_ as ye,ma as we,ua as He}from"./chunk-VPL2NDH6.js";import"./chunk-7JESXDF2.js";import"./chunk-5Y7GIF2W.js";import"./chunk-T4M5CWAO.js";import"./chunk-PRVQAHWI.js";import"./chunk-UARVYVLN.js";import"./chunk-ULQG3XQS.js";import{f as X}from"./chunk-IU2ZQ6TE.js";import"./chunk-PIBY5DDZ.js";import{e as z,g as i}from"./chunk-VPRTJUIN.js";i();var Zo=z(tn(),1);i();i();i();i();var D="7e9cb568cfd431c538f36d1ad3f2b4f6";var ce="/auth/callback";function io(e){return`http://127.0.0.1:${e}${ce}`}function J(e){return`${D}::${e}`}function y(e){return e.length<=10?"***":`${e.slice(0,10)}***`}i();var Te;function Ne(){return Te??(Te=new je({projectName:"shopify-cli-store"})),Te}function w(e){return typeof e=="string"}function ao(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.id=="number")return{id:t.id,...w(t.email)?{email:t.email}:{},...w(t.firstName)?{firstName:t.firstName}:{},...w(t.lastName)?{lastName:t.lastName}:{},...typeof t.accountOwner=="boolean"?{accountOwner:t.accountOwner}:{}}}function un(e){if(!e||typeof e!="object")return;let t=e;if(!(!w(t.store)||!w(t.clientId)||!w(t.userId)||!w(t.accessToken)||!Array.isArray(t.scopes)||!t.scopes.every(w)||!w(t.acquiredAt)))return{store:t.store,clientId:t.clientId,userId:t.userId,accessToken:t.accessToken,scopes:t.scopes,acquiredAt:t.acquiredAt,...w(t.refreshToken)?{refreshToken:t.refreshToken}:{},...w(t.expiresAt)?{expiresAt:t.expiresAt}:{},...w(t.refreshTokenExpiresAt)?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...ao(t.associatedUser)?{associatedUser:ao(t.associatedUser)}:{}}}function _e(e,t){let o=J(e),n=t.get(o);if(!n||typeof n!="object")return;let{sessionsByUserId:r,currentUserId:u}=n;if(!r||typeof r!="object"||Array.isArray(r)||typeof u!="string"){t.delete(o);return}let d=Object.fromEntries(Object.entries(r).flatMap(([p,g])=>{let l=un(g);return l?[[p,l]]:[]}));if(Object.keys(d).length!==Object.keys(r).length)if(d[u])t.set(o,{currentUserId:u,sessionsByUserId:d});else{t.delete(o);return}return{currentUserId:u,sessionsByUserId:d}}function de(e,t=Ne()){let o=_e(e,t);if(!o)return;let n=o.sessionsByUserId[o.currentUserId];if(!n){t.delete(J(e));return}return n}function ue(e,t=Ne()){let o=J(e.store),n=_e(e.store,t),r={currentUserId:e.userId,sessionsByUserId:{...n?.sessionsByUserId??{},[e.userId]:e}};t.set(o,r)}function K(e,t,o){let n=typeof t=="string"?t:void 0,r=(typeof t=="string"?o:t)??Ne(),u=J(e);if(!n){r.delete(u);return}let d=_e(e,r);if(!d)return;let{[n]:p,...g}=d.sessionsByUserId,l=Object.keys(g);if(l.length===0){r.delete(u);return}r.set(u,{currentUserId:d.currentUserId===n?l[0]:d.currentUserId,sessionsByUserId:g})}i();function so(e,t=300){return e.slice(0,t)}async function co(e){let t=`https://${e.store}/admin/oauth/access_token`;m(c`Exchanging authorization code for token at ${a.raw(t)}`);let o=await xe(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:D,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),n=await o.text();if(!o.ok)throw m(c`Token exchange failed with HTTP ${a.raw(String(o.status))}: ${a.raw(so(n||o.statusText))}`),new s(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,n||o.statusText);let r;try{r=JSON.parse(n)}catch{throw new s("Received an invalid token response from Shopify.")}return m(c`Token exchange succeeded: access_token=${a.raw(y(r.access_token))}, refresh_token=${a.raw(r.refresh_token?y(r.refresh_token):"none")}, expires_in=${a.raw(String(r.expires_in??"unknown"))}s, user=${a.raw(String(r.associated_user?.id??"unknown"))} (${a.raw(r.associated_user?.email??"no email")})`),r}async function uo(e){let t=`https://${e.store}/admin/oauth/access_token`;m(c`Refreshing access token for ${a.raw(e.store)} using refresh_token=${a.raw(y(e.refreshToken))}`);let o=await xe(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:D,grant_type:"refresh_token",refresh_token:e.refreshToken})}),n=await o.text();if(!o.ok)throw m(c`Token refresh failed with HTTP ${a.raw(String(o.status))}: ${a.raw(so(n||o.statusText))}`),new s(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let r;try{r=JSON.parse(n)}catch{throw new s("Received an invalid refresh response from Shopify.")}if(!r.access_token)throw new s(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:r.access_token,refreshToken:r.refresh_token,expiresIn:r.expires_in,refreshTokenExpiresIn:r.refresh_token_expires_in}}var mn=`#graphql
|
|
1
|
+
import{a as Ae}from"./chunk-J5BRKYGE.js";import{a as ve,b as Zt}from"./chunk-BQWK3C47.js";import"./chunk-XWPPBOGF.js";import"./chunk-GJXINXSU.js";import{a as Io}from"./chunk-2GU7OY3H.js";import{a as Eo}from"./chunk-FQ5ZZX2G.js";import{a as so}from"./chunk-USLYL5AC.js";import{a as Ro}from"./chunk-UYSF234H.js";import{a as Ao}from"./chunk-OU4SKQTC.js";import{a as Do}from"./chunk-2GAFKG64.js";import{a as bo}from"./chunk-S22NCNAJ.js";import{a as xo}from"./chunk-FOFJBRSL.js";import{a as L,b as Ge,c as To}from"./chunk-M7YFD4EV.js";import{a as mo}from"./chunk-DCLUZFT7.js";import{a as po}from"./chunk-HCTZN7L4.js";import{a as _o}from"./chunk-Q7C44DX5.js";import{a as fo}from"./chunk-ZM75DSIW.js";import"./chunk-MMIHHCMW.js";import{a as go}from"./chunk-JLE4NBMT.js";import{a as So}from"./chunk-VRJTLVG3.js";import{a as Fo}from"./chunk-T4NS63K4.js";import{a as yo}from"./chunk-JSOGPMWB.js";import{a as ko}from"./chunk-YPBCSDFQ.js";import"./chunk-NWXDOCL5.js";import{a as wo}from"./chunk-G3RWLAOG.js";import{a as vo}from"./chunk-2TMQG2UT.js";import"./chunk-7572RLUP.js";import{a as no}from"./chunk-5FFHQTRC.js";import{a as ao}from"./chunk-PNP5OKNZ.js";import{a as io}from"./chunk-4FFPTEKD.js";import{a as No}from"./chunk-CEHXOWA6.js";import{a as co}from"./chunk-CV5EQGES.js";import"./chunk-5O43334U.js";import{a as we,b as uo}from"./chunk-EH7ZTFS4.js";import"./chunk-UOHNRH6E.js";import"./chunk-MINZGZ4N.js";import"./chunk-SSCYLDSX.js";import"./chunk-G2OHWAY2.js";import{a as an}from"./chunk-EVZA2TCI.js";import"./chunk-FIYAECXH.js";import"./chunk-G2LVUM7N.js";import"./chunk-AERKD4TO.js";import{a as sn}from"./chunk-AU5EZQW7.js";import"./chunk-M2YINBHF.js";import"./chunk-7LV55VWE.js";import"./chunk-UC7KMA6W.js";import"./chunk-ZUKLGZOU.js";import"./chunk-GWHV62YT.js";import"./chunk-JAWKLBOB.js";import"./chunk-T3ERXB7F.js";import"./chunk-I4R7TML2.js";import"./chunk-JEZ3PGVC.js";import"./chunk-N3CNWCC2.js";import"./chunk-57PPQKJT.js";import"./chunk-2XZBQZ5R.js";import"./chunk-2EHBJWC6.js";import"./chunk-DZQYG32N.js";import"./chunk-J3JPJCWP.js";import"./chunk-JK3NIHTX.js";import"./chunk-WHNWE7P2.js";import"./chunk-3YDYZ232.js";import"./chunk-KRZABRYT.js";import"./chunk-W7DDV2EY.js";import"./chunk-YMAWEIUR.js";import"./chunk-DTIWUT2T.js";import"./chunk-STJ3LWFL.js";import"./chunk-AVD3INWF.js";import"./chunk-MIDYZPO4.js";import{b as nn}from"./chunk-JUYJZUYU.js";import"./chunk-VJ6KDRZI.js";import"./chunk-TRYWVIVJ.js";import"./chunk-5XDQ76DQ.js";import"./chunk-TUNUEOHO.js";import"./chunk-AO3RFGNV.js";import"./chunk-N3YTDGFY.js";import"./chunk-RKDZGK5K.js";import"./chunk-WA3YC5W4.js";import"./chunk-RSRYC5ZF.js";import"./chunk-VE35YELD.js";import"./chunk-PMS4MNHB.js";import"./chunk-TU47HMTL.js";import"./chunk-25HJX3L2.js";import"./chunk-TYMYIUIQ.js";import"./chunk-LXVORHCQ.js";import"./chunk-6LWOWDF4.js";import"./chunk-YVQXEPHY.js";import"./chunk-ZI7LK3LW.js";import{a as Co}from"./chunk-LCZDC6EE.js";import{a as lo}from"./chunk-Q73GEVSJ.js";import"./chunk-FKIVKNOV.js";import{a as Qt}from"./chunk-UU5P2IYU.js";import{a as Wt}from"./chunk-PFGYC53K.js";import{a as Jt}from"./chunk-HIQHYPLU.js";import{a as qt}from"./chunk-WVRGCNBZ.js";import{a as to}from"./chunk-MRS6LAY7.js";import"./chunk-S7F5KFQP.js";import"./chunk-MEIEEENL.js";import{a as oo}from"./chunk-AXNAGI32.js";import{a as ho}from"./chunk-T4IV643Z.js";import{a as ro}from"./chunk-762JWOWJ.js";import"./chunk-I22ZTRKK.js";import"./chunk-A27NZMWB.js";import"./chunk-OZBY45KT.js";import"./chunk-EKVTNWHM.js";import"./chunk-5BKCIDMS.js";import"./chunk-AWEB5AQM.js";import{a as $t}from"./chunk-PXHY753L.js";import{a as Dt}from"./chunk-7D45IAMQ.js";import{a as Lt}from"./chunk-6KETAPWL.js";import"./chunk-N3NE4MVN.js";import{a as Rt}from"./chunk-5FVB7JHP.js";import"./chunk-ATSMK66C.js";import"./chunk-VUMUCNI7.js";import{a as Ut}from"./chunk-JAWOP4HJ.js";import"./chunk-OU3M32A2.js";import{a as Bt}from"./chunk-YSIBRY6C.js";import{a as Vt}from"./chunk-JJ6RM54S.js";import"./chunk-2RBIR3NM.js";import"./chunk-GCN4O7HM.js";import{a as _t}from"./chunk-YIRFEW5M.js";import{a as Ct}from"./chunk-2K7FGAT6.js";import{a as Pt}from"./chunk-G3JJLXPH.js";import{a as Gt}from"./chunk-TP7E54WN.js";import{a as Ft}from"./chunk-TY6BZTG3.js";import{a as zt}from"./chunk-KRQGLK2Q.js";import{a as Mt}from"./chunk-UB26DGTR.js";import{a as Ht}from"./chunk-33OHQUHZ.js";import{a as Oo}from"./chunk-3AOQKI4B.js";import{t as eo}from"./chunk-4QTEPWEJ.js";import"./chunk-S6B2ADVR.js";import"./chunk-YLQ3LNNY.js";import"./chunk-VJEKDBGZ.js";import{a as Yt,b as Kt,d as Xt}from"./chunk-UTO4Z6P6.js";import"./chunk-YL3TYQGT.js";import"./chunk-4J32OHLY.js";import"./chunk-IWOTLFOY.js";import"./chunk-F3TMLDLC.js";import{e as K}from"./chunk-CFOXXOO2.js";import"./chunk-A5HKAMAC.js";import{a as Po}from"./chunk-6JKGUQRD.js";import"./chunk-QDVJJKLB.js";import{a as mn}from"./chunk-BL46CZ2M.js";import{d as un}from"./chunk-5H3VTG77.js";import{a as jt}from"./chunk-Q77MM2N2.js";import{a as Et}from"./chunk-ZGJ3DFTQ.js";import{a as Ot}from"./chunk-DNXYKGV2.js";import"./chunk-JCIN73BE.js";import"./chunk-NILXAUUT.js";import"./chunk-E7DHELFH.js";import{G as H,P,ea as Z,fa as W,g as on,n as je,na as Ve,o as ge,pa as J,v as Se,z as N}from"./chunk-G4OQABDT.js";import"./chunk-ZDF5N422.js";import"./chunk-ANBOLDON.js";import"./chunk-HDC5V7RY.js";import"./chunk-MPW2YJWU.js";import{a as ze}from"./chunk-VPPWSKOY.js";import"./chunk-J3HX6ZGD.js";import{a as rn}from"./chunk-GDHD3TGC.js";import{a as It,b as v,c as A}from"./chunk-OXJBYKMX.js";import"./chunk-T7KHS6RF.js";import{c as be,d as dn}from"./chunk-L2PC4MUV.js";import{b as ye}from"./chunk-N5LVGFDS.js";import{b as te}from"./chunk-HOSFU6UP.js";import"./chunk-WW7TENNA.js";import{a as gt,c as X}from"./chunk-5C7HDTHJ.js";import{B as vt,C as ke,E as j,I as At,J as xt,P as Tt,u as kt,v as Y,y as wt}from"./chunk-NTRAWIEJ.js";import"./chunk-EJDWYASP.js";import"./chunk-7UNQOKZW.js";import"./chunk-GB3YC4TI.js";import"./chunk-RJ5VF3QY.js";import{d as St,e as yt}from"./chunk-VI34CKV6.js";import{c as bt,d as s,g as ee}from"./chunk-TPCG6DCA.js";import{a as oe,b as cn}from"./chunk-J3H4LPN6.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-XVUHUA36.js";import"./chunk-636CTEW7.js";import{r as me}from"./chunk-T6CC5WUU.js";import"./chunk-UQWFDL3F.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-ET2CGROE.js";import"./chunk-TOLPNBZK.js";import"./chunk-PCCK4YTE.js";import"./chunk-3SPDFV5D.js";import{Fb as d,Hb as m,Lb as w,Mb as b,N as lt,Ob as Nt,Pb as l,Qb as Be,Ta as He,W as ft,_ as ue,ma as Me,ua as ht}from"./chunk-7FQFEB33.js";import"./chunk-A4SBXDZB.js";import"./chunk-NJOO5XJV.js";import"./chunk-ZG7BVVT2.js";import"./chunk-2O22LZKV.js";import"./chunk-S5IFJ737.js";import"./chunk-NNOSZ447.js";import{f as he}from"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import{e as Q,g as i}from"./chunk-VKWPEFWQ.js";i();var en=Q(rn(),1);i();i();i();i();i();i();var _="7e9cb568cfd431c538f36d1ad3f2b4f6";var xe="/auth/callback";function Uo(e){return`http://127.0.0.1:${e}${xe}`}function re(e){return`${_}::${pn(e)}`}function pn(e){return e.replace(/\./g,"\\.")}function I(e){return e.length<=10?"***":`${e.slice(0,10)}***`}var Qe;function Te(){return Qe??(Qe=new ye({projectName:"shopify-cli-store"})),Qe}function S(e){return typeof e=="string"}function ln(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.id=="number")return{id:t.id,...S(t.email)?{email:t.email}:{},...S(t.firstName)?{firstName:t.firstName}:{},...S(t.lastName)?{lastName:t.lastName}:{},...typeof t.accountOwner=="boolean"?{accountOwner:t.accountOwner}:{}}}function fn(e){if(!e||typeof e!="object")return;let t=e;if(!(!S(t.shopId)||!S(t.name)||!S(t.createdAt)))return{shopId:t.shopId,name:t.name,createdAt:t.createdAt,...S(t.placeholderAccountUuid)?{placeholderAccountUuid:t.placeholderAccountUuid}:{},...S(t.country)?{country:t.country}:{},...S(t.accessUrl)?{accessUrl:t.accessUrl}:{}}}function hn(e){if(!e||typeof e!="object")return;let t=e;if(!S(t.store)||!S(t.clientId)||!S(t.userId)||!S(t.accessToken)||!Array.isArray(t.scopes)||!t.scopes.every(S)||!S(t.acquiredAt))return;let o=ln(t.associatedUser),r=t.kind==="preview"?"preview":"standard",n=r==="preview"?fn(t.preview):void 0;if(!(r==="preview"&&!n))return{store:t.store,clientId:t.clientId,userId:t.userId,accessToken:t.accessToken,scopes:t.scopes,acquiredAt:t.acquiredAt,...S(t.refreshToken)?{refreshToken:t.refreshToken}:{},...S(t.expiresAt)?{expiresAt:t.expiresAt}:{},...S(t.refreshTokenExpiresAt)?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function Lo(e,t,o){if(!t||typeof t!="object")return;let{sessionsByUserId:r,currentUserId:n}=t;if(!(r!==void 0||n!==void 0))return;let c=re(e);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(c);return}let u=Object.fromEntries(Object.entries(r).flatMap(([p,f])=>{let T=hn(f);return T?[[p,T]]:[]}));if(Object.keys(u).length!==Object.keys(r).length)if(u[n])o.set(c,{currentUserId:n,sessionsByUserId:u});else{o.delete(c);return}return{currentUserId:n,sessionsByUserId:u}}function We(e,t){return Lo(e,t.get(re(e)),t)}function gn(e){return e.config?.store??{}}function $o(e=Te()){let t=[],o=`${_}::`;for(let[r,n]of Object.entries(gn(e))){if(!r.startsWith(o))continue;let a=Lo(r.slice(o.length),n,e),c=a?.sessionsByUserId[a.currentUserId];c&&t.push(c)}return t}function ne(e,t=Te()){let o=We(e,t);if(!o)return;let r=o.sessionsByUserId[o.currentUserId];if(!r){t.delete(re(e));return}return r}function ie(e,t=Te()){let o=re(e.store),r=We(e.store,t),n={currentUserId:e.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[e.userId]:e}};t.set(o,n)}function ae(e,t,o){let r=typeof t=="string"?t:void 0,n=(typeof t=="string"?o:t)??Te(),a=re(e);if(!r){n.delete(a);return}let c=We(e,n);if(!c)return;let{[r]:u,...p}=c.sessionsByUserId,f=Object.keys(p);if(f.length===0){n.delete(a);return}n.set(a,{currentUserId:c.currentUserId===r?f[0]:c.currentUserId,sessionsByUserId:p})}function Je(e){return $o(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 qo(){return{sessions:Je().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}:{}}))}}i();i();var Sn=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function Ne(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Sn.format(t)}function _e(e){let t=L(e);if(t)return t.split(".")[0]}function zo(e,t){if(t==="json"){w(JSON.stringify(yn(e),null,2));return}kn(e)}function yn(e){return{sessions:e.sessions.map(Mo),...e.sessions.length===0?{message:Ho()}:{}}}function kn(e){if(e.sessions.length===0){b(Ho());return}ke({rows:e.sessions.map(Mo),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}function Mo(e){return{subdomain:_e(e.store)??e.store,connected:Ne(e.connectedAt)}}function Ho(){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 Ye,C=class extends te{async run(){let{flags:t}=await this.parse(Ye),o=qo();zo(o,t.json?"json":"text")}};Ye=C;C.hidden=!0;C.summary="List stores authenticated directly with store auth.";C.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`.";C.description=Ye.descriptionWithoutMarkdown();C.examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];C.flags={...v,...A};var jo=C;i();i();i();function Vo(e,t=300){return e.slice(0,t)}async function Bo(e){let t=`https://${e.store}/admin/oauth/access_token`;l(m`Exchanging authorization code for token at ${d.raw(t)}`);let o=await je(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:_,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw l(m`Token exchange failed with HTTP ${d.raw(String(o.status))}: ${d.raw(Vo(r||o.statusText))}`),new s(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,r||o.statusText);let n;try{n=JSON.parse(r)}catch{throw new s("Received an invalid token response from Shopify.")}return l(m`Token exchange succeeded: access_token=${d.raw(I(n.access_token))}, refresh_token=${d.raw(n.refresh_token?I(n.refresh_token):"none")}, expires_in=${d.raw(String(n.expires_in??"unknown"))}s, user=${d.raw(String(n.associated_user?.id??"unknown"))} (${d.raw(n.associated_user?.email??"no email")})`),n}async function Go(e){let t=`https://${e.store}/admin/oauth/access_token`;l(m`Refreshing access token for ${d.raw(e.store)} using refresh_token=${d.raw(I(e.refreshToken))}`);let o=await je(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:_,grant_type:"refresh_token",refresh_token:e.refreshToken})}),r=await o.text();if(!o.ok)throw l(m`Token refresh failed with HTTP ${d.raw(String(o.status))}: ${d.raw(Vo(r||o.statusText))}`),new s(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let n;try{n=JSON.parse(r)}catch{throw new s("Received an invalid refresh response from Shopify.")}if(!n.access_token)throw new s(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:n.access_token,refreshToken:n.refresh_token,expiresIn:n.expires_in,refreshTokenExpiresIn:n.refresh_token_expires_in}}var wn=`#graphql
|
|
2
3
|
query CurrentAppInstallationAccessScopes {
|
|
3
4
|
currentAppInstallation {
|
|
4
5
|
accessScopes {
|
|
@@ -6,7 +7,7 @@ import{a as ae}from"./chunk-E2YBU6D3.js";import{a as ie,b as At}from"./chunk-OKO
|
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
|
-
`;async function
|
|
10
|
+
`;async function Qo(e){l(m`Fetching current app installation scopes for ${d.raw(e.store)} using token ${d.raw(I(e.accessToken))}`);let t=await W({query:wn,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]:[])}i();i();function vn(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function Ke(e,t){return[[vn(e,t)]]}function Wo(e){throw new s(`No stored app authentication found for ${e}.`,"To create stored auth for this store, run:",Ke(e,"<comma-separated-scopes>"))}function V(e,t,o){throw new s(e,"To re-authenticate, run:",Ke(t,o))}function Jo(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:`,Ke(e,"<comma-separated-scopes>"))}import{timingSafeEqual as An}from"crypto";import{createServer as bn}from"http";function Yo(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>
|
|
10
11
|
<html lang="en">
|
|
11
12
|
<head>
|
|
12
13
|
<meta charset="utf-8" />
|
|
@@ -71,18 +72,38 @@ import{a as ae}from"./chunk-E2YBU6D3.js";import{a as ie,b as At}from"./chunk-OKO
|
|
|
71
72
|
<header class="header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 28" width="80" height="90"><path fill="#95BF47" fill-rule="evenodd" d="M17.836 27.059l-.062-23.736c-.16-.16-.472-.112-.594-.076l-.813.252a5.675 5.675 0 00-.39-.957c-.576-1.1-1.42-1.682-2.44-1.683h-.003c-.068 0-.136.006-.204.012h-.008a2.234 2.234 0 00-.092-.105C12.786.29 12.216.059 11.533.079c-1.318.038-2.63.99-3.693 2.679-.75 1.19-1.318 2.683-1.48 3.84L3.767 7.4c-.764.24-.788.263-.888.982C2.803 8.928.806 24.377.806 24.377l16.743 2.895.287-.213zM12.35 1.163a1.347 1.347 0 00-.792-.208c-2.033.06-3.807 3.235-4.26 5.352l1.949-.604.347-.107c.255-1.344.896-2.738 1.733-3.636a3.821 3.821 0 011.023-.797zm-1.793 4.135l2.796-.866c.009-.728-.07-1.805-.435-2.565-.388.16-.715.44-.95.691-.628.675-1.14 1.705-1.41 2.74zM14.23 4.16l1.299-.403c-.208-.674-.7-1.805-1.7-1.994.311.802.391 1.73.4 2.397z" clip-rule="evenodd"/><path fill="#5E8E3E" d="M21.587 5.088c-.099-.008-2.035-.037-2.035-.037s-1.619-1.573-1.778-1.733a.399.399 0 00-.225-.103v24.053l7.256-1.804S21.844 5.447 21.825 5.31a.263.263 0 00-.238-.222z"/><path fill="#fff" d="M13.528 8.824l-.843 3.153s-.94-.429-2.054-.358c-1.635.103-1.652 1.134-1.636 1.392.09 1.41 3.799 1.718 4.008 5.021.163 2.599-1.379 4.376-3.601 4.516-2.667.169-4.135-1.405-4.135-1.405l.565-2.404s1.478 1.115 2.66 1.04c.773-.048 1.05-.677 1.021-1.121-.116-1.84-3.137-1.731-3.328-4.754-.16-2.544 1.51-5.12 5.196-5.353 1.42-.09 2.147.273 2.147.273"/></svg></header>
|
|
72
73
|
<main class="card">
|
|
73
74
|
<h1>${o}</h1>
|
|
74
|
-
<p>${
|
|
75
|
+
<p>${r}</p>
|
|
75
76
|
</main>
|
|
76
77
|
</div>
|
|
77
78
|
</body>
|
|
78
|
-
</html>`}async function
|
|
79
|
+
</html>`}async function Ko({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:n}){let a=N(e);return new Promise((c,u)=>{let p=!1,f=!1,T=setTimeout(()=>{U(new s("Timed out waiting for OAuth callback."))},r),g=bn((k,h)=>{let Ue=new URL(k.url??"/",`http://127.0.0.1:${o}`);if(Ue.pathname!==xe){h.statusCode=404,h.end("Not found");return}let{searchParams:fe}=Ue,de=(qe,tn)=>{let pt=typeof qe=="string"?new s(qe,tn):qe;h.statusCode=400,h.setHeader("Content-Type","text/html"),h.setHeader("Connection","close"),h.once("finish",()=>U(pt)),h.end(Yo("Authentication failed",pt.message))},Le=fe.get("shop");if(l(m`Received OAuth callback for shop ${d.raw(Le??"unknown")}`),!Le){de("OAuth callback store does not match the requested store.");return}let dt=N(Le);if(dt!==a){de(Jo(dt));return}let ut=fe.get("state");if(!ut||!xn(ut,t)){de("OAuth callback state does not match the original request.");return}let mt=fe.get("error");if(mt){de(`Shopify returned an OAuth error: ${mt}`);return}let $e=fe.get("code");if(!$e){de("OAuth callback did not include an authorization code.");return}l(m`Received authorization code ${d.raw(I($e))}`),h.statusCode=200,h.setHeader("Content-Type","text/html"),h.setHeader("Connection","close"),h.once("finish",()=>y(()=>c($e))),h.end(Yo("Authentication succeeded","Close this window and return to the terminal"))}),y=k=>{if(p)return;p=!0,clearTimeout(T);let h=()=>{k()};if(!f){h();return}g.close(()=>{f=!1,h()}),g.closeIdleConnections?.()},U=k=>{y(()=>u(k))};g.on("error",k=>{if(k.code==="EADDRINUSE"){U(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}U(k)}),g.listen(o,"127.0.0.1",()=>{f=!0,l(m`PKCE callback server listening on http://127.0.0.1:${d.raw(String(o))}${d.raw(xe)}`),n&&Promise.resolve(n()).catch(k=>{U(k instanceof Error?k:new Error(String(k)))})})})}function xn(e,t){return e.length!==t.length?!1:An(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}i();import{createHash as Nn,randomBytes as _n}from"crypto";function In(){return _n(32).toString("base64url")}function En(e){return Nn("sha256").update(e).digest("base64url")}function On(e){let t=new URLSearchParams;return t.set("client_id",_),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function Xo(e){let{store:t,scopes:o,exchangeCodeForToken:r}=e,n=13387,a=X(),c=Uo(n),u=In(),p=En(u),f=On({store:t,scopes:o,state:a,redirectUri:c,codeChallenge:p});return l(m`Starting PKCE auth for ${d.raw(t)} with scopes ${d.raw(o.join(","))} (redirect_uri=${d.raw(c)})`),{authorization:{store:t,scopes:o,state:a,port:n,redirectUri:c,authorizationUrl:f,codeVerifier:u},waitForAuthCodeOptions:{store:t,state:a,port:n},exchangeCodeForToken:T=>r({store:t,code:T,codeVerifier:u,redirectUri:c})}}i();function Ze(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 lt(t)}function Xe(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 Zo(e,t){let o=[...t],r=Xe(t);for(let n of e)if(!r.has(n)){o.push(n);for(let a of Xe([n]))r.add(a)}return o}function er(e,t){if(!e.scope)return l(m`Token response did not include scope; falling back to requested scopes`),t;let o=Ze(e.scope),r=Xe(o),n=t.filter(a=>!r.has(a));if(n.length>0)throw new s("Shopify granted fewer scopes than were requested.",`Missing scopes: ${n.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}i();i();var Pn=240*1e3;function Cn(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Pn<Date.now()}function Fn(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 se(e){let t=ne(e);if(t||Wo(e),l(m`Loaded stored session for ${d.raw(e)}: token=${d.raw(I(t.accessToken))}, expires=${d.raw(t.expiresAt??"unknown")}`),!Cn(t))return t;t.refreshToken||V(`No refresh token stored for ${t.store}.`,t.store,t.scopes.join(",")),l(m`Refreshing expired token for ${d.raw(t.store)} (expired at ${d.raw(t.expiresAt??"unknown")}, refresh_token=${d.raw(I(t.refreshToken))})`);let o=t.accessToken,r;try{r=await Go({store:t.store,refreshToken:t.refreshToken})}catch(n){throw ae(t.store,t.userId),n instanceof s&&n.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&V(n.message,t.store,t.scopes.join(",")),n instanceof s&&n.message===`Token refresh returned an invalid response for ${t.store}.`&&V(n.message,t.store,t.scopes.join(",")),n instanceof s&&n.message==="Received an invalid refresh response from Shopify.",n}return t=Fn(t,r),l(m`Token refresh succeeded for ${d.raw(t.store)}: ${d.raw(I(o))} → ${d.raw(I(t.accessToken))}, new expiry ${d.raw(t.expiresAt??"unknown")}`),ie(t),t}function tr(e,t=300){return e.slice(0,t)}function Dn(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let n=typeof r=="string"?r:JSON.stringify(r);return tr(n?`HTTP ${o}: ${n}`:`HTTP ${o}`)}}return tr(e instanceof Error?e.message:String(e))}async function or(e){let t=N(e),o=ne(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await se(t),n=await Qo({store:r.store,accessToken:r.accessToken});return l(m`Resolved current remote scopes for ${d.raw(t)}: ${d.raw(n.join(",")||"none")}`),{scopes:n,authoritative:!0}}catch(r){if(r instanceof Error)return l(m`Falling back to locally stored scopes for ${d.raw(t)} after remote scope lookup failed: ${d.raw(Dn(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}i();function Rn(e){return JSON.stringify(e,null,2)}function Un(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 Ln(){b("Shopify CLI will open the app authorization page in your browser."),b("")}function $n(e){b("Browser did not open automatically. Open this URL manually:"),b(m`${d.link(e)}`),b("")}function qn(e,t="text"){if(t==="json"){w(Rn(e));return}let o=Un(e);o.completed.forEach(r=>Nt(r)),o.info.forEach(r=>b(r))}function Ie(e="text"){return{openingBrowser:Ln,manualAuthUrl:$n,success(t){qn(t,e)}}}i();async function E(e,t,o){await yt(()=>({store_fqdn:e})),await St(()=>({store_fqdn_hash:gt(e),store_fqdn_validated:t,store_domain:e,store_id:ft(o)}))}var zn={openURL:xt,waitForStoreAuthCode:Ko,exchangeStoreAuthCodeForToken:Bo,resolveExistingScopes:or,presenter:Ie("text")};async function rr(e,t={}){let o={...zn,...t},r=N(e.store);await E(r,!1);let n=Ze(e.scopes),a=await o.resolveExistingScopes(r),c=Zo(n,a.scopes),u=a.authoritative?c:n;a.scopes.length>0&&l(m`Merged requested scopes ${d.raw(n.join(","))} with existing scopes ${d.raw(a.scopes.join(","))} for ${d.raw(r)}`);let p=Xo({store:r,scopes:c,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:f}}=p;o.presenter.openingBrowser();let T=await o.waitForStoreAuthCode({...p.waitForAuthCodeOptions,onListening:async()=>{await o.openURL(f)||o.presenter.manualAuthUrl(f)}}),g=await p.exchangeCodeForToken(T);await E(r,!0);let y=g.associated_user?.id?.toString();if(!y)throw new s("Shopify did not return associated user information for the online access token.");H(y);let U=Date.now(),k=g.expires_in?new Date(U+g.expires_in*1e3).toISOString():void 0,h={store:r,userId:y,scopes:er(g,u),acquiredAt:new Date(U).toISOString(),expiresAt:k,refreshTokenExpiresAt:g.refresh_token_expires_in?new Date(U+g.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!g.refresh_token,associatedUser:g.associated_user?{id:g.associated_user.id,email:g.associated_user.email,firstName:g.associated_user.first_name,lastName:g.associated_user.last_name,accountOwner:g.associated_user.account_owner}:void 0};return ie({store:r,clientId:_,userId:y,accessToken:g.access_token,refreshToken:g.refresh_token,scopes:h.scopes,acquiredAt:h.acquiredAt,expiresAt:k,refreshTokenExpiresAt:h.refreshTokenExpiresAt,associatedUser:h.associatedUser}),l(m`Session persisted for ${d.raw(r)} (user ${d.raw(y)}, expires ${d.raw(k??"unknown")})`),o.presenter.success(h),h}i();var x=class extends te{};i();var Ee=Q(me(),1);function Mn(e){return Ee.Flags.string({description:"Two-letter country code for the store, such as US, CA, or GB.",env:e,required:!1,parse:async t=>t.trim().toUpperCase()})}function nr(e){return/^[A-Z]{2}$/.test(e)}var ir={country:Mn("SHOPIFY_FLAG_PREVIEW_STORE_COUNTRY")},F={store:Ee.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>N(e),required:!0}),"organization-id":Ee.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})};var ar=Q(me(),1),et,$=class extends x{async run(){let{flags:t}=await this.parse(et);await rr({store:t.store,scopes:t.scopes},{presenter:Ie(t.json?"json":"text")})}};et=$;$.summary="Authenticate an app against a store for store commands.";$.descriptionWithMarkdown=`Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
|
|
79
80
|
|
|
80
|
-
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;_.description=Fe.descriptionWithoutMarkdown();_.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"];_.flags={...F,...P,store:q.store,scopes:xo.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};var Ao=_;i();i();i();var bo={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"}}}],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"}}}],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"}}]}}]}}]};i();var To={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 Fn=2,Pn=300*1e3;function Dn(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 No(e){let t=await vt(e.organizationId?.toString()),o=await T(),n={type:"token_refresh",handler:async()=>({token:await T()})},u=(await B({query:bo,token:o,organizationId:t.id,variables:{shopName:e.name,priceLookupKey:"SHOPIFY_PLUS_APP_DEVELOPMENT",prepopulateTestData:!1},unauthorizedHandler:n})).createAppDevelopmentStore;if(!u)throw new s("Store creation failed: unexpected empty response.");let d=u.userErrors;if(d&&d.length>0){let l=d.map(x=>x.message).join(", ");throw new s(`Failed to create development store: ${l}`)}let{shopDomain:p,shopAdminUrl:g}=u;if(!p)throw new s("Store creation succeeded but no shop domain was returned.");await M({title:c`Waiting for store to be ready...`,task:async l=>{let x=Date.now();for(;;){if(Date.now()-x>Pn)throw new s("Store creation timed out after 5 minutes.");let k=(await B({query:To,token:o,organizationId:t.id,variables:{shopDomain:p},unauthorizedHandler:n})).organization?.storeCreation?.status;if(!k)throw new s("Unable to determine store creation status.");if(k==="COMPLETE")return;if(k==="FAILED"||k==="TIMED_OUT"||k==="USER_ERROR")throw new s(`Store creation failed with status: ${k}`);l(c`${Dn(k)}`),await Ke(Fn)}},renderOptions:{stdout:process.stderr}}),e.json?v(JSON.stringify({store:{name:e.name,domain:p,adminUrl:g},organization:{id:t.id,name:t.businessName}},null,2)):Q({headline:`Development store "${e.name}" created successfully.`,body:[`Domain: ${p}`,`Admin: ${g??"N/A"}`]})}var _o=z(ee(),1),Pe,E=class extends ne{async run(){let{flags:t}=await this.parse(Pe);try{await No({name:t.name,organizationId:t["organization-id"],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}}};Pe=E;E.hidden=!0;E.summary="Create a new development store.";E.descriptionWithMarkdown="Creates a new app development store in your organization.";E.description=Pe.descriptionWithoutMarkdown();E.flags={...F,...P,name:_o.Flags.string({description:"Name for the new development store.",required:!0,env:"SHOPIFY_FLAG_STORE_NAME"}),"organization-id":q["organization-id"]};var Eo=E;i();i();i();var Io=z(en(),1);async function qn(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 ve(e.queryFile))throw new s(c`Query file not found at ${a.path(e.queryFile)}. Please check the path and try again.`);let t=await we(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new s(c`Query file at ${a.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new H("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}async function $n(e,t){if(e)try{return JSON.parse(e)}catch(o){let n=o instanceof Error?o.message:"Unknown error";throw new s(c`Invalid JSON in ${a.yellow("--variables")} flag: ${n}`,"Please provide valid JSON format.")}else if(t){if(!await ve(t))throw new s(c`Variable file not found at ${a.path(t)}. Please check the path and try again.`);let o=await we(t,{encoding:"utf8"});try{return JSON.parse(o)}catch(n){let r=n instanceof Error?n.message:"Unknown error";throw new s(c`Invalid JSON in variable file ${a.path(t)}: ${r}`,"Please provide valid JSON format.")}}}function Ln(e){let t;try{t=(0,Io.parse)(e)}catch(n){throw n instanceof Error?new s(`Invalid GraphQL syntax: ${n.message}`):n}let o=t.definitions.filter(n=>n.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 Rn(e){return e.operationDefinition.operation==="mutation"}function Un(e,t=!1){if(Rn(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 Oo(e){let t=await qn({query:e.query,queryFile:e.queryFile}),o=Ln(t);Un(o,e.allowMutations);let n=await $n(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:n,requestedVersion:e.version}}i();i();i();var zn=`
|
|
81
|
+
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;$.description=et.descriptionWithoutMarkdown();$.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"];$.flags={...v,...A,store:F.store,scopes:ar.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};var sr=$;i();i();i();function B(e={}){return{type:"token_refresh",handler:async()=>({token:await Hn(e)})}}async function Hn(e){return P([],{noPrompt:e.noPrompt})}i();var cr={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"}}}],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"}}}],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"}}]}}]}}]};i();var dr={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 jn=2,Vn=300*1e3;function Bn(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 ur(e){let t=await Xt(e.organizationId?.toString()),o=await P(),r=B(),a=(await J({query:cr,token:o,organizationId:t.id,variables:{shopName:e.name,priceLookupKey:"SHOPIFY_PLUS_APP_DEVELOPMENT",prepopulateTestData:!1},unauthorizedHandler:r})).createAppDevelopmentStore;if(!a)throw new s("Store creation failed: unexpected empty response.");let c=a.userErrors;if(c&&c.length>0){let f=c.map(T=>T.message).join(", ");throw new s(`Failed to create development store: ${f}`)}let{shopDomain:u,shopAdminUrl:p}=a;if(!u)throw new s("Store creation succeeded but no shop domain was returned.");await j({title:m`Waiting for store to be ready...`,task:async f=>{let T=Date.now();for(;;){if(Date.now()-T>Vn)throw new s("Store creation timed out after 5 minutes.");let y=(await J({query:dr,token:o,organizationId:t.id,variables:{shopDomain:u},unauthorizedHandler:r})).organization?.storeCreation?.status;if(!y)throw new s("Unable to determine store creation status.");if(y==="COMPLETE")return;if(y==="FAILED"||y==="TIMED_OUT"||y==="USER_ERROR")throw new s(`Store creation failed with status: ${y}`);f(m`${Bn(y)}`),await Tt(jn)}},renderOptions:{stdout:process.stderr}}),e.json?w(JSON.stringify({store:{name:e.name,domain:u,adminUrl:p},organization:{id:t.id,name:t.businessName}},null,2)):Y({headline:`Development store "${e.name}" created successfully.`,body:[`Domain: ${u}`,`Admin: ${p??"N/A"}`]})}var mr=Q(me(),1),tt,q=class extends te{async run(){let{flags:t}=await this.parse(tt);try{await ur({name:t.name,organizationId:t["organization-id"],json:t.json})}catch(o){throw t.json&&o instanceof s&&(w(JSON.stringify({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1},null,2)),process.exit(1)),o}}};tt=q;q.hidden=!0;q.summary="Create a new development store.";q.descriptionWithMarkdown="Creates a new app development store in your organization.";q.description=tt.descriptionWithoutMarkdown();q.flags={...v,...A,name:mr.Flags.string({description:"Name for the new development store.",required:!0,env:"SHOPIFY_FLAG_STORE_NAME"}),"organization-id":F["organization-id"]};var pr=q;i();i();i();var Gn="X-Shopify-CLI-Instance",Qn="X-Shopify-CLI-Version",ot;function Wn(){return ot??(ot=new ye({projectName:"shopify-cli-store"})),ot}function rt(e=Wn()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=X();return e.set("cliInstanceId",o),o}function lr(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${ze}`,[Gn]:e,[Qn]:ze}}function Jn(e){return lr(e)}function fr(e,t){return{...lr(e),authorization:t,"X-Shopify-Access-Token":t}}async function hr(e,t={}){let r=`https://${await Se()}/services/preview-stores`,n=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await ge(r,{method:"POST",headers:Jn(rt(t.storage)),body:n}),c=await a.text();if(!a.ok){let p=Yn(a.status,c);throw new s(p.message,p.tryMessage)}let u;try{u=JSON.parse(c)}catch(p){let f=p instanceof Error?p.message:"Unknown error";throw new s("Preview store creation returned a non-JSON response.",`Parse error: ${f}. Body (truncated): ${Oe(c).slice(0,500)}`)}return Zn(u)}async function gr(e,t={}){let r=`https://${await Se()}/services/preview-stores/${encodeURIComponent(e.shopId)}/claim`,n=JSON.stringify({...e.email?{email:e.email}:{}}),a=await ge(r,{method:"POST",headers:fr(rt(t.storage),e.adminApiToken),body:n}),c=await a.text();if(!a.ok){let p=Kn(a.status,c);throw new s(p.message,p.tryMessage)}let u;try{u=JSON.parse(c)}catch(p){let f=p instanceof Error?p.message:"Unknown error";throw new s("Preview store claim URL request returned a non-JSON response.",`Parse error: ${f}. Body (truncated): ${Oe(c).slice(0,500)}`)}return ei(u)}async function Sr(e,t={}){let r=`https://${await Se()}/services/preview-stores/${e.shopId}`,n=await ge(r,{method:"GET",headers:fr(rt(t.storage),e.adminApiToken)}),a=await n.text();if(!n.ok){let u=Xn(n.status,a);throw new s(u.message,u.tryMessage)}let c;try{c=JSON.parse(a)}catch(u){let p=u instanceof Error?u.message:"Unknown error";throw new s("Preview store lookup returned a non-JSON response.",`Parse error: ${p}. Body (truncated): ${a.slice(0,500)}`)}return ti(c)}function Yn(e,t){let o=nt(t),r=o.error_code,n=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=Oe(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:n??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function nt(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 Kn(e,t){let o=nt(t),r=Oe(t);return{message:`Preview store claim URL request failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function Xn(e,t){let o=nt(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(t.length>0?t.slice(0,1e3):"No response body returned.")}}function Zn(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,n=typeof t?.domain=="string"?N(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,c=typeof e.access_url=="string"?e.access_url:void 0,u=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0;if(!o||!r||!n||!a||!c)throw new s("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(oi(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:n},adminApiToken:a,accessUrl:c,...u?{placeholderAccountUuid:u}:{}}}function ei(e){let t=typeof e.claim_url=="string"?e.claim_url:void 0;if(!t)throw new s("Preview store claim URL response is missing required fields.",`Got: ${JSON.stringify(ri(e)).slice(0,500)}`);return{claimUrl:t}}function ti(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,n=typeof t?.domain=="string"?N(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0;if(!o||!r||!n||!a)throw new s("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(ni(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:n},accessUrl:a}}function oi(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function ri(e){return{...e,...e.claim_url?{claim_url:"[REDACTED]"}:{}}}function Oe(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 ni(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{}}}var ii="preview:",ai={createPreviewStore:hr,setStoredStoreAppSession:ie,recordStoreFqdnMetadata:E,setLastSeenUserId:H,now:()=>new Date};async function yr(e,t={}){let o={...ai,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return ci(r,e.country,o)}function si(e){return`${ii}${e.placeholderAccountUuid??e.shop.id}`}async function ci(e,t,o){let r=o.now().toISOString(),n=si(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:_,userId:n,accessToken:e.adminApiToken,scopes:[],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(n);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:"Your Shopify store 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}}}i();function kr(e,t){if(t==="json"){w(JSON.stringify(di(e),null,2));return}ui(e)}function di(e){return{status:e.status,message:e.message,store:e.store,next_steps:wr(e).map(t=>t.json)}}function wr(e){return[{json:`Open your store (${e.store.storefrontUrl}) to preview the storefront.`,text:["Open ",{link:{label:"your store",url:e.store.storefrontUrl}}," 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 ui(e){Y({headline:"Store created",customSections:[{body:{tabularData:[["Name",e.store.name]],firstColumnSubdued:!0}},{body:e.message},{title:"Next steps",body:{list:{items:wr(e).map(t=>t.text)}}}]})}var vr=Q(me(),1),it,D=class extends x{async run(){let{flags:t}=await this.parse(it);t.country!==void 0&&!nr(t.country)&&this.error("Country must be a two-letter country code, for example: US.");let o=await j({title:m`Creating store…`,task:async()=>yr({name:t.name,country:t.country})});kr(o,t.json?"json":"text")}};it=D;D.hidden=!0;D.summary="Create a preview Shopify store.";D.descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";D.description=it.descriptionWithoutMarkdown();D.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'];D.flags={...v,...A,name:vr.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:ir.country};var Ar=D;i();i();i();var br=Q(on(),1);async function mi(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 He(e.queryFile))throw new s(m`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(m`Query file at ${d.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new ee("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}async function pi(e,t){if(e)try{return JSON.parse(e)}catch(o){let r=o instanceof Error?o.message:"Unknown error";throw new s(m`Invalid JSON in ${d.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(t){if(!await He(t))throw new s(m`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 n=r instanceof Error?r.message:"Unknown error";throw new s(m`Invalid JSON in variable file ${d.path(t)}: ${n}`,"Please provide valid JSON format.")}}}function li(e){let t;try{t=(0,br.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 fi(e){return e.operationDefinition.operation==="mutation"}function hi(e,t=!1){if(fi(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 xr(e){let t=await mi({query:e.query,queryFile:e.queryFile}),o=li(t);hi(o,e.allowMutations);let r=await pi(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}i();i();i();i();function Pe(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Tr(e){if(!Pe(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Nr=["the user aborted a request","the operation was aborted"];function gi(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Nr.some(o=>t.includes(o))}function pe(e,t){if(Tr(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(gi(e))return new s(`Request to ${t} was aborted before it completed.`)}function Ce(e,t){let o=Tr(e);o!==401&&o!==404||(ae(t.store,t.userId),V(`Stored app authentication for ${t.store} is no longer valid.`,t.store,t.scopes.join(",")))}var Si=`
|
|
81
82
|
query StoreExecutePublicApiVersions {
|
|
82
83
|
publicApiVersions {
|
|
83
84
|
handle
|
|
84
85
|
supported
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
`;async function Co(e){try{return(await G({query:zn,api:"Admin",url:Y(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){let o=Po(t);(o===401||o===404)&&(K(e.session.store,e.session.userId),R(`Stored app authentication for ${e.session.store} is no longer valid.`,e.session.store,e.session.scopes.join(",")));let n=Do(t,e.adminSession.storeFqdn);throw n||t}}async function Fo(e){try{return await M({title:c`Executing GraphQL operation`,task:async()=>G({query:e.request.query,api:"Admin",url:Y(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){De(t)&&t.response.status===401&&(K(e.context.session.store,e.context.session.userId),R(`Stored app authentication for ${e.context.session.store} is no longer valid.`,e.context.session.store,e.context.session.scopes.join(",")));let o=Do(t,e.context.adminSession.storeFqdn);throw o||(De(t)&&t.response.errors?new s("GraphQL operation failed.",JSON.stringify({errors:t.response.errors},null,2)):t)}}function De(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Po(e){if(!De(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Mn=["the user aborted a request","the operation was aborted"];function Hn(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Mn.some(o=>t.includes(o))}function Do(e,t){if(Po(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(Hn(e))return new s(`Request to ${t} was aborted before it completed.`)}async function Vn(e){let{session:t,adminSession:o,userSpecifiedVersion:n}=e;if(n==="unstable")return n;let r=await Co({adminSession:o,session:t});if(!n)return r.filter(p=>p.supported).map(p=>p.handle).sort().reverse()[0];let u=r.map(d=>d.handle);if(u.includes(n))return n;throw new s(`Invalid API version: ${n}`,`Allowed versions: ${u.join(", ")}`)}async function qo(e){let t=await me(e.store);await U(t.store,!0),oe(t.userId);let o={token:t.accessToken,storeFqdn:t.store},n=await Vn({session:t,adminSession:o,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:o,version:n,session:t}}var jn={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>qo({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>Fo({context:e,request:t})};function $o(e){if(e==="admin")return jn;throw new H(`Unsupported store GraphQL API target: ${e}`)}async function Lo(e){await U(e.store,!1);let t=$o(e.api??"admin"),o=await Oo({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),n=await M({title:c`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:n,request:o})}i();function Gn(e){return JSON.stringify(e,null,2)}function Ro(e){if(e){Q({headline:"Operation succeeded.",body:`Results written to ${e}`});return}Q({headline:"Operation succeeded."})}async function Uo(e,t,o="text"){let n=Gn(e);if(t){await He(t,n),o==="text"&&Ro(t);return}o==="text"&&Ro(),v(n)}var $=z(ee(),1),qe,I=class extends N{async run(){let{flags:t}=await this.parse(qe),o=await Lo({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 Uo(o,t["output-file"],t.json?"json":"text")}};qe=I;I.summary="Execute GraphQL queries and mutations on a store.";I.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.";I.description=qe.descriptionWithoutMarkdown();I.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'];I.flags={...F,...P,query:$.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":$.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=>X(e),exactlyOne:["query","query-file"]}),variables:$.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":$.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 e=>X(e),exclusive:["variables"]}),store:q.store,version:$.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":$.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async e=>X(e)}),"allow-mutations":$.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var zo=I;i();i();i();i();var Mo={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"}}]}}]}}]};i();var Ho={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"}}]}}]}}]};async function Vo(e){let t=e.token??await T(),o={type:"token_refresh",handler:async()=>({token:await T()})},n=W(e.store)??e.store.toLowerCase(),r=n.split(".")[0]??n,p=((await be({query:Mo,token:t,variables:{search:r},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(l=>Qn(l,n));if(!p)throw new s(`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 g=await Bn(String(p.publicId),t,o);return{...g?{owningOrg:g}:{}}}async function Bn(e,t,o){try{let r=(await be({query:Ho,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!r){m(`No owning organization returned for destination ${e}.`);return}let u=r.id?wt(r.id):void 0;return{name:r.name,...u?{id:u}:{}}}catch(n){m(`Failed to resolve owning organization: ${Yn(n)}`);return}}function Qn(e,t){return[e.primaryDomain,e.webUrl].some(o=>W(o)===t)}function Yn(e){return e instanceof Error?e.message:String(e)}i();i();var jo={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 Go(e){let t=e.token??await T(),o={type:"token_refresh",handler:async()=>({token:await T()})},r=(await B({query:jo,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],u=e.store.toLowerCase(),d=r.map(p=>p.node).find(p=>W(p.primaryDomain)===u);if(!d)throw new H(`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{shopifyShopId:d.shopifyShopId??void 0,name:d.name,primaryDomain:d.primaryDomain??void 0,storeType:d.storeType??void 0,developerPreviewHandle:d.developerPreviewHandle??void 0,planName:d.planName??void 0,ownerName:d.ownerDetails?.fullName??void 0,ownerEmail:d.ownerDetails?.email??void 0}}i();var Wn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};function Bo(e){if(e)return Wn[e.toLowerCase()]}async function Qo(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=await Vo({store:t}),n=await Jn(o,t);return Kn({store:t,destinationsCtx:o,orgShop:n})}async function Jn(e,t){if(!e.owningOrg?.id){m("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await Go({store:t,organizationId:e.owningOrg.id})}catch(o){m(`BP Organizations shop lookup failed: ${o instanceof Error?o.message:String(o)}`);return}}function Kn(e){let{store:t,destinationsCtx:o,orgShop:n}=e,r={id:Zn(n?.shopifyShopId),displayName:n?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:Xn(n),type:or(n?.storeType),plan:Bo(n?.planName),featurePreview:n?.developerPreviewHandle,adminUrl:er(xt(t))};return{...Ae(r),subdomain:t}}function Zn(e){if(e)return`gid://shopify/Shop/${e}`}function Xn(e){if(!e)return;let t=Ae({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function er(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}var tr={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client_transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function or(e){if(e)return tr[e]}i();function Yo(e,t){if(t==="json"){v(JSON.stringify(e,null,2));return}Qe({customSections:[{title:"Store details",body:{list:{items:nr(e)}}}]})}function nr(e){let t=[];return O(t,"ID",e.id),O(t,"Display Name",e.displayName),O(t,"Subdomain",e.subdomain),O(t,"Organization",e.organizationName),O(t,"Store owner",rr(e.storeOwner)),O(t,"Type",e.type?ye(e.type):void 0),O(t,"Plan",e.plan?ye(e.plan):void 0),O(t,"Feature Preview",e.featurePreview),O(t,"Admin URL",e.adminUrl),t}function rr(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function O(e,t,o){o&&e.push(`${t}: ${o}`)}var $e,C=class extends N{async run(){let{flags:t}=await this.parse($e),o=await Qo({store:t.store});Yo(o,t.json?"json":"text")}};$e=C;C.summary="Surface metadata about a Shopify store.";C.descriptionWithMarkdown="Returns metadata about a store you have access to: id, display name, subdomain, organization, store owner, type, plan, feature preview, and admin URL.\n\nUse `--json` for machine-readable output.";C.description=$e.descriptionWithoutMarkdown();C.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];C.flags={...F,...P,store:q.store};var Wo=C;var ir={"store:auth":Ao,"store:create:dev":Eo,"store:execute":zo,"store:info":Wo},le=ir;i();i();var ar=async e=>{bt(),process.env.COMMAND_RUN_ID=te()},Jo=ar;var fe={"app:build":Tt,"app:bulk:cancel":Nt,"app:bulk:status":_t,"app:deploy":Ft,"app:dev":Pt,"app:dev:clean":to,"app:logs":Dt,"app:logs:sources":qt,"app:import-custom-data-definitions":no,"app:import-extensions":Bt,"app:info":Qt,"app:init":Yt,"app:config:validate":Wt,"app:release":Jt,"app:config:link":Et,"app:config:use":It,"app:config:pull":Ot,"app:env:pull":$t,"app:env:show":Lt,"app:execute":Ut,"app:bulk:execute":Rt,"app:function:build":zt,"app:function:replay":Mt,"app:function:run":Ht,"app:function:info":oo,"app:function:schema":Vt,"app:function:typegen":jt,"app:generate:extension":Gt,"app:versions:list":Kt,"app:webhook:trigger":Zt,"demo:watcher":Ct,"organization:list":ro},sr=eo,cr=Jo,dr=Xt;import ur from"fs";var Cd=At.init;(0,Zo.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof We?Ye(e):ur.writeSync(process.stderr.fd,`${e.stack??e.message??e}
|
|
88
|
-
|
|
88
|
+
`;async function _r(e){try{return(await W({query:Si,api:"Admin",url:K(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){Ce(t,e.session);let o=pe(t,e.adminSession.storeFqdn);throw o||t}}async function Ir(e){try{return await j({title:m`Executing GraphQL operation`,task:async()=>W({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){Pe(t)&&t.response.status===401&&(ae(e.context.session.store,e.context.session.userId),V(`Stored app authentication for ${e.context.session.store} is no longer valid.`,e.context.session.store,e.context.session.scopes.join(",")));let o=pe(t,e.context.adminSession.storeFqdn);throw o||(Pe(t)&&t.response.errors?new s("GraphQL operation failed.",JSON.stringify({errors:t.response.errors},null,2)):t)}}async function yi(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let n=await _r({adminSession:o,session:t});if(!r)return n.filter(u=>u.supported).map(u=>u.handle).sort().reverse()[0];let a=n.map(c=>c.handle);if(a.includes(r))return r;throw new s(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function Er(e){let t=await se(e.store);await E(t.store,!0),H(t.userId);let o={token:t.accessToken,storeFqdn:t.store},r=await yi({session:t,adminSession:o,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:o,version:r,session:t}}var ki={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>Er({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>Ir({context:e,request:t})};function Or(e){if(e==="admin")return ki;throw new ee(`Unsupported store GraphQL API target: ${e}`)}async function Pr(e){await E(e.store,!1);let t=Or(e.api??"admin"),o=await xr({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await j({title:m`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:r,request:o})}i();function wi(e){return JSON.stringify(e,null,2)}function Cr(e){if(e){Y({headline:"Operation succeeded.",body:`Results written to ${e}`});return}Y({headline:"Operation succeeded."})}async function Fr(e,t,o="text"){let r=wi(e);if(t){await ht(t,r),o==="text"&&Cr(t);return}o==="text"&&Cr(),w(r)}var G=Q(me(),1),at,z=class extends x{async run(){let{flags:t}=await this.parse(at),o=await Pr({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 Fr(o,t["output-file"],t.json?"json":"text")}};at=z;z.summary="Execute GraphQL queries and mutations on a store.";z.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.";z.description=at.descriptionWithoutMarkdown();z.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'];z.flags={...v,...A,query:G.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":G.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=>he(e),exactlyOne:["query","query-file"]}),variables:G.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":G.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 e=>he(e),exclusive:["variables"]}),store:F.store,version:G.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":G.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async e=>he(e)}),"allow-mutations":G.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var Dr=z;i();i();i();i();var Rr={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"}}]}}]}}]};i();var Ur={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 Lr(e){let t=e.token??await P([],{noPrompt:e.noPrompt}),o=B({noPrompt:e.noPrompt}),r=L(e.store)??e.store.toLowerCase(),n=r.split(".")[0]??r,u=((await Ve({query:Rr,token:t,variables:{search:n},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(f=>Ai(f,r));if(!u)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 vi(String(u.publicId),t,o);return{...p?{owningOrg:p}:{}}}async function vi(e,t,o){try{let n=(await Ve({query:Ur,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!n){l(`No owning organization returned for destination ${e}.`);return}let a=n.id?Yt(n.id):void 0;return{name:n.name,...a?{id:a}:{}}}catch(r){l(`Failed to resolve owning organization: ${bi(r)}`);return}}function Ai(e,t){return[e.primaryDomain,e.webUrl].some(o=>L(o)===t)}function bi(e){return e instanceof Error?e.message:String(e)}i();i();var $r={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 qr(e){let t=e.token??await P([],{noPrompt:e.noPrompt}),o=B({noPrompt:e.noPrompt}),n=(await J({query:$r,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),c=n.map(u=>u.node).find(u=>L(u.primaryDomain)===a);if(!c)throw new ee(`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{shopifyShopId:c.shopifyShopId??void 0,name:c.name,primaryDomain:c.primaryDomain??void 0,storeType:c.storeType??void 0,developerPreviewHandle:c.developerPreviewHandle??void 0,planName:c.planName??void 0,ownerName:c.ownerDetails?.fullName??void 0,ownerEmail:c.ownerDetails?.email??void 0}}i();var xi={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};function zr(e){if(e)return xi[e.toLowerCase()]}i();var Ti={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client_transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function Fe(e){if(e)return Ti[e]}function Mr(e){return e?ue(e):""}var Ni=`#graphql
|
|
89
|
+
query StoreInfoAdminShop {
|
|
90
|
+
shop {
|
|
91
|
+
id
|
|
92
|
+
name
|
|
93
|
+
myshopifyDomain
|
|
94
|
+
email
|
|
95
|
+
shopOwnerName
|
|
96
|
+
plan {
|
|
97
|
+
publicDisplayName
|
|
98
|
+
partnerDevelopment
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`;async function Hr(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=ne(t);if(Oi(o)){await E(o.store,!0,o.preview.shopId);let n=await Pi(o);return $i({store:t,previewSession:o,previewStoreUrls:n})}let r=!!o;try{return await Ii(t,{noPrompt:r})}catch(n){if(!r||!Fi(n))throw n;return l(`BP store info lookup failed; falling back to stored store auth: ${Ri(n)}`),_i(t)}}async function _i(e){let t=await se(e);await E(t.store,!0),H(t.userId);let o=await Ei(t);return Ui({store:t.store,shop:o})}async function Ii(e,t={}){let o=await Lr({store:e,noPrompt:t.noPrompt}),r=await Ci(o,e,{noPrompt:t.noPrompt});return Li({store:e,destinationsCtx:o,orgShop:r})}async function Ei(e){try{let t=await W({query:Ni,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){Ce(t,e);let o=pe(t,e.store);throw o||t}}function Oi(e){return e?.kind==="preview"&&e.preview!==void 0}async function Pi(e){let t={shopId:e.preview.shopId,adminApiToken:e.accessToken},[o,r]=await Promise.all([gr(t),Sr(t)]);return{accessUrl:r.accessUrl,saveUrl:o.claimUrl}}async function Ci(e,t,o={}){if(!e.owningOrg?.id){l("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await qr({store:t,organizationId:e.owningOrg.id,noPrompt:o.noPrompt})}catch(r){l(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function Fi(e){return e instanceof le||Di(e)}function Di(e){return e instanceof s&&e.message.includes("unable to prompt for reauthentication")}function Ri(e){return e instanceof Error?e.message:String(e)}function Ui(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,n={id:o.id,displayName:o.name,storeOwner:qi(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:Vr(Ge(r))};return{...Z(n),subdomain:r}}function Li(e){let{store:t,destinationsCtx:o,orgShop:r}=e,n={id:jr(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:zi(r),type:Fe(r?.storeType),plan:zr(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:Vr(Ge(t))};return{...Z(n),subdomain:t}}function $i(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,n={id:jr(o.preview.shopId),displayName:o.preview.name,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...Z(n),subdomain:t}}function jr(e){if(e)return`gid://shopify/Shop/${e}`}function qi(e){let t=Z({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function zi(e){if(!e)return;let t=Z({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function Vr(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}i();function Br(e,t){if(t==="json"){w(JSON.stringify(e,null,2));return}kt({customSections:[{title:"Store details",body:{list:{items:Mi(e)}}}]})}function Mi(e){let t=[];return O(t,"ID",e.id),O(t,"Display Name",e.displayName),O(t,"Subdomain",e.subdomain),O(t,"Organization",e.organizationName),O(t,"Store owner",Hi(e.storeOwner)),O(t,"Type",e.type?ue(e.type):void 0),O(t,"Plan",e.plan?ue(e.plan):void 0),O(t,"Feature Preview",e.featurePreview),O(t,"Admin URL",e.adminUrl),O(t,"Access URL",e.accessUrl),O(t,"Save URL",e.saveUrl),t}function Hi(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function O(e,t,o){o&&e.push(`${t}: ${o}`)}var st,M=class extends x{async run(){let{flags:t}=await this.parse(st),o=await Hr({store:t.store});Br(o,t.json?"json":"text")}};st=M;M.summary="Surface metadata about a Shopify store.";M.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.
|
|
103
|
+
|
|
104
|
+
Some details may be omitted when they are not available for the store.
|
|
105
|
+
|
|
106
|
+
Use \`--json\` for machine-readable output.`;M.description=st.descriptionWithoutMarkdown();M.examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];M.flags={...v,...A,store:F.store};var Gr=M;i();i();i();i();i();var Qr={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 Wr(e){let{entries:t,hasMore:o}=await ji(e.token,e.organization);return{entries:t.sort(Bi),hasMore:o}}async function ji(e,t){let o=B(),n=(await J({query:Qr,token:e,organizationId:t.id,variables:{first:250},unauthorizedHandler:o})).organization?.accessibleShops;if(!n)return{entries:[],hasMore:!1};let a=[];for(let c of n.edges){let u=Vi(c.node,t);u&&a.push(u)}return{entries:a,hasMore:n.pageInfo.hasNextPage}}function Vi(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:L(o)??o,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:Fe(e.storeType)}}function Bi(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function Jr(e={}){let t=await P(),o=await Kt(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&&!At())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 Gi(o.organizations,e.organizationId),n=await Wr({token:t,organization:r}),{stores:a,truncated:c}=Wi(n.entries,n.hasMore);return{stores:a,source:"organization",organization:Qi(r),...c?{truncated:!0}:{}}}async function Gi(e,t){if(t){let a=e.find(c=>c.id===t.toString());if(!a)throw new s(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(c=>`${c.businessName} (${c.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,n=await vt({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===n)}function Qi(e){return{id:e.id,name:e.businessName}}function Wi(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}i();function Yr(e,t){if(e.notice&&Be(e.notice),e.truncated&&Be(Ji(e)),t==="json"){w(JSON.stringify({stores:e.stores,...e.organization?{organization:e.organization}:{},...e.notice?{notice:e.notice}:{},...e.truncated?{truncated:!0}:{}},null,2));return}Yi(e)}function Ji(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent stores${t}. More stores exist.`}function Yi(e){if(e.stores.length===0){b(Xi(e));return}e.organization&&b(`Organization: ${e.organization.name} (${e.organization.id})`),Ki(e.stores),b("To list stores authenticated directly with `shopify store auth`, run `shopify store auth list`.")}function Ki(e){ke({rows:e.map(t=>({subdomain:Zi(t.store),name:t.name??"",type:Mr(t.type),created:Ne(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},created:{header:"Created"}}})}function Xi(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(`
|
|
107
|
+
`):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(`
|
|
108
|
+
`)}function Zi(e){return _e(e)??e}var ct,R=class extends x{async run(){let{flags:t}=await this.parse(ct),o=await Jr({organizationId:t["organization-id"]});Yr(o,t.json?"json":"text")}};ct=R;R.hidden=!0;R.summary="List stores in a Shopify organization.";R.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`.\nIn non-interactive environments, `--organization-id` is required.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";R.description=ct.descriptionWithoutMarkdown();R.examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --json"];R.flags={...v,...A,"organization-id":F["organization-id"]};var Kr=R;var ea={"store:auth:list":jo,"store:auth":sr,"store:create:dev":pr,"store:create:preview":Ar,"store:execute":Dr,"store:info":Gr,"store:list":Kr},De=ea;i();i();var ta=async e=>{eo(),process.env.COMMAND_RUN_ID=X()},Xr=ta;var Re={"app:build":to,"app:bulk:cancel":oo,"app:bulk:status":ro,"app:deploy":co,"app:dev":uo,"app:dev:clean":Co,"app:logs":mo,"app:logs:sources":po,"app:import-custom-data-definitions":Do,"app:import-extensions":bo,"app:info":xo,"app:init":To,"app:config:validate":No,"app:release":_o,"app:config:link":no,"app:config:use":io,"app:config:pull":ao,"app:env:pull":lo,"app:env:show":fo,"app:execute":go,"app:bulk:execute":ho,"app:function:build":So,"app:function:replay":yo,"app:function:run":ko,"app:function:info":Fo,"app:function:schema":wo,"app:function:typegen":vo,"app:generate:extension":Ao,"app:versions:list":Io,"app:webhook:trigger":Eo,"demo:watcher":so,"organization:list":Ro},oa=Po,ra=Xr,na=Oo;import ia from"fs";var Pl=Zt.init;(0,en.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof bt?wt(e):ia.writeSync(process.stderr.fd,`${e.stack??e.message??e}
|
|
109
|
+
`),process.exit(1)});var aa=["SIGINT","SIGTERM","SIGQUIT"];aa.forEach(e=>{process.on(e,()=>{process.exit(1)})});var Zr=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(Zr)||(process.stdout.columns=Zr);async function sa({development:e}){await It({moduleURL:import.meta.url,development:e})}oe.plugins.hidden=!0;oe["plugins:install"].description="";var ca=Object.keys(Re);ca.forEach(e=>{Re[e].customPluginName="@shopify/app"});var da=Object.keys(we);da.forEach(e=>{we[e].customPluginName="@shopify/theme"});var ua=Object.keys(ve);ua.forEach(e=>{ve[e].customPluginName="@shopify/cli-hydrogen"});var ma=Object.keys(De);ma.forEach(e=>{De[e].customPluginName="@shopify/store"});var pa=Object.keys(Ae);pa.forEach(e=>{Ae[e].customPluginName="@oclif/plugin-commands"});var la=Object.keys(be);la.forEach(e=>{be[e].customPluginName="@shopify/plugin-did-you-mean"});var fa=Object.keys(oe);fa.forEach(e=>{oe[e].customPluginName="@oclif/plugin-plugins"});var Cl={...Re,...we,...oe,...be,...Ae,...ve,...De,search:Et,upgrade:Ot,version:_t,help:jt,"auth:logout":Pt,"auth:login":Ct,"debug:command-flags":Ft,"kitchen-sink":Lt,"kitchen-sink:async":Dt,"kitchen-sink:prompts":Rt,"kitchen-sink:static":Ut,"doctor-release":$t,"doctor-release:theme":qt,"doc:fetch":zt,"doc:search":Mt,"docs:generate":Ht,"notifications:list":Vt,"notifications:generate":Bt,"cache:clear":Gt,"config:autoupgrade:off":Qt,"config:autoupgrade:on":Wt,"config:autoupgrade:status":Jt},Fl=sa;export{ra as AppInitHook,na as AppPublicMetadataHook,oa as AppSensitiveMetadataHook,Cl as COMMANDS,dn as DidYouMeanHook,Pl as HydrogenInitHook,cn as PluginHook,un as TunnelProviderHook,mn as TunnelStartHook,Fl as default,nn as fetchStoreThemes,an as pull,sn as push};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ab as c,Bb as d,Cb as e,yb as a,zb as b}from"./chunk-7FQFEB33.js";import"./chunk-A4SBXDZB.js";import"./chunk-NJOO5XJV.js";import"./chunk-ZG7BVVT2.js";import"./chunk-2O22LZKV.js";import"./chunk-S5IFJ737.js";import"./chunk-NNOSZ447.js";import"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as currentProcessIsGlobal,e as getProjectDir,d as inferPackageManagerForGlobalCLI,c as installGlobalCLIPrompt,b as installGlobalShopifyCLI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r}from"./chunk-
|
|
1
|
+
import{g as r}from"./chunk-VKWPEFWQ.js";r();import f from"node:process";import d from"node:os";import s from"node:fs";r();import l from"node:fs";r();import i from"node:fs";var t;function u(){try{return i.statSync("/.dockerenv"),!0}catch{return!1}}function a(){try{return i.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function n(){return t===void 0&&(t=u()||a()),t}var o,m=()=>{try{return l.statSync("/run/.containerenv"),!0}catch{return!1}};function e(){return o===void 0&&(o=m()||n()),o}var c=()=>{if(f.platform!=="linux")return!1;if(d.release().toLowerCase().includes("microsoft"))return!e();try{if(s.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!e()}catch{}return s.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||s.existsSync("/run/WSL")?!e():!1},I=f.env.__IS_WSL_TEST__?c:c();export{I as default};
|