@shopify/cli 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/analytics-5TEIW43T.js +1 -0
- package/dist/analytics-GG7CYCGL.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-MBAFWQSZ.js → chunk-2AJ5FI2K.js} +1 -1
- package/dist/{chunk-SRCQVUMC.js → chunk-2GK56X53.js} +1 -1
- package/dist/{chunk-3F6NZK7S.js → chunk-3D4JXJPS.js} +1 -1
- package/dist/{chunk-YI232QLS.js → chunk-3NBK56IK.js} +1 -1
- package/dist/{chunk-HUZUORYM.js → chunk-4DCQNGUV.js} +1 -1
- package/dist/{chunk-6TZAAS5H.js → chunk-4IC626OL.js} +1 -1
- package/dist/{chunk-SBEZBZM7.js → chunk-54CAKCYR.js} +2 -2
- package/dist/{chunk-VWYM4OWK.js → chunk-5UHQVR2Z.js} +1 -1
- package/dist/{chunk-D6JARNEH.js → chunk-5WVAHE5E.js} +1 -1
- package/dist/{chunk-Y5JKV2AI.js → chunk-67MH4AXG.js} +1 -1
- package/dist/{chunk-3DQIVE24.js → chunk-6CYMJ76C.js} +1 -1
- package/dist/chunk-6G6TMKXF.js +28 -0
- package/dist/{chunk-MQNYGGAM.js → chunk-6ITDI2SD.js} +1 -1
- package/dist/{chunk-WZBSLU4Q.js → chunk-6RE2SNCU.js} +1 -1
- package/dist/{chunk-KL5Z3T6L.js → chunk-6SF3ZETE.js} +1 -1
- package/dist/chunk-6WL4GA2M.js +15 -0
- package/dist/{chunk-DU4WR4OP.js → chunk-76R52ODR.js} +1 -1
- package/dist/{chunk-DJQVNH7P.js → chunk-7ESSIN27.js} +1 -1
- package/dist/{chunk-UGDBJTLP.js → chunk-7NH7CHVI.js} +1 -1
- package/dist/{chunk-ELYP4KFP.js → chunk-7QIOUDCX.js} +1 -1
- package/dist/{chunk-GD7FWXJ5.js → chunk-7ZT57XT7.js} +1 -1
- package/dist/{chunk-RF2DPBA6.js → chunk-AGNMOFJS.js} +1 -1
- package/dist/{chunk-WXVZJJOR.js → chunk-BS3BKORT.js} +1 -1
- package/dist/{chunk-K5YV6UVF.js → chunk-C2IK2HY3.js} +1 -1
- package/dist/{chunk-22PCRFG4.js → chunk-C7BTJ32Z.js} +1 -1
- package/dist/{chunk-RFG5RMPL.js → chunk-CBXSPL4W.js} +1 -1
- package/dist/{chunk-B2IVY4V5.js → chunk-CEIQFLCN.js} +1 -1
- package/dist/{chunk-XBXMPFXM.js → chunk-DCPBRWVC.js} +1 -1
- package/dist/{chunk-26D72ZNV.js → chunk-DN2IE3VY.js} +1 -1
- package/dist/{chunk-Q7ING5F5.js → chunk-DRFGABEB.js} +1 -1
- package/dist/{chunk-DJONKJSZ.js → chunk-E3EMHAJB.js} +1 -1
- package/dist/{chunk-TQYMC7TH.js → chunk-EKXY5COY.js} +1 -1
- package/dist/{chunk-4G7J6HIV.js → chunk-EQU4MUQJ.js} +1 -1
- package/dist/chunk-F2QU6WWX.js +1 -0
- package/dist/{chunk-AIV5RI3X.js → chunk-FKMC5OFF.js} +1 -1
- package/dist/{chunk-XLELNRFF.js → chunk-FQWB2F75.js} +1 -1
- package/dist/{chunk-JHPRFW5B.js → chunk-FYFNUDOC.js} +1 -1
- package/dist/chunk-G4BPGWJC.js +1 -0
- package/dist/{chunk-KNVM7N3U.js → chunk-GVQIPEZT.js} +1 -1
- package/dist/{chunk-66RJ5T7A.js → chunk-GZS44BUW.js} +61 -61
- package/dist/{chunk-J3KVONB3.js → chunk-HIBX234C.js} +1 -1
- package/dist/{chunk-OHY4ZL3U.js → chunk-HRUGYZZ4.js} +1 -1
- package/dist/{chunk-ZV6NCNI4.js → chunk-HUIJMGVJ.js} +1 -1
- package/dist/{chunk-ALKTLKQ6.js → chunk-IZ3C5J7G.js} +1 -1
- package/dist/{chunk-RVNMVBPM.js → chunk-JAO53IH2.js} +1 -1
- package/dist/chunk-JCL2RRU6.js +1 -0
- package/dist/{chunk-74HYYXXE.js → chunk-JQJBBXMX.js} +1 -1
- package/dist/{chunk-HSK7YMRE.js → chunk-JXW374CL.js} +1 -1
- package/dist/{chunk-KWJ562F2.js → chunk-K6CTUBFC.js} +1 -1
- package/dist/{chunk-A74GETYC.js → chunk-KHSYW7I4.js} +1 -1
- package/dist/{chunk-LX3ZOW52.js → chunk-KHTV6PBV.js} +1 -1
- package/dist/{chunk-TFSBQ4RY.js → chunk-KKTW6ZCA.js} +1 -1
- package/dist/{chunk-JGXWQULI.js → chunk-KN3WTTHZ.js} +1 -1
- package/dist/{chunk-R466TU3N.js → chunk-KR6QDE7D.js} +1 -1
- package/dist/{chunk-GFJ7UV74.js → chunk-KZOBF55B.js} +1 -1
- package/dist/{chunk-LAZJ47DZ.js → chunk-L2MGAEV3.js} +2 -2
- package/dist/{chunk-JVIKCGDY.js → chunk-M2D7USAX.js} +1 -1
- package/dist/{chunk-INEU4XKS.js → chunk-M2ZHFKPN.js} +1 -1
- package/dist/{chunk-LXFJDCNG.js → chunk-M3RYUB22.js} +1 -1
- package/dist/{chunk-JPGO36XP.js → chunk-M56NDIMD.js} +1 -1
- package/dist/{chunk-GNPS5SBU.js → chunk-MCVRONUY.js} +1 -1
- package/dist/{chunk-4HHXSMD7.js → chunk-MHWV5RQV.js} +1 -1
- package/dist/{chunk-LW7U753G.js → chunk-MWGBTOO3.js} +1 -1
- package/dist/{chunk-JLBH7RCF.js → chunk-MWY3A7O3.js} +1 -1
- package/dist/{chunk-GFEAKSGV.js → chunk-N5PQPIBF.js} +40 -40
- package/dist/{chunk-2APPXD5Z.js → chunk-NMBBTTIH.js} +1 -1
- package/dist/{chunk-VY6SNDKW.js → chunk-NPEVESCV.js} +1 -1
- package/dist/{chunk-V2CNCPIE.js → chunk-OBEWZXOQ.js} +1 -1
- package/dist/{chunk-6BMMB2UO.js → chunk-OTY24J2W.js} +1 -1
- package/dist/{chunk-2VQJQ36C.js → chunk-OY3PNHPZ.js} +1 -1
- package/dist/{chunk-VS3T5YOG.js → chunk-PAP22IQO.js} +2 -2
- package/dist/{chunk-LALIKZPS.js → chunk-PYVAWAUO.js} +1 -1
- package/dist/{chunk-LNHLDRC5.js → chunk-Q33IBIVJ.js} +1 -1
- package/dist/chunk-Q4T2T2QE.js +15 -0
- package/dist/{chunk-NRAFVIU3.js → chunk-QA23HIH4.js} +1 -1
- package/dist/{chunk-52GC6XUT.js → chunk-QBSKKQBN.js} +1 -1
- package/dist/{chunk-KGXQS7LS.js → chunk-S6EJHWJL.js} +1 -1
- package/dist/{chunk-P5VVOLGV.js → chunk-SIMFNECG.js} +1 -1
- package/dist/{chunk-YMWHHINU.js → chunk-SXTMSGUE.js} +1 -1
- package/dist/{chunk-IOLVEXM6.js → chunk-T542UQBY.js} +1 -1
- package/dist/{chunk-QRRNOVJ3.js → chunk-TQ6HYDVC.js} +1 -1
- package/dist/chunk-TYZXGSHO.js +3 -0
- package/dist/{chunk-IIIVWD4R.js → chunk-UHJYPEY2.js} +1 -1
- package/dist/{chunk-KBQ4LGFB.js → chunk-UJVH7FZS.js} +1 -1
- package/dist/{chunk-6B53BWJW.js → chunk-UJXUSRQK.js} +1 -1
- package/dist/{chunk-OXPWCC7I.js → chunk-ULFWK45W.js} +1 -1
- package/dist/chunk-ULQG3XQS.js +1 -0
- package/dist/{chunk-RM5SJJN6.js → chunk-URZPVSJZ.js} +1 -1
- package/dist/{chunk-UGXYQ23Y.js → chunk-UXVZ2P63.js} +1 -1
- package/dist/{chunk-72F3YBNA.js → chunk-UYXEA3Y6.js} +1 -1
- package/dist/{chunk-OUOYKNMY.js → chunk-VICYNG2W.js} +1 -1
- package/dist/{chunk-IASVAERO.js → chunk-WSDN25F5.js} +1 -1
- package/dist/{chunk-DFMQWJQ3.js → chunk-XITQULK4.js} +1 -1
- package/dist/{chunk-B2EHO7ZC.js → chunk-XONFGLJQ.js} +4 -4
- package/dist/{chunk-YZDDTYTU.js → chunk-XOTA6JTZ.js} +3 -3
- package/dist/{chunk-323UTVMM.js → chunk-XR6GMMEU.js} +1 -1
- package/dist/{chunk-XNO6DZYP.js → chunk-XULPJ6UG.js} +1 -1
- package/dist/{chunk-3LVGAQB4.js → chunk-XXVEHDVO.js} +1 -1
- package/dist/chunk-Y7JGYGV7.js +1 -0
- package/dist/chunk-YTNDFQJT.js +3 -0
- package/dist/{chunk-N5YIPQ6J.js → chunk-ZBRRJDGW.js} +1 -1
- package/dist/{chunk-ELVFJ7BR.js → chunk-ZGK3LGCH.js} +1 -1
- package/dist/{chunk-GOJ2QHSR.js → chunk-ZSBA6VIC.js} +1 -1
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +9 -9
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/docs/generate.d.ts +0 -8
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-U5ZITKJN.js → conf-store-BMZFATRQ.js} +1 -1
- package/dist/{deprecations-TU5UQJVV.js → deprecations-7LHRXPXU.js} +1 -1
- package/dist/dist-LDXPBYSZ.js +1 -0
- package/dist/dist-V63ILV6L.js +1 -0
- package/dist/{environments-Z5PR7DSI.js → environments-5X7S2O5U.js} +1 -1
- package/dist/{error-IJGNYKZ3.js → error-ZRLNNGIQ.js} +1 -1
- package/dist/error-handler-PRZFHPRG.js +1 -0
- package/dist/{fs-5BDEA2KD.js → fs-H7V6IRSH.js} +1 -1
- package/dist/hooks/app-init.js +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/index.js +165 -165
- package/dist/is-global-IOWPCT2U.js +1 -0
- package/dist/local-MTKXSZ3I.js +1 -0
- package/dist/{local-storage-JLXBZVWO.js → local-storage-CYEL4MXF.js} +1 -1
- package/dist/{metadata-UDMOTRS7.js → metadata-NOVBMKLM.js} +1 -1
- package/dist/{node-package-manager-HAFRYGUM.js → node-package-manager-N5CVNHA3.js} +1 -1
- package/dist/notifications-system-YX2GPLDW.js +1 -0
- package/dist/{output-YGMHXEIS.js → output-Q46DT46U.js} +1 -1
- package/dist/{system-KLXD4FXF.js → system-E6Q3OBX3.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-GHG3UGB3.js → ui-WRS2IDPP.js} +1 -1
- package/dist/upgrade-TKUN2M5P.js +1 -0
- package/dist/{version-D5PJZIRW.js → version-5W5RVAPA.js} +1 -1
- package/dist/version-BQJ3FPXD.js +1 -0
- package/dist/{workerd-L2EJKIAQ.js → workerd-GOK6GWEX.js} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
- package/dist/analytics-6IHHYAV6.js +0 -1
- package/dist/analytics-KKVP5DT3.js +0 -1
- package/dist/chunk-2I4PRX2I.js +0 -1
- package/dist/chunk-7BGM2GAH.js +0 -1
- package/dist/chunk-BDVAE5MS.js +0 -28
- package/dist/chunk-D3TSJA5S.js +0 -1
- package/dist/chunk-N7RBSKYT.js +0 -1
- package/dist/chunk-ODNGDO4H.js +0 -50
- package/dist/chunk-P7R7FBY2.js +0 -3
- package/dist/chunk-SGQ6D3LU.js +0 -15
- package/dist/chunk-YC6G4MHD.js +0 -3
- package/dist/chunk-ZVJVDCIM.js +0 -1
- package/dist/dist-2Z5TND4U.js +0 -1
- package/dist/dist-GYHFDHKP.js +0 -1
- package/dist/error-handler-WSCGNS2P.js +0 -1
- package/dist/is-global-V4ZRHQG2.js +0 -1
- package/dist/local-6QPX4GCJ.js +0 -1
- package/dist/notifications-system-MP7WDOCS.js +0 -1
- package/dist/upgrade-OPZGPM5J.js +0 -1
- package/dist/version-KRQBMYCH.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as h}from"./chunk-
|
|
1
|
+
import{d as h}from"./chunk-M56NDIMD.js";import{Gb as V,Ib as T,Qb as $,Ta as N,ma as w}from"./chunk-N5PQPIBF.js";import{a as d,c as b,e as K,g as v}from"./chunk-VPRTJUIN.js";var O=b((H,L)=>{L.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var j=b((z,p)=>{v();var m=d("fs"),y=d("path"),Y=d("os"),R=d("crypto"),F=O(),_=F.version,P=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
2
2
|
`);let s;for(;(s=P.exec(r))!=null;){let a=s[1],t=s[2]||"";t=t.trim();let o=t[0];t=t.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(t=t.replace(/\\n/g,`
|
|
3
3
|
`),t=t.replace(/\\r/g,"\r")),n[a]=t}return n}function U(e){let n=A(e),r=c.configDotenv({path:n});if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw o.code="MISSING_DATA",o}let s=k(e).split(","),a=s.length,t;for(let o=0;o<a;o++)try{let i=s[o].trim(),l=q(r,i);t=c.decrypt(l.ciphertext,l.key);break}catch(i){if(o+1>=a)throw i}return c.parse(t)}function C(e){console.log(`[dotenv@${_}][INFO] ${e}`)}function M(e){console.log(`[dotenv@${_}][WARN] ${e}`)}function g(e){console.log(`[dotenv@${_}][DEBUG] ${e}`)}function k(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function q(e,n){let r;try{r=new URL(n)}catch(i){if(i.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw i}let s=r.password;if(!s){let i=new Error("INVALID_DOTENV_KEY: Missing key part");throw i.code="INVALID_DOTENV_KEY",i}let a=r.searchParams.get("environment");if(!a){let i=new Error("INVALID_DOTENV_KEY: Missing environment part");throw i.code="INVALID_DOTENV_KEY",i}let t=`DOTENV_VAULT_${a.toUpperCase()}`,o=e.parsed[t];if(!o){let i=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${t} in your .env.vault file.`);throw i.code="NOT_FOUND_DOTENV_ENVIRONMENT",i}return{ciphertext:o,key:s}}function A(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)m.existsSync(r)&&(n=r.endsWith(".vault")?r:`${r}.vault`);else n=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else n=y.resolve(process.cwd(),".env.vault");return m.existsSync(n)?n:null}function I(e){return e[0]==="~"?y.join(Y.homedir(),e.slice(1)):e}function B(e){C("Loading env from encrypted .env.vault");let n=c._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),c.populate(r,n,e),{parsed:n}}function W(e){let n=y.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug);e&&e.encoding?r=e.encoding:s&&g("No encoding is specified. UTF-8 is used by default");let a=[n];if(e&&e.path)if(!Array.isArray(e.path))a=[I(e.path)];else{a=[];for(let l of e.path)a.push(I(l))}let t,o={};for(let l of a)try{let u=c.parse(m.readFileSync(l,{encoding:r}));c.populate(o,u,e)}catch(u){s&&g(`Failed to load ${l} ${u.message}`),t=u}let i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),c.populate(i,o,e),t?{parsed:o,error:t}:{parsed:o}}function G(e){if(k(e).length===0)return c.configDotenv(e);let n=A(e);return n?c._configVault(e):(M(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),c.configDotenv(e))}function J(e,n){let r=Buffer.from(n.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.subarray(0,12),t=s.subarray(-16);s=s.subarray(12,-16);try{let o=R.createDecipheriv("aes-256-gcm",r,a);return o.setAuthTag(t),`${o.update(s)}${o.final()}`}catch(o){let i=o instanceof RangeError,l=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||l){let f=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw f.code="INVALID_DOTENV_KEY",f}else if(u){let f=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw f.code="DECRYPTION_FAILED",f}else throw o}}function Q(e,n,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof n!="object"){let t=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let t of Object.keys(n))Object.prototype.hasOwnProperty.call(e,t)?(a===!0&&(e[t]=n[t]),s&&g(a===!0?`"${t}" is already defined and WAS overwritten`:`"${t}" is already defined and was NOT overwritten`)):e[t]=n[t]}var c={configDotenv:W,_configVault:B,_parseVault:U,config:G,decrypt:J,parse:S,populate:Q};p.exports.configDotenv=c.configDotenv;p.exports._configVault=c._configVault;p.exports._parseVault=c._parseVault;p.exports.config=c.config;p.exports.decrypt=c.decrypt;p.exports.parse=c.parse;p.exports.populate=c.populate;p.exports=c});v();var x=K(j());async function re(e){if($(T`Reading the .env file at ${V.path(e)}`),!await N(e))throw new h(`The environment file at ${e} does not exist.`);let n=await w(e);return{path:e,variables:(0,x.parse)(n)}}function oe(e,n){let r=[],s=e===null?[]:e.split(`
|
|
4
4
|
`),a=[],t;for(let o of s){if(t){if(o.endsWith(t.quote)){let u=E(t.key,t.value+o.slice(0,-1),t.quote),f=n[t.key];f&&(a.push(t.key),u=E(t.key,f)),r.push(u),t=void 0}else t.value+=`${o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k,b as N,c as w}from"./chunk-
|
|
1
|
+
import{a as k,b as N,c as w}from"./chunk-UYXEA3Y6.js";import{n as F}from"./chunk-XONFGLJQ.js";import{a as T,b as D}from"./chunk-XULPJ6UG.js";import{O as A,P,a as O}from"./chunk-6G6TMKXF.js";import{g as b}from"./chunk-M56NDIMD.js";import{Ia as _,La as U,Pa as I,Qb as u,Ua as p,xa as x,za as y}from"./chunk-N5PQPIBF.js";import{f as h}from"./chunk-YTNDFQJT.js";import{d as m,i as l,j as S}from"./chunk-IU2ZQ6TE.js";import{g as f}from"./chunk-VPRTJUIN.js";f();f();import{fileURLToPath as M}from"url";import Y from"util";import{pipeline as j}from"stream";import{execSync as q,execFileSync as z}from"child_process";var v="2024.8.2",B=`https://github.com/cloudflare/cloudflared/releases/download/${v}/`,W={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},G={arm64:"cloudflared-darwin-arm64.tgz",x64:"cloudflared-darwin-amd64.tgz"},V={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-amd64.exe"},$={linux:W,darwin:G,win32:V};function X(e=process.platform,t=process.arch){if(!Object.keys($).includes(e))throw new Error(`Unsupported system platform: ${e}`);let n=$[e][t];if(n===void 0)throw new Error(`Unsupported system arch: ${t}`);return B+n}function Z(e=process.env,t=process.platform){return e.SHOPIFY_CLI_CLOUDFLARED_PATH?e.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(M(import.meta.url)),"..","bin",t==="win32"?"cloudflared.exe":"cloudflared")}async function g(e=process.env,t=process.platform,r=process.arch){if(e.SHOPIFY_CLI_IGNORE_CLOUDFLARED){u("Skipping cloudflared installation because SHOPIFY_CLI_IGNORE_CLOUDFLARED is set");return}let n=X(t,r),o=Z(e,t);if(p(o))try{let a=z(o,["--version"],{encoding:"utf8"}).split(" "),i=a.length>2?a[2]:"0.0.0";if(!J(v,i)){u("cloudflared already installed, skipping");return}}catch{u("version check failed, reinstalling")}if(t==="linux")await K(n,o);else if(t==="darwin")await tt(n,o);else if(t==="win32")await Q(n,o);else throw new Error(`Unsupported platform: ${t}`)}function J(e,t){let[r,n,o]=e.split(".").map(Number),[a,i,c]=t.split(".").map(Number);return r!==a?(r??0)>(a??0):n!==i?(n??0)>(i??0):(o??0)>(c??0)}async function K(e,t){await C(e,t),await I(t,"755")}async function Q(e,t){await C(e,t)}async function tt(e,t){await C(e,`${t}.tgz`);let r=S(`${t}.tgz`);q(`tar -xzf ${r}`,{cwd:l(t)}),_(`${t}.tgz`),await y(`${l(t)}/cloudflared`,t)}async function C(e,t){p(l(t))||x(l(t));let r=Y.promisify(j),n=await F(e,{redirect:"follow"},"slow-request");if(!n.ok||!n.body)throw new Error(`Couldn't download file ${e} (${n.status} ${n.statusText})`);let o=U(t);return await r(n.body,o),t}import{Writable as et}from"stream";import{fileURLToPath as rt}from"url";var kt=N({provider:w,action:st}),nt=h()?.2:40,ot=5;async function st(e){try{let t=new R(e);return await t.startTunnel(),T(t)}catch(t){let r=new k("unknown",t.message);return D(r)}}var R=class{constructor(t){this.provider=w,this.currentStatus={status:"not-started"},this.abortController=void 0,this.port=t}async startTunnel(){try{await g(),this.tunnel()}catch(t){this.currentStatus={status:"error",message:t.message,tryMessage:d()}}}getTunnelStatus(){return this.currentStatus}stopTunnel(){this.abortController?.abort()}tunnel(t=0){this.abortController=new O;let r=!1;if(t>=ot){r=!0,this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: max retries reached.",tryMessage:d()};return}let n=["tunnel","--url",`http://localhost:${this.port}`,"--no-autoupdate"],o=[],a=!1,i;this.currentStatus={status:"starting"},setTimeout(()=>{if(!r){r=!0;let s=[...new Set(o)].slice(-5).join(`
|
|
2
2
|
`);s===""?this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: unknown error.",tryMessage:d()}:this.currentStatus={status:"error",message:s,tryMessage:d()},this.abortController?.abort()}},nt*1e3);let c=this,E=new et({write(s,ft,H){if(u(s.toString()),r)return;i??(i=it(s)),ut(s)&&(a=!0),a&&(i?(r=!0,c.currentStatus={status:"connected",url:i}):c.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: URL not found."});let L=at(s);L&&o.push(L),H()}});A(ct(),n,{stdout:E,stderr:E,signal:this.abortController.signal,externalErrorHandler:async s=>{if(r)throw new b(`Could not start Cloudflare tunnel: process crashed after stablishing a connection: ${s.message}`,d());u(`Cloudflare tunnel crashed: ${s.message}, restarting...`),h()||await P(1),this.tunnel(t+1)}})}};function d(){return["You can run the command again, or try networking with Shopify via",{command:"--use-localhost"},"or",{command:"--tunnel-url <custom tunnel>"},".",{link:{label:"See documentation for details.",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options"}}]}function it(e){let t=new RegExp(`(https:\\/\\/[^\\s]+\\.${dt()})`),r=e.toString().match(t)??void 0;return r&&r[1]}function at(e){if([/failed to request quick Tunnel/,/failed to unmarshal quick Tunnel/,/failed to parse quick Tunnel ID/,/failed to provision routing/,/ERR Couldn't start tunnel/,/ERR Failed to serve quic connection/,/ERR Failed to create new quic connection error/].some(n=>n.test(e.toString())))return`Could not start Cloudflare tunnel: ${lt(e.toString())}`}function lt(e){let t=/^[0-9TZ:-]+ (ERR )?/g,r=/connIndex.*/g;return e.replace(t,"").replace(r,"")}function ut(e){let t=e.toString().match(/(INF Registered tunnel connection|INF Connection)/)??void 0;return t&&t[0]}function ct(){return process.env.SHOPIFY_CLI_CLOUDFLARED_PATH?process.env.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(rt(import.meta.url)),"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared")}function dt(){return process.env.SHOPIFY_CLI_CLOUDFLARED_DOMAIN??"trycloudflare.com"}export{kt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as r}from"./chunk-
|
|
1
|
+
import{z as r}from"./chunk-XONFGLJQ.js";import{r as o}from"./chunk-LDGAHMS7.js";import{f as t,q as n}from"./chunk-IU2ZQ6TE.js";import{e as s,g as a}from"./chunk-VPRTJUIN.js";a();var e=s(o(),1);var c={path:e.Flags.string({description:"The path to your app directory.",parse:async i=>t(i),default:async()=>n(),noCacheDefault:!0,env:"SHOPIFY_FLAG_PATH"}),config:e.Flags.string({hidden:!1,char:"c",description:"The name of the app configuration.",env:"SHOPIFY_FLAG_APP_CONFIG"}),"client-id":e.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]}),reset:e.Flags.boolean({hidden:!1,description:"Reset all your settings.",env:"SHOPIFY_FLAG_RESET",default:!1,exclusive:["config"]})},p={query:e.Flags.string({char:"q",description:"The GraphQL query or mutation to run as a bulk operation.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":e.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async i=>t(i),exactlyOne:["query","query-file"]}),variables:e.Flags.string({char:"v",description:"The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",env:"SHOPIFY_FLAG_VARIABLES",multiple:!0,exclusive:["variable-file"]}),"variable-file":e.Flags.string({description:"Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async i=>t(i),exclusive:["variables"]}),store:e.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>r(i)}),watch:e.Flags.boolean({description:"Wait for bulk operation results before exiting. Defaults to false.",env:"SHOPIFY_FLAG_WATCH"}),"output-file":e.Flags.string({description:"The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE",dependsOn:["watch"]}),version:e.Flags.string({description:"The API version to use for the bulk operation. If not specified, uses the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})},h={query:e.Flags.string({char:"q",description:"The GraphQL query or mutation, as a string.",env:"SHOPIFY_FLAG_QUERY",required:!1,exactlyOne:["query","query-file"]}),"query-file":e.Flags.string({description:"Path to a file containing the GraphQL query or mutation. Can't be used with --query.",env:"SHOPIFY_FLAG_QUERY_FILE",parse:async i=>t(i),exactlyOne:["query","query-file"]}),variables:e.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES",exclusive:["variable-file"]}),"variable-file":e.Flags.string({description:"Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",env:"SHOPIFY_FLAG_VARIABLE_FILE",parse:async i=>t(i),exclusive:["variables"]}),store:e.Flags.string({char:"s",description:"The myshopify.com domain of the store to execute against. The app must be installed on the store. If not specified, you will be prompted to select a store.",env:"SHOPIFY_FLAG_STORE",parse:async i=>r(i)}),version:e.Flags.string({description:"The API version to use for the query or mutation. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"}),"output-file":e.Flags.string({description:"The file name where results should be written, instead of STDOUT.",env:"SHOPIFY_FLAG_OUTPUT_FILE"})};export{c as a,p as b,h as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-MHWV5RQV.js";import{b as f}from"./chunk-XOTA6JTZ.js";import{A as S,u as i,y as x}from"./chunk-6G6TMKXF.js";import{d as v}from"./chunk-M56NDIMD.js";import{Qb as I}from"./chunk-N5PQPIBF.js";import{g as a}from"./chunk-VPRTJUIN.js";a();a();a();var m={on:"Autocorrect on. The system will automatically run commands even when you mistype them.",off:"Autocorrect off. You'll need to confirm corrections for mistyped commands."};a();function p(o=W()){return!!o.get("autocorrectEnabled")}function y(o,n=W()){n.set("autocorrectEnabled",o)}function W(){return b??(b=new C({projectName:"did-you-mean"})),b}var b;var A,s=class extends f{async run(){y(!0),i({body:m.on})}};A=s;s.summary="Enable autocorrect. Off by default.";s.descriptionWithMarkdown=`Enable autocorrect. Off by default.
|
|
2
2
|
|
|
3
3
|
When autocorrection is enabled, Shopify CLI automatically runs a corrected version of your command if a correction is available.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as f,e as c}from"./chunk-
|
|
1
|
+
import{b as f,e as c}from"./chunk-7ESSIN27.js";import{d as s}from"./chunk-M56NDIMD.js";import{$ as l,Ta as i,qa as m,wa as p}from"./chunk-N5PQPIBF.js";import{d as o}from"./chunk-IU2ZQ6TE.js";import{g as a}from"./chunk-VPRTJUIN.js";a();async function v(t,r){let n=t?.path??"",e=o(r,n);if(!await i(e))throw new s(`
|
|
2
2
|
The extension is not available for ${t?.value}`);return e}async function P({name:t,app:r}){let n=l(t),e=o(r.directory,c.extensions.directoryName,n);if(await i(e))throw new s(`
|
|
3
3
|
A directory with this name (${n}) already exists.
|
|
4
4
|
Choose a new name for your extension.`);return await p(e),await m(o(e,f.lockFile)),e}async function b({localApp:t,developerPlatformClient:r,apiKey:n,organizationId:e}){let{dashboardManagedExtensionRegistrations:h}=(await r.appExtensionRegistrations({id:n,apiKey:n,organizationId:e})).app;return h.length>0||t.allExtensions.filter(x=>x.isThemeExtension).length>0||t.allExtensions.length>0}export{v as a,P as b,b as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-NMBBTTIH.js";import{Fa as i}from"./chunk-XONFGLJQ.js";import{b as s}from"./chunk-XOTA6JTZ.js";import{r as m}from"./chunk-LDGAHMS7.js";import{e as d,g as e}from"./chunk-VPRTJUIN.js";e();var n=d(m(),1);var t=class c extends s{static{this.description="List current notifications configured for the CLI."}static{this.hidden=!0}static{this.flags={"ignore-errors":n.Flags.boolean({hidden:!1,description:"Don't fail if an error occurs.",env:"SHOPIFY_FLAG_IGNORE_ERRORS"})}}async run(){let{flags:f}=await this.parse(c);try{await a()}catch(r){let o="Error fetching notifications";if(r instanceof Error&&(o=o.concat(`: ${r.message}`)),await i(o,"expected_error"),!f["ignore-errors"])throw r}}};export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as k}from"./chunk-TQYMC7TH.js";import{ua as b,va as c,xa as s}from"./chunk-B2EHO7ZC.js";import{F as _}from"./chunk-BDVAE5MS.js";import{d as N}from"./chunk-JPGO36XP.js";import{Qb as E,T as D}from"./chunk-GFEAKSGV.js";import{g as l}from"./chunk-VPRTJUIN.js";l();var M=/gid:\/\/shopify\/\w*\/(\d+)/,T="development",W="live",Y="unpublished";function Z(e){return e.role===T}async function J(e){let i=await D("creative");return _({message:e,defaultValue:i})}function F(e){return`gid://shopify/OnlineStoreTheme/${e}`}function h(e){let i=M.exec(e);if(i&&i[1]!==void 0)return parseInt(i[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var S;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(S||(S={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:i,name:a,role:n,processing:d,createdAtRuntime:t}=e;return{id:i,name:a,processing:d,createdAtRuntime:t,role:n==="main"?"live":n}}function te(e){if(!e)return;let{key:i,checksum:a,attachment:n,value:d}=e,t={size:(d||n||"").length,mtime:Date.now()};return{key:i,checksum:a,attachment:n,value:d,stats:t}}l();var V={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 w={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 x={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 I={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 A={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 B={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 C={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 P={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 U={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 L={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 q={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 R={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 G={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 $="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",p={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0};async function an(e,i){let a=F(e);s("theme-api:fetch-theme");try{let{theme:n}=await k({query:q,session:i,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(n)return y({id:h(n.id),processing:n.processing,role:n.role.toLowerCase(),name:n.name})}catch(n){c(n),E(`Error fetching theme with ID: ${e}`)}}async function tn(e){let i=[],a=null;for(s("theme-api:fetch-themes");;){let n=await k({query:L,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});n.themes||r("Failed to fetch themes");let{nodes:d,pageInfo:t}=n.themes;if(d.forEach(m=>{let o=y({id:h(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&i.push(o)}),!t.hasNextPage)return i;a=t.endCursor}}async function dn(e,i){s("theme-api:find-development-theme-by-name");let{themes:a}=await k({query:R,session:i,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw c(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:n,processing:d,role:t,name:m}=a.nodes[0];return y({id:h(n),processing:d,role:t.toLowerCase(),name:m})}}async function ln(e,i){let a=e.src??$;s("theme-api:create-theme");let{themeCreate:n}=await k({query:I,session:i,variables:{name:e.name??"",source:a,role:(e.role??T).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:p});n||r("Failed to create theme");let{theme:d,userErrors:t}=n;if(t.length){let m=n.userErrors.map(o=>o.message).join(", ");throw c(new N(m))}return d||r("Failed to create theme"),y({id:h(d.id),name:d.name,role:d.role.toLowerCase()})}async function mn(e,i,a){let n=[],d=null;for(s("theme-api:fetch-assets");;){let t=await k({query:A,session:a,variables:{id:g(e),filenames:i,after:d},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!t.theme?.files?.nodes||!t.theme?.files?.pageInfo){let u=t.theme?.files?.userErrors.map(f=>f.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=t.theme.files;if(n.push(...await Promise.all(m.map(async u=>{let{attachment:f,value:v}=await X(u.body);return{attachment:f,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return n;d=o.endCursor}}async function on(e,i,a){let d=[];s("theme-api:delete-assets");for(let t=0;t<i.length;t+=50){let m=i.slice(t,t+50),{themeFilesDelete:o}=await k({query:P,session:a,variables:{themeId:F(e),files:m},preferredBehaviour:p});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:f}=o;u&&u.forEach(v=>{d.push({key:v.filename,success:!0,operation:S.Delete})}),f.length>0&&f.forEach(v=>{v.filename?(c(`Asset deletion failed for ${v.filename}: ${v.message}`),d.push({key:v.filename,success:!1,operation:S.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return d}async function rn(e,i,a){let n=[];s("theme-api:bulk-upload-assets");for(let d=0;d<i.length;d+=50){let t=i.slice(d,d+50),m=z(t);b("theme-api:upload-files");let o=await H(e,m,a);b("theme-api:upload-files"),n.push(...j(o))}return n}function z(e){return e.map(i=>i.attachment?{filename:i.key,body:{type:"BASE64",value:i.attachment}}:{filename:i.key,body:{type:"TEXT",value:i.value??""}})}async function H(e,i,a){return k({query:C,session:a,variables:{themeId:g(e),files:i},preferredBehaviour:p})}function j(e){let{themeFilesUpsert:i}=e;i||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:n}=i,d=[];return a?.forEach(t=>{d.push({key:t.filename,success:!0,operation:S.Upload})}),n.forEach(t=>{t.filename||r(`Error uploading theme files: ${t.message}`),c(`Asset upload failed for ${t.filename}: ${t.message}`),d.push({key:t.filename,success:!1,operation:S.Upload,errors:{asset:[t.message]}})}),d}async function sn(e,i){let a=[],n=null;for(s("theme-api:fetch-checksums");;){let d=await k({query:B,session:i,variables:{id:g(e),after:n},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!d?.theme?.files?.nodes||!d?.theme?.files?.pageInfo){let o=d.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw c(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:t,pageInfo:m}=d.theme.files;if(a.push(...t.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;n=m.endCursor}}async function kn(e,i,a){let n=i.name,d={};n&&(d.name=n),s("theme-api:update-theme");let{themeUpdate:t}=await k({query:V,session:a,variables:{id:F(e),input:d},preferredBehaviour:p});t||r("Failed to update theme");let{theme:m,userErrors:o}=t;if(o.length){let u=t.userErrors.map(f=>f.message).join(", ");throw c(new N(u))}return m||r("Failed to update theme"),y({id:h(m.id),name:m.name,role:m.role.toLowerCase()})}async function un(e,i){s("theme-api:publish-theme");let{themePublish:a}=await k({query:O,session:i,variables:{id:F(e)},preferredBehaviour:p});a||r("Failed to update theme");let{theme:n,userErrors:d}=a;if(d.length){let t=a.userErrors.map(m=>m.message).join(", ");throw c(new N(t))}return n||r("Failed to update theme"),y({id:h(n.id),name:n.name,role:n.role.toLowerCase()})}async function cn(e,i){s("theme-api:delete-theme");let{themeDelete:a}=await k({query:w,session:i,variables:{id:F(e)},preferredBehaviour:p});a||r("Failed to update theme");let{deletedThemeId:n,userErrors:d}=a;if(d.length){let t=a.userErrors.map(m=>m.message).join(", ");throw c(new N(t))}return n||r("Failed to update theme"),!0}async function pn(e,i,a){let n;s("theme-api:duplicate-theme");let{themeDuplicate:d}=await k({query:x,session:a,variables:{id:F(e),name:i},preferredBehaviour:p,responseOptions:{onResponse:u=>{n=u.headers.get("x-request-id")??void 0}}});if(!d)return c("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:n};let{newTheme:t,userErrors:m}=d;return m.length>0?{theme:void 0,userErrors:m,requestId:n}:t?{theme:y({id:h(t.id),name:t.name,role:t.role.toLowerCase()}),userErrors:[],requestId:n}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:n}}async function vn(e,i){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await k({query:U,session:i,variables:{ownerType:e}});return a.nodes.map(n=>({key:n.key,namespace:n.namespace,name:n.name,description:n.description,type:{name:n.type.name,category:n.type.category}}))}async function Nn(e){s("theme-api:check-password-protection");let{onlineStore:i}=await k({query:G,session:e});i||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=i;return a.enabled}function r(e){throw c(new N(e))}function g(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function X(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 c(new N(`Error downloading content from URL: ${e.url}`))}}}export{te as a,T as b,W as c,Y as d,Z as e,J as f,an as g,tn as h,dn as i,ln as j,mn as k,on as l,rn as m,sn as n,kn as o,un as p,cn as q,pn as r,vn as s,Nn as t};
|
|
1
|
+
import{b as k}from"./chunk-EKXY5COY.js";import{ua as b,va as c,xa as s}from"./chunk-XONFGLJQ.js";import{F as _}from"./chunk-6G6TMKXF.js";import{d as N}from"./chunk-M56NDIMD.js";import{Qb as E,T as D}from"./chunk-N5PQPIBF.js";import{g as l}from"./chunk-VPRTJUIN.js";l();var M=/gid:\/\/shopify\/\w*\/(\d+)/,T="development",W="live",Y="unpublished";function Z(e){return e.role===T}async function J(e){let i=await D("creative");return _({message:e,defaultValue:i})}function F(e){return`gid://shopify/OnlineStoreTheme/${e}`}function h(e){let i=M.exec(e);if(i&&i[1]!==void 0)return parseInt(i[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var S;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(S||(S={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:i,name:a,role:n,processing:d,createdAtRuntime:t}=e;return{id:i,name:a,processing:d,createdAtRuntime:t,role:n==="main"?"live":n}}function te(e){if(!e)return;let{key:i,checksum:a,attachment:n,value:d}=e,t={size:(d||n||"").length,mtime:Date.now()};return{key:i,checksum:a,attachment:n,value:d,stats:t}}l();var V={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 w={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 x={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 I={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 A={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 B={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 C={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 P={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 U={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 L={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 q={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 R={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 G={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 $="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",p={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0};async function an(e,i){let a=F(e);s("theme-api:fetch-theme");try{let{theme:n}=await k({query:q,session:i,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(n)return y({id:h(n.id),processing:n.processing,role:n.role.toLowerCase(),name:n.name})}catch(n){c(n),E(`Error fetching theme with ID: ${e}`)}}async function tn(e){let i=[],a=null;for(s("theme-api:fetch-themes");;){let n=await k({query:L,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});n.themes||r("Failed to fetch themes");let{nodes:d,pageInfo:t}=n.themes;if(d.forEach(m=>{let o=y({id:h(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&i.push(o)}),!t.hasNextPage)return i;a=t.endCursor}}async function dn(e,i){s("theme-api:find-development-theme-by-name");let{themes:a}=await k({query:R,session:i,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw c(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:n,processing:d,role:t,name:m}=a.nodes[0];return y({id:h(n),processing:d,role:t.toLowerCase(),name:m})}}async function ln(e,i){let a=e.src??$;s("theme-api:create-theme");let{themeCreate:n}=await k({query:I,session:i,variables:{name:e.name??"",source:a,role:(e.role??T).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:p});n||r("Failed to create theme");let{theme:d,userErrors:t}=n;if(t.length){let m=n.userErrors.map(o=>o.message).join(", ");throw c(new N(m))}return d||r("Failed to create theme"),y({id:h(d.id),name:d.name,role:d.role.toLowerCase()})}async function mn(e,i,a){let n=[],d=null;for(s("theme-api:fetch-assets");;){let t=await k({query:A,session:a,variables:{id:g(e),filenames:i,after:d},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!t.theme?.files?.nodes||!t.theme?.files?.pageInfo){let u=t.theme?.files?.userErrors.map(f=>f.filename).join(", ");r(`Error fetching assets: ${u}`)}let{nodes:m,pageInfo:o}=t.theme.files;if(n.push(...await Promise.all(m.map(async u=>{let{attachment:f,value:v}=await X(u.body);return{attachment:f,key:u.filename,checksum:u.checksumMd5,value:v}}))),!o.hasNextPage)return n;d=o.endCursor}}async function on(e,i,a){let d=[];s("theme-api:delete-assets");for(let t=0;t<i.length;t+=50){let m=i.slice(t,t+50),{themeFilesDelete:o}=await k({query:P,session:a,variables:{themeId:F(e),files:m},preferredBehaviour:p});o||r("Failed to delete theme assets");let{deletedThemeFiles:u,userErrors:f}=o;u&&u.forEach(v=>{d.push({key:v.filename,success:!0,operation:S.Delete})}),f.length>0&&f.forEach(v=>{v.filename?(c(`Asset deletion failed for ${v.filename}: ${v.message}`),d.push({key:v.filename,success:!1,operation:S.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return d}async function rn(e,i,a){let n=[];s("theme-api:bulk-upload-assets");for(let d=0;d<i.length;d+=50){let t=i.slice(d,d+50),m=z(t);b("theme-api:upload-files");let o=await H(e,m,a);b("theme-api:upload-files"),n.push(...j(o))}return n}function z(e){return e.map(i=>i.attachment?{filename:i.key,body:{type:"BASE64",value:i.attachment}}:{filename:i.key,body:{type:"TEXT",value:i.value??""}})}async function H(e,i,a){return k({query:C,session:a,variables:{themeId:g(e),files:i},preferredBehaviour:p})}function j(e){let{themeFilesUpsert:i}=e;i||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:n}=i,d=[];return a?.forEach(t=>{d.push({key:t.filename,success:!0,operation:S.Upload})}),n.forEach(t=>{t.filename||r(`Error uploading theme files: ${t.message}`),c(`Asset upload failed for ${t.filename}: ${t.message}`),d.push({key:t.filename,success:!1,operation:S.Upload,errors:{asset:[t.message]}})}),d}async function sn(e,i){let a=[],n=null;for(s("theme-api:fetch-checksums");;){let d=await k({query:B,session:i,variables:{id:g(e),after:n},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!d?.theme?.files?.nodes||!d?.theme?.files?.pageInfo){let o=d.theme?.files?.userErrors.map(u=>u.filename).join(", ");throw c(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:t,pageInfo:m}=d.theme.files;if(a.push(...t.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;n=m.endCursor}}async function kn(e,i,a){let n=i.name,d={};n&&(d.name=n),s("theme-api:update-theme");let{themeUpdate:t}=await k({query:V,session:a,variables:{id:F(e),input:d},preferredBehaviour:p});t||r("Failed to update theme");let{theme:m,userErrors:o}=t;if(o.length){let u=t.userErrors.map(f=>f.message).join(", ");throw c(new N(u))}return m||r("Failed to update theme"),y({id:h(m.id),name:m.name,role:m.role.toLowerCase()})}async function un(e,i){s("theme-api:publish-theme");let{themePublish:a}=await k({query:O,session:i,variables:{id:F(e)},preferredBehaviour:p});a||r("Failed to update theme");let{theme:n,userErrors:d}=a;if(d.length){let t=a.userErrors.map(m=>m.message).join(", ");throw c(new N(t))}return n||r("Failed to update theme"),y({id:h(n.id),name:n.name,role:n.role.toLowerCase()})}async function cn(e,i){s("theme-api:delete-theme");let{themeDelete:a}=await k({query:w,session:i,variables:{id:F(e)},preferredBehaviour:p});a||r("Failed to update theme");let{deletedThemeId:n,userErrors:d}=a;if(d.length){let t=a.userErrors.map(m=>m.message).join(", ");throw c(new N(t))}return n||r("Failed to update theme"),!0}async function pn(e,i,a){let n;s("theme-api:duplicate-theme");let{themeDuplicate:d}=await k({query:x,session:a,variables:{id:F(e),name:i},preferredBehaviour:p,responseOptions:{onResponse:u=>{n=u.headers.get("x-request-id")??void 0}}});if(!d)return c("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:n};let{newTheme:t,userErrors:m}=d;return m.length>0?{theme:void 0,userErrors:m,requestId:n}:t?{theme:y({id:h(t.id),name:t.name,role:t.role.toLowerCase()}),userErrors:[],requestId:n}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:n}}async function vn(e,i){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await k({query:U,session:i,variables:{ownerType:e}});return a.nodes.map(n=>({key:n.key,namespace:n.namespace,name:n.name,description:n.description,type:{name:n.type.name,category:n.type.category}}))}async function Nn(e){s("theme-api:check-password-protection");let{onlineStore:i}=await k({query:G,session:e});i||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=i;return a.enabled}function r(e){throw c(new N(e))}function g(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function X(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 c(new N(`Error downloading content from URL: ${e.url}`))}}}export{te as a,T as b,W as c,Y as d,Z as e,J as f,an as g,tn as h,dn as i,ln as j,mn as k,on as l,rn as m,sn as n,kn as o,un as p,cn as q,pn as r,vn as s,Nn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n,c as s,d as h}from"./chunk-
|
|
1
|
+
import{b as n,c as s,d as h}from"./chunk-XITQULK4.js";import{a as r}from"./chunk-SXTMSGUE.js";import{d as m}from"./chunk-M56NDIMD.js";import{g as o}from"./chunk-VPRTJUIN.js";o();var p=t=>`Development theme #${t} could not be found. Please create a new development theme.`,d="No development theme ID has been set. Please create a development theme first.",i=class extends r{constructor(e){super(e);this.context="Development";this.themeId=n()}async find(){let e=await this.fetch();if(!e)throw new m(this.themeId?p(this.themeId):d);return e}setTheme(e){s(e)}removeTheme(){h()}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as l,ga as o,ha as h,ia as c,v as s,w as q,z as f}from"./chunk-
|
|
1
|
+
import{f as l,ga as o,ha as h,ia as c,v as s,w as q,z as f}from"./chunk-XONFGLJQ.js";import{b as g}from"./chunk-4LNCYIS3.js";import{b as m}from"./chunk-ZSBA6VIC.js";import{e as i,g as a}from"./chunk-VPRTJUIN.js";a();var y=i(c()),x=new y.default({minTime:150,maxConcurrent:10});async function v(e){let n="App Management",r=`https://${await s()}/app_management/unstable/graphql.json`;return{token:e,api:n,url:r,responseOptions:{onResponse:d}}}var A=e=>l(e),T=async(e,n,t)=>{let u=`https://${await s()}/app_management/unstable/organizations/${e}/app_logs/poll`;return h(u,n,t)};async function U(e){let n=e.cacheOptions?.cacheExtraKey??"",t=e.cacheOptions?{...e.cacheOptions,cacheExtraKey:n}:void 0;return x.schedule(async()=>o({...await v(e.token),query:e.query,variables:e.variables,cacheOptions:t,preferredBehaviour:e.requestOptions?.requestMode,unauthorizedHandler:e.unauthorizedHandler}))}function d(e){if(!e.extensions)return;let n=[];for(let t of e.extensions.deprecations)t.supportedUntilDate&&n.push(new Date(t.supportedUntilDate));g(n)}a();var D=i(c()),z=new D.default({minTime:150,maxConcurrent:10});async function L(e){let n="App Dev",t=f(e.shopFqdn),u=`https://${await q(t)}/app_dev/unstable/graphql.json`,p=m()==="local"?{"x-forwarded-host":t}:void 0;return z.schedule(()=>o({query:e.query,api:n,url:u,token:e.token,addedHeaders:p,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler,preferredBehaviour:e.requestOptions?.requestMode}))}a();var b=i(c()),k=new b.default({minTime:150,maxConcurrent:10});async function R(e,n,t){let r="Functions",p=`https://${await s()}/functions/unstable/organizations/${e}/${t}/graphql`;return{token:n,api:r,url:p,responseOptions:{onResponse:d}}}async function P(e){return await k.schedule(async()=>o({...await R(e.organizationId,e.token,e.appId),query:e.query,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}a();var w=i(c()),H=new w.default({minTime:150,maxConcurrent:10});async function Z(e){let n="Webhooks",r=`https://${await s()}/webhooks/unstable/organizations/${e.organizationId}/graphql.json`;return H.schedule(()=>o({query:e.query,api:n,url:r,token:e.token,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}export{A as a,T as b,U as c,L as d,P as e,Z as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,c,d as f}from"./chunk-
|
|
1
|
+
import{b as i,c,d as f}from"./chunk-JAO53IH2.js";import{b as w}from"./chunk-XITQULK4.js";import{d as s,f as d,j as S}from"./chunk-CBXSPL4W.js";import{B as h}from"./chunk-6G6TMKXF.js";import{d as u}from"./chunk-M56NDIMD.js";import{U as a}from"./chunk-N5PQPIBF.js";import{g as l}from"./chunk-VPRTJUIN.js";l();async function q(e,r){let n=await i(e),t=new f(r.filter),m=e.storeFqdn;if(t.any())return c(m,n,t)[0];let T=r.header??"",p=n.map(o=>{let g=o.id.toString()===w()?" [current]":"";return{value:async()=>o,label:`${o.name}${g}`,group:a(o.role)}});return r.create&&p.unshift(y(e)),(await h({message:T,choices:p}))()}async function B(e,r){return(await i(e)).find(t=>t.id.toString()===r)}async function C(e,r){let n=await i(e),t=new f(r),m=e.storeFqdn;return t.any()?c(m,n,t):[]}function y(e){return{value:async()=>{let r=s,n=await d("Name of the new theme"),t=await S({name:n,role:r},e);if(!t)throw new u("The theme could not be created.");return t},label:"[Create a new theme]",group:a(s)}}export{q as a,B as b,C as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as o}from"./chunk-
|
|
1
|
+
import{d as o}from"./chunk-XR6GMMEU.js";import{b as s}from"./chunk-XOTA6JTZ.js";import{g as e}from"./chunk-VPRTJUIN.js";e();var t=class extends s{static{this.description="Clear the CLI cache, used to store some API responses and handle notifications status"}static{this.hidden=!0}async run(){await o()}};export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as R}from"./chunk-
|
|
1
|
+
import{n as R}from"./chunk-XONFGLJQ.js";import{a as T,b as k}from"./chunk-XULPJ6UG.js";import{f as G}from"./chunk-WSDN25F5.js";import{d as l}from"./chunk-M56NDIMD.js";import{Gb as u,Ib as h,Oa as y,Pa as x,Qb as f,ka as $,ua as b,wa as g}from"./chunk-N5PQPIBF.js";import{d,i as w}from"./chunk-IU2ZQ6TE.js";import{g as m}from"./chunk-VPRTJUIN.js";m();function U(a){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(a);if(!t){let v=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return k(new Error(`Parsing the url ${a} failed. Supported formats are ${v.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",r=e==="github"?"github.com":e,s=t[4],i=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),o=t[7],p=o?`#${o}`:"",c=`git@${r}:${s}/${i}`,H=`https://${r}/${s}/${i}`,P=["https:/",r,s,i,n].join("/").concat(p);return T({full:P,site:r,user:s,name:i,ref:o,subDirectory:n,ssh:c,http:H})}function A(a){let t=new URL(a),e=t.hash?t.hash.slice(1):void 0,[r,s,i,...n]=t.pathname.split("/"),o=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${s}/${i}`,branch:e,filePath:o}}async function B(a,t,e,r){let s=`https://github.com/${a}/releases/download/${t}/${e}`;return G("cmd_all_timing_network_ms")(async()=>{f(h`Downloading ${u.link(e,s)}`),await $(async i=>{let n=d(i,e),o;try{if(o=await R(s,void 0,"slow-request"),!o.ok)throw new l(`Failed to download ${e}: ${o.statusText}`)}catch(c){throw new l(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let p=await o.arrayBuffer();await b(n,Buffer.from(p)),await x(n,493),await g(w(r)),await y(n,r)}),f(h`${u.successIcon()} Successfully downloaded ${u.path(r)}`)})}export{U as a,A as b,B as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as f,fa as v,ga as A,h as d,k as w,s as m}from"./chunk-
|
|
1
|
+
import{F as f,fa as v,ga as A,h as d,k as w,s as m}from"./chunk-XONFGLJQ.js";import{b as l}from"./chunk-ZSBA6VIC.js";import{d as p,g as F}from"./chunk-M56NDIMD.js";import{Gb as g,Ib as h}from"./chunk-N5PQPIBF.js";import{j as q}from"./chunk-ULQG3XQS.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e){let o="Admin",a=await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,a,r);return v({query:t,api:o,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:n,preferredBehaviour:s}=t,i=a??S.get(e.storeFqdn);i??(i=await b(e,s));let u=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=u,u=new m().host("app"));let D={url:x(u,i,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:n,unauthorizedHandler:y,preferredBehaviour:s})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:V,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${g.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
1
|
+
import{b as m}from"./chunk-MHWV5RQV.js";import{Ib as t,Qb as o}from"./chunk-N5PQPIBF.js";import{g as h}from"./chunk-VPRTJUIN.js";h();var n;function r(){return n??(n=new m({projectName:"shopify-cli-host-theme-conf"})),n}function u(e){return o(t`Getting host theme...`),r().get(e)}function p(e,s){o(t`Setting host theme...`),r().set(e,s)}function g(e){o(t`Removing host theme...`),r().delete(e)}export{u as a,p as b,g as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as I}from"./chunk-VPRTJUIN.js";I();var o="4.1.0";export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as a}from"./chunk-
|
|
1
|
+
import{n as a}from"./chunk-XONFGLJQ.js";import{d as i}from"./chunk-M56NDIMD.js";import{g as s}from"./chunk-VPRTJUIN.js";s();var e={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},g={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function p(t,n){let r=T(t);return r===e.LOCALHOST&&n===e.HTTP?!0:r===n}function f(t){return g.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function w(t,n){if(!p(t,n))throw new i(`Can't deliver your webhook payload to this address using '${n}'`,"Use a valid URL for address",l(n));let r=n;return f(t)&&(r=e.LOCALHOST),[t.trim(),r]}function l(t){return t===e.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===e.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===e.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function d(t,n){if(n.includes(t))return t;throw new i(`Api Version '${t}' does not exist`,`Allowed values: ${n.join(", ")}`,["Try again with a valid api-version value"])}function E(t,n,r){if(r.length===0)throw new i(`No topics found for '${n}'`);let o=c(t.trim(),r);if(o===void 0)throw new i(`Topic '${t}' does not exist for ApiVersion '${n}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return o}function c(t,n){return n.includes(t)?t:n.find(r=>r.toUpperCase().replace("/","_")===t)}function T(t){if(t){if(t.startsWith("pubsub:"))return e.PUBSUB;if(t.startsWith("arn:aws:events:"))return e.EVENTBRIDGE;if(f(t))return e.LOCALHOST;if(g.HTTP.test(t))return e.HTTP}}s();async function H(t,n,r){let o={method:"POST",body:n,headers:{"Content-Type":"application/json",...JSON.parse(r)}},u=await a(t,o);return u.status>=200&&u.status<300}export{H as a,e as b,p as c,w as d,d as e,E as f,T as g};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as w,n as y,r as n}from"./chunk-
|
|
1
|
+
import{d as w,n as y,r as n}from"./chunk-XONFGLJQ.js";import{w as l}from"./chunk-L2MGAEV3.js";import{k as u,l as m}from"./chunk-ZSBA6VIC.js";import{a as h}from"./chunk-F2QU6WWX.js";import{a as x}from"./chunk-MOA33ZFO.js";import{O as S,u as d,w as g,x as N}from"./chunk-6G6TMKXF.js";import{f as _}from"./chunk-M56NDIMD.js";import{Qb as a}from"./chunk-N5PQPIBF.js";import{a as f}from"./chunk-ULQG3XQS.js";import{g as p}from"./chunk-VPRTJUIN.js";p();var $="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",C=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function c(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??$}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),I=n.object({notifications:n.array(E)});async function Q(e,t=process.env){try{let r=x();if(b(r,t)||w(t))return;let o=await k(),s=v(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await V(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-PRZFHPRG.js");await s(o,"unexpected_error")}}function b(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||C.includes(e)}async function V(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
|
|
2
2
|
`),link:t.cta};switch(t.type){case"info":{d(r);break}case"warning":{g(r);break}case"error":throw N(r),new Error("abort")}u(`notification-${t.id}`,new Date().getTime().toString())})}async function k(){let e=`notifications-${c()}`,t=m(e)?.value;if(!t)throw new Error(D);let r=JSON.parse(t);return I.parse(r)}async function X(){a("Fetching notifications...");let e=await y(c(),void 0,{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:3*1e3});if(e.status!==200)throw new Error(`Failed to fetch notifications: ${e.statusText}`);let t=await e.text(),r=JSON.parse(t),o=I.parse(r);return await O(t),o}async function O(e){u(`notifications-${c()}`,e),a(`Notifications from ${c()} stored in the cache`)}function Z(e,t=process.argv,r=process.env){if(b(e,r)||!t[0]||!t[1])return;let o=t[0],i=[t[1],"notifications","list","--ignore-errors"];S(o,i,{background:!0,env:{...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},externalErrorHandler:async T=>{a(`Failed to fetch notifications in background: ${T.message}`)}})}function v(e,t,r,o=new Date(new Date().setUTCHours(0,0,0,0)),s=h){return e.filter(i=>B(i,s)).filter(i=>F(i,o)).filter(i=>A(i,t)).filter(i=>j(i,t,r)).filter(i=>q(i))}function B(e,t){let r=!e.minVersion||l(t,`>=${e.minVersion}`),o=!e.maxVersion||l(t,`<=${e.maxVersion}`);return r&&o}function F(e,t){let r=!e.minDate||new Date(e.minDate)<=t,o=!e.maxDate||new Date(e.maxDate)>=t;return r&&o}function A(e,t){return t===""?!0:!e.commands||e.commands.includes(t)}function j(e,t,r){let o=t.split(":")[0]??"all",s=e.surface??"all";return r?r.includes(s):s===o||s==="all"}function q(e){if(!e.frequency)return!0;let t=`notification-${e.id}`,r=m(t)?.value;if(!r)return!0;switch(e.frequency){case"always":return!0;case"once":return!1;case"once_a_day":return new Date().getTime()-Number(r)>24*3600*1e3;case"once_a_week":return new Date().getTime()-Number(r)>168*3600*1e3}}function ee(e){let t=[];return e.minDate&&t.push(`from ${e.minDate}`),e.maxDate&&t.push(`to ${e.maxDate}`),e.minVersion&&t.push(`from v${e.minVersion}`),e.maxVersion&&t.push(`to v${e.maxVersion}`),e.frequency==="once"&&t.push("show only once"),e.frequency==="once_a_day"&&t.push("show once a day"),e.frequency==="once_a_week"&&t.push("show once a week"),e.surface&&t.push(`surface = ${e.surface}`),e.commands&&t.push(`commands = ${e.commands.join(", ")}`),t.join(`
|
|
3
3
|
`)}export{Q as a,k as b,X as c,Z as d,v as e,ee as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as w,q as $}from"./chunk-
|
|
1
|
+
import{k as w,q as $}from"./chunk-XITQULK4.js";import{$ as ne,aa as E}from"./chunk-UXVZ2P63.js";import{r as C}from"./chunk-L2MGAEV3.js";import{b as P}from"./chunk-XR6GMMEU.js";import{u as S,v as T}from"./chunk-6G6TMKXF.js";import{r as te}from"./chunk-LDGAHMS7.js";import{$a as I,Mb as p,Nb as A,Ob as N,Qb as L,Ta as R,na as _,ua as F}from"./chunk-N5PQPIBF.js";import{d as k,p as x}from"./chunk-IU2ZQ6TE.js";import{e as O,g as v}from"./chunk-VPRTJUIN.js";v();v();var s=O(E(),1),h=O(ne(),1);function re(t){switch(t){case"error":return s.Severity.ERROR;case"suggestion":case"warning":return s.Severity.WARNING;case"style":case"info":return s.Severity.INFO;case"crash":return}}function G(t){switch(t){case s.Severity.ERROR:return"error";case s.Severity.WARNING:return"warning";case s.Severity.INFO:return"info"}}function ie(t,e,r){let n=s.path.fsPath(t),a=_(n).toString().split(`
|
|
2
2
|
`).slice(e,r+1),c=a.length===1;return a.map((f,m)=>{let u=e+m+1,d=c?f.trim():f;return`${u} ${d}`}).join(`
|
|
3
3
|
`)}function se(t){switch(t){case s.Severity.ERROR:return{error:`
|
|
4
4
|
[error]:`};case s.Severity.WARNING:return{warn:`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Da as e}from"./chunk-54CAKCYR.js";import{g as t}from"./chunk-VPRTJUIN.js";t();var p=class extends e{};export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d}from"./chunk-
|
|
1
|
+
import{c as d}from"./chunk-CBXSPL4W.js";import{xa as i}from"./chunk-XONFGLJQ.js";import{A as s,D as u,w as a,x as c}from"./chunk-6G6TMKXF.js";import{g as m}from"./chunk-VPRTJUIN.js";m();function f(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function y(e){return{list:{items:e.map(f)}}}async function b(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return c({headline:o?`Environment: ${o}`:"",body:r}),!1;if(a({body:r}),!process.stdout.isTTY)return!0;let t=await s({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function g(e,r,o){if(e.role!==d||!process.stdout.isTTY||o)return!0;let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await s({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function v(e,r,o=!1){e.length>0&&await u(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{f as a,y as b,b as c,g as d,v as e};
|