@vertracloud/api-types 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["api-key.ts"],"sourcesContent":["import type { ISODateString } from \"../../common/v1\";\n\n/**\n * API key scope, in the form `<resource>:<action>`. Presets: `read` = every `*:read`;\n * `write` = `read` + every `*:write`; `full` = all of them, including the ones without a\n * `read`/`write` suffix (delete, envs, files, credentials).\n * @see https://docs.vertracloud.app/api-reference/introduction#scopes\n */\nexport type APIApiKeyScope =\n\t| \"apps:read\"\n\t| \"apps:write\"\n\t| \"apps:delete\"\n\t| \"apps:envs\"\n\t| \"apps:files\"\n\t| \"databases:read\"\n\t| \"databases:write\"\n\t| \"databases:delete\"\n\t| \"databases:credentials\"\n\t| \"snapshots:read\"\n\t| \"snapshots:write\"\n\t| \"account:read\"\n\t| \"account:write\"\n\t| \"workspaces:read\"\n\t| \"workspaces:write\"\n\t| \"workspaces:delete\"\n\t| \"workspaces:invites\"\n\t| \"billing:read\"\n\t| \"billing:write\"\n\t| \"redeem:write\";\n\nexport const APIApiKeyScope = {\n\tAPPS_READ: \"apps:read\",\n\tAPPS_WRITE: \"apps:write\",\n\tAPPS_DELETE: \"apps:delete\",\n\tAPPS_ENVS: \"apps:envs\",\n\tAPPS_FILES: \"apps:files\",\n\tDATABASES_READ: \"databases:read\",\n\tDATABASES_WRITE: \"databases:write\",\n\tDATABASES_DELETE: \"databases:delete\",\n\tDATABASES_CREDENTIALS: \"databases:credentials\",\n\tSNAPSHOTS_READ: \"snapshots:read\",\n\tSNAPSHOTS_WRITE: \"snapshots:write\",\n\tACCOUNT_READ: \"account:read\",\n\tACCOUNT_WRITE: \"account:write\",\n\tWORKSPACES_READ: \"workspaces:read\",\n\tWORKSPACES_WRITE: \"workspaces:write\",\n\tWORKSPACES_DELETE: \"workspaces:delete\",\n\tWORKSPACES_INVITES: \"workspaces:invites\",\n\tBILLING_READ: \"billing:read\",\n\tBILLING_WRITE: \"billing:write\",\n\tREDEEM_WRITE: \"redeem:write\",\n} as const satisfies Record<string, APIApiKeyScope>;\n\nexport type APIApiKeyPreset = \"read\" | \"write\" | \"full\";\nexport const APIApiKeyPreset = { Read: \"read\", Write: \"write\", Full: \"full\" } as const;\n\nexport type APIApiKeyRouteMethod = \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\nexport interface APIApiKeyRoute {\n\tmethod: APIApiKeyRouteMethod;\n\t/** Full route pattern with `:param` placeholders (`/v1/apps/:id/files`). Matched exactly, no regex. */\n\tpath: string;\n}\n\nexport interface APIApiKeyScopeEntry {\n\t/** Display group the scope belongs to. */\n\tgroup: \"apps\" | \"databases\" | \"snapshots\" | \"account\" | \"workspaces\" | \"billing\";\n\troutes: APIApiKeyRoute[];\n}\n\n/**\n * Closed catalog of the routes an API key can reach, per scope. A key without the route's scope\n * gets 403 `API_KEY_SCOPE_DENIED`; a route that is not listed here always returns 403 to an API key.\n *\n * Intentionally left out (dashboard session only): key management, creating workspace invites\n * (an invite would outlive the key's revocation), revoking sessions, plan downgrade, and the\n * database **Data** tab (`/v1/databases/:id/data/*`).\n *\n * The rollback `POST` with `restore_environment: true` also requires `apps:envs` for an API key;\n * without it the request returns 403 `API_KEY_SCOPE_DENIED`.\n */\nexport const API_KEY_SCOPES: Record<APIApiKeyScope, APIApiKeyScopeEntry> = {\n\t\"apps:read\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/apps/runtimes\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/realtime\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/metrics\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/logs\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/download\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/deploys\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/deploys/webhook\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/releases\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/releases/:release_id/log\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/network/custom\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/network/dns\" },\n\t\t],\n\t},\n\t\"apps:write\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/apps\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/start\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/stop\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/restart\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/apps/:id/config\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/deploys/webhook\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/deploys/webhook\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/network/custom\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/network/custom\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/network/purge-cache\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/apps/:id/network/subdomain\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/network/publish\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/network/publish\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/releases/:release_id/rollback\" },\n\t\t],\n\t},\n\t\"apps:delete\": { group: \"apps\", routes: [{ method: \"DELETE\", path: \"/v1/apps/:id\" }] },\n\t\"apps:envs\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/envs\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/envs\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/envs/:envId\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/releases/:release_id/rollback\" },\n\t\t],\n\t},\n\t\"apps:files\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/files/tree\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/files/content\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/files/upload\" },\n\t\t],\n\t},\n\t\"databases:read\": {\n\t\tgroup: \"databases\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/databases/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id/metrics\" },\n\t\t],\n\t},\n\t\"databases:write\": {\n\t\tgroup: \"databases\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/databases\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/databases/:id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/start\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/stop\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/reset\" },\n\t\t],\n\t},\n\t\"databases:delete\": { group: \"databases\", routes: [{ method: \"DELETE\", path: \"/v1/databases/:id\" }] },\n\t\"databases:credentials\": {\n\t\tgroup: \"databases\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id/credentials/certificate\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/credentials/certificate/reset\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/credentials/reset\" },\n\t\t],\n\t},\n\t\"snapshots:read\": {\n\t\tgroup: \"snapshots\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/users/snapshots\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/:id/snapshots\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/:id/snapshots/:snapshot_id/download\" },\n\t\t],\n\t},\n\t\"snapshots:write\": {\n\t\tgroup: \"snapshots\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/users/:id/snapshots\" },\n\t\t\t{ method: \"POST\", path: \"/v1/users/:id/snapshots/:snapshot_id/restore\" },\n\t\t],\n\t},\n\t\"account:read\": {\n\t\tgroup: \"account\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/users/me\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/me/sessions\" },\n\t\t],\n\t},\n\t\"account:write\": {\n\t\tgroup: \"account\",\n\t\troutes: [\n\t\t\t{ method: \"PATCH\", path: \"/v1/users/me\" },\n\t\t\t{ method: \"POST\", path: \"/v1/users/me/folders\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/users/me/folders/:folder_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/users/me/folders/:folder_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/users/me/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/users/me/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/users/me/favorites/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/users/me/favorites/:resource_type/:resource_id\" },\n\t\t],\n\t},\n\t\"workspaces:read\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/members\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/roles\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/action-requests\" },\n\t\t],\n\t},\n\t\"workspaces:write\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/members/:user_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/members/:user_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/roles\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/roles/:role_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/roles/:role_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/apps/:app_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/apps/:app_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/databases/:db_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/databases/:db_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/folders\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/workspaces/:id/folders/:folder_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/folders/:folder_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/favorites/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/favorites/:resource_type/:resource_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/action-requests\" },\n\t\t],\n\t},\n\t/**\n\t * Intentionally left out (dashboard session only): creating invites (a leaked key could grant\n\t * access that outlives its revocation), transferring ownership, approving/rejecting action\n\t * requests (approval is a human decision) and exporting activities.\n\t */\n\t/** Delete a workspace (soft delete). Only in the `full` preset, like `apps:delete`. */\n\t\"workspaces:delete\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [{ method: \"DELETE\", path: \"/v1/workspaces/:id\" }],\n\t},\n\t/** List and revoke workspace invites; view, accept and decline your own invite by token. Only in the `full` preset. */\n\t\"workspaces:invites\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/invites\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/invites/:invite_id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/invites/:token\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/invites/:token/accept\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/invites/:token/decline\" },\n\t\t],\n\t},\n\t\"billing:read\": {\n\t\tgroup: \"billing\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/orders\" },\n\t\t\t{ method: \"GET\", path: \"/v1/orders/:orderId/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/me/billing\" },\n\t\t],\n\t},\n\t/**\n\t * Creates a plan order and generates the PIX charge; the payment itself is made by a person in their banking app.\n\t * Also saves the billing details (name, address, CPF/CNPJ) an order needs.\n\t */\n\t\"billing:write\": {\n\t\tgroup: \"billing\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/orders\" },\n\t\t\t{ method: \"POST\", path: \"/v1/orders/:orderId/initiate/pix\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/users/me/billing\" },\n\t\t],\n\t},\n\t\"redeem:write\": { group: \"billing\", routes: [{ method: \"POST\", path: \"/v1/redeem/:code\" }] },\n};\n\nexport const API_KEY_SCOPE_LIST = Object.keys(API_KEY_SCOPES) as APIApiKeyScope[];\n\n/** Scopes selected by a preset. `full` is the whole catalog. */\nexport function apiKeyPresetScopes(preset: APIApiKeyPreset): APIApiKeyScope[] {\n\tif (preset === \"full\") return API_KEY_SCOPE_LIST;\n\treturn API_KEY_SCOPE_LIST.filter((s) => s.endsWith(\":read\") || (preset === \"write\" && s.endsWith(\":write\")));\n}\n\n/** Maximum keys per account, entries in `allowed_ips`, and key name length. */\nexport const API_KEY_MAX_PER_USER = 10;\nexport const API_KEY_MAX_ALLOWED_IPS = 20;\nexport const API_KEY_NAME_MAX_LENGTH = 40;\n\n/**\n * An API key as listed. The secret is returned only ONCE, in `APIApiKeyCreated`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/users/api-keys/list\n */\nexport interface APIApiKey {\n\tid: string;\n\tname: string;\n\t/** Public start of the key (`vc_live_a1b2c3d4`; older keys: 8 hex characters). */\n\tprefix: string;\n\t/** Last 4 characters; `null` for keys generated before the `vc_live_` format. */\n\tlast4: string | null;\n\tscopes: APIApiKeyScope[];\n\t/** Allowed IPs/CIDRs. Empty list = any IP. */\n\tallowed_ips: string[];\n\tcreated_at: ISODateString;\n\tlast_used_at: ISODateString | null;\n}\n\nexport interface APIApiKeyCreated extends APIApiKey {\n\t/** The full secret. Shown once; it cannot be recovered. */\n\tapi_key: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BO,IAAM,iBAAiB;AAAA,EAC7B,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,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,OAAO,MAAM,aAAa;AAAA,MACpC,EAAE,QAAQ,OAAO,MAAM,6BAA6B;AAAA,MACpD,EAAE,QAAQ,OAAO,MAAM,uBAAuB;AAAA,IAC/C;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,MACP,EAAE,QAAQ,QAAQ,MAAM,aAAa;AAAA,MACrC,EAAE,QAAQ,QAAQ,MAAM,mCAAmC;AAAA,MAC3D,EAAE,QAAQ,OAAO,MAAM,uBAAuB;AAAA,IAC/C;AAAA,EACD;AAAA,EACA,gBAAgB,EAAE,OAAO,WAAW,QAAQ,CAAC,EAAE,QAAQ,QAAQ,MAAM,mBAAmB,CAAC,EAAE;AAC5F;AAEO,IAAM,qBAAqB,OAAO,KAAK,cAAc;AAGrD,SAAS,mBAAmB,QAA2C;AAC7E,MAAI,WAAW,OAAQ,QAAO;AAC9B,SAAO,mBAAmB,OAAO,CAAC,MAAM,EAAE,SAAS,OAAO,KAAM,WAAW,WAAW,EAAE,SAAS,QAAQ,CAAE;AAC5G;AAGO,IAAM,uBAAuB;AAC7B,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;","names":[]}
1
+ {"version":3,"sources":["api-key.ts"],"sourcesContent":["import type { ISODateString } from \"../../common/v1\";\n\n/**\n * API key scope, in the form `<resource>:<action>`. Presets: `read` = every `*:read`;\n * `write` = `read` + every `*:write`; `full` = all of them, including the ones without a\n * `read`/`write` suffix (delete, envs, files, credentials).\n * @see https://docs.vertracloud.app/api-reference/introduction#scopes\n */\nexport type APIApiKeyScope =\n\t| \"apps:read\"\n\t| \"apps:write\"\n\t| \"apps:delete\"\n\t| \"apps:envs\"\n\t| \"apps:files\"\n\t| \"databases:read\"\n\t| \"databases:write\"\n\t| \"databases:delete\"\n\t| \"databases:credentials\"\n\t| \"snapshots:read\"\n\t| \"snapshots:write\"\n\t| \"account:read\"\n\t| \"account:write\"\n\t| \"workspaces:read\"\n\t| \"workspaces:write\"\n\t| \"workspaces:delete\"\n\t| \"workspaces:invites\"\n\t| \"blob:read\"\n\t| \"blob:write\"\n\t| \"billing:read\"\n\t| \"billing:write\"\n\t| \"redeem:write\";\n\nexport const APIApiKeyScope = {\n\tAPPS_READ: \"apps:read\",\n\tAPPS_WRITE: \"apps:write\",\n\tAPPS_DELETE: \"apps:delete\",\n\tAPPS_ENVS: \"apps:envs\",\n\tAPPS_FILES: \"apps:files\",\n\tDATABASES_READ: \"databases:read\",\n\tDATABASES_WRITE: \"databases:write\",\n\tDATABASES_DELETE: \"databases:delete\",\n\tDATABASES_CREDENTIALS: \"databases:credentials\",\n\tSNAPSHOTS_READ: \"snapshots:read\",\n\tSNAPSHOTS_WRITE: \"snapshots:write\",\n\tACCOUNT_READ: \"account:read\",\n\tACCOUNT_WRITE: \"account:write\",\n\tWORKSPACES_READ: \"workspaces:read\",\n\tWORKSPACES_WRITE: \"workspaces:write\",\n\tWORKSPACES_DELETE: \"workspaces:delete\",\n\tWORKSPACES_INVITES: \"workspaces:invites\",\n\tBLOB_READ: \"blob:read\",\n\tBLOB_WRITE: \"blob:write\",\n\tBILLING_READ: \"billing:read\",\n\tBILLING_WRITE: \"billing:write\",\n\tREDEEM_WRITE: \"redeem:write\",\n} as const satisfies Record<string, APIApiKeyScope>;\n\nexport type APIApiKeyPreset = \"read\" | \"write\" | \"full\";\nexport const APIApiKeyPreset = { Read: \"read\", Write: \"write\", Full: \"full\" } as const;\n\nexport type APIApiKeyRouteMethod = \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\nexport interface APIApiKeyRoute {\n\tmethod: APIApiKeyRouteMethod;\n\t/** Full route pattern with `:param` placeholders (`/v1/apps/:id/files`). Matched exactly, no regex. */\n\tpath: string;\n}\n\nexport interface APIApiKeyScopeEntry {\n\t/** Display group the scope belongs to. */\n\tgroup: \"apps\" | \"databases\" | \"snapshots\" | \"account\" | \"workspaces\" | \"billing\" | \"blob\";\n\troutes: APIApiKeyRoute[];\n}\n\n/**\n * Closed catalog of the routes an API key can reach, per scope. A key without the route's scope\n * gets 403 `API_KEY_SCOPE_DENIED`; a route that is not listed here always returns 403 to an API key.\n *\n * Intentionally left out (dashboard session only): key management, creating workspace invites\n * (an invite would outlive the key's revocation), revoking sessions, plan downgrade, and the\n * database **Data** tab (`/v1/databases/:id/data/*`).\n *\n * The rollback `POST` with `restore_environment: true` also requires `apps:envs` for an API key;\n * without it the request returns 403 `API_KEY_SCOPE_DENIED`.\n */\nexport const API_KEY_SCOPES: Record<APIApiKeyScope, APIApiKeyScopeEntry> = {\n\t\"apps:read\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/apps/runtimes\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/realtime\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/metrics\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/logs\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/download\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/deploys\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/deploys/webhook\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/releases\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/releases/:release_id/log\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/network/custom\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/network/dns\" },\n\t\t],\n\t},\n\t\"apps:write\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/apps\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/start\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/stop\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/restart\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/apps/:id/config\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/deploys/webhook\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/deploys/webhook\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/network/custom\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/network/custom\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/network/purge-cache\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/apps/:id/network/subdomain\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/network/publish\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/network/publish\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/releases/:release_id/rollback\" },\n\t\t],\n\t},\n\t\"apps:delete\": { group: \"apps\", routes: [{ method: \"DELETE\", path: \"/v1/apps/:id\" }] },\n\t\"apps:envs\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/envs\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/envs\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/envs/:envId\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/releases/:release_id/rollback\" },\n\t\t],\n\t},\n\t\"apps:files\": {\n\t\tgroup: \"apps\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/files/tree\" },\n\t\t\t{ method: \"GET\", path: \"/v1/apps/:id/files/content\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/apps/:id/files\" },\n\t\t\t{ method: \"POST\", path: \"/v1/apps/:id/files/upload\" },\n\t\t],\n\t},\n\t\"databases:read\": {\n\t\tgroup: \"databases\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/databases/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id/metrics\" },\n\t\t],\n\t},\n\t\"databases:write\": {\n\t\tgroup: \"databases\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/databases\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/databases/:id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/start\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/stop\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/reset\" },\n\t\t],\n\t},\n\t\"databases:delete\": { group: \"databases\", routes: [{ method: \"DELETE\", path: \"/v1/databases/:id\" }] },\n\t\"databases:credentials\": {\n\t\tgroup: \"databases\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/databases/:id/credentials/certificate\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/credentials/certificate/reset\" },\n\t\t\t{ method: \"POST\", path: \"/v1/databases/:id/credentials/reset\" },\n\t\t],\n\t},\n\t\"snapshots:read\": {\n\t\tgroup: \"snapshots\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/users/snapshots\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/:id/snapshots\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/:id/snapshots/:snapshot_id/download\" },\n\t\t],\n\t},\n\t\"snapshots:write\": {\n\t\tgroup: \"snapshots\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/users/:id/snapshots\" },\n\t\t\t{ method: \"POST\", path: \"/v1/users/:id/snapshots/:snapshot_id/restore\" },\n\t\t],\n\t},\n\t\"account:read\": {\n\t\tgroup: \"account\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/users/me\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/me/sessions\" },\n\t\t],\n\t},\n\t\"account:write\": {\n\t\tgroup: \"account\",\n\t\troutes: [\n\t\t\t{ method: \"PATCH\", path: \"/v1/users/me\" },\n\t\t\t{ method: \"POST\", path: \"/v1/users/me/folders\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/users/me/folders/:folder_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/users/me/folders/:folder_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/users/me/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/users/me/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/users/me/favorites/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/users/me/favorites/:resource_type/:resource_id\" },\n\t\t],\n\t},\n\t\"workspaces:read\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/members\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/roles\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/action-requests\" },\n\t\t],\n\t},\n\t\"workspaces:write\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/members/:user_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/members/:user_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/roles\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/roles/:role_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/roles/:role_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/apps/:app_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/apps/:app_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/databases/:db_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/databases/:db_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/folders\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/workspaces/:id/folders/:folder_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/folders/:folder_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/folders/:folder_id/resources/:resource_type/:resource_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/workspaces/:id/favorites/:resource_type/:resource_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/favorites/:resource_type/:resource_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/:id/action-requests\" },\n\t\t],\n\t},\n\t/**\n\t * Intentionally left out (dashboard session only): creating invites (a leaked key could grant\n\t * access that outlives its revocation), transferring ownership, approving/rejecting action\n\t * requests (approval is a human decision) and exporting activities.\n\t */\n\t/** Delete a workspace (soft delete). Only in the `full` preset, like `apps:delete`. */\n\t\"workspaces:delete\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [{ method: \"DELETE\", path: \"/v1/workspaces/:id\" }],\n\t},\n\t/** List and revoke workspace invites; view, accept and decline your own invite by token. Only in the `full` preset. */\n\t\"workspaces:invites\": {\n\t\tgroup: \"workspaces\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/:id/invites\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/workspaces/:id/invites/:invite_id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/workspaces/invites/:token\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/invites/:token/accept\" },\n\t\t\t{ method: \"POST\", path: \"/v1/workspaces/invites/:token/decline\" },\n\t\t],\n\t},\n\t/** Blob Storage (`blob.vertracloud.app`). Upload tokens (`vcup_`) are a separate credential, not a scope. */\n\t\"blob:read\": {\n\t\tgroup: \"blob\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/blob/objects\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/objects/:object_id\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/objects/:object_id/download\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/shares\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/rules\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/stats\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/s3/credentials\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/domains\" },\n\t\t],\n\t},\n\t\"blob:write\": {\n\t\tgroup: \"blob\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/blob/objects\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/blob/objects\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/blob/objects/:object_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/objects/copy\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/blob/objects\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/blob/objects/:object_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/uploads\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/uploads\" },\n\t\t\t{ method: \"GET\", path: \"/v1/blob/uploads/:upload_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/uploads/:upload_id/parts\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/uploads/:upload_id/complete\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/blob/uploads/:upload_id\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/shares\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/blob/shares/:share_id\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/blob/rules\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/blob/rules/:prefix\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/blob/rules/:prefix\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/upload-tokens\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/domains\" },\n\t\t\t{ method: \"POST\", path: \"/v1/blob/domains/:domain_id/verify\" },\n\t\t\t{ method: \"PATCH\", path: \"/v1/blob/domains/:domain_id\" },\n\t\t\t{ method: \"DELETE\", path: \"/v1/blob/domains/:domain_id\" },\n\t\t],\n\t},\n\t\"billing:read\": {\n\t\tgroup: \"billing\",\n\t\troutes: [\n\t\t\t{ method: \"GET\", path: \"/v1/orders\" },\n\t\t\t{ method: \"GET\", path: \"/v1/orders/:orderId/status\" },\n\t\t\t{ method: \"GET\", path: \"/v1/users/me/billing\" },\n\t\t],\n\t},\n\t/**\n\t * Creates a plan order and generates the PIX charge; the payment itself is made by a person in their banking app.\n\t * Also saves the billing details (name, address, CPF/CNPJ) an order needs.\n\t */\n\t\"billing:write\": {\n\t\tgroup: \"billing\",\n\t\troutes: [\n\t\t\t{ method: \"POST\", path: \"/v1/orders\" },\n\t\t\t{ method: \"POST\", path: \"/v1/orders/:orderId/initiate/pix\" },\n\t\t\t{ method: \"PUT\", path: \"/v1/users/me/billing\" },\n\t\t],\n\t},\n\t\"redeem:write\": { group: \"billing\", routes: [{ method: \"POST\", path: \"/v1/redeem/:code\" }] },\n};\n\nexport const API_KEY_SCOPE_LIST = Object.keys(API_KEY_SCOPES) as APIApiKeyScope[];\n\n/** Scopes selected by a preset. `full` is the whole catalog. */\nexport function apiKeyPresetScopes(preset: APIApiKeyPreset): APIApiKeyScope[] {\n\tif (preset === \"full\") return API_KEY_SCOPE_LIST;\n\treturn API_KEY_SCOPE_LIST.filter((s) => s.endsWith(\":read\") || (preset === \"write\" && s.endsWith(\":write\")));\n}\n\n/** Maximum keys per account, entries in `allowed_ips`, and key name length. */\nexport const API_KEY_MAX_PER_USER = 10;\nexport const API_KEY_MAX_ALLOWED_IPS = 20;\nexport const API_KEY_NAME_MAX_LENGTH = 40;\n\n/**\n * An API key as listed. The secret is returned only ONCE, in `APIApiKeyCreated`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/users/api-keys/list\n */\nexport interface APIApiKey {\n\tid: string;\n\tname: string;\n\t/** Public start of the key (`vc_live_a1b2c3d4`; older keys: 8 hex characters). */\n\tprefix: string;\n\t/** Last 4 characters; `null` for keys generated before the `vc_live_` format. */\n\tlast4: string | null;\n\tscopes: APIApiKeyScope[];\n\t/** Allowed IPs/CIDRs. Empty list = any IP. */\n\tallowed_ips: string[];\n\tcreated_at: ISODateString;\n\tlast_used_at: ISODateString | null;\n}\n\nexport interface APIApiKeyCreated extends APIApiKey {\n\t/** The full secret. Shown once; it cannot be recovered. */\n\tapi_key: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCO,IAAM,iBAAiB;AAAA,EAC7B,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AA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,EAAE,QAAQ,SAAS,MAAM,8BAA8B;AAAA,MACvD,EAAE,QAAQ,UAAU,MAAM,8BAA8B;AAAA,IACzD;AAAA,EACD;AAAA,EACA,gBAAgB;AAAA,IACf,OAAO;AAAA,IACP,QAAQ;AAAA,MACP,EAAE,QAAQ,OAAO,MAAM,aAAa;AAAA,MACpC,EAAE,QAAQ,OAAO,MAAM,6BAA6B;AAAA,MACpD,EAAE,QAAQ,OAAO,MAAM,uBAAuB;AAAA,IAC/C;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,MACP,EAAE,QAAQ,QAAQ,MAAM,aAAa;AAAA,MACrC,EAAE,QAAQ,QAAQ,MAAM,mCAAmC;AAAA,MAC3D,EAAE,QAAQ,OAAO,MAAM,uBAAuB;AAAA,IAC/C;AAAA,EACD;AAAA,EACA,gBAAgB,EAAE,OAAO,WAAW,QAAQ,CAAC,EAAE,QAAQ,QAAQ,MAAM,mBAAmB,CAAC,EAAE;AAC5F;AAEO,IAAM,qBAAqB,OAAO,KAAK,cAAc;AAGrD,SAAS,mBAAmB,QAA2C;AAC7E,MAAI,WAAW,OAAQ,QAAO;AAC9B,SAAO,mBAAmB,OAAO,CAAC,MAAM,EAAE,SAAS,OAAO,KAAM,WAAW,WAAW,EAAE,SAAS,QAAQ,CAAE;AAC5G;AAGO,IAAM,uBAAuB;AAC7B,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;","names":[]}
@@ -17,6 +17,8 @@ var APIApiKeyScope = {
17
17
  WORKSPACES_WRITE: "workspaces:write",
18
18
  WORKSPACES_DELETE: "workspaces:delete",
19
19
  WORKSPACES_INVITES: "workspaces:invites",
20
+ BLOB_READ: "blob:read",
21
+ BLOB_WRITE: "blob:write",
20
22
  BILLING_READ: "billing:read",
21
23
  BILLING_WRITE: "billing:write",
22
24
  REDEEM_WRITE: "redeem:write"
@@ -201,6 +203,47 @@ var API_KEY_SCOPES = {
201
203
  { method: "POST", path: "/v1/workspaces/invites/:token/decline" }
202
204
  ]
203
205
  },
206
+ /** Blob Storage (`blob.vertracloud.app`). Upload tokens (`vcup_`) are a separate credential, not a scope. */
207
+ "blob:read": {
208
+ group: "blob",
209
+ routes: [
210
+ { method: "GET", path: "/v1/blob/objects" },
211
+ { method: "GET", path: "/v1/blob/objects/:object_id" },
212
+ { method: "GET", path: "/v1/blob/objects/:object_id/download" },
213
+ { method: "GET", path: "/v1/blob/shares" },
214
+ { method: "GET", path: "/v1/blob/rules" },
215
+ { method: "GET", path: "/v1/blob/stats" },
216
+ { method: "GET", path: "/v1/blob/s3/credentials" },
217
+ { method: "GET", path: "/v1/blob/domains" }
218
+ ]
219
+ },
220
+ "blob:write": {
221
+ group: "blob",
222
+ routes: [
223
+ { method: "POST", path: "/v1/blob/objects" },
224
+ { method: "PATCH", path: "/v1/blob/objects" },
225
+ { method: "PATCH", path: "/v1/blob/objects/:object_id" },
226
+ { method: "POST", path: "/v1/blob/objects/copy" },
227
+ { method: "DELETE", path: "/v1/blob/objects" },
228
+ { method: "DELETE", path: "/v1/blob/objects/:object_id" },
229
+ { method: "POST", path: "/v1/blob/uploads" },
230
+ { method: "GET", path: "/v1/blob/uploads" },
231
+ { method: "GET", path: "/v1/blob/uploads/:upload_id" },
232
+ { method: "POST", path: "/v1/blob/uploads/:upload_id/parts" },
233
+ { method: "POST", path: "/v1/blob/uploads/:upload_id/complete" },
234
+ { method: "DELETE", path: "/v1/blob/uploads/:upload_id" },
235
+ { method: "POST", path: "/v1/blob/shares" },
236
+ { method: "DELETE", path: "/v1/blob/shares/:share_id" },
237
+ { method: "PUT", path: "/v1/blob/rules" },
238
+ { method: "PUT", path: "/v1/blob/rules/:prefix" },
239
+ { method: "DELETE", path: "/v1/blob/rules/:prefix" },
240
+ { method: "POST", path: "/v1/blob/upload-tokens" },
241
+ { method: "POST", path: "/v1/blob/domains" },
242
+ { method: "POST", path: "/v1/blob/domains/:domain_id/verify" },
243
+ { method: "PATCH", path: "/v1/blob/domains/:domain_id" },
244
+ { method: "DELETE", path: "/v1/blob/domains/:domain_id" }
245
+ ]
246
+ },
204
247
  "billing:read": {
205
248
  group: "billing",
206
249
  routes: [
@@ -132,7 +132,7 @@ declare const ApplicationZeroDowntime: {
132
132
  * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig
133
133
  */
134
134
  interface APIApplicationDeploySettings {
135
- /** The saved choice. Defaults to `auto`. */
135
+ /** The saved choice. Defaults to `off`: zero-downtime deploys are opt-in. */
136
136
  zero_downtime: ApplicationZeroDowntime;
137
137
  /**
138
138
  * Whether the next deploy runs without downtime. `true` on Enterprise when `zero_downtime` is `on`,
@@ -141,7 +141,8 @@ interface APIApplicationDeploySettings {
141
141
  zero_downtime_active: boolean;
142
142
  /**
143
143
  * If the new version stops within 60 seconds after a deploy, the platform switches back to the
144
- * previous version, once. Acts from the Intermediary plan; the saved value is returned on any plan.
144
+ * previous version, once. Off by default (opt-in). Acts from the Intermediary plan; the saved value is returned on
145
+ * any plan.
145
146
  */
146
147
  auto_rollback: boolean;
147
148
  /**
@@ -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 * How a new deploy replaces the running version. `auto` = without downtime only when the app receives\n * traffic through web publishing, otherwise with downtime; `on` = always without downtime (Enterprise);\n * `off` = the running version stops before the new one starts.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport type ApplicationZeroDowntime = \"auto\" | \"on\" | \"off\";\nexport const ApplicationZeroDowntime = {\n\tAUTO: \"auto\",\n\tON: \"on\",\n\tOFF: \"off\",\n} as const;\n\n/**\n * Deploy behavior of an application. Changed with `PATCH /v1/apps/:id/config` (`deploy`).\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport interface APIApplicationDeploySettings {\n\t/** The saved choice. Defaults to `auto`. */\n\tzero_downtime: ApplicationZeroDowntime;\n\t/**\n\t * Whether the next deploy runs without downtime. `true` on Enterprise when `zero_downtime` is `on`,\n\t * or when it is `auto` and the app receives traffic through web publishing.\n\t */\n\tzero_downtime_active: boolean;\n\t/**\n\t * If the new version stops within 60 seconds after a deploy, the platform switches back to the\n\t * previous version, once. Acts from the Intermediary plan; the saved value is returned on any plan.\n\t */\n\tauto_rollback: boolean;\n\t/**\n\t * HTTP path the platform calls on the new version before it receives traffic. Any HTTP response,\n\t * including 404, counts as healthy; a refused connection, a timeout or a 5xx counts as a failure.\n\t * Starts with `/`, at most 200 characters, printable ASCII only with no spaces; percent-encode anything\n\t * else (`%20`, `%C3%A9`). `null` = `/`.\n\t */\n\thealth_check_path: string | null;\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\t/** Deploy behavior: zero downtime, automatic rollback and health check. */\n\tdeploy: APIApplicationDeploySettings;\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 * How a release was created.\n * `github` = push to the connected repository; `cli` = the Vertra CLI; `upload` = upload from the\n * dashboard, an SDK or an extension; `editor` = edits made in the file manager; `rollback` = a\n * release that restores an earlier one; `env_change` = a change to the environment variables only.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport type ApplicationReleaseSource = \"github\" | \"cli\" | \"upload\" | \"editor\" | \"rollback\" | \"env_change\";\nexport const ApplicationReleaseSource = {\n\tGITHUB: \"github\",\n\tCLI: \"cli\",\n\tUPLOAD: \"upload\",\n\tEDITOR: \"editor\",\n\tROLLBACK: \"rollback\",\n\tENV_CHANGE: \"env_change\",\n} as const;\n\n/**\n * Lifecycle of a release. `deploying` = being built and started; `active` = the application's current\n * code, one per application (see `first_started_at`: files committed without a restart are `active`\n * before the application runs them); `superseded` = replaced by a newer release; `failed` = the\n * application stopped right after this release was deployed and the platform rolled back to the\n * previous one; `rolled_back` = the active release was replaced by a rollback; `expired` = its code is\n * no longer kept.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport type ApplicationReleaseStatus = \"deploying\" | \"active\" | \"superseded\" | \"failed\" | \"rolled_back\" | \"expired\";\nexport const ApplicationReleaseStatus = {\n\tDEPLOYING: \"deploying\",\n\tACTIVE: \"active\",\n\tSUPERSEDED: \"superseded\",\n\tFAILED: \"failed\",\n\tROLLED_BACK: \"rolled_back\",\n\tEXPIRED: \"expired\",\n} as const;\n\n/**\n * One version of an application's code, kept so it can be listed and, when the plan allows it,\n * restored. The list is newest first. A release stays listed after its code expires.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport interface APIApplicationRelease {\n\tid: SnowFlake;\n\tapp_id: SnowFlake;\n\tsource: ApplicationReleaseSource;\n\tstatus: ApplicationReleaseStatus;\n\t/** Commit or upload message. `null` when none was given, and always `null` for file manager edits. */\n\tmessage: string | null;\n\t/** The GitHub pusher, or the name of the user who uploaded or edited the files. */\n\tauthor: string;\n\t/** The GitHub push that produced this release. `null` for any other source. */\n\tgithub: APIApplicationDeployment | null;\n\t/** Number of files changed by the operation that produced this release. */\n\tfiles_changed: number;\n\trollback: {\n\t\t/**\n\t\t * `false` for the active release, for an expired release, and when the plan does not allow\n\t\t * rolling back to this release.\n\t\t */\n\t\tavailable: boolean;\n\t\t/**\n\t\t * When this release's code stops being kept, counted from the moment it stopped being the active\n\t\t * release. `null` for the active release and when no code was kept.\n\t\t */\n\t\texpires_at: ISODateString | null;\n\t\t/** The release this one restores, when `source` is `rollback`. `null` otherwise. */\n\t\tfrom: SnowFlake | null;\n\t};\n\t/** `true` when a crash log was recorded for this release. The log can still expire; see the log endpoint. */\n\thas_log: boolean;\n\t/**\n\t * Time, in milliseconds, the platform took to install dependencies, build and start this release.\n\t * `null` when the release was not deployed with a build (for example, files committed without a restart).\n\t */\n\tbuild_duration_ms: number | null;\n\t/**\n\t * When the application first started with this release's code. `null` while the code is in the\n\t * application folder but the application has not been started with it yet (for example, files\n\t * committed without a restart): changes only take effect after a restart.\n\t */\n\tfirst_started_at: ISODateString | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * Crash log of a release. `content` is `null` when there is no log or it has expired.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/log\n */\nexport interface APIApplicationReleaseLog {\n\tcontent: string | null;\n}\n\n/**\n * How an environment variable changes if a rollback restores the release's variables, compared with the\n * active release. `added` = the release has it and the active release does not; `removed` = the active\n * release has it and the release does not; `modified` = both have it with different values.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview\n */\nexport type ApplicationEnvironmentChange = \"added\" | \"modified\" | \"removed\";\nexport const ApplicationEnvironmentChange = {\n\tADDED: \"added\",\n\tMODIFIED: \"modified\",\n\tREMOVED: \"removed\",\n} as const;\n\n/**\n * What a rollback to a release would change in the environment variables. Only variable names and the\n * kind of change are returned, never values. Sorted by key. Empty when the release has no stored variables.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview\n */\nexport interface APIApplicationRollbackPreview {\n\tenvironment_changes: { key: string; change: ApplicationEnvironmentChange }[];\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`, `deploy_note:failed:<release_id>`, `deploy_note:rollback:<from>:<to>`,\n * `deploy_note:discarded:<release_id>` (Enterprise zero-downtime: the new release did not become healthy\n * and was dropped; the previous one keeps running), where `<from>` and `<to>` identify the releases\n * involved); `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;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,sBAAsB;AAAA,EAClC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,KAA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ACN,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 * How a new deploy replaces the running version. `auto` = without downtime only when the app receives\n * traffic through web publishing, otherwise with downtime; `on` = always without downtime (Enterprise);\n * `off` = the running version stops before the new one starts.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport type ApplicationZeroDowntime = \"auto\" | \"on\" | \"off\";\nexport const ApplicationZeroDowntime = {\n\tAUTO: \"auto\",\n\tON: \"on\",\n\tOFF: \"off\",\n} as const;\n\n/**\n * Deploy behavior of an application. Changed with `PATCH /v1/apps/:id/config` (`deploy`).\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport interface APIApplicationDeploySettings {\n\t/** The saved choice. Defaults to `off`: zero-downtime deploys are opt-in. */\n\tzero_downtime: ApplicationZeroDowntime;\n\t/**\n\t * Whether the next deploy runs without downtime. `true` on Enterprise when `zero_downtime` is `on`,\n\t * or when it is `auto` and the app receives traffic through web publishing.\n\t */\n\tzero_downtime_active: boolean;\n\t/**\n\t * If the new version stops within 60 seconds after a deploy, the platform switches back to the\n\t * previous version, once. Off by default (opt-in). Acts from the Intermediary plan; the saved value is returned on\n\t * any plan.\n\t */\n\tauto_rollback: boolean;\n\t/**\n\t * HTTP path the platform calls on the new version before it receives traffic. Any HTTP response,\n\t * including 404, counts as healthy; a refused connection, a timeout or a 5xx counts as a failure.\n\t * Starts with `/`, at most 200 characters, printable ASCII only with no spaces; percent-encode anything\n\t * else (`%20`, `%C3%A9`). `null` = `/`.\n\t */\n\thealth_check_path: string | null;\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\t/** Deploy behavior: zero downtime, automatic rollback and health check. */\n\tdeploy: APIApplicationDeploySettings;\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 * How a release was created.\n * `github` = push to the connected repository; `cli` = the Vertra CLI; `upload` = upload from the\n * dashboard, an SDK or an extension; `editor` = edits made in the file manager; `rollback` = a\n * release that restores an earlier one; `env_change` = a change to the environment variables only.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport type ApplicationReleaseSource = \"github\" | \"cli\" | \"upload\" | \"editor\" | \"rollback\" | \"env_change\";\nexport const ApplicationReleaseSource = {\n\tGITHUB: \"github\",\n\tCLI: \"cli\",\n\tUPLOAD: \"upload\",\n\tEDITOR: \"editor\",\n\tROLLBACK: \"rollback\",\n\tENV_CHANGE: \"env_change\",\n} as const;\n\n/**\n * Lifecycle of a release. `deploying` = being built and started; `active` = the application's current\n * code, one per application (see `first_started_at`: files committed without a restart are `active`\n * before the application runs them); `superseded` = replaced by a newer release; `failed` = the\n * application stopped right after this release was deployed and the platform rolled back to the\n * previous one; `rolled_back` = the active release was replaced by a rollback; `expired` = its code is\n * no longer kept.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport type ApplicationReleaseStatus = \"deploying\" | \"active\" | \"superseded\" | \"failed\" | \"rolled_back\" | \"expired\";\nexport const ApplicationReleaseStatus = {\n\tDEPLOYING: \"deploying\",\n\tACTIVE: \"active\",\n\tSUPERSEDED: \"superseded\",\n\tFAILED: \"failed\",\n\tROLLED_BACK: \"rolled_back\",\n\tEXPIRED: \"expired\",\n} as const;\n\n/**\n * One version of an application's code, kept so it can be listed and, when the plan allows it,\n * restored. The list is newest first. A release stays listed after its code expires.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport interface APIApplicationRelease {\n\tid: SnowFlake;\n\tapp_id: SnowFlake;\n\tsource: ApplicationReleaseSource;\n\tstatus: ApplicationReleaseStatus;\n\t/** Commit or upload message. `null` when none was given, and always `null` for file manager edits. */\n\tmessage: string | null;\n\t/** The GitHub pusher, or the name of the user who uploaded or edited the files. */\n\tauthor: string;\n\t/** The GitHub push that produced this release. `null` for any other source. */\n\tgithub: APIApplicationDeployment | null;\n\t/** Number of files changed by the operation that produced this release. */\n\tfiles_changed: number;\n\trollback: {\n\t\t/**\n\t\t * `false` for the active release, for an expired release, and when the plan does not allow\n\t\t * rolling back to this release.\n\t\t */\n\t\tavailable: boolean;\n\t\t/**\n\t\t * When this release's code stops being kept, counted from the moment it stopped being the active\n\t\t * release. `null` for the active release and when no code was kept.\n\t\t */\n\t\texpires_at: ISODateString | null;\n\t\t/** The release this one restores, when `source` is `rollback`. `null` otherwise. */\n\t\tfrom: SnowFlake | null;\n\t};\n\t/** `true` when a crash log was recorded for this release. The log can still expire; see the log endpoint. */\n\thas_log: boolean;\n\t/**\n\t * Time, in milliseconds, the platform took to install dependencies, build and start this release.\n\t * `null` when the release was not deployed with a build (for example, files committed without a restart).\n\t */\n\tbuild_duration_ms: number | null;\n\t/**\n\t * When the application first started with this release's code. `null` while the code is in the\n\t * application folder but the application has not been started with it yet (for example, files\n\t * committed without a restart): changes only take effect after a restart.\n\t */\n\tfirst_started_at: ISODateString | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * Crash log of a release. `content` is `null` when there is no log or it has expired.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/log\n */\nexport interface APIApplicationReleaseLog {\n\tcontent: string | null;\n}\n\n/**\n * How an environment variable changes if a rollback restores the release's variables, compared with the\n * active release. `added` = the release has it and the active release does not; `removed` = the active\n * release has it and the release does not; `modified` = both have it with different values.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview\n */\nexport type ApplicationEnvironmentChange = \"added\" | \"modified\" | \"removed\";\nexport const ApplicationEnvironmentChange = {\n\tADDED: \"added\",\n\tMODIFIED: \"modified\",\n\tREMOVED: \"removed\",\n} as const;\n\n/**\n * What a rollback to a release would change in the environment variables. Only variable names and the\n * kind of change are returned, never values. Sorted by key. Empty when the release has no stored variables.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview\n */\nexport interface APIApplicationRollbackPreview {\n\tenvironment_changes: { key: string; change: ApplicationEnvironmentChange }[];\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`, `deploy_note:failed:<release_id>`, `deploy_note:rollback:<from>:<to>`,\n * `deploy_note:discarded:<release_id>` (Enterprise zero-downtime: the new release did not become healthy\n * and was dropped; the previous one keeps running), where `<from>` and `<to>` identify the releases\n * involved); `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;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;AA8DO,IAAM,0BAA0B;AAAA,EACtC,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,KAAK;AACN;AA4MO,IAAM,2BAA2B;AAAA,EACvC,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AACb;AAaO,IAAM,2BAA2B;AAAA,EACvC,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AACV;AAoEO,IAAM,+BAA+B;AAAA,EAC3C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AACV;AAgBO,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;AAqEO,IAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,WAAW;AACZ;","names":[]}
@@ -0,0 +1,248 @@
1
+ import { SnowFlake, ISODateString } from '../../common/v1.js';
2
+ import { APIErrorCode } from './api-error.js';
3
+
4
+ /** Who can read an object by its public URL. `private` objects need a temporary link or a share. */
5
+ type BlobVisibility = "public" | "private";
6
+ declare const BlobVisibility: {
7
+ readonly PUBLIC: "public";
8
+ readonly PRIVATE: "private";
9
+ };
10
+ /** How a browser treats the file: shown in the page (`inline`) or saved (`attachment`). */
11
+ type BlobContentDisposition = "inline" | "attachment";
12
+ declare const BlobContentDisposition: {
13
+ readonly INLINE: "inline";
14
+ readonly ATTACHMENT: "attachment";
15
+ };
16
+ /** `single` = one `PUT` to one URL; `multipart` = several parts, each with its own URL. */
17
+ type BlobUploadMode = "single" | "multipart";
18
+ declare const BlobUploadMode: {
19
+ readonly SINGLE: "single";
20
+ readonly MULTIPART: "multipart";
21
+ };
22
+ type BlobUploadStatus = "pending" | "completed" | "aborted" | "expired";
23
+ declare const BlobUploadStatus: {
24
+ readonly PENDING: "pending";
25
+ readonly COMPLETED: "completed";
26
+ readonly ABORTED: "aborted";
27
+ readonly EXPIRED: "expired";
28
+ };
29
+ type BlobCustomDomainStatus = "pending" | "active" | "failed" | "suspended";
30
+ declare const BlobCustomDomainStatus: {
31
+ readonly PENDING: "pending";
32
+ readonly ACTIVE: "active";
33
+ readonly FAILED: "failed";
34
+ readonly SUSPENDED: "suspended";
35
+ };
36
+ /** A stored file. The `id` never changes; `path` can (move, rename). */
37
+ interface APIBlobObject {
38
+ id: SnowFlake;
39
+ /** Full path inside the account, for example `images/avatars/joao.png`. */
40
+ path: string;
41
+ size: number;
42
+ content_type: string;
43
+ etag: string;
44
+ /** SHA-256 (hex) of the content, when the upload sent a checksum. */
45
+ sha256: string | null;
46
+ visibility: BlobVisibility;
47
+ /** Public URL; `null` while the object is private. */
48
+ url: string | null;
49
+ /** `immutable`, `max-age=<seconds>` or `no-cache` (plan-dependent); `null` = default. */
50
+ cache_control: string | null;
51
+ content_disposition: BlobContentDisposition;
52
+ /** File name suggested on download; `null` = the last segment of `path`. */
53
+ filename: string | null;
54
+ /** Up to 5 keys (`[a-z0-9-]{1,64}`) and 512 bytes in total; plan-dependent. */
55
+ metadata: Record<string, string>;
56
+ expires_at: ISODateString | null;
57
+ created_at: ISODateString;
58
+ updated_at: ISODateString;
59
+ }
60
+ /** Result of listing objects: one page of files plus the folders found under the prefix. */
61
+ interface APIBlobObjectList {
62
+ objects: APIBlobObject[];
63
+ /** Folder prefixes ending in `/` (empty without a `delimiter`). */
64
+ folders: string[];
65
+ /** Pass back as `cursor` for the next page; `null` = last page. */
66
+ cursor: string | null;
67
+ }
68
+ /** A direct upload in progress. Bytes go straight to the URLs, not through the API. */
69
+ interface APIBlobUpload {
70
+ id: SnowFlake;
71
+ /** Final path (with the random suffix, when requested). */
72
+ path: string;
73
+ mode: BlobUploadMode;
74
+ status: BlobUploadStatus;
75
+ size: number;
76
+ /** When the URLs and the reserved storage expire. */
77
+ expires_at: ISODateString;
78
+ /** `single` mode: URL to `PUT` the whole file to. */
79
+ url?: string;
80
+ /** Headers the `PUT` must send exactly as given. */
81
+ headers: Record<string, string>;
82
+ /** `multipart` mode: fixed part size (the last part can be smaller). */
83
+ part_size?: number;
84
+ part_count?: number;
85
+ /** Part numbers already stored; use it to resume an interrupted upload. */
86
+ uploaded_parts?: number[];
87
+ created_at: ISODateString;
88
+ }
89
+ interface APIBlobUploadPart {
90
+ part_number: number;
91
+ url: string;
92
+ size: number;
93
+ /** Headers the `PUT` of this part must send exactly as given. */
94
+ headers: Record<string, string>;
95
+ }
96
+ /** Plan limits that apply to Blob Storage, so clients need not hardcode them. */
97
+ interface APIBlobLimits {
98
+ /** Largest file accepted by the single-request upload. */
99
+ max_simple_upload_bytes: number;
100
+ /** Largest file that can be sent in one part of a direct upload. */
101
+ max_single_put_bytes: number;
102
+ max_object_bytes: number;
103
+ min_part_bytes: number;
104
+ max_part_bytes: number;
105
+ max_parts: number;
106
+ max_open_uploads: number;
107
+ /** `null` = no limit of its own. */
108
+ uploads_per_second: number | null;
109
+ max_rules: number;
110
+ max_custom_domains: number;
111
+ metadata_enabled: boolean;
112
+ share_password_enabled: boolean;
113
+ /** Whether `cache_control: "no-cache"` is allowed. */
114
+ no_cache_enabled: boolean;
115
+ /** Shortest accepted `expires_at` from now, in seconds. */
116
+ min_expiration_seconds: number;
117
+ /** 0 = image transformation is not included in the plan. */
118
+ image_transformations_per_month: number;
119
+ }
120
+ interface APIBlobStats {
121
+ objects: number;
122
+ used_bytes: number;
123
+ quota_bytes: number;
124
+ /** Above 0 only after a plan downgrade. */
125
+ over_quota_bytes: number;
126
+ /** Estimated overage charge, in cents, billed on renewal. */
127
+ estimated_overage_cents: number;
128
+ month_average_bytes: number;
129
+ /** Image transformations used in the current month. */
130
+ image_transformations_used: number;
131
+ /** Base URL of the public files of the account. */
132
+ public_base_url: string;
133
+ limits: APIBlobLimits;
134
+ }
135
+ /** One item of a batch update. */
136
+ interface APIBlobBatchResult {
137
+ id: SnowFlake;
138
+ ok: boolean;
139
+ /** Set when `ok` is `false`. */
140
+ code?: APIErrorCode;
141
+ /** Set when `ok` is `true`. */
142
+ object?: APIBlobObject;
143
+ }
144
+ interface APIBlobDeleteResult {
145
+ deleted: SnowFlake[];
146
+ not_found: SnowFlake[];
147
+ /** `true` when more objects match and another call is needed. */
148
+ remaining: boolean;
149
+ }
150
+ /** Temporary download link, returned when `redirect=false`. */
151
+ interface APIBlobDownload {
152
+ url: string;
153
+ expires_at: ISODateString;
154
+ }
155
+ /** Short-lived credential for browsers and untrusted clients; usable only on the upload routes. */
156
+ interface APIBlobUploadToken {
157
+ /** Starts with `vcup_`. Shown once. */
158
+ token: string;
159
+ expires_at: ISODateString;
160
+ max_uses: number;
161
+ }
162
+ interface APIBlobShare {
163
+ id: SnowFlake;
164
+ object_id: SnowFlake;
165
+ /** Share page URL. */
166
+ url: string;
167
+ expires_at: ISODateString;
168
+ max_downloads: number | null;
169
+ remaining_downloads: number | null;
170
+ has_password: boolean;
171
+ /** `true` = the object is public, so the share does not protect it. */
172
+ object_is_public: boolean;
173
+ created_at: ISODateString;
174
+ }
175
+ /** What the public share page shows before the download. No sign-in needed; the token is the credential. */
176
+ interface APIBlobSharePublic {
177
+ filename: string;
178
+ size: number;
179
+ content_type: string;
180
+ has_password: boolean;
181
+ expires_at: ISODateString;
182
+ remaining_downloads: number | null;
183
+ }
184
+ /** Defaults and limits applied to every object under a folder prefix. The longest matching prefix wins. */
185
+ interface APIBlobRule {
186
+ /** Folder prefix, always stored with a trailing `/`. */
187
+ prefix: string;
188
+ /** Default visibility of new objects in the folder. */
189
+ visibility?: BlobVisibility;
190
+ /** Default expiration of each new object, in seconds. */
191
+ expire_seconds?: number;
192
+ /** Largest accepted file, 512 bytes to 10 GB. */
193
+ max_size?: number;
194
+ /** Accepted extensions (1–50), lowercase, without the dot. */
195
+ extensions?: string[];
196
+ cache_control?: string;
197
+ /** Delete objects this many days after upload (1–3650). */
198
+ delete_after_days?: number;
199
+ /** When `delete_after_days` starts to apply. */
200
+ active_from?: ISODateString;
201
+ created_at: ISODateString;
202
+ }
203
+ /** The rule list and the version tag to send back as `If-Match` when replacing it. */
204
+ interface APIBlobRules {
205
+ rules: APIBlobRule[];
206
+ etag: string;
207
+ }
208
+ /** S3-compatible credentials, derived from the API key that requested them. */
209
+ interface APIBlobS3Credentials {
210
+ access_key_id: string;
211
+ secret_access_key: string;
212
+ endpoint: string;
213
+ region: "auto";
214
+ buckets: ["public", "private"];
215
+ access: {
216
+ read: boolean;
217
+ write: boolean;
218
+ };
219
+ }
220
+ interface APIBlobCustomDomain {
221
+ id: SnowFlake;
222
+ /** Subdomain only (`cdn.example.com`). */
223
+ hostname: string;
224
+ status: BlobCustomDomainStatus;
225
+ ssl_status: string;
226
+ /** Point a CNAME record of `hostname` to this value. */
227
+ cname_target: string;
228
+ /** When set, the domain serves only this folder. */
229
+ prefix: string | null;
230
+ /**
231
+ * `true`: on this domain, `.html`, `.htm`, `.xhtml`, `.svg` and `.xml` open in the browser with their real type (pages
232
+ * run JavaScript in a sandbox: no forms, no cookies, no top-level navigation). `false` (default): they always download.
233
+ * The default public URL always downloads them, whatever this value.
234
+ */
235
+ web_content: boolean;
236
+ /**
237
+ * Ownership proof: publish this `TXT` record at `name` with the exact `value`. The domain only becomes
238
+ * `active` after it resolves (and the CNAME and certificate are ready). `null` once the domain is active.
239
+ */
240
+ verification?: {
241
+ type: "txt";
242
+ name: string;
243
+ value: string;
244
+ } | null;
245
+ created_at: ISODateString;
246
+ }
247
+
248
+ export { type APIBlobBatchResult, type APIBlobCustomDomain, type APIBlobDeleteResult, type APIBlobDownload, type APIBlobLimits, type APIBlobObject, type APIBlobObjectList, type APIBlobRule, type APIBlobRules, type APIBlobS3Credentials, type APIBlobShare, type APIBlobSharePublic, type APIBlobStats, type APIBlobUpload, type APIBlobUploadPart, type APIBlobUploadToken, BlobContentDisposition, BlobCustomDomainStatus, BlobUploadMode, BlobUploadStatus, BlobVisibility };
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // payloads/v1/blob.ts
21
+ var blob_exports = {};
22
+ __export(blob_exports, {
23
+ BlobContentDisposition: () => BlobContentDisposition,
24
+ BlobCustomDomainStatus: () => BlobCustomDomainStatus,
25
+ BlobUploadMode: () => BlobUploadMode,
26
+ BlobUploadStatus: () => BlobUploadStatus,
27
+ BlobVisibility: () => BlobVisibility
28
+ });
29
+ module.exports = __toCommonJS(blob_exports);
30
+ var BlobVisibility = { PUBLIC: "public", PRIVATE: "private" };
31
+ var BlobContentDisposition = {
32
+ INLINE: "inline",
33
+ ATTACHMENT: "attachment"
34
+ };
35
+ var BlobUploadMode = { SINGLE: "single", MULTIPART: "multipart" };
36
+ var BlobUploadStatus = {
37
+ PENDING: "pending",
38
+ COMPLETED: "completed",
39
+ ABORTED: "aborted",
40
+ EXPIRED: "expired"
41
+ };
42
+ var BlobCustomDomainStatus = {
43
+ PENDING: "pending",
44
+ ACTIVE: "active",
45
+ FAILED: "failed",
46
+ SUSPENDED: "suspended"
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ BlobContentDisposition,
51
+ BlobCustomDomainStatus,
52
+ BlobUploadMode,
53
+ BlobUploadStatus,
54
+ BlobVisibility
55
+ });
56
+ //# sourceMappingURL=blob.js.map