@vertracloud/api-types 0.2.1 → 0.2.2
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/package.json +1 -1
- package/payloads/v1/api-error.d.ts +24 -0
- package/payloads/v1/api-error.js +16 -0
- package/payloads/v1/api-error.js.map +1 -1
- package/payloads/v1/api-error.mjs +16 -0
- package/payloads/v1/application.d.ts +0 -4
- package/payloads/v1/application.js.map +1 -1
- package/payloads/v1/index.d.ts +0 -1
- package/payloads/v1/index.js +16 -0
- package/payloads/v1/index.js.map +1 -1
- package/payloads/v1/index.mjs +16 -0
- package/payloads/v1/workspace.d.ts +7 -0
- package/payloads/v1/workspace.js +7 -0
- package/payloads/v1/workspace.js.map +1 -1
- package/payloads/v1/workspace.mjs +7 -0
- package/rest/v1/application.d.ts +0 -3
- package/rest/v1/application.js.map +1 -1
- package/rest/v1/index.d.ts +0 -2
- package/rest/v1/index.js.map +1 -1
- package/v1.d.ts +0 -2
- package/v1.js +16 -0
- package/v1.js.map +1 -1
- package/v1.mjs +16 -0
- package/payloads/v1/github.d.ts +0 -20
- package/payloads/v1/github.js +0 -19
- package/payloads/v1/github.js.map +0 -1
- package/payloads/v1/github.mjs +0 -1
- package/rest/v1/github.d.ts +0 -22
- package/rest/v1/github.js +0 -19
- package/rest/v1/github.js.map +0 -1
- package/rest/v1/github.mjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertracloud/api-types",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TypeScript types for the public API of Vertra Cloud, a Brazilian application hosting platform (PaaS) for applications, managed databases and bots.",
|
|
6
6
|
"homepage": "https://vertracloud.app",
|
|
@@ -12,8 +12,12 @@ declare const API_ERROR_CODES: {
|
|
|
12
12
|
readonly WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND";
|
|
13
13
|
readonly WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED";
|
|
14
14
|
readonly WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH";
|
|
15
|
+
readonly WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED";
|
|
16
|
+
readonly WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER";
|
|
15
17
|
readonly WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY";
|
|
16
18
|
readonly WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND";
|
|
19
|
+
readonly WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED";
|
|
20
|
+
readonly WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED";
|
|
17
21
|
readonly WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED";
|
|
18
22
|
readonly WORKSPACE_ACTION_INVALID_PARAMS: "WORKSPACE_ACTION_INVALID_PARAMS";
|
|
19
23
|
readonly WORKSPACE_ACTION_REQUEST_PENDING: "WORKSPACE_ACTION_REQUEST_PENDING";
|
|
@@ -23,8 +27,15 @@ declare const API_ERROR_CODES: {
|
|
|
23
27
|
readonly PLAN_RESTRICTED_FEATURE: "PLAN_RESTRICTED_FEATURE";
|
|
24
28
|
readonly ACCESS_DENIED: "ACCESS_DENIED";
|
|
25
29
|
readonly API_KEY_INVALID: "API_KEY_INVALID";
|
|
30
|
+
readonly API_KEY_NOT_FOUND: "API_KEY_NOT_FOUND";
|
|
31
|
+
readonly API_KEY_LIMIT_REACHED: "API_KEY_LIMIT_REACHED";
|
|
32
|
+
readonly API_KEY_INVALID_NAME: "API_KEY_INVALID_NAME";
|
|
33
|
+
readonly API_KEY_INVALID_SCOPES: "API_KEY_INVALID_SCOPES";
|
|
34
|
+
readonly API_KEY_INVALID_IPS: "API_KEY_INVALID_IPS";
|
|
26
35
|
readonly API_KEY_IP_DENIED: "API_KEY_IP_DENIED";
|
|
27
36
|
readonly API_KEY_SCOPE_DENIED: "API_KEY_SCOPE_DENIED";
|
|
37
|
+
/** 403 — the route only accepts a dashboard session; API keys are refused. */
|
|
38
|
+
readonly WEBSITE_ONLY: "WEBSITE_ONLY";
|
|
28
39
|
readonly AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING";
|
|
29
40
|
readonly ACCOUNT_BANNED: "ACCOUNT_BANNED";
|
|
30
41
|
readonly APP_SHIELD_COOLDOWN: "APP_SHIELD_COOLDOWN";
|
|
@@ -89,6 +100,7 @@ declare const API_ERROR_CODES: {
|
|
|
89
100
|
readonly INVALID_RAM_LIMIT: "INVALID_RAM_LIMIT";
|
|
90
101
|
readonly INVALID_RANGE: "INVALID_RANGE";
|
|
91
102
|
readonly INVALID_SUBDOMAIN_FORMAT: "INVALID_SUBDOMAIN_FORMAT";
|
|
103
|
+
readonly INVALID_VERSION: "INVALID_VERSION";
|
|
92
104
|
readonly INVALID_ZIP: "INVALID_ZIP";
|
|
93
105
|
readonly INVALID_ZIP_STRUCTURE: "INVALID_ZIP_STRUCTURE";
|
|
94
106
|
readonly MAIN_FILE_NOT_FOUND: "MAIN_FILE_NOT_FOUND";
|
|
@@ -161,8 +173,12 @@ declare const APIErrorCode: {
|
|
|
161
173
|
readonly WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND";
|
|
162
174
|
readonly WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED";
|
|
163
175
|
readonly WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH";
|
|
176
|
+
readonly WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED";
|
|
177
|
+
readonly WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER";
|
|
164
178
|
readonly WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY";
|
|
165
179
|
readonly WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND";
|
|
180
|
+
readonly WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED";
|
|
181
|
+
readonly WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED";
|
|
166
182
|
readonly WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED";
|
|
167
183
|
readonly WORKSPACE_ACTION_INVALID_PARAMS: "WORKSPACE_ACTION_INVALID_PARAMS";
|
|
168
184
|
readonly WORKSPACE_ACTION_REQUEST_PENDING: "WORKSPACE_ACTION_REQUEST_PENDING";
|
|
@@ -172,8 +188,15 @@ declare const APIErrorCode: {
|
|
|
172
188
|
readonly PLAN_RESTRICTED_FEATURE: "PLAN_RESTRICTED_FEATURE";
|
|
173
189
|
readonly ACCESS_DENIED: "ACCESS_DENIED";
|
|
174
190
|
readonly API_KEY_INVALID: "API_KEY_INVALID";
|
|
191
|
+
readonly API_KEY_NOT_FOUND: "API_KEY_NOT_FOUND";
|
|
192
|
+
readonly API_KEY_LIMIT_REACHED: "API_KEY_LIMIT_REACHED";
|
|
193
|
+
readonly API_KEY_INVALID_NAME: "API_KEY_INVALID_NAME";
|
|
194
|
+
readonly API_KEY_INVALID_SCOPES: "API_KEY_INVALID_SCOPES";
|
|
195
|
+
readonly API_KEY_INVALID_IPS: "API_KEY_INVALID_IPS";
|
|
175
196
|
readonly API_KEY_IP_DENIED: "API_KEY_IP_DENIED";
|
|
176
197
|
readonly API_KEY_SCOPE_DENIED: "API_KEY_SCOPE_DENIED";
|
|
198
|
+
/** 403 — the route only accepts a dashboard session; API keys are refused. */
|
|
199
|
+
readonly WEBSITE_ONLY: "WEBSITE_ONLY";
|
|
177
200
|
readonly AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING";
|
|
178
201
|
readonly ACCOUNT_BANNED: "ACCOUNT_BANNED";
|
|
179
202
|
readonly APP_SHIELD_COOLDOWN: "APP_SHIELD_COOLDOWN";
|
|
@@ -238,6 +261,7 @@ declare const APIErrorCode: {
|
|
|
238
261
|
readonly INVALID_RAM_LIMIT: "INVALID_RAM_LIMIT";
|
|
239
262
|
readonly INVALID_RANGE: "INVALID_RANGE";
|
|
240
263
|
readonly INVALID_SUBDOMAIN_FORMAT: "INVALID_SUBDOMAIN_FORMAT";
|
|
264
|
+
readonly INVALID_VERSION: "INVALID_VERSION";
|
|
241
265
|
readonly INVALID_ZIP: "INVALID_ZIP";
|
|
242
266
|
readonly INVALID_ZIP_STRUCTURE: "INVALID_ZIP_STRUCTURE";
|
|
243
267
|
readonly MAIN_FILE_NOT_FOUND: "MAIN_FILE_NOT_FOUND";
|
package/payloads/v1/api-error.js
CHANGED
|
@@ -62,9 +62,16 @@ var WORKSPACE_ERROR_CODES = {
|
|
|
62
62
|
WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND",
|
|
63
63
|
WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED",
|
|
64
64
|
WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH",
|
|
65
|
+
/** 400 — the invited account turned off workspace invites by email. */
|
|
66
|
+
WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED",
|
|
67
|
+
/** 409 — the account is already the owner or a member of the workspace. */
|
|
68
|
+
WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER",
|
|
65
69
|
WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY",
|
|
66
70
|
WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND",
|
|
71
|
+
/** 410 — the request expired before anyone decided on it. */
|
|
72
|
+
WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED",
|
|
67
73
|
/** 409 — the request was already approved or rejected. */
|
|
74
|
+
WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED",
|
|
68
75
|
/** 400 — the requester already has the permission; perform the action directly. */
|
|
69
76
|
WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED",
|
|
70
77
|
/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */
|
|
@@ -81,8 +88,16 @@ var WORKSPACE_ERROR_CODES = {
|
|
|
81
88
|
var API_ERROR_CODES = {
|
|
82
89
|
ACCESS_DENIED: "ACCESS_DENIED",
|
|
83
90
|
API_KEY_INVALID: "API_KEY_INVALID",
|
|
91
|
+
// Key management (`/v1/users/me/api-keys`) — dashboard-session routes.
|
|
92
|
+
API_KEY_NOT_FOUND: "API_KEY_NOT_FOUND",
|
|
93
|
+
API_KEY_LIMIT_REACHED: "API_KEY_LIMIT_REACHED",
|
|
94
|
+
API_KEY_INVALID_NAME: "API_KEY_INVALID_NAME",
|
|
95
|
+
API_KEY_INVALID_SCOPES: "API_KEY_INVALID_SCOPES",
|
|
96
|
+
API_KEY_INVALID_IPS: "API_KEY_INVALID_IPS",
|
|
84
97
|
API_KEY_IP_DENIED: "API_KEY_IP_DENIED",
|
|
85
98
|
API_KEY_SCOPE_DENIED: "API_KEY_SCOPE_DENIED",
|
|
99
|
+
/** 403 — the route only accepts a dashboard session; API keys are refused. */
|
|
100
|
+
WEBSITE_ONLY: "WEBSITE_ONLY",
|
|
86
101
|
AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING",
|
|
87
102
|
ACCOUNT_BANNED: "ACCOUNT_BANNED",
|
|
88
103
|
APP_SHIELD_COOLDOWN: "APP_SHIELD_COOLDOWN",
|
|
@@ -147,6 +162,7 @@ var API_ERROR_CODES = {
|
|
|
147
162
|
INVALID_RAM_LIMIT: "INVALID_RAM_LIMIT",
|
|
148
163
|
INVALID_RANGE: "INVALID_RANGE",
|
|
149
164
|
INVALID_SUBDOMAIN_FORMAT: "INVALID_SUBDOMAIN_FORMAT",
|
|
165
|
+
INVALID_VERSION: "INVALID_VERSION",
|
|
150
166
|
INVALID_ZIP: "INVALID_ZIP",
|
|
151
167
|
INVALID_ZIP_STRUCTURE: "INVALID_ZIP_STRUCTURE",
|
|
152
168
|
MAIN_FILE_NOT_FOUND: "MAIN_FILE_NOT_FOUND",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["api-error.ts","workspace.ts"],"sourcesContent":["import { WORKSPACE_ERROR_CODES } from \"./workspace\";\n\n/** Stable error sentinels returned by routes available to API keys. */\nexport const API_ERROR_CODES = {\n\tACCESS_DENIED: \"ACCESS_DENIED\",\n\tAPI_KEY_INVALID: \"API_KEY_INVALID\",\n\tAPI_KEY_IP_DENIED: \"API_KEY_IP_DENIED\",\n\tAPI_KEY_SCOPE_DENIED: \"API_KEY_SCOPE_DENIED\",\n\tAUTH_TOKEN_MISSING: \"AUTH_TOKEN_MISSING\",\n\tACCOUNT_BANNED: \"ACCOUNT_BANNED\",\n\tAPP_SHIELD_COOLDOWN: \"APP_SHIELD_COOLDOWN\",\n\tAPP_BANNED: \"APP_BANNED\",\n\tAPP_ALREADY_PUBLISHED: \"APP_ALREADY_PUBLISHED\",\n\tAPP_HAS_NO_SUBDOMAIN: \"APP_HAS_NO_SUBDOMAIN\",\n\tAPP_NOT_FOUND: \"APP_NOT_FOUND\",\n\tAPP_NOT_PUBLISHED: \"APP_NOT_PUBLISHED\",\n\tAPP_ALREADY_IN_WORKSPACE: \"APP_ALREADY_IN_WORKSPACE\",\n\tAPP_NOT_FOUND_IN_WORKSPACE: \"APP_NOT_FOUND_IN_WORKSPACE\",\n\tBUILD_FAILED: \"BUILD_FAILED\",\n\tBUILD_TIMEOUT: \"BUILD_TIMEOUT\",\n\tCERTIFICATE_NOT_FOUND: \"CERTIFICATE_NOT_FOUND\",\n\tCLEANUP_LANGUAGE_SAME_AS_CURRENT: \"CLEANUP_LANGUAGE_SAME_AS_CURRENT\",\n\tCONTAINER_ALREADY_RUNNING: \"CONTAINER_ALREADY_RUNNING\",\n\tCUSTOM_DOMAIN_RECORD_NOT_FOUND: \"CUSTOM_DOMAIN_RECORD_NOT_FOUND\",\n\tCUSTOM_DOMAIN_REGISTRATION_FAILED: \"CUSTOM_DOMAIN_REGISTRATION_FAILED\",\n\tDAILY_QUOTA_EXCEEDED: \"DAILY_QUOTA_EXCEEDED\",\n\tDATABASE_NOT_FOUND: \"DATABASE_NOT_FOUND\",\n\tDATABASE_NOT_RUNNING: \"DATABASE_NOT_RUNNING\",\n\tDATABASE_ALREADY_IN_WORKSPACE: \"DATABASE_ALREADY_IN_WORKSPACE\",\n\tDATABASE_NOT_FOUND_IN_WORKSPACE: \"DATABASE_NOT_FOUND_IN_WORKSPACE\",\n\tDATABASE_PERSISTENCE_FAILED: \"DATABASE_PERSISTENCE_FAILED\",\n\tDEPLOY_FAILED: \"DEPLOY_FAILED\",\n\tDEPLOYMENT_NOT_FOUND: \"DEPLOYMENT_NOT_FOUND\",\n\tDEPLOY_RATE_LIMITED: \"DEPLOY_RATE_LIMITED\",\n\tDOMAIN_ALREADY_IN_USE: \"DOMAIN_ALREADY_IN_USE\",\n\tENV_LIMIT_EXCEEDED: \"ENV_LIMIT_EXCEEDED\",\n\tENV_DUPLICATE_KEY: \"ENV_DUPLICATE_KEY\",\n\tENV_NOT_FOUND: \"ENV_NOT_FOUND\",\n\tFILE_TOO_LARGE: \"FILE_TOO_LARGE\",\n\tFILE_MODIFIED: \"FILE_MODIFIED\",\n\tFILE_NOT_FOUND: \"FILE_NOT_FOUND\",\n\tFILE_OR_FOLDER_NOT_FOUND: \"FILE_OR_FOLDER_NOT_FOUND\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tFORBIDDEN_DOMAIN: \"FORBIDDEN_DOMAIN\",\n\tFORBIDDEN_PATH: \"FORBIDDEN_PATH\",\n\tFORBIDDEN_KEY: \"FORBIDDEN_KEY\",\n\tFORCED_SNAPSHOT_RATE_LIMIT: \"FORCED_SNAPSHOT_RATE_LIMIT\",\n\tFREE_PLAN_NO_WEB_PUBLISH: \"FREE_PLAN_NO_WEB_PUBLISH\",\n\tINSTALLATION_NOT_FOUND: \"INSTALLATION_NOT_FOUND\",\n\tINSTALL_SHIELD_BLOCKED: \"INSTALL_SHIELD_BLOCKED\",\n\tINSTALL_TIMEOUT: \"INSTALL_TIMEOUT\",\n\tINSTALL_FAILED: \"INSTALL_FAILED\",\n\tINSTALL_CANCELLED: \"INSTALL_CANCELLED\",\n\tINSTALL_OUT_OF_MEMORY: \"INSTALL_OUT_OF_MEMORY\",\n\tINSTALL_QUEUE_FULL: \"INSTALL_QUEUE_FULL\",\n\tINSUFFICIENT_MEMORY: \"INSUFFICIENT_MEMORY\",\n\tINTERNAL_SERVER_ERROR: \"INTERNAL_SERVER_ERROR\",\n\tINVALID_CONFIG: \"INVALID_CONFIG\",\n\tINVALID_CUSTOM_DOMAIN_FORMAT: \"INVALID_CUSTOM_DOMAIN_FORMAT\",\n\tINVALID_HOSTNAME_FOR_APP: \"INVALID_HOSTNAME_FOR_APP\",\n\tINVALID_LANGUAGE: \"INVALID_LANGUAGE\",\n\tINVALID_MEMORY_FORMAT: \"INVALID_MEMORY_FORMAT\",\n\tINVALID_MONTHS: \"INVALID_MONTHS\",\n\tINVALID_OR_EXPIRED_CODE: \"INVALID_OR_EXPIRED_CODE\",\n\tINVALID_PARAMS: \"INVALID_PARAMS\",\n\tINVALID_PAYLOAD: \"INVALID_PAYLOAD\",\n\tINVALID_PATH: \"INVALID_PATH\",\n\tINVALID_PLAN: \"INVALID_PLAN\",\n\tINVALID_PLAN_NAME: \"INVALID_PLAN_NAME\",\n\tINVALID_RAM_LIMIT: \"INVALID_RAM_LIMIT\",\n\tINVALID_RANGE: \"INVALID_RANGE\",\n\tINVALID_SUBDOMAIN_FORMAT: \"INVALID_SUBDOMAIN_FORMAT\",\n\tINVALID_ZIP: \"INVALID_ZIP\",\n\tINVALID_ZIP_STRUCTURE: \"INVALID_ZIP_STRUCTURE\",\n\tMAIN_FILE_NOT_FOUND: \"MAIN_FILE_NOT_FOUND\",\n\tMAX_APPS_REACHED: \"MAX_APPS_REACHED\",\n\tMAX_DATABASES_REACHED: \"MAX_DATABASES_REACHED\",\n\tMEMORY_BELOW_MINIMUM: \"MEMORY_BELOW_MINIMUM\",\n\tMEMORY_LIMIT_EXCEEDED: \"MEMORY_LIMIT_EXCEEDED\",\n\tMEMORY_MUST_BE_INTEGER: \"MEMORY_MUST_BE_INTEGER\",\n\tMEMORY_REQUIRED: \"MEMORY_REQUIRED\",\n\tMISSING_HEADERS: \"MISSING_HEADERS\",\n\tMISSING_PLAN_OR_MONTHS: \"MISSING_PLAN_OR_MONTHS\",\n\tMISSING_CONTENT: \"MISSING_CONTENT\",\n\tNOT_AN_UPGRADE: \"NOT_AN_UPGRADE\",\n\tNO_AUTHORIZED_PATHS: \"NO_AUTHORIZED_PATHS\",\n\tNO_CHANGES_PROVIDED: \"NO_CHANGES_PROVIDED\",\n\tNO_CUSTOM_DOMAIN: \"NO_CUSTOM_DOMAIN\",\n\tNO_FIELDS_TO_UPDATE: \"NO_FIELDS_TO_UPDATE\",\n\tNO_FILE_UPLOADED: \"NO_FILE_UPLOADED\",\n\tOPERATION_IN_PROGRESS: \"OPERATION_IN_PROGRESS\",\n\tORDER_NOT_FOUND: \"ORDER_NOT_FOUND\",\n\tORDER_NOT_PAID: \"ORDER_NOT_PAID\",\n\tORDER_NOT_PAYABLE: \"ORDER_NOT_PAYABLE\",\n\tORDER_NOT_REFUNDED: \"ORDER_NOT_REFUNDED\",\n\tOWNER_APP_WITHOUT_LIMITS: \"OWNER_APP_WITHOUT_LIMITS\",\n\tPAYLOAD_TOO_LARGE: \"PAYLOAD_TOO_LARGE\",\n\tPENDING_ORDER_LIMIT_REACHED: \"PENDING_ORDER_LIMIT_REACHED\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: \"PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH\",\n\tPLAN_MISMATCH_FOR_RENEWAL: \"PLAN_MISMATCH_FOR_RENEWAL\",\n\tPLAN_NOT_ALLOWED: \"PLAN_NOT_ALLOWED\",\n\tRATE_LIMIT_EXCEEDED: \"RATE_LIMIT_EXCEEDED\",\n\tREFUND_AMOUNT_EXCEEDS_PRICE: \"REFUND_AMOUNT_EXCEEDS_PRICE\",\n\tREPO_ALREADY_LINKED: \"REPO_ALREADY_LINKED\",\n\tRESTORE_COOLDOWN: \"RESTORE_COOLDOWN\",\n\tSNAPSHOT_ENGINE_MISMATCH: \"SNAPSHOT_ENGINE_MISMATCH\",\n\tSNAPSHOT_IMPORT_FAILED: \"SNAPSHOT_IMPORT_FAILED\",\n\tSNAPSHOT_NOT_FOUND: \"SNAPSHOT_NOT_FOUND\",\n\tSNAPSHOT_RATE_LIMITED: \"SNAPSHOT_RATE_LIMITED\",\n\tSNAPSHOT_TYPE_MISMATCH: \"SNAPSHOT_TYPE_MISMATCH\",\n\tSNAPSHOT_TOO_LARGE: \"SNAPSHOT_TOO_LARGE\",\n\tSOURCE_CONFLICT: \"SOURCE_CONFLICT\",\n\tSOURCE_REQUIRED: \"SOURCE_REQUIRED\",\n\tSTORAGE_ABOVE_NEW_LIMIT: \"STORAGE_ABOVE_NEW_LIMIT\",\n\tSUBDOMAIN_ALREADY_IN_USE: \"SUBDOMAIN_ALREADY_IN_USE\",\n\tSUBDOMAIN_CHANGE_RATE_LIMITED: \"SUBDOMAIN_CHANGE_RATE_LIMITED\",\n\tSUBDOMAIN_FORBIDDEN: \"SUBDOMAIN_FORBIDDEN\",\n\tSUBDOMAIN_TAKEN: \"SUBDOMAIN_TAKEN\",\n\tTYPE_MISMATCH: \"TYPE_MISMATCH\",\n\tUSER_LIMITS_NOT_FOUND: \"USER_LIMITS_NOT_FOUND\",\n\tUSER_NOT_FOUND: \"USER_NOT_FOUND\",\n\tUSER_NOT_IN_WORKSPACE: \"USER_NOT_IN_WORKSPACE\",\n\tDATABASE_BANNED: \"DATABASE_BANNED\",\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tZIP_TOO_LARGE: \"ZIP_TOO_LARGE\",\n\tZIP_TOO_SMALL: \"ZIP_TOO_SMALL\",\n\tSTORAGE_FULL: \"STORAGE_FULL\",\n\tTARGET_IS_DIRECTORY: \"TARGET_IS_DIRECTORY\",\n\t...WORKSPACE_ERROR_CODES,\n} as const;\n\nexport const APIErrorCode = API_ERROR_CODES;\n\nexport type APIErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];\n","import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\nimport type { APIApplication, APIDatabase } from \"./index\";\n\n/**\n * Granular workspace permission. Display group in `WORKSPACE_PERMISSIONS`.\n * The owner (`owner_id`) has no entry here: owner-only actions (rename/delete the workspace,\n * transfer ownership, link/unlink projects, deploy webhook, web publishing) are allowed for the\n * owner only, never through a permission.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspacePermission =\n\t| \"apps:read\"\n\t| \"apps:manage\"\n\t| \"apps:lifecycle\"\n\t| \"apps:envs\"\n\t| \"apps:files\"\n\t| \"apps:delete\"\n\t| \"databases:read\"\n\t| \"databases:manage\"\n\t| \"databases:lifecycle\"\n\t| \"databases:credentials\"\n\t| \"databases:data\"\n\t| \"databases:delete\"\n\t| \"snapshots:read\"\n\t| \"snapshots:manage\"\n\t| \"members:read\"\n\t| \"members:manage\"\n\t| \"roles:manage\"\n\t| \"activities:read\";\n\nexport const WorkspacePermission = {\n\tAPPS_READ: \"apps:read\",\n\tAPPS_MANAGE: \"apps:manage\",\n\tAPPS_LIFECYCLE: \"apps:lifecycle\",\n\tAPPS_ENVS: \"apps:envs\",\n\tAPPS_FILES: \"apps:files\",\n\tAPPS_DELETE: \"apps:delete\",\n\tDATABASES_READ: \"databases:read\",\n\tDATABASES_MANAGE: \"databases:manage\",\n\tDATABASES_LIFECYCLE: \"databases:lifecycle\",\n\tDATABASES_CREDENTIALS: \"databases:credentials\",\n\tDATABASES_DATA: \"databases:data\",\n\tDATABASES_DELETE: \"databases:delete\",\n\tSNAPSHOTS_READ: \"snapshots:read\",\n\tSNAPSHOTS_MANAGE: \"snapshots:manage\",\n\tMEMBERS_READ: \"members:read\",\n\tMEMBERS_MANAGE: \"members:manage\",\n\tROLES_MANAGE: \"roles:manage\",\n\tACTIVITIES_READ: \"activities:read\",\n} as const satisfies Record<string, WorkspacePermission>;\n\nexport interface WorkspacePermissionEntry {\n\tgroup: \"apps\" | \"databases\" | \"snapshots\" | \"members\" | \"roles\" | \"activities\";\n}\n\n/**\n * Closed catalog of workspace permissions. A member whose role lacks the permission a route\n * requires gets 403 `WORKSPACE_PERMISSION_DENIED`.\n */\nexport const WORKSPACE_PERMISSIONS: Record<WorkspacePermission, WorkspacePermissionEntry> = {\n\t\"apps:read\": { group: \"apps\" },\n\t\"apps:manage\": { group: \"apps\" },\n\t\"apps:lifecycle\": { group: \"apps\" },\n\t\"apps:envs\": { group: \"apps\" },\n\t\"apps:files\": { group: \"apps\" },\n\t\"apps:delete\": { group: \"apps\" },\n\t\"databases:read\": { group: \"databases\" },\n\t\"databases:manage\": { group: \"databases\" },\n\t\"databases:lifecycle\": { group: \"databases\" },\n\t\"databases:credentials\": { group: \"databases\" },\n\t\"databases:data\": { group: \"databases\" },\n\t\"databases:delete\": { group: \"databases\" },\n\t\"snapshots:read\": { group: \"snapshots\" },\n\t\"snapshots:manage\": { group: \"snapshots\" },\n\t\"members:read\": { group: \"members\" },\n\t\"members:manage\": { group: \"members\" },\n\t\"roles:manage\": { group: \"roles\" },\n\t\"activities:read\": { group: \"activities\" },\n};\n\nexport const WORKSPACE_PERMISSION_LIST = Object.keys(WORKSPACE_PERMISSIONS) as WorkspacePermission[];\n\n/**\n * Seed role, created together with the workspace. It can be renamed and deleted like any other\n * role (it becomes a regular role; `preset` is not restored) and counts toward the plan's role limit.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspaceRolePreset = \"admin\" | \"developer\" | \"operator\" | \"viewer\";\nexport const WorkspaceRolePreset = {\n\tAdmin: \"admin\",\n\tDeveloper: \"developer\",\n\tOperator: \"operator\",\n\tViewer: \"viewer\",\n} as const satisfies Record<string, WorkspaceRolePreset>;\n\n/**\n * Permissions a seed role gets when the workspace is created. `admin` does NOT include\n * `snapshots:manage` (restoring/deleting snapshots is destructive); the owner can grant it per role.\n */\nexport function workspacePresetPermissions(preset: WorkspaceRolePreset): WorkspacePermission[] {\n\tswitch (preset) {\n\t\tcase \"admin\":\n\t\t\treturn WORKSPACE_PERMISSION_LIST.filter((p) => p !== \"snapshots:manage\");\n\t\tcase \"developer\":\n\t\t\treturn [\"apps:read\", \"apps:manage\", \"apps:lifecycle\", \"apps:envs\", \"apps:files\", \"databases:read\", \"databases:manage\", \"databases:lifecycle\", \"databases:credentials\", \"databases:data\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"operator\":\n\t\t\treturn [\"apps:read\", \"apps:lifecycle\", \"databases:read\", \"databases:lifecycle\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"viewer\":\n\t\t\treturn [\"apps:read\", \"databases:read\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t}\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/roles/list\n */\nexport interface APIWorkspaceRole {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tname: string;\n\tpermissions: WorkspacePermission[];\n\t/** Seed role it came from; `null` for a manually created role. Informational only. */\n\tpreset: WorkspaceRolePreset | null;\n\t/** Display order. */\n\tposition: number;\n\tmembers_count: number;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/members/list\n */\nexport interface APIWorkspaceMember {\n\tuser_id: SnowFlake;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tjoined_at: ISODateString;\n\t/** When the member's access expires; `null` = never. */\n\texpires_at: ISODateString | null;\n\tuser: {\n\t\tdisplay_name: string;\n\t\temail: string;\n\t};\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspace {\n\tid: SnowFlake;\n\tname: string;\n\tdescription: string | null;\n\towner_id: SnowFlake;\n\towner: { display_name: string };\n\tmembers_count: number;\n\t/** Soft delete timestamp. `null` = active. */\n\tdeleted_at: ISODateString | null;\n\t/**\n\t * `true` when the OWNER's plan does not include workspaces (it expired or was downgraded):\n\t * reads keep working, every write returns `PLAN_RESTRICTED_FEATURE`. Nobody is removed — the\n\t * owner must upgrade to unfreeze it.\n\t */\n\tfrozen: boolean;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspaceInfoResponse extends APIWorkspace {\n\tmembers: APIWorkspaceMember[];\n\troles: APIWorkspaceRole[];\n\tapplications: APIApplication[];\n\tdatabases: APIDatabase[];\n\t/** Resolved permissions of the caller. The owner always gets the full list, regardless of role. */\n\tpermissions: WorkspacePermission[];\n\tis_owner: boolean;\n\t/** Owner's plan — it determines which features the workspace has. */\n\towner_plan_id: UserPlan;\n\t/** The caller's saved resource organization (folders, favorites) in this workspace. */\n\tresource_organization: APIWorkspaceResourceOrganization;\n}\n\nexport type WorkspaceResourceType = \"application\" | \"database\";\nexport const WorkspaceResourceType = { Application: \"application\", Database: \"database\" } as const satisfies Record<string, WorkspaceResourceType>;\n\nexport type WorkspaceResourceOrganizationScope = \"personal\" | \"workspace\";\nexport const WorkspaceResourceOrganizationScope = { Personal: \"personal\", Workspace: \"workspace\" } as const satisfies Record<string, WorkspaceResourceOrganizationScope>;\n\nexport type WorkspaceFolderColor = \"neutral\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"blue\" | \"purple\";\nexport const WorkspaceFolderColor = { Neutral: \"neutral\", Red: \"red\", Orange: \"orange\", Yellow: \"yellow\", Green: \"green\", Blue: \"blue\", Purple: \"purple\" } as const satisfies Record<string, WorkspaceFolderColor>;\nexport const WORKSPACE_FOLDER_COLORS = Object.values(WorkspaceFolderColor) as WorkspaceFolderColor[];\n\nexport interface APIWorkspaceResourceRef {\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n}\n\nexport interface APIWorkspaceFolderItem extends APIWorkspaceResourceRef {\n\tposition: number;\n}\n\nexport interface APIWorkspaceResourceFolder {\n\tid: SnowFlake;\n\tname: string;\n\tcolor: WorkspaceFolderColor;\n\tposition: number;\n\tresources: APIWorkspaceFolderItem[];\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\nexport interface APIWorkspaceFavorite extends APIWorkspaceResourceRef {\n\tposition: number;\n\tcreated_at: ISODateString;\n}\n\nexport interface APIWorkspaceResourceOrganization {\n\tscope: WorkspaceResourceOrganizationScope;\n\tuser_id: SnowFlake;\n\tworkspace_id: SnowFlake | null;\n\tfolders: APIWorkspaceResourceFolder[];\n\tfavorites: APIWorkspaceFavorite[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport type WorkspaceInviteKind = \"email\" | \"link\";\nexport const WorkspaceInviteKind = { Email: \"email\", Link: \"link\" } as const satisfies Record<string, WorkspaceInviteKind>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport interface APIWorkspaceInvite {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tkind: WorkspaceInviteKind;\n\t/** Bound e-mail; only for `kind: \"email\"`. */\n\temail: string | null;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tinvited_by: { id: SnowFlake; display_name: string };\n\texpires_at: ISODateString;\n\taccepted_at: ISODateString | null;\n\trevoked_at: ISODateString | null;\n\tuses: number;\n\t/** Only for `kind: \"link\"`; `null` = unlimited uses. */\n\tmax_uses: number | null;\n\t/** Access expiration applied to members who join through this invite; `null` = never. */\n\texpires_in_days: number | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/create\n */\nexport interface APIWorkspaceInviteCreated extends APIWorkspaceInvite {\n\t/** Invite URL; only for `kind: \"link\"`, shown once. */\n\turl: string | null;\n}\n\n/**\n * What the invitee sees before accepting (`GET /v1/workspaces/invites/:token`).\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/preview\n */\nexport interface APIWorkspaceInvitePreview {\n\tworkspace: { id: SnowFlake; name: string };\n\tinviter: { display_name: string };\n\trole_name: string;\n\tkind: WorkspaceInviteKind;\n\texpires_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type WorkspaceActionRequestAction = \"app_delete\" | \"database_delete\" | \"snapshot_create\" | \"snapshot_restore\";\nexport const WorkspaceActionRequestAction = {\n\tAppDelete: \"app_delete\",\n\tDatabaseDelete: \"database_delete\",\n\tSnapshotCreate: \"snapshot_create\",\n\tSnapshotRestore: \"snapshot_restore\",\n} as const satisfies Record<string, WorkspaceActionRequestAction>;\n\nexport type WorkspaceActionRequestStatus = \"pending\" | \"approved\" | \"rejected\" | \"expired\";\nexport const WorkspaceActionRequestStatus = {\n\tPending: \"pending\",\n\tApproved: \"approved\",\n\tRejected: \"rejected\",\n\tExpired: \"expired\",\n} as const satisfies Record<string, WorkspaceActionRequestStatus>;\n\n/**\n * `params` of an action request, per `action`. Actions without parameters take an empty object;\n * unknown keys are rejected with `WORKSPACE_ACTION_INVALID_PARAMS`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/create\n */\nexport interface WorkspaceActionRequestParams {\n\tapp_delete: Record<string, never>;\n\tdatabase_delete: Record<string, never>;\n\tsnapshot_create: Record<string, never>;\n\t/** The snapshot must belong to the request's resource. */\n\tsnapshot_restore: { snapshot_id: SnowFlake };\n}\n\ninterface APIWorkspaceActionRequestBase {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n\tresource_name: string | null;\n\tstatus: WorkspaceActionRequestStatus;\n\trequested_by: { id: SnowFlake; display_name: string };\n\tdecided_by: { id: SnowFlake; display_name: string } | null;\n\tdecided_at: ISODateString | null;\n\texpires_at: ISODateString;\n\tcreated_at: ISODateString;\n}\n\n/**\n * A request for a destructive/sensitive action made by a member who lacks its permission, to be\n * approved by someone who has it. Expires after 24 h without a decision. Discriminated by `action`,\n * which decides the shape of `params`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type APIWorkspaceActionRequest = {\n\t[A in WorkspaceActionRequestAction]: APIWorkspaceActionRequestBase & { action: A; params: WorkspaceActionRequestParams[A] };\n}[WorkspaceActionRequestAction];\n\n/**\n * Workspace error codes. Stable English sentinels returned in `code`; clients are expected to\n * translate them.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport const WORKSPACE_ERROR_CODES = {\n\tWORKSPACE_NOT_FOUND: \"WORKSPACE_NOT_FOUND\",\n\tWORKSPACE_NAME_ALREADY_EXISTS: \"WORKSPACE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_MEMBER_LIMIT_REACHED: \"WORKSPACE_MEMBER_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_LIMIT_REACHED: \"WORKSPACE_ROLE_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_IN_USE: \"WORKSPACE_ROLE_IN_USE\",\n\tWORKSPACE_ROLE_NOT_FOUND: \"WORKSPACE_ROLE_NOT_FOUND\",\n\tWORKSPACE_ROLE_NAME_ALREADY_EXISTS: \"WORKSPACE_ROLE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_PERMISSION_DENIED: \"WORKSPACE_PERMISSION_DENIED\",\n\tWORKSPACE_PERMISSION_ESCALATION: \"WORKSPACE_PERMISSION_ESCALATION\",\n\tWORKSPACE_INVITE_NOT_FOUND: \"WORKSPACE_INVITE_NOT_FOUND\",\n\tWORKSPACE_INVITE_EXPIRED: \"WORKSPACE_INVITE_EXPIRED\",\n\tWORKSPACE_INVITE_EMAIL_MISMATCH: \"WORKSPACE_INVITE_EMAIL_MISMATCH\",\n\tWORKSPACE_OWNER_ONLY: \"WORKSPACE_OWNER_ONLY\",\n\tWORKSPACE_ACTION_REQUEST_NOT_FOUND: \"WORKSPACE_ACTION_REQUEST_NOT_FOUND\",\n\t/** 409 — the request was already approved or rejected. */\n\t/** 400 — the requester already has the permission; perform the action directly. */\n\tWORKSPACE_ACTION_NOT_NEEDED: \"WORKSPACE_ACTION_NOT_NEEDED\",\n\t/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */\n\tWORKSPACE_ACTION_INVALID_PARAMS: \"WORKSPACE_ACTION_INVALID_PARAMS\",\n\t/** 409 — a pending request already exists for the same action on the same resource. */\n\tWORKSPACE_ACTION_REQUEST_PENDING: \"WORKSPACE_ACTION_REQUEST_PENDING\",\n\tWORKSPACE_RESOURCE_FOLDER_NOT_FOUND: \"WORKSPACE_RESOURCE_FOLDER_NOT_FOUND\",\n\tWORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT: \"WORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT\",\n\tWORKSPACE_RESOURCE_NOT_FOUND: \"WORKSPACE_RESOURCE_NOT_FOUND\",\n\tPLAN_RESTRICTED_FEATURE: \"PLAN_RESTRICTED_FEATURE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AAAA,EAC1B,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,0BAA0B;AAAA,EAC1B,+BAA+B;AAAA,EAC/B,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,GAAG;AACJ;AAEO,IAAM,eAAe;","names":[]}
|
|
1
|
+
{"version":3,"sources":["api-error.ts","workspace.ts"],"sourcesContent":["import { WORKSPACE_ERROR_CODES } from \"./workspace\";\n\n/** Stable error sentinels returned by routes available to API keys. */\nexport const API_ERROR_CODES = {\n\tACCESS_DENIED: \"ACCESS_DENIED\",\n\tAPI_KEY_INVALID: \"API_KEY_INVALID\",\n\t// Key management (`/v1/users/me/api-keys`) — dashboard-session routes.\n\tAPI_KEY_NOT_FOUND: \"API_KEY_NOT_FOUND\",\n\tAPI_KEY_LIMIT_REACHED: \"API_KEY_LIMIT_REACHED\",\n\tAPI_KEY_INVALID_NAME: \"API_KEY_INVALID_NAME\",\n\tAPI_KEY_INVALID_SCOPES: \"API_KEY_INVALID_SCOPES\",\n\tAPI_KEY_INVALID_IPS: \"API_KEY_INVALID_IPS\",\n\tAPI_KEY_IP_DENIED: \"API_KEY_IP_DENIED\",\n\tAPI_KEY_SCOPE_DENIED: \"API_KEY_SCOPE_DENIED\",\n\t/** 403 — the route only accepts a dashboard session; API keys are refused. */\n\tWEBSITE_ONLY: \"WEBSITE_ONLY\",\n\tAUTH_TOKEN_MISSING: \"AUTH_TOKEN_MISSING\",\n\tACCOUNT_BANNED: \"ACCOUNT_BANNED\",\n\tAPP_SHIELD_COOLDOWN: \"APP_SHIELD_COOLDOWN\",\n\tAPP_BANNED: \"APP_BANNED\",\n\tAPP_ALREADY_PUBLISHED: \"APP_ALREADY_PUBLISHED\",\n\tAPP_HAS_NO_SUBDOMAIN: \"APP_HAS_NO_SUBDOMAIN\",\n\tAPP_NOT_FOUND: \"APP_NOT_FOUND\",\n\tAPP_NOT_PUBLISHED: \"APP_NOT_PUBLISHED\",\n\tAPP_ALREADY_IN_WORKSPACE: \"APP_ALREADY_IN_WORKSPACE\",\n\tAPP_NOT_FOUND_IN_WORKSPACE: \"APP_NOT_FOUND_IN_WORKSPACE\",\n\tBUILD_FAILED: \"BUILD_FAILED\",\n\tBUILD_TIMEOUT: \"BUILD_TIMEOUT\",\n\tCERTIFICATE_NOT_FOUND: \"CERTIFICATE_NOT_FOUND\",\n\tCLEANUP_LANGUAGE_SAME_AS_CURRENT: \"CLEANUP_LANGUAGE_SAME_AS_CURRENT\",\n\tCONTAINER_ALREADY_RUNNING: \"CONTAINER_ALREADY_RUNNING\",\n\tCUSTOM_DOMAIN_RECORD_NOT_FOUND: \"CUSTOM_DOMAIN_RECORD_NOT_FOUND\",\n\tCUSTOM_DOMAIN_REGISTRATION_FAILED: \"CUSTOM_DOMAIN_REGISTRATION_FAILED\",\n\tDAILY_QUOTA_EXCEEDED: \"DAILY_QUOTA_EXCEEDED\",\n\tDATABASE_NOT_FOUND: \"DATABASE_NOT_FOUND\",\n\tDATABASE_NOT_RUNNING: \"DATABASE_NOT_RUNNING\",\n\tDATABASE_ALREADY_IN_WORKSPACE: \"DATABASE_ALREADY_IN_WORKSPACE\",\n\tDATABASE_NOT_FOUND_IN_WORKSPACE: \"DATABASE_NOT_FOUND_IN_WORKSPACE\",\n\tDATABASE_PERSISTENCE_FAILED: \"DATABASE_PERSISTENCE_FAILED\",\n\tDEPLOY_FAILED: \"DEPLOY_FAILED\",\n\tDEPLOYMENT_NOT_FOUND: \"DEPLOYMENT_NOT_FOUND\",\n\tDEPLOY_RATE_LIMITED: \"DEPLOY_RATE_LIMITED\",\n\tDOMAIN_ALREADY_IN_USE: \"DOMAIN_ALREADY_IN_USE\",\n\tENV_LIMIT_EXCEEDED: \"ENV_LIMIT_EXCEEDED\",\n\tENV_DUPLICATE_KEY: \"ENV_DUPLICATE_KEY\",\n\tENV_NOT_FOUND: \"ENV_NOT_FOUND\",\n\tFILE_TOO_LARGE: \"FILE_TOO_LARGE\",\n\tFILE_MODIFIED: \"FILE_MODIFIED\",\n\tFILE_NOT_FOUND: \"FILE_NOT_FOUND\",\n\tFILE_OR_FOLDER_NOT_FOUND: \"FILE_OR_FOLDER_NOT_FOUND\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tFORBIDDEN_DOMAIN: \"FORBIDDEN_DOMAIN\",\n\tFORBIDDEN_PATH: \"FORBIDDEN_PATH\",\n\tFORBIDDEN_KEY: \"FORBIDDEN_KEY\",\n\tFORCED_SNAPSHOT_RATE_LIMIT: \"FORCED_SNAPSHOT_RATE_LIMIT\",\n\tFREE_PLAN_NO_WEB_PUBLISH: \"FREE_PLAN_NO_WEB_PUBLISH\",\n\tINSTALLATION_NOT_FOUND: \"INSTALLATION_NOT_FOUND\",\n\tINSTALL_SHIELD_BLOCKED: \"INSTALL_SHIELD_BLOCKED\",\n\tINSTALL_TIMEOUT: \"INSTALL_TIMEOUT\",\n\tINSTALL_FAILED: \"INSTALL_FAILED\",\n\tINSTALL_CANCELLED: \"INSTALL_CANCELLED\",\n\tINSTALL_OUT_OF_MEMORY: \"INSTALL_OUT_OF_MEMORY\",\n\tINSTALL_QUEUE_FULL: \"INSTALL_QUEUE_FULL\",\n\tINSUFFICIENT_MEMORY: \"INSUFFICIENT_MEMORY\",\n\tINTERNAL_SERVER_ERROR: \"INTERNAL_SERVER_ERROR\",\n\tINVALID_CONFIG: \"INVALID_CONFIG\",\n\tINVALID_CUSTOM_DOMAIN_FORMAT: \"INVALID_CUSTOM_DOMAIN_FORMAT\",\n\tINVALID_HOSTNAME_FOR_APP: \"INVALID_HOSTNAME_FOR_APP\",\n\tINVALID_LANGUAGE: \"INVALID_LANGUAGE\",\n\tINVALID_MEMORY_FORMAT: \"INVALID_MEMORY_FORMAT\",\n\tINVALID_MONTHS: \"INVALID_MONTHS\",\n\tINVALID_OR_EXPIRED_CODE: \"INVALID_OR_EXPIRED_CODE\",\n\tINVALID_PARAMS: \"INVALID_PARAMS\",\n\tINVALID_PAYLOAD: \"INVALID_PAYLOAD\",\n\tINVALID_PATH: \"INVALID_PATH\",\n\tINVALID_PLAN: \"INVALID_PLAN\",\n\tINVALID_PLAN_NAME: \"INVALID_PLAN_NAME\",\n\tINVALID_RAM_LIMIT: \"INVALID_RAM_LIMIT\",\n\tINVALID_RANGE: \"INVALID_RANGE\",\n\tINVALID_SUBDOMAIN_FORMAT: \"INVALID_SUBDOMAIN_FORMAT\",\n\tINVALID_VERSION: \"INVALID_VERSION\",\n\tINVALID_ZIP: \"INVALID_ZIP\",\n\tINVALID_ZIP_STRUCTURE: \"INVALID_ZIP_STRUCTURE\",\n\tMAIN_FILE_NOT_FOUND: \"MAIN_FILE_NOT_FOUND\",\n\tMAX_APPS_REACHED: \"MAX_APPS_REACHED\",\n\tMAX_DATABASES_REACHED: \"MAX_DATABASES_REACHED\",\n\tMEMORY_BELOW_MINIMUM: \"MEMORY_BELOW_MINIMUM\",\n\tMEMORY_LIMIT_EXCEEDED: \"MEMORY_LIMIT_EXCEEDED\",\n\tMEMORY_MUST_BE_INTEGER: \"MEMORY_MUST_BE_INTEGER\",\n\tMEMORY_REQUIRED: \"MEMORY_REQUIRED\",\n\tMISSING_HEADERS: \"MISSING_HEADERS\",\n\tMISSING_PLAN_OR_MONTHS: \"MISSING_PLAN_OR_MONTHS\",\n\tMISSING_CONTENT: \"MISSING_CONTENT\",\n\tNOT_AN_UPGRADE: \"NOT_AN_UPGRADE\",\n\tNO_AUTHORIZED_PATHS: \"NO_AUTHORIZED_PATHS\",\n\tNO_CHANGES_PROVIDED: \"NO_CHANGES_PROVIDED\",\n\tNO_CUSTOM_DOMAIN: \"NO_CUSTOM_DOMAIN\",\n\tNO_FIELDS_TO_UPDATE: \"NO_FIELDS_TO_UPDATE\",\n\tNO_FILE_UPLOADED: \"NO_FILE_UPLOADED\",\n\tOPERATION_IN_PROGRESS: \"OPERATION_IN_PROGRESS\",\n\tORDER_NOT_FOUND: \"ORDER_NOT_FOUND\",\n\tORDER_NOT_PAID: \"ORDER_NOT_PAID\",\n\tORDER_NOT_PAYABLE: \"ORDER_NOT_PAYABLE\",\n\tORDER_NOT_REFUNDED: \"ORDER_NOT_REFUNDED\",\n\tOWNER_APP_WITHOUT_LIMITS: \"OWNER_APP_WITHOUT_LIMITS\",\n\tPAYLOAD_TOO_LARGE: \"PAYLOAD_TOO_LARGE\",\n\tPENDING_ORDER_LIMIT_REACHED: \"PENDING_ORDER_LIMIT_REACHED\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: \"PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH\",\n\tPLAN_MISMATCH_FOR_RENEWAL: \"PLAN_MISMATCH_FOR_RENEWAL\",\n\tPLAN_NOT_ALLOWED: \"PLAN_NOT_ALLOWED\",\n\tRATE_LIMIT_EXCEEDED: \"RATE_LIMIT_EXCEEDED\",\n\tREFUND_AMOUNT_EXCEEDS_PRICE: \"REFUND_AMOUNT_EXCEEDS_PRICE\",\n\tREPO_ALREADY_LINKED: \"REPO_ALREADY_LINKED\",\n\tRESTORE_COOLDOWN: \"RESTORE_COOLDOWN\",\n\tSNAPSHOT_ENGINE_MISMATCH: \"SNAPSHOT_ENGINE_MISMATCH\",\n\tSNAPSHOT_IMPORT_FAILED: \"SNAPSHOT_IMPORT_FAILED\",\n\tSNAPSHOT_NOT_FOUND: \"SNAPSHOT_NOT_FOUND\",\n\tSNAPSHOT_RATE_LIMITED: \"SNAPSHOT_RATE_LIMITED\",\n\tSNAPSHOT_TYPE_MISMATCH: \"SNAPSHOT_TYPE_MISMATCH\",\n\tSNAPSHOT_TOO_LARGE: \"SNAPSHOT_TOO_LARGE\",\n\tSOURCE_CONFLICT: \"SOURCE_CONFLICT\",\n\tSOURCE_REQUIRED: \"SOURCE_REQUIRED\",\n\tSTORAGE_ABOVE_NEW_LIMIT: \"STORAGE_ABOVE_NEW_LIMIT\",\n\tSUBDOMAIN_ALREADY_IN_USE: \"SUBDOMAIN_ALREADY_IN_USE\",\n\tSUBDOMAIN_CHANGE_RATE_LIMITED: \"SUBDOMAIN_CHANGE_RATE_LIMITED\",\n\tSUBDOMAIN_FORBIDDEN: \"SUBDOMAIN_FORBIDDEN\",\n\tSUBDOMAIN_TAKEN: \"SUBDOMAIN_TAKEN\",\n\tTYPE_MISMATCH: \"TYPE_MISMATCH\",\n\tUSER_LIMITS_NOT_FOUND: \"USER_LIMITS_NOT_FOUND\",\n\tUSER_NOT_FOUND: \"USER_NOT_FOUND\",\n\tUSER_NOT_IN_WORKSPACE: \"USER_NOT_IN_WORKSPACE\",\n\tDATABASE_BANNED: \"DATABASE_BANNED\",\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tZIP_TOO_LARGE: \"ZIP_TOO_LARGE\",\n\tZIP_TOO_SMALL: \"ZIP_TOO_SMALL\",\n\tSTORAGE_FULL: \"STORAGE_FULL\",\n\tTARGET_IS_DIRECTORY: \"TARGET_IS_DIRECTORY\",\n\t...WORKSPACE_ERROR_CODES,\n} as const;\n\nexport const APIErrorCode = API_ERROR_CODES;\n\nexport type APIErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];\n","import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\nimport type { APIApplication, APIDatabase } from \"./index\";\n\n/**\n * Granular workspace permission. Display group in `WORKSPACE_PERMISSIONS`.\n * The owner (`owner_id`) has no entry here: owner-only actions (rename/delete the workspace,\n * transfer ownership, link/unlink projects, deploy webhook, web publishing) are allowed for the\n * owner only, never through a permission.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspacePermission =\n\t| \"apps:read\"\n\t| \"apps:manage\"\n\t| \"apps:lifecycle\"\n\t| \"apps:envs\"\n\t| \"apps:files\"\n\t| \"apps:delete\"\n\t| \"databases:read\"\n\t| \"databases:manage\"\n\t| \"databases:lifecycle\"\n\t| \"databases:credentials\"\n\t| \"databases:data\"\n\t| \"databases:delete\"\n\t| \"snapshots:read\"\n\t| \"snapshots:manage\"\n\t| \"members:read\"\n\t| \"members:manage\"\n\t| \"roles:manage\"\n\t| \"activities:read\";\n\nexport const WorkspacePermission = {\n\tAPPS_READ: \"apps:read\",\n\tAPPS_MANAGE: \"apps:manage\",\n\tAPPS_LIFECYCLE: \"apps:lifecycle\",\n\tAPPS_ENVS: \"apps:envs\",\n\tAPPS_FILES: \"apps:files\",\n\tAPPS_DELETE: \"apps:delete\",\n\tDATABASES_READ: \"databases:read\",\n\tDATABASES_MANAGE: \"databases:manage\",\n\tDATABASES_LIFECYCLE: \"databases:lifecycle\",\n\tDATABASES_CREDENTIALS: \"databases:credentials\",\n\tDATABASES_DATA: \"databases:data\",\n\tDATABASES_DELETE: \"databases:delete\",\n\tSNAPSHOTS_READ: \"snapshots:read\",\n\tSNAPSHOTS_MANAGE: \"snapshots:manage\",\n\tMEMBERS_READ: \"members:read\",\n\tMEMBERS_MANAGE: \"members:manage\",\n\tROLES_MANAGE: \"roles:manage\",\n\tACTIVITIES_READ: \"activities:read\",\n} as const satisfies Record<string, WorkspacePermission>;\n\nexport interface WorkspacePermissionEntry {\n\tgroup: \"apps\" | \"databases\" | \"snapshots\" | \"members\" | \"roles\" | \"activities\";\n}\n\n/**\n * Closed catalog of workspace permissions. A member whose role lacks the permission a route\n * requires gets 403 `WORKSPACE_PERMISSION_DENIED`.\n */\nexport const WORKSPACE_PERMISSIONS: Record<WorkspacePermission, WorkspacePermissionEntry> = {\n\t\"apps:read\": { group: \"apps\" },\n\t\"apps:manage\": { group: \"apps\" },\n\t\"apps:lifecycle\": { group: \"apps\" },\n\t\"apps:envs\": { group: \"apps\" },\n\t\"apps:files\": { group: \"apps\" },\n\t\"apps:delete\": { group: \"apps\" },\n\t\"databases:read\": { group: \"databases\" },\n\t\"databases:manage\": { group: \"databases\" },\n\t\"databases:lifecycle\": { group: \"databases\" },\n\t\"databases:credentials\": { group: \"databases\" },\n\t\"databases:data\": { group: \"databases\" },\n\t\"databases:delete\": { group: \"databases\" },\n\t\"snapshots:read\": { group: \"snapshots\" },\n\t\"snapshots:manage\": { group: \"snapshots\" },\n\t\"members:read\": { group: \"members\" },\n\t\"members:manage\": { group: \"members\" },\n\t\"roles:manage\": { group: \"roles\" },\n\t\"activities:read\": { group: \"activities\" },\n};\n\nexport const WORKSPACE_PERMISSION_LIST = Object.keys(WORKSPACE_PERMISSIONS) as WorkspacePermission[];\n\n/**\n * Seed role, created together with the workspace. It can be renamed and deleted like any other\n * role (it becomes a regular role; `preset` is not restored) and counts toward the plan's role limit.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspaceRolePreset = \"admin\" | \"developer\" | \"operator\" | \"viewer\";\nexport const WorkspaceRolePreset = {\n\tAdmin: \"admin\",\n\tDeveloper: \"developer\",\n\tOperator: \"operator\",\n\tViewer: \"viewer\",\n} as const satisfies Record<string, WorkspaceRolePreset>;\n\n/**\n * Permissions a seed role gets when the workspace is created. `admin` does NOT include\n * `snapshots:manage` (restoring/deleting snapshots is destructive); the owner can grant it per role.\n */\nexport function workspacePresetPermissions(preset: WorkspaceRolePreset): WorkspacePermission[] {\n\tswitch (preset) {\n\t\tcase \"admin\":\n\t\t\treturn WORKSPACE_PERMISSION_LIST.filter((p) => p !== \"snapshots:manage\");\n\t\tcase \"developer\":\n\t\t\treturn [\"apps:read\", \"apps:manage\", \"apps:lifecycle\", \"apps:envs\", \"apps:files\", \"databases:read\", \"databases:manage\", \"databases:lifecycle\", \"databases:credentials\", \"databases:data\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"operator\":\n\t\t\treturn [\"apps:read\", \"apps:lifecycle\", \"databases:read\", \"databases:lifecycle\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"viewer\":\n\t\t\treturn [\"apps:read\", \"databases:read\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t}\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/roles/list\n */\nexport interface APIWorkspaceRole {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tname: string;\n\tpermissions: WorkspacePermission[];\n\t/** Seed role it came from; `null` for a manually created role. Informational only. */\n\tpreset: WorkspaceRolePreset | null;\n\t/** Display order. */\n\tposition: number;\n\tmembers_count: number;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/members/list\n */\nexport interface APIWorkspaceMember {\n\tuser_id: SnowFlake;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tjoined_at: ISODateString;\n\t/** When the member's access expires; `null` = never. */\n\texpires_at: ISODateString | null;\n\tuser: {\n\t\tdisplay_name: string;\n\t\temail: string;\n\t};\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspace {\n\tid: SnowFlake;\n\tname: string;\n\tdescription: string | null;\n\towner_id: SnowFlake;\n\towner: { display_name: string };\n\tmembers_count: number;\n\t/** Soft delete timestamp. `null` = active. */\n\tdeleted_at: ISODateString | null;\n\t/**\n\t * `true` when the OWNER's plan does not include workspaces (it expired or was downgraded):\n\t * reads keep working, every write returns `PLAN_RESTRICTED_FEATURE`. Nobody is removed — the\n\t * owner must upgrade to unfreeze it.\n\t */\n\tfrozen: boolean;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspaceInfoResponse extends APIWorkspace {\n\tmembers: APIWorkspaceMember[];\n\troles: APIWorkspaceRole[];\n\tapplications: APIApplication[];\n\tdatabases: APIDatabase[];\n\t/** Resolved permissions of the caller. The owner always gets the full list, regardless of role. */\n\tpermissions: WorkspacePermission[];\n\tis_owner: boolean;\n\t/** Owner's plan — it determines which features the workspace has. */\n\towner_plan_id: UserPlan;\n\t/** The caller's saved resource organization (folders, favorites) in this workspace. */\n\tresource_organization: APIWorkspaceResourceOrganization;\n}\n\nexport type WorkspaceResourceType = \"application\" | \"database\";\nexport const WorkspaceResourceType = { Application: \"application\", Database: \"database\" } as const satisfies Record<string, WorkspaceResourceType>;\n\nexport type WorkspaceResourceOrganizationScope = \"personal\" | \"workspace\";\nexport const WorkspaceResourceOrganizationScope = { Personal: \"personal\", Workspace: \"workspace\" } as const satisfies Record<string, WorkspaceResourceOrganizationScope>;\n\nexport type WorkspaceFolderColor = \"neutral\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"blue\" | \"purple\";\nexport const WorkspaceFolderColor = { Neutral: \"neutral\", Red: \"red\", Orange: \"orange\", Yellow: \"yellow\", Green: \"green\", Blue: \"blue\", Purple: \"purple\" } as const satisfies Record<string, WorkspaceFolderColor>;\nexport const WORKSPACE_FOLDER_COLORS = Object.values(WorkspaceFolderColor) as WorkspaceFolderColor[];\n\nexport interface APIWorkspaceResourceRef {\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n}\n\nexport interface APIWorkspaceFolderItem extends APIWorkspaceResourceRef {\n\tposition: number;\n}\n\nexport interface APIWorkspaceResourceFolder {\n\tid: SnowFlake;\n\tname: string;\n\tcolor: WorkspaceFolderColor;\n\tposition: number;\n\tresources: APIWorkspaceFolderItem[];\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\nexport interface APIWorkspaceFavorite extends APIWorkspaceResourceRef {\n\tposition: number;\n\tcreated_at: ISODateString;\n}\n\nexport interface APIWorkspaceResourceOrganization {\n\tscope: WorkspaceResourceOrganizationScope;\n\tuser_id: SnowFlake;\n\tworkspace_id: SnowFlake | null;\n\tfolders: APIWorkspaceResourceFolder[];\n\tfavorites: APIWorkspaceFavorite[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport type WorkspaceInviteKind = \"email\" | \"link\";\nexport const WorkspaceInviteKind = { Email: \"email\", Link: \"link\" } as const satisfies Record<string, WorkspaceInviteKind>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport interface APIWorkspaceInvite {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tkind: WorkspaceInviteKind;\n\t/** Bound e-mail; only for `kind: \"email\"`. */\n\temail: string | null;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tinvited_by: { id: SnowFlake; display_name: string };\n\texpires_at: ISODateString;\n\taccepted_at: ISODateString | null;\n\trevoked_at: ISODateString | null;\n\tuses: number;\n\t/** Only for `kind: \"link\"`; `null` = unlimited uses. */\n\tmax_uses: number | null;\n\t/** Access expiration applied to members who join through this invite; `null` = never. */\n\texpires_in_days: number | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/create\n */\nexport interface APIWorkspaceInviteCreated extends APIWorkspaceInvite {\n\t/** Invite URL; only for `kind: \"link\"`, shown once. */\n\turl: string | null;\n}\n\n/**\n * What the invitee sees before accepting (`GET /v1/workspaces/invites/:token`).\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/preview\n */\nexport interface APIWorkspaceInvitePreview {\n\tworkspace: { id: SnowFlake; name: string };\n\tinviter: { display_name: string };\n\trole_name: string;\n\tkind: WorkspaceInviteKind;\n\texpires_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type WorkspaceActionRequestAction = \"app_delete\" | \"database_delete\" | \"snapshot_create\" | \"snapshot_restore\";\nexport const WorkspaceActionRequestAction = {\n\tAppDelete: \"app_delete\",\n\tDatabaseDelete: \"database_delete\",\n\tSnapshotCreate: \"snapshot_create\",\n\tSnapshotRestore: \"snapshot_restore\",\n} as const satisfies Record<string, WorkspaceActionRequestAction>;\n\nexport type WorkspaceActionRequestStatus = \"pending\" | \"approved\" | \"rejected\" | \"expired\";\nexport const WorkspaceActionRequestStatus = {\n\tPending: \"pending\",\n\tApproved: \"approved\",\n\tRejected: \"rejected\",\n\tExpired: \"expired\",\n} as const satisfies Record<string, WorkspaceActionRequestStatus>;\n\n/**\n * `params` of an action request, per `action`. Actions without parameters take an empty object;\n * unknown keys are rejected with `WORKSPACE_ACTION_INVALID_PARAMS`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/create\n */\nexport interface WorkspaceActionRequestParams {\n\tapp_delete: Record<string, never>;\n\tdatabase_delete: Record<string, never>;\n\tsnapshot_create: Record<string, never>;\n\t/** The snapshot must belong to the request's resource. */\n\tsnapshot_restore: { snapshot_id: SnowFlake };\n}\n\ninterface APIWorkspaceActionRequestBase {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n\tresource_name: string | null;\n\tstatus: WorkspaceActionRequestStatus;\n\trequested_by: { id: SnowFlake; display_name: string };\n\tdecided_by: { id: SnowFlake; display_name: string } | null;\n\tdecided_at: ISODateString | null;\n\texpires_at: ISODateString;\n\tcreated_at: ISODateString;\n}\n\n/**\n * A request for a destructive/sensitive action made by a member who lacks its permission, to be\n * approved by someone who has it. Expires after 24 h without a decision. Discriminated by `action`,\n * which decides the shape of `params`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type APIWorkspaceActionRequest = {\n\t[A in WorkspaceActionRequestAction]: APIWorkspaceActionRequestBase & { action: A; params: WorkspaceActionRequestParams[A] };\n}[WorkspaceActionRequestAction];\n\n/**\n * Workspace error codes. Stable English sentinels returned in `code`; clients are expected to\n * translate them.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport const WORKSPACE_ERROR_CODES = {\n\tWORKSPACE_NOT_FOUND: \"WORKSPACE_NOT_FOUND\",\n\tWORKSPACE_NAME_ALREADY_EXISTS: \"WORKSPACE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_MEMBER_LIMIT_REACHED: \"WORKSPACE_MEMBER_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_LIMIT_REACHED: \"WORKSPACE_ROLE_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_IN_USE: \"WORKSPACE_ROLE_IN_USE\",\n\tWORKSPACE_ROLE_NOT_FOUND: \"WORKSPACE_ROLE_NOT_FOUND\",\n\tWORKSPACE_ROLE_NAME_ALREADY_EXISTS: \"WORKSPACE_ROLE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_PERMISSION_DENIED: \"WORKSPACE_PERMISSION_DENIED\",\n\tWORKSPACE_PERMISSION_ESCALATION: \"WORKSPACE_PERMISSION_ESCALATION\",\n\tWORKSPACE_INVITE_NOT_FOUND: \"WORKSPACE_INVITE_NOT_FOUND\",\n\tWORKSPACE_INVITE_EXPIRED: \"WORKSPACE_INVITE_EXPIRED\",\n\tWORKSPACE_INVITE_EMAIL_MISMATCH: \"WORKSPACE_INVITE_EMAIL_MISMATCH\",\n\t/** 400 — the invited account turned off workspace invites by email. */\n\tWORKSPACE_INVITES_DISABLED: \"WORKSPACE_INVITES_DISABLED\",\n\t/** 409 — the account is already the owner or a member of the workspace. */\n\tWORKSPACE_ALREADY_MEMBER: \"WORKSPACE_ALREADY_MEMBER\",\n\tWORKSPACE_OWNER_ONLY: \"WORKSPACE_OWNER_ONLY\",\n\tWORKSPACE_ACTION_REQUEST_NOT_FOUND: \"WORKSPACE_ACTION_REQUEST_NOT_FOUND\",\n\t/** 410 — the request expired before anyone decided on it. */\n\tWORKSPACE_ACTION_REQUEST_EXPIRED: \"WORKSPACE_ACTION_REQUEST_EXPIRED\",\n\t/** 409 — the request was already approved or rejected. */\n\tWORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: \"WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED\",\n\t/** 400 — the requester already has the permission; perform the action directly. */\n\tWORKSPACE_ACTION_NOT_NEEDED: \"WORKSPACE_ACTION_NOT_NEEDED\",\n\t/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */\n\tWORKSPACE_ACTION_INVALID_PARAMS: \"WORKSPACE_ACTION_INVALID_PARAMS\",\n\t/** 409 — a pending request already exists for the same action on the same resource. */\n\tWORKSPACE_ACTION_REQUEST_PENDING: \"WORKSPACE_ACTION_REQUEST_PENDING\",\n\tWORKSPACE_RESOURCE_FOLDER_NOT_FOUND: \"WORKSPACE_RESOURCE_FOLDER_NOT_FOUND\",\n\tWORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT: \"WORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT\",\n\tWORKSPACE_RESOURCE_NOT_FOUND: \"WORKSPACE_RESOURCE_NOT_FOUND\",\n\tPLAN_RESTRICTED_FEATURE: \"PLAN_RESTRICTED_FEATURE\",\n} as const;\nexport type WorkspaceErrorCode = (typeof WORKSPACE_ERROR_CODES)[keyof typeof WORKSPACE_ERROR_CODES];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC2DO,IAAM,wBAA+E;AAAA,EAC3F,aAAa,EAAE,OAAO,OAAO;AAAA,EAC7B,eAAe,EAAE,OAAO,OAAO;AAAA,EAC/B,kBAAkB,EAAE,OAAO,OAAO;AAAA,EAClC,aAAa,EAAE,OAAO,OAAO;AAAA,EAC7B,cAAc,EAAE,OAAO,OAAO;AAAA,EAC9B,e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;AAAA,EACjB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,0BAA0B;AAAA,EAC1B,+BAA+B;AAAA,EAC/B,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,GAAG;AACJ;AAEO,IAAM,eAAe;","names":[]}
|
|
@@ -35,9 +35,16 @@ var WORKSPACE_ERROR_CODES = {
|
|
|
35
35
|
WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND",
|
|
36
36
|
WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED",
|
|
37
37
|
WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH",
|
|
38
|
+
/** 400 — the invited account turned off workspace invites by email. */
|
|
39
|
+
WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED",
|
|
40
|
+
/** 409 — the account is already the owner or a member of the workspace. */
|
|
41
|
+
WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER",
|
|
38
42
|
WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY",
|
|
39
43
|
WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND",
|
|
44
|
+
/** 410 — the request expired before anyone decided on it. */
|
|
45
|
+
WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED",
|
|
40
46
|
/** 409 — the request was already approved or rejected. */
|
|
47
|
+
WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED",
|
|
41
48
|
/** 400 — the requester already has the permission; perform the action directly. */
|
|
42
49
|
WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED",
|
|
43
50
|
/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */
|
|
@@ -54,8 +61,16 @@ var WORKSPACE_ERROR_CODES = {
|
|
|
54
61
|
var API_ERROR_CODES = {
|
|
55
62
|
ACCESS_DENIED: "ACCESS_DENIED",
|
|
56
63
|
API_KEY_INVALID: "API_KEY_INVALID",
|
|
64
|
+
// Key management (`/v1/users/me/api-keys`) — dashboard-session routes.
|
|
65
|
+
API_KEY_NOT_FOUND: "API_KEY_NOT_FOUND",
|
|
66
|
+
API_KEY_LIMIT_REACHED: "API_KEY_LIMIT_REACHED",
|
|
67
|
+
API_KEY_INVALID_NAME: "API_KEY_INVALID_NAME",
|
|
68
|
+
API_KEY_INVALID_SCOPES: "API_KEY_INVALID_SCOPES",
|
|
69
|
+
API_KEY_INVALID_IPS: "API_KEY_INVALID_IPS",
|
|
57
70
|
API_KEY_IP_DENIED: "API_KEY_IP_DENIED",
|
|
58
71
|
API_KEY_SCOPE_DENIED: "API_KEY_SCOPE_DENIED",
|
|
72
|
+
/** 403 — the route only accepts a dashboard session; API keys are refused. */
|
|
73
|
+
WEBSITE_ONLY: "WEBSITE_ONLY",
|
|
59
74
|
AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING",
|
|
60
75
|
ACCOUNT_BANNED: "ACCOUNT_BANNED",
|
|
61
76
|
APP_SHIELD_COOLDOWN: "APP_SHIELD_COOLDOWN",
|
|
@@ -120,6 +135,7 @@ var API_ERROR_CODES = {
|
|
|
120
135
|
INVALID_RAM_LIMIT: "INVALID_RAM_LIMIT",
|
|
121
136
|
INVALID_RANGE: "INVALID_RANGE",
|
|
122
137
|
INVALID_SUBDOMAIN_FORMAT: "INVALID_SUBDOMAIN_FORMAT",
|
|
138
|
+
INVALID_VERSION: "INVALID_VERSION",
|
|
123
139
|
INVALID_ZIP: "INVALID_ZIP",
|
|
124
140
|
INVALID_ZIP_STRUCTURE: "INVALID_ZIP_STRUCTURE",
|
|
125
141
|
MAIN_FILE_NOT_FOUND: "MAIN_FILE_NOT_FOUND",
|
|
@@ -145,8 +145,6 @@ interface APIApplication {
|
|
|
145
145
|
updated_at: ISODateString;
|
|
146
146
|
main_file: string;
|
|
147
147
|
version: ApplicationVersion;
|
|
148
|
-
/** @deprecated Always `true` since 2026-09-17 — auto-restart is on for every plan; any value sent is ignored. */
|
|
149
|
-
auto_restart: boolean;
|
|
150
148
|
start_command: string | null;
|
|
151
149
|
/**
|
|
152
150
|
* Build command, run once per deploy, after dependencies are installed and before the app
|
|
@@ -237,8 +235,6 @@ interface APIApplicationConfig {
|
|
|
237
235
|
MAIN: string;
|
|
238
236
|
VERSION: ApplicationVersion;
|
|
239
237
|
DESCRIPTION?: string;
|
|
240
|
-
/** @deprecated Always `true` since 2026-09-17 — auto-restart is on for every plan; any value sent is ignored. */
|
|
241
|
-
AUTORESTART?: boolean;
|
|
242
238
|
START?: string;
|
|
243
239
|
/** Build command (see `APIApplication.build_command`). */
|
|
244
240
|
BUILD?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["application.ts"],"sourcesContent":["import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationLanguage = \"javascript\" | \"typescript\" | \"bun\" | \"python\" | \"static\" | \"php\" | \"go\" | \"ruby\" | \"java\" | \"rust\";\nexport const ApplicationLanguage = {\n\tJAVASCRIPT: \"javascript\",\n\tTYPESCRIPT: \"typescript\",\n\tBUN: \"bun\",\n\tPYTHON: \"python\",\n\tSTATIC: \"static\",\n\tPHP: \"php\",\n\tGO: \"go\",\n\tRUBY: \"ruby\",\n\tJAVA: \"java\",\n\tRUST: \"rust\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationStatus = \"up\" | \"down\";\nexport const ApplicationStatus = {\n\tUP: \"up\",\n\tDOWN: \"down\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationCluster = number;\nexport const ApplicationCluster = {\n\tUSA_1: 1,\n\tUSA_2: 2,\n\tUSA_3: 3,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationType = 1 | 2;\nexport const ApplicationType = {\n\tBOT: 1,\n\tWEBSITE: 2,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport type ApplicationFileType = \"file\" | \"directory\";\nexport const ApplicationFileType = {\n\tFILE: \"file\",\n\tDIRECTORY: \"directory\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationVersion = \"recommended\" | \"latest\" | \"auto\" | (string & {});\nexport const ApplicationVersion = {\n\tRECOMMENDED: \"recommended\",\n\tLATEST: \"latest\",\n\tAUTO: \"auto\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport type ApplicationFileContentType = \"base64\";\nexport const ApplicationFileContentType = {\n\tBASE64: \"base64\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport interface APIApplicationFile {\n\ttype: ApplicationFileType;\n\tname: string;\n\tpath: string;\n\tsize?: string;\n\tlast_modified: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/tree\n */\nexport interface APIApplicationFileTree extends APIApplicationFile {\n\tchildren?: APIApplicationFileTree[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport interface APIApplicationFileContent {\n\ttype: \"base64\";\n\t/** File bytes in standard base64 (with padding). */\n\tdata: string;\n\t/** Actual size in bytes (not the length of the base64 string). */\n\tsize: number;\n\t/** File mtime; send it back on PUT (`last_modified`) to detect edit conflicts. */\n\tlast_modified: ISODateString;\n}\n\n/**\n * Successful ZIP upload through `POST /v1/apps/:id/files/upload`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport interface APIApplicationFileUpload {\n\tapp_id: SnowFlake;\n\tupdated_at: ISODateString;\n\tmissing_dependencies: string[];\n\tremoved_directories: string[];\n}\n\n/**\n * Repository linked to the application for auto-deploy. The webhook URL is not included here.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationGithub {\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplication {\n\tid: SnowFlake;\n\tcluster: ApplicationCluster;\n\ttype: ApplicationType;\n\tname: string;\n\tdescription?: string;\n\towner_id: string; // UUID\n\towner_plan_id: UserPlan; // Owner's plan\n\tlanguage: ApplicationLanguage;\n\tram: number;\n\tstatus: ApplicationStatus;\n\tsubdomain: string | null; // example: \"my-app.vertraweb.app\"\n\t/**\n\t * Canonical public URL of the app, computed by the server (`custom_domain` > `subdomain` >\n\t * `null`). Clients should use it as-is instead of building the URL from the subdomain.\n\t */\n\tpublic_url: string | null;\n\t/**\n\t * GitHub integration of this application, if any. `null` = the source is a zip (or snapshot).\n\t * May be absent in older payloads. The webhook URL is available from\n\t * `GET /v1/apps/:id/deploys/webhook`.\n\t */\n\tgithub?: APIApplicationGithub | null;\n\tcustom_domain: string | null; // example: \"my-app.com.br\"\n\tlast_snapshot: ISODateString | null;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n\tmain_file: string;\n\tversion: ApplicationVersion;\n\t/** @deprecated Always `true` since 2026-09-17 — auto-restart is on for every plan; any value sent is ignored. */\n\tauto_restart: boolean;\n\tstart_command: string | null;\n\t/**\n\t * Build command, run once per deploy, after dependencies are installed and before the app\n\t * starts — in the build environment, with more memory than the app. `null` = no build step.\n\t * If it fails, the deploy fails and the app does not start.\n\t */\n\tbuild_command: string | null;\n\toffline_since: ISODateString | null;\n\tmissing_dependencies?: string[]; // Undeclared packages detected on build/deploy\n\t/** Active Vertra Shield containment (burst/rate limit); `null` when there is none. */\n\tshield_cooldown: APIApplicationShieldCooldown | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationNetwork {\n\ttotal: string;\n\tnow: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/status\n */\nexport interface APIApplicationStatus {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** @deprecated Not returned by `GET /v1/apps/:id/status`; use `running`. */\n\tstatus?: ApplicationStatus;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\tstorage: string;\n\t/** `null` when network usage is unavailable (e.g. the app is stopped). */\n\tnetwork: APIApplicationNetwork | null;\n\tuptime: number;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/allstatus\n */\nexport interface APIApplicationStatusShort {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** Absent when the app's status could not be read. */\n\tstorage?: string;\n\t/** Absent when the app's status could not be read; `null` when network usage is unavailable. */\n\tnetwork?: APIApplicationNetwork | null;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\t/**\n\t * Seconds since the app started.\n\t *\n\t * A duration, not a point in time — hence `number` rather than `ISODateString`. Same unit and\n\t * type as `APIApplicationStatus.uptime`.\n\t *\n\t * `null` when unknown (the app is stopped or its status could not be read). **`0` is never used\n\t * as a sentinel** — `0` means \"just started\".\n\t */\n\tuptime: number | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport interface APIApplicationMetric {\n\tcpu: number;\n\tram: number;\n\tstorage: number;\n\tdate: ISODateString;\n\tnetwork: number[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport interface APIApplicationConfig {\n\tNAME: string;\n\tMEMORY: number;\n\tMAIN: string;\n\tVERSION: ApplicationVersion;\n\tDESCRIPTION?: string;\n\t/** @deprecated Always `true` since 2026-09-17 — auto-restart is on for every plan; any value sent is ignored. */\n\tAUTORESTART?: boolean;\n\tSTART?: string;\n\t/** Build command (see `APIApplication.build_command`). */\n\tBUILD?: string;\n\tSUBDOMAIN?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/get\n */\nexport interface APIApplicationEnvironment {\n\tid: string;\n\tkey: string;\n\tvalue: string;\n\tnote: string | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/start\n */\nexport interface APIApplicationOperationResponse {\n\tstatus: \"success\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/recents\n */\nexport interface APIApplicationDeployment {\n\tapp_id: SnowFlake;\n\tcommit_id: string;\n\tmessage: string;\n\tpusher: string;\n\tbranch: string;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordType = \"CNAME\" | \"TXT\";\nexport const ApplicationDnsRecordType = {\n\tCNAME: \"CNAME\",\n\tTXT: \"TXT\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordStatus = \"active\" | \"pending_validation\";\nexport const ApplicationDnsRecordStatus = {\n\tACTIVE: \"active\",\n\tPENDING_VALIDATION: \"pending_validation\",\n} as const;\n\n/**\n * DNS record the user must create at their DNS provider for the custom domain.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport interface APIApplicationDnsRecord {\n\ttype: ApplicationDnsRecordType;\n\tname: string;\n\tvalue: string;\n\tstatus: ApplicationDnsRecordStatus;\n}\n\n/**\n * Returned when the auto-deploy webhook is created.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport interface APIApplicationWebhookUrl {\n\turl: string;\n}\n\n/**\n * Auto-deploy webhook of an application and the repository it is linked to.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/webhookurl\n */\nexport interface APIApplicationWebhook {\n\twebhook_url: string;\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport interface APIApplicationSubdomain {\n\t/** Full hostname (`my-app.vertraweb.app`). */\n\tsubdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport interface APIApplicationCustomDomain {\n\tdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentReason = \"burst\" | \"rate_limit\";\nexport const ShieldIncidentReason = {\n\tBURST: \"burst\",\n\tRATE_LIMIT: \"rate_limit\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentDirection = \"in\" | \"out\";\nexport const ShieldIncidentDirection = {\n\tIN: \"in\",\n\tOUT: \"out\",\n} as const;\n\n/**\n * Active Vertra Shield containment on this application (bandwidth limit after a burst/rate limit).\n * `null` when no containment is in effect.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationShieldCooldown {\n\tuntil: ISODateString;\n\treason: ShieldIncidentReason;\n\tdirection: ShieldIncidentDirection;\n\tstrikes: number;\n}\n\n/**\n * Web publishing state of an application.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport interface APIApplicationWebPublish {\n\t/** `null` when web publishing is off. */\n\tsubdomain: string | null;\n\tcustom_domain: string | null;\n\ttype: ApplicationType;\n}\n\n/**\n * Suggestions from scanning the zip before creating an application. Nothing is applied\n * automatically: they are meant to pre-fill a creation form that the user can edit.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport interface APIApplicationScanSuggestions {\n\tsuggested_start_command?: string;\n\tsuggested_build_command?: string;\n\tsuggested_memory_mb?: number;\n\tsuggested_public_web?: boolean;\n\tmissing_dependencies?: string[];\n}\n\n/**\n * One runtime of `GET /v1/apps/runtimes`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport interface APIApplicationRuntime {\n\t/** Recommended version for new applications. */\n\trecommended: string;\n\tlatest: string;\n\t/** Other exact versions that can be pinned. Empty for runtimes without version pinning. */\n\tspecific: string[];\n}\n\n/**\n * Catalog of supported runtimes, keyed by language.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport type APIApplicationRuntimes = Record<ApplicationLanguage, APIApplicationRuntime>;\n\n/**\n * `event` field of the `GET /v1/apps/:id/realtime` stream (`text/event-stream`).\n * `logs` = application output (one or more lines); `system` = stream/platform notices (e.g.\n * `install_note:started`); `heartbeat` = keep-alive, no content.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport type ApplicationRealtimeEventType = \"logs\" | \"system\" | \"heartbeat\";\nexport const ApplicationRealtimeEventType = {\n\tLOGS: \"logs\",\n\tSYSTEM: \"system\",\n\tHEARTBEAT: \"heartbeat\",\n} as const;\n\n/**\n * One server-sent event of `GET /v1/apps/:id/realtime`. `data` is plain text, not JSON; a `logs`\n * event may carry several lines separated by `\\n`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport interface APIApplicationRealtimeEvent {\n\tevent: ApplicationRealtimeEventType;\n\tdata: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,sBAAsB;AAAA,EAClC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAMO,IAAM,oBAAoB;AAAA,EAChC,IAAI;AAAA,EACJ,MAAM;AACP;AAMO,IAAM,qBAAqB;AAAA,EACjC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;AAMO,IAAM,kBAAkB;AAAA,EAC9B,KAAK;AAAA,EACL,SAAS;AACV;AAMO,IAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,EACN,WAAW;AACZ;AAMO,IAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AACP;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AACT;AAiOO,IAAM,2BAA2B;AAAA,EACvC,OAAO;AAAA,EACP,KAAK;AACN;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AAAA,EACR,oBAAoB;AACrB;AAmDO,IAAM,uBAAuB;AAAA,EACnC,OAAO;AAAA,EACP,YAAY;AACb;AAMO,IAAM,0BAA0B;AAAA,EACtC,IAAI;AAAA,EACJ,KAAK;AACN;AAkEO,IAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,WAAW;AACZ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["application.ts"],"sourcesContent":["import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationLanguage = \"javascript\" | \"typescript\" | \"bun\" | \"python\" | \"static\" | \"php\" | \"go\" | \"ruby\" | \"java\" | \"rust\";\nexport const ApplicationLanguage = {\n\tJAVASCRIPT: \"javascript\",\n\tTYPESCRIPT: \"typescript\",\n\tBUN: \"bun\",\n\tPYTHON: \"python\",\n\tSTATIC: \"static\",\n\tPHP: \"php\",\n\tGO: \"go\",\n\tRUBY: \"ruby\",\n\tJAVA: \"java\",\n\tRUST: \"rust\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationStatus = \"up\" | \"down\";\nexport const ApplicationStatus = {\n\tUP: \"up\",\n\tDOWN: \"down\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationCluster = number;\nexport const ApplicationCluster = {\n\tUSA_1: 1,\n\tUSA_2: 2,\n\tUSA_3: 3,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationType = 1 | 2;\nexport const ApplicationType = {\n\tBOT: 1,\n\tWEBSITE: 2,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport type ApplicationFileType = \"file\" | \"directory\";\nexport const ApplicationFileType = {\n\tFILE: \"file\",\n\tDIRECTORY: \"directory\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationVersion = \"recommended\" | \"latest\" | \"auto\" | (string & {});\nexport const ApplicationVersion = {\n\tRECOMMENDED: \"recommended\",\n\tLATEST: \"latest\",\n\tAUTO: \"auto\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport type ApplicationFileContentType = \"base64\";\nexport const ApplicationFileContentType = {\n\tBASE64: \"base64\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport interface APIApplicationFile {\n\ttype: ApplicationFileType;\n\tname: string;\n\tpath: string;\n\tsize?: string;\n\tlast_modified: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/tree\n */\nexport interface APIApplicationFileTree extends APIApplicationFile {\n\tchildren?: APIApplicationFileTree[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport interface APIApplicationFileContent {\n\ttype: \"base64\";\n\t/** File bytes in standard base64 (with padding). */\n\tdata: string;\n\t/** Actual size in bytes (not the length of the base64 string). */\n\tsize: number;\n\t/** File mtime; send it back on PUT (`last_modified`) to detect edit conflicts. */\n\tlast_modified: ISODateString;\n}\n\n/**\n * Successful ZIP upload through `POST /v1/apps/:id/files/upload`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport interface APIApplicationFileUpload {\n\tapp_id: SnowFlake;\n\tupdated_at: ISODateString;\n\tmissing_dependencies: string[];\n\tremoved_directories: string[];\n}\n\n/**\n * Repository linked to the application for auto-deploy. The webhook URL is not included here.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationGithub {\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplication {\n\tid: SnowFlake;\n\tcluster: ApplicationCluster;\n\ttype: ApplicationType;\n\tname: string;\n\tdescription?: string;\n\towner_id: string; // UUID\n\towner_plan_id: UserPlan; // Owner's plan\n\tlanguage: ApplicationLanguage;\n\tram: number;\n\tstatus: ApplicationStatus;\n\tsubdomain: string | null; // example: \"my-app.vertraweb.app\"\n\t/**\n\t * Canonical public URL of the app, computed by the server (`custom_domain` > `subdomain` >\n\t * `null`). Clients should use it as-is instead of building the URL from the subdomain.\n\t */\n\tpublic_url: string | null;\n\t/**\n\t * GitHub integration of this application, if any. `null` = the source is a zip (or snapshot).\n\t * May be absent in older payloads. The webhook URL is available from\n\t * `GET /v1/apps/:id/deploys/webhook`.\n\t */\n\tgithub?: APIApplicationGithub | null;\n\tcustom_domain: string | null; // example: \"my-app.com.br\"\n\tlast_snapshot: ISODateString | null;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n\tmain_file: string;\n\tversion: ApplicationVersion;\n\tstart_command: string | null;\n\t/**\n\t * Build command, run once per deploy, after dependencies are installed and before the app\n\t * starts — in the build environment, with more memory than the app. `null` = no build step.\n\t * If it fails, the deploy fails and the app does not start.\n\t */\n\tbuild_command: string | null;\n\toffline_since: ISODateString | null;\n\tmissing_dependencies?: string[]; // Undeclared packages detected on build/deploy\n\t/** Active Vertra Shield containment (burst/rate limit); `null` when there is none. */\n\tshield_cooldown: APIApplicationShieldCooldown | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationNetwork {\n\ttotal: string;\n\tnow: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/status\n */\nexport interface APIApplicationStatus {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** @deprecated Not returned by `GET /v1/apps/:id/status`; use `running`. */\n\tstatus?: ApplicationStatus;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\tstorage: string;\n\t/** `null` when network usage is unavailable (e.g. the app is stopped). */\n\tnetwork: APIApplicationNetwork | null;\n\tuptime: number;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/allstatus\n */\nexport interface APIApplicationStatusShort {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** Absent when the app's status could not be read. */\n\tstorage?: string;\n\t/** Absent when the app's status could not be read; `null` when network usage is unavailable. */\n\tnetwork?: APIApplicationNetwork | null;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\t/**\n\t * Seconds since the app started.\n\t *\n\t * A duration, not a point in time — hence `number` rather than `ISODateString`. Same unit and\n\t * type as `APIApplicationStatus.uptime`.\n\t *\n\t * `null` when unknown (the app is stopped or its status could not be read). **`0` is never used\n\t * as a sentinel** — `0` means \"just started\".\n\t */\n\tuptime: number | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport interface APIApplicationMetric {\n\tcpu: number;\n\tram: number;\n\tstorage: number;\n\tdate: ISODateString;\n\tnetwork: number[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport interface APIApplicationConfig {\n\tNAME: string;\n\tMEMORY: number;\n\tMAIN: string;\n\tVERSION: ApplicationVersion;\n\tDESCRIPTION?: string;\n\tSTART?: string;\n\t/** Build command (see `APIApplication.build_command`). */\n\tBUILD?: string;\n\tSUBDOMAIN?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/get\n */\nexport interface APIApplicationEnvironment {\n\tid: string;\n\tkey: string;\n\tvalue: string;\n\tnote: string | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/start\n */\nexport interface APIApplicationOperationResponse {\n\tstatus: \"success\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/recents\n */\nexport interface APIApplicationDeployment {\n\tapp_id: SnowFlake;\n\tcommit_id: string;\n\tmessage: string;\n\tpusher: string;\n\tbranch: string;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordType = \"CNAME\" | \"TXT\";\nexport const ApplicationDnsRecordType = {\n\tCNAME: \"CNAME\",\n\tTXT: \"TXT\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordStatus = \"active\" | \"pending_validation\";\nexport const ApplicationDnsRecordStatus = {\n\tACTIVE: \"active\",\n\tPENDING_VALIDATION: \"pending_validation\",\n} as const;\n\n/**\n * DNS record the user must create at their DNS provider for the custom domain.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport interface APIApplicationDnsRecord {\n\ttype: ApplicationDnsRecordType;\n\tname: string;\n\tvalue: string;\n\tstatus: ApplicationDnsRecordStatus;\n}\n\n/**\n * Returned when the auto-deploy webhook is created.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport interface APIApplicationWebhookUrl {\n\turl: string;\n}\n\n/**\n * Auto-deploy webhook of an application and the repository it is linked to.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/webhookurl\n */\nexport interface APIApplicationWebhook {\n\twebhook_url: string;\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport interface APIApplicationSubdomain {\n\t/** Full hostname (`my-app.vertraweb.app`). */\n\tsubdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport interface APIApplicationCustomDomain {\n\tdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentReason = \"burst\" | \"rate_limit\";\nexport const ShieldIncidentReason = {\n\tBURST: \"burst\",\n\tRATE_LIMIT: \"rate_limit\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentDirection = \"in\" | \"out\";\nexport const ShieldIncidentDirection = {\n\tIN: \"in\",\n\tOUT: \"out\",\n} as const;\n\n/**\n * Active Vertra Shield containment on this application (bandwidth limit after a burst/rate limit).\n * `null` when no containment is in effect.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationShieldCooldown {\n\tuntil: ISODateString;\n\treason: ShieldIncidentReason;\n\tdirection: ShieldIncidentDirection;\n\tstrikes: number;\n}\n\n/**\n * Web publishing state of an application.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport interface APIApplicationWebPublish {\n\t/** `null` when web publishing is off. */\n\tsubdomain: string | null;\n\tcustom_domain: string | null;\n\ttype: ApplicationType;\n}\n\n/**\n * Suggestions from scanning the zip before creating an application. Nothing is applied\n * automatically: they are meant to pre-fill a creation form that the user can edit.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport interface APIApplicationScanSuggestions {\n\tsuggested_start_command?: string;\n\tsuggested_build_command?: string;\n\tsuggested_memory_mb?: number;\n\tsuggested_public_web?: boolean;\n\tmissing_dependencies?: string[];\n}\n\n/**\n * One runtime of `GET /v1/apps/runtimes`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport interface APIApplicationRuntime {\n\t/** Recommended version for new applications. */\n\trecommended: string;\n\tlatest: string;\n\t/** Other exact versions that can be pinned. Empty for runtimes without version pinning. */\n\tspecific: string[];\n}\n\n/**\n * Catalog of supported runtimes, keyed by language.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport type APIApplicationRuntimes = Record<ApplicationLanguage, APIApplicationRuntime>;\n\n/**\n * `event` field of the `GET /v1/apps/:id/realtime` stream (`text/event-stream`).\n * `logs` = application output (one or more lines); `system` = stream/platform notices (e.g.\n * `install_note:started`); `heartbeat` = keep-alive, no content.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport type ApplicationRealtimeEventType = \"logs\" | \"system\" | \"heartbeat\";\nexport const ApplicationRealtimeEventType = {\n\tLOGS: \"logs\",\n\tSYSTEM: \"system\",\n\tHEARTBEAT: \"heartbeat\",\n} as const;\n\n/**\n * One server-sent event of `GET /v1/apps/:id/realtime`. `data` is plain text, not JSON; a `logs`\n * event may carry several lines separated by `\\n`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport interface APIApplicationRealtimeEvent {\n\tevent: ApplicationRealtimeEventType;\n\tdata: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,sBAAsB;AAAA,EAClC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAMO,IAAM,oBAAoB;AAAA,EAChC,IAAI;AAAA,EACJ,MAAM;AACP;AAMO,IAAM,qBAAqB;AAAA,EACjC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;AAMO,IAAM,kBAAkB;AAAA,EAC9B,KAAK;AAAA,EACL,SAAS;AACV;AAMO,IAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,EACN,WAAW;AACZ;AAMO,IAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AACP;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AACT;AA6NO,IAAM,2BAA2B;AAAA,EACvC,OAAO;AAAA,EACP,KAAK;AACN;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AAAA,EACR,oBAAoB;AACrB;AAmDO,IAAM,uBAAuB;AAAA,EACnC,OAAO;AAAA,EACP,YAAY;AACb;AAMO,IAAM,0BAA0B;AAAA,EACtC,IAAI;AAAA,EACJ,KAAK;AACN;AAkEO,IAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,WAAW;AACZ;","names":[]}
|
package/payloads/v1/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export { APIErrorCode, API_ERROR_CODES } from './api-error.js';
|
|
|
4
4
|
export { APIApplication, APIApplicationConfig, APIApplicationCustomDomain, APIApplicationDeployment, APIApplicationDnsRecord, APIApplicationEnvironment, APIApplicationFile, APIApplicationFileContent, APIApplicationFileTree, APIApplicationFileUpload, APIApplicationGithub, APIApplicationMetric, APIApplicationNetwork, APIApplicationOperationResponse, APIApplicationRealtimeEvent, APIApplicationRuntime, APIApplicationRuntimes, APIApplicationScanSuggestions, APIApplicationShieldCooldown, APIApplicationStatus, APIApplicationStatusShort, APIApplicationSubdomain, APIApplicationWebPublish, APIApplicationWebhook, APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationStatus, ApplicationType, ApplicationVersion, ShieldIncidentDirection, ShieldIncidentReason } from './application.js';
|
|
5
5
|
export { APIDatabase, APIDatabaseCertificate, APIDatabaseMetrics, APIDatabaseNetwork, APIDatabaseOperationResponse, APIDatabasePasswordReset, APIDatabaseStatus, APIDatabaseStatusShort, DatabaseCluster, DatabaseStatus, DatabaseType } from './database.js';
|
|
6
6
|
export { APIDatabaseCollection, APIDatabaseColumn, APIDatabaseColumnReference, APIDatabaseDataError, APIDatabaseDataOverview, APIDatabaseDocumentListParams, APIDatabaseDocumentsPage, APIDatabaseIndex, APIDatabaseListParams, APIDatabaseMongoIndex, APIDatabaseQueryResult, APIDatabaseRedisInfo, APIDatabaseRedisKey, APIDatabaseRedisKeyValue, APIDatabaseRedisKeysPage, APIDatabaseRedisScanParams, APIDatabaseRedisZSetMember, APIDatabaseRowFilter, APIDatabaseRowsPage, APIDatabaseSchema, APIDatabaseTable, DatabaseFilterOperator, DatabaseRedisKeyType, DatabaseSortDirection, DatabaseTableKind } from './database-data.js';
|
|
7
|
-
export { APIGitHubFile } from './github.js';
|
|
8
7
|
export { APINotification, LocalizedContent, NotificationImportance, NotificationType } from './notification.js';
|
|
9
8
|
export { APIOAuthClient, APIOAuthCodeChallengeMethod, APIOAuthConsentDecision } from './oauth.js';
|
|
10
9
|
export { APIOrderCreateResponse, APIOrderDiscount, APIOrderListItem, APIOrderPixPayment, APIOrderStatus, OrderProvider, OrderStatus, OrderType } from './orders.js';
|
package/payloads/v1/index.js
CHANGED
|
@@ -415,9 +415,16 @@ var WORKSPACE_ERROR_CODES = {
|
|
|
415
415
|
WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND",
|
|
416
416
|
WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED",
|
|
417
417
|
WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH",
|
|
418
|
+
/** 400 — the invited account turned off workspace invites by email. */
|
|
419
|
+
WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED",
|
|
420
|
+
/** 409 — the account is already the owner or a member of the workspace. */
|
|
421
|
+
WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER",
|
|
418
422
|
WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY",
|
|
419
423
|
WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND",
|
|
424
|
+
/** 410 — the request expired before anyone decided on it. */
|
|
425
|
+
WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED",
|
|
420
426
|
/** 409 — the request was already approved or rejected. */
|
|
427
|
+
WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED",
|
|
421
428
|
/** 400 — the requester already has the permission; perform the action directly. */
|
|
422
429
|
WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED",
|
|
423
430
|
/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */
|
|
@@ -434,8 +441,16 @@ var WORKSPACE_ERROR_CODES = {
|
|
|
434
441
|
var API_ERROR_CODES = {
|
|
435
442
|
ACCESS_DENIED: "ACCESS_DENIED",
|
|
436
443
|
API_KEY_INVALID: "API_KEY_INVALID",
|
|
444
|
+
// Key management (`/v1/users/me/api-keys`) — dashboard-session routes.
|
|
445
|
+
API_KEY_NOT_FOUND: "API_KEY_NOT_FOUND",
|
|
446
|
+
API_KEY_LIMIT_REACHED: "API_KEY_LIMIT_REACHED",
|
|
447
|
+
API_KEY_INVALID_NAME: "API_KEY_INVALID_NAME",
|
|
448
|
+
API_KEY_INVALID_SCOPES: "API_KEY_INVALID_SCOPES",
|
|
449
|
+
API_KEY_INVALID_IPS: "API_KEY_INVALID_IPS",
|
|
437
450
|
API_KEY_IP_DENIED: "API_KEY_IP_DENIED",
|
|
438
451
|
API_KEY_SCOPE_DENIED: "API_KEY_SCOPE_DENIED",
|
|
452
|
+
/** 403 — the route only accepts a dashboard session; API keys are refused. */
|
|
453
|
+
WEBSITE_ONLY: "WEBSITE_ONLY",
|
|
439
454
|
AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING",
|
|
440
455
|
ACCOUNT_BANNED: "ACCOUNT_BANNED",
|
|
441
456
|
APP_SHIELD_COOLDOWN: "APP_SHIELD_COOLDOWN",
|
|
@@ -500,6 +515,7 @@ var API_ERROR_CODES = {
|
|
|
500
515
|
INVALID_RAM_LIMIT: "INVALID_RAM_LIMIT",
|
|
501
516
|
INVALID_RANGE: "INVALID_RANGE",
|
|
502
517
|
INVALID_SUBDOMAIN_FORMAT: "INVALID_SUBDOMAIN_FORMAT",
|
|
518
|
+
INVALID_VERSION: "INVALID_VERSION",
|
|
503
519
|
INVALID_ZIP: "INVALID_ZIP",
|
|
504
520
|
INVALID_ZIP_STRUCTURE: "INVALID_ZIP_STRUCTURE",
|
|
505
521
|
MAIN_FILE_NOT_FOUND: "MAIN_FILE_NOT_FOUND",
|