From e7fe28e9e629c990ffcc55a28bf20f81b3d560cb Mon Sep 17 00:00:00 2001 From: jgoux <1443499+jgoux@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:03:01 +0000 Subject: [PATCH 1/3] chore(api): sync Management API OpenAPI spec --- packages/api/src/generated/contracts.ts | 2804 ++++++++++++++++------- packages/api/src/generated/openapi.json | 2021 ++++++++-------- 2 files changed, 3003 insertions(+), 1822 deletions(-) diff --git a/packages/api/src/generated/contracts.ts b/packages/api/src/generated/contracts.ts index dc45a03138..e3f946eb3d 100644 --- a/packages/api/src/generated/contracts.ts +++ b/packages/api/src/generated/contracts.ts @@ -4,7 +4,9 @@ import * as Schema from "effect/Schema"; export const BranchResponse = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), name: Schema.String, @@ -12,7 +14,12 @@ export const BranchResponse = Schema.Struct({ parent_project_ref: Schema.String, is_default: Schema.Boolean, git_branch: Schema.optionalKey(Schema.String), - pr_number: Schema.optionalKey(Schema.Number.annotate({ format: "int32" }).check(Schema.isInt())), + pr_number: Schema.optionalKey( + Schema.Number.annotate({ format: "int32" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", @@ -29,12 +36,40 @@ export const BranchResponse = Schema.Struct({ ]).annotate({ description: "This field is deprecated. List action runs to get branch status instead.", }), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), - review_requested_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + review_requested_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), with_data: Schema.Boolean, notify_url: Schema.optionalKey(Schema.String.annotate({ format: "uri" })), - deletion_scheduled_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + deletion_scheduled_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), preview_project_status: Schema.optionalKey( Schema.Literals([ "INACTIVE", @@ -115,13 +150,34 @@ export const ApiKeyResponse = Schema.Struct({ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), hash: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), inserted_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), updated_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), }); export const SecretResponse = Schema.Struct({ @@ -143,30 +199,31 @@ export const V1ServiceHealthResponse = Schema.Struct({ healthy: Schema.Boolean.annotate({ description: "Deprecated. Use `status` instead." }), status: Schema.Literals(["COMING_UP", "ACTIVE_HEALTHY", "UNHEALTHY"]), info: Schema.optionalKey( - Schema.Union( - [ - Schema.Struct({ - name: Schema.Literal("GoTrue"), - version: Schema.String, - description: Schema.String, - }), - Schema.Struct({ - healthy: Schema.Boolean.annotate({ description: "Deprecated. Use `status` instead." }), - db_connected: Schema.Boolean, - replication_connected: Schema.Boolean, - connected_cluster: Schema.Number.check(Schema.isInt()), - }), - Schema.Struct({ db_schema: Schema.String }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.Struct({ + name: Schema.Literal("GoTrue"), + version: Schema.String, + description: Schema.String, + }), + Schema.Struct({ + healthy: Schema.Boolean.annotate({ description: "Deprecated. Use `status` instead." }), + db_connected: Schema.Boolean, + replication_connected: Schema.Boolean, + connected_cluster: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + }), + Schema.Struct({ db_schema: Schema.String }), + ]), ), error: Schema.optionalKey(Schema.String), }); export const ThirdPartyAuth = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), type: Schema.String, @@ -183,9 +240,17 @@ export const FunctionResponse = Schema.Struct({ slug: Schema.String, name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), - created_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updated_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -206,12 +271,24 @@ export const SupavisorConfigResponse = Schema.Struct({ is_using_scram_auth: Schema.Boolean, db_user: Schema.String, db_host: Schema.String, - db_port: Schema.Number.check(Schema.isInt()), + db_port: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), db_name: Schema.String, connection_string: Schema.String, connectionString: Schema.String.annotate({ description: "Use connection_string instead" }), - default_pool_size: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - max_client_conn: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + default_pool_size: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + max_client_conn: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), pool_mode: Schema.Literals(["transaction", "session"]), }); export const V1OrganizationMemberResponse = Schema.Struct({ @@ -222,6 +299,43 @@ export const V1OrganizationMemberResponse = Schema.Struct({ mfa_enabled: Schema.Boolean, avatar_url: Schema.Union([Schema.String, Schema.Null]), }); +// recursive definitions +export const UpdateCustomHostnameResponseJsonValue = Schema.Union([ + Schema.Union([ + Schema.Union([Schema.String, Schema.Number.check(Schema.isFinite()), Schema.Boolean]), + Schema.Null, + ]), + Schema.Array( + Schema.suspend( + (): Schema.Codec => + UpdateCustomHostnameResponseJsonValue, + ), + ), + Schema.Record( + Schema.String, + Schema.suspend( + (): Schema.Codec => + UpdateCustomHostnameResponseJsonValue, + ), + ), +]).annotate({ description: "Any JSON-serializable value" }); +export const ListProjectAddonsResponseJsonValue = Schema.Union([ + Schema.Union([ + Schema.Union([Schema.String, Schema.Number.check(Schema.isFinite()), Schema.Boolean]), + Schema.Null, + ]), + Schema.Array( + Schema.suspend( + (): Schema.Codec => ListProjectAddonsResponseJsonValue, + ), + ), + Schema.Record( + Schema.String, + Schema.suspend( + (): Schema.Codec => ListProjectAddonsResponseJsonValue, + ), + ), +]).annotate({ description: "Any JSON-serializable value" }); // binary input helpers export const BinaryInput = Schema.Union([ Schema.Uint8Array, @@ -233,14 +347,24 @@ export const V1AcceptInviteExternalJitAccessInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - email: Schema.String.annotate({ format: "email" }).check(Schema.isMinLength(1)), + email: Schema.String.annotate({ format: "email" }) + .check(Schema.isMinLength(1)) + .check( + Schema.isPattern( + new RegExp( + "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + ), + ), + ), token: Schema.String.check(Schema.isMinLength(1)), }); export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ user_id: Schema.optionalKey( Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), ), @@ -250,9 +374,31 @@ export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), ), }), ), @@ -278,8 +424,8 @@ export const V1ActivateCustomHostnameOutput = Schema.Struct({ custom_hostname: Schema.optionalKey(Schema.String), data: Schema.Struct({ success: Schema.Boolean, - errors: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), - messages: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), + errors: Schema.Array(UpdateCustomHostnameResponseJsonValue), + messages: Schema.Array(UpdateCustomHostnameResponseJsonValue), result: Schema.Struct({ id: Schema.String, hostname: Schema.String, @@ -323,34 +469,31 @@ export const V1ApplyProjectAddonInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - addon_variant: Schema.Union( - [ - Schema.Literals([ - "ci_micro", - "ci_small", - "ci_medium", - "ci_large", - "ci_xlarge", - "ci_2xlarge", - "ci_4xlarge", - "ci_8xlarge", - "ci_12xlarge", - "ci_16xlarge", - "ci_24xlarge", - "ci_24xlarge_optimized_cpu", - "ci_24xlarge_optimized_memory", - "ci_24xlarge_high_memory", - "ci_48xlarge", - "ci_48xlarge_optimized_cpu", - "ci_48xlarge_optimized_memory", - "ci_48xlarge_high_memory", - ]), - Schema.Literal("cd_default"), - Schema.Literals(["pitr_7", "pitr_14", "pitr_28"]), - Schema.Literal("ipv4_default"), - ], - { mode: "oneOf" }, - ), + addon_variant: Schema.Union([ + Schema.Literals([ + "ci_micro", + "ci_small", + "ci_medium", + "ci_large", + "ci_xlarge", + "ci_2xlarge", + "ci_4xlarge", + "ci_8xlarge", + "ci_12xlarge", + "ci_16xlarge", + "ci_24xlarge", + "ci_24xlarge_optimized_cpu", + "ci_24xlarge_optimized_memory", + "ci_24xlarge_high_memory", + "ci_48xlarge", + "ci_48xlarge_optimized_cpu", + "ci_48xlarge_optimized_memory", + "ci_48xlarge_high_memory", + ]), + Schema.Literal("cd_default"), + Schema.Literals(["pitr_7", "pitr_14", "pitr_28"]), + Schema.Literal("ipv4_default"), + ]), addon_type: Schema.Literals([ "custom_domain", "compute_instance", @@ -367,12 +510,29 @@ export const V1AuthorizeJitAccessInput = Schema.Struct({ .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), role: Schema.String.check(Schema.isMinLength(1)), - rhost: Schema.String.check(Schema.isMinLength(1)), + rhost: Schema.Union([ + Schema.String.annotate({ format: "ipv4" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$", + ), + ), + ), + Schema.String.annotate({ format: "ipv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$", + ), + ), + ), + ]), }); export const V1AuthorizeJitAccessOutput = Schema.Struct({ user_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), user_role: Schema.Struct({ @@ -380,8 +540,32 @@ export const V1AuthorizeJitAccessOutput = Schema.Struct({ expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), - allowed_cidrs_v6: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), + allowed_cidrs_v6: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), + ), }), ), branches_only: Schema.optionalKey(Schema.Boolean), @@ -390,7 +574,9 @@ export const V1AuthorizeJitAccessOutput = Schema.Struct({ export const V1AuthorizeUserInput = Schema.Struct({ client_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), response_type: Schema.Literals(["code", "token", "id_token token"]), @@ -437,9 +623,14 @@ export const V1BulkUpdateFunctionsInput = Schema.Struct({ slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$"))), name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), created_at: Schema.optionalKey( - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), @@ -456,9 +647,17 @@ export const V1BulkUpdateFunctionsOutput = Schema.Struct({ slug: Schema.String, name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), - created_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updated_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -545,7 +744,9 @@ export const V1CreateABranchInput = Schema.Struct({ export const V1CreateABranchOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), name: Schema.String, @@ -553,7 +754,12 @@ export const V1CreateABranchOutput = Schema.Struct({ parent_project_ref: Schema.String, is_default: Schema.Boolean, git_branch: Schema.optionalKey(Schema.String), - pr_number: Schema.optionalKey(Schema.Number.annotate({ format: "int32" }).check(Schema.isInt())), + pr_number: Schema.optionalKey( + Schema.Number.annotate({ format: "int32" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", @@ -570,12 +776,40 @@ export const V1CreateABranchOutput = Schema.Struct({ ]).annotate({ description: "This field is deprecated. List action runs to get branch status instead.", }), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), - review_requested_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + review_requested_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), with_data: Schema.Boolean, notify_url: Schema.optionalKey(Schema.String.annotate({ format: "uri" })), - deletion_scheduled_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + deletion_scheduled_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), preview_project_status: Schema.optionalKey( Schema.Literals([ "INACTIVE", @@ -602,8 +836,8 @@ export const V1CreateAFunctionInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), slug: Schema.optionalKey(Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")))), name: Schema.optionalKey(Schema.String), - verify_jwt: Schema.optionalKey(Schema.Boolean), - import_map: Schema.optionalKey(Schema.Boolean), + verify_jwt: Schema.optionalKey(Schema.String), + import_map: Schema.optionalKey(Schema.String), entrypoint_path: Schema.optionalKey(Schema.String), import_map_path: Schema.optionalKey(Schema.String), ezbr_sha256: Schema.optionalKey(Schema.String), @@ -614,9 +848,17 @@ export const V1CreateAFunctionOutput = Schema.Struct({ slug: Schema.String, name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), - created_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updated_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -743,6 +985,8 @@ export const V1CreateAProjectInput = Schema.Struct({ format: "uri", }), ), + release_channel: Schema.optionalKey(Schema.Null), + postgres_engine: Schema.optionalKey(Schema.Null), high_availability: Schema.optionalKey( Schema.Boolean.annotate({ description: "[Experimental] Whether to enable high availability for the project.", @@ -798,15 +1042,12 @@ export const V1CreateASsoProviderInput = Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), default: Schema.optionalKey( - Schema.Union( - [ - Schema.Struct({}), - Schema.Number.check(Schema.isFinite()), - Schema.String, - Schema.Boolean, - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.Struct({}), + Schema.Number.check(Schema.isFinite()), + Schema.String, + Schema.Boolean, + ]), ), array: Schema.optionalKey(Schema.Boolean), }), @@ -891,14 +1132,28 @@ export const V1CreateLegacySigningKeyInput = Schema.Struct({ export const V1CreateLegacySigningKeyOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }); export const V1CreateLoginRoleInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -911,20 +1166,24 @@ export const V1CreateLoginRoleOutput = Schema.Struct({ password: Schema.String.check(Schema.isMinLength(1)), ttl_seconds: Schema.Number.annotate({ format: "int64" }) .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), + .check(Schema.isGreaterThanOrEqualTo(1)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }); export const V1CreateProjectApiKeyInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - reveal: Schema.optionalKey(Schema.Boolean), + reveal: Schema.optionalKey(Schema.String), type: Schema.Literals(["publishable", "secret"]), name: Schema.String.check(Schema.isMinLength(4)) .check(Schema.isMaxLength(64)) .check(Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$"))), description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), }); export const V1CreateProjectApiKeyOutput = Schema.Struct({ @@ -941,13 +1200,34 @@ export const V1CreateProjectApiKeyOutput = Schema.Struct({ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), hash: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), inserted_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), updated_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), }); export const V1CreateProjectClaimTokenInput = Schema.Struct({ @@ -962,7 +1242,9 @@ export const V1CreateProjectClaimTokenOutput = Schema.Struct({ created_at: Schema.String, created_by: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -980,7 +1262,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), ), @@ -1008,7 +1290,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), ), @@ -1032,7 +1314,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), ), @@ -1055,7 +1337,7 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), ), @@ -1079,14 +1361,28 @@ export const V1CreateProjectSigningKeyInput = Schema.Struct({ export const V1CreateProjectSigningKeyOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }); export const V1CreateProjectTpaIntegrationInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -1099,7 +1395,9 @@ export const V1CreateProjectTpaIntegrationInput = Schema.Struct({ export const V1CreateProjectTpaIntegrationOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), type: Schema.String, @@ -1120,7 +1418,16 @@ export const V1CreateRestorePointInput = Schema.Struct({ export const V1CreateRestorePointOutput = Schema.Struct({ name: Schema.String, status: Schema.Literals(["AVAILABLE", "PENDING", "REMOVED", "FAILED"]), - completed_on: Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + completed_on: Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), }); export const V1DeactivateVanitySubdomainConfigInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -1131,26 +1438,23 @@ export const V1DeleteHostnameConfigInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - remove_addon: Schema.optionalKey(Schema.Boolean), + remove_addon: Schema.optionalKey(Schema.String), }); export const V1DeleteABranchInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), - force: Schema.optionalKey(Schema.Boolean), + ), + ]), + force: Schema.optionalKey(Schema.String), }); export const V1DeleteABranchOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1DeleteAFunctionInput = Schema.Struct({ @@ -1165,7 +1469,9 @@ export const V1DeleteAProjectInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1DeleteAProjectOutput = Schema.Struct({ - id: Schema.Number.check(Schema.isInt()), + id: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), ref: Schema.String, name: Schema.String, }); @@ -1175,7 +1481,9 @@ export const V1DeleteASsoProviderInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), provider_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -1236,7 +1544,9 @@ export const V1DeleteInviteExternalJitAccessInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), invite_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -1246,7 +1556,9 @@ export const V1DeleteJitAccessInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), user_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -1276,11 +1588,13 @@ export const V1DeleteProjectApiKeyInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), - reveal: Schema.optionalKey(Schema.Boolean), - was_compromised: Schema.optionalKey(Schema.Boolean), + reveal: Schema.optionalKey(Schema.String), + was_compromised: Schema.optionalKey(Schema.String), reason: Schema.optionalKey(Schema.String), }); export const V1DeleteProjectApiKeyOutput = Schema.Struct({ @@ -1297,13 +1611,34 @@ export const V1DeleteProjectApiKeyOutput = Schema.Struct({ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), hash: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), inserted_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), updated_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), }); export const V1DeleteProjectClaimTokenInput = Schema.Struct({ @@ -1317,14 +1652,18 @@ export const V1DeleteProjectTpaIntegrationInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), tpa_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); export const V1DeleteProjectTpaIntegrationOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), type: Schema.String, @@ -1343,9 +1682,9 @@ export const V1DeployAFunctionInput = Schema.Struct({ slug: Schema.optionalKey( Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$"))), ), - bundleOnly: Schema.optionalKey(Schema.Boolean), + bundleOnly: Schema.optionalKey(Schema.String), body: Schema.Struct({ - file: Schema.optionalKey(Schema.Array(BinaryInput)), + file: Schema.Array(BinaryInput), metadata: Schema.Struct({ entrypoint_path: Schema.String, import_map_path: Schema.optionalKey(Schema.String), @@ -1360,9 +1699,21 @@ export const V1DeployAFunctionOutput = Schema.Struct({ slug: Schema.String, name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), - created_at: Schema.optionalKey(Schema.Number.annotate({ format: "int64" }).check(Schema.isInt())), - updated_at: Schema.optionalKey(Schema.Number.annotate({ format: "int64" }).check(Schema.isInt())), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + created_at: Schema.optionalKey( + Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), + updated_at: Schema.optionalKey( + Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -1370,24 +1721,21 @@ export const V1DeployAFunctionOutput = Schema.Struct({ ezbr_sha256: Schema.optionalKey(Schema.String), }); export const V1DiffABranchInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), included_schemas: Schema.optionalKey(Schema.String), - pgdelta: Schema.optionalKey(Schema.Boolean), + pgdelta: Schema.optionalKey(Schema.String), }); export const V1DiffABranchOutput = Schema.String; export const V1DisablePreviewBranchingInput = Schema.Struct({ @@ -1418,7 +1766,7 @@ export const V1ExchangeOauthTokenInput = Schema.Struct({ Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), ), @@ -1451,7 +1799,9 @@ export const V1ExchangeOauthTokenOutput = Schema.Struct({ "The `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type issues access tokens only, no refresh token is returned and the token cannot be revoked via `/v1/oauth/revoke`.", }), ), - expires_in: Schema.Number.check(Schema.isInt()), + expires_in: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), token_type: Schema.Literal("Bearer"), }); export const V1GenerateTypescriptTypesInput = Schema.Struct({ @@ -1470,7 +1820,9 @@ export const V1GetABranchInput = Schema.Struct({ export const V1GetABranchOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), name: Schema.String, @@ -1478,7 +1830,12 @@ export const V1GetABranchOutput = Schema.Struct({ parent_project_ref: Schema.String, is_default: Schema.Boolean, git_branch: Schema.optionalKey(Schema.String), - pr_number: Schema.optionalKey(Schema.Number.annotate({ format: "int32" }).check(Schema.isInt())), + pr_number: Schema.optionalKey( + Schema.Number.annotate({ format: "int32" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", @@ -1495,12 +1852,40 @@ export const V1GetABranchOutput = Schema.Struct({ ]).annotate({ description: "This field is deprecated. List action runs to get branch status instead.", }), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), - review_requested_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + review_requested_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), with_data: Schema.Boolean, notify_url: Schema.optionalKey(Schema.String.annotate({ format: "uri" })), - deletion_scheduled_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + deletion_scheduled_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), preview_project_status: Schema.optionalKey( Schema.Literals([ "INACTIVE", @@ -1522,22 +1907,19 @@ export const V1GetABranchOutput = Schema.Struct({ ), }); export const V1GetABranchConfigInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), }); export const V1GetABranchConfigOutput = Schema.Struct({ ref: Schema.String, @@ -1562,7 +1944,9 @@ export const V1GetABranchConfigOutput = Schema.Struct({ "RESIZING", ]), db_host: Schema.String, - db_port: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), + db_port: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), db_user: Schema.optionalKey(Schema.String), db_pass: Schema.optionalKey(Schema.String), jwt_secret: Schema.optionalKey(Schema.String), @@ -1578,9 +1962,17 @@ export const V1GetAFunctionOutput = Schema.Struct({ slug: Schema.String, name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), - created_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updated_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -1611,7 +2003,9 @@ export const V1GetAMigrationOutput = Schema.Struct({ export const V1GetASnippetInput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -1646,7 +2040,9 @@ export const V1GetASsoProviderInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), provider_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -1742,7 +2138,9 @@ export const V1GetActionRunLogsOutput = Schema.String; export const V1GetAllProjectsForOrganizationInput = Schema.Struct({ slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), offset: Schema.optionalKey( - Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), ), limit: Schema.optionalKey( Schema.Number.check(Schema.isInt()) @@ -1869,8 +2267,18 @@ export const V1GetAuthServiceConfigInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1GetAuthServiceConfigOutput = Schema.Struct({ - api_max_request_duration: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - db_max_pool_size: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + api_max_request_duration: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + db_max_pool_size: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), db_max_pool_size_unit: Schema.Union([ Schema.Literals(["connections", "percent"]), Schema.Union([Schema.Null]), @@ -1992,11 +2400,23 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ hook_after_user_created_enabled: Schema.Union([Schema.Boolean, Schema.Null]), hook_after_user_created_uri: Schema.Union([Schema.String, Schema.Null]), hook_after_user_created_secrets: Schema.Union([Schema.String, Schema.Null]), - jwt_exp: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + jwt_exp: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), mailer_allow_unverified_email_sign_ins: Schema.Union([Schema.Boolean, Schema.Null]), mailer_autoconfirm: Schema.Union([Schema.Boolean, Schema.Null]), - mailer_otp_exp: Schema.Number.check(Schema.isInt()), - mailer_otp_length: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + mailer_otp_exp: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + mailer_otp_length: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), mailer_secure_email_change_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mailer_subjects_confirmation: Schema.Union([Schema.String, Schema.Null]), mailer_subjects_email_change: Schema.Union([Schema.String, Schema.Null]), @@ -2043,7 +2463,12 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ mailer_notifications_mfa_factor_unenrolled_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mailer_notifications_identity_linked_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mailer_notifications_identity_unlinked_enabled: Schema.Union([Schema.Boolean, Schema.Null]), - mfa_max_enrolled_factors: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + mfa_max_enrolled_factors: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), mfa_totp_enroll_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mfa_totp_verify_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mfa_phone_enroll_enabled: Schema.Union([Schema.Boolean, Schema.Null]), @@ -2054,14 +2479,26 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ webauthn_rp_display_name: Schema.Union([Schema.String, Schema.Null]), webauthn_rp_id: Schema.Union([Schema.String, Schema.Null]), webauthn_rp_origins: Schema.Union([Schema.String, Schema.Null]), - mfa_phone_otp_length: Schema.Number.check(Schema.isInt()), + mfa_phone_otp_length: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), mfa_phone_template: Schema.Union([Schema.String, Schema.Null]), - mfa_phone_max_frequency: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + mfa_phone_max_frequency: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), nimbus_oauth_client_id: Schema.Union([Schema.String, Schema.Null]), nimbus_oauth_email_optional: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), nimbus_oauth_client_secret: Schema.Union([Schema.String, Schema.Null]), password_hibp_enabled: Schema.Union([Schema.Boolean, Schema.Null]), - password_min_length: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + password_min_length: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), password_required_characters: Schema.Union([ Schema.Literals([ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", @@ -2071,13 +2508,48 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ ]), Schema.Union([Schema.Null]), ]), - rate_limit_anonymous_users: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_email_sent: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_sms_sent: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_token_refresh: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_verify: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_otp: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_web3: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + rate_limit_anonymous_users: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_email_sent: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_sms_sent: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_token_refresh: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_verify: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_otp: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_web3: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), refresh_token_rotation_enabled: Schema.Union([Schema.Boolean, Schema.Null]), saml_enabled: Schema.Union([Schema.Boolean, Schema.Null]), saml_external_url: Schema.Union([Schema.String, Schema.Null]), @@ -2091,7 +2563,9 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ security_captcha_secret: Schema.Union([Schema.String, Schema.Null]), security_manual_linking_enabled: Schema.Union([Schema.Boolean, Schema.Null]), security_refresh_token_reuse_interval: Schema.Union([ - Schema.Number.check(Schema.isInt()), + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), Schema.Null, ]), security_update_password_require_reauthentication: Schema.Union([Schema.Boolean, Schema.Null]), @@ -2101,11 +2575,23 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ sessions_timebox: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), site_url: Schema.Union([Schema.String, Schema.Null]), sms_autoconfirm: Schema.Union([Schema.Boolean, Schema.Null]), - sms_max_frequency: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + sms_max_frequency: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), sms_messagebird_access_key: Schema.Union([Schema.String, Schema.Null]), sms_messagebird_originator: Schema.Union([Schema.String, Schema.Null]), - sms_otp_exp: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - sms_otp_length: Schema.Number.check(Schema.isInt()), + sms_otp_exp: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + sms_otp_length: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), sms_provider: Schema.Union([ Schema.Literals(["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"]), Schema.Union([Schema.Null]), @@ -2113,7 +2599,13 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ sms_template: Schema.Union([Schema.String, Schema.Null]), sms_test_otp: Schema.Union([Schema.String, Schema.Null]), sms_test_otp_valid_until: Schema.Union([ - Schema.String.annotate({ format: "date-time" }), + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + ), + ), + ), Schema.Null, ]), sms_textlocal_api_key: Schema.Union([Schema.String, Schema.Null]), @@ -2128,9 +2620,23 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ sms_vonage_api_key: Schema.Union([Schema.String, Schema.Null]), sms_vonage_api_secret: Schema.Union([Schema.String, Schema.Null]), sms_vonage_from: Schema.Union([Schema.String, Schema.Null]), - smtp_admin_email: Schema.Union([Schema.String.annotate({ format: "email" }), Schema.Null]), + smtp_admin_email: Schema.Union([ + Schema.String.annotate({ format: "email" }).check( + Schema.isPattern( + new RegExp( + "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + ), + ), + ), + Schema.Null, + ]), smtp_host: Schema.Union([Schema.String, Schema.Null]), - smtp_max_frequency: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + smtp_max_frequency: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), smtp_pass: Schema.Union([Schema.String, Schema.Null]), smtp_port: Schema.Union([Schema.String, Schema.Null]), smtp_sender_name: Schema.Union([Schema.String, Schema.Null]), @@ -2140,7 +2646,9 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ oauth_server_allow_dynamic_registration: Schema.Boolean, oauth_server_authorization_path: Schema.Union([Schema.String, Schema.Null]), custom_oauth_enabled: Schema.Boolean, - custom_oauth_max_providers: Schema.Number.check(Schema.isInt()), + custom_oauth_max_providers: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }); export const V1GetAvailableRegionsInput = Schema.Struct({ organization_slug: Schema.String, @@ -2200,7 +2708,7 @@ export const V1GetAvailableRegionsOutput = Schema.Struct({ "sa-east-1", ]), type: Schema.Literal("specific"), - provider: Schema.Literals(["AWS", "FLY", "AWS_K8S", "AWS_NIMBUS"]), + provider: Schema.Literals(["AWS", "AWS_K8S", "AWS_NIMBUS"]), status: Schema.optionalKey(Schema.Literals(["capacity", "other"])), }), ), @@ -2237,7 +2745,7 @@ export const V1GetAvailableRegionsOutput = Schema.Struct({ "sa-east-1", ]), type: Schema.Literal("specific"), - provider: Schema.Literals(["AWS", "FLY", "AWS_K8S", "AWS_NIMBUS"]), + provider: Schema.Literals(["AWS", "AWS_K8S", "AWS_NIMBUS"]), status: Schema.optionalKey(Schema.Literals(["capacity", "other"])), }), ), @@ -2251,11 +2759,17 @@ export const V1GetBackupScheduleInput = Schema.Struct({ export const V1GetBackupScheduleOutput = Schema.Struct({ schedule_for: Schema.String.annotate({ description: "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", - }), + }).check(Schema.isPattern(new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$"))), updated_at: Schema.String.annotate({ description: "Timestamp of when the backup schedule was last updated.", format: "date-time", - }), + }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + ), + ), + ), }); export const V1GetDatabaseDiskInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -2263,24 +2777,31 @@ export const V1GetDatabaseDiskInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1GetDatabaseDiskOutput = Schema.Struct({ - attributes: Schema.Union( - [ - Schema.Struct({ - iops: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - size_gb: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - throughput_mibps: Schema.optionalKey( - Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - ), - type: Schema.Literal("gp3"), - }), - Schema.Struct({ - iops: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - size_gb: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - type: Schema.Literal("io2"), - }), - ], - { mode: "oneOf" }, - ), + attributes: Schema.Union([ + Schema.Struct({ + iops: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + size_gb: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + throughput_mibps: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + ), + type: Schema.Literal("gp3"), + }), + Schema.Struct({ + iops: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + size_gb: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + type: Schema.Literal("io2"), + }), + ]), last_modified_at: Schema.optionalKey(Schema.String), }); export const V1GetDatabaseMetadataInput = Schema.Struct({ @@ -2341,8 +2862,8 @@ export const V1GetHostnameConfigOutput = Schema.Struct({ custom_hostname: Schema.optionalKey(Schema.String), data: Schema.Struct({ success: Schema.Boolean, - errors: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), - messages: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), + errors: Schema.Array(UpdateCustomHostnameResponseJsonValue), + messages: Schema.Array(UpdateCustomHostnameResponseJsonValue), result: Schema.Struct({ id: Schema.String, hostname: Schema.String, @@ -2373,7 +2894,9 @@ export const V1GetJitAccessOutput = Schema.Struct({ user_id: Schema.optionalKey( Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), ), @@ -2383,9 +2906,31 @@ export const V1GetJitAccessOutput = Schema.Struct({ expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), ), }), ), @@ -2423,14 +2968,28 @@ export const V1GetLegacySigningKeyInput = Schema.Struct({ export const V1GetLegacySigningKeyOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }); export const V1GetNetworkRestrictionsInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -2456,8 +3015,24 @@ export const V1GetNetworkRestrictionsOutput = Schema.Struct({ }), ), status: Schema.Literals(["stored", "applied"]), - updated_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), - applied_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + updated_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), + applied_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), }); export const V1GetOrganizationEntitlementsInput = Schema.Struct({ slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), @@ -2535,19 +3110,16 @@ export const V1GetOrganizationEntitlementsOutput = Schema.Struct({ }), hasAccess: Schema.Boolean, type: Schema.Literals(["boolean", "numeric", "set"]), - config: Schema.Union( - [ - Schema.Struct({ enabled: Schema.Boolean }), - Schema.Struct({ - enabled: Schema.Boolean, - value: Schema.Number.check(Schema.isFinite()), - unlimited: Schema.Boolean, - unit: Schema.String, - }), - Schema.Struct({ enabled: Schema.Boolean, set: Schema.Array(Schema.String) }), - ], - { mode: "oneOf" }, - ), + config: Schema.Union([ + Schema.Struct({ enabled: Schema.Boolean }), + Schema.Struct({ + enabled: Schema.Boolean, + value: Schema.Number.check(Schema.isFinite()), + unlimited: Schema.Boolean, + unit: Schema.String, + }), + Schema.Struct({ enabled: Schema.Boolean, set: Schema.Array(Schema.String) }), + ]), }), ), }); @@ -2575,7 +3147,9 @@ export const V1GetOrganizationProjectClaimOutput = Schema.Struct({ created_at: Schema.String, created_by: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -2716,7 +3290,11 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ .check(Schema.isGreaterThanOrEqualTo(0)) .check(Schema.isLessThanOrEqualTo(1024)), ), - max_replication_slots: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_replication_slots: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), max_slot_wal_keep_size: Schema.optionalKey(Schema.String), max_standby_archive_delay: Schema.optionalKey(Schema.String), max_standby_streaming_delay: Schema.optionalKey(Schema.String), @@ -2726,7 +3304,11 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ .check(Schema.isLessThanOrEqualTo(262143)), ), max_wal_size: Schema.optionalKey(Schema.String), - max_wal_senders: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_wal_senders: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), max_worker_processes: Schema.optionalKey( Schema.Number.check(Schema.isInt()) .check(Schema.isGreaterThanOrEqualTo(0)) @@ -2790,54 +3372,48 @@ export const V1GetPostgresUpgradeEligibilityOutput = Schema.Struct({ description: "Use validation_errors instead.", }), validation_errors: Schema.Array( - Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("objects_depending_on_pg_cron"), - dependents: Schema.Array(Schema.String), - }), - Schema.Struct({ - type: Schema.Literal("indexes_referencing_ll_to_earth"), - schema_name: Schema.String, - table_name: Schema.String, - index_name: Schema.String, - }), - Schema.Struct({ - type: Schema.Literal("function_using_obsolete_lang"), - schema_name: Schema.String, - function_name: Schema.String, - lang_name: Schema.String, - }), - Schema.Struct({ - type: Schema.Literal("unsupported_extension"), - extension_name: Schema.String, - }), - Schema.Struct({ - type: Schema.Literal("unsupported_fdw_handler"), - fdw_name: Schema.String, - fdw_handler_name: Schema.String, - }), - Schema.Struct({ - type: Schema.Literal("unlogged_table_with_persistent_sequence"), - schema_name: Schema.String, - table_name: Schema.String, - sequence_name: Schema.String, - }), - Schema.Struct({ - type: Schema.Literal("user_defined_objects_in_internal_schemas"), - obj_type: Schema.Literals(["table", "function"]), - schema_name: Schema.String, - obj_name: Schema.String, - }), - Schema.Struct({ - type: Schema.Literal("active_replication_slot"), - slot_name: Schema.String, - }), - Schema.Struct({ type: Schema.Literal("x86_architecture") }), - Schema.Struct({ type: Schema.Literal("project_hibernating") }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.Struct({ + type: Schema.Literal("objects_depending_on_pg_cron"), + dependents: Schema.Array(Schema.String), + }), + Schema.Struct({ + type: Schema.Literal("indexes_referencing_ll_to_earth"), + schema_name: Schema.String, + table_name: Schema.String, + index_name: Schema.String, + }), + Schema.Struct({ + type: Schema.Literal("function_using_obsolete_lang"), + schema_name: Schema.String, + function_name: Schema.String, + lang_name: Schema.String, + }), + Schema.Struct({ + type: Schema.Literal("unsupported_extension"), + extension_name: Schema.String, + }), + Schema.Struct({ + type: Schema.Literal("unsupported_fdw_handler"), + fdw_name: Schema.String, + fdw_handler_name: Schema.String, + }), + Schema.Struct({ + type: Schema.Literal("unlogged_table_with_persistent_sequence"), + schema_name: Schema.String, + table_name: Schema.String, + sequence_name: Schema.String, + }), + Schema.Struct({ + type: Schema.Literal("user_defined_objects_in_internal_schemas"), + obj_type: Schema.Literals(["table", "function"]), + schema_name: Schema.String, + obj_name: Schema.String, + }), + Schema.Struct({ type: Schema.Literal("active_replication_slot"), slot_name: Schema.String }), + Schema.Struct({ type: Schema.Literal("x86_architecture") }), + Schema.Struct({ type: Schema.Literal("project_hibernating") }), + ]), ), warnings: Schema.Array( Schema.Union( @@ -2902,18 +3478,26 @@ export const V1GetPostgrestServiceConfigInput = Schema.Struct({ }); export const V1GetPostgrestServiceConfigOutput = Schema.Struct({ db_schema: Schema.String, - max_rows: Schema.Number.check(Schema.isInt()), + max_rows: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), db_extra_search_path: Schema.String, db_pool: Schema.Union([ Schema.Number.annotate({ description: "If `null`, the value is automatically configured based on compute size.", - }).check(Schema.isInt()), + }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), Schema.Null, ]), db_pool_acquisition_timeout: Schema.Union([ Schema.Number.annotate({ description: "If `null`, the value is automatically configured to 10.", - }).check(Schema.isInt()), + }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), Schema.Null, ]), jwt_secret: Schema.optionalKey(Schema.String), @@ -2974,10 +3558,12 @@ export const V1GetProjectApiKeyInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), - reveal: Schema.optionalKey(Schema.Boolean), + reveal: Schema.optionalKey(Schema.String), }); export const V1GetProjectApiKeyOutput = Schema.Struct({ api_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -2993,20 +3579,41 @@ export const V1GetProjectApiKeyOutput = Schema.Struct({ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), hash: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), inserted_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), updated_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), }); export const V1GetProjectApiKeysInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - reveal: Schema.optionalKey(Schema.Boolean), + reveal: Schema.optionalKey(Schema.String), }); export const V1GetProjectApiKeysOutput = Schema.Array(ApiKeyResponse); export const V1GetProjectClaimTokenInput = Schema.Struct({ @@ -3020,7 +3627,9 @@ export const V1GetProjectClaimTokenOutput = Schema.Struct({ created_at: Schema.String, created_by: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); @@ -3033,18 +3642,21 @@ export const V1GetProjectDiskAutoscaleConfigOutput = Schema.Struct({ growth_percent: Schema.Union([ Schema.Number.annotate({ description: "Growth percentage for disk autoscaling" }) .check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) .check(Schema.isGreaterThan(0)), Schema.Null, ]), min_increment_gb: Schema.Union([ Schema.Number.annotate({ description: "Minimum increment size for disk autoscaling in GB" }) .check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) .check(Schema.isGreaterThan(0)), Schema.Null, ]), max_size_gb: Schema.Union([ Schema.Number.annotate({ description: "Maximum limit the disk size will grow to in GB" }) .check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) .check(Schema.isGreaterThan(0)), Schema.Null, ]), @@ -3059,26 +3671,23 @@ export const V1GetProjectFunctionCombinedStatsInput = Schema.Struct({ export const V1GetProjectFunctionCombinedStatsOutput = Schema.Struct({ result: Schema.optionalKey(Schema.Array(Schema.Json)), error: Schema.optionalKey( - Schema.Union( - [ - Schema.String, - Schema.Struct({ - code: Schema.Number.check(Schema.isFinite()), - errors: Schema.Array( - Schema.Struct({ - domain: Schema.String, - location: Schema.String, - locationType: Schema.String, - message: Schema.String, - reason: Schema.String, - }), - ), - message: Schema.String, - status: Schema.String, - }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.String, + Schema.Struct({ + code: Schema.Number.check(Schema.isFinite()), + errors: Schema.Array( + Schema.Struct({ + domain: Schema.String, + location: Schema.String, + locationType: Schema.String, + message: Schema.String, + reason: Schema.String, + }), + ), + message: Schema.String, + status: Schema.String, + }), + ]), ), }); export const V1GetProjectLegacyApiKeysInput = Schema.Struct({ @@ -3092,32 +3701,45 @@ export const V1GetProjectLogsInput = Schema.Struct({ .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), sql: Schema.optionalKey(Schema.String), - iso_timestamp_start: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), - iso_timestamp_end: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + iso_timestamp_start: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), + iso_timestamp_end: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), }); export const V1GetProjectLogsOutput = Schema.Struct({ result: Schema.optionalKey(Schema.Array(Schema.Json)), error: Schema.optionalKey( - Schema.Union( - [ - Schema.String, - Schema.Struct({ - code: Schema.Number.check(Schema.isFinite()), - errors: Schema.Array( - Schema.Struct({ - domain: Schema.String, - location: Schema.String, - locationType: Schema.String, - message: Schema.String, - reason: Schema.String, - }), - ), - message: Schema.String, - status: Schema.String, - }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.String, + Schema.Struct({ + code: Schema.Number.check(Schema.isFinite()), + errors: Schema.Array( + Schema.Struct({ + domain: Schema.String, + location: Schema.String, + locationType: Schema.String, + message: Schema.String, + reason: Schema.String, + }), + ), + message: Schema.String, + status: Schema.String, + }), + ]), ), }); export const V1GetProjectLogsAllInput = Schema.Struct({ @@ -3125,32 +3747,45 @@ export const V1GetProjectLogsAllInput = Schema.Struct({ .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), sql: Schema.optionalKey(Schema.String), - iso_timestamp_start: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), - iso_timestamp_end: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + iso_timestamp_start: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), + iso_timestamp_end: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), }); export const V1GetProjectLogsAllOutput = Schema.Struct({ result: Schema.optionalKey(Schema.Array(Schema.Json)), error: Schema.optionalKey( - Schema.Union( - [ - Schema.String, - Schema.Struct({ - code: Schema.Number.check(Schema.isFinite()), - errors: Schema.Array( - Schema.Struct({ - domain: Schema.String, - location: Schema.String, - locationType: Schema.String, - message: Schema.String, - reason: Schema.String, - }), - ), - message: Schema.String, - status: Schema.String, - }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.String, + Schema.Struct({ + code: Schema.Number.check(Schema.isFinite()), + errors: Schema.Array( + Schema.Struct({ + domain: Schema.String, + location: Schema.String, + locationType: Schema.String, + message: Schema.String, + reason: Schema.String, + }), + ), + message: Schema.String, + status: Schema.String, + }), + ]), ), }); export const V1GetProjectPgbouncerConfigInput = Schema.Struct({ @@ -3159,20 +3794,46 @@ export const V1GetProjectPgbouncerConfigInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1GetProjectPgbouncerConfigOutput = Schema.Struct({ - default_pool_size: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + default_pool_size: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), ignore_startup_parameters: Schema.optionalKey(Schema.String), - max_client_conn: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_client_conn: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), pool_mode: Schema.optionalKey(Schema.Literals(["transaction", "session", "statement"])), connection_string: Schema.optionalKey(Schema.String), - server_idle_timeout: Schema.optionalKey(Schema.Number.check(Schema.isInt())), - server_lifetime: Schema.optionalKey(Schema.Number.check(Schema.isInt())), - query_wait_timeout: Schema.optionalKey(Schema.Number.check(Schema.isInt())), - reserve_pool_size: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + server_idle_timeout: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), + server_lifetime: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), + query_wait_timeout: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), + reserve_pool_size: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), }); export const V1GetProjectSigningKeyInput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), ref: Schema.String.check(Schema.isMinLength(20)) @@ -3182,14 +3843,28 @@ export const V1GetProjectSigningKeyInput = Schema.Struct({ export const V1GetProjectSigningKeyOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }); export const V1GetProjectSigningKeysInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -3202,15 +3877,27 @@ export const V1GetProjectSigningKeysOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }), ), }); @@ -3220,14 +3907,18 @@ export const V1GetProjectTpaIntegrationInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), tpa_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), }); export const V1GetProjectTpaIntegrationOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), type: Schema.String, @@ -3251,7 +3942,13 @@ export const V1GetProjectUsageApiCountOutput = Schema.Struct({ result: Schema.optionalKey( Schema.Array( Schema.Struct({ - timestamp: Schema.String.annotate({ format: "date-time" }), + timestamp: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|))$", + ), + ), + ), total_auth_requests: Schema.Number.check(Schema.isFinite()), total_realtime_requests: Schema.Number.check(Schema.isFinite()), total_rest_requests: Schema.Number.check(Schema.isFinite()), @@ -3260,26 +3957,23 @@ export const V1GetProjectUsageApiCountOutput = Schema.Struct({ ), ), error: Schema.optionalKey( - Schema.Union( - [ - Schema.String, - Schema.Struct({ - code: Schema.Number.check(Schema.isFinite()), - errors: Schema.Array( - Schema.Struct({ - domain: Schema.String, - location: Schema.String, - locationType: Schema.String, - message: Schema.String, - reason: Schema.String, - }), - ), - message: Schema.String, - status: Schema.String, - }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.String, + Schema.Struct({ + code: Schema.Number.check(Schema.isFinite()), + errors: Schema.Array( + Schema.Struct({ + domain: Schema.String, + location: Schema.String, + locationType: Schema.String, + message: Schema.String, + reason: Schema.String, + }), + ), + message: Schema.String, + status: Schema.String, + }), + ]), ), }); export const V1GetProjectUsageRequestCountInput = Schema.Struct({ @@ -3292,26 +3986,23 @@ export const V1GetProjectUsageRequestCountOutput = Schema.Struct({ Schema.Array(Schema.Struct({ count: Schema.Number.check(Schema.isFinite()) })), ), error: Schema.optionalKey( - Schema.Union( - [ - Schema.String, - Schema.Struct({ - code: Schema.Number.check(Schema.isFinite()), - errors: Schema.Array( - Schema.Struct({ - domain: Schema.String, - location: Schema.String, - locationType: Schema.String, - message: Schema.String, - reason: Schema.String, - }), - ), - message: Schema.String, - status: Schema.String, - }), - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.String, + Schema.Struct({ + code: Schema.Number.check(Schema.isFinite()), + errors: Schema.Array( + Schema.Struct({ + domain: Schema.String, + location: Schema.String, + locationType: Schema.String, + message: Schema.String, + reason: Schema.String, + }), + ), + message: Schema.String, + status: Schema.String, + }), + ]), ), }); export const V1GetReadonlyModeStatusInput = Schema.Struct({ @@ -3414,7 +4105,16 @@ export const V1GetRestorePointInput = Schema.Struct({ export const V1GetRestorePointOutput = Schema.Struct({ name: Schema.String, status: Schema.Literals(["AVAILABLE", "PENDING", "REMOVED", "FAILED"]), - completed_on: Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + completed_on: Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), }); export const V1GetSecurityAdvisorsInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -3483,18 +4183,24 @@ export const V1GetServicesHealthInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - services: Schema.Array( - Schema.Literals([ - "auth", - "db", - "db_postgres_user", - "pooler", - "realtime", - "rest", - "storage", - "pg_bouncer", - ]), - ), + services: Schema.Union([ + Schema.String.annotate({ + description: + "Comma-separated list of enums:\n\n- `auth`\n- `db`\n- `db_postgres_user`\n- `pooler`\n- `realtime`\n- `rest`\n- `storage`\n- `pg_bouncer`", + }), + Schema.Array( + Schema.Literals([ + "auth", + "db", + "db_postgres_user", + "pooler", + "realtime", + "rest", + "storage", + "pg_bouncer", + ]), + ).annotate({ description: "Array of enums." }), + ]), timeout_ms: Schema.optionalKey( Schema.Number.check(Schema.isInt()) .check(Schema.isGreaterThanOrEqualTo(0)) @@ -3517,21 +4223,34 @@ export const V1GetStorageConfigInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1GetStorageConfigOutput = Schema.Struct({ - fileSizeLimit: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + fileSizeLimit: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), features: Schema.Struct({ imageTransformation: Schema.Struct({ enabled: Schema.Boolean }), s3Protocol: Schema.Struct({ enabled: Schema.Boolean }), purgeCache: Schema.Struct({ enabled: Schema.Boolean }), icebergCatalog: Schema.Struct({ enabled: Schema.Boolean, - maxNamespaces: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), - maxTables: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), - maxCatalogs: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), + maxNamespaces: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + maxTables: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + maxCatalogs: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }), vectorBuckets: Schema.Struct({ enabled: Schema.Boolean, - maxBuckets: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), - maxIndexes: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), + maxBuckets: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + maxIndexes: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }), }), capabilities: Schema.Struct({ list_v2: Schema.Boolean, iceberg_catalog: Schema.Boolean }), @@ -3552,16 +4271,46 @@ export const V1InviteExternalJitAccessInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - email: Schema.String.annotate({ format: "email" }).check(Schema.isMinLength(1)), + email: Schema.String.annotate({ format: "email" }) + .check(Schema.isMinLength(1)) + .check( + Schema.isPattern( + new RegExp( + "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + ), + ), + ), roles: Schema.Array( Schema.Struct({ role: Schema.String.check(Schema.isMinLength(1)), expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), ), }), ), @@ -3570,10 +4319,18 @@ export const V1InviteExternalJitAccessInput = Schema.Struct({ ), }); export const V1InviteExternalJitAccessOutput = Schema.Struct({ - email: Schema.String.annotate({ format: "email" }), + email: Schema.String.annotate({ format: "email" }).check( + Schema.isPattern( + new RegExp( + "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + ), + ), + ), invite_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), user_roles: Schema.Array( @@ -3582,9 +4339,31 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), ), }), ), @@ -3649,7 +4428,9 @@ export const V1ListAllBackupsOutput = Schema.Struct({ pitr_enabled: Schema.Boolean, backups: Schema.Array( Schema.Struct({ - id: Schema.Number.check(Schema.isInt()), + id: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), is_physical_backup: Schema.Boolean, status: Schema.Literals([ "COMPLETED", @@ -3663,8 +4444,16 @@ export const V1ListAllBackupsOutput = Schema.Struct({ }), ), physical_backup_data: Schema.Struct({ - earliest_physical_backup_date_unix: Schema.optionalKey(Schema.Number.check(Schema.isInt())), - latest_physical_backup_date_unix: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + earliest_physical_backup_date_unix: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), + latest_physical_backup_date_unix: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), }), }); export const V1ListAllBranchesInput = Schema.Struct({ @@ -3830,69 +4619,106 @@ export const V1ListJitAccessInput = Schema.Struct({ }); export const V1ListJitAccessOutput = Schema.Struct({ items: Schema.Array( - Schema.Union( - [ - Schema.Struct({ - user_id: Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + Schema.Union([ + Schema.Struct({ + user_id: Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - primary_email: Schema.Union([Schema.String, Schema.Null]), - invite_id: Schema.Null, - expires_at: Schema.Null, - user_roles: Schema.Array( - Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), - allowed_networks: Schema.optionalKey( - Schema.Struct({ - allowed_cidrs: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + ), + primary_email: Schema.Union([Schema.String, Schema.Null]), + invite_id: Schema.Null, + expires_at: Schema.Null, + user_roles: Schema.Array( + Schema.Struct({ + role: Schema.String.check(Schema.isMinLength(1)), + expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + allowed_networks: Schema.optionalKey( + Schema.Struct({ + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), ), - allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + ), + allowed_cidrs_v6: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), ), - }), - ), - branches_only: Schema.optionalKey(Schema.Boolean), - }), - ), - }), - Schema.Struct({ - user_id: Schema.Null, - primary_email: Schema.String, - invite_id: Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + ), + }), + ), + branches_only: Schema.optionalKey(Schema.Boolean), + }), + ), + }), + Schema.Struct({ + user_id: Schema.Null, + primary_email: Schema.String, + invite_id: Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - expires_at: Schema.String, - user_roles: Schema.Array( - Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), - allowed_networks: Schema.optionalKey( - Schema.Struct({ - allowed_cidrs: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + ), + expires_at: Schema.String, + user_roles: Schema.Array( + Schema.Struct({ + role: Schema.String.check(Schema.isMinLength(1)), + expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + allowed_networks: Schema.optionalKey( + Schema.Struct({ + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), ), - allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + ), + allowed_cidrs_v6: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), ), - }), - ), - branches_only: Schema.optionalKey(Schema.Boolean), - }), - ), - }), - ], - { mode: "oneOf" }, - ), + ), + }), + ), + branches_only: Schema.optionalKey(Schema.Boolean), + }), + ), + }), + ]), ), }); export const V1ListMigrationHistoryInput = Schema.Struct({ @@ -3929,8 +4755,62 @@ export const V1ListProjectAddonsOutput = Schema.Struct({ "etl_pipeline", ]), variant: Schema.Struct({ - id: Schema.Union( - [ + id: Schema.Union([ + Schema.Literals([ + "ci_micro", + "ci_small", + "ci_medium", + "ci_large", + "ci_xlarge", + "ci_2xlarge", + "ci_4xlarge", + "ci_8xlarge", + "ci_12xlarge", + "ci_16xlarge", + "ci_24xlarge", + "ci_24xlarge_optimized_cpu", + "ci_24xlarge_optimized_memory", + "ci_24xlarge_high_memory", + "ci_48xlarge", + "ci_48xlarge_optimized_cpu", + "ci_48xlarge_optimized_memory", + "ci_48xlarge_high_memory", + ]), + Schema.Literal("cd_default"), + Schema.Literals(["pitr_7", "pitr_14", "pitr_28"]), + Schema.Literal("ipv4_default"), + Schema.Literal("auth_mfa_phone_default"), + Schema.Literal("auth_mfa_web_authn_default"), + Schema.Literal("log_drain_default"), + Schema.Literal("etl_pipeline_default"), + ]), + name: Schema.String, + price: Schema.Struct({ + description: Schema.String, + type: Schema.Literals(["fixed", "usage"]), + interval: Schema.Literals(["monthly", "hourly"]), + amount: Schema.Number.check(Schema.isFinite()), + }), + meta: Schema.optionalKey(ListProjectAddonsResponseJsonValue), + }), + }), + ), + available_addons: Schema.Array( + Schema.Struct({ + type: Schema.Literals([ + "custom_domain", + "compute_instance", + "pitr", + "ipv4", + "auth_mfa_phone", + "auth_mfa_web_authn", + "log_drain", + "etl_pipeline", + ]), + name: Schema.String, + variants: Schema.Array( + Schema.Struct({ + id: Schema.Union([ Schema.Literals([ "ci_micro", "ci_small", @@ -3958,69 +4838,7 @@ export const V1ListProjectAddonsOutput = Schema.Struct({ Schema.Literal("auth_mfa_web_authn_default"), Schema.Literal("log_drain_default"), Schema.Literal("etl_pipeline_default"), - ], - { mode: "oneOf" }, - ), - name: Schema.String, - price: Schema.Struct({ - description: Schema.String, - type: Schema.Literals(["fixed", "usage"]), - interval: Schema.Literals(["monthly", "hourly"]), - amount: Schema.Number.check(Schema.isFinite()), - }), - meta: Schema.optionalKey( - Schema.Json.annotate({ description: "Any JSON-serializable value" }), - ), - }), - }), - ), - available_addons: Schema.Array( - Schema.Struct({ - type: Schema.Literals([ - "custom_domain", - "compute_instance", - "pitr", - "ipv4", - "auth_mfa_phone", - "auth_mfa_web_authn", - "log_drain", - "etl_pipeline", - ]), - name: Schema.String, - variants: Schema.Array( - Schema.Struct({ - id: Schema.Union( - [ - Schema.Literals([ - "ci_micro", - "ci_small", - "ci_medium", - "ci_large", - "ci_xlarge", - "ci_2xlarge", - "ci_4xlarge", - "ci_8xlarge", - "ci_12xlarge", - "ci_16xlarge", - "ci_24xlarge", - "ci_24xlarge_optimized_cpu", - "ci_24xlarge_optimized_memory", - "ci_24xlarge_high_memory", - "ci_48xlarge", - "ci_48xlarge_optimized_cpu", - "ci_48xlarge_optimized_memory", - "ci_48xlarge_high_memory", - ]), - Schema.Literal("cd_default"), - Schema.Literals(["pitr_7", "pitr_14", "pitr_28"]), - Schema.Literal("ipv4_default"), - Schema.Literal("auth_mfa_phone_default"), - Schema.Literal("auth_mfa_web_authn_default"), - Schema.Literal("log_drain_default"), - Schema.Literal("etl_pipeline_default"), - ], - { mode: "oneOf" }, - ), + ]), name: Schema.String, price: Schema.Struct({ description: Schema.String, @@ -4028,9 +4846,7 @@ export const V1ListProjectAddonsOutput = Schema.Struct({ interval: Schema.Literals(["monthly", "hourly"]), amount: Schema.Number.check(Schema.isFinite()), }), - meta: Schema.optionalKey( - Schema.Json.annotate({ description: "Any JSON-serializable value" }), - ), + meta: Schema.optionalKey(ListProjectAddonsResponseJsonValue), }), ), }), @@ -4043,22 +4859,19 @@ export const V1ListProjectTpaIntegrationsInput = Schema.Struct({ }); export const V1ListProjectTpaIntegrationsOutput = Schema.Array(ThirdPartyAuth); export const V1MergeABranchInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), migration_version: Schema.optionalKey(Schema.String), }); export const V1MergeABranchOutput = Schema.Struct({ @@ -4072,16 +4885,26 @@ export const V1ModifyDatabaseDiskInput = Schema.Struct({ attributes: Schema.Union( [ Schema.Struct({ - iops: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - size_gb: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), + iops: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + size_gb: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), throughput_mibps: Schema.optionalKey( - Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), + Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), ), type: Schema.Literal("gp3"), }), Schema.Struct({ - iops: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), - size_gb: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), + iops: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), + size_gb: Schema.Number.check(Schema.isInt()) + .check(Schema.isLessThanOrEqualTo(9007199254740991)) + .check(Schema.isGreaterThan(0)), type: Schema.Literal("io2"), }), ], @@ -4094,7 +4917,9 @@ export const V1OauthAuthorizeProjectClaimInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), client_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), response_type: Schema.Literals(["code", "token", "id_token token"]), @@ -4151,8 +4976,24 @@ export const V1PatchNetworkRestrictionsOutput = Schema.Struct({ "Populated when a new config has been received, but not registered as successfully applied to a project.", }), ), - updated_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), - applied_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + updated_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), + applied_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), status: Schema.Literals(["stored", "applied"]), }); export const V1PauseAProjectInput = Schema.Struct({ @@ -4161,22 +5002,19 @@ export const V1PauseAProjectInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1PushABranchInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), migration_version: Schema.optionalKey(Schema.String), }); export const V1PushABranchOutput = Schema.Struct({ @@ -4200,39 +5038,38 @@ export const V1RemoveProjectAddonInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - addon_variant: Schema.Union( - [ - Schema.Literals([ - "ci_micro", - "ci_small", - "ci_medium", - "ci_large", - "ci_xlarge", - "ci_2xlarge", - "ci_4xlarge", - "ci_8xlarge", - "ci_12xlarge", - "ci_16xlarge", - "ci_24xlarge", - "ci_24xlarge_optimized_cpu", - "ci_24xlarge_optimized_memory", - "ci_24xlarge_high_memory", - "ci_48xlarge", - "ci_48xlarge_optimized_cpu", - "ci_48xlarge_optimized_memory", - "ci_48xlarge_high_memory", - ]), - Schema.Literal("cd_default"), - Schema.Literals(["pitr_7", "pitr_14", "pitr_28"]), - Schema.Literal("ipv4_default"), - ], - { mode: "oneOf" }, - ), + addon_variant: Schema.Union([ + Schema.Literals([ + "ci_micro", + "ci_small", + "ci_medium", + "ci_large", + "ci_xlarge", + "ci_2xlarge", + "ci_4xlarge", + "ci_8xlarge", + "ci_12xlarge", + "ci_16xlarge", + "ci_24xlarge", + "ci_24xlarge_optimized_cpu", + "ci_24xlarge_optimized_memory", + "ci_24xlarge_high_memory", + "ci_48xlarge", + "ci_48xlarge_optimized_cpu", + "ci_48xlarge_optimized_memory", + "ci_48xlarge_high_memory", + ]), + Schema.Literal("cd_default"), + Schema.Literals(["pitr_7", "pitr_14", "pitr_28"]), + Schema.Literal("ipv4_default"), + ]), }); export const V1RemoveProjectSigningKeyInput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), ref: Schema.String.check(Schema.isMinLength(20)) @@ -4242,32 +5079,43 @@ export const V1RemoveProjectSigningKeyInput = Schema.Struct({ export const V1RemoveProjectSigningKeyOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }); export const V1ResetABranchInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), migration_version: Schema.optionalKey(Schema.String), }); export const V1ResetABranchOutput = Schema.Struct({ @@ -4280,22 +5128,19 @@ export const V1RestartAProjectInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), }); export const V1RestoreABranchInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), }); export const V1RestoreABranchOutput = Schema.Struct({ message: Schema.Literal("Branch restoration initiated"), @@ -4309,7 +5154,9 @@ export const V1RestorePhysicalBackupInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - id: Schema.Number.check(Schema.isInt()), + id: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }); export const V1RestorePitrBackupInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -4317,12 +5164,15 @@ export const V1RestorePitrBackupInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), recovery_time_target_unix: Schema.Number.annotate({ format: "int64" }) .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }); export const V1RevokeTokenInput = Schema.Struct({ client_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), client_secret: Schema.String, @@ -4385,22 +5235,19 @@ export const V1UndoInput = Schema.Struct({ name: Schema.String.check(Schema.isMaxLength(20)), }); export const V1UpdateABranchConfigInput = Schema.Struct({ - branch_id_or_ref: Schema.Union( - [ - Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - Schema.String.annotate({ format: "uuid" }).check( - Schema.isPattern( - new RegExp( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - ), + branch_id_or_ref: Schema.Union([ + Schema.String.annotate({ description: "Project ref" }) + .check(Schema.isMinLength(20)) + .check(Schema.isMaxLength(20)) + .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.annotate({ format: "uuid" }).check( + Schema.isPattern( + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", ), ), - ], - { mode: "oneOf" }, - ), + ), + ]), branch_name: Schema.optionalKey(Schema.String), git_branch: Schema.optionalKey(Schema.String), reset_on_push: Schema.optionalKey( @@ -4431,7 +5278,9 @@ export const V1UpdateABranchConfigInput = Schema.Struct({ export const V1UpdateABranchConfigOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), name: Schema.String, @@ -4439,7 +5288,12 @@ export const V1UpdateABranchConfigOutput = Schema.Struct({ parent_project_ref: Schema.String, is_default: Schema.Boolean, git_branch: Schema.optionalKey(Schema.String), - pr_number: Schema.optionalKey(Schema.Number.annotate({ format: "int32" }).check(Schema.isInt())), + pr_number: Schema.optionalKey( + Schema.Number.annotate({ format: "int32" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", @@ -4456,12 +5310,40 @@ export const V1UpdateABranchConfigOutput = Schema.Struct({ ]).annotate({ description: "This field is deprecated. List action runs to get branch status instead.", }), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), - review_requested_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + review_requested_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), with_data: Schema.Boolean, notify_url: Schema.optionalKey(Schema.String.annotate({ format: "uri" })), - deletion_scheduled_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + deletion_scheduled_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), preview_project_status: Schema.optionalKey( Schema.Literals([ "INACTIVE", @@ -4489,8 +5371,8 @@ export const V1UpdateAFunctionInput = Schema.Struct({ function_slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$"))), slug: Schema.optionalKey(Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")))), name: Schema.optionalKey(Schema.String), - verify_jwt: Schema.optionalKey(Schema.Boolean), - import_map: Schema.optionalKey(Schema.Boolean), + verify_jwt: Schema.optionalKey(Schema.String), + import_map: Schema.optionalKey(Schema.String), entrypoint_path: Schema.optionalKey(Schema.String), import_map_path: Schema.optionalKey(Schema.String), ezbr_sha256: Schema.optionalKey(Schema.String), @@ -4501,9 +5383,17 @@ export const V1UpdateAFunctionOutput = Schema.Struct({ slug: Schema.String, name: Schema.String, status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), - version: Schema.Number.check(Schema.isInt()), - created_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updated_at: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + version: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -4517,7 +5407,9 @@ export const V1UpdateAProjectInput = Schema.Struct({ name: Schema.String.check(Schema.isMinLength(1)).check(Schema.isMaxLength(256)), }); export const V1UpdateAProjectOutput = Schema.Struct({ - id: Schema.Number.check(Schema.isInt()), + id: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), ref: Schema.String, name: Schema.String, }); @@ -4527,7 +5419,9 @@ export const V1UpdateASsoProviderInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), provider_id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), metadata_xml: Schema.optionalKey(Schema.String), @@ -4541,15 +5435,12 @@ export const V1UpdateASsoProviderInput = Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), default: Schema.optionalKey( - Schema.Union( - [ - Schema.Struct({}), - Schema.Number.check(Schema.isFinite()), - Schema.String, - Schema.Boolean, - ], - { mode: "oneOf" }, - ), + Schema.Union([ + Schema.Struct({}), + Schema.Number.check(Schema.isFinite()), + Schema.String, + Schema.Boolean, + ]), ), array: Schema.optionalKey(Schema.Boolean), }), @@ -4661,7 +5552,16 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ ]), ), smtp_admin_email: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "email" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "email" }).check( + Schema.isPattern( + new RegExp( + "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + ), + ), + ), + Schema.Null, + ]), ), smtp_host: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), smtp_port: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -4948,7 +5848,16 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ ]), ), sms_test_otp_valid_until: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + ), + ), + ), + Schema.Null, + ]), ), sms_textlocal_api_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sms_textlocal_sender: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -5099,13 +6008,23 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ external_zoom_email_optional: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), external_zoom_secret: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), db_max_pool_size: Schema.optionalKey( - Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), ), db_max_pool_size_unit: Schema.optionalKey( Schema.Union([Schema.Literals(["connections", "percent"]), Schema.Union([Schema.Null])]), ), api_max_request_duration: Schema.optionalKey( - Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), ), mfa_totp_enroll_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), mfa_totp_verify_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), @@ -5144,8 +6063,18 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ custom_oauth_enabled: Schema.optionalKey(Schema.Boolean), }); export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ - api_max_request_duration: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - db_max_pool_size: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + api_max_request_duration: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + db_max_pool_size: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), db_max_pool_size_unit: Schema.Union([ Schema.Literals(["connections", "percent"]), Schema.Union([Schema.Null]), @@ -5267,11 +6196,23 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ hook_after_user_created_enabled: Schema.Union([Schema.Boolean, Schema.Null]), hook_after_user_created_uri: Schema.Union([Schema.String, Schema.Null]), hook_after_user_created_secrets: Schema.Union([Schema.String, Schema.Null]), - jwt_exp: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + jwt_exp: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), mailer_allow_unverified_email_sign_ins: Schema.Union([Schema.Boolean, Schema.Null]), mailer_autoconfirm: Schema.Union([Schema.Boolean, Schema.Null]), - mailer_otp_exp: Schema.Number.check(Schema.isInt()), - mailer_otp_length: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + mailer_otp_exp: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + mailer_otp_length: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), mailer_secure_email_change_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mailer_subjects_confirmation: Schema.Union([Schema.String, Schema.Null]), mailer_subjects_email_change: Schema.Union([Schema.String, Schema.Null]), @@ -5318,7 +6259,12 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ mailer_notifications_mfa_factor_unenrolled_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mailer_notifications_identity_linked_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mailer_notifications_identity_unlinked_enabled: Schema.Union([Schema.Boolean, Schema.Null]), - mfa_max_enrolled_factors: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + mfa_max_enrolled_factors: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), mfa_totp_enroll_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mfa_totp_verify_enabled: Schema.Union([Schema.Boolean, Schema.Null]), mfa_phone_enroll_enabled: Schema.Union([Schema.Boolean, Schema.Null]), @@ -5329,14 +6275,26 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ webauthn_rp_display_name: Schema.Union([Schema.String, Schema.Null]), webauthn_rp_id: Schema.Union([Schema.String, Schema.Null]), webauthn_rp_origins: Schema.Union([Schema.String, Schema.Null]), - mfa_phone_otp_length: Schema.Number.check(Schema.isInt()), + mfa_phone_otp_length: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), mfa_phone_template: Schema.Union([Schema.String, Schema.Null]), - mfa_phone_max_frequency: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + mfa_phone_max_frequency: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), nimbus_oauth_client_id: Schema.Union([Schema.String, Schema.Null]), nimbus_oauth_email_optional: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), nimbus_oauth_client_secret: Schema.Union([Schema.String, Schema.Null]), password_hibp_enabled: Schema.Union([Schema.Boolean, Schema.Null]), - password_min_length: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + password_min_length: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), password_required_characters: Schema.Union([ Schema.Literals([ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", @@ -5346,13 +6304,48 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ ]), Schema.Union([Schema.Null]), ]), - rate_limit_anonymous_users: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_email_sent: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_sms_sent: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_token_refresh: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_verify: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_otp: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - rate_limit_web3: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + rate_limit_anonymous_users: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_email_sent: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_sms_sent: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_token_refresh: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_verify: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_otp: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + rate_limit_web3: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), refresh_token_rotation_enabled: Schema.Union([Schema.Boolean, Schema.Null]), saml_enabled: Schema.Union([Schema.Boolean, Schema.Null]), saml_external_url: Schema.Union([Schema.String, Schema.Null]), @@ -5366,7 +6359,9 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ security_captcha_secret: Schema.Union([Schema.String, Schema.Null]), security_manual_linking_enabled: Schema.Union([Schema.Boolean, Schema.Null]), security_refresh_token_reuse_interval: Schema.Union([ - Schema.Number.check(Schema.isInt()), + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), Schema.Null, ]), security_update_password_require_reauthentication: Schema.Union([Schema.Boolean, Schema.Null]), @@ -5376,11 +6371,23 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ sessions_timebox: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), site_url: Schema.Union([Schema.String, Schema.Null]), sms_autoconfirm: Schema.Union([Schema.Boolean, Schema.Null]), - sms_max_frequency: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + sms_max_frequency: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), sms_messagebird_access_key: Schema.Union([Schema.String, Schema.Null]), sms_messagebird_originator: Schema.Union([Schema.String, Schema.Null]), - sms_otp_exp: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), - sms_otp_length: Schema.Number.check(Schema.isInt()), + sms_otp_exp: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), + sms_otp_length: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), sms_provider: Schema.Union([ Schema.Literals(["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"]), Schema.Union([Schema.Null]), @@ -5388,7 +6395,13 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ sms_template: Schema.Union([Schema.String, Schema.Null]), sms_test_otp: Schema.Union([Schema.String, Schema.Null]), sms_test_otp_valid_until: Schema.Union([ - Schema.String.annotate({ format: "date-time" }), + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + ), + ), + ), Schema.Null, ]), sms_textlocal_api_key: Schema.Union([Schema.String, Schema.Null]), @@ -5403,9 +6416,23 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ sms_vonage_api_key: Schema.Union([Schema.String, Schema.Null]), sms_vonage_api_secret: Schema.Union([Schema.String, Schema.Null]), sms_vonage_from: Schema.Union([Schema.String, Schema.Null]), - smtp_admin_email: Schema.Union([Schema.String.annotate({ format: "email" }), Schema.Null]), + smtp_admin_email: Schema.Union([ + Schema.String.annotate({ format: "email" }).check( + Schema.isPattern( + new RegExp( + "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + ), + ), + ), + Schema.Null, + ]), smtp_host: Schema.Union([Schema.String, Schema.Null]), - smtp_max_frequency: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + smtp_max_frequency: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), smtp_pass: Schema.Union([Schema.String, Schema.Null]), smtp_port: Schema.Union([Schema.String, Schema.Null]), smtp_sender_name: Schema.Union([Schema.String, Schema.Null]), @@ -5415,7 +6442,9 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ oauth_server_allow_dynamic_registration: Schema.Boolean, oauth_server_authorization_path: Schema.Union([Schema.String, Schema.Null]), custom_oauth_enabled: Schema.Boolean, - custom_oauth_max_providers: Schema.Number.check(Schema.isInt()), + custom_oauth_max_providers: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }); export const V1UpdateBackupScheduleInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -5423,16 +6452,22 @@ export const V1UpdateBackupScheduleInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), schedule_for: Schema.String.annotate({ description: "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", - }), + }).check(Schema.isPattern(new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$"))), }); export const V1UpdateBackupScheduleOutput = Schema.Struct({ schedule_for: Schema.String.annotate({ description: "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", - }), + }).check(Schema.isPattern(new RegExp("^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$"))), updated_at: Schema.String.annotate({ description: "Timestamp of when the backup schedule was last updated.", format: "date-time", - }), + }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", + ), + ), + ), }); export const V1UpdateDatabasePasswordInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -5460,8 +6495,8 @@ export const V1UpdateHostnameConfigOutput = Schema.Struct({ custom_hostname: Schema.optionalKey(Schema.String), data: Schema.Struct({ success: Schema.Boolean, - errors: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), - messages: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), + errors: Schema.Array(UpdateCustomHostnameResponseJsonValue), + messages: Schema.Array(UpdateCustomHostnameResponseJsonValue), result: Schema.Struct({ id: Schema.String, hostname: Schema.String, @@ -5491,7 +6526,9 @@ export const V1UpdateJitAccessInput = Schema.Struct({ .check(Schema.isMinLength(1)) .check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), roles: Schema.Array( @@ -5500,9 +6537,31 @@ export const V1UpdateJitAccessInput = Schema.Struct({ expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), ), }), ), @@ -5514,7 +6573,9 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ user_id: Schema.optionalKey( Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), ), @@ -5524,9 +6585,31 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), allowed_networks: Schema.optionalKey( Schema.Struct({ - allowed_cidrs: Schema.optionalKey(Schema.Array(Schema.Struct({ cidr: Schema.String }))), + allowed_cidrs: Schema.optionalKey( + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv4" }).check( + Schema.isPattern( + new RegExp( + "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", + ), + ), + ), + }), + ), + ), allowed_cidrs_v6: Schema.optionalKey( - Schema.Array(Schema.Struct({ cidr: Schema.String })), + Schema.Array( + Schema.Struct({ + cidr: Schema.String.annotate({ format: "cidrv6" }).check( + Schema.isPattern( + new RegExp( + "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", + ), + ), + ), + }), + ), ), }), ), @@ -5583,8 +6666,24 @@ export const V1UpdateNetworkRestrictionsOutput = Schema.Struct({ }), ), status: Schema.Literals(["stored", "applied"]), - updated_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), - applied_at: Schema.optionalKey(Schema.String.annotate({ format: "date-time" })), + updated_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), + applied_at: Schema.optionalKey( + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + ), }); export const V1UpdatePgsodiumConfigInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -5618,7 +6717,12 @@ export const V1UpdatePoolerConfigInput = Schema.Struct({ ), }); export const V1UpdatePoolerConfigOutput = Schema.Struct({ - default_pool_size: Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + default_pool_size: Schema.Union([ + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + Schema.Null, + ]), pool_mode: Schema.String, }); export const V1UpdatePostgresConfigInput = Schema.Struct({ @@ -5678,7 +6782,11 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ .check(Schema.isGreaterThanOrEqualTo(0)) .check(Schema.isLessThanOrEqualTo(1024)), ), - max_replication_slots: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_replication_slots: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), max_slot_wal_keep_size: Schema.optionalKey(Schema.String), max_standby_archive_delay: Schema.optionalKey(Schema.String), max_standby_streaming_delay: Schema.optionalKey(Schema.String), @@ -5688,7 +6796,11 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ .check(Schema.isLessThanOrEqualTo(262143)), ), max_wal_size: Schema.optionalKey(Schema.String), - max_wal_senders: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_wal_senders: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), max_worker_processes: Schema.optionalKey( Schema.Number.check(Schema.isInt()) .check(Schema.isGreaterThanOrEqualTo(0)) @@ -5771,7 +6883,11 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ .check(Schema.isGreaterThanOrEqualTo(0)) .check(Schema.isLessThanOrEqualTo(1024)), ), - max_replication_slots: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_replication_slots: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), max_slot_wal_keep_size: Schema.optionalKey(Schema.String), max_standby_archive_delay: Schema.optionalKey(Schema.String), max_standby_streaming_delay: Schema.optionalKey(Schema.String), @@ -5781,7 +6897,11 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ .check(Schema.isLessThanOrEqualTo(262143)), ), max_wal_size: Schema.optionalKey(Schema.String), - max_wal_senders: Schema.optionalKey(Schema.Number.check(Schema.isInt())), + max_wal_senders: Schema.optionalKey( + Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + ), max_worker_processes: Schema.optionalKey( Schema.Number.check(Schema.isInt()) .check(Schema.isGreaterThanOrEqualTo(0)) @@ -5833,18 +6953,26 @@ export const V1UpdatePostgrestServiceConfigInput = Schema.Struct({ }); export const V1UpdatePostgrestServiceConfigOutput = Schema.Struct({ db_schema: Schema.String, - max_rows: Schema.Number.check(Schema.isInt()), + max_rows: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), db_extra_search_path: Schema.String, db_pool: Schema.Union([ Schema.Number.annotate({ description: "If `null`, the value is automatically configured based on compute size.", - }).check(Schema.isInt()), + }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), Schema.Null, ]), db_pool_acquisition_timeout: Schema.Union([ Schema.Number.annotate({ description: "If `null`, the value is automatically configured to 10.", - }).check(Schema.isInt()), + }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(-9007199254740991)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), Schema.Null, ]), }); @@ -5854,10 +6982,12 @@ export const V1UpdateProjectApiKeyInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), - reveal: Schema.optionalKey(Schema.Boolean), + reveal: Schema.optionalKey(Schema.String), name: Schema.optionalKey( Schema.String.check(Schema.isMinLength(4)) .check(Schema.isMaxLength(64)) @@ -5865,7 +6995,10 @@ export const V1UpdateProjectApiKeyInput = Schema.Struct({ ), description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), }); export const V1UpdateProjectApiKeyOutput = Schema.Struct({ @@ -5882,26 +7015,49 @@ export const V1UpdateProjectApiKeyOutput = Schema.Struct({ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), hash: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), secret_jwt_template: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Json), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json).check(Schema.isPropertyNames(Schema.String)), + Schema.Null, + ]), ), inserted_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), updated_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), + Schema.Union([ + Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + Schema.Null, + ]), ), }); export const V1UpdateProjectLegacyApiKeysInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - enabled: Schema.Boolean, + enabled: Schema.String, }); export const V1UpdateProjectLegacyApiKeysOutput = Schema.Struct({ enabled: Schema.Boolean }); export const V1UpdateProjectSigningKeyInput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), ref: Schema.String.check(Schema.isMinLength(20)) @@ -5912,14 +7068,28 @@ export const V1UpdateProjectSigningKeyInput = Schema.Struct({ export const V1UpdateProjectSigningKeyOutput = Schema.Struct({ id: Schema.String.annotate({ format: "uuid" }).check( Schema.isPattern( - new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"), + new RegExp( + "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", + ), ), ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), - public_jwk: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - created_at: Schema.String.annotate({ format: "date-time" }), - updated_at: Schema.String.annotate({ format: "date-time" }), + public_jwk: Schema.Union([Schema.Json, Schema.Null]), + created_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), + updated_at: Schema.String.annotate({ format: "date-time" }).check( + Schema.isPattern( + new RegExp( + "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", + ), + ), + ), }); export const V1UpdateRealtimeConfigInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) @@ -6020,18 +7190,26 @@ export const V1UpdateStorageConfigInput = Schema.Struct({ icebergCatalog: Schema.optionalKey( Schema.Struct({ enabled: Schema.Boolean, - maxNamespaces: Schema.Number.check(Schema.isInt()).check( - Schema.isGreaterThanOrEqualTo(0), - ), - maxTables: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), - maxCatalogs: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), + maxNamespaces: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + maxTables: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + maxCatalogs: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }), ), vectorBuckets: Schema.optionalKey( Schema.Struct({ enabled: Schema.Boolean, - maxBuckets: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), - maxIndexes: Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), + maxBuckets: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), + maxIndexes: Schema.Number.check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)) + .check(Schema.isLessThanOrEqualTo(9007199254740991)), }), ), }), @@ -6077,8 +7255,8 @@ export const V1VerifyDnsConfigOutput = Schema.Struct({ custom_hostname: Schema.optionalKey(Schema.String), data: Schema.Struct({ success: Schema.Boolean, - errors: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), - messages: Schema.Array(Schema.Json.annotate({ description: "Any JSON-serializable value" })), + errors: Schema.Array(UpdateCustomHostnameResponseJsonValue), + messages: Schema.Array(UpdateCustomHostnameResponseJsonValue), result: Schema.Struct({ id: Schema.String, hostname: Schema.String, @@ -6354,7 +7532,7 @@ export const operationDefinitions = { }, v1ApplyAMigration: { id: "v1ApplyAMigration", - description: "Only available to selected partner OAuth apps", + description: "Apply a database migration", method: "POST", path: "/v1/projects/{ref}/database/migrations", pathParams: ["ref"], @@ -6590,6 +7768,8 @@ export const operationDefinitions = { "kps_enabled", "desired_instance_size", "template_url", + "release_channel", + "postgres_engine", "high_availability", ], }, @@ -7058,7 +8238,7 @@ export const operationDefinitions = { }, v1GetAMigration: { id: "v1GetAMigration", - description: "Only available to selected partner OAuth apps", + description: "Fetch an existing entry from migration history", method: "GET", path: "/v1/projects/{ref}/database/migrations/{version}", pathParams: ["ref", "version"], @@ -7941,7 +9121,7 @@ export const operationDefinitions = { }, v1ListMigrationHistory: { id: "v1ListMigrationHistory", - description: "Only available to selected partner OAuth apps", + description: "List applied migration versions", method: "GET", path: "/v1/projects/{ref}/database/migrations", pathParams: ["ref"], @@ -8043,7 +9223,7 @@ export const operationDefinitions = { }, v1PatchAMigration: { id: "v1PatchAMigration", - description: "Only available to selected partner OAuth apps", + description: "Patch an existing entry in migration history", method: "PATCH", path: "/v1/projects/{ref}/database/migrations/{version}", pathParams: ["ref", "version"], @@ -8248,7 +9428,7 @@ export const operationDefinitions = { }, v1RollbackMigrations: { id: "v1RollbackMigrations", - description: "Only available to selected partner OAuth apps", + description: "Rollback database migrations and remove them from history table", method: "DELETE", path: "/v1/projects/{ref}/database/migrations", pathParams: ["ref"], @@ -8990,7 +10170,7 @@ export const operationDefinitions = { }, v1UpsertAMigration: { id: "v1UpsertAMigration", - description: "Only available to selected partner OAuth apps", + description: "Upsert a database migration without applying", method: "PUT", path: "/v1/projects/{ref}/database/migrations", pathParams: ["ref"], diff --git a/packages/api/src/generated/openapi.json b/packages/api/src/generated/openapi.json index eed6a9bb90..1bc9c9fd22 100644 --- a/packages/api/src/generated/openapi.json +++ b/packages/api/src/generated/openapi.json @@ -17,7 +17,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -29,6 +29,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -53,12 +54,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_read"] - }, - { - "fga_permissions": ["branching_development_read"] } ], "summary": "Get database branch config", @@ -70,6 +65,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_read"], ["branching_production_read"]], "x-oauth-scope": "environment:read" }, "patch": { @@ -83,7 +79,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -95,6 +91,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -129,12 +126,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_write"] - }, - { - "fga_permissions": ["branching_development_write"] } ], "summary": "Update database branch config", @@ -146,6 +137,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_write"], ["branching_production_write"]], "x-oauth-scope": "environment:write" }, "delete": { @@ -159,7 +151,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -171,6 +163,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -182,9 +175,8 @@ "in": "query", "description": "If set to false, schedule deletion with 1-hour grace period (only when soft deletion is enabled).", "schema": { - "default": "true", "example": false, - "type": "boolean" + "type": "string" } } ], @@ -206,12 +198,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_delete"] - }, - { - "fga_permissions": ["branching_development_delete"] } ], "summary": "Delete a database branch", @@ -223,6 +209,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_delete"], ["branching_production_delete"]], "x-oauth-scope": "environment:write" } }, @@ -238,7 +225,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -250,6 +237,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -284,12 +272,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_write"] - }, - { - "fga_permissions": ["branching_development_write"] } ], "summary": "Pushes a database branch", @@ -301,6 +283,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_write"], ["branching_production_write"]], "x-oauth-scope": "environment:write" } }, @@ -316,7 +299,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -328,6 +311,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -362,12 +346,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_write"] - }, - { - "fga_permissions": ["branching_development_write"] } ], "summary": "Merges a database branch", @@ -379,6 +357,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_write"], ["branching_production_write"]], "x-oauth-scope": "environment:write" } }, @@ -394,7 +373,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -406,6 +385,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -440,12 +420,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_write"] - }, - { - "fga_permissions": ["branching_development_write"] } ], "summary": "Resets a database branch", @@ -457,6 +431,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_write"], ["branching_production_write"]], "x-oauth-scope": "environment:write" } }, @@ -472,7 +447,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -484,6 +459,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -508,12 +484,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_write"] - }, - { - "fga_permissions": ["branching_development_write"] } ], "summary": "Restore a scheduled branch deletion", @@ -525,6 +495,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_write"], ["branching_production_write"]], "x-oauth-scope": "environment:write" } }, @@ -540,7 +511,7 @@ "description": "Branch ref or deprecated branch ID", "schema": { "example": "abcdefghijklmnopqrst", - "oneOf": [ + "anyOf": [ { "type": "string", "minLength": 20, @@ -552,6 +523,7 @@ { "type": "string", "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "deprecated": true } ] @@ -570,10 +542,10 @@ "name": "pgdelta", "required": false, "in": "query", - "description": "Use pg-delta instead of Migra for diffing when true", + "description": "Use pg-delta instead of Migra for diffing when true. \nBoolean string.\n\nTruthy values: `true`, `1`, `yes`, `on`, `y`, `enabled`\n\nFalsy values: `false`, `0`, `no`, `off`, `n`, `disabled`", "schema": { - "example": false, - "type": "boolean" + "example": "true", + "type": "string" } } ], @@ -595,12 +567,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_write"] - }, - { - "fga_permissions": ["branching_development_write"] } ], "summary": "[Beta] Diffs a database branch", @@ -612,6 +578,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_write"], ["branching_production_write"]], "x-oauth-scope": "environment:write" } }, @@ -647,9 +614,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["projects_read"] } ], "summary": "List all projects", @@ -661,6 +625,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["projects_read"]], "x-oauth-scope": "projects:read" }, "post": { @@ -700,9 +665,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_projects_create"] } ], "summary": "Create a project", @@ -714,6 +676,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["organization_projects_create"]], "x-oauth-scope": "projects:write" } }, @@ -837,9 +800,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organizations_read"] } ], "summary": "List all organizations", @@ -851,6 +811,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organizations_read"]], "x-oauth-scope": "organizations:read" }, "post": { @@ -893,14 +854,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organizations_create"] } ], "summary": "Create an organization", "tags": ["Organizations"], - "x-endpoint-owners": ["management-api", "billing"] + "x-endpoint-owners": ["management-api", "billing"], + "x-fga-permissions": [["organizations_create"]] } }, "/v1/oauth/authorize": { @@ -913,6 +872,7 @@ "in": "query", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "66666666-6666-4666-8666-666666666666", "type": "string" } @@ -1008,6 +968,7 @@ "description": "Resource indicator for MCP (Model Context Protocol) clients", "schema": { "format": "uri", + "example": "https://mcp.supabase.com/projects", "type": "string" } } @@ -1017,11 +978,6 @@ "description": "" } }, - "security": [ - { - "oauth2": ["read"] - } - ], "summary": "[Beta] Authorize user through oauth", "tags": ["OAuth"], "x-endpoint-owners": ["auth", "management-api"] @@ -1054,11 +1010,6 @@ } } }, - "security": [ - { - "oauth2": ["write"] - } - ], "summary": "[Beta] Exchange auth code for user's access and refresh token", "tags": ["OAuth"], "x-endpoint-owners": ["auth", "management-api"] @@ -1083,11 +1034,6 @@ "description": "" } }, - "security": [ - { - "oauth2": ["write"] - } - ], "summary": "[Beta] Revoke oauth app authorization and it's corresponding tokens", "tags": ["OAuth"], "x-endpoint-owners": ["auth", "management-api"] @@ -1117,6 +1063,7 @@ "in": "query", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "66666666-6666-4666-8666-666666666666", "type": "string" } @@ -1195,14 +1142,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_write", "project_admin_write"] } ], "summary": "Authorize user through oauth and claim a project", "tags": ["OAuth"], - "x-endpoint-owners": ["management-api"] + "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_admin_write", "project_admin_write"]] } }, "/v1/snippets": { @@ -1286,9 +1231,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["snippets_read"] } ], "summary": "Lists SQL snippets for the logged in user", @@ -1300,6 +1242,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["snippets_read"]], "x-oauth-scope": "database:read" } }, @@ -1313,6 +1256,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "44444444-4444-4444-8444-444444444444", "type": "string" } @@ -1345,9 +1289,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["snippets_read"] } ], "summary": "Gets a specific SQL snippet", @@ -1359,6 +1300,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["snippets_read"]], "x-oauth-scope": "database:read" } }, @@ -1389,9 +1331,9 @@ } }, "/v1/projects/{ref}/actions": { - "get": { - "description": "Returns a paginated list of action runs of the specified project.", - "operationId": "v1-list-action-runs", + "head": { + "description": "Returns the total number of action runs of the specified project.", + "operationId": "v1-count-action-runs", "parameters": [ { "name": "ref", @@ -1405,38 +1347,21 @@ "example": "abcdefghijklmnopqrst", "type": "string" } - }, - { - "name": "offset", - "required": false, - "in": "query", - "schema": { - "minimum": 0, - "example": 0, - "type": "number" - } - }, - { - "name": "limit", - "required": false, - "in": "query", - "schema": { - "minimum": 10, - "example": 20, - "type": "number" - } } ], "responses": { "200": { - "description": "", - "content": { - "application/json": { + "headers": { + "X-Total-Count": { "schema": { - "$ref": "#/components/schemas/ListActionRunResponse" - } + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "description": "total count value" } - } + }, + "description": "" }, "401": { "description": "Unauthorized" @@ -1448,18 +1373,15 @@ "description": "Rate limit exceeded" }, "500": { - "description": "Failed to list action runs" + "description": "Failed to count action runs" } }, "security": [ { "bearer": [] - }, - { - "fga_permissions": ["action_runs_read"] } ], - "summary": "List all action runs", + "summary": "Count the number of action runs", "tags": ["Environments"], "x-badges": [ { @@ -1467,12 +1389,12 @@ "position": "after" } ], - "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["action_runs_read"]], "x-oauth-scope": "environment:read" }, - "head": { - "description": "Returns the total number of action runs of the specified project.", - "operationId": "v1-count-action-runs", + "get": { + "description": "Returns a paginated list of action runs of the specified project.", + "operationId": "v1-list-action-runs", "parameters": [ { "name": "ref", @@ -1486,21 +1408,38 @@ "example": "abcdefghijklmnopqrst", "type": "string" } + }, + { + "name": "offset", + "required": false, + "in": "query", + "schema": { + "minimum": 0, + "example": 0, + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "minimum": 10, + "example": 20, + "type": "number" + } } ], "responses": { "200": { - "headers": { - "X-Total-Count": { + "description": "", + "content": { + "application/json": { "schema": { - "type": "integer", - "format": "int64", - "minimum": 0 - }, - "description": "total count value" + "$ref": "#/components/schemas/ListActionRunResponse" + } } - }, - "description": "" + } }, "401": { "description": "Unauthorized" @@ -1512,18 +1451,15 @@ "description": "Rate limit exceeded" }, "500": { - "description": "Failed to count action runs" + "description": "Failed to list action runs" } }, "security": [ { "bearer": [] - }, - { - "fga_permissions": ["action_runs_read"] } ], - "summary": "Count the number of action runs", + "summary": "List all action runs", "tags": ["Environments"], "x-badges": [ { @@ -1531,6 +1467,8 @@ "position": "after" } ], + "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["action_runs_read"]], "x-oauth-scope": "environment:read" } }, @@ -1590,9 +1528,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["action_runs_read"] } ], "summary": "Get the status of an action run", @@ -1604,6 +1539,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["action_runs_read"]], "x-oauth-scope": "environment:read" } }, @@ -1673,9 +1609,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["action_runs_write"] } ], "summary": "Update the status of an action run", @@ -1687,6 +1620,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["action_runs_write"]], "x-oauth-scope": "environment:write" } }, @@ -1746,9 +1680,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["action_runs_read"] } ], "summary": "Get the logs of an action run", @@ -1760,6 +1691,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["action_runs_read"]], "x-oauth-scope": "environment:read" } }, @@ -1784,10 +1716,10 @@ "name": "reveal", "required": false, "in": "query", - "description": "Boolean string, true or false", + "description": "Boolean string.\n\nTruthy values: `true`, `1`, `yes`, `on`, `y`, `enabled`\n\nFalsy values: `false`, `0`, `no`, `off`, `n`, `disabled`", "schema": { - "example": true, - "type": "boolean" + "example": "true", + "type": "string" } } ], @@ -1818,9 +1750,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_read"] } ], "summary": "Get project api keys", @@ -1832,6 +1761,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_read"]], "x-oauth-scope": "secrets:read" }, "post": { @@ -1854,10 +1784,10 @@ "name": "reveal", "required": false, "in": "query", - "description": "Boolean string, true or false", + "description": "Boolean string.\n\nTruthy values: `true`, `1`, `yes`, `on`, `y`, `enabled`\n\nFalsy values: `false`, `0`, `no`, `off`, `n`, `disabled`", "schema": { - "example": true, - "type": "boolean" + "example": "true", + "type": "string" } } ], @@ -1895,9 +1825,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_write"] } ], "summary": "Creates a new API key for the project", @@ -1909,6 +1836,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_write"]], "x-oauth-scope": "secrets:write" } }, @@ -1954,9 +1882,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_read"] } ], "summary": "Check whether JWT based legacy (anon, service_role) API keys are enabled. This API endpoint will be removed in the future, check for HTTP 404 Not Found.", @@ -1968,6 +1893,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_read"]], "x-oauth-scope": "secrets:read" }, "put": { @@ -1990,10 +1916,10 @@ "name": "enabled", "required": true, "in": "query", - "description": "Boolean string, true or false", + "description": "Boolean string.\n\nTruthy values: `true`, `1`, `yes`, `on`, `y`, `enabled`\n\nFalsy values: `false`, `0`, `no`, `off`, `n`, `disabled`", "schema": { - "example": true, - "type": "boolean" + "example": "true", + "type": "string" } } ], @@ -2021,9 +1947,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_write"] } ], "summary": "Disable or re-enable JWT based legacy (anon, service_role) API keys. This API endpoint will be removed in the future, check for HTTP 404 Not Found.", @@ -2035,6 +1958,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_write"]], "x-oauth-scope": "secrets:write" } }, @@ -2061,6 +1985,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "22222222-2222-4222-8222-222222222222", "type": "string" } @@ -2069,10 +1994,10 @@ "name": "reveal", "required": false, "in": "query", - "description": "Boolean string, true or false", + "description": "Boolean string.\n\nTruthy values: `true`, `1`, `yes`, `on`, `y`, `enabled`\n\nFalsy values: `false`, `0`, `no`, `off`, `n`, `disabled`", "schema": { - "example": true, - "type": "boolean" + "example": "true", + "type": "string" } } ], @@ -2110,9 +2035,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_write"] } ], "summary": "Updates an API key for the project", @@ -2124,6 +2046,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_write"]], "x-oauth-scope": "secrets:write" }, "get": { @@ -2148,6 +2071,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "22222222-2222-4222-8222-222222222222", "type": "string" } @@ -2156,10 +2080,10 @@ "name": "reveal", "required": false, "in": "query", - "description": "Boolean string, true or false", + "description": "Boolean string.\n\nTruthy values: `true`, `1`, `yes`, `on`, `y`, `enabled`\n\nFalsy values: `false`, `0`, `no`, `off`, `n`, `disabled`", "schema": { - "example": true, - "type": "boolean" + "example": "true", + "type": "string" } } ], @@ -2187,9 +2111,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_read"] } ], "summary": "Get API key", @@ -2201,6 +2122,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_read"]], "x-oauth-scope": "secrets:read" }, "delete": { @@ -2225,6 +2147,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "22222222-2222-4222-8222-222222222222", "type": "string" } @@ -2236,7 +2159,7 @@ "description": "Boolean string, true or false", "schema": { "example": true, - "type": "boolean" + "type": "string" } }, { @@ -2246,7 +2169,7 @@ "description": "Boolean string, true or false", "schema": { "example": false, - "type": "boolean" + "type": "string" } }, { @@ -2283,9 +2206,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["api_gateway_keys_write"] } ], "summary": "Deletes an API key for the project", @@ -2297,6 +2217,7 @@ } ], "x-endpoint-owners": ["auth", "management-api"], + "x-fga-permissions": [["api_gateway_keys_write"]], "x-oauth-scope": "secrets:write" } }, @@ -2340,12 +2261,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_read"] - }, - { - "fga_permissions": ["branching_development_read"] } ], "summary": "List all database branches", @@ -2357,6 +2272,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_read"], ["branching_production_read"]], "x-oauth-scope": "environment:read" }, "post": { @@ -2405,12 +2321,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_create"] - }, - { - "fga_permissions": ["branching_development_create"] } ], "summary": "Create a database branch", @@ -2422,6 +2332,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_create"], ["branching_production_create"]], "x-oauth-scope": "environment:write" }, "delete": { @@ -2462,9 +2373,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_delete"] } ], "summary": "Disables preview branching", @@ -2476,6 +2384,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_production_delete"]], "x-oauth-scope": "environment:write" } }, @@ -2525,12 +2434,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["branching_production_read"] - }, - { - "fga_permissions": ["branching_development_read"] } ], "summary": "Get a database branch", @@ -2542,6 +2445,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["branching_development_read"], ["branching_production_read"]], "x-oauth-scope": "environment:read" } }, @@ -2590,9 +2494,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["custom_domain_read"] } ], "summary": "[Beta] Gets project's custom hostname config", @@ -2604,6 +2505,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["custom_domain_read"]], "x-oauth-scope": "domains:read" }, "delete": { @@ -2628,8 +2530,7 @@ "in": "query", "description": "If true, also removes the custom domain add-on from the project subscription.", "schema": { - "default": "false", - "type": "boolean" + "type": "string" } } ], @@ -2653,9 +2554,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["custom_domain_write"] } ], "summary": "[Beta] Deletes a project's custom hostname configuration", @@ -2667,6 +2565,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["custom_domain_write"]], "x-oauth-scope": "domains:write" } }, @@ -2725,9 +2624,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["custom_domain_write"] } ], "summary": "[Beta] Updates project's custom hostname configuration", @@ -2739,6 +2635,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["custom_domain_write"]], "x-oauth-scope": "domains:write" } }, @@ -2787,9 +2684,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["custom_domain_write"] } ], "summary": "[Beta] Attempts to verify the DNS configuration for project's custom hostname configuration", @@ -2801,6 +2695,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["custom_domain_write"]], "x-oauth-scope": "domains:write" } }, @@ -2849,9 +2744,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["custom_domain_write"] } ], "summary": "[Beta] Activates a custom hostname for a project.", @@ -2863,6 +2755,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["custom_domain_write"]], "x-oauth-scope": "domains:write" } }, @@ -2890,7 +2783,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JitStateResponse" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "type": "object", + "properties": { + "state": { + "type": "string", + "enum": ["enabled", "disabled"] + }, + "appliedSuccessfully": { + "type": "boolean" + } + }, + "required": ["state"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "state": { + "type": "string", + "const": "unavailable" + }, + "unavailableReason": { + "type": "string", + "enum": [ + "postgres_upgrade_required", + "ssl_enforcement_required", + "temporarily_unavailable" + ] + } + }, + "required": ["state", "unavailableReason"], + "additionalProperties": false + } + ] } } } @@ -2911,9 +2839,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read"] } ], "summary": "[Beta] Get project's temporary access configuration.", @@ -2925,6 +2850,7 @@ } ], "x-endpoint-owners": ["security", "management-api"], + "x-fga-permissions": [["project_admin_read"]], "x-oauth-scope": "database:read" }, "put": { @@ -2960,7 +2886,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JitStateResponse" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "type": "object", + "properties": { + "state": { + "type": "string", + "enum": ["enabled", "disabled"] + }, + "appliedSuccessfully": { + "type": "boolean" + } + }, + "required": ["state"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "state": { + "type": "string", + "const": "unavailable" + }, + "unavailableReason": { + "type": "string", + "enum": [ + "postgres_upgrade_required", + "ssl_enforcement_required", + "temporarily_unavailable" + ] + } + }, + "required": ["state", "unavailableReason"], + "additionalProperties": false + } + ] } } } @@ -2981,9 +2942,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "[Beta] Update project's temporary access configuration.", @@ -2995,6 +2953,7 @@ } ], "x-endpoint-owners": ["security", "management-api"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "database:write" } }, @@ -3043,9 +3002,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_network_bans_read"] } ], "summary": "[Beta] Gets project's network bans", @@ -3057,6 +3013,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["database_network_bans_read"]], "x-oauth-scope": "projects:read" } }, @@ -3105,9 +3062,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_network_bans_read"] } ], "summary": "[Beta] Gets project's network bans with additional information about which databases they affect", @@ -3119,6 +3073,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["database_network_bans_read"]], "x-oauth-scope": "projects:read" } }, @@ -3170,9 +3125,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_network_bans_write"] } ], "summary": "[Beta] Remove network bans.", @@ -3184,6 +3136,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["database_network_bans_write"]], "x-oauth-scope": "projects:write" } }, @@ -3232,9 +3185,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_network_restrictions_read"] } ], "summary": "[Beta] Gets project's network restrictions", @@ -3246,6 +3196,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_network_restrictions_read"]], "x-oauth-scope": "projects:read" }, "patch": { @@ -3302,9 +3253,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_network_restrictions_write"] } ], "summary": "[Alpha] Updates project's network restrictions by adding or removing CIDRs", @@ -3316,6 +3264,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_network_restrictions_write"]], "x-oauth-scope": "projects:write" } }, @@ -3374,9 +3323,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_network_restrictions_write"] } ], "summary": "[Beta] Updates project's network restrictions", @@ -3388,6 +3334,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_network_restrictions_write"]], "x-oauth-scope": "projects:write" } }, @@ -3436,9 +3383,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "[Beta] Gets project's pgsodium config", @@ -3450,6 +3394,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "secrets:read" }, "put": { @@ -3506,9 +3451,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "[Beta] Updates project's pgsodium config. Updating the root_key can cause all data encrypted with the older key to become inaccessible.", @@ -3520,6 +3462,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "secrets:write" } }, @@ -3568,9 +3511,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["data_api_config_read"] } ], "summary": "Gets project's postgrest config", @@ -3582,6 +3522,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["data_api_config_read"]], "x-oauth-scope": "rest:read" }, "patch": { @@ -3638,9 +3579,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["data_api_config_write"] } ], "summary": "Updates project's postgrest config", @@ -3652,6 +3590,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["data_api_config_write"]], "x-oauth-scope": "rest:write" } }, @@ -3700,9 +3639,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read"] } ], "summary": "Gets a specific project that belongs to the authenticated user", @@ -3714,6 +3650,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["project_admin_read"]], "x-oauth-scope": "projects:read" }, "delete": { @@ -3757,9 +3694,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "Deletes the given project", @@ -3771,6 +3705,7 @@ } ], "x-endpoint-owners": ["management-api", "infra", "dev-workflows"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "projects:write" }, "patch": { @@ -3827,9 +3762,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "Updates the given project", @@ -3841,6 +3773,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "projects:write" } }, @@ -3893,9 +3826,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_secrets_read"] } ], "summary": "List all secrets", @@ -3907,6 +3837,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_secrets_read"]], "x-oauth-scope": "secrets:read" }, "post": { @@ -3957,9 +3888,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_secrets_write"] } ], "summary": "Bulk create secrets", @@ -3971,6 +3899,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_secrets_write"]], "x-oauth-scope": "secrets:write" }, "delete": { @@ -4021,9 +3950,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_secrets_write"] } ], "summary": "Bulk delete secrets", @@ -4035,6 +3961,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_secrets_write"]], "x-oauth-scope": "secrets:write" } }, @@ -4083,9 +4010,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_ssl_config_read"] } ], "summary": "[Beta] Get project's SSL enforcement configuration.", @@ -4097,6 +4021,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_ssl_config_read"]], "x-oauth-scope": "database:read" }, "put": { @@ -4153,9 +4078,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_ssl_config_write"] } ], "summary": "[Beta] Update project's SSL enforcement configuration.", @@ -4167,6 +4089,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_ssl_config_write"]], "x-oauth-scope": "database:write" } }, @@ -4226,9 +4149,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_read"] } ], "summary": "Generate TypeScript types", @@ -4240,6 +4160,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["database_read"]], "x-oauth-scope": "database:read" } }, @@ -4298,9 +4219,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["vanity_subdomain_read"] } ], "summary": "[Beta] Gets current vanity subdomain config", @@ -4317,6 +4235,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["vanity_subdomain_read"]], "x-oauth-scope": "domains:read" }, "delete": { @@ -4356,9 +4275,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["vanity_subdomain_write"] } ], "summary": "[Beta] Deletes a project's vanity subdomain configuration", @@ -4370,6 +4286,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["vanity_subdomain_write"]], "x-oauth-scope": "domains:write" } }, @@ -4438,9 +4355,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["vanity_subdomain_write"] } ], "summary": "[Beta] Checks vanity subdomain availability", @@ -4457,6 +4371,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["vanity_subdomain_write"]], "x-oauth-scope": "domains:write" } }, @@ -4525,9 +4440,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["vanity_subdomain_write"] } ], "summary": "[Beta] Activates a vanity subdomain for a project.", @@ -4544,6 +4456,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["vanity_subdomain_write"]], "x-oauth-scope": "domains:write" } }, @@ -4602,9 +4515,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write", "database_write"] } ], "summary": "[Beta] Upgrades the project's Postgres version", @@ -4616,6 +4526,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_write", "database_write"]], "x-oauth-scope": "projects:write" } }, @@ -4664,9 +4575,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read", "database_read"] } ], "summary": "[Beta] Returns the project's eligibility for upgrades", @@ -4678,6 +4586,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_read", "database_read"]], "x-oauth-scope": "projects:read" } }, @@ -4735,9 +4644,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read", "database_read"] } ], "summary": "[Beta] Gets the latest status of the project's upgrade", @@ -4749,6 +4655,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_read", "database_read"]], "x-oauth-scope": "projects:read" } }, @@ -4797,9 +4704,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_readonly_config_read"] } ], "summary": "Returns project's readonly mode status", @@ -4811,6 +4715,7 @@ } ], "x-endpoint-owners": ["management-api", "infra", "support-tooling"], + "x-fga-permissions": [["database_readonly_config_read"]], "x-oauth-scope": "database:read" } }, @@ -4852,9 +4757,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_readonly_config_write"] } ], "summary": "Disables project's readonly mode for the next 15 minutes", @@ -4866,6 +4768,7 @@ } ], "x-endpoint-owners": ["management-api", "infra", "support-tooling"], + "x-fga-permissions": [["database_readonly_config_write"]], "x-oauth-scope": "database:write" } }, @@ -4927,9 +4830,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_read_replicas_write"] } ], "summary": "[Beta] Set up a read replica", @@ -4941,7 +4841,8 @@ "position": "before" } ], - "x-endpoint-owners": ["management-api", "infra"] + "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["infra_read_replicas_write"]] } }, "/v1/projects/{ref}/read-replicas/remove": { @@ -4992,14 +4893,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_read_replicas_write"] } ], "summary": "[Beta] Remove a read replica", "tags": ["Database"], - "x-endpoint-owners": ["management-api", "infra"] + "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["infra_read_replicas_write"]] } }, "/v1/projects/{ref}/health": { @@ -5023,22 +4922,34 @@ "name": "services", "required": true, "in": "query", + "description": "Comma-separated list of enums or array of enums.", "schema": { - "example": ["auth", "rest"], - "type": "array", - "items": { - "type": "string", - "enum": [ - "auth", - "db", - "db_postgres_user", - "pooler", - "realtime", - "rest", - "storage", - "pg_bouncer" - ] - } + "example": ["auth,db", "auth"], + "anyOf": [ + { + "type": "string", + "description": "Comma-separated list of enums:\n\n- `auth`\n- `db`\n- `db_postgres_user`\n- `pooler`\n- `realtime`\n- `rest`\n- `storage`\n- `pg_bouncer`", + "example": ["auth,db", "auth"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "auth", + "db", + "db_postgres_user", + "pooler", + "realtime", + "rest", + "storage", + "pg_bouncer" + ] + }, + "description": "Array of enums.", + "example": ["{field}=auth&{field}=db", "{field}=auth"] + } + ] } }, { @@ -5083,9 +4994,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read"] } ], "summary": "Gets project's service health status", @@ -5097,6 +5005,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_read"]], "x-oauth-scope": "projects:read" } }, @@ -5142,9 +5051,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_write"] } ], "summary": "Set up the project's existing JWT secret as an in_use JWT signing key. This endpoint will be removed in the future always check for HTTP 404 Not Found.", @@ -5156,6 +5062,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_write"]], "x-oauth-scope": "secrets:write" }, "get": { @@ -5199,9 +5106,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_read"] } ], "summary": "Get the signing key information for the JWT secret imported as signing key for this project. This endpoint will be removed in the future, check for HTTP 404 Not Found.", @@ -5213,6 +5117,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_read"]], "x-oauth-scope": "secrets:read" } }, @@ -5268,9 +5173,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_write"] } ], "summary": "Create a new signing key for the project in standby status", @@ -5282,6 +5184,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_write"]], "x-oauth-scope": "secrets:write" }, "get": { @@ -5325,9 +5228,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_read"] } ], "summary": "List all signing keys for the project", @@ -5339,6 +5239,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_read"]], "x-oauth-scope": "secrets:read" } }, @@ -5352,6 +5253,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "33333333-3333-4333-8333-333333333333", "type": "string" } @@ -5394,14 +5296,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_read"] } ], "summary": "Get information about a signing key", "tags": ["Auth"], - "x-endpoint-owners": ["auth"] + "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_read"]] }, "delete": { "operationId": "v1-remove-project-signing-key", @@ -5412,6 +5312,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "33333333-3333-4333-8333-333333333333", "type": "string" } @@ -5454,9 +5355,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_write"] } ], "summary": "Remove a signing key from a project. Only possible if the key has been in revoked status for a while.", @@ -5468,6 +5366,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_write"]], "x-oauth-scope": "secrets:write" }, "patch": { @@ -5479,6 +5378,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "33333333-3333-4333-8333-333333333333", "type": "string" } @@ -5531,9 +5431,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_signing_keys_write"] } ], "summary": "Update a signing key, mainly its status", @@ -5545,6 +5442,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_signing_keys_write"]], "x-oauth-scope": "secrets:write" } }, @@ -5593,9 +5491,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_read"] } ], "summary": "Gets project's auth config", @@ -5607,6 +5502,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_read"]], "x-oauth-scope": "auth:read" }, "patch": { @@ -5663,9 +5559,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_write", "project_admin_write"] } ], "summary": "Updates a project's auth config", @@ -5677,6 +5570,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_write", "project_admin_write"]], "x-oauth-scope": "auth:write" } }, @@ -5732,9 +5626,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_write"] } ], "summary": "Creates a new third-party auth integration", @@ -5746,6 +5637,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_write"]], "x-oauth-scope": "auth:write" }, "get": { @@ -5792,9 +5684,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_read"] } ], "summary": "Lists all third-party auth integrations", @@ -5806,6 +5695,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_read"]], "x-oauth-scope": "auth:read" } }, @@ -5832,6 +5722,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "88888888-8888-4888-8888-888888888888", "type": "string" } @@ -5861,9 +5752,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_write"] } ], "summary": "Removes a third-party auth integration", @@ -5875,6 +5763,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_write"]], "x-oauth-scope": "auth:write" }, "get": { @@ -5899,6 +5788,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "88888888-8888-4888-8888-888888888888", "type": "string" } @@ -5928,9 +5818,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_read"] } ], "summary": "Get a third-party integration", @@ -5942,6 +5829,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_read"]], "x-oauth-scope": "auth:read" } }, @@ -5980,9 +5868,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "Pauses the given project", @@ -5994,6 +5879,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "projects:write" } }, @@ -6032,9 +5918,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "Restarts the given project", @@ -6046,6 +5929,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "projects:write" } }, @@ -6091,9 +5975,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read"] } ], "summary": "Lists available restore versions for the given project", @@ -6105,6 +5986,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_read"]], "x-oauth-scope": "projects:read" }, "post": { @@ -6141,9 +6023,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "Restores the given project", @@ -6155,6 +6034,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "projects:write" } }, @@ -6193,9 +6073,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_write"] } ], "summary": "Cancels the given project restoration", @@ -6207,6 +6084,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["project_admin_write"]], "x-oauth-scope": "projects:write" } }, @@ -6256,14 +6134,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_add_ons_read"] } ], "summary": "List billing addons and compute instance selections", "tags": ["Billing"], - "x-endpoint-owners": ["billing"] + "x-endpoint-owners": ["billing"], + "x-fga-permissions": [["infra_add_ons_read"]] }, "patch": { "description": "Selects an addon variant, for example scaling the project’s compute instance up or down, and applies it to the project.", @@ -6313,14 +6189,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_add_ons_write"] } ], "summary": "Apply or update billing addons, including compute instance size", "tags": ["Billing"], - "x-endpoint-owners": ["billing"] + "x-endpoint-owners": ["billing"], + "x-fga-permissions": [["infra_add_ons_write"]] } }, "/v1/projects/{ref}/billing/addons/{addon_variant}": { @@ -6347,7 +6221,7 @@ "in": "path", "schema": { "example": "pitr_7", - "oneOf": [ + "anyOf": [ { "type": "string", "enum": [ @@ -6407,14 +6281,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_add_ons_write"] } ], "summary": "Remove billing addons or revert compute instance sizing", "tags": ["Billing"], - "x-endpoint-owners": ["billing"] + "x-endpoint-owners": ["billing"], + "x-fga-permissions": [["infra_add_ons_write"]] } }, "/v1/projects/{ref}/claim-token": { @@ -6459,14 +6331,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["project_admin_read"] } ], "summary": "Gets project claim token", "tags": ["Projects"], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["project_admin_read"]], "x-internal": true }, "post": { @@ -6510,14 +6380,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_write", "project_admin_write"] } ], "summary": "Creates project claim token", "tags": ["Projects"], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_admin_write", "project_admin_write"]], "x-internal": true }, "delete": { @@ -6554,14 +6422,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_write", "project_admin_write"] } ], "summary": "Revokes project claim token", "tags": ["Projects"], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_admin_write", "project_admin_write"]], "x-internal": true } }, @@ -6609,9 +6475,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["advisors_read"] } ], "summary": "Gets project performance advisors.", @@ -6623,6 +6486,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["advisors_read"]], "x-oauth-scope": "database:read" } }, @@ -6680,9 +6544,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["advisors_read"] } ], "summary": "Gets project security advisors.", @@ -6694,6 +6555,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["advisors_read"]], "x-oauth-scope": "database:read" } }, @@ -6722,6 +6584,7 @@ "in": "query", "description": "Custom SQL query to execute on the logs. See [querying logs](/docs/guides/telemetry/logs?queryGroups=product&product=postgres&queryGroups=source&source=edge_logs#querying-with-the-logs-explorer) for more details.", "schema": { + "example": "select event_message from edge_logs limit 10", "type": "string" } }, @@ -6731,6 +6594,7 @@ "in": "query", "schema": { "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "example": "2025-03-01T00:00:00Z", "type": "string" } @@ -6741,6 +6605,7 @@ "in": "query", "schema": { "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "example": "2025-03-01T23:59:59Z", "type": "string" } @@ -6773,9 +6638,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["analytics_logs_read"] } ], "summary": "Gets project's logs", @@ -6787,6 +6649,7 @@ } ], "x-endpoint-owners": ["analytics"], + "x-fga-permissions": [["analytics_logs_read"]], "x-oauth-scope": "analytics:read" } }, @@ -6815,6 +6678,7 @@ "in": "query", "description": "Custom SQL query to execute on the logs. See [querying logs](/docs/guides/telemetry/logs?queryGroups=product&product=postgres&queryGroups=source&source=edge_logs#querying-with-the-logs-explorer) for more details.", "schema": { + "example": "select event_message from edge_logs limit 10", "type": "string" } }, @@ -6824,6 +6688,7 @@ "in": "query", "schema": { "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "example": "2025-03-01T00:00:00Z", "type": "string" } @@ -6834,6 +6699,7 @@ "in": "query", "schema": { "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "example": "2025-03-01T23:59:59Z", "type": "string" } @@ -6866,9 +6732,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["analytics_logs_read"] } ], "summary": "Gets all project's logs in a single log stream", @@ -6880,6 +6743,7 @@ } ], "x-endpoint-owners": ["analytics"], + "x-fga-permissions": [["analytics_logs_read"]], "x-oauth-scope": "analytics:read" } }, @@ -6938,14 +6802,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["analytics_usage_read"] } ], "summary": "Gets project's usage api counts", "tags": ["Analytics"], - "x-endpoint-owners": ["analytics"] + "x-endpoint-owners": ["analytics"], + "x-fga-permissions": [["analytics_usage_read"]] } }, "/v1/projects/{ref}/analytics/endpoints/usage.api-requests-count": { @@ -6993,14 +6855,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["analytics_usage_read"] } ], "summary": "Gets project's usage api requests count", "tags": ["Analytics"], - "x-endpoint-owners": ["analytics"] + "x-endpoint-owners": ["analytics"], + "x-fga-permissions": [["analytics_usage_read"]] } }, "/v1/projects/{ref}/analytics/endpoints/functions.combined-stats": { @@ -7067,14 +6927,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["analytics_usage_read"] } ], "summary": "Gets a project's function combined statistics", "tags": ["Analytics"], - "x-endpoint-owners": ["analytics"] + "x-endpoint-owners": ["analytics"], + "x-fga-permissions": [["analytics_usage_read"]] } }, "/v1/projects/{ref}/analytics/endpoints/metrics": { @@ -7128,9 +6986,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["analytics_logs_read"] } ], "summary": "Scrape a project's metrics", @@ -7142,6 +6997,7 @@ } ], "x-endpoint-owners": ["analytics"], + "x-fga-permissions": [["analytics_logs_read"]], "x-oauth-scope": "analytics:read" } }, @@ -7200,9 +7056,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_write"] } ], "summary": "[Beta] Create a login role for CLI with temporary password", @@ -7214,6 +7067,7 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["database_write"]], "x-oauth-scope": "database:write" }, "delete": { @@ -7260,9 +7114,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_write"] } ], "summary": "[Beta] Delete existing login roles used by CLI", @@ -7274,12 +7125,12 @@ } ], "x-endpoint-owners": ["dev-workflows"], + "x-fga-permissions": [["database_write"]], "x-oauth-scope": "database:write" } }, "/v1/projects/{ref}/database/migrations": { "get": { - "description": "Only available to selected partner OAuth apps", "operationId": "v1-list-migration-history", "parameters": [ { @@ -7323,9 +7174,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_migrations_read"] } ], "summary": "List applied migration versions", @@ -7337,10 +7185,10 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_migrations_read"]], "x-oauth-scope": "database:read" }, "post": { - "description": "Only available to selected partner OAuth apps", "operationId": "v1-apply-a-migration", "parameters": [ { @@ -7396,9 +7244,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_migrations_write"] } ], "summary": "Apply a database migration", @@ -7410,10 +7255,10 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_migrations_write"]], "x-oauth-scope": "database:write" }, "put": { - "description": "Only available to selected partner OAuth apps", "operationId": "v1-upsert-a-migration", "parameters": [ { @@ -7469,9 +7314,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_migrations_write"] } ], "summary": "Upsert a database migration without applying", @@ -7483,10 +7325,10 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_migrations_write"]], "x-oauth-scope": "database:write" }, "delete": { - "description": "Only available to selected partner OAuth apps", "operationId": "v1-rollback-migrations", "parameters": [ { @@ -7534,9 +7376,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_migrations_write"] } ], "summary": "Rollback database migrations and remove them from history table", @@ -7548,12 +7387,12 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_migrations_write"]], "x-oauth-scope": "database:write" } }, "/v1/projects/{ref}/database/migrations/{version}": { "get": { - "description": "Only available to selected partner OAuth apps", "operationId": "v1-get-a-migration", "parameters": [ { @@ -7607,9 +7446,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_migrations_read"] } ], "summary": "Fetch an existing entry from migration history", @@ -7621,10 +7457,10 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_migrations_read"]], "x-oauth-scope": "database:read" }, "patch": { - "description": "Only available to selected partner OAuth apps", "operationId": "v1-patch-a-migration", "parameters": [ { @@ -7681,9 +7517,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_migrations_write"] } ], "summary": "Patch an existing entry in migration history", @@ -7695,6 +7528,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_migrations_write"]], "x-oauth-scope": "database:write" } }, @@ -7746,12 +7580,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_write"] - }, - { - "fga_permissions": ["database_read"] } ], "summary": "[Beta] Run sql query", @@ -7763,6 +7591,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["database_read"], ["database_write"]], "x-oauth-scope": "database:write" } }, @@ -7815,9 +7644,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_read"] } ], "summary": "[Beta] Run a sql query as supabase_read_only_user", @@ -7829,6 +7655,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["database_read"]], "x-oauth-scope": "database:read" } }, @@ -7870,9 +7697,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_webhooks_config_write"] } ], "summary": "[Beta] Enables Database Webhooks on the project", @@ -7884,6 +7708,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["database_webhooks_config_write"]], "x-oauth-scope": "database:write" } }, @@ -7931,9 +7756,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_read"] } ], "summary": "Gets database metadata for the given project.", @@ -7945,6 +7767,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["database_read"]], "x-oauth-scope": "projects:read" } }, @@ -8002,10 +7825,7 @@ }, "security": [ { - "bearer": [] - }, - { - "fga_permissions": ["database_config_write"] + "bearer": [] } ], "summary": "Updates the database password", @@ -8017,6 +7837,7 @@ } ], "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["database_config_write"]], "x-oauth-scope": "database:write" } }, @@ -8066,9 +7887,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_read"] } ], "summary": "Get user-id to role mappings for JIT access", @@ -8080,6 +7898,7 @@ } ], "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_read"]], "x-oauth-scope": "database:read" }, "post": { @@ -8137,9 +7956,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_read"] } ], "summary": "Authorize user-id to role mappings for JIT access", @@ -8151,6 +7967,7 @@ } ], "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_read"]], "x-oauth-scope": "database:read" }, "put": { @@ -8208,14 +8025,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_write"] } ], "summary": "Updates a user mapping for JIT access", "tags": ["Database"], - "x-endpoint-owners": ["security"] + "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_write"]] } }, "/v1/projects/{ref}/database/jit/list": { @@ -8264,14 +8079,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_read"] } ], "summary": "List all user-id to role mappings for JIT access", "tags": ["Database"], - "x-endpoint-owners": ["security"] + "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_write"]] } }, "/v1/projects/{ref}/database/jit/invite": { @@ -8330,14 +8143,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_write"] } ], "summary": "Invites an external user to a database for JIT access", "tags": ["Database"], - "x-endpoint-owners": ["security"] + "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_write"]] } }, "/v1/projects/{ref}/database/jit/invite/accept": { @@ -8418,6 +8229,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "55555555-5555-4555-8555-555555555555", "type": "string" } @@ -8443,14 +8255,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_write"] } ], "summary": "Deletes the invite for an external user to a database for JIT access", "tags": ["Database"], - "x-endpoint-owners": ["security"] + "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_write"]] } }, "/v1/projects/{ref}/database/jit/{user_id}": { @@ -8477,6 +8287,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "55555555-5555-4555-8555-555555555555", "type": "string" } @@ -8502,14 +8313,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_jit_write"] } ], "summary": "Delete JIT access by user-id", "tags": ["Database"], - "x-endpoint-owners": ["security"] + "x-endpoint-owners": ["security"], + "x-fga-permissions": [["database_jit_write"]] } }, "/v1/projects/{ref}/database/openapi": { @@ -8568,9 +8377,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_read"] } ], "summary": "Get PostgREST OpenAPI spec", @@ -8582,6 +8388,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["database_read"]], "x-oauth-scope": "database:read" } }, @@ -8634,9 +8441,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_read"] } ], "summary": "List all functions", @@ -8648,6 +8452,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_read"]], "x-oauth-scope": "edge_functions:read" }, "post": { @@ -8691,20 +8496,18 @@ "name": "verify_jwt", "required": false, "in": "query", - "description": "Boolean string, true or false", "schema": { "example": true, - "type": "boolean" + "type": "string" } }, { "name": "import_map", "required": false, "in": "query", - "description": "Boolean string, true or false", "schema": { "example": false, - "type": "boolean" + "type": "string" } }, { @@ -8781,9 +8584,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_write"] } ], "summary": "Create a function", @@ -8795,6 +8595,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_write"]], "x-oauth-scope": "edge_functions:write" }, "put": { @@ -8855,9 +8656,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_write"] } ], "summary": "Bulk update functions", @@ -8869,6 +8667,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_write"]], "x-oauth-scope": "edge_functions:write" } }, @@ -8904,10 +8703,9 @@ "name": "bundleOnly", "required": false, "in": "query", - "description": "Boolean string, true or false", "schema": { "example": false, - "type": "boolean" + "type": "string" } } ], @@ -8951,9 +8749,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_write"] } ], "summary": "Deploy a function", @@ -8965,6 +8760,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_write"]], "x-oauth-scope": "edge_functions:write" } }, @@ -9025,9 +8821,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_read"] } ], "summary": "Retrieve a function", @@ -9039,6 +8832,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_read"]], "x-oauth-scope": "edge_functions:read" }, "patch": { @@ -9092,20 +8886,18 @@ "name": "verify_jwt", "required": false, "in": "query", - "description": "Boolean string, true or false", "schema": { "example": true, - "type": "boolean" + "type": "string" } }, { "name": "import_map", "required": false, "in": "query", - "description": "Boolean string, true or false", "schema": { "example": false, - "type": "boolean" + "type": "string" } }, { @@ -9179,9 +8971,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_write"] } ], "summary": "Update a function", @@ -9193,6 +8982,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_write"]], "x-oauth-scope": "edge_functions:write" }, "delete": { @@ -9244,9 +9034,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_write"] } ], "summary": "Delete a function", @@ -9258,6 +9045,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_write"]], "x-oauth-scope": "edge_functions:write" } }, @@ -9318,9 +9106,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["edge_functions_read"] } ], "summary": "Retrieve a function body", @@ -9332,6 +9117,7 @@ } ], "x-endpoint-owners": ["functions"], + "x-fga-permissions": [["edge_functions_read"]], "x-oauth-scope": "edge_functions:read" } }, @@ -9383,9 +9169,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["storage_read"] } ], "summary": "Lists all buckets", @@ -9397,6 +9180,7 @@ } ], "x-endpoint-owners": ["storage"], + "x-fga-permissions": [["storage_read"]], "x-oauth-scope": "storage:read" } }, @@ -9445,14 +9229,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_disk_config_read"] } ], "summary": "Get database disk attributes", "tags": ["Projects"], - "x-endpoint-owners": ["management-api", "infra"] + "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["infra_disk_config_read"]] }, "post": { "operationId": "v1-modify-database-disk", @@ -9501,14 +9283,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_disk_config_write"] } ], "summary": "Modify database disk", "tags": ["Projects"], - "x-endpoint-owners": ["management-api", "infra"] + "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["infra_disk_config_write"]] } }, "/v1/projects/{ref}/config/disk/util": { @@ -9556,14 +9336,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_disk_config_read"] } ], "summary": "Get disk utilization", "tags": ["Projects"], - "x-endpoint-owners": ["management-api", "infra"] + "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["infra_disk_config_read"]] } }, "/v1/projects/{ref}/config/disk/autoscale": { @@ -9611,14 +9389,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["infra_disk_config_read"] } ], "summary": "Gets project disk autoscale config", "tags": ["Projects"], - "x-endpoint-owners": ["management-api", "infra"] + "x-endpoint-owners": ["management-api", "infra"], + "x-fga-permissions": [["infra_disk_config_read"]] } }, "/v1/projects/{ref}/config/storage": { @@ -9666,14 +9442,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["storage_config_read"] } ], "summary": "Gets project's storage config", "tags": ["Storage"], - "x-endpoint-owners": ["storage"] + "x-endpoint-owners": ["storage"], + "x-fga-permissions": [["storage_config_read"]] }, "patch": { "operationId": "v1-update-storage-config", @@ -9722,14 +9496,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["storage_config_write"] } ], "summary": "Updates project's storage config", "tags": ["Storage"], - "x-endpoint-owners": ["storage"] + "x-endpoint-owners": ["storage"], + "x-fga-permissions": [["storage_config_write"]] } }, "/v1/projects/{ref}/config/database/pgbouncer": { @@ -9774,11 +9546,6 @@ "description": "Failed to retrieve project's pgbouncer config" } }, - "security": [ - { - "fga_permissions": ["database_read"] - } - ], "summary": "Get project's pgbouncer config", "tags": ["Database"], "x-badges": [ @@ -9788,6 +9555,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_read"]], "x-oauth-scope": "database:read" } }, @@ -9839,9 +9607,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_pooling_config_read"] } ], "summary": "Gets project's supavisor config", @@ -9853,6 +9618,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_pooling_config_read"]], "x-oauth-scope": "database:read" }, "patch": { @@ -9909,9 +9675,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_pooling_config_write"] } ], "summary": "Updates project's supavisor config", @@ -9923,6 +9686,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["database_pooling_config_write"]], "x-oauth-scope": "database:write" } }, @@ -9971,9 +9735,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_config_read"] } ], "summary": "Gets project's Postgres config", @@ -9985,6 +9746,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_config_read"]], "x-oauth-scope": "database:read" }, "put": { @@ -10041,9 +9803,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["database_config_write"] } ], "summary": "Updates project's Postgres config", @@ -10055,6 +9814,7 @@ } ], "x-endpoint-owners": ["infra", "management-api"], + "x-fga-permissions": [["database_config_write"]], "x-oauth-scope": "database:write" } }, @@ -10100,14 +9860,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["realtime_config_read"] } ], "summary": "Gets realtime configuration", "tags": ["Realtime"], - "x-endpoint-owners": ["realtime"] + "x-endpoint-owners": ["realtime"], + "x-fga-permissions": [["realtime_config_read"]] }, "patch": { "operationId": "v1-update-realtime-config", @@ -10153,14 +9911,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["realtime_config_write"] } ], "summary": "Updates realtime configuration", "tags": ["Realtime"], - "x-endpoint-owners": ["realtime"] + "x-endpoint-owners": ["realtime"], + "x-fga-permissions": [["realtime_config_write"]] } }, "/v1/projects/{ref}/config/realtime/shutdown": { @@ -10201,14 +9957,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["realtime_config_write"] } ], "summary": "Shutdowns realtime connections for a project", "tags": ["Realtime"], - "x-endpoint-owners": ["realtime"] + "x-endpoint-owners": ["realtime"], + "x-fga-permissions": [["realtime_config_write"]] } }, "/v1/projects/{ref}/config/auth/sso/providers": { @@ -10266,9 +10020,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_write"] } ], "summary": "Creates a new SSO provider", @@ -10280,6 +10031,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_write"]], "x-oauth-scope": "auth:write" }, "get": { @@ -10326,9 +10078,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_read"] } ], "summary": "Lists all SSO providers", @@ -10340,6 +10089,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_read"]], "x-oauth-scope": "auth:read" } }, @@ -10366,6 +10116,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "77777777-7777-4777-8777-777777777777", "type": "string" } @@ -10398,9 +10149,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_read"] } ], "summary": "Gets a SSO provider by its UUID", @@ -10412,6 +10160,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_read"]], "x-oauth-scope": "auth:read" }, "put": { @@ -10436,6 +10185,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "77777777-7777-4777-8777-777777777777", "type": "string" } @@ -10478,9 +10228,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_write"] } ], "summary": "Updates a SSO provider by its UUID", @@ -10492,6 +10239,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_write"]], "x-oauth-scope": "auth:write" }, "delete": { @@ -10516,6 +10264,7 @@ "in": "path", "schema": { "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "example": "77777777-7777-4777-8777-777777777777", "type": "string" } @@ -10548,9 +10297,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["auth_config_write"] } ], "summary": "Removes a SSO provider by its UUID", @@ -10562,6 +10308,7 @@ } ], "x-endpoint-owners": ["auth"], + "x-fga-permissions": [["auth_config_write"]], "x-oauth-scope": "auth:write" } }, @@ -10610,9 +10357,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_read"] } ], "summary": "Lists all backups", @@ -10624,6 +10368,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_read"]], "x-oauth-scope": "database:read" } }, @@ -10672,9 +10417,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_write"] } ], "summary": "Restores a PITR backup for a database", @@ -10686,6 +10428,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_write"]], "x-oauth-scope": "database:write" } }, @@ -10741,9 +10484,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_write"] } ], "summary": "Initiates a creation of a restore point for a database", @@ -10755,6 +10495,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_write"]], "x-internal": true, "x-oauth-scope": "database:write" }, @@ -10811,9 +10552,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_read"] } ], "summary": "Get restore points for project", @@ -10825,6 +10563,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_read"]], "x-internal": true, "x-oauth-scope": "database:read" } @@ -10874,9 +10613,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_write"] } ], "summary": "Restores a physical backup for a database", @@ -10888,6 +10624,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_write"]], "x-internal": true, "x-oauth-scope": "database:write" } @@ -10950,9 +10687,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_read"] } ], "summary": "Gets the backup schedule for a project", @@ -10969,6 +10703,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_read"]], "x-oauth-scope": "database:read" }, "patch": { @@ -11042,9 +10777,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_write"] } ], "summary": "Updates the backup schedule time for a project", @@ -11061,6 +10793,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_write"]], "x-oauth-scope": "database:write" } }, @@ -11109,9 +10842,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["backups_write"] } ], "summary": "Initiates an undo to a given restore point", @@ -11123,6 +10853,7 @@ } ], "x-endpoint-owners": ["infra"], + "x-fga-permissions": [["backups_write"]], "x-internal": true, "x-oauth-scope": "database:write" } @@ -11168,9 +10899,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_read"] } ], "summary": "Get entitlements for an organization", @@ -11182,6 +10910,7 @@ } ], "x-endpoint-owners": ["billing"], + "x-fga-permissions": [["organization_admin_read"]], "x-oauth-scope": "organizations:read" } }, @@ -11219,9 +10948,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["members_read"] } ], "summary": "List members of an organization", @@ -11233,6 +10959,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["members_read"]], "x-oauth-scope": "organizations:read" } }, @@ -11276,9 +11003,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_read"] } ], "summary": "Gets information about the organization", @@ -11290,6 +11014,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_admin_read"]], "x-oauth-scope": "organizations:read" } }, @@ -11342,14 +11067,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_write"] } ], "summary": "Gets project details for the specified organization and claim token", "tags": ["Organizations"], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_admin_write"]], "x-internal": true }, "post": { @@ -11393,14 +11116,12 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_admin_write"] } ], "summary": "Claims project for the specified organization", "tags": ["Organizations"], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_admin_write"]], "x-internal": true } }, @@ -11427,6 +11148,7 @@ "description": "Number of projects to skip", "schema": { "minimum": 0, + "maximum": 9007199254740991, "default": 0, "example": 0, "type": "integer" @@ -11505,9 +11227,6 @@ "security": [ { "bearer": [] - }, - { - "fga_permissions": ["organization_projects_read"] } ], "summary": "Gets all projects for the given organization", @@ -11519,6 +11238,7 @@ } ], "x-endpoint-owners": ["management-api"], + "x-fga-permissions": [["organization_projects_read"]], "x-oauth-scope": "projects:read" } } @@ -11565,8 +11285,9 @@ }, "db_port": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "db_user": { "type": "string" @@ -11598,9 +11319,9 @@ "type": "string" }, "reset_on_push": { - "type": "boolean", "description": "This field is deprecated and will be ignored. Use v1-reset-a-branch endpoint directly instead.", - "deprecated": true + "deprecated": true, + "type": "boolean" }, "persistent": { "type": "boolean" @@ -11638,7 +11359,8 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "name": { "type": "string" @@ -11657,12 +11379,14 @@ }, "pr_number": { "type": "integer", - "format": "int32" + "format": "int32", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "latest_check_run_id": { - "type": "number", "description": "This field is deprecated and will not be populated.", - "deprecated": true + "deprecated": true, + "type": "number" }, "persistent": { "type": "boolean" @@ -11682,15 +11406,18 @@ }, "created_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "updated_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "review_requested_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "with_data": { "type": "boolean" @@ -11701,7 +11428,8 @@ }, "deletion_scheduled_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "preview_project_status": { "type": "string", @@ -11888,9 +11616,9 @@ "description": "Name of your project" }, "organization_id": { - "type": "string", + "deprecated": true, "description": "Deprecated: Use `organization_slug` instead.", - "deprecated": true + "type": "string" }, "organization_slug": { "type": "string", @@ -11899,13 +11627,12 @@ "example": "tsrqponmlkjihgfedcba" }, "plan": { - "type": "string", - "enum": ["free", "pro"], "deprecated": true, - "description": "Subscription Plan is now set on organization level and is ignored in this request" + "description": "Subscription Plan is now set on organization level and is ignored in this request", + "type": "string", + "enum": ["free", "pro"] }, "region": { - "type": "string", "description": "Region you want your server to reside in. Use region_selection instead.", "deprecated": true, "enum": [ @@ -11927,12 +11654,11 @@ "ca-central-1", "ap-south-1", "sa-east-1" - ] + ], + "type": "string" }, "region_selection": { - "discriminator": { - "propertyName": "type" - }, + "description": "Region selection. Only one of region or region_selection can be specified.", "oneOf": [ { "type": "object", @@ -11983,13 +11709,12 @@ }, "required": ["type", "code"] } - ], - "description": "Region selection. Only one of region or region_selection can be specified." + ] }, "kps_enabled": { - "type": "boolean", "deprecated": true, - "description": "This field is deprecated and is ignored in this request" + "description": "This field is deprecated and is ignored in this request", + "type": "boolean" }, "desired_instance_size": { "description": "Desired instance size. Omit this field to always default to the smallest possible size.", @@ -12017,24 +11742,31 @@ ] }, "template_url": { + "description": "Template URL used to create the project from the CLI.", "type": "string", - "format": "uri", - "description": "Template URL used to create the project from the CLI." + "format": "uri" + }, + "release_channel": { + "deprecated": true, + "type": "null" + }, + "postgres_engine": { + "deprecated": true, + "type": "null" }, "high_availability": { - "type": "boolean", - "description": "[Experimental] Whether to enable high availability for the project." + "description": "[Experimental] Whether to enable high availability for the project.", + "type": "boolean" } }, "required": ["db_pass", "name", "organization_slug"], - "additionalProperties": false, - "hideDefinitions": ["release_channel", "postgres_engine"], "example": { "db_pass": "correct-horse-battery-staple", "name": "acme-prod", "organization_slug": "tsrqponmlkjihgfedcba", "region": "us-east-1" - } + }, + "additionalProperties": false }, "V1ProjectResponse": { "type": "object", @@ -12167,7 +11899,7 @@ }, "provider": { "type": "string", - "enum": ["AWS", "FLY", "AWS_K8S", "AWS_NIMBUS"] + "enum": ["AWS", "AWS_K8S", "AWS_NIMBUS"] }, "status": { "type": "string", @@ -12240,7 +11972,7 @@ }, "provider": { "type": "string", - "enum": ["AWS", "FLY", "AWS_K8S", "AWS_NIMBUS"] + "enum": ["AWS", "AWS_K8S", "AWS_NIMBUS"] }, "status": { "type": "string", @@ -12285,10 +12017,10 @@ } }, "required": ["name"], - "additionalProperties": false, "example": { "name": "Acme" - } + }, + "additionalProperties": false }, "OAuthTokenBody": { "type": "object", @@ -12303,7 +12035,8 @@ }, "client_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "client_secret": { "type": "string" @@ -12321,19 +12054,18 @@ "type": "string" }, "assertion": { - "type": "string", - "description": "IDJAG assertion JWT for grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer. Beta - available on Team and Enterprise plans only." + "description": "IDJAG assertion JWT for grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer. Beta - available on Team and Enterprise plans only.", + "type": "string" }, "resource": { + "description": "Resource indicator for MCP (Model Context Protocol) clients", "type": "string", - "format": "uri", - "description": "Resource indicator for MCP (Model Context Protocol) clients" + "format": "uri" }, "scope": { "type": "string" } }, - "additionalProperties": false, "example": { "grant_type": "authorization_code", "client_id": "66666666-6666-4666-8666-666666666666", @@ -12342,7 +12074,8 @@ "code_verifier": "qW0Z6d9pQnW0mL1dK1q9wFq6Yz2nV5rA8jT3mP7sH4c", "redirect_uri": "https://app.acme.com/auth/callback", "scope": "projects:read projects:write" - } + }, + "additionalProperties": false }, "OAuthTokenResponse": { "type": "object", @@ -12351,11 +12084,13 @@ "type": "string" }, "refresh_token": { - "type": "string", - "description": "The `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type issues access tokens only, no refresh token is returned and the token cannot be revoked via `/v1/oauth/revoke`." + "description": "The `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type issues access tokens only, no refresh token is returned and the token cannot be revoked via `/v1/oauth/revoke`.", + "type": "string" }, "expires_in": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "token_type": { "type": "string", @@ -12370,7 +12105,8 @@ "properties": { "client_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "client_secret": { "type": "string" @@ -12380,12 +12116,12 @@ } }, "required": ["client_id", "client_secret", "refresh_token"], - "additionalProperties": false, "example": { "client_id": "66666666-6666-4666-8666-666666666666", "client_secret": "sb_secret_live_example_9f4d3a206b2e4a7e8c91", "refresh_token": "oauth_refresh_9f4d3a206b2e4a7e8c91" - } + }, + "additionalProperties": false }, "SnippetList": { "type": "object", @@ -12550,9 +12286,9 @@ "type": "object", "properties": { "favorite": { - "type": "boolean", "deprecated": true, - "description": "Deprecated: Rely on root-level favorite property instead." + "description": "Deprecated: Rely on root-level favorite property instead.", + "type": "boolean" }, "schema_version": { "type": "string" @@ -12795,7 +12531,7 @@ }, "type": { "type": "string", - "enum": ["legacy", "publishable", "secret"], + "enum": ["legacy", "publishable", "secret", null], "nullable": true }, "prefix": { @@ -12815,17 +12551,22 @@ }, "secret_jwt_template": { "type": "object", + "propertyNames": { + "type": "string" + }, "additionalProperties": {}, "nullable": true }, "inserted_at": { "type": "string", "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "nullable": true }, "updated_at": { "type": "string", "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "nullable": true } }, @@ -12859,6 +12600,9 @@ }, "secret_jwt_template": { "type": "object", + "propertyNames": { + "type": "string" + }, "additionalProperties": {}, "nullable": true } @@ -12885,6 +12629,9 @@ }, "secret_jwt_template": { "type": "object", + "propertyNames": { + "type": "string" + }, "additionalProperties": {}, "nullable": true } @@ -12972,6 +12719,37 @@ "notify_url": "https://example.com/webhooks/branches" } }, + "UpdateCustomHostnameResponseJsonValue": { + "description": "Any JSON-serializable value", + "anyOf": [ + { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "nullable": true + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpdateCustomHostnameResponseJsonValue" + } + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateCustomHostnameResponseJsonValue" + } + } + ] + }, "UpdateCustomHostnameResponse": { "type": "object", "properties": { @@ -12997,13 +12775,13 @@ "errors": { "type": "array", "items": { - "description": "Any JSON-serializable value" + "$ref": "#/components/schemas/UpdateCustomHostnameResponseJsonValue" } }, "messages": { "type": "array", "items": { - "description": "Any JSON-serializable value" + "$ref": "#/components/schemas/UpdateCustomHostnameResponseJsonValue" } }, "result": { @@ -13092,52 +12870,14 @@ "properties": { "custom_hostname": { "type": "string", - "maxLength": 253, - "minLength": 1 - } - }, - "required": ["custom_hostname"], - "example": { - "custom_hostname": "docs.example.com" - } - }, - "JitStateResponse": { - "discriminator": { - "propertyName": "state" - }, - "oneOf": [ - { - "type": "object", - "properties": { - "state": { - "type": "string", - "enum": ["enabled", "disabled"] - }, - "appliedSuccessfully": { - "type": "boolean" - } - }, - "required": ["state"] - }, - { - "type": "object", - "properties": { - "state": { - "type": "string", - "enum": ["unavailable"] - }, - "unavailableReason": { - "type": "string", - "enum": [ - "postgres_upgrade_required", - "ssl_enforcement_required", - "temporarily_unavailable" - ] - } - }, - "required": ["state", "unavailableReason"] + "minLength": 1, + "maxLength": 253 } - ] + }, + "required": ["custom_hostname"], + "example": { + "custom_hostname": "docs.example.com" + } }, "JitAccessRequestRequest": { "type": "object", @@ -13200,8 +12940,8 @@ }, "requester_ip": { "default": false, - "type": "boolean", - "description": "Include requester's public IP in the list of addresses to unban." + "description": "Include requester's public IP in the list of addresses to unban.", + "type": "boolean" }, "identifier": { "type": "string" @@ -13236,9 +12976,14 @@ } } }, + "example": { + "dbAllowedCidrs": ["203.0.113.0/24"], + "dbAllowedCidrsV6": ["2001:db8::/32"] + }, "description": "At any given point in time, this is the config that the user has requested be applied to their project. The `status` field indicates if it has been applied to the project, or is pending. When an updated config is received, the applied config is moved to `old_config`." }, "old_config": { + "description": "Populated when a new config has been received, but not registered as successfully applied to a project.", "type": "object", "properties": { "dbAllowedCidrs": { @@ -13257,8 +13002,7 @@ "example": { "dbAllowedCidrs": ["203.0.113.0/24"], "dbAllowedCidrsV6": ["2001:db8::/32"] - }, - "description": "Populated when a new config has been received, but not registered as successfully applied to a project." + } }, "status": { "type": "string", @@ -13266,11 +13010,13 @@ }, "updated_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "applied_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" } }, "required": ["entitlement", "config", "status"] @@ -13373,6 +13119,7 @@ "description": "At any given point in time, this is the config that the user has requested be applied to their project. The `status` field indicates if it has been applied to the project, or is pending. When an updated config is received, the applied config is moved to `old_config`." }, "old_config": { + "description": "Populated when a new config has been received, but not registered as successfully applied to a project.", "type": "object", "properties": { "dbAllowedCidrs": { @@ -13391,16 +13138,17 @@ "required": ["address", "type"] } } - }, - "description": "Populated when a new config has been received, but not registered as successfully applied to a project." + } }, "updated_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "applied_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "status": { "type": "string", @@ -13442,20 +13190,26 @@ "type": "string" }, "max_rows": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "db_extra_search_path": { "type": "string" }, "db_pool": { "type": "integer", - "nullable": true, - "description": "If `null`, the value is automatically configured based on compute size." + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "If `null`, the value is automatically configured based on compute size.", + "nullable": true }, "db_pool_acquisition_timeout": { "type": "integer", - "nullable": true, - "description": "If `null`, the value is automatically configured to 10." + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "If `null`, the value is automatically configured to 10.", + "nullable": true }, "jwt_secret": { "type": "string" @@ -13507,20 +13261,26 @@ "type": "string" }, "max_rows": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "db_extra_search_path": { "type": "string" }, "db_pool": { "type": "integer", - "nullable": true, - "description": "If `null`, the value is automatically configured based on compute size." + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "If `null`, the value is automatically configured based on compute size.", + "nullable": true }, "db_pool_acquisition_timeout": { "type": "integer", - "nullable": true, - "description": "If `null`, the value is automatically configured to 10." + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "If `null`, the value is automatically configured to 10.", + "nullable": true } }, "required": [ @@ -13535,7 +13295,9 @@ "type": "object", "properties": { "id": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "ref": { "type": "string" @@ -13576,6 +13338,7 @@ "required": ["name", "value"] }, "CreateSecretBody": { + "maxItems": 100, "type": "array", "items": { "type": "object", @@ -13593,7 +13356,6 @@ }, "required": ["name", "value"] }, - "maxItems": 100, "example": [ { "name": "OPENAI_API_KEY", @@ -13681,24 +13443,24 @@ "description": "Human-readable explanation of the plan gate" }, "error": { + "description": "Present on entitlement denials. Other errors with this status code (validation, billing state) carry only message.", "type": "object", "properties": { "code": { "type": "string", - "enum": ["entitlement_required"], - "description": "Machine-readable marker for plan-gated denials" + "description": "Machine-readable marker for plan-gated denials", + "enum": ["entitlement_required"] }, "feature": { "type": "string", "description": "Entitlement feature key that failed the check" }, "upgrade_url": { - "type": "string", - "description": "Billing page URL for the organization, present when the org is resolvable" + "description": "Billing page URL for the organization, present when the org is resolvable", + "type": "string" } }, - "required": ["code", "feature"], - "description": "Present on entitlement denials. Other errors with this status code (validation, billing state) carry only message." + "required": ["code", "feature"] } }, "required": ["message"] @@ -13832,7 +13594,7 @@ "validation_errors": { "type": "array", "items": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": { @@ -13943,8 +13705,16 @@ "enum": ["user_defined_objects_in_internal_schemas"] }, "obj_type": { - "type": "string", - "enum": ["table", "function"] + "anyOf": [ + { + "type": "string", + "enum": ["table"] + }, + { + "type": "string", + "enum": ["function"] + } + ] }, "schema_name": { "type": "string" @@ -13994,9 +13764,6 @@ "warnings": { "type": "array", "items": { - "discriminator": { - "propertyName": "type" - }, "oneOf": [ { "type": "object", @@ -14188,7 +13955,7 @@ "enum": ["COMING_UP", "ACTIVE_HEALTHY", "UNHEALTHY"] }, "info": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": { @@ -14220,7 +13987,9 @@ "type": "boolean" }, "connected_cluster": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 } }, "required": [ @@ -14252,7 +14021,8 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "algorithm": { "type": "string", @@ -14267,14 +14037,16 @@ }, "created_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "updated_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" } }, - "required": ["id", "algorithm", "status", "created_at", "updated_at"], + "required": ["id", "algorithm", "status", "public_jwk", "created_at", "updated_at"], "additionalProperties": false }, "CreateSigningKeyBody": { @@ -14289,29 +14061,27 @@ "enum": ["in_use", "standby"] }, "private_jwk": { - "discriminator": { - "propertyName": "kty" - }, "oneOf": [ { "type": "object", "properties": { "kid": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "use": { "type": "string", "enum": ["sig"] }, "key_ops": { + "minItems": 2, + "maxItems": 2, "type": "array", "items": { "type": "string", "enum": ["sign", "verify"] - }, - "minItems": 2, - "maxItems": 2 + } }, "ext": { "type": "boolean", @@ -14359,20 +14129,21 @@ "properties": { "kid": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "use": { "type": "string", "enum": ["sig"] }, "key_ops": { + "minItems": 2, + "maxItems": 2, "type": "array", "items": { "type": "string", "enum": ["sign", "verify"] - }, - "minItems": 2, - "maxItems": 2 + } }, "ext": { "type": "boolean", @@ -14408,20 +14179,21 @@ "properties": { "kid": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "use": { "type": "string", "enum": ["sig"] }, "key_ops": { + "minItems": 2, + "maxItems": 2, "type": "array", "items": { "type": "string", "enum": ["sign", "verify"] - }, - "minItems": 2, - "maxItems": 2 + } }, "ext": { "type": "boolean", @@ -14454,20 +14226,21 @@ "properties": { "kid": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "use": { "type": "string", "enum": ["sig"] }, "key_ops": { + "minItems": 2, + "maxItems": 2, "type": "array", "items": { "type": "string", "enum": ["sign", "verify"] - }, - "minItems": 2, - "maxItems": 2 + } }, "ext": { "type": "boolean", @@ -14493,11 +14266,11 @@ } }, "required": ["algorithm"], - "additionalProperties": false, "example": { "algorithm": "RS256", "status": "standby" - } + }, + "additionalProperties": false }, "SigningKeysResponse": { "type": "object", @@ -14509,7 +14282,8 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "algorithm": { "type": "string", @@ -14524,14 +14298,16 @@ }, "created_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "updated_at": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" } }, - "required": ["id", "algorithm", "status", "created_at", "updated_at"], + "required": ["id", "algorithm", "status", "public_jwk", "created_at", "updated_at"], "additionalProperties": false } } @@ -14548,25 +14324,29 @@ } }, "required": ["status"], - "additionalProperties": false, "example": { "status": "standby" - } + }, + "additionalProperties": false }, "AuthConfigResponse": { "type": "object", "properties": { "api_max_request_duration": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "db_max_pool_size": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "db_max_pool_size_unit": { "type": "string", - "enum": ["connections", "percent"], + "enum": ["connections", "percent", null], "nullable": true }, "disable_signup": { @@ -15039,6 +14819,8 @@ }, "jwt_exp": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "mailer_allow_unverified_email_sign_ins": { @@ -15050,10 +14832,14 @@ "nullable": true }, "mailer_otp_exp": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "mailer_otp_length": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "mailer_secure_email_change_enabled": { @@ -15194,6 +14980,8 @@ }, "mfa_max_enrolled_factors": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "mfa_totp_enroll_enabled": { @@ -15236,7 +15024,9 @@ "nullable": true }, "mfa_phone_otp_length": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "mfa_phone_template": { "type": "string", @@ -15244,6 +15034,8 @@ }, "mfa_phone_max_frequency": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "nimbus_oauth_client_id": { @@ -15264,6 +15056,8 @@ }, "password_min_length": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "password_required_characters": { @@ -15272,36 +15066,51 @@ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~", - "" + "", + null ], "nullable": true }, "rate_limit_anonymous_users": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "rate_limit_email_sent": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "rate_limit_sms_sent": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "rate_limit_token_refresh": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "rate_limit_verify": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "rate_limit_otp": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "rate_limit_web3": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "refresh_token_rotation_enabled": { @@ -15330,7 +15139,7 @@ }, "security_captcha_provider": { "type": "string", - "enum": ["turnstile", "hcaptcha"], + "enum": ["turnstile", "hcaptcha", null], "nullable": true }, "security_captcha_secret": { @@ -15343,6 +15152,8 @@ }, "security_refresh_token_reuse_interval": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "security_update_password_require_reauthentication": { @@ -15375,6 +15186,8 @@ }, "sms_max_frequency": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "sms_messagebird_access_key": { @@ -15387,14 +15200,18 @@ }, "sms_otp_exp": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "sms_otp_length": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "sms_provider": { "type": "string", - "enum": ["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"], + "enum": ["messagebird", "textlocal", "twilio", "twilio_verify", "vonage", null], "nullable": true }, "sms_template": { @@ -15408,6 +15225,7 @@ "sms_test_otp_valid_until": { "type": "string", "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", "nullable": true }, "sms_textlocal_api_key": { @@ -15461,6 +15279,7 @@ "smtp_admin_email": { "type": "string", "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", "nullable": true }, "smtp_host": { @@ -15469,6 +15288,8 @@ }, "smtp_max_frequency": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "smtp_pass": { @@ -15505,7 +15326,9 @@ "type": "boolean" }, "custom_oauth_max_providers": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 } }, "required": [ @@ -15768,6 +15591,7 @@ "smtp_admin_email": { "type": "string", "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", "nullable": true }, "smtp_host": { @@ -15977,7 +15801,7 @@ }, "security_captcha_provider": { "type": "string", - "enum": ["turnstile", "hcaptcha"], + "enum": ["turnstile", "hcaptcha", null], "nullable": true }, "security_captcha_secret": { @@ -16069,7 +15893,8 @@ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~", - "" + "", + null ], "nullable": true }, @@ -16121,7 +15946,7 @@ }, "sms_provider": { "type": "string", - "enum": ["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"], + "enum": ["messagebird", "textlocal", "twilio", "twilio_verify", "vonage", null], "nullable": true }, "sms_messagebird_access_key": { @@ -16140,6 +15965,7 @@ "sms_test_otp_valid_until": { "type": "string", "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", "nullable": true }, "sms_textlocal_api_key": { @@ -16648,15 +16474,19 @@ }, "db_max_pool_size": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "db_max_pool_size_unit": { "type": "string", - "enum": ["connections", "percent"], + "enum": ["connections", "percent", null], "nullable": true }, "api_max_request_duration": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "mfa_totp_enroll_enabled": { @@ -16765,7 +16595,8 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "type": { "type": "string" @@ -16823,6 +16654,37 @@ }, "required": ["available_versions"] }, + "ListProjectAddonsResponseJsonValue": { + "description": "Any JSON-serializable value", + "anyOf": [ + { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "nullable": true + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListProjectAddonsResponseJsonValue" + } + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ListProjectAddonsResponseJsonValue" + } + } + ] + }, "ListProjectAddonsResponse": { "type": "object", "properties": { @@ -16848,7 +16710,7 @@ "type": "object", "properties": { "id": { - "oneOf": [ + "anyOf": [ { "type": "string", "enum": [ @@ -16926,7 +16788,7 @@ "required": ["description", "type", "interval", "amount"] }, "meta": { - "description": "Any JSON-serializable value" + "$ref": "#/components/schemas/ListProjectAddonsResponseJsonValue" } }, "required": ["id", "name", "price"] @@ -16962,7 +16824,7 @@ "type": "object", "properties": { "id": { - "oneOf": [ + "anyOf": [ { "type": "string", "enum": [ @@ -17040,7 +16902,7 @@ "required": ["description", "type", "interval", "amount"] }, "meta": { - "description": "Any JSON-serializable value" + "$ref": "#/components/schemas/ListProjectAddonsResponseJsonValue" } }, "required": ["id", "name", "price"] @@ -17057,7 +16919,7 @@ "type": "object", "properties": { "addon_variant": { - "oneOf": [ + "anyOf": [ { "type": "string", "enum": [ @@ -17129,7 +16991,8 @@ }, "created_by": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": ["token_alias", "expires_at", "created_at", "created_by"] @@ -17151,7 +17014,8 @@ }, "created_by": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": ["token", "token_alias", "expires_at", "created_at", "created_by"] @@ -17165,7 +17029,6 @@ "type": "object", "properties": { "name": { - "type": "string", "enum": [ "unindexed_foreign_keys", "auth_users_exposed", @@ -17196,7 +17059,8 @@ "leaked_service_key", "no_backup_admin", "vulnerable_postgres_version" - ] + ], + "type": "string" }, "title": { "type": "string" @@ -17280,7 +17144,7 @@ "items": {} }, "error": { - "oneOf": [ + "anyOf": [ { "type": "string" }, @@ -17337,7 +17201,8 @@ "properties": { "timestamp": { "type": "string", - "format": "date-time" + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|))$" }, "total_auth_requests": { "type": "number" @@ -17362,7 +17227,7 @@ } }, "error": { - "oneOf": [ + "anyOf": [ { "type": "string" }, @@ -17425,7 +17290,7 @@ } }, "error": { - "oneOf": [ + "anyOf": [ { "type": "string" }, @@ -17498,6 +17363,7 @@ "ttl_seconds": { "type": "integer", "minimum": 1, + "maximum": 9007199254740991, "format": "int64" } }, @@ -17676,12 +17542,12 @@ } }, "required": ["name"], - "additionalProperties": true + "additionalProperties": {} } } }, "required": ["name", "schemas"], - "additionalProperties": true + "additionalProperties": {} } } }, @@ -17714,7 +17580,8 @@ "properties": { "user_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "user_roles": { "type": "array", @@ -17737,7 +17604,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -17749,7 +17618,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -17775,8 +17646,18 @@ "minLength": 1 }, "rhost": { - "type": "string", - "minLength": 1 + "anyOf": [ + { + "type": "string", + "format": "ipv4", + "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$" + }, + { + "type": "string", + "format": "ipv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$" + } + ] } }, "required": ["role", "rhost"], @@ -17790,7 +17671,8 @@ "properties": { "user_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "user_role": { "type": "object", @@ -17811,7 +17693,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -17823,7 +17707,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -17846,13 +17732,14 @@ "items": { "type": "array", "items": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": { "user_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "primary_email": { "type": "string", @@ -17885,7 +17772,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -17897,7 +17786,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -17926,7 +17817,8 @@ }, "invite_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "expires_at": { "type": "string" @@ -17952,7 +17844,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -17964,7 +17858,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -17993,8 +17889,9 @@ "properties": { "user_id": { "type": "string", + "minLength": 1, "format": "uuid", - "minLength": 1 + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "roles": { "type": "array", @@ -18017,7 +17914,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -18029,7 +17928,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -18069,8 +17970,9 @@ "properties": { "email": { "type": "string", + "minLength": 1, "format": "email", - "minLength": 1 + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "roles": { "type": "array", @@ -18093,7 +17995,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -18105,7 +18009,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -18145,11 +18051,13 @@ "properties": { "email": { "type": "string", - "format": "email" + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "invite_id": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "user_roles": { "type": "array", @@ -18172,7 +18080,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$" } }, "required": ["cidr"] @@ -18184,7 +18094,9 @@ "type": "object", "properties": { "cidr": { - "type": "string" + "type": "string", + "format": "cidrv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$" } }, "required": ["cidr"] @@ -18207,8 +18119,9 @@ "properties": { "email": { "type": "string", + "minLength": 1, "format": "email", - "minLength": 1 + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "token": { "type": "string", @@ -18238,14 +18151,20 @@ "enum": ["ACTIVE", "REMOVED", "THROTTLED"] }, "version": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "created_at": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "updated_at": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "verify_jwt": { @@ -18312,11 +18231,15 @@ "enum": ["ACTIVE", "REMOVED", "THROTTLED"] }, "version": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "created_at": { "type": "integer", - "format": "int64" + "format": "int64", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "verify_jwt": { "type": "boolean" @@ -18370,14 +18293,20 @@ "enum": ["ACTIVE", "REMOVED", "THROTTLED"] }, "version": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "created_at": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "updated_at": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "verify_jwt": { @@ -18438,7 +18367,7 @@ "required": ["entrypoint_path"] } }, - "required": ["metadata"], + "required": ["file", "metadata"], "example": { "file": ["./supabase/functions/hello-world/index.ts"], "metadata": { @@ -18465,15 +18394,21 @@ "enum": ["ACTIVE", "REMOVED", "THROTTLED"] }, "version": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "created_at": { "type": "integer", - "format": "int64" + "format": "int64", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "updated_at": { "type": "integer", - "format": "int64" + "format": "int64", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "verify_jwt": { "type": "boolean" @@ -18511,14 +18446,20 @@ "enum": ["ACTIVE", "REMOVED", "THROTTLED"] }, "version": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "created_at": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "updated_at": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "verify_jwt": { @@ -18591,24 +18532,27 @@ "type": "object", "properties": { "attributes": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": { "iops": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "size_gb": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "throughput_mibps": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "type": { "type": "string", @@ -18622,13 +18566,15 @@ "properties": { "iops": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "size_gb": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "type": { "type": "string", @@ -18649,27 +18595,27 @@ "type": "object", "properties": { "attributes": { - "discriminator": { - "propertyName": "type" - }, "oneOf": [ { "type": "object", "properties": { "iops": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "size_gb": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "throughput_mibps": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "type": { "type": "string", @@ -18683,13 +18629,15 @@ "properties": { "iops": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "size_gb": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": true, + "maximum": 9007199254740991, + "minimum": 0 }, "type": { "type": "string", @@ -18740,24 +18688,24 @@ "properties": { "growth_percent": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true, - "nullable": true, - "description": "Growth percentage for disk autoscaling" + "exclusiveMinimum": 0, + "maximum": 9007199254740991, + "description": "Growth percentage for disk autoscaling", + "nullable": true }, "min_increment_gb": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true, - "nullable": true, - "description": "Minimum increment size for disk autoscaling in GB" + "exclusiveMinimum": 0, + "maximum": 9007199254740991, + "description": "Minimum increment size for disk autoscaling in GB", + "nullable": true }, "max_size_gb": { "type": "integer", - "minimum": 0, - "exclusiveMinimum": true, - "nullable": true, - "description": "Maximum limit the disk size will grow to in GB" + "exclusiveMinimum": 0, + "maximum": 9007199254740991, + "description": "Maximum limit the disk size will grow to in GB", + "nullable": true } }, "required": ["growth_percent", "min_increment_gb", "max_size_gb"] @@ -18767,6 +18715,8 @@ "properties": { "fileSizeLimit": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "format": "int64" }, "features": { @@ -18807,15 +18757,18 @@ }, "maxNamespaces": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 }, "maxTables": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 }, "maxCatalogs": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 } }, "required": ["enabled", "maxNamespaces", "maxTables", "maxCatalogs"] @@ -18828,11 +18781,13 @@ }, "maxBuckets": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 }, "maxIndexes": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 } }, "required": ["enabled", "maxBuckets", "maxIndexes"] @@ -18882,9 +18837,9 @@ "properties": { "fileSizeLimit": { "type": "integer", + "format": "int64", "minimum": 0, - "maximum": 536870912000, - "format": "int64" + "maximum": 536870912000 }, "features": { "type": "object", @@ -18924,15 +18879,18 @@ }, "maxNamespaces": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 }, "maxTables": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 }, "maxCatalogs": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 } }, "required": ["enabled", "maxNamespaces", "maxTables", "maxCatalogs"] @@ -18945,11 +18903,13 @@ }, "maxBuckets": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 }, "maxIndexes": { "type": "integer", - "minimum": 0 + "minimum": 0, + "maximum": 9007199254740991 } }, "required": ["enabled", "maxBuckets", "maxIndexes"] @@ -18967,7 +18927,6 @@ "required": ["upstreamTarget"] } }, - "additionalProperties": false, "example": { "fileSizeLimit": 10485760, "features": { @@ -18975,19 +18934,24 @@ "enabled": true } } - } + }, + "additionalProperties": false }, "V1PgbouncerConfigResponse": { "type": "object", "properties": { "default_pool_size": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "ignore_startup_parameters": { "type": "string" }, "max_client_conn": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "pool_mode": { "type": "string", @@ -18997,16 +18961,24 @@ "type": "string" }, "server_idle_timeout": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "server_lifetime": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "query_wait_timeout": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "reserve_pool_size": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 } } }, @@ -19030,7 +19002,9 @@ "type": "string" }, "db_port": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "db_name": { "type": "string" @@ -19044,10 +19018,14 @@ }, "default_pool_size": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "max_client_conn": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "pool_mode": { @@ -19080,9 +19058,9 @@ "nullable": true }, "pool_mode": { + "description": "Dedicated pooler mode for the project", "type": "string", - "enum": ["transaction", "session"], - "description": "Dedicated pooler mode for the project" + "enum": ["transaction", "session"] } }, "example": { @@ -19095,6 +19073,8 @@ "properties": { "default_pool_size": { "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, "nullable": true }, "pool_mode": { @@ -19186,7 +19166,9 @@ "maximum": 1024 }, "max_replication_slots": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "max_slot_wal_keep_size": { "type": "string" @@ -19206,7 +19188,9 @@ "type": "string" }, "max_wal_senders": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "max_worker_processes": { "type": "integer", @@ -19332,7 +19316,9 @@ "maximum": 1024 }, "max_replication_slots": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "max_slot_wal_keep_size": { "type": "string" @@ -19352,7 +19338,9 @@ "type": "string" }, "max_wal_senders": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "max_worker_processes": { "type": "integer", @@ -19397,82 +19385,82 @@ "type": "boolean" } }, - "additionalProperties": false, "example": { "max_connections": 120, "shared_buffers": "256MB", "work_mem": "4MB", "statement_timeout": "60000ms" - } + }, + "additionalProperties": false }, "RealtimeConfigResponse": { "type": "object", "properties": { "private_only": { "type": "boolean", - "nullable": true, - "description": "Whether to only allow private channels" + "description": "Whether to only allow private channels", + "nullable": true }, "connection_pool": { "type": "integer", "minimum": 1, "maximum": 100, - "nullable": true, - "description": "Sets connection pool size for Realtime Authorization" + "description": "Sets connection pool size for Realtime Authorization", + "nullable": true }, "max_concurrent_users": { "type": "integer", "minimum": 1, "maximum": 50000, - "nullable": true, - "description": "Sets maximum number of concurrent users rate limit" + "description": "Sets maximum number of concurrent users rate limit", + "nullable": true }, "max_events_per_second": { "type": "integer", "minimum": 1, "maximum": 50000, - "nullable": true, - "description": "Sets maximum number of events per second rate per channel limit" + "description": "Sets maximum number of events per second rate per channel limit", + "nullable": true }, "max_bytes_per_second": { "type": "integer", "minimum": 1, "maximum": 10000000, - "nullable": true, - "description": "Sets maximum number of bytes per second rate per channel limit" + "description": "Sets maximum number of bytes per second rate per channel limit", + "nullable": true }, "max_channels_per_client": { "type": "integer", "minimum": 1, "maximum": 10000, - "nullable": true, - "description": "Sets maximum number of channels per client rate limit" + "description": "Sets maximum number of channels per client rate limit", + "nullable": true }, "max_joins_per_second": { "type": "integer", "minimum": 1, "maximum": 5000, - "nullable": true, - "description": "Sets maximum number of joins per second rate limit" + "description": "Sets maximum number of joins per second rate limit", + "nullable": true }, "max_presence_events_per_second": { "type": "integer", "minimum": 1, "maximum": 5000, - "nullable": true, - "description": "Sets maximum number of presence events per second rate limit" + "description": "Sets maximum number of presence events per second rate limit", + "nullable": true }, "max_payload_size_in_kb": { "type": "integer", "minimum": 1, "maximum": 10000, - "nullable": true, - "description": "Sets maximum number of payload size in KB rate limit" + "description": "Sets maximum number of payload size in KB rate limit", + "nullable": true }, "suspend": { "type": "boolean", - "nullable": true, - "description": "Disables the Realtime service for this project when true. Set to false to re-enable it." + "description": "Disables the Realtime service for this project when true. Set to false to re-enable it.", + "nullable": true }, "presence_enabled": { "type": "boolean", @@ -19557,12 +19545,12 @@ "description": "Whether to enable presence" } }, - "additionalProperties": false, "example": { "private_only": false, "max_concurrent_users": 1000, "max_channels_per_client": 100 - } + }, + "additionalProperties": false }, "CreateProviderBody": { "type": "object", @@ -19602,7 +19590,7 @@ } }, "default": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": {} @@ -19996,7 +19984,7 @@ } }, "default": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": {} @@ -20252,7 +20240,9 @@ "type": "object", "properties": { "id": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "is_physical_backup": { "type": "boolean" @@ -20272,10 +20262,14 @@ "type": "object", "properties": { "earliest_physical_backup_date_unix": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "latest_physical_backup_date_unix": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 } } } @@ -20288,6 +20282,7 @@ "recovery_time_target_unix": { "type": "integer", "minimum": 0, + "maximum": 9007199254740991, "format": "int64" } }, @@ -20322,6 +20317,7 @@ "completed_on": { "type": "string", "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", "nullable": true } }, @@ -20331,7 +20327,9 @@ "type": "object", "properties": { "id": { - "type": "integer" + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 } }, "required": ["id"], @@ -20344,12 +20342,14 @@ "properties": { "schedule_for": { "type": "string", + "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", "description": "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", "example": "04:00:00" }, "updated_at": { "type": "string", "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$", "description": "Timestamp of when the backup schedule was last updated.", "example": "2026-05-04T14:40:44+00:00" } @@ -20361,6 +20361,7 @@ "properties": { "schedule_for": { "type": "string", + "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?$", "description": "Time of day to schedule daily backups, in UTC. Format: HH:MM:SS.", "example": "04:00:00" } @@ -20477,7 +20478,7 @@ "enum": ["boolean", "numeric", "set"] }, "config": { - "oneOf": [ + "anyOf": [ { "type": "object", "properties": { @@ -20570,7 +20571,6 @@ "opt_in_tags": { "type": "array", "items": { - "type": "string", "enum": [ "AI_SQL_GENERATOR_OPT_IN", "AI_DATA_GENERATOR_OPT_IN", @@ -20675,7 +20675,7 @@ }, "target_subscription_plan": { "type": "string", - "enum": ["free", "pro", "team", "enterprise", "platform"], + "enum": ["free", "pro", "team", "enterprise", "platform", null], "nullable": true } }, @@ -20697,7 +20697,8 @@ }, "created_by": { "type": "string", - "format": "uuid" + "format": "uuid", + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": ["project", "preview", "expires_at", "created_at", "created_by"] From 6804e339831ad118c8f431d30df2f915e3154d9f Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Wed, 5 Aug 2026 14:27:20 +0200 Subject: [PATCH 2/3] chore(api): handle refreshed schema constraints Preserve boolean query inputs, bound recursive schema introspection, and update strict contract fixtures. --- .../interactions.json | 2 +- .../branches/branches.format.unit.test.ts | 2 +- .../create/create.integration.test.ts | 2 +- .../branches/get/get.integration.test.ts | 4 +- .../branches/list/list.integration.test.ts | 6 +-- .../snippets/list/list.integration.test.ts | 2 +- .../snippets/snippets.format.unit.test.ts | 4 +- .../next/auth/platform-api.layer.unit.test.ts | 4 +- .../create/create.integration.test.ts | 2 +- .../branches/list/list.integration.test.ts | 6 +-- .../switch/switch.integration.test.ts | 4 +- .../commands/platform/platform-examples.ts | 16 ++++++- .../platform/platform-schema-introspection.ts | 11 ++++- .../platform-schema-text.unit.test.ts | 13 +++++- .../platform-schema.integration.test.ts | 2 +- apps/cli/src/shared/functions/deploy.ts | 2 +- packages/api/scripts/generate.ts | 18 +++++++- packages/api/scripts/generate.unit.test.ts | 38 ++++++++++++++++- packages/api/src/generated/contracts.ts | 42 ++++++++++++------- packages/api/src/internal/client.unit.test.ts | 4 +- 20 files changed, 140 insertions(+), 44 deletions(-) diff --git a/apps/cli-e2e/fixtures/scenarios/branches-list-returns-json-output-with-output-json/interactions.json b/apps/cli-e2e/fixtures/scenarios/branches-list-returns-json-output-with-output-json/interactions.json index d5945840c2..7473a87935 100644 --- a/apps/cli-e2e/fixtures/scenarios/branches-list-returns-json-output-with-output-json/interactions.json +++ b/apps/cli-e2e/fixtures/scenarios/branches-list-returns-json-output-with-output-json/interactions.json @@ -23,7 +23,7 @@ }, "body": [ { - "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "name": "test-branch", "project_ref": "branchrefaaaaaaaaa", "parent_project_ref": "__PROJECT_REF__", diff --git a/apps/cli/src/legacy/commands/branches/branches.format.unit.test.ts b/apps/cli/src/legacy/commands/branches/branches.format.unit.test.ts index a2b6ca496e..7fd835c670 100644 --- a/apps/cli/src/legacy/commands/branches/branches.format.unit.test.ts +++ b/apps/cli/src/legacy/commands/branches/branches.format.unit.test.ts @@ -13,7 +13,7 @@ describe("renderBranchesListTable", () => { it("renders all 8 columns in declared order", () => { const out = renderBranchesListTable([ { - id: "11111111-2222-3333-4444-555555555555", + id: "11111111-2222-4333-8444-555555555555", name: "feat-1", project_ref: "abcdefghijklmnopqrst", parent_project_ref: "parent-ref-aaaaaaaaa", diff --git a/apps/cli/src/legacy/commands/branches/create/create.integration.test.ts b/apps/cli/src/legacy/commands/branches/create/create.integration.test.ts index 5ea0d82e9f..132ff4b466 100644 --- a/apps/cli/src/legacy/commands/branches/create/create.integration.test.ts +++ b/apps/cli/src/legacy/commands/branches/create/create.integration.test.ts @@ -26,7 +26,7 @@ import { legacyBranchesCreate } from "./create.handler.ts"; type CreatedBranch = typeof V1CreateABranchOutput.Type; const CREATED: CreatedBranch = { - id: "11111111-2222-3333-4444-555555555555", + id: "11111111-2222-4333-8444-555555555555", name: "feat-x", project_ref: "aaaaaaaaaaaaaaaaaaaa", parent_project_ref: "bbbbbbbbbbbbbbbbbbbb", diff --git a/apps/cli/src/legacy/commands/branches/get/get.integration.test.ts b/apps/cli/src/legacy/commands/branches/get/get.integration.test.ts index 00a7d63012..53ae645158 100644 --- a/apps/cli/src/legacy/commands/branches/get/get.integration.test.ts +++ b/apps/cli/src/legacy/commands/branches/get/get.integration.test.ts @@ -64,8 +64,8 @@ const FIND: FindResponse = { is_default: false, persistent: false, status: "MIGRATIONS_PASSED", - created_at: "", - updated_at: "", + created_at: "2024-01-01T00:00:00Z", + updated_at: "2024-01-01T00:00:00Z", with_data: false, }; diff --git a/apps/cli/src/legacy/commands/branches/list/list.integration.test.ts b/apps/cli/src/legacy/commands/branches/list/list.integration.test.ts index 008fdbb855..33aa8a1c8d 100644 --- a/apps/cli/src/legacy/commands/branches/list/list.integration.test.ts +++ b/apps/cli/src/legacy/commands/branches/list/list.integration.test.ts @@ -17,7 +17,7 @@ import { legacyBranchesList } from "./list.handler.ts"; type Branches = typeof V1ListAllBranchesOutput.Type; const SAMPLE_BRANCH: Branches[number] = { - id: "11111111-2222-3333-4444-555555555555", + id: "11111111-2222-4333-8444-555555555555", name: "feat-1", project_ref: "aaaaaaaaaaaaaaaaaaaa", parent_project_ref: "bbbbbbbbbbbbbbbbbbbb", @@ -171,7 +171,7 @@ describe("legacy branches list integration", () => { expect(out.stdoutText).toBe(`- createdat: 2026-05-27T01:02:03Z deletionscheduledat: null gitbranch: feat-1 - id: 11111111-2222-3333-4444-555555555555 + id: 11111111-2222-4333-8444-555555555555 isdefault: false latestcheckrunid: null name: feat-1 @@ -226,7 +226,7 @@ describe("legacy branches list integration", () => { expect(out.stdoutText).toBe(`[[branches]] CreatedAt = 2026-05-27T01:02:03Z GitBranch = "feat-1" - Id = "11111111-2222-3333-4444-555555555555" + Id = "11111111-2222-4333-8444-555555555555" IsDefault = false Name = "feat-1" ParentProjectRef = "bbbbbbbbbbbbbbbbbbbb" diff --git a/apps/cli/src/legacy/commands/snippets/list/list.integration.test.ts b/apps/cli/src/legacy/commands/snippets/list/list.integration.test.ts index da845a438b..8786d173df 100644 --- a/apps/cli/src/legacy/commands/snippets/list/list.integration.test.ts +++ b/apps/cli/src/legacy/commands/snippets/list/list.integration.test.ts @@ -21,7 +21,7 @@ import { legacySnippetsList } from "./list.handler.ts"; type SnippetsResponse = typeof V1ListAllSnippetsOutput.Type; -const SNIPPET_ID = "00000000-0000-0000-0000-000000000001"; +const SNIPPET_ID = "00000000-0000-4000-8000-000000000001"; const SNIPPET_BASE = { id: SNIPPET_ID, diff --git a/apps/cli/src/legacy/commands/snippets/snippets.format.unit.test.ts b/apps/cli/src/legacy/commands/snippets/snippets.format.unit.test.ts index ddfe7e6607..d5afc6bbdf 100644 --- a/apps/cli/src/legacy/commands/snippets/snippets.format.unit.test.ts +++ b/apps/cli/src/legacy/commands/snippets/snippets.format.unit.test.ts @@ -16,7 +16,7 @@ describe("renderSnippetsTable", () => { it("preserves literal `|` characters in name, visibility, and owner (Glamour decodes Go's escape back)", () => { const out = renderSnippetsTable([ { - id: "00000000-0000-0000-0000-000000000001", + id: "00000000-0000-4000-8000-000000000001", name: "name|here", visibility: "user|public", owner: { username: "user|name" }, @@ -35,7 +35,7 @@ describe("renderSnippetsTable", () => { it("formats RFC3339 timestamps as UTC YYYY-MM-DD HH:MM:SS", () => { const out = renderSnippetsTable([ { - id: "00000000-0000-0000-0000-000000000001", + id: "00000000-0000-4000-8000-000000000001", name: "n", visibility: "user", owner: { username: "u" }, diff --git a/apps/cli/src/next/auth/platform-api.layer.unit.test.ts b/apps/cli/src/next/auth/platform-api.layer.unit.test.ts index 0004e26729..c3727980a5 100644 --- a/apps/cli/src/next/auth/platform-api.layer.unit.test.ts +++ b/apps/cli/src/next/auth/platform-api.layer.unit.test.ts @@ -166,7 +166,7 @@ describe("platformApiLayer", () => { return Effect.succeed( jsonResponse(request, 200, [ { - id: "00000000-0000-0000-0000-000000000001", + id: "00000000-0000-4000-8000-000000000001", name: "main", project_ref: "mainrefghijklmnopqrst", parent_project_ref: "parentrefabcdefghijk", @@ -219,7 +219,7 @@ describe("platformApiLayer", () => { return Effect.succeed( jsonResponse(request, 200, [ { - id: "00000000-0000-0000-0000-000000000001", + id: "00000000-0000-4000-8000-000000000001", name: "main", project_ref: "mainrefghijklmnopqrst", parent_project_ref: "parentrefabcdefghijk", diff --git a/apps/cli/src/next/commands/branches/create/create.integration.test.ts b/apps/cli/src/next/commands/branches/create/create.integration.test.ts index 94db314cdf..710fe61b30 100644 --- a/apps/cli/src/next/commands/branches/create/create.integration.test.ts +++ b/apps/cli/src/next/commands/branches/create/create.integration.test.ts @@ -27,7 +27,7 @@ function makeCreatedBranch( overrides: Partial = {}, ): typeof V1CreateABranchOutput.Type { return { - id: "00000000-0000-0000-0000-000000000002", + id: "00000000-0000-4000-8000-000000000002", name: "feature-branch", project_ref: "branchrefabcdefghijk", parent_project_ref: "parentrefabcdefghijk", diff --git a/apps/cli/src/next/commands/branches/list/list.integration.test.ts b/apps/cli/src/next/commands/branches/list/list.integration.test.ts index e0a3698038..08d1fef5f8 100644 --- a/apps/cli/src/next/commands/branches/list/list.integration.test.ts +++ b/apps/cli/src/next/commands/branches/list/list.integration.test.ts @@ -19,7 +19,7 @@ function makeBranch( overrides: Partial = {}, ): typeof BranchResponse.Type { return { - id: "00000000-0000-0000-0000-000000000001", + id: "00000000-0000-4000-8000-000000000001", name: "main", project_ref: "mainrefghijklmnopqrst", parent_project_ref: "parentrefabcdefghijk", @@ -142,7 +142,7 @@ describe("branches list handler", () => { () => Effect.gen(function* () { const devBranch = makeBranch({ - id: "00000000-0000-0000-0000-000000000002", + id: "00000000-0000-4000-8000-000000000002", name: "dev", project_ref: "devrefghijklmnopqrst", is_default: false, @@ -206,7 +206,7 @@ describe("branches list handler", () => { it.live("sets active:false for non-active branches in JSON mode", () => Effect.gen(function* () { const devBranch = makeBranch({ - id: "00000000-0000-0000-0000-000000000002", + id: "00000000-0000-4000-8000-000000000002", name: "dev", project_ref: "devrefghijklmnopqrst", is_default: false, diff --git a/apps/cli/src/next/commands/branches/switch/switch.integration.test.ts b/apps/cli/src/next/commands/branches/switch/switch.integration.test.ts index 054becb019..2eeba2563d 100644 --- a/apps/cli/src/next/commands/branches/switch/switch.integration.test.ts +++ b/apps/cli/src/next/commands/branches/switch/switch.integration.test.ts @@ -20,7 +20,7 @@ function makeBranch( overrides: Partial = {}, ): typeof BranchResponse.Type { return { - id: "00000000-0000-0000-0000-000000000001", + id: "00000000-0000-4000-8000-000000000001", name: "main", project_ref: "mainrefghijklmnopqrst", parent_project_ref: "parentref1234567890", @@ -36,7 +36,7 @@ function makeBranch( const MAIN_BRANCH = makeBranch(); const DEV_BRANCH = makeBranch({ - id: "00000000-0000-0000-0000-000000000002", + id: "00000000-0000-4000-8000-000000000002", name: "dev", project_ref: "devrefghijklmnopqrst", is_default: false, diff --git a/apps/cli/src/next/commands/platform/platform-examples.ts b/apps/cli/src/next/commands/platform/platform-examples.ts index edb501f071..ed8773b6b3 100644 --- a/apps/cli/src/next/commands/platform/platform-examples.ts +++ b/apps/cli/src/next/commands/platform/platform-examples.ts @@ -179,12 +179,26 @@ function buildMultipartBodyExample(schema: PlatformSchemaNode | undefined): Json } if (schema.kind === "object") { - return objectExampleForNode(schema, false, false); + return objectExampleForNode( + { + ...schema, + properties: schema.properties?.filter((property) => !isBinaryProperty(property)), + }, + false, + false, + ); } return exampleValueForNode(schema, false, false); } +function isBinaryProperty(property: PlatformSchemaNode): boolean { + return ( + property.format === "binary" || + (property.kind === "array" && property.items?.format === "binary") + ); +} + function multipartUploadSegments(schema: PlatformSchemaNode | undefined): ReadonlyArray { return ( schema?.properties?.flatMap((property) => { diff --git a/apps/cli/src/next/commands/platform/platform-schema-introspection.ts b/apps/cli/src/next/commands/platform/platform-schema-introspection.ts index ea934d9a39..335c15bfe0 100644 --- a/apps/cli/src/next/commands/platform/platform-schema-introspection.ts +++ b/apps/cli/src/next/commands/platform/platform-schema-introspection.ts @@ -154,12 +154,16 @@ function toPlatformSchemaNode(options: { readonly required: boolean; readonly sensitive: boolean; readonly description?: string; + readonly ancestors?: ReadonlySet; }): PlatformSchemaNode { const resolved = resolvePlatformOpenApiSchema(options.schema); - const objectShape = getPlatformOpenApiObjectShape(options.schema); + const isRecursive = options.ancestors?.has(resolved) === true; + const ancestors = new Set(options.ancestors); + ancestors.add(resolved); + const objectShape = isRecursive ? undefined : getPlatformOpenApiObjectShape(options.schema); const kind = classifyPlatformSchemaKind(options.schema); const enumValues = enumValuesForNode(options.schema); - const unionVariants = unionVariantsFor(options.schema); + const unionVariants = isRecursive ? [] : unionVariantsFor(options.schema); const properties = objectShape && Object.keys(objectShape.properties).length > 0 @@ -170,6 +174,7 @@ function toPlatformSchemaNode(options: { label: humanizeFieldName(name), required: objectShape.required.has(name), sensitive: isSensitiveField(name), + ancestors, }), ) : undefined; @@ -181,6 +186,7 @@ function toPlatformSchemaNode(options: { label: options.label ? `${options.label} Item` : "Item", required: true, sensitive: options.sensitive, + ancestors, }) : undefined; @@ -192,6 +198,7 @@ function toPlatformSchemaNode(options: { label: options.label ? `${options.label} Variant ${index + 1}` : `Variant ${index + 1}`, required: options.required, sensitive: options.sensitive, + ancestors, }), ) : undefined; diff --git a/apps/cli/src/next/commands/platform/platform-schema-text.unit.test.ts b/apps/cli/src/next/commands/platform/platform-schema-text.unit.test.ts index 86b136af25..8f350c23cb 100644 --- a/apps/cli/src/next/commands/platform/platform-schema-text.unit.test.ts +++ b/apps/cli/src/next/commands/platform/platform-schema-text.unit.test.ts @@ -198,6 +198,17 @@ describe("platform schema text rendering", () => { expect(rendered).not.toContain("id: string (optional)"); }); + it("bounds recursive JSON response schemas", () => { + const payload = buildPlatformSchemaPayload( + findPlatformOperationDescriptor("v1GetHostnameConfig"), + ); + const rendered = renderPlatformSchemaPayload(payload); + + expect(rendered).toContain("GET /v1/projects/{ref}/custom-hostname"); + expect(rendered).toContain("errors?:"); + expect(rendered.length).toBeLessThan(10_000); + }); + it("renders multipart guidance without dumping nested renderer state", () => { const payload = buildPlatformSchemaPayload( findPlatformOperationDescriptor("v1DeployAFunction"), @@ -208,7 +219,7 @@ describe("platform schema text rendering", () => { expect(rendered).toContain(" --json"); expect(rendered).toContain(" --upload"); expect(rendered).toContain("metadata: object"); - expect(rendered).toContain("file?: binary[]"); + expect(rendered).toContain("file: binary[]"); expect(rendered).toContain( "note: Use repeated `--upload field=path` flags for binary multipart fields, including array-valued fields.", ); diff --git a/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts b/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts index bce09cb550..20b89de789 100644 --- a/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts +++ b/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts @@ -177,7 +177,7 @@ describe("api schema payload", () => { }, upload: { flag: "--upload", - optional: { + required: { file: { type: "array", items: { diff --git a/apps/cli/src/shared/functions/deploy.ts b/apps/cli/src/shared/functions/deploy.ts index 1043a3a149..a3b59b4f80 100644 --- a/apps/cli/src/shared/functions/deploy.ts +++ b/apps/cli/src/shared/functions/deploy.ts @@ -1630,7 +1630,7 @@ const uploadFunctionSource = Effect.fnUntraced(function* ( ...(bundleOnly ? { bundleOnly: true } : {}), body: { metadata, - ...(files.length > 0 ? { file: files } : {}), + file: files, }, }) .pipe( diff --git a/packages/api/scripts/generate.ts b/packages/api/scripts/generate.ts index 5d528aca59..f2052685d5 100644 --- a/packages/api/scripts/generate.ts +++ b/packages/api/scripts/generate.ts @@ -384,6 +384,18 @@ function resolveSchema(document: OpenApiDocument, schema: OpenApiSchema): OpenAp return sanitizeOpenApiSchema(schema); } +export function normalizeQueryParameterSchema( + parameter: OpenApiParameter, + schema: OpenApiSchema, +): OpenApiSchema { + const acceptsBoolean = + schema.type === "string" && + (typeof parameter.schema?.example === "boolean" || + /\bboolean string\b/iu.test(parameter.description ?? "")); + + return acceptsBoolean ? { anyOf: [schema, { type: "boolean" }] } : schema; +} + function getObjectShape(document: OpenApiDocument, schema: OpenApiSchema): ObjectShape | undefined { const resolved = resolveSchema(document, schema); if (resolved.type === "object" || resolved.properties !== undefined) { @@ -514,7 +526,9 @@ function buildCombinedInputSchema( if (parameter.in === "cookie" || parameter.schema === undefined) { continue; } - properties[parameter.name] = resolveSchema(document, parameter.schema); + const schema = resolveSchema(document, parameter.schema); + properties[parameter.name] = + parameter.in === "query" ? normalizeQueryParameterSchema(parameter, schema) : schema; if (parameter.required === true) { required.add(parameter.name); } @@ -666,7 +680,7 @@ function renderSchemaSource( parts.push("// recursive definitions"); for (const [name, code] of recursiveEntries) { parts.push( - `export const ${name} = ${hasBinaryInputs ? replaceBinarySchemaCode(code.runtime) : code.runtime}`, + `export type ${name} = ${code.Type}\nexport const ${name} = ${hasBinaryInputs ? replaceBinarySchemaCode(code.runtime) : code.runtime}`, ); } } diff --git a/packages/api/scripts/generate.unit.test.ts b/packages/api/scripts/generate.unit.test.ts index 77596f8d1f..68f198506b 100644 --- a/packages/api/scripts/generate.unit.test.ts +++ b/packages/api/scripts/generate.unit.test.ts @@ -2,7 +2,7 @@ import * as JsonSchema from "effect/JsonSchema"; import * as SchemaRepresentation from "effect/SchemaRepresentation"; import { describe, expect, test } from "vitest"; -import { normalizeNullableJsonSchema } from "./generate.ts"; +import { normalizeNullableJsonSchema, normalizeQueryParameterSchema } from "./generate.ts"; function renderOpenApiSchema(schema: Parameters[0]) { const normalized = normalizeNullableJsonSchema(JsonSchema.fromSchemaOpenApi3_0(schema).schema); @@ -23,4 +23,40 @@ describe("generate", () => { 'Schema.Union([Schema.String.annotate({ "format": "date-time" }), Schema.Null])', ); }); + + test("accepts booleans for string-encoded boolean query parameters", () => { + expect( + normalizeQueryParameterSchema( + { + name: "verify_jwt", + in: "query", + schema: { type: "string", example: true }, + }, + { type: "string" }, + ), + ).toEqual({ anyOf: [{ type: "string" }, { type: "boolean" }] }); + + expect( + normalizeQueryParameterSchema( + { + name: "reveal", + in: "query", + description: "Boolean string, true or false", + schema: { type: "string", example: "true" }, + }, + { type: "string" }, + ), + ).toEqual({ anyOf: [{ type: "string" }, { type: "boolean" }] }); + + expect( + normalizeQueryParameterSchema( + { + name: "slug", + in: "query", + schema: { type: "string", example: "hello-world" }, + }, + { type: "string" }, + ), + ).toEqual({ type: "string" }); + }); }); diff --git a/packages/api/src/generated/contracts.ts b/packages/api/src/generated/contracts.ts index e3f946eb3d..337fb9144a 100644 --- a/packages/api/src/generated/contracts.ts +++ b/packages/api/src/generated/contracts.ts @@ -300,6 +300,13 @@ export const V1OrganizationMemberResponse = Schema.Struct({ avatar_url: Schema.Union([Schema.String, Schema.Null]), }); // recursive definitions +export type UpdateCustomHostnameResponseJsonValue = + | string + | number + | boolean + | null + | ReadonlyArray + | { readonly [x: string]: UpdateCustomHostnameResponseJsonValue }; export const UpdateCustomHostnameResponseJsonValue = Schema.Union([ Schema.Union([ Schema.Union([Schema.String, Schema.Number.check(Schema.isFinite()), Schema.Boolean]), @@ -319,6 +326,13 @@ export const UpdateCustomHostnameResponseJsonValue = Schema.Union([ ), ), ]).annotate({ description: "Any JSON-serializable value" }); +export type ListProjectAddonsResponseJsonValue = + | string + | number + | boolean + | null + | ReadonlyArray + | { readonly [x: string]: ListProjectAddonsResponseJsonValue }; export const ListProjectAddonsResponseJsonValue = Schema.Union([ Schema.Union([ Schema.Union([Schema.String, Schema.Number.check(Schema.isFinite()), Schema.Boolean]), @@ -836,8 +850,8 @@ export const V1CreateAFunctionInput = Schema.Struct({ .check(Schema.isPattern(new RegExp("^[a-z]+$"))), slug: Schema.optionalKey(Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")))), name: Schema.optionalKey(Schema.String), - verify_jwt: Schema.optionalKey(Schema.String), - import_map: Schema.optionalKey(Schema.String), + verify_jwt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), + import_map: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), entrypoint_path: Schema.optionalKey(Schema.String), import_map_path: Schema.optionalKey(Schema.String), ezbr_sha256: Schema.optionalKey(Schema.String), @@ -1173,7 +1187,7 @@ export const V1CreateProjectApiKeyInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - reveal: Schema.optionalKey(Schema.String), + reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), type: Schema.Literals(["publishable", "secret"]), name: Schema.String.check(Schema.isMinLength(4)) .check(Schema.isMaxLength(64)) @@ -1454,7 +1468,7 @@ export const V1DeleteABranchInput = Schema.Struct({ ), ), ]), - force: Schema.optionalKey(Schema.String), + force: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1DeleteABranchOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1DeleteAFunctionInput = Schema.Struct({ @@ -1593,8 +1607,8 @@ export const V1DeleteProjectApiKeyInput = Schema.Struct({ ), ), ), - reveal: Schema.optionalKey(Schema.String), - was_compromised: Schema.optionalKey(Schema.String), + reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), + was_compromised: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), reason: Schema.optionalKey(Schema.String), }); export const V1DeleteProjectApiKeyOutput = Schema.Struct({ @@ -1682,7 +1696,7 @@ export const V1DeployAFunctionInput = Schema.Struct({ slug: Schema.optionalKey( Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$"))), ), - bundleOnly: Schema.optionalKey(Schema.String), + bundleOnly: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), body: Schema.Struct({ file: Schema.Array(BinaryInput), metadata: Schema.Struct({ @@ -1735,7 +1749,7 @@ export const V1DiffABranchInput = Schema.Struct({ ), ]), included_schemas: Schema.optionalKey(Schema.String), - pgdelta: Schema.optionalKey(Schema.String), + pgdelta: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1DiffABranchOutput = Schema.String; export const V1DisablePreviewBranchingInput = Schema.Struct({ @@ -3563,7 +3577,7 @@ export const V1GetProjectApiKeyInput = Schema.Struct({ ), ), ), - reveal: Schema.optionalKey(Schema.String), + reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1GetProjectApiKeyOutput = Schema.Struct({ api_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -3613,7 +3627,7 @@ export const V1GetProjectApiKeysInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - reveal: Schema.optionalKey(Schema.String), + reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1GetProjectApiKeysOutput = Schema.Array(ApiKeyResponse); export const V1GetProjectClaimTokenInput = Schema.Struct({ @@ -5371,8 +5385,8 @@ export const V1UpdateAFunctionInput = Schema.Struct({ function_slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$"))), slug: Schema.optionalKey(Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")))), name: Schema.optionalKey(Schema.String), - verify_jwt: Schema.optionalKey(Schema.String), - import_map: Schema.optionalKey(Schema.String), + verify_jwt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), + import_map: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), entrypoint_path: Schema.optionalKey(Schema.String), import_map_path: Schema.optionalKey(Schema.String), ezbr_sha256: Schema.optionalKey(Schema.String), @@ -6987,7 +7001,7 @@ export const V1UpdateProjectApiKeyInput = Schema.Struct({ ), ), ), - reveal: Schema.optionalKey(Schema.String), + reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), name: Schema.optionalKey( Schema.String.check(Schema.isMinLength(4)) .check(Schema.isMaxLength(64)) @@ -7049,7 +7063,7 @@ export const V1UpdateProjectLegacyApiKeysInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - enabled: Schema.String, + enabled: Schema.Union([Schema.String, Schema.Boolean]), }); export const V1UpdateProjectLegacyApiKeysOutput = Schema.Struct({ enabled: Schema.Boolean }); export const V1UpdateProjectSigningKeyInput = Schema.Struct({ diff --git a/packages/api/src/internal/client.unit.test.ts b/packages/api/src/internal/client.unit.test.ts index caad463bfa..76515ed47b 100644 --- a/packages/api/src/internal/client.unit.test.ts +++ b/packages/api/src/internal/client.unit.test.ts @@ -642,7 +642,7 @@ describe("makeSupabaseApiClient", () => { client.execute<"v1ExchangeOauthToken">(operationDefinitions.v1ExchangeOauthToken, { body: { grant_type: "authorization_code", - client_id: "11111111-1111-1111-1111-111111111111", + client_id: "11111111-1111-4111-8111-111111111111", client_secret: "client-secret", code: "auth-code", code_verifier: "code-verifier", @@ -670,7 +670,7 @@ describe("makeSupabaseApiClient", () => { const body = new URLSearchParams(requestBodyText(seenRequest!)); expect(body.get("grant_type")).toBe("authorization_code"); - expect(body.get("client_id")).toBe("11111111-1111-1111-1111-111111111111"); + expect(body.get("client_id")).toBe("11111111-1111-4111-8111-111111111111"); expect(body.get("client_secret")).toBe("client-secret"); expect(body.get("code")).toBe("auth-code"); expect(body.get("code_verifier")).toBe("code-verifier"); From ddcbd2ea5c94119dee89cfd49ad8056280c662ba Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Wed, 5 Aug 2026 16:28:59 +0200 Subject: [PATCH 3/3] fix(api): handle remaining generated schema edge cases --- .../platform/platform-schema-introspection.ts | 4 +-- .../platform-schema.integration.test.ts | 31 +++++++++++++++++++ packages/api/scripts/generate.ts | 3 +- packages/api/scripts/generate.unit.test.ts | 12 +++++++ packages/api/src/generated/contracts.ts | 2 +- 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/apps/cli/src/next/commands/platform/platform-schema-introspection.ts b/apps/cli/src/next/commands/platform/platform-schema-introspection.ts index 335c15bfe0..115c5f20e0 100644 --- a/apps/cli/src/next/commands/platform/platform-schema-introspection.ts +++ b/apps/cli/src/next/commands/platform/platform-schema-introspection.ts @@ -161,7 +161,7 @@ function toPlatformSchemaNode(options: { const ancestors = new Set(options.ancestors); ancestors.add(resolved); const objectShape = isRecursive ? undefined : getPlatformOpenApiObjectShape(options.schema); - const kind = classifyPlatformSchemaKind(options.schema); + const kind = isRecursive ? "unknown" : classifyPlatformSchemaKind(options.schema); const enumValues = enumValuesForNode(options.schema); const unionVariants = isRecursive ? [] : unionVariantsFor(options.schema); @@ -180,7 +180,7 @@ function toPlatformSchemaNode(options: { : undefined; const items = - resolved.type === "array" && resolved.items !== undefined + !isRecursive && resolved.type === "array" && resolved.items !== undefined ? toPlatformSchemaNode({ schema: resolved.items, label: options.label ? `${options.label} Item` : "Item", diff --git a/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts b/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts index 20b89de789..04633cf62b 100644 --- a/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts +++ b/apps/cli/src/next/commands/platform/platform-schema.integration.test.ts @@ -148,6 +148,37 @@ describe("api schema payload", () => { }); }); + it("uses unknown placeholders for recursive response schemas", () => { + const payload = buildPlatformSchemaPayload( + findPlatformOperationDescriptor("v1GetHostnameConfig"), + ); + + expect(payload).toMatchObject({ + response: { + properties: { + data: { + properties: { + errors: { + items: { + oneOf: expect.arrayContaining([ + { + type: "array", + items: { + type: "unknown", + description: "Any JSON-serializable value", + }, + }, + ]), + }, + }, + }, + }, + }, + }, + }); + expect(JSON.stringify(payload)).not.toContain('"oneOf":[]'); + }); + it("splits multipart routes into structured and upload channels", () => { const payload = buildPlatformSchemaPayload( findPlatformOperationDescriptor("v1DeployAFunction"), diff --git a/packages/api/scripts/generate.ts b/packages/api/scripts/generate.ts index f2052685d5..e2cf669fcb 100644 --- a/packages/api/scripts/generate.ts +++ b/packages/api/scripts/generate.ts @@ -391,7 +391,8 @@ export function normalizeQueryParameterSchema( const acceptsBoolean = schema.type === "string" && (typeof parameter.schema?.example === "boolean" || - /\bboolean string\b/iu.test(parameter.description ?? "")); + /\bboolean string\b/iu.test(parameter.description ?? "") || + /\bif (?:true|false)\b/iu.test(parameter.description ?? "")); return acceptsBoolean ? { anyOf: [schema, { type: "boolean" }] } : schema; } diff --git a/packages/api/scripts/generate.unit.test.ts b/packages/api/scripts/generate.unit.test.ts index 68f198506b..879ecc02cb 100644 --- a/packages/api/scripts/generate.unit.test.ts +++ b/packages/api/scripts/generate.unit.test.ts @@ -48,6 +48,18 @@ describe("generate", () => { ), ).toEqual({ anyOf: [{ type: "string" }, { type: "boolean" }] }); + expect( + normalizeQueryParameterSchema( + { + name: "remove_addon", + in: "query", + description: "If true, also removes the custom domain add-on.", + schema: { type: "string" }, + }, + { type: "string" }, + ), + ).toEqual({ anyOf: [{ type: "string" }, { type: "boolean" }] }); + expect( normalizeQueryParameterSchema( { diff --git a/packages/api/src/generated/contracts.ts b/packages/api/src/generated/contracts.ts index 337fb9144a..0bd5009ac0 100644 --- a/packages/api/src/generated/contracts.ts +++ b/packages/api/src/generated/contracts.ts @@ -1452,7 +1452,7 @@ export const V1DeleteHostnameConfigInput = Schema.Struct({ ref: Schema.String.check(Schema.isMinLength(20)) .check(Schema.isMaxLength(20)) .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - remove_addon: Schema.optionalKey(Schema.String), + remove_addon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1DeleteABranchInput = Schema.Struct({ branch_id_or_ref: Schema.Union([