@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,18 @@
|
|
|
1
|
+
import{a as ft,c,e as pt,g as a}from"./chunk-VKWPEFWQ.js";var M=c((qt,U)=>{"use strict";a();var m=class t extends Error{constructor(e,s,r){super("[ParserError] "+e,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}},d=class{constructor(e){this.parser=e,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},T=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new d(this.parseStart)}parse(e){if(e.length===0||e.length==null)return;this._buf=String(e),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let e;do e=this.state.parser,this.runOne();while(this.state.parser!==e);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(e){if(typeof e!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(e));this.state.parser=e}goto(e){return this.next(e),this.runOne()}call(e,s){s&&this.next(s),this.stack.push(this.state),this.state=new d(e)}callNow(e,s){return this.call(e,s),this.runOne()}return(e){if(this.stack.length===0)throw this.error(new m("Stack underflow"));e===void 0&&(e=this.state.buf),this.state=this.stack.pop(),this.state.returned=e}returnNow(e){return this.return(e),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(e){return e.line=this.line,e.col=this.col,e.pos=this.pos,e}parseStart(){throw new m("Must declare a parseStart method")}};T.END=1114112;T.Error=m;U.exports=T});var B=c((Wt,P)=>{"use strict";a();P.exports=t=>{let e=new Date(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}});var g=c((Zt,F)=>{"use strict";a();F.exports=(t,e)=>{for(e=String(e);e.length<t;)e="0"+e;return e}});var $=c((vt,K)=>{"use strict";a();var _=g(),N=class extends Date{constructor(e){super(e+"Z"),this.isFloating=!0}toISOString(){let e=`${this.getUTCFullYear()}-${_(2,this.getUTCMonth()+1)}-${_(2,this.getUTCDate())}`,s=`${_(2,this.getUTCHours())}:${_(2,this.getUTCMinutes())}:${_(2,this.getUTCSeconds())}.${_(3,this.getUTCMilliseconds())}`;return`${e}T${s}`}};K.exports=t=>{let e=new N(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}});var W=c((zt,Q)=>{"use strict";a();var q=g(),mt=global.Date,y=class extends mt{constructor(e){super(e),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${q(2,this.getUTCMonth()+1)}-${q(2,this.getUTCDate())}`}};Q.exports=t=>{let e=new y(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}});var Z=c((jt,J)=>{"use strict";a();var A=g(),L=class extends Date{constructor(e){super(`0000-01-01T${e}Z`),this.isTime=!0}toISOString(){return`${A(2,this.getUTCHours())}:${A(2,this.getUTCMinutes())}:${A(2,this.getUTCSeconds())}.${A(3,this.getUTCMilliseconds())}`}};J.exports=t=>{let e=new L(t);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}});var x=c((exports,module)=>{"use strict";a();module.exports=makeParserClass(M());module.exports.makeParserClass=makeParserClass;var TomlError=class t extends Error{constructor(e){super(e),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,t),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=t=>{let e=new TomlError(t.message);return e.code=t.code,e.wrapped=t,e};module.exports.TomlError=TomlError;var createDateTime=B(),createDateTimeFloat=$(),createDate=W(),createTime=Z(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
|
|
2
|
+
`,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(t){return t>=CHAR_0&&t<=CHAR_9}function isHexit(t){return t>=CHAR_A&&t<=CHAR_F||t>=CHAR_a&&t<=CHAR_f||t>=CHAR_0&&t<=CHAR_9}function isBit(t){return t===CHAR_1||t===CHAR_0}function isOctit(t){return t>=CHAR_0&&t<=CHAR_7}function isAlphaNumQuoteHyphen(t){return t>=CHAR_A&&t<=CHAR_Z||t>=CHAR_a&&t<=CHAR_z||t>=CHAR_0&&t<=CHAR_9||t===CHAR_APOS||t===CHAR_QUOT||t===CHAR_LOWBAR||t===CHAR_HYPHEN}function isAlphaNumHyphen(t){return t>=CHAR_A&&t<=CHAR_Z||t>=CHAR_a&&t<=CHAR_z||t>=CHAR_0&&t<=CHAR_9||t===CHAR_LOWBAR||t===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(t,e){return hasOwnProperty.call(t,e)?!0:(e==="__proto__"&&defineProperty(t,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(t){return t===null||typeof t!="object"?!1:t[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(t){return t===null||typeof t!="object"?!1:t[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(t){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:t}})}function isInlineList(t){return t===null||typeof t!="object"?!1:t[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(t){return t===null||typeof t!="object"?!1:t[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(t){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(e){try{this.value=global.BigInt.asIntN(64,e)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(t){let e=Number(t);return Object.is(e,-0)&&(e=0),global.BigInt&&!Number.isSafeInteger(e)?new BoxedBigInt(t):Object.defineProperties(new Number(e),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${t}]`}})}function isInteger(t){return t===null||typeof t!="object"?!1:t[_type]===INTEGER}var FLOAT=Symbol("float");function Float(t){return Object.defineProperties(new Number(t),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${t}]`}})}function isFloat(t){return t===null||typeof t!="object"?!1:t[_type]===FLOAT}function tomlType(t){let e=typeof t;if(e==="object"){if(t===null)return"null";if(t instanceof Date)return"datetime";if(_type in t)switch(t[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return e}function makeParserClass(t){class e extends t{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===t.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===t.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===t.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===t.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===t.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===t.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===t.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===t.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===t.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],h=tomlType(r);if(i!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${h}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===t.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return e}});var w=c((te,Y)=>{"use strict";a();Y.exports=Ct;function Ct(t,e){if(t.pos==null||t.line==null)return t;let s=t.message;if(s+=` at row ${t.line+1}, col ${t.col+1}, pos ${t.pos}:
|
|
3
|
+
`,e&&e.split){let r=e.split(/\n/),i=String(Math.min(r.length,t.line+3)).length,h=" ";for(;h.length<i;)h+=" ";for(let n=Math.max(0,t.line-1);n<Math.min(r.length,t.line+2);++n){let o=String(n+1);if(o.length<i&&(o=" "+o),t.line===n){s+=o+"> "+r[n]+`
|
|
4
|
+
`,s+=h+" ";for(let l=0;l<t.col;++l)s+=" ";s+=`^
|
|
5
|
+
`}else s+=o+": "+r[n]+`
|
|
6
|
+
`}}return t.message=s+`
|
|
7
|
+
`,t}});var V=c((re,v)=>{"use strict";a();v.exports=Rt;var _t=x(),Tt=w();function Rt(t){global.Buffer&&global.Buffer.isBuffer(t)&&(t=t.toString("utf8"));let e=new _t;try{return e.parse(t),e.finish()}catch(s){throw Tt(s,t)}}});var j=c((ie,G)=>{"use strict";a();G.exports=gt;var dt=x(),z=w();function gt(t,e){e||(e={});let s=0,r=e.blocksize||40960,i=new dt;return new Promise((n,o)=>{setImmediate(h,s,r,n,o)});function h(n,o,l,p){if(n>=t.length)try{return l(i.finish())}catch(f){return p(z(f,t))}try{i.parse(t.slice(n,n+o)),setImmediate(h,n+o,o,l,p)}catch(f){p(z(f,t))}}}});var tt=c((he,X)=>{"use strict";a();X.exports=xt;var At=ft("stream"),k=x();function xt(t){return t?wt(t):Ht(t)}function wt(t){let e=new k;return t.setEncoding("utf8"),new Promise((s,r)=>{let i,h=!1,n=!1;function o(){if(h=!0,!i)try{s(e.finish())}catch(f){r(f)}}function l(f){n=!0,r(f)}t.once("end",o),t.once("error",l),p();function p(){i=!0;let f;for(;(f=t.read())!==null;)try{e.parse(f)}catch(ut){return l(ut)}if(i=!1,h)return o();n||t.once("readable",p)}})}function Ht(){let t=new k;return new At.Transform({objectMode:!0,transform(e,s,r){try{t.parse(e.toString(s))}catch(i){this.emit("error",i)}r()},flush(e){try{this.push(t.finish())}catch(s){this.emit("error",s)}e()}})}});var et=c((oe,R)=>{"use strict";a();R.exports=V();R.exports.async=j();R.exports.stream=tt();R.exports.prettyError=w()});var lt=c((ce,O)=>{"use strict";a();O.exports=Et;O.exports.value=S;function Et(t){if(t===null)throw C("null");if(t===void 0)throw C("undefined");if(typeof t!="object")throw C(typeof t);if(typeof t.toJSON=="function"&&(t=t.toJSON()),t==null)return null;let e=u(t);if(e!=="table")throw C(e);return I("","",t)}function C(t){return new Error("Can only stringify objects, not "+t)}function bt(){return new Error("Array values can't have mixed types")}function rt(t){return Object.keys(t).filter(e=>st(t[e]))}function Nt(t){return Object.keys(t).filter(e=>!st(t[e]))}function H(t){let e=Array.isArray(t)?[]:Object.prototype.hasOwnProperty.call(t,"__proto__")?{["__proto__"]:void 0}:{};for(let s of Object.keys(t))t[s]&&typeof t[s].toJSON=="function"&&!("toISOString"in t[s])?e[s]=t[s].toJSON():e[s]=t[s];return e}function I(t,e,s){s=H(s);var r,i;r=rt(s),i=Nt(s);var h=[],n=e||"";r.forEach(l=>{var p=u(s[l]);p!=="undefined"&&p!=="null"&&h.push(n+E(l)+" = "+ht(s[l],!0))}),h.length>0&&h.push("");var o=t&&r.length>0?e+" ":"";return i.forEach(l=>{h.push(Ft(t,o,l,s[l]))}),h.join(`
|
|
8
|
+
`)}function st(t){switch(u(t)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return t.length===0||u(t[0])!=="table";case"table":return Object.keys(t).length===0;default:return!1}}function u(t){return t===void 0?"undefined":t===null?"null":typeof t=="bigint"||Number.isInteger(t)&&!Object.is(t,-0)?"integer":typeof t=="number"?"float":typeof t=="boolean"?"boolean":typeof t=="string"?"string":"toISOString"in t?isNaN(t)?"undefined":"datetime":Array.isArray(t)?"array":"table"}function E(t){var e=String(t);return/^[-A-Za-z0-9_]+$/.test(e)?e:it(e)}function it(t){return'"'+nt(t).replace(/"/g,'\\"')+'"'}function yt(t){return"'"+t+"'"}function Lt(t,e){for(;e.length<t;)e="0"+e;return e}function nt(t){return t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,e=>"\\u"+Lt(4,e.codePointAt(0).toString(16)))}function It(t){let e=t.split(/\n/).map(s=>nt(s).replace(/"(?="")/g,'\\"')).join(`
|
|
9
|
+
`);return e.slice(-1)==='"'&&(e+=`\\
|
|
10
|
+
`),`"""
|
|
11
|
+
`+e+'"""'}function ht(t,e){let s=u(t);return s==="string"&&(e&&/\n/.test(t)?s="string-multiline":!/[\b\t\n\f\r']/.test(t)&&/"/.test(t)&&(s="string-literal")),S(t,s)}function S(t,e){switch(e||(e=u(t)),e){case"string-multiline":return It(t);case"string":return it(t);case"string-literal":return yt(t);case"integer":return at(t);case"float":return St(t);case"boolean":return Ot(t);case"datetime":return Dt(t);case"array":return Pt(t.filter(s=>u(s)!=="null"&&u(s)!=="undefined"&&u(s)!=="nan"));case"table":return Bt(t);default:throw C(e)}}function at(t){return String(t).replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function St(t){if(t===1/0)return"inf";if(t===-1/0)return"-inf";if(Object.is(t,NaN))return"nan";if(Object.is(t,-0))return"-0.0";var e=String(t).split("."),s=e[0],r=e[1]||0;return at(s)+"."+r}function Ot(t){return String(t)}function Dt(t){return t.toISOString()}function Ut(t){return t==="float"||t==="integer"}function Mt(t){var e=u(t[0]);return t.every(s=>u(s)===e)?e:t.every(s=>Ut(u(s)))?"float":"mixed"}function ot(t){let e=Mt(t);if(e==="mixed")throw bt();return e}function Pt(t){t=H(t);let e=ot(t);var s="[",r=t.map(i=>S(i,e));return r.join(", ").length>60||/\n/.test(r)?s+=`
|
|
12
|
+
`+r.join(`,
|
|
13
|
+
`)+`
|
|
14
|
+
`:s+=" "+r.join(", ")+(r.length>0?" ":""),s+"]"}function Bt(t){t=H(t);var e=[];return Object.keys(t).forEach(s=>{e.push(E(s)+" = "+ht(t[s],!1))}),"{ "+e.join(", ")+(e.length>0?" ":"")+"}"}function Ft(t,e,s,r){var i=u(r);if(i==="array")return Kt(t,e,s,r);if(i==="table")return $t(t,e,s,r);throw C(i)}function Kt(t,e,s,r){r=H(r),ot(r);var i=u(r[0]);if(i!=="table")throw C(i);var h=t+E(s),n="";return r.forEach(o=>{n.length>0&&(n+=`
|
|
15
|
+
`),n+=e+"[["+h+`]]
|
|
16
|
+
`,n+=I(h+".",e,o)}),n}function $t(t,e,s,r){var i=t+E(s),h="";return rt(r).length>0&&(h+=e+"["+i+`]
|
|
17
|
+
`),h+I(i+".",e,r)}});var ct=c(D=>{"use strict";a();D.parse=et();D.stringify=lt()});a();var b=pt(ct(),1);function me(t){let e=t.replace(/\r\n$/g,`
|
|
18
|
+
`);return b.parse(e)}function Ce(t){return b.stringify(t)}export{me as a,Ce as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-67Z34HN5.js";import{a as r,b as c}from"./chunk-Z65E4UAP.js";import{d as s}from"./chunk-HFSCXTJQ.js";import{a}from"./chunk-UZARYOLN.js";import{wa as n}from"./chunk-ZZRFG6ME.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class d extends a{static hidden=!0;static summary="Reverses app subscription migrations that are still scheduled.";static descriptionWithMarkdown="Reverses scheduled app subscription migrations that have not migrated yet.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV header: `shop_id`.\n- Example row: `123456789`.\n\nThe CSV can contain only the `shop_id` header, or it can reuse the complete CSV supplied to `schedule`; schedule-only columns are ignored.\n\nUnscheduling is not a rollback after a subscription has migrated. The command validates the entire CSV before sending any mutation. Use `--force` to skip confirmation and immediately submit every valid row.\n\nOperations are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...s};async run(){let{flags:t}=await this.parse(d),{app:m,remoteApp:u}=await n({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),h=await p({action:"unschedule",input:t.input??"-",clientId:u.apiKey,skipConfirmation:t.force,watch:t.watch,...t.watch&&!t.json?{onSubmissionAccepted:r}:{}}),i=c(h,{json:t.json,watch:t.watch});return i!==0&&(process.exitCode=i),{app:m}}};export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h,c as T,g as p}from"./chunk-VKWPEFWQ.js";var b=T((w,I)=>{p();I.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&I.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&I.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var q=T((M,a)=>{p();var e=global.process,u=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};u(e)?(C=h("assert"),i=b(),U=/^win/i.test(e.platform),c=h("events"),typeof c!="function"&&(c=c.EventEmitter),e.__signal_exit_emitter__?n=e.__signal_exit_emitter__:(n=e.__signal_exit_emitter__=new c,n.count=0,n.emitted={}),n.infinite||(n.setMaxListeners(1/0),n.infinite=!0),a.exports=function(t,f){if(!u(global.process))return function(){};C.equal(typeof t,"function","a callback must be provided for exit handler"),l===!1&&_();var r="exit";f&&f.alwaysLast&&(r="afterexit");var x=function(){n.removeListener(r,t),n.listeners("exit").length===0&&n.listeners("afterexit").length===0&&S()};return n.on(r,t),x},S=function(){!l||!u(global.process)||(l=!1,i.forEach(function(f){try{e.removeListener(f,v[f])}catch{}}),e.emit=G,e.reallyExit=y,n.count-=1)},a.exports.unload=S,o=function(f,r,x){n.emitted[f]||(n.emitted[f]=!0,n.emit(f,r,x))},v={},i.forEach(function(t){v[t]=function(){if(u(global.process)){var r=e.listeners(t);r.length===n.count&&(S(),o("exit",null,t),o("afterexit",null,t),U&&t==="SIGHUP"&&(t="SIGINT"),e.kill(e.pid,t))}}}),a.exports.signals=function(){return i},l=!1,_=function(){l||!u(global.process)||(l=!0,n.count+=1,i=i.filter(function(f){try{return e.on(f,v[f]),!0}catch{return!1}}),e.emit=k,e.reallyExit=L)},a.exports.load=_,y=e.reallyExit,L=function(f){u(global.process)&&(e.exitCode=f||0,o("exit",e.exitCode,null),o("afterexit",e.exitCode,null),y.call(e,e.exitCode))},G=e.emit,k=function(f,r){if(f==="exit"&&u(global.process)){r!==void 0&&(e.exitCode=r);var x=G.apply(this,arguments);return o("exit",e.exitCode,null),o("afterexit",e.exitCode,null),x}else return G.apply(this,arguments)}):a.exports=function(){return function(){}};var C,i,U,c,n,S,o,v,l,_,y,L,G,k});export{q as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as x,a as oe,b as ne,c as M,d as ie,e as ae,g as L,i as P,j as le,k as ce,m as ue,n as pe,o as me,r as fe,s as de,t as ge,u as Ee,v,w as he,x as ye,y as Te,z as S}from"./chunk-IARCMH7G.js";import{a as se}from"./chunk-EX5GVHGE.js";import{a as re}from"./chunk-UZARYOLN.js";import{a as K}from"./chunk-YESGYUEL.js";import{B as W,V as Z,X as ee,l as z,wa as te}from"./chunk-ZZRFG6ME.js";import{F as X}from"./chunk-N75VOJHO.js";import{b as Q,c as Y}from"./chunk-YEVGLC5X.js";import{D as $}from"./chunk-3JXPOOFV.js";import{d as _,e as f,f as o,l as G,y as H}from"./chunk-YFINLODF.js";import{h as N}from"./chunk-BWJIZYAG.js";import{a as Ne}from"./chunk-CTNBSUVU.js";import{ca as V,wb as F,xb as I}from"./chunk-VFM2KQRM.js";import{j}from"./chunk-773TIA5M.js";import{e as k,g as E}from"./chunk-VKWPEFWQ.js";E();E();E();E();E();E();var C=k(_(),1);function we(t){let s=(0,C.useRef)(t);(0,C.useEffect)(()=>{s.current=t},[t]),(0,C.useEffect)(()=>{let n;function i(){s.current().then(({retryIntervalMs:a})=>{a&&(n=setTimeout(i,a))}).catch(()=>{})}return n=setTimeout(i,0),()=>n&&clearTimeout(n)},[])}E();var U=async({pollOptions:{jwtToken:t,cursor:s,filters:n},developerPlatformClient:i,organizationId:l})=>{let a=await i.appLogs({jwtToken:t,cursor:s},l),{errors:p,status:u}=a;if(u!==200){if(u===401||u===429||u>=500)return{errors:p.map(T=>({status:u,message:T}))};throw new N(`${p.join(", ")} while fetching app logs`)}let{cursor:r,app_logs:c}=a,d=Ce(c,n);return{cursor:r,appLogs:d}};function Ce(t,s){let n=t;return(s.status!==void 0||s.sources!==void 0)&&(n=n.filter(i=>{let l=s.status===void 0?!0:i.status===s.status,a=s.sources===void 0?!0:s.sources.includes(`${i.source_namespace}.${i.source}`);return l&&a})),n}var b=k(_(),1);async function _e({jwtToken:t,cursor:s,filters:n,storeNameById:i,organizationId:l,setErrors:a,setAppLogOutputs:p,resubscribeCallback:u,developerPlatformClient:r}){let c=t,d=L,T=s,R=await U({pollOptions:{jwtToken:t,cursor:s,filters:n},developerPlatformClient:r,organizationId:l}),m="not_attempted",w=R;if(w.errors){let h=await v({response:w,onThrottle:g=>{a(["Request throttled while polling app logs.",`Retrying in ${g/1e3}s`])},onUnknownError:g=>{a(["Error while polling app logs",`Retrying in ${g/1e3}s`])},onResubscribe:()=>u()});m=h.resubscribeResult,h.nextJwtToken&&(c=h.nextJwtToken),d=h.retryIntervalMs}else{a(g=>g.length?[]:g);let{appLogs:h}=R;if(T=R.cursor,h)for(let g of h){let y,A,O,J=i.get(g.shop_id.toString());if(J===void 0)continue;switch(g.log_type){case ce:y=fe(g.payload),A=`export "${y.export}" executed in ${(y.fuelConsumed/le).toFixed(4)}M instructions`;break;case ue:y=de(g.payload),A="network access response retrieved from cache";break;case pe:y=ge(g.payload),A="network access request executing in background";break;case me:y=Ee(g.payload),O=y.connectTimeMs&&y.writeReadTimeMs?y.connectTimeMs+y.writeReadTimeMs:null,A=`network access request executed${O?` in ${O} ms`:""}`;break;default:continue}let Ae={status:g.status==="success"?"Success":"Failure",source:g.source,storeName:J,description:A,logTimestamp:V(g.log_timestamp)};y&&p(ke=>[...ke,{appLog:y,prefix:Ae}])}}return{nextJwtToken:c,retryIntervalMs:d,cursor:T??s,resubscribeResult:m}}function be({initialJwt:t,filters:s,resubscribeCallback:n,storeNameById:i,developerPlatformClient:l,organizationId:a}){let[p,u]=(0,b.useState)([]),[r,c]=(0,b.useState)([]),d=(0,b.useRef)(t),T=(0,b.useRef)(0),R=(0,b.useRef)(""),m=(0,b.useRef)(0),w=(0,b.useCallback)(async()=>{let h=await _e({jwtToken:d.current,cursor:R.current,filters:s,storeNameById:i,setErrors:u,setAppLogOutputs:c,resubscribeCallback:n,developerPlatformClient:l,organizationId:a});if(h.resubscribeResult==="failed"){if(m.current+=1,m.current>=P)return u(["App log streaming session has expired. Please restart your dev session."]),{retryIntervalMs:0}}else h.resubscribeResult==="succeeded"&&(m.current=0);return d.current=h.nextJwtToken,R.current=h.cursor,T.current=h.retryIntervalMs,{retryIntervalMs:T.current}},[]);return we(w),{appLogOutputs:r,errors:p}}var e=k(_(),1);var Fe=t=>{switch(t){case M.NoCachedResponse:return"No cached response available";case M.CacheAboutToExpire:return"Cache is about to expire";case M.Unknown:return"Unknown reason"}},Re=({pollOptions:{jwtToken:t,filters:s},resubscribeCallback:n,storeNameById:i,developerPlatformClient:l,organizationId:a})=>{let{appLogOutputs:p,errors:u}=be({filters:s,initialJwt:t,resubscribeCallback:n,storeNameById:i,developerPlatformClient:l,organizationId:a});return e.default.createElement(e.default.Fragment,null,p.map(({appLog:r,prefix:c},d)=>e.default.createElement(f,{flexDirection:"column",key:d},e.default.createElement(f,{flexDirection:"row",gap:1},e.default.createElement(o,null,e.default.createElement(o,{color:"green"},c.logTimestamp," "),e.default.createElement(o,{color:"blueBright"},`${c.storeName.split(".")[0]}`," "),e.default.createElement(o,{color:"blueBright"},c.source," "),e.default.createElement(o,{color:c.status==="Success"?"green":"red"},c.status," "),e.default.createElement(o,null,c.description))),e.default.createElement(f,{flexDirection:"column",marginLeft:4},r instanceof oe&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,r.logs),r.inputQueryVariablesMetafieldKey&&r.inputQueryVariablesMetafieldNamespace?e.default.createElement(f,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Input Query Variables:"),e.default.createElement(f,{flexDirection:"row",marginLeft:1,marginTop:1},e.default.createElement(o,{dimColor:!0},"Namespace:"),e.default.createElement(o,null," ",r.inputQueryVariablesMetafieldNamespace)),e.default.createElement(f,{flexDirection:"row",marginLeft:1},e.default.createElement(o,{dimColor:!0},"Key:"),e.default.createElement(o,null," ",r.inputQueryVariablesMetafieldKey)),e.default.createElement(f,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.inputQueryVariablesMetafieldValue)??e.default.createElement(o,{color:"red"},"Metafield is not set")))):null,r.input?e.default.createElement(f,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Input ",e.default.createElement(o,{dimColor:!0},"(",r.inputBytes," bytes):")),e.default.createElement(f,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.input)))):null,r.output?e.default.createElement(f,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Output ",e.default.createElement(o,{dimColor:!0},"(",r.outputBytes," bytes):")),e.default.createElement(f,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.output)))):null),r instanceof ne&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"Cache write time: ",new Date(r.cacheEntryEpochMs).toISOString()),e.default.createElement(o,null,"Cache TTL: ",r.cacheTtlMs/1e3," s"),e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest)),e.default.createElement(o,null,"HTTP response:"),e.default.createElement(o,null,x(r.httpResponse))),r instanceof ie&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"Reason: ",Fe(r.reason)),e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest))),r instanceof ae&&e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"Attempt: ",r.attempt),r.connectTimeMs?e.default.createElement(o,null,"Connect time: ",r.connectTimeMs," ms"):null,r.writeReadTimeMs?e.default.createElement(o,null,"Write read time: ",r.writeReadTimeMs," ms"):null,e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest)),r.httpResponse?e.default.createElement(f,{flexDirection:"column"},e.default.createElement(o,null,"HTTP response:"),e.default.createElement(o,null,x(r.httpResponse))):null,r.error?e.default.createElement(o,null,"Error: ",r.error):null)))),u.length>0&&e.default.createElement(f,{flexDirection:"column"},u.map((r,c)=>e.default.createElement(f,{key:c},e.default.createElement(o,{color:"red"},r)))))};var xe=k(_(),1);async function Ie({pollOptions:t,options:{variables:s,developerPlatformClient:n},storeNameById:i,organizationId:l}){let a=async()=>S(n,s,l);return G(xe.default.createElement(Re,{pollOptions:t,resubscribeCallback:a,storeNameById:i,developerPlatformClient:n,organizationId:l}))}E();async function q({pollOptions:t,options:{variables:s,developerPlatformClient:n},storeNameById:i,organizationId:l,consecutiveResubscribeFailures:a=0}){let p=await U({pollOptions:t,developerPlatformClient:n,organizationId:l}),u=L,r=t.jwtToken,c=a,d=p;if(d.errors){let m=await v({response:d,onThrottle:w=>{I(JSON.stringify({message:"Request throttled while polling app logs.",retry_in_ms:w}))},onUnknownError:w=>{I(JSON.stringify({message:"Error while polling app logs.",retry_in_ms:w}))},onResubscribe:()=>S(n,s,l)});if(m.resubscribeResult==="failed"){if(c+=1,c>=P){I(JSON.stringify({message:"App log streaming session has expired. Please restart your dev session."}));return}}else m.resubscribeResult==="succeeded"&&(c=0);m.nextJwtToken&&(r=m.nextJwtToken),u=m.retryIntervalMs}else c=0;let{cursor:T,appLogs:R}=p;R&&R.forEach(m=>{let w=i.get(m.shop_id?.toString());w!==void 0&&F(ye({appLog:m,appLogPayload:Te(m.payload,m.log_type),storeName:w,prettyPrint:!1}))}),setTimeout(()=>{q({options:{variables:s,developerPlatformClient:n},pollOptions:{jwtToken:r||t.jwtToken,cursor:T??t.cursor,filters:t.filters},storeNameById:i,organizationId:l,consecutiveResubscribeFailures:c}).catch(m=>{throw m})},u)}async function Se(t){let{app:s,remoteApp:n,developerPlatformClient:i}=t,l=await Me(t),a=he(s);if(a.length===0)throw new N("This app has no log sources. Learn more about app logs at https://shopify.dev/docs/api/shopify-cli/app/app-logs");if(t.sources){let d=t.sources.filter(T=>!a.includes(T));if(d.length)throw new N(`Invalid sources: ${d.join(", ")}. Valid sources are: ${a.join(", ")}`)}let p={shopIds:l.storeIds.map(Number),apiKey:n.apiKey},u=await S(i,p,t.organization.id),r={status:t.status,sources:t.sources},c={jwtToken:u,filters:r};t.format==="json"?(F(JSON.stringify({subscribedToStores:t.storeFqdns})),I(JSON.stringify({message:"Waiting for app logs..."})),await q({options:{variables:p,developerPlatformClient:i},pollOptions:c,storeNameById:l.storeNameById,organizationId:t.organization.id})):(I(`Waiting for app logs...
|
|
2
|
+
`),await Ie({options:{variables:p,developerPlatformClient:i},pollOptions:c,storeNameById:l.storeNameById,organizationId:t.organization.id}))}async function Me(t){let{app:s,remoteApp:n,developerPlatformClient:i,primaryStore:l,organization:a}=t,p=j(s.configPath);t.format==="text"&&Le(n.title,l.shopDomain,t.storeFqdns,p,a.businessName);let u=new Map;return u.set(l.shopId,l.shopDomain),t.storeFqdns&&t.storeFqdns.length>1&&await Promise.all(t.storeFqdns?.slice(1).map(async c=>{let d=await X(a,c,i);u.set(d.shopId,c)})),{storeIds:Array.from(u.keys()),storeNameById:u}}function Le(t,s,n,i,l){let a=[];n&&n.length>0?n.forEach(u=>a.push(u)):a.push(s);let p=i?z(i):void 0;H({headline:i?`Using ${p} for default values:`:"Using these settings:",body:Z({appName:t,org:l,devStores:a,messages:[ee]})})}var B=k(Ne(),1);var D=class t extends re{static summary="Stream detailed logs for your Shopify app.";static descriptionWithMarkdown="\n Opens a real-time stream of detailed app logs from the selected app and store.\n Use the `--source` argument to limit output to a particular log source, such as a specific Shopify Function handle. Use the `shopify app logs sources` command to view a list of sources.\n Use the `--status` argument to filter on status, either `success` or `failure`.\n ```\n shopify app logs --status=success --source=extension.discount-function\n ```\n ";static description=this.descriptionWithoutMarkdown();static flags={...Q,...K,...Y,store:B.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",multiple:!0,parse:async s=>$(s)}),source:B.Flags.string({description:"Filters output to the specified log source.",env:"SHOPIFY_FLAG_SOURCE",multiple:!0}),status:B.Flags.string({description:"Filters output to the specified status (success or failure).",options:["success","failure"],env:"SHOPIFY_FLAG_STATUS"})};async run(){let{flags:s}=await this.parse(t);await W(s.path);let n=await te({directory:s.path,clientId:s["client-id"],forceRelink:s.reset,userProvidedConfigName:s.config}),i=await se({appContextResult:n,storeFqdn:s.store?.[0],forceReselectStore:s.reset}),l={...n,primaryStore:i,storeFqdns:s.store,sources:s.source,status:s.status,format:s.json?"json":"text"};return await Se(l),{app:n.app}}};export{D as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as v,b as f}from"./chunk-YY6TFARF.js";import{a as u}from"./chunk-Q5JX23QU.js";import{a as y}from"./chunk-ZYX7UHCQ.js";import{a as w}from"./chunk-GRPKF5ZB.js";import{p as d,v as c}from"./chunk-GNBRCK7L.js";import{b as p}from"./chunk-YEVGLC5X.js";import{N as m,y as s}from"./chunk-YFINLODF.js";import{a as E}from"./chunk-CTNBSUVU.js";import{e as T,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function g(t,e){let r=new u(t),F=(await(e.development?r.find():r.fetch()))?.id,n=await y(t,{header:"Select a theme to open",filter:{live:e.live,theme:e.development?`${F}`:e.theme}}),l=v(n,t),a=f(n,t);s({body:["Preview information for theme",...w(n),`
|
|
2
|
+
|
|
3
|
+
`,{list:{items:[{link:{label:"Preview your theme",url:l}},{link:{label:"Customize your theme at the theme editor",url:a}}]}}]}),e.editor?await m(a):await m(l)}var o=T(E(),1);var h=class extends c{static summary="Opens the preview of your remote theme.";static descriptionWithMarkdown=`Returns links that let you preview the specified theme. The following links are returned:
|
|
4
|
+
|
|
5
|
+
- A link to the [editor](https://shopify.dev/docs/themes/tools/online-editor) for the theme in the Shopify admin.
|
|
6
|
+
- A [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with other developers.
|
|
7
|
+
|
|
8
|
+
If you don't specify a theme, then you're prompted to select the theme to open from the list of the themes in your store.`;static description=this.descriptionWithoutMarkdown();static flags={...p,...d,development:o.Flags.boolean({char:"d",description:"Open your development theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),editor:o.Flags.boolean({char:"E",description:"Open the theme editor for the specified theme in the browser.",env:"SHOPIFY_FLAG_EDITOR"}),live:o.Flags.boolean({char:"l",description:"Open your live (published) theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_LIVE"}),theme:o.Flags.string({char:"t",description:"Theme ID or name of the remote theme. Use --development, --live, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_THEME_ID"})};static multiEnvironmentsFlags=null;static nonTTYFlagRequirements(){return[{flags:["theme","development","live"]}]}async command(e,r){await g(r,e)}};export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as p}from"./chunk-KWVOJWO7.js";import{Aa as s,l as E,xa as b,ya as k}from"./chunk-3JXPOOFV.js";import{J as w}from"./chunk-YFINLODF.js";import{h as N}from"./chunk-BWJIZYAG.js";import{Ab as V,S as _}from"./chunk-VFM2KQRM.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ie="live",ae="unpublished";function te(e){return e.role===g}async function de(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??=!1,e.createdAtRuntime??=!1;let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function se(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},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:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},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:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{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"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},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:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},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:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{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:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},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:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",c={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function sn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await p({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),k(i),V(`Error fetching theme with ID: ${e}`)}}async function un(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await T({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:c});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await T({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw k(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function cn(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await T({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:c});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw k(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function pn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await T({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let u=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async u=>{let{attachment:h,value:v}=await J(u.body);return{attachment:h,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function vn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await p({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:c});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:h}=o;u&&u.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(k(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function Nn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);b("theme-api:upload-files");let o=await K(e,m,a);b("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return p({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:c})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),k(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function hn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await T({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:c});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw k(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function fn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await p({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:c});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let u=d.userErrors.map(h=>h.message).join(", ");throw k(new N(u))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function yn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await p({query:O,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function Sn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await p({query:x,session:n,variables:{id:S(e)},preferredBehaviour:c});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw k(new N(d))}return i||r("Failed to update theme"),!0}async function Fn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await p({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:c,responseOptions:{onResponse:u=>{i=u.headers.get("x-request-id")??void 0}}});if(!t)return k("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Tn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await p({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await p({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw k(new N(e))}async function T(e){try{return await p(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw k(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:Z(i)}function Z(e){return e.trim().replace(/\.$/,"").replace(/^The user needs\s+/i,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function J(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw k(new N(`Error downloading content from URL: ${e.url}`))}}}export{se as a,g as b,ie as c,ae as d,te as e,de as f,sn as g,un as h,kn as i,cn as j,pn as k,vn as l,Nn as m,hn as n,fn as o,yn as p,Sn as q,Fn as r,Tn as s,bn as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as p}from"./chunk-VKWPEFWQ.js";p();import i from"node:process";import n from"node:path";import{fileURLToPath as f}from"node:url";p();function s(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}var u=({cwd:t=i.cwd(),path:e=i.env[s()],preferLocal:r=!0,execPath:o=i.execPath,addExecPath:l=!0}={})=>{let m=t instanceof URL?f(t):t,c=n.resolve(m),a=[];return r&&h(a,c),l&&v(a,o,c),[...a,e].join(n.delimiter)},h=(t,e)=>{let r;for(;r!==e;)t.push(n.join(e,"node_modules/.bin")),r=e,e=n.resolve(e,"..")},v=(t,e,r)=>{let o=e instanceof URL?f(e):e;t.push(n.resolve(r,o,".."))},j=({env:t=i.env,...e}={})=>{t={...t};let r=s({env:t});return e.path=t[r],t[r]=u(e),t};export{j as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as se}from"./chunk-H2TQ4ODI.js";import{a as ne,b as re,h as oe}from"./chunk-HFSCXTJQ.js";import{a as q,d as X}from"./chunk-3JXPOOFV.js";import{E as ee,_ as ie}from"./chunk-YFINLODF.js";import{h as A,j as te}from"./chunk-BWJIZYAG.js";import{Ta as Z,ma as Y}from"./chunk-VFM2KQRM.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var ve=/^gid:\/\/shopify\/Shop\/(\d+)$/,De=/^\d+$/,ae=250,Re=new Set(ne),Be=new Set(re);function ue(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Ae(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),fe(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),le(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&fe(w)&&le(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ce(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Le(i,r),canonicalInput:a,inputDigest:de(a)}}}function Ae(i){let e=i?.trim();if(!e)return;let o=De.test(e)?e:ve.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function fe(i){return i!==void 0&&Re.has(i)}function le(i){return Be.has(i)}function ce(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Le(i,e){let o=[];for(let t=0;t<e.length;t+=ae){let n=e.slice(t,t+ae),r=ce(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:de(r)})}return o}function de(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var _e=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var he=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Te(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Te=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var pe=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},$e=13,Me=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:_e(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
|
|
2
|
+
`,a).length:w,l?(s===null?0:s.length)+f.length:0,l?f.length+w:0);return S<O},parse:function(t,n,r,a){let{bom:s,comment_no_infix:f,delimiter_auto:l,encoding:h,from_line:w,ltrim:S,max_record_size:O,raw:L,relax_quotes:I,rtrim:E,skip_empty_lines:y,to:g,to_line:p}=this.options,{comment:x,escape:C,quote:N,record_delimiter:F}=this.options,{bomSkipped:Ne,delimiterDiscovered:Ee,delimiterBufPrevious:V,rawBuffer:xe,escapeIsQuote:Ce}=this.state;if(!Ee&&l){let m;if(V===void 0?m=t:V!==void 0&&t===void 0?m=V:m=Buffer.concat([V,t]),t=void 0,n||m.length>l.size)this.options.delimiter=[Buffer.from(he(m,this.options.delimiter_auto))],this.state.previousBuf=m,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=m;return}}let{previousBuf:P}=this.state,_;if(P===void 0)if(t===void 0){a();return}else _=t;else P!==void 0&&t===void 0?_=P:_=Buffer.concat([P,t]);if(Ne===!1)if(s===!1)this.state.bomSkipped=!0;else if(_.length<3){if(n===!1){this.state.previousBuf=_;return}}else{for(let m in $)if($[m].compare(_,0,$[m].length)===0){let D=$[m].length;this.state.bufBytesStart+=D,_=_.slice(D);let k=T({...this.original_options,encoding:m});for(let b in k)this.options[b]=k[b];({comment:x,escape:C,quote:N}=this.options);break}this.state.bomSkipped=!0}let U=_.length,u;for(u=0;u<U&&!this.__needMoreData(u,U,n);u++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),p!==-1&&this.info.lines>p){this.state.stop=!0,a();return}this.state.quoting===!1&&F.length===0&&this.__autoDiscoverRecordDelimiter(_,u)&&(F=this.options.record_delimiter);let m=_[u];if(L===!0&&xe.append(m),(m===$e||m===Me)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(C!==null&&this.state.quoting===!0&&this.__isEscape(_,u,m)&&u+C.length<U)if(Ce){if(this.__isQuote(_,u+C.length)){this.state.escaping=!0,u+=C.length-1;continue}}else{this.state.escaping=!0,u+=C.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(_,u))if(this.state.quoting===!0){let b=_[u+N.length],R=E&&this.__isCharTrimable(_,u+N.length),v=x!==null&&this.__compareBytes(x,_,u+N.length,b),B=this.__isDelimiter(_,u+N.length,b),J=F.length===0?this.__autoDiscoverRecordDelimiter(_,u+N.length):this.__isRecordDelimiter(b,_,u+N.length);if(C!==null&&this.__isEscape(_,u,m)&&this.__isQuote(_,u+C.length))u+=C.length-1;else if(!b||B||J||v||R){this.state.quoting=!1,this.state.wasQuoting=!0,u+=N.length-1;continue}else if(I===!1){let W=this.__error(new c("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(b)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(W!==void 0)return W}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(N),u+=N.length-1}else if(this.state.field.length!==0){if(I===!1){let b=this.__infoField(),R=Object.keys($).map(B=>$[B].equals(this.state.field.toString())?B:!1).filter(Boolean)[0],v=this.__error(new c("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(b.column)} at line ${b.lines}, value is ${JSON.stringify(this.state.field.toString(h))}`,R?`(${R} bom)`:void 0],this.options,b,{field:this.state.field}));if(v!==void 0)return v}}else{this.state.quoting=!0,u+=N.length-1;continue}if(this.state.quoting===!1){let b=this.__isRecordDelimiter(m,_,u);if(b!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=w){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),u+=b-1;continue}if(y===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,u+=b-1;continue}this.info.bytes=this.state.bufBytesStart+u;let B=this.__onField();if(B!==void 0)return B;this.info.bytes=this.state.bufBytesStart+u+b;let J=this.__onRecord(r);if(J!==void 0)return J;if(g!==-1&&this.info.records>=g){this.state.stop=!0,a();return}}this.state.commenting=!1,u+=b-1;continue}if(this.state.commenting)continue;if(x!==null&&(f===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(x,_,u,m)!==0){this.state.commenting=!0;continue}let R=this.__isDelimiter(_,u,m);if(R!==0){this.info.bytes=this.state.bufBytesStart+u;let v=this.__onField();if(v!==void 0)return v;u+=R-1;continue}}}if(this.state.commenting===!1&&O!==0&&this.state.record_length+this.state.field.length>O)return this.__error(new c("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${O}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let D=S===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(_,u),k=E===!1||this.state.wasQuoting===!1;if(D===!0&&k===!0)this.state.field.append(m);else{if(E===!0&&!this.__isCharTrimable(_,u))return this.__error(new c("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));D===!1&&(u+=this.__isCharTrimable(_,u)-1);continue}}if(n===!0)if(this.state.quoting===!0){let m=this.__error(new c("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(m!==void 0)return m}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+u;let m=this.__onField();if(m!==void 0)return m;let D=this.__onRecord(r);if(D!==void 0)return D}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=u,this.state.previousBuf=_.slice(u);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(t){let{columns:n,group_columns_by_name:r,encoding:a,info:s,from:f,relax_column_count:l,relax_column_count_less:h,relax_column_count_more:w,raw:S,skip_records_with_empty_values:O}=this.options,{enabled:L,record:I}=this.state;if(L===!1)return this.__resetRecord();let E=I.length;if(n===!0){if(O===!0&&pe(I)){this.__resetRecord();return}return this.__firstLineToColumns(I)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=E),E!==this.state.expectedRecordLength){let y=n===!1?new c("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I}):new c("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I});if(l===!0||h===!0&&E<this.state.expectedRecordLength||w===!0&&E>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=y;else{let g=this.__error(y);if(g)return g}}if(O===!0&&pe(I)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,f===1||this.info.records>=f){let{objname:y}=this.options;if(n!==!1){let g={};for(let p=0,x=I.length;p<x;p++)n[p]===void 0||n[p].disabled||(r===!0&&Object.hasOwn(g,n[p].name)?Array.isArray(g[n[p].name])?g[n[p].name]=g[n[p].name].concat(I[p]):g[n[p].name]=[g[n[p].name],I[p]]:Object.defineProperty(g,n[p].name,{value:I[p],enumerable:!0,writable:!0,configurable:!0}));if(S===!0||s===!0){let p=Object.assign({record:g},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),x=this.__push(y===void 0?p:[g[y],p],t);if(x)return x}else{let p=this.__push(y===void 0?g:[g[y],g],t);if(p)return p}}else if(S===!0||s===!0){let g=Object.assign({record:I},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),p=this.__push(y===void 0?g:[I[y],g],t);if(p)return p}else{let g=this.__push(y===void 0?I:[I[y],I],t);if(g)return g}}this.__resetRecord()},__firstLineToColumns:function(t){let{firstLineToHeaders:n}=this.state;try{let r=n===void 0?t:n.call(null,t);if(!Array.isArray(r))return this.__error(new c("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}));let a=z(r);this.state.expectedRecordLength=a.length,this.options.columns=a,this.__resetRecord();return}catch(r){return r}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:t,encoding:n,rtrim:r,max_record_size:a}=this.options,{enabled:s,wasQuoting:f}=this.state;if(s===!1)return this.__resetField();let l=this.state.field.toString(n);if(r===!0&&f===!1&&(l=l.trimRight()),t===!0){let[h,w]=this.__cast(l);if(h!==void 0)return h;l=w}this.state.record.push(l),a!==0&&typeof l=="string"&&(this.state.record_length+=l.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(t,n){let{on_record:r}=this.options;if(r!==void 0){let a=this.__infoRecord();try{t=r.call(null,t,a)}catch(s){return s}if(t==null)return}this.info.bytes_records+=this.info.bytes,n(t)},__cast:function(t){let{columns:n,relax_column_count:r}=this.options;if(Array.isArray(n)===!0&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let s=this.__infoField();return[void 0,this.state.castField.call(null,t,s)]}catch(s){return[s]}if(this.__isFloat(t))return[void 0,parseFloat(t)];if(this.options.cast_date!==!1){let s=this.__infoField();return[void 0,this.options.cast_date.call(null,t,s)]}return[void 0,t]},__compareBytes:function(t,n,r,a){if(t[0]!==a)return 0;let s=t.length;for(let f=1;f<s;f++)if(t[f]!==n[r+f])return 0;return s},__isCharTrimable:function(t,n){let{timchars:r,timcharFirstBytes:a}=this.state,s=t[n];if(s===void 0||a[s]===0)return 0;e:for(let f=0;f<r.length;f++){let l=r[f];for(let h=0;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}return 0},__isDelimiter:function(t,n,r){let{delimiter:a,ignore_last_delimiters:s}=this.options;if(s===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(s!==!1&&typeof s=="number"&&this.state.record.length===s-1)return 0;e:for(let f=0;f<a.length;f++){let l=a[f];if(l[0]===r){for(let h=1;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}}return 0},__isEscape:function(t,n,r){let{escape:a}=this.options;if(a===null)return!1;let s=a.length;if(a[0]===r){for(let f=0;f<s;f++)if(a[f]!==t[n+f])return!1;return!0}return!1},__isFloat:function(t){return t-parseFloat(t)+1>=0},__isQuote:function(t,n){let{quote:r}=this.options;if(r===null)return!1;let a=r.length;for(let s=0;s<a;s++)if(r[s]!==t[n+s])return!1;return!0},__isRecordDelimiter:function(t,n,r){let{record_delimiter:a}=this.options,s=a.length;e:for(let f=0;f<s;f++){let l=a[f],h=l.length;if(l[0]===t){for(let w=1;w<h;w++)if(l[w]!==n[r+w])continue e;return l.length}}return 0},__autoDiscoverRecordDelimiter:function(t,n){let{encoding:r}=this.options,a=[Buffer.from(`\r
|
|
3
|
+
`,r),Buffer.from(`
|
|
4
|
+
`,r),Buffer.from("\r",r)];e:for(let s=0;s<a.length;s++){let f=a[s].length;for(let l=0;l<f;l++)if(a[s][l]!==t[n+l])continue e;return this.options.record_delimiter.push(a[s]),this.state.recordDelimiterMaxLength=a[s].length,a[s].length}return 0},__error:function(t){let{encoding:n,raw:r,skip_records_with_error:a}=this.options,s=typeof t=="string"?new Error(t):t;if(a){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(s,r?this.state.rawBuffer.toString(n):void 0)}catch(f){return f}return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:t,raw:n,encoding:r}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:t===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(r):void 0}},__infoField:function(){let{columns:t}=this.options,n=Array.isArray(t),r=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:r,column:n===!0?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var ge=function(i,e={}){typeof i=="string"&&(i=Buffer.from(i));let o=e&&e.objname?Object.create(null):[],t=j(e),n=s=>{t.options.objname===void 0?o.push(s):o[s[0]]=s[1]},r=()=>{},a=t.parse(i,!0,n,r);if(a!==void 0)throw a;return o};var Ve=["shop_id","target_plan_handle","price_behavior","notification"],Pe={schedule:["shop_id","target_plan_handle","price_behavior"],unschedule:["shop_id"]};function be(i,e){if(i.trim()==="")return{ok:!1,errors:[{message:"The CSV is empty"}]};let o=[],t;try{t=ge(i,{bom:!0,columns:r=>(o=r,r),info:!0,skip_empty_lines:!0,trim:!0})}catch(r){if(!(r instanceof c))throw r;return{ok:!1,errors:[{message:`Invalid CSV: ${r.message}`}]}}let n=ke(o,e);return n.length>0?{ok:!1,errors:n}:t.length===0?{ok:!1,errors:[{message:"The CSV must contain at least one data row"}]}:{ok:!0,rows:t.map(({record:r,info:a})=>Je(r,a.lines,e))}}function ke(i,e){let o=[],t=new Set(Ve),n=new Set;for(let r of i)n.has(r)?o.push({field:r,message:`Duplicate CSV header: ${r}`}):n.add(r),t.has(r)||o.push({field:r,message:`Unknown CSV header: ${r}`});for(let r of Pe[e])i.includes(r)||o.push({field:r,message:`Missing required CSV header: ${r}`});return o}function Je(i,e,o){return o==="unschedule"?{sourceRow:e,shopId:i.shop_id}:{sourceRow:e,shopId:i.shop_id,...i.target_plan_handle===void 0?{}:{targetPlanHandle:i.target_plan_handle},...i.price_behavior===void 0?{}:{priceBehavior:i.price_behavior},...i.notification===void 0?{}:{notification:i.notification}}}d();var we={fileExists:Z,readFile:Y,readStdin:ie};async function G(i,e=we){let o={...we,...e};if(i!=="-"){if(!await o.fileExists(i))throw new A(`CSV file not found: ${i}`);try{return await o.readFile(i)}catch(n){if(n instanceof A)throw n;let r=n instanceof Error?n.message:String(n);throw new A(`Couldn't read CSV file ${i}: ${r}`)}}let t=await o.readStdin();if(t===void 0||t==="")throw new A("Provide --input <path> or pipe CSV data to stdin.");return t}async function Ie(i,e,o){let t=o?await G(e,o):await G(e),n=be(t,i);return n.ok?ue(i,n.rows):n}d();d();var qe="shopify-subscription-migration:v1";function ye(){return X()}function Oe({appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t}){let n=JSON.stringify({namespace:qe,appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t});return q(n).toString("hex")}var K=class extends Error{batchIndex;constructor(e){super(`Migration submission batch ${e} returned neither an operation nor user errors`),this.name="MigrationSubmissionProtocolError",this.batchIndex=e}};async function Se({clientId:i,plan:e,invocationId:o=ye(),createOperation:t=oe}){let n={clientId:i,action:e.action,inputDigest:e.inputDigest,total:e.rows.length,operations:[]};for(let r of e.batches){let a=Oe({appIdentifier:i,action:e.action,invocationId:o,canonicalBatchPayload:r.canonicalPayload}),s=await t({clientId:i,idempotencyKey:a,migrations:r.rows.map(ze)});if(s.operation&&n.operations.push({batchIndex:r.index,batchPayloadDigest:r.payloadDigest,operation:s.operation}),s.userErrors.length>0)return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:s.userErrors}};if(!s.operation)throw new K(r.index)}return{status:"success",submission:n}}function ze(i){return i.action==="unschedule"?{shopId:i.shopId,action:{cancelMigration:!0}}:{shopId:i.shopId,action:{scheduleMigration:je(i)}}}function je({targetPlanHandle:i,priceBehavior:e,notification:o}){return{targetPlanHandle:i,priceBehavior:e,notification:o}}async function ni(i){let e=await Ie(i.action,i.input);if(!e.ok)throw new A(Ue(e.errors));if(!i.skipConfirmation&&!await ee({message:`${i.action==="schedule"?"Schedule":"Unschedule"} ${e.plan.rows.length} subscriptions?`}))throw new te;let o=await Se({clientId:i.clientId,plan:e.plan});if(o.status==="failed"||!i.watch)return o;i.onSubmissionAccepted?.(o.submission);let t=await se({clientId:i.clientId,operationIds:o.submission.operations.map(({operation:a})=>a.id)}),n=Fe(o.submission,t),r=n.operations.filter(({operation:a})=>a.status==="FAILED").map(({operation:a})=>a.id);return r.length===0?{status:"success",submission:n}:{status:"failed",submission:n,failure:{type:"operations",operationIds:r}}}function Fe(i,e){let o=new Map(e.map(t=>[t.id,t]));return{...i,operations:i.operations.map(t=>({...t,operation:o.get(t.operation.id)??t.operation}))}}function Ue(i){return i.map(e=>{let o=[e.row===void 0?void 0:`row ${e.row}`,e.field].filter(t=>t!==void 0).join(", ");return o?`${o}: ${e.message}`:e.message}).join(`
|
|
5
|
+
`)}export{ni as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ba as a,i}from"./chunk-ZZRFG6ME.js";import{qb as e,sb as r}from"./chunk-VFM2KQRM.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();async function f(n,t,o){return c(n,t,o,"text")}async function c(n,t,o,S){return await a(t,o.source),S==="json"?r`${e.json({SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:i(n.configuration)})}`:r`
|
|
2
|
+
${e.green("SHOPIFY_API_KEY")}=${t.apiKey}
|
|
3
|
+
${e.green("SHOPIFY_API_SECRET")}=${t.apiSecretKeys[0]?.secret??""}
|
|
4
|
+
${e.green("SCOPES")}=${i(n.configuration)}
|
|
5
|
+
`}export{f as a,c as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,b as l}from"./chunk-H2TQ4ODI.js";import{f as d,i as m}from"./chunk-HFSCXTJQ.js";import{a as c}from"./chunk-UZARYOLN.js";import{wa as p}from"./chunk-ZZRFG6ME.js";import{h as s}from"./chunk-BWJIZYAG.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();async function f({clientId:a,operationIds:t,getOperation:n=m}){return Promise.all(t.map(async i=>{let e=await n({clientId:a,operationId:i});if(!e)throw new s(`Migration operation not found: ${i}`);return e}))}var r=class a extends c{static hidden=!0;static summary="Checks the status of app subscription migration operations.";static descriptionWithMarkdown="Checks app subscription migration operation status.\n\nRepeat `--id` for every operation GID returned by a multi-batch submission. With `--watch`, the command displays the current state while polling and outputs the final state after all requested operations reach a terminal status.\n\n`RUNNING` means an operation is still processing. `COMPLETED` means processing finished, but you must inspect the per-shop results to confirm each outcome. `FAILED` means the operation failed, and `CANCELED` means cancellation stopped further processing.\n\nUse `--json` to output every operation and its per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2> --watch","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...d};async run(){let{flags:t}=await this.parse(a),{app:n,remoteApp:i}=await p({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),e=t.watch?await l({clientId:i.apiKey,operationIds:t.id}):await f({clientId:i.apiKey,operationIds:t.id});return u(e,t.json),{app:n}}};export{r as a};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{p as C,v as Y}from"./chunk-GNBRCK7L.js";import{$ as re,aa as H}from"./chunk-F3NYCSXT.js";import{b as U}from"./chunk-YEVGLC5X.js";import{r as L}from"./chunk-Y5PRPHLQ.js";import{y as w,z as E}from"./chunk-YFINLODF.js";import{h as P}from"./chunk-BWJIZYAG.js";import{a as oe}from"./chunk-CTNBSUVU.js";import{$a as A,Ab as j,N as I,Ta as N,ua as T,wb as p,xb as $,yb as G}from"./chunk-VFM2KQRM.js";import{d as O,f as _,p as b}from"./chunk-773TIA5M.js";import{e as k,g as v}from"./chunk-VKWPEFWQ.js";v();v();var r=k(H(),1),l=k(re(),1);function se(e,t){return e instanceof Error&&"code"in e&&e.code==="ENOENT"&&"path"in e&&typeof e.path=="string"&&_(e.path)===_(t)}async function F(e,t){try{return await t()}catch(n){throw e!==void 0&&se(n,e)?new P(`Theme Check config file not found: ${e}`):n}}function ce(e){switch(e){case"error":return r.Severity.ERROR;case"suggestion":case"warning":return r.Severity.WARNING;case"style":case"info":return r.Severity.INFO;case"crash":return}}function W(e){switch(e){case r.Severity.ERROR:return"error";case r.Severity.WARNING:return"warning";case r.Severity.INFO:return"info"}}function ae(e){return new Map(e.map(t=>[t.uri,t.source]))}function ue(e,t,n){let o=e.split(`
|
|
2
|
+
`).slice(t,n+1),s=o.length===1;return o.map((c,a)=>{let u=t+a+1,m=s?c.trim():c;return`${u} ${m}`}).join(`
|
|
3
|
+
`)}function fe(e){switch(e){case r.Severity.ERROR:return{error:`
|
|
4
|
+
[error]:`};case r.Severity.WARNING:return{warn:`
|
|
5
|
+
[warning]:`};case r.Severity.INFO:return{info:`
|
|
6
|
+
[info]:`}}}function he(e,t){return e.map((i,o)=>{let{message:s,uri:c,start:a,end:u,check:m,severity:d}=i,f=t.get(c),x=f===void 0?[]:[`
|
|
7
|
+
|
|
8
|
+
${ue(f,a.line,u.line)}`],S=o===e.length-1?"":`
|
|
9
|
+
|
|
10
|
+
`;return[fe(d),{bold:m},{subdued:`
|
|
11
|
+
${s}`},...x,S]}).flat()}var de=(e,t)=>e.severity-t.severity;function q(e){let t=e.reduce((n,i)=>{let{uri:o}=i,s=r.path.fsPath(o);return n[s]??=[],n[s].push(i),n},{});return Object.keys(t).reduce((n,i)=>(n[i]=t[i].sort(de),n),{})}function B(e){return e.reduce((t,n)=>(!Object.prototype.hasOwnProperty.call(t,n.severity)&&(t[n.severity]=0),t[n.severity]++,t),{})}function M(e,t,n){let i=[`${n.length} files inspected`];if(e.length===0)i.push("with no offenses found.");else{i.push(`with ${e.length} total offenses found across ${Object.keys(t).length} files.`);let o=B(e);o[r.Severity.ERROR]&&i.push(`
|
|
12
|
+
${o[r.Severity.ERROR]} errors.`),o[r.Severity.WARNING]&&i.push(`
|
|
13
|
+
${o[r.Severity.WARNING]} warnings.`),o[r.Severity.INFO]&&i.push(`
|
|
14
|
+
${o[r.Severity.INFO]} info issues.`)}return i}function D(e,t,n,i){let o=ae(n);Object.keys(e).sort().forEach(c=>{let a=c.replace(t,"").slice(1);w({headline:i?`[${i}] ${a}`:a,body:he(e[c],o)})})}function J(e,t){return Object.entries(e).map(([n,i])=>{let o=i.map(c=>({check:c.check,severity:W(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=B(i);return{environment:t,path:n,offenses:o,errorCount:s[r.Severity.ERROR]??0,warningCount:s[r.Severity.WARNING]??0,infoCount:s[r.Severity.INFO]??0}})}function V(e,t){t||process.exit(0);let n=ce(t),i=n!==void 0&&e.some(o=>o.severity<=n);process.exit(i?1:0)}function me(e){return e.split(`
|
|
15
|
+
`).map(t=>`# ${t}`).join(`
|
|
16
|
+
`)}async function z(e){let t=".theme-check.yml",n=O(e,t);if(await N(n)){$(`${t} already exists at ${e}`);return}let{settings:i}=await(0,r.loadConfig)(void 0,e),o=me(l.default.stringify(i)),s=l.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await T(n,`${s}${o}`),G(`Created ${t} at ${e}`)}var pe=async(e,t)=>{let n=(0,r.applyFixToString)(e.source,t),i=r.path.fsPath(e.uri);await T(i,n)};async function K(e,t){await(0,r.autofix)(e,t,pe)}async function Q(e,t,n){let{ignore:i,settings:o,rootUri:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c={extends:[],ignore:I(i??[]),rootUri:s,...o},a=n?{[n]:c}:c;p(l.default.stringify(a))}async function X(e,t,n){let{settings:i,ignore:o,checks:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c=I(o??[]),u=Object.keys(i).reduce((d,f)=>{let{severity:x,enabled:S,...ee}=i[f];if(!S)return d;let te=W(x??r.Severity.INFO),g=s.find(ie=>ie.meta.code===f),ne=g&&g.meta?{description:g.meta.docs.description,doc:g.meta.docs.url}:{};return d[f]={severity:te,...ne,ignored_patterns:`[${c.join(", ")}]`,...ee},d},{}),m=n?{[n]:u}:u;p(l.default.stringify(m))}function Z(e){return"_handle"in e&&typeof e._handle=="object"&&e._handle!==null&&typeof e._handle.setBlocking=="function"}var h=k(oe(),1);var y=k(H(),1);var R=class extends Y{static summary="Validate the theme.";static descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";static description=this.descriptionWithoutMarkdown();static flags={...U,path:C.path,"auto-correct":h.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:h.Flags.string({char:"C",required:!1,description:`Use the config provided, overriding .theme-check.yml if present
|
|
17
|
+
Supports all theme-check: config values, e.g., theme-check:theme-app-extension,
|
|
18
|
+
theme-check:recommended, theme-check:all
|
|
19
|
+
For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":h.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:h.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:h.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:h.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:h.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:h.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:C.environment};static multiEnvironmentsFlags=["path"];async command(t,n,i){let o=t.path,s=t.environment?.[0],a=t.config?.startsWith(":")&&y.LegacyIdentifiers.has(t.config.slice(1))?y.LegacyIdentifiers.get(t.config.slice(1)):t.config;if(t.init){await z(o);return}if(t.version){let d=await A(O("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:b(import.meta.url)}),f="unknown";d&&(f=await L(d)??"unknown"),p(f);return}if(t.print){await Q(o,a,s);return}if(t.list){await X(o,a,s);return}let{offenses:u,theme:m}=await le(o,t.output,a,s);if(t["auto-correct"]&&await K(m,u),!i)return V(u,t["fail-level"])}};async function le(e,t,n,i){let{offenses:o,theme:s}=await F(n,()=>(0,y.themeCheckRun)(e,n,a=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&j(a)})),c=q(o);if(t==="text"&&(D(c,e,s,i),(o.length?w:E)({headline:i?`[${i}] Theme Check Summary.`:"Theme Check Summary.",body:M(o,c,s)})),t==="json"){let a=process.stdout;Z(a)&&a._handle.setBlocking(!0),p(JSON.stringify(J(c,i)))}return{offenses:o,theme:s}}export{R as a,le as b};
|