@vertracloud/api-types 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,9 +124,16 @@ var WORKSPACE_ERROR_CODES = {
124
124
  WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND",
125
125
  WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED",
126
126
  WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH",
127
+ /** 400 — the invited account turned off workspace invites by email. */
128
+ WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED",
129
+ /** 409 — the account is already the owner or a member of the workspace. */
130
+ WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER",
127
131
  WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY",
128
132
  WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND",
133
+ /** 410 — the request expired before anyone decided on it. */
134
+ WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED",
129
135
  /** 409 — the request was already approved or rejected. */
136
+ WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED",
130
137
  /** 400 — the requester already has the permission; perform the action directly. */
131
138
  WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED",
132
139
  /** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */
@@ -1 +1 @@
1
- {"version":3,"sources":["workspace.ts"],"sourcesContent":["import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\nimport type { APIApplication, APIDatabase } from \"./index\";\n\n/**\n * Granular workspace permission. Display group in `WORKSPACE_PERMISSIONS`.\n * The owner (`owner_id`) has no entry here: owner-only actions (rename/delete the workspace,\n * transfer ownership, link/unlink projects, deploy webhook, web publishing) are allowed for the\n * owner only, never through a permission.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspacePermission =\n\t| \"apps:read\"\n\t| \"apps:manage\"\n\t| \"apps:lifecycle\"\n\t| \"apps:envs\"\n\t| \"apps:files\"\n\t| \"apps:delete\"\n\t| \"databases:read\"\n\t| \"databases:manage\"\n\t| \"databases:lifecycle\"\n\t| \"databases:credentials\"\n\t| \"databases:data\"\n\t| \"databases:delete\"\n\t| \"snapshots:read\"\n\t| \"snapshots:manage\"\n\t| \"members:read\"\n\t| \"members:manage\"\n\t| \"roles:manage\"\n\t| \"activities:read\";\n\nexport const WorkspacePermission = {\n\tAPPS_READ: \"apps:read\",\n\tAPPS_MANAGE: \"apps:manage\",\n\tAPPS_LIFECYCLE: \"apps:lifecycle\",\n\tAPPS_ENVS: \"apps:envs\",\n\tAPPS_FILES: \"apps:files\",\n\tAPPS_DELETE: \"apps:delete\",\n\tDATABASES_READ: \"databases:read\",\n\tDATABASES_MANAGE: \"databases:manage\",\n\tDATABASES_LIFECYCLE: \"databases:lifecycle\",\n\tDATABASES_CREDENTIALS: \"databases:credentials\",\n\tDATABASES_DATA: \"databases:data\",\n\tDATABASES_DELETE: \"databases:delete\",\n\tSNAPSHOTS_READ: \"snapshots:read\",\n\tSNAPSHOTS_MANAGE: \"snapshots:manage\",\n\tMEMBERS_READ: \"members:read\",\n\tMEMBERS_MANAGE: \"members:manage\",\n\tROLES_MANAGE: \"roles:manage\",\n\tACTIVITIES_READ: \"activities:read\",\n} as const satisfies Record<string, WorkspacePermission>;\n\nexport interface WorkspacePermissionEntry {\n\tgroup: \"apps\" | \"databases\" | \"snapshots\" | \"members\" | \"roles\" | \"activities\";\n}\n\n/**\n * Closed catalog of workspace permissions. A member whose role lacks the permission a route\n * requires gets 403 `WORKSPACE_PERMISSION_DENIED`.\n */\nexport const WORKSPACE_PERMISSIONS: Record<WorkspacePermission, WorkspacePermissionEntry> = {\n\t\"apps:read\": { group: \"apps\" },\n\t\"apps:manage\": { group: \"apps\" },\n\t\"apps:lifecycle\": { group: \"apps\" },\n\t\"apps:envs\": { group: \"apps\" },\n\t\"apps:files\": { group: \"apps\" },\n\t\"apps:delete\": { group: \"apps\" },\n\t\"databases:read\": { group: \"databases\" },\n\t\"databases:manage\": { group: \"databases\" },\n\t\"databases:lifecycle\": { group: \"databases\" },\n\t\"databases:credentials\": { group: \"databases\" },\n\t\"databases:data\": { group: \"databases\" },\n\t\"databases:delete\": { group: \"databases\" },\n\t\"snapshots:read\": { group: \"snapshots\" },\n\t\"snapshots:manage\": { group: \"snapshots\" },\n\t\"members:read\": { group: \"members\" },\n\t\"members:manage\": { group: \"members\" },\n\t\"roles:manage\": { group: \"roles\" },\n\t\"activities:read\": { group: \"activities\" },\n};\n\nexport const WORKSPACE_PERMISSION_LIST = Object.keys(WORKSPACE_PERMISSIONS) as WorkspacePermission[];\n\n/**\n * Seed role, created together with the workspace. It can be renamed and deleted like any other\n * role (it becomes a regular role; `preset` is not restored) and counts toward the plan's role limit.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspaceRolePreset = \"admin\" | \"developer\" | \"operator\" | \"viewer\";\nexport const WorkspaceRolePreset = {\n\tAdmin: \"admin\",\n\tDeveloper: \"developer\",\n\tOperator: \"operator\",\n\tViewer: \"viewer\",\n} as const satisfies Record<string, WorkspaceRolePreset>;\n\n/**\n * Permissions a seed role gets when the workspace is created. `admin` does NOT include\n * `snapshots:manage` (restoring/deleting snapshots is destructive); the owner can grant it per role.\n */\nexport function workspacePresetPermissions(preset: WorkspaceRolePreset): WorkspacePermission[] {\n\tswitch (preset) {\n\t\tcase \"admin\":\n\t\t\treturn WORKSPACE_PERMISSION_LIST.filter((p) => p !== \"snapshots:manage\");\n\t\tcase \"developer\":\n\t\t\treturn [\"apps:read\", \"apps:manage\", \"apps:lifecycle\", \"apps:envs\", \"apps:files\", \"databases:read\", \"databases:manage\", \"databases:lifecycle\", \"databases:credentials\", \"databases:data\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"operator\":\n\t\t\treturn [\"apps:read\", \"apps:lifecycle\", \"databases:read\", \"databases:lifecycle\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"viewer\":\n\t\t\treturn [\"apps:read\", \"databases:read\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t}\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/roles/list\n */\nexport interface APIWorkspaceRole {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tname: string;\n\tpermissions: WorkspacePermission[];\n\t/** Seed role it came from; `null` for a manually created role. Informational only. */\n\tpreset: WorkspaceRolePreset | null;\n\t/** Display order. */\n\tposition: number;\n\tmembers_count: number;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/members/list\n */\nexport interface APIWorkspaceMember {\n\tuser_id: SnowFlake;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tjoined_at: ISODateString;\n\t/** When the member's access expires; `null` = never. */\n\texpires_at: ISODateString | null;\n\tuser: {\n\t\tdisplay_name: string;\n\t\temail: string;\n\t};\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspace {\n\tid: SnowFlake;\n\tname: string;\n\tdescription: string | null;\n\towner_id: SnowFlake;\n\towner: { display_name: string };\n\tmembers_count: number;\n\t/** Soft delete timestamp. `null` = active. */\n\tdeleted_at: ISODateString | null;\n\t/**\n\t * `true` when the OWNER's plan does not include workspaces (it expired or was downgraded):\n\t * reads keep working, every write returns `PLAN_RESTRICTED_FEATURE`. Nobody is removed — the\n\t * owner must upgrade to unfreeze it.\n\t */\n\tfrozen: boolean;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspaceInfoResponse extends APIWorkspace {\n\tmembers: APIWorkspaceMember[];\n\troles: APIWorkspaceRole[];\n\tapplications: APIApplication[];\n\tdatabases: APIDatabase[];\n\t/** Resolved permissions of the caller. The owner always gets the full list, regardless of role. */\n\tpermissions: WorkspacePermission[];\n\tis_owner: boolean;\n\t/** Owner's plan — it determines which features the workspace has. */\n\towner_plan_id: UserPlan;\n\t/** The caller's saved resource organization (folders, favorites) in this workspace. */\n\tresource_organization: APIWorkspaceResourceOrganization;\n}\n\nexport type WorkspaceResourceType = \"application\" | \"database\";\nexport const WorkspaceResourceType = { Application: \"application\", Database: \"database\" } as const satisfies Record<string, WorkspaceResourceType>;\n\nexport type WorkspaceResourceOrganizationScope = \"personal\" | \"workspace\";\nexport const WorkspaceResourceOrganizationScope = { Personal: \"personal\", Workspace: \"workspace\" } as const satisfies Record<string, WorkspaceResourceOrganizationScope>;\n\nexport type WorkspaceFolderColor = \"neutral\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"blue\" | \"purple\";\nexport const WorkspaceFolderColor = { Neutral: \"neutral\", Red: \"red\", Orange: \"orange\", Yellow: \"yellow\", Green: \"green\", Blue: \"blue\", Purple: \"purple\" } as const satisfies Record<string, WorkspaceFolderColor>;\nexport const WORKSPACE_FOLDER_COLORS = Object.values(WorkspaceFolderColor) as WorkspaceFolderColor[];\n\nexport interface APIWorkspaceResourceRef {\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n}\n\nexport interface APIWorkspaceFolderItem extends APIWorkspaceResourceRef {\n\tposition: number;\n}\n\nexport interface APIWorkspaceResourceFolder {\n\tid: SnowFlake;\n\tname: string;\n\tcolor: WorkspaceFolderColor;\n\tposition: number;\n\tresources: APIWorkspaceFolderItem[];\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\nexport interface APIWorkspaceFavorite extends APIWorkspaceResourceRef {\n\tposition: number;\n\tcreated_at: ISODateString;\n}\n\nexport interface APIWorkspaceResourceOrganization {\n\tscope: WorkspaceResourceOrganizationScope;\n\tuser_id: SnowFlake;\n\tworkspace_id: SnowFlake | null;\n\tfolders: APIWorkspaceResourceFolder[];\n\tfavorites: APIWorkspaceFavorite[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport type WorkspaceInviteKind = \"email\" | \"link\";\nexport const WorkspaceInviteKind = { Email: \"email\", Link: \"link\" } as const satisfies Record<string, WorkspaceInviteKind>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport interface APIWorkspaceInvite {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tkind: WorkspaceInviteKind;\n\t/** Bound e-mail; only for `kind: \"email\"`. */\n\temail: string | null;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tinvited_by: { id: SnowFlake; display_name: string };\n\texpires_at: ISODateString;\n\taccepted_at: ISODateString | null;\n\trevoked_at: ISODateString | null;\n\tuses: number;\n\t/** Only for `kind: \"link\"`; `null` = unlimited uses. */\n\tmax_uses: number | null;\n\t/** Access expiration applied to members who join through this invite; `null` = never. */\n\texpires_in_days: number | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/create\n */\nexport interface APIWorkspaceInviteCreated extends APIWorkspaceInvite {\n\t/** Invite URL; only for `kind: \"link\"`, shown once. */\n\turl: string | null;\n}\n\n/**\n * What the invitee sees before accepting (`GET /v1/workspaces/invites/:token`).\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/preview\n */\nexport interface APIWorkspaceInvitePreview {\n\tworkspace: { id: SnowFlake; name: string };\n\tinviter: { display_name: string };\n\trole_name: string;\n\tkind: WorkspaceInviteKind;\n\texpires_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type WorkspaceActionRequestAction = \"app_delete\" | \"database_delete\" | \"snapshot_create\" | \"snapshot_restore\";\nexport const WorkspaceActionRequestAction = {\n\tAppDelete: \"app_delete\",\n\tDatabaseDelete: \"database_delete\",\n\tSnapshotCreate: \"snapshot_create\",\n\tSnapshotRestore: \"snapshot_restore\",\n} as const satisfies Record<string, WorkspaceActionRequestAction>;\n\nexport type WorkspaceActionRequestStatus = \"pending\" | \"approved\" | \"rejected\" | \"expired\";\nexport const WorkspaceActionRequestStatus = {\n\tPending: \"pending\",\n\tApproved: \"approved\",\n\tRejected: \"rejected\",\n\tExpired: \"expired\",\n} as const satisfies Record<string, WorkspaceActionRequestStatus>;\n\n/**\n * `params` of an action request, per `action`. Actions without parameters take an empty object;\n * unknown keys are rejected with `WORKSPACE_ACTION_INVALID_PARAMS`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/create\n */\nexport interface WorkspaceActionRequestParams {\n\tapp_delete: Record<string, never>;\n\tdatabase_delete: Record<string, never>;\n\tsnapshot_create: Record<string, never>;\n\t/** The snapshot must belong to the request's resource. */\n\tsnapshot_restore: { snapshot_id: SnowFlake };\n}\n\ninterface APIWorkspaceActionRequestBase {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n\tresource_name: string | null;\n\tstatus: WorkspaceActionRequestStatus;\n\trequested_by: { id: SnowFlake; display_name: string };\n\tdecided_by: { id: SnowFlake; display_name: string } | null;\n\tdecided_at: ISODateString | null;\n\texpires_at: ISODateString;\n\tcreated_at: ISODateString;\n}\n\n/**\n * A request for a destructive/sensitive action made by a member who lacks its permission, to be\n * approved by someone who has it. Expires after 24 h without a decision. Discriminated by `action`,\n * which decides the shape of `params`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type APIWorkspaceActionRequest = {\n\t[A in WorkspaceActionRequestAction]: APIWorkspaceActionRequestBase & { action: A; params: WorkspaceActionRequestParams[A] };\n}[WorkspaceActionRequestAction];\n\n/**\n * Workspace error codes. Stable English sentinels returned in `code`; clients are expected to\n * translate them.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport const WORKSPACE_ERROR_CODES = {\n\tWORKSPACE_NOT_FOUND: \"WORKSPACE_NOT_FOUND\",\n\tWORKSPACE_NAME_ALREADY_EXISTS: \"WORKSPACE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_MEMBER_LIMIT_REACHED: \"WORKSPACE_MEMBER_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_LIMIT_REACHED: \"WORKSPACE_ROLE_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_IN_USE: \"WORKSPACE_ROLE_IN_USE\",\n\tWORKSPACE_ROLE_NOT_FOUND: \"WORKSPACE_ROLE_NOT_FOUND\",\n\tWORKSPACE_ROLE_NAME_ALREADY_EXISTS: \"WORKSPACE_ROLE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_PERMISSION_DENIED: \"WORKSPACE_PERMISSION_DENIED\",\n\tWORKSPACE_PERMISSION_ESCALATION: \"WORKSPACE_PERMISSION_ESCALATION\",\n\tWORKSPACE_INVITE_NOT_FOUND: \"WORKSPACE_INVITE_NOT_FOUND\",\n\tWORKSPACE_INVITE_EXPIRED: \"WORKSPACE_INVITE_EXPIRED\",\n\tWORKSPACE_INVITE_EMAIL_MISMATCH: \"WORKSPACE_INVITE_EMAIL_MISMATCH\",\n\tWORKSPACE_OWNER_ONLY: \"WORKSPACE_OWNER_ONLY\",\n\tWORKSPACE_ACTION_REQUEST_NOT_FOUND: \"WORKSPACE_ACTION_REQUEST_NOT_FOUND\",\n\t/** 409 — the request was already approved or rejected. */\n\t/** 400 — the requester already has the permission; perform the action directly. */\n\tWORKSPACE_ACTION_NOT_NEEDED: \"WORKSPACE_ACTION_NOT_NEEDED\",\n\t/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */\n\tWORKSPACE_ACTION_INVALID_PARAMS: \"WORKSPACE_ACTION_INVALID_PARAMS\",\n\t/** 409 — a pending request already exists for the same action on the same resource. */\n\tWORKSPACE_ACTION_REQUEST_PENDING: \"WORKSPACE_ACTION_REQUEST_PENDING\",\n\tWORKSPACE_RESOURCE_FOLDER_NOT_FOUND: \"WORKSPACE_RESOURCE_FOLDER_NOT_FOUND\",\n\tWORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT: \"WORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT\",\n\tWORKSPACE_RESOURCE_NOT_FOUND: \"WORKSPACE_RESOURCE_NOT_FOUND\",\n\tPLAN_RESTRICTED_FEATURE: \"PLAN_RESTRICTED_FEATURE\",\n} as const;\nexport type WorkspaceErrorCode = (typeof WORKSPACE_ERROR_CODES)[keyof typeof WORKSPACE_ERROR_CODES];\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["workspace.ts"],"sourcesContent":["import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\nimport type { APIApplication, APIDatabase } from \"./index\";\n\n/**\n * Granular workspace permission. Display group in `WORKSPACE_PERMISSIONS`.\n * The owner (`owner_id`) has no entry here: owner-only actions (rename/delete the workspace,\n * transfer ownership, link/unlink projects, deploy webhook, web publishing) are allowed for the\n * owner only, never through a permission.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspacePermission =\n\t| \"apps:read\"\n\t| \"apps:manage\"\n\t| \"apps:lifecycle\"\n\t| \"apps:envs\"\n\t| \"apps:files\"\n\t| \"apps:delete\"\n\t| \"databases:read\"\n\t| \"databases:manage\"\n\t| \"databases:lifecycle\"\n\t| \"databases:credentials\"\n\t| \"databases:data\"\n\t| \"databases:delete\"\n\t| \"snapshots:read\"\n\t| \"snapshots:manage\"\n\t| \"members:read\"\n\t| \"members:manage\"\n\t| \"roles:manage\"\n\t| \"activities:read\";\n\nexport const WorkspacePermission = {\n\tAPPS_READ: \"apps:read\",\n\tAPPS_MANAGE: \"apps:manage\",\n\tAPPS_LIFECYCLE: \"apps:lifecycle\",\n\tAPPS_ENVS: \"apps:envs\",\n\tAPPS_FILES: \"apps:files\",\n\tAPPS_DELETE: \"apps:delete\",\n\tDATABASES_READ: \"databases:read\",\n\tDATABASES_MANAGE: \"databases:manage\",\n\tDATABASES_LIFECYCLE: \"databases:lifecycle\",\n\tDATABASES_CREDENTIALS: \"databases:credentials\",\n\tDATABASES_DATA: \"databases:data\",\n\tDATABASES_DELETE: \"databases:delete\",\n\tSNAPSHOTS_READ: \"snapshots:read\",\n\tSNAPSHOTS_MANAGE: \"snapshots:manage\",\n\tMEMBERS_READ: \"members:read\",\n\tMEMBERS_MANAGE: \"members:manage\",\n\tROLES_MANAGE: \"roles:manage\",\n\tACTIVITIES_READ: \"activities:read\",\n} as const satisfies Record<string, WorkspacePermission>;\n\nexport interface WorkspacePermissionEntry {\n\tgroup: \"apps\" | \"databases\" | \"snapshots\" | \"members\" | \"roles\" | \"activities\";\n}\n\n/**\n * Closed catalog of workspace permissions. A member whose role lacks the permission a route\n * requires gets 403 `WORKSPACE_PERMISSION_DENIED`.\n */\nexport const WORKSPACE_PERMISSIONS: Record<WorkspacePermission, WorkspacePermissionEntry> = {\n\t\"apps:read\": { group: \"apps\" },\n\t\"apps:manage\": { group: \"apps\" },\n\t\"apps:lifecycle\": { group: \"apps\" },\n\t\"apps:envs\": { group: \"apps\" },\n\t\"apps:files\": { group: \"apps\" },\n\t\"apps:delete\": { group: \"apps\" },\n\t\"databases:read\": { group: \"databases\" },\n\t\"databases:manage\": { group: \"databases\" },\n\t\"databases:lifecycle\": { group: \"databases\" },\n\t\"databases:credentials\": { group: \"databases\" },\n\t\"databases:data\": { group: \"databases\" },\n\t\"databases:delete\": { group: \"databases\" },\n\t\"snapshots:read\": { group: \"snapshots\" },\n\t\"snapshots:manage\": { group: \"snapshots\" },\n\t\"members:read\": { group: \"members\" },\n\t\"members:manage\": { group: \"members\" },\n\t\"roles:manage\": { group: \"roles\" },\n\t\"activities:read\": { group: \"activities\" },\n};\n\nexport const WORKSPACE_PERMISSION_LIST = Object.keys(WORKSPACE_PERMISSIONS) as WorkspacePermission[];\n\n/**\n * Seed role, created together with the workspace. It can be renamed and deleted like any other\n * role (it becomes a regular role; `preset` is not restored) and counts toward the plan's role limit.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport type WorkspaceRolePreset = \"admin\" | \"developer\" | \"operator\" | \"viewer\";\nexport const WorkspaceRolePreset = {\n\tAdmin: \"admin\",\n\tDeveloper: \"developer\",\n\tOperator: \"operator\",\n\tViewer: \"viewer\",\n} as const satisfies Record<string, WorkspaceRolePreset>;\n\n/**\n * Permissions a seed role gets when the workspace is created. `admin` does NOT include\n * `snapshots:manage` (restoring/deleting snapshots is destructive); the owner can grant it per role.\n */\nexport function workspacePresetPermissions(preset: WorkspaceRolePreset): WorkspacePermission[] {\n\tswitch (preset) {\n\t\tcase \"admin\":\n\t\t\treturn WORKSPACE_PERMISSION_LIST.filter((p) => p !== \"snapshots:manage\");\n\t\tcase \"developer\":\n\t\t\treturn [\"apps:read\", \"apps:manage\", \"apps:lifecycle\", \"apps:envs\", \"apps:files\", \"databases:read\", \"databases:manage\", \"databases:lifecycle\", \"databases:credentials\", \"databases:data\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"operator\":\n\t\t\treturn [\"apps:read\", \"apps:lifecycle\", \"databases:read\", \"databases:lifecycle\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t\tcase \"viewer\":\n\t\t\treturn [\"apps:read\", \"databases:read\", \"snapshots:read\", \"members:read\", \"activities:read\"];\n\t}\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/roles/list\n */\nexport interface APIWorkspaceRole {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tname: string;\n\tpermissions: WorkspacePermission[];\n\t/** Seed role it came from; `null` for a manually created role. Informational only. */\n\tpreset: WorkspaceRolePreset | null;\n\t/** Display order. */\n\tposition: number;\n\tmembers_count: number;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/members/list\n */\nexport interface APIWorkspaceMember {\n\tuser_id: SnowFlake;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tjoined_at: ISODateString;\n\t/** When the member's access expires; `null` = never. */\n\texpires_at: ISODateString | null;\n\tuser: {\n\t\tdisplay_name: string;\n\t\temail: string;\n\t};\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspace {\n\tid: SnowFlake;\n\tname: string;\n\tdescription: string | null;\n\towner_id: SnowFlake;\n\towner: { display_name: string };\n\tmembers_count: number;\n\t/** Soft delete timestamp. `null` = active. */\n\tdeleted_at: ISODateString | null;\n\t/**\n\t * `true` when the OWNER's plan does not include workspaces (it expired or was downgraded):\n\t * reads keep working, every write returns `PLAN_RESTRICTED_FEATURE`. Nobody is removed — the\n\t * owner must upgrade to unfreeze it.\n\t */\n\tfrozen: boolean;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport interface APIWorkspaceInfoResponse extends APIWorkspace {\n\tmembers: APIWorkspaceMember[];\n\troles: APIWorkspaceRole[];\n\tapplications: APIApplication[];\n\tdatabases: APIDatabase[];\n\t/** Resolved permissions of the caller. The owner always gets the full list, regardless of role. */\n\tpermissions: WorkspacePermission[];\n\tis_owner: boolean;\n\t/** Owner's plan — it determines which features the workspace has. */\n\towner_plan_id: UserPlan;\n\t/** The caller's saved resource organization (folders, favorites) in this workspace. */\n\tresource_organization: APIWorkspaceResourceOrganization;\n}\n\nexport type WorkspaceResourceType = \"application\" | \"database\";\nexport const WorkspaceResourceType = { Application: \"application\", Database: \"database\" } as const satisfies Record<string, WorkspaceResourceType>;\n\nexport type WorkspaceResourceOrganizationScope = \"personal\" | \"workspace\";\nexport const WorkspaceResourceOrganizationScope = { Personal: \"personal\", Workspace: \"workspace\" } as const satisfies Record<string, WorkspaceResourceOrganizationScope>;\n\nexport type WorkspaceFolderColor = \"neutral\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"blue\" | \"purple\";\nexport const WorkspaceFolderColor = { Neutral: \"neutral\", Red: \"red\", Orange: \"orange\", Yellow: \"yellow\", Green: \"green\", Blue: \"blue\", Purple: \"purple\" } as const satisfies Record<string, WorkspaceFolderColor>;\nexport const WORKSPACE_FOLDER_COLORS = Object.values(WorkspaceFolderColor) as WorkspaceFolderColor[];\n\nexport interface APIWorkspaceResourceRef {\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n}\n\nexport interface APIWorkspaceFolderItem extends APIWorkspaceResourceRef {\n\tposition: number;\n}\n\nexport interface APIWorkspaceResourceFolder {\n\tid: SnowFlake;\n\tname: string;\n\tcolor: WorkspaceFolderColor;\n\tposition: number;\n\tresources: APIWorkspaceFolderItem[];\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n}\n\nexport interface APIWorkspaceFavorite extends APIWorkspaceResourceRef {\n\tposition: number;\n\tcreated_at: ISODateString;\n}\n\nexport interface APIWorkspaceResourceOrganization {\n\tscope: WorkspaceResourceOrganizationScope;\n\tuser_id: SnowFlake;\n\tworkspace_id: SnowFlake | null;\n\tfolders: APIWorkspaceResourceFolder[];\n\tfavorites: APIWorkspaceFavorite[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport type WorkspaceInviteKind = \"email\" | \"link\";\nexport const WorkspaceInviteKind = { Email: \"email\", Link: \"link\" } as const satisfies Record<string, WorkspaceInviteKind>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/list\n */\nexport interface APIWorkspaceInvite {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tkind: WorkspaceInviteKind;\n\t/** Bound e-mail; only for `kind: \"email\"`. */\n\temail: string | null;\n\trole_id: SnowFlake;\n\trole_name: string;\n\tinvited_by: { id: SnowFlake; display_name: string };\n\texpires_at: ISODateString;\n\taccepted_at: ISODateString | null;\n\trevoked_at: ISODateString | null;\n\tuses: number;\n\t/** Only for `kind: \"link\"`; `null` = unlimited uses. */\n\tmax_uses: number | null;\n\t/** Access expiration applied to members who join through this invite; `null` = never. */\n\texpires_in_days: number | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/create\n */\nexport interface APIWorkspaceInviteCreated extends APIWorkspaceInvite {\n\t/** Invite URL; only for `kind: \"link\"`, shown once. */\n\turl: string | null;\n}\n\n/**\n * What the invitee sees before accepting (`GET /v1/workspaces/invites/:token`).\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/invites/preview\n */\nexport interface APIWorkspaceInvitePreview {\n\tworkspace: { id: SnowFlake; name: string };\n\tinviter: { display_name: string };\n\trole_name: string;\n\tkind: WorkspaceInviteKind;\n\texpires_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type WorkspaceActionRequestAction = \"app_delete\" | \"database_delete\" | \"snapshot_create\" | \"snapshot_restore\";\nexport const WorkspaceActionRequestAction = {\n\tAppDelete: \"app_delete\",\n\tDatabaseDelete: \"database_delete\",\n\tSnapshotCreate: \"snapshot_create\",\n\tSnapshotRestore: \"snapshot_restore\",\n} as const satisfies Record<string, WorkspaceActionRequestAction>;\n\nexport type WorkspaceActionRequestStatus = \"pending\" | \"approved\" | \"rejected\" | \"expired\";\nexport const WorkspaceActionRequestStatus = {\n\tPending: \"pending\",\n\tApproved: \"approved\",\n\tRejected: \"rejected\",\n\tExpired: \"expired\",\n} as const satisfies Record<string, WorkspaceActionRequestStatus>;\n\n/**\n * `params` of an action request, per `action`. Actions without parameters take an empty object;\n * unknown keys are rejected with `WORKSPACE_ACTION_INVALID_PARAMS`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/create\n */\nexport interface WorkspaceActionRequestParams {\n\tapp_delete: Record<string, never>;\n\tdatabase_delete: Record<string, never>;\n\tsnapshot_create: Record<string, never>;\n\t/** The snapshot must belong to the request's resource. */\n\tsnapshot_restore: { snapshot_id: SnowFlake };\n}\n\ninterface APIWorkspaceActionRequestBase {\n\tid: SnowFlake;\n\tworkspace_id: SnowFlake;\n\tresource_type: WorkspaceResourceType;\n\tresource_id: SnowFlake;\n\tresource_name: string | null;\n\tstatus: WorkspaceActionRequestStatus;\n\trequested_by: { id: SnowFlake; display_name: string };\n\tdecided_by: { id: SnowFlake; display_name: string } | null;\n\tdecided_at: ISODateString | null;\n\texpires_at: ISODateString;\n\tcreated_at: ISODateString;\n}\n\n/**\n * A request for a destructive/sensitive action made by a member who lacks its permission, to be\n * approved by someone who has it. Expires after 24 h without a decision. Discriminated by `action`,\n * which decides the shape of `params`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/action-requests/list\n */\nexport type APIWorkspaceActionRequest = {\n\t[A in WorkspaceActionRequestAction]: APIWorkspaceActionRequestBase & { action: A; params: WorkspaceActionRequestParams[A] };\n}[WorkspaceActionRequestAction];\n\n/**\n * Workspace error codes. Stable English sentinels returned in `code`; clients are expected to\n * translate them.\n * @see https://docs.vertracloud.app/api-reference/endpoint/workspaces/get\n */\nexport const WORKSPACE_ERROR_CODES = {\n\tWORKSPACE_NOT_FOUND: \"WORKSPACE_NOT_FOUND\",\n\tWORKSPACE_NAME_ALREADY_EXISTS: \"WORKSPACE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_MEMBER_LIMIT_REACHED: \"WORKSPACE_MEMBER_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_LIMIT_REACHED: \"WORKSPACE_ROLE_LIMIT_REACHED\",\n\tWORKSPACE_ROLE_IN_USE: \"WORKSPACE_ROLE_IN_USE\",\n\tWORKSPACE_ROLE_NOT_FOUND: \"WORKSPACE_ROLE_NOT_FOUND\",\n\tWORKSPACE_ROLE_NAME_ALREADY_EXISTS: \"WORKSPACE_ROLE_NAME_ALREADY_EXISTS\",\n\tWORKSPACE_PERMISSION_DENIED: \"WORKSPACE_PERMISSION_DENIED\",\n\tWORKSPACE_PERMISSION_ESCALATION: \"WORKSPACE_PERMISSION_ESCALATION\",\n\tWORKSPACE_INVITE_NOT_FOUND: \"WORKSPACE_INVITE_NOT_FOUND\",\n\tWORKSPACE_INVITE_EXPIRED: \"WORKSPACE_INVITE_EXPIRED\",\n\tWORKSPACE_INVITE_EMAIL_MISMATCH: \"WORKSPACE_INVITE_EMAIL_MISMATCH\",\n\t/** 400 — the invited account turned off workspace invites by email. */\n\tWORKSPACE_INVITES_DISABLED: \"WORKSPACE_INVITES_DISABLED\",\n\t/** 409 — the account is already the owner or a member of the workspace. */\n\tWORKSPACE_ALREADY_MEMBER: \"WORKSPACE_ALREADY_MEMBER\",\n\tWORKSPACE_OWNER_ONLY: \"WORKSPACE_OWNER_ONLY\",\n\tWORKSPACE_ACTION_REQUEST_NOT_FOUND: \"WORKSPACE_ACTION_REQUEST_NOT_FOUND\",\n\t/** 410 — the request expired before anyone decided on it. */\n\tWORKSPACE_ACTION_REQUEST_EXPIRED: \"WORKSPACE_ACTION_REQUEST_EXPIRED\",\n\t/** 409 — the request was already approved or rejected. */\n\tWORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: \"WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED\",\n\t/** 400 — the requester already has the permission; perform the action directly. */\n\tWORKSPACE_ACTION_NOT_NEEDED: \"WORKSPACE_ACTION_NOT_NEEDED\",\n\t/** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */\n\tWORKSPACE_ACTION_INVALID_PARAMS: \"WORKSPACE_ACTION_INVALID_PARAMS\",\n\t/** 409 — a pending request already exists for the same action on the same resource. */\n\tWORKSPACE_ACTION_REQUEST_PENDING: \"WORKSPACE_ACTION_REQUEST_PENDING\",\n\tWORKSPACE_RESOURCE_FOLDER_NOT_FOUND: \"WORKSPACE_RESOURCE_FOLDER_NOT_FOUND\",\n\tWORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT: \"WORKSPACE_RESOURCE_FOLDER_NAME_CONFLICT\",\n\tWORKSPACE_RESOURCE_NOT_FOUND: \"WORKSPACE_RESOURCE_NOT_FOUND\",\n\tPLAN_RESTRICTED_FEATURE: \"PLAN_RESTRICTED_FEATURE\",\n} as const;\nexport type WorkspaceErrorCode = (typeof WORKSPACE_ERROR_CODES)[keyof typeof WORKSPACE_ERROR_CODES];\n"],"mappings":"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","names":[]}
@@ -88,9 +88,16 @@ var WORKSPACE_ERROR_CODES = {
88
88
  WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND",
89
89
  WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED",
90
90
  WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH",
91
+ /** 400 — the invited account turned off workspace invites by email. */
92
+ WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED",
93
+ /** 409 — the account is already the owner or a member of the workspace. */
94
+ WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER",
91
95
  WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY",
92
96
  WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND",
97
+ /** 410 — the request expired before anyone decided on it. */
98
+ WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED",
93
99
  /** 409 — the request was already approved or rejected. */
100
+ WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED",
94
101
  /** 400 — the requester already has the permission; perform the action directly. */
95
102
  WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED",
96
103
  /** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */
@@ -180,8 +180,6 @@ interface RESTPostAPIApplicationCreateBody {
180
180
  start?: string;
181
181
  /** Build command (see `APIApplication.build_command`). */
182
182
  build?: string;
183
- /** @deprecated Always `true` since 2026-09-17 — auto-restart is on for every plan; any value sent is ignored. */
184
- autorestart?: boolean;
185
183
  /** `"random"` = the platform picks one at random. */
186
184
  subdomain?: string;
187
185
  workspace_id?: string;
@@ -269,7 +267,6 @@ interface RESTPatchAPIApplicationUpdateConfigBody {
269
267
  description?: string | null;
270
268
  main_file?: string;
271
269
  version?: string;
272
- auto_restart?: boolean;
273
270
  start_command?: string | null;
274
271
  build_command?: string | null;
275
272
  ram?: number;
@@ -1 +1 @@
1
- {"version":3,"sources":["application.ts"],"sourcesContent":["import type {\n\tAPIApplication,\n\tAPIApplicationCustomDomain,\n\tAPIApplicationDeployment,\n\tAPIApplicationDnsRecord,\n\tAPIApplicationEnvironment,\n\tAPIApplicationFile,\n\tAPIApplicationFileContent,\n\tAPIApplicationFileTree,\n\tAPIApplicationFileUpload,\n\tAPIApplicationMetric,\n\tAPIApplicationOperationResponse,\n\tAPIApplicationRealtimeEvent,\n\tAPIApplicationRuntimes,\n\tAPIApplicationScanSuggestions,\n\tAPIApplicationStatus,\n\tAPIApplicationStatusShort,\n\tAPIApplicationSubdomain,\n\tAPIApplicationWebPublish,\n\tAPIApplicationWebhook,\n\tAPIApplicationWebhookUrl,\n\tAPIPayload,\n\tApplicationLanguage,\n\tISODateString,\n\tRESTAPIWorkspaceQuery,\n} from \"../../v1\";\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport type RESTGetAPIApplicationRuntimesResponse = APIPayload<APIApplicationRuntimes>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type RESTGetAPIApplicationResponse = APIPayload<APIApplication>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/status\n */\nexport type RESTGetAPIApplicationStatusResponse = APIPayload<APIApplicationStatus>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/allstatus\n */\nexport type RESTGetAPIApplicationStatusShortResponse = APIPayload<APIApplicationStatusShort[]>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/logs\n */\nexport type RESTGetAPIApplicationLogsResponse = APIPayload<string>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport interface RESTGetAPIApplicationMetricsQuery extends RESTAPIWorkspaceQuery {\n\trange?: \"10m\" | \"30m\" | \"24h\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport type RESTGetAPIApplicationMetricsResponse = APIPayload<APIApplicationMetric[]>;\n\n/**\n * `GET /v1/apps/:id/files`. `path` absent = the application root.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport interface RESTGetAPIApplicationFilesQuery extends RESTAPIWorkspaceQuery {\n\tpath?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport type RESTGetAPIApplicationFilesResponse = APIPayload<APIApplicationFile[]>;\n\n/**\n * `GET /v1/apps/:id/files/tree` — the whole file tree (depth-limited), as a list of root entries.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/tree\n */\nexport type RESTGetAPIApplicationFileTreeResponse = APIPayload<APIApplicationFileTree[]>;\n\n/**\n * `GET /v1/apps/:id/files/content`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport interface RESTGetAPIApplicationFileContentQuery extends RESTAPIWorkspaceQuery {\n\tpath: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport type RESTGetAPIApplicationFileContentResponse = APIPayload<APIApplicationFileContent>;\n\n/**\n * `POST /v1/apps/:id/files/upload` (multipart zip). `restart: \"true\"` restarts the app after the upload.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport interface RESTPostAPIApplicationFileUploadQuery extends RESTAPIWorkspaceQuery {\n\trestart?: \"true\" | \"false\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport type RESTPostAPIApplicationFileUploadResponse = APIPayload<APIApplicationFileUpload>;\n\n/**\n * Creates or overwrites a file. Without `content`, creates (or truncates to) an empty file.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/save\n */\nexport interface RESTPutAPIApplicationFileBody {\n\tpath: string;\n\tcontent?: string;\n\t/** ISO 8601 datetime from the last read; a mismatch returns `409 FILE_MODIFIED`. */\n\tlast_modified?: ISODateString;\n\tworkspace_id?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/save\n */\nexport type RESTPutAPIApplicationFileResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/delete\n */\nexport interface RESTDeleteAPIApplicationFileBody {\n\tpath: string;\n\tworkspace_id?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/delete\n */\nexport type RESTDeleteAPIApplicationFileResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/move\n */\nexport interface RESTPatchAPIApplicationFileMoveBody {\n\tpath: string;\n\tto: string;\n\tworkspace_id?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/move\n */\nexport type RESTPatchAPIApplicationFileMoveResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/get\n */\nexport type RESTGetAPIApplicationEnvironmentResponse = APIPayload<APIApplicationEnvironment[]>;\n\n/**\n * One variable of the `POST /apps/:id/envs` body. `note: null` clears the existing note.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/createOrEdit\n */\nexport interface RESTPostAPIApplicationEnvironmentVariableBody {\n\tkey: string;\n\tvalue: string;\n\tnote?: string | null;\n}\n\n/**\n * Body of `POST /apps/:id/envs`: a single object (one variable) or an array (batch), with no repeated keys.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/createOrEdit\n */\nexport type RESTPostAPIApplicationEnvironmentBody = RESTPostAPIApplicationEnvironmentVariableBody | RESTPostAPIApplicationEnvironmentVariableBody[];\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/createOrEdit\n */\nexport type RESTPostAPIApplicationEnvironmentResponse = APIPayload<APIApplicationEnvironment[]>;\n\n/**\n * `DELETE /v1/apps/:id/envs/:envId`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/delete\n */\nexport type RESTDeleteAPIApplicationEnvironmentResponse = APIPayload<null>;\n\n/**\n * Body of `POST /apps` — **`multipart/form-data`**, not JSON. Each field below is one multipart\n * part: `file` as a file and **every other field as a text field** (including `snapshot_id`,\n * `memory` and `envs`, the latter as a JSON-serialized string).\n *\n * The application has **two mutually exclusive sources**:\n *\n * - `file` — the zip uploaded by the user;\n * - `snapshot_id` — alternative to `file`: the app is created from that snapshot (which already\n * includes its `vertracloud.config`).\n *\n * **Exactly one of them must be present.** Neither → `SOURCE_REQUIRED`; both →\n * `SOURCE_CONFLICT`.\n *\n * Error codes:\n *\n * - `SOURCE_REQUIRED` — neither `file` nor `snapshot_id`.\n * - `SOURCE_CONFLICT` — `file` and `snapshot_id` together.\n * - `SNAPSHOT_NOT_FOUND` — the snapshot does not exist or does not belong to the user.\n * - `SNAPSHOT_TYPE_MISMATCH` — the snapshot is from a database, not an application.\n * - `SNAPSHOT_TOO_LARGE` — the snapshot exceeds the size limit for creation.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport interface RESTPostAPIApplicationCreateBody {\n\t/** Application zip. Absent when the source is `snapshot_id`. */\n\tfile?: unknown;\n\t/**\n\t * Alternative to `file`: id of the **application** snapshot to create the app from. Sent as a\n\t * multipart text field. Exactly one of `file` and `snapshot_id`.\n\t */\n\tsnapshot_id?: string;\n\tname: string;\n\tdescription?: string | null;\n\t/** RAM in MB. Multipart text field. Required with `file`; with `snapshot_id` defaults to the snapshot's config. */\n\tmemory?: number;\n\t/** Required with `file`; with `snapshot_id` defaults to the snapshot's config. */\n\tmain?: string;\n\t/** Required with `file`; with `snapshot_id` defaults to the snapshot's config. */\n\tversion?: string;\n\tstart?: string;\n\t/** Build command (see `APIApplication.build_command`). */\n\tbuild?: string;\n\t/** @deprecated Always `true` since 2026-09-17 — auto-restart is on for every plan; any value sent is ignored. */\n\tautorestart?: boolean;\n\t/** `\"random\"` = the platform picks one at random. */\n\tsubdomain?: string;\n\tworkspace_id?: string;\n\t/** JSON-serialized string in the multipart body. */\n\tenvs?: RESTPostAPIApplicationEnvironmentVariableBody[];\n}\n\n/**\n * The created application, plus the directories removed from the uploaded zip.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport type RESTPostAPIApplicationCreateResponse = APIPayload<APIApplication & { removed_directories: string[] }>;\n\n/**\n * Scans a zip before creating the application and returns suggestions (start/build command,\n * memory). Creates nothing.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport interface RESTPostAPIApplicationScanBody {\n\t/** Application zip. */\n\tfile: unknown;\n\t/** Main file of the application — used only to infer the language, as on create. */\n\tmain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport type RESTPostAPIApplicationScanResponse = APIPayload<APIApplicationScanSuggestions>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/delete\n */\nexport type RESTDeleteAPIApplicationResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/download\n */\nexport type RESTGetAPIApplicationDownloadResponse = ArrayBuffer;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport interface RESTGetAPIApplicationRealtimeQuery extends RESTAPIWorkspaceQuery {\n\tsince?: number;\n}\n\n/**\n * The route answers with a `text/event-stream`; this is the shape of each event in it.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport type RESTGetAPIApplicationRealtimeResponse = APIApplicationRealtimeEvent;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/start\n */\nexport type RESTPostAPIApplicationStartResponse = APIPayload<APIApplicationOperationResponse>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/stop\n */\nexport type RESTPostAPIApplicationStopResponse = APIPayload<APIApplicationOperationResponse>;\n\n/**\n * Optional restart body. No body = regular restart, reusing the install and build cache.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/restart\n */\nexport interface RESTPostAPIApplicationRestartBody {\n\t/** Reinstalls dependencies from scratch, ignoring the install cache. */\n\treinstall_dependencies?: boolean;\n\t/** Runs the build command again even without code changes. Counts as a deploy toward the hourly limit. */\n\tforce_build?: boolean;\n\t/**\n\t * After changing the app's language, removes the dependencies left by the previous runtime.\n\t * Must differ from the current language (`CLEANUP_LANGUAGE_SAME_AS_CURRENT`).\n\t */\n\tcleanup_old_runtime_language?: ApplicationLanguage;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/restart\n */\nexport type RESTPostAPIApplicationRestartResponse = APIPayload<APIApplicationOperationResponse>;\n\n/**\n * Body for updating the app configuration. Every field is optional, but at least one must be\n * provided.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport interface RESTPatchAPIApplicationUpdateConfigBody {\n\tname?: string;\n\tdescription?: string | null;\n\tmain_file?: string;\n\tversion?: string;\n\tauto_restart?: boolean;\n\tstart_command?: string | null;\n\tbuild_command?: string | null;\n\tram?: number;\n\tlanguage?: ApplicationLanguage;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport type RESTPatchAPIApplicationUpdateConfigResponse = APIPayload<string>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type RESTGetAPIApplicationDnsRecordsResponse = APIPayload<APIApplicationDnsRecord[]>;\n\n/**\n * Purges the edge cache of a published application.\n *\n * `hostnames` absent or empty = every host of the application (subdomain and custom domain).\n * When provided, each host must belong to the application. `paths` narrows the purge to\n * specific URLs within those hosts.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/purgecache\n */\nexport interface RESTPostAPIApplicationPurgeCacheBody {\n\thostnames?: string[];\n\tpaths?: string[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/purgecache\n */\nexport type RESTPostAPIApplicationPurgeCacheResponse = APIPayload<null>;\n\n/**\n * `GET /v1/apps/:id/network/custom` — `404 NO_CUSTOM_DOMAIN` when the application has none.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport type RESTGetAPIApplicationCustomDomainResponse = APIPayload<APIApplicationCustomDomain>;\n\n/**\n * `POST /v1/apps/:id/network/custom`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport interface RESTPostAPIApplicationCustomDomainBody {\n\tdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport type RESTPostAPIApplicationCustomDomainResponse = APIPayload<APIApplicationCustomDomain>;\n\n/**\n * `DELETE /v1/apps/:id/network/custom`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport type RESTDeleteAPIApplicationCustomDomainResponse = APIPayload<null>;\n\n/**\n * `PATCH /v1/apps/:id/network/subdomain`. Only the label (`my-app`), 3–50 characters.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport interface RESTPatchAPIApplicationSubdomainBody {\n\tsubdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport type RESTPatchAPIApplicationSubdomainResponse = APIPayload<APIApplicationSubdomain>;\n\n/**\n * Turns on web publishing for an application created without it.\n * `subdomain` absent = the platform picks one at random; choosing one requires a plan with custom subdomains.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport interface RESTPostAPIApplicationWebPublishBody {\n\tsubdomain?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport type RESTPostAPIApplicationWebPublishResponse = APIPayload<APIApplicationWebPublish>;\n\n/**\n * Turns off web publishing: releases the subdomain, removes the custom domain and makes the application private again.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport type RESTDeleteAPIApplicationWebPublishResponse = APIPayload<APIApplicationWebPublish>;\n\n/**\n * `GET /v1/apps/:id/deploys/webhook`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/webhookurl\n */\nexport type RESTGetAPIApplicationWebhookUrlResponse = APIPayload<APIApplicationWebhook>;\n\n/**\n * Creates the auto-deploy webhook from an already connected repository.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport interface RESTPostAPIApplicationWebhookCreateBody {\n\towner: string;\n\trepo_name: string;\n\trepo_id: string;\n\taccount_id: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport type RESTPostAPIApplicationWebhookCreateResponse = APIPayload<APIApplicationWebhookUrl>;\n\n/**\n * `DELETE /v1/apps/:id/deploys/webhook`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/delete\n */\nexport type RESTDeleteAPIApplicationWebhookResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/recents\n */\nexport type RESTGetAPIApplicationDeploymentsResponse = APIPayload<APIApplicationDeployment[]>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["application.ts"],"sourcesContent":["import type {\n\tAPIApplication,\n\tAPIApplicationCustomDomain,\n\tAPIApplicationDeployment,\n\tAPIApplicationDnsRecord,\n\tAPIApplicationEnvironment,\n\tAPIApplicationFile,\n\tAPIApplicationFileContent,\n\tAPIApplicationFileTree,\n\tAPIApplicationFileUpload,\n\tAPIApplicationMetric,\n\tAPIApplicationOperationResponse,\n\tAPIApplicationRealtimeEvent,\n\tAPIApplicationRuntimes,\n\tAPIApplicationScanSuggestions,\n\tAPIApplicationStatus,\n\tAPIApplicationStatusShort,\n\tAPIApplicationSubdomain,\n\tAPIApplicationWebPublish,\n\tAPIApplicationWebhook,\n\tAPIApplicationWebhookUrl,\n\tAPIPayload,\n\tApplicationLanguage,\n\tISODateString,\n\tRESTAPIWorkspaceQuery,\n} from \"../../v1\";\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport type RESTGetAPIApplicationRuntimesResponse = APIPayload<APIApplicationRuntimes>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type RESTGetAPIApplicationResponse = APIPayload<APIApplication>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/status\n */\nexport type RESTGetAPIApplicationStatusResponse = APIPayload<APIApplicationStatus>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/allstatus\n */\nexport type RESTGetAPIApplicationStatusShortResponse = APIPayload<APIApplicationStatusShort[]>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/logs\n */\nexport type RESTGetAPIApplicationLogsResponse = APIPayload<string>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport interface RESTGetAPIApplicationMetricsQuery extends RESTAPIWorkspaceQuery {\n\trange?: \"10m\" | \"30m\" | \"24h\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport type RESTGetAPIApplicationMetricsResponse = APIPayload<APIApplicationMetric[]>;\n\n/**\n * `GET /v1/apps/:id/files`. `path` absent = the application root.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport interface RESTGetAPIApplicationFilesQuery extends RESTAPIWorkspaceQuery {\n\tpath?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport type RESTGetAPIApplicationFilesResponse = APIPayload<APIApplicationFile[]>;\n\n/**\n * `GET /v1/apps/:id/files/tree` — the whole file tree (depth-limited), as a list of root entries.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/tree\n */\nexport type RESTGetAPIApplicationFileTreeResponse = APIPayload<APIApplicationFileTree[]>;\n\n/**\n * `GET /v1/apps/:id/files/content`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport interface RESTGetAPIApplicationFileContentQuery extends RESTAPIWorkspaceQuery {\n\tpath: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport type RESTGetAPIApplicationFileContentResponse = APIPayload<APIApplicationFileContent>;\n\n/**\n * `POST /v1/apps/:id/files/upload` (multipart zip). `restart: \"true\"` restarts the app after the upload.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport interface RESTPostAPIApplicationFileUploadQuery extends RESTAPIWorkspaceQuery {\n\trestart?: \"true\" | \"false\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport type RESTPostAPIApplicationFileUploadResponse = APIPayload<APIApplicationFileUpload>;\n\n/**\n * Creates or overwrites a file. Without `content`, creates (or truncates to) an empty file.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/save\n */\nexport interface RESTPutAPIApplicationFileBody {\n\tpath: string;\n\tcontent?: string;\n\t/** ISO 8601 datetime from the last read; a mismatch returns `409 FILE_MODIFIED`. */\n\tlast_modified?: ISODateString;\n\tworkspace_id?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/save\n */\nexport type RESTPutAPIApplicationFileResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/delete\n */\nexport interface RESTDeleteAPIApplicationFileBody {\n\tpath: string;\n\tworkspace_id?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/delete\n */\nexport type RESTDeleteAPIApplicationFileResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/move\n */\nexport interface RESTPatchAPIApplicationFileMoveBody {\n\tpath: string;\n\tto: string;\n\tworkspace_id?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/move\n */\nexport type RESTPatchAPIApplicationFileMoveResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/get\n */\nexport type RESTGetAPIApplicationEnvironmentResponse = APIPayload<APIApplicationEnvironment[]>;\n\n/**\n * One variable of the `POST /apps/:id/envs` body. `note: null` clears the existing note.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/createOrEdit\n */\nexport interface RESTPostAPIApplicationEnvironmentVariableBody {\n\tkey: string;\n\tvalue: string;\n\tnote?: string | null;\n}\n\n/**\n * Body of `POST /apps/:id/envs`: a single object (one variable) or an array (batch), with no repeated keys.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/createOrEdit\n */\nexport type RESTPostAPIApplicationEnvironmentBody = RESTPostAPIApplicationEnvironmentVariableBody | RESTPostAPIApplicationEnvironmentVariableBody[];\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/createOrEdit\n */\nexport type RESTPostAPIApplicationEnvironmentResponse = APIPayload<APIApplicationEnvironment[]>;\n\n/**\n * `DELETE /v1/apps/:id/envs/:envId`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/delete\n */\nexport type RESTDeleteAPIApplicationEnvironmentResponse = APIPayload<null>;\n\n/**\n * Body of `POST /apps` — **`multipart/form-data`**, not JSON. Each field below is one multipart\n * part: `file` as a file and **every other field as a text field** (including `snapshot_id`,\n * `memory` and `envs`, the latter as a JSON-serialized string).\n *\n * The application has **two mutually exclusive sources**:\n *\n * - `file` — the zip uploaded by the user;\n * - `snapshot_id` — alternative to `file`: the app is created from that snapshot (which already\n * includes its `vertracloud.config`).\n *\n * **Exactly one of them must be present.** Neither → `SOURCE_REQUIRED`; both →\n * `SOURCE_CONFLICT`.\n *\n * Error codes:\n *\n * - `SOURCE_REQUIRED` — neither `file` nor `snapshot_id`.\n * - `SOURCE_CONFLICT` — `file` and `snapshot_id` together.\n * - `SNAPSHOT_NOT_FOUND` — the snapshot does not exist or does not belong to the user.\n * - `SNAPSHOT_TYPE_MISMATCH` — the snapshot is from a database, not an application.\n * - `SNAPSHOT_TOO_LARGE` — the snapshot exceeds the size limit for creation.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport interface RESTPostAPIApplicationCreateBody {\n\t/** Application zip. Absent when the source is `snapshot_id`. */\n\tfile?: unknown;\n\t/**\n\t * Alternative to `file`: id of the **application** snapshot to create the app from. Sent as a\n\t * multipart text field. Exactly one of `file` and `snapshot_id`.\n\t */\n\tsnapshot_id?: string;\n\tname: string;\n\tdescription?: string | null;\n\t/** RAM in MB. Multipart text field. Required with `file`; with `snapshot_id` defaults to the snapshot's config. */\n\tmemory?: number;\n\t/** Required with `file`; with `snapshot_id` defaults to the snapshot's config. */\n\tmain?: string;\n\t/** Required with `file`; with `snapshot_id` defaults to the snapshot's config. */\n\tversion?: string;\n\tstart?: string;\n\t/** Build command (see `APIApplication.build_command`). */\n\tbuild?: string;\n\t/** `\"random\"` = the platform picks one at random. */\n\tsubdomain?: string;\n\tworkspace_id?: string;\n\t/** JSON-serialized string in the multipart body. */\n\tenvs?: RESTPostAPIApplicationEnvironmentVariableBody[];\n}\n\n/**\n * The created application, plus the directories removed from the uploaded zip.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport type RESTPostAPIApplicationCreateResponse = APIPayload<APIApplication & { removed_directories: string[] }>;\n\n/**\n * Scans a zip before creating the application and returns suggestions (start/build command,\n * memory). Creates nothing.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport interface RESTPostAPIApplicationScanBody {\n\t/** Application zip. */\n\tfile: unknown;\n\t/** Main file of the application — used only to infer the language, as on create. */\n\tmain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport type RESTPostAPIApplicationScanResponse = APIPayload<APIApplicationScanSuggestions>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/delete\n */\nexport type RESTDeleteAPIApplicationResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/download\n */\nexport type RESTGetAPIApplicationDownloadResponse = ArrayBuffer;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport interface RESTGetAPIApplicationRealtimeQuery extends RESTAPIWorkspaceQuery {\n\tsince?: number;\n}\n\n/**\n * The route answers with a `text/event-stream`; this is the shape of each event in it.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport type RESTGetAPIApplicationRealtimeResponse = APIApplicationRealtimeEvent;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/start\n */\nexport type RESTPostAPIApplicationStartResponse = APIPayload<APIApplicationOperationResponse>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/stop\n */\nexport type RESTPostAPIApplicationStopResponse = APIPayload<APIApplicationOperationResponse>;\n\n/**\n * Optional restart body. No body = regular restart, reusing the install and build cache.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/restart\n */\nexport interface RESTPostAPIApplicationRestartBody {\n\t/** Reinstalls dependencies from scratch, ignoring the install cache. */\n\treinstall_dependencies?: boolean;\n\t/** Runs the build command again even without code changes. Counts as a deploy toward the hourly limit. */\n\tforce_build?: boolean;\n\t/**\n\t * After changing the app's language, removes the dependencies left by the previous runtime.\n\t * Must differ from the current language (`CLEANUP_LANGUAGE_SAME_AS_CURRENT`).\n\t */\n\tcleanup_old_runtime_language?: ApplicationLanguage;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/restart\n */\nexport type RESTPostAPIApplicationRestartResponse = APIPayload<APIApplicationOperationResponse>;\n\n/**\n * Body for updating the app configuration. Every field is optional, but at least one must be\n * provided.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport interface RESTPatchAPIApplicationUpdateConfigBody {\n\tname?: string;\n\tdescription?: string | null;\n\tmain_file?: string;\n\tversion?: string;\n\tstart_command?: string | null;\n\tbuild_command?: string | null;\n\tram?: number;\n\tlanguage?: ApplicationLanguage;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport type RESTPatchAPIApplicationUpdateConfigResponse = APIPayload<string>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type RESTGetAPIApplicationDnsRecordsResponse = APIPayload<APIApplicationDnsRecord[]>;\n\n/**\n * Purges the edge cache of a published application.\n *\n * `hostnames` absent or empty = every host of the application (subdomain and custom domain).\n * When provided, each host must belong to the application. `paths` narrows the purge to\n * specific URLs within those hosts.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/purgecache\n */\nexport interface RESTPostAPIApplicationPurgeCacheBody {\n\thostnames?: string[];\n\tpaths?: string[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/purgecache\n */\nexport type RESTPostAPIApplicationPurgeCacheResponse = APIPayload<null>;\n\n/**\n * `GET /v1/apps/:id/network/custom` — `404 NO_CUSTOM_DOMAIN` when the application has none.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport type RESTGetAPIApplicationCustomDomainResponse = APIPayload<APIApplicationCustomDomain>;\n\n/**\n * `POST /v1/apps/:id/network/custom`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport interface RESTPostAPIApplicationCustomDomainBody {\n\tdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport type RESTPostAPIApplicationCustomDomainResponse = APIPayload<APIApplicationCustomDomain>;\n\n/**\n * `DELETE /v1/apps/:id/network/custom`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport type RESTDeleteAPIApplicationCustomDomainResponse = APIPayload<null>;\n\n/**\n * `PATCH /v1/apps/:id/network/subdomain`. Only the label (`my-app`), 3–50 characters.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport interface RESTPatchAPIApplicationSubdomainBody {\n\tsubdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport type RESTPatchAPIApplicationSubdomainResponse = APIPayload<APIApplicationSubdomain>;\n\n/**\n * Turns on web publishing for an application created without it.\n * `subdomain` absent = the platform picks one at random; choosing one requires a plan with custom subdomains.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport interface RESTPostAPIApplicationWebPublishBody {\n\tsubdomain?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport type RESTPostAPIApplicationWebPublishResponse = APIPayload<APIApplicationWebPublish>;\n\n/**\n * Turns off web publishing: releases the subdomain, removes the custom domain and makes the application private again.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport type RESTDeleteAPIApplicationWebPublishResponse = APIPayload<APIApplicationWebPublish>;\n\n/**\n * `GET /v1/apps/:id/deploys/webhook`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/webhookurl\n */\nexport type RESTGetAPIApplicationWebhookUrlResponse = APIPayload<APIApplicationWebhook>;\n\n/**\n * Creates the auto-deploy webhook from an already connected repository.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport interface RESTPostAPIApplicationWebhookCreateBody {\n\towner: string;\n\trepo_name: string;\n\trepo_id: string;\n\taccount_id: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport type RESTPostAPIApplicationWebhookCreateResponse = APIPayload<APIApplicationWebhookUrl>;\n\n/**\n * `DELETE /v1/apps/:id/deploys/webhook`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/delete\n */\nexport type RESTDeleteAPIApplicationWebhookResponse = APIPayload<null>;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/recents\n */\nexport type RESTGetAPIApplicationDeploymentsResponse = APIPayload<APIApplicationDeployment[]>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -3,7 +3,6 @@ export { RESTDeleteAPIUserApiKeyResponse, RESTGetAPIUserApiKeysResponse, RESTPat
3
3
  export { RESTDeleteAPIApplicationCustomDomainResponse, RESTDeleteAPIApplicationEnvironmentResponse, RESTDeleteAPIApplicationFileBody, RESTDeleteAPIApplicationFileResponse, RESTDeleteAPIApplicationResponse, RESTDeleteAPIApplicationWebPublishResponse, RESTDeleteAPIApplicationWebhookResponse, RESTGetAPIApplicationCustomDomainResponse, RESTGetAPIApplicationDeploymentsResponse, RESTGetAPIApplicationDnsRecordsResponse, RESTGetAPIApplicationDownloadResponse, RESTGetAPIApplicationEnvironmentResponse, RESTGetAPIApplicationFileContentQuery, RESTGetAPIApplicationFileContentResponse, RESTGetAPIApplicationFileTreeResponse, RESTGetAPIApplicationFilesQuery, RESTGetAPIApplicationFilesResponse, RESTGetAPIApplicationLogsResponse, RESTGetAPIApplicationMetricsQuery, RESTGetAPIApplicationMetricsResponse, RESTGetAPIApplicationRealtimeQuery, RESTGetAPIApplicationRealtimeResponse, RESTGetAPIApplicationResponse, RESTGetAPIApplicationRuntimesResponse, RESTGetAPIApplicationStatusResponse, RESTGetAPIApplicationStatusShortResponse, RESTGetAPIApplicationWebhookUrlResponse, RESTPatchAPIApplicationFileMoveBody, RESTPatchAPIApplicationFileMoveResponse, RESTPatchAPIApplicationSubdomainBody, RESTPatchAPIApplicationSubdomainResponse, RESTPatchAPIApplicationUpdateConfigBody, RESTPatchAPIApplicationUpdateConfigResponse, RESTPostAPIApplicationCreateBody, RESTPostAPIApplicationCreateResponse, RESTPostAPIApplicationCustomDomainBody, RESTPostAPIApplicationCustomDomainResponse, RESTPostAPIApplicationEnvironmentBody, RESTPostAPIApplicationEnvironmentResponse, RESTPostAPIApplicationEnvironmentVariableBody, RESTPostAPIApplicationFileUploadQuery, RESTPostAPIApplicationFileUploadResponse, RESTPostAPIApplicationPurgeCacheBody, RESTPostAPIApplicationPurgeCacheResponse, RESTPostAPIApplicationRestartBody, RESTPostAPIApplicationRestartResponse, RESTPostAPIApplicationScanBody, RESTPostAPIApplicationScanResponse, RESTPostAPIApplicationStartResponse, RESTPostAPIApplicationStopResponse, RESTPostAPIApplicationWebPublishBody, RESTPostAPIApplicationWebPublishResponse, RESTPostAPIApplicationWebhookCreateBody, RESTPostAPIApplicationWebhookCreateResponse, RESTPutAPIApplicationFileBody, RESTPutAPIApplicationFileResponse } from './application.js';
4
4
  export { RESTDeleteAPIDatabaseResponse, RESTGetAPIDatabaseCertificateResponse, RESTGetAPIDatabaseMetricsResponse, RESTGetAPIDatabaseResponse, RESTGetAPIDatabaseStatusResponse, RESTGetAPIDatabaseStatusShortResponse, RESTPostAPIDatabaseCreateBody, RESTPostAPIDatabaseCreateResponse, RESTPostAPIDatabaseResetCertificateResponse, RESTPostAPIDatabaseResetPasswordResponse, RESTPostAPIDatabaseResetResponse, RESTPostAPIDatabaseStartResponse, RESTPostAPIDatabaseStopResponse, RESTPutAPIDatabaseUpdateBody, RESTPutAPIDatabaseUpdateResponse } from './database.js';
5
5
  export { RESTDeleteAPIDatabaseDocumentsBody, RESTDeleteAPIDatabaseRedisKeysBody, RESTDeleteAPIDatabaseRowsBody, RESTGetAPIDatabaseCollectionIndexesResult, RESTGetAPIDatabaseCollectionsResult, RESTGetAPIDatabaseDataOverviewResult, RESTGetAPIDatabaseDocumentsResult, RESTGetAPIDatabaseRedisInfoResult, RESTGetAPIDatabaseRedisKeyValueResult, RESTGetAPIDatabaseRedisKeysResult, RESTGetAPIDatabaseSchemasResult, RESTGetAPIDatabaseTableColumnsResult, RESTGetAPIDatabaseTableRowsResult, RESTGetAPIDatabaseTablesResult, RESTMutateAPIDatabaseDocumentsResult, RESTMutateAPIDatabaseRedisKeysResult, RESTMutateAPIDatabaseRowsResult, RESTPostAPIDatabaseDocumentCreateBody, RESTPostAPIDatabaseQueryBody, RESTPostAPIDatabaseQueryResult, RESTPostAPIDatabaseRowCreateBody, RESTPutAPIDatabaseDocumentUpdateBody, RESTPutAPIDatabaseRedisKeyBody, RESTPutAPIDatabaseRedisKeyExpireBody, RESTPutAPIDatabaseRowUpdateBody } from './database-data.js';
6
- export { RESTPostAPIGitHubFileBody, RESTPostAPIGitHubFileResponse } from './github.js';
7
6
  export { RESTGetAPINotificationsResponse } from './notification.js';
8
7
  export { RESTGetAPIOAuthClientResponse, RESTPostAPIOAuthConsentBody, RESTPostAPIOAuthConsentResponse, RESTPostAPIOAuthRegisterBody, RESTPostAPIOAuthRegisterResponse, RESTPostAPIOAuthTokenBody, RESTPostAPIOAuthTokenResponse } from './oauth.js';
9
8
  export { RESTGetAPIOrderListQuery, RESTGetAPIOrderListResponse, RESTGetAPIOrderStatusResponse, RESTPostAPIOrderCreateBody, RESTPostAPIOrderCreateResponse, RESTPostAPIOrderPixPaymentResponse } from './orders.js';
@@ -20,7 +19,6 @@ import '../../payloads/v1/api-key.js';
20
19
  import '../../payloads/v1/application.js';
21
20
  import '../../payloads/v1/database.js';
22
21
  import '../../payloads/v1/database-data.js';
23
- import '../../payloads/v1/github.js';
24
22
  import '../../payloads/v1/oauth.js';
25
23
  import '../../payloads/v1/orders.js';
26
24
  import '../../payloads/v1/redeem.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from \"./activity\";\nexport * from \"./api-key\";\nexport * from \"./application\";\nexport * from \"./database\";\nexport * from \"./database-data\";\nexport * from \"./github\";\nexport * from \"./notification\";\nexport * from \"./oauth\";\nexport * from \"./orders\";\nexport * from \"./redeem\";\nexport * from \"./snapshot\";\nexport * from \"./status\";\nexport * from \"./user\";\nexport * from \"./workspace\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from \"./activity\";\nexport * from \"./api-key\";\nexport * from \"./application\";\nexport * from \"./database\";\nexport * from \"./database-data\";\nexport * from \"./notification\";\nexport * from \"./oauth\";\nexport * from \"./orders\";\nexport * from \"./redeem\";\nexport * from \"./snapshot\";\nexport * from \"./status\";\nexport * from \"./user\";\nexport * from \"./workspace\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/v1.d.ts CHANGED
@@ -5,7 +5,6 @@ export { APIErrorCode, API_ERROR_CODES } from './payloads/v1/api-error.js';
5
5
  export { APIApplication, APIApplicationConfig, APIApplicationCustomDomain, APIApplicationDeployment, APIApplicationDnsRecord, APIApplicationEnvironment, APIApplicationFile, APIApplicationFileContent, APIApplicationFileTree, APIApplicationFileUpload, APIApplicationGithub, APIApplicationMetric, APIApplicationNetwork, APIApplicationOperationResponse, APIApplicationRealtimeEvent, APIApplicationRuntime, APIApplicationRuntimes, APIApplicationScanSuggestions, APIApplicationShieldCooldown, APIApplicationStatus, APIApplicationStatusShort, APIApplicationSubdomain, APIApplicationWebPublish, APIApplicationWebhook, APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationStatus, ApplicationType, ApplicationVersion, ShieldIncidentDirection, ShieldIncidentReason } from './payloads/v1/application.js';
6
6
  export { APIDatabase, APIDatabaseCertificate, APIDatabaseMetrics, APIDatabaseNetwork, APIDatabaseOperationResponse, APIDatabasePasswordReset, APIDatabaseStatus, APIDatabaseStatusShort, DatabaseCluster, DatabaseStatus, DatabaseType } from './payloads/v1/database.js';
7
7
  export { APIDatabaseCollection, APIDatabaseColumn, APIDatabaseColumnReference, APIDatabaseDataError, APIDatabaseDataOverview, APIDatabaseDocumentListParams, APIDatabaseDocumentsPage, APIDatabaseIndex, APIDatabaseListParams, APIDatabaseMongoIndex, APIDatabaseQueryResult, APIDatabaseRedisInfo, APIDatabaseRedisKey, APIDatabaseRedisKeyValue, APIDatabaseRedisKeysPage, APIDatabaseRedisScanParams, APIDatabaseRedisZSetMember, APIDatabaseRowFilter, APIDatabaseRowsPage, APIDatabaseSchema, APIDatabaseTable, DatabaseFilterOperator, DatabaseRedisKeyType, DatabaseSortDirection, DatabaseTableKind } from './payloads/v1/database-data.js';
8
- export { APIGitHubFile } from './payloads/v1/github.js';
9
8
  export { APINotification, LocalizedContent, NotificationImportance, NotificationType } from './payloads/v1/notification.js';
10
9
  export { APIOAuthClient, APIOAuthCodeChallengeMethod, APIOAuthConsentDecision } from './payloads/v1/oauth.js';
11
10
  export { APIOrderCreateResponse, APIOrderDiscount, APIOrderListItem, APIOrderPixPayment, APIOrderStatus, OrderProvider, OrderStatus, OrderType } from './payloads/v1/orders.js';
@@ -19,7 +18,6 @@ export { RESTDeleteAPIUserApiKeyResponse, RESTGetAPIUserApiKeysResponse, RESTPat
19
18
  export { RESTDeleteAPIApplicationCustomDomainResponse, RESTDeleteAPIApplicationEnvironmentResponse, RESTDeleteAPIApplicationFileBody, RESTDeleteAPIApplicationFileResponse, RESTDeleteAPIApplicationResponse, RESTDeleteAPIApplicationWebPublishResponse, RESTDeleteAPIApplicationWebhookResponse, RESTGetAPIApplicationCustomDomainResponse, RESTGetAPIApplicationDeploymentsResponse, RESTGetAPIApplicationDnsRecordsResponse, RESTGetAPIApplicationDownloadResponse, RESTGetAPIApplicationEnvironmentResponse, RESTGetAPIApplicationFileContentQuery, RESTGetAPIApplicationFileContentResponse, RESTGetAPIApplicationFileTreeResponse, RESTGetAPIApplicationFilesQuery, RESTGetAPIApplicationFilesResponse, RESTGetAPIApplicationLogsResponse, RESTGetAPIApplicationMetricsQuery, RESTGetAPIApplicationMetricsResponse, RESTGetAPIApplicationRealtimeQuery, RESTGetAPIApplicationRealtimeResponse, RESTGetAPIApplicationResponse, RESTGetAPIApplicationRuntimesResponse, RESTGetAPIApplicationStatusResponse, RESTGetAPIApplicationStatusShortResponse, RESTGetAPIApplicationWebhookUrlResponse, RESTPatchAPIApplicationFileMoveBody, RESTPatchAPIApplicationFileMoveResponse, RESTPatchAPIApplicationSubdomainBody, RESTPatchAPIApplicationSubdomainResponse, RESTPatchAPIApplicationUpdateConfigBody, RESTPatchAPIApplicationUpdateConfigResponse, RESTPostAPIApplicationCreateBody, RESTPostAPIApplicationCreateResponse, RESTPostAPIApplicationCustomDomainBody, RESTPostAPIApplicationCustomDomainResponse, RESTPostAPIApplicationEnvironmentBody, RESTPostAPIApplicationEnvironmentResponse, RESTPostAPIApplicationEnvironmentVariableBody, RESTPostAPIApplicationFileUploadQuery, RESTPostAPIApplicationFileUploadResponse, RESTPostAPIApplicationPurgeCacheBody, RESTPostAPIApplicationPurgeCacheResponse, RESTPostAPIApplicationRestartBody, RESTPostAPIApplicationRestartResponse, RESTPostAPIApplicationScanBody, RESTPostAPIApplicationScanResponse, RESTPostAPIApplicationStartResponse, RESTPostAPIApplicationStopResponse, RESTPostAPIApplicationWebPublishBody, RESTPostAPIApplicationWebPublishResponse, RESTPostAPIApplicationWebhookCreateBody, RESTPostAPIApplicationWebhookCreateResponse, RESTPutAPIApplicationFileBody, RESTPutAPIApplicationFileResponse } from './rest/v1/application.js';
20
19
  export { RESTDeleteAPIDatabaseResponse, RESTGetAPIDatabaseCertificateResponse, RESTGetAPIDatabaseMetricsResponse, RESTGetAPIDatabaseResponse, RESTGetAPIDatabaseStatusResponse, RESTGetAPIDatabaseStatusShortResponse, RESTPostAPIDatabaseCreateBody, RESTPostAPIDatabaseCreateResponse, RESTPostAPIDatabaseResetCertificateResponse, RESTPostAPIDatabaseResetPasswordResponse, RESTPostAPIDatabaseResetResponse, RESTPostAPIDatabaseStartResponse, RESTPostAPIDatabaseStopResponse, RESTPutAPIDatabaseUpdateBody, RESTPutAPIDatabaseUpdateResponse } from './rest/v1/database.js';
21
20
  export { RESTDeleteAPIDatabaseDocumentsBody, RESTDeleteAPIDatabaseRedisKeysBody, RESTDeleteAPIDatabaseRowsBody, RESTGetAPIDatabaseCollectionIndexesResult, RESTGetAPIDatabaseCollectionsResult, RESTGetAPIDatabaseDataOverviewResult, RESTGetAPIDatabaseDocumentsResult, RESTGetAPIDatabaseRedisInfoResult, RESTGetAPIDatabaseRedisKeyValueResult, RESTGetAPIDatabaseRedisKeysResult, RESTGetAPIDatabaseSchemasResult, RESTGetAPIDatabaseTableColumnsResult, RESTGetAPIDatabaseTableRowsResult, RESTGetAPIDatabaseTablesResult, RESTMutateAPIDatabaseDocumentsResult, RESTMutateAPIDatabaseRedisKeysResult, RESTMutateAPIDatabaseRowsResult, RESTPostAPIDatabaseDocumentCreateBody, RESTPostAPIDatabaseQueryBody, RESTPostAPIDatabaseQueryResult, RESTPostAPIDatabaseRowCreateBody, RESTPutAPIDatabaseDocumentUpdateBody, RESTPutAPIDatabaseRedisKeyBody, RESTPutAPIDatabaseRedisKeyExpireBody, RESTPutAPIDatabaseRowUpdateBody } from './rest/v1/database-data.js';
22
- export { RESTPostAPIGitHubFileBody, RESTPostAPIGitHubFileResponse } from './rest/v1/github.js';
23
21
  export { RESTGetAPINotificationsResponse } from './rest/v1/notification.js';
24
22
  export { RESTGetAPIOAuthClientResponse, RESTPostAPIOAuthConsentBody, RESTPostAPIOAuthConsentResponse, RESTPostAPIOAuthRegisterBody, RESTPostAPIOAuthRegisterResponse, RESTPostAPIOAuthTokenBody, RESTPostAPIOAuthTokenResponse } from './rest/v1/oauth.js';
25
23
  export { RESTGetAPIOrderListQuery, RESTGetAPIOrderListResponse, RESTGetAPIOrderStatusResponse, RESTPostAPIOrderCreateBody, RESTPostAPIOrderCreateResponse, RESTPostAPIOrderPixPaymentResponse } from './rest/v1/orders.js';
package/v1.js CHANGED
@@ -259,13 +259,13 @@ var API_KEY_SCOPES = {
259
259
  group: "account",
260
260
  routes: [
261
261
  { method: "PATCH", path: "/v1/users/me" },
262
- { method: "POST", path: "/v1/users/me/resource-organization/folders" },
263
- { method: "PATCH", path: "/v1/users/me/resource-organization/folders/:folder_id" },
264
- { method: "DELETE", path: "/v1/users/me/resource-organization/folders/:folder_id" },
265
- { method: "PUT", path: "/v1/users/me/resource-organization/folders/:folder_id/resources/:resource_type/:resource_id" },
266
- { method: "DELETE", path: "/v1/users/me/resource-organization/folders/:folder_id/resources/:resource_type/:resource_id" },
267
- { method: "PUT", path: "/v1/users/me/resource-organization/favorites/:resource_type/:resource_id" },
268
- { method: "DELETE", path: "/v1/users/me/resource-organization/favorites/:resource_type/:resource_id" }
262
+ { method: "POST", path: "/v1/users/me/folders" },
263
+ { method: "PATCH", path: "/v1/users/me/folders/:folder_id" },
264
+ { method: "DELETE", path: "/v1/users/me/folders/:folder_id" },
265
+ { method: "PUT", path: "/v1/users/me/folders/:folder_id/resources/:resource_type/:resource_id" },
266
+ { method: "DELETE", path: "/v1/users/me/folders/:folder_id/resources/:resource_type/:resource_id" },
267
+ { method: "PUT", path: "/v1/users/me/favorites/:resource_type/:resource_id" },
268
+ { method: "DELETE", path: "/v1/users/me/favorites/:resource_type/:resource_id" }
269
269
  ]
270
270
  },
271
271
  "workspaces:read": {
@@ -292,13 +292,13 @@ var API_KEY_SCOPES = {
292
292
  { method: "DELETE", path: "/v1/workspaces/:id/apps/:app_id" },
293
293
  { method: "POST", path: "/v1/workspaces/:id/databases/:db_id" },
294
294
  { method: "DELETE", path: "/v1/workspaces/:id/databases/:db_id" },
295
- { method: "POST", path: "/v1/workspaces/:id/resource-organization/folders" },
296
- { method: "PATCH", path: "/v1/workspaces/:id/resource-organization/folders/:folder_id" },
297
- { method: "DELETE", path: "/v1/workspaces/:id/resource-organization/folders/:folder_id" },
298
- { method: "PUT", path: "/v1/workspaces/:id/resource-organization/folders/:folder_id/resources/:resource_type/:resource_id" },
299
- { method: "DELETE", path: "/v1/workspaces/:id/resource-organization/folders/:folder_id/resources/:resource_type/:resource_id" },
300
- { method: "PUT", path: "/v1/workspaces/:id/resource-organization/favorites/:resource_type/:resource_id" },
301
- { method: "DELETE", path: "/v1/workspaces/:id/resource-organization/favorites/:resource_type/:resource_id" },
295
+ { method: "POST", path: "/v1/workspaces/:id/folders" },
296
+ { method: "PATCH", path: "/v1/workspaces/:id/folders/:folder_id" },
297
+ { method: "DELETE", path: "/v1/workspaces/:id/folders/:folder_id" },
298
+ { method: "PUT", path: "/v1/workspaces/:id/folders/:folder_id/resources/:resource_type/:resource_id" },
299
+ { method: "DELETE", path: "/v1/workspaces/:id/folders/:folder_id/resources/:resource_type/:resource_id" },
300
+ { method: "PUT", path: "/v1/workspaces/:id/favorites/:resource_type/:resource_id" },
301
+ { method: "DELETE", path: "/v1/workspaces/:id/favorites/:resource_type/:resource_id" },
302
302
  { method: "POST", path: "/v1/workspaces/:id/action-requests" }
303
303
  ]
304
304
  },
@@ -439,9 +439,16 @@ var WORKSPACE_ERROR_CODES = {
439
439
  WORKSPACE_INVITE_NOT_FOUND: "WORKSPACE_INVITE_NOT_FOUND",
440
440
  WORKSPACE_INVITE_EXPIRED: "WORKSPACE_INVITE_EXPIRED",
441
441
  WORKSPACE_INVITE_EMAIL_MISMATCH: "WORKSPACE_INVITE_EMAIL_MISMATCH",
442
+ /** 400 — the invited account turned off workspace invites by email. */
443
+ WORKSPACE_INVITES_DISABLED: "WORKSPACE_INVITES_DISABLED",
444
+ /** 409 — the account is already the owner or a member of the workspace. */
445
+ WORKSPACE_ALREADY_MEMBER: "WORKSPACE_ALREADY_MEMBER",
442
446
  WORKSPACE_OWNER_ONLY: "WORKSPACE_OWNER_ONLY",
443
447
  WORKSPACE_ACTION_REQUEST_NOT_FOUND: "WORKSPACE_ACTION_REQUEST_NOT_FOUND",
448
+ /** 410 — the request expired before anyone decided on it. */
449
+ WORKSPACE_ACTION_REQUEST_EXPIRED: "WORKSPACE_ACTION_REQUEST_EXPIRED",
444
450
  /** 409 — the request was already approved or rejected. */
451
+ WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED: "WORKSPACE_ACTION_REQUEST_ALREADY_DECIDED",
445
452
  /** 400 — the requester already has the permission; perform the action directly. */
446
453
  WORKSPACE_ACTION_NOT_NEEDED: "WORKSPACE_ACTION_NOT_NEEDED",
447
454
  /** 400 — the request `params` failed the action's validation (e.g. a snapshot of another resource). */
@@ -458,8 +465,16 @@ var WORKSPACE_ERROR_CODES = {
458
465
  var API_ERROR_CODES = {
459
466
  ACCESS_DENIED: "ACCESS_DENIED",
460
467
  API_KEY_INVALID: "API_KEY_INVALID",
468
+ // Key management (`/v1/users/me/api-keys`) — dashboard-session routes.
469
+ API_KEY_NOT_FOUND: "API_KEY_NOT_FOUND",
470
+ API_KEY_LIMIT_REACHED: "API_KEY_LIMIT_REACHED",
471
+ API_KEY_INVALID_NAME: "API_KEY_INVALID_NAME",
472
+ API_KEY_INVALID_SCOPES: "API_KEY_INVALID_SCOPES",
473
+ API_KEY_INVALID_IPS: "API_KEY_INVALID_IPS",
461
474
  API_KEY_IP_DENIED: "API_KEY_IP_DENIED",
462
475
  API_KEY_SCOPE_DENIED: "API_KEY_SCOPE_DENIED",
476
+ /** 403 — the route only accepts a dashboard session; API keys are refused. */
477
+ WEBSITE_ONLY: "WEBSITE_ONLY",
463
478
  AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING",
464
479
  ACCOUNT_BANNED: "ACCOUNT_BANNED",
465
480
  APP_SHIELD_COOLDOWN: "APP_SHIELD_COOLDOWN",
@@ -524,6 +539,7 @@ var API_ERROR_CODES = {
524
539
  INVALID_RAM_LIMIT: "INVALID_RAM_LIMIT",
525
540
  INVALID_RANGE: "INVALID_RANGE",
526
541
  INVALID_SUBDOMAIN_FORMAT: "INVALID_SUBDOMAIN_FORMAT",
542
+ INVALID_VERSION: "INVALID_VERSION",
527
543
  INVALID_ZIP: "INVALID_ZIP",
528
544
  INVALID_ZIP_STRUCTURE: "INVALID_ZIP_STRUCTURE",
529
545
  MAIN_FILE_NOT_FOUND: "MAIN_FILE_NOT_FOUND",