shopify 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-QFDTQYPM.js +1 -0
- package/dist/analytics-XADBBHOH.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/chunk-24Q6X53V.js +1 -0
- package/dist/{chunk-LEHBZKK3.js → chunk-25MYHE4W.js} +1 -1
- package/dist/{chunk-TODZ3TJR.js → chunk-27JT4NA4.js} +1 -1
- package/dist/chunk-2BYW3BYX.js +1 -0
- package/dist/chunk-2KFYIYLI.js +1 -0
- package/dist/{chunk-D2KIGKBI.js → chunk-2KUM2RU4.js} +60 -60
- package/dist/chunk-2PD7TNFS.js +275 -0
- package/dist/{chunk-64G5TGFF.js → chunk-3C72S6LO.js} +1 -1
- package/dist/chunk-3FZ4LE6A.js +10 -0
- package/dist/{chunk-3MYDSQHF.js → chunk-3GD5ESWN.js} +1 -1
- package/dist/chunk-3KGN6N7E.js +1 -0
- package/dist/{chunk-KNWT7JLL.js → chunk-3MZ7ELHS.js} +2 -2
- package/dist/{chunk-PF53E2DC.js → chunk-3PS52ZT4.js} +1 -1
- package/dist/chunk-3PYDIBTX.js +1 -0
- package/dist/chunk-3Z75BVGJ.js +1 -0
- package/dist/chunk-4FWPOGPQ.js +1 -0
- package/dist/chunk-4IP37MBX.js +1 -0
- package/dist/chunk-4NFX7YCT.js +1 -0
- package/dist/chunk-4TCXPHKN.js +1 -0
- package/dist/chunk-4WBWZIN5.js +6 -0
- package/dist/chunk-5534MHZW.js +97 -0
- package/dist/{chunk-UKWIWCOH.js → chunk-5C6CXU74.js} +1 -1
- package/dist/{chunk-QEKGGTMN.js → chunk-5HOZDOJ7.js} +1 -1
- package/dist/{chunk-ER6C5WS3.js → chunk-5PSQFQL6.js} +1 -1
- package/dist/chunk-5T3ZT6CC.js +1 -0
- package/dist/chunk-62NW4EPI.js +17 -0
- package/dist/chunk-65NCQJYR.js +1 -0
- package/dist/{chunk-IHXGZW42.js → chunk-6BYHL3DS.js} +1 -1
- package/dist/chunk-6I7DT7QR.js +3 -0
- package/dist/chunk-6IMTMS2S.js +3 -0
- package/dist/chunk-7A77JCED.js +11 -0
- package/dist/chunk-7ART2IKU.js +1 -0
- package/dist/{chunk-I4CEH7AK.js → chunk-7BPT5V24.js} +2 -2
- package/dist/{chunk-Z2WAW6MM.js → chunk-7CT3NIXI.js} +1 -1
- package/dist/chunk-7DBKSSDK.js +1 -0
- package/dist/chunk-7HECBXSP.js +1 -0
- package/dist/chunk-7KID5BIR.js +4 -0
- package/dist/{chunk-2L6AN3QA.js → chunk-7N7KRZOM.js} +1 -1
- package/dist/{chunk-W37IFK3P.js → chunk-7NRHZG5Y.js} +102 -102
- package/dist/chunk-7PHDEILV.js +1 -0
- package/dist/chunk-A2NSORBM.js +2296 -0
- package/dist/chunk-A54TADAZ.js +1 -0
- package/dist/{chunk-YTUUU33R.js → chunk-AE3IQG7S.js} +1 -1
- package/dist/chunk-AGTUAQHX.js +4 -0
- package/dist/chunk-AHYI27QL.js +11 -0
- package/dist/chunk-ALINJ6J2.js +1 -0
- package/dist/chunk-AMVWKHNY.js +1 -0
- package/dist/{chunk-NVKJ7ZLP.js → chunk-ASKBYEO7.js} +1 -1
- package/dist/{chunk-62EOM3Y2.js → chunk-AVJJGQOP.js} +1 -1
- package/dist/{chunk-NXAEBGMO.js → chunk-AY3AAV77.js} +1 -1
- package/dist/{chunk-F3CK3EJJ.js → chunk-BFAOTQGH.js} +1 -1
- package/dist/{chunk-H6GNKWYM.js → chunk-BPKQA2EO.js} +1 -1
- package/dist/{chunk-WESTVWWD.js → chunk-C2HJEGTS.js} +1 -1
- package/dist/chunk-C72QNK6O.js +4 -0
- package/dist/chunk-CDSDQTNB.js +16 -0
- package/dist/chunk-CEQGOCKX.js +1 -0
- package/dist/{chunk-WCC52MR2.js → chunk-CIGWIKOW.js} +1 -1
- package/dist/chunk-CQAD5WML.js +1 -0
- package/dist/chunk-CRQQCT7F.js +1 -0
- package/dist/chunk-CZNUBAAG.js +3 -0
- package/dist/{chunk-ISKQQXLZ.js → chunk-D7IMC2G4.js} +1 -1
- package/dist/{chunk-6ES4KRFW.js → chunk-DC7ITY6T.js} +1 -1
- package/dist/{chunk-7GHSE7SG.js → chunk-DDRP6QTC.js} +1 -1
- package/dist/{chunk-SLY27GDC.js → chunk-DDZYIC76.js} +2 -2
- package/dist/chunk-DGIIUQH3.js +1 -0
- package/dist/{chunk-3KM5ZOW2.js → chunk-DMOLPSXF.js} +1 -1
- package/dist/{chunk-LHXFTFFM.js → chunk-DOLVBTCB.js} +1 -1
- package/dist/{chunk-WBVS5NBV.js → chunk-DTKGI43P.js} +2 -2
- package/dist/{chunk-2WJOTJOD.js → chunk-DVD7I2TX.js} +2 -2
- package/dist/chunk-DVFVO6ZE.js +2 -0
- package/dist/{chunk-3XRI3D44.js → chunk-DXEMSLI6.js} +1 -1
- package/dist/chunk-EDWIWZWM.js +15 -0
- package/dist/chunk-ELR6AZT4.js +9 -0
- package/dist/chunk-EVQPYZ7F.js +5 -0
- package/dist/chunk-F5QKMDP3.js +1 -0
- package/dist/{chunk-URXM5A2K.js → chunk-F6IQWX2F.js} +1 -1
- package/dist/{chunk-SACNUF4I.js → chunk-FAVPTYIR.js} +1 -1
- package/dist/{chunk-Q7BOSHWX.js → chunk-FDSNRKGQ.js} +1 -1
- package/dist/{chunk-Q4JYAUVL.js → chunk-FHKK3QU7.js} +1 -1
- package/dist/chunk-FKKJQGYX.js +7 -0
- package/dist/chunk-FQLXQ7WN.js +16 -0
- package/dist/{chunk-6PUU6ZNQ.js → chunk-FRWQJAW2.js} +1 -1
- package/dist/{chunk-J5ERDFIC.js → chunk-FU7PYW7H.js} +1 -1
- package/dist/{chunk-ESFCYB46.js → chunk-FYQE5E6U.js} +1 -1
- package/dist/chunk-G3EWGBXR.js +1 -0
- package/dist/chunk-G3RNO2TC.js +1 -0
- package/dist/{chunk-35XFNKNB.js → chunk-GGCP2TIK.js} +1 -1
- package/dist/chunk-GSFWBFFH.js +1 -0
- package/dist/{chunk-ZRI3SSLG.js → chunk-H2KGP2FM.js} +2 -2
- package/dist/{chunk-GW7YIJPJ.js → chunk-H4K3F7PP.js} +1 -1
- package/dist/chunk-HGZ2HRPO.js +13 -0
- package/dist/chunk-HMPRWNGG.js +203 -0
- package/dist/chunk-HP4QYSBQ.js +1 -0
- package/dist/{chunk-RPCIFYCY.js → chunk-HSTZV6H7.js} +2 -2
- package/dist/{chunk-N57Y7THE.js → chunk-HVUMVDUG.js} +1 -1
- package/dist/{chunk-XWSWXQCC.js → chunk-HYCNYUHW.js} +1 -1
- package/dist/{chunk-CXI3RHPW.js → chunk-I3WRA2LH.js} +1 -1
- package/dist/{chunk-UUAKOX7E.js → chunk-IRLYC626.js} +2 -2
- package/dist/chunk-IWNFPBH2.js +33 -0
- package/dist/{chunk-C3RFAKWR.js → chunk-JALDNBTU.js} +1 -1
- package/dist/{chunk-QDCLL5OI.js → chunk-JC37YZ4I.js} +1 -1
- package/dist/{chunk-QF5WKTPD.js → chunk-JG4FAT2T.js} +1 -1
- package/dist/chunk-JGLLABZR.js +8 -0
- package/dist/chunk-JIY6XWSC.js +1 -0
- package/dist/{chunk-3ODQKAEA.js → chunk-JIYCZXK5.js} +1 -1
- package/dist/chunk-JMSAHCBU.js +35 -0
- package/dist/{chunk-KZRLZWOU.js → chunk-JNSVKDBY.js} +1 -1
- package/dist/chunk-JQU2BJDH.js +3 -0
- package/dist/chunk-JVY6CCLE.js +3 -0
- package/dist/{chunk-BAHIL37I.js → chunk-K4QJEQI4.js} +1 -1
- package/dist/chunk-KCAWHJGF.js +1 -0
- package/dist/{chunk-YV2TP44L.js → chunk-KFO2JNF5.js} +1 -1
- package/dist/chunk-KFR7HWCG.js +9 -0
- package/dist/{chunk-MEYVUHQH.js → chunk-KHZF73BL.js} +1 -1
- package/dist/{chunk-LGXI7EGM.js → chunk-KM4LE7K4.js} +2 -2
- package/dist/{chunk-IILLQOUC.js → chunk-L2PUDV7Y.js} +1 -1
- package/dist/chunk-LFBFPK22.js +1 -0
- package/dist/{chunk-BN7ZXAZJ.js → chunk-LG3KEHGD.js} +2 -2
- package/dist/chunk-LGDWE3H3.js +1 -0
- package/dist/chunk-LPPEAMI6.js +1 -0
- package/dist/chunk-LXIWMYM4.js +1 -0
- package/dist/chunk-MGWCXTGD.js +1 -0
- package/dist/chunk-MGX7UG44.js +1 -0
- package/dist/chunk-MKFRKNHF.js +3 -0
- package/dist/chunk-MTT6EAQO.js +1 -0
- package/dist/{chunk-SIL6HPMK.js → chunk-MU7IVBGI.js} +2 -2
- package/dist/{chunk-QEVTBD33.js → chunk-MYMBHVC4.js} +1 -1
- package/dist/chunk-MZDBH4XV.js +4 -0
- package/dist/{chunk-Q5IC3IYY.js → chunk-NUBJ2HK7.js} +1 -1
- package/dist/{chunk-3Z3MADXZ.js → chunk-NY5N4ANL.js} +1 -1
- package/dist/{chunk-WRZWHT6M.js → chunk-NYMKGE3J.js} +1 -1
- package/dist/{chunk-CX5CC6P5.js → chunk-O472FAYX.js} +1 -1
- package/dist/chunk-O7HZ3EIP.js +1 -0
- package/dist/chunk-OJOF6IYG.js +9 -0
- package/dist/{chunk-UXVXVI6O.js → chunk-ONZULPQH.js} +68 -66
- package/dist/chunk-ORMXPSJM.js +1 -0
- package/dist/chunk-ORYEDUKM.js +5 -0
- package/dist/{chunk-T4XJKM6B.js → chunk-OTMYJWIP.js} +1 -1
- package/dist/chunk-OVJVFB5E.js +20 -0
- package/dist/chunk-OWQEFORZ.js +1 -0
- package/dist/{chunk-UBP3LQFY.js → chunk-OXPEBT4I.js} +2 -2
- package/dist/chunk-OXZR2MB4.js +6 -0
- package/dist/chunk-OY5M52EF.js +6 -0
- package/dist/{chunk-2A2JSAAA.js → chunk-PJZZZNWR.js} +1 -1
- package/dist/chunk-Q2LQJYRK.js +16 -0
- package/dist/chunk-QBRRFFMZ.js +1 -0
- package/dist/{chunk-AQKWPRZE.js → chunk-QCLE5REL.js} +2 -2
- package/dist/{chunk-43R5VGKT.js → chunk-QGQWVA7N.js} +1 -1
- package/dist/chunk-QKPAB245.js +1 -0
- package/dist/chunk-QUPZOBTB.js +1 -0
- package/dist/chunk-R4E2E4NN.js +1 -0
- package/dist/{chunk-CGVROSPS.js → chunk-R6US7F33.js} +1 -1
- package/dist/chunk-RKNVTEO3.js +5 -0
- package/dist/{chunk-7CCTPBCT.js → chunk-RLOEI6VE.js} +1 -1
- package/dist/chunk-RSZAAN37.js +1 -0
- package/dist/{chunk-WBJ6ZHYH.js → chunk-S3RROJGG.js} +37 -37
- package/dist/chunk-S4KNPCW3.js +81 -0
- package/dist/{chunk-26PWHH3B.js → chunk-SBN3ILXO.js} +1 -1
- package/dist/chunk-SCDGLREP.js +1 -0
- package/dist/chunk-SHOMIS6Q.js +2 -0
- package/dist/chunk-SN3PMWUF.js +6 -0
- package/dist/chunk-SODCXZ5U.js +1 -0
- package/dist/chunk-SPJM7RTD.js +1 -0
- package/dist/chunk-SQL67BKI.js +5 -0
- package/dist/{chunk-AQ6EVL73.js → chunk-SURFUFAZ.js} +1 -1
- package/dist/{chunk-SNH4XZ6E.js → chunk-SVQDMZJO.js} +1 -1
- package/dist/chunk-T4ZOTYOY.js +1 -0
- package/dist/chunk-T6C4WC3Z.js +2 -0
- package/dist/chunk-TD6JBHUS.js +1 -0
- package/dist/chunk-TIM4CIXZ.js +22 -0
- package/dist/{chunk-B2O3ANRZ.js → chunk-TP7CTMMT.js} +1 -1
- package/dist/chunk-TSPJAMYB.js +1 -0
- package/dist/chunk-TSVEV2UD.js +26 -0
- package/dist/{chunk-ZBL7XMJ6.js → chunk-TTAT62N3.js} +2 -2
- package/dist/{chunk-S5P7KWY4.js → chunk-TUSS6PXB.js} +1 -1
- package/dist/chunk-TXP6KFWO.js +5 -0
- package/dist/chunk-TZHVCMZN.js +6 -0
- package/dist/chunk-UC4TOM36.js +3 -0
- package/dist/{chunk-RPVZ2JON.js → chunk-UFY4L5KQ.js} +1 -1
- package/dist/chunk-UU6UQ2QY.js +1 -0
- package/dist/chunk-V4FC72R6.js +1 -0
- package/dist/chunk-VA2S7W7H.js +10 -0
- package/dist/chunk-VE3IIC7H.js +1 -0
- package/dist/{chunk-PTSCGSQV.js → chunk-VJG7VXFU.js} +2 -2
- package/dist/chunk-VQSRU5XL.js +4 -0
- package/dist/chunk-VRIFLMA3.js +70 -0
- package/dist/chunk-WBJFTCEJ.js +1 -0
- package/dist/chunk-WBPP6PO7.js +31 -0
- package/dist/chunk-WE5KY6T6.js +1 -0
- package/dist/chunk-WFPVT2IY.js +1 -0
- package/dist/{chunk-PLSS456F.js → chunk-WLYXBQ2M.js} +1 -1
- package/dist/chunk-WNVOEE6T.js +7 -0
- package/dist/chunk-WPDJVUTY.js +47 -0
- package/dist/chunk-WWCYEZUU.js +1 -0
- package/dist/chunk-WWVDZ3GC.js +3 -0
- package/dist/{chunk-4KECSZTL.js → chunk-WZBZ7FWP.js} +2 -2
- package/dist/chunk-XEZPN5TR.js +22 -0
- package/dist/{chunk-QW52RPAU.js → chunk-XLMKHTJ5.js} +1 -1
- package/dist/chunk-XRNBCV2B.js +1 -0
- package/dist/{chunk-67L7FIB6.js → chunk-XWLNCBAG.js} +1 -1
- package/dist/chunk-YF4AXKM4.js +1 -0
- package/dist/chunk-YKDRUAY3.js +857 -0
- package/dist/{chunk-YSWVYPWR.js → chunk-YNFQBYSL.js} +1 -1
- package/dist/{chunk-TFPW2VGN.js → chunk-YNZLLZU2.js} +1 -1
- package/dist/chunk-YOYPYB4H.js +1 -0
- package/dist/{chunk-HF4NDEX3.js → chunk-YR4J46US.js} +1 -1
- package/dist/chunk-YTL45RXR.js +103 -0
- package/dist/chunk-YVPB7OT6.js +6 -0
- package/dist/chunk-YYWSHRO2.js +89 -0
- package/dist/{chunk-DZKFP6H2.js → chunk-Z5QEXS6F.js} +1 -1
- package/dist/chunk-Z5WFRYVQ.js +6 -0
- package/dist/{chunk-PWAT52M4.js → chunk-Z6ZRS256.js} +1 -1
- package/dist/chunk-ZMOW2YZ4.js +18 -0
- package/dist/chunk-ZMU4EYXT.js +1 -0
- package/dist/{chunk-ACA2BGAD.js → chunk-ZNEPRGFY.js} +1 -1
- package/dist/chunk-ZXZWMXXK.js +7 -0
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import/channel-config.js +1 -1
- package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs-next.js +1 -0
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/security/check.js +1 -1
- package/dist/cli/commands/app/security/clean.js +1 -1
- package/dist/cli/commands/app/security/instructions.js +1 -1
- package/dist/cli/commands/app/security/record.js +1 -1
- package/dist/cli/commands/app/security/review.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.d.ts +10 -10
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.d.ts +7 -7
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/doc/fetch.d.ts +21 -21
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.d.ts +23 -23
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.d.ts +90 -90
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.d.ts +7 -7
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/send-analytics.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.d.ts +24 -24
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.d.ts +7 -7
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli-version-check-V25AVSZ6.js +1 -0
- package/dist/{command-event-context-LFUZ7UCA.js → command-event-context-ILIANB5Q.js} +1 -1
- package/dist/command-json-schema-C5UZXP2W.js +1 -0
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-OCGEEV4U.js +1 -0
- package/dist/custom-oclif-loader-ZVUKMRGH.js +1 -0
- package/dist/data/filters.json +41 -2
- package/dist/data/local_block_entry.json +1 -1
- package/dist/data/manifest_theme.json +1 -0
- package/dist/data/objects.json +78 -36
- package/dist/data/section.json +1 -1
- package/dist/data/shopify_system_translations.json +240 -23
- package/dist/data/strict_settings.json +24 -0
- package/dist/data/tags.json +57 -24
- package/dist/data/theme_block.json +1 -1
- package/dist/deprecations-A5AXXKIK.js +1 -0
- package/dist/dist-NORLLIHQ.js +1 -0
- package/dist/dist-XBM4XZS4.js +1 -0
- package/dist/environment-5P7JJ3GI.js +1 -0
- package/dist/environments-Y5JEI3U3.js +1 -0
- package/dist/error-GI4DXVDU.js +1 -0
- package/dist/error-handler-BS2ZENQV.js +1 -0
- package/dist/fs-UOOLPOHJ.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +2 -2
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/http-2OXOS2AW.js +1 -0
- package/dist/http-proxy-node16-NZZ674YW.js +38 -0
- package/dist/index.js +12 -12
- package/dist/is-global-CI77T7NE.js +1 -0
- package/dist/json-error-6PBUR4LQ.js +1 -0
- package/dist/latest-version-75YEFEMK.js +9 -0
- package/dist/lib-4JVADMNT.js +1 -0
- package/dist/lib-L4STV5B2.js +1 -0
- package/dist/lib-LEEN55OD.js +1 -0
- package/dist/{local-OKPVB4NH.js → local-5NIWPWDS.js} +1 -1
- package/dist/metadata-IXPNNPNJ.js +1 -0
- package/dist/{morph-CRY35DIK.js → morph-H7XQP55V.js} +3 -3
- package/dist/node-package-manager-ALFEGGD6.js +1 -0
- package/dist/notifications-system-FQW3GKH2.js +1 -0
- package/dist/{npa-A4YSCQ5Q.js → npa-LVYMN7GE.js} +1 -1
- package/dist/os-6TNQTEUN.js +1 -0
- package/dist/output-LEOB5LAM.js +1 -0
- package/dist/{prettier-EGVCP5CY.js → prettier-VLTY4MIE.js} +1 -1
- package/dist/registry-auth-token-EDH77OOW.js +1 -0
- package/dist/registry-url-JMNV3LLX.js +1 -0
- package/dist/semver-HHZRKD6Y.js +1 -0
- package/dist/system-J4CTESP5.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-YDUI56E3.js +1 -0
- package/dist/upgrade-LBCZORG2.js +1 -0
- package/dist/version-2YL4YEQ2.js +1 -0
- package/dist/version-X2CPQVWQ.js +1 -0
- package/dist/workerd-5UPTEWNI.js +18 -0
- package/oclif.manifest.json +25622 -1132
- package/package.json +7 -7
- package/dist/analytics-NMMVOF4B.js +0 -1
- package/dist/analytics-UK77WNLG.js +0 -1
- package/dist/chunk-224UPIYS.js +0 -4
- package/dist/chunk-27NXPOAS.js +0 -1
- package/dist/chunk-2MT3LSMZ.js +0 -1
- package/dist/chunk-2T4HDR6R.js +0 -70
- package/dist/chunk-2ZBXHCQZ.js +0 -1
- package/dist/chunk-335BUVBP.js +0 -1
- package/dist/chunk-33ZE3DRQ.js +0 -16
- package/dist/chunk-34MOWGRL.js +0 -1
- package/dist/chunk-3JSKNXL7.js +0 -1
- package/dist/chunk-3MG4MTWQ.js +0 -1
- package/dist/chunk-4WYKPIN3.js +0 -1
- package/dist/chunk-5AEZJZNQ.js +0 -1
- package/dist/chunk-5ED7SOQZ.js +0 -20
- package/dist/chunk-5IDJALJH.js +0 -1
- package/dist/chunk-66TMIQMB.js +0 -1
- package/dist/chunk-74NRFUGQ.js +0 -1
- package/dist/chunk-7GUMJ5E4.js +0 -1
- package/dist/chunk-7NFTSBHQ.js +0 -10
- package/dist/chunk-ACZNWIRY.js +0 -1
- package/dist/chunk-AUE7LM32.js +0 -1
- package/dist/chunk-AXL2VIWA.js +0 -16
- package/dist/chunk-B3ZJGYZY.js +0 -3
- package/dist/chunk-BOAGJ6P5.js +0 -1
- package/dist/chunk-BWN2QG6D.js +0 -5
- package/dist/chunk-CCUQM4FX.js +0 -6
- package/dist/chunk-CLUUA3HX.js +0 -3
- package/dist/chunk-CYEEGTVZ.js +0 -11
- package/dist/chunk-DBDTE3EE.js +0 -5
- package/dist/chunk-DLVB3237.js +0 -31
- package/dist/chunk-DN6X7SHW.js +0 -2
- package/dist/chunk-E5COIKGY.js +0 -5
- package/dist/chunk-E6RONHMT.js +0 -1
- package/dist/chunk-EAZIQI2D.js +0 -1
- package/dist/chunk-EEY4FKAW.js +0 -1
- package/dist/chunk-EKFPTBXC.js +0 -1
- package/dist/chunk-FEBOZ2XX.js +0 -31
- package/dist/chunk-FFSDGRAN.js +0 -1
- package/dist/chunk-FZCGRIOM.js +0 -1
- package/dist/chunk-GNCVDN7U.js +0 -1
- package/dist/chunk-GQLNG537.js +0 -836
- package/dist/chunk-GVI3DWSB.js +0 -4
- package/dist/chunk-H6GYBLVQ.js +0 -2
- package/dist/chunk-HB3MJYBK.js +0 -1
- package/dist/chunk-HSKDFEXW.js +0 -1
- package/dist/chunk-HTRJU4R4.js +0 -1
- package/dist/chunk-HXZAY5OA.js +0 -1
- package/dist/chunk-I7PEEJVH.js +0 -1
- package/dist/chunk-IHMATNOR.js +0 -1
- package/dist/chunk-IJY3RJPJ.js +0 -47
- package/dist/chunk-J3JPJCWP.js +0 -1
- package/dist/chunk-J55GQLP4.js +0 -1
- package/dist/chunk-JLQRDFR5.js +0 -18
- package/dist/chunk-JPWRZ5SL.js +0 -16
- package/dist/chunk-K7ZSPQKL.js +0 -4
- package/dist/chunk-L5TSPCSY.js +0 -26
- package/dist/chunk-LUGMXSRI.js +0 -9
- package/dist/chunk-M2CWCOFU.js +0 -11
- package/dist/chunk-M5VIFG2V.js +0 -1
- package/dist/chunk-MADINS4Z.js +0 -1
- package/dist/chunk-MGHPF7HU.js +0 -6
- package/dist/chunk-MHR5OHT5.js +0 -10
- package/dist/chunk-MXEXP3HT.js +0 -15
- package/dist/chunk-OJULL7HT.js +0 -1
- package/dist/chunk-OMPQ7REW.js +0 -3
- package/dist/chunk-OR4IJ4BQ.js +0 -1
- package/dist/chunk-P2RMFHQP.js +0 -1
- package/dist/chunk-P4VZYOKO.js +0 -15
- package/dist/chunk-PDZBKVWL.js +0 -97
- package/dist/chunk-Q2KWXZQB.js +0 -12
- package/dist/chunk-QFSENE5T.js +0 -3
- package/dist/chunk-QFWWCZOI.js +0 -1
- package/dist/chunk-QFYLJVJW.js +0 -77
- package/dist/chunk-QQJNQNKP.js +0 -6
- package/dist/chunk-R4UVIYZP.js +0 -4
- package/dist/chunk-RLNIOJH3.js +0 -272
- package/dist/chunk-RW6G4ZPU.js +0 -1
- package/dist/chunk-S4LOWCGS.js +0 -1
- package/dist/chunk-SB27UOXX.js +0 -1
- package/dist/chunk-SHD4VV5V.js +0 -3
- package/dist/chunk-SK7EPN6C.js +0 -1
- package/dist/chunk-TAWCKJKP.js +0 -1
- package/dist/chunk-U2T5HPRD.js +0 -319
- package/dist/chunk-U6YOP562.js +0 -1
- package/dist/chunk-UPPO3BMT.js +0 -7
- package/dist/chunk-USXIXANP.js +0 -103
- package/dist/chunk-UV5GAGAD.js +0 -1
- package/dist/chunk-UY6W2EVZ.js +0 -1
- package/dist/chunk-UYELAINQ.js +0 -16
- package/dist/chunk-V75WUEFU.js +0 -1
- package/dist/chunk-VAVXDIUX.js +0 -6
- package/dist/chunk-VEUKT5EI.js +0 -6
- package/dist/chunk-VGSH52JM.js +0 -1
- package/dist/chunk-VHZ6RL67.js +0 -1
- package/dist/chunk-VQA3X7O3.js +0 -1
- package/dist/chunk-VZCMJRYV.js +0 -1
- package/dist/chunk-W56ZGEQQ.js +0 -2265
- package/dist/chunk-WSDKCQH6.js +0 -6
- package/dist/chunk-X2PFXSU4.js +0 -1
- package/dist/chunk-X5NIAZA4.js +0 -1
- package/dist/chunk-XBMD3FEZ.js +0 -3
- package/dist/chunk-XDVPIGXE.js +0 -2
- package/dist/chunk-XLIJYJ6Q.js +0 -1
- package/dist/chunk-XUHGWIWW.js +0 -4
- package/dist/chunk-Y55T4IIQ.js +0 -7
- package/dist/chunk-Y5CVX5LJ.js +0 -1
- package/dist/chunk-Y6J46XYF.js +0 -3
- package/dist/chunk-YKMINHYY.js +0 -3
- package/dist/chunk-ZDQO6CNY.js +0 -1
- package/dist/chunk-ZGASBRSQ.js +0 -5
- package/dist/chunk-ZGBTO46A.js +0 -1
- package/dist/chunk-ZJOX5HW4.js +0 -22
- package/dist/chunk-ZOOT3GBY.js +0 -5
- package/dist/command-json-schema-F5XF7XHL.js +0 -1
- package/dist/conf-store-5CBLWTOC.js +0 -1
- package/dist/custom-oclif-loader-UDVUFKMD.js +0 -1
- package/dist/deprecations-EOHPSTCS.js +0 -1
- package/dist/dist-RNV3GFZ7.js +0 -1
- package/dist/dist-ZFKWJVNB.js +0 -1
- package/dist/environment-O7ECODHU.js +0 -1
- package/dist/environments-4FLRZW4P.js +0 -1
- package/dist/error-JY2ADS6S.js +0 -1
- package/dist/error-handler-4GCXKC6I.js +0 -1
- package/dist/fs-XS5YF34R.js +0 -1
- package/dist/http-proxy-node16-D3JUYA5D.js +0 -38
- package/dist/is-global-27MUENOK.js +0 -1
- package/dist/json-error-S5XFS3UX.js +0 -1
- package/dist/latest-version-LDWU5F7A.js +0 -49
- package/dist/lib-PJHT4MKY.js +0 -1
- package/dist/lib-VKSQ65BQ.js +0 -1
- package/dist/lib-YEZOHXF3.js +0 -1
- package/dist/metadata-2YJBAKR7.js +0 -1
- package/dist/node-package-manager-B3OW3PFQ.js +0 -1
- package/dist/notifications-system-BWTDYBG2.js +0 -1
- package/dist/os-F6QKJCFW.js +0 -1
- package/dist/output-BRIPK7UC.js +0 -1
- package/dist/system-466QKFDI.js +0 -1
- package/dist/ui-VJTNGCS6.js +0 -1
- package/dist/upgrade-VHVJLXKX.js +0 -1
- package/dist/version-FETZRLZO.js +0 -1
- package/dist/version-T4XXTJMB.js +0 -1
- package/dist/workerd-32DMKLMN.js +0 -18
- /package/dist/{chunk-YLQ3LNNY.js → chunk-2S3FHQFS.js} +0 -0
- /package/dist/{chunk-YRHFPXC3.js → chunk-Z2AV4BWZ.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as gt}from"./chunk-IILLQOUC.js";import{a as ht,b as Dr}from"./chunk-SIL6HPMK.js";import"./chunk-LQ7ENG4V.js";import"./chunk-UUAKOX7E.js";import{a as En}from"./chunk-UV5GAGAD.js";import{a as fn}from"./chunk-7GUMJ5E4.js";import{a as hn}from"./chunk-Y6J46XYF.js";import{a as gn}from"./chunk-VQA3X7O3.js";import{a as Sn}from"./chunk-VZCMJRYV.js";import{a as yn}from"./chunk-ACZNWIRY.js";import"./chunk-QEKGGTMN.js";import"./chunk-62EOM3Y2.js";import"./chunk-J5ERDFIC.js";import"./chunk-PDZBKVWL.js";import{a as wn}from"./chunk-UY6W2EVZ.js";import{a as kn}from"./chunk-ZBL7XMJ6.js";import{a as Br}from"./chunk-4WYKPIN3.js";import{a as dn}from"./chunk-7NFTSBHQ.js";import{a as Qr}from"./chunk-WCC52MR2.js";import{a as ln}from"./chunk-R4UVIYZP.js";import{a as Mr}from"./chunk-GVI3DWSB.js";import{a as Gr}from"./chunk-HTRJU4R4.js";import{a as Jr}from"./chunk-34MOWGRL.js";import"./chunk-JPWRZ5SL.js";import{a as Vr}from"./chunk-IHMATNOR.js";import{a as Wr}from"./chunk-Q2KWXZQB.js";import"./chunk-V75WUEFU.js";import"./chunk-HB3MJYBK.js";import"./chunk-X5NIAZA4.js";import"./chunk-66TMIQMB.js";import"./chunk-W56ZGEQQ.js";import{a as sn}from"./chunk-LGXI7EGM.js";import{a as Cr,b as Pr,c as en}from"./chunk-B3ZJGYZY.js";import{a as In}from"./chunk-WESTVWWD.js";import{a as un}from"./chunk-ISKQQXLZ.js";import"./chunk-PLSS456F.js";import{a as On}from"./chunk-UPPO3BMT.js";import{a as Tn}from"./chunk-XUHGWIWW.js";import{a as cn}from"./chunk-3MG4MTWQ.js";import{a as pn}from"./chunk-M2CWCOFU.js";import{a as Kr}from"./chunk-74NRFUGQ.js";import"./chunk-67L7FIB6.js";import{a as Zr}from"./chunk-RW6G4ZPU.js";import{a as tn}from"./chunk-EKFPTBXC.js";import{a as xn}from"./chunk-AXL2VIWA.js";import{a as on}from"./chunk-BWN2QG6D.js";import{a as rn}from"./chunk-I7PEEJVH.js";import"./chunk-EAZIQI2D.js";import{a as nn}from"./chunk-ZGBTO46A.js";import{a as an}from"./chunk-5AEZJZNQ.js";import"./chunk-S4LOWCGS.js";import{a as $r}from"./chunk-224UPIYS.js";import{a as zr}from"./chunk-OR4IJ4BQ.js";import{a as Ur}from"./chunk-X2PFXSU4.js";import{a as mn}from"./chunk-QFSENE5T.js";import{a as Hr}from"./chunk-SLY27GDC.js";import"./chunk-QF5WKTPD.js";import{a as ft,b as jr}from"./chunk-L5TSPCSY.js";import"./chunk-UOHNRH6E.js";import{a as Ea}from"./chunk-PF53E2DC.js";import"./chunk-DLVB3237.js";import"./chunk-AQKWPRZE.js";import"./chunk-UBP3LQFY.js";import{h as _a}from"./chunk-SHD4VV5V.js";import"./chunk-UXVXVI6O.js";import"./chunk-OJULL7HT.js";import"./chunk-OMPQ7REW.js";import"./chunk-KNWT7JLL.js";import"./chunk-QDCLL5OI.js";import"./chunk-2ZBXHCQZ.js";import"./chunk-RPCIFYCY.js";import"./chunk-AQ6EVL73.js";import"./chunk-5ED7SOQZ.js";import"./chunk-MXEXP3HT.js";import"./chunk-2WJOTJOD.js";import"./chunk-HF4NDEX3.js";import"./chunk-FEBOZ2XX.js";import"./chunk-J3JPJCWP.js";import"./chunk-MEYVUHQH.js";import"./chunk-MADINS4Z.js";import"./chunk-USXIXANP.js";import"./chunk-JLGA3B7P.js";import"./chunk-TFPW2VGN.js";import"./chunk-IJY3RJPJ.js";import"./chunk-XBMD3FEZ.js";import"./chunk-6PUU6ZNQ.js";import"./chunk-PWAT52M4.js";import"./chunk-QW52RPAU.js";import"./chunk-2A2JSAAA.js";import"./chunk-CGVROSPS.js";import"./chunk-IHXGZW42.js";import"./chunk-YY6TFARF.js";import"./chunk-2L6AN3QA.js";import{b as Ia}from"./chunk-3JSKNXL7.js";import"./chunk-QFWWCZOI.js";import"./chunk-H6GYBLVQ.js";import"./chunk-WBVS5NBV.js";import{a as j,b as mr,c as Y,d as ge,e as Se}from"./chunk-YKMINHYY.js";import"./chunk-Z2WAW6MM.js";import"./chunk-KZRLZWOU.js";import"./chunk-SACNUF4I.js";import"./chunk-PTSCGSQV.js";import"./chunk-W37IFK3P.js";import"./chunk-H6GNKWYM.js";import"./chunk-Q7BOSHWX.js";import"./chunk-P4VZYOKO.js";import"./chunk-C3RFAKWR.js";import"./chunk-ZOOT3GBY.js";import"./chunk-MGHPF7HU.js";import"./chunk-HXZAY5OA.js";import"./chunk-2T4HDR6R.js";import"./chunk-UWHAOGO4.js";import"./chunk-ZI7LK3LW.js";import"./chunk-ACA2BGAD.js";import"./chunk-26PWHH3B.js";import{a as An}from"./chunk-E5COIKGY.js";import{a as Yr}from"./chunk-CYEEGTVZ.js";import"./chunk-FKIVKNOV.js";import"./chunk-XLIJYJ6Q.js";import"./chunk-7GHSE7SG.js";import{a as ur}from"./chunk-WSDKCQH6.js";import{a as pr}from"./chunk-CCUQM4FX.js";import{a as dr}from"./chunk-VAVXDIUX.js";import"./chunk-XWSWXQCC.js";import{a as er}from"./chunk-35XFNKNB.js";import{a as Lr}from"./chunk-P2RMFHQP.js";import"./chunk-VGSH52JM.js";import"./chunk-7CCTPBCT.js";import{a as Rr}from"./chunk-DN6X7SHW.js";import{a as Xr}from"./chunk-4KECSZTL.js";import{a as qr}from"./chunk-DBDTE3EE.js";import"./chunk-CLUUA3HX.js";import"./chunk-AUE7LM32.js";import{a as se,b as lr,c as ye,e as we,f as Pe,g as fr,h as hr,i as gr,j as Sr,k as yr,l as wr,m as dt,n as kr,o as br,p as vr,q as Ar,r as xr,s as ro}from"./chunk-DZKFP6H2.js";import"./chunk-J55GQLP4.js";import"./chunk-VHZ6RL67.js";import"./chunk-3MYDSQHF.js";import"./chunk-NVKJ7ZLP.js";import{a as rr}from"./chunk-B2O3ANRZ.js";import{a as Zo}from"./chunk-QEVTBD33.js";import{a as Qo}from"./chunk-UKWIWCOH.js";import{a as Xo}from"./chunk-3Z3MADXZ.js";import"./chunk-64G5TGFF.js";import{a as Yo}from"./chunk-ER6C5WS3.js";import"./chunk-TAWCKJKP.js";import"./chunk-VUMUCNI7.js";import{a as Ko}from"./chunk-SNH4XZ6E.js";import"./chunk-Y55T4IIQ.js";import{a as sr}from"./chunk-WRZWHT6M.js";import{a as ar}from"./chunk-S5P7KWY4.js";import"./chunk-XDVPIGXE.js";import{a as Mo}from"./chunk-27NXPOAS.js";import"./chunk-K7ZSPQKL.js";import"./chunk-U6YOP562.js";import{a as Ho}from"./chunk-E6RONHMT.js";import{a as Vo}from"./chunk-3XRI3D44.js";import{a as Jo}from"./chunk-2MT3LSMZ.js";import{a as cr}from"./chunk-Q4JYAUVL.js";import{a as Wo}from"./chunk-RPVZ2JON.js";import{a as tr}from"./chunk-ZRI3SSLG.js";import{a as or}from"./chunk-VEUKT5EI.js";import"./chunk-BAHIL37I.js";import{a as bn}from"./chunk-EEY4FKAW.js";import"./chunk-U2T5HPRD.js";import"./chunk-6ES4KRFW.js";import"./chunk-YLQ3LNNY.js";import{a as V,b as K,d as Or,e as Tr,f as mt,g as Ir,h as Er,i as lt,k as no,l as A,m as ce,n as io,o as ao,p as _r,q as Nr,r as Fr}from"./chunk-33ZE3DRQ.js";import"./chunk-YV2TP44L.js";import"./chunk-RLNIOJH3.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import{e as ae}from"./chunk-SK7EPN6C.js";import"./chunk-VJEKDBGZ.js";import"./chunk-TODZ3TJR.js";import"./chunk-Y5CVX5LJ.js";import"./chunk-T4XJKM6B.js";import{a as vn}from"./chunk-3ODQKAEA.js";import"./chunk-N57Y7THE.js";import{a as Pa}from"./chunk-YSWVYPWR.js";import{d as Ca}from"./chunk-URXM5A2K.js";import{a as nr}from"./chunk-GNCVDN7U.js";import{a as jo}from"./chunk-LUGMXSRI.js";import{a as Go}from"./chunk-SB27UOXX.js";import{a as ir,b as Ta}from"./chunk-I4CEH7AK.js";import"./chunk-Q5IC3IYY.js";import{c as St,d as Fa}from"./chunk-UYELAINQ.js";import{b as Q}from"./chunk-ZJOX5HW4.js";import"./chunk-LFOBYEWG.js";import{C as z,D as re,E as q,O as B,P as it,Q as le,b as Oa,fa as fe,ha as ne,j as Kt,k as Xt,ma as eo,q as Zt,u as _}from"./chunk-GQLNG537.js";import"./chunk-ZDF5N422.js";import"./chunk-QQJNQNKP.js";import"./chunk-MPW2YJWU.js";import{e as Fo}from"./chunk-MHR5OHT5.js";import{a as Jt}from"./chunk-HSKDFEXW.js";import"./chunk-F3CK3EJJ.js";import{a as zo,b as y,c as w,e as Bo,f as pt}from"./chunk-3KM5ZOW2.js";import"./chunk-T7KHS6RF.js";import{A as I,B as ie,C as W,G as Do,H as he,J as H,L as Lo,N as st,O as ct,U as qo,W as ut,_ as $o,a as No,z as T}from"./chunk-D2KIGKBI.js";import"./chunk-7Y7AZRL3.js";import"./chunk-LEHBZKK3.js";import"./chunk-GW7YIJPJ.js";import"./chunk-5HBIIYSK.js";import"./chunk-GB3YC4TI.js";import{b as _o,d as nt}from"./chunk-335BUVBP.js";import"./chunk-YRHFPXC3.js";import{a as x}from"./chunk-BN7ZXAZJ.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import{d as Co,e as Po}from"./chunk-CXI3RHPW.js";import{h as c,j as Ro,k as J}from"./chunk-M5VIFG2V.js";import{a as ke,b as Na}from"./chunk-WBJ6ZHYH.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-5IDJALJH.js";import"./chunk-NXAEBGMO.js";import{Ab as Uo,Bb as f,Cb as to,Db as oo,N as Io,Sa as Ce,V as Eo,Z as oe,ba as Qt,ga as Yt,la as Ne,qb as u,sb as d,ta as Fe,wb as S,yb as P}from"./chunk-JLQRDFR5.js";import{i as at}from"./chunk-B4OMIONW.js";import"./chunk-BOAGJ6P5.js";import"./chunk-5B76DT7X.js";import"./chunk-JJZNUFPD.js";import{b as s,c as Vt,d as Wt}from"./chunk-FZCGRIOM.js";import"./chunk-LHXFTFFM.js";import{b as To}from"./chunk-43R5VGKT.js";import"./chunk-ZDQO6CNY.js";import{b as M}from"./chunk-YTUUU33R.js";import"./chunk-JD5P5RAJ.js";import{e as G}from"./chunk-IWTNUJGY.js";import"./chunk-QFYLJVJW.js";import"./chunk-ZGASBRSQ.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-IGE4Y5SE.js";import"./chunk-JFBCE4HN.js";import{e as R,g as n}from"./chunk-VKWPEFWQ.js";n();var xa=R(Ta(),1);n();n();n();n();function so(e){return mr(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}n();var Da=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function yt(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Da.format(t)}function wt(e){let t=z(e);if(t)return t.split(".")[0]}function _n(){let e=so().map(t=>({subdomain:wt(t.store)??t.store,connected:yt(t.acquiredAt),store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}}));return{sessions:e,...e.length===0?{message:La()}:{}}}function La(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
|
|
2
|
-
`)}n();n();n();var
|
|
1
|
+
import{a as gt}from"./chunk-L2PUDV7Y.js";import{a as St,b as qr}from"./chunk-MU7IVBGI.js";import"./chunk-LQ7ENG4V.js";import"./chunk-IRLYC626.js";import{a as Mr}from"./chunk-A54TADAZ.js";import{a as Cn}from"./chunk-3Z75BVGJ.js";import{a as Kr}from"./chunk-TSVEV2UD.js";import{a as yn}from"./chunk-SODCXZ5U.js";import{a as wn}from"./chunk-UC4TOM36.js";import{a as kn}from"./chunk-TSPJAMYB.js";import{a as bn}from"./chunk-AMVWKHNY.js";import{a as vn}from"./chunk-QKPAB245.js";import"./chunk-5HOZDOJ7.js";import"./chunk-AVJJGQOP.js";import"./chunk-FU7PYW7H.js";import"./chunk-5534MHZW.js";import{a as An}from"./chunk-MGWCXTGD.js";import{a as xn}from"./chunk-TTAT62N3.js";import{a as hn}from"./chunk-VA2S7W7H.js";import{a as Xr}from"./chunk-CIGWIKOW.js";import{a as Zr}from"./chunk-62NW4EPI.js";import{a as gn}from"./chunk-7KID5BIR.js";import{a as Vr}from"./chunk-MZDBH4XV.js";import"./chunk-FKKJQGYX.js";import{a as Wr}from"./chunk-SPJM7RTD.js";import{a as Qr}from"./chunk-MTT6EAQO.js";import"./chunk-FQLXQ7WN.js";import{a as Yr}from"./chunk-7ART2IKU.js";import"./chunk-4FWPOGPQ.js";import"./chunk-ZMU4EYXT.js";import"./chunk-G3RNO2TC.js";import"./chunk-A2NSORBM.js";import{a as dn}from"./chunk-KM4LE7K4.js";import{a as Dr,b as Lr,c as Rr,d as nn}from"./chunk-JQU2BJDH.js";import{a as Fn}from"./chunk-C2HJEGTS.js";import{a as ln}from"./chunk-D7IMC2G4.js";import"./chunk-WLYXBQ2M.js";import{a as _n}from"./chunk-ZXZWMXXK.js";import{a as Nn}from"./chunk-AGTUAQHX.js";import{a as mn}from"./chunk-LFBFPK22.js";import{a as fn}from"./chunk-AHYI27QL.js";import{a as tn}from"./chunk-SCDGLREP.js";import"./chunk-XWLNCBAG.js";import{a as rn}from"./chunk-HP4QYSBQ.js";import{a as an}from"./chunk-V4FC72R6.js";import{a as En}from"./chunk-Q2LQJYRK.js";import{a as sn}from"./chunk-KFR7HWCG.js";import{a as cn}from"./chunk-ORMXPSJM.js";import"./chunk-G3EWGBXR.js";import{a as un}from"./chunk-QUPZOBTB.js";import{a as pn}from"./chunk-65NCQJYR.js";import"./chunk-5T3ZT6CC.js";import{a as Br}from"./chunk-VQSRU5XL.js";import{a as Hr}from"./chunk-CRQQCT7F.js";import{a as jr}from"./chunk-4TCXPHKN.js";import{a as Sn}from"./chunk-WWVDZ3GC.js";import{a as Gr}from"./chunk-DDZYIC76.js";import"./chunk-JG4FAT2T.js";import{a as ht,b as Jr}from"./chunk-TIM4CIXZ.js";import"./chunk-UOHNRH6E.js";import"./chunk-SURFUFAZ.js";import{a as Ca}from"./chunk-3PS52ZT4.js";import"./chunk-WBPP6PO7.js";import"./chunk-QCLE5REL.js";import"./chunk-OXPEBT4I.js";import{h as Pa}from"./chunk-MKFRKNHF.js";import"./chunk-DTKGI43P.js";import"./chunk-ONZULPQH.js";import"./chunk-OWQEFORZ.js";import"./chunk-6I7DT7QR.js";import"./chunk-3MZ7ELHS.js";import"./chunk-JC37YZ4I.js";import"./chunk-VE3IIC7H.js";import"./chunk-HSTZV6H7.js";import"./chunk-OVJVFB5E.js";import"./chunk-KCAWHJGF.js";import"./chunk-HGZ2HRPO.js";import"./chunk-DVD7I2TX.js";import"./chunk-YR4J46US.js";import"./chunk-JMSAHCBU.js";import"./chunk-YF4AXKM4.js";import"./chunk-KHZF73BL.js";import"./chunk-WBJFTCEJ.js";import"./chunk-YTL45RXR.js";import"./chunk-JLGA3B7P.js";import"./chunk-YNZLLZU2.js";import"./chunk-WPDJVUTY.js";import"./chunk-JVY6CCLE.js";import"./chunk-FRWQJAW2.js";import"./chunk-Z6ZRS256.js";import"./chunk-XLMKHTJ5.js";import"./chunk-PJZZZNWR.js";import"./chunk-R6US7F33.js";import"./chunk-6BYHL3DS.js";import"./chunk-YY6TFARF.js";import"./chunk-7N7KRZOM.js";import{b as Fa}from"./chunk-O7HZ3EIP.js";import"./chunk-DVFVO6ZE.js";import"./chunk-7HECBXSP.js";import{a as H,b as lr,c as Y,d as Se,e as ge}from"./chunk-CZNUBAAG.js";import"./chunk-7CT3NIXI.js";import"./chunk-JNSVKDBY.js";import"./chunk-FAVPTYIR.js";import"./chunk-VJG7VXFU.js";import"./chunk-7NRHZG5Y.js";import"./chunk-BPKQA2EO.js";import"./chunk-FDSNRKGQ.js";import"./chunk-EDWIWZWM.js";import"./chunk-JALDNBTU.js";import"./chunk-TXP6KFWO.js";import"./chunk-Z5WFRYVQ.js";import"./chunk-4IP37MBX.js";import"./chunk-MGX7UG44.js";import"./chunk-VRIFLMA3.js";import"./chunk-UWHAOGO4.js";import"./chunk-ZI7LK3LW.js";import"./chunk-ZNEPRGFY.js";import"./chunk-SBN3ILXO.js";import{a as Tn}from"./chunk-ORYEDUKM.js";import{a as en}from"./chunk-7A77JCED.js";import"./chunk-FKIVKNOV.js";import"./chunk-7PHDEILV.js";import"./chunk-DDRP6QTC.js";import{a as pr}from"./chunk-OXZR2MB4.js";import{a as dr}from"./chunk-YVPB7OT6.js";import{a as mr}from"./chunk-OY5M52EF.js";import"./chunk-HYCNYUHW.js";import{a as tr}from"./chunk-GGCP2TIK.js";import{a as $r}from"./chunk-DGIIUQH3.js";import"./chunk-ALINJ6J2.js";import"./chunk-RLOEI6VE.js";import{a as Ur}from"./chunk-T6C4WC3Z.js";import{a as on}from"./chunk-WZBZ7FWP.js";import{a as zr}from"./chunk-RKNVTEO3.js";import"./chunk-6IMTMS2S.js";import"./chunk-4NFX7YCT.js";import{a as se,b as hr,c as ye,e as we,f as Pe,g as Sr,h as gr,i as yr,j as wr,k as kr,l as br,m as mt,n as vr,o as Ar,p as xr,q as Or,r as Ir,s as no}from"./chunk-Z5QEXS6F.js";import"./chunk-LXIWMYM4.js";import"./chunk-RSZAAN37.js";import"./chunk-3GD5ESWN.js";import"./chunk-ASKBYEO7.js";import{a as nr}from"./chunk-TP7CTMMT.js";import{a as er}from"./chunk-MYMBHVC4.js";import{a as Yo}from"./chunk-5C6CXU74.js";import{a as Zo}from"./chunk-NY5N4ANL.js";import"./chunk-3C72S6LO.js";import{a as Ko}from"./chunk-5PSQFQL6.js";import"./chunk-GSFWBFFH.js";import"./chunk-VUMUCNI7.js";import{a as Xo}from"./chunk-SVQDMZJO.js";import"./chunk-WNVOEE6T.js";import{a as cr}from"./chunk-NYMKGE3J.js";import{a as sr}from"./chunk-TUSS6PXB.js";import"./chunk-SHOMIS6Q.js";import{a as Go}from"./chunk-LPPEAMI6.js";import"./chunk-SQL67BKI.js";import"./chunk-LGDWE3H3.js";import"./chunk-WE5KY6T6.js";import{a as Ho}from"./chunk-XRNBCV2B.js";import{a as Wo}from"./chunk-DXEMSLI6.js";import{a as Vo}from"./chunk-CEQGOCKX.js";import{a as ur}from"./chunk-FHKK3QU7.js";import{a as Qo}from"./chunk-UFY4L5KQ.js";import{a as or}from"./chunk-H2KGP2FM.js";import{a as rr}from"./chunk-SN3PMWUF.js";import"./chunk-K4QJEQI4.js";import{a as On}from"./chunk-WWCYEZUU.js";import"./chunk-HMPRWNGG.js";import"./chunk-2S3FHQFS.js";import"./chunk-JGLLABZR.js";import{d as fr,f as ae}from"./chunk-2BYW3BYX.js";import"./chunk-YYWSHRO2.js";import"./chunk-DC7ITY6T.js";import"./chunk-VJEKDBGZ.js";import{a as V,b as K,d as Tr,f as Er,g as lt,h as _r,i as Nr,j as ft,l as io,m as A,n as ce,o as ao,p as so,q as Fr,r as Cr,s as Pr}from"./chunk-OJOF6IYG.js";import"./chunk-7DBKSSDK.js";import"./chunk-KFO2JNF5.js";import"./chunk-2PD7TNFS.js";import"./chunk-IWOTLFOY.js";import"./chunk-27JT4NA4.js";import"./chunk-F5QKMDP3.js";import"./chunk-OTMYJWIP.js";import{a as In}from"./chunk-JIYCZXK5.js";import"./chunk-HVUMVDUG.js";import{a as qa}from"./chunk-YNFQBYSL.js";import{d as Ra}from"./chunk-F6IQWX2F.js";import{a as ir}from"./chunk-24Q6X53V.js";import{a as Mo}from"./chunk-ELR6AZT4.js";import{a as Jo}from"./chunk-YOYPYB4H.js";import{a as ar,b as Na}from"./chunk-7BPT5V24.js";import"./chunk-NUBJ2HK7.js";import{c as yt,d as La}from"./chunk-CDSDQTNB.js";import{b as Q}from"./chunk-XEZPN5TR.js";import"./chunk-LFOBYEWG.js";import{B as _,J as z,K as re,L as q,V as B,W as at,X as le,b as _a,ma as fe,p as Xt,q as Zt,qa as ne,va as to,x as eo}from"./chunk-YKDRUAY3.js";import"./chunk-ZDF5N422.js";import"./chunk-4WBWZIN5.js";import"./chunk-T4ZOTYOY.js";import{e as Co}from"./chunk-3FZ4LE6A.js";import"./chunk-MPW2YJWU.js";import{a as Vt}from"./chunk-JIY6XWSC.js";import"./chunk-BFAOTQGH.js";import{a as Bo,b as y,c as w,e as jo,f as dt}from"./chunk-DMOLPSXF.js";import"./chunk-T7KHS6RF.js";import{A as W,E as Lo,F as he,H as j,J as Ro,L as ct,M as ut,S as $o,U as pt,Y as Uo,a as Fo,x as I,y as T,z as ie}from"./chunk-2KUM2RU4.js";import"./chunk-7Y7AZRL3.js";import"./chunk-25MYHE4W.js";import"./chunk-H4K3F7PP.js";import"./chunk-5HBIIYSK.js";import"./chunk-RJ5VF3QY.js";import"./chunk-7UNQOKZW.js";import"./chunk-GB3YC4TI.js";import"./chunk-2KFYIYLI.js";import{b as No,d as it}from"./chunk-QBRRFFMZ.js";import"./chunk-Z2AV4BWZ.js";import{a as x}from"./chunk-LG3KEHGD.js";import{d as Po,e as Do}from"./chunk-I3WRA2LH.js";import{i as c,k as qo,l as J}from"./chunk-TD6JBHUS.js";import{a as ke,b as Da}from"./chunk-S3RROJGG.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-EVQPYZ7F.js";import"./chunk-636CTEW7.js";import"./chunk-WFPVT2IY.js";import"./chunk-AY3AAV77.js";import{Bb as P,Db as zo,Eb as f,Fb as oo,Gb as ro,N as Eo,Sa as Ce,V as _o,Z as oe,ba as Yt,ga as Kt,la as Ne,ta as Fe,tb as u,vb as d,zb as g}from"./chunk-ZMOW2YZ4.js";import{i as st}from"./chunk-B4OMIONW.js";import"./chunk-UU6UQ2QY.js";import"./chunk-5B76DT7X.js";import"./chunk-JJZNUFPD.js";import{b as s,c as nt,d as Wt,e as Qt}from"./chunk-3PYDIBTX.js";import"./chunk-DOLVBTCB.js";import{b as To}from"./chunk-QGQWVA7N.js";import{b as M}from"./chunk-AE3IQG7S.js";import"./chunk-R4E2E4NN.js";import"./chunk-JD5P5RAJ.js";import{e as G}from"./chunk-IWTNUJGY.js";import"./chunk-3KGN6N7E.js";import"./chunk-S4KNPCW3.js";import"./chunk-CQAD5WML.js";import"./chunk-I5A6BPCP.js";import"./chunk-O472FAYX.js";import"./chunk-IGE4Y5SE.js";import"./chunk-JFBCE4HN.js";import{e as R,g as n}from"./chunk-VKWPEFWQ.js";n();var Ea=R(Na(),1);n();n();n();n();function co(e){return lr(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}n();var $a=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function wt(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":$a.format(t)}function kt(e){let t=z(e);if(t)return t.split(".")[0]}function Pn(){let e=co().map(t=>({subdomain:kt(t.store)??t.store,connected:wt(t.acquiredAt),store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}}));return{sessions:e,...e.length===0?{message:Ua()}:{}}}function Ua(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
|
|
2
|
+
`)}n();n();n();var bt=s.object({id:s.number(),email:s.string().optional(),firstName:s.string().optional(),lastName:s.string().optional(),accountOwner:s.boolean().optional()}),ue=s.object({store:s.string(),userId:s.string(),scopes:s.array(s.string()),acquiredAt:s.string(),expiresAt:s.string().optional(),refreshTokenExpiresAt:s.string().optional(),associatedUser:bt.optional()}),be=x({name:"StoreAuthResult",schema:ue.omit({associatedUser:!0}).extend({hasRefreshToken:s.boolean(),associatedUser:ue.shape.associatedUser}),definitions:{StoreAuthAssociatedUser:bt}});var Dn=s.object({subdomain:s.string(),connected:s.string(),...ue.partial().shape,acquiredAt:ue.shape.acquiredAt.optional().describe("When the stored token was acquired, in ISO 8601 format."),expiresAt:ue.shape.expiresAt.describe("When the stored access token expires, in ISO 8601 format."),refreshTokenExpiresAt:ue.shape.refreshTokenExpiresAt.describe("When the stored refresh token expires, in ISO 8601 format.")}),vt=x({name:"StoreAuthListResult",schema:s.object({sessions:s.array(Dn),message:s.string().optional()}),definitions:{StoreAuthListSession:Dn,StoreAuthAssociatedUser:bt}});function Ln(e,t){if(t==="json"){g(vt.encode(e));return}za(e)}function za(e){if(e.sessions.length===0){P(e.message??"");return}he({rows:e.sessions.map(({subdomain:t,connected:o})=>({subdomain:t,connected:o})),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}var De=class e extends Q{static summary="List stores authenticated directly with store auth.";static descriptionWithMarkdown="Lists stores authenticated directly on this machine with `shopify store auth`.\n\nUse this command to find stores that can be used with store-authenticated commands such as `shopify store execute`.\nTo list stores in a Shopify organization, run `shopify store list`.";static jsonOutputSchema=vt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w};async run(){let{flags:t}=await this.parse(e),o=Pn();Ln(o,t.json?"json":"text")}};n();n();n();var Rn=13387,At="/auth/callback",uo="/auth/handoff";function qn(e){return`http://127.0.0.1:${e}${At}`}function $n(e,t){return`http://127.0.0.1:${e}${uo}?nonce=${encodeURIComponent(t)}`}function D(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function Un(e,t=300){return e.slice(0,t)}async function zn(e){let t=`https://${e.store}/admin/oauth/access_token`;f(d`Exchanging authorization code for token at ${u.raw(t)}`);let o=await Xt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:H,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw f(d`Token exchange failed with HTTP ${u.raw(String(o.status))}: ${u.raw(Un(r||o.statusText))}`),new c(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,r||o.statusText);let i;try{i=JSON.parse(r)}catch{throw new c("Received an invalid token response from Shopify.")}return f(d`Token exchange succeeded: access_token=${u.raw(D(i.access_token))}, refresh_token=${u.raw(i.refresh_token?D(i.refresh_token):"none")}, expires_in=${u.raw(String(i.expires_in??"unknown"))}s, user=${u.raw(String(i.associated_user?.id??"unknown"))} (${u.raw(i.associated_user?.email??"no email")})`),i}async function Bn(e){let t=`https://${e.store}/admin/oauth/access_token`;f(d`Refreshing access token for ${u.raw(e.store)} using refresh_token=${u.raw(D(e.refreshToken))}`);let o=await Xt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:H,grant_type:"refresh_token",refresh_token:e.refreshToken}),signal:e.signal}),r=await o.text();if(!o.ok)throw f(d`Token refresh failed with HTTP ${u.raw(String(o.status))}: ${u.raw(Un(r||o.statusText))}`),new c(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let i;try{i=JSON.parse(r)}catch{throw new c("Received an invalid refresh response from Shopify.")}if(!i.access_token)throw new c(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresIn:i.expires_in,refreshTokenExpiresIn:i.refresh_token_expires_in}}var Ba=`#graphql
|
|
3
3
|
query CurrentAppInstallationAccessScopes {
|
|
4
4
|
currentAppInstallation {
|
|
5
5
|
accessScopes {
|
|
@@ -7,7 +7,7 @@ import{a as gt}from"./chunk-IILLQOUC.js";import{a as ht,b as Dr}from"./chunk-SIL
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`;async function
|
|
10
|
+
`;async function jn(e){f(d`Fetching current app installation scopes for ${u.raw(e.store)} using token ${u.raw(D(e.accessToken))}`);let t=await ne({query:Ba,api:"Admin",url:ae(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!Array.isArray(t.currentAppInstallation?.accessScopes))throw new Error("Shopify did not return currentAppInstallation.accessScopes.");return t.currentAppInstallation.accessScopes.flatMap(o=>typeof o.handle=="string"?[o.handle]:[])}n();n();var po="<comma-separated-scopes>";function Hn(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function ja(e){return[[Hn(e,po)]]}function Mn(e,t,o){return[["Run",Hn(e,t),o]]}function Ha(e){return e.kind==="preview"?po:e.scopes.join(",")}function Gn(e){throw new c(`No stored app authentication found for ${e}.`,void 0,Mn(e,po,"to authenticate"))}function Le(e,t){throw new c(e,void 0,Mn(t.store,Ha(t),"to re-authenticate"))}function xt(e){let t=e.kind==="preview"?`The preview store ${e.store} has likely been claimed, so its stored authentication is no longer valid.`:`Stored app authentication for ${e.store} is no longer valid.`;Le(t,e)}function Jn(e){return new c("OAuth callback store does not match the requested store.",`Shopify returned ${e} during authentication. Re-run using the permanent store domain:`,ja(e))}import{timingSafeEqual as Ma}from"crypto";import{createServer as Ga}from"http";function Ja(e){let t=[e["sec-purpose"],e.purpose,e["x-moz"]].flat().join(" ");return t.includes("prefetch")||t.includes("prerender")}function Vn(e,t){let o=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return`<!doctype html>
|
|
11
11
|
<html lang="en">
|
|
12
12
|
<head>
|
|
13
13
|
<meta charset="utf-8" />
|
|
@@ -76,13 +76,13 @@ import{a as gt}from"./chunk-IILLQOUC.js";import{a as ht,b as Dr}from"./chunk-SIL
|
|
|
76
76
|
</main>
|
|
77
77
|
</div>
|
|
78
78
|
</body>
|
|
79
|
-
</html>`}async function Gn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let p=_(e);return new Promise((m,l)=>{let g=!1,O=!1,h=!1,L=setTimeout(()=>{C(new c("Timed out waiting for OAuth callback."))},r),U=Ba((E,v)=>{let ot=new URL(E.url??"/",`http://127.0.0.1:${o}`),ko=()=>{v.statusCode=404,v.setHeader("Cache-Control","no-store"),v.setHeader("Connection","close"),v.end("Not found")};if(ot.pathname===co){let me=ot.searchParams.get("nonce");if(!(a!==void 0&&!h&&E.method==="GET"&&me!==null&&Mn(me,a.nonce))||Ha(E.headers)){ko();return}h=!0,v.statusCode=302,v.setHeader("Location",a.authorizationUrl),v.setHeader("Cache-Control","no-store"),v.setHeader("Referrer-Policy","no-referrer"),v.setHeader("Connection","close"),v.end();return}if(ot.pathname!==vt){ko();return}let{searchParams:rt}=ot,_e=(me,xo)=>{let Oo=typeof me=="string"?new c(me,xo):me;v.statusCode=400,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>C(Oo)),v.end(jn("Authentication failed",Oo.message))},Mt=rt.get("shop");if(f(d`Received OAuth callback for shop ${u.raw(Mt??"unknown")}`),!Mt){_e("OAuth callback store does not match the requested store.");return}let bo=_(Mt);if(bo!==p){_e(Hn(bo));return}let vo=rt.get("state");if(!vo||!Mn(vo,t)){_e("OAuth callback state does not match the original request.");return}let Ao=rt.get("error");if(Ao){_e(`Shopify returned an OAuth error: ${Ao}`);return}let Gt=rt.get("code");if(!Gt){_e("OAuth callback did not include an authorization code.");return}f(d`Received authorization code ${u.raw(D(Gt))}`),v.statusCode=200,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>de(()=>m(Gt))),v.end(jn("Authentication succeeded","Close this window and return to the terminal"))}),de=E=>{if(g)return;g=!0,clearTimeout(L);let v=()=>{E()};if(!O){v();return}U.close(()=>{O=!1,v()}),U.closeIdleConnections?.()},C=E=>{de(()=>l(E))};U.on("error",E=>{if(E.code==="EADDRINUSE"){C(new c(`Port ${o} is already in use.`,`Free port ${o} and re-run ${u.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}C(E)}),U.listen(o,"127.0.0.1",()=>{O=!0,f(d`PKCE callback server listening on http://127.0.0.1:${u.raw(String(o))}${u.raw(vt)}`),i&&Promise.resolve(i()).catch(E=>{C(E instanceof Error?E:new Error(String(E)))})})})}function Mn(e,t){return e.length!==t.length?!1:za(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as ja,randomBytes as Jn}from"crypto";function Ma(){return Jn(32).toString("base64url")}function Ga(e){return ja("sha256").update(e).digest("base64url")}function Ja(e){let t=new URLSearchParams;return t.set("client_id",j),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function Va(e,t){let o=new URL(e);return o.searchParams.set("signup",t),{nonce:Jn(32).toString("base64url"),authorizationUrl:o.toString()}}function Vn(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Cn,p=nt(),m=Pn(a),l=Ma(),g=Ga(l),O=Ja({store:t,scopes:o,state:p,redirectUri:m,codeChallenge:g}),h=r?Va(O,r):void 0,L=h?Dn(a,h.nonce):O;return f(d`Starting PKCE auth for ${u.raw(t)} with scopes ${u.raw(o.join(","))} (redirect_uri=${u.raw(m)})`),{authorization:{store:t,scopes:o,state:p,port:a,redirectUri:m,authorizationUrl:L,codeVerifier:l},waitForAuthCodeOptions:{store:t,state:p,port:a,authorizationRedirect:h},exchangeCodeForToken:U=>i({store:t,code:U,codeVerifier:l,redirectUri:m})}}n();function mo(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new c("At least one scope is required.","Pass --scopes as a comma-separated list.");return Io(t)}function po(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function Wn(e,t){let o=[...t],r=po(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of po([i]))r.add(a)}return o}function Qn(e,t){if(!e.scope)return f(d`Token response did not include scope; falling back to requested scopes`),t;let o=mo(e.scope),r=po(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new c("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var Wa=240*1e3;function Qa(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Wa<Date.now()}function Ya(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function $(e){let t=Y(e);if(t||Bn(e),f(d`Loaded stored session for ${u.raw(e)}: token=${u.raw(D(t.accessToken))}, expires=${u.raw(t.expiresAt??"unknown")}`),!Qa(t))return t;t.refreshToken||Le(`No refresh token stored for ${t.store}.`,t),f(d`Refreshing expired token for ${u.raw(t.store)} (expired at ${u.raw(t.expiresAt??"unknown")}, refresh_token=${u.raw(D(t.refreshToken))})`);let o=t.accessToken,r={store:t.store,refreshToken:t.refreshToken},i;try{i=await qn(r)}catch(a){throw Se(t.store,t.userId),a instanceof c&&a.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&Le(a.message,t),a instanceof c&&a.message===`Token refresh returned an invalid response for ${t.store}.`&&Le(a.message,t),a instanceof c&&a.message==="Received an invalid refresh response from Shopify.",a}return t=Ya(t,i),f(d`Token refresh succeeded for ${u.raw(t.store)}: ${u.raw(D(o))} → ${u.raw(D(t.accessToken))}, new expiry ${u.raw(t.expiresAt??"unknown")}`),ge(t),t}function Yn(e,t=300){return e.slice(0,t)}function Ka(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return Yn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return Yn(e instanceof Error?e.message:String(e))}async function Kn(e){let t=_(e),o=Y(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await $(t),i=await $n({store:r.store,accessToken:r.accessToken});return f(d`Resolved current remote scopes for ${u.raw(t)}: ${u.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return f(d`Falling back to locally stored scopes for ${u.raw(t)} after remote scope lookup failed: ${u.raw(Ka(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Xa(e){return{completed:["Logged in.",`Authenticated${e.associatedUser?.email?` as ${e.associatedUser.email}`:""} against ${e.store}.`],info:["","To verify that authentication worked, run:",`shopify store execute --store ${e.store} --query 'query { shop { name id } }'`]}}function Za(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function es(e){return URL.canParse(e)?new URL(e).searchParams.has("signup"):!0}function ts(e,t={}){return t.sensitive||es(e)?(P("Browser did not open automatically. The manual authorization URL contains sensitive credentials and was not printed."),P("Run this command again in an environment where Shopify CLI can open a browser automatically."),P(""),!1):(P("Browser did not open automatically. Open this URL manually:"),P(d`${u.link(e)}`),P(""),!0)}function os(e,t="text"){if(t==="json"){S(be.encode(e));return}let o=Xa(e);o.completed.forEach(r=>Uo(r)),o.info.forEach(r=>P(r))}function ve(e="text"){return{openingBrowser:Za,manualAuthUrl:ts,success(t){os(t,e)}}}n();async function N(e,t,o){await Po(()=>({store_fqdn:e})),await Co(()=>({store_fqdn_hash:_o(e),store_fqdn_validated:t,store_domain:e,store_id:Eo(o)}))}var rs={openURL:ct,waitForStoreAuthCode:Gn,exchangeStoreAuthCodeForToken:Rn,resolveExistingScopes:Kn,getCurrentStoredStoreAppSession:Y,presenter:ve("text")};async function xt(e,t={}){let o={...rs,...t},r=_(e.store);if(ns(r,o),To())throw new c("Store authentication requires browser interaction, but user input is disabled.","Remove `--no-input` and run the command in an interactive terminal.");await N(r,!1);let i=mo(e.scopes),a=await o.resolveExistingScopes(r),p=Wn(i,a.scopes),m=a.authoritative?p:i;a.scopes.length>0&&f(d`Merged requested scopes ${u.raw(i.join(","))} with existing scopes ${u.raw(a.scopes.join(","))} for ${u.raw(r)}`);let l=Vn({store:r,scopes:p,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:g}}=l;o.presenter.openingBrowser();let O=await o.waitForStoreAuthCode({...l.waitForAuthCodeOptions,onListening:async()=>{if(await o.openURL(g))return;if(!o.presenter.manualAuthUrl(g))throw new c("Authentication can't continue without a browser.")}}),h=await l.exchangeCodeForToken(O);await N(r,!0);let L=h.associated_user?.id?.toString();if(!L)throw new c("Shopify did not return associated user information for the online access token.");q(L);let U=Date.now(),de=h.expires_in?new Date(U+h.expires_in*1e3).toISOString():void 0,C={store:r,userId:L,scopes:Qn(h,m),acquiredAt:new Date(U).toISOString(),expiresAt:de,refreshTokenExpiresAt:h.refresh_token_expires_in?new Date(U+h.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!h.refresh_token,associatedUser:h.associated_user?{id:h.associated_user.id,email:h.associated_user.email,firstName:h.associated_user.first_name,lastName:h.associated_user.last_name,accountOwner:h.associated_user.account_owner}:void 0};return ge({store:r,clientId:j,userId:L,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:C.scopes,acquiredAt:C.acquiredAt,expiresAt:de,refreshTokenExpiresAt:C.refreshTokenExpiresAt,associatedUser:C.associatedUser}),f(d`Session persisted for ${u.raw(r)} (user ${u.raw(L)}, expires ${u.raw(de??"unknown")})`),o.presenter.success(C),C}function ns(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new c("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
|
|
79
|
+
</html>`}async function Qn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let p=_(e);return new Promise((m,l)=>{let S=!1,O=!1,h=!1,L=setTimeout(()=>{C(new c("Timed out waiting for OAuth callback."))},r),U=Ga((E,v)=>{let ot=new URL(E.url??"/",`http://127.0.0.1:${o}`),bo=()=>{v.statusCode=404,v.setHeader("Cache-Control","no-store"),v.setHeader("Connection","close"),v.end("Not found")};if(ot.pathname===uo){let me=ot.searchParams.get("nonce");if(!(a!==void 0&&!h&&E.method==="GET"&&me!==null&&Wn(me,a.nonce))||Ja(E.headers)){bo();return}h=!0,v.statusCode=302,v.setHeader("Location",a.authorizationUrl),v.setHeader("Cache-Control","no-store"),v.setHeader("Referrer-Policy","no-referrer"),v.setHeader("Connection","close"),v.end();return}if(ot.pathname!==At){bo();return}let{searchParams:rt}=ot,_e=(me,Oo)=>{let Io=typeof me=="string"?new c(me,Oo):me;v.statusCode=400,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>C(Io)),v.end(Vn("Authentication failed",Io.message))},Gt=rt.get("shop");if(f(d`Received OAuth callback for shop ${u.raw(Gt??"unknown")}`),!Gt){_e("OAuth callback store does not match the requested store.");return}let vo=_(Gt);if(vo!==p){_e(Jn(vo));return}let Ao=rt.get("state");if(!Ao||!Wn(Ao,t)){_e("OAuth callback state does not match the original request.");return}let xo=rt.get("error");if(xo){_e(`Shopify returned an OAuth error: ${xo}`);return}let Jt=rt.get("code");if(!Jt){_e("OAuth callback did not include an authorization code.");return}f(d`Received authorization code ${u.raw(D(Jt))}`),v.statusCode=200,v.setHeader("Content-Type","text/html"),v.setHeader("Connection","close"),v.once("finish",()=>de(()=>m(Jt))),v.end(Vn("Authentication succeeded","Close this window and return to the terminal"))}),de=E=>{if(S)return;S=!0,clearTimeout(L);let v=()=>{E()};if(!O){v();return}U.close(()=>{O=!1,v()}),U.closeIdleConnections?.()},C=E=>{de(()=>l(E))};U.on("error",E=>{if(E.code==="EADDRINUSE"){C(new c(`Port ${o} is already in use.`,`Free port ${o} and re-run ${u.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}C(E)}),U.listen(o,"127.0.0.1",()=>{O=!0,f(d`PKCE callback server listening on http://127.0.0.1:${u.raw(String(o))}${u.raw(At)}`),i&&Promise.resolve(i()).catch(E=>{C(E instanceof Error?E:new Error(String(E)))})})})}function Wn(e,t){return e.length!==t.length?!1:Ma(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as Va,randomBytes as Yn}from"crypto";function Wa(){return Yn(32).toString("base64url")}function Qa(e){return Va("sha256").update(e).digest("base64url")}function Ya(e){let t=new URLSearchParams;return t.set("client_id",H),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function Ka(e,t){let o=new URL(e);return o.searchParams.set("signup",t),{nonce:Yn(32).toString("base64url"),authorizationUrl:o.toString()}}function Kn(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Rn,p=it(),m=qn(a),l=Wa(),S=Qa(l),O=Ya({store:t,scopes:o,state:p,redirectUri:m,codeChallenge:S}),h=r?Ka(O,r):void 0,L=h?$n(a,h.nonce):O;return f(d`Starting PKCE auth for ${u.raw(t)} with scopes ${u.raw(o.join(","))} (redirect_uri=${u.raw(m)})`),{authorization:{store:t,scopes:o,state:p,port:a,redirectUri:m,authorizationUrl:L,codeVerifier:l},waitForAuthCodeOptions:{store:t,state:p,port:a,authorizationRedirect:h},exchangeCodeForToken:U=>i({store:t,code:U,codeVerifier:l,redirectUri:m})}}n();function lo(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new c("At least one scope is required.","Pass --scopes as a comma-separated list.");return Eo(t)}function mo(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function Xn(e,t){let o=[...t],r=mo(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of mo([i]))r.add(a)}return o}function Zn(e,t){if(!e.scope)return f(d`Token response did not include scope; falling back to requested scopes`),t;let o=lo(e.scope),r=mo(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new c("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var Xa=240*1e3;function Za(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Xa<Date.now()}function es(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function $(e,t){t?.throwIfAborted();let o=Y(e);if(o||Gn(e),f(d`Loaded stored session for ${u.raw(e)}: token=${u.raw(D(o.accessToken))}, expires=${u.raw(o.expiresAt??"unknown")}`),!Za(o))return o;o.refreshToken||Le(`No refresh token stored for ${o.store}.`,o),f(d`Refreshing expired token for ${u.raw(o.store)} (expired at ${u.raw(o.expiresAt??"unknown")}, refresh_token=${u.raw(D(o.refreshToken))})`);let r=o.accessToken,i={store:o.store,refreshToken:o.refreshToken,...t?{signal:t}:{}},a;try{a=await Bn(i)}catch(p){throw t?.aborted||(ge(o.store,o.userId),p instanceof c&&p.message.startsWith(`Token refresh failed for ${o.store} (HTTP `)&&Le(p.message,o),p instanceof c&&p.message===`Token refresh returned an invalid response for ${o.store}.`&&Le(p.message,o),p instanceof c&&p.message==="Received an invalid refresh response from Shopify."),p}return o=es(o,a),f(d`Token refresh succeeded for ${u.raw(o.store)}: ${u.raw(D(r))} → ${u.raw(D(o.accessToken))}, new expiry ${u.raw(o.expiresAt??"unknown")}`),Se(o),o}function ei(e,t=300){return e.slice(0,t)}function ts(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return ei(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return ei(e instanceof Error?e.message:String(e))}async function ti(e){let t=_(e),o=Y(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await $(t),i=await jn({store:r.store,accessToken:r.accessToken});return f(d`Resolved current remote scopes for ${u.raw(t)}: ${u.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return f(d`Falling back to locally stored scopes for ${u.raw(t)} after remote scope lookup failed: ${u.raw(ts(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function os(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 rs(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function ns(e){return URL.canParse(e)?new URL(e).searchParams.has("signup"):!0}function is(e,t={}){return t.sensitive||ns(e)?(P("Browser did not open automatically. The manual authorization URL contains sensitive credentials and was not printed."),P("Run this command again in an environment where Shopify CLI can open a browser automatically."),P(""),!1):(P("Browser did not open automatically. Open this URL manually:"),P(d`${u.link(e)}`),P(""),!0)}function as(e,t="text"){if(t==="json"){g(be.encode(e));return}let o=os(e);o.completed.forEach(r=>zo(r)),o.info.forEach(r=>P(r))}function ve(e="text"){return{openingBrowser:rs,manualAuthUrl:is,success(t){as(t,e)}}}n();async function N(e,t,o){await Do(()=>({store_fqdn:e})),await Po(()=>({store_fqdn_hash:No(e),store_fqdn_validated:t,store_domain:e,store_id:_o(o)}))}var ss={openURL:ut,waitForStoreAuthCode:Qn,exchangeStoreAuthCodeForToken:zn,resolveExistingScopes:ti,getCurrentStoredStoreAppSession:Y,presenter:ve("text")};async function Ot(e,t={}){let o={...ss,...t},r=_(e.store);if(cs(r,o),To())throw new c("Store authentication requires browser interaction, but user input is disabled.","Remove `--no-input` and run the command in an interactive terminal.");await N(r,!1);let i=lo(e.scopes),a=await o.resolveExistingScopes(r),p=Xn(i,a.scopes),m=a.authoritative?p:i;a.scopes.length>0&&f(d`Merged requested scopes ${u.raw(i.join(","))} with existing scopes ${u.raw(a.scopes.join(","))} for ${u.raw(r)}`);let l=Kn({store:r,scopes:p,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:S}}=l;o.presenter.openingBrowser();let O=await o.waitForStoreAuthCode({...l.waitForAuthCodeOptions,onListening:async()=>{if(await o.openURL(S))return;if(!o.presenter.manualAuthUrl(S))throw new c("Authentication can't continue without a browser.")}}),h=await l.exchangeCodeForToken(O);await N(r,!0);let L=h.associated_user?.id?.toString();if(!L)throw new c("Shopify did not return associated user information for the online access token.");q(L);let U=Date.now(),de=h.expires_in?new Date(U+h.expires_in*1e3).toISOString():void 0,C={store:r,userId:L,scopes:Zn(h,m),acquiredAt:new Date(U).toISOString(),expiresAt:de,refreshTokenExpiresAt:h.refresh_token_expires_in?new Date(U+h.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!h.refresh_token,associatedUser:h.associated_user?{id:h.associated_user.id,email:h.associated_user.email,firstName:h.associated_user.first_name,lastName:h.associated_user.last_name,accountOwner:h.associated_user.account_owner}:void 0};return Se({store:r,clientId:H,userId:L,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:C.scopes,acquiredAt:C.acquiredAt,expiresAt:de,refreshTokenExpiresAt:C.refreshTokenExpiresAt,associatedUser:C.associatedUser}),f(d`Session persisted for ${u.raw(r)} (user ${u.raw(L)}, expires ${u.raw(de??"unknown")})`),o.presenter.success(C),C}function cs(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new c("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
|
|
80
80
|
|
|
81
|
-
Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends Q{};n();var F=R(M(),1),
|
|
81
|
+
Run \`shopify store info --store ${e} --json\` to view this list again at any time.`,["Run `shopify store execute` directly against the preview store; no `store auth` step is needed."])}n();var k=class extends Q{};n();var F=R(M(),1),us="Country must be a two-letter country code, for example: US.";function ps(e){return/^[A-Z]{2}$/.test(e)}var It=F.Flags.string({description:"Two-letter country code for the store, such as US, CA, or GB. Follows the ISO 3166-1 alpha-2 standard.",env:"SHOPIFY_FLAG_STORE_COUNTRY",required:!1,parse:async e=>{let t=e.trim().toUpperCase();if(!ps(t))throw new c(us);return t}}),b={store:F.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>_(e),required:!0}),"organization-id":F.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},oi={env:"SHOPIFY_FLAG_ID",parse:async e=>hr(e)},ri=F.Flags.string({...oi,description:"The bulk operation ID (numeric ID or full GID). If not provided, lists all bulk operations on this store in the last 7 days."}),ni=F.Flags.string({...oi,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),ii={query:F.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":F.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>G(e),exactlyOne:["query","query-file"]}),variables:F.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":F.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>G(e),exclusive:["variables"]}),watch:F.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":F.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:F.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"allow-mutations":F.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var ai=R(M(),1),Re=class e extends k{static summary="Authenticate an app against a store for store commands.";static descriptionWithMarkdown=`Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
|
|
82
82
|
|
|
83
|
-
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];static flags={...y,...w,store:b.store,scopes:
|
|
84
|
-
`,{command:`shopify store bulk status --id=${ye(r.id)}`}]:i.body,p={headline:i.headline,...a&&{body:a},...i.customSections&&{customSections:i.customSections}};switch(i.renderType){case"success":
|
|
85
|
-
`);if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);return Ne(t,{encoding:"utf8"})}else return}async function
|
|
83
|
+
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;static jsonOutputSchema=be;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];static flags={...y,...w,store:b.store,scopes:ai.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0})};async run(){let{flags:t}=await this.parse(e);await Ot({store:t.store,scopes:t.scopes},{presenter:ve(t.json?"json":"text")})}};n();n();async function si(e){let t=await br(e);return{store:e.adminSession.storeFqdn,apiVersion:e.version??se,operation:t?.bulkOperation??null,userErrors:t?.userErrors??[]}}n();async function Ae(e){le();let t=await $(e);return await N(t.store,!0),q(t.userId),{token:t.accessToken,storeFqdn:t.store}}n();n();var mi=s.string().regex(/^gid:\/\/shopify\/BulkOperation\/[^/]+$/).describe("The Shopify global ID of a bulk operation."),pe=s.object({gid:mi,type:s.string(),status:s.string(),errorCode:s.string().nullable(),createdAt:Wt,completedAt:Wt.nullable(),objectCount:s.string().regex(/^\d+$/).describe("A nonnegative decimal count, without loss of integer precision."),url:s.string().url().nullable(),partialDataUrl:s.string().url().nullable()}).strict(),li=pe.omit({type:!0}),Tt=s.object({storeDomain:nt.nullable(),apiVersion:s.string().nullable().describe("The API version selected for the request.")}).strict(),Et=x({name:"CancelBulkOperationResult",schema:Tt.extend({status:s.literal("success"),operation:pe}),definitions:{BulkOperation:pe}}),ci=Tt.extend({status:s.enum(["success","partial","cancelled"]),reason:s.literal("watch-aborted").optional(),operation:pe,resultsJsonl:s.string().optional().describe("Downloaded results in their native JSONL format.")}),ui=s.object({path:s.string().describe("The absolute path of the downloaded results file."),format:s.literal("jsonl")}).strict(),qe=x({name:"ExecuteBulkOperationResult",schema:s.union([ci,ui]),definitions:{BulkOperation:pe,ExecuteBulkOperationResult:ci,BulkOperationFile:ui}}),pi=Tt.extend({operationGid:mi,operation:pe.nullable()}),di=Tt.extend({operations:s.array(li),pageInfo:s.object({hasNextPage:s.boolean().nullable().describe("Unknown when the API result reaches the fetch limit.")}).strict()}),_t=x({name:"BulkOperationStatusResult",schema:s.union([pi,di]),definitions:{GetBulkOperationStatusResult:pi,ListBulkOperationsResult:di,BulkOperation:pe,ListedBulkOperation:li}});n();function X(e){let t=re(e.store);return{storeDomain:t?`${t}.myshopify.com`:null,apiVersion:e.apiVersion??null}}function Z(e){if(typeof e.objectCount=="number"&&!Number.isSafeInteger(e.objectCount))throw new J("Shopify returned a bulk operation count that can't be represented exactly.");return{gid:e.id,..."type"in e?{type:e.type}:{},status:e.status,errorCode:e.errorCode??null,createdAt:Qt(new Date(String(e.createdAt))),completedAt:e.completedAt?Qt(new Date(String(e.completedAt))):null,objectCount:String(e.objectCount),url:e.url??null,partialDataUrl:e.partialDataUrl??null}}function fi(e,t,o){if(o==="json"){if(e.userErrors.length||!e.operation){let i=new c("Failed to cancel bulk operation.");throw i.details={...X(e),operationGid:t,userErrors:e.userErrors},i}g(Et.encode({...X(e),status:"success",operation:Z(e.operation)}));return}if(e.userErrors.length){vr(e.userErrors,"Failed to cancel bulk operation.");return}let r=e.operation;if(r){let i=Ar(r),a=r.status==="CANCELING"?[`This may take a few moments. Check the status with:
|
|
84
|
+
`,{command:`shopify store bulk status --id=${ye(r.id)}`}]:i.body,p={headline:i.headline,...a&&{body:a},...i.customSections&&{customSections:i.customSections}};switch(i.renderType){case"success":T(p);break;case"warning":ie(p);break;case"info":I(p);break}}else W({headline:"Bulk operation not found or could not be canceled.",body:d`ID: ${u.yellow(t)}`.value})}n();n();function hi(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function Si(e,t=!1){if(we(e)&&!t)throw new c("Mutations are disabled by default for shopify store bulk execute.","Re-run with --allow-mutations if you intend to modify store data.")}function xe(e,t){let o=[...t.operationId?[`ID: ${t.operationId}`]:[],...hi(t)];I({headline:e,body:[{list:{items:o}}]})}var $e=class e extends k{static summary="Cancel a bulk operation on a store.";static descriptionWithMarkdown="Cancels a running bulk operation by ID, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.";static jsonOutputSchema=Et;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:ni};async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await Ae(t.store);xe("Canceling bulk operation.",{storeFqdn:r.storeFqdn,operationId:t.id});let i=await si({adminSession:r,operationId:t.id});fi(i,t.id,o)}};n();n();async function ds(e,t){if(e)return e.join(`
|
|
85
|
+
`);if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);return Ne(t,{encoding:"utf8"})}else return}async function gi(e){let{store:t,query:o,variables:r,variableFile:i,watch:a=!1,version:p,allowMutations:m=!1}=e;Si(o,m);let{adminSession:l,version:S}=await j({title:d`Authenticating`,task:async()=>{let h=await Ae(t),L=await Pe({adminSession:h,userSpecifiedVersion:p,minimumDefaultVersion:se});return{adminSession:h,version:L}},renderOptions:{stdout:process.stderr}}),O=await ds(r,i);return ms(o,O),{adminSession:l,version:S,query:o,variablesJsonl:O,watch:a}}async function yi(e){let{adminSession:t,version:o,query:r,variablesJsonl:i,watch:a}=e,p=we(r)?await yr({adminSession:t,query:r,variablesJsonl:i,version:o}):await gr({adminSession:t,query:r,version:o});if(p?.userErrors?.length||!p?.bulkOperation)return{store:t.storeFqdn,apiVersion:o,operation:p?.bulkOperation??null,userErrors:p?.userErrors??[],watchAborted:!1};let m=new Fo,l=a?await Or(t,p.bulkOperation.id,m.signal,()=>m.abort()):await xr(t,p.bulkOperation.id),S=a&&!m.signal.aborted&&l.status==="COMPLETED"&&l.url?await Ir(l.url):void 0;return{store:t.storeFqdn,apiVersion:o,operation:l,userErrors:[],watchAborted:m.signal.aborted,results:S}}function ms(e,t){if(we(e)&&!t)throw new c(d`Bulk mutations require variables. Provide a JSONL file with ${u.yellow("--variable-file")} or individual JSON objects with ${u.yellow("--variables")}.`);if(!we(e)&&t)throw new c(d`The ${u.yellow("--variables")} and ${u.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}n();async function wi(e,t){let{format:o,watch:r,outputFile:i}=t,{operation:a,userErrors:p,watchAborted:m,results:l}=e;if(!a&&p.length===0)throw ie({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new J("Bulk operation response returned null with no error message.");if(o==="json"){if(p.length||a&&["FAILED","CANCELED","EXPIRED"].includes(a.status)){let h=new c("Bulk operation failed.");throw h.details={...X(e),operation:a?Z(a):null,userErrors:p},h}if(!a)throw new J("Bulk operation response returned no operation.");let S=l!==void 0&&no(l),O=S?"partial":"success";if(m&&(O="cancelled"),S&&(process.exitCode=1),i&&l===void 0&&!m)throw new c("No results are available to write to the output file.");if(i&&l!==void 0){let h=G(i);await Fe(h,l),g(qe.encode({path:h,format:"jsonl"}))}else g(qe.encode({...X(e),status:O,...m?{reason:"watch-aborted"}:{},operation:Z(a),...l===void 0?{}:{resultsJsonl:l}}));return}if(i&&l!==void 0&&await Fe(i,l),p.length){W({headline:"Error creating bulk operation.",body:{list:{items:p.map(S=>S.field?`${S.field.join(".")}: ${S.message}`:S.message)}}});return}a&&(m?I({headline:`Bulk operation ${a.id} is still running in the background.`,body:Nt(a.id)}):r||["FAILED","CANCELED","EXPIRED"].includes(a.status)?ls(a,l,i):T({headline:"Bulk operation is running.",body:Nt(a.id),customSections:[{body:[{list:{items:[d`ID: ${u.cyan(a.id)}`.value]}}]}]}))}function ls(e,t,o){let r=mt(e).value,a=[{body:[{list:{items:[d`ID: ${u.cyan(e.id)}`.value,d`Status: ${u.yellow(e.status)}`.value,d`Created at: ${u.gray(String(e.createdAt))}`.value,...e.completedAt?[d`Completed at: ${u.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":T({headline:"Bulk operation started.",body:Nt(e.id),customSections:a});break;case"RUNNING":T({headline:"Bulk operation is running.",body:Nt(e.id),customSections:a});break;case"COMPLETED":if(t===void 0)T({headline:r,customSections:a});else{let p=no(t);o||g(t),p?ie({headline:"Bulk operation completed with errors.",body:o?`Results written to ${o}. Check file for error details.`:"Check results for error details.",customSections:a}):T({headline:r,body:o?[`Results written to ${o}`]:void 0,customSections:a})}break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":W({headline:r,customSections:a});break}}function Nt(e){return[`Monitor its progress with:
|
|
86
86
|
`,{command:`shopify store bulk status --id=${ye(e)}`}]}var Ue=class e extends k{static summary="Execute bulk operations on a store.";static descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store as a bulk operation, using previously stored app authentication.
|
|
87
87
|
|
|
88
88
|
Run \`shopify store auth\` first to create stored auth for the store.
|
|
@@ -91,14 +91,14 @@ Re-run this command if the stored token is missing, expires, or no longer has th
|
|
|
91
91
|
|
|
92
92
|
Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.
|
|
93
93
|
|
|
94
|
-
Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];static flags={...y,...w,store:b.store,...ti};static get jsonOutputSchema(){return qe}async run(){let{flags:t}=await this.parse(e),o=await fr({query:t.query,queryFile:t["query-file"]}),r=await li({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,allowMutations:t["allow-mutations"],...t.version&&{version:t.version}}),i=t.json?"json":"text";xe("Starting bulk operation.",{storeFqdn:r.adminSession.storeFqdn,version:r.version});let a=await fi(r);await hi(a,{format:i,watch:r.watch,outputFile:t["output-file"]})}};n();n();async function gi(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await Sr({...e,version:t});return{store:e.adminSession.storeFqdn,apiVersion:t,operationId:e.operationId,operation:o??null}}async function Si(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await yr({...e,version:t,first:100});return{store:e.adminSession.storeFqdn,apiVersion:t,operations:o}}n();function yi(e,t){if(t==="json"){S(Et.encode({...X(e),..."operation"in e?{operationGid:e.operationId,operation:e.operation?Z(e.operation):null}:{operations:e.operations.map(Z),pageInfo:{hasNextPage:e.operations.length<100?!1:null}}}));return}if("operation"in e){e.operation?ps(e.operation):W({headline:"Bulk operation not found.",body:d`ID: ${u.yellow(e.operationId)}`.value});return}let o=e.operations.map(r=>({id:ye(r.id),status:ms(r.status),count:ls(r.objectCount),dateCreated:Qt(new Date(String(r.createdAt))),dateFinished:r.completedAt?Qt(new Date(String(r.completedAt))):"",results:fs(r.url??r.partialDataUrl)}));oo(),o.length===0?T({body:"No bulk operations found in the last 7 days."}):he({rows:o,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),oo()}function ps(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:p}=e,m=dt(e).value,l=ds(r,i),g=d`ID: ${u.yellow(t)}\n${l}`.value;if(o==="COMPLETED"){let O=a?u.link("Download results",a):"";I({headline:m,body:d`${g}\n${O}`.value})}else if(o==="FAILED"){let O=p?u.link("Download partial results",p):"";W({headline:m,body:d`${g}\n${O}`.value})}else T({headline:m,body:g})}function ds(e,t){let o=new Date;return t?`Finished ${Yt(new Date(String(t)),o)}`:`Started ${Yt(new Date(String(e)),o)}`}function ms(e){return e==="COMPLETED"?at.green(e):e==="FAILED"?at.red(e):at.dim(e)}function ls(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function fs(e){return e?d`${u.link("download",e)}`.value:""}var ze=class e extends k{static summary="Check the status of bulk operations on a store.";static descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:Zn};static get jsonOutputSchema(){return Et}async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await Ae(t.store);xe(t.id?"Checking bulk operation status.":"Listing bulk operations.",{storeFqdn:r.storeFqdn});let i=t.id?await gi({adminSession:r,operationId:t.id}):await Si({adminSession:r});yi(i,o)}};n();var lo=R(M(),1),Be=class e extends k{static hidden=!0;static summary="Authenticate for store commands.";static descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup or stdin.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","printf %s <signup-jwt> | <%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];static flags={...y,...w,store:b.store,scopes:lo.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:lo.Flags.string({description:"Provide JWT for the store. When omitted, the JWT is read from stdin.",env:"SHOPIFY_FLAG_SIGNUP",required:!1})};static get jsonOutputSchema(){return be}async run(){let{flags:t}=await this.parse(e),o=gs(t.signup)??await Ss();await xt({store:t.store,scopes:t.scopes,signup:o},{presenter:ve(t.json?"json":"text")})}},hs=8*1024,wi="Missing signup JWT.",ki="Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.";function gs(e){let t=e?.trim();return t===""?void 0:t}async function Ss(e=process.stdin){if(e===process.stdin&&!$o())throw new c(wi,ki);let t=[],o=0;for await(let i of e){let a=Buffer.isBuffer(i)?i:Buffer.from(i);if(o+=a.length,o>hs)throw new c("The input piped to stdin is too large to be a signup JWT.","Pipe only the signup JWT.");t.push(a)}let r=Buffer.concat(t).toString("utf8").trim();if(!r)throw new c(wi,ki);return r}n();n();n();var Oe=s.object({error:s.literal(!0),message:s.string(),nextSteps:s.array(s.unknown()).describe("Suggested next steps, as text or formatted UI tokens."),exitCode:s.literal(1)});var fo=x({name:"CreateDevStoreResult",schema:s.union([io.schema,Oe]),definitions:{...io.definitions,StoreCommandError:Oe}});n();var bi={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var vi=_r,Ai=Nr,xi=Fr;var He=R(M(),1),je=class e extends Q{static summary="Create a new dev store.";static descriptionWithMarkdown="Creates a new dev store in your organization.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>",'<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --demo-data','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --json'];static flags={...y,...w,name:pt(He.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":pt(b["organization-id"]),plan:pt(He.Flags.string({description:"The Shopify plan to use for the new dev store.",options:no,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":He.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":He.Flags.boolean({description:"Populate the new dev store with demo data.",allowNo:!0,env:"SHOPIFY_FLAG_STORE_DEMO_DATA"}),country:Ot};static get jsonOutputSchema(){return fo}async run(){let{flags:t}=await this.parse(e),o=await lt(t["organization-id"]?.toString()),r=t.name??await vi(),i=t.plan??await Ai(),a=t["demo-data"]??(ut()?await xi():!1);try{await ao({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:a,country:t.country,json:t.json})}catch(p){throw t.json&&p instanceof c&&(S(fo.encode({error:!0,message:p.message,nextSteps:p.nextSteps??[],exitCode:1})),process.exit(1)),p}}};n();n();n();var ys="X-Shopify-CLI-Instance",ws="X-Shopify-CLI-Version",Oi;function ks(){return Oi??=new Fo({projectName:"shopify-cli-store"}),Oi}var Me=class extends c{status;constructor(t,o,r){super(o,r??null),this.status=t}};function Ti(e=ks()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=nt();return e.set("cliInstanceId",o),o}function Ii(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${Jt}`,[ys]:e,[ws]:Jt}}function bs(e){return Ii(e)}function vs(e,t){return{...Ii(e),authorization:t,"X-Shopify-Access-Token":t}}async function Ei(e,t={}){let r=`https://${await Zt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await Xt(r,{method:"POST",headers:bs(Ti(t.storage)),body:i}),p=await a.text();if(!a.ok){let l=As(a.status,p);throw new c(l.message,l.tryMessage)}let m;try{m=JSON.parse(p)}catch(l){let g=l instanceof Error?l.message:"Unknown error";throw new c("Preview store creation returned a non-JSON response.",`Parse error: ${g}. Body (truncated): ${Nt(p).slice(0,500)}`)}return Os(m)}async function _i(e,t={}){let r=`https://${await Zt()}/services/preview-stores/${e.shopId}`,i=await Xt(r,{method:"GET",headers:vs(Ti(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=xs(i.status,a);throw new Me(i.status,m.message,m.tryMessage)}let p;try{p=JSON.parse(a)}catch(m){let l=m instanceof Error?m.message:"Unknown error";throw new c("Preview store lookup returned a non-JSON response.",`Parse error: ${l}. Body (truncated): ${Nt(a).slice(0,500)}`)}return Ts(p)}function As(e,t){let o=Ni(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=Nt(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Ni(e){if(e.length===0)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object")return{};let o=t;return{...typeof o.error_code=="string"?{error_code:o.error_code}:{},...typeof o.message=="string"?{message:o.message}:{}}}catch(t){if(t instanceof SyntaxError)return{};throw t}}function xs(e,t){let o=Ni(t),r=Nt(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function Os(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,p=typeof e.access_url=="string"?e.access_url:void 0,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,l=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(g=>typeof g=="string"):void 0;if(!o||!r||!i||!a||!p||!l)throw new c("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(Is(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:l,accessUrl:p,...m?{placeholderAccountUuid:m}:{}}}function Ts(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,p=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new c("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(Es(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...p?{claimUrl:p}:{}}}function Is(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Nt(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function Es(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var _s={createPreviewStore:Ei,setStoredStoreAppSession:ge,recordStoreFqdnMetadata:N,setLastSeenUserId:q,now:()=>new Date};async function Fi(e,t={}){let o={..._s,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Fs(r,e.country,o)}function Ns(e){return e.placeholderAccountUuid??e.shop.id}async function Fs(e,t,o){let r=o.now().toISOString(),i=Ns(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:j,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl,type:"preview",authScopes:e.adminApiScopes},next_steps:Cs(e.shop.domain)}}function Cs(e){return[`Use \`shopify store open --store ${e}\` to preview the storefront.`,`Use \`shopify store execute --store ${e}\` to add products, collections, pages, and more.`,`Use \`shopify theme pull --store ${e}\` and \`shopify theme push --store ${e}\` to edit your store design.`]}n();n();var Ci=A.pick({id:!0,name:!0,subdomain:!0,country:!0}).extend({storefrontUrl:s.string(),type:s.literal("preview").optional(),authScopes:A.shape.authScopes.describe("Preapproved Admin API scopes for the preview store.")}),Ft=x({name:"CreatePreviewStoreResult",schema:s.object({status:s.literal("success"),message:s.string(),store:Ci,next_steps:s.array(s.string())}),definitions:{PreviewStore:Ci}});function Pi(e,t){if(t==="json"){S(Ft.encode(e));return}Ds(e)}function Ps(e){return e.split(/(`[^`]+`)/).map(t=>t.startsWith("`")&&t.endsWith("`")?{command:t.slice(1,-1)}:t)}function Ds(e){I({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:e.next_steps.map(Ps)}}}]})}var Di=R(M(),1),Ge=class e extends k{static summary="Create a preview Shopify store.";static descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];static flags={...y,...w,name:Di.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:Ot};static get jsonOutputSchema(){return Ft}async run(){let{flags:t}=await this.parse(e),o=await H({title:d`Creating store`,task:async()=>Fi({name:t.name,country:t.country})});Pi(o,t.json?"json":"text")}};n();n();var Li=s.object({domain:A.shape.subdomain,deletionRequested:s.literal(!0),deletionConfirmed:s.boolean()}),Je=x({name:"DeleteDevStoreResult",schema:s.union([s.object({store:Li,organization:ce,message:s.string().optional()}),Oe]),definitions:{DeletedStore:Li,StoreOrganization:ce,StoreCommandError:Oe}});n();n();n();n();var Ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"5"}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"developerPreviewHandle"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"ownerDetails"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function qi(e){let t=await Ve(e);if(!t)throw new c(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return t}async function Ve(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r={id:e.organizationId,businessName:e.organizationName},a=(await K(r,{query:Ri,token:t,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],p=e.store.toLowerCase(),m=a.find(l=>z(l.node.primaryDomain)===p)?.node;if(m)return{shopifyShopId:m.shopifyShopId??void 0,name:m.name,primaryDomain:m.primaryDomain??void 0,storeType:m.storeType??void 0,developerPreviewHandle:m.developerPreviewHandle??void 0,planName:m.planName??void 0,ownerName:m.ownerDetails?.fullName??void 0,ownerEmail:m.ownerDetails?.email??void 0}}n();var $i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"storeFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var Ui={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationAccessibleShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopifyShopID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShop"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ls="cancelled",Rs=5,qs=300*1e3;async function Bi(e){let{organization:t,store:o}=e,r=await B([],{allowAutomationToken:!0}),i=V(),a=await zi({store:o,organization:t,token:r}),m=(await K(t,{query:$i,token:r,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!m)throw new c("Store deletion failed: unexpected empty response.");let l=m.userErrors;if(l&&l.length>0){let O=l.map(h=>h.message).join(", ");throw new c(`Failed to delete dev store: ${O}`)}if(m.success===!1)throw new c("Store deletion failed.");a??=await zi({store:o,organization:t,token:r});let g=a?await Us({shopifyShopId:a,organization:t,token:r,unauthorizedHandler:i}):!1;e.json?S(Bs({store:o,organization:t,deletionConfirmed:g})):g?I({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):ie({headline:`Dev store "${o}" deletion was requested, but not confirmed.`,body:["Shopify accepted the deletion request, but deletion was not confirmed before the CLI stopped waiting.","The store may still finish deleting asynchronously."]})}async function zi(e){let{store:t,organization:o,token:r}=e;return(await Ve({store:t,organizationId:o.id,organizationName:o.businessName,token:r}))?.shopifyShopId}function $s(e){let t=String(e),o=t.match(/^(?:gid:\/\/shopify\/Shop\/)?(\d+)$/)?.[1];if(!o)throw new Error(`Invalid Shopify shop ID: ${t}`);return Buffer.from(`gid://organization/ShopifyShop/${o}`).toString("base64url")}async function Us(e){let t=$s(e.shopifyShopId);return H({title:d`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>qs)return!1;if((await K(e.organization,{query:Ui,token:e.token,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===Ls.toLowerCase())return!0;o(d`${zs()}`),await qo(Rs)}},renderOptions:{stdout:process.stderr}})}function zs(){return"Waiting for deletion confirmation"}function Bs(e){let{store:t,organization:o,deletionConfirmed:r}=e;return Je.encode({store:{domain:t,deletionRequested:!0,deletionConfirmed:r},organization:{id:o.id,name:o.businessName},...r?{}:{message:"Deletion was requested, but has not been confirmed yet. The store may still finish deleting asynchronously."}})}n();n();n();var Hi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Te=class extends c{};async function Ct(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r=z(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await eo({query:Hi,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(g=>Ms(g,r));if(!m)throw new Te(`Couldn't find a store with domain ${e.store} for the current account.`,Hs());let l=await js(String(m.publicId),t,o);return{...l?{owningOrg:l}:{}}}function Hs(){let e="Check the domain (it must be the permanent `myshopify.com` domain)";return it()?`${e} and that the service account has access to the store: it can open the stores it created, or any store in an organization where it has Dev store management access. Inactive stores aren't searchable.`:`${e} and that you're logged in to an account with access to the store. Inactive stores aren't searchable.`}async function js(e,t,o){try{let i=(await eo({query:ji,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?Or(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${Gs(r)}`);return}}function Ms(e,t){return[e.primaryDomain,e.webUrl].some(o=>z(o)===t)}function Gs(e){return e instanceof Error?e.message:String(e)}async function Js(e){let{store:t}=e;try{let r=(await Ct(e)).owningOrg;if(!r?.id){f(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){f(`Could not infer the owning organization for ${t}: ${Vs(o)}`);return}}function Vs(e){return e instanceof Error?e.message:String(e)}async function Mi(e,t){if(t)return lt(t);let o=ut(),r=await Js({store:e,noPrompt:!o});if(r)return r;let i=await B([],{noPrompt:!o,allowAutomationToken:!0}),{organizations:a}=await mt(i);if(a.length===1)return f(`Using ${a[0].businessName}, the only organization the account belongs to, for ${e}.`),a[0];if(a.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(!o)throw new c(`Could not determine which organization owns ${e}.`,"Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");return T({headline:`Could not determine which organization owns ${e}.`,body:["Select one below, or specify it with",{command:"--organization-id"},{char:"."}]}),Er(a)}var Gi=R(M(),1),We=class e extends Q{static summary="Delete a dev store.";static descriptionWithMarkdown="Deletes a dev store from your organization.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --json","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --force"];static flags={...y,...w,store:b.store,"organization-id":b["organization-id"],force:Gi.Flags.boolean({char:"f",description:"Skip confirmation. Required if non interactive.",env:"SHOPIFY_FLAG_FORCE",default:!1})};static get jsonOutputSchema(){return Je}async run(){let{flags:t}=await this.parse(e);try{if(!t.force&&!st())throw new c(`Deleting the dev store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Mi(t.store,t["organization-id"]?.toString());if(!t.force&&!await Lo({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new Ro;await Bi({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof c&&(S(Je.encode({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1})),process.exit(1)),o}}};n();n();n();var Vi=R(Oa(),1);async function Ws(e){if(e.query!==void 0){if(!e.query.trim())throw new c("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await Ce(e.queryFile))throw new c(d`Query file not found at ${u.path(e.queryFile)}. Please check the path and try again.`);let t=await Ne(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new c(d`Query file at ${u.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new J("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Ji(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new c(d`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Qs(e,t){if(e!==void 0){if(!e.trim())throw new c(d`The ${u.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Ji(JSON.parse(e),u.yellow("--variables"))}catch(o){if(o instanceof c)throw o;let r=o instanceof Error?o.message:"Unknown error";throw new c(d`Invalid JSON in ${u.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);let o=await Ne(t,{encoding:"utf8"});try{return Ji(JSON.parse(o),u.path(t))}catch(r){if(r instanceof c)throw r;let i=r instanceof Error?r.message:"Unknown error";throw new c(d`Invalid JSON in variable file ${u.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function Ys(e){let t;try{t=(0,Vi.parse)(e)}catch(r){throw r instanceof Error?new c(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new c("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function Ks(e){return e.operationDefinition.operation==="mutation"}function Xs(e,t=!1){if(Ks(e)&&!t)throw new c("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Wi(e){let t=await Ws({query:e.query,queryFile:e.queryFile}),o=Ys(t);Xs(o,e.allowMutations);let r=await Qs(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();var Ie=x({name:"StoreExecuteResult",schema:s.object({data:s.record(s.unknown()).nullable().describe("GraphQL response data, preserving query fields and aliases."),extensions:s.record(s.unknown()).optional().describe("Response-level GraphQL metadata, when returned by the API.")}).strict()});n();function Pt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Qi(e){if(!Pt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Yi=["the user aborted a request","the operation was aborted"];function Zs(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Yi.some(o=>t.includes(o))}function Qe(e,t){if(Qi(e)===402)return new c(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(Zs(e))return new c(`Request to ${t} was aborted before it completed.`)}function Ye(e,t){let o=Qi(e);o!==401&&o!==404||(Se(t.store,t.userId),At(t))}var ec=`
|
|
94
|
+
Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;static jsonOutputSchema=qe;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];static flags={...y,...w,store:b.store,...ii};async run(){let{flags:t}=await this.parse(e),o=await Sr({query:t.query,queryFile:t["query-file"]}),r=await gi({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,allowMutations:t["allow-mutations"],...t.version&&{version:t.version}}),i=t.json?"json":"text";xe("Starting bulk operation.",{storeFqdn:r.adminSession.storeFqdn,version:r.version});let a=await yi(r);await wi(a,{format:i,watch:r.watch,outputFile:t["output-file"]})}};n();n();async function ki(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await wr({...e,version:t});return{store:e.adminSession.storeFqdn,apiVersion:t,operationId:e.operationId,operation:o??null}}async function bi(e){let t=await Pe({adminSession:e.adminSession,minimumDefaultVersion:se}),o=await kr({...e,version:t,first:100});return{store:e.adminSession.storeFqdn,apiVersion:t,operations:o}}n();function vi(e,t){if(t==="json"){g(_t.encode({...X(e),..."operation"in e?{operationGid:e.operationId,operation:e.operation?Z(e.operation):null}:{operations:e.operations.map(Z),pageInfo:{hasNextPage:e.operations.length<100?!1:null}}}));return}if("operation"in e){e.operation?fs(e.operation):W({headline:"Bulk operation not found.",body:d`ID: ${u.yellow(e.operationId)}`.value});return}let o=e.operations.map(r=>({id:ye(r.id),status:Ss(r.status),count:gs(r.objectCount),dateCreated:Yt(new Date(String(r.createdAt))),dateFinished:r.completedAt?Yt(new Date(String(r.completedAt))):"",results:ys(r.url??r.partialDataUrl)}));ro(),o.length===0?I({body:"No bulk operations found in the last 7 days."}):he({rows:o,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),ro()}function fs(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:p}=e,m=mt(e).value,l=hs(r,i),S=d`ID: ${u.yellow(t)}\n${l}`.value;if(o==="COMPLETED"){let O=a?u.link("Download results",a):"";T({headline:m,body:d`${S}\n${O}`.value})}else if(o==="FAILED"){let O=p?u.link("Download partial results",p):"";W({headline:m,body:d`${S}\n${O}`.value})}else I({headline:m,body:S})}function hs(e,t){let o=new Date;return t?`Finished ${Kt(new Date(String(t)),o)}`:`Started ${Kt(new Date(String(e)),o)}`}function Ss(e){return e==="COMPLETED"?st.green(e):e==="FAILED"?st.red(e):st.dim(e)}function gs(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ys(e){return e?d`${u.link("download",e)}`.value:""}var ze=class e extends k{static summary="Check the status of bulk operations on a store.";static descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";static jsonOutputSchema=_t;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...y,...w,store:b.store,id:ri};async run(){let{flags:t}=await this.parse(e),o=t.json?"json":"text",r=await Ae(t.store);xe(t.id?"Checking bulk operation status.":"Listing bulk operations.",{storeFqdn:r.storeFqdn});let i=t.id?await ki({adminSession:r,operationId:t.id}):await bi({adminSession:r});vi(i,o)}};n();var fo=R(M(),1),Be=class e extends k{static hidden=!0;static summary="Authenticate for store commands.";static descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup or stdin.";static jsonOutputSchema=be;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","printf %s <signup-jwt> | <%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];static flags={...y,...w,store:b.store,scopes:fo.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:fo.Flags.string({description:"Provide JWT for the store. When omitted, the JWT is read from stdin.",env:"SHOPIFY_FLAG_SIGNUP",required:!1})};async run(){let{flags:t}=await this.parse(e),o=ks(t.signup)??await bs();await Ot({store:t.store,scopes:t.scopes,signup:o},{presenter:ve(t.json?"json":"text")})}},ws=8*1024,Ai="Missing signup JWT.",xi="Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.";function ks(e){let t=e?.trim();return t===""?void 0:t}async function bs(e=process.stdin){if(e===process.stdin&&!Uo())throw new c(Ai,xi);let t=[],o=0;for await(let i of e){let a=Buffer.isBuffer(i)?i:Buffer.from(i);if(o+=a.length,o>ws)throw new c("The input piped to stdin is too large to be a signup JWT.","Pipe only the signup JWT.");t.push(a)}let r=Buffer.concat(t).toString("utf8").trim();if(!r)throw new c(Ai,xi);return r}n();n();n();var Oe=s.object({error:s.literal(!0),message:s.string(),nextSteps:s.array(s.unknown()).describe("Suggested next steps, as text or formatted UI tokens."),exitCode:s.literal(1)});var ho=x({name:"CreateDevStoreResult",schema:s.union([ao.schema,Oe]),definitions:{...ao.definitions,StoreCommandError:Oe}});n();var Oi={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var Ii=Fr,Ti=Cr,Ei=Pr;var je=R(M(),1),He=class e extends Q{static summary="Create a new dev store.";static descriptionWithMarkdown="Creates a new dev store in your organization.";static jsonOutputSchema=ho;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>",'<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --demo-data','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --json'];static flags={...y,...w,name:dt(je.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":dt(b["organization-id"]),plan:dt(je.Flags.string({description:"The Shopify plan to use for the new dev store.",options:io,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":je.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":je.Flags.boolean({description:"Populate the new dev store with demo data.",allowNo:!0,env:"SHOPIFY_FLAG_STORE_DEMO_DATA"}),country:It};async run(){let{flags:t}=await this.parse(e),o=await ft(t["organization-id"]?.toString()),r=t.name??await Ii(),i=t.plan??await Ti(),a=t["demo-data"]??(pt()?await Ei():!1);try{await so({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:a,country:t.country,json:t.json})}catch(p){throw t.json&&p instanceof c&&(g(ho.encode({error:!0,message:p.message,nextSteps:p.nextSteps??[],exitCode:1})),process.exit(1)),p}}};n();n();n();var vs="X-Shopify-CLI-Instance",As="X-Shopify-CLI-Version",_i;function xs(){return _i??=new Co({projectName:"shopify-cli-store"}),_i}var Me=class extends c{status;constructor(t,o,r){super(o,r??null),this.status=t}};function Ni(e=xs()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=it();return e.set("cliInstanceId",o),o}function Fi(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${Vt}`,[vs]:e,[As]:Vt}}function Os(e){return Fi(e)}function Is(e,t){return{...Fi(e),authorization:t,"X-Shopify-Access-Token":t}}async function Ci(e,t={}){let r=`https://${await eo()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await Zt(r,{method:"POST",headers:Os(Ni(t.storage)),body:i}),p=await a.text();if(!a.ok){let l=Ts(a.status,p);throw new c(l.message,l.tryMessage)}let m;try{m=JSON.parse(p)}catch(l){let S=l instanceof Error?l.message:"Unknown error";throw new c("Preview store creation returned a non-JSON response.",`Parse error: ${S}. Body (truncated): ${Ft(p).slice(0,500)}`)}return _s(m)}async function Pi(e,t={}){let r=`https://${await eo()}/services/preview-stores/${e.shopId}`,i=await Zt(r,{method:"GET",headers:Is(Ni(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let m=Es(i.status,a);throw new Me(i.status,m.message,m.tryMessage)}let p;try{p=JSON.parse(a)}catch(m){let l=m instanceof Error?m.message:"Unknown error";throw new c("Preview store lookup returned a non-JSON response.",`Parse error: ${l}. Body (truncated): ${Ft(a).slice(0,500)}`)}return Ns(p)}function Ts(e,t){let o=Di(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=Ft(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Di(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 Es(e,t){let o=Di(t),r=Ft(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function _s(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,p=typeof e.access_url=="string"?e.access_url:void 0,m=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,l=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(S=>typeof S=="string"):void 0;if(!o||!r||!i||!a||!p||!l)throw new c("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(Fs(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:l,accessUrl:p,...m?{placeholderAccountUuid:m}:{}}}function Ns(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,p=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new c("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(Cs(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...p?{claimUrl:p}:{}}}function Fs(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function Ft(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function Cs(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var Ps={createPreviewStore:Ci,setStoredStoreAppSession:Se,recordStoreFqdnMetadata:N,setLastSeenUserId:q,now:()=>new Date};async function Li(e,t={}){let o={...Ps,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Ls(r,e.country,o)}function Ds(e){return e.placeholderAccountUuid??e.shop.id}async function Ls(e,t,o){let r=o.now().toISOString(),i=Ds(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:H,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl,type:"preview",authScopes:e.adminApiScopes},next_steps:Rs(e.shop.domain)}}function Rs(e){return[`Use \`shopify store open --store ${e}\` to preview the storefront.`,`Use \`shopify store execute --store ${e}\` to add products, collections, pages, and more.`,`Use \`shopify theme pull --store ${e}\` and \`shopify theme push --store ${e}\` to edit your store design.`]}n();n();var Ri=A.pick({id:!0,name:!0,subdomain:!0,country:!0}).extend({storefrontUrl:s.string(),type:s.literal("preview").optional(),authScopes:A.shape.authScopes.describe("Preapproved Admin API scopes for the preview store.")}),Ct=x({name:"CreatePreviewStoreResult",schema:s.object({status:s.literal("success"),message:s.string(),store:Ri,next_steps:s.array(s.string())}),definitions:{PreviewStore:Ri}});function qi(e,t){if(t==="json"){g(Ct.encode(e));return}$s(e)}function qs(e){return e.split(/(`[^`]+`)/).map(t=>t.startsWith("`")&&t.endsWith("`")?{command:t.slice(1,-1)}:t)}function $s(e){T({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:e.next_steps.map(qs)}}}]})}var $i=R(M(),1),Ge=class e extends k{static summary="Create a preview Shopify store.";static descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";static jsonOutputSchema=Ct;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];static flags={...y,...w,name:$i.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:It};async run(){let{flags:t}=await this.parse(e),o=await j({title:d`Creating store`,task:async()=>Li({name:t.name,country:t.country})});qi(o,t.json?"json":"text")}};n();n();var Ui=s.object({domain:A.shape.subdomain,deletionRequested:s.literal(!0),deletionConfirmed:s.boolean()}),Je=x({name:"DeleteDevStoreResult",schema:s.union([s.object({store:Ui,organization:ce,message:s.string().optional()}),Oe]),definitions:{DeletedStore:Ui,StoreOrganization:ce,StoreCommandError:Oe}});n();n();n();n();var zi={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 Bi(e){let t=await Ve(e);if(!t)throw new c(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return t}async function Ve(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r={id:e.organizationId,businessName:e.organizationName},a=(await K(r,{query:zi,token:t,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],p=e.store.toLowerCase(),m=a.find(l=>z(l.node.primaryDomain)===p)?.node;if(m)return{shopifyShopId:m.shopifyShopId??void 0,name:m.name,primaryDomain:m.primaryDomain??void 0,storeType:m.storeType??void 0,developerPreviewHandle:m.developerPreviewHandle??void 0,planName:m.planName??void 0,ownerName:m.ownerDetails?.fullName??void 0,ownerEmail:m.ownerDetails?.email??void 0}}n();var ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"storeFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var Hi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationAccessibleShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopifyShopID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShop"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Us="cancelled",zs=5,Bs=300*1e3;async function Gi(e){let{organization:t,store:o}=e,r=await B([],{allowAutomationToken:!0}),i=V(),a=await Mi({store:o,organization:t,token:r}),m=(await K(t,{query:ji,token:r,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!m)throw new c("Store deletion failed: unexpected empty response.");let l=m.userErrors;if(l&&l.length>0){let O=l.map(h=>h.message).join(", ");throw new c(`Failed to delete dev store: ${O}`)}if(m.success===!1)throw new c("Store deletion failed.");a??=await Mi({store:o,organization:t,token:r});let S=a?await Hs({shopifyShopId:a,organization:t,token:r,unauthorizedHandler:i}):!1;e.json?g(Gs({store:o,organization:t,deletionConfirmed:S})):S?T({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):ie({headline:`Dev store "${o}" deletion was requested, but not confirmed.`,body:["Shopify accepted the deletion request, but deletion was not confirmed before the CLI stopped waiting.","The store may still finish deleting asynchronously."]})}async function Mi(e){let{store:t,organization:o,token:r}=e;return(await Ve({store:t,organizationId:o.id,organizationName:o.businessName,token:r}))?.shopifyShopId}function js(e){let t=String(e),o=t.match(/^(?:gid:\/\/shopify\/Shop\/)?(\d+)$/)?.[1];if(!o)throw new Error(`Invalid Shopify shop ID: ${t}`);return Buffer.from(`gid://organization/ShopifyShop/${o}`).toString("base64url")}async function Hs(e){let t=js(e.shopifyShopId);return j({title:d`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>Bs)return!1;if((await K(e.organization,{query:Hi,token:e.token,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===Us.toLowerCase())return!0;o(d`${Ms()}`),await $o(zs)}},renderOptions:{stdout:process.stderr}})}function Ms(){return"Waiting for deletion confirmation"}function Gs(e){let{store:t,organization:o,deletionConfirmed:r}=e;return Je.encode({store:{domain:t,deletionRequested:!0,deletionConfirmed:r},organization:{id:o.id,name:o.businessName},...r?{}:{message:"Deletion was requested, but has not been confirmed yet. The store may still finish deleting asynchronously."}})}n();n();n();var Ji={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var Vi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ie=class extends c{};async function Pt(e){let t=e.token??await B([],{noPrompt:e.noPrompt,allowAutomationToken:!0}),o=V({noPrompt:e.noPrompt}),r=z(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,m=((await to({query:Ji,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(S=>Ws(S,r));if(!m)throw new Ie(`Couldn't find a store with domain ${e.store} for the current account.`,Js());let l=await Vs(String(m.publicId),t,o);return{...l?{owningOrg:l}:{}}}function Js(){let e="Check the domain (it must be the permanent `myshopify.com` domain)";return at()?`${e} and that the service account has access to the store: it can open the stores it created, or any store in an organization where it has Dev store management access. Inactive stores aren't searchable.`:`${e} and that you're logged in to an account with access to the store. Inactive stores aren't searchable.`}async function Vs(e,t,o){try{let i=(await to({query:Vi,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){f(`No owning organization returned for destination ${e}.`);return}let a=i.id?Tr(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){f(`Failed to resolve owning organization: ${Qs(r)}`);return}}function Ws(e,t){return[e.primaryDomain,e.webUrl].some(o=>z(o)===t)}function Qs(e){return e instanceof Error?e.message:String(e)}async function Ys(e){let{store:t}=e;try{let r=(await Pt(e)).owningOrg;if(!r?.id){f(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){f(`Could not infer the owning organization for ${t}: ${Ks(o)}`);return}}function Ks(e){return e instanceof Error?e.message:String(e)}async function Wi(e,t){if(t)return ft(t);let o=pt(),r=await Ys({store:e,noPrompt:!o});if(r)return r;let i=await B([],{noPrompt:!o,allowAutomationToken:!0}),{organizations:a}=await lt(i);if(a.length===1)return f(`Using ${a[0].businessName}, the only organization the account belongs to, for ${e}.`),a[0];if(a.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(!o)throw new c(`Could not determine which organization owns ${e}.`,"Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");return I({headline:`Could not determine which organization owns ${e}.`,body:["Select one below, or specify it with",{command:"--organization-id"},{char:"."}]}),Nr(a)}var Qi=R(M(),1),We=class e extends Q{static summary="Delete a dev store.";static descriptionWithMarkdown="Deletes a dev store from your organization.";static jsonOutputSchema=Je;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --json","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --force"];static flags={...y,...w,store:b.store,"organization-id":b["organization-id"],force:Qi.Flags.boolean({char:"f",description:"Skip confirmation. Required if non interactive.",env:"SHOPIFY_FLAG_FORCE",default:!1})};async run(){let{flags:t}=await this.parse(e);try{if(!t.force&&!ct())throw new c(`Deleting the dev store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Wi(t.store,t["organization-id"]?.toString());if(!t.force&&!await Ro({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new qo;await Gi({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof c&&(g(Je.encode({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1})),process.exit(1)),o}}};n();n();n();var Ki=R(_a(),1);async function Xs(e){if(e.query!==void 0){if(!e.query.trim())throw new c("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await Ce(e.queryFile))throw new c(d`Query file not found at ${u.path(e.queryFile)}. Please check the path and try again.`);let t=await Ne(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new c(d`Query file at ${u.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new J("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Yi(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new c(d`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Zs(e,t){if(e!==void 0){if(!e.trim())throw new c(d`The ${u.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Yi(JSON.parse(e),u.yellow("--variables"))}catch(o){if(o instanceof c)throw o;let r=o instanceof Error?o.message:"Unknown error";throw new c(d`Invalid JSON in ${u.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await Ce(t))throw new c(d`Variable file not found at ${u.path(t)}. Please check the path and try again.`);let o=await Ne(t,{encoding:"utf8"});try{return Yi(JSON.parse(o),u.path(t))}catch(r){if(r instanceof c)throw r;let i=r instanceof Error?r.message:"Unknown error";throw new c(d`Invalid JSON in variable file ${u.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function ec(e){let t;try{t=(0,Ki.parse)(e)}catch(r){throw r instanceof Error?new c(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new c("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function tc(e){return e.operationDefinition.operation==="mutation"}function oc(e,t=!1){if(tc(e)&&!t)throw new c("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Xi(e){let t=await Xs({query:e.query,queryFile:e.queryFile}),o=ec(t);oc(o,e.allowMutations);let r=await Zs(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();var Te=x({name:"StoreExecuteResult",schema:s.object({data:s.record(s.unknown()).nullable().describe("GraphQL response data, preserving query fields and aliases."),extensions:s.record(s.unknown()).optional().describe("Response-level GraphQL metadata, when returned by the API.")}).strict()});n();function Dt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Zi(e){if(!Dt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var ea=["the user aborted a request","the operation was aborted"];function rc(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return ea.some(o=>t.includes(o))}function Qe(e,t){if(Zi(e)===402)return new c(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(rc(e))return new c(`Request to ${t} was aborted before it completed.`)}function Ye(e,t){let o=Zi(e);o!==401&&o!==404||(ge(t.store,t.userId),xt(t))}var nc=`
|
|
95
95
|
query StoreExecutePublicApiVersions {
|
|
96
96
|
publicApiVersions {
|
|
97
97
|
handle
|
|
98
98
|
supported
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
`;async function
|
|
101
|
+
`;async function ta(e){try{return(await ne({query:nc,api:"Admin",url:ae(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){Ye(t,e.session);let o=Qe(t,e.adminSession.storeFqdn);throw o||(Dt(t)&&typeof t.response.status=="number"&&t.response.status>=500?new fr(e.adminSession.storeFqdn,t.response.status):t)}}async function oa(e){try{return await j({title:d`Executing GraphQL operation`,task:async()=>{let t,o=await ne({query:e.request.query,api:"Admin",url:ae(e.context.adminSession.storeFqdn,e.context.version,e.context.adminSession),token:e.context.adminSession.token,variables:e.request.parsedVariables,responseOptions:{handleErrors:!1,onResponse:r=>{t=r.extensions}}});return Te.validate({data:o,...t===void 0?{}:{extensions:t}})},renderOptions:{stdout:process.stderr}})}catch(t){Ye(t,e.context.session);let o=Qe(t,e.context.adminSession.storeFqdn);if(o)throw o;if(Dt(t)&&t.response.errors){let{errors:r,extensions:i,data:a}=t.response,p={errors:r,...i===void 0?{}:{extensions:i},...a===void 0?{}:{data:a}},m=new c("GraphQL operation failed.",JSON.stringify({errors:r},null,2));throw m.details=p,m}throw t}}n();async function So(e){le();let t=await $(_(e));return await N(t.store,!0),q(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function ic(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await ta({adminSession:o,session:t});if(!r)return i.filter(m=>m.supported).map(m=>m.handle).sort().reverse()[0];let a=i.map(p=>p.handle);if(a.includes(r))return r;throw new c(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function ra(e){let{adminSession:t,session:o}=await So(e.store),r=await ic({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var ac={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>ra({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>oa({context:e,request:t})};function na(e){if(e==="admin")return ac;throw new J(`Unsupported store GraphQL API target: ${e}`)}async function ia(e){await N(e.store,!1);let t=na(e.api??"admin"),o=await Xi({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await j({title:d`Loading stored store auth`,task:async()=>t.prepareContext({store:e.store,requestedVersion:o.requestedVersion}),renderOptions:{stdout:process.stderr}});return t.execute({context:r,request:o})}n();function aa(e){if(e){T({headline:"Operation succeeded.",body:`Results written to ${e}`});return}T({headline:"Operation succeeded."})}async function sa(e,t,o="text"){let r=o==="json"?Te.encode(e):JSON.stringify(e.data,null,2);if(t){await Fe(t,r),o==="text"&&aa(t);return}o==="text"&&aa(),g(r)}var ee=R(M(),1),Ke=class e extends k{static summary="Execute GraphQL queries and mutations on a store.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";static jsonOutputSchema=Te;static description=this.descriptionForHelp();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',`<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,'<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations','<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json'];static flags={...y,...w,query:ee.Flags.string({char:"q",description:"The GraphQL query or mutation, as a string.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":ee.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async t=>G(t),exactlyOne:["query","query-file"]}),variables:ee.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES",exclusive:["variable-file"]}),"variable-file":ee.Flags.string({description:"Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async t=>G(t),exclusive:["variables"]}),store:b.store,version:ee.Flags.string({description:"The API version to use for the query or mutation. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"output-file":ee.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async t=>G(t)}),"allow-mutations":ee.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};async run(){let{flags:t}=await this.parse(e),o=await ia({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 sa(o,t["output-file"],t.json?"json":"text")}};n();n();async function ca(e){le();let t=sc(e.store),o=Lr();await Rr({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,outputFormat:e.outputFormat,additionalReadyMessages:[d`Mutations are ${e.allowMutations?u.green("allowed"):u.yellow("blocked")}.`],abortSignal:e.abortSignal})}function sc(e){return{getToken:async t=>(await $(e,t)).accessToken,refreshToken:async t=>(await $(e,t)).accessToken}}var Lt=R(M(),1);var Xe=class e extends k{static summary="Open a local GraphiQL UI for a store.";static descriptionWithMarkdown="Opens an authenticated Admin API GraphiQL UI for the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";static jsonOutputSchema=Dr;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --allow-mutations","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];static flags={...y,...w,store:b.store,port:jo({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":Lt.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:Lt.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:Lt.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};async run(){let{flags:t}=await this.parse(e);return this.runWithParsedOutput(t,async()=>{await ca({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version,outputFormat:t.json?"json":"text"})})}};n();n();n();function Rt(e){if(e)return Oi[e.toLowerCase()]}function ua(e){return e?oe(e):""}n();var cc={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client-transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function qt(e){if(e)return cc[e]}function pa(e){return e?oe(e):""}var da={dev:"development_superset",production:"production","client-transfer":"client_transfer",collaborator:"collaborator"},$t=Object.keys(da);function ma(e){return da[e]}var uc=`#graphql
|
|
102
102
|
query StoreInfoAdminShop {
|
|
103
103
|
shop {
|
|
104
104
|
id
|
|
@@ -112,8 +112,8 @@ Re-run this command if the stored token is missing, expires, or no longer has th
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
`;async function
|
|
115
|
+
`;async function Ut(e){let t=e.store;if(!t)throw new c("No store specified.","Pass the `myshopify.com` domain via the `--store` flag, e.g. `shopify store info --store shop.myshopify.com`.");let o=at()?void 0:Y(t);if(fc(o)){await N(o.store,!0,o.preview.shopId),q(o.userId);let i=await hc(o);return kc({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await dc(t,{noPrompt:r})}catch(i){if(!r||!gc(i))throw i;return f(`BP store info lookup failed; falling back to stored store auth: ${go(i)}`),pc(t)}}async function pc(e){let t=await $(e);await N(t.store,!0),q(t.userId);let o=await lc(t);return{...wc({store:t.store,shop:o}),authScopes:t.scopes}}async function dc(e,t={}){let o;try{o=await Pt({store:e,noPrompt:t.noPrompt})}catch(i){if(!(i instanceof Ie))throw i;let a=await mc(e,t);if(!a)throw i;return a}let r=await Sc(o,e,{noPrompt:t.noPrompt});return la({store:e,destinationsCtx:o,orgShop:r})}async function mc(e,t){let o;try{let i=await Er();if(i.length!==1)return;o=i[0]}catch(i){f(`Could not list the account's organizations: ${go(i)}`);return}let r;try{r=await Ve({store:e,organizationId:o.id,noPrompt:t.noPrompt})}catch(i){f(`BP Organizations shop lookup in ${o.businessName} failed: ${go(i)}`);return}if(r)return f(`Found ${e} in ${o.businessName}, the only organization the account belongs to.`),la({store:e,destinationsCtx:{owningOrg:{id:o.id,name:o.businessName}},orgShop:r})}async function lc(e){try{let t=await ne({query:uc,api:"Admin",url:ae(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!t.shop)throw new c(`Shopify did not return store information for ${e.store}.`);return t.shop}catch(t){Ye(t,e);let o=Qe(t,e.store);throw o||t}}function fc(e){return e?.kind==="preview"&&e.preview!==void 0}async function hc(e){try{let t=await Pi({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof Me&&(t.status===401||t.status===404)&&(ge(e.store,e.userId),xt(e)),t}}async function Sc(e,t,o={}){if(!e.owningOrg?.id){f("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await Bi({store:t,organizationId:e.owningOrg.id,organizationName:e.owningOrg.name,noPrompt:o.noPrompt})}catch(r){f(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function gc(e){return e instanceof Ie||yc(e)}function yc(e){return e instanceof c&&e.message.includes("unable to prompt for reauthentication")}function go(e){return e instanceof Error?e.message:String(e)}function wc(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:bc(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:ha(re(r))};return{...fe(i),subdomain:r}}function la(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:fa(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:vc(r),type:qt(r?.storeType),plan:Rt(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:ha(re(t))};return{...fe(i),subdomain:t}}function kc(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:fa(o.preview.shopId),displayName:o.preview.name,type:"preview",country:o.preview.country,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...fe(i),subdomain:t,authScopes:o.scopes}}function fa(e){if(e)return`gid://shopify/Shop/${e}`}function bc(e){let t=fe({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function vc(e){if(!e)return;let t=fe({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function ha(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();n();var Sa=s.object({name:s.string().optional(),email:s.string().optional()}),zt=x({name:"StoreInfoResult",schema:s.object({id:A.shape.id.optional(),displayName:A.shape.name.optional(),subdomain:A.shape.subdomain,organizationId:A.shape.organizationId.optional(),organizationName:A.shape.organizationName.optional(),storeOwner:Sa.optional(),type:A.shape.type,country:A.shape.country.describe("The country selected when creating the preview store, if specified."),plan:A.shape.plan,featurePreview:s.string().optional(),adminUrl:s.string().optional(),accessUrl:s.string().optional(),saveUrl:s.string().optional(),authScopes:A.shape.authScopes}),definitions:{StoreInfoStoreOwner:Sa}});function ga(e,t){if(t==="json"){g(zt.encode(e));return}let o=xc(e);I({customSections:[{title:"Store details",body:{tabularData:Ac(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function Ac(e){let t=[];return te(t,"ID",e.id),te(t,"Display Name",e.displayName),te(t,"Subdomain",e.subdomain),te(t,"Organization",e.organizationName),te(t,"Store owner",Oc(e.storeOwner)),te(t,"Type",e.type?oe(e.type):void 0),te(t,"Plan",e.plan?oe(e.plan):void 0),te(t,"Feature Preview",e.featurePreview),t}function xc(e){let t=[];return yo(t,e.adminUrl,"Manage this store in the Shopify admin"),yo(t,e.accessUrl,"View your store"),yo(t,e.saveUrl,"Save your store"),t}function Oc(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function te(e,t,o){o&&e.push([t,o])}function yo(e,t,o){t&&e.push({link:{label:o,url:t}})}var Ze=class e extends k{static summary="Surface metadata about a Shopify store.";static descriptionWithMarkdown=`Returns available metadata about a store you have access to, such as its id, display name, subdomain, organization, store owner, type, plan, feature preview, admin URL, and access and save URLs for preview stores.
|
|
116
116
|
|
|
117
117
|
Some details may be omitted when they are not available for the store.
|
|
118
118
|
|
|
119
|
-
Use \`--json\` for machine-readable output.`;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];static flags={...y,...w,store:b.store};static get jsonOutputSchema(){return Ut}async run(){let{flags:t}=await this.parse(e),o=await $t({store:t.store});la(o,t.json?"json":"text")}};n();n();n();n();n();var fa={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filters"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopFilterInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function ha(e){let{entries:t,hasMore:o}=await vc(e.token,e.organization,e.storeType);return{entries:t.sort(Oc),hasMore:o}}async function vc(e,t,o){let r=V(),a=(await K(t,{query:fa,token:e,variables:{first:250,filters:Ac(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let p=[];for(let m of a.edges){let l=xc(m.node,t);l&&p.push(l)}return{entries:p,hasMore:a.pageInfo.hasNextPage}}function Ac(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:ca(e)}),t}function xc(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:z(o)??o,...e.primaryDomain?{primaryDomain:z(e.primaryDomain)??e.primaryDomain}:{},createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:Rt(e.storeType),plan:Lt(e.planName)}}function Oc(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function Sa(e={}){let t=await B([],{allowAutomationToken:!0});if(e.organizationId){let i=await Ir(e.organizationId.toString(),t);if(i)return ga(t,i,e.storeType)}let o=await mt(t);if(!o.currentUserResolved)return{stores:[],notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[]};if(!e.organizationId&&o.organizations.length>1&&!st())throw new c("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await Tc(o.organizations,e.organizationId);return ga(t,r,e.storeType)}async function ga(e,t,o){let r=await ha({token:e,organization:t,storeType:o}),{stores:i,truncated:a}=Ec(r.entries,r.hasMore);return{stores:i,organization:Ic(t),...o?{storeType:o}:{},...a?{truncated:!0}:{}}}async function Tc(e,t){if(t){let a=e.find(p=>p.id===t.toString());if(!a)throw new c(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(p=>`${p.businessName} (${p.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await Do({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function Ic(e){return{id:e.id,name:e.businessName}}function Ec(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();n();var ya=s.object({id:A.shape.id.optional(),store:A.shape.subdomain,primaryDomain:s.string().optional().describe("The primary storefront hostname, which may be a custom domain."),createdAt:s.string(),organizationId:A.shape.organizationId,organizationName:A.shape.organizationName,name:A.shape.name.optional(),type:A.shape.type,plan:A.shape.plan}),zt=x({name:"StoreListResult",schema:s.object({stores:s.array(ya),organization:ce.optional(),storeType:s.enum(qt).optional(),notice:s.string().optional(),truncated:s.boolean().optional()}),definitions:{StoreListEntry:ya,StoreListOrganization:ce}});var _c=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function wa(e,t){if(e.notice&&to(e.notice),e.truncated&&to(Nc(e)),t==="json"){S(zt.encode(e));return}Fc(e)}function Nc(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${ka(e.storeType)}${t}. More stores exist.`}function ka(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function Fc(e){T({headline:Cc(e),customSections:[...Pc(e.organization),{body:_c}]}),e.stores.length>0&&Dc(e.stores)}function Cc(e){let t=ka(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function Pc(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function Dc(e){he({rows:e.map(t=>({subdomain:Lc(t.store),name:t.name??"",type:aa(t.type),plan:ia(t.plan),created:yt(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function Lc(e){return wt(e)??e}var yo=R(M(),1),et=class e extends k{static summary="List stores in a Shopify organization.";static descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`. In that case, `--organization-id` is required in non-interactive environments.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --type dev","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w,"organization-id":yo.Flags.integer({description:`${b["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:yo.Flags.string({description:"List only stores of this type.",options:qt,env:"SHOPIFY_FLAG_STORE_TYPE"})};static get jsonOutputSchema(){return zt}async run(){let{flags:t}=await this.parse(e),o=await Sa({organizationId:t["organization-id"],storeType:t.type});wa(o,t.json?"json":"text")}};n();n();var Rc={getStoreInfo:$t,openURL:ct};async function ba(e,t={}){let{getStoreInfo:o,openURL:r}={...Rc,...t},i=await o({store:e.store}),a=qc(i),p=await r(a),m=re(i.subdomain);return{storeDomain:m?`${m}.myshopify.com`:null,url:a,opened:p}}function qc(e){return e.accessUrl??`https://${e.subdomain}`}n();n();var Bt=x({name:"OpenStoreResult",schema:s.object({storeDomain:s.string().regex(/^[^.]+\.myshopify\.com$/).nullable(),url:s.string().url(),opened:s.boolean()}).strict()});function va(e,t){if(t==="json"){S(Bt.encode(e));return}if(e.opened){T({headline:`Opening the storefront for ${e.storeDomain??e.url} in your browser.`});return}T({headline:"Browser didn't open automatically. Open the storefront manually:",body:[d`${u.link(e.url,e.url)}`.value]})}var tt=class e extends k{static summary="Open your Shopify store in the default web browser.";static descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...y,...w,store:b.store};static get jsonOutputSchema(){return Bt}async run(){let{flags:t}=await this.parse(e),o=await ba({store:t.store});va(o,t.json?"json":"text")}};var $c={"store:auth:list":De,"store:auth":Re,"store:bulk:cancel":$e,"store:bulk:execute":Ue,"store:bulk:status":ze,"store:stripe-auth":Be,"store:create:dev":je,"store:create:preview":Ge,"store:delete":We,"store:execute":Ke,"store:graphiql":Xe,"store:info":Ze,"store:list":et,"store:open":tt},Ht=$c;n();var jt={"app:build":Lr,"app:bulk:cancel":Rr,"app:bulk:status":qr,"app:deploy":Hr,"app:dev":jr,"app:dev:clean":An,"app:security:check":Mr,"app:security:clean":Gr,"app:security:instructions":Jr,"app:security:record":Vr,"app:security:review":Wr,"app:logs":Qr,"app:import:channel-config":On,"app:import:custom-data-definitions":Tn,"app:import:dashboard-extensions":cn,"app:import-custom-data-definitions":In,"app:import-extensions":un,"app:info":pn,"app:init":dn,"app:config:validate":mn,"app:release":ln,"app:subscription-migrations:cancel":fn,"app:subscription-migrations:list":hn,"app:subscription-migrations:schedule":gn,"app:subscription-migrations:status":Sn,"app:subscription-migrations:unschedule":yn,"app:config:link":$r,"app:config:use":Ur,"app:config:pull":zr,"app:env:pull":Yr,"app:env:show":Kr,"app:execute":Zr,"app:graphiql":en,"app:bulk:execute":Xr,"app:function:build":tn,"app:function:replay":on,"app:function:run":rn,"app:function:info":xn,"app:function:schema":nn,"app:function:typegen":an,"app:generate:extension":sn,"app:versions:list":wn,"app:webhook:trigger":kn,"demo:watcher":Br,"organization:list":En},Uc=vn,zc=bn;var Yk=Dr.init;(0,xa.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async e=>{await ir(e),process.exit(1)});var Bc=process,wo=!1,Hc=["SIGINT","SIGTERM","SIGQUIT"];Hc.forEach(e=>{process.on(e,()=>{wo||(wo=Bc.emit("shopify:signal",e),wo||process.exit(1))})});var Aa=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(Aa)||(process.stdout.columns=Aa);async function jc({development:e}){await zo({moduleURL:import.meta.url,development:e})}ke.plugins.hidden=!0;ke["plugins:install"].description="";var Mc=Object.keys(jt);Mc.forEach(e=>{jt[e].customPluginName="@shopify/app"});var Gc=Object.keys(ft);Gc.forEach(e=>{ft[e].customPluginName="@shopify/theme"});var Jc=Object.keys(ht);Jc.forEach(e=>{ht[e].customPluginName="@shopify/cli-hydrogen"});var Vc=Object.keys(Ht);Vc.forEach(e=>{Ht[e].customPluginName="@shopify/store"});var Wc=Object.keys(gt);Wc.forEach(e=>{gt[e].customPluginName="@oclif/plugin-commands"});var Qc=Object.keys(St);Qc.forEach(e=>{St[e].customPluginName="@shopify/plugin-did-you-mean"});var Yc=Object.keys(ke);Yc.forEach(e=>{ke[e].customPluginName="@oclif/plugin-plugins"});var Kk={...jt,...ft,...ke,...St,...gt,...ht,...Ht,search:jo,upgrade:Mo,version:Ho,"send-analytics":Go,help:nr,"auth:logout":Jo,"auth:login":Vo,"debug:command-flags":Wo,"kitchen-sink":Xo,"kitchen-sink:async":Qo,"kitchen-sink:prompts":Yo,"kitchen-sink:static":Ko,"doctor-release":Zo,"doctor-release:theme":er,"doc:fetch":tr,"doc:search":or,"docs:generate":rr,"notifications:list":ar,"notifications:generate":sr,"cache:clear":cr,"config:autoupgrade:off":ur,"config:autoupgrade:on":pr,"config:autoupgrade:status":dr},Xk=jc;export{zc as AppPublicMetadataHook,Uc as AppSensitiveMetadataHook,Kk as COMMANDS,Fa as DidYouMeanHook,Yk as HydrogenInitHook,Na as PluginHook,Ca as TunnelProviderHook,Pa as TunnelStartHook,Xk as default,Ia as fetchStoreThemes,Ea as pull,_a as push};
|
|
119
|
+
Use \`--json\` for machine-readable output.`;static jsonOutputSchema=zt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];static flags={...y,...w,store:b.store};async run(){let{flags:t}=await this.parse(e),o=await Ut({store:t.store});ga(o,t.json?"json":"text")}};n();n();n();n();n();var ya={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filters"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopFilterInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function wa(e){let{entries:t,hasMore:o}=await Ic(e.token,e.organization,e.storeType);return{entries:t.sort(_c),hasMore:o}}async function Ic(e,t,o){let r=V(),a=(await K(t,{query:ya,token:e,variables:{first:250,filters:Tc(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let p=[];for(let m of a.edges){let l=Ec(m.node,t);l&&p.push(l)}return{entries:p,hasMore:a.pageInfo.hasNextPage}}function Tc(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:ma(e)}),t}function Ec(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:z(o)??o,...e.primaryDomain?{primaryDomain:z(e.primaryDomain)??e.primaryDomain}:{},createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:qt(e.storeType),plan:Rt(e.planName)}}function _c(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function ba(e={}){let t=await B([],{allowAutomationToken:!0});if(e.organizationId){let i=await _r(e.organizationId.toString(),t);if(i)return ka(t,i,e.storeType)}let o=await lt(t);if(!o.currentUserResolved)return{stores:[],notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[]};if(!e.organizationId&&o.organizations.length>1&&!ct())throw new c("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await Nc(o.organizations,e.organizationId);return ka(t,r,e.storeType)}async function ka(e,t,o){let r=await wa({token:e,organization:t,storeType:o}),{stores:i,truncated:a}=Cc(r.entries,r.hasMore);return{stores:i,organization:Fc(t),...o?{storeType:o}:{},...a?{truncated:!0}:{}}}async function Nc(e,t){if(t){let a=e.find(p=>p.id===t.toString());if(!a)throw new c(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(p=>`${p.businessName} (${p.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await Lo({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function Fc(e){return{id:e.id,name:e.businessName}}function Cc(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();n();var va=s.object({id:A.shape.id.optional(),store:A.shape.subdomain,primaryDomain:s.string().optional().describe("The primary storefront hostname, which may be a custom domain."),createdAt:s.string(),organizationId:A.shape.organizationId,organizationName:A.shape.organizationName,name:A.shape.name.optional(),type:A.shape.type,plan:A.shape.plan}),Bt=x({name:"StoreListResult",schema:s.object({stores:s.array(va),organization:ce.optional(),storeType:s.enum($t).optional(),notice:s.string().optional(),truncated:s.boolean().optional()}),definitions:{StoreListEntry:va,StoreListOrganization:ce}});var Pc=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function Aa(e,t){if(e.notice&&oo(e.notice),e.truncated&&oo(Dc(e)),t==="json"){g(Bt.encode(e));return}Lc(e)}function Dc(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${xa(e.storeType)}${t}. More stores exist.`}function xa(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function Lc(e){I({headline:Rc(e),customSections:[...qc(e.organization),{body:Pc}]}),e.stores.length>0&&$c(e.stores)}function Rc(e){let t=xa(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function qc(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function $c(e){he({rows:e.map(t=>({subdomain:Uc(t.store),name:t.name??"",type:pa(t.type),plan:ua(t.plan),created:wt(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function Uc(e){return kt(e)??e}var wo=R(M(),1),et=class e extends k{static summary="List stores in a Shopify organization.";static descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`. In that case, `--organization-id` is required in non-interactive environments.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";static jsonOutputSchema=Bt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --type dev","<%= config.bin %> <%= command.id %> --json"];static flags={...y,...w,"organization-id":wo.Flags.integer({description:`${b["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:wo.Flags.string({description:"List only stores of this type.",options:$t,env:"SHOPIFY_FLAG_STORE_TYPE"})};async run(){let{flags:t}=await this.parse(e),o=await ba({organizationId:t["organization-id"],storeType:t.type});Aa(o,t.json?"json":"text")}};n();n();var zc={getStoreInfo:Ut,openURL:ut};async function Oa(e,t={}){let{getStoreInfo:o,openURL:r}={...zc,...t},i=await o({store:e.store}),a=Bc(i),p=await r(a),m=re(i.subdomain);return{storeDomain:m?`${m}.myshopify.com`:null,url:a,opened:p}}function Bc(e){return e.accessUrl??`https://${e.subdomain}`}n();n();var jt=x({name:"OpenStoreResult",schema:s.object({storeDomain:nt.nullable(),url:s.string().url(),opened:s.boolean()}).strict()});function Ia(e,t){if(t==="json"){g(jt.encode(e));return}if(e.opened){I({headline:`Opening the storefront for ${e.storeDomain??e.url} in your browser.`});return}I({headline:"Browser didn't open automatically. Open the storefront manually:",body:[d`${u.link(e.url,e.url)}`.value]})}var tt=class e extends k{static summary="Open your Shopify store in the default web browser.";static descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";static jsonOutputSchema=jt;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...y,...w,store:b.store};async run(){let{flags:t}=await this.parse(e),o=await Oa({store:t.store});Ia(o,t.json?"json":"text")}};var jc={"store:auth:list":De,"store:auth":Re,"store:bulk:cancel":$e,"store:bulk:execute":Ue,"store:bulk:status":ze,"store:stripe-auth":Be,"store:create:dev":He,"store:create:preview":Ge,"store:delete":We,"store:execute":Ke,"store:graphiql":Xe,"store:info":Ze,"store:list":et,"store:open":tt},Ht=jc;n();var Mt={"app:build":$r,"app:bulk:cancel":Ur,"app:bulk:status":zr,"app:deploy":Gr,"app:dev":Jr,"app:dev:clean":Tn,"app:security:check":Vr,"app:security:clean":Wr,"app:security:instructions":Qr,"app:security:record":Yr,"app:security:review":Kr,"app:logs":Xr,"app:logs-next":Zr,"app:import:channel-config":_n,"app:import:custom-data-definitions":Nn,"app:import:dashboard-extensions":mn,"app:import-custom-data-definitions":Fn,"app:import-extensions":ln,"app:info":fn,"app:init":hn,"app:config:validate":Sn,"app:release":gn,"app:subscription-migrations:cancel":yn,"app:subscription-migrations:list":wn,"app:subscription-migrations:schedule":kn,"app:subscription-migrations:status":bn,"app:subscription-migrations:unschedule":vn,"app:config:link":Br,"app:config:use":jr,"app:config:pull":Hr,"app:env:pull":en,"app:env:show":tn,"app:execute":rn,"app:graphiql":nn,"app:bulk:execute":on,"app:function:build":an,"app:function:replay":sn,"app:function:run":cn,"app:function:info":En,"app:function:schema":un,"app:function:typegen":pn,"app:generate:extension":dn,"app:versions:list":An,"app:webhook:trigger":xn,"demo:watcher":Mr,"organization:list":Cn},Hc=In,Mc=On;var ob=qr.init;(0,Ea.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",async e=>{await ar(e),process.exit(1)});var Gc=process,ko=!1,Jc=["SIGINT","SIGTERM","SIGQUIT"];Jc.forEach(e=>{process.on(e,()=>{ko||(ko=Gc.emit("shopify:signal",e),ko||process.exit(1))})});var Ta=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(Ta)||(process.stdout.columns=Ta);async function Vc({development:e}){await Bo({moduleURL:import.meta.url,development:e})}ke.plugins.hidden=!0;ke["plugins:install"].description="";var Wc=Object.keys(Mt);Wc.forEach(e=>{Mt[e].customPluginName="@shopify/app"});var Qc=Object.keys(ht);Qc.forEach(e=>{ht[e].customPluginName="@shopify/theme"});var Yc=Object.keys(St);Yc.forEach(e=>{St[e].customPluginName="@shopify/cli-hydrogen"});var Kc=Object.keys(Ht);Kc.forEach(e=>{Ht[e].customPluginName="@shopify/store"});var Xc=Object.keys(gt);Xc.forEach(e=>{gt[e].customPluginName="@oclif/plugin-commands"});var Zc=Object.keys(yt);Zc.forEach(e=>{yt[e].customPluginName="@shopify/plugin-did-you-mean"});var eu=Object.keys(ke);eu.forEach(e=>{ke[e].customPluginName="@oclif/plugin-plugins"});var rb={...Mt,...ht,...ke,...yt,...gt,...St,...Ht,search:Mo,upgrade:Go,version:Ho,"send-analytics":Jo,help:ir,"auth:logout":Vo,"auth:login":Wo,"debug:command-flags":Qo,"kitchen-sink":Zo,"kitchen-sink:async":Yo,"kitchen-sink:prompts":Ko,"kitchen-sink:static":Xo,"doctor-release":er,"doctor-release:theme":tr,"doc:fetch":or,"doc:search":rr,"docs:generate":nr,"notifications:list":sr,"notifications:generate":cr,"cache:clear":ur,"config:autoupgrade:off":pr,"config:autoupgrade:on":dr,"config:autoupgrade:status":mr},nb=Vc;export{Mc as AppPublicMetadataHook,Hc as AppSensitiveMetadataHook,rb as COMMANDS,La as DidYouMeanHook,ob as HydrogenInitHook,Da as PluginHook,Ra as TunnelProviderHook,qa as TunnelStartHook,nb as default,Fa as fetchStoreThemes,Ca as pull,Pa as push};
|