@zuplo/core 5.1929.0 → 5.1935.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/create.index.minified.js +1 -1
- package/index.minified.js +2 -2
- package/package.json +1 -1
package/create.index.minified.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
"use strict";var YZe=Object.create;var ZE=Object.defineProperty;var WZe=Object.getOwnPropertyDescriptor;var QZe=Object.getOwnPropertyNames;var XZe=Object.getPrototypeOf,ZZe=Object.prototype.hasOwnProperty;var l=(t,e)=>ZE(t,"name",{value:e,configurable:!0});var Ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),eM=(t,e)=>{for(var r in e)ZE(t,r,{get:e[r],enumerable:!0})},kde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QZe(e))!ZZe.call(t,i)&&i!==r&&ZE(t,i,{get:()=>e[i],enumerable:!(n=WZe(e,i))||n.enumerable});return t};var wu=(t,e,r)=>(r=t!=null?YZe(XZe(t)):{},kde(e||!t||!t.__esModule?ZE(r,"default",{value:t,enumerable:!0}):r,t)),Xg=t=>kde(ZE({},"__esModule",{value:!0}),t);var ba=x(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.EnvironmentalVariableRequiredError=Zg.getRequiredEnvVar=void 0;var tM=class{static{l(this,"Environment")}get LOG_LEVEL(){return process.env.LOG_LEVEL??"info"}get LOG_FORMAT(){return process.env.LOG_FORMAT??"pretty"}get NODE_ENV(){return process.env.NODE_ENV}get USE_LOCAL_API_SERVER(){return process.env.USE_LOCAL_API_SERVER==="true"}get USE_MONOREPO_PACKAGES(){return process.env.USE_MONOREPO_PACKAGES==="true"}get GCP_STORAGE_BUNDLE_BUCKET_NAME(){return process.env.GCP_STORAGE_BUNDLE_BUCKET_NAME}get GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME(){return process.env.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}get GCP_STORAGE_ARCHIVE_BUCKET_NAME(){return process.env.GCP_STORAGE_ARCHIVE_BUCKET_NAME}get GCP_STORAGE_SOURCE_CODE_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}get GCP_STORAGE_SOURCES_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCES_BUCKET_NAME}get ZUPLO_AUTH_API_JWT(){return process.env.ZUPLO_AUTH_API_JWT}get GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS(){return process.env.GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS}get RUNTIME_DENO_VERSION(){return process.env.RUNTIME_DENO_VERSION??"1.53.0"}get AUTH_API_URL(){return Ja("AUTH_API_URL","http://localhost:5201")}get MANAGEMENT_API_URL(){return Ja("MANAGEMENT_API_URL","http://localhost:3100")}get TENANT_API_URL(){return Ja("TENANT_API_URL","http://localhost:5100")}get CONTENT_API_URL(){return Ja("CONTENT_API_URL","http://localhost:5400")}get DEPLOYER_API_URL(){return Ja("DEPLOYER_API_URL","http://localhost:5300")}get DEV_API_URL(){return Ja("DEV_API_URL","http://localhost:5200")}get API_KEY_SERVICE_URL(){return Ja("API_KEY_SERVICE_URL","https://apikey.zuplo.com")}get API_KEY_MANAGEMENT_SERVICE_URL(){return Ja("API_KEY_MANAGEMENT_SERVICE_URL","https://api-key-management-service-rreeuhlsca-ue.a.run.app")}get METERING_SERVICE_URL(){return Ja("METERING_SERVICE_URL","https://meters.zuplo.com")}get FETCH_PROXY_URL(){return process.env.FETCH_PROXY_URL||"https://proxy-main-04e55cb.zuplo.app"}get FETCH_PROXY_API_KEY(){return process.env.FETCH_PROXY_API_KEY||"zpk_123"}get LOG_EVENT_API_URL(){return process.env.LOG_EVENT_API_URL}get LAUNCH_DARKLY_SERVER_KEY(){return process.env.LAUNCH_DARKLY_SERVER_KEY}get REMOTE_LOGGING_SHARED_SECRET(){return process.env.REMOTE_LOGGING_SHARED_SECRET??"the-logging-shared-secret"}get TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT(){return process.env.TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT??"10.142.0.64:5000"}get DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME(){return process.env.DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME??"zpl-developer-api"}get __ZUPLO_AUTH_API_JWT(){return process.env.__ZUPLO_AUTH_API_JWT??void 0}get BUILD_ASSETS_BUCKET_NAME(){return process.env.BUILD_ASSETS_BUCKET_NAME}get BUILD_ASSETS_S3_ENDPOINT(){return process.env.BUILD_ASSETS_S3_ENDPOINT}get BUILD_ASSETS_ACCESS_KEY_ID(){return process.env.BUILD_ASSETS_ACCESS_KEY_ID}get BUILD_ASSETS_SECRET_ACCESS_KEY(){return process.env.BUILD_ASSETS_SECRET_ACCESS_KEY}get DEV_PORTAL_ENCRYPTION_SECRET(){if(!process.env.DEV_PORTAL_ENCRYPTION_SECRET)throw new ew("DEV_PORTAL_ENCRYPTION_SECRET");return process.env.DEV_PORTAL_ENCRYPTION_SECRET}isProduction(){return this.NODE_ENV==="production"}get OPENFGA_SERVICE_URL(){return Ja("OPENFGA_SERVICE_URL","https://openfga-eq7z4lly2a-ue.a.run.app")}get OPENFGA_STORE_ID(){return process.env.OPENFGA_STORE_ID??""}get OPENFGA_MODEL_ID(){return process.env.OPENFGA_MODEL_ID??""}GCP_PROJECT_ID(){return Ja("GCP_PROJECT_ID")}GCP_TASK_QUEUE_LOCATION(){return Ja("GCP_TASK_QUEUE_LOCATION")}GCP_TASK_QUEUE_NAME(){return Ja("GCP_TASK_QUEUE_NAME")}};function Ja(t,e){let r=process.env[t];if(r===void 0&&(e===void 0||process.env.NODE_ENV==="production"))throw new ew(t);return r??e}l(Ja,"getRequiredEnvVar");Zg.getRequiredEnvVar=Ja;var ew=class extends Error{static{l(this,"EnvironmentalVariableRequiredError")}constructor(e){super(`The environmental variable '${e}' is required.'`)}};Zg.EnvironmentalVariableRequiredError=ew;var eet=new tM;Zg.default=eet});var rM=x(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});C6.HttpStatusCode=void 0;var Rde;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.ALREADY_REPORTED=208]="ALREADY_REPORTED",t[t.IM_USED=226]="IM_USED",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.SWITCH_PROXY=306]="SWITCH_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Rde||(C6.HttpStatusCode=Rde={}))});var Nde=x(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});k6.getSourceControlProviderLabel=void 0;function tet(t){let e="";switch(t){case"GITLAB":e="GitLab";break;case"GITHUB":e="GitHub";break;case"BITBUCKET":e="BitBucket";break;default:e=t;break}return e}l(tet,"getSourceControlProviderLabel");k6.getSourceControlProviderLabel=tet});var Ide=x(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.DEPLOYMENT_INVALID_MULTI_PART=V.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=V.DEPLOYMENT_FILE_DOES_NOT_EXISTS=V.DEPLOYMENT_NOT_FOUND=V.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=V.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=V.DEPLOYMENT_NO_ACCESS=V.INVALID_SOURCE_REPO_URL=V.INVALID_EMAIL_FORMAT=V.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=V.PROJECT_MUST_HAVE_ONE_MEMBER=V.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=V.PROJECT_MEMBER_ALREADY_EXISTS=V.PROJECT_MEMBER_NOT_FOUND=V.INVALID_TEMPLATE_REPOSITORY=V.INCORRECT_PROJECT_TEMPLATE=V.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=V.PROJECT_NOT_FOUND=V.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=V.PROJECT_SHARING_DISABLED_ON_ACCOUNT=V.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=V.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=V.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=V.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=V.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=V.ACCOUNT_MEMBER_INVITE_INVALID=V.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=V.ACCOUNT_MEMBER_DOES_NOT_EXIST=V.ACCOUNT_MEMBER_INFO_MISSING=V.ACCOUNT_MEMBER_ALREADY_EXISTS=V.ACCOUNT_UPDATE_INFO_MISSING=V.ACCOUNT_INFO_MISSING=V.ACCOUNT_DOES_NOT_EXISTS=V.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=V.ACCOUNT_NAME_USES_RESERVED_KEYWORD=V.ACCOUNT_ALREADY_EXISTS=V.ACCOUNT_NOT_FOUND=V.USER_IS_NOT_SERVICE_ACCOUNT=V.USER_REMOVE_NOT_MEMBER_ACCOUNT=V.USER_HAS_NO_ACCESS_TO_ACCOUNT=V.USER_DETAILS_CANNOT_BE_FOUND=V.USER_ALREADY_EXISTS=V.CLIENT_NOT_FOUND=V.FORBIDDEN=V.UNAUTHORIZED=V.METHOD_NOT_ALLOWED=V.NOT_FOUND=V.CONFLICT=V.BAD_REQUEST=V.INTERNAL_SERVER_ERROR=void 0;V.GITHUB_INTEGRATION_DUPLICATE_REPO=V.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=V.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=V.GITHUB_INTEGRATION_BRANCH_BEHIND=V.GITHUB_INTEGRATION_NOT_FOUND=V.GITHUB_REPOSITORY_NOT_FOUND=V.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=V.GITHUB_INTEGRATION_ALREADY_EXISTS=V.FEATURE_FLAGS_NOT_FOUND=V.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=V.PROJECT_ALREADY_HAS_REPO=V.PROJECT_INVALID_NAME=V.FAILED_TO_REVOKE_GH_TOKEN=V.USER_ACCOUNT_NOT_FS_MIGRATED=V.USER_NO_ACCESS_GITLAB_REPO=V.USER_NO_ACCESS_BITBUCKET_REPO=V.GITHUB_APP_CONFIGURATION_NOT_FOUND=V.GITHUB_APP_NO_USER_ACCESS_=V.GITHUB_APP_NO_NAMESPACE_ACCESS=V.GENERIC_GITHUB_BRANCH_INFO_ERROR=V.GITHUB_USER_NO_READ_ACCESS_REPO=V.USER_NO_PULL_ACCESS_GITHUB_REPO=V.USER_NO_ACCESS_GITHUB_REPO=V.PROJECT_SHARING_REQUIRES_GIT_REPO=V.PROJECT_INVALID_GIT_REPO=V.PROJECT_INVALID_GIT_CLONE=V.USER_IS_PROJECT_MEMBER=V.USER_HAS_NO_ACCESS_TO_PROJECT=V.RUNTIME_FLAG_KEY_NOT_VALID=V.RUNTIME_FLAG_NOT_FOUND=V.RUNTIME_FLAG_ALREADY_EXISTS=V.PROJECT_NO_MEMBERS=V.PROJECT_ALREADY_EXISTS=V.SERVICE_CONFIGURATION_FAILED_DECRYPTION=V.WORKING_COPY_SERVICE_NOT_CREATED=V.WORKING_COPY_SERVICE_NOT_DELETED=V.WORKING_COPY_SERVICE_NOT_FOUND=V.SERVICE_CONFIGURATION_NOT_FOUND=V.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=V.DEPLOYMENT_INCORRECT_STATUS_PAUSE=V.DEPLOYMENT_NOT_WORKING_COPY=V.DEPLOYMENT_LOG_NOT_FOUND=V.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=V.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=V.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=V.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=V.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=V.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=V.DEPLOYMENT_DELETE_ERROR=V.DEPLOYMENT_CANNOT_DELETE_INSTANCE=void 0;V.TARGET_BRANCH_ONLY_FOR_PREVIEW=V.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=V.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=V.DEPLOYMENT_NAME_MISSING=V.NON_EXISTENT_ENVIRONMENT_VARIABLE=V.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=V.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=V.DUPLICATE_ENVIRONMENT_VARIABLE=V.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=V.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=V.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=V.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=V.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=V.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=V.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=V.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=V.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=V.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=V.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=V.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=V.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=V.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=V.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=V.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=V.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=V.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=V.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=V.SOURCE_CONTROL_REPO_OPERATION_ERROR=V.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=V.SOURCE_CONTROL_REPO_NOT_FOUND=V.SOURCE_CONTROL_AUTHENTICATION_FAILED=V.EXTERNAL_SERVICE_GENERIC_ERROR=V.API_USER_NO_ACCESS=V.EXTERNAL_USER_NOT_CONFIGURED=V.EXTERNAL_USER_NO_ACCESS=V.CONSUMER_DOES_NOT_EXIST=V.CONSUMER_NO_ACCESS=V.GITLAB_ACCESS_LEVEL_CHECK_FAIL=V.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=V.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=V.GITLAB_DUPLICATE_REPO=V.GITLAB_FAILED_DURING_REPO_CREATION=V.GITLAB_QUERY_USER_INFO_FAILED=V.BITBUCKET_FAILED_DURING_REPO_CREATION=V.BITBUCKET_WORKSPACE_MISCONFIGURATION=V.BITBUCKET_QUERY_USER_INFO_FAILED=V.GITHUB_INTEGRATION_INVALID_REPO=V.GIT_CREATE_PROJECT_WITH_INVALID_REPO=V.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=V.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=void 0;V.METERING_BUCKET_CREATION_FAILED=V.UNABLE_UPGRADE_PLAN=V.BUCKET_NOT_FOUND=V.BUCKET_API_KEY_SERVICE_CONFLICT=V.DIRECTORY_DELETE_FAILED=V.FILE_DELETE_FAILED=V.CANNOT_DELETE_SOLE_OPEN_API_FILE=V.CANNOT_DELETE_ESSENTIAL_DIRECTORY=V.CANNOT_DELETE_ESSENTIAL_FILE=V.FILE_WRITE_FAILED=V.FILE_RENAME_FAILED=V.FILE_RENAME_FILE_ALREADY_EXISTS=V.FILE_RENAME_CANNOT_CHANGE_EXTENSION=V.FILE_RENAME_PATHS_MATCH=V.DIRECTORY_CREATION_FAILED=V.DIRECTORY_OR_FILE_DOES_NOT_EXIST=V.DIRECTORY_DOES_NOT_EXIST=V.DIRECTORY_ALREADY_EXISTS=V.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=V.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=V.FAILED_DOWNLOAD_FROM_STORAGE=V.CANNOT_FIND_SRC_DIRECTORY=V.CANNOT_READ_PACKAGE_JSON=V.PACKAGE_JSON_NOT_FOUND=V.RUNTIME_VERSION_INCORRECT_FORMAT=V.MIGRATIONS_ONLY_ON_WORKING_COPY=V.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=V.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=V.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=V.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=V.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=V.NO_GLOBAL_SYMBOLS=V.NO_ZUPLO_PREFIXED_VARIABLES=V.NON_EMPTY_TARGETS_REQUIRED=V.CONFLICTING_TYPES=V.OVERLAPPING_TARGETS=V.INVALID_BRANCH_NAME=void 0;var me=rM(),Dde=Nde(),ret="https://github.com/apps/zuplo/installations/new";V.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:me.HttpStatusCode.BAD_REQUEST};V.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:me.HttpStatusCode.CONFLICT};V.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:me.HttpStatusCode.NOT_FOUND};V.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:me.HttpStatusCode.METHOD_NOT_ALLOWED};V.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:me.HttpStatusCode.UNAUTHORIZED};V.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:me.HttpStatusCode.FORBIDDEN};V.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:me.HttpStatusCode.NOT_FOUND};V.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:me.HttpStatusCode.CONFLICT};V.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:me.HttpStatusCode.UNAUTHORIZED};V.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:me.HttpStatusCode.BAD_REQUEST};V.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:me.HttpStatusCode.CONFLICT};V.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:me.HttpStatusCode.FORBIDDEN};V.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:me.HttpStatusCode.NOT_FOUND};V.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.FORBIDDEN};V.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:me.HttpStatusCode.BAD_REQUEST};var net=l(({repositoryUrl:t})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${t} is not a valid Zuplo template repository`,status:me.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");V.INVALID_TEMPLATE_REPOSITORY=net;V.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:me.HttpStatusCode.NOT_FOUND};V.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:me.HttpStatusCode.BAD_REQUEST};V.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:me.HttpStatusCode.BAD_REQUEST};V.INVALID_EMAIL_FORMAT={type:"https://zup.fail/invalid-email-format",title:"The email address provided is in an invalid email format",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};V.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.FORBIDDEN};V.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:me.HttpStatusCode.BAD_REQUEST};V.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:me.HttpStatusCode.NOT_FOUND};V.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:me.HttpStatusCode.NOT_FOUND};V.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:me.HttpStatusCode.BAD_REQUEST};V.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:me.HttpStatusCode.BAD_REQUEST};V.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:me.HttpStatusCode.NOT_FOUND};V.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:me.HttpStatusCode.BAD_REQUEST};V.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:me.HttpStatusCode.NOT_FOUND};V.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:me.HttpStatusCode.BAD_REQUEST};V.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:me.HttpStatusCode.FORBIDDEN};V.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};var iet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");V.USER_NO_ACCESS_GITHUB_REPO=iet;var oet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");V.USER_NO_PULL_ACCESS_GITHUB_REPO=oet;var aet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");V.GITHUB_USER_NO_READ_ACCESS_REPO=aet;V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.FORBIDDEN};var set=l(({repositoryUrl:t})=>({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 '${t}'. Go to '${ret}' to add the repository.`,status:me.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");V.GITHUB_APP_NO_USER_ACCESS_=set;V.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:me.HttpStatusCode.NOT_FOUND};var uet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");V.USER_NO_ACCESS_BITBUCKET_REPO=uet;var cet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");V.USER_NO_ACCESS_GITLAB_REPO=cet;V.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:me.HttpStatusCode.FORBIDDEN};V.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:me.HttpStatusCode.BAD_REQUEST};var pet=l(({repositoryUrl:t})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:me.HttpStatusCode.CONFLICT,detail:`The repository ${t} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");V.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=pet;var det=l(({repositoryUrl:t})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:me.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${t} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");V.GITHUB_REPOSITORY_NOT_FOUND=det;V.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:me.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};V.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:me.HttpStatusCode.BAD_REQUEST};V.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};var fet=l(({repositoryName:t,orgName:e})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${t}' already exists on GitHub org '${e}'.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");V.GITHUB_INTEGRATION_DUPLICATE_REPO=fet;var het=l(({repositoryName:t,details:e})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:e,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");V.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=het;var met=l(({repositoryUrl:t})=>({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 '${t}' 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:t,status:me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");V.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=met;var get=l(({repositoryUrl:t})=>({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 '${t}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");V.GIT_CREATE_PROJECT_WITH_INVALID_REPO=get;var yet=l(({repositoryUrl:t})=>({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 '${t}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");V.GITHUB_INTEGRATION_INVALID_REPO=yet;V.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:me.HttpStatusCode.FORBIDDEN};V.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:me.HttpStatusCode.FORBIDDEN};var vet=l(({details:t})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:t,status:me.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");V.BITBUCKET_FAILED_DURING_REPO_CREATION=vet;V.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:me.HttpStatusCode.FORBIDDEN};var bet=l(({details:t})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");V.GITLAB_FAILED_DURING_REPO_CREATION=bet;var _et=l(({repositoryName:t,orgName:e})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${t}' already exists in GitLab team '${e}'.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");V.GITLAB_DUPLICATE_REPO=_et;var Oet=l(({orgName:t})=>({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:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");V.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=Oet;var Eet=l(({namespaceLabel:t})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${t}'.`,details:`The user's GitLab access level does not allow the use of namespace '${t}'.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");V.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=Eet;var wet=l(({orgName:t})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");V.GITLAB_ACCESS_LEVEL_CHECK_FAIL=wet;V.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:me.HttpStatusCode.UNAUTHORIZED};V.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:me.HttpStatusCode.NOT_FOUND};V.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:me.HttpStatusCode.UNAUTHORIZED};V.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:me.HttpStatusCode.FORBIDDEN};V.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:me.HttpStatusCode.FORBIDDEN};V.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};var Tet=l(({sourceControlProvider:t})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,Dde.getSourceControlProviderLabel)(t)}`,status:me.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");V.SOURCE_CONTROL_AUTHENTICATION_FAILED=Tet;var Aet=l(({sourceControlProvider:t})=>({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,Dde.getSourceControlProviderLabel)(t)} repository`,status:me.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");V.SOURCE_CONTROL_REPO_NOT_FOUND=Aet;V.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:me.HttpStatusCode.BAD_REQUEST};var Pet=l(({repoURL:t,operation:e})=>({type:`https://zup.fail/source-control-repo-${e}-error`,title:`Failed on ${e} operation to repository '${t}'. 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:me.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");V.SOURCE_CONTROL_REPO_OPERATION_ERROR=Pet;V.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:me.HttpStatusCode.FORBIDDEN};V.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.UNAUTHORIZED};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:me.HttpStatusCode.FAILED_DEPENDENCY};V.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:me.HttpStatusCode.FAILED_DEPENDENCY};V.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:me.HttpStatusCode.FAILED_DEPENDENCY};V.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:me.HttpStatusCode.BAD_REQUEST};V.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:me.HttpStatusCode.BAD_REQUEST};V.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:me.HttpStatusCode.BAD_REQUEST};V.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.FORBIDDEN};V.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:me.HttpStatusCode.NOT_FOUND};var xet=l(({operation:t,path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${t} file ${e} for a read-only environment. Read-only environments cannot be edited.`,status:me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");V.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=xet;var Cet=l(()=>({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:me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");V.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=Cet;V.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:me.HttpStatusCode.BAD_REQUEST};V.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:me.HttpStatusCode.BAD_REQUEST};V.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:me.HttpStatusCode.NOT_FOUND};V.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:me.HttpStatusCode.BAD_REQUEST};V.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:me.HttpStatusCode.BAD_REQUEST};V.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:me.HttpStatusCode.BAD_REQUEST};var ket=l(({path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${t} for a read-only environment. Read-only environments cannot be edited.`,status:me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");V.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=ket;var Ret=l(({path:t})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${t} is not allowed.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");V.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=Ret;var Net=l(({path:t})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:me.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${t}.`}),"DIRECTORY_ALREADY_EXISTS");V.DIRECTORY_ALREADY_EXISTS=Net;var Det=l(({path:t})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:me.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${t}`}),"DIRECTORY_DOES_NOT_EXIST");V.DIRECTORY_DOES_NOT_EXIST=Det;var Iet=l(({path:t})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:me.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${t}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");V.DIRECTORY_OR_FILE_DOES_NOT_EXIST=Iet;var jet=l(({path:t})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${t}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");V.DIRECTORY_CREATION_FAILED=jet;var Let=l(({path:t})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${t} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");V.FILE_RENAME_PATHS_MATCH=Let;var qet=l(({oldExtension:t,newExtension:e})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${e} must match the old extension ${t}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");V.FILE_RENAME_CANNOT_CHANGE_EXTENSION=qet;var Met=l(({path:t})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${t}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");V.FILE_RENAME_FILE_ALREADY_EXISTS=Met;var Fet=l(({path:t})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${t}. Please try again or contact support.`}),"FILE_RENAME_FAILED");V.FILE_RENAME_FAILED=Fet;var Uet=l(({path:t})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${t}. Please try again or contact support.`}),"FILE_WRITE_FAILED");V.FILE_WRITE_FAILED=Uet;var $et=l(({path:t})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:me.HttpStatusCode.BAD_REQUEST,detail:`File '${t}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");V.CANNOT_DELETE_ESSENTIAL_FILE=$et;var Bet=l(({path:t})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:me.HttpStatusCode.BAD_REQUEST,detail:`Directory '${t}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");V.CANNOT_DELETE_ESSENTIAL_DIRECTORY=Bet;var Vet=l(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:me.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");V.CANNOT_DELETE_SOLE_OPEN_API_FILE=Vet;var Het=l(({path:t})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${t}. Please try again or contact support.`}),"FILE_DELETE_FAILED");V.FILE_DELETE_FAILED=Het;var Get=l(({path:t})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${t}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");V.DIRECTORY_DELETE_FAILED=Get;V.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:me.HttpStatusCode.CONFLICT};V.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:me.HttpStatusCode.BAD_REQUEST};V.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR}});var Lde=x(Ka=>{"use strict";var zet=Ka&&Ka.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jet=Ka&&Ka.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ket=Ka&&Ka.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&zet(e,t,r);return Jet(e,t),e};Object.defineProperty(Ka,"__esModule",{value:!0});Ka.ApiNotFoundError=Ka.ApiError=Ka.Problems=void 0;var jde=Ket(Ide());Ka.Problems=jde;var R6=class extends Error{static{l(this,"ApiError")}type;status;detail;instance;constructor(e){if(super(e.title),!e.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 ${e.type}`);this.name="ApiProblemError",this.type=e.type,this.status=e.status,this.detail=e.detail,this.instance=e.instance}};Ka.ApiError=R6;var nM=class extends R6{static{l(this,"ApiNotFoundError")}constructor(e={}){super({...e,...jde.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};Ka.ApiNotFoundError=nM});var Ya=x(vd=>{"use strict";var Yet=vd&&vd.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Wet=vd&&vd.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yet(e,t,r)};Object.defineProperty(vd,"__esModule",{value:!0});vd.HttpStatusCode=void 0;Wet(Lde(),vd);var Qet=rM();Object.defineProperty(vd,"HttpStatusCode",{enumerable:!0,get:function(){return Qet.HttpStatusCode}})});var oM=x(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});N6.CommonAuth=void 0;var Ff=Ya(),Xet=["google-oauth2|106231436550039770264","google-oauth2|113609898431445637338","google-oauth2|115413213714061429608","google-oauth2|105283806895031006146","google-oauth2|116604562105669742663"],iM=class t{static{l(this,"CommonAuth")}static DEPLOYER_USER_SUB="deployer-app@zuplo";isZuploAdmin(e){return Xet.includes(e)}isDeployerServiceAccount(e){return t.DEPLOYER_USER_SUB===e}static isAuthorizedSub(e,r){if(typeof r=="string")throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS);if(r instanceof Buffer)throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS);try{if(!e.includes(r.sub))throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS)}catch{throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS)}}};N6.CommonAuth=iM});var qde=x(D6=>{"use strict";Object.defineProperty(D6,"__esModule",{value:!0});D6.hasBlockedNotifications=void 0;var Zet=["chocolate_bold_silverfish"];function ett(t){return Zet.includes(t)}l(ett,"hasBlockedNotifications");D6.hasBlockedNotifications=ett});var sM=x(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.BuildIssueError=Wa.WARNING_SEVERITY=Wa.ERROR_SEVERITY=Wa.FAILURE_STATUS=Wa.WARNING_STATUS=Wa.GOOD_STATUS=void 0;Wa.GOOD_STATUS="Good";Wa.WARNING_STATUS="Warnings";Wa.FAILURE_STATUS="Failed";Wa.ERROR_SEVERITY="error";Wa.WARNING_SEVERITY="warning";var aM=class extends Error{static{l(this,"BuildIssueError")}issue;constructor(e){super(e.message),this.issue=e}};Wa.BuildIssueError=aM});var Mde=x(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});I6.COMPATIBILITY_FLAG_MAPPINGS=void 0;I6.COMPATIBILITY_FLAG_MAPPINGS=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}})});var Fde=x((D3r,ttt)=>{ttt.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/zuplo.config.json",title:"Zuplo Config",description:"",type:"object",required:[],additionalProperties:!1,properties:{version:{description:"The version of the configuration",type:"number",enum:[1]},project:{type:"string"},compatibilityDate:{description:"The compatibility date on which to run the gateway",type:"string",title:"Compatibility Date",default:"2024-01-15",enum:["2023-03-14","2024-01-15"]}}}});var Ude=x(j6=>{"use strict";Object.defineProperty(j6,"__esModule",{value:!0});j6.VALID_COMPATIBILITY_DATES=void 0;j6.VALID_COMPATIBILITY_DATES=Object.freeze(["2023-03-14","2024-01-15"])});var $de=x(Uf=>{"use strict";var rtt=Uf&&Uf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uf,"__esModule",{value:!0});Uf.DEFAULT_COMPATIBILITY_DATE=Uf.VALID_COMPATIBILITY_DATES=void 0;var ntt=rtt(Fde()),itt=Ude();Object.defineProperty(Uf,"VALID_COMPATIBILITY_DATES",{enumerable:!0,get:function(){return itt.VALID_COMPATIBILITY_DATES}});Uf.DEFAULT_COMPATIBILITY_DATE=ntt.default.properties.compatibilityDate.default});var Bde=x(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});L6.FeatureFlags=void 0;L6.FeatureFlags=Object.freeze({esmWorker:(t,e)=>({flagName:"ZUPLO_ESM_WORKER",defaultValue:!1,accountName:t,projectName:e}),FS_ACCOUNT_NAME_PATH:"FS_ACCOUNT_NAME_PATH"})});var Vde=x($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.decrypt=$f.encrypt=$f.signString=void 0;var B1=require("crypto");function ott(t,e){return(0,B1.createHmac)("sha256",e).update(t).digest("hex")}l(ott,"signString");$f.signString=ott;var lM={AUTH_TAG_BYTE_LEN:16,IV_BYTE_LEN:12},att=l(()=>(0,B1.randomBytes)(lM.IV_BYTE_LEN),"getIV");function stt(t,e){if(t===null)return null;let r=(0,B1.createHash)("sha256").update(String(e)).digest("base64").substring(0,32),n=att(),i=(0,B1.createCipheriv)("aes-256-gcm",r,n,{authTagLength:lM.AUTH_TAG_BYTE_LEN}),s=i.update(t);return s=Buffer.concat([s,i.final()]),Buffer.concat([n,s,i.getAuthTag()]).toString("hex")}l(stt,"encrypt");$f.encrypt=stt;function ltt(t,e){if(!t)return null;let r=Buffer.from(e),n=(0,B1.createHash)("sha256").update(String(r)).digest("base64").substring(0,32),i=Buffer.from(t,"hex"),s=i.slice(-16),p=i.slice(0,12),d=i.slice(12,-16),f=(0,B1.createDecipheriv)("aes-256-gcm",n,p,{authTagLength:lM.AUTH_TAG_BYTE_LEN});f.setAuthTag(s);let a=f.update(d);return Buffer.concat([a,f.final()]).toString("utf-8")}l(ltt,"decrypt");$f.decrypt=ltt});var Hde=x(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});q6.getCurrentUtcDateTime=void 0;function utt(){let t={year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0,timeZone:"UTC"};return new Date().toLocaleString("en-US",t)}l(utt,"getCurrentUtcDateTime");q6.getCurrentUtcDateTime=utt});var uM=x(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});M6.DeploymentLogState=void 0;var Gde;(function(t){t.ERROR="ERROR",t.IN_PROGRESS="IN_PROGRESS",t.SUCCESS="SUCCESS"})(Gde||(M6.DeploymentLogState=Gde={}))});var cM=x(zde=>{"use strict";Object.defineProperty(zde,"__esModule",{value:!0})});var Kde=x(Jde=>{"use strict";Object.defineProperty(Jde,"__esModule",{value:!0})});var Yde=x(F6=>{"use strict";Object.defineProperty(F6,"__esModule",{value:!0});F6.MARKDOWN_FRONTMATTER_KEYS=void 0;F6.MARKDOWN_FRONTMATTER_KEYS=["sidebar_label"]});var Qde=x(Wde=>{"use strict";Object.defineProperty(Wde,"__esModule",{value:!0})});var Xde=x(Cc=>{"use strict";var ctt=Cc&&Cc.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U6=Cc&&Cc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ctt(e,t,r)};Object.defineProperty(Cc,"__esModule",{value:!0});U6(cM(),Cc);U6(Kde(),Cc);U6(Yde(),Cc);U6(Qde(),Cc)});var $6=x(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.getLoggerContext=kc.requestIdGenerator=kc.REQUEST_ID_HEADER=kc.LEGACY_REQUEST_ID_HEADER=void 0;var ptt=require("crypto");kc.LEGACY_REQUEST_ID_HEADER="zuplo-request-id";kc.REQUEST_ID_HEADER="zp-rid";var dtt=l(t=>{let e=t.headers["zuplo-request-id"],r=t.headers["X-GitHub-Delivery"];return e?`${e}`:r?`${r}`:(0,ptt.randomUUID)()},"requestIdGenerator");kc.requestIdGenerator=dtt;function ftt(t){let e=t.raw.url??"",r={};try{let n=t.headers["zuplo-user"]??t.user?.sub;n&&(r.userSub=`${n}`);let i=e.match(/(deployments)\/([a-zA-Z-0-9]*)/);i&&i!==null&&i.length>=2&&(r.deployment=i[2]);let s=e.match(/(accounts)\/([a-zA-Z-0-9]*)/);s&&s!==null&&s.length>=2&&(r.account=s[2]);let p=e.match(/(projects)\/([a-zA-Z-0-9]*)/);p&&p!==null&&p.length>=2&&(r.project=p[2])}catch{}return r}l(ftt,"getLoggerContext");kc.getLoggerContext=ftt});var pM=x(V1=>{"use strict";var htt=V1&&V1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(V1,"__esModule",{value:!0});V1.errorHandler=void 0;var nl=Ya(),mtt=htt(ba()),Zde=$6();function gtt(t,e,r){let n=500,i;if(t instanceof nl.ApiError)n=t.status,i={type:t.type,title:t.message,status:t.status,detail:t.detail,instance:t.instance};else if(typeof t=="object"&&"validation"in t&&"validationContext"in t)n=nl.HttpStatusCode.BAD_REQUEST,i={...nl.Problems.BAD_REQUEST,detail:`An error occurred when validating the ${t.validationContext}.`,errors:t.validation};else if(typeof t=="object"&&"code"in t&&t.code==="FST_ERR_NOT_FOUND")n=404,i=nl.Problems.NOT_FOUND;else if(typeof t=="object"&&"code"in t&&typeof t.code=="string"&&["FST_ERR_CTP_INVALID_TYPE","FST_ERR_CTP_EMPTY_TYPE","FST_ERR_CTP_BODY_TOO_LARGE","FST_ERR_CTP_INVALID_MEDIA_TYPE","FST_ERR_CTP_INVALID_CONTENT_LENGTH","FST_ERR_CTP_EMPTY_JSON_BODY","FST_ERR_BAD_URL","FST_ERR_INVALID_URL"].includes(t.code))n=nl.HttpStatusCode.BAD_REQUEST,i={...nl.Problems.BAD_REQUEST,detail:t.message};else{let p;!r.statusCode||r.statusCode===200?(typeof t=="object"&&"statusCode"in t&&typeof t.statusCode=="number"?p=t.statusCode:typeof t=="object"&&"status"in t&&typeof t.status=="number"&&(p=t.status),n=p&&p>=400?p:500):n=r.statusCode,i=ytt(n),mtt.default.NODE_ENV!=="production"&&(typeof t=="object"&&"message"in t?i.detail=t.message:typeof t=="string"&&(i.detail=t))}i.trace={timestamp:new Date().toJSON(),requestId:e.headers[Zde.REQUEST_ID_HEADER]??e.headers[Zde.LEGACY_REQUEST_ID_HEADER]},n<500?r.log.warn({res:r,err:t},t&&t.message):r.log.error({req:e,res:r,err:t},t&&t.message);let s=JSON.stringify(i,null,2);return r.status(n).header("content-type","application/json").send(s)}l(gtt,"errorHandler");V1.errorHandler=gtt;function ytt(t){return t===401?nl.Problems.UNAUTHORIZED:t===403?nl.Problems.FORBIDDEN:t===404?nl.Problems.NOT_FOUND:t===405?nl.Problems.METHOD_NOT_ALLOWED:t<500&&t>=400?nl.Problems.BAD_REQUEST:nl.Problems.INTERNAL_SERVER_ERROR}l(ytt,"getProblemFromStatus")});var tfe=x((Q3r,dM)=>{"use strict";var vtt=/at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/,btt=/(\w*(\.\w*)*)\..*/;dM.exports=l(function(e){if(e.name.length>0)return e.name;let r=Error.stackTraceLimit;Error.stackTraceLimit=10;try{throw new Error("anonymous function")}catch(n){return Error.stackTraceLimit=r,efe(n.stack)}},"getPluginName");function efe(t){let e=t.match(vtt);return e?e[1].split(/[/\\]/).slice(-1)[0].match(btt)[1]:"anonymous"}l(efe,"extractPluginName");dM.exports.extractPluginName=efe});var nfe=x((Z3r,rfe)=>{"use strict";rfe.exports=l(function(e){return e[0]==="@"&&(e=e.slice(1).replace("/","-")),e.replace(/-(.)/g,function(n,i){return i.toUpperCase()})},"toCamelCase")});var ey=x((t4r,B6)=>{"use strict";var _tt=tfe(),Ott=nfe(),Ett=0;function fM(t,e={}){let r=!1;if(typeof t.default<"u"&&(t=t.default),typeof t!="function")throw new TypeError(`fastify-plugin expects a function, instead got a '${typeof t}'`);if(typeof e=="string"&&(e={fastify:e}),typeof e!="object"||Array.isArray(e)||e===null)throw new TypeError("The options object should be an object");if(e.fastify!==void 0&&typeof e.fastify!="string")throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof e.fastify}'`);e.name||(r=!0,e.name=_tt(t)+"-auto-"+Ett++),t[Symbol.for("skip-override")]=e.encapsulate!==!0,t[Symbol.for("fastify.display-name")]=e.name,t[Symbol.for("plugin-meta")]=e,t.default||(t.default=t);let n=Ott(e.name);return!r&&!t[n]&&(t[n]=t),t}l(fM,"plugin");B6.exports=fM;B6.exports.default=fM;B6.exports.fastifyPlugin=fM});var ofe=x(H1=>{"use strict";var wtt=H1&&H1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(H1,"__esModule",{value:!0});H1.apiKeyAuthPlugin=void 0;var Rc=Ya(),Ttt=wtt(ey()),Stt="https://apikey.zuplo.com",ife="Bearer ";H1.apiKeyAuthPlugin=(0,Ttt.default)(async(t,e)=>{t.decorate("validateApiKey",async function(r){let{authorization:n}=r.headers;if(!n)throw new Rc.ApiError({...Rc.Problems.UNAUTHORIZED,detail:"No Authorization Header"});if(!n.toLowerCase().startsWith(ife))throw new Rc.ApiError({...Rc.Problems.UNAUTHORIZED,detail:"Invalid Authorization Scheme"});let i=n.substring(ife.length);if(!i||i==="")throw new Rc.ApiError({...Rc.Problems.UNAUTHORIZED,detail:"No key present"});let s={key:i},p=await fetch(`${Stt}/v1/$validate/${e.bucketName}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(p.status===401)throw new Rc.ApiError(Rc.Problems.UNAUTHORIZED);let d=await p.json();if(e.allowedSubs&&!e.allowedSubs.includes(d.name))throw new Rc.ApiError(Rc.Problems.UNAUTHORIZED);r.user={sub:d.name,metadata:d.metadata}})},{name:"api-key-auth"})});var afe=x(G1=>{"use strict";var Att=G1&&G1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(G1,"__esModule",{value:!0});G1.ensureZuploAdminPlugin=void 0;var V6=Ya(),Ptt=Att(ey()),xtt=oM();G1.ensureZuploAdminPlugin=(0,Ptt.default)(async function(t){let e=new xtt.CommonAuth;t.decorate("ensureZuploAdmin",async function(r){if(!r.user)throw r.log.error("Bad request, no user on request"),new V6.ApiError(V6.Problems.UNAUTHORIZED);let n=r.user.sub;if(!(n&&e.isZuploAdmin(n)))throw r.log.error("User is not an admin"),new V6.ApiError(V6.Problems.FORBIDDEN)})},{name:"ensure-zuplo-admin-plugin"})});var lfe=x(z1=>{"use strict";var Ctt=z1&&z1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z1,"__esModule",{value:!0});z1.ensureZuploUserPlugin=void 0;var sfe=Ya(),ktt=Ctt(ey());z1.ensureZuploUserPlugin=(0,ktt.default)(async t=>{t.decorate("ensureZuploUser",async function(e){let r=e.headers["zuplo-user"];if(!r||typeof r!="string")throw e.log.error("The 'zuplo-user' header is missing"),new sfe.ApiError(sfe.Problems.UNAUTHORIZED);e.user={sub:r}})},{name:"ensure-zuplo-user-plugin"})});var pfe=x(J1=>{"use strict";var Rtt=J1&&J1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(J1,"__esModule",{value:!0});J1.featureFlagsPlugin=void 0;var Ntt=Rtt(ey()),hM;async function ufe(t,e){try{let r=await hM?.variation(e.flagName,{kind:e.kind,key:e.key},e.defaultValue);return r===void 0?e.defaultValue:r}catch(r){t.log.warn(`Failed to query Launch Darkly flag ${e.flagName}`),t.log.error(r)}return e.defaultValue}l(ufe,"getFlagValue");function cfe(){return this.log.error("Call to feature flag getFlagValue function on uninitialized flag plugin"),Promise.resolve(!1)}l(cfe,"fallback");J1.featureFlagsPlugin=(0,Ntt.default)(async(t,e)=>{try{if(typeof e.key!="string"||!e.key||!e.client){t.decorateRequest("getFlagValue",cfe),t.decorateRequest("getFlagValueByUser",cfe);return}hM=e.client,t.log.info("Launch Darkly SDK successfully initialized!"),t.decorate("flags",hM),t.decorateRequest("getFlagValue",async function(r){let n,i;"projectName"in r?(n="project",i=`${r.accountName}/${r.projectName}`):(n="account",i=r.accountName);let s={flagName:r.flagName,kind:n,key:i,defaultValue:r.defaultValue};return ufe(this,s)}),t.decorateRequest("getFlagValueByUser",async function(r,n,i){return ufe(this,{flagName:r,kind:"user",key:n,defaultValue:i})})}catch(r){t.log.warn("Launch Darkly failed to initialize"),t.log.error(r)}},{name:"feature-flag-plugin"})});var mM=x(K1=>{"use strict";var Dtt=K1&&K1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K1,"__esModule",{value:!0});K1.getUserSubPlugin=void 0;var dfe=Ya(),Itt=Dtt(ey());K1.getUserSubPlugin=(0,Itt.default)(async t=>{t.decorateRequest("getUserSub",function(){let e=this.user?.sub;if(!e)throw this.log.error("Could not determine the user sub"),new dfe.ApiError(dfe.Problems.UNAUTHORIZED);return e})},{name:"get-user-sub-plugin"})});var gM=x(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.getUserSubPlugin=il.featureFlagsPlugin=il.ensureZuploUserPlugin=il.ensureZuploAdminPlugin=il.apiKeyAuthPlugin=void 0;var jtt=ofe();Object.defineProperty(il,"apiKeyAuthPlugin",{enumerable:!0,get:function(){return jtt.apiKeyAuthPlugin}});var Ltt=afe();Object.defineProperty(il,"ensureZuploAdminPlugin",{enumerable:!0,get:function(){return Ltt.ensureZuploAdminPlugin}});var qtt=lfe();Object.defineProperty(il,"ensureZuploUserPlugin",{enumerable:!0,get:function(){return qtt.ensureZuploUserPlugin}});var Mtt=pfe();Object.defineProperty(il,"featureFlagsPlugin",{enumerable:!0,get:function(){return Mtt.featureFlagsPlugin}});var Ftt=mM();Object.defineProperty(il,"getUserSubPlugin",{enumerable:!0,get:function(){return Ftt.getUserSubPlugin}})});var sn=x(vo=>{"use strict";var yM=Symbol.for("yaml.alias"),ffe=Symbol.for("yaml.document"),H6=Symbol.for("yaml.map"),hfe=Symbol.for("yaml.pair"),vM=Symbol.for("yaml.scalar"),G6=Symbol.for("yaml.seq"),bd=Symbol.for("yaml.node.type"),Utt=l(t=>!!t&&typeof t=="object"&&t[bd]===yM,"isAlias"),$tt=l(t=>!!t&&typeof t=="object"&&t[bd]===ffe,"isDocument"),Btt=l(t=>!!t&&typeof t=="object"&&t[bd]===H6,"isMap"),Vtt=l(t=>!!t&&typeof t=="object"&&t[bd]===hfe,"isPair"),mfe=l(t=>!!t&&typeof t=="object"&&t[bd]===vM,"isScalar"),Htt=l(t=>!!t&&typeof t=="object"&&t[bd]===G6,"isSeq");function gfe(t){if(t&&typeof t=="object")switch(t[bd]){case H6:case G6:return!0}return!1}l(gfe,"isCollection");function Gtt(t){if(t&&typeof t=="object")switch(t[bd]){case yM:case H6:case vM:case G6:return!0}return!1}l(Gtt,"isNode");var ztt=l(t=>(mfe(t)||gfe(t))&&!!t.anchor,"hasAnchor");vo.ALIAS=yM;vo.DOC=ffe;vo.MAP=H6;vo.NODE_TYPE=bd;vo.PAIR=hfe;vo.SCALAR=vM;vo.SEQ=G6;vo.hasAnchor=ztt;vo.isAlias=Utt;vo.isCollection=gfe;vo.isDocument=$tt;vo.isMap=Btt;vo.isNode=Gtt;vo.isPair=Vtt;vo.isScalar=mfe;vo.isSeq=Htt});var tw=x(bM=>{"use strict";var Gi=sn(),Qa=Symbol("break visit"),yfe=Symbol("skip children"),Nc=Symbol("remove node");function z6(t,e){let r=vfe(e);Gi.isDocument(t)?Y1(null,t.contents,r,Object.freeze([t]))===Nc&&(t.contents=null):Y1(null,t,r,Object.freeze([]))}l(z6,"visit");z6.BREAK=Qa;z6.SKIP=yfe;z6.REMOVE=Nc;function Y1(t,e,r,n){let i=bfe(t,e,r,n);if(Gi.isNode(i)||Gi.isPair(i))return _fe(t,n,i),Y1(t,i,r,n);if(typeof i!="symbol"){if(Gi.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let p=Y1(s,e.items[s],r,n);if(typeof p=="number")s=p-1;else{if(p===Qa)return Qa;p===Nc&&(e.items.splice(s,1),s-=1)}}}else if(Gi.isPair(e)){n=Object.freeze(n.concat(e));let s=Y1("key",e.key,r,n);if(s===Qa)return Qa;s===Nc&&(e.key=null);let p=Y1("value",e.value,r,n);if(p===Qa)return Qa;p===Nc&&(e.value=null)}}return i}l(Y1,"visit_");async function J6(t,e){let r=vfe(e);Gi.isDocument(t)?await W1(null,t.contents,r,Object.freeze([t]))===Nc&&(t.contents=null):await W1(null,t,r,Object.freeze([]))}l(J6,"visitAsync");J6.BREAK=Qa;J6.SKIP=yfe;J6.REMOVE=Nc;async function W1(t,e,r,n){let i=await bfe(t,e,r,n);if(Gi.isNode(i)||Gi.isPair(i))return _fe(t,n,i),W1(t,i,r,n);if(typeof i!="symbol"){if(Gi.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let p=await W1(s,e.items[s],r,n);if(typeof p=="number")s=p-1;else{if(p===Qa)return Qa;p===Nc&&(e.items.splice(s,1),s-=1)}}}else if(Gi.isPair(e)){n=Object.freeze(n.concat(e));let s=await W1("key",e.key,r,n);if(s===Qa)return Qa;s===Nc&&(e.key=null);let p=await W1("value",e.value,r,n);if(p===Qa)return Qa;p===Nc&&(e.value=null)}}return i}l(W1,"visitAsync_");function vfe(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}l(vfe,"initVisitor");function bfe(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Gi.isMap(e))return r.Map?.(t,e,n);if(Gi.isSeq(e))return r.Seq?.(t,e,n);if(Gi.isPair(e))return r.Pair?.(t,e,n);if(Gi.isScalar(e))return r.Scalar?.(t,e,n);if(Gi.isAlias(e))return r.Alias?.(t,e,n)}l(bfe,"callVisitor");function _fe(t,e,r){let n=e[e.length-1];if(Gi.isCollection(n))n.items[t]=r;else if(Gi.isPair(n))t==="key"?n.key=r:n.value=r;else if(Gi.isDocument(n))n.contents=r;else{let i=Gi.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}l(_fe,"replaceNode");bM.visit=z6;bM.visitAsync=J6});var _M=x(Efe=>{"use strict";var Ofe=sn(),Jtt=tw(),Ktt={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ytt=l(t=>t.replace(/[!,[\]{}]/g,e=>Ktt[e]),"escapeTagName"),rw=class t{static{l(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,p]=n;return this.tags[s]=p,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let p=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,p),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let p=e.slice(2,-1);return p==="!"||p==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),p)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(p){return r(String(p)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Ytt(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Ofe.isNode(e.contents)){let s={};Jtt.visit(e.contents,(p,d)=>{Ofe.isNode(d)&&d.tag&&(s[d.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,p]of n)s==="!!"&&p==="tag:yaml.org,2002:"||(!e||i.some(d=>d.startsWith(p)))&&r.push(`%TAG ${s} ${p}`);return r.join(`
|
|
25
|
+
"use strict";var YZe=Object.create;var ZE=Object.defineProperty;var WZe=Object.getOwnPropertyDescriptor;var QZe=Object.getOwnPropertyNames;var XZe=Object.getPrototypeOf,ZZe=Object.prototype.hasOwnProperty;var l=(t,e)=>ZE(t,"name",{value:e,configurable:!0});var Ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),eM=(t,e)=>{for(var r in e)ZE(t,r,{get:e[r],enumerable:!0})},kde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QZe(e))!ZZe.call(t,i)&&i!==r&&ZE(t,i,{get:()=>e[i],enumerable:!(n=WZe(e,i))||n.enumerable});return t};var wu=(t,e,r)=>(r=t!=null?YZe(XZe(t)):{},kde(e||!t||!t.__esModule?ZE(r,"default",{value:t,enumerable:!0}):r,t)),Xg=t=>kde(ZE({},"__esModule",{value:!0}),t);var ba=x(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.EnvironmentalVariableRequiredError=Zg.getRequiredEnvVar=void 0;var tM=class{static{l(this,"Environment")}get LOG_LEVEL(){return process.env.LOG_LEVEL??"info"}get LOG_FORMAT(){return process.env.LOG_FORMAT??"pretty"}get NODE_ENV(){return process.env.NODE_ENV}get USE_LOCAL_API_SERVER(){return process.env.USE_LOCAL_API_SERVER==="true"}get USE_MONOREPO_PACKAGES(){return process.env.USE_MONOREPO_PACKAGES==="true"}get GCP_STORAGE_BUNDLE_BUCKET_NAME(){return process.env.GCP_STORAGE_BUNDLE_BUCKET_NAME}get GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME(){return process.env.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}get GCP_STORAGE_ARCHIVE_BUCKET_NAME(){return process.env.GCP_STORAGE_ARCHIVE_BUCKET_NAME}get GCP_STORAGE_SOURCE_CODE_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}get GCP_STORAGE_SOURCES_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCES_BUCKET_NAME}get ZUPLO_AUTH_API_JWT(){return process.env.ZUPLO_AUTH_API_JWT}get GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS(){return process.env.GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS}get RUNTIME_DENO_VERSION(){return process.env.RUNTIME_DENO_VERSION??"1.53.0"}get AUTH_API_URL(){return Ja("AUTH_API_URL","http://localhost:5201")}get MANAGEMENT_API_URL(){return Ja("MANAGEMENT_API_URL","http://localhost:3100")}get TENANT_API_URL(){return Ja("TENANT_API_URL","http://localhost:5100")}get CONTENT_API_URL(){return Ja("CONTENT_API_URL","http://localhost:5400")}get DEPLOYER_API_URL(){return Ja("DEPLOYER_API_URL","http://localhost:5300")}get DEV_API_URL(){return Ja("DEV_API_URL","http://localhost:5200")}get API_KEY_SERVICE_URL(){return Ja("API_KEY_SERVICE_URL","https://apikey.zuplo.com")}get API_KEY_MANAGEMENT_SERVICE_URL(){return Ja("API_KEY_MANAGEMENT_SERVICE_URL","https://api-key-management-service-rreeuhlsca-ue.a.run.app")}get METERING_SERVICE_URL(){return Ja("METERING_SERVICE_URL","https://meters.zuplo.com")}get FETCH_PROXY_URL(){return process.env.FETCH_PROXY_URL||"https://proxy-main-04e55cb.zuplo.app"}get FETCH_PROXY_API_KEY(){return process.env.FETCH_PROXY_API_KEY||"zpk_123"}get LOG_EVENT_API_URL(){return process.env.LOG_EVENT_API_URL}get LAUNCH_DARKLY_SERVER_KEY(){return process.env.LAUNCH_DARKLY_SERVER_KEY}get REMOTE_LOGGING_SHARED_SECRET(){return process.env.REMOTE_LOGGING_SHARED_SECRET??"the-logging-shared-secret"}get TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT(){return process.env.TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT??"10.142.0.64:5000"}get DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME(){return process.env.DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME??"zpl-developer-api"}get __ZUPLO_AUTH_API_JWT(){return process.env.__ZUPLO_AUTH_API_JWT??void 0}get BUILD_ASSETS_BUCKET_NAME(){return process.env.BUILD_ASSETS_BUCKET_NAME}get BUILD_ASSETS_S3_ENDPOINT(){return process.env.BUILD_ASSETS_S3_ENDPOINT}get BUILD_ASSETS_ACCESS_KEY_ID(){return process.env.BUILD_ASSETS_ACCESS_KEY_ID}get BUILD_ASSETS_SECRET_ACCESS_KEY(){return process.env.BUILD_ASSETS_SECRET_ACCESS_KEY}get DEV_PORTAL_ENCRYPTION_SECRET(){if(!process.env.DEV_PORTAL_ENCRYPTION_SECRET)throw new ew("DEV_PORTAL_ENCRYPTION_SECRET");return process.env.DEV_PORTAL_ENCRYPTION_SECRET}isProduction(){return this.NODE_ENV==="production"}get OPENFGA_SERVICE_URL(){return Ja("OPENFGA_SERVICE_URL","https://openfga-eq7z4lly2a-ue.a.run.app")}get OPENFGA_STORE_ID(){return process.env.OPENFGA_STORE_ID??""}get OPENFGA_MODEL_ID(){return process.env.OPENFGA_MODEL_ID??""}GCP_PROJECT_ID(){return Ja("GCP_PROJECT_ID")}GCP_TASK_QUEUE_LOCATION(){return Ja("GCP_TASK_QUEUE_LOCATION")}GCP_TASK_QUEUE_NAME(){return Ja("GCP_TASK_QUEUE_NAME")}};function Ja(t,e){let r=process.env[t];if(r===void 0&&(e===void 0||process.env.NODE_ENV==="production"))throw new ew(t);return r??e}l(Ja,"getRequiredEnvVar");Zg.getRequiredEnvVar=Ja;var ew=class extends Error{static{l(this,"EnvironmentalVariableRequiredError")}constructor(e){super(`The environmental variable '${e}' is required.'`)}};Zg.EnvironmentalVariableRequiredError=ew;var eet=new tM;Zg.default=eet});var rM=x(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});C6.HttpStatusCode=void 0;var Rde;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.ALREADY_REPORTED=208]="ALREADY_REPORTED",t[t.IM_USED=226]="IM_USED",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.SWITCH_PROXY=306]="SWITCH_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Rde||(C6.HttpStatusCode=Rde={}))});var Nde=x(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});k6.getSourceControlProviderLabel=void 0;function tet(t){let e="";switch(t){case"GITLAB":e="GitLab";break;case"GITHUB":e="GitHub";break;case"BITBUCKET":e="BitBucket";break;default:e=t;break}return e}l(tet,"getSourceControlProviderLabel");k6.getSourceControlProviderLabel=tet});var Ide=x(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.DEPLOYMENT_CANNOT_DELETE_INSTANCE=V.DEPLOYMENT_INVALID_MULTI_PART=V.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=V.DEPLOYMENT_FILE_DOES_NOT_EXISTS=V.DEPLOYMENT_NOT_FOUND=V.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=V.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=V.DEPLOYMENT_NO_ACCESS=V.INVALID_SOURCE_REPO_URL=V.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=V.PROJECT_MUST_HAVE_ONE_MEMBER=V.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=V.PROJECT_MEMBER_ALREADY_EXISTS=V.PROJECT_MEMBER_NOT_FOUND=V.INVALID_TEMPLATE_REPOSITORY=V.INCORRECT_PROJECT_TEMPLATE=V.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=V.PROJECT_NOT_FOUND=V.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=V.PROJECT_SHARING_DISABLED_ON_ACCOUNT=V.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=V.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=V.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=V.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=V.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=V.ACCOUNT_MEMBER_INVITE_INVALID=V.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=V.ACCOUNT_MEMBER_DOES_NOT_EXIST=V.ACCOUNT_MEMBER_INFO_MISSING=V.ACCOUNT_MEMBER_ALREADY_EXISTS=V.ACCOUNT_UPDATE_INFO_MISSING=V.ACCOUNT_INFO_MISSING=V.ACCOUNT_DOES_NOT_EXISTS=V.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=V.ACCOUNT_NAME_USES_RESERVED_KEYWORD=V.ACCOUNT_ALREADY_EXISTS=V.ACCOUNT_NOT_FOUND=V.USER_IS_NOT_SERVICE_ACCOUNT=V.USER_REMOVE_NOT_MEMBER_ACCOUNT=V.USER_HAS_NO_ACCESS_TO_ACCOUNT=V.USER_DETAILS_CANNOT_BE_FOUND=V.USER_ALREADY_EXISTS=V.CLIENT_NOT_FOUND=V.FORBIDDEN=V.UNAUTHORIZED=V.METHOD_NOT_ALLOWED=V.NOT_FOUND=V.CONFLICT=V.BAD_REQUEST=V.INTERNAL_SERVER_ERROR=void 0;V.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=V.GITHUB_INTEGRATION_DUPLICATE_REPO=V.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=V.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=V.GITHUB_INTEGRATION_BRANCH_BEHIND=V.GITHUB_INTEGRATION_NOT_FOUND=V.GITHUB_REPOSITORY_NOT_FOUND=V.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=V.GITHUB_INTEGRATION_ALREADY_EXISTS=V.FEATURE_FLAGS_NOT_FOUND=V.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=V.PROJECT_ALREADY_HAS_REPO=V.PROJECT_INVALID_NAME=V.FAILED_TO_REVOKE_GH_TOKEN=V.USER_ACCOUNT_NOT_FS_MIGRATED=V.USER_NO_ACCESS_GITLAB_REPO=V.USER_NO_ACCESS_BITBUCKET_REPO=V.GITHUB_APP_CONFIGURATION_NOT_FOUND=V.GITHUB_APP_NO_USER_ACCESS_=V.GITHUB_APP_NO_NAMESPACE_ACCESS=V.GENERIC_GITHUB_BRANCH_INFO_ERROR=V.GITHUB_USER_NO_READ_ACCESS_REPO=V.USER_NO_PULL_ACCESS_GITHUB_REPO=V.USER_NO_ACCESS_GITHUB_REPO=V.PROJECT_SHARING_REQUIRES_GIT_REPO=V.PROJECT_INVALID_GIT_REPO=V.PROJECT_INVALID_GIT_CLONE=V.USER_IS_PROJECT_MEMBER=V.USER_HAS_NO_ACCESS_TO_PROJECT=V.RUNTIME_FLAG_KEY_NOT_VALID=V.RUNTIME_FLAG_NOT_FOUND=V.RUNTIME_FLAG_ALREADY_EXISTS=V.PROJECT_NO_MEMBERS=V.PROJECT_ALREADY_EXISTS=V.SERVICE_CONFIGURATION_FAILED_DECRYPTION=V.WORKING_COPY_SERVICE_NOT_CREATED=V.WORKING_COPY_SERVICE_NOT_DELETED=V.WORKING_COPY_SERVICE_NOT_FOUND=V.SERVICE_CONFIGURATION_NOT_FOUND=V.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=V.DEPLOYMENT_INCORRECT_STATUS_PAUSE=V.DEPLOYMENT_NOT_WORKING_COPY=V.DEPLOYMENT_LOG_NOT_FOUND=V.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=V.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=V.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=V.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=V.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=V.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=V.DEPLOYMENT_DELETE_ERROR=void 0;V.INVALID_BRANCH_NAME=V.TARGET_BRANCH_ONLY_FOR_PREVIEW=V.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=V.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=V.DEPLOYMENT_NAME_MISSING=V.NON_EXISTENT_ENVIRONMENT_VARIABLE=V.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=V.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=V.DUPLICATE_ENVIRONMENT_VARIABLE=V.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=V.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=V.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=V.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=V.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=V.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=V.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=V.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=V.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=V.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=V.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=V.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=V.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=V.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=V.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=V.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=V.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=V.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=V.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=V.SOURCE_CONTROL_REPO_OPERATION_ERROR=V.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=V.SOURCE_CONTROL_REPO_NOT_FOUND=V.SOURCE_CONTROL_AUTHENTICATION_FAILED=V.EXTERNAL_SERVICE_GENERIC_ERROR=V.API_USER_NO_ACCESS=V.EXTERNAL_USER_NOT_CONFIGURED=V.EXTERNAL_USER_NO_ACCESS=V.CONSUMER_DOES_NOT_EXIST=V.CONSUMER_NO_ACCESS=V.GITLAB_ACCESS_LEVEL_CHECK_FAIL=V.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=V.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=V.GITLAB_DUPLICATE_REPO=V.GITLAB_FAILED_DURING_REPO_CREATION=V.GITLAB_QUERY_USER_INFO_FAILED=V.BITBUCKET_FAILED_DURING_REPO_CREATION=V.BITBUCKET_WORKSPACE_MISCONFIGURATION=V.BITBUCKET_QUERY_USER_INFO_FAILED=V.GITHUB_INTEGRATION_INVALID_REPO=V.GIT_CREATE_PROJECT_WITH_INVALID_REPO=V.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=void 0;V.METERING_BUCKET_CREATION_FAILED=V.UNABLE_UPGRADE_PLAN=V.BUCKET_NOT_FOUND=V.BUCKET_API_KEY_SERVICE_CONFLICT=V.DIRECTORY_DELETE_FAILED=V.FILE_DELETE_FAILED=V.CANNOT_DELETE_SOLE_OPEN_API_FILE=V.CANNOT_DELETE_ESSENTIAL_DIRECTORY=V.CANNOT_DELETE_ESSENTIAL_FILE=V.FILE_WRITE_FAILED=V.FILE_RENAME_FAILED=V.FILE_RENAME_FILE_ALREADY_EXISTS=V.FILE_RENAME_CANNOT_CHANGE_EXTENSION=V.FILE_RENAME_PATHS_MATCH=V.DIRECTORY_CREATION_FAILED=V.DIRECTORY_OR_FILE_DOES_NOT_EXIST=V.DIRECTORY_DOES_NOT_EXIST=V.DIRECTORY_ALREADY_EXISTS=V.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=V.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=V.FAILED_DOWNLOAD_FROM_STORAGE=V.CANNOT_FIND_SRC_DIRECTORY=V.CANNOT_READ_PACKAGE_JSON=V.PACKAGE_JSON_NOT_FOUND=V.RUNTIME_VERSION_INCORRECT_FORMAT=V.MIGRATIONS_ONLY_ON_WORKING_COPY=V.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=V.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=V.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=V.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=V.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=V.NO_GLOBAL_SYMBOLS=V.NO_ZUPLO_PREFIXED_VARIABLES=V.NON_EMPTY_TARGETS_REQUIRED=V.CONFLICTING_TYPES=V.OVERLAPPING_TARGETS=void 0;var me=rM(),Dde=Nde(),ret="https://github.com/apps/zuplo/installations/new";V.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:me.HttpStatusCode.BAD_REQUEST};V.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:me.HttpStatusCode.CONFLICT};V.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:me.HttpStatusCode.NOT_FOUND};V.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:me.HttpStatusCode.METHOD_NOT_ALLOWED};V.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:me.HttpStatusCode.UNAUTHORIZED};V.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:me.HttpStatusCode.FORBIDDEN};V.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:me.HttpStatusCode.NOT_FOUND};V.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:me.HttpStatusCode.CONFLICT};V.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:me.HttpStatusCode.UNAUTHORIZED};V.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:me.HttpStatusCode.BAD_REQUEST};V.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:me.HttpStatusCode.CONFLICT};V.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:me.HttpStatusCode.BAD_REQUEST};V.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:me.HttpStatusCode.FORBIDDEN};V.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:me.HttpStatusCode.NOT_FOUND};V.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.FORBIDDEN};V.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:me.HttpStatusCode.BAD_REQUEST};var net=l(({repositoryUrl:t})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${t} is not a valid Zuplo template repository`,status:me.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");V.INVALID_TEMPLATE_REPOSITORY=net;V.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:me.HttpStatusCode.NOT_FOUND};V.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:me.HttpStatusCode.BAD_REQUEST};V.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};V.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.FORBIDDEN};V.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:me.HttpStatusCode.BAD_REQUEST};V.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:me.HttpStatusCode.BAD_REQUEST};V.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:me.HttpStatusCode.NOT_FOUND};V.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:me.HttpStatusCode.NOT_FOUND};V.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:me.HttpStatusCode.BAD_REQUEST};V.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:me.HttpStatusCode.BAD_REQUEST};V.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:me.HttpStatusCode.NOT_FOUND};V.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:me.HttpStatusCode.BAD_REQUEST};V.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:me.HttpStatusCode.NOT_FOUND};V.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:me.HttpStatusCode.BAD_REQUEST};V.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:me.HttpStatusCode.FORBIDDEN};V.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:me.HttpStatusCode.BAD_REQUEST};V.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};var iet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");V.USER_NO_ACCESS_GITHUB_REPO=iet;var oet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");V.USER_NO_PULL_ACCESS_GITHUB_REPO=oet;var aet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");V.GITHUB_USER_NO_READ_ACCESS_REPO=aet;V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.FORBIDDEN};var set=l(({repositoryUrl:t})=>({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 '${t}'. Go to '${ret}' to add the repository.`,status:me.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");V.GITHUB_APP_NO_USER_ACCESS_=set;V.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:me.HttpStatusCode.NOT_FOUND};var uet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");V.USER_NO_ACCESS_BITBUCKET_REPO=uet;var cet=l(({repositoryUrl:t})=>({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 '${t}' to add a new collaborator.`,status:me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");V.USER_NO_ACCESS_GITLAB_REPO=cet;V.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:me.HttpStatusCode.FORBIDDEN};V.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:me.HttpStatusCode.BAD_REQUEST};var pet=l(({repositoryUrl:t})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:me.HttpStatusCode.CONFLICT,detail:`The repository ${t} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");V.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=pet;var det=l(({repositoryUrl:t})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:me.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${t} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");V.GITHUB_REPOSITORY_NOT_FOUND=det;V.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:me.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};V.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:me.HttpStatusCode.BAD_REQUEST};V.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};var fet=l(({repositoryName:t,orgName:e})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${t}' already exists on GitHub org '${e}'.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");V.GITHUB_INTEGRATION_DUPLICATE_REPO=fet;var het=l(({repositoryName:t,details:e})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:e,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");V.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=het;var met=l(({repositoryUrl:t})=>({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 '${t}' 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:t,status:me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");V.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=met;var get=l(({repositoryUrl:t})=>({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 '${t}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");V.GIT_CREATE_PROJECT_WITH_INVALID_REPO=get;var yet=l(({repositoryUrl:t})=>({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 '${t}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");V.GITHUB_INTEGRATION_INVALID_REPO=yet;V.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:me.HttpStatusCode.FORBIDDEN};V.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:me.HttpStatusCode.FORBIDDEN};var vet=l(({details:t})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:t,status:me.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");V.BITBUCKET_FAILED_DURING_REPO_CREATION=vet;V.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:me.HttpStatusCode.FORBIDDEN};var bet=l(({details:t})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");V.GITLAB_FAILED_DURING_REPO_CREATION=bet;var _et=l(({repositoryName:t,orgName:e})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${t}' already exists in GitLab team '${e}'.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");V.GITLAB_DUPLICATE_REPO=_et;var Oet=l(({orgName:t})=>({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:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");V.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=Oet;var Eet=l(({namespaceLabel:t})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${t}'.`,details:`The user's GitLab access level does not allow the use of namespace '${t}'.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");V.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=Eet;var wet=l(({orgName:t})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");V.GITLAB_ACCESS_LEVEL_CHECK_FAIL=wet;V.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:me.HttpStatusCode.UNAUTHORIZED};V.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:me.HttpStatusCode.NOT_FOUND};V.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:me.HttpStatusCode.UNAUTHORIZED};V.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:me.HttpStatusCode.FORBIDDEN};V.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:me.HttpStatusCode.FORBIDDEN};V.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR};var Tet=l(({sourceControlProvider:t})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,Dde.getSourceControlProviderLabel)(t)}`,status:me.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");V.SOURCE_CONTROL_AUTHENTICATION_FAILED=Tet;var Aet=l(({sourceControlProvider:t})=>({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,Dde.getSourceControlProviderLabel)(t)} repository`,status:me.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");V.SOURCE_CONTROL_REPO_NOT_FOUND=Aet;V.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:me.HttpStatusCode.BAD_REQUEST};var Pet=l(({repoURL:t,operation:e})=>({type:`https://zup.fail/source-control-repo-${e}-error`,title:`Failed on ${e} operation to repository '${t}'. 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:me.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");V.SOURCE_CONTROL_REPO_OPERATION_ERROR=Pet;V.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:me.HttpStatusCode.FORBIDDEN};V.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.UNAUTHORIZED};V.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:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:me.HttpStatusCode.FORBIDDEN};V.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:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.NOT_FOUND};V.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:me.HttpStatusCode.INTERNAL_SERVER_ERROR};V.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:me.HttpStatusCode.FAILED_DEPENDENCY};V.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:me.HttpStatusCode.FAILED_DEPENDENCY};V.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:me.HttpStatusCode.FAILED_DEPENDENCY};V.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:me.HttpStatusCode.BAD_REQUEST};V.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:me.HttpStatusCode.NOT_FOUND};V.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:me.HttpStatusCode.BAD_REQUEST};V.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:me.HttpStatusCode.BAD_REQUEST};V.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.BAD_REQUEST};V.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:me.HttpStatusCode.FORBIDDEN};V.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:me.HttpStatusCode.NOT_FOUND};var xet=l(({operation:t,path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${t} file ${e} for a read-only environment. Read-only environments cannot be edited.`,status:me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");V.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=xet;var Cet=l(()=>({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:me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");V.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=Cet;V.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:me.HttpStatusCode.BAD_REQUEST};V.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:me.HttpStatusCode.BAD_REQUEST};V.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:me.HttpStatusCode.NOT_FOUND};V.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:me.HttpStatusCode.BAD_REQUEST};V.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:me.HttpStatusCode.BAD_REQUEST};V.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:me.HttpStatusCode.BAD_REQUEST};var ket=l(({path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${t} for a read-only environment. Read-only environments cannot be edited.`,status:me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");V.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=ket;var Ret=l(({path:t})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${t} is not allowed.`,instance:t,status:me.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");V.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=Ret;var Net=l(({path:t})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:me.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${t}.`}),"DIRECTORY_ALREADY_EXISTS");V.DIRECTORY_ALREADY_EXISTS=Net;var Det=l(({path:t})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:me.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${t}`}),"DIRECTORY_DOES_NOT_EXIST");V.DIRECTORY_DOES_NOT_EXIST=Det;var Iet=l(({path:t})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:me.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${t}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");V.DIRECTORY_OR_FILE_DOES_NOT_EXIST=Iet;var jet=l(({path:t})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${t}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");V.DIRECTORY_CREATION_FAILED=jet;var Let=l(({path:t})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${t} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");V.FILE_RENAME_PATHS_MATCH=Let;var qet=l(({oldExtension:t,newExtension:e})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${e} must match the old extension ${t}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");V.FILE_RENAME_CANNOT_CHANGE_EXTENSION=qet;var Met=l(({path:t})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${t}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");V.FILE_RENAME_FILE_ALREADY_EXISTS=Met;var Fet=l(({path:t})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${t}. Please try again or contact support.`}),"FILE_RENAME_FAILED");V.FILE_RENAME_FAILED=Fet;var Uet=l(({path:t})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${t}. Please try again or contact support.`}),"FILE_WRITE_FAILED");V.FILE_WRITE_FAILED=Uet;var $et=l(({path:t})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:me.HttpStatusCode.BAD_REQUEST,detail:`File '${t}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");V.CANNOT_DELETE_ESSENTIAL_FILE=$et;var Bet=l(({path:t})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:me.HttpStatusCode.BAD_REQUEST,detail:`Directory '${t}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");V.CANNOT_DELETE_ESSENTIAL_DIRECTORY=Bet;var Vet=l(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:me.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");V.CANNOT_DELETE_SOLE_OPEN_API_FILE=Vet;var Het=l(({path:t})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${t}. Please try again or contact support.`}),"FILE_DELETE_FAILED");V.FILE_DELETE_FAILED=Het;var Get=l(({path:t})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${t}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");V.DIRECTORY_DELETE_FAILED=Get;V.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:me.HttpStatusCode.CONFLICT};V.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:me.HttpStatusCode.NOT_FOUND};V.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:me.HttpStatusCode.BAD_REQUEST};V.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:me.HttpStatusCode.INTERNAL_SERVER_ERROR}});var Lde=x(Ka=>{"use strict";var zet=Ka&&Ka.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jet=Ka&&Ka.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ket=Ka&&Ka.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&zet(e,t,r);return Jet(e,t),e};Object.defineProperty(Ka,"__esModule",{value:!0});Ka.ApiNotFoundError=Ka.ApiError=Ka.Problems=void 0;var jde=Ket(Ide());Ka.Problems=jde;var R6=class extends Error{static{l(this,"ApiError")}type;status;detail;instance;constructor(e){if(super(e.title),!e.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 ${e.type}`);this.name="ApiProblemError",this.type=e.type,this.status=e.status,this.detail=e.detail,this.instance=e.instance}};Ka.ApiError=R6;var nM=class extends R6{static{l(this,"ApiNotFoundError")}constructor(e={}){super({...e,...jde.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};Ka.ApiNotFoundError=nM});var Ya=x(vd=>{"use strict";var Yet=vd&&vd.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Wet=vd&&vd.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yet(e,t,r)};Object.defineProperty(vd,"__esModule",{value:!0});vd.HttpStatusCode=void 0;Wet(Lde(),vd);var Qet=rM();Object.defineProperty(vd,"HttpStatusCode",{enumerable:!0,get:function(){return Qet.HttpStatusCode}})});var oM=x(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});N6.CommonAuth=void 0;var Ff=Ya(),Xet=["google-oauth2|106231436550039770264","google-oauth2|113609898431445637338","google-oauth2|115413213714061429608","google-oauth2|105283806895031006146","google-oauth2|116604562105669742663"],iM=class t{static{l(this,"CommonAuth")}static DEPLOYER_USER_SUB="deployer-app@zuplo";isZuploAdmin(e){return Xet.includes(e)}isDeployerServiceAccount(e){return t.DEPLOYER_USER_SUB===e}static isAuthorizedSub(e,r){if(typeof r=="string")throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS);if(r instanceof Buffer)throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS);try{if(!e.includes(r.sub))throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS)}catch{throw new Ff.ApiError(Ff.Problems.API_USER_NO_ACCESS)}}};N6.CommonAuth=iM});var qde=x(D6=>{"use strict";Object.defineProperty(D6,"__esModule",{value:!0});D6.hasBlockedNotifications=void 0;var Zet=["chocolate_bold_silverfish"];function ett(t){return Zet.includes(t)}l(ett,"hasBlockedNotifications");D6.hasBlockedNotifications=ett});var sM=x(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.BuildIssueError=Wa.WARNING_SEVERITY=Wa.ERROR_SEVERITY=Wa.FAILURE_STATUS=Wa.WARNING_STATUS=Wa.GOOD_STATUS=void 0;Wa.GOOD_STATUS="Good";Wa.WARNING_STATUS="Warnings";Wa.FAILURE_STATUS="Failed";Wa.ERROR_SEVERITY="error";Wa.WARNING_SEVERITY="warning";var aM=class extends Error{static{l(this,"BuildIssueError")}issue;constructor(e){super(e.message),this.issue=e}};Wa.BuildIssueError=aM});var Mde=x(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});I6.COMPATIBILITY_FLAG_MAPPINGS=void 0;I6.COMPATIBILITY_FLAG_MAPPINGS=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}})});var Fde=x((D3r,ttt)=>{ttt.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/zuplo.config.json",title:"Zuplo Config",description:"",type:"object",required:[],additionalProperties:!1,properties:{version:{description:"The version of the configuration",type:"number",enum:[1]},project:{type:"string"},compatibilityDate:{description:"The compatibility date on which to run the gateway",type:"string",title:"Compatibility Date",default:"2024-01-15",enum:["2023-03-14","2024-01-15"]}}}});var Ude=x(j6=>{"use strict";Object.defineProperty(j6,"__esModule",{value:!0});j6.VALID_COMPATIBILITY_DATES=void 0;j6.VALID_COMPATIBILITY_DATES=Object.freeze(["2023-03-14","2024-01-15"])});var $de=x(Uf=>{"use strict";var rtt=Uf&&Uf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uf,"__esModule",{value:!0});Uf.DEFAULT_COMPATIBILITY_DATE=Uf.VALID_COMPATIBILITY_DATES=void 0;var ntt=rtt(Fde()),itt=Ude();Object.defineProperty(Uf,"VALID_COMPATIBILITY_DATES",{enumerable:!0,get:function(){return itt.VALID_COMPATIBILITY_DATES}});Uf.DEFAULT_COMPATIBILITY_DATE=ntt.default.properties.compatibilityDate.default});var Bde=x(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});L6.FeatureFlags=void 0;L6.FeatureFlags=Object.freeze({esmWorker:(t,e)=>({flagName:"ZUPLO_ESM_WORKER",defaultValue:!1,accountName:t,projectName:e}),FS_ACCOUNT_NAME_PATH:"FS_ACCOUNT_NAME_PATH"})});var Vde=x($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.decrypt=$f.encrypt=$f.signString=void 0;var B1=require("crypto");function ott(t,e){return(0,B1.createHmac)("sha256",e).update(t).digest("hex")}l(ott,"signString");$f.signString=ott;var lM={AUTH_TAG_BYTE_LEN:16,IV_BYTE_LEN:12},att=l(()=>(0,B1.randomBytes)(lM.IV_BYTE_LEN),"getIV");function stt(t,e){if(t===null)return null;let r=(0,B1.createHash)("sha256").update(String(e)).digest("base64").substring(0,32),n=att(),i=(0,B1.createCipheriv)("aes-256-gcm",r,n,{authTagLength:lM.AUTH_TAG_BYTE_LEN}),s=i.update(t);return s=Buffer.concat([s,i.final()]),Buffer.concat([n,s,i.getAuthTag()]).toString("hex")}l(stt,"encrypt");$f.encrypt=stt;function ltt(t,e){if(!t)return null;let r=Buffer.from(e),n=(0,B1.createHash)("sha256").update(String(r)).digest("base64").substring(0,32),i=Buffer.from(t,"hex"),s=i.slice(-16),p=i.slice(0,12),d=i.slice(12,-16),f=(0,B1.createDecipheriv)("aes-256-gcm",n,p,{authTagLength:lM.AUTH_TAG_BYTE_LEN});f.setAuthTag(s);let a=f.update(d);return Buffer.concat([a,f.final()]).toString("utf-8")}l(ltt,"decrypt");$f.decrypt=ltt});var Hde=x(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});q6.getCurrentUtcDateTime=void 0;function utt(){let t={year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0,timeZone:"UTC"};return new Date().toLocaleString("en-US",t)}l(utt,"getCurrentUtcDateTime");q6.getCurrentUtcDateTime=utt});var uM=x(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});M6.DeploymentLogState=void 0;var Gde;(function(t){t.ERROR="ERROR",t.IN_PROGRESS="IN_PROGRESS",t.SUCCESS="SUCCESS"})(Gde||(M6.DeploymentLogState=Gde={}))});var cM=x(zde=>{"use strict";Object.defineProperty(zde,"__esModule",{value:!0})});var Kde=x(Jde=>{"use strict";Object.defineProperty(Jde,"__esModule",{value:!0})});var Yde=x(F6=>{"use strict";Object.defineProperty(F6,"__esModule",{value:!0});F6.MARKDOWN_FRONTMATTER_KEYS=void 0;F6.MARKDOWN_FRONTMATTER_KEYS=["sidebar_label"]});var Qde=x(Wde=>{"use strict";Object.defineProperty(Wde,"__esModule",{value:!0})});var Xde=x(Cc=>{"use strict";var ctt=Cc&&Cc.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U6=Cc&&Cc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ctt(e,t,r)};Object.defineProperty(Cc,"__esModule",{value:!0});U6(cM(),Cc);U6(Kde(),Cc);U6(Yde(),Cc);U6(Qde(),Cc)});var $6=x(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.getLoggerContext=kc.requestIdGenerator=kc.REQUEST_ID_HEADER=kc.LEGACY_REQUEST_ID_HEADER=void 0;var ptt=require("crypto");kc.LEGACY_REQUEST_ID_HEADER="zuplo-request-id";kc.REQUEST_ID_HEADER="zp-rid";var dtt=l(t=>{let e=t.headers["zuplo-request-id"],r=t.headers["X-GitHub-Delivery"];return e?`${e}`:r?`${r}`:(0,ptt.randomUUID)()},"requestIdGenerator");kc.requestIdGenerator=dtt;function ftt(t){let e=t.raw.url??"",r={};try{let n=t.headers["zuplo-user"]??t.user?.sub;n&&(r.userSub=`${n}`);let i=e.match(/(deployments)\/([a-zA-Z-0-9]*)/);i&&i!==null&&i.length>=2&&(r.deployment=i[2]);let s=e.match(/(accounts)\/([a-zA-Z-0-9]*)/);s&&s!==null&&s.length>=2&&(r.account=s[2]);let p=e.match(/(projects)\/([a-zA-Z-0-9]*)/);p&&p!==null&&p.length>=2&&(r.project=p[2])}catch{}return r}l(ftt,"getLoggerContext");kc.getLoggerContext=ftt});var pM=x(V1=>{"use strict";var htt=V1&&V1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(V1,"__esModule",{value:!0});V1.errorHandler=void 0;var nl=Ya(),mtt=htt(ba()),Zde=$6();function gtt(t,e,r){let n=500,i;if(t instanceof nl.ApiError)n=t.status,i={type:t.type,title:t.message,status:t.status,detail:t.detail,instance:t.instance};else if(typeof t=="object"&&"validation"in t&&"validationContext"in t)n=nl.HttpStatusCode.BAD_REQUEST,i={...nl.Problems.BAD_REQUEST,detail:`An error occurred when validating the ${t.validationContext}.`,errors:t.validation};else if(typeof t=="object"&&"code"in t&&t.code==="FST_ERR_NOT_FOUND")n=404,i=nl.Problems.NOT_FOUND;else if(typeof t=="object"&&"code"in t&&typeof t.code=="string"&&["FST_ERR_CTP_INVALID_TYPE","FST_ERR_CTP_EMPTY_TYPE","FST_ERR_CTP_BODY_TOO_LARGE","FST_ERR_CTP_INVALID_MEDIA_TYPE","FST_ERR_CTP_INVALID_CONTENT_LENGTH","FST_ERR_CTP_EMPTY_JSON_BODY","FST_ERR_BAD_URL","FST_ERR_INVALID_URL"].includes(t.code))n=nl.HttpStatusCode.BAD_REQUEST,i={...nl.Problems.BAD_REQUEST,detail:t.message};else{let p;!r.statusCode||r.statusCode===200?(typeof t=="object"&&"statusCode"in t&&typeof t.statusCode=="number"?p=t.statusCode:typeof t=="object"&&"status"in t&&typeof t.status=="number"&&(p=t.status),n=p&&p>=400?p:500):n=r.statusCode,i=ytt(n),mtt.default.NODE_ENV!=="production"&&(typeof t=="object"&&"message"in t?i.detail=t.message:typeof t=="string"&&(i.detail=t))}i.trace={timestamp:new Date().toJSON(),requestId:e.headers[Zde.REQUEST_ID_HEADER]??e.headers[Zde.LEGACY_REQUEST_ID_HEADER]},n<500?r.log.warn({res:r,err:t},t&&t.message):r.log.error({req:e,res:r,err:t},t&&t.message);let s=JSON.stringify(i,null,2);return r.status(n).header("content-type","application/json").send(s)}l(gtt,"errorHandler");V1.errorHandler=gtt;function ytt(t){return t===401?nl.Problems.UNAUTHORIZED:t===403?nl.Problems.FORBIDDEN:t===404?nl.Problems.NOT_FOUND:t===405?nl.Problems.METHOD_NOT_ALLOWED:t<500&&t>=400?nl.Problems.BAD_REQUEST:nl.Problems.INTERNAL_SERVER_ERROR}l(ytt,"getProblemFromStatus")});var tfe=x((Q3r,dM)=>{"use strict";var vtt=/at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/,btt=/(\w*(\.\w*)*)\..*/;dM.exports=l(function(e){if(e.name.length>0)return e.name;let r=Error.stackTraceLimit;Error.stackTraceLimit=10;try{throw new Error("anonymous function")}catch(n){return Error.stackTraceLimit=r,efe(n.stack)}},"getPluginName");function efe(t){let e=t.match(vtt);return e?e[1].split(/[/\\]/).slice(-1)[0].match(btt)[1]:"anonymous"}l(efe,"extractPluginName");dM.exports.extractPluginName=efe});var nfe=x((Z3r,rfe)=>{"use strict";rfe.exports=l(function(e){return e[0]==="@"&&(e=e.slice(1).replace("/","-")),e.replace(/-(.)/g,function(n,i){return i.toUpperCase()})},"toCamelCase")});var ey=x((t4r,B6)=>{"use strict";var _tt=tfe(),Ott=nfe(),Ett=0;function fM(t,e={}){let r=!1;if(typeof t.default<"u"&&(t=t.default),typeof t!="function")throw new TypeError(`fastify-plugin expects a function, instead got a '${typeof t}'`);if(typeof e=="string"&&(e={fastify:e}),typeof e!="object"||Array.isArray(e)||e===null)throw new TypeError("The options object should be an object");if(e.fastify!==void 0&&typeof e.fastify!="string")throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof e.fastify}'`);e.name||(r=!0,e.name=_tt(t)+"-auto-"+Ett++),t[Symbol.for("skip-override")]=e.encapsulate!==!0,t[Symbol.for("fastify.display-name")]=e.name,t[Symbol.for("plugin-meta")]=e,t.default||(t.default=t);let n=Ott(e.name);return!r&&!t[n]&&(t[n]=t),t}l(fM,"plugin");B6.exports=fM;B6.exports.default=fM;B6.exports.fastifyPlugin=fM});var ofe=x(H1=>{"use strict";var wtt=H1&&H1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(H1,"__esModule",{value:!0});H1.apiKeyAuthPlugin=void 0;var Rc=Ya(),Ttt=wtt(ey()),Stt="https://apikey.zuplo.com",ife="Bearer ";H1.apiKeyAuthPlugin=(0,Ttt.default)(async(t,e)=>{t.decorate("validateApiKey",async function(r){let{authorization:n}=r.headers;if(!n)throw new Rc.ApiError({...Rc.Problems.UNAUTHORIZED,detail:"No Authorization Header"});if(!n.toLowerCase().startsWith(ife))throw new Rc.ApiError({...Rc.Problems.UNAUTHORIZED,detail:"Invalid Authorization Scheme"});let i=n.substring(ife.length);if(!i||i==="")throw new Rc.ApiError({...Rc.Problems.UNAUTHORIZED,detail:"No key present"});let s={key:i},p=await fetch(`${Stt}/v1/$validate/${e.bucketName}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(p.status===401)throw new Rc.ApiError(Rc.Problems.UNAUTHORIZED);let d=await p.json();if(e.allowedSubs&&!e.allowedSubs.includes(d.name))throw new Rc.ApiError(Rc.Problems.UNAUTHORIZED);r.user={sub:d.name,metadata:d.metadata}})},{name:"api-key-auth"})});var afe=x(G1=>{"use strict";var Att=G1&&G1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(G1,"__esModule",{value:!0});G1.ensureZuploAdminPlugin=void 0;var V6=Ya(),Ptt=Att(ey()),xtt=oM();G1.ensureZuploAdminPlugin=(0,Ptt.default)(async function(t){let e=new xtt.CommonAuth;t.decorate("ensureZuploAdmin",async function(r){if(!r.user)throw r.log.error("Bad request, no user on request"),new V6.ApiError(V6.Problems.UNAUTHORIZED);let n=r.user.sub;if(!(n&&e.isZuploAdmin(n)))throw r.log.error("User is not an admin"),new V6.ApiError(V6.Problems.FORBIDDEN)})},{name:"ensure-zuplo-admin-plugin"})});var lfe=x(z1=>{"use strict";var Ctt=z1&&z1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z1,"__esModule",{value:!0});z1.ensureZuploUserPlugin=void 0;var sfe=Ya(),ktt=Ctt(ey());z1.ensureZuploUserPlugin=(0,ktt.default)(async t=>{t.decorate("ensureZuploUser",async function(e){let r=e.headers["zuplo-user"];if(!r||typeof r!="string")throw e.log.error("The 'zuplo-user' header is missing"),new sfe.ApiError(sfe.Problems.UNAUTHORIZED);e.user={sub:r}})},{name:"ensure-zuplo-user-plugin"})});var pfe=x(J1=>{"use strict";var Rtt=J1&&J1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(J1,"__esModule",{value:!0});J1.featureFlagsPlugin=void 0;var Ntt=Rtt(ey()),hM;async function ufe(t,e){try{let r=await hM?.variation(e.flagName,{kind:e.kind,key:e.key},e.defaultValue);return r===void 0?e.defaultValue:r}catch(r){t.log.warn(`Failed to query Launch Darkly flag ${e.flagName}`),t.log.error(r)}return e.defaultValue}l(ufe,"getFlagValue");function cfe(){return this.log.error("Call to feature flag getFlagValue function on uninitialized flag plugin"),Promise.resolve(!1)}l(cfe,"fallback");J1.featureFlagsPlugin=(0,Ntt.default)(async(t,e)=>{try{if(typeof e.key!="string"||!e.key||!e.client){t.decorateRequest("getFlagValue",cfe),t.decorateRequest("getFlagValueByUser",cfe);return}hM=e.client,t.log.info("Launch Darkly SDK successfully initialized!"),t.decorate("flags",hM),t.decorateRequest("getFlagValue",async function(r){let n,i;"projectName"in r?(n="project",i=`${r.accountName}/${r.projectName}`):(n="account",i=r.accountName);let s={flagName:r.flagName,kind:n,key:i,defaultValue:r.defaultValue};return ufe(this,s)}),t.decorateRequest("getFlagValueByUser",async function(r,n,i){return ufe(this,{flagName:r,kind:"user",key:n,defaultValue:i})})}catch(r){t.log.warn("Launch Darkly failed to initialize"),t.log.error(r)}},{name:"feature-flag-plugin"})});var mM=x(K1=>{"use strict";var Dtt=K1&&K1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K1,"__esModule",{value:!0});K1.getUserSubPlugin=void 0;var dfe=Ya(),Itt=Dtt(ey());K1.getUserSubPlugin=(0,Itt.default)(async t=>{t.decorateRequest("getUserSub",function(){let e=this.user?.sub;if(!e)throw this.log.error("Could not determine the user sub"),new dfe.ApiError(dfe.Problems.UNAUTHORIZED);return e})},{name:"get-user-sub-plugin"})});var gM=x(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.getUserSubPlugin=il.featureFlagsPlugin=il.ensureZuploUserPlugin=il.ensureZuploAdminPlugin=il.apiKeyAuthPlugin=void 0;var jtt=ofe();Object.defineProperty(il,"apiKeyAuthPlugin",{enumerable:!0,get:function(){return jtt.apiKeyAuthPlugin}});var Ltt=afe();Object.defineProperty(il,"ensureZuploAdminPlugin",{enumerable:!0,get:function(){return Ltt.ensureZuploAdminPlugin}});var qtt=lfe();Object.defineProperty(il,"ensureZuploUserPlugin",{enumerable:!0,get:function(){return qtt.ensureZuploUserPlugin}});var Mtt=pfe();Object.defineProperty(il,"featureFlagsPlugin",{enumerable:!0,get:function(){return Mtt.featureFlagsPlugin}});var Ftt=mM();Object.defineProperty(il,"getUserSubPlugin",{enumerable:!0,get:function(){return Ftt.getUserSubPlugin}})});var sn=x(vo=>{"use strict";var yM=Symbol.for("yaml.alias"),ffe=Symbol.for("yaml.document"),H6=Symbol.for("yaml.map"),hfe=Symbol.for("yaml.pair"),vM=Symbol.for("yaml.scalar"),G6=Symbol.for("yaml.seq"),bd=Symbol.for("yaml.node.type"),Utt=l(t=>!!t&&typeof t=="object"&&t[bd]===yM,"isAlias"),$tt=l(t=>!!t&&typeof t=="object"&&t[bd]===ffe,"isDocument"),Btt=l(t=>!!t&&typeof t=="object"&&t[bd]===H6,"isMap"),Vtt=l(t=>!!t&&typeof t=="object"&&t[bd]===hfe,"isPair"),mfe=l(t=>!!t&&typeof t=="object"&&t[bd]===vM,"isScalar"),Htt=l(t=>!!t&&typeof t=="object"&&t[bd]===G6,"isSeq");function gfe(t){if(t&&typeof t=="object")switch(t[bd]){case H6:case G6:return!0}return!1}l(gfe,"isCollection");function Gtt(t){if(t&&typeof t=="object")switch(t[bd]){case yM:case H6:case vM:case G6:return!0}return!1}l(Gtt,"isNode");var ztt=l(t=>(mfe(t)||gfe(t))&&!!t.anchor,"hasAnchor");vo.ALIAS=yM;vo.DOC=ffe;vo.MAP=H6;vo.NODE_TYPE=bd;vo.PAIR=hfe;vo.SCALAR=vM;vo.SEQ=G6;vo.hasAnchor=ztt;vo.isAlias=Utt;vo.isCollection=gfe;vo.isDocument=$tt;vo.isMap=Btt;vo.isNode=Gtt;vo.isPair=Vtt;vo.isScalar=mfe;vo.isSeq=Htt});var tw=x(bM=>{"use strict";var Gi=sn(),Qa=Symbol("break visit"),yfe=Symbol("skip children"),Nc=Symbol("remove node");function z6(t,e){let r=vfe(e);Gi.isDocument(t)?Y1(null,t.contents,r,Object.freeze([t]))===Nc&&(t.contents=null):Y1(null,t,r,Object.freeze([]))}l(z6,"visit");z6.BREAK=Qa;z6.SKIP=yfe;z6.REMOVE=Nc;function Y1(t,e,r,n){let i=bfe(t,e,r,n);if(Gi.isNode(i)||Gi.isPair(i))return _fe(t,n,i),Y1(t,i,r,n);if(typeof i!="symbol"){if(Gi.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let p=Y1(s,e.items[s],r,n);if(typeof p=="number")s=p-1;else{if(p===Qa)return Qa;p===Nc&&(e.items.splice(s,1),s-=1)}}}else if(Gi.isPair(e)){n=Object.freeze(n.concat(e));let s=Y1("key",e.key,r,n);if(s===Qa)return Qa;s===Nc&&(e.key=null);let p=Y1("value",e.value,r,n);if(p===Qa)return Qa;p===Nc&&(e.value=null)}}return i}l(Y1,"visit_");async function J6(t,e){let r=vfe(e);Gi.isDocument(t)?await W1(null,t.contents,r,Object.freeze([t]))===Nc&&(t.contents=null):await W1(null,t,r,Object.freeze([]))}l(J6,"visitAsync");J6.BREAK=Qa;J6.SKIP=yfe;J6.REMOVE=Nc;async function W1(t,e,r,n){let i=await bfe(t,e,r,n);if(Gi.isNode(i)||Gi.isPair(i))return _fe(t,n,i),W1(t,i,r,n);if(typeof i!="symbol"){if(Gi.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let p=await W1(s,e.items[s],r,n);if(typeof p=="number")s=p-1;else{if(p===Qa)return Qa;p===Nc&&(e.items.splice(s,1),s-=1)}}}else if(Gi.isPair(e)){n=Object.freeze(n.concat(e));let s=await W1("key",e.key,r,n);if(s===Qa)return Qa;s===Nc&&(e.key=null);let p=await W1("value",e.value,r,n);if(p===Qa)return Qa;p===Nc&&(e.value=null)}}return i}l(W1,"visitAsync_");function vfe(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}l(vfe,"initVisitor");function bfe(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Gi.isMap(e))return r.Map?.(t,e,n);if(Gi.isSeq(e))return r.Seq?.(t,e,n);if(Gi.isPair(e))return r.Pair?.(t,e,n);if(Gi.isScalar(e))return r.Scalar?.(t,e,n);if(Gi.isAlias(e))return r.Alias?.(t,e,n)}l(bfe,"callVisitor");function _fe(t,e,r){let n=e[e.length-1];if(Gi.isCollection(n))n.items[t]=r;else if(Gi.isPair(n))t==="key"?n.key=r:n.value=r;else if(Gi.isDocument(n))n.contents=r;else{let i=Gi.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}l(_fe,"replaceNode");bM.visit=z6;bM.visitAsync=J6});var _M=x(Efe=>{"use strict";var Ofe=sn(),Jtt=tw(),Ktt={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ytt=l(t=>t.replace(/[!,[\]{}]/g,e=>Ktt[e]),"escapeTagName"),rw=class t{static{l(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,p]=n;return this.tags[s]=p,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let p=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,p),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let p=e.slice(2,-1);return p==="!"||p==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),p)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(p){return r(String(p)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Ytt(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Ofe.isNode(e.contents)){let s={};Jtt.visit(e.contents,(p,d)=>{Ofe.isNode(d)&&d.tag&&(s[d.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,p]of n)s==="!!"&&p==="tag:yaml.org,2002:"||(!e||i.some(d=>d.startsWith(p)))&&r.push(`%TAG ${s} ${p}`);return r.join(`
|
|
26
26
|
`)}};rw.defaultYaml={explicit:!1,version:"1.2"};rw.defaultTags={"!!":"tag:yaml.org,2002:"};Efe.Directives=rw});var K6=x(nw=>{"use strict";var wfe=sn(),Wtt=tw();function Qtt(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}l(Qtt,"anchorIsValid");function Tfe(t){let e=new Set;return Wtt.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}l(Tfe,"anchorNames");function Sfe(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}l(Sfe,"findNewAnchor");function Xtt(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i||(i=Tfe(t));let p=Sfe(e,i);return i.add(p),p},setAnchors:()=>{for(let s of r){let p=n.get(s);if(typeof p=="object"&&p.anchor&&(wfe.isScalar(p.node)||wfe.isCollection(p.node)))p.node.anchor=p.anchor;else{let d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=s,d}}},sourceObjects:n}}l(Xtt,"createNodeAnchors");nw.anchorIsValid=Qtt;nw.anchorNames=Tfe;nw.createNodeAnchors=Xtt;nw.findNewAnchor=Sfe});var OM=x(Afe=>{"use strict";function iw(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let p=n[i],d=iw(t,n,String(i),p);d===void 0?delete n[i]:d!==p&&(n[i]=d)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),p=iw(t,n,i,s);p===void 0?n.delete(i):p!==s&&n.set(i,p)}else if(n instanceof Set)for(let i of Array.from(n)){let s=iw(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let p=iw(t,n,i,s);p===void 0?delete n[i]:p!==s&&(n[i]=p)}return t.call(e,r,n)}l(iw,"applyReviver");Afe.applyReviver=iw});var Bf=x(xfe=>{"use strict";var Ztt=sn();function Pfe(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Pfe(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Ztt.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}l(Pfe,"toJS");xfe.toJS=Pfe});var Y6=x(kfe=>{"use strict";var ert=OM(),Cfe=sn(),trt=Bf(),EM=class{static{l(this,"NodeBase")}constructor(e){Object.defineProperty(this,Cfe.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!Cfe.isDocument(e))throw new TypeError("A document argument is required");let p={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},d=trt.toJS(this,"",p);if(typeof i=="function")for(let{count:f,res:a}of p.anchors.values())i(a,f);return typeof s=="function"?ert.applyReviver(s,{"":d},"",d):d}};kfe.NodeBase=EM});var ow=x(Nfe=>{"use strict";var rrt=K6(),Rfe=tw(),W6=sn(),nrt=Y6(),irt=Bf(),wM=class extends nrt.NodeBase{static{l(this,"Alias")}constructor(e){super(W6.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let r;return Rfe.visit(e,{Node:(n,i)=>{if(i===this)return Rfe.visit.BREAK;i.anchor===this.source&&(r=i)}}),r}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,p=this.resolve(i);if(!p){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let d=n.get(p);if(d||(irt.toJS(p,null,r),d=n.get(p)),!d||d.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Q6(i,p,n)),d.count*d.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return d.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(rrt.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function Q6(t,e,r){if(W6.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(W6.isCollection(e)){let n=0;for(let i of e.items){let s=Q6(t,i,r);s>n&&(n=s)}return n}else if(W6.isPair(e)){let n=Q6(t,e.key,r),i=Q6(t,e.value,r);return Math.max(n,i)}return 1}l(Q6,"getAliasCount");Nfe.Alias=wM});var Di=x(TM=>{"use strict";var ort=sn(),art=Y6(),srt=Bf(),lrt=l(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),Vf=class extends art.NodeBase{static{l(this,"Scalar")}constructor(e){super(ort.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:srt.toJS(this.value,e,r)}toString(){return String(this.value)}};Vf.BLOCK_FOLDED="BLOCK_FOLDED";Vf.BLOCK_LITERAL="BLOCK_LITERAL";Vf.PLAIN="PLAIN";Vf.QUOTE_DOUBLE="QUOTE_DOUBLE";Vf.QUOTE_SINGLE="QUOTE_SINGLE";TM.Scalar=Vf;TM.isScalarValue=lrt});var aw=x(Ife=>{"use strict";var urt=ow(),ty=sn(),Dfe=Di(),crt="tag:yaml.org,2002:";function prt(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}l(prt,"findTagObject");function drt(t,e,r){if(ty.isDocument(t)&&(t=t.contents),ty.isNode(t))return t;if(ty.isPair(t)){let o=r.schema[ty.MAP].createNode?.(r.schema,null,r);return o.items.push(t),o}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:p,sourceObjects:d}=r,f;if(n&&t&&typeof t=="object"){if(f=d.get(t),f)return f.anchor||(f.anchor=i(t)),new urt.Alias(f.anchor);f={anchor:null,node:null},d.set(t,f)}e?.startsWith("!!")&&(e=crt+e.slice(2));let a=prt(t,e,p.tags);if(!a){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let o=new Dfe.Scalar(t);return f&&(f.node=o),o}a=t instanceof Map?p[ty.MAP]:Symbol.iterator in Object(t)?p[ty.SEQ]:p[ty.MAP]}s&&(s(a),delete r.onTagObj);let u=a?.createNode?a.createNode(r.schema,t,r):typeof a?.nodeClass?.from=="function"?a.nodeClass.from(r.schema,t,r):new Dfe.Scalar(t);return e?u.tag=e:a.default||(u.tag=a.tag),f&&(f.node=u),u}l(drt,"createNode");Ife.createNode=drt});var sw=x(Z6=>{"use strict";var frt=aw(),Dc=sn(),hrt=Y6();function SM(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let p=[];p[s]=n,n=p}else n=new Map([[s,n]])}return frt.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}l(SM,"collectionFromPath");var jfe=l(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),X6=class extends hrt.NodeBase{static{l(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Dc.isNode(n)||Dc.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(jfe(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Dc.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,SM(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Dc.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Dc.isScalar(s)?s.value:s:Dc.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Dc.isPair(r))return!1;let n=r.value;return n==null||e&&Dc.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Dc.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Dc.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,SM(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};X6.maxFlowStringSingleLineLength=60;Z6.Collection=X6;Z6.collectionFromPath=SM;Z6.isEmptyPath=jfe});var lw=x(ex=>{"use strict";var mrt=l(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function AM(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}l(AM,"indentComment");var grt=l((t,e,r)=>t.endsWith(`
|
|
27
27
|
`)?AM(r,e):r.includes(`
|
|
28
28
|
`)?`
|
package/index.minified.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
"use strict";var qFr=Object.create;var z9=Object.defineProperty;var UFr=Object.getOwnPropertyDescriptor;var $Fr=Object.getOwnPropertyNames;var VFr=Object.getPrototypeOf,HFr=Object.prototype.hasOwnProperty;var a=(e,t)=>z9(e,"name",{value:t,configurable:!0});var Kr=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Gx=(e,t)=>{for(var r in t)z9(e,r,{get:t[r],enumerable:!0})},eat=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $Fr(t))!HFr.call(e,i)&&i!==r&&z9(e,i,{get:()=>t[i],enumerable:!(n=UFr(t,i))||n.enumerable});return e};var Qm=(e,t,r)=>(r=e!=null?qFr(VFr(e)):{},eat(t||!e||!e.__esModule?z9(r,"default",{value:e,enumerable:!0}):r,e)),Tt=e=>eat(z9({},"__esModule",{value:!0}),e);var tat=E((Njo,GFr)=>{GFr.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var nat=E((Djo,QK)=>{var zFr=require("fs"),rat=require("path"),KFr=require("os"),WFr=tat(),YFr=WFr.version,JFr=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function QFr(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
26
26
|
`);let n;for(;(n=JFr.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let u=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),u==='"'&&(o=o.replace(/\\n/g,`
|
|
27
|
-
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}a(QFr,"parse");function j1e(e){console.log(`[dotenv@${YFr}][DEBUG] ${e}`)}a(j1e,"_log");function XFr(e){return e[0]==="~"?rat.join(KFr.homedir(),e.slice(1)):e}a(XFr,"_resolveHome");function ZFr(e){let t=rat.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(t=XFr(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=JK.parse(zFr.readFileSync(t,{encoding:r}));return Object.keys(o).forEach(function(u){Object.prototype.hasOwnProperty.call(process.env,u)?(i===!0&&(process.env[u]=o[u]),n&&j1e(i===!0?`"${u}" is already defined in \`process.env\` and WAS overwritten`:`"${u}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[u]=o[u]}),{parsed:o}}catch(o){return n&&j1e(`Failed to load ${t} ${o.message}`),{error:o}}}a(ZFr,"config");var JK={config:ZFr,parse:QFr};QK.exports.config=JK.config;QK.exports.parse=JK.parse;QK.exports=JK});var Kc=E(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.EnvironmentalVariableRequiredError=eT.getRequiredEnvVar=void 0;var q1e=class{static{a(this,"Environment")}get LOG_LEVEL(){return process.env.LOG_LEVEL??"info"}get LOG_FORMAT(){return process.env.LOG_FORMAT??"pretty"}get NODE_ENV(){return process.env.NODE_ENV}get USE_LOCAL_API_SERVER(){return process.env.USE_LOCAL_API_SERVER==="true"}get USE_MONOREPO_PACKAGES(){return process.env.USE_MONOREPO_PACKAGES==="true"}get GCP_STORAGE_BUNDLE_BUCKET_NAME(){return process.env.GCP_STORAGE_BUNDLE_BUCKET_NAME}get GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME(){return process.env.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}get GCP_STORAGE_ARCHIVE_BUCKET_NAME(){return process.env.GCP_STORAGE_ARCHIVE_BUCKET_NAME}get GCP_STORAGE_SOURCE_CODE_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}get GCP_STORAGE_SOURCES_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCES_BUCKET_NAME}get ZUPLO_AUTH_API_JWT(){return process.env.ZUPLO_AUTH_API_JWT}get GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS(){return process.env.GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS}get RUNTIME_DENO_VERSION(){return process.env.RUNTIME_DENO_VERSION??"1.53.0"}get AUTH_API_URL(){return Ld("AUTH_API_URL","http://localhost:5201")}get MANAGEMENT_API_URL(){return Ld("MANAGEMENT_API_URL","http://localhost:3100")}get TENANT_API_URL(){return Ld("TENANT_API_URL","http://localhost:5100")}get CONTENT_API_URL(){return Ld("CONTENT_API_URL","http://localhost:5400")}get DEPLOYER_API_URL(){return Ld("DEPLOYER_API_URL","http://localhost:5300")}get DEV_API_URL(){return Ld("DEV_API_URL","http://localhost:5200")}get API_KEY_SERVICE_URL(){return Ld("API_KEY_SERVICE_URL","https://apikey.zuplo.com")}get API_KEY_MANAGEMENT_SERVICE_URL(){return Ld("API_KEY_MANAGEMENT_SERVICE_URL","https://api-key-management-service-rreeuhlsca-ue.a.run.app")}get METERING_SERVICE_URL(){return Ld("METERING_SERVICE_URL","https://meters.zuplo.com")}get FETCH_PROXY_URL(){return process.env.FETCH_PROXY_URL||"https://proxy-main-04e55cb.zuplo.app"}get FETCH_PROXY_API_KEY(){return process.env.FETCH_PROXY_API_KEY||"zpk_123"}get LOG_EVENT_API_URL(){return process.env.LOG_EVENT_API_URL}get LAUNCH_DARKLY_SERVER_KEY(){return process.env.LAUNCH_DARKLY_SERVER_KEY}get REMOTE_LOGGING_SHARED_SECRET(){return process.env.REMOTE_LOGGING_SHARED_SECRET??"the-logging-shared-secret"}get TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT(){return process.env.TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT??"10.142.0.64:5000"}get DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME(){return process.env.DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME??"zpl-developer-api"}get __ZUPLO_AUTH_API_JWT(){return process.env.__ZUPLO_AUTH_API_JWT??void 0}get BUILD_ASSETS_BUCKET_NAME(){return process.env.BUILD_ASSETS_BUCKET_NAME}get BUILD_ASSETS_S3_ENDPOINT(){return process.env.BUILD_ASSETS_S3_ENDPOINT}get BUILD_ASSETS_ACCESS_KEY_ID(){return process.env.BUILD_ASSETS_ACCESS_KEY_ID}get BUILD_ASSETS_SECRET_ACCESS_KEY(){return process.env.BUILD_ASSETS_SECRET_ACCESS_KEY}get DEV_PORTAL_ENCRYPTION_SECRET(){if(!process.env.DEV_PORTAL_ENCRYPTION_SECRET)throw new K9("DEV_PORTAL_ENCRYPTION_SECRET");return process.env.DEV_PORTAL_ENCRYPTION_SECRET}isProduction(){return this.NODE_ENV==="production"}get OPENFGA_SERVICE_URL(){return Ld("OPENFGA_SERVICE_URL","https://openfga-eq7z4lly2a-ue.a.run.app")}get OPENFGA_STORE_ID(){return process.env.OPENFGA_STORE_ID??""}get OPENFGA_MODEL_ID(){return process.env.OPENFGA_MODEL_ID??""}GCP_PROJECT_ID(){return Ld("GCP_PROJECT_ID")}GCP_TASK_QUEUE_LOCATION(){return Ld("GCP_TASK_QUEUE_LOCATION")}GCP_TASK_QUEUE_NAME(){return Ld("GCP_TASK_QUEUE_NAME")}};function Ld(e,t){let r=process.env[e];if(r===void 0&&(t===void 0||process.env.NODE_ENV==="production"))throw new K9(e);return r??t}a(Ld,"getRequiredEnvVar");eT.getRequiredEnvVar=Ld;var K9=class extends Error{static{a(this,"EnvironmentalVariableRequiredError")}constructor(t){super(`The environmental variable '${t}' is required.'`)}};eT.EnvironmentalVariableRequiredError=K9;var eMr=new q1e;eT.default=eMr});var U1e=E(XK=>{"use strict";Object.defineProperty(XK,"__esModule",{value:!0});XK.HttpStatusCode=void 0;var iat;(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"})(iat||(XK.HttpStatusCode=iat={}))});var oat=E(ZK=>{"use strict";Object.defineProperty(ZK,"__esModule",{value:!0});ZK.getSourceControlProviderLabel=void 0;function tMr(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}a(tMr,"getSourceControlProviderLabel");ZK.getSourceControlProviderLabel=tMr});var sat=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.DEPLOYMENT_INVALID_MULTI_PART=te.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=te.DEPLOYMENT_FILE_DOES_NOT_EXISTS=te.DEPLOYMENT_NOT_FOUND=te.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=te.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=te.DEPLOYMENT_NO_ACCESS=te.INVALID_SOURCE_REPO_URL=te.INVALID_EMAIL_FORMAT=te.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=te.PROJECT_MUST_HAVE_ONE_MEMBER=te.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=te.PROJECT_MEMBER_ALREADY_EXISTS=te.PROJECT_MEMBER_NOT_FOUND=te.INVALID_TEMPLATE_REPOSITORY=te.INCORRECT_PROJECT_TEMPLATE=te.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=te.PROJECT_NOT_FOUND=te.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=te.PROJECT_SHARING_DISABLED_ON_ACCOUNT=te.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=te.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=te.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=te.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=te.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=te.ACCOUNT_MEMBER_INVITE_INVALID=te.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=te.ACCOUNT_MEMBER_DOES_NOT_EXIST=te.ACCOUNT_MEMBER_INFO_MISSING=te.ACCOUNT_MEMBER_ALREADY_EXISTS=te.ACCOUNT_UPDATE_INFO_MISSING=te.ACCOUNT_INFO_MISSING=te.ACCOUNT_DOES_NOT_EXISTS=te.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=te.ACCOUNT_NAME_USES_RESERVED_KEYWORD=te.ACCOUNT_ALREADY_EXISTS=te.ACCOUNT_NOT_FOUND=te.USER_IS_NOT_SERVICE_ACCOUNT=te.USER_REMOVE_NOT_MEMBER_ACCOUNT=te.USER_HAS_NO_ACCESS_TO_ACCOUNT=te.USER_DETAILS_CANNOT_BE_FOUND=te.USER_ALREADY_EXISTS=te.CLIENT_NOT_FOUND=te.FORBIDDEN=te.UNAUTHORIZED=te.METHOD_NOT_ALLOWED=te.NOT_FOUND=te.CONFLICT=te.BAD_REQUEST=te.INTERNAL_SERVER_ERROR=void 0;te.GITHUB_INTEGRATION_DUPLICATE_REPO=te.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=te.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=te.GITHUB_INTEGRATION_BRANCH_BEHIND=te.GITHUB_INTEGRATION_NOT_FOUND=te.GITHUB_REPOSITORY_NOT_FOUND=te.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=te.GITHUB_INTEGRATION_ALREADY_EXISTS=te.FEATURE_FLAGS_NOT_FOUND=te.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=te.PROJECT_ALREADY_HAS_REPO=te.PROJECT_INVALID_NAME=te.FAILED_TO_REVOKE_GH_TOKEN=te.USER_ACCOUNT_NOT_FS_MIGRATED=te.USER_NO_ACCESS_GITLAB_REPO=te.USER_NO_ACCESS_BITBUCKET_REPO=te.GITHUB_APP_CONFIGURATION_NOT_FOUND=te.GITHUB_APP_NO_USER_ACCESS_=te.GITHUB_APP_NO_NAMESPACE_ACCESS=te.GENERIC_GITHUB_BRANCH_INFO_ERROR=te.GITHUB_USER_NO_READ_ACCESS_REPO=te.USER_NO_PULL_ACCESS_GITHUB_REPO=te.USER_NO_ACCESS_GITHUB_REPO=te.PROJECT_SHARING_REQUIRES_GIT_REPO=te.PROJECT_INVALID_GIT_REPO=te.PROJECT_INVALID_GIT_CLONE=te.USER_IS_PROJECT_MEMBER=te.USER_HAS_NO_ACCESS_TO_PROJECT=te.RUNTIME_FLAG_KEY_NOT_VALID=te.RUNTIME_FLAG_NOT_FOUND=te.RUNTIME_FLAG_ALREADY_EXISTS=te.PROJECT_NO_MEMBERS=te.PROJECT_ALREADY_EXISTS=te.SERVICE_CONFIGURATION_FAILED_DECRYPTION=te.WORKING_COPY_SERVICE_NOT_CREATED=te.WORKING_COPY_SERVICE_NOT_DELETED=te.WORKING_COPY_SERVICE_NOT_FOUND=te.SERVICE_CONFIGURATION_NOT_FOUND=te.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=te.DEPLOYMENT_INCORRECT_STATUS_PAUSE=te.DEPLOYMENT_NOT_WORKING_COPY=te.DEPLOYMENT_LOG_NOT_FOUND=te.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=te.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=te.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=te.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=te.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=te.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=te.DEPLOYMENT_DELETE_ERROR=te.DEPLOYMENT_CANNOT_DELETE_INSTANCE=void 0;te.TARGET_BRANCH_ONLY_FOR_PREVIEW=te.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=te.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=te.DEPLOYMENT_NAME_MISSING=te.NON_EXISTENT_ENVIRONMENT_VARIABLE=te.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=te.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=te.DUPLICATE_ENVIRONMENT_VARIABLE=te.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=te.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=te.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=te.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=te.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=te.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=te.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=te.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=te.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=te.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=te.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=te.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=te.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=te.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=te.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=te.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=te.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=te.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=te.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=te.SOURCE_CONTROL_REPO_OPERATION_ERROR=te.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=te.SOURCE_CONTROL_REPO_NOT_FOUND=te.SOURCE_CONTROL_AUTHENTICATION_FAILED=te.EXTERNAL_SERVICE_GENERIC_ERROR=te.API_USER_NO_ACCESS=te.EXTERNAL_USER_NOT_CONFIGURED=te.EXTERNAL_USER_NO_ACCESS=te.CONSUMER_DOES_NOT_EXIST=te.CONSUMER_NO_ACCESS=te.GITLAB_ACCESS_LEVEL_CHECK_FAIL=te.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=te.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=te.GITLAB_DUPLICATE_REPO=te.GITLAB_FAILED_DURING_REPO_CREATION=te.GITLAB_QUERY_USER_INFO_FAILED=te.BITBUCKET_FAILED_DURING_REPO_CREATION=te.BITBUCKET_WORKSPACE_MISCONFIGURATION=te.BITBUCKET_QUERY_USER_INFO_FAILED=te.GITHUB_INTEGRATION_INVALID_REPO=te.GIT_CREATE_PROJECT_WITH_INVALID_REPO=te.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=te.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=void 0;te.METERING_BUCKET_CREATION_FAILED=te.UNABLE_UPGRADE_PLAN=te.BUCKET_NOT_FOUND=te.BUCKET_API_KEY_SERVICE_CONFLICT=te.DIRECTORY_DELETE_FAILED=te.FILE_DELETE_FAILED=te.CANNOT_DELETE_SOLE_OPEN_API_FILE=te.CANNOT_DELETE_ESSENTIAL_DIRECTORY=te.CANNOT_DELETE_ESSENTIAL_FILE=te.FILE_WRITE_FAILED=te.FILE_RENAME_FAILED=te.FILE_RENAME_FILE_ALREADY_EXISTS=te.FILE_RENAME_CANNOT_CHANGE_EXTENSION=te.FILE_RENAME_PATHS_MATCH=te.DIRECTORY_CREATION_FAILED=te.DIRECTORY_OR_FILE_DOES_NOT_EXIST=te.DIRECTORY_DOES_NOT_EXIST=te.DIRECTORY_ALREADY_EXISTS=te.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=te.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=te.FAILED_DOWNLOAD_FROM_STORAGE=te.CANNOT_FIND_SRC_DIRECTORY=te.CANNOT_READ_PACKAGE_JSON=te.PACKAGE_JSON_NOT_FOUND=te.RUNTIME_VERSION_INCORRECT_FORMAT=te.MIGRATIONS_ONLY_ON_WORKING_COPY=te.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=te.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=te.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=te.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=te.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=te.NO_GLOBAL_SYMBOLS=te.NO_ZUPLO_PREFIXED_VARIABLES=te.NON_EMPTY_TARGETS_REQUIRED=te.CONFLICTING_TYPES=te.OVERLAPPING_TARGETS=te.INVALID_BRANCH_NAME=void 0;var Ve=U1e(),aat=oat(),rMr="https://github.com/apps/zuplo/installations/new";te.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:Ve.HttpStatusCode.BAD_REQUEST};te.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:Ve.HttpStatusCode.CONFLICT};te.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:Ve.HttpStatusCode.NOT_FOUND};te.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:Ve.HttpStatusCode.METHOD_NOT_ALLOWED};te.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:Ve.HttpStatusCode.UNAUTHORIZED};te.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:Ve.HttpStatusCode.FORBIDDEN};te.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:Ve.HttpStatusCode.NOT_FOUND};te.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:Ve.HttpStatusCode.CONFLICT};te.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:Ve.HttpStatusCode.UNAUTHORIZED};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:Ve.HttpStatusCode.CONFLICT};te.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:Ve.HttpStatusCode.FORBIDDEN};te.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:Ve.HttpStatusCode.NOT_FOUND};te.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.FORBIDDEN};te.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:Ve.HttpStatusCode.BAD_REQUEST};var nMr=a(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:Ve.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");te.INVALID_TEMPLATE_REPOSITORY=nMr;te.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:Ve.HttpStatusCode.NOT_FOUND};te.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:Ve.HttpStatusCode.BAD_REQUEST};te.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:Ve.HttpStatusCode.BAD_REQUEST};te.INVALID_EMAIL_FORMAT={type:"https://zup.fail/invalid-email-format",title:"The email address provided is in an invalid email format",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};te.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.FORBIDDEN};te.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:Ve.HttpStatusCode.BAD_REQUEST};te.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:Ve.HttpStatusCode.NOT_FOUND};te.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:Ve.HttpStatusCode.NOT_FOUND};te.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:Ve.HttpStatusCode.BAD_REQUEST};te.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:Ve.HttpStatusCode.BAD_REQUEST};te.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:Ve.HttpStatusCode.NOT_FOUND};te.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:Ve.HttpStatusCode.BAD_REQUEST};te.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:Ve.HttpStatusCode.NOT_FOUND};te.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:Ve.HttpStatusCode.BAD_REQUEST};te.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:Ve.HttpStatusCode.FORBIDDEN};te.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};var iMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");te.USER_NO_ACCESS_GITHUB_REPO=iMr;var oMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");te.USER_NO_PULL_ACCESS_GITHUB_REPO=oMr;var aMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");te.GITHUB_USER_NO_READ_ACCESS_REPO=aMr;te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.FORBIDDEN};var sMr=a(({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 '${rMr}' to add the repository.`,status:Ve.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");te.GITHUB_APP_NO_USER_ACCESS_=sMr;te.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:Ve.HttpStatusCode.NOT_FOUND};var lMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");te.USER_NO_ACCESS_BITBUCKET_REPO=lMr;var uMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");te.USER_NO_ACCESS_GITLAB_REPO=uMr;te.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:Ve.HttpStatusCode.FORBIDDEN};te.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:Ve.HttpStatusCode.BAD_REQUEST};var cMr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:Ve.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");te.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=cMr;var dMr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:Ve.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");te.GITHUB_REPOSITORY_NOT_FOUND=dMr;te.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:Ve.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};var pMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");te.GITHUB_INTEGRATION_DUPLICATE_REPO=pMr;var fMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");te.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=fMr;var hMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");te.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=hMr;var mMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");te.GIT_CREATE_PROJECT_WITH_INVALID_REPO=mMr;var gMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");te.GITHUB_INTEGRATION_INVALID_REPO=gMr;te.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:Ve.HttpStatusCode.FORBIDDEN};te.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:Ve.HttpStatusCode.FORBIDDEN};var yMr=a(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:Ve.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");te.BITBUCKET_FAILED_DURING_REPO_CREATION=yMr;te.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:Ve.HttpStatusCode.FORBIDDEN};var vMr=a(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");te.GITLAB_FAILED_DURING_REPO_CREATION=vMr;var bMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");te.GITLAB_DUPLICATE_REPO=bMr;var EMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");te.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=EMr;var _Mr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");te.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=_Mr;var SMr=a(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");te.GITLAB_ACCESS_LEVEL_CHECK_FAIL=SMr;te.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:Ve.HttpStatusCode.UNAUTHORIZED};te.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:Ve.HttpStatusCode.NOT_FOUND};te.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:Ve.HttpStatusCode.UNAUTHORIZED};te.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:Ve.HttpStatusCode.FORBIDDEN};te.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:Ve.HttpStatusCode.FORBIDDEN};te.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};var wMr=a(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,aat.getSourceControlProviderLabel)(e)}`,status:Ve.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");te.SOURCE_CONTROL_AUTHENTICATION_FAILED=wMr;var OMr=a(({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,aat.getSourceControlProviderLabel)(e)} repository`,status:Ve.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");te.SOURCE_CONTROL_REPO_NOT_FOUND=OMr;te.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:Ve.HttpStatusCode.BAD_REQUEST};var TMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");te.SOURCE_CONTROL_REPO_OPERATION_ERROR=TMr;te.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:Ve.HttpStatusCode.FORBIDDEN};te.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.UNAUTHORIZED};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:Ve.HttpStatusCode.FAILED_DEPENDENCY};te.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:Ve.HttpStatusCode.FAILED_DEPENDENCY};te.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:Ve.HttpStatusCode.FAILED_DEPENDENCY};te.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:Ve.HttpStatusCode.BAD_REQUEST};te.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:Ve.HttpStatusCode.BAD_REQUEST};te.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:Ve.HttpStatusCode.BAD_REQUEST};te.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.FORBIDDEN};te.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:Ve.HttpStatusCode.NOT_FOUND};var AMr=a(({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:Ve.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");te.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=AMr;var CMr=a(()=>({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:Ve.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");te.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=CMr;te.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:Ve.HttpStatusCode.BAD_REQUEST};te.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:Ve.HttpStatusCode.NOT_FOUND};te.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:Ve.HttpStatusCode.BAD_REQUEST};te.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:Ve.HttpStatusCode.BAD_REQUEST};te.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:Ve.HttpStatusCode.BAD_REQUEST};var PMr=a(({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:Ve.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");te.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=PMr;var xMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");te.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=xMr;var kMr=a(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");te.DIRECTORY_ALREADY_EXISTS=kMr;var RMr=a(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");te.DIRECTORY_DOES_NOT_EXIST=RMr;var NMr=a(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");te.DIRECTORY_OR_FILE_DOES_NOT_EXIST=NMr;var DMr=a(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");te.DIRECTORY_CREATION_FAILED=DMr;var IMr=a(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:Ve.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");te.FILE_RENAME_PATHS_MATCH=IMr;var LMr=a(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");te.FILE_RENAME_CANNOT_CHANGE_EXTENSION=LMr;var FMr=a(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:Ve.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");te.FILE_RENAME_FILE_ALREADY_EXISTS=FMr;var MMr=a(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");te.FILE_RENAME_FAILED=MMr;var BMr=a(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");te.FILE_WRITE_FAILED=BMr;var jMr=a(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");te.CANNOT_DELETE_ESSENTIAL_FILE=jMr;var qMr=a(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");te.CANNOT_DELETE_ESSENTIAL_DIRECTORY=qMr;var UMr=a(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");te.CANNOT_DELETE_SOLE_OPEN_API_FILE=UMr;var $Mr=a(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");te.FILE_DELETE_FAILED=$Mr;var VMr=a(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");te.DIRECTORY_DELETE_FAILED=VMr;te.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:Ve.HttpStatusCode.CONFLICT};te.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:Ve.HttpStatusCode.BAD_REQUEST};te.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR}});var uat=E(Fd=>{"use strict";var HMr=Fd&&Fd.__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]}),GMr=Fd&&Fd.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zMr=Fd&&Fd.__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)&&HMr(t,e,r);return GMr(t,e),t};Object.defineProperty(Fd,"__esModule",{value:!0});Fd.ApiNotFoundError=Fd.ApiError=Fd.Problems=void 0;var lat=zMr(sat());Fd.Problems=lat;var eW=class extends Error{static{a(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}};Fd.ApiError=eW;var $1e=class extends eW{static{a(this,"ApiNotFoundError")}constructor(t={}){super({...t,...lat.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};Fd.ApiNotFoundError=$1e});var Md=E(N1=>{"use strict";var KMr=N1&&N1.__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]}),WMr=N1&&N1.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&KMr(t,e,r)};Object.defineProperty(N1,"__esModule",{value:!0});N1.HttpStatusCode=void 0;WMr(uat(),N1);var YMr=U1e();Object.defineProperty(N1,"HttpStatusCode",{enumerable:!0,get:function(){return YMr.HttpStatusCode}})});var H1e=E(tW=>{"use strict";Object.defineProperty(tW,"__esModule",{value:!0});tW.CommonAuth=void 0;var JE=Md(),JMr=["google-oauth2|106231436550039770264","google-oauth2|113609898431445637338","google-oauth2|115413213714061429608","google-oauth2|105283806895031006146","google-oauth2|116604562105669742663"],V1e=class e{static{a(this,"CommonAuth")}static DEPLOYER_USER_SUB="deployer-app@zuplo";isZuploAdmin(t){return JMr.includes(t)}isDeployerServiceAccount(t){return e.DEPLOYER_USER_SUB===t}static isAuthorizedSub(t,r){if(typeof r=="string")throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS);if(r instanceof Buffer)throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS);try{if(!t.includes(r.sub))throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS)}catch{throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS)}}};tW.CommonAuth=V1e});var cat=E(rW=>{"use strict";Object.defineProperty(rW,"__esModule",{value:!0});rW.hasBlockedNotifications=void 0;var QMr=["chocolate_bold_silverfish"];function XMr(e){return QMr.includes(e)}a(XMr,"hasBlockedNotifications");rW.hasBlockedNotifications=XMr});var z1e=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.BuildIssueError=Bd.WARNING_SEVERITY=Bd.ERROR_SEVERITY=Bd.FAILURE_STATUS=Bd.WARNING_STATUS=Bd.GOOD_STATUS=void 0;Bd.GOOD_STATUS="Good";Bd.WARNING_STATUS="Warnings";Bd.FAILURE_STATUS="Failed";Bd.ERROR_SEVERITY="error";Bd.WARNING_SEVERITY="warning";var G1e=class extends Error{static{a(this,"BuildIssueError")}issue;constructor(t){super(t.message),this.issue=t}};Bd.BuildIssueError=G1e});var dat=E(nW=>{"use strict";Object.defineProperty(nW,"__esModule",{value:!0});nW.COMPATIBILITY_FLAG_MAPPINGS=void 0;nW.COMPATIBILITY_FLAG_MAPPINGS=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}})});var pat=E((Xjo,ZMr)=>{ZMr.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/zuplo.config.json",title:"Zuplo Config",description:"",type:"object",required:[],additionalProperties:!1,properties:{version:{description:"The version of the configuration",type:"number",enum:[1]},project:{type:"string"},compatibilityDate:{description:"The compatibility date on which to run the gateway",type:"string",title:"Compatibility Date",default:"2024-01-15",enum:["2023-03-14","2024-01-15"]}}}});var fat=E(iW=>{"use strict";Object.defineProperty(iW,"__esModule",{value:!0});iW.VALID_COMPATIBILITY_DATES=void 0;iW.VALID_COMPATIBILITY_DATES=Object.freeze(["2023-03-14","2024-01-15"])});var hat=E(QE=>{"use strict";var eBr=QE&&QE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(QE,"__esModule",{value:!0});QE.DEFAULT_COMPATIBILITY_DATE=QE.VALID_COMPATIBILITY_DATES=void 0;var tBr=eBr(pat()),rBr=fat();Object.defineProperty(QE,"VALID_COMPATIBILITY_DATES",{enumerable:!0,get:function(){return rBr.VALID_COMPATIBILITY_DATES}});QE.DEFAULT_COMPATIBILITY_DATE=tBr.default.properties.compatibilityDate.default});var mat=E(oW=>{"use strict";Object.defineProperty(oW,"__esModule",{value:!0});oW.FeatureFlags=void 0;oW.FeatureFlags=Object.freeze({esmWorker:(e,t)=>({flagName:"ZUPLO_ESM_WORKER",defaultValue:!1,accountName:e,projectName:t}),FS_ACCOUNT_NAME_PATH:"FS_ACCOUNT_NAME_PATH"})});var gat=E(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.decrypt=XE.encrypt=XE.signString=void 0;var zx=require("crypto");function nBr(e,t){return(0,zx.createHmac)("sha256",t).update(e).digest("hex")}a(nBr,"signString");XE.signString=nBr;var K1e={AUTH_TAG_BYTE_LEN:16,IV_BYTE_LEN:12},iBr=a(()=>(0,zx.randomBytes)(K1e.IV_BYTE_LEN),"getIV");function oBr(e,t){if(e===null)return null;let r=(0,zx.createHash)("sha256").update(String(t)).digest("base64").substring(0,32),n=iBr(),i=(0,zx.createCipheriv)("aes-256-gcm",r,n,{authTagLength:K1e.AUTH_TAG_BYTE_LEN}),o=i.update(e);return o=Buffer.concat([o,i.final()]),Buffer.concat([n,o,i.getAuthTag()]).toString("hex")}a(oBr,"encrypt");XE.encrypt=oBr;function aBr(e,t){if(!e)return null;let r=Buffer.from(t),n=(0,zx.createHash)("sha256").update(String(r)).digest("base64").substring(0,32),i=Buffer.from(e,"hex"),o=i.slice(-16),u=i.slice(0,12),d=i.slice(12,-16),p=(0,zx.createDecipheriv)("aes-256-gcm",n,u,{authTagLength:K1e.AUTH_TAG_BYTE_LEN});p.setAuthTag(o);let s=p.update(d);return Buffer.concat([s,p.final()]).toString("utf-8")}a(aBr,"decrypt");XE.decrypt=aBr});var yat=E(aW=>{"use strict";Object.defineProperty(aW,"__esModule",{value:!0});aW.getCurrentUtcDateTime=void 0;function sBr(){let e={year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0,timeZone:"UTC"};return new Date().toLocaleString("en-US",e)}a(sBr,"getCurrentUtcDateTime");aW.getCurrentUtcDateTime=sBr});var W1e=E(sW=>{"use strict";Object.defineProperty(sW,"__esModule",{value:!0});sW.DeploymentLogState=void 0;var vat;(function(e){e.ERROR="ERROR",e.IN_PROGRESS="IN_PROGRESS",e.SUCCESS="SUCCESS"})(vat||(sW.DeploymentLogState=vat={}))});var Y1e=E(bat=>{"use strict";Object.defineProperty(bat,"__esModule",{value:!0})});var _at=E(Eat=>{"use strict";Object.defineProperty(Eat,"__esModule",{value:!0})});var Sat=E(lW=>{"use strict";Object.defineProperty(lW,"__esModule",{value:!0});lW.MARKDOWN_FRONTMATTER_KEYS=void 0;lW.MARKDOWN_FRONTMATTER_KEYS=["sidebar_label"]});var Oat=E(wat=>{"use strict";Object.defineProperty(wat,"__esModule",{value:!0})});var Tat=E(Ny=>{"use strict";var lBr=Ny&&Ny.__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]}),uW=Ny&&Ny.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&lBr(t,e,r)};Object.defineProperty(Ny,"__esModule",{value:!0});uW(Y1e(),Ny);uW(_at(),Ny);uW(Sat(),Ny);uW(Oat(),Ny)});var cW=E(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.getLoggerContext=Dy.requestIdGenerator=Dy.REQUEST_ID_HEADER=Dy.LEGACY_REQUEST_ID_HEADER=void 0;var uBr=require("crypto");Dy.LEGACY_REQUEST_ID_HEADER="zuplo-request-id";Dy.REQUEST_ID_HEADER="zp-rid";var cBr=a(e=>{let t=e.headers["zuplo-request-id"],r=e.headers["X-GitHub-Delivery"];return t?`${t}`:r?`${r}`:(0,uBr.randomUUID)()},"requestIdGenerator");Dy.requestIdGenerator=cBr;function dBr(e){let t=e.raw.url??"",r={};try{let n=e.headers["zuplo-user"]??e.user?.sub;n&&(r.userSub=`${n}`);let i=t.match(/(deployments)\/([a-zA-Z-0-9]*)/);i&&i!==null&&i.length>=2&&(r.deployment=i[2]);let o=t.match(/(accounts)\/([a-zA-Z-0-9]*)/);o&&o!==null&&o.length>=2&&(r.account=o[2]);let u=t.match(/(projects)\/([a-zA-Z-0-9]*)/);u&&u!==null&&u.length>=2&&(r.project=u[2])}catch{}return r}a(dBr,"getLoggerContext");Dy.getLoggerContext=dBr});var J1e=E(Kx=>{"use strict";var pBr=Kx&&Kx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kx,"__esModule",{value:!0});Kx.errorHandler=void 0;var Vf=Md(),fBr=pBr(Kc()),Aat=cW();function hBr(e,t,r){let n=500,i;if(e instanceof Vf.ApiError)n=e.status,i={type:e.type,title:e.message,status:e.status,detail:e.detail,instance:e.instance};else if(typeof e=="object"&&"validation"in e&&"validationContext"in e)n=Vf.HttpStatusCode.BAD_REQUEST,i={...Vf.Problems.BAD_REQUEST,detail:`An error occurred when validating the ${e.validationContext}.`,errors:e.validation};else if(typeof e=="object"&&"code"in e&&e.code==="FST_ERR_NOT_FOUND")n=404,i=Vf.Problems.NOT_FOUND;else if(typeof e=="object"&&"code"in e&&typeof e.code=="string"&&["FST_ERR_CTP_INVALID_TYPE","FST_ERR_CTP_EMPTY_TYPE","FST_ERR_CTP_BODY_TOO_LARGE","FST_ERR_CTP_INVALID_MEDIA_TYPE","FST_ERR_CTP_INVALID_CONTENT_LENGTH","FST_ERR_CTP_EMPTY_JSON_BODY","FST_ERR_BAD_URL","FST_ERR_INVALID_URL"].includes(e.code))n=Vf.HttpStatusCode.BAD_REQUEST,i={...Vf.Problems.BAD_REQUEST,detail:e.message};else{let u;!r.statusCode||r.statusCode===200?(typeof e=="object"&&"statusCode"in e&&typeof e.statusCode=="number"?u=e.statusCode:typeof e=="object"&&"status"in e&&typeof e.status=="number"&&(u=e.status),n=u&&u>=400?u:500):n=r.statusCode,i=mBr(n),fBr.default.NODE_ENV!=="production"&&(typeof e=="object"&&"message"in e?i.detail=e.message:typeof e=="string"&&(i.detail=e))}i.trace={timestamp:new Date().toJSON(),requestId:t.headers[Aat.REQUEST_ID_HEADER]??t.headers[Aat.LEGACY_REQUEST_ID_HEADER]},n<500?r.log.warn({res:r,err:e},e&&e.message):r.log.error({req:t,res:r,err:e},e&&e.message);let o=JSON.stringify(i,null,2);return r.status(n).header("content-type","application/json").send(o)}a(hBr,"errorHandler");Kx.errorHandler=hBr;function mBr(e){return e===401?Vf.Problems.UNAUTHORIZED:e===403?Vf.Problems.FORBIDDEN:e===404?Vf.Problems.NOT_FOUND:e===405?Vf.Problems.METHOD_NOT_ALLOWED:e<500&&e>=400?Vf.Problems.BAD_REQUEST:Vf.Problems.INTERNAL_SERVER_ERROR}a(mBr,"getProblemFromStatus")});var Pat=E((gqo,Q1e)=>{"use strict";var gBr=/at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/,yBr=/(\w*(\.\w*)*)\..*/;Q1e.exports=a(function(t){if(t.name.length>0)return t.name;let r=Error.stackTraceLimit;Error.stackTraceLimit=10;try{throw new Error("anonymous function")}catch(n){return Error.stackTraceLimit=r,Cat(n.stack)}},"getPluginName");function Cat(e){let t=e.match(gBr);return t?t[1].split(/[/\\]/).slice(-1)[0].match(yBr)[1]:"anonymous"}a(Cat,"extractPluginName");Q1e.exports.extractPluginName=Cat});var kat=E((vqo,xat)=>{"use strict";xat.exports=a(function(t){return t[0]==="@"&&(t=t.slice(1).replace("/","-")),t.replace(/-(.)/g,function(n,i){return i.toUpperCase()})},"toCamelCase")});var tT=E((Eqo,dW)=>{"use strict";var vBr=Pat(),bBr=kat(),EBr=0;function X1e(e,t={}){let r=!1;if(typeof e.default<"u"&&(e=e.default),typeof e!="function")throw new TypeError(`fastify-plugin expects a function, instead got a '${typeof e}'`);if(typeof t=="string"&&(t={fastify:t}),typeof t!="object"||Array.isArray(t)||t===null)throw new TypeError("The options object should be an object");if(t.fastify!==void 0&&typeof t.fastify!="string")throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof t.fastify}'`);t.name||(r=!0,t.name=vBr(e)+"-auto-"+EBr++),e[Symbol.for("skip-override")]=t.encapsulate!==!0,e[Symbol.for("fastify.display-name")]=t.name,e[Symbol.for("plugin-meta")]=t,e.default||(e.default=e);let n=bBr(t.name);return!r&&!e[n]&&(e[n]=e),e}a(X1e,"plugin");dW.exports=X1e;dW.exports.default=X1e;dW.exports.fastifyPlugin=X1e});var Nat=E(Wx=>{"use strict";var _Br=Wx&&Wx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wx,"__esModule",{value:!0});Wx.apiKeyAuthPlugin=void 0;var Iy=Md(),SBr=_Br(tT()),wBr="https://apikey.zuplo.com",Rat="Bearer ";Wx.apiKeyAuthPlugin=(0,SBr.default)(async(e,t)=>{e.decorate("validateApiKey",async function(r){let{authorization:n}=r.headers;if(!n)throw new Iy.ApiError({...Iy.Problems.UNAUTHORIZED,detail:"No Authorization Header"});if(!n.toLowerCase().startsWith(Rat))throw new Iy.ApiError({...Iy.Problems.UNAUTHORIZED,detail:"Invalid Authorization Scheme"});let i=n.substring(Rat.length);if(!i||i==="")throw new Iy.ApiError({...Iy.Problems.UNAUTHORIZED,detail:"No key present"});let o={key:i},u=await fetch(`${wBr}/v1/$validate/${t.bucketName}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)});if(u.status===401)throw new Iy.ApiError(Iy.Problems.UNAUTHORIZED);let d=await u.json();if(t.allowedSubs&&!t.allowedSubs.includes(d.name))throw new Iy.ApiError(Iy.Problems.UNAUTHORIZED);r.user={sub:d.name,metadata:d.metadata}})},{name:"api-key-auth"})});var Dat=E(Yx=>{"use strict";var OBr=Yx&&Yx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yx,"__esModule",{value:!0});Yx.ensureZuploAdminPlugin=void 0;var pW=Md(),TBr=OBr(tT()),ABr=H1e();Yx.ensureZuploAdminPlugin=(0,TBr.default)(async function(e){let t=new ABr.CommonAuth;e.decorate("ensureZuploAdmin",async function(r){if(!r.user)throw r.log.error("Bad request, no user on request"),new pW.ApiError(pW.Problems.UNAUTHORIZED);let n=r.user.sub;if(!(n&&t.isZuploAdmin(n)))throw r.log.error("User is not an admin"),new pW.ApiError(pW.Problems.FORBIDDEN)})},{name:"ensure-zuplo-admin-plugin"})});var Lat=E(Jx=>{"use strict";var CBr=Jx&&Jx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jx,"__esModule",{value:!0});Jx.ensureZuploUserPlugin=void 0;var Iat=Md(),PBr=CBr(tT());Jx.ensureZuploUserPlugin=(0,PBr.default)(async e=>{e.decorate("ensureZuploUser",async function(t){let r=t.headers["zuplo-user"];if(!r||typeof r!="string")throw t.log.error("The 'zuplo-user' header is missing"),new Iat.ApiError(Iat.Problems.UNAUTHORIZED);t.user={sub:r}})},{name:"ensure-zuplo-user-plugin"})});var Bat=E(Qx=>{"use strict";var xBr=Qx&&Qx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qx,"__esModule",{value:!0});Qx.featureFlagsPlugin=void 0;var kBr=xBr(tT()),Z1e;async function Fat(e,t){try{let r=await Z1e?.variation(t.flagName,{kind:t.kind,key:t.key},t.defaultValue);return r===void 0?t.defaultValue:r}catch(r){e.log.warn(`Failed to query Launch Darkly flag ${t.flagName}`),e.log.error(r)}return t.defaultValue}a(Fat,"getFlagValue");function Mat(){return this.log.error("Call to feature flag getFlagValue function on uninitialized flag plugin"),Promise.resolve(!1)}a(Mat,"fallback");Qx.featureFlagsPlugin=(0,kBr.default)(async(e,t)=>{try{if(typeof t.key!="string"||!t.key||!t.client){e.decorateRequest("getFlagValue",Mat),e.decorateRequest("getFlagValueByUser",Mat);return}Z1e=t.client,e.log.info("Launch Darkly SDK successfully initialized!"),e.decorate("flags",Z1e),e.decorateRequest("getFlagValue",async function(r){let n,i;"projectName"in r?(n="project",i=`${r.accountName}/${r.projectName}`):(n="account",i=r.accountName);let o={flagName:r.flagName,kind:n,key:i,defaultValue:r.defaultValue};return Fat(this,o)}),e.decorateRequest("getFlagValueByUser",async function(r,n,i){return Fat(this,{flagName:r,kind:"user",key:n,defaultValue:i})})}catch(r){e.log.warn("Launch Darkly failed to initialize"),e.log.error(r)}},{name:"feature-flag-plugin"})});var ebe=E(Xx=>{"use strict";var RBr=Xx&&Xx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xx,"__esModule",{value:!0});Xx.getUserSubPlugin=void 0;var jat=Md(),NBr=RBr(tT());Xx.getUserSubPlugin=(0,NBr.default)(async e=>{e.decorateRequest("getUserSub",function(){let t=this.user?.sub;if(!t)throw this.log.error("Could not determine the user sub"),new jat.ApiError(jat.Problems.UNAUTHORIZED);return t})},{name:"get-user-sub-plugin"})});var tbe=E(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.getUserSubPlugin=Hf.featureFlagsPlugin=Hf.ensureZuploUserPlugin=Hf.ensureZuploAdminPlugin=Hf.apiKeyAuthPlugin=void 0;var DBr=Nat();Object.defineProperty(Hf,"apiKeyAuthPlugin",{enumerable:!0,get:function(){return DBr.apiKeyAuthPlugin}});var IBr=Dat();Object.defineProperty(Hf,"ensureZuploAdminPlugin",{enumerable:!0,get:function(){return IBr.ensureZuploAdminPlugin}});var LBr=Lat();Object.defineProperty(Hf,"ensureZuploUserPlugin",{enumerable:!0,get:function(){return LBr.ensureZuploUserPlugin}});var FBr=Bat();Object.defineProperty(Hf,"featureFlagsPlugin",{enumerable:!0,get:function(){return FBr.featureFlagsPlugin}});var MBr=ebe();Object.defineProperty(Hf,"getUserSubPlugin",{enumerable:!0,get:function(){return MBr.getUserSubPlugin}})});var So=E(fu=>{"use strict";var rbe=Symbol.for("yaml.alias"),qat=Symbol.for("yaml.document"),fW=Symbol.for("yaml.map"),Uat=Symbol.for("yaml.pair"),nbe=Symbol.for("yaml.scalar"),hW=Symbol.for("yaml.seq"),D1=Symbol.for("yaml.node.type"),BBr=a(e=>!!e&&typeof e=="object"&&e[D1]===rbe,"isAlias"),jBr=a(e=>!!e&&typeof e=="object"&&e[D1]===qat,"isDocument"),qBr=a(e=>!!e&&typeof e=="object"&&e[D1]===fW,"isMap"),UBr=a(e=>!!e&&typeof e=="object"&&e[D1]===Uat,"isPair"),$at=a(e=>!!e&&typeof e=="object"&&e[D1]===nbe,"isScalar"),$Br=a(e=>!!e&&typeof e=="object"&&e[D1]===hW,"isSeq");function Vat(e){if(e&&typeof e=="object")switch(e[D1]){case fW:case hW:return!0}return!1}a(Vat,"isCollection");function VBr(e){if(e&&typeof e=="object")switch(e[D1]){case rbe:case fW:case nbe:case hW:return!0}return!1}a(VBr,"isNode");var HBr=a(e=>($at(e)||Vat(e))&&!!e.anchor,"hasAnchor");fu.ALIAS=rbe;fu.DOC=qat;fu.MAP=fW;fu.NODE_TYPE=D1;fu.PAIR=Uat;fu.SCALAR=nbe;fu.SEQ=hW;fu.hasAnchor=HBr;fu.isAlias=BBr;fu.isCollection=Vat;fu.isDocument=jBr;fu.isMap=qBr;fu.isNode=VBr;fu.isPair=UBr;fu.isScalar=$at;fu.isSeq=$Br});var W9=E(ibe=>{"use strict";var Tl=So(),jd=Symbol("break visit"),Hat=Symbol("skip children"),Ly=Symbol("remove node");function mW(e,t){let r=Gat(t);Tl.isDocument(e)?Zx(null,e.contents,r,Object.freeze([e]))===Ly&&(e.contents=null):Zx(null,e,r,Object.freeze([]))}a(mW,"visit");mW.BREAK=jd;mW.SKIP=Hat;mW.REMOVE=Ly;function Zx(e,t,r,n){let i=zat(e,t,r,n);if(Tl.isNode(i)||Tl.isPair(i))return Kat(e,n,i),Zx(e,i,r,n);if(typeof i!="symbol"){if(Tl.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let u=Zx(o,t.items[o],r,n);if(typeof u=="number")o=u-1;else{if(u===jd)return jd;u===Ly&&(t.items.splice(o,1),o-=1)}}}else if(Tl.isPair(t)){n=Object.freeze(n.concat(t));let o=Zx("key",t.key,r,n);if(o===jd)return jd;o===Ly&&(t.key=null);let u=Zx("value",t.value,r,n);if(u===jd)return jd;u===Ly&&(t.value=null)}}return i}a(Zx,"visit_");async function gW(e,t){let r=Gat(t);Tl.isDocument(e)?await ek(null,e.contents,r,Object.freeze([e]))===Ly&&(e.contents=null):await ek(null,e,r,Object.freeze([]))}a(gW,"visitAsync");gW.BREAK=jd;gW.SKIP=Hat;gW.REMOVE=Ly;async function ek(e,t,r,n){let i=await zat(e,t,r,n);if(Tl.isNode(i)||Tl.isPair(i))return Kat(e,n,i),ek(e,i,r,n);if(typeof i!="symbol"){if(Tl.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let u=await ek(o,t.items[o],r,n);if(typeof u=="number")o=u-1;else{if(u===jd)return jd;u===Ly&&(t.items.splice(o,1),o-=1)}}}else if(Tl.isPair(t)){n=Object.freeze(n.concat(t));let o=await ek("key",t.key,r,n);if(o===jd)return jd;o===Ly&&(t.key=null);let u=await ek("value",t.value,r,n);if(u===jd)return jd;u===Ly&&(t.value=null)}}return i}a(ek,"visitAsync_");function Gat(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}a(Gat,"initVisitor");function zat(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(Tl.isMap(t))return r.Map?.(e,t,n);if(Tl.isSeq(t))return r.Seq?.(e,t,n);if(Tl.isPair(t))return r.Pair?.(e,t,n);if(Tl.isScalar(t))return r.Scalar?.(e,t,n);if(Tl.isAlias(t))return r.Alias?.(e,t,n)}a(zat,"callVisitor");function Kat(e,t,r){let n=t[t.length-1];if(Tl.isCollection(n))n.items[e]=r;else if(Tl.isPair(n))e==="key"?n.key=r:n.value=r;else if(Tl.isDocument(n))n.contents=r;else{let i=Tl.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(Kat,"replaceNode");ibe.visit=mW;ibe.visitAsync=gW});var obe=E(Yat=>{"use strict";var Wat=So(),GBr=W9(),zBr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},KBr=a(e=>e.replace(/[!,[\]{}]/g,t=>zBr[t]),"escapeTagName"),Y9=class e{static{a(this,"Directives")}constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,r)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,u]=n;return this.tags[o]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let u=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,u),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let u=t.slice(2,-1);return u==="!"||u==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),u)}let[,n,i]=t.match(/^(.*!)([^!]*)$/s);i||r(`The ${t} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(u){return r(String(u)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+KBr(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(t&&n.length>0&&Wat.isNode(t.contents)){let o={};GBr.visit(t.contents,(u,d)=>{Wat.isNode(d)&&d.tag&&(o[d.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,u]of n)o==="!!"&&u==="tag:yaml.org,2002:"||(!t||i.some(d=>d.startsWith(u)))&&r.push(`%TAG ${o} ${u}`);return r.join(`
|
|
27
|
+
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}a(QFr,"parse");function j1e(e){console.log(`[dotenv@${YFr}][DEBUG] ${e}`)}a(j1e,"_log");function XFr(e){return e[0]==="~"?rat.join(KFr.homedir(),e.slice(1)):e}a(XFr,"_resolveHome");function ZFr(e){let t=rat.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(t=XFr(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=JK.parse(zFr.readFileSync(t,{encoding:r}));return Object.keys(o).forEach(function(u){Object.prototype.hasOwnProperty.call(process.env,u)?(i===!0&&(process.env[u]=o[u]),n&&j1e(i===!0?`"${u}" is already defined in \`process.env\` and WAS overwritten`:`"${u}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[u]=o[u]}),{parsed:o}}catch(o){return n&&j1e(`Failed to load ${t} ${o.message}`),{error:o}}}a(ZFr,"config");var JK={config:ZFr,parse:QFr};QK.exports.config=JK.config;QK.exports.parse=JK.parse;QK.exports=JK});var Kc=E(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.EnvironmentalVariableRequiredError=eT.getRequiredEnvVar=void 0;var q1e=class{static{a(this,"Environment")}get LOG_LEVEL(){return process.env.LOG_LEVEL??"info"}get LOG_FORMAT(){return process.env.LOG_FORMAT??"pretty"}get NODE_ENV(){return process.env.NODE_ENV}get USE_LOCAL_API_SERVER(){return process.env.USE_LOCAL_API_SERVER==="true"}get USE_MONOREPO_PACKAGES(){return process.env.USE_MONOREPO_PACKAGES==="true"}get GCP_STORAGE_BUNDLE_BUCKET_NAME(){return process.env.GCP_STORAGE_BUNDLE_BUCKET_NAME}get GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME(){return process.env.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}get GCP_STORAGE_ARCHIVE_BUCKET_NAME(){return process.env.GCP_STORAGE_ARCHIVE_BUCKET_NAME}get GCP_STORAGE_SOURCE_CODE_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}get GCP_STORAGE_SOURCES_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCES_BUCKET_NAME}get ZUPLO_AUTH_API_JWT(){return process.env.ZUPLO_AUTH_API_JWT}get GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS(){return process.env.GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS}get RUNTIME_DENO_VERSION(){return process.env.RUNTIME_DENO_VERSION??"1.53.0"}get AUTH_API_URL(){return Ld("AUTH_API_URL","http://localhost:5201")}get MANAGEMENT_API_URL(){return Ld("MANAGEMENT_API_URL","http://localhost:3100")}get TENANT_API_URL(){return Ld("TENANT_API_URL","http://localhost:5100")}get CONTENT_API_URL(){return Ld("CONTENT_API_URL","http://localhost:5400")}get DEPLOYER_API_URL(){return Ld("DEPLOYER_API_URL","http://localhost:5300")}get DEV_API_URL(){return Ld("DEV_API_URL","http://localhost:5200")}get API_KEY_SERVICE_URL(){return Ld("API_KEY_SERVICE_URL","https://apikey.zuplo.com")}get API_KEY_MANAGEMENT_SERVICE_URL(){return Ld("API_KEY_MANAGEMENT_SERVICE_URL","https://api-key-management-service-rreeuhlsca-ue.a.run.app")}get METERING_SERVICE_URL(){return Ld("METERING_SERVICE_URL","https://meters.zuplo.com")}get FETCH_PROXY_URL(){return process.env.FETCH_PROXY_URL||"https://proxy-main-04e55cb.zuplo.app"}get FETCH_PROXY_API_KEY(){return process.env.FETCH_PROXY_API_KEY||"zpk_123"}get LOG_EVENT_API_URL(){return process.env.LOG_EVENT_API_URL}get LAUNCH_DARKLY_SERVER_KEY(){return process.env.LAUNCH_DARKLY_SERVER_KEY}get REMOTE_LOGGING_SHARED_SECRET(){return process.env.REMOTE_LOGGING_SHARED_SECRET??"the-logging-shared-secret"}get TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT(){return process.env.TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT??"10.142.0.64:5000"}get DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME(){return process.env.DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME??"zpl-developer-api"}get __ZUPLO_AUTH_API_JWT(){return process.env.__ZUPLO_AUTH_API_JWT??void 0}get BUILD_ASSETS_BUCKET_NAME(){return process.env.BUILD_ASSETS_BUCKET_NAME}get BUILD_ASSETS_S3_ENDPOINT(){return process.env.BUILD_ASSETS_S3_ENDPOINT}get BUILD_ASSETS_ACCESS_KEY_ID(){return process.env.BUILD_ASSETS_ACCESS_KEY_ID}get BUILD_ASSETS_SECRET_ACCESS_KEY(){return process.env.BUILD_ASSETS_SECRET_ACCESS_KEY}get DEV_PORTAL_ENCRYPTION_SECRET(){if(!process.env.DEV_PORTAL_ENCRYPTION_SECRET)throw new K9("DEV_PORTAL_ENCRYPTION_SECRET");return process.env.DEV_PORTAL_ENCRYPTION_SECRET}isProduction(){return this.NODE_ENV==="production"}get OPENFGA_SERVICE_URL(){return Ld("OPENFGA_SERVICE_URL","https://openfga-eq7z4lly2a-ue.a.run.app")}get OPENFGA_STORE_ID(){return process.env.OPENFGA_STORE_ID??""}get OPENFGA_MODEL_ID(){return process.env.OPENFGA_MODEL_ID??""}GCP_PROJECT_ID(){return Ld("GCP_PROJECT_ID")}GCP_TASK_QUEUE_LOCATION(){return Ld("GCP_TASK_QUEUE_LOCATION")}GCP_TASK_QUEUE_NAME(){return Ld("GCP_TASK_QUEUE_NAME")}};function Ld(e,t){let r=process.env[e];if(r===void 0&&(t===void 0||process.env.NODE_ENV==="production"))throw new K9(e);return r??t}a(Ld,"getRequiredEnvVar");eT.getRequiredEnvVar=Ld;var K9=class extends Error{static{a(this,"EnvironmentalVariableRequiredError")}constructor(t){super(`The environmental variable '${t}' is required.'`)}};eT.EnvironmentalVariableRequiredError=K9;var eMr=new q1e;eT.default=eMr});var U1e=E(XK=>{"use strict";Object.defineProperty(XK,"__esModule",{value:!0});XK.HttpStatusCode=void 0;var iat;(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"})(iat||(XK.HttpStatusCode=iat={}))});var oat=E(ZK=>{"use strict";Object.defineProperty(ZK,"__esModule",{value:!0});ZK.getSourceControlProviderLabel=void 0;function tMr(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}a(tMr,"getSourceControlProviderLabel");ZK.getSourceControlProviderLabel=tMr});var sat=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.DEPLOYMENT_CANNOT_DELETE_INSTANCE=te.DEPLOYMENT_INVALID_MULTI_PART=te.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=te.DEPLOYMENT_FILE_DOES_NOT_EXISTS=te.DEPLOYMENT_NOT_FOUND=te.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=te.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=te.DEPLOYMENT_NO_ACCESS=te.INVALID_SOURCE_REPO_URL=te.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=te.PROJECT_MUST_HAVE_ONE_MEMBER=te.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=te.PROJECT_MEMBER_ALREADY_EXISTS=te.PROJECT_MEMBER_NOT_FOUND=te.INVALID_TEMPLATE_REPOSITORY=te.INCORRECT_PROJECT_TEMPLATE=te.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=te.PROJECT_NOT_FOUND=te.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=te.PROJECT_SHARING_DISABLED_ON_ACCOUNT=te.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=te.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=te.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=te.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=te.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=te.ACCOUNT_MEMBER_INVITE_INVALID=te.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=te.ACCOUNT_MEMBER_DOES_NOT_EXIST=te.ACCOUNT_MEMBER_INFO_MISSING=te.ACCOUNT_MEMBER_ALREADY_EXISTS=te.ACCOUNT_UPDATE_INFO_MISSING=te.ACCOUNT_INFO_MISSING=te.ACCOUNT_DOES_NOT_EXISTS=te.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=te.ACCOUNT_NAME_USES_RESERVED_KEYWORD=te.ACCOUNT_ALREADY_EXISTS=te.ACCOUNT_NOT_FOUND=te.USER_IS_NOT_SERVICE_ACCOUNT=te.USER_REMOVE_NOT_MEMBER_ACCOUNT=te.USER_HAS_NO_ACCESS_TO_ACCOUNT=te.USER_DETAILS_CANNOT_BE_FOUND=te.USER_ALREADY_EXISTS=te.CLIENT_NOT_FOUND=te.FORBIDDEN=te.UNAUTHORIZED=te.METHOD_NOT_ALLOWED=te.NOT_FOUND=te.CONFLICT=te.BAD_REQUEST=te.INTERNAL_SERVER_ERROR=void 0;te.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=te.GITHUB_INTEGRATION_DUPLICATE_REPO=te.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=te.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=te.GITHUB_INTEGRATION_BRANCH_BEHIND=te.GITHUB_INTEGRATION_NOT_FOUND=te.GITHUB_REPOSITORY_NOT_FOUND=te.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=te.GITHUB_INTEGRATION_ALREADY_EXISTS=te.FEATURE_FLAGS_NOT_FOUND=te.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=te.PROJECT_ALREADY_HAS_REPO=te.PROJECT_INVALID_NAME=te.FAILED_TO_REVOKE_GH_TOKEN=te.USER_ACCOUNT_NOT_FS_MIGRATED=te.USER_NO_ACCESS_GITLAB_REPO=te.USER_NO_ACCESS_BITBUCKET_REPO=te.GITHUB_APP_CONFIGURATION_NOT_FOUND=te.GITHUB_APP_NO_USER_ACCESS_=te.GITHUB_APP_NO_NAMESPACE_ACCESS=te.GENERIC_GITHUB_BRANCH_INFO_ERROR=te.GITHUB_USER_NO_READ_ACCESS_REPO=te.USER_NO_PULL_ACCESS_GITHUB_REPO=te.USER_NO_ACCESS_GITHUB_REPO=te.PROJECT_SHARING_REQUIRES_GIT_REPO=te.PROJECT_INVALID_GIT_REPO=te.PROJECT_INVALID_GIT_CLONE=te.USER_IS_PROJECT_MEMBER=te.USER_HAS_NO_ACCESS_TO_PROJECT=te.RUNTIME_FLAG_KEY_NOT_VALID=te.RUNTIME_FLAG_NOT_FOUND=te.RUNTIME_FLAG_ALREADY_EXISTS=te.PROJECT_NO_MEMBERS=te.PROJECT_ALREADY_EXISTS=te.SERVICE_CONFIGURATION_FAILED_DECRYPTION=te.WORKING_COPY_SERVICE_NOT_CREATED=te.WORKING_COPY_SERVICE_NOT_DELETED=te.WORKING_COPY_SERVICE_NOT_FOUND=te.SERVICE_CONFIGURATION_NOT_FOUND=te.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=te.DEPLOYMENT_INCORRECT_STATUS_PAUSE=te.DEPLOYMENT_NOT_WORKING_COPY=te.DEPLOYMENT_LOG_NOT_FOUND=te.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=te.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=te.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=te.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=te.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=te.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=te.DEPLOYMENT_DELETE_ERROR=void 0;te.INVALID_BRANCH_NAME=te.TARGET_BRANCH_ONLY_FOR_PREVIEW=te.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=te.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=te.DEPLOYMENT_NAME_MISSING=te.NON_EXISTENT_ENVIRONMENT_VARIABLE=te.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=te.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=te.DUPLICATE_ENVIRONMENT_VARIABLE=te.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=te.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=te.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=te.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=te.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=te.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=te.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=te.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=te.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=te.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=te.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=te.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=te.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=te.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=te.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=te.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=te.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=te.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=te.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=te.SOURCE_CONTROL_REPO_OPERATION_ERROR=te.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=te.SOURCE_CONTROL_REPO_NOT_FOUND=te.SOURCE_CONTROL_AUTHENTICATION_FAILED=te.EXTERNAL_SERVICE_GENERIC_ERROR=te.API_USER_NO_ACCESS=te.EXTERNAL_USER_NOT_CONFIGURED=te.EXTERNAL_USER_NO_ACCESS=te.CONSUMER_DOES_NOT_EXIST=te.CONSUMER_NO_ACCESS=te.GITLAB_ACCESS_LEVEL_CHECK_FAIL=te.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=te.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=te.GITLAB_DUPLICATE_REPO=te.GITLAB_FAILED_DURING_REPO_CREATION=te.GITLAB_QUERY_USER_INFO_FAILED=te.BITBUCKET_FAILED_DURING_REPO_CREATION=te.BITBUCKET_WORKSPACE_MISCONFIGURATION=te.BITBUCKET_QUERY_USER_INFO_FAILED=te.GITHUB_INTEGRATION_INVALID_REPO=te.GIT_CREATE_PROJECT_WITH_INVALID_REPO=te.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=void 0;te.METERING_BUCKET_CREATION_FAILED=te.UNABLE_UPGRADE_PLAN=te.BUCKET_NOT_FOUND=te.BUCKET_API_KEY_SERVICE_CONFLICT=te.DIRECTORY_DELETE_FAILED=te.FILE_DELETE_FAILED=te.CANNOT_DELETE_SOLE_OPEN_API_FILE=te.CANNOT_DELETE_ESSENTIAL_DIRECTORY=te.CANNOT_DELETE_ESSENTIAL_FILE=te.FILE_WRITE_FAILED=te.FILE_RENAME_FAILED=te.FILE_RENAME_FILE_ALREADY_EXISTS=te.FILE_RENAME_CANNOT_CHANGE_EXTENSION=te.FILE_RENAME_PATHS_MATCH=te.DIRECTORY_CREATION_FAILED=te.DIRECTORY_OR_FILE_DOES_NOT_EXIST=te.DIRECTORY_DOES_NOT_EXIST=te.DIRECTORY_ALREADY_EXISTS=te.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=te.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=te.FAILED_DOWNLOAD_FROM_STORAGE=te.CANNOT_FIND_SRC_DIRECTORY=te.CANNOT_READ_PACKAGE_JSON=te.PACKAGE_JSON_NOT_FOUND=te.RUNTIME_VERSION_INCORRECT_FORMAT=te.MIGRATIONS_ONLY_ON_WORKING_COPY=te.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=te.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=te.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=te.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=te.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=te.NO_GLOBAL_SYMBOLS=te.NO_ZUPLO_PREFIXED_VARIABLES=te.NON_EMPTY_TARGETS_REQUIRED=te.CONFLICTING_TYPES=te.OVERLAPPING_TARGETS=void 0;var Ve=U1e(),aat=oat(),rMr="https://github.com/apps/zuplo/installations/new";te.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:Ve.HttpStatusCode.BAD_REQUEST};te.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:Ve.HttpStatusCode.CONFLICT};te.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:Ve.HttpStatusCode.NOT_FOUND};te.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:Ve.HttpStatusCode.METHOD_NOT_ALLOWED};te.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:Ve.HttpStatusCode.UNAUTHORIZED};te.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:Ve.HttpStatusCode.FORBIDDEN};te.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:Ve.HttpStatusCode.NOT_FOUND};te.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:Ve.HttpStatusCode.CONFLICT};te.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:Ve.HttpStatusCode.UNAUTHORIZED};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:Ve.HttpStatusCode.CONFLICT};te.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:Ve.HttpStatusCode.BAD_REQUEST};te.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:Ve.HttpStatusCode.FORBIDDEN};te.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:Ve.HttpStatusCode.NOT_FOUND};te.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.FORBIDDEN};te.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:Ve.HttpStatusCode.BAD_REQUEST};var nMr=a(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:Ve.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");te.INVALID_TEMPLATE_REPOSITORY=nMr;te.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:Ve.HttpStatusCode.NOT_FOUND};te.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:Ve.HttpStatusCode.BAD_REQUEST};te.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};te.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.FORBIDDEN};te.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:Ve.HttpStatusCode.BAD_REQUEST};te.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:Ve.HttpStatusCode.BAD_REQUEST};te.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:Ve.HttpStatusCode.NOT_FOUND};te.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:Ve.HttpStatusCode.NOT_FOUND};te.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:Ve.HttpStatusCode.BAD_REQUEST};te.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:Ve.HttpStatusCode.BAD_REQUEST};te.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:Ve.HttpStatusCode.NOT_FOUND};te.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:Ve.HttpStatusCode.BAD_REQUEST};te.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:Ve.HttpStatusCode.NOT_FOUND};te.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:Ve.HttpStatusCode.BAD_REQUEST};te.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:Ve.HttpStatusCode.FORBIDDEN};te.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};var iMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");te.USER_NO_ACCESS_GITHUB_REPO=iMr;var oMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");te.USER_NO_PULL_ACCESS_GITHUB_REPO=oMr;var aMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");te.GITHUB_USER_NO_READ_ACCESS_REPO=aMr;te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.FORBIDDEN};var sMr=a(({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 '${rMr}' to add the repository.`,status:Ve.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");te.GITHUB_APP_NO_USER_ACCESS_=sMr;te.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:Ve.HttpStatusCode.NOT_FOUND};var lMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");te.USER_NO_ACCESS_BITBUCKET_REPO=lMr;var uMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");te.USER_NO_ACCESS_GITLAB_REPO=uMr;te.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:Ve.HttpStatusCode.FORBIDDEN};te.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:Ve.HttpStatusCode.BAD_REQUEST};var cMr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:Ve.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");te.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=cMr;var dMr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:Ve.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");te.GITHUB_REPOSITORY_NOT_FOUND=dMr;te.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:Ve.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};var pMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");te.GITHUB_INTEGRATION_DUPLICATE_REPO=pMr;var fMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");te.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=fMr;var hMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");te.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=hMr;var mMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");te.GIT_CREATE_PROJECT_WITH_INVALID_REPO=mMr;var gMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");te.GITHUB_INTEGRATION_INVALID_REPO=gMr;te.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:Ve.HttpStatusCode.FORBIDDEN};te.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:Ve.HttpStatusCode.FORBIDDEN};var yMr=a(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:Ve.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");te.BITBUCKET_FAILED_DURING_REPO_CREATION=yMr;te.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:Ve.HttpStatusCode.FORBIDDEN};var vMr=a(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");te.GITLAB_FAILED_DURING_REPO_CREATION=vMr;var bMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");te.GITLAB_DUPLICATE_REPO=bMr;var EMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");te.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=EMr;var _Mr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");te.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=_Mr;var SMr=a(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:Ve.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");te.GITLAB_ACCESS_LEVEL_CHECK_FAIL=SMr;te.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:Ve.HttpStatusCode.UNAUTHORIZED};te.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:Ve.HttpStatusCode.NOT_FOUND};te.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:Ve.HttpStatusCode.UNAUTHORIZED};te.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:Ve.HttpStatusCode.FORBIDDEN};te.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:Ve.HttpStatusCode.FORBIDDEN};te.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};var wMr=a(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,aat.getSourceControlProviderLabel)(e)}`,status:Ve.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");te.SOURCE_CONTROL_AUTHENTICATION_FAILED=wMr;var OMr=a(({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,aat.getSourceControlProviderLabel)(e)} repository`,status:Ve.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");te.SOURCE_CONTROL_REPO_NOT_FOUND=OMr;te.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:Ve.HttpStatusCode.BAD_REQUEST};var TMr=a(({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:Ve.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");te.SOURCE_CONTROL_REPO_OPERATION_ERROR=TMr;te.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:Ve.HttpStatusCode.FORBIDDEN};te.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.UNAUTHORIZED};te.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:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:Ve.HttpStatusCode.FORBIDDEN};te.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:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.NOT_FOUND};te.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:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR};te.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:Ve.HttpStatusCode.FAILED_DEPENDENCY};te.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:Ve.HttpStatusCode.FAILED_DEPENDENCY};te.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:Ve.HttpStatusCode.FAILED_DEPENDENCY};te.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:Ve.HttpStatusCode.BAD_REQUEST};te.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:Ve.HttpStatusCode.NOT_FOUND};te.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:Ve.HttpStatusCode.BAD_REQUEST};te.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:Ve.HttpStatusCode.BAD_REQUEST};te.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.BAD_REQUEST};te.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:Ve.HttpStatusCode.FORBIDDEN};te.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:Ve.HttpStatusCode.NOT_FOUND};var AMr=a(({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:Ve.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");te.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=AMr;var CMr=a(()=>({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:Ve.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");te.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=CMr;te.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:Ve.HttpStatusCode.BAD_REQUEST};te.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:Ve.HttpStatusCode.BAD_REQUEST};te.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:Ve.HttpStatusCode.NOT_FOUND};te.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:Ve.HttpStatusCode.BAD_REQUEST};te.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:Ve.HttpStatusCode.BAD_REQUEST};te.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:Ve.HttpStatusCode.BAD_REQUEST};var PMr=a(({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:Ve.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");te.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=PMr;var xMr=a(({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:Ve.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");te.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=xMr;var kMr=a(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");te.DIRECTORY_ALREADY_EXISTS=kMr;var RMr=a(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");te.DIRECTORY_DOES_NOT_EXIST=RMr;var NMr=a(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");te.DIRECTORY_OR_FILE_DOES_NOT_EXIST=NMr;var DMr=a(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");te.DIRECTORY_CREATION_FAILED=DMr;var IMr=a(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:Ve.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");te.FILE_RENAME_PATHS_MATCH=IMr;var LMr=a(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");te.FILE_RENAME_CANNOT_CHANGE_EXTENSION=LMr;var FMr=a(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:Ve.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");te.FILE_RENAME_FILE_ALREADY_EXISTS=FMr;var MMr=a(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");te.FILE_RENAME_FAILED=MMr;var BMr=a(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");te.FILE_WRITE_FAILED=BMr;var jMr=a(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");te.CANNOT_DELETE_ESSENTIAL_FILE=jMr;var qMr=a(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");te.CANNOT_DELETE_ESSENTIAL_DIRECTORY=qMr;var UMr=a(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:Ve.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");te.CANNOT_DELETE_SOLE_OPEN_API_FILE=UMr;var $Mr=a(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");te.FILE_DELETE_FAILED=$Mr;var VMr=a(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");te.DIRECTORY_DELETE_FAILED=VMr;te.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:Ve.HttpStatusCode.CONFLICT};te.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:Ve.HttpStatusCode.NOT_FOUND};te.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:Ve.HttpStatusCode.BAD_REQUEST};te.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:Ve.HttpStatusCode.INTERNAL_SERVER_ERROR}});var uat=E(Fd=>{"use strict";var HMr=Fd&&Fd.__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]}),GMr=Fd&&Fd.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zMr=Fd&&Fd.__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)&&HMr(t,e,r);return GMr(t,e),t};Object.defineProperty(Fd,"__esModule",{value:!0});Fd.ApiNotFoundError=Fd.ApiError=Fd.Problems=void 0;var lat=zMr(sat());Fd.Problems=lat;var eW=class extends Error{static{a(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}};Fd.ApiError=eW;var $1e=class extends eW{static{a(this,"ApiNotFoundError")}constructor(t={}){super({...t,...lat.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};Fd.ApiNotFoundError=$1e});var Md=E(N1=>{"use strict";var KMr=N1&&N1.__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]}),WMr=N1&&N1.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&KMr(t,e,r)};Object.defineProperty(N1,"__esModule",{value:!0});N1.HttpStatusCode=void 0;WMr(uat(),N1);var YMr=U1e();Object.defineProperty(N1,"HttpStatusCode",{enumerable:!0,get:function(){return YMr.HttpStatusCode}})});var H1e=E(tW=>{"use strict";Object.defineProperty(tW,"__esModule",{value:!0});tW.CommonAuth=void 0;var JE=Md(),JMr=["google-oauth2|106231436550039770264","google-oauth2|113609898431445637338","google-oauth2|115413213714061429608","google-oauth2|105283806895031006146","google-oauth2|116604562105669742663"],V1e=class e{static{a(this,"CommonAuth")}static DEPLOYER_USER_SUB="deployer-app@zuplo";isZuploAdmin(t){return JMr.includes(t)}isDeployerServiceAccount(t){return e.DEPLOYER_USER_SUB===t}static isAuthorizedSub(t,r){if(typeof r=="string")throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS);if(r instanceof Buffer)throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS);try{if(!t.includes(r.sub))throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS)}catch{throw new JE.ApiError(JE.Problems.API_USER_NO_ACCESS)}}};tW.CommonAuth=V1e});var cat=E(rW=>{"use strict";Object.defineProperty(rW,"__esModule",{value:!0});rW.hasBlockedNotifications=void 0;var QMr=["chocolate_bold_silverfish"];function XMr(e){return QMr.includes(e)}a(XMr,"hasBlockedNotifications");rW.hasBlockedNotifications=XMr});var z1e=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.BuildIssueError=Bd.WARNING_SEVERITY=Bd.ERROR_SEVERITY=Bd.FAILURE_STATUS=Bd.WARNING_STATUS=Bd.GOOD_STATUS=void 0;Bd.GOOD_STATUS="Good";Bd.WARNING_STATUS="Warnings";Bd.FAILURE_STATUS="Failed";Bd.ERROR_SEVERITY="error";Bd.WARNING_SEVERITY="warning";var G1e=class extends Error{static{a(this,"BuildIssueError")}issue;constructor(t){super(t.message),this.issue=t}};Bd.BuildIssueError=G1e});var dat=E(nW=>{"use strict";Object.defineProperty(nW,"__esModule",{value:!0});nW.COMPATIBILITY_FLAG_MAPPINGS=void 0;nW.COMPATIBILITY_FLAG_MAPPINGS=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}})});var pat=E((Xjo,ZMr)=>{ZMr.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/zuplo.config.json",title:"Zuplo Config",description:"",type:"object",required:[],additionalProperties:!1,properties:{version:{description:"The version of the configuration",type:"number",enum:[1]},project:{type:"string"},compatibilityDate:{description:"The compatibility date on which to run the gateway",type:"string",title:"Compatibility Date",default:"2024-01-15",enum:["2023-03-14","2024-01-15"]}}}});var fat=E(iW=>{"use strict";Object.defineProperty(iW,"__esModule",{value:!0});iW.VALID_COMPATIBILITY_DATES=void 0;iW.VALID_COMPATIBILITY_DATES=Object.freeze(["2023-03-14","2024-01-15"])});var hat=E(QE=>{"use strict";var eBr=QE&&QE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(QE,"__esModule",{value:!0});QE.DEFAULT_COMPATIBILITY_DATE=QE.VALID_COMPATIBILITY_DATES=void 0;var tBr=eBr(pat()),rBr=fat();Object.defineProperty(QE,"VALID_COMPATIBILITY_DATES",{enumerable:!0,get:function(){return rBr.VALID_COMPATIBILITY_DATES}});QE.DEFAULT_COMPATIBILITY_DATE=tBr.default.properties.compatibilityDate.default});var mat=E(oW=>{"use strict";Object.defineProperty(oW,"__esModule",{value:!0});oW.FeatureFlags=void 0;oW.FeatureFlags=Object.freeze({esmWorker:(e,t)=>({flagName:"ZUPLO_ESM_WORKER",defaultValue:!1,accountName:e,projectName:t}),FS_ACCOUNT_NAME_PATH:"FS_ACCOUNT_NAME_PATH"})});var gat=E(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.decrypt=XE.encrypt=XE.signString=void 0;var zx=require("crypto");function nBr(e,t){return(0,zx.createHmac)("sha256",t).update(e).digest("hex")}a(nBr,"signString");XE.signString=nBr;var K1e={AUTH_TAG_BYTE_LEN:16,IV_BYTE_LEN:12},iBr=a(()=>(0,zx.randomBytes)(K1e.IV_BYTE_LEN),"getIV");function oBr(e,t){if(e===null)return null;let r=(0,zx.createHash)("sha256").update(String(t)).digest("base64").substring(0,32),n=iBr(),i=(0,zx.createCipheriv)("aes-256-gcm",r,n,{authTagLength:K1e.AUTH_TAG_BYTE_LEN}),o=i.update(e);return o=Buffer.concat([o,i.final()]),Buffer.concat([n,o,i.getAuthTag()]).toString("hex")}a(oBr,"encrypt");XE.encrypt=oBr;function aBr(e,t){if(!e)return null;let r=Buffer.from(t),n=(0,zx.createHash)("sha256").update(String(r)).digest("base64").substring(0,32),i=Buffer.from(e,"hex"),o=i.slice(-16),u=i.slice(0,12),d=i.slice(12,-16),p=(0,zx.createDecipheriv)("aes-256-gcm",n,u,{authTagLength:K1e.AUTH_TAG_BYTE_LEN});p.setAuthTag(o);let s=p.update(d);return Buffer.concat([s,p.final()]).toString("utf-8")}a(aBr,"decrypt");XE.decrypt=aBr});var yat=E(aW=>{"use strict";Object.defineProperty(aW,"__esModule",{value:!0});aW.getCurrentUtcDateTime=void 0;function sBr(){let e={year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0,timeZone:"UTC"};return new Date().toLocaleString("en-US",e)}a(sBr,"getCurrentUtcDateTime");aW.getCurrentUtcDateTime=sBr});var W1e=E(sW=>{"use strict";Object.defineProperty(sW,"__esModule",{value:!0});sW.DeploymentLogState=void 0;var vat;(function(e){e.ERROR="ERROR",e.IN_PROGRESS="IN_PROGRESS",e.SUCCESS="SUCCESS"})(vat||(sW.DeploymentLogState=vat={}))});var Y1e=E(bat=>{"use strict";Object.defineProperty(bat,"__esModule",{value:!0})});var _at=E(Eat=>{"use strict";Object.defineProperty(Eat,"__esModule",{value:!0})});var Sat=E(lW=>{"use strict";Object.defineProperty(lW,"__esModule",{value:!0});lW.MARKDOWN_FRONTMATTER_KEYS=void 0;lW.MARKDOWN_FRONTMATTER_KEYS=["sidebar_label"]});var Oat=E(wat=>{"use strict";Object.defineProperty(wat,"__esModule",{value:!0})});var Tat=E(Ny=>{"use strict";var lBr=Ny&&Ny.__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]}),uW=Ny&&Ny.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&lBr(t,e,r)};Object.defineProperty(Ny,"__esModule",{value:!0});uW(Y1e(),Ny);uW(_at(),Ny);uW(Sat(),Ny);uW(Oat(),Ny)});var cW=E(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.getLoggerContext=Dy.requestIdGenerator=Dy.REQUEST_ID_HEADER=Dy.LEGACY_REQUEST_ID_HEADER=void 0;var uBr=require("crypto");Dy.LEGACY_REQUEST_ID_HEADER="zuplo-request-id";Dy.REQUEST_ID_HEADER="zp-rid";var cBr=a(e=>{let t=e.headers["zuplo-request-id"],r=e.headers["X-GitHub-Delivery"];return t?`${t}`:r?`${r}`:(0,uBr.randomUUID)()},"requestIdGenerator");Dy.requestIdGenerator=cBr;function dBr(e){let t=e.raw.url??"",r={};try{let n=e.headers["zuplo-user"]??e.user?.sub;n&&(r.userSub=`${n}`);let i=t.match(/(deployments)\/([a-zA-Z-0-9]*)/);i&&i!==null&&i.length>=2&&(r.deployment=i[2]);let o=t.match(/(accounts)\/([a-zA-Z-0-9]*)/);o&&o!==null&&o.length>=2&&(r.account=o[2]);let u=t.match(/(projects)\/([a-zA-Z-0-9]*)/);u&&u!==null&&u.length>=2&&(r.project=u[2])}catch{}return r}a(dBr,"getLoggerContext");Dy.getLoggerContext=dBr});var J1e=E(Kx=>{"use strict";var pBr=Kx&&Kx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kx,"__esModule",{value:!0});Kx.errorHandler=void 0;var Vf=Md(),fBr=pBr(Kc()),Aat=cW();function hBr(e,t,r){let n=500,i;if(e instanceof Vf.ApiError)n=e.status,i={type:e.type,title:e.message,status:e.status,detail:e.detail,instance:e.instance};else if(typeof e=="object"&&"validation"in e&&"validationContext"in e)n=Vf.HttpStatusCode.BAD_REQUEST,i={...Vf.Problems.BAD_REQUEST,detail:`An error occurred when validating the ${e.validationContext}.`,errors:e.validation};else if(typeof e=="object"&&"code"in e&&e.code==="FST_ERR_NOT_FOUND")n=404,i=Vf.Problems.NOT_FOUND;else if(typeof e=="object"&&"code"in e&&typeof e.code=="string"&&["FST_ERR_CTP_INVALID_TYPE","FST_ERR_CTP_EMPTY_TYPE","FST_ERR_CTP_BODY_TOO_LARGE","FST_ERR_CTP_INVALID_MEDIA_TYPE","FST_ERR_CTP_INVALID_CONTENT_LENGTH","FST_ERR_CTP_EMPTY_JSON_BODY","FST_ERR_BAD_URL","FST_ERR_INVALID_URL"].includes(e.code))n=Vf.HttpStatusCode.BAD_REQUEST,i={...Vf.Problems.BAD_REQUEST,detail:e.message};else{let u;!r.statusCode||r.statusCode===200?(typeof e=="object"&&"statusCode"in e&&typeof e.statusCode=="number"?u=e.statusCode:typeof e=="object"&&"status"in e&&typeof e.status=="number"&&(u=e.status),n=u&&u>=400?u:500):n=r.statusCode,i=mBr(n),fBr.default.NODE_ENV!=="production"&&(typeof e=="object"&&"message"in e?i.detail=e.message:typeof e=="string"&&(i.detail=e))}i.trace={timestamp:new Date().toJSON(),requestId:t.headers[Aat.REQUEST_ID_HEADER]??t.headers[Aat.LEGACY_REQUEST_ID_HEADER]},n<500?r.log.warn({res:r,err:e},e&&e.message):r.log.error({req:t,res:r,err:e},e&&e.message);let o=JSON.stringify(i,null,2);return r.status(n).header("content-type","application/json").send(o)}a(hBr,"errorHandler");Kx.errorHandler=hBr;function mBr(e){return e===401?Vf.Problems.UNAUTHORIZED:e===403?Vf.Problems.FORBIDDEN:e===404?Vf.Problems.NOT_FOUND:e===405?Vf.Problems.METHOD_NOT_ALLOWED:e<500&&e>=400?Vf.Problems.BAD_REQUEST:Vf.Problems.INTERNAL_SERVER_ERROR}a(mBr,"getProblemFromStatus")});var Pat=E((gqo,Q1e)=>{"use strict";var gBr=/at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/,yBr=/(\w*(\.\w*)*)\..*/;Q1e.exports=a(function(t){if(t.name.length>0)return t.name;let r=Error.stackTraceLimit;Error.stackTraceLimit=10;try{throw new Error("anonymous function")}catch(n){return Error.stackTraceLimit=r,Cat(n.stack)}},"getPluginName");function Cat(e){let t=e.match(gBr);return t?t[1].split(/[/\\]/).slice(-1)[0].match(yBr)[1]:"anonymous"}a(Cat,"extractPluginName");Q1e.exports.extractPluginName=Cat});var kat=E((vqo,xat)=>{"use strict";xat.exports=a(function(t){return t[0]==="@"&&(t=t.slice(1).replace("/","-")),t.replace(/-(.)/g,function(n,i){return i.toUpperCase()})},"toCamelCase")});var tT=E((Eqo,dW)=>{"use strict";var vBr=Pat(),bBr=kat(),EBr=0;function X1e(e,t={}){let r=!1;if(typeof e.default<"u"&&(e=e.default),typeof e!="function")throw new TypeError(`fastify-plugin expects a function, instead got a '${typeof e}'`);if(typeof t=="string"&&(t={fastify:t}),typeof t!="object"||Array.isArray(t)||t===null)throw new TypeError("The options object should be an object");if(t.fastify!==void 0&&typeof t.fastify!="string")throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof t.fastify}'`);t.name||(r=!0,t.name=vBr(e)+"-auto-"+EBr++),e[Symbol.for("skip-override")]=t.encapsulate!==!0,e[Symbol.for("fastify.display-name")]=t.name,e[Symbol.for("plugin-meta")]=t,e.default||(e.default=e);let n=bBr(t.name);return!r&&!e[n]&&(e[n]=e),e}a(X1e,"plugin");dW.exports=X1e;dW.exports.default=X1e;dW.exports.fastifyPlugin=X1e});var Nat=E(Wx=>{"use strict";var _Br=Wx&&Wx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wx,"__esModule",{value:!0});Wx.apiKeyAuthPlugin=void 0;var Iy=Md(),SBr=_Br(tT()),wBr="https://apikey.zuplo.com",Rat="Bearer ";Wx.apiKeyAuthPlugin=(0,SBr.default)(async(e,t)=>{e.decorate("validateApiKey",async function(r){let{authorization:n}=r.headers;if(!n)throw new Iy.ApiError({...Iy.Problems.UNAUTHORIZED,detail:"No Authorization Header"});if(!n.toLowerCase().startsWith(Rat))throw new Iy.ApiError({...Iy.Problems.UNAUTHORIZED,detail:"Invalid Authorization Scheme"});let i=n.substring(Rat.length);if(!i||i==="")throw new Iy.ApiError({...Iy.Problems.UNAUTHORIZED,detail:"No key present"});let o={key:i},u=await fetch(`${wBr}/v1/$validate/${t.bucketName}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o)});if(u.status===401)throw new Iy.ApiError(Iy.Problems.UNAUTHORIZED);let d=await u.json();if(t.allowedSubs&&!t.allowedSubs.includes(d.name))throw new Iy.ApiError(Iy.Problems.UNAUTHORIZED);r.user={sub:d.name,metadata:d.metadata}})},{name:"api-key-auth"})});var Dat=E(Yx=>{"use strict";var OBr=Yx&&Yx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yx,"__esModule",{value:!0});Yx.ensureZuploAdminPlugin=void 0;var pW=Md(),TBr=OBr(tT()),ABr=H1e();Yx.ensureZuploAdminPlugin=(0,TBr.default)(async function(e){let t=new ABr.CommonAuth;e.decorate("ensureZuploAdmin",async function(r){if(!r.user)throw r.log.error("Bad request, no user on request"),new pW.ApiError(pW.Problems.UNAUTHORIZED);let n=r.user.sub;if(!(n&&t.isZuploAdmin(n)))throw r.log.error("User is not an admin"),new pW.ApiError(pW.Problems.FORBIDDEN)})},{name:"ensure-zuplo-admin-plugin"})});var Lat=E(Jx=>{"use strict";var CBr=Jx&&Jx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jx,"__esModule",{value:!0});Jx.ensureZuploUserPlugin=void 0;var Iat=Md(),PBr=CBr(tT());Jx.ensureZuploUserPlugin=(0,PBr.default)(async e=>{e.decorate("ensureZuploUser",async function(t){let r=t.headers["zuplo-user"];if(!r||typeof r!="string")throw t.log.error("The 'zuplo-user' header is missing"),new Iat.ApiError(Iat.Problems.UNAUTHORIZED);t.user={sub:r}})},{name:"ensure-zuplo-user-plugin"})});var Bat=E(Qx=>{"use strict";var xBr=Qx&&Qx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qx,"__esModule",{value:!0});Qx.featureFlagsPlugin=void 0;var kBr=xBr(tT()),Z1e;async function Fat(e,t){try{let r=await Z1e?.variation(t.flagName,{kind:t.kind,key:t.key},t.defaultValue);return r===void 0?t.defaultValue:r}catch(r){e.log.warn(`Failed to query Launch Darkly flag ${t.flagName}`),e.log.error(r)}return t.defaultValue}a(Fat,"getFlagValue");function Mat(){return this.log.error("Call to feature flag getFlagValue function on uninitialized flag plugin"),Promise.resolve(!1)}a(Mat,"fallback");Qx.featureFlagsPlugin=(0,kBr.default)(async(e,t)=>{try{if(typeof t.key!="string"||!t.key||!t.client){e.decorateRequest("getFlagValue",Mat),e.decorateRequest("getFlagValueByUser",Mat);return}Z1e=t.client,e.log.info("Launch Darkly SDK successfully initialized!"),e.decorate("flags",Z1e),e.decorateRequest("getFlagValue",async function(r){let n,i;"projectName"in r?(n="project",i=`${r.accountName}/${r.projectName}`):(n="account",i=r.accountName);let o={flagName:r.flagName,kind:n,key:i,defaultValue:r.defaultValue};return Fat(this,o)}),e.decorateRequest("getFlagValueByUser",async function(r,n,i){return Fat(this,{flagName:r,kind:"user",key:n,defaultValue:i})})}catch(r){e.log.warn("Launch Darkly failed to initialize"),e.log.error(r)}},{name:"feature-flag-plugin"})});var ebe=E(Xx=>{"use strict";var RBr=Xx&&Xx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xx,"__esModule",{value:!0});Xx.getUserSubPlugin=void 0;var jat=Md(),NBr=RBr(tT());Xx.getUserSubPlugin=(0,NBr.default)(async e=>{e.decorateRequest("getUserSub",function(){let t=this.user?.sub;if(!t)throw this.log.error("Could not determine the user sub"),new jat.ApiError(jat.Problems.UNAUTHORIZED);return t})},{name:"get-user-sub-plugin"})});var tbe=E(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.getUserSubPlugin=Hf.featureFlagsPlugin=Hf.ensureZuploUserPlugin=Hf.ensureZuploAdminPlugin=Hf.apiKeyAuthPlugin=void 0;var DBr=Nat();Object.defineProperty(Hf,"apiKeyAuthPlugin",{enumerable:!0,get:function(){return DBr.apiKeyAuthPlugin}});var IBr=Dat();Object.defineProperty(Hf,"ensureZuploAdminPlugin",{enumerable:!0,get:function(){return IBr.ensureZuploAdminPlugin}});var LBr=Lat();Object.defineProperty(Hf,"ensureZuploUserPlugin",{enumerable:!0,get:function(){return LBr.ensureZuploUserPlugin}});var FBr=Bat();Object.defineProperty(Hf,"featureFlagsPlugin",{enumerable:!0,get:function(){return FBr.featureFlagsPlugin}});var MBr=ebe();Object.defineProperty(Hf,"getUserSubPlugin",{enumerable:!0,get:function(){return MBr.getUserSubPlugin}})});var So=E(fu=>{"use strict";var rbe=Symbol.for("yaml.alias"),qat=Symbol.for("yaml.document"),fW=Symbol.for("yaml.map"),Uat=Symbol.for("yaml.pair"),nbe=Symbol.for("yaml.scalar"),hW=Symbol.for("yaml.seq"),D1=Symbol.for("yaml.node.type"),BBr=a(e=>!!e&&typeof e=="object"&&e[D1]===rbe,"isAlias"),jBr=a(e=>!!e&&typeof e=="object"&&e[D1]===qat,"isDocument"),qBr=a(e=>!!e&&typeof e=="object"&&e[D1]===fW,"isMap"),UBr=a(e=>!!e&&typeof e=="object"&&e[D1]===Uat,"isPair"),$at=a(e=>!!e&&typeof e=="object"&&e[D1]===nbe,"isScalar"),$Br=a(e=>!!e&&typeof e=="object"&&e[D1]===hW,"isSeq");function Vat(e){if(e&&typeof e=="object")switch(e[D1]){case fW:case hW:return!0}return!1}a(Vat,"isCollection");function VBr(e){if(e&&typeof e=="object")switch(e[D1]){case rbe:case fW:case nbe:case hW:return!0}return!1}a(VBr,"isNode");var HBr=a(e=>($at(e)||Vat(e))&&!!e.anchor,"hasAnchor");fu.ALIAS=rbe;fu.DOC=qat;fu.MAP=fW;fu.NODE_TYPE=D1;fu.PAIR=Uat;fu.SCALAR=nbe;fu.SEQ=hW;fu.hasAnchor=HBr;fu.isAlias=BBr;fu.isCollection=Vat;fu.isDocument=jBr;fu.isMap=qBr;fu.isNode=VBr;fu.isPair=UBr;fu.isScalar=$at;fu.isSeq=$Br});var W9=E(ibe=>{"use strict";var Tl=So(),jd=Symbol("break visit"),Hat=Symbol("skip children"),Ly=Symbol("remove node");function mW(e,t){let r=Gat(t);Tl.isDocument(e)?Zx(null,e.contents,r,Object.freeze([e]))===Ly&&(e.contents=null):Zx(null,e,r,Object.freeze([]))}a(mW,"visit");mW.BREAK=jd;mW.SKIP=Hat;mW.REMOVE=Ly;function Zx(e,t,r,n){let i=zat(e,t,r,n);if(Tl.isNode(i)||Tl.isPair(i))return Kat(e,n,i),Zx(e,i,r,n);if(typeof i!="symbol"){if(Tl.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let u=Zx(o,t.items[o],r,n);if(typeof u=="number")o=u-1;else{if(u===jd)return jd;u===Ly&&(t.items.splice(o,1),o-=1)}}}else if(Tl.isPair(t)){n=Object.freeze(n.concat(t));let o=Zx("key",t.key,r,n);if(o===jd)return jd;o===Ly&&(t.key=null);let u=Zx("value",t.value,r,n);if(u===jd)return jd;u===Ly&&(t.value=null)}}return i}a(Zx,"visit_");async function gW(e,t){let r=Gat(t);Tl.isDocument(e)?await ek(null,e.contents,r,Object.freeze([e]))===Ly&&(e.contents=null):await ek(null,e,r,Object.freeze([]))}a(gW,"visitAsync");gW.BREAK=jd;gW.SKIP=Hat;gW.REMOVE=Ly;async function ek(e,t,r,n){let i=await zat(e,t,r,n);if(Tl.isNode(i)||Tl.isPair(i))return Kat(e,n,i),ek(e,i,r,n);if(typeof i!="symbol"){if(Tl.isCollection(t)){n=Object.freeze(n.concat(t));for(let o=0;o<t.items.length;++o){let u=await ek(o,t.items[o],r,n);if(typeof u=="number")o=u-1;else{if(u===jd)return jd;u===Ly&&(t.items.splice(o,1),o-=1)}}}else if(Tl.isPair(t)){n=Object.freeze(n.concat(t));let o=await ek("key",t.key,r,n);if(o===jd)return jd;o===Ly&&(t.key=null);let u=await ek("value",t.value,r,n);if(u===jd)return jd;u===Ly&&(t.value=null)}}return i}a(ek,"visitAsync_");function Gat(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}a(Gat,"initVisitor");function zat(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(Tl.isMap(t))return r.Map?.(e,t,n);if(Tl.isSeq(t))return r.Seq?.(e,t,n);if(Tl.isPair(t))return r.Pair?.(e,t,n);if(Tl.isScalar(t))return r.Scalar?.(e,t,n);if(Tl.isAlias(t))return r.Alias?.(e,t,n)}a(zat,"callVisitor");function Kat(e,t,r){let n=t[t.length-1];if(Tl.isCollection(n))n.items[e]=r;else if(Tl.isPair(n))e==="key"?n.key=r:n.value=r;else if(Tl.isDocument(n))n.contents=r;else{let i=Tl.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(Kat,"replaceNode");ibe.visit=mW;ibe.visitAsync=gW});var obe=E(Yat=>{"use strict";var Wat=So(),GBr=W9(),zBr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},KBr=a(e=>e.replace(/[!,[\]{}]/g,t=>zBr[t]),"escapeTagName"),Y9=class e{static{a(this,"Directives")}constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,r)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,u]=n;return this.tags[o]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let u=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,u),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let u=t.slice(2,-1);return u==="!"||u==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),u)}let[,n,i]=t.match(/^(.*!)([^!]*)$/s);i||r(`The ${t} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(u){return r(String(u)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+KBr(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(t&&n.length>0&&Wat.isNode(t.contents)){let o={};GBr.visit(t.contents,(u,d)=>{Wat.isNode(d)&&d.tag&&(o[d.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,u]of n)o==="!!"&&u==="tag:yaml.org,2002:"||(!t||i.some(d=>d.startsWith(u)))&&r.push(`%TAG ${o} ${u}`);return r.join(`
|
|
28
28
|
`)}};Y9.defaultYaml={explicit:!1,version:"1.2"};Y9.defaultTags={"!!":"tag:yaml.org,2002:"};Yat.Directives=Y9});var yW=E(J9=>{"use strict";var Jat=So(),WBr=W9();function YBr(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(r)}return!0}a(YBr,"anchorIsValid");function Qat(e){let t=new Set;return WBr.visit(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}a(Qat,"anchorNames");function Xat(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}a(Xat,"findNewAnchor");function JBr(e,t){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i||(i=Qat(e));let u=Xat(t,i);return i.add(u),u},setAnchors:()=>{for(let o of r){let u=n.get(o);if(typeof u=="object"&&u.anchor&&(Jat.isScalar(u.node)||Jat.isCollection(u.node)))u.node.anchor=u.anchor;else{let d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=o,d}}},sourceObjects:n}}a(JBr,"createNodeAnchors");J9.anchorIsValid=YBr;J9.anchorNames=Qat;J9.createNodeAnchors=JBr;J9.findNewAnchor=Xat});var abe=E(Zat=>{"use strict";function Q9(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let u=n[i],d=Q9(e,n,String(i),u);d===void 0?delete n[i]:d!==u&&(n[i]=d)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),u=Q9(e,n,i,o);u===void 0?n.delete(i):u!==o&&n.set(i,u)}else if(n instanceof Set)for(let i of Array.from(n)){let o=Q9(e,n,i,i);o===void 0?n.delete(i):o!==i&&(n.delete(i),n.add(o))}else for(let[i,o]of Object.entries(n)){let u=Q9(e,n,i,o);u===void 0?delete n[i]:u!==o&&(n[i]=u)}return e.call(t,r,n)}a(Q9,"applyReviver");Zat.applyReviver=Q9});var ZE=E(tst=>{"use strict";var QBr=So();function est(e,t,r){if(Array.isArray(e))return e.map((n,i)=>est(n,String(i),r));if(e&&typeof e.toJSON=="function"){if(!r||!QBr.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=e.toJSON(t,r);return r.onCreate&&r.onCreate(i),i}return typeof e=="bigint"&&!r?.keep?Number(e):e}a(est,"toJS");tst.toJS=est});var vW=E(nst=>{"use strict";var XBr=abe(),rst=So(),ZBr=ZE(),sbe=class{static{a(this,"NodeBase")}constructor(t){Object.defineProperty(this,rst.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!rst.isDocument(t))throw new TypeError("A document argument is required");let u={anchors:new Map,doc:t,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},d=ZBr.toJS(this,"",u);if(typeof i=="function")for(let{count:p,res:s}of u.anchors.values())i(s,p);return typeof o=="function"?XBr.applyReviver(o,{"":d},"",d):d}};nst.NodeBase=sbe});var X9=E(ost=>{"use strict";var e7r=yW(),ist=W9(),bW=So(),t7r=vW(),r7r=ZE(),lbe=class extends t7r.NodeBase{static{a(this,"Alias")}constructor(t){super(bW.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let r;return ist.visit(t,{Node:(n,i)=>{if(i===this)return ist.visit.BREAK;i.anchor===this.source&&(r=i)}}),r}toJSON(t,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,u=this.resolve(i);if(!u){let p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let d=n.get(u);if(d||(r7r.toJS(u,null,r),d=n.get(u)),!d||d.res===void 0){let p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(o>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=EW(i,u,n)),d.count*d.aliasCount>o)){let p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return d.res}toString(t,r,n){let i=`*${this.source}`;if(t){if(e7r.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}};function EW(e,t,r){if(bW.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(bW.isCollection(t)){let n=0;for(let i of t.items){let o=EW(e,i,r);o>n&&(n=o)}return n}else if(bW.isPair(t)){let n=EW(e,t.key,r),i=EW(e,t.value,r);return Math.max(n,i)}return 1}a(EW,"getAliasCount");ost.Alias=lbe});var Zs=E(ube=>{"use strict";var n7r=So(),i7r=vW(),o7r=ZE(),a7r=a(e=>!e||typeof e!="function"&&typeof e!="object","isScalarValue"),e_=class extends i7r.NodeBase{static{a(this,"Scalar")}constructor(t){super(n7r.SCALAR),this.value=t}toJSON(t,r){return r?.keep?this.value:o7r.toJS(this.value,t,r)}toString(){return String(this.value)}};e_.BLOCK_FOLDED="BLOCK_FOLDED";e_.BLOCK_LITERAL="BLOCK_LITERAL";e_.PLAIN="PLAIN";e_.QUOTE_DOUBLE="QUOTE_DOUBLE";e_.QUOTE_SINGLE="QUOTE_SINGLE";ube.Scalar=e_;ube.isScalarValue=a7r});var Z9=E(sst=>{"use strict";var s7r=X9(),rT=So(),ast=Zs(),l7r="tag:yaml.org,2002:";function u7r(e,t,r){if(t){let n=r.filter(o=>o.tag===t),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return r.find(n=>n.identify?.(e)&&!n.format)}a(u7r,"findTagObject");function c7r(e,t,r){if(rT.isDocument(e)&&(e=e.contents),rT.isNode(e))return e;if(rT.isPair(e)){let l=r.schema[rT.MAP].createNode?.(r.schema,null,r);return l.items.push(e),l}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:u,sourceObjects:d}=r,p;if(n&&e&&typeof e=="object"){if(p=d.get(e),p)return p.anchor||(p.anchor=i(e)),new s7r.Alias(p.anchor);p={anchor:null,node:null},d.set(e,p)}t?.startsWith("!!")&&(t=l7r+t.slice(2));let s=u7r(e,t,u.tags);if(!s){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let l=new ast.Scalar(e);return p&&(p.node=l),l}s=e instanceof Map?u[rT.MAP]:Symbol.iterator in Object(e)?u[rT.SEQ]:u[rT.MAP]}o&&(o(s),delete r.onTagObj);let c=s?.createNode?s.createNode(r.schema,e,r):typeof s?.nodeClass?.from=="function"?s.nodeClass.from(r.schema,e,r):new ast.Scalar(e);return t?c.tag=t:s.default||(c.tag=s.tag),p&&(p.node=c),c}a(c7r,"createNode");sst.createNode=c7r});var eF=E(SW=>{"use strict";var d7r=Z9(),Fy=So(),p7r=vW();function cbe(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let u=[];u[o]=n,n=u}else n=new Map([[o,n]])}return d7r.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}a(cbe,"collectionFromPath");var lst=a(e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,"isEmptyPath"),_W=class extends p7r.NodeBase{static{a(this,"Collection")}constructor(t,r){super(t),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(t){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(r.schema=t),r.items=r.items.map(n=>Fy.isNode(n)||Fy.isPair(n)?n.clone(t):n),this.range&&(r.range=this.range.slice()),r}addIn(t,r){if(lst(t))this.add(r);else{let[n,...i]=t,o=this.get(n,!0);if(Fy.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,cbe(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){let[r,...n]=t;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Fy.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){let[n,...i]=t,o=this.get(n,!0);return i.length===0?!r&&Fy.isScalar(o)?o.value:o:Fy.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!Fy.isPair(r))return!1;let n=r.value;return n==null||t&&Fy.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){let[r,...n]=t;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Fy.isCollection(i)?i.hasIn(n):!1}setIn(t,r){let[n,...i]=t;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Fy.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,cbe(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};_W.maxFlowStringSingleLineLength=60;SW.Collection=_W;SW.collectionFromPath=cbe;SW.isEmptyPath=lst});var tF=E(wW=>{"use strict";var f7r=a(e=>e.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function dbe(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}a(dbe,"indentComment");var h7r=a((e,t,r)=>e.endsWith(`
|
|
29
29
|
`)?dbe(r,t):r.includes(`
|
|
30
30
|
`)?`
|
|
@@ -848,7 +848,7 @@ Too many redirects:
|
|
|
848
848
|
`)}a(Grr,"generateRawRouteSource");Rw.generateRawRouteSource=Grr;function jTi(e,t,r,n,i){let o=[];for(let d=0;d<n.length;d++){let p=zrr(t,d);o.push(`const ${p} = {`);let s=r.get(n.at(d));o.push(rde((0,XV.getFilePathNameFromRefName)(n.at(d)),t,s,r,n,i)),o.push("};")}return o.join(`
|
|
849
849
|
`)}a(jTi,"generateRefs");function qTi(e,t,r,n,i,o,u){let d=[];d.push(`${r}: {`);let p=rde(e,t,n,i,o,u);return d.push(p),d.push("}"),d.join(`
|
|
850
850
|
`)}a(qTi,"getJsonEntry");function rde(e,t,r,n,i,o){let u=[];for(let d in r){let p=r[d];if(d==="$ref")return(0,XV.chaseRefs)(e,t,(0,XV.getFullyQualifiedRefName)(e,p),n,i,o),`$REF:${zrr(t,o.get((0,XV.getFullyQualifiedRefName)(e,p)))}`;switch(typeof p){case"string":{u.push(`"${d}": ${JSON.stringify(p)},`);break}case"number":case"boolean":{u.push(`"${d}":${p},`);break}default:if(Array.isArray(p))u.push(`"${d}":[`),p.forEach(s=>{if(typeof s=="object"){let c=rde(e,t,s,n,i,o);if(c.startsWith("$REF")){let l=c.split(":")[1];u.push(`${l},`)}else u.push("{"),u.push(c),u.push("},")}else u.push(`${JSON.stringify(s)},`)}),u.push("],");else{let s=rde(e,t,p,n,i,o);if(s.startsWith("$REF")){let c=s.split(":")[1];u.push(`${d}: ${c},`)}else u.push(`"${d}":{`),u.push(s),u.push("},")}}}return u.join(`
|
|
851
|
-
`)}a(rde,"processNode");function zrr(e,t){return(0,Vrr.sanitizedIdentifierName)(e)+`_refsData_${t}`}a(zrr,"getRefIdentifierName")});var Yrr=E(U4=>{"use strict";var vHe=U4&&U4.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U4,"__esModule",{value:!0});U4.runtimeConfigPlugin=void 0;var UTi=Cn(),$Ti=vHe(require("fs/promises")),yHe=vHe(require("path")),VTi=vHe(qo()),ide="runtime-config",Wrr="runtime-config-plugin";function HTi(){return{name:ide,setup(e){e.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},t=>({namespace:Wrr,path:yHe.default.isAbsolute(t.path)?t.path:yHe.default.join(t.resolveDir,t.path),pluginName:ide})),e.onLoad({filter:/.*/,namespace:Wrr},async t=>VTi.default.timeFn("Generating zuplo.runtime.ts data",async()=>{let r="export const runtimeInit = undefined;",n=[];return await UTi.xfs.fileExists(t.path)?(r=await $Ti.default.readFile(t.path,"utf-8"),{contents:r,loader:"ts",resolveDir:yHe.default.dirname(t.path),errors:n,pluginName:ide,watchFiles:[t.path]}):{contents:r,loader:"ts",errors:n,pluginName:ide}}))}}}a(HTi,"runtimeConfigPlugin");U4.runtimeConfigPlugin=HTi});var tnr=E(bm=>{"use strict";var $4=bm&&bm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bm,"__esModule",{value:!0});bm.isPolicyPresentInOperation=bm.getPolicyNamesReferencingPolicyHandlers=bm.schemaValidationSource=bm.schemaValidationPlugin=void 0;var Jrr=Cn(),eH=require("@zuplo/runtime/internal"),GTi=$4(hUe()),zTi=$4(mUe()),ode=$4(require("fs/promises")),Nw=$4(require("path")),KTi=$4(require("prettier")),bHe=zn(),WTi=$4(ow()),YTi=QV(),ZV=MC(),EHe="schema-validation-plugin",Qrr="schema-validation",JTi="module.exports = {}";function QTi(e){return{name:"schema-validation-plugin",setup(t){t.onResolve({filter:/ajv-schema.json$/},r=>({namespace:Qrr,path:r.path,pluginName:EHe})),t.onLoad({filter:/.*/,namespace:Qrr},async r=>{let n=Nw.default.resolve(e.sourceDirectory,bHe.USER_CONFIG_DIR_NAME,"policies.json");if(!e.isOpenApiBased||!await Jrr.xfs.fileExists(n))return{contents:JTi,loader:"js",resolveDir:Nw.default.dirname(r.path),pluginName:EHe};let i=await XTi(e.sourceDirectory),o=Nw.default.resolve(e.sourceDirectory,bHe.USER_CONFIG_DIR_NAME),u=await(0,ZV.getOpenApiFilesByAlphabetical)(o),d=await eAi(u,i),p=await Xrr({oasFiles:u,routesWithSchemaValidation:d,sourceDirectory:e.sourceDirectory,logger:e.logger});if(WTi.default.DEBUG_BUILD_MODE&&p){let s=Nw.default.join(e.sourceDirectory,bHe.BUILD_OUTPUT_DIR),c=Nw.default.resolve(s,"schema-validation.js");await Jrr.xfs.mkdirForFilePathIfNotExits(c);let l=await KTi.default.format(p,{parser:"babel"});await ode.default.writeFile(c,l,"utf-8")}return{contents:p,loader:"js",resolveDir:Nw.default.dirname(r.path),pluginName:EHe}})}}}a(QTi,"schemaValidationPlugin");bm.schemaValidationPlugin=QTi;async function Xrr({oasFiles:e,routesWithSchemaValidation:t,sourceDirectory:r,logger:n}){let i="",o=new YTi.RefParser(r,n);if(t.length===0)return i;let u=new GTi.default({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let d of e){let p=await ode.default.readFile(d,"utf-8"),s=Nw.default.basename(d,".oas.json"),c=t.filter(b=>b.fileName===s),l=await o.resolve(d),f=JSON.parse(p),h=[],y=new Map;c.forEach(b=>{let _=f.paths[b.path][b.method];if(_.requestBody){let w;if(_.requestBody.$ref){let k=_.requestBody.$ref;w=l.get(k)?.content}else _.requestBody.content&&(w=_.requestBody.content);if(w)for(let k in w){let C=w[k].schema,P=(0,eH.getIdForRequestBodySchema)(b.path,b.method,k);C.$id=P,u.addSchema(C),_He(C,d,s,u,l,h,y)}}if(_.parameters)for(let w of _.parameters){let k=w.$ref?l.get(w.$ref):w,C=k.schema.$ref?l.get(k.schema.$ref):k.schema,P=(0,eH.getIdForParameterSchema)(b.path,b.method,k.in,k.name);C.$id=P,u.addSchema(C),_He(k,d,s,u,l,h,y)}});for(let b of h){let _=l.get(b),w=(0,eH.getIdForRefSchema)(s,b);u.addSchema(_,w)}}return i=(0,zTi.default)(u),i}a(Xrr,"schemaValidationSource");bm.schemaValidationSource=Xrr;function _He(e,t,r,n,i,o,u){for(let d in e){let p=e[d];if(d==="$ref"){let s=(0,eH.getIdForRefSchema)(r,(0,ZV.getFullyQualifiedRefName)(t,p));e[d]=s,(0,ZV.chaseRefs)(t,r,(0,ZV.getFullyQualifiedRefName)(t,p),i,o,u,(c,l)=>(0,eH.getIdForRefSchema)(c,(0,ZV.getFullyQualifiedRefName)(t,l)))}else typeof p=="object"&&_He(p,t,r,n,i,o,u)}}a(_He,"addRefsToSchema");async function XTi(e){let t=new Set(["RequestValidationInboundPolicy"]),r=await ode.default.readFile(`${e}/config/policies.json`,"utf-8"),n=JSON.parse(r);return Zrr(n,t)}a(XTi,"getPolicyNamesUsingSchemaValidationPolicies");function Zrr(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=ZTi(e,r);return new Set([...r,...n])}a(Zrr,"getPolicyNamesReferencingPolicyHandlers");bm.getPolicyNamesReferencingPolicyHandlers=Zrr;function ZTi(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}a(ZTi,"getCompositePoliciesContainingPolicy");function enr(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}a(enr,"isPolicyPresentInOperation");bm.isPolicyPresentInOperation=enr;async function eAi(e,t){let r=[];for(let n of e){let i=await ode.default.readFile(n,"utf-8"),u=JSON.parse(i).paths;for(let d in u){let p=u[d];for(let s in p){let c=p[s];enr(c,t)&&r.push({fileName:Nw.default.basename(n,".oas.json"),path:d,method:s})}}}return r}a(eAi,"getRoutesContainingPolicies")});var SHe=E(Dw=>{"use strict";var tAi=Dw&&Dw.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dw,"__esModule",{value:!0});Dw.BUILD_CONDITIONS=void 0;var rAi=cKt(),rnr=tAi(require("path")),nAi=m$(),iAi=dKt(),oAi=mKt(),aAi=bKt(),sAi=bJt(),lAi=_Jt(),uAi=ser(),cAi=Krr(),dAi=Yrr(),pAi=tnr(),fAi=(0,rAi.debug)("zuplo:core:build");Dw.BUILD_CONDITIONS=["workerd","worker","browser"];var nnr=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],...require.main?.paths??[]];async function hAi({dev:e=!1,targetPlatform:t,systemDirectory:r,outputDirectory:n,sourceDirectory:i,logger:o,flags:u}){let d=rnr.default.join(r,(0,nAi.getBuildEntry)(t));fAi(`Building with node paths: ${nnr.join(", ")}`);let p=e===!1?{minify:!0}:{minify:!1,keepNames:!0,metafile:!0},s={platform:"browser",
|
|
851
|
+
`)}a(rde,"processNode");function zrr(e,t){return(0,Vrr.sanitizedIdentifierName)(e)+`_refsData_${t}`}a(zrr,"getRefIdentifierName")});var Yrr=E(U4=>{"use strict";var vHe=U4&&U4.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U4,"__esModule",{value:!0});U4.runtimeConfigPlugin=void 0;var UTi=Cn(),$Ti=vHe(require("fs/promises")),yHe=vHe(require("path")),VTi=vHe(qo()),ide="runtime-config",Wrr="runtime-config-plugin";function HTi(){return{name:ide,setup(e){e.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},t=>({namespace:Wrr,path:yHe.default.isAbsolute(t.path)?t.path:yHe.default.join(t.resolveDir,t.path),pluginName:ide})),e.onLoad({filter:/.*/,namespace:Wrr},async t=>VTi.default.timeFn("Generating zuplo.runtime.ts data",async()=>{let r="export const runtimeInit = undefined;",n=[];return await UTi.xfs.fileExists(t.path)?(r=await $Ti.default.readFile(t.path,"utf-8"),{contents:r,loader:"ts",resolveDir:yHe.default.dirname(t.path),errors:n,pluginName:ide,watchFiles:[t.path]}):{contents:r,loader:"ts",errors:n,pluginName:ide}}))}}}a(HTi,"runtimeConfigPlugin");U4.runtimeConfigPlugin=HTi});var tnr=E(bm=>{"use strict";var $4=bm&&bm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bm,"__esModule",{value:!0});bm.isPolicyPresentInOperation=bm.getPolicyNamesReferencingPolicyHandlers=bm.schemaValidationSource=bm.schemaValidationPlugin=void 0;var Jrr=Cn(),eH=require("@zuplo/runtime/internal"),GTi=$4(hUe()),zTi=$4(mUe()),ode=$4(require("fs/promises")),Nw=$4(require("path")),KTi=$4(require("prettier")),bHe=zn(),WTi=$4(ow()),YTi=QV(),ZV=MC(),EHe="schema-validation-plugin",Qrr="schema-validation",JTi="module.exports = {}";function QTi(e){return{name:"schema-validation-plugin",setup(t){t.onResolve({filter:/ajv-schema.json$/},r=>({namespace:Qrr,path:r.path,pluginName:EHe})),t.onLoad({filter:/.*/,namespace:Qrr},async r=>{let n=Nw.default.resolve(e.sourceDirectory,bHe.USER_CONFIG_DIR_NAME,"policies.json");if(!e.isOpenApiBased||!await Jrr.xfs.fileExists(n))return{contents:JTi,loader:"js",resolveDir:Nw.default.dirname(r.path),pluginName:EHe};let i=await XTi(e.sourceDirectory),o=Nw.default.resolve(e.sourceDirectory,bHe.USER_CONFIG_DIR_NAME),u=await(0,ZV.getOpenApiFilesByAlphabetical)(o),d=await eAi(u,i),p=await Xrr({oasFiles:u,routesWithSchemaValidation:d,sourceDirectory:e.sourceDirectory,logger:e.logger});if(WTi.default.DEBUG_BUILD_MODE&&p){let s=Nw.default.join(e.sourceDirectory,bHe.BUILD_OUTPUT_DIR),c=Nw.default.resolve(s,"schema-validation.js");await Jrr.xfs.mkdirForFilePathIfNotExits(c);let l=await KTi.default.format(p,{parser:"babel"});await ode.default.writeFile(c,l,"utf-8")}return{contents:p,loader:"js",resolveDir:Nw.default.dirname(r.path),pluginName:EHe}})}}}a(QTi,"schemaValidationPlugin");bm.schemaValidationPlugin=QTi;async function Xrr({oasFiles:e,routesWithSchemaValidation:t,sourceDirectory:r,logger:n}){let i="",o=new YTi.RefParser(r,n);if(t.length===0)return i;let u=new GTi.default({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let d of e){let p=await ode.default.readFile(d,"utf-8"),s=Nw.default.basename(d,".oas.json"),c=t.filter(b=>b.fileName===s),l=await o.resolve(d),f=JSON.parse(p),h=[],y=new Map;c.forEach(b=>{let _=f.paths[b.path][b.method];if(_.requestBody){let w;if(_.requestBody.$ref){let k=_.requestBody.$ref;w=l.get(k)?.content}else _.requestBody.content&&(w=_.requestBody.content);if(w)for(let k in w){let C=w[k].schema,P=(0,eH.getIdForRequestBodySchema)(b.path,b.method,k);C.$id=P,u.addSchema(C),_He(C,d,s,u,l,h,y)}}if(_.parameters)for(let w of _.parameters){let k=w.$ref?l.get(w.$ref):w,C=k.schema.$ref?l.get(k.schema.$ref):k.schema,P=(0,eH.getIdForParameterSchema)(b.path,b.method,k.in,k.name);C.$id=P,u.addSchema(C),_He(k,d,s,u,l,h,y)}});for(let b of h){let _=l.get(b),w=(0,eH.getIdForRefSchema)(s,b);u.addSchema(_,w)}}return i=(0,zTi.default)(u),i}a(Xrr,"schemaValidationSource");bm.schemaValidationSource=Xrr;function _He(e,t,r,n,i,o,u){for(let d in e){let p=e[d];if(d==="$ref"){let s=(0,eH.getIdForRefSchema)(r,(0,ZV.getFullyQualifiedRefName)(t,p));e[d]=s,(0,ZV.chaseRefs)(t,r,(0,ZV.getFullyQualifiedRefName)(t,p),i,o,u,(c,l)=>(0,eH.getIdForRefSchema)(c,(0,ZV.getFullyQualifiedRefName)(t,l)))}else typeof p=="object"&&_He(p,t,r,n,i,o,u)}}a(_He,"addRefsToSchema");async function XTi(e){let t=new Set(["RequestValidationInboundPolicy"]),r=await ode.default.readFile(`${e}/config/policies.json`,"utf-8"),n=JSON.parse(r);return Zrr(n,t)}a(XTi,"getPolicyNamesUsingSchemaValidationPolicies");function Zrr(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=ZTi(e,r);return new Set([...r,...n])}a(Zrr,"getPolicyNamesReferencingPolicyHandlers");bm.getPolicyNamesReferencingPolicyHandlers=Zrr;function ZTi(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}a(ZTi,"getCompositePoliciesContainingPolicy");function enr(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}a(enr,"isPolicyPresentInOperation");bm.isPolicyPresentInOperation=enr;async function eAi(e,t){let r=[];for(let n of e){let i=await ode.default.readFile(n,"utf-8"),u=JSON.parse(i).paths;for(let d in u){let p=u[d];for(let s in p){let c=p[s];enr(c,t)&&r.push({fileName:Nw.default.basename(n,".oas.json"),path:d,method:s})}}}return r}a(eAi,"getRoutesContainingPolicies")});var SHe=E(Dw=>{"use strict";var tAi=Dw&&Dw.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dw,"__esModule",{value:!0});Dw.BUILD_CONDITIONS=void 0;var rAi=cKt(),rnr=tAi(require("path")),nAi=m$(),iAi=dKt(),oAi=mKt(),aAi=bKt(),sAi=bJt(),lAi=_Jt(),uAi=ser(),cAi=Krr(),dAi=Yrr(),pAi=tnr(),fAi=(0,rAi.debug)("zuplo:core:build");Dw.BUILD_CONDITIONS=["workerd","worker","browser"];var nnr=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],...require.main?.paths??[]];async function hAi({dev:e=!1,targetPlatform:t,systemDirectory:r,outputDirectory:n,sourceDirectory:i,logger:o,flags:u}){let d=rnr.default.join(r,(0,nAi.getBuildEntry)(t));fAi(`Building with node paths: ${nnr.join(", ")}`);let p=e===!1?{minify:!0}:{minify:!1,keepNames:!0,metafile:!0},s={platform:"browser",target:"es2022",outfile:rnr.default.join(n,"worker.js")};return{format:u?.esmWorker===!0?"esm":"iife",banner:{js:`'use strict';
|
|
852
852
|
`},nodePaths:nnr,entryPoints:[d],...s,sourcemap:"linked",treeShaking:!0,bundle:!0,...p,external:[],logLevel:"silent",conditions:Dw.BUILD_CONDITIONS,plugins:[(0,aAi.environmentPlugin)({sourceDirectory:i,targetPlatform:t}),(0,iAi.blockRemoteModulePlugin)({logger:o}),(0,uAi.openApiRoutesPlugin)({sourceDirectory:i,outputDirectory:n}),(0,cAi.rawRoutePlugin)({sourceDirectory:i,targetPlatform:t,logger:o}),(0,pAi.schemaValidationPlugin)({sourceDirectory:i,logger:o,isOpenApiBased:!0}),(0,dAi.runtimeConfigPlugin)(),(0,oAi.devPortalConfigPlugin)({sourceDirectory:i}),(0,sAi.jsonSchemaPlugin)({sourceDirectory:i,outputDirectory:n}),(0,lAi.nodejsCompatPlugin)({nodeCompatEnabled:u?.esmWorker===!0,sourceDirectory:i})]}}a(hAi,"getBaseESBuildConfig");Dw.default=hAi});var anr=E(Em=>{"use strict";var mAi=Em&&Em.__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]}),gAi=Em&&Em.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yAi=Em&&Em.__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)&&mAi(t,e,r);return gAi(t,e),t},onr=Em&&Em.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Em,"__esModule",{value:!0});Em.getRunEsBuildPlugin=void 0;var inr=Cn(),vAi=yAi(require("esbuild")),bAi=onr(qo()),EAi=yle(),_Ai=onr(SHe()),SAi=MC(),wHe=m$(),wAi=a(function(e){return a(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,targetPlatform:u,generateSourceMaps:d,buildId:p,logger:s,flags:c}){return bAi.default.timeFn("Running esbuild",async()=>{s.info(`Running build for platform ${u}, build_id: ${p}`);let l=await(0,_Ai.default)({systemDirectory:r,outputDirectory:n,targetPlatform:u,generateSourceMaps:d,sourceDirectory:i,dev:o,logger:s,flags:c}),f,h=new Date;try{if(!await(0,SAi.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");f=await vAi.build(l)}catch(b){if(s.error(b),b.errors||b.warnings)f=b;else if(b.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))f={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:wHe.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 b}let y=new Date;if(e(new EAi.CompilerResult(f,{endBuildTime:y,startBuildTime:h,buildId:p??""})),f.errors.length>0){f.errors.length>1&&(f.errors.length=1);let b=f.errors[0];s.debug(b)}return{warnings:[...f.warnings.map(b=>({message:b.text,pluginName:wHe.ESBUILD_PLUGIN_NAME,severity:inr.WARNING_SEVERITY}))],errors:[...f.errors.map(b=>({message:b.text,pluginName:wHe.ESBUILD_PLUGIN_NAME,severity:inr.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Em.getRunEsBuildPlugin=wAi});var CHe=E(V4=>{"use strict";var lnr=V4&&V4.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V4,"__esModule",{value:!0});V4.build=void 0;var OHe=Cn(),OAi=require("crypto"),TAi=require("fs"),tH=lnr(require("path")),snr=zn(),AAi=xl(),CAi=lnr(qo()),PAi=rje(),xAi=d$(),kAi=Tzt(),RAi=Czt(),NAi=Pzt(),DAi=Nzt(),IAi=Dzt(),LAi=Bzt(),FAi=Yzt(),MAi=Jzt(),BAi=anr(),THe=m$(),AHe;try{let e=(0,TAi.readFileSync)(tH.default.resolve(__dirname,"../../package.json"),"utf-8");AHe=JSON.parse(e).version}catch{AHe="0.0.0"}async function jAi({sourceDirectory:e,dev:t,targetPlatform:r,generateSourceMaps:n=!1,noCompile:i=!1,deploymentSecret:o,deploymentName:u=tH.default.basename(e),logger:d,publicZuploEnvironmentVariables:p={},entitlements:s,projectId:c,customDomain:l,environmentType:f,postBuildActions:h}){let y=(0,OAi.randomUUID)(),b=d.child({buildId:y});return CAi.default.timeFn(`Run Build for platform: ${r}, build_id: ${y}`,async()=>{let _=await(0,PAi.getZuploConfig)(e),w={dev:t,targetPlatform:r,generateSourceMaps:n,deploymentName:u,sourceDirectory:e,outputDirectory:tH.default.join(e,snr.BUILD_OUTPUT_DIR),systemDirectory:tH.default.join(e,snr.GENERATED_SOURCE_DIR_NAME),buildId:y,logger:b,config:_.config,publicZuploEnvironmentVariables:p,projectId:c,entitlements:s,customDomain:l,environmentType:f,flags:_.config?.flags},k=[];k.push(kAi.cleanOutput),k.push(RAi.createSystemDir),k.push(NAi.checkForDeprecations),k.push(DAi.generateBuildData),k.push(LAi.validateDevPortalJSON),k.push(FAi.validateOpenAPIFiles),r==xAi.TargetPlatform.Worker&&k.push(IAi.generateWorker);let C={compatibilityDate:_.config?.compatibilityDate,runtimeVersion:AHe,outputPath:w.outputDirectory,buildTaskResult:{buildTime:"",buildTimeMs:0,status:OHe.GOOD_STATUS,buildId:y,warnings:[],errors:[..._.errors]},flags:_.config?.flags},P=a(B=>{C.compilerResult=B},"compileCallback");i||k.push((0,BAi.getRunEsBuildPlugin)(P)),k.push(MAi.verifyWorkerOutput);let{errors:N,warnings:D}=_.errors.length>0?{errors:_.errors,warnings:[]}:await(0,AAi.runPlugins)(k,w);if(D.length>0){D.forEach(U=>{b.warn(U)});let B=D.filter(U=>U.pluginName!=="runEsbuild"&&U.pluginName!==THe.ESBUILD_PLUGIN_NAME);B.length>0&&(C.buildTaskResult.warnings=B),C.buildTaskResult.status=OHe.WARNING_STATUS}if(N.length>0){N.forEach(U=>{b.error(U)});let B=N.filter(U=>U.pluginName!=="runEsbuild"&&U.pluginName!==THe.ESBUILD_PLUGIN_NAME);B.length>0&&(C.buildTaskResult.errors=B),C.buildTaskResult.status=OHe.FAILURE_STATUS}if(b.debug(`Build ${C.compilerResult?.buildId??y} completed ${i?"on watch mode":"with compiler status "+C.compilerResult?.status} and build task status ${C.buildTaskResult.status}`),h){let B=[];for(let U of h)B.push(U({buildLogger:b,result:C,deploymentSecret:o,sourceDirectory:e,deploymentName:u,buildId:y}));await Promise.all(B)}if(C.compilerResult){let{metafile:B,...U}=C.compilerResult;b.debug(`Compiler results for build ${C.compilerResult?.buildId??y}`,U)}b.debug(`Build task results for build ${C.buildTaskResult?.buildId??y}`,C.buildTaskResult);let L=tH.default.basename(e);return(0,THe.formatBuildResult)(C,L,b)})}a(jAi,"build");V4.build=jAi});var kHe=E(_m=>{"use strict";var qAi=_m&&_m.__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]}),UAi=_m&&_m.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$Ai=_m&&_m.__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)&&qAi(t,e,r);return UAi(t,e),t},ade=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_m,"__esModule",{value:!0});_m.BuildWatcher=void 0;var unr=Cn(),VAi=ade(require("chokidar")),HAi=$Ai(require("esbuild")),cnr=require("crypto"),GAi=ade(require("events")),rH=ade(require("path")),dnr=zn(),zAi=CHe(),pnr=yle(),KAi=ade(SHe()),fnr=m$(),PHe=class extends GAi.default{static{a(this,"WatchEmitter")}},xHe=class{static{a(this,"BuildWatcher")}esbuildContext;emitter=new PHe;envFilesWatcher;outputDirectory;sourceDirectory;dev;targetPlatform;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,targetPlatform:n,generateSourceMaps:i,logger:o,publicZuploEnvironmentVariables:u={}}){this.sourceDirectory=t,this.dev=r,this.targetPlatform=n,this.outputDirectory=rH.default.join(t,dnr.BUILD_OUTPUT_DIR),this.generateSourceMaps=i??!1,this.logger=o,this.publicZuploEnvironmentVariables=u,this.projectName=rH.default.basename(t),this.envFilesWatcher=VAi.default.watch([rH.default.join(t,".env"),rH.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,zAi.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,targetPlatform:this.targetPlatform,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,KAi.default)({systemDirectory:rH.default.join(t,dnr.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(u=>{i.logger.debug("Watcher (build) reloaded");let d;if(u)if(d=new pnr.CompilerResult(u),d.errors.length>0){let p={compatibilityDate:void 0,flags:void 0,runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:unr.FAILURE_STATUS,buildId:(0,cnr.randomUUID)(),warnings:[],errors:[]}};p.compilerResult=d,(0,fnr.formatBuildResult)(p,i.projectName,i.logger),i.logger.error(p.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${d.buildId}`);i.emitter.emit("reload",null,d)})}}),this.esbuildContext=await HAi.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let u={compatibilityDate:void 0,flags:void 0,runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:unr.FAILURE_STATUS,buildId:(0,cnr.randomUUID)(),warnings:[],errors:[]}};u.compilerResult=new pnr.CompilerResult(o),(0,fnr.formatBuildResult)(u,this.projectName,this.logger),this.logger.error(u.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)}}};_m.BuildWatcher=xHe});var vnr=E((NNa,ynr)=>{ynr.exports=gnr;gnr.sync=YAi;var hnr=require("fs");function WAi(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}a(WAi,"checkPathExt");function mnr(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:WAi(t,r)}a(mnr,"checkStat");function gnr(e,t,r){hnr.stat(e,function(n,i){r(n,n?!1:mnr(i,e,t))})}a(gnr,"isexe");function YAi(e,t){return mnr(hnr.statSync(e),e,t)}a(YAi,"sync")});var wnr=E((INa,Snr)=>{Snr.exports=Enr;Enr.sync=JAi;var bnr=require("fs");function Enr(e,t,r){bnr.stat(e,function(n,i){r(n,n?!1:_nr(i,t))})}a(Enr,"isexe");function JAi(e,t){return _nr(bnr.statSync(e),t)}a(JAi,"sync");function _nr(e,t){return e.isFile()&&QAi(e,t)}a(_nr,"checkStat");function QAi(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),u=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),d=parseInt("100",8),p=parseInt("010",8),s=parseInt("001",8),c=d|p,l=r&s||r&p&&i===u||r&d&&n===o||r&c&&o===0;return l}a(QAi,"checkMode")});var Tnr=E((MNa,Onr)=>{var FNa=require("fs"),sde;process.platform==="win32"||global.TESTING_WINDOWS?sde=vnr():sde=wnr();Onr.exports=RHe;RHe.sync=XAi;function RHe(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){RHe(e,t||{},function(o,u){o?i(o):n(u)})})}sde(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}a(RHe,"isexe");function XAi(e,t){try{return sde.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(XAi,"sync")});var Nnr=E((jNa,Rnr)=>{var H4=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Anr=require("path"),ZAi=H4?";":":",Cnr=Tnr(),Pnr=a(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),xnr=a((e,t)=>{let r=t.colon||ZAi,n=e.match(/\//)||H4&&e.match(/\\/)?[""]:[...H4?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=H4?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=H4?i.split(r):[""];return H4&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),knr=a((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=xnr(e,t),u=[],d=a(s=>new Promise((c,l)=>{if(s===n.length)return t.all&&u.length?c(u):l(Pnr(e));let f=n[s],h=/^".*"$/.test(f)?f.slice(1,-1):f,y=Anr.join(h,e),b=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;c(p(b,s,0))}),"step"),p=a((s,c,l)=>new Promise((f,h)=>{if(l===i.length)return f(d(c+1));let y=i[l];Cnr(s+y,{pathExt:o},(b,_)=>{if(!b&&_)if(t.all)u.push(s+y);else return f(s+y);return f(p(s,c,l+1))})}),"subStep");return r?d(0).then(s=>r(null,s),r):d(0)},"which"),eCi=a((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=xnr(e,t),o=[];for(let u=0;u<r.length;u++){let d=r[u],p=/^".*"$/.test(d)?d.slice(1,-1):d,s=Anr.join(p,e),c=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+s:s;for(let l=0;l<n.length;l++){let f=c+n[l];try{if(Cnr.sync(f,{pathExt:i}))if(t.all)o.push(f);else return f}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Pnr(e)},"whichSync");Rnr.exports=knr;knr.sync=eCi});var DHe=E((UNa,NHe)=>{"use strict";var Dnr=a((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");NHe.exports=Dnr;NHe.exports.default=Dnr});var Mnr=E((VNa,Fnr)=>{"use strict";var Inr=require("path"),tCi=Nnr(),rCi=DHe();function Lnr(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 u;try{u=tCi.sync(e.command,{path:r[rCi({env:r})],pathExt:t?Inr.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return u&&(u=Inr.resolve(i?e.options.cwd:"",u)),u}a(Lnr,"resolveCommandAttempt");function nCi(e){return Lnr(e)||Lnr(e,!0)}a(nCi,"resolveCommand");Fnr.exports=nCi});var Bnr=E((GNa,LHe)=>{"use strict";var IHe=/([()\][%!^"`<>&|;, *?])/g;function iCi(e){return e=e.replace(IHe,"^$1"),e}a(iCi,"escapeCommand");function oCi(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(IHe,"^$1"),t&&(e=e.replace(IHe,"^$1")),e}a(oCi,"escapeArgument");LHe.exports.command=iCi;LHe.exports.argument=oCi});var qnr=E((KNa,jnr)=>{"use strict";jnr.exports=/^#!(.*)/});var $nr=E((WNa,Unr)=>{"use strict";var aCi=qnr();Unr.exports=(e="")=>{let t=e.match(aCi);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Hnr=E((YNa,Vnr)=>{"use strict";var FHe=require("fs"),sCi=$nr();function lCi(e){let r=Buffer.alloc(150),n;try{n=FHe.openSync(e,"r"),FHe.readSync(n,r,0,150,0),FHe.closeSync(n)}catch{}return sCi(r.toString())}a(lCi,"readShebang");Vnr.exports=lCi});var Wnr=E((QNa,Knr)=>{"use strict";var uCi=require("path"),Gnr=Mnr(),znr=Bnr(),cCi=Hnr(),dCi=process.platform==="win32",pCi=/\.(?:com|exe)$/i,fCi=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function hCi(e){e.file=Gnr(e);let t=e.file&&cCi(e.file);return t?(e.args.unshift(e.file),e.command=t,Gnr(e)):e.file}a(hCi,"detectShebang");function mCi(e){if(!dCi)return e;let t=hCi(e),r=!pCi.test(t);if(e.options.forceShell||r){let n=fCi.test(t);e.command=uCi.normalize(e.command),e.command=znr.command(e.command),e.args=e.args.map(o=>znr.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}a(mCi,"parseNonShell");function gCi(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:mCi(n)}a(gCi,"parse");Knr.exports=gCi});var Qnr=E((ZNa,Jnr)=>{"use strict";var MHe=process.platform==="win32";function BHe(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})}a(BHe,"notFoundError");function yCi(e,t){if(!MHe)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=Ynr(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}a(yCi,"hookChildProcess");function Ynr(e,t){return MHe&&e===1&&!t.file?BHe(t.original,"spawn"):null}a(Ynr,"verifyENOENT");function vCi(e,t){return MHe&&e===1&&!t.file?BHe(t.original,"spawnSync"):null}a(vCi,"verifyENOENTSync");Jnr.exports={hookChildProcess:yCi,verifyENOENT:Ynr,verifyENOENTSync:vCi,notFoundError:BHe}});var eir=E((t3a,G4)=>{"use strict";var Xnr=require("child_process"),jHe=Wnr(),qHe=Qnr();function Znr(e,t,r){let n=jHe(e,t,r),i=Xnr.spawn(n.command,n.args,n.options);return qHe.hookChildProcess(i,n),i}a(Znr,"spawn");function bCi(e,t,r){let n=jHe(e,t,r),i=Xnr.spawnSync(n.command,n.args,n.options);return i.error=i.error||qHe.verifyENOENTSync(i.status,n),i}a(bCi,"spawnSync");G4.exports=Znr;G4.exports.spawn=Znr;G4.exports.sync=bCi;G4.exports._parse=jHe;G4.exports._enoent=qHe});var rir=E((n3a,tir)=>{"use strict";tir.exports=e=>{let t=typeof e=="string"?`
|
|
853
853
|
`:`
|
|
854
854
|
`.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 oir=E((i3a,iH)=>{"use strict";var nH=require("path"),nir=DHe(),iir=a(e=>{e={cwd:process.cwd(),path:process.env[nir()],execPath:process.execPath,...e};let t,r=nH.resolve(e.cwd),n=[];for(;t!==r;)n.push(nH.join(r,"node_modules/.bin")),t=r,r=nH.resolve(r,"..");let i=nH.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(nH.delimiter)},"npmRunPath");iH.exports=iir;iH.exports.default=iir;iH.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=nir({env:t});return e.path=t[r],t[r]=iH.exports(e),t}});var sir=E((a3a,UHe)=>{"use strict";var air=a((e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},"mimicFn");UHe.exports=air;UHe.exports.default=air});var uir=E((l3a,ude)=>{"use strict";var ECi=sir(),lde=new WeakMap,lir=a((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,i=e.displayName||e.name||"<anonymous>",o=a(function(...u){if(lde.set(o,++n),n===1)r=e.apply(this,u),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r},"onetime");return ECi(o,e),lde.set(o,n),o},"onetime");ude.exports=lir;ude.exports.default=lir;ude.exports.callCount=e=>{if(!lde.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return lde.get(e)}});var cir=E(cde=>{"use strict";Object.defineProperty(cde,"__esModule",{value:!0});cde.SIGNALS=void 0;var _Ci=[{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"}];cde.SIGNALS=_Ci});var $He=E(z4=>{"use strict";Object.defineProperty(z4,"__esModule",{value:!0});z4.SIGRTMAX=z4.getRealtimeSignals=void 0;var SCi=a(function(){let e=pir-dir+1;return Array.from({length:e},wCi)},"getRealtimeSignals");z4.getRealtimeSignals=SCi;var wCi=a(function(e,t){return{name:`SIGRT${t+1}`,number:dir+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),dir=34,pir=64;z4.SIGRTMAX=pir});var fir=E(dde=>{"use strict";Object.defineProperty(dde,"__esModule",{value:!0});dde.getSignals=void 0;var OCi=require("os"),TCi=cir(),ACi=$He(),CCi=a(function(){let e=(0,ACi.getRealtimeSignals)();return[...TCi.SIGNALS,...e].map(PCi)},"getSignals");dde.getSignals=CCi;var PCi=a(function({name:e,number:t,description:r,action:n,forced:i=!1,standard:o}){let{signals:{[e]:u}}=OCi.constants,d=u!==void 0;return{name:e,number:d?u:t,description:r,supported:d,action:n,forced:i,standard:o}},"normalizeSignal")});var mir=E(K4=>{"use strict";Object.defineProperty(K4,"__esModule",{value:!0});K4.signalsByNumber=K4.signalsByName=void 0;var xCi=require("os"),hir=fir(),kCi=$He(),RCi=a(function(){return(0,hir.getSignals)().reduce(NCi,{})},"getSignalsByName"),NCi=a(function(e,{name:t,number:r,description:n,supported:i,action:o,forced:u,standard:d}){return{...e,[t]:{name:t,number:r,description:n,supported:i,action:o,forced:u,standard:d}}},"getSignalByName"),DCi=RCi();K4.signalsByName=DCi;var ICi=a(function(){let e=(0,hir.getSignals)(),t=kCi.SIGRTMAX+1,r=Array.from({length:t},(n,i)=>LCi(i,e));return Object.assign({},...r)},"getSignalsByNumber"),LCi=a(function(e,t){let r=FCi(e,t);if(r===void 0)return{};let{name:n,description:i,supported:o,action:u,forced:d,standard:p}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:u,forced:d,standard:p}}},"getSignalByNumber"),FCi=a(function(e,t){let r=t.find(({name:n})=>xCi.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},"findSignalByNumber"),MCi=ICi();K4.signalsByNumber=MCi});var yir=E((y3a,gir)=>{"use strict";var{signalsByName:BCi}=mir(),jCi=a(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:o,isCanceled:u})=>e?`timed out after ${t} milliseconds`:u?"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"),qCi=a(({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:u,escapedCommand:d,timedOut:p,isCanceled:s,killed:c,parsed:{options:{timeout:l}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let f=i===void 0?void 0:BCi[i].description,h=n&&n.code,b=`Command ${jCi({timedOut:p,timeout:l,errorCode:h,signal:i,signalDescription:f,exitCode:o,isCanceled:s})}: ${u}`,_=Object.prototype.toString.call(n)==="[object Error]",w=_?`${b}
|