@vertracloud/api-types 0.2.5 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertracloud/api-types",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "description": "TypeScript types for the public API of Vertra Cloud, a Brazilian application hosting platform (PaaS) for applications, managed databases and bots.",
6
6
  "homepage": "https://vertracloud.app",
@@ -48,9 +48,32 @@ declare const API_ERROR_CODES: {
48
48
  readonly APP_NOT_FOUND_IN_WORKSPACE: "APP_NOT_FOUND_IN_WORKSPACE";
49
49
  readonly BUILD_FAILED: "BUILD_FAILED";
50
50
  readonly BUILD_TIMEOUT: "BUILD_TIMEOUT";
51
+ /** 400 — billing details failed validation; the field is in `details.path`. */
52
+ readonly BILLING_DETAILS_INVALID: "BILLING_DETAILS_INVALID";
53
+ /** 402 — the bank refused the card charge. */
54
+ readonly CARD_DECLINED: "CARD_DECLINED";
55
+ /** 400 — the plan can only be paid by PIX. */
56
+ readonly CARD_NOT_ALLOWED_FOR_PLAN: "CARD_NOT_ALLOWED_FOR_PLAN";
57
+ readonly CARD_NOT_FOUND: "CARD_NOT_FOUND";
51
58
  readonly CERTIFICATE_NOT_FOUND: "CERTIFICATE_NOT_FOUND";
52
59
  readonly CLEANUP_LANGUAGE_SAME_AS_CURRENT: "CLEANUP_LANGUAGE_SAME_AS_CURRENT";
53
60
  readonly CONTAINER_ALREADY_RUNNING: "CONTAINER_ALREADY_RUNNING";
61
+ /** 400 — no active coupon with this code. */
62
+ readonly COUPON_INVALID: "COUPON_INVALID";
63
+ readonly COUPON_INACTIVE: "COUPON_INACTIVE";
64
+ readonly COUPON_NOT_STARTED: "COUPON_NOT_STARTED";
65
+ readonly COUPON_EXPIRED: "COUPON_EXPIRED";
66
+ /** 400 — the coupon reached its total number of uses. */
67
+ readonly COUPON_EXHAUSTED: "COUPON_EXHAUSTED";
68
+ /** 400 — the account already used this coupon as many times as allowed. */
69
+ readonly COUPON_USER_LIMIT: "COUPON_USER_LIMIT";
70
+ /** 400 — the coupon is not available to this account. */
71
+ readonly COUPON_AUDIENCE: "COUPON_AUDIENCE";
72
+ /** 400 — the coupon does not apply to this plan. */
73
+ readonly COUPON_PLAN: "COUPON_PLAN";
74
+ /** 400 — the coupon does not apply to this billing period. */
75
+ readonly COUPON_DURATION: "COUPON_DURATION";
76
+ readonly COUPON_PAYMENT_METHOD: "COUPON_PAYMENT_METHOD";
54
77
  readonly CUSTOM_DOMAIN_RECORD_NOT_FOUND: "CUSTOM_DOMAIN_RECORD_NOT_FOUND";
55
78
  readonly CUSTOM_DOMAIN_REGISTRATION_FAILED: "CUSTOM_DOMAIN_REGISTRATION_FAILED";
56
79
  readonly DAILY_QUOTA_EXCEEDED: "DAILY_QUOTA_EXCEEDED";
@@ -126,9 +149,14 @@ declare const API_ERROR_CODES: {
126
149
  readonly ORDER_NOT_PAID: "ORDER_NOT_PAID";
127
150
  readonly ORDER_NOT_PAYABLE: "ORDER_NOT_PAYABLE";
128
151
  readonly ORDER_NOT_REFUNDED: "ORDER_NOT_REFUNDED";
152
+ /** 404 — the order has no payment receipt (unpaid, redeemed code or paid before receipts existed). */
153
+ readonly ORDER_RECEIPT_UNAVAILABLE: "ORDER_RECEIPT_UNAVAILABLE";
129
154
  readonly OWNER_APP_WITHOUT_LIMITS: "OWNER_APP_WITHOUT_LIMITS";
130
155
  readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
156
+ /** 409 — a folder in the path is an existing file (writing `app/x.js` when `app` is a file). */
157
+ readonly PATH_IS_FILE: "PATH_IS_FILE";
131
158
  readonly PENDING_ORDER_LIMIT_REACHED: "PENDING_ORDER_LIMIT_REACHED";
159
+ readonly PAYMENT_METHOD_UNAVAILABLE: "PAYMENT_METHOD_UNAVAILABLE";
132
160
  readonly PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN";
133
161
  readonly PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN";
134
162
  readonly PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: "PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH";
@@ -151,6 +179,8 @@ declare const API_ERROR_CODES: {
151
179
  readonly SUBDOMAIN_CHANGE_RATE_LIMITED: "SUBDOMAIN_CHANGE_RATE_LIMITED";
152
180
  readonly SUBDOMAIN_FORBIDDEN: "SUBDOMAIN_FORBIDDEN";
153
181
  readonly SUBDOMAIN_TAKEN: "SUBDOMAIN_TAKEN";
182
+ /** 400 — the CPF or CNPJ is not valid. */
183
+ readonly TAX_ID_INVALID: "TAX_ID_INVALID";
154
184
  readonly TYPE_MISMATCH: "TYPE_MISMATCH";
155
185
  readonly USER_LIMITS_NOT_FOUND: "USER_LIMITS_NOT_FOUND";
156
186
  readonly USER_NOT_FOUND: "USER_NOT_FOUND";
@@ -211,9 +241,32 @@ declare const APIErrorCode: {
211
241
  readonly APP_NOT_FOUND_IN_WORKSPACE: "APP_NOT_FOUND_IN_WORKSPACE";
212
242
  readonly BUILD_FAILED: "BUILD_FAILED";
213
243
  readonly BUILD_TIMEOUT: "BUILD_TIMEOUT";
244
+ /** 400 — billing details failed validation; the field is in `details.path`. */
245
+ readonly BILLING_DETAILS_INVALID: "BILLING_DETAILS_INVALID";
246
+ /** 402 — the bank refused the card charge. */
247
+ readonly CARD_DECLINED: "CARD_DECLINED";
248
+ /** 400 — the plan can only be paid by PIX. */
249
+ readonly CARD_NOT_ALLOWED_FOR_PLAN: "CARD_NOT_ALLOWED_FOR_PLAN";
250
+ readonly CARD_NOT_FOUND: "CARD_NOT_FOUND";
214
251
  readonly CERTIFICATE_NOT_FOUND: "CERTIFICATE_NOT_FOUND";
215
252
  readonly CLEANUP_LANGUAGE_SAME_AS_CURRENT: "CLEANUP_LANGUAGE_SAME_AS_CURRENT";
216
253
  readonly CONTAINER_ALREADY_RUNNING: "CONTAINER_ALREADY_RUNNING";
254
+ /** 400 — no active coupon with this code. */
255
+ readonly COUPON_INVALID: "COUPON_INVALID";
256
+ readonly COUPON_INACTIVE: "COUPON_INACTIVE";
257
+ readonly COUPON_NOT_STARTED: "COUPON_NOT_STARTED";
258
+ readonly COUPON_EXPIRED: "COUPON_EXPIRED";
259
+ /** 400 — the coupon reached its total number of uses. */
260
+ readonly COUPON_EXHAUSTED: "COUPON_EXHAUSTED";
261
+ /** 400 — the account already used this coupon as many times as allowed. */
262
+ readonly COUPON_USER_LIMIT: "COUPON_USER_LIMIT";
263
+ /** 400 — the coupon is not available to this account. */
264
+ readonly COUPON_AUDIENCE: "COUPON_AUDIENCE";
265
+ /** 400 — the coupon does not apply to this plan. */
266
+ readonly COUPON_PLAN: "COUPON_PLAN";
267
+ /** 400 — the coupon does not apply to this billing period. */
268
+ readonly COUPON_DURATION: "COUPON_DURATION";
269
+ readonly COUPON_PAYMENT_METHOD: "COUPON_PAYMENT_METHOD";
217
270
  readonly CUSTOM_DOMAIN_RECORD_NOT_FOUND: "CUSTOM_DOMAIN_RECORD_NOT_FOUND";
218
271
  readonly CUSTOM_DOMAIN_REGISTRATION_FAILED: "CUSTOM_DOMAIN_REGISTRATION_FAILED";
219
272
  readonly DAILY_QUOTA_EXCEEDED: "DAILY_QUOTA_EXCEEDED";
@@ -289,9 +342,14 @@ declare const APIErrorCode: {
289
342
  readonly ORDER_NOT_PAID: "ORDER_NOT_PAID";
290
343
  readonly ORDER_NOT_PAYABLE: "ORDER_NOT_PAYABLE";
291
344
  readonly ORDER_NOT_REFUNDED: "ORDER_NOT_REFUNDED";
345
+ /** 404 — the order has no payment receipt (unpaid, redeemed code or paid before receipts existed). */
346
+ readonly ORDER_RECEIPT_UNAVAILABLE: "ORDER_RECEIPT_UNAVAILABLE";
292
347
  readonly OWNER_APP_WITHOUT_LIMITS: "OWNER_APP_WITHOUT_LIMITS";
293
348
  readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
349
+ /** 409 — a folder in the path is an existing file (writing `app/x.js` when `app` is a file). */
350
+ readonly PATH_IS_FILE: "PATH_IS_FILE";
294
351
  readonly PENDING_ORDER_LIMIT_REACHED: "PENDING_ORDER_LIMIT_REACHED";
352
+ readonly PAYMENT_METHOD_UNAVAILABLE: "PAYMENT_METHOD_UNAVAILABLE";
295
353
  readonly PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN";
296
354
  readonly PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN";
297
355
  readonly PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: "PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH";
@@ -314,6 +372,8 @@ declare const APIErrorCode: {
314
372
  readonly SUBDOMAIN_CHANGE_RATE_LIMITED: "SUBDOMAIN_CHANGE_RATE_LIMITED";
315
373
  readonly SUBDOMAIN_FORBIDDEN: "SUBDOMAIN_FORBIDDEN";
316
374
  readonly SUBDOMAIN_TAKEN: "SUBDOMAIN_TAKEN";
375
+ /** 400 — the CPF or CNPJ is not valid. */
376
+ readonly TAX_ID_INVALID: "TAX_ID_INVALID";
317
377
  readonly TYPE_MISMATCH: "TYPE_MISMATCH";
318
378
  readonly USER_LIMITS_NOT_FOUND: "USER_LIMITS_NOT_FOUND";
319
379
  readonly USER_NOT_FOUND: "USER_NOT_FOUND";
@@ -110,9 +110,32 @@ var API_ERROR_CODES = {
110
110
  APP_NOT_FOUND_IN_WORKSPACE: "APP_NOT_FOUND_IN_WORKSPACE",
111
111
  BUILD_FAILED: "BUILD_FAILED",
112
112
  BUILD_TIMEOUT: "BUILD_TIMEOUT",
113
+ /** 400 — billing details failed validation; the field is in `details.path`. */
114
+ BILLING_DETAILS_INVALID: "BILLING_DETAILS_INVALID",
115
+ /** 402 — the bank refused the card charge. */
116
+ CARD_DECLINED: "CARD_DECLINED",
117
+ /** 400 — the plan can only be paid by PIX. */
118
+ CARD_NOT_ALLOWED_FOR_PLAN: "CARD_NOT_ALLOWED_FOR_PLAN",
119
+ CARD_NOT_FOUND: "CARD_NOT_FOUND",
113
120
  CERTIFICATE_NOT_FOUND: "CERTIFICATE_NOT_FOUND",
114
121
  CLEANUP_LANGUAGE_SAME_AS_CURRENT: "CLEANUP_LANGUAGE_SAME_AS_CURRENT",
115
122
  CONTAINER_ALREADY_RUNNING: "CONTAINER_ALREADY_RUNNING",
123
+ /** 400 — no active coupon with this code. */
124
+ COUPON_INVALID: "COUPON_INVALID",
125
+ COUPON_INACTIVE: "COUPON_INACTIVE",
126
+ COUPON_NOT_STARTED: "COUPON_NOT_STARTED",
127
+ COUPON_EXPIRED: "COUPON_EXPIRED",
128
+ /** 400 — the coupon reached its total number of uses. */
129
+ COUPON_EXHAUSTED: "COUPON_EXHAUSTED",
130
+ /** 400 — the account already used this coupon as many times as allowed. */
131
+ COUPON_USER_LIMIT: "COUPON_USER_LIMIT",
132
+ /** 400 — the coupon is not available to this account. */
133
+ COUPON_AUDIENCE: "COUPON_AUDIENCE",
134
+ /** 400 — the coupon does not apply to this plan. */
135
+ COUPON_PLAN: "COUPON_PLAN",
136
+ /** 400 — the coupon does not apply to this billing period. */
137
+ COUPON_DURATION: "COUPON_DURATION",
138
+ COUPON_PAYMENT_METHOD: "COUPON_PAYMENT_METHOD",
116
139
  CUSTOM_DOMAIN_RECORD_NOT_FOUND: "CUSTOM_DOMAIN_RECORD_NOT_FOUND",
117
140
  CUSTOM_DOMAIN_REGISTRATION_FAILED: "CUSTOM_DOMAIN_REGISTRATION_FAILED",
118
141
  DAILY_QUOTA_EXCEEDED: "DAILY_QUOTA_EXCEEDED",
@@ -188,9 +211,14 @@ var API_ERROR_CODES = {
188
211
  ORDER_NOT_PAID: "ORDER_NOT_PAID",
189
212
  ORDER_NOT_PAYABLE: "ORDER_NOT_PAYABLE",
190
213
  ORDER_NOT_REFUNDED: "ORDER_NOT_REFUNDED",
214
+ /** 404 — the order has no payment receipt (unpaid, redeemed code or paid before receipts existed). */
215
+ ORDER_RECEIPT_UNAVAILABLE: "ORDER_RECEIPT_UNAVAILABLE",
191
216
  OWNER_APP_WITHOUT_LIMITS: "OWNER_APP_WITHOUT_LIMITS",
192
217
  PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE",
218
+ /** 409 — a folder in the path is an existing file (writing `app/x.js` when `app` is a file). */
219
+ PATH_IS_FILE: "PATH_IS_FILE",
193
220
  PENDING_ORDER_LIMIT_REACHED: "PENDING_ORDER_LIMIT_REACHED",
221
+ PAYMENT_METHOD_UNAVAILABLE: "PAYMENT_METHOD_UNAVAILABLE",
194
222
  PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN",
195
223
  PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN",
196
224
  PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: "PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH",
@@ -213,6 +241,8 @@ var API_ERROR_CODES = {
213
241
  SUBDOMAIN_CHANGE_RATE_LIMITED: "SUBDOMAIN_CHANGE_RATE_LIMITED",
214
242
  SUBDOMAIN_FORBIDDEN: "SUBDOMAIN_FORBIDDEN",
215
243
  SUBDOMAIN_TAKEN: "SUBDOMAIN_TAKEN",
244
+ /** 400 — the CPF or CNPJ is not valid. */
245
+ TAX_ID_INVALID: "TAX_ID_INVALID",
216
246
  TYPE_MISMATCH: "TYPE_MISMATCH",
217
247
  USER_LIMITS_NOT_FOUND: "USER_LIMITS_NOT_FOUND",
218
248
  USER_NOT_FOUND: "USER_NOT_FOUND",
@@ -1 +1 @@
1
- {"version":3,"sources":["api-error.ts","workspace.ts"],"sourcesContent":["import { WORKSPACE_ERROR_CODES } from \"./workspace\";\n\n/** Stable error sentinels returned by routes available to API keys. */\nexport const API_ERROR_CODES = {\n\tACCESS_DENIED: \"ACCESS_DENIED\",\n\tAPI_KEY_INVALID: \"API_KEY_INVALID\",\n\t// Key management (`/v1/users/me/api-keys`) — dashboard-session routes.\n\tAPI_KEY_NOT_FOUND: \"API_KEY_NOT_FOUND\",\n\tAPI_KEY_LIMIT_REACHED: \"API_KEY_LIMIT_REACHED\",\n\tAPI_KEY_INVALID_NAME: \"API_KEY_INVALID_NAME\",\n\tAPI_KEY_INVALID_SCOPES: \"API_KEY_INVALID_SCOPES\",\n\tAPI_KEY_INVALID_IPS: \"API_KEY_INVALID_IPS\",\n\tAPI_KEY_IP_DENIED: \"API_KEY_IP_DENIED\",\n\tAPI_KEY_SCOPE_DENIED: \"API_KEY_SCOPE_DENIED\",\n\t/** 403 — the route only accepts a dashboard session; API keys are refused. */\n\tWEBSITE_ONLY: \"WEBSITE_ONLY\",\n\tAUTH_TOKEN_MISSING: \"AUTH_TOKEN_MISSING\",\n\tACCOUNT_BANNED: \"ACCOUNT_BANNED\",\n\tAPP_SHIELD_COOLDOWN: \"APP_SHIELD_COOLDOWN\",\n\tAPP_BANNED: \"APP_BANNED\",\n\tAPP_ALREADY_PUBLISHED: \"APP_ALREADY_PUBLISHED\",\n\tAPP_HAS_NO_SUBDOMAIN: \"APP_HAS_NO_SUBDOMAIN\",\n\tAPP_NOT_FOUND: \"APP_NOT_FOUND\",\n\tAPP_NOT_PUBLISHED: \"APP_NOT_PUBLISHED\",\n\tAPP_ALREADY_IN_WORKSPACE: \"APP_ALREADY_IN_WORKSPACE\",\n\tAPP_NOT_FOUND_IN_WORKSPACE: \"APP_NOT_FOUND_IN_WORKSPACE\",\n\tBUILD_FAILED: \"BUILD_FAILED\",\n\tBUILD_TIMEOUT: \"BUILD_TIMEOUT\",\n\tCERTIFICATE_NOT_FOUND: \"CERTIFICATE_NOT_FOUND\",\n\tCLEANUP_LANGUAGE_SAME_AS_CURRENT: \"CLEANUP_LANGUAGE_SAME_AS_CURRENT\",\n\tCONTAINER_ALREADY_RUNNING: \"CONTAINER_ALREADY_RUNNING\",\n\tCUSTOM_DOMAIN_RECORD_NOT_FOUND: \"CUSTOM_DOMAIN_RECORD_NOT_FOUND\",\n\tCUSTOM_DOMAIN_REGISTRATION_FAILED: \"CUSTOM_DOMAIN_REGISTRATION_FAILED\",\n\tDAILY_QUOTA_EXCEEDED: \"DAILY_QUOTA_EXCEEDED\",\n\tDATABASE_NOT_FOUND: \"DATABASE_NOT_FOUND\",\n\tDATABASE_NOT_RUNNING: \"DATABASE_NOT_RUNNING\",\n\tDATABASE_ALREADY_IN_WORKSPACE: \"DATABASE_ALREADY_IN_WORKSPACE\",\n\tDATABASE_NOT_FOUND_IN_WORKSPACE: \"DATABASE_NOT_FOUND_IN_WORKSPACE\",\n\tDATABASE_PERSISTENCE_FAILED: \"DATABASE_PERSISTENCE_FAILED\",\n\tDEPLOY_FAILED: \"DEPLOY_FAILED\",\n\tDEPLOYMENT_NOT_FOUND: \"DEPLOYMENT_NOT_FOUND\",\n\tDEPLOY_RATE_LIMITED: \"DEPLOY_RATE_LIMITED\",\n\tDOMAIN_ALREADY_IN_USE: \"DOMAIN_ALREADY_IN_USE\",\n\tENV_LIMIT_EXCEEDED: \"ENV_LIMIT_EXCEEDED\",\n\tENV_DUPLICATE_KEY: \"ENV_DUPLICATE_KEY\",\n\tENV_NOT_FOUND: \"ENV_NOT_FOUND\",\n\tFILE_TOO_LARGE: \"FILE_TOO_LARGE\",\n\tFILE_MODIFIED: \"FILE_MODIFIED\",\n\tFILE_NOT_FOUND: \"FILE_NOT_FOUND\",\n\tFILE_OR_FOLDER_NOT_FOUND: \"FILE_OR_FOLDER_NOT_FOUND\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tFORBIDDEN_DOMAIN: \"FORBIDDEN_DOMAIN\",\n\tFORBIDDEN_PATH: \"FORBIDDEN_PATH\",\n\tFORBIDDEN_KEY: \"FORBIDDEN_KEY\",\n\tFORCED_SNAPSHOT_RATE_LIMIT: \"FORCED_SNAPSHOT_RATE_LIMIT\",\n\tFREE_PLAN_NO_WEB_PUBLISH: \"FREE_PLAN_NO_WEB_PUBLISH\",\n\t/** 403 — the Free plan can no longer create applications or databases; a paid plan is required. */\n\tFREE_PLAN_SUSPENDED: \"FREE_PLAN_SUSPENDED\",\n\tINSTALLATION_NOT_FOUND: \"INSTALLATION_NOT_FOUND\",\n\tINSTALL_SHIELD_BLOCKED: \"INSTALL_SHIELD_BLOCKED\",\n\tINSTALL_TIMEOUT: \"INSTALL_TIMEOUT\",\n\tINSTALL_FAILED: \"INSTALL_FAILED\",\n\tINSTALL_CANCELLED: \"INSTALL_CANCELLED\",\n\tINSTALL_OUT_OF_MEMORY: \"INSTALL_OUT_OF_MEMORY\",\n\tINSTALL_QUEUE_FULL: \"INSTALL_QUEUE_FULL\",\n\tINSUFFICIENT_MEMORY: \"INSUFFICIENT_MEMORY\",\n\tINTERNAL_SERVER_ERROR: \"INTERNAL_SERVER_ERROR\",\n\tINVALID_CONFIG: \"INVALID_CONFIG\",\n\tINVALID_CUSTOM_DOMAIN_FORMAT: \"INVALID_CUSTOM_DOMAIN_FORMAT\",\n\tINVALID_HOSTNAME_FOR_APP: \"INVALID_HOSTNAME_FOR_APP\",\n\tINVALID_LANGUAGE: \"INVALID_LANGUAGE\",\n\tINVALID_MEMORY_FORMAT: \"INVALID_MEMORY_FORMAT\",\n\tINVALID_MONTHS: \"INVALID_MONTHS\",\n\tINVALID_OR_EXPIRED_CODE: \"INVALID_OR_EXPIRED_CODE\",\n\tINVALID_PARAMS: \"INVALID_PARAMS\",\n\tINVALID_PAYLOAD: \"INVALID_PAYLOAD\",\n\tINVALID_PATH: \"INVALID_PATH\",\n\tINVALID_PLAN: \"INVALID_PLAN\",\n\tINVALID_PLAN_NAME: \"INVALID_PLAN_NAME\",\n\tINVALID_RAM_LIMIT: \"INVALID_RAM_LIMIT\",\n\tINVALID_RANGE: \"INVALID_RANGE\",\n\tINVALID_SUBDOMAIN_FORMAT: \"INVALID_SUBDOMAIN_FORMAT\",\n\tINVALID_VERSION: \"INVALID_VERSION\",\n\tINVALID_ZIP: \"INVALID_ZIP\",\n\tINVALID_ZIP_STRUCTURE: \"INVALID_ZIP_STRUCTURE\",\n\tMAIN_FILE_NOT_FOUND: \"MAIN_FILE_NOT_FOUND\",\n\tMAX_APPS_REACHED: \"MAX_APPS_REACHED\",\n\tMAX_DATABASES_REACHED: \"MAX_DATABASES_REACHED\",\n\tMEMORY_BELOW_MINIMUM: \"MEMORY_BELOW_MINIMUM\",\n\tMEMORY_LIMIT_EXCEEDED: \"MEMORY_LIMIT_EXCEEDED\",\n\tMEMORY_MUST_BE_INTEGER: \"MEMORY_MUST_BE_INTEGER\",\n\tMEMORY_REQUIRED: \"MEMORY_REQUIRED\",\n\tMISSING_HEADERS: \"MISSING_HEADERS\",\n\tMISSING_PLAN_OR_MONTHS: \"MISSING_PLAN_OR_MONTHS\",\n\tMISSING_CONTENT: \"MISSING_CONTENT\",\n\tNOT_AN_UPGRADE: \"NOT_AN_UPGRADE\",\n\tNO_AUTHORIZED_PATHS: \"NO_AUTHORIZED_PATHS\",\n\tNO_CHANGES_PROVIDED: \"NO_CHANGES_PROVIDED\",\n\tNO_CUSTOM_DOMAIN: \"NO_CUSTOM_DOMAIN\",\n\tNO_FIELDS_TO_UPDATE: \"NO_FIELDS_TO_UPDATE\",\n\tNO_FILE_UPLOADED: \"NO_FILE_UPLOADED\",\n\tOPERATION_IN_PROGRESS: \"OPERATION_IN_PROGRESS\",\n\tORDER_NOT_FOUND: \"ORDER_NOT_FOUND\",\n\tORDER_NOT_PAID: \"ORDER_NOT_PAID\",\n\tORDER_NOT_PAYABLE: \"ORDER_NOT_PAYABLE\",\n\tORDER_NOT_REFUNDED: \"ORDER_NOT_REFUNDED\",\n\tOWNER_APP_WITHOUT_LIMITS: \"OWNER_APP_WITHOUT_LIMITS\",\n\tPAYLOAD_TOO_LARGE: \"PAYLOAD_TOO_LARGE\",\n\tPENDING_ORDER_LIMIT_REACHED: \"PENDING_ORDER_LIMIT_REACHED\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: \"PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH\",\n\tPLAN_MISMATCH_FOR_RENEWAL: \"PLAN_MISMATCH_FOR_RENEWAL\",\n\tPLAN_NOT_ALLOWED: \"PLAN_NOT_ALLOWED\",\n\tRATE_LIMIT_EXCEEDED: \"RATE_LIMIT_EXCEEDED\",\n\tREFUND_AMOUNT_EXCEEDS_PRICE: \"REFUND_AMOUNT_EXCEEDS_PRICE\",\n\tREPO_ALREADY_LINKED: \"REPO_ALREADY_LINKED\",\n\tRESTORE_COOLDOWN: \"RESTORE_COOLDOWN\",\n\tSNAPSHOT_ENGINE_MISMATCH: \"SNAPSHOT_ENGINE_MISMATCH\",\n\tSNAPSHOT_FAILED: \"SNAPSHOT_FAILED\",\n\tSNAPSHOT_IMPORT_FAILED: \"SNAPSHOT_IMPORT_FAILED\",\n\tSNAPSHOT_NOT_FOUND: \"SNAPSHOT_NOT_FOUND\",\n\tSNAPSHOT_RATE_LIMITED: \"SNAPSHOT_RATE_LIMITED\",\n\tSNAPSHOT_TYPE_MISMATCH: \"SNAPSHOT_TYPE_MISMATCH\",\n\tSNAPSHOT_TOO_LARGE: \"SNAPSHOT_TOO_LARGE\",\n\tSOURCE_CONFLICT: \"SOURCE_CONFLICT\",\n\tSOURCE_REQUIRED: \"SOURCE_REQUIRED\",\n\tSTORAGE_ABOVE_NEW_LIMIT: \"STORAGE_ABOVE_NEW_LIMIT\",\n\tSUBDOMAIN_CHANGE_RATE_LIMITED: \"SUBDOMAIN_CHANGE_RATE_LIMITED\",\n\tSUBDOMAIN_FORBIDDEN: \"SUBDOMAIN_FORBIDDEN\",\n\tSUBDOMAIN_TAKEN: \"SUBDOMAIN_TAKEN\",\n\tTYPE_MISMATCH: \"TYPE_MISMATCH\",\n\tUSER_LIMITS_NOT_FOUND: \"USER_LIMITS_NOT_FOUND\",\n\tUSER_NOT_FOUND: \"USER_NOT_FOUND\",\n\tUSER_NOT_IN_WORKSPACE: \"USER_NOT_IN_WORKSPACE\",\n\tDATABASE_BANNED: \"DATABASE_BANNED\",\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tZIP_TOO_LARGE: \"ZIP_TOO_LARGE\",\n\tZIP_TOO_SMALL: \"ZIP_TOO_SMALL\",\n\tSTORAGE_FULL: \"STORAGE_FULL\",\n\tTARGET_IS_DIRECTORY: \"TARGET_IS_DIRECTORY\",\n\t...WORKSPACE_ERROR_CODES,\n} as const;\n\nexport const APIErrorCode = API_ERROR_CODES;\n\nexport type APIErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];\n","import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\nimport type { APIApplication, APIDatabase } from \"./index\";\n\n/**\n * Granular workspace permission. Display group in `WORKSPACE_PERMISSIONS`.\n * The owner (`owner_id`) has no entry here: owner-only actions (rename/delete the workspace,\n * 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":[]}
1
+ {"version":3,"sources":["api-error.ts","workspace.ts"],"sourcesContent":["import { WORKSPACE_ERROR_CODES } from \"./workspace\";\n\n/** Stable error sentinels returned by routes available to API keys. */\nexport const API_ERROR_CODES = {\n\tACCESS_DENIED: \"ACCESS_DENIED\",\n\tAPI_KEY_INVALID: \"API_KEY_INVALID\",\n\t// Key management (`/v1/users/me/api-keys`) — dashboard-session routes.\n\tAPI_KEY_NOT_FOUND: \"API_KEY_NOT_FOUND\",\n\tAPI_KEY_LIMIT_REACHED: \"API_KEY_LIMIT_REACHED\",\n\tAPI_KEY_INVALID_NAME: \"API_KEY_INVALID_NAME\",\n\tAPI_KEY_INVALID_SCOPES: \"API_KEY_INVALID_SCOPES\",\n\tAPI_KEY_INVALID_IPS: \"API_KEY_INVALID_IPS\",\n\tAPI_KEY_IP_DENIED: \"API_KEY_IP_DENIED\",\n\tAPI_KEY_SCOPE_DENIED: \"API_KEY_SCOPE_DENIED\",\n\t/** 403 — the route only accepts a dashboard session; API keys are refused. */\n\tWEBSITE_ONLY: \"WEBSITE_ONLY\",\n\tAUTH_TOKEN_MISSING: \"AUTH_TOKEN_MISSING\",\n\tACCOUNT_BANNED: \"ACCOUNT_BANNED\",\n\tAPP_SHIELD_COOLDOWN: \"APP_SHIELD_COOLDOWN\",\n\tAPP_BANNED: \"APP_BANNED\",\n\tAPP_ALREADY_PUBLISHED: \"APP_ALREADY_PUBLISHED\",\n\tAPP_HAS_NO_SUBDOMAIN: \"APP_HAS_NO_SUBDOMAIN\",\n\tAPP_NOT_FOUND: \"APP_NOT_FOUND\",\n\tAPP_NOT_PUBLISHED: \"APP_NOT_PUBLISHED\",\n\tAPP_ALREADY_IN_WORKSPACE: \"APP_ALREADY_IN_WORKSPACE\",\n\tAPP_NOT_FOUND_IN_WORKSPACE: \"APP_NOT_FOUND_IN_WORKSPACE\",\n\tBUILD_FAILED: \"BUILD_FAILED\",\n\tBUILD_TIMEOUT: \"BUILD_TIMEOUT\",\n\t/** 400 — billing details failed validation; the field is in `details.path`. */\n\tBILLING_DETAILS_INVALID: \"BILLING_DETAILS_INVALID\",\n\t/** 402 — the bank refused the card charge. */\n\tCARD_DECLINED: \"CARD_DECLINED\",\n\t/** 400 — the plan can only be paid by PIX. */\n\tCARD_NOT_ALLOWED_FOR_PLAN: \"CARD_NOT_ALLOWED_FOR_PLAN\",\n\tCARD_NOT_FOUND: \"CARD_NOT_FOUND\",\n\tCERTIFICATE_NOT_FOUND: \"CERTIFICATE_NOT_FOUND\",\n\tCLEANUP_LANGUAGE_SAME_AS_CURRENT: \"CLEANUP_LANGUAGE_SAME_AS_CURRENT\",\n\tCONTAINER_ALREADY_RUNNING: \"CONTAINER_ALREADY_RUNNING\",\n\t/** 400 — no active coupon with this code. */\n\tCOUPON_INVALID: \"COUPON_INVALID\",\n\tCOUPON_INACTIVE: \"COUPON_INACTIVE\",\n\tCOUPON_NOT_STARTED: \"COUPON_NOT_STARTED\",\n\tCOUPON_EXPIRED: \"COUPON_EXPIRED\",\n\t/** 400 — the coupon reached its total number of uses. */\n\tCOUPON_EXHAUSTED: \"COUPON_EXHAUSTED\",\n\t/** 400 — the account already used this coupon as many times as allowed. */\n\tCOUPON_USER_LIMIT: \"COUPON_USER_LIMIT\",\n\t/** 400 — the coupon is not available to this account. */\n\tCOUPON_AUDIENCE: \"COUPON_AUDIENCE\",\n\t/** 400 — the coupon does not apply to this plan. */\n\tCOUPON_PLAN: \"COUPON_PLAN\",\n\t/** 400 — the coupon does not apply to this billing period. */\n\tCOUPON_DURATION: \"COUPON_DURATION\",\n\tCOUPON_PAYMENT_METHOD: \"COUPON_PAYMENT_METHOD\",\n\tCUSTOM_DOMAIN_RECORD_NOT_FOUND: \"CUSTOM_DOMAIN_RECORD_NOT_FOUND\",\n\tCUSTOM_DOMAIN_REGISTRATION_FAILED: \"CUSTOM_DOMAIN_REGISTRATION_FAILED\",\n\tDAILY_QUOTA_EXCEEDED: \"DAILY_QUOTA_EXCEEDED\",\n\tDATABASE_NOT_FOUND: \"DATABASE_NOT_FOUND\",\n\tDATABASE_NOT_RUNNING: \"DATABASE_NOT_RUNNING\",\n\tDATABASE_ALREADY_IN_WORKSPACE: \"DATABASE_ALREADY_IN_WORKSPACE\",\n\tDATABASE_NOT_FOUND_IN_WORKSPACE: \"DATABASE_NOT_FOUND_IN_WORKSPACE\",\n\tDATABASE_PERSISTENCE_FAILED: \"DATABASE_PERSISTENCE_FAILED\",\n\tDEPLOY_FAILED: \"DEPLOY_FAILED\",\n\tDEPLOYMENT_NOT_FOUND: \"DEPLOYMENT_NOT_FOUND\",\n\tDEPLOY_RATE_LIMITED: \"DEPLOY_RATE_LIMITED\",\n\tDOMAIN_ALREADY_IN_USE: \"DOMAIN_ALREADY_IN_USE\",\n\tENV_LIMIT_EXCEEDED: \"ENV_LIMIT_EXCEEDED\",\n\tENV_DUPLICATE_KEY: \"ENV_DUPLICATE_KEY\",\n\tENV_NOT_FOUND: \"ENV_NOT_FOUND\",\n\tFILE_TOO_LARGE: \"FILE_TOO_LARGE\",\n\tFILE_MODIFIED: \"FILE_MODIFIED\",\n\tFILE_NOT_FOUND: \"FILE_NOT_FOUND\",\n\tFILE_OR_FOLDER_NOT_FOUND: \"FILE_OR_FOLDER_NOT_FOUND\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tFORBIDDEN_DOMAIN: \"FORBIDDEN_DOMAIN\",\n\tFORBIDDEN_PATH: \"FORBIDDEN_PATH\",\n\tFORBIDDEN_KEY: \"FORBIDDEN_KEY\",\n\tFORCED_SNAPSHOT_RATE_LIMIT: \"FORCED_SNAPSHOT_RATE_LIMIT\",\n\tFREE_PLAN_NO_WEB_PUBLISH: \"FREE_PLAN_NO_WEB_PUBLISH\",\n\t/** 403 — the Free plan can no longer create applications or databases; a paid plan is required. */\n\tFREE_PLAN_SUSPENDED: \"FREE_PLAN_SUSPENDED\",\n\tINSTALLATION_NOT_FOUND: \"INSTALLATION_NOT_FOUND\",\n\tINSTALL_SHIELD_BLOCKED: \"INSTALL_SHIELD_BLOCKED\",\n\tINSTALL_TIMEOUT: \"INSTALL_TIMEOUT\",\n\tINSTALL_FAILED: \"INSTALL_FAILED\",\n\tINSTALL_CANCELLED: \"INSTALL_CANCELLED\",\n\tINSTALL_OUT_OF_MEMORY: \"INSTALL_OUT_OF_MEMORY\",\n\tINSTALL_QUEUE_FULL: \"INSTALL_QUEUE_FULL\",\n\tINSUFFICIENT_MEMORY: \"INSUFFICIENT_MEMORY\",\n\tINTERNAL_SERVER_ERROR: \"INTERNAL_SERVER_ERROR\",\n\tINVALID_CONFIG: \"INVALID_CONFIG\",\n\tINVALID_CUSTOM_DOMAIN_FORMAT: \"INVALID_CUSTOM_DOMAIN_FORMAT\",\n\tINVALID_HOSTNAME_FOR_APP: \"INVALID_HOSTNAME_FOR_APP\",\n\tINVALID_LANGUAGE: \"INVALID_LANGUAGE\",\n\tINVALID_MEMORY_FORMAT: \"INVALID_MEMORY_FORMAT\",\n\tINVALID_MONTHS: \"INVALID_MONTHS\",\n\tINVALID_OR_EXPIRED_CODE: \"INVALID_OR_EXPIRED_CODE\",\n\tINVALID_PARAMS: \"INVALID_PARAMS\",\n\tINVALID_PAYLOAD: \"INVALID_PAYLOAD\",\n\tINVALID_PATH: \"INVALID_PATH\",\n\tINVALID_PLAN: \"INVALID_PLAN\",\n\tINVALID_PLAN_NAME: \"INVALID_PLAN_NAME\",\n\tINVALID_RAM_LIMIT: \"INVALID_RAM_LIMIT\",\n\tINVALID_RANGE: \"INVALID_RANGE\",\n\tINVALID_SUBDOMAIN_FORMAT: \"INVALID_SUBDOMAIN_FORMAT\",\n\tINVALID_VERSION: \"INVALID_VERSION\",\n\tINVALID_ZIP: \"INVALID_ZIP\",\n\tINVALID_ZIP_STRUCTURE: \"INVALID_ZIP_STRUCTURE\",\n\tMAIN_FILE_NOT_FOUND: \"MAIN_FILE_NOT_FOUND\",\n\tMAX_APPS_REACHED: \"MAX_APPS_REACHED\",\n\tMAX_DATABASES_REACHED: \"MAX_DATABASES_REACHED\",\n\tMEMORY_BELOW_MINIMUM: \"MEMORY_BELOW_MINIMUM\",\n\tMEMORY_LIMIT_EXCEEDED: \"MEMORY_LIMIT_EXCEEDED\",\n\tMEMORY_MUST_BE_INTEGER: \"MEMORY_MUST_BE_INTEGER\",\n\tMEMORY_REQUIRED: \"MEMORY_REQUIRED\",\n\tMISSING_HEADERS: \"MISSING_HEADERS\",\n\tMISSING_PLAN_OR_MONTHS: \"MISSING_PLAN_OR_MONTHS\",\n\tMISSING_CONTENT: \"MISSING_CONTENT\",\n\tNOT_AN_UPGRADE: \"NOT_AN_UPGRADE\",\n\tNO_AUTHORIZED_PATHS: \"NO_AUTHORIZED_PATHS\",\n\tNO_CHANGES_PROVIDED: \"NO_CHANGES_PROVIDED\",\n\tNO_CUSTOM_DOMAIN: \"NO_CUSTOM_DOMAIN\",\n\tNO_FIELDS_TO_UPDATE: \"NO_FIELDS_TO_UPDATE\",\n\tNO_FILE_UPLOADED: \"NO_FILE_UPLOADED\",\n\tOPERATION_IN_PROGRESS: \"OPERATION_IN_PROGRESS\",\n\tORDER_NOT_FOUND: \"ORDER_NOT_FOUND\",\n\tORDER_NOT_PAID: \"ORDER_NOT_PAID\",\n\tORDER_NOT_PAYABLE: \"ORDER_NOT_PAYABLE\",\n\tORDER_NOT_REFUNDED: \"ORDER_NOT_REFUNDED\",\n\t/** 404 — the order has no payment receipt (unpaid, redeemed code or paid before receipts existed). */\n\tORDER_RECEIPT_UNAVAILABLE: \"ORDER_RECEIPT_UNAVAILABLE\",\n\tOWNER_APP_WITHOUT_LIMITS: \"OWNER_APP_WITHOUT_LIMITS\",\n\tPAYLOAD_TOO_LARGE: \"PAYLOAD_TOO_LARGE\",\n\t/** 409 — a folder in the path is an existing file (writing `app/x.js` when `app` is a file). */\n\tPATH_IS_FILE: \"PATH_IS_FILE\",\n\tPENDING_ORDER_LIMIT_REACHED: \"PENDING_ORDER_LIMIT_REACHED\",\n\tPAYMENT_METHOD_UNAVAILABLE: \"PAYMENT_METHOD_UNAVAILABLE\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: \"PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN\",\n\tPLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: \"PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH\",\n\tPLAN_MISMATCH_FOR_RENEWAL: \"PLAN_MISMATCH_FOR_RENEWAL\",\n\tPLAN_NOT_ALLOWED: \"PLAN_NOT_ALLOWED\",\n\tRATE_LIMIT_EXCEEDED: \"RATE_LIMIT_EXCEEDED\",\n\tREFUND_AMOUNT_EXCEEDS_PRICE: \"REFUND_AMOUNT_EXCEEDS_PRICE\",\n\tREPO_ALREADY_LINKED: \"REPO_ALREADY_LINKED\",\n\tRESTORE_COOLDOWN: \"RESTORE_COOLDOWN\",\n\tSNAPSHOT_ENGINE_MISMATCH: \"SNAPSHOT_ENGINE_MISMATCH\",\n\tSNAPSHOT_FAILED: \"SNAPSHOT_FAILED\",\n\tSNAPSHOT_IMPORT_FAILED: \"SNAPSHOT_IMPORT_FAILED\",\n\tSNAPSHOT_NOT_FOUND: \"SNAPSHOT_NOT_FOUND\",\n\tSNAPSHOT_RATE_LIMITED: \"SNAPSHOT_RATE_LIMITED\",\n\tSNAPSHOT_TYPE_MISMATCH: \"SNAPSHOT_TYPE_MISMATCH\",\n\tSNAPSHOT_TOO_LARGE: \"SNAPSHOT_TOO_LARGE\",\n\tSOURCE_CONFLICT: \"SOURCE_CONFLICT\",\n\tSOURCE_REQUIRED: \"SOURCE_REQUIRED\",\n\tSTORAGE_ABOVE_NEW_LIMIT: \"STORAGE_ABOVE_NEW_LIMIT\",\n\tSUBDOMAIN_CHANGE_RATE_LIMITED: \"SUBDOMAIN_CHANGE_RATE_LIMITED\",\n\tSUBDOMAIN_FORBIDDEN: \"SUBDOMAIN_FORBIDDEN\",\n\tSUBDOMAIN_TAKEN: \"SUBDOMAIN_TAKEN\",\n\t/** 400 — the CPF or CNPJ is not valid. */\n\tTAX_ID_INVALID: \"TAX_ID_INVALID\",\n\tTYPE_MISMATCH: \"TYPE_MISMATCH\",\n\tUSER_LIMITS_NOT_FOUND: \"USER_LIMITS_NOT_FOUND\",\n\tUSER_NOT_FOUND: \"USER_NOT_FOUND\",\n\tUSER_NOT_IN_WORKSPACE: \"USER_NOT_IN_WORKSPACE\",\n\tDATABASE_BANNED: \"DATABASE_BANNED\",\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tZIP_TOO_LARGE: \"ZIP_TOO_LARGE\",\n\tZIP_TOO_SMALL: \"ZIP_TOO_SMALL\",\n\tSTORAGE_FULL: \"STORAGE_FULL\",\n\tTARGET_IS_DIRECTORY: \"TARGET_IS_DIRECTORY\",\n\t...WORKSPACE_ERROR_CODES,\n} as const;\n\nexport const APIErrorCode = API_ERROR_CODES;\n\nexport type APIErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];\n","import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\nimport type { APIApplication, APIDatabase } from \"./index\";\n\n/**\n * Granular workspace permission. Display group in `WORKSPACE_PERMISSIONS`.\n * The owner (`owner_id`) has no entry here: owner-only actions (rename/delete the workspace,\n * 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":[]}
@@ -83,9 +83,32 @@ var API_ERROR_CODES = {
83
83
  APP_NOT_FOUND_IN_WORKSPACE: "APP_NOT_FOUND_IN_WORKSPACE",
84
84
  BUILD_FAILED: "BUILD_FAILED",
85
85
  BUILD_TIMEOUT: "BUILD_TIMEOUT",
86
+ /** 400 — billing details failed validation; the field is in `details.path`. */
87
+ BILLING_DETAILS_INVALID: "BILLING_DETAILS_INVALID",
88
+ /** 402 — the bank refused the card charge. */
89
+ CARD_DECLINED: "CARD_DECLINED",
90
+ /** 400 — the plan can only be paid by PIX. */
91
+ CARD_NOT_ALLOWED_FOR_PLAN: "CARD_NOT_ALLOWED_FOR_PLAN",
92
+ CARD_NOT_FOUND: "CARD_NOT_FOUND",
86
93
  CERTIFICATE_NOT_FOUND: "CERTIFICATE_NOT_FOUND",
87
94
  CLEANUP_LANGUAGE_SAME_AS_CURRENT: "CLEANUP_LANGUAGE_SAME_AS_CURRENT",
88
95
  CONTAINER_ALREADY_RUNNING: "CONTAINER_ALREADY_RUNNING",
96
+ /** 400 — no active coupon with this code. */
97
+ COUPON_INVALID: "COUPON_INVALID",
98
+ COUPON_INACTIVE: "COUPON_INACTIVE",
99
+ COUPON_NOT_STARTED: "COUPON_NOT_STARTED",
100
+ COUPON_EXPIRED: "COUPON_EXPIRED",
101
+ /** 400 — the coupon reached its total number of uses. */
102
+ COUPON_EXHAUSTED: "COUPON_EXHAUSTED",
103
+ /** 400 — the account already used this coupon as many times as allowed. */
104
+ COUPON_USER_LIMIT: "COUPON_USER_LIMIT",
105
+ /** 400 — the coupon is not available to this account. */
106
+ COUPON_AUDIENCE: "COUPON_AUDIENCE",
107
+ /** 400 — the coupon does not apply to this plan. */
108
+ COUPON_PLAN: "COUPON_PLAN",
109
+ /** 400 — the coupon does not apply to this billing period. */
110
+ COUPON_DURATION: "COUPON_DURATION",
111
+ COUPON_PAYMENT_METHOD: "COUPON_PAYMENT_METHOD",
89
112
  CUSTOM_DOMAIN_RECORD_NOT_FOUND: "CUSTOM_DOMAIN_RECORD_NOT_FOUND",
90
113
  CUSTOM_DOMAIN_REGISTRATION_FAILED: "CUSTOM_DOMAIN_REGISTRATION_FAILED",
91
114
  DAILY_QUOTA_EXCEEDED: "DAILY_QUOTA_EXCEEDED",
@@ -161,9 +184,14 @@ var API_ERROR_CODES = {
161
184
  ORDER_NOT_PAID: "ORDER_NOT_PAID",
162
185
  ORDER_NOT_PAYABLE: "ORDER_NOT_PAYABLE",
163
186
  ORDER_NOT_REFUNDED: "ORDER_NOT_REFUNDED",
187
+ /** 404 — the order has no payment receipt (unpaid, redeemed code or paid before receipts existed). */
188
+ ORDER_RECEIPT_UNAVAILABLE: "ORDER_RECEIPT_UNAVAILABLE",
164
189
  OWNER_APP_WITHOUT_LIMITS: "OWNER_APP_WITHOUT_LIMITS",
165
190
  PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE",
191
+ /** 409 — a folder in the path is an existing file (writing `app/x.js` when `app` is a file). */
192
+ PATH_IS_FILE: "PATH_IS_FILE",
166
193
  PENDING_ORDER_LIMIT_REACHED: "PENDING_ORDER_LIMIT_REACHED",
194
+ PAYMENT_METHOD_UNAVAILABLE: "PAYMENT_METHOD_UNAVAILABLE",
167
195
  PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN",
168
196
  PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN",
169
197
  PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: "PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH",
@@ -186,6 +214,8 @@ var API_ERROR_CODES = {
186
214
  SUBDOMAIN_CHANGE_RATE_LIMITED: "SUBDOMAIN_CHANGE_RATE_LIMITED",
187
215
  SUBDOMAIN_FORBIDDEN: "SUBDOMAIN_FORBIDDEN",
188
216
  SUBDOMAIN_TAKEN: "SUBDOMAIN_TAKEN",
217
+ /** 400 — the CPF or CNPJ is not valid. */
218
+ TAX_ID_INVALID: "TAX_ID_INVALID",
189
219
  TYPE_MISMATCH: "TYPE_MISMATCH",
190
220
  USER_LIMITS_NOT_FOUND: "USER_LIMITS_NOT_FOUND",
191
221
  USER_NOT_FOUND: "USER_NOT_FOUND",
@@ -0,0 +1,66 @@
1
+ import { ISODateString } from '../../common/v1.js';
2
+ import './api-error.js';
3
+
4
+ /** Postal address used for billing. `country` is a two-letter ISO code (`"BR"`). */
5
+ interface APIBillingAddress {
6
+ line1: string;
7
+ line2: string | null;
8
+ city: string;
9
+ /** Two-letter state code in Brazil (`"CE"`); free text elsewhere. */
10
+ state: string | null;
11
+ postal_code: string | null;
12
+ country: string;
13
+ }
14
+ /** Brazilian tax document kind. */
15
+ type BillingTaxIdType = "cpf" | "cnpj";
16
+ declare const BillingTaxIdType: {
17
+ readonly CPF: "cpf";
18
+ readonly CNPJ: "cnpj";
19
+ };
20
+ /** Tax document as returned by the API: never the full number. */
21
+ interface APIBillingTaxId {
22
+ type: BillingTaxIdType;
23
+ /** Masked, for example `"CPF ••• 47"`. */
24
+ masked: string;
25
+ }
26
+ /**
27
+ * Billing details of the logged-in account, used on receipts, invoices and fraud checks.
28
+ * Dashboard session only.
29
+ */
30
+ interface APIBillingDetails {
31
+ name: string | null;
32
+ address: APIBillingAddress | null;
33
+ /** E.164, for example `"+5585999990000"`. */
34
+ phone: string | null;
35
+ tax_id: APIBillingTaxId | null;
36
+ /** `true` when every required field is filled. */
37
+ complete: boolean;
38
+ }
39
+ /** Saved card of the logged-in account. Dashboard session only. */
40
+ interface APIBillingCard {
41
+ id: string;
42
+ /** Card brand as reported by the card network, for example `"visa"` or `"mastercard"`. */
43
+ brand: string;
44
+ last4: string;
45
+ exp_month: number;
46
+ exp_year: number;
47
+ /** The plan renews automatically on the default card. */
48
+ is_default: boolean;
49
+ created_at: ISODateString;
50
+ }
51
+ /** Automatic renewal of the paid plan on the default card. Dashboard session only. */
52
+ interface APIBillingRenewal {
53
+ /** Preference of the account. `false` means the plan simply expires on its date; the saved cards are kept. */
54
+ auto_renew: boolean;
55
+ /** Plan expiry date, or `null` when the plan has none. */
56
+ renews_at: ISODateString | null;
57
+ /** Default card the renewal would charge, or `null` without one. */
58
+ card: {
59
+ brand: string;
60
+ last4: string;
61
+ } | null;
62
+ /** `true` when the current plan can renew on a card (paid plan, not Economy) and a default card exists. */
63
+ eligible: boolean;
64
+ }
65
+
66
+ export { type APIBillingAddress, type APIBillingCard, type APIBillingDetails, type APIBillingRenewal, type APIBillingTaxId, BillingTaxIdType };
@@ -0,0 +1,34 @@
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/billing.ts
21
+ var billing_exports = {};
22
+ __export(billing_exports, {
23
+ BillingTaxIdType: () => BillingTaxIdType
24
+ });
25
+ module.exports = __toCommonJS(billing_exports);
26
+ var BillingTaxIdType = {
27
+ CPF: "cpf",
28
+ CNPJ: "cnpj"
29
+ };
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ BillingTaxIdType
33
+ });
34
+ //# sourceMappingURL=billing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["billing.ts"],"sourcesContent":["import type { ISODateString } from \"../../v1\";\n\n/** Postal address used for billing. `country` is a two-letter ISO code (`\"BR\"`). */\nexport interface APIBillingAddress {\n\tline1: string;\n\tline2: string | null;\n\tcity: string;\n\t/** Two-letter state code in Brazil (`\"CE\"`); free text elsewhere. */\n\tstate: string | null;\n\tpostal_code: string | null;\n\tcountry: string;\n}\n\n/** Brazilian tax document kind. */\nexport type BillingTaxIdType = \"cpf\" | \"cnpj\";\nexport const BillingTaxIdType = {\n\tCPF: \"cpf\",\n\tCNPJ: \"cnpj\",\n} as const;\n\n/** Tax document as returned by the API: never the full number. */\nexport interface APIBillingTaxId {\n\ttype: BillingTaxIdType;\n\t/** Masked, for example `\"CPF ••• 47\"`. */\n\tmasked: string;\n}\n\n/**\n * Billing details of the logged-in account, used on receipts, invoices and fraud checks.\n * Dashboard session only.\n */\nexport interface APIBillingDetails {\n\tname: string | null;\n\taddress: APIBillingAddress | null;\n\t/** E.164, for example `\"+5585999990000\"`. */\n\tphone: string | null;\n\ttax_id: APIBillingTaxId | null;\n\t/** `true` when every required field is filled. */\n\tcomplete: boolean;\n}\n\n/** Saved card of the logged-in account. Dashboard session only. */\nexport interface APIBillingCard {\n\tid: string;\n\t/** Card brand as reported by the card network, for example `\"visa\"` or `\"mastercard\"`. */\n\tbrand: string;\n\tlast4: string;\n\texp_month: number;\n\texp_year: number;\n\t/** The plan renews automatically on the default card. */\n\tis_default: boolean;\n\tcreated_at: ISODateString;\n}\n\n/** Automatic renewal of the paid plan on the default card. Dashboard session only. */\nexport interface APIBillingRenewal {\n\t/** Preference of the account. `false` means the plan simply expires on its date; the saved cards are kept. */\n\tauto_renew: boolean;\n\t/** Plan expiry date, or `null` when the plan has none. */\n\trenews_at: ISODateString | null;\n\t/** Default card the renewal would charge, or `null` without one. */\n\tcard: { brand: string; last4: string } | null;\n\t/** `true` when the current plan can renew on a card (paid plan, not Economy) and a default card exists. */\n\teligible: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,IAAM,mBAAmB;AAAA,EAC/B,KAAK;AAAA,EACL,MAAM;AACP;","names":[]}
@@ -0,0 +1,9 @@
1
+ // payloads/v1/billing.ts
2
+ var BillingTaxIdType = {
3
+ CPF: "cpf",
4
+ CNPJ: "cnpj"
5
+ };
6
+ export {
7
+ BillingTaxIdType
8
+ };
9
+ //# sourceMappingURL=billing.mjs.map
@@ -2,11 +2,12 @@ export { APIActivity, ActivityOrigin, ActivityStatus, ActivityTargetType } from
2
2
  export { APIApiKey, APIApiKeyCreated, APIApiKeyPreset, APIApiKeyRoute, APIApiKeyRouteMethod, APIApiKeyScope, APIApiKeyScopeEntry, API_KEY_MAX_ALLOWED_IPS, API_KEY_MAX_PER_USER, API_KEY_NAME_MAX_LENGTH, API_KEY_SCOPES, API_KEY_SCOPE_LIST, apiKeyPresetScopes } from './api-key.js';
3
3
  export { APIErrorCode, API_ERROR_CODES } from './api-error.js';
4
4
  export { APIApplication, APIApplicationConfig, APIApplicationCustomDomain, APIApplicationDeployment, APIApplicationDnsRecord, APIApplicationEnvironment, APIApplicationFile, APIApplicationFileContent, APIApplicationFileTree, APIApplicationFileUpload, APIApplicationGithub, APIApplicationMetric, APIApplicationNetwork, APIApplicationOperationResponse, APIApplicationRealtimeEvent, APIApplicationRuntime, APIApplicationRuntimes, APIApplicationScanSuggestions, APIApplicationShieldCooldown, APIApplicationStatus, APIApplicationStatusShort, APIApplicationSubdomain, APIApplicationWebPublish, APIApplicationWebhook, APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationStatus, ApplicationType, ApplicationVersion, ShieldIncidentDirection, ShieldIncidentReason } from './application.js';
5
+ export { APIBillingAddress, APIBillingCard, APIBillingDetails, APIBillingRenewal, APIBillingTaxId, BillingTaxIdType } from './billing.js';
5
6
  export { APIDatabase, APIDatabaseCertificate, APIDatabaseMetrics, APIDatabaseNetwork, APIDatabaseOperationResponse, APIDatabasePasswordReset, APIDatabaseStatus, APIDatabaseStatusShort, DatabaseCluster, DatabaseStatus, DatabaseType } from './database.js';
6
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 './database-data.js';
7
8
  export { APINotification, LocalizedContent, NotificationImportance, NotificationType } from './notification.js';
8
9
  export { APIOAuthClient, APIOAuthCodeChallengeMethod, APIOAuthConsentDecision } from './oauth.js';
9
- export { APIOrderCreateResponse, APIOrderDiscount, APIOrderListItem, APIOrderPixPayment, APIOrderStatus, OrderProvider, OrderStatus, OrderType } from './orders.js';
10
+ export { APIOrderCardPayment, APIOrderCouponPreview, APIOrderCreateResponse, APIOrderDiscount, APIOrderListItem, APIOrderPixPayment, APIOrderReceipt, APIOrderStatus, OrderCardPaymentStatus, OrderProvider, OrderStatus, OrderType } from './orders.js';
10
11
  export { APIRedeemResponse } from './redeem.js';
11
12
  export { APIGroupedResourceSnapshots, APIResourceSnapshot, APISnapshotRestoreResponse, ResourceType, SnapshotResourceType, SnapshotScope } from './snapshot.js';
12
13
  export { APIStatus, StatusType } from './status.js';
@@ -44,6 +44,7 @@ __export(v1_exports, {
44
44
  ApplicationStatus: () => ApplicationStatus,
45
45
  ApplicationType: () => ApplicationType,
46
46
  ApplicationVersion: () => ApplicationVersion,
47
+ BillingTaxIdType: () => BillingTaxIdType,
47
48
  DatabaseCluster: () => DatabaseCluster,
48
49
  DatabaseFilterOperator: () => DatabaseFilterOperator,
49
50
  DatabaseRedisKeyType: () => DatabaseRedisKeyType,
@@ -53,6 +54,7 @@ __export(v1_exports, {
53
54
  DatabaseType: () => DatabaseType,
54
55
  NotificationImportance: () => NotificationImportance,
55
56
  NotificationType: () => NotificationType,
57
+ OrderCardPaymentStatus: () => OrderCardPaymentStatus,
56
58
  OrderProvider: () => OrderProvider,
57
59
  OrderStatus: () => OrderStatus,
58
60
  OrderType: () => OrderType,
@@ -463,9 +465,32 @@ var API_ERROR_CODES = {
463
465
  APP_NOT_FOUND_IN_WORKSPACE: "APP_NOT_FOUND_IN_WORKSPACE",
464
466
  BUILD_FAILED: "BUILD_FAILED",
465
467
  BUILD_TIMEOUT: "BUILD_TIMEOUT",
468
+ /** 400 — billing details failed validation; the field is in `details.path`. */
469
+ BILLING_DETAILS_INVALID: "BILLING_DETAILS_INVALID",
470
+ /** 402 — the bank refused the card charge. */
471
+ CARD_DECLINED: "CARD_DECLINED",
472
+ /** 400 — the plan can only be paid by PIX. */
473
+ CARD_NOT_ALLOWED_FOR_PLAN: "CARD_NOT_ALLOWED_FOR_PLAN",
474
+ CARD_NOT_FOUND: "CARD_NOT_FOUND",
466
475
  CERTIFICATE_NOT_FOUND: "CERTIFICATE_NOT_FOUND",
467
476
  CLEANUP_LANGUAGE_SAME_AS_CURRENT: "CLEANUP_LANGUAGE_SAME_AS_CURRENT",
468
477
  CONTAINER_ALREADY_RUNNING: "CONTAINER_ALREADY_RUNNING",
478
+ /** 400 — no active coupon with this code. */
479
+ COUPON_INVALID: "COUPON_INVALID",
480
+ COUPON_INACTIVE: "COUPON_INACTIVE",
481
+ COUPON_NOT_STARTED: "COUPON_NOT_STARTED",
482
+ COUPON_EXPIRED: "COUPON_EXPIRED",
483
+ /** 400 — the coupon reached its total number of uses. */
484
+ COUPON_EXHAUSTED: "COUPON_EXHAUSTED",
485
+ /** 400 — the account already used this coupon as many times as allowed. */
486
+ COUPON_USER_LIMIT: "COUPON_USER_LIMIT",
487
+ /** 400 — the coupon is not available to this account. */
488
+ COUPON_AUDIENCE: "COUPON_AUDIENCE",
489
+ /** 400 — the coupon does not apply to this plan. */
490
+ COUPON_PLAN: "COUPON_PLAN",
491
+ /** 400 — the coupon does not apply to this billing period. */
492
+ COUPON_DURATION: "COUPON_DURATION",
493
+ COUPON_PAYMENT_METHOD: "COUPON_PAYMENT_METHOD",
469
494
  CUSTOM_DOMAIN_RECORD_NOT_FOUND: "CUSTOM_DOMAIN_RECORD_NOT_FOUND",
470
495
  CUSTOM_DOMAIN_REGISTRATION_FAILED: "CUSTOM_DOMAIN_REGISTRATION_FAILED",
471
496
  DAILY_QUOTA_EXCEEDED: "DAILY_QUOTA_EXCEEDED",
@@ -541,9 +566,14 @@ var API_ERROR_CODES = {
541
566
  ORDER_NOT_PAID: "ORDER_NOT_PAID",
542
567
  ORDER_NOT_PAYABLE: "ORDER_NOT_PAYABLE",
543
568
  ORDER_NOT_REFUNDED: "ORDER_NOT_REFUNDED",
569
+ /** 404 — the order has no payment receipt (unpaid, redeemed code or paid before receipts existed). */
570
+ ORDER_RECEIPT_UNAVAILABLE: "ORDER_RECEIPT_UNAVAILABLE",
544
571
  OWNER_APP_WITHOUT_LIMITS: "OWNER_APP_WITHOUT_LIMITS",
545
572
  PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE",
573
+ /** 409 — a folder in the path is an existing file (writing `app/x.js` when `app` is a file). */
574
+ PATH_IS_FILE: "PATH_IS_FILE",
546
575
  PENDING_ORDER_LIMIT_REACHED: "PENDING_ORDER_LIMIT_REACHED",
576
+ PAYMENT_METHOD_UNAVAILABLE: "PAYMENT_METHOD_UNAVAILABLE",
547
577
  PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN",
548
578
  PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN",
549
579
  PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: "PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH",
@@ -566,6 +596,8 @@ var API_ERROR_CODES = {
566
596
  SUBDOMAIN_CHANGE_RATE_LIMITED: "SUBDOMAIN_CHANGE_RATE_LIMITED",
567
597
  SUBDOMAIN_FORBIDDEN: "SUBDOMAIN_FORBIDDEN",
568
598
  SUBDOMAIN_TAKEN: "SUBDOMAIN_TAKEN",
599
+ /** 400 — the CPF or CNPJ is not valid. */
600
+ TAX_ID_INVALID: "TAX_ID_INVALID",
569
601
  TYPE_MISMATCH: "TYPE_MISMATCH",
570
602
  USER_LIMITS_NOT_FOUND: "USER_LIMITS_NOT_FOUND",
571
603
  USER_NOT_FOUND: "USER_NOT_FOUND",
@@ -640,6 +672,12 @@ var ApplicationRealtimeEventType = {
640
672
  HEARTBEAT: "heartbeat"
641
673
  };
642
674
 
675
+ // payloads/v1/billing.ts
676
+ var BillingTaxIdType = {
677
+ CPF: "cpf",
678
+ CNPJ: "cnpj"
679
+ };
680
+
643
681
  // payloads/v1/database.ts
644
682
  var DatabaseType = {
645
683
  POSTGRESQL: 1,
@@ -716,8 +754,14 @@ var OrderType = {
716
754
  };
717
755
  var OrderProvider = {
718
756
  PIX: "pix",
757
+ CARD: "card",
719
758
  REDEEM_CODE: "redeem_code"
720
759
  };
760
+ var OrderCardPaymentStatus = {
761
+ SUCCEEDED: "succeeded",
762
+ REQUIRES_ACTION: "requires_action",
763
+ PROCESSING: "processing"
764
+ };
721
765
 
722
766
  // payloads/v1/snapshot.ts
723
767
  var ResourceType = {
@@ -768,6 +812,7 @@ var UserLanguage = {
768
812
  ApplicationStatus,
769
813
  ApplicationType,
770
814
  ApplicationVersion,
815
+ BillingTaxIdType,
771
816
  DatabaseCluster,
772
817
  DatabaseFilterOperator,
773
818
  DatabaseRedisKeyType,
@@ -777,6 +822,7 @@ var UserLanguage = {
777
822
  DatabaseType,
778
823
  NotificationImportance,
779
824
  NotificationType,
825
+ OrderCardPaymentStatus,
780
826
  OrderProvider,
781
827
  OrderStatus,
782
828
  OrderType,