@ohos-ports/shopify 4.8.0-beta.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/README.md +75 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +11 -0
- package/dist/acorn-7M27BPGP.js +16 -0
- package/dist/analytics-3IIUBZ3B.js +1 -0
- package/dist/analytics-OOT5AB52.js +1 -0
- package/dist/angular-DW5TQVCM.js +4 -0
- package/dist/assets/graphiql/favicon.ico +0 -0
- package/dist/assets/graphiql/style.css +58 -0
- package/dist/assets/hydrogen/bundle/analyzer.html +2056 -0
- package/dist/assets/hydrogen/i18n/domains.ts +21 -0
- package/dist/assets/hydrogen/i18n/mock-i18n-types.ts +5 -0
- package/dist/assets/hydrogen/i18n/subdomains.ts +20 -0
- package/dist/assets/hydrogen/i18n/subfolders.ts +22 -0
- package/dist/assets/hydrogen/routes/locale-check.ts +16 -0
- package/dist/assets/hydrogen/starter/.cursor/rules/hydrogen-react-router.mdc +52 -0
- package/dist/assets/hydrogen/starter/.graphqlrc.ts +29 -0
- package/dist/assets/hydrogen/starter/AGENTS.md +5 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +2839 -0
- package/dist/assets/hydrogen/starter/CLAUDE.md +1 -0
- package/dist/assets/hydrogen/starter/README.md +45 -0
- package/dist/assets/hydrogen/starter/app/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +37 -0
- package/dist/assets/hydrogen/starter/app/components/Aside.tsx +101 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +197 -0
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +109 -0
- package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +300 -0
- package/dist/assets/hydrogen/starter/app/components/Footer.tsx +129 -0
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +231 -0
- package/dist/assets/hydrogen/starter/app/components/MockShopNotice.tsx +20 -0
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +174 -0
- package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +61 -0
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +150 -0
- package/dist/assets/hydrogen/starter/app/components/ProductImage.tsx +23 -0
- package/dist/assets/hydrogen/starter/app/components/ProductItem.tsx +44 -0
- package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +27 -0
- package/dist/assets/hydrogen/starter/app/components/SearchForm.tsx +68 -0
- package/dist/assets/hydrogen/starter/app/components/SearchFormPredictive.tsx +76 -0
- package/dist/assets/hydrogen/starter/app/components/SearchResults.tsx +161 -0
- package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +304 -0
- package/dist/assets/hydrogen/starter/app/entry.client.tsx +21 -0
- package/dist/assets/hydrogen/starter/app/entry.server.tsx +53 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerAddressMutations.ts +64 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerDetailsQuery.ts +40 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrderQuery.ts +90 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrdersQuery.ts +63 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerUpdateMutation.ts +25 -0
- package/dist/assets/hydrogen/starter/app/lib/context.ts +65 -0
- package/dist/assets/hydrogen/starter/app/lib/fragments.ts +242 -0
- package/dist/assets/hydrogen/starter/app/lib/orderFilters.ts +90 -0
- package/dist/assets/hydrogen/starter/app/lib/redirect.ts +23 -0
- package/dist/assets/hydrogen/starter/app/lib/search.ts +79 -0
- package/dist/assets/hydrogen/starter/app/lib/session.ts +72 -0
- package/dist/assets/hydrogen/starter/app/lib/variants.ts +46 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +209 -0
- package/dist/assets/hydrogen/starter/app/routes/$.tsx +11 -0
- package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +78 -0
- package/dist/assets/hydrogen/starter/app/routes/[sitemap.xml].tsx +16 -0
- package/dist/assets/hydrogen/starter/app/routes/_index.tsx +177 -0
- package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +9 -0
- package/dist/assets/hydrogen/starter/app/routes/account._index.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +516 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +222 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +222 -0
- package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +133 -0
- package/dist/assets/hydrogen/starter/app/routes/account.tsx +97 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.authorize.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.login.tsx +17 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.logout.tsx +11 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +129 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +175 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +109 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.$lines.tsx +70 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +113 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +161 -0
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +133 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +122 -0
- package/dist/assets/hydrogen/starter/app/routes/discount.$code.tsx +48 -0
- package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +88 -0
- package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +93 -0
- package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +69 -0
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +232 -0
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +426 -0
- package/dist/assets/hydrogen/starter/app/routes/sitemap.$type.$page[.xml].tsx +23 -0
- package/dist/assets/hydrogen/starter/app/routes.ts +9 -0
- package/dist/assets/hydrogen/starter/app/styles/app.css +645 -0
- package/dist/assets/hydrogen/starter/app/styles/reset.css +139 -0
- package/dist/assets/hydrogen/starter/customer-accountapi.generated.d.ts +543 -0
- package/dist/assets/hydrogen/starter/env.d.ts +7 -0
- package/dist/assets/hydrogen/starter/eslint.config.js +247 -0
- package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.jpg +0 -0
- package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.md +394 -0
- package/dist/assets/hydrogen/starter/guides/search/search.jpg +0 -0
- package/dist/assets/hydrogen/starter/guides/search/search.md +335 -0
- package/dist/assets/hydrogen/starter/package.json +62 -0
- package/dist/assets/hydrogen/starter/public/.gitkeep +0 -0
- package/dist/assets/hydrogen/starter/react-router.config.ts +13 -0
- package/dist/assets/hydrogen/starter/server.ts +59 -0
- package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +1342 -0
- package/dist/assets/hydrogen/starter/tsconfig.json +43 -0
- package/dist/assets/hydrogen/starter/vite.config.ts +44 -0
- package/dist/assets/hydrogen/tailwind/package.json +11 -0
- package/dist/assets/hydrogen/tailwind/tailwind.css +6 -0
- package/dist/assets/hydrogen/vanilla-extract/package.json +8 -0
- package/dist/assets/hydrogen/virtual-routes/assets/debug-network.css +609 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon-dark.svg +20 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/virtual-routes/assets/inter-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/styles.css +249 -0
- package/dist/assets/hydrogen/virtual-routes/components/FlameChartWrapper.jsx +123 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseBW.jsx +32 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseColor.jsx +47 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconBanner.jsx +292 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconClose.jsx +38 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconDiscard.jsx +44 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconError.jsx +61 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconGithub.jsx +23 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconTwitter.jsx +21 -0
- package/dist/assets/hydrogen/virtual-routes/components/Layout.jsx +7 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestDetails.jsx +171 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestTable.jsx +91 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestWaterfall.jsx +151 -0
- package/dist/assets/hydrogen/virtual-routes/layout.jsx +33 -0
- package/dist/assets/hydrogen/virtual-routes/lib/useDebugNetworkServer.jsx +178 -0
- package/dist/assets/hydrogen/virtual-routes/routes/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx +37 -0
- package/dist/assets/hydrogen/virtual-routes/routes/graphiql.jsx +5 -0
- package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +265 -0
- package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +243 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root-with-layout.jsx +63 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +67 -0
- package/dist/assets/hydrogen/vite/package.json +13 -0
- package/dist/assets/hydrogen/vite/vite.config.js +43 -0
- package/dist/assets/speedscope/SourceCodePro-Regular.ttf.f546cbe0.woff2 +0 -0
- package/dist/assets/speedscope/demangle-cpp.1768f4cc.js +4 -0
- package/dist/assets/speedscope/favicon-16x16.f74b3187.png +0 -0
- package/dist/assets/speedscope/favicon-32x32.bc503437.png +0 -0
- package/dist/assets/speedscope/file-format-schema.json +324 -0
- package/dist/assets/speedscope/import.bcbb2033.js +123 -0
- package/dist/assets/speedscope/index.html +2 -0
- package/dist/assets/speedscope/perf-vertx-stacks-01-collapsed-all.2681da68.txt +199 -0
- package/dist/assets/speedscope/release.txt +3 -0
- package/dist/assets/speedscope/reset.8c46b7a1.css +2 -0
- package/dist/assets/speedscope/source-code-pro.52b1676f.css +2 -0
- package/dist/assets/speedscope/source-code-pro.LICENSE.md +93 -0
- package/dist/assets/speedscope/source-map.438fa06b.js +24 -0
- package/dist/assets/speedscope/speedscope.6f107512.js +193 -0
- package/dist/babel-I2RLWM7N.js +15 -0
- package/dist/bootstrap.d.ts +5 -0
- package/dist/bootstrap.js +3 -0
- package/dist/chokidar-5RWEYTNQ.js +1 -0
- package/dist/chunk-2AK44UYM.js +1 -0
- package/dist/chunk-2CIZE537.js +3 -0
- package/dist/chunk-2EAFYCCS.js +16 -0
- package/dist/chunk-2KD4LHRT.js +5 -0
- package/dist/chunk-2KGPH7YG.js +2 -0
- package/dist/chunk-2O224ZPO.js +3 -0
- package/dist/chunk-2XDUJQQN.js +12 -0
- package/dist/chunk-36ROOKQB.js +1 -0
- package/dist/chunk-3DCN3N23.js +4 -0
- package/dist/chunk-3JXPOOFV.js +836 -0
- package/dist/chunk-4QBJ5JBX.js +18 -0
- package/dist/chunk-4ZNV5YSL.js +1 -0
- package/dist/chunk-5HBIIYSK.js +1 -0
- package/dist/chunk-5L63PRJL.js +2 -0
- package/dist/chunk-5N6HNQQ5.js +8 -0
- package/dist/chunk-5SEEDOQ5.js +1 -0
- package/dist/chunk-636CTEW7.js +1 -0
- package/dist/chunk-67Z34HN5.js +5 -0
- package/dist/chunk-6BDAJ6UD.js +5 -0
- package/dist/chunk-6CXG3XLP.js +1 -0
- package/dist/chunk-6MWWJZFN.js +19 -0
- package/dist/chunk-6QDOCBD4.js +6 -0
- package/dist/chunk-6RQOEPEC.js +1 -0
- package/dist/chunk-72ZY3KTF.js +1 -0
- package/dist/chunk-742XXXGL.js +6 -0
- package/dist/chunk-773TIA5M.js +2 -0
- package/dist/chunk-7HFHL5SO.js +2 -0
- package/dist/chunk-7ISJRIPT.js +1 -0
- package/dist/chunk-7LWUHQIF.js +1 -0
- package/dist/chunk-7T6M7FAC.js +103 -0
- package/dist/chunk-7UNQOKZW.js +1 -0
- package/dist/chunk-7Y7AZRL3.js +10 -0
- package/dist/chunk-A6BMJISP.js +8 -0
- package/dist/chunk-AAK376RT.js +2 -0
- package/dist/chunk-AEUCDGTB.js +294 -0
- package/dist/chunk-AWUX36VG.js +1 -0
- package/dist/chunk-B4OMIONW.js +5 -0
- package/dist/chunk-BOAGJ6P5.js +1 -0
- package/dist/chunk-BWJIZYAG.js +1 -0
- package/dist/chunk-BZ73NV3L.js +2 -0
- package/dist/chunk-C3RUVXG2.js +6 -0
- package/dist/chunk-C4YLE3NS.js +64 -0
- package/dist/chunk-CEYIZC3M.js +2 -0
- package/dist/chunk-CIWKN4HF.js +7 -0
- package/dist/chunk-CRALWNNO.js +1 -0
- package/dist/chunk-CTNBSUVU.js +83 -0
- package/dist/chunk-CULTZLC4.js +1 -0
- package/dist/chunk-CX5CC6P5.js +1 -0
- package/dist/chunk-CX75OKZK.js +1 -0
- package/dist/chunk-DASVZTAX.js +359 -0
- package/dist/chunk-DPNZWBT5.js +1 -0
- package/dist/chunk-DX3JLOUA.js +4 -0
- package/dist/chunk-E55KS3GZ.js +1 -0
- package/dist/chunk-E5FXOLQO.js +17 -0
- package/dist/chunk-E6N4PZZR.js +7 -0
- package/dist/chunk-EB574SY6.js +6 -0
- package/dist/chunk-ET2CGROE.js +451 -0
- package/dist/chunk-EX5GVHGE.js +1 -0
- package/dist/chunk-F3NYCSXT.js +273 -0
- package/dist/chunk-F3TMLDLC.js +1 -0
- package/dist/chunk-F6X6OXXB.js +3 -0
- package/dist/chunk-FDBHQLFK.js +1 -0
- package/dist/chunk-FDYW3UQC.js +1 -0
- package/dist/chunk-FEDVVYK2.js +1 -0
- package/dist/chunk-FFSDGRAN.js +1 -0
- package/dist/chunk-FJ6F4XRV.js +28 -0
- package/dist/chunk-FKIVKNOV.js +2 -0
- package/dist/chunk-FOREMLFZ.js +1 -0
- package/dist/chunk-FUYDGK33.js +2 -0
- package/dist/chunk-FX3L344E.js +1 -0
- package/dist/chunk-G5XIGN5D.js +593 -0
- package/dist/chunk-GAYKYEIM.js +1 -0
- package/dist/chunk-GB3YC4TI.js +1 -0
- package/dist/chunk-GCN4O7HM.js +1 -0
- package/dist/chunk-GCY7LPEF.js +6 -0
- package/dist/chunk-GNBRCK7L.js +3 -0
- package/dist/chunk-GRPKF5ZB.js +1 -0
- package/dist/chunk-GRSF7456.js +1 -0
- package/dist/chunk-H2TQ4ODI.js +1 -0
- package/dist/chunk-H6XEESUN.js +4 -0
- package/dist/chunk-HB347DXT.js +2 -0
- package/dist/chunk-HFSCXTJQ.js +97 -0
- package/dist/chunk-HHN6KZXX.js +1 -0
- package/dist/chunk-HP64ZTEJ.js +6 -0
- package/dist/chunk-I5A6BPCP.js +1 -0
- package/dist/chunk-IARCMH7G.js +5 -0
- package/dist/chunk-IBI5UCJO.js +1 -0
- package/dist/chunk-IKUSLRGD.js +1 -0
- package/dist/chunk-IT4HYLTY.js +1 -0
- package/dist/chunk-IWOTLFOY.js +32 -0
- package/dist/chunk-J3JPJCWP.js +1 -0
- package/dist/chunk-J4T73EAS.js +8 -0
- package/dist/chunk-JD5P5RAJ.js +1 -0
- package/dist/chunk-JG4HH54Q.js +1 -0
- package/dist/chunk-JIYSCWCG.js +1 -0
- package/dist/chunk-JJZNUFPD.js +44 -0
- package/dist/chunk-JLGA3B7P.js +1 -0
- package/dist/chunk-JWRK5KLD.js +560 -0
- package/dist/chunk-JX7FYWPO.js +1 -0
- package/dist/chunk-K42WBNJQ.js +18 -0
- package/dist/chunk-KDU7VW3L.js +11 -0
- package/dist/chunk-KWVOJWO7.js +1 -0
- package/dist/chunk-LANUJ7LX.js +16 -0
- package/dist/chunk-LD6ZCTZ3.js +9 -0
- package/dist/chunk-LFOBYEWG.js +1 -0
- package/dist/chunk-LQ7ENG4V.js +1 -0
- package/dist/chunk-LUKQ5HLC.js +1 -0
- package/dist/chunk-M2XHIN57.js +4 -0
- package/dist/chunk-MNOQAXJW.js +3 -0
- package/dist/chunk-MPW2YJWU.js +31 -0
- package/dist/chunk-MYQUYU4U.js +2 -0
- package/dist/chunk-N65F7ET2.js +1 -0
- package/dist/chunk-N6RBRPGW.js +7 -0
- package/dist/chunk-N75VOJHO.js +15 -0
- package/dist/chunk-NBFMP5XQ.js +1 -0
- package/dist/chunk-NE3ZFSMS.js +1 -0
- package/dist/chunk-NGLMZYS7.js +278 -0
- package/dist/chunk-NHAUJWEG.js +1 -0
- package/dist/chunk-NILETICC.js +11 -0
- package/dist/chunk-NNZXKFOS.js +7 -0
- package/dist/chunk-NQK2VCDA.js +1 -0
- package/dist/chunk-NROVZETL.js +1 -0
- package/dist/chunk-NW6NUGN7.js +1 -0
- package/dist/chunk-O7DZXO3O.js +15 -0
- package/dist/chunk-OBYQSIYU.js +25 -0
- package/dist/chunk-OEG3N5PG.js +15 -0
- package/dist/chunk-OGBZTY2G.js +5 -0
- package/dist/chunk-OMHR423H.js +1 -0
- package/dist/chunk-OV6SRRXR.js +5 -0
- package/dist/chunk-OVV5YGKN.js +1 -0
- package/dist/chunk-OZL5FTT7.js +1 -0
- package/dist/chunk-OZMQ2EJB.js +1 -0
- package/dist/chunk-P2OI2P2M.js +1 -0
- package/dist/chunk-P57P7UAN.js +3 -0
- package/dist/chunk-PATTG7YZ.js +1 -0
- package/dist/chunk-PG5YNPJB.js +26 -0
- package/dist/chunk-PP4L2JJ6.js +3 -0
- package/dist/chunk-Q5JX23QU.js +1 -0
- package/dist/chunk-Q5KVMLBK.js +4 -0
- package/dist/chunk-Q5LIJGT7.js +12 -0
- package/dist/chunk-Q6ADIMJM.js +6 -0
- package/dist/chunk-Q7BOSHWX.js +7 -0
- package/dist/chunk-QERQARMC.js +1 -0
- package/dist/chunk-QOV43E26.js +1 -0
- package/dist/chunk-QTFUYKMF.js +1 -0
- package/dist/chunk-QTJCCOAG.js +20 -0
- package/dist/chunk-R6ICQT2D.js +1 -0
- package/dist/chunk-R7T3LYJL.js +3 -0
- package/dist/chunk-RJ5VF3QY.js +2 -0
- package/dist/chunk-RXQJCJDV.js +1 -0
- package/dist/chunk-S2TLBBSS.js +5 -0
- package/dist/chunk-S5FOQY35.js +1 -0
- package/dist/chunk-SYLHT42O.js +1 -0
- package/dist/chunk-T4AA6TSF.js +15 -0
- package/dist/chunk-T4QWK5GG.js +10 -0
- package/dist/chunk-T7KHS6RF.js +1 -0
- package/dist/chunk-T7PJDT5O.js +6 -0
- package/dist/chunk-TEY4LRY7.js +1 -0
- package/dist/chunk-TFBRVLDN.js +1 -0
- package/dist/chunk-TOLPNBZK.js +4 -0
- package/dist/chunk-TR4OWSEX.js +77 -0
- package/dist/chunk-TU47HMTL.js +1 -0
- package/dist/chunk-TUVDJ3PG.js +2 -0
- package/dist/chunk-TYMYIUIQ.js +1 -0
- package/dist/chunk-U2DWBZK2.js +1 -0
- package/dist/chunk-U53OLUOE.js +3 -0
- package/dist/chunk-UAETNFN4.js +1 -0
- package/dist/chunk-UAFEFKAQ.js +5 -0
- package/dist/chunk-ULRJDKWQ.js +1 -0
- package/dist/chunk-UOHNRH6E.js +7 -0
- package/dist/chunk-UZARYOLN.js +1 -0
- package/dist/chunk-VASGXHYA.js +1 -0
- package/dist/chunk-VD4XJ6BX.js +1 -0
- package/dist/chunk-VE35YELD.js +1 -0
- package/dist/chunk-VFM2KQRM.js +19 -0
- package/dist/chunk-VJEKDBGZ.js +1 -0
- package/dist/chunk-VKWPEFWQ.js +1 -0
- package/dist/chunk-VSDRNYA5.js +1 -0
- package/dist/chunk-VUMUCNI7.js +1 -0
- package/dist/chunk-VVZSYHDG.js +4 -0
- package/dist/chunk-VXEYO3ZP.js +1 -0
- package/dist/chunk-VYDSOAV4.js +9 -0
- package/dist/chunk-W6ST525S.js +99 -0
- package/dist/chunk-WBYAGS6B.js +6 -0
- package/dist/chunk-WGAFCKGD.js +1 -0
- package/dist/chunk-WYBTC356.js +1 -0
- package/dist/chunk-XF2KTEID.js +1 -0
- package/dist/chunk-XH5YGJQR.js +1 -0
- package/dist/chunk-XHKWITLA.js +1705 -0
- package/dist/chunk-XOCB4KNX.js +2 -0
- package/dist/chunk-XUUAKGEX.js +1 -0
- package/dist/chunk-XUYVJEZG.js +3 -0
- package/dist/chunk-Y47C3LSX.js +3 -0
- package/dist/chunk-Y5PRPHLQ.js +6 -0
- package/dist/chunk-YD2VQEN5.js +1 -0
- package/dist/chunk-YESGYUEL.js +1 -0
- package/dist/chunk-YEVGLC5X.js +1 -0
- package/dist/chunk-YFINLODF.js +375 -0
- package/dist/chunk-YKL3BLWC.js +46 -0
- package/dist/chunk-YLQ3LNNY.js +99 -0
- package/dist/chunk-YLXPYXQP.js +1 -0
- package/dist/chunk-YNDIZCD2.js +7 -0
- package/dist/chunk-YPWHD3NL.js +1 -0
- package/dist/chunk-YSAFHVV6.js +8 -0
- package/dist/chunk-YY6TFARF.js +1 -0
- package/dist/chunk-YZMY2CTU.js +10 -0
- package/dist/chunk-Z4AFEO36.js +1 -0
- package/dist/chunk-Z5WPP6ME.js +1 -0
- package/dist/chunk-Z65E4UAP.js +1 -0
- package/dist/chunk-ZDF5N422.js +1 -0
- package/dist/chunk-ZDRIQC7O.js +1 -0
- package/dist/chunk-ZH44BDUR.js +5 -0
- package/dist/chunk-ZI7LK3LW.js +11 -0
- package/dist/chunk-ZL5LU4U2.js +32 -0
- package/dist/chunk-ZYX7UHCQ.js +1 -0
- package/dist/chunk-ZZRFG6ME.js +317 -0
- package/dist/cli/commands/app/app-logs/sources.js +1 -0
- package/dist/cli/commands/app/build.js +1 -0
- package/dist/cli/commands/app/bulk/cancel.js +1 -0
- package/dist/cli/commands/app/bulk/execute.js +1 -0
- package/dist/cli/commands/app/bulk/status.js +1 -0
- package/dist/cli/commands/app/config/link.js +1 -0
- package/dist/cli/commands/app/config/pull.js +1 -0
- package/dist/cli/commands/app/config/use.js +1 -0
- package/dist/cli/commands/app/config/validate.js +1 -0
- package/dist/cli/commands/app/demo/watcher.js +1 -0
- package/dist/cli/commands/app/deploy.js +1 -0
- package/dist/cli/commands/app/dev/clean.js +1 -0
- package/dist/cli/commands/app/dev.js +1 -0
- package/dist/cli/commands/app/doctor/instructions.js +1 -0
- package/dist/cli/commands/app/doctor.js +1 -0
- package/dist/cli/commands/app/env/pull.js +1 -0
- package/dist/cli/commands/app/env/show.js +1 -0
- package/dist/cli/commands/app/execute.js +1 -0
- package/dist/cli/commands/app/function/build.js +1 -0
- package/dist/cli/commands/app/function/info.js +1 -0
- package/dist/cli/commands/app/function/replay.js +1 -0
- package/dist/cli/commands/app/function/run.js +1 -0
- package/dist/cli/commands/app/function/schema.js +1 -0
- package/dist/cli/commands/app/function/typegen.js +1 -0
- package/dist/cli/commands/app/generate/extension.js +1 -0
- package/dist/cli/commands/app/graphiql.js +1 -0
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -0
- package/dist/cli/commands/app/import-extensions.js +1 -0
- package/dist/cli/commands/app/info.js +1 -0
- package/dist/cli/commands/app/init.js +1 -0
- package/dist/cli/commands/app/logs.js +1 -0
- package/dist/cli/commands/app/release.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -0
- package/dist/cli/commands/app/versions/list.js +1 -0
- package/dist/cli/commands/app/webhook/trigger.js +1 -0
- package/dist/cli/commands/auth/login.d.ts +8 -0
- package/dist/cli/commands/auth/login.js +1 -0
- package/dist/cli/commands/auth/logout.d.ts +5 -0
- package/dist/cli/commands/auth/logout.js +1 -0
- package/dist/cli/commands/cache/clear.d.ts +6 -0
- package/dist/cli/commands/cache/clear.js +1 -0
- package/dist/cli/commands/config/autoupgrade/constants.d.ts +4 -0
- package/dist/cli/commands/config/autoupgrade/constants.js +1 -0
- package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -0
- package/dist/cli/commands/config/autoupgrade/off.js +1 -0
- package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -0
- package/dist/cli/commands/config/autoupgrade/on.js +1 -0
- package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -0
- package/dist/cli/commands/config/autoupgrade/status.js +1 -0
- package/dist/cli/commands/debug/command-flags.d.ts +9 -0
- package/dist/cli/commands/debug/command-flags.js +1 -0
- package/dist/cli/commands/doc/fetch.d.ts +12 -0
- package/dist/cli/commands/doc/fetch.js +1 -0
- package/dist/cli/commands/doc/search.d.ts +13 -0
- package/dist/cli/commands/doc/search.js +1 -0
- package/dist/cli/commands/docs/generate.d.ts +21 -0
- package/dist/cli/commands/docs/generate.js +1 -0
- package/dist/cli/commands/doctor-release/doctor-release.d.ts +6 -0
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -0
- package/dist/cli/commands/doctor-release/theme/index.d.ts +14 -0
- package/dist/cli/commands/doctor-release/theme/index.js +1 -0
- package/dist/cli/commands/help.d.ts +13 -0
- package/dist/cli/commands/help.js +1 -0
- package/dist/cli/commands/kitchen-sink/async.d.ts +11 -0
- package/dist/cli/commands/kitchen-sink/async.js +1 -0
- package/dist/cli/commands/kitchen-sink/index.d.ts +12 -0
- package/dist/cli/commands/kitchen-sink/index.js +1 -0
- package/dist/cli/commands/kitchen-sink/prompts.d.ts +11 -0
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -0
- package/dist/cli/commands/kitchen-sink/static.d.ts +11 -0
- package/dist/cli/commands/kitchen-sink/static.js +1 -0
- package/dist/cli/commands/notifications/generate.d.ts +6 -0
- package/dist/cli/commands/notifications/generate.js +1 -0
- package/dist/cli/commands/notifications/list.d.ts +9 -0
- package/dist/cli/commands/notifications/list.js +1 -0
- package/dist/cli/commands/organization/list.js +1 -0
- package/dist/cli/commands/search.d.ts +14 -0
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/send-analytics.d.ts +5 -0
- package/dist/cli/commands/send-analytics.js +1 -0
- package/dist/cli/commands/theme/check.js +1 -0
- package/dist/cli/commands/theme/console.js +1 -0
- package/dist/cli/commands/theme/delete.js +1 -0
- package/dist/cli/commands/theme/dev.js +1 -0
- package/dist/cli/commands/theme/duplicate.js +1 -0
- package/dist/cli/commands/theme/info.js +1 -0
- package/dist/cli/commands/theme/init.js +1 -0
- package/dist/cli/commands/theme/language-server.js +1 -0
- package/dist/cli/commands/theme/list.js +1 -0
- package/dist/cli/commands/theme/metafields/pull.js +1 -0
- package/dist/cli/commands/theme/open.js +1 -0
- package/dist/cli/commands/theme/package.js +1 -0
- package/dist/cli/commands/theme/preview.js +1 -0
- package/dist/cli/commands/theme/profile.js +1 -0
- package/dist/cli/commands/theme/publish.js +1 -0
- package/dist/cli/commands/theme/pull.js +1 -0
- package/dist/cli/commands/theme/push.js +1 -0
- package/dist/cli/commands/theme/rename.js +1 -0
- package/dist/cli/commands/theme/share.js +1 -0
- package/dist/cli/commands/upgrade.d.ts +7 -0
- package/dist/cli/commands/upgrade.js +1 -0
- package/dist/cli/commands/version.d.ts +5 -0
- package/dist/cli/commands/version.js +1 -0
- package/dist/cli/help.d.ts +38 -0
- package/dist/cli/help.js +2 -0
- package/dist/cli/services/commands/doc/fetch.d.ts +1 -0
- package/dist/cli/services/commands/doc/fetch.js +45 -0
- package/dist/cli/services/commands/doc/search.d.ts +1 -0
- package/dist/cli/services/commands/doc/search.js +47 -0
- package/dist/cli/services/commands/notifications.d.ts +2 -0
- package/dist/cli/services/commands/notifications.js +106 -0
- package/dist/cli/services/commands/search.d.ts +1 -0
- package/dist/cli/services/commands/search.js +7 -0
- package/dist/cli/services/commands/version.d.ts +1 -0
- package/dist/cli/services/commands/version.js +6 -0
- package/dist/cli/services/doctor-release/context.d.ts +16 -0
- package/dist/cli/services/doctor-release/context.js +11 -0
- package/dist/cli/services/doctor-release/theme/runner.d.ts +7 -0
- package/dist/cli/services/doctor-release/theme/runner.js +37 -0
- package/dist/cli/services/doctor-release/theme/tests/init.d.ts +11 -0
- package/dist/cli/services/doctor-release/theme/tests/init.js +34 -0
- package/dist/cli/services/doctor-release/theme/tests/push.d.ts +10 -0
- package/dist/cli/services/doctor-release/theme/tests/push.js +44 -0
- package/dist/cli/services/kitchen-sink/async.d.ts +1 -0
- package/dist/cli/services/kitchen-sink/async.js +65 -0
- package/dist/cli/services/kitchen-sink/prompts.d.ts +1 -0
- package/dist/cli/services/kitchen-sink/prompts.js +168 -0
- package/dist/cli/services/kitchen-sink/static.d.ts +1 -0
- package/dist/cli/services/kitchen-sink/static.js +201 -0
- package/dist/command-registry.d.ts +8 -0
- package/dist/command-registry.js +1 -0
- package/dist/conf-store-ASDCTDQ4.js +1 -0
- package/dist/configs/all.yml +280 -0
- package/dist/configs/nothing.yml +3 -0
- package/dist/configs/recommended.yml +258 -0
- package/dist/configs/theme-app-extension.yml +24 -0
- package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
- package/dist/data/app_block_entry.json +13 -0
- package/dist/data/default_setting_values.json +24 -0
- package/dist/data/filters.json +6177 -0
- package/dist/data/latest.json +2 -0
- package/dist/data/local_block_entry.json +25 -0
- package/dist/data/manifest_theme.json +19 -0
- package/dist/data/manifest_theme_app_extension.json +10 -0
- package/dist/data/objects.json +20621 -0
- package/dist/data/preset.json +72 -0
- package/dist/data/preset_blocks.json +91 -0
- package/dist/data/section.json +208 -0
- package/dist/data/setting.json +1538 -0
- package/dist/data/settings.json +10 -0
- package/dist/data/shopify_system_translations.json +2766 -0
- package/dist/data/tags.json +1276 -0
- package/dist/data/targetted_block_entry.json +15 -0
- package/dist/data/theme_block.json +91 -0
- package/dist/data/theme_block_entry.json +14 -0
- package/dist/data/theme_settings.json +83 -0
- package/dist/data/translations.json +63 -0
- package/dist/deprecations-VBQV7Q4O.js +1 -0
- package/dist/devtools-37DE4MUR.js +1 -0
- package/dist/devtools-WAWU5KQL.js +1 -0
- package/dist/dist-FZLOAKU7.js +1 -0
- package/dist/dist-HTY6UHG5.js +1 -0
- package/dist/environments-HSTNEQRG.js +1 -0
- package/dist/error-2LZYKRMA.js +1 -0
- package/dist/error-handler-PIGEJ7BT.js +1 -0
- package/dist/estree-JV5M77BA.js +44 -0
- package/dist/flow-N4JYPYMQ.js +20 -0
- package/dist/fs-BJHNJDDK.js +1 -0
- package/dist/glimmer-JEV3BXHR.js +37 -0
- package/dist/graphql-DTF6MHYF.js +28 -0
- package/dist/hooks/did-you-mean.d.ts +1 -0
- package/dist/hooks/did-you-mean.js +1 -0
- package/dist/hooks/hydrogen-init.d.ts +7 -0
- package/dist/hooks/hydrogen-init.js +1 -0
- package/dist/hooks/plugin-plugins.d.ts +1 -0
- package/dist/hooks/plugin-plugins.js +1 -0
- package/dist/hooks/postrun.d.ts +1 -0
- package/dist/hooks/postrun.js +1 -0
- package/dist/hooks/prerun.d.ts +1 -0
- package/dist/hooks/prerun.js +2 -0
- package/dist/hooks/public-metadata.d.ts +1 -0
- package/dist/hooks/public-metadata.js +1 -0
- package/dist/hooks/sensitive-metadata.d.ts +1 -0
- package/dist/hooks/sensitive-metadata.js +1 -0
- package/dist/hooks/tunnel-provider.d.ts +1 -0
- package/dist/hooks/tunnel-provider.js +1 -0
- package/dist/hooks/tunnel-start.d.ts +1 -0
- package/dist/hooks/tunnel-start.js +1 -0
- package/dist/html-LVOJ3RQS.js +25 -0
- package/dist/http-proxy-node16-A6AKKRQH.js +38 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +120 -0
- package/dist/is-global-6SCOAJVG.js +1 -0
- package/dist/latest-version-LDWU5F7A.js +49 -0
- package/dist/lib-2BR2WN7L.js +1 -0
- package/dist/lib-M72BVWQ3.js +1 -0
- package/dist/lib-O5EZ4NVT.js +1 -0
- package/dist/lib-P3APEIHY.js +1 -0
- package/dist/local-PZWPRFU7.js +1 -0
- package/dist/markdown-J6CE6POI.js +62 -0
- package/dist/meriyah-PNQQZQYI.js +5 -0
- package/dist/metadata-VVBHB3HL.js +1 -0
- package/dist/morph-BMYYMQNX.js +30489 -0
- package/dist/multipart-parser-5NSSTW27.js +2 -0
- package/dist/node-package-manager-ETYQN7OM.js +1 -0
- package/dist/notifications-system-652OG5KL.js +1 -0
- package/dist/npa-A4YSCQ5Q.js +1 -0
- package/dist/open-KLSGXBIW.js +1 -0
- package/dist/os-7D6NT4O3.js +1 -0
- package/dist/out-53ABAVL7.js +1 -0
- package/dist/output-74VDGYJD.js +1 -0
- package/dist/path-MBXP7ZIC.js +1 -0
- package/dist/postcss-Q36SHOML.js +61 -0
- package/dist/prettier-EGVCP5CY.js +1 -0
- package/dist/source-map-E7FCCJL7.js +1 -0
- package/dist/system-P5QIJALL.js +1 -0
- package/dist/templates/ui-extensions/html/error.html.liquid +41 -0
- package/dist/templates/ui-extensions/html/post_purchase/index.html.liquid +44 -0
- package/dist/templates/ui-extensions/html/post_purchase/tunnel-error.html.liquid +41 -0
- package/dist/templates/ui-extensions/html/tunnel-error.html.liquid +55 -0
- package/dist/toml_patch_bg.wasm +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/typescript-5R4Y7PXE.js +1 -0
- package/dist/typescript-WYPDGPSV.js +21 -0
- package/dist/ui-H5I5YVKV.js +1 -0
- package/dist/upgrade-34HSYBXI.js +1 -0
- package/dist/vendor/esbuild-ohos/lib/main.js +2538 -0
- package/dist/vendor/esbuild-ohos/package.json +7 -0
- package/dist/version-EKXEAF6Q.js +1 -0
- package/dist/version-J2PYO6M5.js +1 -0
- package/dist/workerd-X4TGHEG3.js +18 -0
- package/dist/yaml-6KWCJ64X.js +159 -0
- package/dist/yoga.wasm +0 -0
- package/oclif.manifest.json +10100 -0
- package/package.json +153 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{b as Ae}from"./chunk-2KD4LHRT.js";import"./chunk-CRALWNNO.js";import{a as w,c as g,g as l}from"./chunk-VKWPEFWQ.js";var re=g((ft,D)=>{"use strict";l();var qe=Object.prototype.hasOwnProperty,_="~";function C(){}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(_=!1));function Be(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function te(e,t,r,s,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var n=new Be(r,s||e,o),i=_?_+t:t;return e._events[i]?e._events[i].fn?e._events[i]=[e._events[i],n]:e._events[i].push(n):(e._events[i]=n,e._eventsCount++),e}function j(e,t){--e._eventsCount===0?e._events=new C:delete e._events[t]}function v(){this._events=new C,this._eventsCount=0}v.prototype.eventNames=function(){var t=[],r,s;if(this._eventsCount===0)return t;for(s in r=this._events)qe.call(r,s)&&t.push(_?s.slice(1):s);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};v.prototype.listeners=function(t){var r=_?_+t:t,s=this._events[r];if(!s)return[];if(s.fn)return[s.fn];for(var o=0,n=s.length,i=new Array(n);o<n;o++)i[o]=s[o].fn;return i};v.prototype.listenerCount=function(t){var r=_?_+t:t,s=this._events[r];return s?s.fn?1:s.length:0};v.prototype.emit=function(t,r,s,o,n,i){var c=_?_+t:t;if(!this._events[c])return!1;var a=this._events[c],h=arguments.length,u,f;if(a.fn){switch(a.once&&this.removeListener(t,a.fn,void 0,!0),h){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,r),!0;case 3:return a.fn.call(a.context,r,s),!0;case 4:return a.fn.call(a.context,r,s,o),!0;case 5:return a.fn.call(a.context,r,s,o,n),!0;case 6:return a.fn.call(a.context,r,s,o,n,i),!0}for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];a.fn.apply(a.context,u)}else{var d=a.length,p;for(f=0;f<d;f++)switch(a[f].once&&this.removeListener(t,a[f].fn,void 0,!0),h){case 1:a[f].fn.call(a[f].context);break;case 2:a[f].fn.call(a[f].context,r);break;case 3:a[f].fn.call(a[f].context,r,s);break;case 4:a[f].fn.call(a[f].context,r,s,o);break;default:if(!u)for(p=1,u=new Array(h-1);p<h;p++)u[p-1]=arguments[p];a[f].fn.apply(a[f].context,u)}}return!0};v.prototype.on=function(t,r,s){return te(this,t,r,s,!1)};v.prototype.once=function(t,r,s){return te(this,t,r,s,!0)};v.prototype.removeListener=function(t,r,s,o){var n=_?_+t:t;if(!this._events[n])return this;if(!r)return j(this,n),this;var i=this._events[n];if(i.fn)i.fn===r&&(!o||i.once)&&(!s||i.context===s)&&j(this,n);else{for(var c=0,a=[],h=i.length;c<h;c++)(i[c].fn!==r||o&&!i[c].once||s&&i[c].context!==s)&&a.push(i[c]);a.length?this._events[n]=a.length===1?a[0]:a:j(this,n)}return this};v.prototype.removeAllListeners=function(t){var r;return t?(r=_?_+t:t,this._events[r]&&j(this,r)):(this._events=new C,this._eventsCount=0),this};v.prototype.off=v.prototype.removeListener;v.prototype.addListener=v.prototype.on;v.prefixed=_;v.EventEmitter=v;typeof D<"u"&&(D.exports=v)});var ne=g((ct,se)=>{"use strict";l();se.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}});var N=g(oe=>{l();var E=oe,Ue=w("url"),ie=Object.assign,je=ne(),Ne=/(^|,)\s*upgrade\s*($|,)/i,k=/^https|wss/;E.isSSL=k;E.setupOutgoing=function(e,t,r,s){e.port=t[s||"target"].port||(k.test(t[s||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(c){e[c]=t[s||"target"][c]}),e.method=t.method||r.method,e.headers=ie({},r.headers),t.headers&&ie(e.headers,t.headers),t.auth&&(e.auth=t.auth),t.ca&&(e.ca=t.ca),k.test(t[s||"target"].protocol)&&(e.rejectUnauthorized=typeof t.secure>"u"?!0:t.secure),e.agent=t.agent||!1,e.localAddress=t.localAddress,e.agent||(e.headers=e.headers||{},(typeof e.headers.connection!="string"||!Ne.test(e.headers.connection))&&(e.headers.connection="close"));var o=t[s||"target"],n=o&&t.prependPath!==!1&&o.path||"",i=t.toProxy?r.url:Ue.parse(r.url).path||"";return i=t.ignorePath?"":i,e.path=E.urlJoin(n,i),t.changeOrigin&&(e.headers.host=je(e.port,t[s||"target"].protocol)&&!Me(e.host)?e.host+":"+e.port:e.host),e};E.setupSocket=function(e){return e.setTimeout(0),e.setNoDelay(!0),e.setKeepAlive(!0,0),e};E.getPort=function(e){var t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:E.hasEncryptedConnection(e)?"443":"80"};E.hasEncryptedConnection=function(e){return!!(e.connection.encrypted||e.connection.pair)};E.urlJoin=function(){var e=Array.prototype.slice.call(arguments),t=[],r="",s;return e.forEach((o,n)=>{var i=o.indexOf("?");i!==-1&&(t.push(o.substring(i+1)),e[n]=o.substring(0,i))}),r=t.filter(Boolean).join("&"),s=e.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://"),r?s+"?"+r:s};E.rewriteCookieProperty=function e(t,r,s){return Array.isArray(t)?t.map(function(o){return e(o,r,s)}):t.replace(new RegExp("(;\\s*"+s+"=)([^;]+)","i"),function(o,n,i){var c;if(i in r)c=r[i];else if("*"in r)c=r["*"];else return o;return c?n+c:""})};function Me(e){return!!~e.indexOf(":")}});var he=g((vt,fe)=>{l();var ae=w("url"),ue=N(),De=/^201|30(1|2|7|8)$/;fe.exports={removeChunked:function(t,r,s){t.httpVersion==="1.0"&&delete s.headers["transfer-encoding"]},setConnection:function(t,r,s){t.httpVersion==="1.0"?s.headers.connection=t.headers.connection||"close":t.httpVersion!=="2.0"&&!s.headers.connection&&(s.headers.connection=t.headers.connection||"keep-alive")},setRedirectHostRewrite:function(t,r,s,o){if((o.hostRewrite||o.autoRewrite||o.protocolRewrite)&&s.headers.location&&De.test(s.statusCode)){var n=ae.parse(o.target),i=ae.parse(s.headers.location);if(n.host!=i.host)return;o.hostRewrite?i.host=o.hostRewrite:o.autoRewrite&&(i.host=t.headers.host),o.protocolRewrite&&(i.protocol=o.protocolRewrite),s.headers.location=i.format()}},writeHeaders:function(t,r,s,o){var n=o.cookieDomainRewrite,i=o.cookiePathRewrite,c=o.preserveHeaderKeyCase,a,h=function(d,p){p!=null&&(n&&d.toLowerCase()==="set-cookie"&&(p=ue.rewriteCookieProperty(p,n,"domain")),i&&d.toLowerCase()==="set-cookie"&&(p=ue.rewriteCookieProperty(p,i,"path")),r.setHeader(String(d).trim(),p))};if(typeof n=="string"&&(n={"*":n}),typeof i=="string"&&(i={"*":i}),c&&s.rawHeaders!=null){a={};for(var u=0;u<s.rawHeaders.length;u+=2){var f=s.rawHeaders[u];a[f.toLowerCase()]=f}}Object.keys(s.headers).forEach(function(d){var p=s.headers[d];c&&a&&(d=a[d]||d),h(d,p)})},writeStatusCode:function(t,r,s){s.statusMessage?(r.statusCode=s.statusCode,r.statusMessage=s.statusMessage):r.statusCode=s.statusCode}}});var de=g((wt,ce)=>{l();var T;ce.exports=function(){if(!T){try{T=Ae()("follow-redirects")}catch{}typeof T!="function"&&(T=function(){})}T.apply(null,arguments)}});var we=g((yt,Q)=>{l();var S=w("url"),H=S.URL,ke=w("http"),Ie=w("https"),$=w("stream").Writable,X=w("assert"),le=de();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",s=x(Error.captureStackTrace);!t&&(r||!s)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var z=!1;try{X(new H(""))}catch(e){z=e.code==="ERR_INVALID_URL"}var Fe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],K=["abort","aborted","connect","error","socket","timeout"],G=Object.create(null);K.forEach(function(e){G[e]=function(t,r,s){this._redirectable.emit(e,t,r,s)}});var F=A("ERR_INVALID_URL","Invalid URL",TypeError),V=A("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Ve=A("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",V),We=A("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),$e=A("ERR_STREAM_WRITE_AFTER_END","write after end"),Xe=$.prototype.destroy||ve;function y(e,t){$.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(s){try{r._processResponse(s)}catch(o){r.emit("error",o instanceof V?o:new V({cause:o}))}},this._performRequest()}y.prototype=Object.create($.prototype);y.prototype.abort=function(){Y(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};y.prototype.destroy=function(e){return Y(this._currentRequest,e),Xe.call(this,e),this};y.prototype.write=function(e,t,r){if(this._ending)throw new $e;if(!P(e)&&!Ge(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(x(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new We),this.abort())};y.prototype.end=function(e,t,r){if(x(e)?(r=e,e=t=null):x(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var s=this,o=this._currentRequest;this.write(e,t,function(){s._ended=!0,o.end(null,null,r)}),this._ending=!0}};y.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};y.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};y.prototype.setTimeout=function(e,t){var r=this;function s(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function o(i){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),n()},e),s(i)}function n(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",n),r.removeListener("error",n),r.removeListener("response",n),r.removeListener("close",n),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",o)}return t&&this.on("timeout",t),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",s),this.on("abort",n),this.on("error",n),this.on("response",n),this.on("close",n),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){y.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(y.prototype,e,{get:function(){return this._currentRequest[e]}})});y.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};y.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var s=this._currentRequest=t.request(this._options,this._onNativeResponse);s._redirectable=this;for(var o of K)s.on(o,G[o]);if(this._currentUrl=/^\//.test(this._options.path)?S.format(this._options):this._options.path,this._isRedirect){var n=0,i=this,c=this._requestBodyBuffers;(function a(h){if(s===i._currentRequest)if(h)i.emit("error",h);else if(n<c.length){var u=c[n++];s.finished||s.write(u.data,u.encoding,a)}else i._ended&&s.end()})()}};y.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Y(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Ve;var s,o=this._options.beforeRedirect;o&&(s=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var n=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],I(/^content-/i,this._options.headers));var i=I(/^host$/i,this._options.headers),c=J(this._currentUrl),a=i||c.host,h=/^\w+:/.test(r)?this._currentUrl:S.format(Object.assign(c,{host:a})),u=ze(r,h);if(le("redirecting to",u.href),this._isRedirect=!0,W(u,this._options),(u.protocol!==c.protocol&&u.protocol!=="https:"||u.host!==a&&!Ke(u.host,a))&&I(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),x(o)){var f={headers:e.headers,statusCode:t},d={url:h,method:n,headers:s};o(this._options,f,d),this._sanitizeOptions(this._options)}this._performRequest()};function pe(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(s){var o=s+":",n=r[o]=e[s],i=t[s]=Object.create(n);function c(h,u,f){return Je(h)?h=W(h):P(h)?h=W(J(h)):(f=u,u=me(h),h={protocol:o}),x(u)&&(f=u,u=null),u=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},h,u),u.nativeProtocols=r,!P(u.host)&&!P(u.hostname)&&(u.hostname="::1"),X.equal(u.protocol,o,"protocol mismatch"),le("options",u),new y(u,f)}function a(h,u,f){var d=i.request(h,u,f);return d.end(),d}Object.defineProperties(i,{request:{value:c,configurable:!0,enumerable:!0,writable:!0},get:{value:a,configurable:!0,enumerable:!0,writable:!0}})}),t}function ve(){}function J(e){var t;if(z)t=new H(e);else if(t=me(S.parse(e)),!P(t.protocol))throw new F({input:e});return t}function ze(e,t){return z?new H(e,t):J(S.resolve(t,e))}function me(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new F({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new F({input:e.href||e});return e}function W(e,t){var r=t||{};for(var s of Fe)r[s]=e[s];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function I(e,t){var r;for(var s in t)e.test(s)&&(r=t[s],delete t[s]);return r===null||typeof r>"u"?void 0:String(r).trim()}function A(e,t,r){function s(o){x(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,o||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return s.prototype=new(r||Error),Object.defineProperties(s.prototype,{constructor:{value:s,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),s}function Y(e,t){for(var r of K)e.removeListener(r,G[r]);e.on("error",ve),e.destroy(t)}function Ke(e,t){X(P(e)&&P(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function P(e){return typeof e=="string"||e instanceof String}function x(e){return typeof e=="function"}function Ge(e){return typeof e=="object"&&"length"in e}function Je(e){return H&&e instanceof H}Q.exports=pe({http:ke,https:Ie});Q.exports.wrap=pe});var ye=g((Et,_e)=>{l();var Ye=w("http"),Qe=w("https"),q=he(),M=N(),Ze=we();q=Object.keys(q).map(function(e){return q[e]});var et={http:Ye,https:Qe};var tt=(function(){var e=process.versions.node.split(".").map(Number);return e[0]<=14||e[0]===15&&e[1]<=4})();_e.exports={deleteLength:function(t,r,s){(t.method==="DELETE"||t.method==="OPTIONS")&&!t.headers["content-length"]&&(t.headers["content-length"]="0",delete t.headers["transfer-encoding"])},timeout:function(t,r,s){s.timeout&&t.socket.setTimeout(s.timeout)},XHeaders:function(t,r,s){if(s.xfwd){var o=t.isSpdy||M.hasEncryptedConnection(t),n={for:t.connection.remoteAddress||t.socket.remoteAddress,port:M.getPort(t),proto:o?"https":"http"};["for","port","proto"].forEach(function(i){t.headers["x-forwarded-"+i]=(t.headers["x-forwarded-"+i]||"")+(t.headers["x-forwarded-"+i]?",":"")+n[i]}),t.headers["x-forwarded-host"]=t.headers["x-forwarded-host"]||t.headers.host||""}},stream:function(t,r,s,o,n,i){n.emit("start",t,r,s.target||s.forward);var c=s.followRedirects?Ze:et,a=c.http,h=c.https;if(s.forward){var u=(s.forward.protocol==="https:"?h:a).request(M.setupOutgoing(s.ssl||{},s,t,"forward")),f=R(u,s.forward);if(t.on("error",f),u.on("error",f),(s.buffer||t).pipe(u),!s.target)return r.end()}var d=(s.target.protocol==="https:"?h:a).request(M.setupOutgoing(s.ssl||{},s,t));d.on("socket",function(m){n&&!d.getHeader("expect")&&n.emit("proxyReq",d,t,r,s)}),s.proxyTimeout&&d.setTimeout(s.proxyTimeout,function(){d.abort()}),tt?t.on("aborted",function(){d.abort()}):r.on("close",function(){var m=!r.writableFinished;m&&d.abort()});var p=R(d,s.target);t.on("error",p),d.on("error",p);function R(m,b){return function(U){if(t.socket.destroyed&&U.code==="ECONNRESET")return n.emit("econnreset",U,t,r,b),m.abort();i?i(U,t,r,b):n.emit("error",U,t,r,b)}}(s.buffer||t).pipe(d),d.on("response",function(m){if(n&&n.emit("proxyRes",m,t,r),!r.headersSent&&!s.selfHandleResponse)for(var b=0;b<q.length&&!q[b](t,r,m,s);b++);r.finished?n&&n.emit("end",t,r,m):(m.on("end",function(){n&&n.emit("end",t,r,m)}),s.selfHandleResponse||m.pipe(r))})}}});var Ee=g((bt,ge)=>{l();var rt=w("http"),st=w("https"),O=N();ge.exports={checkMethodAndHeader:function(t,r){if(t.method!=="GET"||!t.headers.upgrade||t.headers.upgrade.toLowerCase()!=="websocket")return r.destroy(),!0},XHeaders:function(t,r,s){if(s.xfwd){var o={for:t.connection.remoteAddress||t.socket.remoteAddress,port:O.getPort(t),proto:O.hasEncryptedConnection(t)?"wss":"ws"};["for","port","proto"].forEach(function(n){t.headers["x-forwarded-"+n]=(t.headers["x-forwarded-"+n]||"")+(t.headers["x-forwarded-"+n]?",":"")+o[n]})}},stream:function(t,r,s,o,n,i){var c=function(u,f){return Object.keys(f).reduce(function(d,p){var R=f[p];if(!Array.isArray(R))return d.push(p+": "+R),d;for(var m=0;m<R.length;m++)d.push(p+": "+R[m]);return d},[u]).join(`\r
|
|
2
|
+
`)+`\r
|
|
3
|
+
\r
|
|
4
|
+
`};O.setupSocket(r),o&&o.length&&r.unshift(o);var a=(O.isSSL.test(s.target.protocol)?st:rt).request(O.setupOutgoing(s.ssl||{},s,t));return n&&n.emit("proxyReqWs",a,t,r,s,o),a.on("error",h),a.on("response",function(u){u.upgrade||(r.write(c("HTTP/"+u.httpVersion+" "+u.statusCode+" "+u.statusMessage,u.headers)),u.pipe(r))}),a.on("upgrade",function(u,f,d){f.on("error",h),f.on("end",function(){n.emit("close",u,f,d)}),r.on("error",function(){f.destroy()}),O.setupSocket(f),d&&d.length&&f.unshift(d),r.write(c("HTTP/1.1 101 Switching Protocols",u.headers)),f.pipe(r).pipe(f),n.emit("open",f),n.emit("proxySocket",f)}),a.end();function h(u){i?i(u,t,r):n.emit("error",u,t,r),r.end()}}}});var Ce=g((xt,Oe)=>{l();var xe=Oe.exports,Re=Object.assign,nt=w("url").parse,Le=re(),it=w("http"),ot=w("https"),be=ye(),Pe=Ee();xe.Server=L;function Z(e){return function(t){return function(r,s){var o=e==="ws"?this.wsPasses:this.webPasses,n=[].slice.call(arguments),i=n.length-1,c,a;typeof n[i]=="function"&&(a=n[i],i--);var h=t;if(!(n[i]instanceof Buffer)&&n[i]!==s&&(h=Re({},t),Re(h,n[i]),i--),n[i]instanceof Buffer&&(c=n[i]),["target","forward"].forEach(function(f){typeof h[f]=="string"&&(h[f]=nt(h[f]))}),!h.target&&!h.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u<o.length&&!o[u](r,s,h,c,this,a);u++);}}}xe.createRightProxy=Z;function L(e){Le.call(this),e=e||{},e.prependPath=e.prependPath!==!1,this.web=this.proxyRequest=Z("web")(e),this.ws=this.proxyWebsocketRequest=Z("ws")(e),this.options=e,this.webPasses=Object.keys(be).map(function(t){return be[t]}),this.wsPasses=Object.keys(Pe).map(function(t){return Pe[t]}),this.on("error",this.onError,this)}w("util").inherits(L,Le);L.prototype.onError=function(e){if(this.listeners("error").length===1)throw e};L.prototype.listen=function(e,t){var r=this,s=function(o,n){r.web(o,n)};return this._server=this.options.ssl?ot.createServer(this.options.ssl,s):it.createServer(s),this.options.ws&&this._server.on("upgrade",function(o,n,i){r.ws(o,n,i)}),this._server.listen(e,t),this};L.prototype.close=function(e){var t=this;this._server&&this._server.close(r);function r(){t._server=null,e&&e.apply(null,arguments)}};L.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var s=e==="ws"?this.wsPasses:this.webPasses,o=!1;if(s.forEach(function(n,i){n.name===t&&(o=i)}),o===!1)throw new Error("No such pass");s.splice(o,0,r)};L.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var s=e==="ws"?this.wsPasses:this.webPasses,o=!1;if(s.forEach(function(n,i){n.name===t&&(o=i)}),o===!1)throw new Error("No such pass");s.splice(o++,0,r)}});var He=g((Ot,Te)=>{l();var B=Ce().Server;function ee(e){return new B(e)}B.createProxyServer=ee;B.createServer=ee;B.createProxy=ee;Te.exports=B});var at=g((Tt,Se)=>{l();Se.exports=He()});export default at();
|
|
5
|
+
/*! Bundled license information:
|
|
6
|
+
|
|
7
|
+
http-proxy-node16/lib/http-proxy/passes/web-outgoing.js:
|
|
8
|
+
http-proxy-node16/lib/http-proxy/passes/web-incoming.js:
|
|
9
|
+
(*!
|
|
10
|
+
* Array of passes.
|
|
11
|
+
*
|
|
12
|
+
* A `pass` is just a function that is executed on `req, res, options`
|
|
13
|
+
* so that you can easily add new checks while still keeping the base
|
|
14
|
+
* flexible.
|
|
15
|
+
*)
|
|
16
|
+
|
|
17
|
+
http-proxy-node16/lib/http-proxy/passes/ws-incoming.js:
|
|
18
|
+
(*!
|
|
19
|
+
* Array of passes.
|
|
20
|
+
*
|
|
21
|
+
* A `pass` is just a function that is executed on `req, socket, options`
|
|
22
|
+
* so that you can easily add new checks while still keeping the base
|
|
23
|
+
* flexible.
|
|
24
|
+
*)
|
|
25
|
+
|
|
26
|
+
http-proxy-node16/index.js:
|
|
27
|
+
(*!
|
|
28
|
+
* Caron dimonio, con occhi di bragia
|
|
29
|
+
* loro accennando, tutte le raccoglie;
|
|
30
|
+
* batte col remo qualunque s’adagia
|
|
31
|
+
*
|
|
32
|
+
* Charon the demon, with the eyes of glede,
|
|
33
|
+
* Beckoning to them, collects them all together,
|
|
34
|
+
* Beats with his oar whoever lags behind
|
|
35
|
+
*
|
|
36
|
+
* Dante - The Divine Comedy (Canto III)
|
|
37
|
+
*)
|
|
38
|
+
*/
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { DidYouMeanHook } from '@shopify/plugin-did-you-mean';
|
|
2
|
+
export { default as TunnelStartHook } from '@shopify/plugin-cloudflare/hooks/tunnel';
|
|
3
|
+
export { default as TunnelProviderHook } from '@shopify/plugin-cloudflare/hooks/provider';
|
|
4
|
+
export { hooks as PluginHook } from '@oclif/plugin-plugins';
|
|
5
|
+
export { AppSensitiveMetadataHook, AppPublicMetadataHook } from '@shopify/app';
|
|
6
|
+
export { push, pull, fetchStoreThemes } from '@shopify/theme';
|
|
7
|
+
export declare const HydrogenInitHook: unknown;
|
|
8
|
+
interface RunShopifyCLIOptions {
|
|
9
|
+
development: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function runShopifyCLI({ development }: RunShopifyCLIOptions): Promise<void>;
|
|
12
|
+
export declare const COMMANDS: any;
|
|
13
|
+
export default runShopifyCLI;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{a as Xe}from"./chunk-AEUCDGTB.js";import{a as Ke,b as Ko}from"./chunk-NGLMZYS7.js";import"./chunk-LQ7ENG4V.js";import"./chunk-DASVZTAX.js";import{a as Fr}from"./chunk-4ZNV5YSL.js";import{a as Cr}from"./chunk-HHN6KZXX.js";import{a as Pr}from"./chunk-OBYQSIYU.js";import{a as nr}from"./chunk-OZL5FTT7.js";import{a as Ur}from"./chunk-XH5YGJQR.js";import{a as M,b as It,c as xr}from"./chunk-T4QWK5GG.js";import{a as dr}from"./chunk-5L63PRJL.js";import{a as ur}from"./chunk-FUYDGK33.js";import{a as Ir}from"./chunk-M2XHIN57.js";import{a as Or}from"./chunk-VXEYO3ZP.js";import{a as _r}from"./chunk-PP4L2JJ6.js";import{a as Nr}from"./chunk-VD4XJ6BX.js";import"./chunk-67Z34HN5.js";import"./chunk-Z65E4UAP.js";import{a as Er}from"./chunk-6CXG3XLP.js";import"./chunk-H2TQ4ODI.js";import"./chunk-HFSCXTJQ.js";import{a as Sr}from"./chunk-QTFUYKMF.js";import{a as wr}from"./chunk-FEDVVYK2.js";import{a as kr}from"./chunk-QOV43E26.js";import{a as br}from"./chunk-YSAFHVV6.js";import{a as Yo,b as Jo,c as hr}from"./chunk-2O224ZPO.js";import{a as $r}from"./chunk-DX3JLOUA.js";import{a as vr}from"./chunk-CULTZLC4.js";import{a as Ar}from"./chunk-NILETICC.js";import{a as cr}from"./chunk-C3RUVXG2.js";import{a as sr}from"./chunk-OMHR423H.js";import"./chunk-XHKWITLA.js";import{a as pr}from"./chunk-KDU7VW3L.js";import"./chunk-FKIVKNOV.js";import{a as mr}from"./chunk-YPWHD3NL.js";import"./chunk-6BDAJ6UD.js";import{a as fr}from"./chunk-RXQJCJDV.js";import{a as gr}from"./chunk-IBI5UCJO.js";import{a as qr}from"./chunk-2EAFYCCS.js";import{a as yr}from"./chunk-S2TLBBSS.js";import"./chunk-36ROOKQB.js";import"./chunk-JX7FYWPO.js";import{a as er}from"./chunk-OV6SRRXR.js";import{a as tr}from"./chunk-VVZSYHDG.js";import{a as rr}from"./chunk-QERQARMC.js";import{a as or}from"./chunk-NE3ZFSMS.js";import{a as Tr}from"./chunk-F6X6OXXB.js";import{a as ir}from"./chunk-K42WBNJQ.js";import"./chunk-MYQUYU4U.js";import{a as Je,b as ar}from"./chunk-QTJCCOAG.js";import"./chunk-UOHNRH6E.js";import"./chunk-N6RBRPGW.js";import"./chunk-CX75OKZK.js";import"./chunk-MNOQAXJW.js";import"./chunk-YNDIZCD2.js";import{a as Ti}from"./chunk-XUYVJEZG.js";import"./chunk-FJ6F4XRV.js";import"./chunk-HP64ZTEJ.js";import"./chunk-P57P7UAN.js";import{a as Ii}from"./chunk-ZH44BDUR.js";import"./chunk-PG5YNPJB.js";import"./chunk-742XXXGL.js";import"./chunk-J3JPJCWP.js";import"./chunk-E5FXOLQO.js";import"./chunk-ZL5LU4U2.js";import"./chunk-YD2VQEN5.js";import"./chunk-J4T73EAS.js";import"./chunk-JWRK5KLD.js";import"./chunk-LUKQ5HLC.js";import"./chunk-R7T3LYJL.js";import"./chunk-GRSF7456.js";import"./chunk-7T6M7FAC.js";import"./chunk-JLGA3B7P.js";import"./chunk-FDBHQLFK.js";import"./chunk-5N6HNQQ5.js";import"./chunk-S5FOQY35.js";import"./chunk-6MWWJZFN.js";import"./chunk-OEG3N5PG.js";import"./chunk-NQK2VCDA.js";import"./chunk-YKL3BLWC.js";import"./chunk-YY6TFARF.js";import"./chunk-E6N4PZZR.js";import"./chunk-Q5JX23QU.js";import"./chunk-ZYX7UHCQ.js";import{b as xi}from"./chunk-E55KS3GZ.js";import"./chunk-GRPKF5ZB.js";import"./chunk-NBFMP5XQ.js";import"./chunk-5SEEDOQ5.js";import{a as U,b as Eo,c as V,d as se,e as ce}from"./chunk-GNBRCK7L.js";import"./chunk-7ISJRIPT.js";import"./chunk-WYBTC356.js";import"./chunk-Y47C3LSX.js";import"./chunk-G5XIGN5D.js";import"./chunk-OZMQ2EJB.js";import"./chunk-Q7BOSHWX.js";import"./chunk-O7DZXO3O.js";import"./chunk-VE35YELD.js";import"./chunk-T7PJDT5O.js";import"./chunk-TU47HMTL.js";import"./chunk-IARCMH7G.js";import"./chunk-TYMYIUIQ.js";import"./chunk-AWUX36VG.js";import"./chunk-C4YLE3NS.js";import"./chunk-Q5LIJGT7.js";import"./chunk-ZI7LK3LW.js";import"./chunk-7LWUHQIF.js";import{a as Rr}from"./chunk-OGBZTY2G.js";import{a as Oo}from"./chunk-EB574SY6.js";import{a as _o}from"./chunk-Q6ADIMJM.js";import{a as No}from"./chunk-WBYAGS6B.js";import"./chunk-GCN4O7HM.js";import{a as wo}from"./chunk-Z4AFEO36.js";import{a as Xo}from"./chunk-IKUSLRGD.js";import"./chunk-JG4HH54Q.js";import"./chunk-TFBRVLDN.js";import{a as Zo}from"./chunk-HB347DXT.js";import{a as lr}from"./chunk-NNZXKFOS.js";import"./chunk-2AK44UYM.js";import{a as ye,b as Fo,c as de,e as ue,f as Se,g as Co,h as Po,i as Do,j as Lo,k as Ro,l as qo,m as Ye,n as $o,o as Uo,p as zo,q as Mo,r as Ho,s as Bo}from"./chunk-3DCN3N23.js";import"./chunk-EX5GVHGE.js";import"./chunk-UZARYOLN.js";import"./chunk-NW6NUGN7.js";import"./chunk-YESGYUEL.js";import{a as vo}from"./chunk-T4AA6TSF.js";import{a as So}from"./chunk-ULRJDKWQ.js";import{a as fo}from"./chunk-PATTG7YZ.js";import{a as yo}from"./chunk-Z5WPP6ME.js";import"./chunk-U2DWBZK2.js";import{a as ho}from"./chunk-FDYW3UQC.js";import"./chunk-TEY4LRY7.js";import"./chunk-VUMUCNI7.js";import{a as go}from"./chunk-N65F7ET2.js";import"./chunk-CIWKN4HF.js";import{a as To}from"./chunk-OVV5YGKN.js";import{a as xo}from"./chunk-UAETNFN4.js";import"./chunk-BZ73NV3L.js";import{a as co}from"./chunk-YLXPYXQP.js";import"./chunk-Q5KVMLBK.js";import{a as no}from"./chunk-GAYKYEIM.js";import{a as mo}from"./chunk-SYLHT42O.js";import{a as po}from"./chunk-VSDRNYA5.js";import{a as Io}from"./chunk-72ZY3KTF.js";import{a as lo}from"./chunk-H6XEESUN.js";import{a as ko}from"./chunk-2CIZE537.js";import{a as bo}from"./chunk-GCY7LPEF.js";import{a as Dr}from"./chunk-FX3L344E.js";import"./chunk-ZZRFG6ME.js";import"./chunk-A6BMJISP.js";import"./chunk-YLQ3LNNY.js";import"./chunk-VJEKDBGZ.js";import"./chunk-TUVDJ3PG.js";import{a as Go,b as jo,d as we,e as H,f as Ot,g as _t,h as Vo,i as Wo,j as Qo}from"./chunk-N75VOJHO.js";import{e as ee}from"./chunk-KWVOJWO7.js";import"./chunk-CEYIZC3M.js";import"./chunk-XOCB4KNX.js";import"./chunk-F3NYCSXT.js";import"./chunk-IWOTLFOY.js";import"./chunk-FFSDGRAN.js";import"./chunk-F3TMLDLC.js";import"./chunk-4QBJ5JBX.js";import"./chunk-6RQOEPEC.js";import"./chunk-U53OLUOE.js";import{a as Lr}from"./chunk-IT4HYLTY.js";import"./chunk-NROVZETL.js";import{a as Ei}from"./chunk-7HFHL5SO.js";import{d as Ni}from"./chunk-ZDRIQC7O.js";import{a as Ao}from"./chunk-JIYSCWCG.js";import{a as so}from"./chunk-VYDSOAV4.js";import{a as uo}from"./chunk-WGAFCKGD.js";import{a as Ai}from"./chunk-6QDOCBD4.js";import{a as io,b as g,c as T,e as ao,f as Qe}from"./chunk-YEVGLC5X.js";import{c as Ze,d as _i}from"./chunk-LANUJ7LX.js";import{b as j}from"./chunk-2XDUJQQN.js";import"./chunk-LFOBYEWG.js";import{D as _,K as R,U as B,b as Wt,d as Be,ja as ne,k as vi,ka as K,pa as At,r as kt,ra as X,s as bt,z as vt}from"./chunk-3JXPOOFV.js";import"./chunk-ZDF5N422.js";import"./chunk-Y5PRPHLQ.js";import{A as Z,B as G,C as Kt,F as Xt,G as ie,I as $,K as Zt,M as je,N as Ve,T as oo,V as We,a as Vt,y as b,z as I}from"./chunk-YFINLODF.js";import"./chunk-7Y7AZRL3.js";import"./chunk-7UNQOKZW.js";import"./chunk-UAFEFKAQ.js";import"./chunk-5HBIIYSK.js";import"./chunk-GB3YC4TI.js";import{a as yt}from"./chunk-VASGXHYA.js";import"./chunk-MPW2YJWU.js";import{e as Qt}from"./chunk-YZMY2CTU.js";import"./chunk-RJ5VF3QY.js";import{d as Yt,e as Jt}from"./chunk-NHAUJWEG.js";import"./chunk-XF2KTEID.js";import{g as eo,h as s,j as to,k as ae}from"./chunk-BWJIZYAG.js";import"./chunk-T7KHS6RF.js";import{a as z}from"./chunk-CTNBSUVU.js";import{a as pe,b as Oi}from"./chunk-W6ST525S.js";import"./chunk-AAK376RT.js";import"./chunk-P2OI2P2M.js";import"./chunk-636CTEW7.js";import"./chunk-TR4OWSEX.js";import"./chunk-2KD4LHRT.js";import"./chunk-I5A6BPCP.js";import"./chunk-CX5CC6P5.js";import"./chunk-ET2CGROE.js";import"./chunk-TOLPNBZK.js";import"./chunk-FOREMLFZ.js";import"./chunk-2KGPH7YG.js";import{Ab as l,Bb as xt,Cb as Tt,N as Gt,Ta as ge,V as jt,Z as J,ba as St,ga as wt,ma as he,qb as c,sb as d,ua as He,wb as v,xb as P,zb as ro}from"./chunk-VFM2KQRM.js";import{i as Ge}from"./chunk-B4OMIONW.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-R6ICQT2D.js";import"./chunk-DPNZWBT5.js";import"./chunk-JD5P5RAJ.js";import{f as Y}from"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import{e as L,g as n}from"./chunk-VKWPEFWQ.js";n();var ki=L(Ai(),1);n();n();n();n();function Nt(e){return Eo(e).map(t=>({store:t.store,userId:t.userId,scopes:t.scopes,acquiredAt:t.acquiredAt,...t.expiresAt?{expiresAt:t.expiresAt}:{},...t.refreshTokenExpiresAt?{refreshTokenExpiresAt:t.refreshTokenExpiresAt}:{},...t.associatedUser?{associatedUser:t.associatedUser}:{}})).sort((t,o)=>o.acquiredAt.localeCompare(t.acquiredAt)||t.store.localeCompare(o.store))}function zr(){return{sessions:Nt().map(e=>({kind:"store",store:e.store,userId:e.userId,scopes:e.scopes,connectedAt:e.acquiredAt,...e.expiresAt?{expiresAt:e.expiresAt}:{},...e.refreshTokenExpiresAt?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...e.associatedUser?{associatedUser:e.associatedUser}:{}}))}}n();n();var Fi=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"});function et(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?"":Fi.format(t)}function tt(e){let t=M(e);if(t)return t.split(".")[0]}function Mr(e,t){if(t==="json"){v(JSON.stringify(Ci(e),null,2));return}Pi(e)}function Ci(e){return{sessions:e.sessions.map(Hr),...e.sessions.length===0?{message:Br()}:{}}}function Pi(e){if(e.sessions.length===0){P(Br());return}ie({rows:e.sessions.map(Hr),columns:{subdomain:{header:"Subdomain"},connected:{header:"Connected"}}})}function Hr(e){return{subdomain:tt(e.store)??e.store,connected:et(e.connectedAt)}}function Br(){return["No stores are authenticated directly with `shopify store auth`.","","Run `shopify store auth --store <domain> --scopes <scopes>` to authenticate a store.","Run `shopify store list` to list stores in a Shopify organization."].join(`
|
|
2
|
+
`)}var ke=class e extends j{static summary="List stores authenticated directly with store auth.";static descriptionWithMarkdown="Lists stores authenticated directly on this machine with `shopify store auth`.\n\nUse this command to find stores that can be used with store-authenticated commands such as `shopify store execute`.\nTo list stores in a Shopify organization, run `shopify store list`.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --json"];static flags={...g,...T};async run(){let{flags:t}=await this.parse(e),o=zr();Mr(o,t.json?"json":"text")}};n();n();n();var Gr=13387,ot="/auth/callback",Et="/auth/handoff";function jr(e){return`http://127.0.0.1:${e}${ot}`}function Vr(e,t){return`http://127.0.0.1:${e}${Et}?nonce=${encodeURIComponent(t)}`}function D(e){return e.length<=10?"***":`${e.slice(0,10)}***`}n();function Wr(e,t=300){return e.slice(0,t)}async function Qr(e){let t=`https://${e.store}/admin/oauth/access_token`;l(d`Exchanging authorization code for token at ${c.raw(t)}`);let o=await kt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:U,code:e.code,code_verifier:e.codeVerifier,redirect_uri:e.redirectUri})}),r=await o.text();if(!o.ok)throw l(d`Token exchange failed with HTTP ${c.raw(String(o.status))}: ${c.raw(Wr(r||o.statusText))}`),new s(`Failed to exchange OAuth code for an access token (HTTP ${o.status}).`,r||o.statusText);let i;try{i=JSON.parse(r)}catch{throw new s("Received an invalid token response from Shopify.")}return l(d`Token exchange succeeded: access_token=${c.raw(D(i.access_token))}, refresh_token=${c.raw(i.refresh_token?D(i.refresh_token):"none")}, expires_in=${c.raw(String(i.expires_in??"unknown"))}s, user=${c.raw(String(i.associated_user?.id??"unknown"))} (${c.raw(i.associated_user?.email??"no email")})`),i}async function Yr(e){let t=`https://${e.store}/admin/oauth/access_token`;l(d`Refreshing access token for ${c.raw(e.store)} using refresh_token=${c.raw(D(e.refreshToken))}`);let o=await kt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:U,grant_type:"refresh_token",refresh_token:e.refreshToken})}),r=await o.text();if(!o.ok)throw l(d`Token refresh failed with HTTP ${c.raw(String(o.status))}: ${c.raw(Wr(r||o.statusText))}`),new s(`Token refresh failed for ${e.store} (HTTP ${o.status}).`);let i;try{i=JSON.parse(r)}catch{throw new s("Received an invalid refresh response from Shopify.")}if(!i.access_token)throw new s(`Token refresh returned an invalid response for ${e.store}.`);return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresIn:i.expires_in,refreshTokenExpiresIn:i.refresh_token_expires_in}}var Di=`#graphql
|
|
3
|
+
query CurrentAppInstallationAccessScopes {
|
|
4
|
+
currentAppInstallation {
|
|
5
|
+
accessScopes {
|
|
6
|
+
handle
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
`;async function Jr(e){l(d`Fetching current app installation scopes for ${c.raw(e.store)} using token ${c.raw(D(e.accessToken))}`);let t=await K({query:Di,api:"Admin",url:ee(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 Ft="<comma-separated-scopes>";function Kr(e,t){return{command:`shopify store auth --store ${e} --scopes ${t}`}}function Li(e){return[[Kr(e,Ft)]]}function Xr(e,t,o){return[["Run",Kr(e,t),o]]}function Ri(e){return e.kind==="preview"?Ft:e.scopes.join(",")}function Zr(e){throw new s(`No stored app authentication found for ${e}.`,void 0,Xr(e,Ft,"to authenticate"))}function be(e,t){throw new s(e,void 0,Xr(t.store,Ri(t),"to re-authenticate"))}function rt(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.`;be(t,e)}function en(e){return new s("OAuth callback store does not match the requested store.",`Shopify returned ${e} during authentication. Re-run using the permanent store domain:`,Li(e))}import{timingSafeEqual as qi}from"crypto";import{createServer as $i}from"http";function tn(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
|
+
<html lang="en">
|
|
12
|
+
<head>
|
|
13
|
+
<meta charset="utf-8" />
|
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
15
|
+
<title>${o}</title>
|
|
16
|
+
<style>
|
|
17
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
18
|
+
html, body {
|
|
19
|
+
background-color: rgb(10, 19, 20);
|
|
20
|
+
color: rgb(32, 34, 35);
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
background: radial-gradient(53.91% 53.91% at 50% 22.36%, rgb(10, 19, 20) 50%, rgb(2, 9, 10) 100%);
|
|
24
|
+
min-height: 100vh;
|
|
25
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
line-height: 20px;
|
|
28
|
+
-webkit-font-smoothing: antialiased;
|
|
29
|
+
}
|
|
30
|
+
.page-main {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
min-height: 100vh;
|
|
36
|
+
}
|
|
37
|
+
.header {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
.card {
|
|
44
|
+
background: #fff;
|
|
45
|
+
border-radius: 24px;
|
|
46
|
+
box-shadow: rgba(26, 26, 26, 0.24) 0px 12px 20px -8px,
|
|
47
|
+
rgba(204, 204, 204, 0.5) 0px 1px 0px 0px inset,
|
|
48
|
+
rgba(0, 0, 0, 0.17) 0px -1px 0px 0px inset,
|
|
49
|
+
rgba(0, 0, 0, 0.13) -1px 0px 0px 0px inset,
|
|
50
|
+
rgba(0, 0, 0, 0.13) 1px 0px 0px 0px inset;
|
|
51
|
+
max-width: 476px;
|
|
52
|
+
width: calc(100% - 2rem);
|
|
53
|
+
margin-top: 28px;
|
|
54
|
+
padding: 40px;
|
|
55
|
+
}
|
|
56
|
+
h1 {
|
|
57
|
+
font-size: 24px;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
line-height: 28.8px;
|
|
60
|
+
color: rgb(32, 34, 35);
|
|
61
|
+
margin-bottom: 12px;
|
|
62
|
+
}
|
|
63
|
+
p {
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
line-height: 20px;
|
|
66
|
+
color: rgb(109, 113, 117);
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
69
|
+
</head>
|
|
70
|
+
<body>
|
|
71
|
+
<div class="page-main">
|
|
72
|
+
<header class="header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 28" width="80" height="90"><path fill="#95BF47" fill-rule="evenodd" d="M17.836 27.059l-.062-23.736c-.16-.16-.472-.112-.594-.076l-.813.252a5.675 5.675 0 00-.39-.957c-.576-1.1-1.42-1.682-2.44-1.683h-.003c-.068 0-.136.006-.204.012h-.008a2.234 2.234 0 00-.092-.105C12.786.29 12.216.059 11.533.079c-1.318.038-2.63.99-3.693 2.679-.75 1.19-1.318 2.683-1.48 3.84L3.767 7.4c-.764.24-.788.263-.888.982C2.803 8.928.806 24.377.806 24.377l16.743 2.895.287-.213zM12.35 1.163a1.347 1.347 0 00-.792-.208c-2.033.06-3.807 3.235-4.26 5.352l1.949-.604.347-.107c.255-1.344.896-2.738 1.733-3.636a3.821 3.821 0 011.023-.797zm-1.793 4.135l2.796-.866c.009-.728-.07-1.805-.435-2.565-.388.16-.715.44-.95.691-.628.675-1.14 1.705-1.41 2.74zM14.23 4.16l1.299-.403c-.208-.674-.7-1.805-1.7-1.994.311.802.391 1.73.4 2.397z" clip-rule="evenodd"/><path fill="#5E8E3E" d="M21.587 5.088c-.099-.008-2.035-.037-2.035-.037s-1.619-1.573-1.778-1.733a.399.399 0 00-.225-.103v24.053l7.256-1.804S21.844 5.447 21.825 5.31a.263.263 0 00-.238-.222z"/><path fill="#fff" d="M13.528 8.824l-.843 3.153s-.94-.429-2.054-.358c-1.635.103-1.652 1.134-1.636 1.392.09 1.41 3.799 1.718 4.008 5.021.163 2.599-1.379 4.376-3.601 4.516-2.667.169-4.135-1.405-4.135-1.405l.565-2.404s1.478 1.115 2.66 1.04c.773-.048 1.05-.677 1.021-1.121-.116-1.84-3.137-1.731-3.328-4.754-.16-2.544 1.51-5.12 5.196-5.353 1.42-.09 2.147.273 2.147.273"/></svg></header>
|
|
73
|
+
<main class="card">
|
|
74
|
+
<h1>${o}</h1>
|
|
75
|
+
<p>${r}</p>
|
|
76
|
+
</main>
|
|
77
|
+
</div>
|
|
78
|
+
</body>
|
|
79
|
+
</html>`}async function rn({store:e,state:t,port:o,timeoutMs:r=300*1e3,onListening:i,authorizationRedirect:a}){let u=_(e);return new Promise((p,m)=>{let y=!1,x=!1,h=!1,F=setTimeout(()=>{A(new s("Timed out waiting for OAuth callback."))},r),O=$i((C,f)=>{let ze=new URL(C.url??"/",`http://127.0.0.1:${o}`);if(ze.pathname===Et&&a){let re=ze.searchParams.get("nonce");if(!re||!on(re,a.nonce)){f.statusCode=403,f.setHeader("Cache-Control","no-store"),f.setHeader("Connection","close"),f.end("Forbidden");return}if(h){f.statusCode=410,f.setHeader("Cache-Control","no-store"),f.setHeader("Connection","close"),f.end("Authorization handoff already used");return}h=!0,f.statusCode=302,f.setHeader("Location",a.authorizationUrl),f.setHeader("Cache-Control","no-store"),f.setHeader("Referrer-Policy","no-referrer"),f.setHeader("Connection","close"),f.end();return}if(ze.pathname!==ot){f.statusCode=404,f.end("Not found");return}let{searchParams:Me}=ze,fe=(re,bi)=>{let Bt=typeof re=="string"?new s(re,bi):re;f.statusCode=400,f.setHeader("Content-Type","text/html"),f.setHeader("Connection","close"),f.once("finish",()=>A(Bt)),f.end(tn("Authentication failed",Bt.message))},ht=Me.get("shop");if(l(d`Received OAuth callback for shop ${c.raw(ht??"unknown")}`),!ht){fe("OAuth callback store does not match the requested store.");return}let zt=_(ht);if(zt!==u){fe(en(zt));return}let Mt=Me.get("state");if(!Mt||!on(Mt,t)){fe("OAuth callback state does not match the original request.");return}let Ht=Me.get("error");if(Ht){fe(`Shopify returned an OAuth error: ${Ht}`);return}let gt=Me.get("code");if(!gt){fe("OAuth callback did not include an authorization code.");return}l(d`Received authorization code ${c.raw(D(gt))}`),f.statusCode=200,f.setHeader("Content-Type","text/html"),f.setHeader("Connection","close"),f.once("finish",()=>k(()=>p(gt))),f.end(tn("Authentication succeeded","Close this window and return to the terminal"))}),k=C=>{if(y)return;y=!0,clearTimeout(F);let f=()=>{C()};if(!x){f();return}O.close(()=>{x=!1,f()}),O.closeIdleConnections?.()},A=C=>{k(()=>m(C))};O.on("error",C=>{if(C.code==="EADDRINUSE"){A(new s(`Port ${o} is already in use.`,`Free port ${o} and re-run ${c.genericShellCommand(`shopify store auth --store ${e} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));return}A(C)}),O.listen(o,"127.0.0.1",()=>{x=!0,l(d`PKCE callback server listening on http://127.0.0.1:${c.raw(String(o))}${c.raw(ot)}`),i&&Promise.resolve(i()).catch(C=>{A(C instanceof Error?C:new Error(String(C)))})})})}function on(e,t){return e.length!==t.length?!1:qi(Buffer.from(e,"utf8"),Buffer.from(t,"utf8"))}n();import{createHash as Ui,randomBytes as nn}from"crypto";function zi(){return nn(32).toString("base64url")}function Mi(e){return Ui("sha256").update(e).digest("base64url")}function Hi(e){let t=new URLSearchParams;return t.set("client_id",U),t.set("scope",e.scopes.join(",")),t.set("redirect_uri",e.redirectUri),t.set("state",e.state),t.set("response_type","code"),t.set("code_challenge",e.codeChallenge),t.set("code_challenge_method","S256"),e.signup&&t.set("signup",e.signup),`https://${e.store}/admin/oauth/authorize?${t.toString()}`}function an(e){let{store:t,scopes:o,signup:r,exchangeCodeForToken:i}=e,a=Gr,u=Be(),p=jr(a),m=zi(),y=Mi(m),x=Hi({store:t,scopes:o,state:u,redirectUri:p,codeChallenge:y,signup:r}),h=r?nn(32).toString("base64url"):void 0,F=h?Vr(a,h):x;return l(d`Starting PKCE auth for ${c.raw(t)} with scopes ${c.raw(o.join(","))} (redirect_uri=${c.raw(p)})`),{authorization:{store:t,scopes:o,state:u,port:a,redirectUri:p,authorizationUrl:F,codeVerifier:m,signup:r},waitForAuthCodeOptions:{store:t,state:u,port:a,authorizationRedirect:h?{nonce:h,authorizationUrl:x}:void 0},exchangeCodeForToken:O=>i({store:t,code:O,codeVerifier:m,redirectUri:p})}}n();function Pt(e){let t=e.split(/[ ,]+/).filter(Boolean);if(t.length===0)throw new s("At least one scope is required.","Pass --scopes as a comma-separated list.");return Gt(t)}function Ct(e){let t=new Set(e);for(let o of e){let r=o.match(/^(unauthenticated_)?write_(.*)$/);r&&t.add(`${r[1]??""}read_${r[2]}`)}return t}function sn(e,t){let o=[...t],r=Ct(t);for(let i of e)if(!r.has(i)){o.push(i);for(let a of Ct([i]))r.add(a)}return o}function cn(e,t){if(!e.scope)return l(d`Token response did not include scope; falling back to requested scopes`),t;let o=Pt(e.scope),r=Ct(o),i=t.filter(a=>!r.has(a));if(i.length>0)throw new s("Shopify granted fewer scopes than were requested.",`Missing scopes: ${i.join(", ")}.`,["Update the app or store installation scopes.","See https://shopify.dev/app/scopes","Re-run shopify store auth."]);return o}n();n();var Bi=240*1e3;function Gi(e){if(!e.expiresAt)return!1;let t=new Date(e.expiresAt).getTime();return Number.isNaN(t)?!0:t-Bi<Date.now()}function ji(e,t){let o=Date.now(),r=t.expiresIn?new Date(o+t.expiresIn*1e3).toISOString():e.expiresAt;return{...e,accessToken:t.accessToken,refreshToken:t.refreshToken??e.refreshToken,expiresAt:r,refreshTokenExpiresAt:t.refreshTokenExpiresIn?new Date(o+t.refreshTokenExpiresIn*1e3).toISOString():e.refreshTokenExpiresAt,acquiredAt:new Date(o).toISOString()}}async function q(e){let t=V(e);if(t||Zr(e),l(d`Loaded stored session for ${c.raw(e)}: token=${c.raw(D(t.accessToken))}, expires=${c.raw(t.expiresAt??"unknown")}`),!Gi(t))return t;t.refreshToken||be(`No refresh token stored for ${t.store}.`,t),l(d`Refreshing expired token for ${c.raw(t.store)} (expired at ${c.raw(t.expiresAt??"unknown")}, refresh_token=${c.raw(D(t.refreshToken))})`);let o=t.accessToken,r;try{r=await Yr({store:t.store,refreshToken:t.refreshToken})}catch(i){throw ce(t.store,t.userId),i instanceof s&&i.message.startsWith(`Token refresh failed for ${t.store} (HTTP `)&&be(i.message,t),i instanceof s&&i.message===`Token refresh returned an invalid response for ${t.store}.`&&be(i.message,t),i instanceof s&&i.message==="Received an invalid refresh response from Shopify.",i}return t=ji(t,r),l(d`Token refresh succeeded for ${c.raw(t.store)}: ${c.raw(D(o))} → ${c.raw(D(t.accessToken))}, new expiry ${c.raw(t.expiresAt??"unknown")}`),se(t),t}function dn(e,t=300){return e.slice(0,t)}function Vi(e){if(e&&typeof e=="object"&&"response"in e){let t=e.response,o=t?.status,r=t?.errors;if(typeof o=="number"){let i=typeof r=="string"?r:JSON.stringify(r);return dn(i?`HTTP ${o}: ${i}`:`HTTP ${o}`)}}return dn(e instanceof Error?e.message:String(e))}async function un(e){let t=_(e),o=V(t);if(!o)return{scopes:[],authoritative:!0};try{let r=await q(t),i=await Jr({store:r.store,accessToken:r.accessToken});return l(d`Resolved current remote scopes for ${c.raw(t)}: ${c.raw(i.join(",")||"none")}`),{scopes:i,authoritative:!0}}catch(r){if(r instanceof Error)return l(d`Falling back to locally stored scopes for ${c.raw(t)} after remote scope lookup failed: ${c.raw(Vi(r))}`),{scopes:o.scopes,authoritative:!1};throw r}}n();function Wi(e){return JSON.stringify(e,null,2)}function Qi(e){return{completed:["Logged in.",`Authenticated${e.associatedUser?.email?` as ${e.associatedUser.email}`:""} against ${e.store}.`],info:["","To verify that authentication worked, run:",`shopify store execute --store ${e.store} --query 'query { shop { name id } }'`]}}function Yi(){P("Shopify CLI will open the app authorization page in your browser."),P("")}function Ji(e,t={}){if(t.sensitive){P("Browser did not open automatically. The manual authorization URL contains sensitive credentials and was not printed."),P("Run this command again in an environment where Shopify CLI can open a browser automatically."),P("");return}P("Browser did not open automatically. Open this URL manually:"),P(d`${c.link(e)}`),P("")}function Ki(e,t="text"){if(t==="json"){v(Wi(e));return}let o=Qi(e);o.completed.forEach(r=>ro(r)),o.info.forEach(r=>P(r))}function me(e="text"){return{openingBrowser:Yi,manualAuthUrl:Ji,success(t){Ki(t,e)}}}n();async function N(e,t,o){await Jt(()=>({store_fqdn:e})),await Yt(()=>({store_fqdn_hash:Wt(e),store_fqdn_validated:t,store_domain:e,store_id:jt(o)}))}var Xi={openURL:Ve,waitForStoreAuthCode:rn,exchangeStoreAuthCodeForToken:Qr,resolveExistingScopes:un,getCurrentStoredStoreAppSession:V,presenter:me("text")};async function nt(e,t={}){let o={...Xi,...t},r=_(e.store);Zi(r,o),await N(r,!1);let i=Pt(e.scopes),a=await o.resolveExistingScopes(r),u=sn(i,a.scopes),p=a.authoritative?u:i;a.scopes.length>0&&l(d`Merged requested scopes ${c.raw(i.join(","))} with existing scopes ${c.raw(a.scopes.join(","))} for ${c.raw(r)}`);let m=an({store:r,scopes:u,signup:e.signup,exchangeCodeForToken:o.exchangeStoreAuthCodeForToken}),{authorization:{authorizationUrl:y}}=m;o.presenter.openingBrowser();let x=await o.waitForStoreAuthCode({...m.waitForAuthCodeOptions,onListening:async()=>{await o.openURL(y)||o.presenter.manualAuthUrl(y,{sensitive:!1})}}),h=await m.exchangeCodeForToken(x);await N(r,!0);let F=h.associated_user?.id?.toString();if(!F)throw new s("Shopify did not return associated user information for the online access token.");R(F);let O=Date.now(),k=h.expires_in?new Date(O+h.expires_in*1e3).toISOString():void 0,A={store:r,userId:F,scopes:cn(h,p),acquiredAt:new Date(O).toISOString(),expiresAt:k,refreshTokenExpiresAt:h.refresh_token_expires_in?new Date(O+h.refresh_token_expires_in*1e3).toISOString():void 0,hasRefreshToken:!!h.refresh_token,associatedUser:h.associated_user?{id:h.associated_user.id,email:h.associated_user.email,firstName:h.associated_user.first_name,lastName:h.associated_user.last_name,accountOwner:h.associated_user.account_owner}:void 0};return se({store:r,clientId:U,userId:F,accessToken:h.access_token,refreshToken:h.refresh_token,scopes:A.scopes,acquiredAt:A.acquiredAt,expiresAt:k,refreshTokenExpiresAt:A.refreshTokenExpiresAt,associatedUser:A.associatedUser}),l(d`Session persisted for ${c.raw(r)} (user ${c.raw(F)}, expires ${c.raw(k??"unknown")})`),o.presenter.success(A),A}function Zi(e,t){let o=t.getCurrentStoredStoreAppSession(e);if(o?.kind!=="preview")return;let r=o.scopes,i=r.length>0?r.join(", "):"none";throw new s("`store auth` is unavailable for preview stores. Additional Admin API scopes can't be granted.",`The following scopes are available: ${i}.
|
|
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 S=class extends j{};n();var E=L(z(),1),ea="Country must be a two-letter country code, for example: US.";function ta(e){return/^[A-Z]{2}$/.test(e)}var it=E.Flags.string({description:"Two-letter country code for the store, such as US, CA, or GB. Follows the ISO 3166-1 alpha-2 standard.",env:"SHOPIFY_FLAG_STORE_COUNTRY",required:!1,parse:async e=>{let t=e.trim().toUpperCase();if(!ta(t))throw new s(ea);return t}}),w={store:E.Flags.string({char:"s",description:"The myshopify.com domain of the store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>_(e),required:!0}),"organization-id":E.Flags.integer({description:"The numeric organization ID. Auto-selects if you belong to a single organization.",env:"SHOPIFY_FLAG_ORGANIZATION_ID"})},pn={env:"SHOPIFY_FLAG_ID",parse:async e=>Fo(e)},mn=E.Flags.string({...pn,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."}),ln=E.Flags.string({...pn,description:"The bulk operation ID to cancel (numeric ID or full GID).",required:!0}),fn={query:E.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":E.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async e=>Y(e),exactlyOne:["query","query-file"]}),variables:E.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":E.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async e=>Y(e),exclusive:["variables"]}),watch:E.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":E.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:E.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"allow-mutations":E.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1})};var hn=L(z(),1),ve=class e extends S{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
|
+
|
|
83
|
+
Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json"];static flags={...g,...T,store:w.store,scopes:hn.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 nt({store:t.store,scopes:t.scopes},{presenter:me(t.json?"json":"text")})}};n();n();n();function te(e){let{storeFqdn:t,version:o}=e,r=[`Store: ${t}`];return o&&r.push(`API version: ${o}`),r}function gn(e,t=!1){if(ue(e)&&!t)throw new s("Mutations are disabled by default for shopify store bulk execute.","Re-run with --allow-mutations if you intend to modify store data.")}n();async function oe(e){let t=await q(e);return await N(t.store,!0),R(t.userId),{token:t.accessToken,storeFqdn:t.store}}async function yn(e){let{store:t,operationId:o}=e,r=await oe(t);b({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${o}`,...te({storeFqdn:r.storeFqdn})]}}]});let i=await qo({adminSession:r,operationId:o});if(i?.userErrors?.length){$o(i.userErrors,"Failed to cancel bulk operation.");return}let a=i?.bulkOperation;if(a){let u=Uo(a),p=a.status==="CANCELING"?[`This may take a few moments. Check the status with:
|
|
84
|
+
`,{command:`shopify store bulk status --id=${de(a.id)}`}]:u.body,m={headline:u.headline,...p&&{body:p},...u.customSections&&{customSections:u.customSections}};switch(u.renderType){case"success":I(m);break;case"warning":Z(m);break;case"info":b(m);break}}else G({headline:"Bulk operation not found or could not be canceled.",body:d`ID: ${c.yellow(o)}`.value})}var Ae=class e extends S{static summary="Cancel a bulk operation on a store.";static descriptionWithMarkdown="Cancels a running bulk operation by ID, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...g,store:w.store,id:ln};async run(){let{flags:t}=await this.parse(e);await yn({store:t.store,operationId:t.id})}};n();n();async function oa(e,t){if(e)return e.join(`
|
|
85
|
+
`);if(t){if(!await ge(t))throw new s(d`Variable file not found at ${c.path(t)}. Please check the path and try again.`);return he(t,{encoding:"utf8"})}else return}async function wn(e){let{store:t,query:o,variables:r,variableFile:i,outputFile:a,watch:u=!1,version:p,allowMutations:m=!1}=e;gn(o,m);let{adminSession:y,version:x}=await $({title:d`Authenticating`,task:async()=>{let k=await oe(t),A=await Se({adminSession:k,userSpecifiedVersion:p,minimumDefaultVersion:ye});return{adminSession:k,version:A}},renderOptions:{stdout:process.stderr}}),h=await oa(r,i);ra(o,h),b({headline:"Starting bulk operation.",body:[{list:{items:te({storeFqdn:y.storeFqdn,version:x})}}]});let F=ue(o)?await Do({adminSession:y,query:o,variablesJsonl:h,version:x}):await Po({adminSession:y,query:o,version:x});if(F?.userErrors?.length){G({headline:"Error creating bulk operation.",body:{list:{items:F.userErrors.map(k=>k.field?`${k.field.join(".")}: ${k.message}`:k.message)}}});return}let O=F?.bulkOperation;if(O)if(u){let k=new Vt,A=await Mo(y,O.id,k.signal,()=>k.abort());k.signal.aborted?b({headline:`Bulk operation ${A.id} is still running in the background.`,body:at(A.id)}):await Sn(A,a)}else{let k=await zo(y,O.id);["FAILED","CANCELED","EXPIRED"].includes(k.status)?await Sn(k,a):I({headline:"Bulk operation is running.",body:at(k.id),customSections:[{body:[{list:{items:[d`ID: ${c.cyan(k.id)}`.value]}}]}]})}else throw Z({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new ae("Bulk operation response returned null with no error message.")}async function Sn(e,t){let o=Ye(e).value,i=[{body:[{list:{items:[d`ID: ${c.cyan(e.id)}`.value,d`Status: ${c.yellow(e.status)}`.value,d`Created at: ${c.gray(String(e.createdAt))}`.value,...e.completedAt?[d`Completed at: ${c.gray(String(e.completedAt))}`.value]:[]]}}]}];switch(e.status){case"CREATED":I({headline:"Bulk operation started.",body:at(e.id),customSections:i});break;case"RUNNING":I({headline:"Bulk operation is running.",body:at(e.id),customSections:i});break;case"COMPLETED":if(e.url){let a=await Ho(e.url),u=Bo(a);t?await He(t,a):v(a),u?Z({headline:"Bulk operation completed with errors.",body:t?`Results written to ${t}. Check file for error details.`:"Check results for error details.",customSections:i}):I({headline:o,body:t?[`Results written to ${t}`]:void 0,customSections:i})}else I({headline:o,customSections:i});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":G({headline:o,customSections:i});break}}function ra(e,t){if(ue(e)&&!t)throw new s(d`Bulk mutations require variables. Provide a JSONL file with ${c.yellow("--variable-file")} or individual JSON objects with ${c.yellow("--variables")}.`);if(!ue(e)&&t)throw new s(d`The ${c.yellow("--variables")} and ${c.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function at(e){return[`Monitor its progress with:
|
|
86
|
+
`,{command:`shopify store bulk status --id=${de(e)}`}]}var xe=class e extends S{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
|
+
|
|
88
|
+
Run \`shopify store auth\` first to create stored auth for the store.
|
|
89
|
+
|
|
90
|
+
Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
|
|
91
|
+
|
|
92
|
+
Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.
|
|
93
|
+
|
|
94
|
+
Use [\`store bulk status\`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-status) to check the status of your bulk operations.`;static description=this.descriptionWithoutMarkdown();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { products { edges { node { id } } } }"',"<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --watch","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./mutation.graphql --variable-file ./variables.jsonl --allow-mutations"];static flags={...g,store:w.store,...fn};async run(){let{flags:t}=await this.parse(e),o=await Co({query:t.query,queryFile:t["query-file"]});await wn({store:t.store,query:o,variables:t.variables,variableFile:t["variable-file"],watch:t.watch??!1,outputFile:t["output-file"],allowMutations:t["allow-mutations"],...t.version&&{version:t.version}})}};n();n();async function kn(e){let{store:t,operationId:o}=e,r=await oe(t);b({headline:"Checking bulk operation status.",body:[{list:{items:te({storeFqdn:r.storeFqdn})}}]});let i=await Lo({adminSession:r,operationId:o,version:await Se({adminSession:r,minimumDefaultVersion:ye})});i?na(i):G({headline:"Bulk operation not found.",body:d`ID: ${c.yellow(o)}`.value})}async function bn(e){let{store:t}=e,o=await oe(t);b({headline:"Listing bulk operations.",body:[{list:{items:te({storeFqdn:o.storeFqdn})}}]});let i=(await Ro({adminSession:o,version:await Se({adminSession:o,minimumDefaultVersion:ye})})).map(a=>({id:de(a.id),status:aa(a.status),count:sa(a.objectCount),dateCreated:St(new Date(String(a.createdAt))),dateFinished:a.completedAt?St(new Date(String(a.completedAt))):"",results:ca(a.url??a.partialDataUrl)}));Tt(),i.length===0?b({body:"No bulk operations found in the last 7 days."}):ie({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),Tt()}function na(e){let{id:t,status:o,createdAt:r,completedAt:i,url:a,partialDataUrl:u}=e,p=Ye(e).value,m=ia(r,i),y=d`ID: ${c.yellow(t)}\n${m}`.value;if(o==="COMPLETED"){let x=a?c.link("Download results",a):"";I({headline:p,body:d`${y}\n${x}`.value})}else if(o==="FAILED"){let x=u?c.link("Download partial results",u):"";G({headline:p,body:d`${y}\n${x}`.value})}else b({headline:p,body:y})}function ia(e,t){let o=new Date;return t?`Finished ${wt(new Date(String(t)),o)}`:`Started ${wt(new Date(String(e)),o)}`}function aa(e){return e==="COMPLETED"?Ge.green(e):e==="FAILED"?Ge.red(e):Ge.dim(e)}function sa(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ca(e){return e?d`${c.link("download",e)}`.value:""}var Te=class e extends S{static summary="Check the status of bulk operations on a store.";static descriptionWithMarkdown="Check the status of a specific bulk operation by ID, or list all bulk operations on this store in the last 7 days, using previously stored app authentication.\n\n Run `shopify store auth` first to create stored auth for the store.\n\n Use [`store bulk execute`](https://shopify.dev/docs/api/shopify-cli/store/store-bulk-execute) to start a new bulk operation.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --id 123456789"];static flags={...g,store:w.store,id:mn};async run(){let{flags:t}=await this.parse(e);t.id?await kn({store:t.store,operationId:t.id}):await bn({store:t.store})}};n();var Dt=L(z(),1),Ie=class e extends S{static hidden=!0;static summary="Authenticate for store commands.";static descriptionWithMarkdown="Authenticates to a store then stores an online access token for later reuse. Pass the provided JWT to --signup or stdin.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt>","printf %s <signup-jwt> | <%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --signup <signup-jwt> --json"];static flags={...g,...T,store:w.store,scopes:Dt.Flags.string({description:"Comma-separated Admin API scopes to request for the app.",env:"SHOPIFY_FLAG_SCOPES",required:!0}),signup:Dt.Flags.string({description:"Provide JWT for the store. When omitted, the JWT is read from stdin.",env:"SHOPIFY_FLAG_SIGNUP",required:!1})};async run(){let{flags:t}=await this.parse(e),o=t.signup??await da();await nt({store:t.store,scopes:t.scopes,signup:o},{presenter:me(t.json?"json":"text")})}};async function da(e=process.stdin){let t=[];for await(let r of e)t.push(Buffer.isBuffer(r)?r:Buffer.from(r));let o=Buffer.concat(t).toString("utf8").trim();if(!o)throw new s("Missing signup JWT.","Pass --signup <jwt>, set SHOPIFY_FLAG_SIGNUP, or pipe the JWT to stdin.");return o}n();n();n();var vn={basic:"basic",professional:"grow",grow:"grow",unlimited:"advanced",advanced:"advanced",shopify_plus:"plus",plus:"plus"};n();var An=Vo,xn=Wo,Tn=Qo;var Oe=L(z(),1),_e=class e extends j{static summary="Create a new dev store.";static descriptionWithMarkdown="Creates a new dev store in your organization.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %>",'<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --demo-data','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --organization-id 1234567 --plan basic --json'];static flags={...g,...T,name:Qe(Oe.Flags.string({description:"Name for the new dev store.",env:"SHOPIFY_FLAG_STORE_NAME"})),"organization-id":Qe(w["organization-id"]),plan:Qe(Oe.Flags.string({description:"The Shopify plan to use for the new dev store.",options:Ot,env:"SHOPIFY_FLAG_STORE_PLAN"})),"feature-preview":Oe.Flags.string({description:"The handle of a feature preview to enable on the new dev store.",env:"SHOPIFY_FLAG_STORE_FEATURE_PREVIEW"}),"demo-data":Oe.Flags.boolean({description:"Populate the new dev store with demo data.",allowNo:!0,env:"SHOPIFY_FLAG_STORE_DEMO_DATA"}),country:it};async run(){let{flags:t}=await this.parse(e),o=await we(t["organization-id"]?.toString()),r=t.name??await An(),i=t.plan??await xn(),a=t["demo-data"]??(We()?await Tn():!1);try{await _t({name:r,organization:o,plan:i,featurePreview:t["feature-preview"],withDemoData:a,country:t.country,json:t.json})}catch(u){throw t.json&&u instanceof s&&(v(JSON.stringify({error:!0,message:u.message,nextSteps:u.nextSteps??[],exitCode:1},null,2)),process.exit(1)),u}}};n();n();n();var ua="X-Shopify-CLI-Instance",pa="X-Shopify-CLI-Version",In;function ma(){return In??=new Qt({projectName:"shopify-cli-store"}),In}var Ne=class extends s{status;constructor(t,o,r){super(o,r??null),this.status=t}};function On(e=ma()){let t=e.get("cliInstanceId");if(typeof t=="string"&&t.length>0)return t;let o=Be();return e.set("cliInstanceId",o),o}function _n(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":`Shopify CLI; v=${yt}`,[ua]:e,[pa]:yt}}function la(e){return _n(e)}function fa(e,t){return{..._n(e),authorization:t,"X-Shopify-Access-Token":t}}async function Nn(e,t={}){let r=`https://${await vt()}/services/preview-stores`,i=JSON.stringify({...e.name?{name:e.name}:{},...e.country?{variables:{storeCreatePayload:{country:e.country}}}:{}}),a=await bt(r,{method:"POST",headers:la(On(t.storage)),body:i}),u=await a.text();if(!a.ok){let m=ha(a.status,u);throw new s(m.message,m.tryMessage)}let p;try{p=JSON.parse(u)}catch(m){let y=m instanceof Error?m.message:"Unknown error";throw new s("Preview store creation returned a non-JSON response.",`Parse error: ${y}. Body (truncated): ${st(u).slice(0,500)}`)}return ya(p)}async function En(e,t={}){let r=`https://${await vt()}/services/preview-stores/${e.shopId}`,i=await bt(r,{method:"GET",headers:fa(On(t.storage),e.adminApiToken)}),a=await i.text();if(!i.ok){let p=ga(i.status,a);throw new Ne(i.status,p.message,p.tryMessage)}let u;try{u=JSON.parse(a)}catch(p){let m=p instanceof Error?p.message:"Unknown error";throw new s("Preview store lookup returned a non-JSON response.",`Parse error: ${m}. Body (truncated): ${st(a).slice(0,500)}`)}return Sa(u)}function ha(e,t){let o=Fn(t),r=o.error_code,i=o.message;if(r==="not_in_rollout")return{message:"Preview store creation is not enabled yet.",tryMessage:"Try again later."};if(r==="service_unavailable")return{message:"Preview store creation is temporarily unavailable.",tryMessage:"Try again later."};if(r==="rate_limited")return{message:"Too many preview store creation requests.",tryMessage:"Try again later."};if(r==="preview_store_create_failed")return{message:"Preview store creation failed.",tryMessage:"Try again later."};if(r==="shop_name_banned_keyword"||r==="shop_name_invalid")return{message:"The preview store name was rejected.",tryMessage:"Use a different store name and try again."};if(r==="country_invalid")return{message:"The preview store country was rejected.",tryMessage:"Use a different country and try again."};let a=st(t);return{message:`Preview store creation failed with HTTP ${e}.`,tryMessage:i??(a.length>0?a.slice(0,1e3):"No response body returned.")}}function Fn(e){if(e.length===0)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object")return{};let o=t;return{...typeof o.error_code=="string"?{error_code:o.error_code}:{},...typeof o.message=="string"?{message:o.message}:{}}}catch(t){if(t instanceof SyntaxError)return{};throw t}}function ga(e,t){let o=Fn(t),r=st(t);return{message:`Preview store lookup failed with HTTP ${e}.`,tryMessage:o.message??(r.length>0?r.slice(0,1e3):"No response body returned.")}}function ya(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.admin_api_token=="string"?e.admin_api_token:void 0,u=typeof e.access_url=="string"?e.access_url:void 0,p=typeof e.placeholder_account_uuid=="string"?e.placeholder_account_uuid:void 0,m=Array.isArray(e.admin_api_scopes)?e.admin_api_scopes.filter(y=>typeof y=="string"):void 0;if(!o||!r||!i||!a||!u||!m)throw new s("Preview store creation response is missing required fields.",`Got: ${JSON.stringify(wa(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},adminApiToken:a,adminApiScopes:m,accessUrl:u,...p?{placeholderAccountUuid:p}:{}}}function Sa(e){let t=e.shop,o=typeof t?.id=="string"||typeof t?.id=="number"?String(t.id):void 0,r=typeof t?.name=="string"?t.name:void 0,i=typeof t?.domain=="string"?_(t.domain):void 0,a=typeof e.access_url=="string"?e.access_url:void 0,u=typeof e.claim_url=="string"?e.claim_url:void 0;if(!o||!r||!i||!a)throw new s("Preview store lookup response is missing required fields.",`Got: ${JSON.stringify(ka(e)).slice(0,500)}`);return{shop:{id:o,name:r,domain:i},accessUrl:a,...u?{claimUrl:u}:{}}}function wa(e){return{...e,...e.admin_api_token?{admin_api_token:"[REDACTED]"}:{},...e.access_url?{access_url:"[REDACTED]"}:{}}}function st(e){return e.replace(/(["']?(?:admin_api_token|adminApiToken)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/(["']?(?:access_url|accessUrl|claim_url|claimUrl)["']?\s*:\s*["'])[^"']+/gi,"$1[REDACTED]").replace(/([?&](?:token|access_token)=)[^&\s"'<>]+/gi,"$1[REDACTED]")}function ka(e){return{...e,...e.access_url?{access_url:"[REDACTED]"}:{},...e.claim_url?{claim_url:"[REDACTED]"}:{}}}var ba={createPreviewStore:Nn,setStoredStoreAppSession:se,recordStoreFqdnMetadata:N,setLastSeenUserId:R,now:()=>new Date};async function Cn(e,t={}){let o={...ba,...t},r=await o.createPreviewStore({name:e.name,country:e.country},e.client);return Aa(r,e.country,o)}function va(e){return e.placeholderAccountUuid??e.shop.id}async function Aa(e,t,o){let r=o.now().toISOString(),i=va(e);o.setStoredStoreAppSession({store:e.shop.domain,clientId:U,userId:i,accessToken:e.adminApiToken,scopes:e.adminApiScopes,acquiredAt:r,kind:"preview",preview:{shopId:e.shop.id,name:e.shop.name,createdAt:r,...e.placeholderAccountUuid?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...t?{country:t}:{},accessUrl:e.accessUrl}}),o.setLastSeenUserId(i);try{await o.recordStoreFqdnMetadata(e.shop.domain,!0,e.shop.id)}catch{}return{status:"success",message:`Your Shopify store "${e.shop.name}" is ready. This store is temporary. Create a free Shopify account to save it and start selling.`,store:{id:e.shop.id,name:e.shop.name,subdomain:e.shop.domain,...t?{country:t}:{},storefrontUrl:e.accessUrl}}}n();function Pn(e,t){if(t==="json"){v(JSON.stringify(xa(e),null,2));return}Ta(e)}function xa(e){return{status:e.status,message:e.message,store:e.store,next_steps:Dn(e).map(t=>t.json)}}function Dn(e){return[{json:`Use \`shopify store open --store ${e.store.subdomain}\` to preview the storefront.`,text:["Use ",{command:`shopify store open --store ${e.store.subdomain}`}," to preview the storefront."]},{json:`Use \`shopify store execute --store ${e.store.subdomain}\` to add products, collections, pages, and more.`,text:["Use ",{command:`shopify store execute --store ${e.store.subdomain}`}," to add products, collections, pages, and more."]},{json:`Use \`shopify theme pull --store ${e.store.subdomain}\` and \`shopify theme push --store ${e.store.subdomain}\` to edit your store design.`,text:["Use ",{command:`shopify theme pull --store ${e.store.subdomain}`}," and ",{command:`shopify theme push --store ${e.store.subdomain}`}," to edit your store design."]}]}function Ta(e){I({headline:"Store created",customSections:[{body:e.message},{title:"Next steps",body:{list:{items:Dn(e).map(t=>t.text)}}}]})}var Ln=L(z(),1),Ee=class e extends S{static summary="Create a preview Shopify store.";static descriptionWithMarkdown="Creates a new Shopify store, with no need for an existing account.";static description=this.descriptionWithoutMarkdown();static examples=['<%= config.bin %> <%= command.id %> --name "Lavender Candles"','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --country US','<%= config.bin %> <%= command.id %> --name "Lavender Candles" --json'];static flags={...g,...T,name:Ln.Flags.string({description:"The name of the store.",env:"SHOPIFY_FLAG_PREVIEW_STORE_NAME",required:!1}),country:it};async run(){let{flags:t}=await this.parse(e),o=await $({title:d`Creating store`,task:async()=>Cn({name:t.name,country:t.country})});Pn(o,t.json?"json":"text")}};n();n();n();n();n();var Rn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"5"}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"developerPreviewHandle"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"ownerDetails"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function qn(e){let t=await Lt(e);if(!t)throw new s(`Couldn't find shop ${e.store} inside organization ${e.organizationId}.`,"The shop matched a global lookup but is not listed under its parent organization. This usually means the search index is stale; try again in a moment.");return t}async function Lt(e){let t=e.token??await B([],{noPrompt:e.noPrompt}),o=H({noPrompt:e.noPrompt}),i=(await X({query:Rn,token:t,organizationId:e.organizationId,variables:{search:e.store},unauthorizedHandler:o})).organization?.accessibleShops?.edges??[],a=e.store.toLowerCase(),u=i.find(p=>M(p.node.primaryDomain)===a)?.node;if(u)return{shopifyShopId:u.shopifyShopId??void 0,name:u.name,primaryDomain:u.primaryDomain??void 0,storeType:u.storeType??void 0,developerPreviewHandle:u.developerPreviewHandle??void 0,planName:u.planName??void 0,ownerName:u.ownerDetails?.fullName??void 0,ownerEmail:u.ownerDetails?.email??void 0}}n();var $n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"storeFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"storeFqdn"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var Un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationAccessibleShop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopifyShopID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessibleShop"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ia="cancelled",Oa=5,_a=300*1e3;async function Mn(e){let{organization:t,store:o}=e,r=await B(),i=H(),a=await zn({store:o,organizationId:t.id,token:r}),p=(await X({query:$n,token:r,organizationId:t.id,variables:{storeFqdn:o},unauthorizedHandler:i})).deleteAppDevelopmentStore;if(!p)throw new s("Store deletion failed: unexpected empty response.");let m=p.userErrors;if(m&&m.length>0){let x=m.map(h=>h.message).join(", ");throw new s(`Failed to delete dev store: ${x}`)}if(p.success===!1)throw new s("Store deletion failed.");a??=await zn({store:o,organizationId:t.id,token:r});let y=a?await Ea({shopifyShopId:a,organizationId:t.id,token:r,unauthorizedHandler:i}):!1;e.json?v(Ca({store:o,organization:t,deletionConfirmed:y})):y?I({headline:`Dev store "${o}" deleted successfully.`,body:["The store was deleted."]}):Z({headline:`Dev store "${o}" deletion was requested, but not confirmed.`,body:["Shopify accepted the deletion request, but deletion was not confirmed before the CLI stopped waiting.","The store may still finish deleting asynchronously."]})}async function zn(e){return(await Lt(e))?.shopifyShopId}function Na(e){let t=String(e),o=t.match(/^(?:gid:\/\/shopify\/Shop\/)?(\d+)$/)?.[1];if(!o)throw new Error(`Invalid Shopify shop ID: ${t}`);return Buffer.from(`gid://organization/ShopifyShop/${o}`).toString("base64url")}async function Ea(e){let t=Na(e.shopifyShopId);return $({title:d`Dev store deletion requested. Waiting for deletion confirmation`,task:async o=>{let r=Date.now();for(;;){if(Date.now()-r>_a)return!1;if((await X({query:Un,token:e.token,organizationId:e.organizationId,variables:{id:t},unauthorizedHandler:e.unauthorizedHandler})).organization?.accessibleShop?.planName?.toLowerCase()===Ia.toLowerCase())return!0;o(d`${Fa()}`),await oo(Oa)}},renderOptions:{stdout:process.stderr}})}function Fa(){return"Waiting for deletion confirmation"}function Ca(e){let{store:t,organization:o,deletionConfirmed:r}=e;return JSON.stringify({store:{domain:t,deletionRequested:!0,deletionConfirmed:r},organization:{id:o.id,name:o.businessName},...r?{}:{message:"Deletion was requested, but has not been confirmed yet. The store may still finish deleting asynchronously."}},null,2)}n();n();n();var Hn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoDestinations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"destinations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"shopsOnly"},value:{kind:"BooleanValue",value:!0}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"25"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicId"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"webUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};n();var Bn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"StoreInfoOwningOrg"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DestinationPublicID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationForDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destinationPublicId"},value:{kind:"Variable",name:{kind:"Name",value:"destinationPublicId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Fe=class extends s{};async function ct(e){let t=e.token??await B([],{noPrompt:e.noPrompt}),o=H({noPrompt:e.noPrompt}),r=M(e.store)??e.store.toLowerCase(),i=r.split(".")[0]??r,p=((await At({query:Hn,token:t,variables:{search:i},unauthorizedHandler:o})).currentUserAccount?.destinations.nodes??[]).find(y=>Da(y,r));if(!p)throw new Fe(`Couldn't find a store with domain ${e.store} for the current account.`,"Verify the domain (must be the canonical `myshopify.com` FQDN) and that you are signed in to an account with access to the store. Inactive shops are not searchable.");let m=await Pa(String(p.publicId),t,o);return{...m?{owningOrg:m}:{}}}async function Pa(e,t,o){try{let i=(await At({query:Bn,token:t,variables:{destinationPublicId:e},unauthorizedHandler:o})).currentUserAccount?.organizationForDestination;if(!i){l(`No owning organization returned for destination ${e}.`);return}let a=i.id?Go(i.id):void 0;return{name:i.name,...a?{id:a}:{}}}catch(r){l(`Failed to resolve owning organization: ${La(r)}`);return}}function Da(e,t){return[e.primaryDomain,e.webUrl].some(o=>M(o)===t)}function La(e){return e instanceof Error?e.message:String(e)}async function Ra(e){let{store:t}=e;try{let r=(await ct(e)).owningOrg;if(!r?.id){l(`Could not infer an owning organization ID for ${t}.`);return}return{id:r.id,businessName:r.name}}catch(o){l(`Could not infer the owning organization for ${t}: ${qa(o)}`);return}}function qa(e){return e instanceof Error?e.message:String(e)}async function Gn(e,t){if(t)return we(t);let o=We(),r=await Ra({store:e,noPrompt:!o});if(r)return r;if(!o)throw new s(`Could not determine which organization owns ${e}.`,"Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");return b({headline:`Could not determine which organization owns ${e}.`,body:["Select one below, or specify it with",{command:"--organization-id"},{char:"."}]}),we()}var jn=L(z(),1),Ce=class e extends j{static summary="Delete a dev store.";static descriptionWithMarkdown="Deletes a dev store from your organization.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --json","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --organization-id 1234567 --force"];static flags={...g,...T,store:w.store,"organization-id":w["organization-id"],force:jn.Flags.boolean({char:"f",description:"Skip confirmation. Required if non interactive.",env:"SHOPIFY_FLAG_FORCE",default:!1})};async run(){let{flags:t}=await this.parse(e);try{if(!t.force&&!je())throw new s(`Deleting the dev store ${t.store} requires confirmation.`,null,["Use the `--force` flag to skip confirmation when running non-interactively."]);let o=await Gn(t.store,t["organization-id"]?.toString());if(!t.force&&!await Zt({message:`Delete dev store ${t.store}? This can't be undone.`,confirmation:t.store}))throw new to;await Mn({store:t.store,organization:o,json:t.json})}catch(o){throw t.json&&o instanceof s&&(v(JSON.stringify({error:!0,message:o.message,nextSteps:o.nextSteps??[],exitCode:1},null,2)),process.exit(1)),o}}};n();n();n();var Wn=L(vi(),1);async function $a(e){if(e.query!==void 0){if(!e.query.trim())throw new s("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");return e.query}if(e.queryFile){if(!await ge(e.queryFile))throw new s(d`Query file not found at ${c.path(e.queryFile)}. Please check the path and try again.`);let t=await he(e.queryFile,{encoding:"utf8"});if(!t.trim())throw new s(d`Query file at ${c.path(e.queryFile)} is empty. Please provide a valid GraphQL query or mutation.`);return t}throw new ae("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.")}function Vn(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new s(d`Invalid variables in ${t}: expected a non-null JSON object.`,"Please provide a JSON object for variables.");return e}async function Ua(e,t){if(e!==void 0){if(!e.trim())throw new s(d`The ${c.yellow("--variables")} flag value is empty.`,"Please provide a non-null JSON object for variables.");try{return Vn(JSON.parse(e),c.yellow("--variables"))}catch(o){if(o instanceof s)throw o;let r=o instanceof Error?o.message:"Unknown error";throw new s(d`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}}else if(t){if(!await ge(t))throw new s(d`Variable file not found at ${c.path(t)}. Please check the path and try again.`);let o=await he(t,{encoding:"utf8"});try{return Vn(JSON.parse(o),c.path(t))}catch(r){if(r instanceof s)throw r;let i=r instanceof Error?r.message:"Unknown error";throw new s(d`Invalid JSON in variable file ${c.path(t)}: ${i}`,"Please provide valid JSON format.")}}}function za(e){let t;try{t=(0,Wn.parse)(e)}catch(r){throw r instanceof Error?new s(`Invalid GraphQL syntax: ${r.message}`):r}let o=t.definitions.filter(r=>r.kind==="OperationDefinition");if(o.length!==1)throw new s("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.");return{operationDefinition:o[0]}}function Ma(e){return e.operationDefinition.operation==="mutation"}function Ha(e,t=!1){if(Ma(e)&&!t)throw new s("Mutations are disabled by default for shopify store execute.","Re-run with --allow-mutations if you intend to modify store data.")}async function Qn(e){let t=await $a({query:e.query,queryFile:e.queryFile}),o=za(t);Ha(o,e.allowMutations);let r=await Ua(e.variables,e.variableFile);return{query:t,parsedOperation:o,parsedVariables:r,requestedVersion:e.version}}n();n();n();n();function Rt(e){if(!e||typeof e!="object"||!("response"in e))return!1;let t=e.response;return!!t&&typeof t=="object"}function Yn(e){if(!Rt(e))return;let t=e.response.status;return typeof t=="number"?t:void 0}var Jn=["the user aborted a request","the operation was aborted"];function Ba(e){if(!(e instanceof Error))return!1;if(e.name==="AbortError")return!0;let t=e.message.toLowerCase();return Jn.some(o=>t.includes(o))}function Pe(e,t){if(Yn(e)===402)return new s(`The store ${t} is currently unavailable.`,"Check the store in the Shopify admin and try again once it is reactivated.");if(Ba(e))return new s(`Request to ${t} was aborted before it completed.`)}function De(e,t){let o=Yn(e);o!==401&&o!==404||(ce(t.store,t.userId),rt(t))}var Ga=`
|
|
95
|
+
query StoreExecutePublicApiVersions {
|
|
96
|
+
publicApiVersions {
|
|
97
|
+
handle
|
|
98
|
+
supported
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`;async function Kn(e){try{return(await K({query:Ga,api:"Admin",url:ee(e.adminSession.storeFqdn,"unstable",e.adminSession),token:e.adminSession.token,responseOptions:{handleErrors:!1}})).publicApiVersions}catch(t){De(t,e.session);let o=Pe(t,e.adminSession.storeFqdn);throw o||t}}async function Xn(e){try{return await $({title:d`Executing GraphQL operation`,task:async()=>K({query:e.request.query,api:"Admin",url:ee(e.context.adminSession.storeFqdn,e.context.version,e.context.adminSession),token:e.context.adminSession.token,variables:e.request.parsedVariables,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}})}catch(t){De(t,e.context.session);let o=Pe(t,e.context.adminSession.storeFqdn);throw o||(Rt(t)&&t.response.errors?new s("GraphQL operation failed.",JSON.stringify({errors:t.response.errors},null,2)):t)}}n();async function qt(e){let t=await q(_(e));return await N(t.store,!0),R(t.userId),{adminSession:{token:t.accessToken,storeFqdn:t.store},session:t}}async function ja(e){let{session:t,adminSession:o,userSpecifiedVersion:r}=e;if(r==="unstable")return r;let i=await Kn({adminSession:o,session:t});if(!r)return i.filter(p=>p.supported).map(p=>p.handle).sort().reverse()[0];let a=i.map(u=>u.handle);if(a.includes(r))return r;throw new s(`Invalid API version: ${r}`,`Allowed versions: ${a.join(", ")}`)}async function Zn(e){let{adminSession:t,session:o}=await qt(e.store),r=await ja({session:o,adminSession:t,userSpecifiedVersion:e.userSpecifiedVersion});return{adminSession:t,version:r,session:o}}var Va={id:"admin",prepareContext:async({store:e,requestedVersion:t})=>Zn({store:e,userSpecifiedVersion:t}),execute:async({context:e,request:t})=>Xn({context:e,request:t})};function ei(e){if(e==="admin")return Va;throw new ae(`Unsupported store GraphQL API target: ${e}`)}async function ti(e){await N(e.store,!1);let t=ei(e.api??"admin"),o=await Qn({query:e.query,queryFile:e.queryFile,variables:e.variables,variableFile:e.variableFile,version:e.version,allowMutations:e.allowMutations}),r=await $({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 Wa(e){return JSON.stringify(e,null,2)}function oi(e){if(e){I({headline:"Operation succeeded.",body:`Results written to ${e}`});return}I({headline:"Operation succeeded."})}async function ri(e,t,o="text"){let r=Wa(e);if(t){await He(t,r),o==="text"&&oi(t);return}o==="text"&&oi(),v(r)}var W=L(z(),1),Le=class e extends S{static summary="Execute GraphQL queries and mutations on a store.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";static description=this.descriptionWithoutMarkdown();static examples=['<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',`<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,'<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations','<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json'];static flags={...g,...T,query:W.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":W.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=>Y(t),exactlyOne:["query","query-file"]}),variables:W.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":W.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=>Y(t),exclusive:["variables"]}),store:w.store,version:W.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":W.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",parse:async t=>Y(t)}),"allow-mutations":W.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 ti({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 ri(o,t["output-file"],t.json?"json":"text")}};n();n();async function ni(e){let t=Qa(e.store),o=Yo();await Jo({port:e.port,storeFqdn:e.store,tokenProvider:t,key:o,protectMutations:!e.allowMutations,query:e.query,variables:e.variables,apiVersion:e.apiVersion,additionalReadyMessages:[d`Mutations are ${e.allowMutations?c.green("allowed"):c.yellow("blocked")}.`],abortSignal:e.abortSignal})}function Qa(e){return{getToken:async()=>(await q(e)).accessToken,refreshToken:async()=>(await q(e)).accessToken}}var dt=L(z(),1),Re=class e extends S{static summary="Open a local GraphiQL UI for a store.";static descriptionWithMarkdown="Opens an authenticated Admin API GraphiQL UI for the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --allow-mutations","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];static flags={...g,store:w.store,port:ao({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),"allow-mutations":dt.Flags.boolean({description:"Allow GraphQL mutations to run against the target store.",env:"SHOPIFY_FLAG_ALLOW_MUTATIONS",default:!1}),variables:dt.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:dt.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};async run(){let{flags:t}=await this.parse(e);await ni({store:t.store,port:t.port,allowMutations:t["allow-mutations"],variables:t.variables,apiVersion:t.version})}};n();n();n();function ut(e){if(e)return vn[e.toLowerCase()]}function ii(e){return e?J(e):""}n();var Ya={APP_DEVELOPMENT:"dev",CLIENT_TRANSFER:"client-transfer",COLLABORATOR:"collaborator",DEVELOPMENT:"dev",DEVELOPMENT_SUPERSET:"dev",PRODUCTION:"production"};function pt(e){if(e)return Ya[e]}function ai(e){return e?J(e):""}var si={dev:"development_superset",production:"production","client-transfer":"client_transfer",collaborator:"collaborator"},ci=Object.keys(si);function di(e){return si[e]}var Ja=`#graphql
|
|
102
|
+
query StoreInfoAdminShop {
|
|
103
|
+
shop {
|
|
104
|
+
id
|
|
105
|
+
name
|
|
106
|
+
myshopifyDomain
|
|
107
|
+
email
|
|
108
|
+
shopOwnerName
|
|
109
|
+
plan {
|
|
110
|
+
publicDisplayName
|
|
111
|
+
partnerDevelopment
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;async function mt(e){let t=e.store;if(!t)throw new s("No store specified.","Pass the `myshopify.com` domain via the `--store` flag, e.g. `shopify store info --store shop.myshopify.com`.");let o=V(t);if(es(o)){await N(o.store,!0,o.preview.shopId),R(o.userId);let i=await ts(o);return cs({store:t,previewSession:o,previewStoreUrls:i})}let r=!!o;try{return await Xa(t,{noPrompt:r})}catch(i){if(!r||!rs(i))throw i;return l(`BP store info lookup failed; falling back to stored store auth: ${is(i)}`),Ka(t)}}async function Ka(e){let t=await q(e);await N(t.store,!0),R(t.userId);let o=await Za(t);return as({store:t.store,shop:o})}async function Xa(e,t={}){let o=await ct({store:e,noPrompt:t.noPrompt}),r=await os(o,e,{noPrompt:t.noPrompt});return ss({store:e,destinationsCtx:o,orgShop:r})}async function Za(e){try{let t=await K({query:Ja,api:"Admin",url:ee(e.store,"unstable"),token:e.accessToken,responseOptions:{handleErrors:!1}});if(!t.shop)throw new s(`Shopify did not return store information for ${e.store}.`);return t.shop}catch(t){De(t,e);let o=Pe(t,e.store);throw o||t}}function es(e){return e?.kind==="preview"&&e.preview!==void 0}async function ts(e){try{let t=await En({shopId:e.preview.shopId,adminApiToken:e.accessToken});return{accessUrl:t.accessUrl,...t.claimUrl?{saveUrl:t.claimUrl}:{}}}catch(t){throw t instanceof Ne&&(t.status===401||t.status===404)&&(ce(e.store,e.userId),rt(e)),t}}async function os(e,t,o={}){if(!e.owningOrg?.id){l("Owning organization id is unknown; skipping BP Organizations shop lookup.");return}try{return await qn({store:t,organizationId:e.owningOrg.id,noPrompt:o.noPrompt})}catch(r){l(`BP Organizations shop lookup failed: ${r instanceof Error?r.message:String(r)}`);return}}function rs(e){return e instanceof Fe||ns(e)}function ns(e){return e instanceof s&&e.message.includes("unable to prompt for reauthentication")}function is(e){return e instanceof Error?e.message:String(e)}function as(e){let{store:t,shop:o}=e,r=o.myshopifyDomain??t,i={id:o.id,displayName:o.name,storeOwner:ds(o),type:o.plan?.partnerDevelopment?"dev":void 0,plan:o.plan?.publicDisplayName,adminUrl:pi(It(r))};return{...ne(i),subdomain:r}}function ss(e){let{store:t,destinationsCtx:o,orgShop:r}=e,i={id:ui(r?.shopifyShopId),displayName:r?.name,organizationId:o.owningOrg?.id,organizationName:o.owningOrg?.name,storeOwner:us(r),type:pt(r?.storeType),plan:ut(r?.planName),featurePreview:r?.developerPreviewHandle,adminUrl:pi(It(t))};return{...ne(i),subdomain:t}}function cs(e){let{store:t,previewSession:o,previewStoreUrls:r}=e,i={id:ui(o.preview.shopId),displayName:o.preview.name,accessUrl:r.accessUrl,saveUrl:r.saveUrl};return{...ne(i),subdomain:t,authScopes:o.scopes}}function ui(e){if(e)return`gid://shopify/Shop/${e}`}function ds(e){let t=ne({name:e.shopOwnerName,email:e.email});return Object.keys(t).length>0?t:void 0}function us(e){if(!e)return;let t=ne({name:e.ownerName,email:e.ownerEmail});return Object.keys(t).length>0?t:void 0}function pi(e){if(e)return`https://admin.shopify.com/store/${encodeURIComponent(e)}`}n();function mi(e,t){if(t==="json"){v(JSON.stringify(e,null,2));return}let o=ms(e);b({customSections:[{title:"Store details",body:{tabularData:ps(e),firstColumnSubdued:!0}},...o.length>0?[{body:{list:{title:{bold:"Next steps"},items:o}}}]:[]]})}function ps(e){let t=[];return Q(t,"ID",e.id),Q(t,"Display Name",e.displayName),Q(t,"Subdomain",e.subdomain),Q(t,"Organization",e.organizationName),Q(t,"Store owner",ls(e.storeOwner)),Q(t,"Type",e.type?J(e.type):void 0),Q(t,"Plan",e.plan?J(e.plan):void 0),Q(t,"Feature Preview",e.featurePreview),t}function ms(e){let t=[];return $t(t,e.adminUrl,"Manage this store in the Shopify admin"),$t(t,e.accessUrl,"View your store"),$t(t,e.saveUrl,"Save your store"),t}function ls(e){if(e)return e.name&&e.email?`${e.name} (${e.email})`:e.name??e.email}function Q(e,t,o){o&&e.push([t,o])}function $t(e,t,o){t&&e.push({link:{label:o,url:t}})}var qe=class e extends S{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
|
+
|
|
117
|
+
Some details may be omitted when they are not available for the store.
|
|
118
|
+
|
|
119
|
+
Use \`--json\` for machine-readable output.`;static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --json"];static flags={...g,...T,store:w.store};async run(){let{flags:t}=await this.parse(e),o=await mt({store:t.store});mi(o,t.json?"json":"text")}};n();n();n();n();n();var li={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAccessibleShops"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filters"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopFilterInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"EnumValue",value:"SHOP_CREATED_AT_DESC"}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"shopifyShopId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"planName"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function fi(e){let{entries:t,hasMore:o}=await fs(e.token,e.organization,e.storeType);return{entries:t.sort(ys),hasMore:o}}async function fs(e,t,o){let r=H(),a=(await X({query:li,token:e,organizationId:t.id,variables:{first:250,filters:hs(o)},unauthorizedHandler:r})).organization?.accessibleShops;if(!a)return{entries:[],hasMore:!1};let u=[];for(let p of a.edges){let m=gs(p.node,t);m&&u.push(m)}return{entries:u,hasMore:a.pageInfo.hasNextPage}}function hs(e){let t=[{field:"STORE_STATUS",operator:"EQUALS",value:"active"}];return e&&t.push({field:"STORE_TYPE",operator:"EQUALS",value:di(e)}),t}function gs(e,t){let o=e.url??e.primaryDomain;if(o)return{...e.shopifyShopId?{id:`gid://shopify/Shop/${e.shopifyShopId}`}:{},store:M(o)??o,createdAt:typeof e.createdAt=="string"?e.createdAt:String(e.createdAt),organizationId:t.id,organizationName:t.businessName,name:e.name,type:pt(e.storeType),plan:ut(e.planName)}}function ys(e,t){return e.createdAt===t.createdAt?e.store.localeCompare(t.store):t.createdAt.localeCompare(e.createdAt)}async function hi(e={}){let t=await B(),o=await jo(t);if(!o.currentUserResolved)return{stores:[],source:"organization",notice:"Couldn't resolve a Shopify account for the current CLI session."};if(o.organizations.length===0)return{stores:[],source:"organization"};if(!e.organizationId&&o.organizations.length>1&&!je())throw new s("An organization ID is required to list stores non-interactively.","Provide `--organization-id`, for example `--organization-id 1234567`. Run `shopify organization list` to find IDs.");let r=await Ss(o.organizations,e.organizationId),i=await fi({token:t,organization:r,storeType:e.storeType}),{stores:a,truncated:u}=ks(i.entries,i.hasMore);return{stores:a,source:"organization",organization:ws(r),...e.storeType?{storeType:e.storeType}:{},...u?{truncated:!0}:{}}}async function Ss(e,t){if(t){let a=e.find(u=>u.id===t.toString());if(!a)throw new s(`Organization with ID ${t} not found.`,`Available organizations: ${e.map(u=>`${u.businessName} (${u.id})`).join(", ")}`);return a}if(e.length===1)return e[0];let r=new Set(e.map(a=>a.businessName)).size<e.length,i=await Xt({message:"Which organization do you want to use?",choices:e.map(a=>({label:r?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}function ws(e){return{id:e.id,name:e.businessName}}function ks(e,t){return{stores:e.slice(0,250),truncated:t||e.length>250}}n();var bs=["To list stores authenticated directly with",{command:"shopify store auth"},{char:","},"run",{command:"shopify store auth list"},{char:"."}];function gi(e,t){if(e.notice&&xt(e.notice),e.truncated&&xt(vs(e)),t==="json"){v(JSON.stringify({stores:e.stores,...e.organization?{organization:e.organization}:{},...e.storeType?{storeType:e.storeType}:{},...e.notice?{notice:e.notice}:{},...e.truncated?{truncated:!0}:{}},null,2));return}As(e)}function vs(e){let t=e.organization?` in ${e.organization.name}`:" in this organization";return`Showing the ${250} most recent ${yi(e.storeType)}${t}. More stores exist.`}function yi(e){return e?`${e.replaceAll("-"," ")} stores`:"stores"}function As(e){b({headline:xs(e),customSections:[...Ts(e.organization),{body:bs}]}),e.stores.length>0&&Is(e.stores)}function xs(e){let t=yi(e.storeType);return e.stores.length>0?`Listing ${t}.`:e.notice?`No ${t} were returned for the current CLI session.`:`No ${t} found.`}function Ts(e){return e?[{body:{tabularData:[["Organization",`${e.name} (${e.id})`]],firstColumnSubdued:!0}}]:[]}function Is(e){ie({rows:e.map(t=>({subdomain:Os(t.store),name:t.name??"",type:ai(t.type),plan:ii(t.plan),created:et(t.createdAt)})),columns:{subdomain:{header:"Subdomain"},name:{header:"Name"},type:{header:"Type"},plan:{header:"Plan"},created:{header:"Created"}}})}function Os(e){return tt(e)??e}var Ut=L(z(),1),$e=class e extends S{static summary="List stores in a Shopify organization.";static descriptionWithMarkdown="Lists stores in a Shopify organization available to the current CLI account.\n\nWhen more than one organization is available, the command prompts you to pick one unless you provide `--organization-id`. In that case, `--organization-id` is required in non-interactive environments.\n\nRun `<%= config.bin %> organization list` to find organization IDs.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --organization-id 1234567","<%= config.bin %> <%= command.id %> --type dev","<%= config.bin %> <%= command.id %> --json"];static flags={...g,...T,"organization-id":Ut.Flags.integer({description:`${w["organization-id"].description} Required if non interactive when more than one organization is available.`,env:"SHOPIFY_FLAG_ORGANIZATION_ID"}),type:Ut.Flags.string({description:"List only stores of this type.",options:ci,env:"SHOPIFY_FLAG_STORE_TYPE"})};async run(){let{flags:t}=await this.parse(e),o=await hi({organizationId:t["organization-id"],storeType:t.type});gi(o,t.json?"json":"text")}};n();n();var _s={getStoreInfo:mt,openURL:Ve};async function Si(e,t={}){let{getStoreInfo:o,openURL:r}={..._s,...t},i=await o({store:e.store}),a=Ns(i);if(await r(a)){b({headline:`Opening the storefront for ${e.store} in your browser.`});return}b({headline:"Browser didn't open automatically. Open the storefront manually:",body:[d`${c.link(a,a)}`.value]})}function Ns(e){return e.accessUrl??`https://${e.subdomain}`}var Ue=class e extends S{static summary="Open your Shopify store in the default web browser.";static descriptionWithMarkdown="Opens the storefront for a store you have access to in your default web browser.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com"];static flags={...g,store:w.store};async run(){let{flags:t}=await this.parse(e);await Si({store:t.store})}};var Es={"store:auth:list":ke,"store:auth":ve,"store:bulk:cancel":Ae,"store:bulk:execute":xe,"store:bulk:status":Te,"store:stripe-auth":Ie,"store:create:dev":_e,"store:create:preview":Ee,"store:delete":Ce,"store:execute":Le,"store:graphiql":Re,"store:info":qe,"store:list":$e,"store:open":Ue},lt=Es;n();var ft={"app:build":Xo,"app:bulk:cancel":Zo,"app:bulk:status":er,"app:deploy":ir,"app:dev":ar,"app:dev:clean":Rr,"app:doctor:instructions":sr,"app:doctor":cr,"app:logs":dr,"app:logs:sources":ur,"app:import-custom-data-definitions":$r,"app:import-extensions":vr,"app:info":Ar,"app:init":xr,"app:config:validate":Tr,"app:release":Ir,"app:subscription-migrations:cancel":Or,"app:subscription-migrations:list":_r,"app:subscription-migrations:schedule":Nr,"app:subscription-migrations:status":Er,"app:subscription-migrations:unschedule":Fr,"app:config:link":tr,"app:config:use":or,"app:config:pull":rr,"app:env:pull":pr,"app:env:show":mr,"app:execute":fr,"app:graphiql":hr,"app:bulk:execute":lr,"app:function:build":gr,"app:function:replay":yr,"app:function:run":Sr,"app:function:info":qr,"app:function:schema":wr,"app:function:typegen":kr,"app:generate:extension":br,"app:versions:list":Cr,"app:webhook:trigger":Pr,"demo:watcher":nr,"organization:list":Ur},Fs=Lr,Cs=Dr;import Ps from"fs";var Ry=Ko.init;(0,ki.createGlobalProxyAgent)({environmentVariableNamespace:"SHOPIFY_",forceGlobalAgent:!0,socketConnectionTimeout:6e4});process.on("uncaughtException",e=>{e instanceof eo?Kt(e):Ps.writeSync(process.stderr.fd,`${e.stack??e.message??e}
|
|
120
|
+
`),process.exit(1)});var Ds=["SIGINT","SIGTERM","SIGQUIT"];Ds.forEach(e=>{process.on(e,()=>{process.exit(1)})});var wi=Number(process.env.SHOPIFY_CLI_COLUMNS);isNaN(wi)||(process.stdout.columns=wi);async function Ls({development:e}){await io({moduleURL:import.meta.url,development:e})}pe.plugins.hidden=!0;pe["plugins:install"].description="";var Rs=Object.keys(ft);Rs.forEach(e=>{ft[e].customPluginName="@shopify/app"});var qs=Object.keys(Je);qs.forEach(e=>{Je[e].customPluginName="@shopify/theme"});var $s=Object.keys(Ke);$s.forEach(e=>{Ke[e].customPluginName="@shopify/cli-hydrogen"});var Us=Object.keys(lt);Us.forEach(e=>{lt[e].customPluginName="@shopify/store"});var zs=Object.keys(Xe);zs.forEach(e=>{Xe[e].customPluginName="@oclif/plugin-commands"});var Ms=Object.keys(Ze);Ms.forEach(e=>{Ze[e].customPluginName="@shopify/plugin-did-you-mean"});var Hs=Object.keys(pe);Hs.forEach(e=>{pe[e].customPluginName="@oclif/plugin-plugins"});var qy={...ft,...Je,...pe,...Ze,...Xe,...Ke,...lt,search:so,upgrade:co,version:no,"send-analytics":uo,help:Ao,"auth:logout":po,"auth:login":mo,"debug:command-flags":lo,"kitchen-sink":yo,"kitchen-sink:async":fo,"kitchen-sink:prompts":ho,"kitchen-sink:static":go,"doctor-release":So,"doctor-release:theme":wo,"doc:fetch":ko,"doc:search":bo,"docs:generate":vo,"notifications:list":xo,"notifications:generate":To,"cache:clear":Io,"config:autoupgrade:off":Oo,"config:autoupgrade:on":_o,"config:autoupgrade:status":No},$y=Ls;export{Cs as AppPublicMetadataHook,Fs as AppSensitiveMetadataHook,qy as COMMANDS,_i as DidYouMeanHook,Ry as HydrogenInitHook,Oi as PluginHook,Ni as TunnelProviderHook,Ei as TunnelStartHook,$y as default,xi as fetchStoreThemes,Ti as pull,Ii as push};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gb as a,hb as b,ib as c,jb as d,kb as e}from"./chunk-VFM2KQRM.js";import"./chunk-B4OMIONW.js";import"./chunk-BOAGJ6P5.js";import"./chunk-LD6ZCTZ3.js";import"./chunk-JJZNUFPD.js";import"./chunk-R6ICQT2D.js";import"./chunk-DPNZWBT5.js";import"./chunk-JD5P5RAJ.js";import"./chunk-773TIA5M.js";import"./chunk-CRALWNNO.js";import"./chunk-VKWPEFWQ.js";export{a as currentProcessIsGlobal,e as getProjectDir,d as inferPackageManagerForGlobalCLI,c as installGlobalCLIPrompt,b as installGlobalShopifyCLI};
|