@zuplo/core 5.1993.0 → 5.1998.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 +1 -1
- package/package.json +1 -1
package/index.minified.js
CHANGED
|
@@ -298,7 +298,7 @@ globstar while`,t,m,r,p,h),this.matchOne(t.slice(m),r.slice(p),n))return this.de
|
|
|
298
298
|
`)}s(p1e,"generateRefs");function h1e(e,t,r,n,i,o,a){let u=[];u.push(`${r}: {`);let c=jv(e,t,n,i,o,a);return u.push(c),u.push("}"),u.join(`
|
|
299
299
|
`)}s(h1e,"getJsonEntry");function jv(e,t,r,n,i,o){let a=[];for(let u in r){let c=r[u];if(u==="$ref")return(0,lf.chaseRefs)(e,t,(0,lf.getFullyQualifiedRefName)(e,c),n,i,o),`$REF:${V5(t,o.get((0,lf.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 d=jv(e,t,l,n,i,o);if(d.startsWith("$REF")){let f=d.split(":")[1];a.push(`${f},`)}else a.push("{"),a.push(d),a.push("},")}else a.push(`${JSON.stringify(l)},`)}),a.push("],");else{let l=jv(e,t,c,n,i,o);if(l.startsWith("$REF")){let d=l.split(":")[1];a.push(`${u}: ${d},`)}else a.push(`"${u}":{`),a.push(l),a.push("},")}}}return a.join(`
|
|
300
300
|
`)}s(jv,"processNode");function V5(e,t){return(0,q5.sanitizedIdentifierName)(e)+`_refsData_${t}`}s(V5,"getRefIdentifierName")});var z5=E(ff=>{"use strict";var xv=ff&&ff.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ff,"__esModule",{value:!0});ff.runtimeConfigPlugin=void 0;var m1e=xv(Tr()),y1e=xv(require("fs/promises")),Y$=xv(require("path")),_1e=xv(Sr()),Mv="runtime-config",H5="runtime-config-plugin";function g1e(){return{name:Mv,setup(e){e.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},t=>({namespace:H5,path:Y$.default.isAbsolute(t.path)?t.path:Y$.default.join(t.resolveDir,t.path),pluginName:Mv})),e.onLoad({filter:/.*/,namespace:H5},async t=>_1e.default.timeFn("Generating zuplo.runtime.ts data",async()=>{let r="export const runtimeInit = undefined;",n=[];return await m1e.default.fileExists(t.path)?(r=await y1e.default.readFile(t.path,"utf-8"),{contents:r,loader:"ts",resolveDir:Y$.default.dirname(t.path),errors:n,pluginName:Mv,watchFiles:[t.path]}):{contents:r,loader:"ts",errors:n,pluginName:Mv}}))}}}s(g1e,"runtimeConfigPlugin");ff.runtimeConfigPlugin=g1e});var X5=E(hi=>{"use strict";var qu=hi&&hi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hi,"__esModule",{value:!0});hi.isPolicyPresentInOperation=hi.getPolicyNamesReferencingPolicyHandlers=hi.schemaValidationSource=hi.schemaValidationPlugin=void 0;var df=Va(),em=require("@zuplo/runtime/internal"),K5=qu(Tr()),E1e=qu(hP()),v1e=qu(mP()),kv=qu(require("fs/promises")),Sa=qu(require("path")),b1e=qu(require("prettier")),J$=ht(),S1e=qu(as()),Q$="schema-validation-plugin",W5="schema-validation",T1e="module.exports = {}";function O1e(e){return{name:"schema-validation-plugin",setup(t){t.onResolve({filter:/ajv-schema.json$/},r=>({namespace:W5,path:r.path,pluginName:Q$})),t.onLoad({filter:/.*/,namespace:W5},async r=>{let n=Sa.default.resolve(e.sourceDirectory,J$.USER_CONFIG_DIR_NAME,"policies.json");if(!e.isOpenApiBased||!await K5.default.fileExists(n))return{contents:T1e,loader:"js",resolveDir:Sa.default.dirname(r.path),pluginName:Q$};let i=await w1e(e.sourceDirectory),o=Sa.default.resolve(e.sourceDirectory,J$.USER_CONFIG_DIR_NAME),a=await(0,df.getOpenApiFilesByAlphabetical)(o),u=await I1e(a,i),c=await Y5({oasFiles:a,routesWithSchemaValidation:u,sourceDirectory:e.sourceDirectory,logger:e.logger});if(S1e.default.DEBUG_BUILD_MODE&&c){let l=Sa.default.join(e.sourceDirectory,J$.BUILD_OUTPUT_DIR),d=Sa.default.resolve(l,"schema-validation.js");await K5.default.mkdirForFilePathIfNotExits(d);let f=await b1e.default.format(c,{parser:"babel"});await kv.default.writeFile(d,f,"utf-8")}return{contents:c,loader:"js",resolveDir:Sa.default.dirname(r.path),pluginName:Q$}})}}}s(O1e,"schemaValidationPlugin");hi.schemaValidationPlugin=O1e;async function Y5({oasFiles:e,routesWithSchemaValidation:t,sourceDirectory:r,logger:n}){let i="",o=new df.RefParser(r,n);if(t.length===0)return i;let a=new E1e.default({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let u of e){let c=await kv.default.readFile(u,"utf-8"),l=Sa.default.basename(u,".oas.json"),d=t.filter(y=>y.fileName===l),f=await o.resolve(u),m=JSON.parse(c),p=[],h=new Map;d.forEach(y=>{let g=m.paths[y.path][y.method];if(g.requestBody){let _;if(g.requestBody.$ref){let v=g.requestBody.$ref;_=f.get(v)?.content}else g.requestBody.content&&(_=g.requestBody.content);if(_)for(let v in _){let b=_[v].schema,T=(0,em.getIdForRequestBodySchema)(y.path,y.method,v);b.$id=T,a.addSchema(b),X$(b,u,l,a,f,p,h)}}if(g.parameters)for(let _ of g.parameters){let v=_.$ref?f.get(_.$ref):_,b=v.schema.$ref?f.get(v.schema.$ref):v.schema,T=(0,em.getIdForParameterSchema)(y.path,y.method,v.in,v.name);b.$id=T,a.addSchema(b),X$(v,u,l,a,f,p,h)}});for(let y of p){let g=f.get(y),_=(0,em.getIdForRefSchema)(l,y);a.addSchema(g,_)}}return i=(0,v1e.default)(a),i}s(Y5,"schemaValidationSource");hi.schemaValidationSource=Y5;function X$(e,t,r,n,i,o,a){for(let u in e){let c=e[u];if(u==="$ref"){let l=(0,em.getIdForRefSchema)(r,(0,df.getFullyQualifiedRefName)(t,c));e[u]=l,(0,df.chaseRefs)(t,r,(0,df.getFullyQualifiedRefName)(t,c),i,o,a,(d,f)=>(0,em.getIdForRefSchema)(d,(0,df.getFullyQualifiedRefName)(t,f)))}else typeof c=="object"&&X$(c,t,r,n,i,o,a)}}s(X$,"addRefsToSchema");async function w1e(e){let t=new Set(["RequestValidationInboundPolicy"]),r=await kv.default.readFile(`${e}/config/policies.json`,"utf-8"),n=JSON.parse(r);return J5(n,t)}s(w1e,"getPolicyNamesUsingSchemaValidationPolicies");function J5(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=P1e(e,r);return new Set([...r,...n])}s(J5,"getPolicyNamesReferencingPolicyHandlers");hi.getPolicyNamesReferencingPolicyHandlers=J5;function P1e(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(P1e,"getCompositePoliciesContainingPolicy");function Q5(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(Q5,"isPolicyPresentInOperation");hi.isPolicyPresentInOperation=Q5;async function I1e(e,t){let r=[];for(let n of e){let i=await kv.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 d=c[l];Q5(d,t)&&r.push({fileName:Sa.default.basename(n,".oas.json"),path:u,method:l})}}}return r}s(I1e,"getRoutesContainingPolicies")});var Z$=E(Ta=>{"use strict";var N1e=Ta&&Ta.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.BUILD_CONDITIONS=void 0;var R1e=gj(),Uv=N1e(require("path")),$1e=Sd(),A1e=Ej(),C1e=Tj(),D1e=Ij(),L1e=Uq(),j1e=Bq(),M1e=x5(),x1e=G5(),k1e=z5(),U1e=X5(),q1e=(0,R1e.debug)("zuplo:core:build");Ta.BUILD_CONDITIONS=["workerd","worker","browser"];var Z5=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],Uv.default.resolve(__dirname,"..","..","..","node_modules"),Uv.default.resolve(__dirname,"..","..","..","..","..","node_modules"),...require.main?.paths??[]];async function F1e({dev:e=!1,targetPlatform:t,systemDirectory:r,outputDirectory:n,sourceDirectory:i,logger:o,flags:a}){let u=Uv.default.join(r,(0,$1e.getBuildEntry)(t));q1e(`Building with node paths: ${Z5.join(", ")}`);let c=e===!1?{minify:!0}:{minify:!1,keepNames:!0,metafile:!0},l={platform:"browser",target:"es2022",outfile:Uv.default.join(n,"worker.js")};return{format:a?.esmWorker===!0?"esm":"iife",banner:{js:`'use strict';
|
|
301
|
-
`},nodePaths:Z5,entryPoints:[u],...l,sourcemap:"linked",treeShaking:!0,bundle:!0,...c,external:[],logLevel:"silent",conditions:Ta.BUILD_CONDITIONS,plugins:[(0,D1e.environmentPlugin)({sourceDirectory:i,targetPlatform:t}),(0,A1e.blockRemoteModulePlugin)({logger:o}),(0,M1e.openApiRoutesPlugin)({sourceDirectory:i,outputDirectory:n}),(0,x1e.rawRoutePlugin)({sourceDirectory:i,targetPlatform:t,logger:o}),(0,U1e.schemaValidationPlugin)({sourceDirectory:i,logger:o,isOpenApiBased:!0}),(0,k1e.runtimeConfigPlugin)(),(0,C1e.devPortalConfigPlugin)({sourceDirectory:i}),(0,L1e.jsonSchemaPlugin)({sourceDirectory:i,outputDirectory:n}),(0,j1e.nodejsCompatPlugin)({nodeCompatEnabled:a?.esmWorker===!0,sourceDirectory:i})]}}s(F1e,"getBaseESBuildConfig");Ta.default=F1e});var rz=E(mi=>{"use strict";var B1e=mi&&mi.__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]}),V1e=mi&&mi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G1e=mi&&mi.__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)&&B1e(t,e,r);return V1e(t,e),t},tz=mi&&mi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mi,"__esModule",{value:!0});mi.getRunEsBuildPlugin=void 0;var H1e=Va(),ez=Ws(),z1e=G1e(require("esbuild")),K1e=tz(Sr()),W1e=Yy(),Y1e=tz(Z$()),eA=Sd(),J1e=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,targetPlatform:a,generateSourceMaps:u,buildId:c,logger:l,config:d}){return K1e.default.timeFn("Running esbuild",async()=>{l.info(`Running build for platform ${a}, build_id: ${c}`);let f=await(0,Y1e.default)({systemDirectory:r,outputDirectory:n,targetPlatform:a,generateSourceMaps:u,sourceDirectory:i,dev:o,logger:l,flags:d.flags}),m,p=new Date;try{if(!await(0,H1e.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");m=await z1e.build(f)}catch(y){if(l.error(y),y.errors||y.warnings)m=y;else if(y.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))m={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:eA.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 y}let h=new Date;if(e(new W1e.CompilerResult(m,{endBuildTime:h,startBuildTime:p,buildId:c??""})),m.errors.length>0){m.errors.length>1&&(m.errors.length=1);let y=m.errors[0];l.debug(y)}return{warnings:[...m.warnings.map(y=>({message:y.text,pluginName:eA.ESBUILD_PLUGIN_NAME,severity:ez.WARNING_SEVERITY}))],errors:[...m.errors.map(y=>({message:y.text,pluginName:eA.ESBUILD_PLUGIN_NAME,severity:ez.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");mi.getRunEsBuildPlugin=J1e});var rA=E(hf=>{"use strict";var iz=hf&&hf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hf,"__esModule",{value:!0});hf.build=void 0;var pf=Ws(),Q1e=require("crypto"),X1e=require("fs"),tm=iz(require("path")),nz=ht(),Z1e=Po(),eCe=iz(Sr()),tCe=AC(),rCe=nd(),nCe=LC(),iCe=jC(),sCe=MC(),oCe=FC(),aCe=BC(),uCe=zC(),cCe=rj(),lCe=ij(),fCe=rz(),tA=Sd(),qv;try{let e=(0,X1e.readFileSync)(tm.default.resolve(__dirname,"../../package.json"),"utf-8");qv=JSON.parse(e).version}catch{qv="0.0.0"}async function dCe({sourceDirectory:e,dev:t,targetPlatform:r,generateSourceMaps:n=!1,noCompile:i=!1,deploymentName:o=tm.default.basename(e),logger:a,publicZuploEnvironmentVariables:u={},entitlements:c,projectId:l,customDomain:d,environmentType:f,postBuildActions:m}){let p=(0,Q1e.randomUUID)(),h=a.child({buildId:p});return eCe.default.timeFn(`Run Build for platform: ${r}, build_id: ${p}`,async()=>{let y=await(0,tCe.getZuploConfig)(e),g=tm.default.join(e,nz.BUILD_OUTPUT_DIR),_;if("errors"in y)_={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:qv,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:pf.FAILURE_STATUS,buildId:p,warnings:[],errors:y.errors}};else{let b={dev:t,targetPlatform:r,generateSourceMaps:n,deploymentName:o,sourceDirectory:e,outputDirectory:g,systemDirectory:tm.default.join(e,nz.GENERATED_SOURCE_DIR_NAME),buildId:p,logger:h,config:y.config,publicZuploEnvironmentVariables:u,projectId:l,entitlements:c,customDomain:d,environmentType:f},T=[];T.push(nCe.cleanOutput),T.push(iCe.createSystemDir),T.push(sCe.checkForDeprecations),T.push(oCe.generateBuildData),T.push(uCe.validateDevPortalJSON),T.push(cCe.validateOpenAPIFiles),r==rCe.TargetPlatform.Worker&&T.push(aCe.generateWorker);let P,L=s(G=>{P=G},"compileCallback");i||T.push((0,fCe.getRunEsBuildPlugin)(L)),T.push(lCe.verifyWorkerOutput);let k=await(0,Z1e.runPlugins)(T,b),q=k.errors.length>0?pf.FAILURE_STATUS:k.warnings.length>0?pf.WARNING_STATUS:pf.GOOD_STATUS;_={status:q==="Failed"||P===void 0||P.status==="Failed"?"Failed":q==="Warnings"||P.status==="Warnings"?"Warnings":"Good",compatibilityDate:y.config.compatibilityDate,runtimeVersion:qv,outputPath:g,compilerResult:P,buildTaskResult:{buildTime:"",buildTimeMs:0,status:q,buildId:p,warnings:k.warnings,errors:k.errors},flags:y.config.flags}}if(_.buildTaskResult.warnings.length>0){_.buildTaskResult.warnings.forEach(T=>{h.warn(T)});let b=_.buildTaskResult.warnings.filter(T=>T.pluginName!=="runEsbuild"&&T.pluginName!==tA.ESBUILD_PLUGIN_NAME);b.length>0&&(_.buildTaskResult.warnings=b),_.buildTaskResult.status=pf.WARNING_STATUS}if(_.buildTaskResult.errors.length>0){_.buildTaskResult.errors.forEach(T=>{h.error(T)});let b=_.buildTaskResult.errors.filter(T=>T.pluginName!=="runEsbuild"&&T.pluginName!==tA.ESBUILD_PLUGIN_NAME);b.length>0&&(_.buildTaskResult.errors=b),_.buildTaskResult.status=pf.FAILURE_STATUS}if(h.debug(`Build ${_.compilerResult?.buildId??p} completed ${i?"on watch mode":"with compiler status "+_.compilerResult?.status} and build task status ${_.buildTaskResult.status}`),m){let b=[];for(let T of m)b.push(T({logger:h,result:_,sourceDirectory:e,deploymentName:o,buildId:p}));await Promise.all(b)}if(_.compilerResult){let{metafile:b,...T}=_.compilerResult;h.debug(`Compiler results for build ${_.compilerResult?.buildId??p}`,T)}h.debug(`Build task results for build ${_.buildTaskResult?.buildId??p}`,_.buildTaskResult);let v=tm.default.basename(e);return(0,tA.formatBuildResult)(_,v,h)})}s(dCe,"build");hf.build=dCe});var sA=E(yi=>{"use strict";var pCe=yi&&yi.__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]}),hCe=yi&&yi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mCe=yi&&yi.__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)&&pCe(t,e,r);return hCe(t,e),t},Fv=yi&&yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yi,"__esModule",{value:!0});yi.BuildWatcher=void 0;var sz=Ws(),yCe=Fv(require("chokidar")),_Ce=mCe(require("esbuild")),oz=require("crypto"),gCe=Fv(require("events")),rm=Fv(require("path")),az=ht(),ECe=rA(),uz=Yy(),vCe=Fv(Z$()),cz=Sd(),nA=class extends gCe.default{static{s(this,"WatchEmitter")}},iA=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new nA;envFilesWatcher;outputDirectory;sourceDirectory;dev;targetPlatform;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,targetPlatform:n,generateSourceMaps:i,logger:o,publicZuploEnvironmentVariables:a={}}){this.sourceDirectory=t,this.dev=r,this.targetPlatform=n,this.outputDirectory=rm.default.join(t,az.BUILD_OUTPUT_DIR),this.generateSourceMaps=i??!1,this.logger=o,this.publicZuploEnvironmentVariables=a,this.projectName=rm.default.basename(t),this.envFilesWatcher=yCe.default.watch([rm.default.join(t,".env"),rm.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,ECe.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,targetPlatform:this.targetPlatform,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,vCe.default)({systemDirectory:rm.default.join(t,az.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,targetPlatform:this.targetPlatform,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 uz.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:sz.FAILURE_STATUS,buildId:(0,oz.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,cz.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",null,u)})}}),this.esbuildContext=await _Ce.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:sz.FAILURE_STATUS,buildId:(0,oz.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new uz.CompilerResult(o),(0,cz.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)}}};yi.BuildWatcher=iA});var oA=E(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});Bv.HttpStatusCode=void 0;var lz;(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"})(lz||(Bv.HttpStatusCode=lz={}))});var fz=E(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});Vv.getSourceControlProviderLabel=void 0;function bCe(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(bCe,"getSourceControlProviderLabel");Vv.getSourceControlProviderLabel=bCe});var pz=E(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=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.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_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=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=void 0;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=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_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.CONSUMER_DOES_NOT_EXIST=S.CONSUMER_NO_ACCESS=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=void 0;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=void 0;var D=oA(),dz=fz(),SCe="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:D.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:D.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:D.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:D.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:D.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:D.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:D.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:D.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:D.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:D.HttpStatusCode.UNAUTHORIZED};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:D.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:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:D.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:D.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:D.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:D.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:D.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:D.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",status:D.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:D.HttpStatusCode.BAD_REQUEST};var TCe=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:D.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=TCe;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:D.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:D.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:D.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:D.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:D.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:D.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:D.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:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:D.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:D.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:D.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:D.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:D.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:D.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:D.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:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};var OCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=OCe;var wCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=wCe;var PCe=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:D.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=PCe;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:D.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:D.HttpStatusCode.FORBIDDEN};var ICe=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 '${SCe}' to add the repository.`,status:D.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=ICe;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:D.HttpStatusCode.NOT_FOUND};var NCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=NCe;var RCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=RCe;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:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};var $Ce=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:D.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=$Ce;var ACe=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:D.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=ACe;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:D.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:D.HttpStatusCode.FORBIDDEN};var CCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=CCe;var DCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=DCe;var LCe=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:D.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=LCe;var jCe=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:D.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=jCe;var MCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=MCe;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:D.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:D.HttpStatusCode.FORBIDDEN};var xCe=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:D.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=xCe;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:D.HttpStatusCode.FORBIDDEN};var kCe=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=kCe;var UCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=UCe;var qCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=qCe;var FCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=FCe;var BCe=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=BCe;S.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:D.HttpStatusCode.UNAUTHORIZED};S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:D.HttpStatusCode.NOT_FOUND};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:D.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:D.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:D.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:D.HttpStatusCode.INTERNAL_SERVER_ERROR};var VCe=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,dz.getSourceControlProviderLabel)(e)}`,status:D.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=VCe;var GCe=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,dz.getSourceControlProviderLabel)(e)} repository`,status:D.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=GCe;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:D.HttpStatusCode.BAD_REQUEST};var HCe=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:D.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=HCe;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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:D.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:D.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:D.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:D.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:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:D.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:D.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:D.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:D.HttpStatusCode.NOT_FOUND};var zCe=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:D.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=zCe;var KCe=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:D.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=KCe;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:D.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:D.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:D.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:D.HttpStatusCode.BAD_REQUEST};var WCe=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:D.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=WCe;var YCe=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:D.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=YCe;var JCe=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:D.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=JCe;var QCe=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:D.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=QCe;var XCe=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:D.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=XCe;var ZCe=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=ZCe;var eDe=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:D.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=eDe;var tDe=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:D.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=tDe;var rDe=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:D.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=rDe;var nDe=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=nDe;var iDe=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=iDe;var sDe=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:D.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=sDe;var oDe=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:D.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=oDe;var aDe=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:D.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=aDe;var uDe=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=uDe;var cDe=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=cDe;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:D.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:D.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:D.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:D.HttpStatusCode.INTERNAL_SERVER_ERROR}});var mz=E(bn=>{"use strict";var lDe=bn&&bn.__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]}),fDe=bn&&bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),dDe=bn&&bn.__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)&&lDe(t,e,r);return fDe(t,e),t};Object.defineProperty(bn,"__esModule",{value:!0});bn.ApiNotFoundError=bn.ApiError=bn.Problems=void 0;var hz=dDe(pz());bn.Problems=hz;var Gv=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}};bn.ApiError=Gv;var aA=class extends Gv{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...hz.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};bn.ApiNotFoundError=aA});var yz=E(go=>{"use strict";var pDe=go&&go.__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]}),hDe=go&&go.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&pDe(t,e,r)};Object.defineProperty(go,"__esModule",{value:!0});go.HttpStatusCode=void 0;hDe(mz(),go);var mDe=oA();Object.defineProperty(go,"HttpStatusCode",{enumerable:!0,get:function(){return mDe.HttpStatusCode}})});var gz=E((HKe,_z)=>{"use strict";function yDe(e){return e>=55296&&e<=56319}s(yDe,"isHighSurrogate");function _De(e){return e>=56320&&e<=57343}s(_De,"isLowSurrogate");_z.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],yDe(a)&&_De(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 vz=E((KKe,Ez)=>{"use strict";var gDe=gz(),EDe=Buffer.byteLength.bind(Buffer);Ez.exports=gDe.bind(null,EDe)});var uA=E(mf=>{"use strict";var vDe=mf&&mf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mf,"__esModule",{value:!0});mf.sanitize=void 0;var bDe=vDe(vz()),SDe=/[/?<>\\:*|"]/g,TDe=/[\x00-\x1f\x80-\x9f]/g,ODe=/^\.+$/,wDe=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,PDe=/[. ]+$/;function IDe(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(SDe,t).replace(TDe,t).replace(ODe,t).replace(wDe,t).replace(PDe,t);return(0,bDe.default)(r,255)}s(IDe,"sanitize");mf.sanitize=IDe});var Oz=E(yf=>{"use strict";var Tz=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yf,"__esModule",{value:!0});yf.createProjectDirs=void 0;var bz=Tz(require("fs/promises")),NDe=Tz(require("path")),nm=ht(),Sz=Po(),RDe=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[nm.USER_MODULES_DIR_NAME,nm.USER_CONFIG_DIR_NAME,nm.USER_TEST_DIR_NAME,nm.USER_SCHEMAS_DIR_NAME,nm.USER_DOCS_DIR_NAME,".vscode"];try{await bz.default.mkdir(e);for(let n of r)await bz.default.mkdir(NDe.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new Sz.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new Sz.PluginResult},"createProjectDirs");yf.createProjectDirs=RDe});var Nz=E(_f=>{"use strict";var Iz=_f&&_f.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_f,"__esModule",{value:!0});_f.generateFromTemplate=void 0;var $De=require("fs"),wz=Iz(require("fs/promises")),Pz=Iz(require("path"));async function ADe(e){let t=Pz.default.resolve(__dirname,"..","templates",e);if((0,$De.existsSync)(t))return await wz.default.readFile(t,"utf-8");{let r=Pz.default.resolve(__dirname,"templates",e);return await wz.default.readFile(r,"utf-8")}}s(ADe,"generateFromTemplate");_f.generateFromTemplate=ADe});var Sn=E(gf=>{"use strict";var Hv=gf&&gf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gf,"__esModule",{value:!0});gf.generateFileFromTemplate=void 0;var CDe=Hv(Tr()),DDe=Hv(require("fs/promises")),LDe=Hv(require("path")),jDe=Hv(Sr()),MDe=Nz(),xDe=s(function(e,t){return async({sourceDirectory:r,logger:n})=>jDe.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=LDe.default.join(r,e);return await CDe.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):kDe(i,t,n)})},"generateFileFromTemplate");gf.generateFileFromTemplate=xDe;async function kDe(e,t,r){let n=await(0,MDe.generateFromTemplate)(t);try{await DDe.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(kDe,"writeTemplate")});var $z=E(Ef=>{"use strict";var UDe=Ef&&Ef.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ef,"__esModule",{value:!0});Ef.generateDefaultDocsMarkdown=void 0;var qDe=UDe(require("path")),Rz=ht(),FDe=Sn();Ef.generateDefaultDocsMarkdown=(0,FDe.generateFileFromTemplate)(qDe.default.join(Rz.USER_DOCS_DIR_NAME,Rz.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Cz=E(vf=>{"use strict";var BDe=vf&&vf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vf,"__esModule",{value:!0});vf.generateDefaultDocsSidebar=void 0;var VDe=BDe(require("path")),Az=ht(),GDe=Sn();vf.generateDefaultDocsSidebar=(0,GDe.generateFileFromTemplate)(VDe.default.join(Az.USER_DOCS_DIR_NAME,Az.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var Lz=E(bf=>{"use strict";var HDe=bf&&bf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bf,"__esModule",{value:!0});bf.generateDefaultDocsTheme=void 0;var zDe=HDe(require("path")),Dz=ht(),KDe=Sn();bf.generateDefaultDocsTheme=(0,KDe.generateFileFromTemplate)(zDe.default.join(Dz.USER_DOCS_DIR_NAME,Dz.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Mz=E(Sf=>{"use strict";var WDe=Sf&&Sf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sf,"__esModule",{value:!0});Sf.generateDefaultModule=void 0;var YDe=WDe(require("path")),jz=ht(),JDe=Sn();Sf.generateDefaultModule=(0,JDe.generateFileFromTemplate)(YDe.default.join(jz.USER_MODULES_DIR_NAME,jz.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var kz=E(Tf=>{"use strict";var QDe=Tf&&Tf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tf,"__esModule",{value:!0});Tf.generateDevPortalConfigJson=void 0;var XDe=QDe(require("path")),xz=ht(),ZDe=Sn();Tf.generateDevPortalConfigJson=(0,ZDe.generateFileFromTemplate)(XDe.default.join(xz.USER_CONFIG_DIR_NAME,xz.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Uz=E(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});zv.generateEnvironment=void 0;var e2e=Sn();zv.generateEnvironment=(0,e2e.generateFileFromTemplate)(".env","env.template")});var qz=E(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});Kv.generateESLint=void 0;var t2e=Sn();Kv.generateESLint=(0,t2e.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Fz=E(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});Wv.generateGitignore=void 0;var r2e=Sn();Wv.generateGitignore=(0,r2e.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var Bz=E(Of=>{"use strict";var n2e=Of&&Of.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Of,"__esModule",{value:!0});Of.generateLaunchJson=void 0;var i2e=n2e(require("path")),s2e=Sn();Of.generateLaunchJson=(0,s2e.generateFileFromTemplate)(i2e.default.join(".vscode","launch.json"),"launch.template.jsonc")});var Gz=E(wf=>{"use strict";var o2e=wf&&wf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wf,"__esModule",{value:!0});wf.generateRouteOasConfig=void 0;var a2e=o2e(require("path")),Vz=ht(),u2e=Sn();wf.generateRouteOasConfig=(0,u2e.generateFileFromTemplate)(a2e.default.join(Vz.USER_CONFIG_DIR_NAME,Vz.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var Kz=E(_i=>{"use strict";var cA=_i&&_i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_i,"__esModule",{value:!0});_i.updateProjectPackageJson=_i.getProjectPackageJson=_i.getPackageOverrides=_i.generateDefaultPackageJson=void 0;var Hz=cA(require("fs/promises")),lA=cA(require("path")),c2e=cA(as());async function l2e(e,t=c2e.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=zz();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(l2e,"generateDefaultPackageJson");_i.generateDefaultPackageJson=l2e;function zz(){let e=lA.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(zz,"getPackageOverrides");_i.getPackageOverrides=zz;async function f2e(e){let t=lA.default.join(e,"package.json"),r=await Hz.default.readFile(t,"utf-8");return JSON.parse(r)}s(f2e,"getProjectPackageJson");_i.getProjectPackageJson=f2e;async function d2e(e,t){let r=lA.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await Hz.default.writeFile(r,n,"utf-8")}s(d2e,"updateProjectPackageJson");_i.updateProjectPackageJson=d2e});var Jz=E(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});Yv.generatePackageJson=void 0;var Wz=Kz(),Yz=Po(),p2e=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,Wz.generateDefaultPackageJson)(t);try{await(0,Wz.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new Yz.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new Yz.PluginResult},"generatePackageJson");Yv.generatePackageJson=p2e});var Xz=E(Pf=>{"use strict";var h2e=Pf&&Pf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.generatePoliciesConfig=void 0;var m2e=h2e(require("path")),Qz=ht(),y2e=Sn();Pf.generatePoliciesConfig=(0,y2e.generateFileFromTemplate)(m2e.default.join(Qz.USER_CONFIG_DIR_NAME,Qz.POLICIES_CONFIG_FILE),"policies.template.json")});var Zz=E(If=>{"use strict";var _2e=If&&If.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(If,"__esModule",{value:!0});If.generateSettingsJson=void 0;var g2e=_2e(require("path")),E2e=Sn();If.generateSettingsJson=(0,E2e.generateFileFromTemplate)(g2e.default.join(".vscode","settings.json"),"settings.template.jsonc")});var eK=E(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});Jv.generateTSConfig=void 0;var v2e=Sn();Jv.generateTSConfig=(0,v2e.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var rK=E(Nf=>{"use strict";var b2e=Nf&&Nf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nf,"__esModule",{value:!0});Nf.generateZuploJson=void 0;var S2e=Ws(),T2e=require("fs/promises"),O2e=b2e(require("path")),w2e=ht(),tK=Po(),P2e=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:S2e.DEFAULT_COMPATIBILITY_DATE},i=O2e.default.join(t,w2e.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,T2e.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new tK.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new tK.PluginResult},"generateZuploJson");Nf.generateZuploJson=P2e});var oK=E(Rf=>{"use strict";var sK=Rf&&Rf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rf,"__esModule",{value:!0});Rf.create=void 0;var nK=yz(),I2e=sK(Tr()),N2e=require("fs/promises"),R2e=sK(require("path")),$2e=Po(),iK=uA(),A2e=Oz(),C2e=$z(),D2e=Cz(),L2e=Lz(),j2e=Mz(),M2e=kz(),x2e=Uz(),k2e=qz(),U2e=Fz(),q2e=Bz(),F2e=Gz(),B2e=Jz(),V2e=Xz(),G2e=Zz(),H2e=eK(),z2e=rK();async function K2e({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,iK.sanitize)(e),o=(0,iK.sanitize)(t),a=R2e.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await I2e.default.dirExists(a))throw new nK.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:nK.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(A2e.createProjectDirs,F2e.generateRouteOasConfig,z2e.generateZuploJson,M2e.generateDevPortalConfigJson,j2e.generateDefaultModule,D2e.generateDefaultDocsSidebar,C2e.generateDefaultDocsMarkdown,L2e.generateDefaultDocsTheme,V2e.generatePoliciesConfig),c.push(H2e.generateTSConfig,U2e.generateGitignore,B2e.generatePackageJson,x2e.generateEnvironment,k2e.generateESLint,q2e.generateLaunchJson,G2e.generateSettingsJson);let{errors:l,warnings:d}=await(0,$2e.runPlugins)(c,u);if(d.length>0&&d.forEach(m=>{n.warn(m)}),l.length>0){await(0,N2e.rm)(a,{recursive:!0,force:!0});let m=l[0];throw m instanceof Error?m:new Error(m.message)}return{sourceDirectory:a,projectName:e}}s(K2e,"create");Rf.create=K2e});var fK=E((T9e,lK)=>{lK.exports=cK;cK.sync=Y2e;var aK=require("fs");function W2e(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(W2e,"checkPathExt");function uK(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:W2e(t,r)}s(uK,"checkStat");function cK(e,t,r){aK.stat(e,function(n,i){r(n,n?!1:uK(i,e,t))})}s(cK,"isexe");function Y2e(e,t){return uK(aK.statSync(e),e,t)}s(Y2e,"sync")});var yK=E((w9e,mK)=>{mK.exports=pK;pK.sync=J2e;var dK=require("fs");function pK(e,t,r){dK.stat(e,function(n,i){r(n,n?!1:hK(i,t))})}s(pK,"isexe");function J2e(e,t){return hK(dK.statSync(e),t)}s(J2e,"sync");function hK(e,t){return e.isFile()&&Q2e(e,t)}s(hK,"checkStat");function Q2e(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),d=u|c,f=r&l||r&c&&i===a||r&u&&n===o||r&d&&o===0;return f}s(Q2e,"checkMode")});var gK=E((N9e,_K)=>{var I9e=require("fs"),Qv;process.platform==="win32"||global.TESTING_WINDOWS?Qv=fK():Qv=yK();_K.exports=fA;fA.sync=X2e;function fA(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){fA(e,t||{},function(o,a){o?i(o):n(a)})})}Qv(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(fA,"isexe");function X2e(e,t){try{return Qv.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(X2e,"sync")});var wK=E(($9e,OK)=>{var $f=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",EK=require("path"),Z2e=$f?";":":",vK=gK(),bK=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),SK=s((e,t)=>{let r=t.colon||Z2e,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"),TK=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=SK(e,t),a=[],u=s(l=>new Promise((d,f)=>{if(l===n.length)return t.all&&a.length?d(a):f(bK(e));let m=n[l],p=/^".*"$/.test(m)?m.slice(1,-1):m,h=EK.join(p,e),y=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;d(c(y,l,0))}),"step"),c=s((l,d,f)=>new Promise((m,p)=>{if(f===i.length)return m(u(d+1));let h=i[f];vK(l+h,{pathExt:o},(y,g)=>{if(!y&&g)if(t.all)a.push(l+h);else return m(l+h);return m(c(l,d,f+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),eLe=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=SK(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=EK.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<n.length;f++){let m=d+n[f];try{if(vK.sync(m,{pathExt:i}))if(t.all)o.push(m);else return m}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw bK(e)},"whichSync");OK.exports=TK;TK.sync=eLe});var pA=E((C9e,dA)=>{"use strict";var PK=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");dA.exports=PK;dA.exports.default=PK});var $K=E((L9e,RK)=>{"use strict";var IK=require("path"),tLe=wK(),rLe=pA();function NK(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=tLe.sync(e.command,{path:r[rLe({env:r})],pathExt:t?IK.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=IK.resolve(i?e.options.cwd:"",a)),a}s(NK,"resolveCommandAttempt");function nLe(e){return NK(e)||NK(e,!0)}s(nLe,"resolveCommand");RK.exports=nLe});var AK=E((M9e,mA)=>{"use strict";var hA=/([()\][%!^"`<>&|;, *?])/g;function iLe(e){return e=e.replace(hA,"^$1"),e}s(iLe,"escapeCommand");function sLe(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(hA,"^$1"),t&&(e=e.replace(hA,"^$1")),e}s(sLe,"escapeArgument");mA.exports.command=iLe;mA.exports.argument=sLe});var DK=E((k9e,CK)=>{"use strict";CK.exports=/^#!(.*)/});var jK=E((U9e,LK)=>{"use strict";var oLe=DK();LK.exports=(e="")=>{let t=e.match(oLe);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var xK=E((q9e,MK)=>{"use strict";var yA=require("fs"),aLe=jK();function uLe(e){let r=Buffer.alloc(150),n;try{n=yA.openSync(e,"r"),yA.readSync(n,r,0,150,0),yA.closeSync(n)}catch{}return aLe(r.toString())}s(uLe,"readShebang");MK.exports=uLe});var FK=E((B9e,qK)=>{"use strict";var cLe=require("path"),kK=$K(),UK=AK(),lLe=xK(),fLe=process.platform==="win32",dLe=/\.(?:com|exe)$/i,pLe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function hLe(e){e.file=kK(e);let t=e.file&&lLe(e.file);return t?(e.args.unshift(e.file),e.command=t,kK(e)):e.file}s(hLe,"detectShebang");function mLe(e){if(!fLe)return e;let t=hLe(e),r=!dLe.test(t);if(e.options.forceShell||r){let n=pLe.test(t);e.command=cLe.normalize(e.command),e.command=UK.command(e.command),e.args=e.args.map(o=>UK.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(mLe,"parseNonShell");function yLe(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:mLe(n)}s(yLe,"parse");qK.exports=yLe});var GK=E((G9e,VK)=>{"use strict";var _A=process.platform==="win32";function gA(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(gA,"notFoundError");function _Le(e,t){if(!_A)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=BK(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(_Le,"hookChildProcess");function BK(e,t){return _A&&e===1&&!t.file?gA(t.original,"spawn"):null}s(BK,"verifyENOENT");function gLe(e,t){return _A&&e===1&&!t.file?gA(t.original,"spawnSync"):null}s(gLe,"verifyENOENTSync");VK.exports={hookChildProcess:_Le,verifyENOENT:BK,verifyENOENTSync:gLe,notFoundError:gA}});var KK=E((z9e,Af)=>{"use strict";var HK=require("child_process"),EA=FK(),vA=GK();function zK(e,t,r){let n=EA(e,t,r),i=HK.spawn(n.command,n.args,n.options);return vA.hookChildProcess(i,n),i}s(zK,"spawn");function ELe(e,t,r){let n=EA(e,t,r),i=HK.spawnSync(n.command,n.args,n.options);return i.error=i.error||vA.verifyENOENTSync(i.status,n),i}s(ELe,"spawnSync");Af.exports=zK;Af.exports.spawn=zK;Af.exports.sync=ELe;Af.exports._parse=EA;Af.exports._enoent=vA});var YK=E((W9e,WK)=>{"use strict";WK.exports=e=>{let t=typeof e=="string"?`
|
|
301
|
+
`},nodePaths:Z5,entryPoints:[u],...l,sourcemap:"linked",treeShaking:!0,bundle:!0,...c,external:[],logLevel:"silent",conditions:Ta.BUILD_CONDITIONS,plugins:[(0,D1e.environmentPlugin)({sourceDirectory:i,targetPlatform:t}),(0,A1e.blockRemoteModulePlugin)({logger:o}),(0,M1e.openApiRoutesPlugin)({sourceDirectory:i,outputDirectory:n}),(0,x1e.rawRoutePlugin)({sourceDirectory:i,targetPlatform:t,logger:o}),(0,U1e.schemaValidationPlugin)({sourceDirectory:i,logger:o,isOpenApiBased:!0}),(0,k1e.runtimeConfigPlugin)(),(0,C1e.devPortalConfigPlugin)({sourceDirectory:i}),(0,L1e.jsonSchemaPlugin)({sourceDirectory:i,outputDirectory:n}),(0,j1e.nodejsCompatPlugin)({nodeCompatEnabled:a?.esmWorker===!0,sourceDirectory:i})]}}s(F1e,"getBaseESBuildConfig");Ta.default=F1e});var rz=E(mi=>{"use strict";var B1e=mi&&mi.__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]}),V1e=mi&&mi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G1e=mi&&mi.__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)&&B1e(t,e,r);return V1e(t,e),t},tz=mi&&mi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mi,"__esModule",{value:!0});mi.getRunEsBuildPlugin=void 0;var H1e=Va(),ez=Ws(),z1e=G1e(require("esbuild")),K1e=tz(Sr()),W1e=Yy(),Y1e=tz(Z$()),eA=Sd(),J1e=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,targetPlatform:a,generateSourceMaps:u,buildId:c,logger:l,config:d}){return K1e.default.timeFn("Running esbuild",async()=>{l.info(`Running build for platform ${a}, build_id: ${c}`);let f=await(0,Y1e.default)({systemDirectory:r,outputDirectory:n,targetPlatform:a,generateSourceMaps:u,sourceDirectory:i,dev:o,logger:l,flags:d.flags}),m,p=new Date;try{if(!await(0,H1e.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");m=await z1e.build(f)}catch(y){if(l.error(y),y.errors||y.warnings)m=y;else if(y.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))m={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:eA.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 y}let h=new Date;if(e(new W1e.CompilerResult(m,{endBuildTime:h,startBuildTime:p,buildId:c??""})),m.errors.length>0){m.errors.length>1&&(m.errors.length=1);let y=m.errors[0];l.debug(y)}return{warnings:[...m.warnings.map(y=>({message:y.text,pluginName:eA.ESBUILD_PLUGIN_NAME,severity:ez.WARNING_SEVERITY}))],errors:[...m.errors.map(y=>({message:y.text,pluginName:eA.ESBUILD_PLUGIN_NAME,severity:ez.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");mi.getRunEsBuildPlugin=J1e});var rA=E(hf=>{"use strict";var iz=hf&&hf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hf,"__esModule",{value:!0});hf.build=void 0;var pf=Ws(),Q1e=require("crypto"),X1e=require("fs"),tm=iz(require("path")),nz=ht(),Z1e=Po(),eCe=iz(Sr()),tCe=AC(),rCe=nd(),nCe=LC(),iCe=jC(),sCe=MC(),oCe=FC(),aCe=BC(),uCe=zC(),cCe=rj(),lCe=ij(),fCe=rz(),tA=Sd(),qv;try{let e=(0,X1e.readFileSync)(tm.default.resolve(__dirname,"../../package.json"),"utf-8");qv=JSON.parse(e).version}catch{qv="0.0.0"}async function dCe({sourceDirectory:e,dev:t,targetPlatform:r,generateSourceMaps:n=!1,noCompile:i=!1,deploymentName:o=tm.default.basename(e),logger:a,publicZuploEnvironmentVariables:u={},entitlements:c,projectId:l,customDomain:d,environmentType:f,postBuildTasks:m}){let p=(0,Q1e.randomUUID)(),h=a.child({buildId:p});return eCe.default.timeFn(`Run Build for platform: ${r}, build_id: ${p}`,async()=>{let y=await(0,tCe.getZuploConfig)(e),g=tm.default.join(e,nz.BUILD_OUTPUT_DIR),_;if("errors"in y)_={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:qv,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:pf.FAILURE_STATUS,buildId:p,warnings:[],errors:y.errors}};else{let b={dev:t,targetPlatform:r,generateSourceMaps:n,deploymentName:o,sourceDirectory:e,outputDirectory:g,systemDirectory:tm.default.join(e,nz.GENERATED_SOURCE_DIR_NAME),buildId:p,logger:h,config:y.config,publicZuploEnvironmentVariables:u,projectId:l,entitlements:c,customDomain:d,environmentType:f},T=[];T.push(nCe.cleanOutput),T.push(iCe.createSystemDir),T.push(sCe.checkForDeprecations),T.push(oCe.generateBuildData),T.push(uCe.validateDevPortalJSON),T.push(cCe.validateOpenAPIFiles),r==rCe.TargetPlatform.Worker&&T.push(aCe.generateWorker);let P,L=s(G=>{P=G},"compileCallback");i||T.push((0,fCe.getRunEsBuildPlugin)(L)),T.push(lCe.verifyWorkerOutput),m&&T.push(...m);let k=await(0,Z1e.runPlugins)(T,b),q=k.errors.length>0?pf.FAILURE_STATUS:k.warnings.length>0?pf.WARNING_STATUS:pf.GOOD_STATUS;_={status:q==="Failed"||P===void 0||P.status==="Failed"?"Failed":q==="Warnings"||P.status==="Warnings"?"Warnings":"Good",compatibilityDate:y.config.compatibilityDate,runtimeVersion:qv,outputPath:g,compilerResult:P,buildTaskResult:{buildTime:"",buildTimeMs:0,status:q,buildId:p,warnings:k.warnings,errors:k.errors},flags:y.config.flags}}if(_.buildTaskResult.warnings.length>0){_.buildTaskResult.warnings.forEach(T=>{h.warn(T)});let b=_.buildTaskResult.warnings.filter(T=>T.pluginName!=="runEsbuild"&&T.pluginName!==tA.ESBUILD_PLUGIN_NAME);b.length>0&&(_.buildTaskResult.warnings=b),_.buildTaskResult.status=pf.WARNING_STATUS}if(_.buildTaskResult.errors.length>0){_.buildTaskResult.errors.forEach(T=>{h.error(T)});let b=_.buildTaskResult.errors.filter(T=>T.pluginName!=="runEsbuild"&&T.pluginName!==tA.ESBUILD_PLUGIN_NAME);b.length>0&&(_.buildTaskResult.errors=b),_.buildTaskResult.status=pf.FAILURE_STATUS}if(h.debug(`Build ${_.compilerResult?.buildId??p} completed ${i?"on watch mode":"with compiler status "+_.compilerResult?.status} and build task status ${_.buildTaskResult.status}`),_.compilerResult){let{metafile:b,...T}=_.compilerResult;h.debug(`Compiler results for build ${_.compilerResult?.buildId??p}`,T)}h.debug(`Build task results for build ${_.buildTaskResult?.buildId??p}`,_.buildTaskResult);let v=tm.default.basename(e);return(0,tA.formatBuildResult)(_,v,h)})}s(dCe,"build");hf.build=dCe});var sA=E(yi=>{"use strict";var pCe=yi&&yi.__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]}),hCe=yi&&yi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mCe=yi&&yi.__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)&&pCe(t,e,r);return hCe(t,e),t},Fv=yi&&yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yi,"__esModule",{value:!0});yi.BuildWatcher=void 0;var sz=Ws(),yCe=Fv(require("chokidar")),_Ce=mCe(require("esbuild")),oz=require("crypto"),gCe=Fv(require("events")),rm=Fv(require("path")),az=ht(),ECe=rA(),uz=Yy(),vCe=Fv(Z$()),cz=Sd(),nA=class extends gCe.default{static{s(this,"WatchEmitter")}},iA=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new nA;envFilesWatcher;outputDirectory;sourceDirectory;dev;targetPlatform;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,targetPlatform:n,generateSourceMaps:i,logger:o,publicZuploEnvironmentVariables:a={}}){this.sourceDirectory=t,this.dev=r,this.targetPlatform=n,this.outputDirectory=rm.default.join(t,az.BUILD_OUTPUT_DIR),this.generateSourceMaps=i??!1,this.logger=o,this.publicZuploEnvironmentVariables=a,this.projectName=rm.default.basename(t),this.envFilesWatcher=yCe.default.watch([rm.default.join(t,".env"),rm.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,ECe.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,targetPlatform:this.targetPlatform,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,vCe.default)({systemDirectory:rm.default.join(t,az.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,targetPlatform:this.targetPlatform,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 uz.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:sz.FAILURE_STATUS,buildId:(0,oz.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,cz.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",null,u)})}}),this.esbuildContext=await _Ce.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:sz.FAILURE_STATUS,buildId:(0,oz.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new uz.CompilerResult(o),(0,cz.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)}}};yi.BuildWatcher=iA});var oA=E(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});Bv.HttpStatusCode=void 0;var lz;(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"})(lz||(Bv.HttpStatusCode=lz={}))});var fz=E(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});Vv.getSourceControlProviderLabel=void 0;function bCe(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(bCe,"getSourceControlProviderLabel");Vv.getSourceControlProviderLabel=bCe});var pz=E(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=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.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_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=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=void 0;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=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_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.CONSUMER_DOES_NOT_EXIST=S.CONSUMER_NO_ACCESS=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=void 0;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=void 0;var D=oA(),dz=fz(),SCe="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:D.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:D.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:D.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:D.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:D.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:D.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:D.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:D.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:D.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:D.HttpStatusCode.UNAUTHORIZED};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:D.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:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:D.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:D.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:D.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:D.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:D.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:D.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:D.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",status:D.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:D.HttpStatusCode.BAD_REQUEST};var TCe=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:D.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=TCe;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:D.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:D.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:D.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:D.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:D.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:D.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:D.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:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:D.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:D.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:D.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:D.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:D.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:D.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:D.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:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};var OCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=OCe;var wCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=wCe;var PCe=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:D.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=PCe;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:D.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:D.HttpStatusCode.FORBIDDEN};var ICe=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 '${SCe}' to add the repository.`,status:D.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=ICe;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:D.HttpStatusCode.NOT_FOUND};var NCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=NCe;var RCe=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:D.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=RCe;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:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};var $Ce=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:D.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=$Ce;var ACe=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:D.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=ACe;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:D.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:D.HttpStatusCode.FORBIDDEN};var CCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=CCe;var DCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=DCe;var LCe=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:D.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=LCe;var jCe=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:D.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=jCe;var MCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=MCe;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:D.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:D.HttpStatusCode.FORBIDDEN};var xCe=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:D.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=xCe;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:D.HttpStatusCode.FORBIDDEN};var kCe=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=kCe;var UCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=UCe;var qCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=qCe;var FCe=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:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=FCe;var BCe=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:D.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=BCe;S.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:D.HttpStatusCode.UNAUTHORIZED};S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:D.HttpStatusCode.NOT_FOUND};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:D.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:D.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:D.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:D.HttpStatusCode.INTERNAL_SERVER_ERROR};var VCe=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,dz.getSourceControlProviderLabel)(e)}`,status:D.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=VCe;var GCe=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,dz.getSourceControlProviderLabel)(e)} repository`,status:D.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=GCe;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:D.HttpStatusCode.BAD_REQUEST};var HCe=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:D.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=HCe;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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.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:D.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:D.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:D.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:D.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:D.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:D.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:D.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:D.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:D.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:D.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:D.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:D.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:D.HttpStatusCode.NOT_FOUND};var zCe=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:D.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=zCe;var KCe=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:D.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=KCe;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:D.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:D.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:D.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:D.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:D.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:D.HttpStatusCode.BAD_REQUEST};var WCe=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:D.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=WCe;var YCe=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:D.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=YCe;var JCe=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:D.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=JCe;var QCe=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:D.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=QCe;var XCe=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:D.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=XCe;var ZCe=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=ZCe;var eDe=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:D.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=eDe;var tDe=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:D.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=tDe;var rDe=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:D.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=rDe;var nDe=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=nDe;var iDe=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=iDe;var sDe=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:D.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=sDe;var oDe=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:D.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=oDe;var aDe=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:D.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=aDe;var uDe=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=uDe;var cDe=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:D.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=cDe;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:D.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:D.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:D.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:D.HttpStatusCode.INTERNAL_SERVER_ERROR}});var mz=E(bn=>{"use strict";var lDe=bn&&bn.__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]}),fDe=bn&&bn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),dDe=bn&&bn.__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)&&lDe(t,e,r);return fDe(t,e),t};Object.defineProperty(bn,"__esModule",{value:!0});bn.ApiNotFoundError=bn.ApiError=bn.Problems=void 0;var hz=dDe(pz());bn.Problems=hz;var Gv=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}};bn.ApiError=Gv;var aA=class extends Gv{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...hz.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};bn.ApiNotFoundError=aA});var yz=E(go=>{"use strict";var pDe=go&&go.__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]}),hDe=go&&go.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&pDe(t,e,r)};Object.defineProperty(go,"__esModule",{value:!0});go.HttpStatusCode=void 0;hDe(mz(),go);var mDe=oA();Object.defineProperty(go,"HttpStatusCode",{enumerable:!0,get:function(){return mDe.HttpStatusCode}})});var gz=E((HKe,_z)=>{"use strict";function yDe(e){return e>=55296&&e<=56319}s(yDe,"isHighSurrogate");function _De(e){return e>=56320&&e<=57343}s(_De,"isLowSurrogate");_z.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],yDe(a)&&_De(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 vz=E((KKe,Ez)=>{"use strict";var gDe=gz(),EDe=Buffer.byteLength.bind(Buffer);Ez.exports=gDe.bind(null,EDe)});var uA=E(mf=>{"use strict";var vDe=mf&&mf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mf,"__esModule",{value:!0});mf.sanitize=void 0;var bDe=vDe(vz()),SDe=/[/?<>\\:*|"]/g,TDe=/[\x00-\x1f\x80-\x9f]/g,ODe=/^\.+$/,wDe=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,PDe=/[. ]+$/;function IDe(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(SDe,t).replace(TDe,t).replace(ODe,t).replace(wDe,t).replace(PDe,t);return(0,bDe.default)(r,255)}s(IDe,"sanitize");mf.sanitize=IDe});var Oz=E(yf=>{"use strict";var Tz=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yf,"__esModule",{value:!0});yf.createProjectDirs=void 0;var bz=Tz(require("fs/promises")),NDe=Tz(require("path")),nm=ht(),Sz=Po(),RDe=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[nm.USER_MODULES_DIR_NAME,nm.USER_CONFIG_DIR_NAME,nm.USER_TEST_DIR_NAME,nm.USER_SCHEMAS_DIR_NAME,nm.USER_DOCS_DIR_NAME,".vscode"];try{await bz.default.mkdir(e);for(let n of r)await bz.default.mkdir(NDe.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new Sz.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new Sz.PluginResult},"createProjectDirs");yf.createProjectDirs=RDe});var Nz=E(_f=>{"use strict";var Iz=_f&&_f.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_f,"__esModule",{value:!0});_f.generateFromTemplate=void 0;var $De=require("fs"),wz=Iz(require("fs/promises")),Pz=Iz(require("path"));async function ADe(e){let t=Pz.default.resolve(__dirname,"..","templates",e);if((0,$De.existsSync)(t))return await wz.default.readFile(t,"utf-8");{let r=Pz.default.resolve(__dirname,"templates",e);return await wz.default.readFile(r,"utf-8")}}s(ADe,"generateFromTemplate");_f.generateFromTemplate=ADe});var Sn=E(gf=>{"use strict";var Hv=gf&&gf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gf,"__esModule",{value:!0});gf.generateFileFromTemplate=void 0;var CDe=Hv(Tr()),DDe=Hv(require("fs/promises")),LDe=Hv(require("path")),jDe=Hv(Sr()),MDe=Nz(),xDe=s(function(e,t){return async({sourceDirectory:r,logger:n})=>jDe.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=LDe.default.join(r,e);return await CDe.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):kDe(i,t,n)})},"generateFileFromTemplate");gf.generateFileFromTemplate=xDe;async function kDe(e,t,r){let n=await(0,MDe.generateFromTemplate)(t);try{await DDe.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(kDe,"writeTemplate")});var $z=E(Ef=>{"use strict";var UDe=Ef&&Ef.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ef,"__esModule",{value:!0});Ef.generateDefaultDocsMarkdown=void 0;var qDe=UDe(require("path")),Rz=ht(),FDe=Sn();Ef.generateDefaultDocsMarkdown=(0,FDe.generateFileFromTemplate)(qDe.default.join(Rz.USER_DOCS_DIR_NAME,Rz.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Cz=E(vf=>{"use strict";var BDe=vf&&vf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vf,"__esModule",{value:!0});vf.generateDefaultDocsSidebar=void 0;var VDe=BDe(require("path")),Az=ht(),GDe=Sn();vf.generateDefaultDocsSidebar=(0,GDe.generateFileFromTemplate)(VDe.default.join(Az.USER_DOCS_DIR_NAME,Az.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var Lz=E(bf=>{"use strict";var HDe=bf&&bf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bf,"__esModule",{value:!0});bf.generateDefaultDocsTheme=void 0;var zDe=HDe(require("path")),Dz=ht(),KDe=Sn();bf.generateDefaultDocsTheme=(0,KDe.generateFileFromTemplate)(zDe.default.join(Dz.USER_DOCS_DIR_NAME,Dz.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Mz=E(Sf=>{"use strict";var WDe=Sf&&Sf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sf,"__esModule",{value:!0});Sf.generateDefaultModule=void 0;var YDe=WDe(require("path")),jz=ht(),JDe=Sn();Sf.generateDefaultModule=(0,JDe.generateFileFromTemplate)(YDe.default.join(jz.USER_MODULES_DIR_NAME,jz.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var kz=E(Tf=>{"use strict";var QDe=Tf&&Tf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tf,"__esModule",{value:!0});Tf.generateDevPortalConfigJson=void 0;var XDe=QDe(require("path")),xz=ht(),ZDe=Sn();Tf.generateDevPortalConfigJson=(0,ZDe.generateFileFromTemplate)(XDe.default.join(xz.USER_CONFIG_DIR_NAME,xz.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Uz=E(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});zv.generateEnvironment=void 0;var e2e=Sn();zv.generateEnvironment=(0,e2e.generateFileFromTemplate)(".env","env.template")});var qz=E(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});Kv.generateESLint=void 0;var t2e=Sn();Kv.generateESLint=(0,t2e.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Fz=E(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});Wv.generateGitignore=void 0;var r2e=Sn();Wv.generateGitignore=(0,r2e.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var Bz=E(Of=>{"use strict";var n2e=Of&&Of.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Of,"__esModule",{value:!0});Of.generateLaunchJson=void 0;var i2e=n2e(require("path")),s2e=Sn();Of.generateLaunchJson=(0,s2e.generateFileFromTemplate)(i2e.default.join(".vscode","launch.json"),"launch.template.jsonc")});var Gz=E(wf=>{"use strict";var o2e=wf&&wf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wf,"__esModule",{value:!0});wf.generateRouteOasConfig=void 0;var a2e=o2e(require("path")),Vz=ht(),u2e=Sn();wf.generateRouteOasConfig=(0,u2e.generateFileFromTemplate)(a2e.default.join(Vz.USER_CONFIG_DIR_NAME,Vz.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var Kz=E(_i=>{"use strict";var cA=_i&&_i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_i,"__esModule",{value:!0});_i.updateProjectPackageJson=_i.getProjectPackageJson=_i.getPackageOverrides=_i.generateDefaultPackageJson=void 0;var Hz=cA(require("fs/promises")),lA=cA(require("path")),c2e=cA(as());async function l2e(e,t=c2e.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=zz();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(l2e,"generateDefaultPackageJson");_i.generateDefaultPackageJson=l2e;function zz(){let e=lA.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(zz,"getPackageOverrides");_i.getPackageOverrides=zz;async function f2e(e){let t=lA.default.join(e,"package.json"),r=await Hz.default.readFile(t,"utf-8");return JSON.parse(r)}s(f2e,"getProjectPackageJson");_i.getProjectPackageJson=f2e;async function d2e(e,t){let r=lA.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await Hz.default.writeFile(r,n,"utf-8")}s(d2e,"updateProjectPackageJson");_i.updateProjectPackageJson=d2e});var Jz=E(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});Yv.generatePackageJson=void 0;var Wz=Kz(),Yz=Po(),p2e=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,Wz.generateDefaultPackageJson)(t);try{await(0,Wz.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new Yz.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new Yz.PluginResult},"generatePackageJson");Yv.generatePackageJson=p2e});var Xz=E(Pf=>{"use strict";var h2e=Pf&&Pf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.generatePoliciesConfig=void 0;var m2e=h2e(require("path")),Qz=ht(),y2e=Sn();Pf.generatePoliciesConfig=(0,y2e.generateFileFromTemplate)(m2e.default.join(Qz.USER_CONFIG_DIR_NAME,Qz.POLICIES_CONFIG_FILE),"policies.template.json")});var Zz=E(If=>{"use strict";var _2e=If&&If.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(If,"__esModule",{value:!0});If.generateSettingsJson=void 0;var g2e=_2e(require("path")),E2e=Sn();If.generateSettingsJson=(0,E2e.generateFileFromTemplate)(g2e.default.join(".vscode","settings.json"),"settings.template.jsonc")});var eK=E(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});Jv.generateTSConfig=void 0;var v2e=Sn();Jv.generateTSConfig=(0,v2e.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var rK=E(Nf=>{"use strict";var b2e=Nf&&Nf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nf,"__esModule",{value:!0});Nf.generateZuploJson=void 0;var S2e=Ws(),T2e=require("fs/promises"),O2e=b2e(require("path")),w2e=ht(),tK=Po(),P2e=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:S2e.DEFAULT_COMPATIBILITY_DATE},i=O2e.default.join(t,w2e.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,T2e.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new tK.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new tK.PluginResult},"generateZuploJson");Nf.generateZuploJson=P2e});var oK=E(Rf=>{"use strict";var sK=Rf&&Rf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rf,"__esModule",{value:!0});Rf.create=void 0;var nK=yz(),I2e=sK(Tr()),N2e=require("fs/promises"),R2e=sK(require("path")),$2e=Po(),iK=uA(),A2e=Oz(),C2e=$z(),D2e=Cz(),L2e=Lz(),j2e=Mz(),M2e=kz(),x2e=Uz(),k2e=qz(),U2e=Fz(),q2e=Bz(),F2e=Gz(),B2e=Jz(),V2e=Xz(),G2e=Zz(),H2e=eK(),z2e=rK();async function K2e({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,iK.sanitize)(e),o=(0,iK.sanitize)(t),a=R2e.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await I2e.default.dirExists(a))throw new nK.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:nK.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(A2e.createProjectDirs,F2e.generateRouteOasConfig,z2e.generateZuploJson,M2e.generateDevPortalConfigJson,j2e.generateDefaultModule,D2e.generateDefaultDocsSidebar,C2e.generateDefaultDocsMarkdown,L2e.generateDefaultDocsTheme,V2e.generatePoliciesConfig),c.push(H2e.generateTSConfig,U2e.generateGitignore,B2e.generatePackageJson,x2e.generateEnvironment,k2e.generateESLint,q2e.generateLaunchJson,G2e.generateSettingsJson);let{errors:l,warnings:d}=await(0,$2e.runPlugins)(c,u);if(d.length>0&&d.forEach(m=>{n.warn(m)}),l.length>0){await(0,N2e.rm)(a,{recursive:!0,force:!0});let m=l[0];throw m instanceof Error?m:new Error(m.message)}return{sourceDirectory:a,projectName:e}}s(K2e,"create");Rf.create=K2e});var fK=E((T9e,lK)=>{lK.exports=cK;cK.sync=Y2e;var aK=require("fs");function W2e(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(W2e,"checkPathExt");function uK(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:W2e(t,r)}s(uK,"checkStat");function cK(e,t,r){aK.stat(e,function(n,i){r(n,n?!1:uK(i,e,t))})}s(cK,"isexe");function Y2e(e,t){return uK(aK.statSync(e),e,t)}s(Y2e,"sync")});var yK=E((w9e,mK)=>{mK.exports=pK;pK.sync=J2e;var dK=require("fs");function pK(e,t,r){dK.stat(e,function(n,i){r(n,n?!1:hK(i,t))})}s(pK,"isexe");function J2e(e,t){return hK(dK.statSync(e),t)}s(J2e,"sync");function hK(e,t){return e.isFile()&&Q2e(e,t)}s(hK,"checkStat");function Q2e(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),d=u|c,f=r&l||r&c&&i===a||r&u&&n===o||r&d&&o===0;return f}s(Q2e,"checkMode")});var gK=E((N9e,_K)=>{var I9e=require("fs"),Qv;process.platform==="win32"||global.TESTING_WINDOWS?Qv=fK():Qv=yK();_K.exports=fA;fA.sync=X2e;function fA(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){fA(e,t||{},function(o,a){o?i(o):n(a)})})}Qv(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(fA,"isexe");function X2e(e,t){try{return Qv.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(X2e,"sync")});var wK=E(($9e,OK)=>{var $f=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",EK=require("path"),Z2e=$f?";":":",vK=gK(),bK=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),SK=s((e,t)=>{let r=t.colon||Z2e,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"),TK=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=SK(e,t),a=[],u=s(l=>new Promise((d,f)=>{if(l===n.length)return t.all&&a.length?d(a):f(bK(e));let m=n[l],p=/^".*"$/.test(m)?m.slice(1,-1):m,h=EK.join(p,e),y=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;d(c(y,l,0))}),"step"),c=s((l,d,f)=>new Promise((m,p)=>{if(f===i.length)return m(u(d+1));let h=i[f];vK(l+h,{pathExt:o},(y,g)=>{if(!y&&g)if(t.all)a.push(l+h);else return m(l+h);return m(c(l,d,f+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),eLe=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=SK(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=EK.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<n.length;f++){let m=d+n[f];try{if(vK.sync(m,{pathExt:i}))if(t.all)o.push(m);else return m}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw bK(e)},"whichSync");OK.exports=TK;TK.sync=eLe});var pA=E((C9e,dA)=>{"use strict";var PK=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");dA.exports=PK;dA.exports.default=PK});var $K=E((L9e,RK)=>{"use strict";var IK=require("path"),tLe=wK(),rLe=pA();function NK(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=tLe.sync(e.command,{path:r[rLe({env:r})],pathExt:t?IK.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=IK.resolve(i?e.options.cwd:"",a)),a}s(NK,"resolveCommandAttempt");function nLe(e){return NK(e)||NK(e,!0)}s(nLe,"resolveCommand");RK.exports=nLe});var AK=E((M9e,mA)=>{"use strict";var hA=/([()\][%!^"`<>&|;, *?])/g;function iLe(e){return e=e.replace(hA,"^$1"),e}s(iLe,"escapeCommand");function sLe(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(hA,"^$1"),t&&(e=e.replace(hA,"^$1")),e}s(sLe,"escapeArgument");mA.exports.command=iLe;mA.exports.argument=sLe});var DK=E((k9e,CK)=>{"use strict";CK.exports=/^#!(.*)/});var jK=E((U9e,LK)=>{"use strict";var oLe=DK();LK.exports=(e="")=>{let t=e.match(oLe);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var xK=E((q9e,MK)=>{"use strict";var yA=require("fs"),aLe=jK();function uLe(e){let r=Buffer.alloc(150),n;try{n=yA.openSync(e,"r"),yA.readSync(n,r,0,150,0),yA.closeSync(n)}catch{}return aLe(r.toString())}s(uLe,"readShebang");MK.exports=uLe});var FK=E((B9e,qK)=>{"use strict";var cLe=require("path"),kK=$K(),UK=AK(),lLe=xK(),fLe=process.platform==="win32",dLe=/\.(?:com|exe)$/i,pLe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function hLe(e){e.file=kK(e);let t=e.file&&lLe(e.file);return t?(e.args.unshift(e.file),e.command=t,kK(e)):e.file}s(hLe,"detectShebang");function mLe(e){if(!fLe)return e;let t=hLe(e),r=!dLe.test(t);if(e.options.forceShell||r){let n=pLe.test(t);e.command=cLe.normalize(e.command),e.command=UK.command(e.command),e.args=e.args.map(o=>UK.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(mLe,"parseNonShell");function yLe(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:mLe(n)}s(yLe,"parse");qK.exports=yLe});var GK=E((G9e,VK)=>{"use strict";var _A=process.platform==="win32";function gA(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(gA,"notFoundError");function _Le(e,t){if(!_A)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=BK(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(_Le,"hookChildProcess");function BK(e,t){return _A&&e===1&&!t.file?gA(t.original,"spawn"):null}s(BK,"verifyENOENT");function gLe(e,t){return _A&&e===1&&!t.file?gA(t.original,"spawnSync"):null}s(gLe,"verifyENOENTSync");VK.exports={hookChildProcess:_Le,verifyENOENT:BK,verifyENOENTSync:gLe,notFoundError:gA}});var KK=E((z9e,Af)=>{"use strict";var HK=require("child_process"),EA=FK(),vA=GK();function zK(e,t,r){let n=EA(e,t,r),i=HK.spawn(n.command,n.args,n.options);return vA.hookChildProcess(i,n),i}s(zK,"spawn");function ELe(e,t,r){let n=EA(e,t,r),i=HK.spawnSync(n.command,n.args,n.options);return i.error=i.error||vA.verifyENOENTSync(i.status,n),i}s(ELe,"spawnSync");Af.exports=zK;Af.exports.spawn=zK;Af.exports.sync=ELe;Af.exports._parse=EA;Af.exports._enoent=vA});var YK=E((W9e,WK)=>{"use strict";WK.exports=e=>{let t=typeof e=="string"?`
|
|
302
302
|
`:`
|
|
303
303
|
`.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 XK=E((Y9e,sm)=>{"use strict";var im=require("path"),JK=pA(),QK=s(e=>{e={cwd:process.cwd(),path:process.env[JK()],execPath:process.execPath,...e};let t,r=im.resolve(e.cwd),n=[];for(;t!==r;)n.push(im.join(r,"node_modules/.bin")),t=r,r=im.resolve(r,"..");let i=im.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(im.delimiter)},"npmRunPath");sm.exports=QK;sm.exports.default=QK;sm.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=JK({env:t});return e.path=t[r],t[r]=sm.exports(e),t}});var e9=E((Q9e,bA)=>{"use strict";var ZK=s((e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},"mimicFn");bA.exports=ZK;bA.exports.default=ZK});var r9=E((Z9e,Zv)=>{"use strict";var vLe=e9(),Xv=new WeakMap,t9=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(Xv.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 vLe(o,e),Xv.set(o,n),o},"onetime");Zv.exports=t9;Zv.exports.default=t9;Zv.exports.callCount=e=>{if(!Xv.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Xv.get(e)}});var n9=E(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.SIGNALS=void 0;var bLe=[{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"}];e0.SIGNALS=bLe});var SA=E(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.SIGRTMAX=Cf.getRealtimeSignals=void 0;var SLe=s(function(){let e=s9-i9+1;return Array.from({length:e},TLe)},"getRealtimeSignals");Cf.getRealtimeSignals=SLe;var TLe=s(function(e,t){return{name:`SIGRT${t+1}`,number:i9+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),i9=34,s9=64;Cf.SIGRTMAX=s9});var o9=E(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.getSignals=void 0;var OLe=require("os"),wLe=n9(),PLe=SA(),ILe=s(function(){let e=(0,PLe.getRealtimeSignals)();return[...wLe.SIGNALS,...e].map(NLe)},"getSignals");t0.getSignals=ILe;var NLe=s(function({name:e,number:t,description:r,action:n,forced:i=!1,standard:o}){let{signals:{[e]:a}}=OLe.constants,u=a!==void 0;return{name:e,number:u?a:t,description:r,supported:u,action:n,forced:i,standard:o}},"normalizeSignal")});var u9=E(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.signalsByNumber=Df.signalsByName=void 0;var RLe=require("os"),a9=o9(),$Le=SA(),ALe=s(function(){return(0,a9.getSignals)().reduce(CLe,{})},"getSignalsByName"),CLe=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"),DLe=ALe();Df.signalsByName=DLe;var LLe=s(function(){let e=(0,a9.getSignals)(),t=$Le.SIGRTMAX+1,r=Array.from({length:t},(n,i)=>jLe(i,e));return Object.assign({},...r)},"getSignalsByNumber"),jLe=s(function(e,t){let r=MLe(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"),MLe=s(function(e,t){let r=t.find(({name:n})=>RLe.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},"findSignalByNumber"),xLe=LLe();Df.signalsByNumber=xLe});var l9=E((u6e,c9)=>{"use strict";var{signalsByName:kLe}=u9(),ULe=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"),qLe=s(({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:a,escapedCommand:u,timedOut:c,isCanceled:l,killed:d,parsed:{options:{timeout:f}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let m=i===void 0?void 0:kLe[i].description,p=n&&n.code,y=`Command ${ULe({timedOut:c,timeout:f,errorCode:p,signal:i,signalDescription:m,exitCode:o,isCanceled:l})}: ${a}`,g=Object.prototype.toString.call(n)==="[object Error]",_=g?`${y}
|
|
304
304
|
${n.message}`:y,v=[_,t,e].filter(Boolean).join(`
|