@zuplo/core 5.2358.0 → 5.2360.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/index.minified.js CHANGED
@@ -299,7 +299,7 @@ globstar while`,t,_,r,m,g),this.matchOne(t.slice(_),r.slice(m),n))return this.de
299
299
  `)}s(Dut,"generateRefs");function Lut(e,t,r,n,i,o,a){let u=[];u.push(`${r}: {`);let c=_1(e,t,n,i,o,a);return u.push(c),u.push("}"),u.join(`
300
300
  `)}s(Lut,"getJsonEntry");function _1(e,t,r,n,i,o){let a=[];for(let u in r){let c=r[u];if(u==="$ref")return(0,zm.chaseRefs)(e,t,(0,zm.getFullyQualifiedRefName)(e,c),n,i,o),`$REF:${Zoe(t,o.get((0,zm.getFullyQualifiedRefName)(e,c)))}`;switch(typeof c){case"string":{a.push(`"${u}": ${JSON.stringify(c)},`);break}case"number":case"boolean":{a.push(`"${u}":${c},`);break}default:if(Array.isArray(c))a.push(`"${u}":[`),c.forEach(l=>{if(typeof l=="object"){let f=_1(e,t,l,n,i,o);if(f.startsWith("$REF")){let d=f.split(":")[1];a.push(`${d},`)}else a.push("{"),a.push(f),a.push("},")}else a.push(`${JSON.stringify(l)},`)}),a.push("],");else{let l=_1(e,t,c,n,i,o);if(l.startsWith("$REF")){let f=l.split(":")[1];a.push(`${u}: ${f},`)}else a.push(`"${u}":{`),a.push(l),a.push("},")}}}return a.join(`
301
301
  `)}s(_1,"processNode");function Zoe(e,t){return(0,Joe.sanitizedIdentifierName)(e)+`_refsData_${t}`}s(Zoe,"getRefIdentifierName")});var rae=h(Hm=>{"use strict";var y1=Hm&&Hm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hm,"__esModule",{value:!0});Hm.runtimeConfigPlugin=void 0;var jut=y1(gn()),Mut=y1(require("fs/promises")),B2=y1(require("path")),Uut=y1(_n()),g1="runtime-config",tae="runtime-config-plugin";function xut(){return{name:g1,setup(e){e.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},t=>({namespace:tae,path:B2.default.isAbsolute(t.path)?t.path:B2.default.join(t.resolveDir,t.path),pluginName:g1})),e.onLoad({filter:/.*/,namespace:tae},async t=>Uut.default.timeFn("Generating zuplo.runtime.ts data",async()=>{let r="export const runtimeInit = undefined;",n=[];return await jut.default.fileExists(t.path)?(r=await Mut.default.readFile(t.path,"utf-8"),{contents:r,loader:"ts",resolveDir:B2.default.dirname(t.path),errors:n,pluginName:g1,watchFiles:[t.path]}):{contents:r,loader:"ts",errors:n,pluginName:g1}}))}}}s(xut,"runtimeConfigPlugin");Hm.runtimeConfigPlugin=xut});var uae=h(js=>{"use strict";var Fd=js&&js.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(js,"__esModule",{value:!0});js.isPolicyPresentInOperation=js.getPolicyNamesReferencingPolicyHandlers=js.schemaValidationSource=js.schemaValidationPlugin=void 0;var Km=Gf(),KE=require("@zuplo/runtime/internal"),nae=Fd(gn()),qut=Fd(cU()),Fut=Fd(lU()),E1=Fd(require("fs/promises")),Qc=Fd(require("path")),kut=Fd(require("prettier")),G2=kt(),But=Fd(Xs()),V2="schema-validation-plugin",iae="schema-validation",Gut="module.exports = {}";function Vut(e){return{name:"schema-validation-plugin",setup(t){t.onResolve({filter:/ajv-schema.json$/},r=>({namespace:iae,path:r.path,pluginName:V2})),t.onLoad({filter:/.*/,namespace:iae},async r=>{let n=Qc.default.resolve(e.sourceDirectory,G2.USER_CONFIG_DIR_NAME,"policies.json");if(!e.isOpenApiBased||!await nae.default.fileExists(n))return{contents:Gut,loader:"js",resolveDir:Qc.default.dirname(r.path),pluginName:V2};let i=await zut(e.sourceDirectory),o=Qc.default.resolve(e.sourceDirectory,G2.USER_CONFIG_DIR_NAME),a=await(0,Km.getOpenApiFilesByAlphabetical)(o),u=await Kut(a,i),c=await sae({oasFiles:a,routesWithSchemaValidation:u,sourceDirectory:e.sourceDirectory,logger:e.logger});if(But.default.DEBUG_BUILD_MODE&&c){let l=Qc.default.join(e.sourceDirectory,G2.BUILD_OUTPUT_DIR),f=Qc.default.resolve(l,"schema-validation.js");await nae.default.mkdirForFilePathIfNotExits(f);let d=await kut.default.format(c,{parser:"babel"});await E1.default.writeFile(f,d,"utf-8")}return{contents:c,loader:"js",resolveDir:Qc.default.dirname(r.path),pluginName:V2}})}}}s(Vut,"schemaValidationPlugin");js.schemaValidationPlugin=Vut;async function sae({oasFiles:e,routesWithSchemaValidation:t,sourceDirectory:r,logger:n}){let i="",o=new Km.RefParser(r,n);if(t.length===0)return i;let a=new qut.default({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let u of e){let c=await E1.default.readFile(u,"utf-8"),l=Qc.default.basename(u,".oas.json"),f=t.filter(y=>y.fileName===l),d=await o.resolve(u),_=JSON.parse(c),m=[],g=new Map;f.forEach(y=>{let b=_.paths[y.path][y.method];if(b.requestBody){let E;if(b.requestBody.$ref){let v=b.requestBody.$ref;E=d.get(v)?.content}else b.requestBody.content&&(E=b.requestBody.content);if(E)for(let v in E){let O=E[v].schema,P=(0,KE.getIdForRequestBodySchema)(y.path,y.method,v);O.$id=P,a.addSchema(O),z2(O,u,l,a,d,m,g)}}if(b.parameters)for(let E of b.parameters){let v=E.$ref?d.get(E.$ref):E,O=v.schema.$ref?d.get(v.schema.$ref):v.schema,P=(0,KE.getIdForParameterSchema)(y.path,y.method,v.in,v.name);O.$id=P,a.addSchema(O),z2(v,u,l,a,d,m,g)}});for(let y of m){let b=d.get(y),E=(0,KE.getIdForRefSchema)(l,y);a.addSchema(b,E)}}return i=(0,Fut.default)(a),i}s(sae,"schemaValidationSource");js.schemaValidationSource=sae;function z2(e,t,r,n,i,o,a){for(let u in e){let c=e[u];if(u==="$ref"){let l=(0,KE.getIdForRefSchema)(r,(0,Km.getFullyQualifiedRefName)(t,c));e[u]=l,(0,Km.chaseRefs)(t,r,(0,Km.getFullyQualifiedRefName)(t,c),i,o,a,(f,d)=>(0,KE.getIdForRefSchema)(f,(0,Km.getFullyQualifiedRefName)(t,d)))}else typeof c=="object"&&z2(c,t,r,n,i,o,a)}}s(z2,"addRefsToSchema");async function zut(e){let t=new Set(["RequestValidationInboundPolicy"]),r=await E1.default.readFile(`${e}/config/policies.json`,"utf-8"),n=JSON.parse(r);return oae(n,t)}s(zut,"getPolicyNamesUsingSchemaValidationPolicies");function oae(e,t){let r=new Set;e.policies?.forEach(i=>{i.handler?.export&&t.has(i.handler.export)&&i.handler.module==="$import(@zuplo/runtime)"&&r.add(i.name)});let n=Hut(e,r);return new Set([...r,...n])}s(oae,"getPolicyNamesReferencingPolicyHandlers");js.getPolicyNamesReferencingPolicyHandlers=oae;function Hut(e,t){let r=new Set;return e.policies?.forEach(n=>{n.handler?.export==="CompositeInboundPolicy"&&n.handler?.options?.policies?.forEach(i=>{t.has(i)&&r.add(n.name)})}),r}s(Hut,"getCompositePoliciesContainingPolicy");function aae(e,t){if(!e["x-zuplo-route"]||!e["x-zuplo-route"].policies)return!1;let r=e["x-zuplo-route"].policies.inbound;if(r){for(let i of r)if(t.has(i))return!0}let n=e["x-zuplo-route"].policies.outbound;if(n){for(let i of n)if(t.has(i))return!0}return!1}s(aae,"isPolicyPresentInOperation");js.isPolicyPresentInOperation=aae;async function Kut(e,t){let r=[];for(let n of e){let i=await E1.default.readFile(n,"utf-8"),a=JSON.parse(i).paths;for(let u in a){let c=a[u];for(let l in c){let f=c[l];aae(f,t)&&r.push({fileName:Qc.default.basename(n,".oas.json"),path:u,method:l})}}}return r}s(Kut,"getRoutesContainingPolicies")});var H2=h(Zc=>{"use strict";var Wut=Zc&&Zc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.BUILD_CONDITIONS=void 0;var Yut=N9(),b1=Wut(require("path")),Jut=kt(),Xut=A9(),Qut=D9(),Zut=U9(),ect=YX(),tct=QX(),rct=Koe(),nct=eae(),ict=rae(),sct=uae(),oct=(0,Yut.debug)("zuplo:core:build");Zc.BUILD_CONDITIONS=["workerd","worker","browser"];var cae=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],b1.default.resolve(__dirname,"..","..","..","node_modules"),b1.default.resolve(__dirname,"..","..","..","..","..","node_modules"),...require.main?.paths??[]];async function act({dev:e=!1,systemDirectory:t,outputDirectory:r,sourceDirectory:n,logger:i,flags:o}){let a=b1.default.join(t,Jut.WORKER_ENTRY_NAME);oct(`Building with node paths: ${cae.join(", ")}`);let u=e===!1?{minify:!0}:{minify:!1,keepNames:!0,metafile:!0},c={platform:"browser",target:"es2022",outfile:b1.default.join(r,"worker.js")};return{format:o?.esmWorker===!0?"esm":"iife",banner:{js:`'use strict';
302
- `},nodePaths:cae,entryPoints:[a],...c,sourcemap:"linked",legalComments:"linked",treeShaking:!0,bundle:!0,...u,external:[],logLevel:"silent",conditions:Zc.BUILD_CONDITIONS,plugins:[(0,Zut.environmentPlugin)({sourceDirectory:n}),(0,Xut.blockRemoteModulePlugin)({logger:i}),(0,rct.openApiRoutesPlugin)({sourceDirectory:n,outputDirectory:r}),(0,nct.rawRoutePlugin)({sourceDirectory:n,logger:i}),(0,sct.schemaValidationPlugin)({sourceDirectory:n,logger:i,isOpenApiBased:!0}),(0,ict.runtimeConfigPlugin)(),(0,Qut.devPortalConfigPlugin)({sourceDirectory:n}),(0,ect.jsonSchemaPlugin)({sourceDirectory:n,outputDirectory:r}),(0,tct.nodejsCompatPlugin)({nodeCompatEnabled:o?.esmWorker===!0,sourceDirectory:n})]}}s(act,"getBaseESBuildConfig");Zc.default=act});var v1=h(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatBuildResult=Ms.BUILD_TASK_PLUGIN_NAME=Ms.ESBUILD_PLUGIN_NAME=void 0;Ms.ESBUILD_PLUGIN_NAME="run-esbuild";Ms.BUILD_TASK_PLUGIN_NAME="build-task";var uct=s((e,t)=>{let r=t;if(t.includes(e)){let n=new RegExp(`.*(${e})`,"g");r=t.replace(n,"")}return r.match(/^(\/)?(\.\.(\/)?)+/)&&(r=r.replace(/^(\/)?(\.\.(\/)?)+/,"/")),r},"removePrefixFromString"),cct=s((e,t)=>{let r=t;if(r.includes(e)){let n=new RegExp(`[a-zA-Z0-9-_.\\/]+(${e})`,"g");r=r.replace(n,"")}return r},"cleanFilePathsInMessage"),S1=s((e,t,r)=>{if(!e||e.length<=0)return e;let n=e.filter(i=>i.message!=='Could not resolve "@zuplo/runtime"');return n&&n.length>0&&n.forEach(i=>{i.location&&i.location.file&&(i.location.file=uct(t,i.location.file)),i.location&&i.location.lineText&&i.location.lineText.includes("@zuplo/core/index.minified.js")&&(i.location.lineText=i.location.lineText.substring(0,200)+"...<Truncated>"),i.message=cct(t,i.message),i.notes&&i.notes.length>0&&delete i.notes,i.text&&delete i.text,i.pluginName===""&&(i.pluginName=r)}),n},"cleanDataOnBuildIssue");function lct(e,t,r){try{e.buildTaskResult&&(e.buildTaskResult.errors&&(e.buildTaskResult.errors=S1(e.buildTaskResult.errors,t,Ms.BUILD_TASK_PLUGIN_NAME)),e.buildTaskResult.warnings&&(e.buildTaskResult.warnings=S1(e.buildTaskResult.warnings,t,Ms.BUILD_TASK_PLUGIN_NAME))),e.compilerResult&&(e.compilerResult.errors&&(e.compilerResult.errors=S1(e.compilerResult.errors,t,Ms.ESBUILD_PLUGIN_NAME)),e.compilerResult.warnings&&(e.compilerResult.warnings=S1(e.compilerResult.warnings,t,Ms.ESBUILD_PLUGIN_NAME)))}catch(n){r.error("Error while formatting buildResult. Err: ",n)}return e}s(lct,"formatBuildResult");Ms.formatBuildResult=lct});var dae=h(Us=>{"use strict";var fct=Us&&Us.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),dct=Us&&Us.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pct=Us&&Us.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&fct(t,e,r);return dct(t,e),t},fae=Us&&Us.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getRunEsBuildPlugin=void 0;var hct=Gf(),lae=Yo(),mct=pct(require("esbuild")),_ct=fae(_n()),gct=$I(),yct=fae(H2()),K2=v1(),Ect=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,generateSourceMaps:a,buildId:u,logger:c,config:l}){return _ct.default.timeFn("Running esbuild",async()=>{c.info(`Running build_id: ${u}`);let f=await(0,yct.default)({systemDirectory:r,outputDirectory:n,generateSourceMaps:a,sourceDirectory:i,dev:o,logger:c,flags:l.flags}),d,_=new Date;try{if(!await(0,hct.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");d=await mct.build(f)}catch(g){if(c.error(g),g.errors||g.warnings)d=g;else if(g.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))d={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:K2.ESBUILD_PLUGIN_NAME,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw g}let m=new Date;if(e(new gct.CompilerResult(d,{endBuildTime:m,startBuildTime:_,buildId:u??""})),d.errors.length>0){d.errors.length>1&&(d.errors.length=1);let g=d.errors[0];c.debug(g)}return{warnings:[...d.warnings.map(g=>({message:g.text,pluginName:K2.ESBUILD_PLUGIN_NAME,severity:lae.WARNING_SEVERITY}))],errors:[...d.errors.map(g=>({message:g.text,pluginName:K2.ESBUILD_PLUGIN_NAME,severity:lae.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Us.getRunEsBuildPlugin=Ect});var Y2=h(Ym=>{"use strict";var hae=Ym&&Ym.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ym,"__esModule",{value:!0});Ym.build=void 0;var Wm=Yo(),bct=require("crypto"),Sct=require("fs"),WE=hae(require("path")),pae=kt(),vct=rc(),Oct=hae(_n()),Ict=Gz(),Pct=zz(),wct=Hz(),Tct=Kz(),Nct=Xz(),Act=Qz(),Rct=rH(),Cct=d9(),$ct=h9(),Dct=dae(),W2=v1(),O1;try{let e=(0,Sct.readFileSync)(WE.default.resolve(__dirname,"../../package.json"),"utf-8");O1=JSON.parse(e).version}catch{O1="0.0.0"}async function Lct({sourceDirectory:e,deploymentName:t=WE.default.basename(e),dev:r,entitlements:n,environmentType:i,generateSourceMaps:o=!1,logger:a,noCompile:u=!1,postBuildTasks:c,projectId:l,publicZuploEnvironmentVariables:f={}}){let d=(0,bct.randomUUID)(),_=a.child({buildId:d});return Oct.default.timeFn(`Run build with build_id: ${d}`,async()=>{let m=await(0,Ict.getZuploConfig)(e),g=WE.default.join(e,pae.BUILD_OUTPUT_DIR),y;if("errors"in m)y={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:O1,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:Wm.FAILURE_STATUS,buildId:d,warnings:[],errors:m.errors}};else{let E={dev:r,generateSourceMaps:o,deploymentName:t,sourceDirectory:e,outputDirectory:g,systemDirectory:WE.default.join(e,pae.GENERATED_SOURCE_DIR_NAME),buildId:d,logger:_,config:m.config,publicZuploEnvironmentVariables:f,projectId:l,entitlements:n,environmentType:i},v=[];v.push(Pct.cleanOutput),v.push(wct.createSystemDir),v.push(Tct.checkForDeprecations),v.push(Nct.generateBuildData),v.push(Rct.validateDevPortalJSON),v.push(Cct.validateOpenAPIFiles),v.push(Act.generateWorker);let O,P=s(V=>{O=V},"compileCallback");u||v.push((0,Dct.getRunEsBuildPlugin)(P)),v.push($ct.verifyWorkerOutput),c&&v.push(...c);let w=await(0,vct.runPlugins)(v,E),D=w.errors.length>0?Wm.FAILURE_STATUS:w.warnings.length>0?Wm.WARNING_STATUS:Wm.GOOD_STATUS;y={status:D==="Failed"||O===void 0||O.status==="Failed"?"Failed":D==="Warnings"||O.status==="Warnings"?"Warnings":"Good",compatibilityDate:m.config.compatibilityDate,runtimeVersion:O1,outputPath:g,compilerResult:O,buildTaskResult:{buildTime:"",buildTimeMs:0,status:D,buildId:d,warnings:w.warnings,errors:w.errors},flags:m.config.flags}}if(y.buildTaskResult.warnings.length>0){y.buildTaskResult.warnings.forEach(v=>{_.warn(v)});let E=y.buildTaskResult.warnings.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==W2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.warnings=E),y.buildTaskResult.status=Wm.WARNING_STATUS}if(y.buildTaskResult.errors.length>0){y.buildTaskResult.errors.forEach(v=>{_.error(v)});let E=y.buildTaskResult.errors.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==W2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.errors=E),y.buildTaskResult.status=Wm.FAILURE_STATUS}if(_.debug(`Build ${y.compilerResult?.buildId??d} completed ${u?"on watch mode":"with compiler status "+y.compilerResult?.status} and build task status ${y.buildTaskResult.status}`),y.compilerResult){let{metafile:E,...v}=y.compilerResult;_.debug(`Compiler results for build ${y.compilerResult?.buildId??d}`,v)}_.debug(`Build task results for build ${y.buildTaskResult?.buildId??d}`,y.buildTaskResult);let b=WE.default.basename(e);return(0,W2.formatBuildResult)(y,b,_)})}s(Lct,"build");Ym.build=Lct});var P1=h(xs=>{"use strict";var jct=xs&&xs.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mct=xs&&xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uct=xs&&xs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&jct(t,e,r);return Mct(t,e),t},I1=xs&&xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.BuildWatcher=void 0;var mae=Yo(),xct=I1(require("chokidar")),qct=Uct(require("esbuild")),_ae=require("crypto"),Fct=I1(require("events")),YE=I1(require("path")),gae=kt(),kct=Y2(),yae=$I(),Bct=I1(H2()),Eae=v1(),J2=class extends Fct.default{static{s(this,"WatchEmitter")}},X2=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new J2;envFilesWatcher;outputDirectory;sourceDirectory;dev;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,generateSourceMaps:n,logger:i,publicZuploEnvironmentVariables:o={}}){this.sourceDirectory=t,this.dev=r,this.outputDirectory=YE.default.join(t,gae.BUILD_OUTPUT_DIR),this.generateSourceMaps=n??!1,this.logger=i,this.publicZuploEnvironmentVariables=o,this.projectName=YE.default.basename(t),this.envFilesWatcher=xct.default.watch([YE.default.join(t,".env"),YE.default.join(t,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",async()=>{this.emitter.emit("reload",null,null)})}onReload=t=>{this.emitter.on("reload",t)};async start(){let{sourceDirectory:t}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let r=await(0,kct.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,Bct.default)({systemDirectory:YE.default.join(t,gae.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,sourceDirectory:t,dev:this.dev,generateSourceMaps:this.generateSourceMaps,logger:this.logger,flags:r.flags}),i=this;n.plugins?.push({name:"on-end",setup(o){o.onEnd(a=>{i.logger.debug("Watcher (build) reloaded");let u;if(a)if(u=new yae.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:mae.FAILURE_STATUS,buildId:(0,_ae.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,Eae.formatBuildResult)(c,i.projectName,i.logger),i.logger.error(c.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${u.buildId}`);i.emitter.emit("reload",r,null,u)})}}),this.esbuildContext=await qct.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let a={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:mae.FAILURE_STATUS,buildId:(0,_ae.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new yae.CompilerResult(o),(0,Eae.formatBuildResult)(a,this.projectName,this.logger),this.logger.error(a.compilerResult.errors,"Build errors")}}catch(o){throw await this.close(),o}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(t){this.logger.error(t)}}};xs.BuildWatcher=X2});var Q2=h(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});w1.HttpStatusCode=void 0;var bae;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(bae||(w1.HttpStatusCode=bae={}))});var Sae=h(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});T1.getSourceControlProviderLabel=void 0;function Gct(e){let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="BitBucket";break;default:t=e;break}return t}s(Gct,"getSourceControlProviderLabel");T1.getSourceControlProviderLabel=Gct});var Oae=h(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_NO_ACCESS=S.INVALID_SOURCE_REPO_URL=S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=S.PROJECT_MUST_HAVE_ONE_MEMBER=S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=S.PROJECT_MEMBER_ALREADY_EXISTS=S.PROJECT_MEMBER_NOT_FOUND=S.INVALID_TEMPLATE_REPOSITORY=S.INCORRECT_PROJECT_TEMPLATE=S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=S.PROJECT_NOT_FOUND=S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=S.PROJECT_SHARING_DISABLED_ON_ACCOUNT=S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=S.ACCOUNT_MEMBER_INVITE_INVALID=S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_INFO_MISSING=S.ACCOUNT_MEMBER_ALREADY_EXISTS=S.ACCOUNT_UPDATE_INFO_MISSING=S.ACCOUNT_INFO_MISSING=S.ACCOUNT_DOES_NOT_EXISTS=S.INVALID_ACCOUNT_LABEL_ENDING=S.INVALID_ACCOUNT_NAME_ENDING=S.ACCOUNT_NAME_ALREADY_IN_USE=S.INVALID_ACCOUNT_LABEL=S.INVALID_ACCOUNT_NAME=S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=S.ACCOUNT_NAME_USES_RESERVED_KEYWORD=S.ACCOUNT_ALREADY_EXISTS=S.ACCOUNT_NOT_FOUND=S.USER_IS_NOT_SERVICE_ACCOUNT=S.USER_REMOVE_NOT_MEMBER_ACCOUNT=S.USER_HAS_NO_ACCESS_TO_ACCOUNT=S.USER_DETAILS_CANNOT_BE_FOUND=S.USER_ALREADY_EXISTS=S.CLIENT_NOT_FOUND=S.FORBIDDEN=S.UNAUTHORIZED=S.METHOD_NOT_ALLOWED=S.NOT_FOUND=S.CONFLICT=S.BAD_REQUEST=S.INTERNAL_SERVER_ERROR=void 0;S.GITHUB_INTEGRATION_ALREADY_EXISTS=S.FEATURE_FLAGS_NOT_FOUND=S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=S.PROJECT_ALREADY_HAS_REPO=S.PROJECT_INVALID_NAME=S.FAILED_TO_REVOKE_GH_TOKEN=S.USER_ACCOUNT_NOT_FS_MIGRATED=S.USER_NO_ACCESS_GITLAB_REPO=S.USER_NO_ACCESS_BITBUCKET_REPO=S.GITHUB_APP_CONFIGURATION_NOT_FOUND=S.GITHUB_APP_NO_USER_ACCESS_=S.GITHUB_APP_NO_NAMESPACE_ACCESS=S.GENERIC_GITHUB_BRANCH_INFO_ERROR=S.GITHUB_USER_NO_READ_ACCESS_REPO=S.USER_NO_PULL_ACCESS_GITHUB_REPO=S.USER_NO_ACCESS_GITHUB_REPO=S.PROJECT_SHARING_REQUIRES_GIT_REPO=S.PROJECT_INVALID_GIT_REPO=S.PROJECT_INVALID_GIT_CLONE=S.USER_IS_PROJECT_MEMBER=S.USER_HAS_NO_ACCESS_TO_PROJECT=S.RUNTIME_FLAG_KEY_NOT_VALID=S.RUNTIME_FLAG_NOT_FOUND=S.RUNTIME_FLAG_ALREADY_EXISTS=S.PROJECT_NO_MEMBERS=S.PROJECT_ALREADY_EXISTS=S.SERVICE_CONFIGURATION_FAILED_DECRYPTION=S.WORKING_COPY_SERVICE_NOT_CREATED=S.WORKING_COPY_SERVICE_NOT_DELETED=S.WORKING_COPY_SERVICE_NOT_FOUND=S.SERVICE_CONFIGURATION_NOT_FOUND=S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=S.DEPLOYMENT_INCORRECT_STATUS_PAUSE=S.DEPLOYMENT_NOT_WORKING_COPY=S.DEPLOYMENT_LOG_NOT_FOUND=S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=S.DEPLOYMENT_DELETE_ERROR=S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_DIR_DOES_NOT_EXISTS=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=void 0;S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS=S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=S.SOURCE_CONTROL_REPO_OPERATION_ERROR=S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=S.SOURCE_CONTROL_REPO_NOT_FOUND=S.SOURCE_CONTROL_AUTHENTICATION_FAILED=S.EXTERNAL_SERVICE_GENERIC_ERROR=S.API_USER_NO_ACCESS=S.EXTERNAL_USER_NOT_CONFIGURED=S.EXTERNAL_USER_NO_ACCESS=S.API_KEY_CANNOT_BE_CREATED=S.CONSUMER_CANNOT_BE_CREATED=S.CONSUMER_DOES_NOT_EXIST=S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=S.GITLAB_DUPLICATE_REPO=S.GITLAB_FAILED_DURING_REPO_CREATION=S.GITLAB_QUERY_USER_INFO_FAILED=S.BITBUCKET_FAILED_DURING_REPO_CREATION=S.BITBUCKET_WORKSPACE_MISCONFIGURATION=S.BITBUCKET_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=S.GITHUB_INTEGRATION_DUPLICATE_REPO=S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=S.GITHUB_INTEGRATION_BRANCH_BEHIND=S.GITHUB_INTEGRATION_NOT_FOUND=S.GITHUB_REPOSITORY_NOT_FOUND=S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=void 0;S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS=S.RBACCONFIGURATION_DOES_NOT_EXISTS=S.RBAC_INVALID_EXPIRATION_DATE=S.ACCOUNT_RBAC_DISABLED=S.METERING_BUCKET_CREATION_FAILED=S.UNABLE_UPGRADE_PLAN=S.BUCKET_NOT_FOUND=S.BUCKET_API_KEY_SERVICE_CONFLICT=S.DIRECTORY_DELETE_FAILED=S.FILE_DELETE_FAILED=S.CANNOT_DELETE_SOLE_OPEN_API_FILE=S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=S.CANNOT_DELETE_ESSENTIAL_FILE=S.FILE_WRITE_FAILED=S.FILE_RENAME_FAILED=S.FILE_RENAME_FILE_ALREADY_EXISTS=S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=S.FILE_RENAME_PATHS_MATCH=S.DIRECTORY_CREATION_FAILED=S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=S.DIRECTORY_DOES_NOT_EXIST=S.DIRECTORY_ALREADY_EXISTS=S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=S.FAILED_DOWNLOAD_FROM_STORAGE=S.CANNOT_FIND_SRC_DIRECTORY=S.CANNOT_READ_PACKAGE_JSON=S.PACKAGE_JSON_NOT_FOUND=S.RUNTIME_VERSION_INCORRECT_FORMAT=S.MIGRATIONS_ONLY_ON_WORKING_COPY=S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=S.NO_GLOBAL_SYMBOLS=S.NO_ZUPLO_PREFIXED_VARIABLES=S.NON_EMPTY_TARGETS_REQUIRED=S.CONFLICTING_TYPES=S.OVERLAPPING_TARGETS=S.INVALID_BRANCH_NAME=S.TARGET_BRANCH_ONLY_FOR_PREVIEW=S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=S.DEPLOYMENT_NAME_MISSING=S.NON_EXISTENT_ENVIRONMENT_VARIABLE=S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=S.DUPLICATE_ENVIRONMENT_VARIABLE=S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=void 0;S.MISCONFIGURED_ENV_VAR=S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS=S.USER_HAS_NO_PROD_ENV_VAR_ACCESS=S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE=S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_CANNOT_EDIT_OWN_ROLE=S.USER_DOES_NOT_EXIST=S.INVALID_USER_ROLE=S.USER_HAS_NO_ACCESS_TO_CONSUMER=S.RBACCONFIGURATION_CONSUMER_LOCKED=S.RBACCONFIGURATION_MISCONFIGURATION=S.RBACCONFIGURATION_DELETE_MISCONFIGURATION=S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG=S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED=S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS=S.RBACCONFIGURATION_REQUIRE_PROJECTS=S.RBACCONFIGURATION_INVALID_ENVIRONMENTS=void 0;var T=Q2(),vae=Sae(),Vct="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:T.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:T.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:T.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:T.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:T.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:T.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:T.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Forbidden",detail:"You are not authorized to access the account resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_REMOVE_NOT_MEMBER_ACCOUNT={type:"https://zup.fail/removed-user-not-account-member",title:"The user being removed is not a member of the account",status:T.HttpStatusCode.BAD_REQUEST};S.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:T.HttpStatusCode.CONFLICT};S.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD={type:"https://zup.fail/account-use-reserved-keyword",title:"The account name can not start with a reserved keyword",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-name-length-limit",title:"The account name exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-label-length-limit",title:"The account label exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME={type:"https://zup.fail/invalid-account-name",title:"The account name can only contain lower-cased characters, numbers, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL={type:"https://zup.fail/invalid-account-label",title:"The account label can only contain alpha-numeric characters, spaces, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_ALREADY_IN_USE={type:"https://zup.fail/account-name-in-use",title:"The account name is already taken. Please try again using a different name.",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME_ENDING={type:"https://zup.fail/invalid-account-name-ending",title:"The account name can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL_ENDING={type:"https://zup.fail/invalid-account-label-ending",title:"The account label can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"Not Found",detail:"The account does not exist.",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND={type:"https://zup.fail/account-member-invite-failed-send",title:"We were not able to send the account member invite. Please try again or contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:T.HttpStatusCode.BAD_REQUEST};S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE={type:"https://zup.fail/existing-pending-account-member-invites",title:"The user has a pending invitation to this account.",status:T.HttpStatusCode.BAD_REQUEST};S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED={type:"https://zup.fail/account-members-limit-reached",title:"This account has reached the limit of users allowed by its current billing plan.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:T.HttpStatusCode.FORBIDDEN};S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS={type:"https://zup.fail/project-cannot-be-deleted-protected-deployments-exists",title:"Project cannot be deleted because it has protected deployments",detail:"Project has protected deployments. Make sure to remove the use of custom domains before trying to delete the project.",status:T.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:T.HttpStatusCode.BAD_REQUEST};var zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:T.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=zct;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS={type:"https://zup.fail/cannt-delete-your-own-project-member",title:"Can not delete your own Project Member record",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:T.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_SOURCE_REPO_URL={type:"https://zup.fail/invalid-source-repo-url",title:"Project is not connected to source control, a sourceRepoUrl property must be specified and valid",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH={type:"https://zup.fail/deployment-branch-does-not-exist",title:"A deployment record cannot be found for the provided branch.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST={type:"https://zup.fail/default-deployment-does-not-exist",title:"A default deployment record cannot be found for the project.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DIR_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-dir-does-not-exists",title:"NOT FOUND",detail:"Deployment directory was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED={type:"https://zup.fail/deployment-is-protected-cannot-be-deleted",title:"Deployment is protected and cannot be deleted",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid account",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid project name",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid user sub",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY={type:"https://zup.fail/deployment-cannot-be-deleted",title:"Deployment cannot be deleted since is a working copy",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:T.HttpStatusCode.BAD_REQUEST};S.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Forbidden",detail:"You are not a member of the project",status:T.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_REPO={type:"https://zup.fail/project-invalid-git-repo",title:"The current source control repository is already in use by a Zuplo project",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_REQUIRES_GIT_REPO={type:"https://zup.fail/project-sharing-requires-git-repo",title:"The current project is not connected to a source control repository.",status:T.HttpStatusCode.BAD_REQUEST};var Hct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=Hct;var Kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have pull access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=Kct;var Wct=s(({repositoryUrl:e})=>({type:"https://zup.fail/no-read-access-github-repo",title:"You do not have read access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=Wct;S.GENERIC_GITHUB_BRANCH_INFO_ERROR={type:"https://zup.fail/gh-branch-info-error",title:"There was an error getting branch information for the GitHub repository associated to the project.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_APP_NO_NAMESPACE_ACCESS={type:"https://zup.fail/no-namespace-access-github-app",title:"The Zuplo GitHub app does not have access to the repositories under the namespace provided. Make sure to configure the GitHub Zuplo App on the repository.",status:T.HttpStatusCode.FORBIDDEN};var Yct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:"The Zuplo GitHub app does not have access to the repository. Make sure to configure the GitHub Zuplo App on the repository.",detail:`The Zuplo GitHub app has not been granted access to the repository '${e}'. Go to '${Vct}' to add the repository.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=Yct;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:T.HttpStatusCode.NOT_FOUND};var Jct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-bitbucket-repo",title:"You do not have access to the Bitbucket repository associated to the project. Ask your Bitbucket admin for access and try again.",detail:`User does not have access to the Bitbucket repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=Jct;var Xct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-gitlab-repo",title:"You do not have access to the GitLab repository associated to the project. Ask your GitLab admin for access and try again.",detail:`User does not have access to the GitLab repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=Xct;S.USER_ACCOUNT_NOT_FS_MIGRATED={type:"https://zup.fail/user-account-not-fs-migrated",title:"User account is in a plan that does not allow project sharing. Please contact your account admin.",status:T.HttpStatusCode.FORBIDDEN};S.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_HAS_REPO={type:"https://zup.fail/project-already-has-repo",title:"The current project has been previously linked to a source control repository",status:T.HttpStatusCode.BAD_REQUEST};S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED={type:"https://zup.fail/max-allowed-projects-limit-reached",title:"Your account has reached the maximum number of projects allowed.",status:T.HttpStatusCode.BAD_REQUEST};S.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:T.HttpStatusCode.BAD_REQUEST};var Qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:T.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=Qct;var Zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:T.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=Zct;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:T.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};S.GITHUB_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/github-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED={type:"https://zup.fail/github-integration-query-user-info-failed",title:"Failed while requesting basic user info from GitHub",status:T.HttpStatusCode.FORBIDDEN};var elt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${e}' already exists on GitHub org '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=elt;var tlt=s(({repositoryName:e,details:t})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:t,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=tlt;var rlt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-empty-repo",title:"The repository is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=rlt;var nlt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-git-repo",title:"We can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=nlt;var ilt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-invalid-repo",title:"We can only connect to an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.",details:`Repository '${e}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=ilt;S.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:T.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:T.HttpStatusCode.FORBIDDEN};var slt=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=slt;S.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:T.HttpStatusCode.FORBIDDEN};var olt=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=olt;var alt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${e}' already exists in GitLab team '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=alt;var ult=s(({orgName:e})=>({type:"https://zup.fail/gitlab-create-repo-perm",title:"The user's GitLab group access level does not allow for repository creation.",details:"The user's GitLab group access level does not allow for repository creation.",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=ult;var clt=s(({namespaceLabel:e})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${e}'.`,details:`The user's GitLab access level does not allow the use of namespace '${e}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=clt;var llt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=llt;S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist or cannot be accessed.",status:T.HttpStatusCode.NOT_FOUND};S.CONSUMER_CANNOT_BE_CREATED={type:"https://zup.fail/consumer-not-created",title:"Failed to create consumer",status:T.HttpStatusCode.BAD_GATEWAY};S.API_KEY_CANNOT_BE_CREATED={type:"https://zup.fail/api-key-not-created",title:"Failed to create api key",status:T.HttpStatusCode.BAD_GATEWAY};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:T.HttpStatusCode.UNAUTHORIZED};S.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:T.HttpStatusCode.FORBIDDEN};S.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:T.HttpStatusCode.FORBIDDEN};S.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};var flt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,vae.getSourceControlProviderLabel)(e)}`,status:T.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=flt;var dlt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-repo-not-found",title:"We cannot connect to the repository associated to the project, verify your source control access configuration and try again.",detail:`Could not connect to ${(0,vae.getSourceControlProviderLabel)(e)} repository`,status:T.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=dlt;S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE={type:"https://zup.fail/source-control-empty-commit",title:"Commit operation failed because you provided an empty message. Please try again by providing a commit message.",status:T.HttpStatusCode.BAD_REQUEST};var plt=s(({repoURL:e,operation:t})=>({type:`https://zup.fail/source-control-repo-${t}-error`,title:`Failed on ${t} operation to repository '${e}'. Verify you have read & write access to the repository and try again.`,detail:"Verify your source control configuration and make sure you have been granted read & write access to the repository",status:T.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=plt;S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE={type:"https://zup.fail/source-control-write-access-issue",title:"You do not have write access to the repository, verify your source control access configuration and try again.",detail:"Verify your source control configuration and make sure you have been granted access to the repository",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:T.HttpStatusCode.NOT_FOUND};S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND={type:"https://zup.fail/source-control-credentials-not-found",title:"Source control credentials not found for this user. Verify your user's source control connection and try again.",status:T.HttpStatusCode.NOT_FOUND};S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-refresh-source-control-credentials",title:"Failed to refresh Source Control credentials. Verify your user's source control connection and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED={type:"https://zup.fail/new-gh-config-required",title:"Current Source Control credentials are using the previous Zuplo GitHup App. Re-authenticate using the latest Zuplo GitHup App via Profile UI and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS={type:"https://zup.fail/gh-app-revoked-access",title:"Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.",status:T.HttpStatusCode.UNAUTHORIZED};S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-revoke-source-control-credentials",title:"Failed to revoke Source Control access token for the user",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING={type:"https://zup.fail/source-control-configuration-info-missing",title:"Source Control Configuration information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING={type:"https://zup.fail/source-control-configuration-bb-workspace-missing",title:"Source Control Configuration for Bitbucket must include a workspace configuration (additionalMetadata).",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION={type:"https://zup.fail/preexisiting-source-control-configuration-on-account",title:"This account already has a Source Control Configuration for this provider.",detail:"This account has a pre-existing Source Control Configuration for this provider. Delete or update the existing configuration.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/source-control-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS={type:"https://zup.fail/source-control-integration-branch-behind",title:"The branch exists in the remote repository. Please try again with a different branch name.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR={type:"https://zup.fail/third-party-app-auth0-clients-endpoint-error",title:"Error Creating an Auth0 Client through tenant api",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST={type:"https://zup.fail/third-party-app-auth0-config-does-not-exist",title:"Auth0 Configuration does not exist for account and environment",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR={type:"https://zup.fail/third-party-app-auth0-client-not-found-error",title:"Third Party App Not Found",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR={type:"https://zup.fail/third-party-app-auth-scope-config-error",title:"API Scope configuration at Auth0 end Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND={type:"https://zup.fail/third-party-app-connection-not-found",title:"Cannot find connection with the given name",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION={type:"https://zup.fail/third-party-app-cannot-link-tpa-to-connection",title:"Cannot link a connection to a third party app",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE={type:"https://zup.fail/environment-variables-cannot-be-retrieved-invalid-env-type",title:"Env vars will not be retrieved since the deployment is from non valid environment type",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:T.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:T.HttpStatusCode.BAD_REQUEST};S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY={type:"https://zup.fail/personal-override-only-for-working-copy",title:"A personal override can only be used for a working-copy environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.TARGET_BRANCH_ONLY_FOR_PREVIEW={type:"https://zup.fail/target-branch-only-for-preview",title:"A target branch can only be used for preview environment variables",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICTING_TYPES={type:"https://zup.fail/conflicting-types",title:"The type of this environment variable conflicts with an existing environment variable with the same name",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:T.HttpStatusCode.BAD_REQUEST};S.NO_ZUPLO_PREFIXED_VARIABLES={type:"https://zup.fail/no-zuplo-prefixed-variables",title:"Environment variables should not start with the reserved prefix of ZUPLO or __ZUPLO",status:T.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE={type:"https://zup.fail/deployer-non-valid-deployment-environment-type",title:"Deployment cannot be different than preview or production",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2={type:"https://zup.fail/deployer-cannot-deploy-using-env-vars-v2",title:"Deployer was not able to deploy zup using environment variables v2",status:T.HttpStatusCode.FORBIDDEN};S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:T.HttpStatusCode.NOT_FOUND};var hlt=s(({operation:e,path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${e} file ${t} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=hlt;var mlt=s(()=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify files on read-only environment",detail:"Cannot save files on a read-only environment. Read-only environments cannot be edited.",status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=mlt;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:T.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:T.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:T.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:T.HttpStatusCode.BAD_REQUEST};var _lt=s(({path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${e} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=_lt;var glt=s(({path:e})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${e} is not allowed.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=glt;var ylt=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=ylt;var Elt=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=Elt;var blt=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=blt;var Slt=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=Slt;var vlt=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${e} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");S.FILE_RENAME_PATHS_MATCH=vlt;var Olt=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=Olt;var Ilt=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${e}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");S.FILE_RENAME_FILE_ALREADY_EXISTS=Ilt;var Plt=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=Plt;var wlt=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=wlt;var Tlt=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=Tlt;var Nlt=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=Nlt;var Alt=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:T.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");S.CANNOT_DELETE_SOLE_OPEN_API_FILE=Alt;var Rlt=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=Rlt;var Clt=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=Clt;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:T.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:T.HttpStatusCode.BAD_REQUEST};S.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.ACCOUNT_RBAC_DISABLED={type:"https://zup.fail/account_rbac_disabled",title:"Forbidden",detail:"Your account does not have fine-grained RBAC feature enabled. Please contact support to enable this feature.",status:T.HttpStatusCode.FORBIDDEN};S.RBAC_INVALID_EXPIRATION_DATE={type:"https://zup.fail/rbac_invalid_expiration_date",title:"Bad Request",detail:"The expiration date provided cannot be in the past. Please provide a valid expiration date.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DOES_NOT_EXISTS={type:"https://zup.fail/rbacconfiguration-does-not-exists",title:"Bad Request",detail:"The api key configuration does not exist or you don't have access to it.",status:T.HttpStatusCode.NOT_FOUND};S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-required-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-invalid-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_REQUIRE_PROJECTS={type:"https://zup.fail/rbacconfiguration-required-projects",title:"Bad Request",detail:"Please provide at least one project to configure access for.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS={type:"https://zup.fail/rbacconfiguration-no-projects",title:"Bad Request",detail:"The account does not have any projects to configure. Please create at least one project before configuring api key access.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED={type:"https://zup.fail/rbacconfiguration-invalid-project",title:"Bad Request",detail:"One or more of the projects provided is not part of the account or does not exist. Make sure all the projects are valid and try again.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG={type:"https://zup.fail/rbacconfiguration-invalid-openfga-config",title:"Bad Gateway",detail:"The provided configuration caused an unexpected error. Please contact support.",status:T.HttpStatusCode.BAD_GATEWAY};S.RBACCONFIGURATION_DELETE_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-delete-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be deleted. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be used. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_CONSUMER_LOCKED={type:"https://zup.fail/rbacconfiguration-consumer-locked",title:"Forbidden",detail:"The provided consumer is locked and can't be modified or deleted.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_CONSUMER={type:"https://zup.fail/forbidden",title:"Forbidden",detail:"You are not authorized to access the consumer resource.",status:T.HttpStatusCode.FORBIDDEN};S.INVALID_USER_ROLE={type:"https://zup.fail/invalid-user-role",title:"Bad Request",detail:"You provided an invalid user role. Valid options include 'admin', 'developer' and 'member'.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_DOES_NOT_EXIST={type:"https://zup.fail/user-does-not-exist",title:"Forbidden",detail:"You are not authorized to access the user resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_CANNOT_EDIT_OWN_ROLE={type:"https://zup.fail/user-edit-itself",title:"Forbidden",detail:"You are not authorized to edit your own access role.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-deploy-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access to deploy this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE={type:"https://zup.fail/account-admin-invalid-project-role-downgrade",title:"Bad Request",detail:"An account administrator cannot be downgraded to a non-administrator role in a project.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_PROD_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-prod-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's production environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-dev-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's preview and development environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.MISCONFIGURED_ENV_VAR={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The environment variable is not correctly configured on any environment. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST}});var Pae=h(wi=>{"use strict";var $lt=wi&&wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Dlt=wi&&wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Llt=wi&&wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&$lt(t,e,r);return Dlt(t,e),t};Object.defineProperty(wi,"__esModule",{value:!0});wi.ApiNotFoundError=wi.ApiError=wi.Problems=void 0;var Iae=Llt(Oae());wi.Problems=Iae;var N1=class extends Error{static{s(this,"ApiError")}type;status;detail;instance;constructor(t){if(super(t.title),!t.type.startsWith("https://zup.fail/"))throw new Error(`Invalid 'type' specified on ApiError, must be a URI starting with 'https://zup.fail/'. Type was set to ${t.type}`);this.name="ApiProblemError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.instance=t.instance}};wi.ApiError=N1;var Z2=class extends N1{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...Iae.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};wi.ApiNotFoundError=Z2});var wae=h(Pu=>{"use strict";var jlt=Pu&&Pu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mlt=Pu&&Pu.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&jlt(t,e,r)};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.HttpStatusCode=void 0;Mlt(Pae(),Pu);var Ult=Q2();Object.defineProperty(Pu,"HttpStatusCode",{enumerable:!0,get:function(){return Ult.HttpStatusCode}})});var Nae=h((Sqt,Tae)=>{"use strict";function xlt(e){return e>=55296&&e<=56319}s(xlt,"isHighSurrogate");function qlt(e){return e>=56320&&e<=57343}s(qlt,"isLowSurrogate");Tae.exports=s(function(t,r,n){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,a,u,c=0;c<i;c+=1){if(a=r.charCodeAt(c),u=r[c],xlt(a)&&qlt(r.charCodeAt(c+1))&&(c+=1,u+=r[c]),o+=t(u),o===n)return r.slice(0,c+1);if(o>n)return r.slice(0,c-u.length+1)}return r},"truncate")});var Rae=h((Oqt,Aae)=>{"use strict";var Flt=Nae(),klt=Buffer.byteLength.bind(Buffer);Aae.exports=Flt.bind(null,klt)});var ek=h(Jm=>{"use strict";var Blt=Jm&&Jm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jm,"__esModule",{value:!0});Jm.sanitize=void 0;var Glt=Blt(Rae()),Vlt=/[/?<>\\:*|"]/g,zlt=/[\x00-\x1f\x80-\x9f]/g,Hlt=/^\.+$/,Klt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Wlt=/[. ]+$/;function Ylt(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(Vlt,t).replace(zlt,t).replace(Hlt,t).replace(Klt,t).replace(Wlt,t);return(0,Glt.default)(r,255)}s(Ylt,"sanitize");Jm.sanitize=Ylt});var Lae=h(Xm=>{"use strict";var Dae=Xm&&Xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xm,"__esModule",{value:!0});Xm.createProjectDirs=void 0;var Cae=Dae(require("fs/promises")),Jlt=Dae(require("path")),JE=kt(),$ae=rc(),Xlt=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[JE.USER_MODULES_DIR_NAME,JE.USER_CONFIG_DIR_NAME,JE.USER_TEST_DIR_NAME,JE.USER_SCHEMAS_DIR_NAME,JE.USER_DOCS_DIR_NAME,".vscode"];try{await Cae.default.mkdir(e);for(let n of r)await Cae.default.mkdir(Jlt.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new $ae.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new $ae.PluginResult},"createProjectDirs");Xm.createProjectDirs=Xlt});var xae=h(Qm=>{"use strict";var Uae=Qm&&Qm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qm,"__esModule",{value:!0});Qm.generateFromTemplate=void 0;var Qlt=require("fs"),jae=Uae(require("fs/promises")),Mae=Uae(require("path"));async function Zlt(e){let t=Mae.default.resolve(__dirname,"..","templates",e);if((0,Qlt.existsSync)(t))return await jae.default.readFile(t,"utf-8");{let r=Mae.default.resolve(__dirname,"templates",e);return await jae.default.readFile(r,"utf-8")}}s(Zlt,"generateFromTemplate");Qm.generateFromTemplate=Zlt});var Ti=h(Zm=>{"use strict";var A1=Zm&&Zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zm,"__esModule",{value:!0});Zm.generateFileFromTemplate=void 0;var eft=A1(gn()),tft=A1(require("fs/promises")),rft=A1(require("path")),nft=A1(_n()),ift=xae(),sft=s(function(e,t){return async({sourceDirectory:r,logger:n})=>nft.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=rft.default.join(r,e);return await eft.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):oft(i,t,n)})},"generateFileFromTemplate");Zm.generateFileFromTemplate=sft;async function oft(e,t,r){let n=await(0,ift.generateFromTemplate)(t);try{await tft.default.writeFile(e,n,"utf-8"),r.debug(`File written to ${e}`)}catch(i){r.error(i);let o={message:`Error creating file at ${e}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[o]}}return{warnings:[],errors:[]}}s(oft,"writeTemplate")});var Fae=h(e_=>{"use strict";var aft=e_&&e_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e_,"__esModule",{value:!0});e_.generateDefaultDocsMarkdown=void 0;var uft=aft(require("path")),qae=kt(),cft=Ti();e_.generateDefaultDocsMarkdown=(0,cft.generateFileFromTemplate)(uft.default.join(qae.USER_DOCS_DIR_NAME,qae.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Bae=h(t_=>{"use strict";var lft=t_&&t_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t_,"__esModule",{value:!0});t_.generateDefaultDocsSidebar=void 0;var fft=lft(require("path")),kae=kt(),dft=Ti();t_.generateDefaultDocsSidebar=(0,dft.generateFileFromTemplate)(fft.default.join(kae.USER_DOCS_DIR_NAME,kae.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var Vae=h(r_=>{"use strict";var pft=r_&&r_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r_,"__esModule",{value:!0});r_.generateDefaultDocsTheme=void 0;var hft=pft(require("path")),Gae=kt(),mft=Ti();r_.generateDefaultDocsTheme=(0,mft.generateFileFromTemplate)(hft.default.join(Gae.USER_DOCS_DIR_NAME,Gae.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Hae=h(n_=>{"use strict";var _ft=n_&&n_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n_,"__esModule",{value:!0});n_.generateDefaultModule=void 0;var gft=_ft(require("path")),zae=kt(),yft=Ti();n_.generateDefaultModule=(0,yft.generateFileFromTemplate)(gft.default.join(zae.USER_MODULES_DIR_NAME,zae.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var Wae=h(i_=>{"use strict";var Eft=i_&&i_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i_,"__esModule",{value:!0});i_.generateDevPortalConfigJson=void 0;var bft=Eft(require("path")),Kae=kt(),Sft=Ti();i_.generateDevPortalConfigJson=(0,Sft.generateFileFromTemplate)(bft.default.join(Kae.USER_CONFIG_DIR_NAME,Kae.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Yae=h(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.generateEnvironment=void 0;var vft=Ti();R1.generateEnvironment=(0,vft.generateFileFromTemplate)(".env","env.template")});var Jae=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.generateESLint=void 0;var Oft=Ti();C1.generateESLint=(0,Oft.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Xae=h($1=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});$1.generateGitignore=void 0;var Ift=Ti();$1.generateGitignore=(0,Ift.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var Qae=h(s_=>{"use strict";var Pft=s_&&s_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s_,"__esModule",{value:!0});s_.generateLaunchJson=void 0;var wft=Pft(require("path")),Tft=Ti();s_.generateLaunchJson=(0,Tft.generateFileFromTemplate)(wft.default.join(".vscode","launch.json"),"launch.template.jsonc")});var eue=h(o_=>{"use strict";var Nft=o_&&o_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o_,"__esModule",{value:!0});o_.generateRouteOasConfig=void 0;var Aft=Nft(require("path")),Zae=kt(),Rft=Ti();o_.generateRouteOasConfig=(0,Rft.generateFileFromTemplate)(Aft.default.join(Zae.USER_CONFIG_DIR_NAME,Zae.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var nue=h(qs=>{"use strict";var tk=qs&&qs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0});qs.updateProjectPackageJson=qs.getProjectPackageJson=qs.getPackageOverrides=qs.generateDefaultPackageJson=void 0;var tue=tk(require("fs/promises")),rk=tk(require("path")),Cft=tk(Xs());async function $ft(e,t=Cft.default.USE_MONOREPO_PACKAGES){let r={name:e,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(t){let n=rue();r.overrides=n,r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"],r.devDependencies&&"@zuplo/core"in r.devDependencies&&(r.devDependencies["@zuplo/core"]=n["@zuplo/core"]),"@zuplo/core"in r.dependencies&&(r.dependencies["@zuplo/core"]=n["@zuplo/core"])}return r}s($ft,"generateDefaultPackageJson");qs.generateDefaultPackageJson=$ft;function rue(){let e=rk.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${e}/core`,"@zuplo/runtime":`file:${e}/runtime`,"@zuplo/debug":`file:${e}/debug`,"@zuplo/errors":`file:${e}/errors`}}s(rue,"getPackageOverrides");qs.getPackageOverrides=rue;async function Dft(e){let t=rk.default.join(e,"package.json"),r=await tue.default.readFile(t,"utf-8");return JSON.parse(r)}s(Dft,"getProjectPackageJson");qs.getProjectPackageJson=Dft;async function Lft(e,t){let r=rk.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await tue.default.writeFile(r,n,"utf-8")}s(Lft,"updateProjectPackageJson");qs.updateProjectPackageJson=Lft});var oue=h(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});D1.generatePackageJson=void 0;var iue=nue(),sue=rc(),jft=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,iue.generateDefaultPackageJson)(t);try{await(0,iue.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new sue.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new sue.PluginResult},"generatePackageJson");D1.generatePackageJson=jft});var uue=h(a_=>{"use strict";var Mft=a_&&a_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a_,"__esModule",{value:!0});a_.generatePoliciesConfig=void 0;var Uft=Mft(require("path")),aue=kt(),xft=Ti();a_.generatePoliciesConfig=(0,xft.generateFileFromTemplate)(Uft.default.join(aue.USER_CONFIG_DIR_NAME,aue.POLICIES_CONFIG_FILE),"policies.template.json")});var cue=h(u_=>{"use strict";var qft=u_&&u_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u_,"__esModule",{value:!0});u_.generateSettingsJson=void 0;var Fft=qft(require("path")),kft=Ti();u_.generateSettingsJson=(0,kft.generateFileFromTemplate)(Fft.default.join(".vscode","settings.json"),"settings.template.jsonc")});var lue=h(L1=>{"use strict";Object.defineProperty(L1,"__esModule",{value:!0});L1.generateTSConfig=void 0;var Bft=Ti();L1.generateTSConfig=(0,Bft.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var due=h(c_=>{"use strict";var Gft=c_&&c_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c_,"__esModule",{value:!0});c_.generateZuploJson=void 0;var Vft=Yo(),zft=require("fs/promises"),Hft=Gft(require("path")),Kft=kt(),fue=rc(),Wft=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:Vft.DEFAULT_COMPATIBILITY_DATE},i=Hft.default.join(t,Kft.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,zft.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new fue.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new fue.PluginResult},"generateZuploJson");c_.generateZuploJson=Wft});var _ue=h(l_=>{"use strict";var mue=l_&&l_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l_,"__esModule",{value:!0});l_.create=void 0;var pue=wae(),Yft=mue(gn()),Jft=require("fs/promises"),Xft=mue(require("path")),Qft=rc(),hue=ek(),Zft=Lae(),edt=Fae(),tdt=Bae(),rdt=Vae(),ndt=Hae(),idt=Wae(),sdt=Yae(),odt=Jae(),adt=Xae(),udt=Qae(),cdt=eue(),ldt=oue(),fdt=uue(),ddt=cue(),pdt=lue(),hdt=due();async function mdt({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,hue.sanitize)(e),o=(0,hue.sanitize)(t),a=Xft.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await Yft.default.dirExists(a))throw new pue.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:pue.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(Zft.createProjectDirs,cdt.generateRouteOasConfig,hdt.generateZuploJson,idt.generateDevPortalConfigJson,ndt.generateDefaultModule,tdt.generateDefaultDocsSidebar,edt.generateDefaultDocsMarkdown,rdt.generateDefaultDocsTheme,fdt.generatePoliciesConfig),c.push(pdt.generateTSConfig,adt.generateGitignore,ldt.generatePackageJson,sdt.generateEnvironment,odt.generateESLint,udt.generateLaunchJson,ddt.generateSettingsJson);let{errors:l,warnings:f}=await(0,Qft.runPlugins)(c,u);if(f.length>0&&f.forEach(_=>{n.warn(_)}),l.length>0){await(0,Jft.rm)(a,{recursive:!0,force:!0});let _=l[0];throw _ instanceof Error?_:new Error(_.message)}return{sourceDirectory:a,projectName:e}}s(mdt,"create");l_.create=mdt});var Sue=h((Zqt,bue)=>{bue.exports=Eue;Eue.sync=gdt;var gue=require("fs");function _dt(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}s(_dt,"checkPathExt");function yue(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:_dt(t,r)}s(yue,"checkStat");function Eue(e,t,r){gue.stat(e,function(n,i){r(n,n?!1:yue(i,e,t))})}s(Eue,"isexe");function gdt(e,t){return yue(gue.statSync(e),e,t)}s(gdt,"sync")});var wue=h((tFt,Pue)=>{Pue.exports=Oue;Oue.sync=ydt;var vue=require("fs");function Oue(e,t,r){vue.stat(e,function(n,i){r(n,n?!1:Iue(i,t))})}s(Oue,"isexe");function ydt(e,t){return Iue(vue.statSync(e),t)}s(ydt,"sync");function Iue(e,t){return e.isFile()&&Edt(e,t)}s(Iue,"checkStat");function Edt(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),f=u|c,d=r&l||r&c&&i===a||r&u&&n===o||r&f&&o===0;return d}s(Edt,"checkMode")});var Nue=h((iFt,Tue)=>{var nFt=require("fs"),j1;process.platform==="win32"||global.TESTING_WINDOWS?j1=Sue():j1=wue();Tue.exports=nk;nk.sync=bdt;function nk(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){nk(e,t||{},function(o,a){o?i(o):n(a)})})}j1(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(nk,"isexe");function bdt(e,t){try{return j1.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(bdt,"sync")});var jue=h((oFt,Lue)=>{var f_=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Aue=require("path"),Sdt=f_?";":":",Rue=Nue(),Cue=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),$ue=s((e,t)=>{let r=t.colon||Sdt,n=e.match(/\//)||f_&&e.match(/\\/)?[""]:[...f_?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=f_?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=f_?i.split(r):[""];return f_&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),Due=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=$ue(e,t),a=[],u=s(l=>new Promise((f,d)=>{if(l===n.length)return t.all&&a.length?f(a):d(Cue(e));let _=n[l],m=/^".*"$/.test(_)?_.slice(1,-1):_,g=Aue.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(c(y,l,0))}),"step"),c=s((l,f,d)=>new Promise((_,m)=>{if(d===i.length)return _(u(f+1));let g=i[d];Rue(l+g,{pathExt:o},(y,b)=>{if(!y&&b)if(t.all)a.push(l+g);else return _(l+g);return _(c(l,f,d+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),vdt=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=$ue(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=Aue.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let _=f+n[d];try{if(Rue.sync(_,{pathExt:i}))if(t.all)o.push(_);else return _}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Cue(e)},"whichSync");Lue.exports=Due;Due.sync=vdt});var sk=h((uFt,ik)=>{"use strict";var Mue=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");ik.exports=Mue;ik.exports.default=Mue});var Fue=h((lFt,que)=>{"use strict";var Uue=require("path"),Odt=jue(),Idt=sk();function xue(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let a;try{a=Odt.sync(e.command,{path:r[Idt({env:r})],pathExt:t?Uue.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=Uue.resolve(i?e.options.cwd:"",a)),a}s(xue,"resolveCommandAttempt");function Pdt(e){return xue(e)||xue(e,!0)}s(Pdt,"resolveCommand");que.exports=Pdt});var kue=h((dFt,ak)=>{"use strict";var ok=/([()\][%!^"`<>&|;, *?])/g;function wdt(e){return e=e.replace(ok,"^$1"),e}s(wdt,"escapeCommand");function Tdt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ok,"^$1"),t&&(e=e.replace(ok,"^$1")),e}s(Tdt,"escapeArgument");ak.exports.command=wdt;ak.exports.argument=Tdt});var Gue=h((hFt,Bue)=>{"use strict";Bue.exports=/^#!(.*)/});var zue=h((mFt,Vue)=>{"use strict";var Ndt=Gue();Vue.exports=(e="")=>{let t=e.match(Ndt);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Kue=h((_Ft,Hue)=>{"use strict";var uk=require("fs"),Adt=zue();function Rdt(e){let r=Buffer.alloc(150),n;try{n=uk.openSync(e,"r"),uk.readSync(n,r,0,150,0),uk.closeSync(n)}catch{}return Adt(r.toString())}s(Rdt,"readShebang");Hue.exports=Rdt});var Xue=h((yFt,Jue)=>{"use strict";var Cdt=require("path"),Wue=Fue(),Yue=kue(),$dt=Kue(),Ddt=process.platform==="win32",Ldt=/\.(?:com|exe)$/i,jdt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Mdt(e){e.file=Wue(e);let t=e.file&&$dt(e.file);return t?(e.args.unshift(e.file),e.command=t,Wue(e)):e.file}s(Mdt,"detectShebang");function Udt(e){if(!Ddt)return e;let t=Mdt(e),r=!Ldt.test(t);if(e.options.forceShell||r){let n=jdt.test(t);e.command=Cdt.normalize(e.command),e.command=Yue.command(e.command),e.args=e.args.map(o=>Yue.argument(o,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(Udt,"parseNonShell");function xdt(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Udt(n)}s(xdt,"parse");Jue.exports=xdt});var ece=h((bFt,Zue)=>{"use strict";var ck=process.platform==="win32";function lk(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(lk,"notFoundError");function qdt(e,t){if(!ck)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=Que(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(qdt,"hookChildProcess");function Que(e,t){return ck&&e===1&&!t.file?lk(t.original,"spawn"):null}s(Que,"verifyENOENT");function Fdt(e,t){return ck&&e===1&&!t.file?lk(t.original,"spawnSync"):null}s(Fdt,"verifyENOENTSync");Zue.exports={hookChildProcess:qdt,verifyENOENT:Que,verifyENOENTSync:Fdt,notFoundError:lk}});var nce=h((vFt,d_)=>{"use strict";var tce=require("child_process"),fk=Xue(),dk=ece();function rce(e,t,r){let n=fk(e,t,r),i=tce.spawn(n.command,n.args,n.options);return dk.hookChildProcess(i,n),i}s(rce,"spawn");function kdt(e,t,r){let n=fk(e,t,r),i=tce.spawnSync(n.command,n.args,n.options);return i.error=i.error||dk.verifyENOENTSync(i.status,n),i}s(kdt,"spawnSync");d_.exports=rce;d_.exports.spawn=rce;d_.exports.sync=kdt;d_.exports._parse=fk;d_.exports._enoent=dk});var sce=h((IFt,ice)=>{"use strict";ice.exports=e=>{let t=typeof e=="string"?`
302
+ `},nodePaths:cae,entryPoints:[a],...c,sourcemap:"linked",legalComments:"linked",treeShaking:!0,bundle:!0,...u,external:[],logLevel:"silent",conditions:Zc.BUILD_CONDITIONS,plugins:[(0,Zut.environmentPlugin)({sourceDirectory:n}),(0,Xut.blockRemoteModulePlugin)({logger:i}),(0,rct.openApiRoutesPlugin)({sourceDirectory:n,outputDirectory:r}),(0,nct.rawRoutePlugin)({sourceDirectory:n,logger:i}),(0,sct.schemaValidationPlugin)({sourceDirectory:n,logger:i,isOpenApiBased:!0}),(0,ict.runtimeConfigPlugin)(),(0,Qut.devPortalConfigPlugin)({sourceDirectory:n}),(0,ect.jsonSchemaPlugin)({sourceDirectory:n,outputDirectory:r}),(0,tct.nodejsCompatPlugin)({nodeCompatEnabled:o?.esmWorker===!0,sourceDirectory:n})]}}s(act,"getBaseESBuildConfig");Zc.default=act});var v1=h(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatBuildResult=Ms.BUILD_TASK_PLUGIN_NAME=Ms.ESBUILD_PLUGIN_NAME=void 0;Ms.ESBUILD_PLUGIN_NAME="run-esbuild";Ms.BUILD_TASK_PLUGIN_NAME="build-task";var uct=s((e,t)=>{let r=t;if(t.includes(e)){let n=new RegExp(`.*(${e})`,"g");r=t.replace(n,"")}return r.match(/^(\/)?(\.\.(\/)?)+/)&&(r=r.replace(/^(\/)?(\.\.(\/)?)+/,"/")),r},"removePrefixFromString"),cct=s((e,t)=>{let r=t;if(r.includes(e)){let n=new RegExp(`[a-zA-Z0-9-_.\\/]+(${e})`,"g");r=r.replace(n,"")}return r},"cleanFilePathsInMessage"),S1=s((e,t,r)=>{if(!e||e.length<=0)return e;let n=e.filter(i=>i.message!=='Could not resolve "@zuplo/runtime"');return n&&n.length>0&&n.forEach(i=>{i.location&&i.location.file&&(i.location.file=uct(t,i.location.file)),i.location&&i.location.lineText&&i.location.lineText.includes("@zuplo/core/index.minified.js")&&(i.location.lineText=i.location.lineText.substring(0,200)+"...<Truncated>"),i.message=cct(t,i.message),i.notes&&i.notes.length>0&&delete i.notes,i.text&&delete i.text,i.pluginName===""&&(i.pluginName=r)}),n},"cleanDataOnBuildIssue");function lct(e,t,r){try{e.buildTaskResult&&(e.buildTaskResult.errors&&(e.buildTaskResult.errors=S1(e.buildTaskResult.errors,t,Ms.BUILD_TASK_PLUGIN_NAME)),e.buildTaskResult.warnings&&(e.buildTaskResult.warnings=S1(e.buildTaskResult.warnings,t,Ms.BUILD_TASK_PLUGIN_NAME))),e.compilerResult&&(e.compilerResult.errors&&(e.compilerResult.errors=S1(e.compilerResult.errors,t,Ms.ESBUILD_PLUGIN_NAME)),e.compilerResult.warnings&&(e.compilerResult.warnings=S1(e.compilerResult.warnings,t,Ms.ESBUILD_PLUGIN_NAME)))}catch(n){r.error("Error while formatting buildResult. Err: ",n)}return e}s(lct,"formatBuildResult");Ms.formatBuildResult=lct});var dae=h(Us=>{"use strict";var fct=Us&&Us.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),dct=Us&&Us.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pct=Us&&Us.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&fct(t,e,r);return dct(t,e),t},fae=Us&&Us.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getRunEsBuildPlugin=void 0;var hct=Gf(),lae=Yo(),mct=pct(require("esbuild")),_ct=fae(_n()),gct=$I(),yct=fae(H2()),K2=v1(),Ect=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,generateSourceMaps:a,buildId:u,logger:c,config:l}){return _ct.default.timeFn("Running esbuild",async()=>{c.info(`Running build_id: ${u}`);let f=await(0,yct.default)({systemDirectory:r,outputDirectory:n,generateSourceMaps:a,sourceDirectory:i,dev:o,logger:c,flags:l.flags}),d,_=new Date;try{if(!await(0,hct.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");d=await mct.build(f)}catch(g){if(c.error(g),g.errors||g.warnings)d=g;else if(g.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))d={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:K2.ESBUILD_PLUGIN_NAME,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw g}let m=new Date;if(e(new gct.CompilerResult(d,{endBuildTime:m,startBuildTime:_,buildId:u??""})),d.errors.length>0){d.errors.length>1&&(d.errors.length=1);let g=d.errors[0];c.debug(g)}return{warnings:[...d.warnings.map(g=>({message:g.text,pluginName:K2.ESBUILD_PLUGIN_NAME,severity:lae.WARNING_SEVERITY}))],errors:[...d.errors.map(g=>({message:g.text,pluginName:K2.ESBUILD_PLUGIN_NAME,severity:lae.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Us.getRunEsBuildPlugin=Ect});var Y2=h(Ym=>{"use strict";var hae=Ym&&Ym.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ym,"__esModule",{value:!0});Ym.build=void 0;var Wm=Yo(),bct=require("crypto"),Sct=require("fs"),WE=hae(require("path")),pae=kt(),vct=rc(),Oct=hae(_n()),Ict=Gz(),Pct=zz(),wct=Hz(),Tct=Kz(),Nct=Xz(),Act=Qz(),Rct=rH(),Cct=d9(),$ct=h9(),Dct=dae(),W2=v1(),O1;try{let e=(0,Sct.readFileSync)(WE.default.resolve(__dirname,"../../package.json"),"utf-8");O1=JSON.parse(e).version}catch{O1="0.0.0"}async function Lct({sourceDirectory:e,deploymentName:t=WE.default.basename(e),dev:r,entitlements:n,environmentType:i,generateSourceMaps:o=!1,logger:a,noCompile:u=!1,postBuildTasks:c,projectId:l,publicZuploEnvironmentVariables:f={}}){let d=(0,bct.randomUUID)(),_=a.child({buildId:d});return Oct.default.timeFn(`Run build with build_id: ${d}`,async()=>{let m=await(0,Ict.getZuploConfig)(e),g=WE.default.join(e,pae.BUILD_OUTPUT_DIR),y;if("errors"in m)y={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:O1,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:Wm.FAILURE_STATUS,buildId:d,warnings:[],errors:m.errors}};else{let E={dev:r,generateSourceMaps:o,deploymentName:t,sourceDirectory:e,outputDirectory:g,systemDirectory:WE.default.join(e,pae.GENERATED_SOURCE_DIR_NAME),buildId:d,logger:_,config:m.config,publicZuploEnvironmentVariables:f,projectId:l,entitlements:n,environmentType:i},v=[];v.push(Pct.cleanOutput),v.push(wct.createSystemDir),v.push(Tct.checkForDeprecations),v.push(Nct.generateBuildData),v.push(Rct.validateDevPortalJSON),v.push(Cct.validateOpenAPIFiles),v.push(Act.generateWorker);let O,P=s(V=>{O=V},"compileCallback");u||v.push((0,Dct.getRunEsBuildPlugin)(P)),v.push($ct.verifyWorkerOutput),c&&v.push(...c);let w=await(0,vct.runPlugins)(v,E),D=w.errors.length>0?Wm.FAILURE_STATUS:w.warnings.length>0?Wm.WARNING_STATUS:Wm.GOOD_STATUS;y={status:D==="Failed"||O===void 0||O.status==="Failed"?"Failed":D==="Warnings"||O.status==="Warnings"?"Warnings":"Good",compatibilityDate:m.config.compatibilityDate,runtimeVersion:O1,outputPath:g,compilerResult:O,buildTaskResult:{buildTime:"",buildTimeMs:0,status:D,buildId:d,warnings:w.warnings,errors:w.errors},flags:m.config.flags}}if(y.buildTaskResult.warnings.length>0){y.buildTaskResult.warnings.forEach(v=>{_.warn(v)});let E=y.buildTaskResult.warnings.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==W2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.warnings=E),y.buildTaskResult.status=Wm.WARNING_STATUS}if(y.buildTaskResult.errors.length>0){y.buildTaskResult.errors.forEach(v=>{_.error(v)});let E=y.buildTaskResult.errors.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==W2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.errors=E),y.buildTaskResult.status=Wm.FAILURE_STATUS}if(_.debug(`Build ${y.compilerResult?.buildId??d} completed ${u?"on watch mode":"with compiler status "+y.compilerResult?.status} and build task status ${y.buildTaskResult.status}`),y.compilerResult){let{metafile:E,...v}=y.compilerResult;_.debug(`Compiler results for build ${y.compilerResult?.buildId??d}`,v)}_.debug(`Build task results for build ${y.buildTaskResult?.buildId??d}`,y.buildTaskResult);let b=WE.default.basename(e);return(0,W2.formatBuildResult)(y,b,_)})}s(Lct,"build");Ym.build=Lct});var P1=h(xs=>{"use strict";var jct=xs&&xs.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mct=xs&&xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uct=xs&&xs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&jct(t,e,r);return Mct(t,e),t},I1=xs&&xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.BuildWatcher=void 0;var mae=Yo(),xct=I1(require("chokidar")),qct=Uct(require("esbuild")),_ae=require("crypto"),Fct=I1(require("events")),YE=I1(require("path")),gae=kt(),kct=Y2(),yae=$I(),Bct=I1(H2()),Eae=v1(),J2=class extends Fct.default{static{s(this,"WatchEmitter")}},X2=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new J2;envFilesWatcher;outputDirectory;sourceDirectory;dev;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,generateSourceMaps:n,logger:i,publicZuploEnvironmentVariables:o={}}){this.sourceDirectory=t,this.dev=r,this.outputDirectory=YE.default.join(t,gae.BUILD_OUTPUT_DIR),this.generateSourceMaps=n??!1,this.logger=i,this.publicZuploEnvironmentVariables=o,this.projectName=YE.default.basename(t),this.envFilesWatcher=xct.default.watch([YE.default.join(t,".env"),YE.default.join(t,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",async()=>{this.emitter.emit("reload",null,null)})}onReload=t=>{this.emitter.on("reload",t)};async start(){let{sourceDirectory:t}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let r=await(0,kct.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,Bct.default)({systemDirectory:YE.default.join(t,gae.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,sourceDirectory:t,dev:this.dev,generateSourceMaps:this.generateSourceMaps,logger:this.logger,flags:r.flags}),i=this;n.plugins?.push({name:"on-end",setup(o){o.onEnd(a=>{i.logger.debug("Watcher (build) reloaded");let u;if(a)if(u=new yae.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:mae.FAILURE_STATUS,buildId:(0,_ae.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,Eae.formatBuildResult)(c,i.projectName,i.logger),i.logger.error(c.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${u.buildId}`);i.emitter.emit("reload",r,null,u)})}}),this.esbuildContext=await qct.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let a={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:mae.FAILURE_STATUS,buildId:(0,_ae.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new yae.CompilerResult(o),(0,Eae.formatBuildResult)(a,this.projectName,this.logger),this.logger.error(a.compilerResult.errors,"Build errors")}}catch(o){throw await this.close(),o}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(t){this.logger.error(t)}}};xs.BuildWatcher=X2});var Q2=h(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});w1.HttpStatusCode=void 0;var bae;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(bae||(w1.HttpStatusCode=bae={}))});var Sae=h(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});T1.getSourceControlProviderLabel=void 0;function Gct(e){let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="BitBucket";break;default:t=e;break}return t}s(Gct,"getSourceControlProviderLabel");T1.getSourceControlProviderLabel=Gct});var Oae=h(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_NO_ACCESS=S.INVALID_SOURCE_REPO_URL=S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=S.PROJECT_MUST_HAVE_ONE_MEMBER=S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=S.PROJECT_MEMBER_ALREADY_EXISTS=S.PROJECT_MEMBER_NOT_FOUND=S.INVALID_TEMPLATE_REPOSITORY=S.INCORRECT_PROJECT_TEMPLATE=S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=S.PROJECT_NOT_FOUND=S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=S.PROJECT_SHARING_DISABLED_ON_ACCOUNT=S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=S.ACCOUNT_MEMBER_INVITE_INVALID=S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_INFO_MISSING=S.ACCOUNT_MEMBER_ALREADY_EXISTS=S.ACCOUNT_UPDATE_INFO_MISSING=S.ACCOUNT_INFO_MISSING=S.ACCOUNT_DOES_NOT_EXISTS=S.INVALID_ACCOUNT_LABEL_ENDING=S.INVALID_ACCOUNT_NAME_ENDING=S.ACCOUNT_NAME_ALREADY_IN_USE=S.INVALID_ACCOUNT_LABEL=S.INVALID_ACCOUNT_NAME=S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=S.ACCOUNT_NAME_USES_RESERVED_KEYWORD=S.ACCOUNT_ALREADY_EXISTS=S.ACCOUNT_NOT_FOUND=S.USER_IS_NOT_SERVICE_ACCOUNT=S.USER_REMOVE_NOT_MEMBER_ACCOUNT=S.USER_HAS_NO_ACCESS_TO_ACCOUNT=S.USER_DETAILS_CANNOT_BE_FOUND=S.USER_ALREADY_EXISTS=S.CLIENT_NOT_FOUND=S.FORBIDDEN=S.UNAUTHORIZED=S.METHOD_NOT_ALLOWED=S.NOT_FOUND=S.CONFLICT=S.BAD_REQUEST=S.INTERNAL_SERVER_ERROR=void 0;S.GITHUB_INTEGRATION_ALREADY_EXISTS=S.FEATURE_FLAGS_NOT_FOUND=S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=S.PROJECT_ALREADY_HAS_REPO=S.PROJECT_INVALID_NAME=S.FAILED_TO_REVOKE_GH_TOKEN=S.USER_ACCOUNT_NOT_FS_MIGRATED=S.USER_NO_ACCESS_GITLAB_REPO=S.USER_NO_ACCESS_BITBUCKET_REPO=S.GITHUB_APP_CONFIGURATION_NOT_FOUND=S.GITHUB_APP_NO_USER_ACCESS_=S.GITHUB_APP_NO_NAMESPACE_ACCESS=S.GENERIC_GITHUB_BRANCH_INFO_ERROR=S.GITHUB_USER_NO_READ_ACCESS_REPO=S.USER_NO_PULL_ACCESS_GITHUB_REPO=S.USER_NO_ACCESS_GITHUB_REPO=S.PROJECT_SHARING_REQUIRES_GIT_REPO=S.PROJECT_INVALID_GIT_REPO=S.PROJECT_INVALID_GIT_CLONE=S.USER_IS_PROJECT_MEMBER=S.USER_HAS_NO_ACCESS_TO_PROJECT=S.RUNTIME_FLAG_KEY_NOT_VALID=S.RUNTIME_FLAG_NOT_FOUND=S.RUNTIME_FLAG_ALREADY_EXISTS=S.PROJECT_NO_MEMBERS=S.PROJECT_ALREADY_EXISTS=S.SERVICE_CONFIGURATION_FAILED_DECRYPTION=S.WORKING_COPY_SERVICE_NOT_CREATED=S.WORKING_COPY_SERVICE_NOT_DELETED=S.WORKING_COPY_SERVICE_NOT_FOUND=S.SERVICE_CONFIGURATION_NOT_FOUND=S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=S.DEPLOYMENT_INCORRECT_STATUS_PAUSE=S.DEPLOYMENT_NOT_WORKING_COPY=S.DEPLOYMENT_LOG_NOT_FOUND=S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=S.DEPLOYMENT_DELETE_ERROR=S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_DIR_DOES_NOT_EXISTS=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=void 0;S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS=S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=S.SOURCE_CONTROL_REPO_OPERATION_ERROR=S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=S.SOURCE_CONTROL_REPO_NOT_FOUND=S.SOURCE_CONTROL_AUTHENTICATION_FAILED=S.EXTERNAL_SERVICE_GENERIC_ERROR=S.API_USER_NO_ACCESS=S.EXTERNAL_USER_NOT_CONFIGURED=S.EXTERNAL_USER_NO_ACCESS=S.API_KEY_CANNOT_BE_CREATED=S.CONSUMER_CANNOT_BE_CREATED=S.CONSUMER_DOES_NOT_EXIST=S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=S.GITLAB_DUPLICATE_REPO=S.GITLAB_FAILED_DURING_REPO_CREATION=S.GITLAB_QUERY_USER_INFO_FAILED=S.BITBUCKET_FAILED_DURING_REPO_CREATION=S.BITBUCKET_WORKSPACE_MISCONFIGURATION=S.BITBUCKET_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=S.GITHUB_INTEGRATION_DUPLICATE_REPO=S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=S.GITHUB_INTEGRATION_BRANCH_BEHIND=S.GITHUB_INTEGRATION_NOT_FOUND=S.GITHUB_REPOSITORY_NOT_FOUND=S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=void 0;S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS=S.RBACCONFIGURATION_DOES_NOT_EXISTS=S.RBAC_INVALID_EXPIRATION_DATE=S.ACCOUNT_RBAC_DISABLED=S.METERING_BUCKET_CREATION_FAILED=S.UNABLE_UPGRADE_PLAN=S.BUCKET_NOT_FOUND=S.BUCKET_API_KEY_SERVICE_CONFLICT=S.DIRECTORY_DELETE_FAILED=S.FILE_DELETE_FAILED=S.CANNOT_DELETE_SOLE_OPEN_API_FILE=S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=S.CANNOT_DELETE_ESSENTIAL_FILE=S.FILE_WRITE_FAILED=S.FILE_RENAME_FAILED=S.FILE_RENAME_FILE_ALREADY_EXISTS=S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=S.FILE_RENAME_PATHS_MATCH=S.DIRECTORY_CREATION_FAILED=S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=S.DIRECTORY_DOES_NOT_EXIST=S.DIRECTORY_ALREADY_EXISTS=S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=S.FAILED_DOWNLOAD_FROM_STORAGE=S.CANNOT_FIND_SRC_DIRECTORY=S.CANNOT_READ_PACKAGE_JSON=S.PACKAGE_JSON_NOT_FOUND=S.RUNTIME_VERSION_INCORRECT_FORMAT=S.MIGRATIONS_ONLY_ON_WORKING_COPY=S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=S.NO_GLOBAL_SYMBOLS=S.NO_ZUPLO_PREFIXED_VARIABLES=S.NON_EMPTY_TARGETS_REQUIRED=S.CONFLICTING_TYPES=S.OVERLAPPING_TARGETS=S.INVALID_BRANCH_NAME=S.TARGET_BRANCH_ONLY_FOR_PREVIEW=S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=S.DEPLOYMENT_NAME_MISSING=S.NON_EXISTENT_ENVIRONMENT_VARIABLE=S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=S.DUPLICATE_ENVIRONMENT_VARIABLE=S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=void 0;S.ACCOUNT_MISCONFIGURED_FOR_RBAC=S.ACCOUNT_ALREADY_RBAC_ENABLED=S.MISCONFIGURED_ENV_VAR=S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS=S.USER_HAS_NO_PROD_ENV_VAR_ACCESS=S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE=S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_CANNOT_EDIT_OWN_ROLE=S.USER_DOES_NOT_EXIST=S.INVALID_USER_ROLE=S.USER_HAS_NO_ACCESS_TO_CONSUMER=S.RBACCONFIGURATION_CONSUMER_LOCKED=S.RBACCONFIGURATION_MISCONFIGURATION=S.RBACCONFIGURATION_DELETE_MISCONFIGURATION=S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG=S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED=S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS=S.RBACCONFIGURATION_REQUIRE_PROJECTS=S.RBACCONFIGURATION_INVALID_ENVIRONMENTS=void 0;var T=Q2(),vae=Sae(),Vct="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:T.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:T.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:T.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:T.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:T.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:T.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:T.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Forbidden",detail:"You are not authorized to access the account resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_REMOVE_NOT_MEMBER_ACCOUNT={type:"https://zup.fail/removed-user-not-account-member",title:"The user being removed is not a member of the account",status:T.HttpStatusCode.BAD_REQUEST};S.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:T.HttpStatusCode.CONFLICT};S.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD={type:"https://zup.fail/account-use-reserved-keyword",title:"The account name can not start with a reserved keyword",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-name-length-limit",title:"The account name exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-label-length-limit",title:"The account label exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME={type:"https://zup.fail/invalid-account-name",title:"The account name can only contain lower-cased characters, numbers, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL={type:"https://zup.fail/invalid-account-label",title:"The account label can only contain alpha-numeric characters, spaces, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_ALREADY_IN_USE={type:"https://zup.fail/account-name-in-use",title:"The account name is already taken. Please try again using a different name.",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME_ENDING={type:"https://zup.fail/invalid-account-name-ending",title:"The account name can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL_ENDING={type:"https://zup.fail/invalid-account-label-ending",title:"The account label can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"Not Found",detail:"The account does not exist.",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND={type:"https://zup.fail/account-member-invite-failed-send",title:"We were not able to send the account member invite. Please try again or contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:T.HttpStatusCode.BAD_REQUEST};S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE={type:"https://zup.fail/existing-pending-account-member-invites",title:"The user has a pending invitation to this account.",status:T.HttpStatusCode.BAD_REQUEST};S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED={type:"https://zup.fail/account-members-limit-reached",title:"This account has reached the limit of users allowed by its current billing plan.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:T.HttpStatusCode.FORBIDDEN};S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS={type:"https://zup.fail/project-cannot-be-deleted-protected-deployments-exists",title:"Project cannot be deleted because it has protected deployments",detail:"Project has protected deployments. Make sure to remove the use of custom domains before trying to delete the project.",status:T.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:T.HttpStatusCode.BAD_REQUEST};var zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:T.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=zct;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS={type:"https://zup.fail/cannt-delete-your-own-project-member",title:"Can not delete your own Project Member record",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:T.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_SOURCE_REPO_URL={type:"https://zup.fail/invalid-source-repo-url",title:"Project is not connected to source control, a sourceRepoUrl property must be specified and valid",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH={type:"https://zup.fail/deployment-branch-does-not-exist",title:"A deployment record cannot be found for the provided branch.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST={type:"https://zup.fail/default-deployment-does-not-exist",title:"A default deployment record cannot be found for the project.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DIR_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-dir-does-not-exists",title:"NOT FOUND",detail:"Deployment directory was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED={type:"https://zup.fail/deployment-is-protected-cannot-be-deleted",title:"Deployment is protected and cannot be deleted",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid account",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid project name",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid user sub",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY={type:"https://zup.fail/deployment-cannot-be-deleted",title:"Deployment cannot be deleted since is a working copy",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:T.HttpStatusCode.BAD_REQUEST};S.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Forbidden",detail:"You are not a member of the project",status:T.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_REPO={type:"https://zup.fail/project-invalid-git-repo",title:"The current source control repository is already in use by a Zuplo project",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_REQUIRES_GIT_REPO={type:"https://zup.fail/project-sharing-requires-git-repo",title:"The current project is not connected to a source control repository.",status:T.HttpStatusCode.BAD_REQUEST};var Hct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=Hct;var Kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have pull access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=Kct;var Wct=s(({repositoryUrl:e})=>({type:"https://zup.fail/no-read-access-github-repo",title:"You do not have read access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=Wct;S.GENERIC_GITHUB_BRANCH_INFO_ERROR={type:"https://zup.fail/gh-branch-info-error",title:"There was an error getting branch information for the GitHub repository associated to the project.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_APP_NO_NAMESPACE_ACCESS={type:"https://zup.fail/no-namespace-access-github-app",title:"The Zuplo GitHub app does not have access to the repositories under the namespace provided. Make sure to configure the GitHub Zuplo App on the repository.",status:T.HttpStatusCode.FORBIDDEN};var Yct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:"The Zuplo GitHub app does not have access to the repository. Make sure to configure the GitHub Zuplo App on the repository.",detail:`The Zuplo GitHub app has not been granted access to the repository '${e}'. Go to '${Vct}' to add the repository.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=Yct;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:T.HttpStatusCode.NOT_FOUND};var Jct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-bitbucket-repo",title:"You do not have access to the Bitbucket repository associated to the project. Ask your Bitbucket admin for access and try again.",detail:`User does not have access to the Bitbucket repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=Jct;var Xct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-gitlab-repo",title:"You do not have access to the GitLab repository associated to the project. Ask your GitLab admin for access and try again.",detail:`User does not have access to the GitLab repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=Xct;S.USER_ACCOUNT_NOT_FS_MIGRATED={type:"https://zup.fail/user-account-not-fs-migrated",title:"User account is in a plan that does not allow project sharing. Please contact your account admin.",status:T.HttpStatusCode.FORBIDDEN};S.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_HAS_REPO={type:"https://zup.fail/project-already-has-repo",title:"The current project has been previously linked to a source control repository",status:T.HttpStatusCode.BAD_REQUEST};S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED={type:"https://zup.fail/max-allowed-projects-limit-reached",title:"Your account has reached the maximum number of projects allowed.",status:T.HttpStatusCode.BAD_REQUEST};S.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:T.HttpStatusCode.BAD_REQUEST};var Qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:T.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=Qct;var Zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:T.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=Zct;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:T.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};S.GITHUB_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/github-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED={type:"https://zup.fail/github-integration-query-user-info-failed",title:"Failed while requesting basic user info from GitHub",status:T.HttpStatusCode.FORBIDDEN};var elt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${e}' already exists on GitHub org '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=elt;var tlt=s(({repositoryName:e,details:t})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:t,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=tlt;var rlt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-empty-repo",title:"The repository is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=rlt;var nlt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-git-repo",title:"We can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=nlt;var ilt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-invalid-repo",title:"We can only connect to an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.",details:`Repository '${e}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=ilt;S.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:T.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:T.HttpStatusCode.FORBIDDEN};var slt=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=slt;S.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:T.HttpStatusCode.FORBIDDEN};var olt=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=olt;var alt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${e}' already exists in GitLab team '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=alt;var ult=s(({orgName:e})=>({type:"https://zup.fail/gitlab-create-repo-perm",title:"The user's GitLab group access level does not allow for repository creation.",details:"The user's GitLab group access level does not allow for repository creation.",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=ult;var clt=s(({namespaceLabel:e})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${e}'.`,details:`The user's GitLab access level does not allow the use of namespace '${e}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=clt;var llt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=llt;S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist or cannot be accessed.",status:T.HttpStatusCode.NOT_FOUND};S.CONSUMER_CANNOT_BE_CREATED={type:"https://zup.fail/consumer-not-created",title:"Failed to create consumer",status:T.HttpStatusCode.BAD_GATEWAY};S.API_KEY_CANNOT_BE_CREATED={type:"https://zup.fail/api-key-not-created",title:"Failed to create api key",status:T.HttpStatusCode.BAD_GATEWAY};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:T.HttpStatusCode.UNAUTHORIZED};S.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:T.HttpStatusCode.FORBIDDEN};S.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:T.HttpStatusCode.FORBIDDEN};S.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};var flt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,vae.getSourceControlProviderLabel)(e)}`,status:T.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=flt;var dlt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-repo-not-found",title:"We cannot connect to the repository associated to the project, verify your source control access configuration and try again.",detail:`Could not connect to ${(0,vae.getSourceControlProviderLabel)(e)} repository`,status:T.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=dlt;S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE={type:"https://zup.fail/source-control-empty-commit",title:"Commit operation failed because you provided an empty message. Please try again by providing a commit message.",status:T.HttpStatusCode.BAD_REQUEST};var plt=s(({repoURL:e,operation:t})=>({type:`https://zup.fail/source-control-repo-${t}-error`,title:`Failed on ${t} operation to repository '${e}'. Verify you have read & write access to the repository and try again.`,detail:"Verify your source control configuration and make sure you have been granted read & write access to the repository",status:T.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=plt;S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE={type:"https://zup.fail/source-control-write-access-issue",title:"You do not have write access to the repository, verify your source control access configuration and try again.",detail:"Verify your source control configuration and make sure you have been granted access to the repository",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:T.HttpStatusCode.NOT_FOUND};S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND={type:"https://zup.fail/source-control-credentials-not-found",title:"Source control credentials not found for this user. Verify your user's source control connection and try again.",status:T.HttpStatusCode.NOT_FOUND};S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-refresh-source-control-credentials",title:"Failed to refresh Source Control credentials. Verify your user's source control connection and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED={type:"https://zup.fail/new-gh-config-required",title:"Current Source Control credentials are using the previous Zuplo GitHup App. Re-authenticate using the latest Zuplo GitHup App via Profile UI and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS={type:"https://zup.fail/gh-app-revoked-access",title:"Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.",status:T.HttpStatusCode.UNAUTHORIZED};S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-revoke-source-control-credentials",title:"Failed to revoke Source Control access token for the user",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING={type:"https://zup.fail/source-control-configuration-info-missing",title:"Source Control Configuration information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING={type:"https://zup.fail/source-control-configuration-bb-workspace-missing",title:"Source Control Configuration for Bitbucket must include a workspace configuration (additionalMetadata).",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION={type:"https://zup.fail/preexisiting-source-control-configuration-on-account",title:"This account already has a Source Control Configuration for this provider.",detail:"This account has a pre-existing Source Control Configuration for this provider. Delete or update the existing configuration.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/source-control-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS={type:"https://zup.fail/source-control-integration-branch-behind",title:"The branch exists in the remote repository. Please try again with a different branch name.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR={type:"https://zup.fail/third-party-app-auth0-clients-endpoint-error",title:"Error Creating an Auth0 Client through tenant api",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST={type:"https://zup.fail/third-party-app-auth0-config-does-not-exist",title:"Auth0 Configuration does not exist for account and environment",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR={type:"https://zup.fail/third-party-app-auth0-client-not-found-error",title:"Third Party App Not Found",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR={type:"https://zup.fail/third-party-app-auth-scope-config-error",title:"API Scope configuration at Auth0 end Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND={type:"https://zup.fail/third-party-app-connection-not-found",title:"Cannot find connection with the given name",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION={type:"https://zup.fail/third-party-app-cannot-link-tpa-to-connection",title:"Cannot link a connection to a third party app",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE={type:"https://zup.fail/environment-variables-cannot-be-retrieved-invalid-env-type",title:"Env vars will not be retrieved since the deployment is from non valid environment type",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:T.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:T.HttpStatusCode.BAD_REQUEST};S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY={type:"https://zup.fail/personal-override-only-for-working-copy",title:"A personal override can only be used for a working-copy environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.TARGET_BRANCH_ONLY_FOR_PREVIEW={type:"https://zup.fail/target-branch-only-for-preview",title:"A target branch can only be used for preview environment variables",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICTING_TYPES={type:"https://zup.fail/conflicting-types",title:"The type of this environment variable conflicts with an existing environment variable with the same name",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:T.HttpStatusCode.BAD_REQUEST};S.NO_ZUPLO_PREFIXED_VARIABLES={type:"https://zup.fail/no-zuplo-prefixed-variables",title:"Environment variables should not start with the reserved prefix of ZUPLO or __ZUPLO",status:T.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE={type:"https://zup.fail/deployer-non-valid-deployment-environment-type",title:"Deployment cannot be different than preview or production",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2={type:"https://zup.fail/deployer-cannot-deploy-using-env-vars-v2",title:"Deployer was not able to deploy zup using environment variables v2",status:T.HttpStatusCode.FORBIDDEN};S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:T.HttpStatusCode.NOT_FOUND};var hlt=s(({operation:e,path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${e} file ${t} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=hlt;var mlt=s(()=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify files on read-only environment",detail:"Cannot save files on a read-only environment. Read-only environments cannot be edited.",status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=mlt;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:T.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:T.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:T.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:T.HttpStatusCode.BAD_REQUEST};var _lt=s(({path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${e} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=_lt;var glt=s(({path:e})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${e} is not allowed.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=glt;var ylt=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=ylt;var Elt=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=Elt;var blt=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=blt;var Slt=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=Slt;var vlt=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${e} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");S.FILE_RENAME_PATHS_MATCH=vlt;var Olt=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=Olt;var Ilt=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${e}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");S.FILE_RENAME_FILE_ALREADY_EXISTS=Ilt;var Plt=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=Plt;var wlt=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=wlt;var Tlt=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=Tlt;var Nlt=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=Nlt;var Alt=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:T.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");S.CANNOT_DELETE_SOLE_OPEN_API_FILE=Alt;var Rlt=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=Rlt;var Clt=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=Clt;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:T.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:T.HttpStatusCode.BAD_REQUEST};S.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.ACCOUNT_RBAC_DISABLED={type:"https://zup.fail/account_rbac_disabled",title:"Forbidden",detail:"Your account does not have fine-grained RBAC feature enabled. Please contact support to enable this feature.",status:T.HttpStatusCode.FORBIDDEN};S.RBAC_INVALID_EXPIRATION_DATE={type:"https://zup.fail/rbac_invalid_expiration_date",title:"Bad Request",detail:"The expiration date provided cannot be in the past. Please provide a valid expiration date.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DOES_NOT_EXISTS={type:"https://zup.fail/rbacconfiguration-does-not-exists",title:"Bad Request",detail:"The api key configuration does not exist or you don't have access to it.",status:T.HttpStatusCode.NOT_FOUND};S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-required-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-invalid-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_REQUIRE_PROJECTS={type:"https://zup.fail/rbacconfiguration-required-projects",title:"Bad Request",detail:"Please provide at least one project to configure access for.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS={type:"https://zup.fail/rbacconfiguration-no-projects",title:"Bad Request",detail:"The account does not have any projects to configure. Please create at least one project before configuring api key access.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED={type:"https://zup.fail/rbacconfiguration-invalid-project",title:"Bad Request",detail:"One or more of the projects provided is not part of the account or does not exist. Make sure all the projects are valid and try again.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG={type:"https://zup.fail/rbacconfiguration-invalid-openfga-config",title:"Bad Gateway",detail:"The provided configuration caused an unexpected error. Please contact support.",status:T.HttpStatusCode.BAD_GATEWAY};S.RBACCONFIGURATION_DELETE_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-delete-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be deleted. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be used. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_CONSUMER_LOCKED={type:"https://zup.fail/rbacconfiguration-consumer-locked",title:"Forbidden",detail:"The provided consumer is locked and can't be modified or deleted.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_CONSUMER={type:"https://zup.fail/forbidden",title:"Forbidden",detail:"You are not authorized to access the consumer resource.",status:T.HttpStatusCode.FORBIDDEN};S.INVALID_USER_ROLE={type:"https://zup.fail/invalid-user-role",title:"Bad Request",detail:"You provided an invalid user role. Valid options include 'admin', 'developer' and 'member'.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_DOES_NOT_EXIST={type:"https://zup.fail/user-does-not-exist",title:"Forbidden",detail:"You are not authorized to access the user resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_CANNOT_EDIT_OWN_ROLE={type:"https://zup.fail/user-edit-itself",title:"Forbidden",detail:"You are not authorized to edit your own access role.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-deploy-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access to deploy this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE={type:"https://zup.fail/account-admin-invalid-project-role-downgrade",title:"Bad Request",detail:"An account administrator cannot be downgraded to a non-administrator role in a project.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_PROD_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-prod-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's production environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-dev-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's preview and development environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.MISCONFIGURED_ENV_VAR={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The environment variable is not correctly configured on any environment. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_ALREADY_RBAC_ENABLED={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The account has been previously migrated to use RBAC.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MISCONFIGURED_FOR_RBAC={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"This account has conflicting account roles and cannot be self-migrated to use RBAC. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST}});var Pae=h(wi=>{"use strict";var $lt=wi&&wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Dlt=wi&&wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Llt=wi&&wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&$lt(t,e,r);return Dlt(t,e),t};Object.defineProperty(wi,"__esModule",{value:!0});wi.ApiNotFoundError=wi.ApiError=wi.Problems=void 0;var Iae=Llt(Oae());wi.Problems=Iae;var N1=class extends Error{static{s(this,"ApiError")}type;status;detail;instance;constructor(t){if(super(t.title),!t.type.startsWith("https://zup.fail/"))throw new Error(`Invalid 'type' specified on ApiError, must be a URI starting with 'https://zup.fail/'. Type was set to ${t.type}`);this.name="ApiProblemError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.instance=t.instance}};wi.ApiError=N1;var Z2=class extends N1{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...Iae.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};wi.ApiNotFoundError=Z2});var wae=h(Pu=>{"use strict";var jlt=Pu&&Pu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mlt=Pu&&Pu.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&jlt(t,e,r)};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.HttpStatusCode=void 0;Mlt(Pae(),Pu);var Ult=Q2();Object.defineProperty(Pu,"HttpStatusCode",{enumerable:!0,get:function(){return Ult.HttpStatusCode}})});var Nae=h((Sqt,Tae)=>{"use strict";function xlt(e){return e>=55296&&e<=56319}s(xlt,"isHighSurrogate");function qlt(e){return e>=56320&&e<=57343}s(qlt,"isLowSurrogate");Tae.exports=s(function(t,r,n){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,a,u,c=0;c<i;c+=1){if(a=r.charCodeAt(c),u=r[c],xlt(a)&&qlt(r.charCodeAt(c+1))&&(c+=1,u+=r[c]),o+=t(u),o===n)return r.slice(0,c+1);if(o>n)return r.slice(0,c-u.length+1)}return r},"truncate")});var Rae=h((Oqt,Aae)=>{"use strict";var Flt=Nae(),klt=Buffer.byteLength.bind(Buffer);Aae.exports=Flt.bind(null,klt)});var ek=h(Jm=>{"use strict";var Blt=Jm&&Jm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jm,"__esModule",{value:!0});Jm.sanitize=void 0;var Glt=Blt(Rae()),Vlt=/[/?<>\\:*|"]/g,zlt=/[\x00-\x1f\x80-\x9f]/g,Hlt=/^\.+$/,Klt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Wlt=/[. ]+$/;function Ylt(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(Vlt,t).replace(zlt,t).replace(Hlt,t).replace(Klt,t).replace(Wlt,t);return(0,Glt.default)(r,255)}s(Ylt,"sanitize");Jm.sanitize=Ylt});var Lae=h(Xm=>{"use strict";var Dae=Xm&&Xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xm,"__esModule",{value:!0});Xm.createProjectDirs=void 0;var Cae=Dae(require("fs/promises")),Jlt=Dae(require("path")),JE=kt(),$ae=rc(),Xlt=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[JE.USER_MODULES_DIR_NAME,JE.USER_CONFIG_DIR_NAME,JE.USER_TEST_DIR_NAME,JE.USER_SCHEMAS_DIR_NAME,JE.USER_DOCS_DIR_NAME,".vscode"];try{await Cae.default.mkdir(e);for(let n of r)await Cae.default.mkdir(Jlt.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new $ae.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new $ae.PluginResult},"createProjectDirs");Xm.createProjectDirs=Xlt});var xae=h(Qm=>{"use strict";var Uae=Qm&&Qm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qm,"__esModule",{value:!0});Qm.generateFromTemplate=void 0;var Qlt=require("fs"),jae=Uae(require("fs/promises")),Mae=Uae(require("path"));async function Zlt(e){let t=Mae.default.resolve(__dirname,"..","templates",e);if((0,Qlt.existsSync)(t))return await jae.default.readFile(t,"utf-8");{let r=Mae.default.resolve(__dirname,"templates",e);return await jae.default.readFile(r,"utf-8")}}s(Zlt,"generateFromTemplate");Qm.generateFromTemplate=Zlt});var Ti=h(Zm=>{"use strict";var A1=Zm&&Zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zm,"__esModule",{value:!0});Zm.generateFileFromTemplate=void 0;var eft=A1(gn()),tft=A1(require("fs/promises")),rft=A1(require("path")),nft=A1(_n()),ift=xae(),sft=s(function(e,t){return async({sourceDirectory:r,logger:n})=>nft.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=rft.default.join(r,e);return await eft.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):oft(i,t,n)})},"generateFileFromTemplate");Zm.generateFileFromTemplate=sft;async function oft(e,t,r){let n=await(0,ift.generateFromTemplate)(t);try{await tft.default.writeFile(e,n,"utf-8"),r.debug(`File written to ${e}`)}catch(i){r.error(i);let o={message:`Error creating file at ${e}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[o]}}return{warnings:[],errors:[]}}s(oft,"writeTemplate")});var Fae=h(e_=>{"use strict";var aft=e_&&e_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e_,"__esModule",{value:!0});e_.generateDefaultDocsMarkdown=void 0;var uft=aft(require("path")),qae=kt(),cft=Ti();e_.generateDefaultDocsMarkdown=(0,cft.generateFileFromTemplate)(uft.default.join(qae.USER_DOCS_DIR_NAME,qae.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Bae=h(t_=>{"use strict";var lft=t_&&t_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t_,"__esModule",{value:!0});t_.generateDefaultDocsSidebar=void 0;var fft=lft(require("path")),kae=kt(),dft=Ti();t_.generateDefaultDocsSidebar=(0,dft.generateFileFromTemplate)(fft.default.join(kae.USER_DOCS_DIR_NAME,kae.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var Vae=h(r_=>{"use strict";var pft=r_&&r_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r_,"__esModule",{value:!0});r_.generateDefaultDocsTheme=void 0;var hft=pft(require("path")),Gae=kt(),mft=Ti();r_.generateDefaultDocsTheme=(0,mft.generateFileFromTemplate)(hft.default.join(Gae.USER_DOCS_DIR_NAME,Gae.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Hae=h(n_=>{"use strict";var _ft=n_&&n_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n_,"__esModule",{value:!0});n_.generateDefaultModule=void 0;var gft=_ft(require("path")),zae=kt(),yft=Ti();n_.generateDefaultModule=(0,yft.generateFileFromTemplate)(gft.default.join(zae.USER_MODULES_DIR_NAME,zae.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var Wae=h(i_=>{"use strict";var Eft=i_&&i_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i_,"__esModule",{value:!0});i_.generateDevPortalConfigJson=void 0;var bft=Eft(require("path")),Kae=kt(),Sft=Ti();i_.generateDevPortalConfigJson=(0,Sft.generateFileFromTemplate)(bft.default.join(Kae.USER_CONFIG_DIR_NAME,Kae.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Yae=h(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.generateEnvironment=void 0;var vft=Ti();R1.generateEnvironment=(0,vft.generateFileFromTemplate)(".env","env.template")});var Jae=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.generateESLint=void 0;var Oft=Ti();C1.generateESLint=(0,Oft.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Xae=h($1=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});$1.generateGitignore=void 0;var Ift=Ti();$1.generateGitignore=(0,Ift.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var Qae=h(s_=>{"use strict";var Pft=s_&&s_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s_,"__esModule",{value:!0});s_.generateLaunchJson=void 0;var wft=Pft(require("path")),Tft=Ti();s_.generateLaunchJson=(0,Tft.generateFileFromTemplate)(wft.default.join(".vscode","launch.json"),"launch.template.jsonc")});var eue=h(o_=>{"use strict";var Nft=o_&&o_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o_,"__esModule",{value:!0});o_.generateRouteOasConfig=void 0;var Aft=Nft(require("path")),Zae=kt(),Rft=Ti();o_.generateRouteOasConfig=(0,Rft.generateFileFromTemplate)(Aft.default.join(Zae.USER_CONFIG_DIR_NAME,Zae.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var nue=h(qs=>{"use strict";var tk=qs&&qs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0});qs.updateProjectPackageJson=qs.getProjectPackageJson=qs.getPackageOverrides=qs.generateDefaultPackageJson=void 0;var tue=tk(require("fs/promises")),rk=tk(require("path")),Cft=tk(Xs());async function $ft(e,t=Cft.default.USE_MONOREPO_PACKAGES){let r={name:e,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(t){let n=rue();r.overrides=n,r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"],r.devDependencies&&"@zuplo/core"in r.devDependencies&&(r.devDependencies["@zuplo/core"]=n["@zuplo/core"]),"@zuplo/core"in r.dependencies&&(r.dependencies["@zuplo/core"]=n["@zuplo/core"])}return r}s($ft,"generateDefaultPackageJson");qs.generateDefaultPackageJson=$ft;function rue(){let e=rk.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${e}/core`,"@zuplo/runtime":`file:${e}/runtime`,"@zuplo/debug":`file:${e}/debug`,"@zuplo/errors":`file:${e}/errors`}}s(rue,"getPackageOverrides");qs.getPackageOverrides=rue;async function Dft(e){let t=rk.default.join(e,"package.json"),r=await tue.default.readFile(t,"utf-8");return JSON.parse(r)}s(Dft,"getProjectPackageJson");qs.getProjectPackageJson=Dft;async function Lft(e,t){let r=rk.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await tue.default.writeFile(r,n,"utf-8")}s(Lft,"updateProjectPackageJson");qs.updateProjectPackageJson=Lft});var oue=h(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});D1.generatePackageJson=void 0;var iue=nue(),sue=rc(),jft=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,iue.generateDefaultPackageJson)(t);try{await(0,iue.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new sue.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new sue.PluginResult},"generatePackageJson");D1.generatePackageJson=jft});var uue=h(a_=>{"use strict";var Mft=a_&&a_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a_,"__esModule",{value:!0});a_.generatePoliciesConfig=void 0;var Uft=Mft(require("path")),aue=kt(),xft=Ti();a_.generatePoliciesConfig=(0,xft.generateFileFromTemplate)(Uft.default.join(aue.USER_CONFIG_DIR_NAME,aue.POLICIES_CONFIG_FILE),"policies.template.json")});var cue=h(u_=>{"use strict";var qft=u_&&u_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u_,"__esModule",{value:!0});u_.generateSettingsJson=void 0;var Fft=qft(require("path")),kft=Ti();u_.generateSettingsJson=(0,kft.generateFileFromTemplate)(Fft.default.join(".vscode","settings.json"),"settings.template.jsonc")});var lue=h(L1=>{"use strict";Object.defineProperty(L1,"__esModule",{value:!0});L1.generateTSConfig=void 0;var Bft=Ti();L1.generateTSConfig=(0,Bft.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var due=h(c_=>{"use strict";var Gft=c_&&c_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c_,"__esModule",{value:!0});c_.generateZuploJson=void 0;var Vft=Yo(),zft=require("fs/promises"),Hft=Gft(require("path")),Kft=kt(),fue=rc(),Wft=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:Vft.DEFAULT_COMPATIBILITY_DATE},i=Hft.default.join(t,Kft.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,zft.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new fue.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new fue.PluginResult},"generateZuploJson");c_.generateZuploJson=Wft});var _ue=h(l_=>{"use strict";var mue=l_&&l_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l_,"__esModule",{value:!0});l_.create=void 0;var pue=wae(),Yft=mue(gn()),Jft=require("fs/promises"),Xft=mue(require("path")),Qft=rc(),hue=ek(),Zft=Lae(),edt=Fae(),tdt=Bae(),rdt=Vae(),ndt=Hae(),idt=Wae(),sdt=Yae(),odt=Jae(),adt=Xae(),udt=Qae(),cdt=eue(),ldt=oue(),fdt=uue(),ddt=cue(),pdt=lue(),hdt=due();async function mdt({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,hue.sanitize)(e),o=(0,hue.sanitize)(t),a=Xft.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await Yft.default.dirExists(a))throw new pue.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:pue.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(Zft.createProjectDirs,cdt.generateRouteOasConfig,hdt.generateZuploJson,idt.generateDevPortalConfigJson,ndt.generateDefaultModule,tdt.generateDefaultDocsSidebar,edt.generateDefaultDocsMarkdown,rdt.generateDefaultDocsTheme,fdt.generatePoliciesConfig),c.push(pdt.generateTSConfig,adt.generateGitignore,ldt.generatePackageJson,sdt.generateEnvironment,odt.generateESLint,udt.generateLaunchJson,ddt.generateSettingsJson);let{errors:l,warnings:f}=await(0,Qft.runPlugins)(c,u);if(f.length>0&&f.forEach(_=>{n.warn(_)}),l.length>0){await(0,Jft.rm)(a,{recursive:!0,force:!0});let _=l[0];throw _ instanceof Error?_:new Error(_.message)}return{sourceDirectory:a,projectName:e}}s(mdt,"create");l_.create=mdt});var Sue=h((Zqt,bue)=>{bue.exports=Eue;Eue.sync=gdt;var gue=require("fs");function _dt(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}s(_dt,"checkPathExt");function yue(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:_dt(t,r)}s(yue,"checkStat");function Eue(e,t,r){gue.stat(e,function(n,i){r(n,n?!1:yue(i,e,t))})}s(Eue,"isexe");function gdt(e,t){return yue(gue.statSync(e),e,t)}s(gdt,"sync")});var wue=h((tFt,Pue)=>{Pue.exports=Oue;Oue.sync=ydt;var vue=require("fs");function Oue(e,t,r){vue.stat(e,function(n,i){r(n,n?!1:Iue(i,t))})}s(Oue,"isexe");function ydt(e,t){return Iue(vue.statSync(e),t)}s(ydt,"sync");function Iue(e,t){return e.isFile()&&Edt(e,t)}s(Iue,"checkStat");function Edt(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),f=u|c,d=r&l||r&c&&i===a||r&u&&n===o||r&f&&o===0;return d}s(Edt,"checkMode")});var Nue=h((iFt,Tue)=>{var nFt=require("fs"),j1;process.platform==="win32"||global.TESTING_WINDOWS?j1=Sue():j1=wue();Tue.exports=nk;nk.sync=bdt;function nk(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){nk(e,t||{},function(o,a){o?i(o):n(a)})})}j1(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(nk,"isexe");function bdt(e,t){try{return j1.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(bdt,"sync")});var jue=h((oFt,Lue)=>{var f_=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Aue=require("path"),Sdt=f_?";":":",Rue=Nue(),Cue=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),$ue=s((e,t)=>{let r=t.colon||Sdt,n=e.match(/\//)||f_&&e.match(/\\/)?[""]:[...f_?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=f_?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=f_?i.split(r):[""];return f_&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),Due=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=$ue(e,t),a=[],u=s(l=>new Promise((f,d)=>{if(l===n.length)return t.all&&a.length?f(a):d(Cue(e));let _=n[l],m=/^".*"$/.test(_)?_.slice(1,-1):_,g=Aue.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(c(y,l,0))}),"step"),c=s((l,f,d)=>new Promise((_,m)=>{if(d===i.length)return _(u(f+1));let g=i[d];Rue(l+g,{pathExt:o},(y,b)=>{if(!y&&b)if(t.all)a.push(l+g);else return _(l+g);return _(c(l,f,d+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),vdt=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=$ue(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=Aue.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let _=f+n[d];try{if(Rue.sync(_,{pathExt:i}))if(t.all)o.push(_);else return _}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Cue(e)},"whichSync");Lue.exports=Due;Due.sync=vdt});var sk=h((uFt,ik)=>{"use strict";var Mue=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");ik.exports=Mue;ik.exports.default=Mue});var Fue=h((lFt,que)=>{"use strict";var Uue=require("path"),Odt=jue(),Idt=sk();function xue(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let a;try{a=Odt.sync(e.command,{path:r[Idt({env:r})],pathExt:t?Uue.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=Uue.resolve(i?e.options.cwd:"",a)),a}s(xue,"resolveCommandAttempt");function Pdt(e){return xue(e)||xue(e,!0)}s(Pdt,"resolveCommand");que.exports=Pdt});var kue=h((dFt,ak)=>{"use strict";var ok=/([()\][%!^"`<>&|;, *?])/g;function wdt(e){return e=e.replace(ok,"^$1"),e}s(wdt,"escapeCommand");function Tdt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ok,"^$1"),t&&(e=e.replace(ok,"^$1")),e}s(Tdt,"escapeArgument");ak.exports.command=wdt;ak.exports.argument=Tdt});var Gue=h((hFt,Bue)=>{"use strict";Bue.exports=/^#!(.*)/});var zue=h((mFt,Vue)=>{"use strict";var Ndt=Gue();Vue.exports=(e="")=>{let t=e.match(Ndt);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Kue=h((_Ft,Hue)=>{"use strict";var uk=require("fs"),Adt=zue();function Rdt(e){let r=Buffer.alloc(150),n;try{n=uk.openSync(e,"r"),uk.readSync(n,r,0,150,0),uk.closeSync(n)}catch{}return Adt(r.toString())}s(Rdt,"readShebang");Hue.exports=Rdt});var Xue=h((yFt,Jue)=>{"use strict";var Cdt=require("path"),Wue=Fue(),Yue=kue(),$dt=Kue(),Ddt=process.platform==="win32",Ldt=/\.(?:com|exe)$/i,jdt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Mdt(e){e.file=Wue(e);let t=e.file&&$dt(e.file);return t?(e.args.unshift(e.file),e.command=t,Wue(e)):e.file}s(Mdt,"detectShebang");function Udt(e){if(!Ddt)return e;let t=Mdt(e),r=!Ldt.test(t);if(e.options.forceShell||r){let n=jdt.test(t);e.command=Cdt.normalize(e.command),e.command=Yue.command(e.command),e.args=e.args.map(o=>Yue.argument(o,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(Udt,"parseNonShell");function xdt(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Udt(n)}s(xdt,"parse");Jue.exports=xdt});var ece=h((bFt,Zue)=>{"use strict";var ck=process.platform==="win32";function lk(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(lk,"notFoundError");function qdt(e,t){if(!ck)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=Que(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(qdt,"hookChildProcess");function Que(e,t){return ck&&e===1&&!t.file?lk(t.original,"spawn"):null}s(Que,"verifyENOENT");function Fdt(e,t){return ck&&e===1&&!t.file?lk(t.original,"spawnSync"):null}s(Fdt,"verifyENOENTSync");Zue.exports={hookChildProcess:qdt,verifyENOENT:Que,verifyENOENTSync:Fdt,notFoundError:lk}});var nce=h((vFt,d_)=>{"use strict";var tce=require("child_process"),fk=Xue(),dk=ece();function rce(e,t,r){let n=fk(e,t,r),i=tce.spawn(n.command,n.args,n.options);return dk.hookChildProcess(i,n),i}s(rce,"spawn");function kdt(e,t,r){let n=fk(e,t,r),i=tce.spawnSync(n.command,n.args,n.options);return i.error=i.error||dk.verifyENOENTSync(i.status,n),i}s(kdt,"spawnSync");d_.exports=rce;d_.exports.spawn=rce;d_.exports.sync=kdt;d_.exports._parse=fk;d_.exports._enoent=dk});var sce=h((IFt,ice)=>{"use strict";ice.exports=e=>{let t=typeof e=="string"?`
303
303
  `:`
304
304
  `.charCodeAt(),r=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e}});var uce=h((PFt,QE)=>{"use strict";var XE=require("path"),oce=sk(),ace=s(e=>{e={cwd:process.cwd(),path:process.env[oce()],execPath:process.execPath,...e};let t,r=XE.resolve(e.cwd),n=[];for(;t!==r;)n.push(XE.join(r,"node_modules/.bin")),t=r,r=XE.resolve(r,"..");let i=XE.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(XE.delimiter)},"npmRunPath");QE.exports=ace;QE.exports.default=ace;QE.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=oce({env:t});return e.path=t[r],t[r]=QE.exports(e),t}});var lce=h((TFt,pk)=>{"use strict";var cce=s((e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},"mimicFn");pk.exports=cce;pk.exports.default=cce});var dce=h((AFt,U1)=>{"use strict";var Bdt=lce(),M1=new WeakMap,fce=s((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,i=e.displayName||e.name||"<anonymous>",o=s(function(...a){if(M1.set(o,++n),n===1)r=e.apply(this,a),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r},"onetime");return Bdt(o,e),M1.set(o,n),o},"onetime");U1.exports=fce;U1.exports.default=fce;U1.exports.callCount=e=>{if(!M1.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return M1.get(e)}});var pce=h(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});x1.SIGNALS=void 0;var Gdt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];x1.SIGNALS=Gdt});var hk=h(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.SIGRTMAX=p_.getRealtimeSignals=void 0;var Vdt=s(function(){let e=mce-hce+1;return Array.from({length:e},zdt)},"getRealtimeSignals");p_.getRealtimeSignals=Vdt;var zdt=s(function(e,t){return{name:`SIGRT${t+1}`,number:hce+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),hce=34,mce=64;p_.SIGRTMAX=mce});var _ce=h(q1=>{"use strict";Object.defineProperty(q1,"__esModule",{value:!0});q1.getSignals=void 0;var Hdt=require("os"),Kdt=pce(),Wdt=hk(),Ydt=s(function(){let e=(0,Wdt.getRealtimeSignals)();return[...Kdt.SIGNALS,...e].map(Jdt)},"getSignals");q1.getSignals=Ydt;var Jdt=s(function({name:e,number:t,description:r,action:n,forced:i=!1,standard:o}){let{signals:{[e]:a}}=Hdt.constants,u=a!==void 0;return{name:e,number:u?a:t,description:r,supported:u,action:n,forced:i,standard:o}},"normalizeSignal")});var yce=h(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});h_.signalsByNumber=h_.signalsByName=void 0;var Xdt=require("os"),gce=_ce(),Qdt=hk(),Zdt=s(function(){return(0,gce.getSignals)().reduce(ept,{})},"getSignalsByName"),ept=s(function(e,{name:t,number:r,description:n,supported:i,action:o,forced:a,standard:u}){return{...e,[t]:{name:t,number:r,description:n,supported:i,action:o,forced:a,standard:u}}},"getSignalByName"),tpt=Zdt();h_.signalsByName=tpt;var rpt=s(function(){let e=(0,gce.getSignals)(),t=Qdt.SIGRTMAX+1,r=Array.from({length:t},(n,i)=>npt(i,e));return Object.assign({},...r)},"getSignalsByNumber"),npt=s(function(e,t){let r=ipt(e,t);if(r===void 0)return{};let{name:n,description:i,supported:o,action:a,forced:u,standard:c}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:a,forced:u,standard:c}}},"getSignalByNumber"),ipt=s(function(e,t){let r=t.find(({name:n})=>Xdt.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},"findSignalByNumber"),spt=rpt();h_.signalsByNumber=spt});var bce=h((xFt,Ece)=>{"use strict";var{signalsByName:opt}=yce(),apt=s(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:o,isCanceled:a})=>e?`timed out after ${t} milliseconds`:a?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed","getErrorPrefix"),upt=s(({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:a,escapedCommand:u,timedOut:c,isCanceled:l,killed:f,parsed:{options:{timeout:d}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let _=i===void 0?void 0:opt[i].description,m=n&&n.code,y=`Command ${apt({timedOut:c,timeout:d,errorCode:m,signal:i,signalDescription:_,exitCode:o,isCanceled:l})}: ${a}`,b=Object.prototype.toString.call(n)==="[object Error]",E=b?`${y}
305
305
  ${n.message}`:y,v=[E,t,e].filter(Boolean).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/core",
3
- "version": "5.2358.0",
3
+ "version": "5.2360.0",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "exports": {