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 65828fa24c..d9b7029288 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..115c5f20e0 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 kind = classifyPlatformSchemaKind(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 = isRecursive ? "unknown" : 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,17 +174,19 @@ function toPlatformSchemaNode(options: { label: humanizeFieldName(name), required: objectShape.required.has(name), sensitive: isSensitiveField(name), + ancestors, }), ) : 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", 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..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"), @@ -177,7 +208,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 e9ce7ae79c..f6ff09526b 100644 --- a/packages/api/scripts/generate.ts +++ b/packages/api/scripts/generate.ts @@ -405,6 +405,19 @@ 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 ?? "") || + /\bif (?:true|false)\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) { @@ -535,7 +548,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); } @@ -689,7 +704,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 04c782b528..5b4dbe720e 100644 --- a/packages/api/scripts/generate.unit.test.ts +++ b/packages/api/scripts/generate.unit.test.ts @@ -3,7 +3,11 @@ import * as JsonSchema from "effect/JsonSchema"; import * as SchemaRepresentation from "effect/SchemaRepresentation"; import { describe, expect, test } from "vitest"; -import { normalizeNullableJsonSchema, sanitizeOpenApiSchema } from "./generate.ts"; +import { + normalizeNullableJsonSchema, + normalizeQueryParameterSchema, + sanitizeOpenApiSchema, +} from "./generate.ts"; function renderOpenApiSchema(schema: Parameters[0]) { const normalized = normalizeNullableJsonSchema( @@ -29,6 +33,54 @@ describe("generate", () => { ); }); + 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: "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( + { + name: "slug", + in: "query", + schema: { type: "string", example: "hello-world" }, + }, + { type: "string" }, + ), + ).toEqual({ type: "string" }); + }); + test("preserves arbitrary JSON in SSO attribute mapping defaults", () => { expect( renderOpenApiSchema({ diff --git a/packages/api/src/generated/contracts.ts b/packages/api/src/generated/contracts.ts index ca42d25c07..589f6895ea 100644 --- a/packages/api/src/generated/contracts.ts +++ b/packages/api/src/generated/contracts.ts @@ -1,22 +1,187 @@ import * as Schema from "effect/Schema"; // non-recursive definitions +export const SupavisorConfigResponse = Schema.Struct({ + identifier: Schema.String, + database_type: Schema.Literals(["PRIMARY", "READ_REPLICA"]), + is_using_scram_auth: Schema.Boolean, + db_user: Schema.String, + db_host: Schema.String, + db_port: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + max_client_conn: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + pool_mode: Schema.Literals(["transaction", "session"]), +}).annotate({ identifier: "SupavisorConfigResponse" }); +export const ApiKeyResponse = Schema.Struct({ + api_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.optionalKey( + Schema.Union([ + Schema.Literal("legacy"), + Schema.Literal("publishable"), + Schema.Literal("secret"), + Schema.Null, + ]), + ), + prefix: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: Schema.String, + 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + Schema.Null, + ]), + ), + inserted_at: Schema.optionalKey( + 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))$", + ), + ).annotate({ + expected: + "a string matching the 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" }).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))$", + ), + ).annotate({ + expected: + "a string matching the 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, + ]), + ), +}).annotate({ identifier: "ApiKeyResponse" }); +export const V1ServiceHealthResponse = Schema.Struct({ + name: Schema.Literals([ + "auth", + "db", + "db_postgres_user", + "pooler", + "realtime", + "rest", + "storage", + "pg_bouncer", + ]), + 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + }), + Schema.Struct({ db_schema: Schema.String }), + ]), + ), + error: Schema.optionalKey(Schema.String), +}).annotate({ identifier: "V1ServiceHealthResponse" }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, project_ref: Schema.String, 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", - }).check(Schema.isFinite()), + }).check(Schema.isFinite().annotate({ expected: "a finite number" })), ), persistent: Schema.Boolean, status: Schema.Literals([ @@ -29,12 +194,52 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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", @@ -54,18 +259,87 @@ export const BranchResponse = Schema.Struct({ "RESIZING", ]), ), -}); +}).annotate({ identifier: "BranchResponse" }); +export const V1StorageBucketResponse = Schema.Struct({ + id: Schema.String, + name: Schema.String, + owner: Schema.String, + created_at: Schema.String, + updated_at: Schema.String, + public: Schema.Boolean, +}).annotate({ identifier: "V1StorageBucketResponse" }); +export const FunctionResponse = Schema.Struct({ + id: Schema.String, + slug: Schema.String, + name: Schema.String, + status: Schema.Literals(["ACTIVE", "REMOVED", "THROTTLED"]), + version: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + verify_jwt: Schema.optionalKey(Schema.Boolean), + import_map: Schema.optionalKey(Schema.Boolean), + entrypoint_path: Schema.optionalKey(Schema.String), + import_map_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + ezbr_sha256: Schema.optionalKey(Schema.String), +}).annotate({ identifier: "FunctionResponse" }); +export const OrganizationResponseV1 = Schema.Struct({ + id: Schema.String.annotate({ description: "Deprecated: Use `slug` instead." }), + slug: Schema.String.annotate({ description: "Organization slug" }).check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), + name: Schema.String, +}).annotate({ identifier: "OrganizationResponseV1" }); export const V1ProjectWithDatabaseResponse = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `ref` instead." }), ref: Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), organization_id: Schema.String.annotate({ description: "Deprecated: Use `organization_slug` instead.", }), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")), + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), ), name: Schema.String.annotate({ description: "Name of your project" }), region: Schema.String.annotate({ description: "Region of your project" }), @@ -93,134 +367,108 @@ export const V1ProjectWithDatabaseResponse = Schema.Struct({ postgres_engine: Schema.String.annotate({ description: "Database engine" }), release_channel: Schema.String.annotate({ description: "Release channel" }), }), -}); -export const OrganizationResponseV1 = Schema.Struct({ - id: Schema.String.annotate({ description: "Deprecated: Use `slug` instead." }), - slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")), - ), - name: Schema.String, -}); -export const ApiKeyResponse = Schema.Struct({ - api_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.optionalKey( - Schema.Union([ - Schema.Literals(["legacy", "publishable", "secret"]), - Schema.Union([Schema.Null]), - ]), - ), - prefix: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - name: Schema.String, - 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]), - ), - inserted_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), - ), - updated_at: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ format: "date-time" }), Schema.Null]), - ), -}); +}).annotate({ identifier: "V1ProjectWithDatabaseResponse" }); export const SecretResponse = Schema.Struct({ name: Schema.String, value: Schema.String, updated_at: Schema.optionalKey(Schema.String), -}); -export const V1ServiceHealthResponse = Schema.Struct({ - name: Schema.Literals([ - "auth", - "db", - "db_postgres_user", - "pooler", - "realtime", - "rest", - "storage", - "pg_bouncer", - ]), - 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" }, - ), - ), - error: Schema.optionalKey(Schema.String), -}); +}).annotate({ identifier: "SecretResponse" }); +export const V1OrganizationMemberResponse = Schema.Struct({ + user_id: Schema.String, + user_name: Schema.String, + email: Schema.optionalKey(Schema.String), + role_name: Schema.String, + mfa_enabled: Schema.Boolean, + avatar_url: Schema.Union([Schema.String, Schema.Null]), +}).annotate({ identifier: "V1OrganizationMemberResponse" }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, oidc_issuer_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), jwks_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - custom_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - resolved_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), + custom_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), + resolved_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), inserted_at: Schema.String, updated_at: Schema.String, resolved_at: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); -export const FunctionResponse = Schema.Struct({ - id: Schema.String, - 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()), - verify_jwt: Schema.optionalKey(Schema.Boolean), - import_map: Schema.optionalKey(Schema.Boolean), - entrypoint_path: Schema.optionalKey(Schema.String), - import_map_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - ezbr_sha256: Schema.optionalKey(Schema.String), -}); -export const V1StorageBucketResponse = Schema.Struct({ - id: Schema.String, - name: Schema.String, - owner: Schema.String, - created_at: Schema.String, - updated_at: Schema.String, - public: Schema.Boolean, -}); -export const SupavisorConfigResponse = Schema.Struct({ - identifier: Schema.String, - database_type: Schema.Literals(["PRIMARY", "READ_REPLICA"]), - is_using_scram_auth: Schema.Boolean, - db_user: Schema.String, - db_host: Schema.String, - db_port: Schema.Number.check(Schema.isInt()), - 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]), - pool_mode: Schema.Literals(["transaction", "session"]), -}); -export const V1OrganizationMemberResponse = Schema.Struct({ - user_id: Schema.String, - user_name: Schema.String, - email: Schema.optionalKey(Schema.String), - role_name: Schema.String, - mfa_enabled: Schema.Boolean, - avatar_url: Schema.Union([Schema.String, Schema.Null]), +}).annotate({ identifier: "ThirdPartyAuth" }); +// 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().annotate({ expected: "a finite number" })), + 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", + identifier: "UpdateCustomHostnameResponseJsonValue", +}); +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().annotate({ expected: "a finite number" })), + 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", + identifier: "ListProjectAddonsResponseJsonValue", }); // binary input helpers export const BinaryInput = Schema.Union([ @@ -230,29 +478,85 @@ export const BinaryInput = Schema.Union([ ]); // operation schemas 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)), - token: Schema.String.check(Schema.isMinLength(1)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + email: Schema.String.annotate({ format: "email" }) + .check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 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,}$", + ), + ).annotate({ + expected: + "a string matching the 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).annotate({ expected: "a value with a length of at least 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)$", + ), + ).annotate({ + expected: + "a string matching the 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( Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + }), + ), + }), + ), ), }), ), @@ -261,9 +565,15 @@ export const V1AcceptInviteExternalJitAccessOutput = Schema.Struct({ ), }); export const V1ActivateCustomHostnameInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ActivateCustomHostnameOutput = Schema.Struct({ status: Schema.optionalKey( @@ -278,8 +588,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, @@ -302,55 +612,74 @@ export const V1ActivateCustomHostnameOutput = Schema.Struct({ }), }); export const V1ActivateVanitySubdomainConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - vanity_subdomain: Schema.String.check(Schema.isMaxLength(63)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + vanity_subdomain: Schema.String.check( + Schema.isMaxLength(63).annotate({ expected: "a value with a length of at most 63" }), + ), }); export const V1ActivateVanitySubdomainConfigOutput = Schema.Struct({ custom_domain: Schema.String, }); export const V1ApplyAMigrationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), "Idempotency-Key": Schema.optionalKey(Schema.String), - query: Schema.String.check(Schema.isMinLength(1)), + query: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), name: Schema.optionalKey(Schema.String), rollback: Schema.optionalKey(Schema.String), }); 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" }, - ), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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"), + ]), addon_type: Schema.Literals([ "custom_domain", "compute_instance", @@ -363,25 +692,93 @@ export const V1ApplyProjectAddonInput = Schema.Struct({ ]), }); export const V1AuthorizeJitAccessInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .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)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 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])$", + ), + ).annotate({ + expected: + "a string matching the 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}|:))$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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,8 +787,13 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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"]), redirect_uri: Schema.String, @@ -401,45 +803,100 @@ export const V1AuthorizeUserInput = Schema.Struct({ code_challenge: Schema.optionalKey(Schema.String), code_challenge_method: Schema.optionalKey(Schema.Literals(["plain", "sha256", "S256"])), organization_slug: Schema.optionalKey( - Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), + Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), ), target_flow: Schema.optionalKey(Schema.String), resource: Schema.optionalKey(Schema.String.annotate({ format: "uri" })), }); export const V1BulkCreateSecretsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), body: Schema.Array( Schema.Struct({ name: Schema.String.annotate({ description: "Secret name must not start with the SUPABASE_ prefix.", }) - .check(Schema.isMaxLength(256)) - .check(Schema.isPattern(new RegExp("^(?!SUPABASE_).*"))), - value: Schema.String.check(Schema.isMaxLength(24576)), + .check( + Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }), + ) + .check( + Schema.isPattern(new RegExp("^(?!SUPABASE_).*")).annotate({ + expected: "a string matching the RegExp ^(?!SUPABASE_).*", + }), + ), + value: Schema.String.check( + Schema.isMaxLength(24576).annotate({ expected: "a value with a length of at most 24576" }), + ), }), - ).check(Schema.isMaxLength(100)), + ).check(Schema.isMaxLength(100).annotate({ expected: "a value with a length of at most 100" })), }); export const V1BulkDeleteSecretsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), body: Schema.Array(Schema.String), }); export const V1BulkUpdateFunctionsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), body: Schema.Array( Schema.Struct({ id: Schema.String, - slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$")).annotate({ + expected: "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), created_at: Schema.optionalKey( - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), @@ -456,9 +913,41 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -468,33 +957,65 @@ export const V1BulkUpdateFunctionsOutput = Schema.Struct({ ), }); export const V1CancelAProjectRestorationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1CheckVanitySubdomainAvailabilityInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - vanity_subdomain: Schema.String.check(Schema.isMaxLength(63)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + vanity_subdomain: Schema.String.check( + Schema.isMaxLength(63).annotate({ expected: "a value with a length of at most 63" }), + ), }); export const V1CheckVanitySubdomainAvailabilityOutput = Schema.Struct({ available: Schema.Boolean, }); export const V1ClaimProjectForOrganizationInput = Schema.Struct({ - slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), token: Schema.String, }); export const V1CountActionRunsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1CreateABranchInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - branch_name: Schema.String.check(Schema.isMinLength(1)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + branch_name: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), git_branch: Schema.optionalKey(Schema.String), is_default: Schema.optionalKey(Schema.Boolean), persistent: Schema.optionalKey(Schema.Boolean), @@ -545,19 +1066,37 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, project_ref: Schema.String, 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", - }).check(Schema.isFinite()), + }).check(Schema.isFinite().annotate({ expected: "a finite number" })), ), persistent: Schema.Boolean, status: Schema.Literals([ @@ -570,12 +1109,52 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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", @@ -597,13 +1176,25 @@ export const V1CreateABranchOutput = Schema.Struct({ ), }); export const V1CreateAFunctionInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - slug: Schema.optionalKey(Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + slug: Schema.optionalKey( + Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + expected: "a string matching the 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.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), @@ -614,9 +1205,41 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -626,13 +1249,15 @@ export const V1CreateAFunctionOutput = Schema.Struct({ export const V1CreateAProjectInput = Schema.Struct({ db_pass: Schema.String.annotate({ description: "Database password" }), name: Schema.String.annotate({ description: "Name of your project" }).check( - Schema.isMaxLength(256), + Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }), ), organization_id: Schema.optionalKey( Schema.String.annotate({ description: "Deprecated: Use `organization_slug` instead." }), ), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")), + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), ), plan: Schema.optionalKey( Schema.Literals(["free", "pro"]).annotate({ @@ -743,6 +1368,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.", @@ -752,14 +1379,20 @@ export const V1CreateAProjectInput = Schema.Struct({ export const V1CreateAProjectOutput = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `ref` instead." }), ref: Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), organization_id: Schema.String.annotate({ description: "Deprecated: Use `organization_slug` instead.", }), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")), + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), ), name: Schema.String.annotate({ description: "Name of your project" }), region: Schema.String.annotate({ description: "Region of your project" }), @@ -783,9 +1416,15 @@ export const V1CreateAProjectOutput = Schema.Struct({ ]), }); export const V1CreateASsoProviderInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), type: Schema.Literal("saml").annotate({ description: "What type of provider will be created" }), metadata_xml: Schema.optionalKey(Schema.String), metadata_url: Schema.optionalKey(Schema.String), @@ -797,7 +1436,14 @@ export const V1CreateASsoProviderInput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -827,7 +1473,16 @@ export const V1CreateASsoProviderOutput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -857,57 +1512,126 @@ export const V1CreateASsoProviderOutput = Schema.Struct({ updated_at: Schema.optionalKey(Schema.String), }); export const V1CreateAnOrganizationInput = Schema.Struct({ - name: Schema.String.check(Schema.isMaxLength(256)), + name: Schema.String.check( + Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }), + ), }); export const V1CreateAnOrganizationOutput = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `slug` instead." }), slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")), + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), ), name: Schema.String, }); export const V1CreateLegacySigningKeyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), read_only: Schema.Boolean, }); export const V1CreateLoginRoleOutput = Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - password: Schema.String.check(Schema.isMinLength(1)), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + password: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), ttl_seconds: Schema.Number.annotate({ format: "int64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + 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)) - .check(Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$"))), + name: Schema.String.check( + Schema.isMinLength(4).annotate({ expected: "a value with a length of at least 4" }), + ) + .check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })) + .check( + Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$")).annotate({ + expected: "a string matching the 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + Schema.Null, + ]), ), }); export const V1CreateProjectApiKeyOutput = Schema.Struct({ @@ -915,8 +1639,10 @@ export const V1CreateProjectApiKeyOutput = Schema.Struct({ id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), type: Schema.optionalKey( Schema.Union([ - Schema.Literals(["legacy", "publishable", "secret"]), - Schema.Union([Schema.Null]), + Schema.Literal("legacy"), + Schema.Literal("publishable"), + Schema.Literal("secret"), + Schema.Null, ]), ), prefix: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -924,19 +1650,56 @@ 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1CreateProjectClaimTokenOutput = Schema.Struct({ token: Schema.String, @@ -945,14 +1708,25 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1CreateProjectSigningKeyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), algorithm: Schema.Literals(["EdDSA", "ES256", "RS256", "HS256"]), status: Schema.optionalKey(Schema.Literals(["in_use", "standby"])), private_jwk: Schema.optionalKey( @@ -963,16 +1737,23 @@ 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)$", ), - ), + ).annotate({ + expected: + "a string matching the 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)$", + }), ), ), use: Schema.optionalKey(Schema.Literal("sig")), key_ops: Schema.optionalKey( Schema.Array(Schema.Literals(["sign", "verify"])) - .check(Schema.isMinLength(2)) - .check(Schema.isMaxLength(2)), + .check( + Schema.isMinLength(2).annotate({ expected: "a value with a length of at least 2" }), + ) + .check( + Schema.isMaxLength(2).annotate({ expected: "a value with a length of at most 2" }), + ), ), ext: Schema.optionalKey(Schema.Literal(true)), kty: Schema.Literal("RSA"), @@ -991,16 +1772,23 @@ 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)$", ), - ), + ).annotate({ + expected: + "a string matching the 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)$", + }), ), ), use: Schema.optionalKey(Schema.Literal("sig")), key_ops: Schema.optionalKey( Schema.Array(Schema.Literals(["sign", "verify"])) - .check(Schema.isMinLength(2)) - .check(Schema.isMaxLength(2)), + .check( + Schema.isMinLength(2).annotate({ expected: "a value with a length of at least 2" }), + ) + .check( + Schema.isMaxLength(2).annotate({ expected: "a value with a length of at most 2" }), + ), ), ext: Schema.optionalKey(Schema.Literal(true)), kty: Schema.Literal("EC"), @@ -1015,16 +1803,23 @@ 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)$", ), - ), + ).annotate({ + expected: + "a string matching the 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)$", + }), ), ), use: Schema.optionalKey(Schema.Literal("sig")), key_ops: Schema.optionalKey( Schema.Array(Schema.Literals(["sign", "verify"])) - .check(Schema.isMinLength(2)) - .check(Schema.isMaxLength(2)), + .check( + Schema.isMinLength(2).annotate({ expected: "a value with a length of at least 2" }), + ) + .check( + Schema.isMaxLength(2).annotate({ expected: "a value with a length of at most 2" }), + ), ), ext: Schema.optionalKey(Schema.Literal(true)), kty: Schema.Literal("OKP"), @@ -1038,21 +1833,30 @@ 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)$", ), - ), + ).annotate({ + expected: + "a string matching the 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)$", + }), ), ), use: Schema.optionalKey(Schema.Literal("sig")), key_ops: Schema.optionalKey( Schema.Array(Schema.Literals(["sign", "verify"])) - .check(Schema.isMinLength(2)) - .check(Schema.isMaxLength(2)), + .check( + Schema.isMinLength(2).annotate({ expected: "a value with a length of at least 2" }), + ) + .check( + Schema.isMaxLength(2).annotate({ expected: "a value with a length of at most 2" }), + ), ), ext: Schema.optionalKey(Schema.Literal(true)), kty: Schema.Literal("oct"), alg: Schema.optionalKey(Schema.Literal("HS256")), - k: Schema.String.check(Schema.isMinLength(16)), + k: Schema.String.check( + Schema.isMinLength(16).annotate({ expected: "a value with a length of at least 16" }), + ), }), ], { mode: "oneOf" }, @@ -1062,104 +1866,215 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), oidc_issuer_url: Schema.optionalKey(Schema.String), jwks_url: Schema.optionalKey(Schema.String), - custom_jwks: Schema.optionalKey(Schema.Json), + custom_jwks: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, oidc_issuer_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), jwks_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - custom_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - resolved_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), + custom_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), + resolved_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), inserted_at: Schema.String, updated_at: Schema.String, resolved_at: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); export const V1CreateRestorePointInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - name: Schema.String.check(Schema.isMaxLength(20)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + name: Schema.String.check( + Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + ), }); 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + remove_addon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + }), + ), + ]), + force: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), +}); +export const V1DeleteABranchOutput = Schema.Struct({ message: Schema.Literal("ok") }); +export const V1DeleteAFunctionInput = Schema.Struct({ + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + function_slug: Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", + }), ), - force: Schema.optionalKey(Schema.Boolean), -}); -export const V1DeleteABranchOutput = Schema.Struct({ message: Schema.Literal("ok") }); -export const V1DeleteAFunctionInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - function_slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$"))), }); export const V1DeleteAProjectInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1DeleteAProjectOutput = Schema.Struct({ - id: Schema.Number.check(Schema.isInt()), + id: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ref: Schema.String, name: Schema.String, }); export const V1DeleteASsoProviderInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1DeleteASsoProviderOutput = Schema.Struct({ @@ -1177,7 +2092,16 @@ export const V1DeleteASsoProviderOutput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -1207,35 +2131,69 @@ export const V1DeleteASsoProviderOutput = Schema.Struct({ updated_at: Schema.optionalKey(Schema.String), }); export const V1DeleteInviteExternalJitAccessInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1DeleteJitAccessInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1DeleteLoginRolesInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1DeleteLoginRolesOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1DeleteNetworkBansInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), ipv4_addresses: Schema.Array(Schema.String).annotate({ description: "List of IP addresses to unban.", }), @@ -1247,16 +2205,27 @@ export const V1DeleteNetworkBansInput = Schema.Struct({ identifier: Schema.optionalKey(Schema.String), }); export const V1DeleteProjectApiKeyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.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({ @@ -1264,8 +2233,10 @@ export const V1DeleteProjectApiKeyOutput = Schema.Struct({ id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), type: Schema.optionalKey( Schema.Union([ - Schema.Literals(["legacy", "publishable", "secret"]), - Schema.Union([Schema.Null]), + Schema.Literal("legacy"), + Schema.Literal("publishable"), + Schema.Literal("secret"), + Schema.Null, ]), ), prefix: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -1273,55 +2244,122 @@ 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1DeleteProjectTpaIntegrationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, oidc_issuer_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), jwks_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - custom_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - resolved_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), + custom_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), + resolved_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), inserted_at: Schema.String, updated_at: Schema.String, resolved_at: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); export const V1DeployAFunctionInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), slug: Schema.optionalKey( - Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$"))), + Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z][A-Za-z0-9_-]*$")).annotate({ + expected: "a string matching the RegExp ^[A-Za-z][A-Za-z0-9_-]*$", + }), + ), ), - bundleOnly: Schema.optionalKey(Schema.Boolean), + bundleOnly: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), 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), @@ -1336,9 +2374,45 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + created_at: Schema.optionalKey( + Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), + updated_at: Schema.optionalKey( + Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -1346,40 +2420,62 @@ 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + }), + ), + ]), included_schemas: Schema.optionalKey(Schema.String), - pgdelta: Schema.optionalKey(Schema.Boolean), + pgdelta: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1DiffABranchOutput = Schema.String; export const V1DisablePreviewBranchingInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1DisableReadonlyModeTemporarilyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1EnableDatabaseWebhookInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ExchangeOauthTokenInput = Schema.Struct({ body: Schema.Struct({ @@ -1394,9 +2490,12 @@ 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)$", ), - ), + ).annotate({ + expected: + "a string matching the 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.optionalKey(Schema.String), @@ -1427,38 +2526,78 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), token_type: Schema.Literal("Bearer"), }); export const V1GenerateTypescriptTypesInput = Schema.Struct({ included_schemas: Schema.optionalKey(Schema.String), - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GenerateTypescriptTypesOutput = Schema.Struct({ types: Schema.String }); export const V1GetABranchInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), name: Schema.String, }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, project_ref: Schema.String, 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", - }).check(Schema.isFinite()), + }).check(Schema.isFinite().annotate({ expected: "a finite number" })), ), persistent: Schema.Boolean, status: Schema.Literals([ @@ -1471,12 +2610,52 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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", @@ -1498,22 +2677,26 @@ 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1GetABranchConfigOutput = Schema.Struct({ ref: Schema.String, @@ -1538,25 +2721,73 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), db_user: Schema.optionalKey(Schema.String), db_pass: Schema.optionalKey(Schema.String), jwt_secret: Schema.optionalKey(Schema.String), }); export const V1GetAFunctionInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - function_slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + function_slug: Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", + }), + ), }); export const V1GetAFunctionOutput = Schema.Struct({ id: Schema.String, 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -1564,20 +2795,42 @@ export const V1GetAFunctionOutput = Schema.Struct({ ezbr_sha256: Schema.optionalKey(Schema.String), }); export const V1GetAFunctionBodyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - function_slug: Schema.String.check(Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + function_slug: Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", + }), + ), }); export const V1GetAFunctionBodyOutput = Schema.Struct({}); export const V1GetAMigrationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - version: Schema.String.check(Schema.isPattern(new RegExp("^\\d+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + version: Schema.String.check( + Schema.isPattern(new RegExp("^\\d+$")).annotate({ + expected: "a string matching the RegExp ^\\d+$", + }), + ), }); export const V1GetAMigrationOutput = Schema.Struct({ - version: Schema.String.check(Schema.isMinLength(1)), + version: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), name: Schema.optionalKey(Schema.String), statements: Schema.optionalKey(Schema.Array(Schema.String)), rollback: Schema.optionalKey(Schema.Array(Schema.String)), @@ -1587,8 +2840,13 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1GetASnippetOutput = Schema.Struct({ @@ -1599,10 +2857,16 @@ export const V1GetASnippetOutput = Schema.Struct({ visibility: Schema.Literals(["user", "project", "org", "public"]), name: Schema.String, description: Schema.Union([Schema.String, Schema.Null]), - project: Schema.Struct({ id: Schema.Number.check(Schema.isFinite()), name: Schema.String }), - owner: Schema.Struct({ id: Schema.Number.check(Schema.isFinite()), username: Schema.String }), + project: Schema.Struct({ + id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + name: Schema.String, + }), + owner: Schema.Struct({ + id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + username: Schema.String, + }), updated_by: Schema.Struct({ - id: Schema.Number.check(Schema.isFinite()), + id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), username: Schema.String, }), favorite: Schema.Boolean, @@ -1617,13 +2881,24 @@ export const V1GetASnippetOutput = Schema.Struct({ }), }); export const V1GetASsoProviderInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1GetASsoProviderOutput = Schema.Struct({ @@ -1641,7 +2916,16 @@ export const V1GetASsoProviderOutput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -1671,9 +2955,15 @@ export const V1GetASsoProviderOutput = Schema.Struct({ updated_at: Schema.optionalKey(Schema.String), }); export const V1GetActionRunInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), run_id: Schema.String, }); export const V1GetActionRunOutput = Schema.Struct({ @@ -1695,28 +2985,59 @@ export const V1GetActionRunOutput = Schema.Struct({ updated_at: Schema.String, }), ), - git_config: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), + git_config: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), workdir: Schema.Union([Schema.String, Schema.Null]), - check_run_id: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), + check_run_id: Schema.Union([ + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + Schema.Null, + ]), created_at: Schema.String, updated_at: Schema.String, }); export const V1GetActionRunLogsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), run_id: Schema.String, }); export const V1GetActionRunLogsOutput = Schema.String; export const V1GetAllProjectsForOrganizationInput = Schema.Struct({ - slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), offset: Schema.optionalKey( - Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ), limit: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(100)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" }), + ), ), search: Schema.optionalKey(Schema.String), sort: Schema.optionalKey( @@ -1794,9 +3115,13 @@ export const V1GetAllProjectsForOrganizationOutput = Schema.Struct({ cloud_provider: Schema.String, identifier: Schema.String, type: Schema.Literals(["PRIMARY", "READ_REPLICA"]), - disk_volume_size_gb: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + disk_volume_size_gb: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), disk_type: Schema.optionalKey(Schema.Literals(["gp3", "io2"])), - disk_throughput_mbps: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + disk_throughput_mbps: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), disk_last_modified_at: Schema.optionalKey(Schema.String), }), ), @@ -1805,17 +3130,21 @@ export const V1GetAllProjectsForOrganizationOutput = Schema.Struct({ pagination: Schema.Struct({ count: Schema.Number.annotate({ description: "Total number of projects. Use this to calculate the total number of pages.", - }).check(Schema.isFinite()), + }).check(Schema.isFinite().annotate({ expected: "a finite number" })), limit: Schema.Number.annotate({ description: "Maximum number of projects per page" }).check( - Schema.isFinite(), + Schema.isFinite().annotate({ expected: "a finite number" }), ), offset: Schema.Number.annotate({ description: "Number of projects skipped in this response", - }).check(Schema.isFinite()), + }).check(Schema.isFinite().annotate({ expected: "a finite number" })), }), }); export const V1GetAnOrganizationInput = Schema.Struct({ - slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), }); export const V1GetAnOrganizationOutput = Schema.Struct({ id: Schema.String, @@ -1833,16 +3162,49 @@ export const V1GetAnOrganizationOutput = Schema.Struct({ ), }); export const V1GetAuthServiceConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + db_max_pool_size: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), db_max_pool_size_unit: Schema.Union([ - Schema.Literals(["connections", "percent"]), - Schema.Union([Schema.Null]), + Schema.Literal("connections"), + Schema.Literal("percent"), + Schema.Null, ]), disable_signup: Schema.Union([Schema.Boolean, Schema.Null]), external_anonymous_users_enabled: Schema.Union([Schema.Boolean, Schema.Null]), @@ -1961,11 +3323,47 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + mailer_otp_length: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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]), @@ -2012,7 +3410,20 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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]), @@ -2023,30 +3434,157 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), password_required_characters: Schema.Union([ - Schema.Literals([ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", - "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", + Schema.Literal("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789"), + Schema.Literal("abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789"), + Schema.Literal( "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~", - "", - ]), - Schema.Union([Schema.Null]), + ), + Schema.Literal(""), + Schema.Null, + ]), + rate_limit_anonymous_users: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_email_sent: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_sms_sent: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_token_refresh: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_verify: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_otp: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_web3: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + 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]), 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]), @@ -2054,35 +3592,101 @@ export const V1GetAuthServiceConfigOutput = Schema.Struct({ security_sb_forwarded_for_enabled: Schema.Union([Schema.Boolean, Schema.Null]), security_captcha_enabled: Schema.Union([Schema.Boolean, Schema.Null]), security_captcha_provider: Schema.Union([ - Schema.Literals(["turnstile", "hcaptcha"]), - Schema.Union([Schema.Null]), + Schema.Literal("turnstile"), + Schema.Literal("hcaptcha"), + Schema.Null, ]), 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), Schema.Null, ]), security_update_password_require_reauthentication: Schema.Union([Schema.Boolean, Schema.Null]), - sessions_inactivity_timeout: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), + sessions_inactivity_timeout: Schema.Union([ + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + Schema.Null, + ]), sessions_single_per_user: Schema.Union([Schema.Boolean, Schema.Null]), sessions_tags: Schema.Union([Schema.String, Schema.Null]), - sessions_timebox: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), + sessions_timebox: Schema.Union([ + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + sms_otp_length: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), sms_provider: Schema.Union([ - Schema.Literals(["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"]), - Schema.Union([Schema.Null]), + Schema.Literal("messagebird"), + Schema.Literal("textlocal"), + Schema.Literal("twilio"), + Schema.Literal("twilio_verify"), + Schema.Literal("vonage"), + Schema.Null, ]), 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)))$", + ), + ).annotate({ + expected: + "a string matching the 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]), @@ -2097,9 +3701,34 @@ 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,}$", + ), + ).annotate({ + expected: + "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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]), @@ -2109,7 +3738,19 @@ 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().annotate({ expected: "an integer" }), + ) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), }); export const V1GetAvailableRegionsInput = Schema.Struct({ organization_slug: Schema.String, @@ -2169,7 +3810,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"])), }), ), @@ -2206,56 +3847,117 @@ 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"])), }), ), }), }); export const V1GetBackupScheduleInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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+)?)?$"), + ).annotate({ + expected: + "a string matching the 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)))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + size_gb: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + throughput_mibps: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + ), + type: Schema.Literal("gp3"), + }), + Schema.Struct({ + iops: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + size_gb: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + type: Schema.Literal("io2"), + }), + ]), last_modified_at: Schema.optionalKey(Schema.String), }); export const V1GetDatabaseMetadataInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetDatabaseMetadataOutput = Schema.Struct({ databases: Schema.Array( @@ -2264,38 +3966,58 @@ export const V1GetDatabaseMetadataOutput = Schema.Struct({ name: Schema.String, schemas: Schema.Array( Schema.StructWithRest(Schema.Struct({ name: Schema.String }), [ - Schema.Record(Schema.String, Schema.Json), + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), ]), ), }), - [Schema.Record(Schema.String, Schema.Json)], + [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))], ), ), }); export const V1GetDatabaseOpenapiInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), schema: Schema.optionalKey(Schema.String), }); export const V1GetDatabaseOpenapiOutput = Schema.Struct({}); export const V1GetDiskUtilizationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetDiskUtilizationOutput = Schema.Struct({ timestamp: Schema.String, metrics: Schema.Struct({ - fs_size_bytes: Schema.Number.check(Schema.isFinite()), - fs_avail_bytes: Schema.Number.check(Schema.isFinite()), - fs_used_bytes: Schema.Number.check(Schema.isFinite()), + fs_size_bytes: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + fs_avail_bytes: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + fs_used_bytes: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), }), }); export const V1GetHostnameConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetHostnameConfigOutput = Schema.Struct({ status: Schema.optionalKey( @@ -2310,8 +4032,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, @@ -2334,27 +4056,70 @@ export const V1GetHostnameConfigOutput = Schema.Struct({ }), }); export const V1GetJitAccessInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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( Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + }), + ), + }), + ), ), }), ), @@ -2363,9 +4128,15 @@ export const V1GetJitAccessOutput = Schema.Struct({ ), }); export const V1GetJitAccessConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetJitAccessConfigOutput = Schema.Union( [ @@ -2385,26 +4156,61 @@ export const V1GetJitAccessConfigOutput = Schema.Union( { mode: "oneOf" }, ); export const V1GetLegacySigningKeyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetNetworkRestrictionsOutput = Schema.Struct({ entitlement: Schema.Literals(["disallowed", "allowed"]), @@ -2425,11 +4231,37 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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-]+$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), }); export const V1GetOrganizationEntitlementsOutput = Schema.Struct({ entitlements: Schema.Array( @@ -2504,24 +4336,25 @@ 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().annotate({ expected: "a finite number" })), + unlimited: Schema.Boolean, + unit: Schema.String, + }), + Schema.Struct({ enabled: Schema.Boolean, set: Schema.Array(Schema.String) }), + ]), }), ), }); export const V1GetOrganizationProjectClaimInput = Schema.Struct({ - slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), token: Schema.String, }); export const V1GetOrganizationProjectClaimOutput = Schema.Struct({ @@ -2532,26 +4365,44 @@ export const V1GetOrganizationProjectClaimOutput = Schema.Struct({ errors: Schema.Array(Schema.Struct({ key: Schema.String, message: Schema.String })), info: Schema.Array(Schema.Struct({ key: Schema.String, message: Schema.String })), members_exceeding_free_project_limit: Schema.Array( - Schema.Struct({ name: Schema.String, limit: Schema.Number.check(Schema.isFinite()) }), + Schema.Struct({ + name: Schema.String, + limit: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + }), ), source_subscription_plan: Schema.Literals(["free", "pro", "team", "enterprise", "platform"]), target_subscription_plan: Schema.Union([ - Schema.Literals(["free", "pro", "team", "enterprise", "platform"]), - Schema.Union([Schema.Null]), + Schema.Literal("free"), + Schema.Literal("pro"), + Schema.Literal("team"), + Schema.Literal("enterprise"), + Schema.Literal("platform"), + Schema.Null, ]), }), expires_at: Schema.String, 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1GetPerformanceAdvisorsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetPerformanceAdvisorsOutput = Schema.Struct({ lints: Schema.Array( @@ -2603,7 +4454,11 @@ export const V1GetPerformanceAdvisorsOutput = Schema.Struct({ Schema.Literals(["table", "view", "auth", "function", "extension", "compliance"]), ), fkey_name: Schema.optionalKey(Schema.String), - fkey_columns: Schema.optionalKey(Schema.Array(Schema.Number.check(Schema.isFinite()))), + fkey_columns: Schema.optionalKey( + Schema.Array( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), + ), }), ), cache_key: Schema.String, @@ -2611,9 +4466,15 @@ export const V1GetPerformanceAdvisorsOutput = Schema.Struct({ ), }); export const V1GetPgsodiumConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetPgsodiumConfigOutput = Schema.Struct({ root_key: Schema.String.annotate({ @@ -2621,15 +4482,27 @@ export const V1GetPgsodiumConfigOutput = Schema.Struct({ }), }); export const V1GetPoolerConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetPoolerConfigOutput = Schema.Array(SupavisorConfigResponse); export const V1GetPostgresConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetPostgresConfigOutput = Schema.Struct({ effective_cache_size: Schema.optionalKey(Schema.String), @@ -2637,7 +4510,9 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ "cron.log_statement": Schema.optionalKey(Schema.Boolean), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_checkpoints: Schema.optionalKey(Schema.Boolean), @@ -2649,84 +4524,186 @@ export const V1GetPostgresConfigOutput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_temp_files: Schema.optionalKey(Schema.String), maintenance_work_mem: Schema.optionalKey(Schema.String), track_activity_query_size: Schema.optionalKey(Schema.String), max_connections: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), max_locks_per_transaction: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(10)) - .check(Schema.isLessThanOrEqualTo(2147483640)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(10).annotate({ + expected: "a value greater than or equal to 10", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483640).annotate({ + expected: "a value less than or equal to 2147483640", + }), + ), ), max_logical_replication_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), max_parallel_maintenance_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), ), max_parallel_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), ), max_parallel_workers_per_gather: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), + ), + max_replication_slots: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ), - max_replication_slots: Schema.optionalKey(Schema.Number.check(Schema.isInt())), 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), max_sync_workers_per_subscription: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), max_worker_processes: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), session_replication_role: Schema.optionalKey(Schema.Literals(["origin", "replica", "local"])), shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), track_commit_timestamp: Schema.optionalKey(Schema.Boolean), wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), hot_standby_feedback: Schema.optionalKey(Schema.Boolean), }); export const V1GetPostgresUpgradeEligibilityInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetPostgresUpgradeEligibilityOutput = Schema.Struct({ eligible: Schema.Boolean, @@ -2747,7 +4724,9 @@ export const V1GetPostgresUpgradeEligibilityOutput = Schema.Struct({ app_version: Schema.String, }), ), - duration_estimate_hours: Schema.Number.check(Schema.isFinite()), + duration_estimate_hours: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), legacy_auth_custom_roles: Schema.Array(Schema.String), objects_to_be_dropped: Schema.Array(Schema.String).annotate({ description: "Use validation_errors instead.", @@ -2759,54 +4738,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( @@ -2820,9 +4793,15 @@ export const V1GetPostgresUpgradeEligibilityOutput = Schema.Struct({ ), }); export const V1GetPostgresUpgradeStatusInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), tracking_id: Schema.optionalKey(Schema.String), }); export const V1GetPostgresUpgradeStatusOutput = Schema.Struct({ @@ -2830,7 +4809,9 @@ export const V1GetPostgresUpgradeStatusOutput = Schema.Struct({ Schema.Struct({ initiated_at: Schema.String, latest_status_at: Schema.String, - target_version: Schema.Number.check(Schema.isFinite()), + target_version: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), error: Schema.optionalKey( Schema.Literals([ "1_upgraded_instance_launch_failed", @@ -2859,30 +4840,68 @@ export const V1GetPostgresUpgradeStatusOutput = Schema.Struct({ "10_completed_post_physical_backup", ]), ), - status: Schema.Number.check(Schema.isFinite()), + status: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), }), Schema.Null, ]), }); export const V1GetPostgrestServiceConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetPostgrestServiceConfigOutput = Schema.Struct({ db_schema: Schema.String, - max_rows: Schema.Number.check(Schema.isInt()), + max_rows: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), Schema.Null, ]), jwt_secret: Schema.optionalKey(Schema.String), @@ -2894,21 +4913,33 @@ export const V1GetProfileOutput = Schema.Struct({ username: Schema.String, }); export const V1GetProjectInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetProjectOutput = Schema.Struct({ id: Schema.String.annotate({ description: "Deprecated: Use `ref` instead." }), ref: Schema.String.annotate({ description: "Project ref" }) - .check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + .check(Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), organization_id: Schema.String.annotate({ description: "Deprecated: Use `organization_slug` instead.", }), organization_slug: Schema.String.annotate({ description: "Organization slug" }).check( - Schema.isPattern(new RegExp("^[\\w-]+$")), + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), ), name: Schema.String.annotate({ description: "Name of your project" }), region: Schema.String.annotate({ description: "Region of your project" }), @@ -2938,23 +4969,36 @@ export const V1GetProjectOutput = Schema.Struct({ }), }); export const V1GetProjectApiKeyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.Union([Schema.String, Schema.Boolean])), }); export const V1GetProjectApiKeyOutput = Schema.Struct({ api_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), type: Schema.optionalKey( Schema.Union([ - Schema.Literals(["legacy", "publishable", "secret"]), - Schema.Union([Schema.Null]), + Schema.Literal("legacy"), + Schema.Literal("publishable"), + Schema.Literal("secret"), + Schema.Null, ]), ), prefix: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -2962,26 +5006,69 @@ 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + reveal: Schema.optionalKey(Schema.Union([Schema.String, Schema.Boolean])), }); export const V1GetProjectApiKeysOutput = Schema.Array(ApiKeyResponse); export const V1GetProjectClaimTokenInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetProjectClaimTokenOutput = Schema.Struct({ token_alias: Schema.String, @@ -2989,181 +5076,384 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1GetProjectDiskAutoscaleConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetProjectDiskAutoscaleConfigOutput = Schema.Struct({ growth_percent: Schema.Union([ Schema.Number.annotate({ description: "Growth percentage for disk autoscaling" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThan(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 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.isGreaterThan(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 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.isGreaterThan(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), Schema.Null, ]), }); export const V1GetProjectFunctionCombinedStatsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), interval: Schema.Literals(["15min", "1hr", "3hr", "1day"]), function_id: Schema.String, }); export const V1GetProjectFunctionCombinedStatsOutput = Schema.Struct({ - result: Schema.optionalKey(Schema.Array(Schema.Json)), + result: Schema.optionalKey(Schema.Array(Schema.Json.annotate({ expected: "JSON value" }))), 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().annotate({ expected: "a finite number" })), + 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetProjectLegacyApiKeysOutput = Schema.Struct({ enabled: Schema.Boolean }); export const V1GetProjectLogsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)), + result: Schema.optionalKey(Schema.Array(Schema.Json.annotate({ expected: "JSON value" }))), 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().annotate({ expected: "a finite number" })), + 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)), + result: Schema.optionalKey(Schema.Array(Schema.Json.annotate({ expected: "JSON value" }))), 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().annotate({ expected: "a finite number" })), + 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), + server_lifetime: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), + query_wait_timeout: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), + reserve_pool_size: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetProjectSigningKeysOutput = Schema.Struct({ keys: Schema.Array( @@ -3171,47 +5461,94 @@ 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)$", ), - ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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 V1GetProjectTpaIntegrationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, oidc_issuer_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), jwks_url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - custom_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), - resolved_jwks: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), + custom_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), + resolved_jwks: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), inserted_at: Schema.String, updated_at: Schema.String, resolved_at: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); export const V1GetProjectUsageApiCountInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), interval: Schema.optionalKey( Schema.Literals(["15min", "30min", "1hr", "3hr", "1day", "3day", "7day"]), ), @@ -3220,73 +5557,100 @@ export const V1GetProjectUsageApiCountOutput = Schema.Struct({ result: Schema.optionalKey( Schema.Array( Schema.Struct({ - timestamp: Schema.String.annotate({ format: "date-time" }), - total_auth_requests: Schema.Number.check(Schema.isFinite()), - total_realtime_requests: Schema.Number.check(Schema.isFinite()), - total_rest_requests: Schema.Number.check(Schema.isFinite()), - total_storage_requests: Schema.Number.check(Schema.isFinite()), + 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|))$", + ), + ).annotate({ + expected: + "a string matching the 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().annotate({ expected: "a finite number" }), + ), + total_realtime_requests: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + total_rest_requests: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + total_storage_requests: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), }), ), ), 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().annotate({ expected: "a finite number" })), + 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetProjectUsageRequestCountOutput = Schema.Struct({ result: Schema.optionalKey( - Schema.Array(Schema.Struct({ count: Schema.Number.check(Schema.isFinite()) })), + Schema.Array( + Schema.Struct({ + count: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + }), + ), ), 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().annotate({ expected: "a finite number" })), + 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetReadonlyModeStatusOutput = Schema.Struct({ enabled: Schema.Boolean, @@ -3294,9 +5658,15 @@ export const V1GetReadonlyModeStatusOutput = Schema.Struct({ override_active_until: Schema.String, }); export const V1GetRealtimeConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetRealtimeConfigOutput = Schema.Struct({ private_only: Schema.Union([ @@ -3305,64 +5675,126 @@ export const V1GetRealtimeConfigOutput = Schema.Struct({ ]), connection_pool: Schema.Union([ Schema.Number.annotate({ description: "Sets connection pool size for Realtime Authorization" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(100)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" }), + ), Schema.Null, ]), max_concurrent_users: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of concurrent users rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(50000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(50000).annotate({ + expected: "a value less than or equal to 50000", + }), + ), Schema.Null, ]), max_events_per_second: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of events per second rate per channel limit", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(50000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(50000).annotate({ + expected: "a value less than or equal to 50000", + }), + ), Schema.Null, ]), max_bytes_per_second: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of bytes per second rate per channel limit", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(10000000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000000).annotate({ + expected: "a value less than or equal to 10000000", + }), + ), Schema.Null, ]), max_channels_per_client: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of channels per client rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(10000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000).annotate({ + expected: "a value less than or equal to 10000", + }), + ), Schema.Null, ]), max_joins_per_second: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of joins per second rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(5000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(5000).annotate({ + expected: "a value less than or equal to 5000", + }), + ), Schema.Null, ]), max_presence_events_per_second: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of presence events per second rate limit", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(5000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(5000).annotate({ + expected: "a value less than or equal to 5000", + }), + ), Schema.Null, ]), max_payload_size_in_kb: Schema.Union([ Schema.Number.annotate({ description: "Sets maximum number of payload size in KB rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(10000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000).annotate({ + expected: "a value less than or equal to 10000", + }), + ), Schema.Null, ]), suspend: Schema.Union([ @@ -3375,20 +5807,48 @@ export const V1GetRealtimeConfigOutput = Schema.Struct({ presence_enabled: Schema.Boolean.annotate({ description: "Whether to enable presence" }), }); export const V1GetRestorePointInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - name: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(20))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + name: Schema.optionalKey( + Schema.String.check( + Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" }), + ), + ), }); 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), lint_type: Schema.optionalKey(Schema.Literal("sql")), }); export const V1GetSecurityAdvisorsOutput = Schema.Struct({ @@ -3441,7 +5901,11 @@ export const V1GetSecurityAdvisorsOutput = Schema.Struct({ Schema.Literals(["table", "view", "auth", "function", "extension", "compliance"]), ), fkey_name: Schema.optionalKey(Schema.String), - fkey_columns: Schema.optionalKey(Schema.Array(Schema.Number.check(Schema.isFinite()))), + fkey_columns: Schema.optionalKey( + Schema.Array( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), + ), }), ), cache_key: Schema.String, @@ -3449,58 +5913,151 @@ export const V1GetSecurityAdvisorsOutput = Schema.Struct({ ), }); 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", - ]), - ), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + 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)) - .check(Schema.isLessThanOrEqualTo(10000)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000).annotate({ + expected: "a value less than or equal to 10000", + }), + ), ), }); export const V1GetServicesHealthOutput = Schema.Array(V1ServiceHealthResponse); export const V1GetSslEnforcementConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetSslEnforcementConfigOutput = Schema.Struct({ currentConfig: Schema.Struct({ database: Schema.Boolean }), appliedSuccessfully: Schema.Boolean, }); export const V1GetStorageConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + maxTables: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + maxCatalogs: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + maxIndexes: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), }), }), capabilities: Schema.Struct({ list_v2: Schema.Boolean, iceberg_catalog: Schema.Boolean }), @@ -3509,28 +6066,87 @@ export const V1GetStorageConfigOutput = Schema.Struct({ databasePoolMode: Schema.optionalKey(Schema.String), }); export const V1GetVanitySubdomainConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1GetVanitySubdomainConfigOutput = Schema.Struct({ status: Schema.Literals(["not-used", "custom-domain-used", "active"]), - custom_domain: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1))), + custom_domain: Schema.optionalKey( + Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + ), }); 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)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + email: Schema.String.annotate({ format: "email" }) + .check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 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,}$", + ), + ).annotate({ + expected: + "a string matching the 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())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + }), + ), + }), + ), ), }), ), @@ -3539,21 +6155,67 @@ 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,}$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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( Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + }), + ), + }), + ), ), }), ), @@ -3562,14 +6224,26 @@ export const V1InviteExternalJitAccessOutput = Schema.Struct({ ), }); export const V1ListActionRunsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), offset: Schema.optionalKey( - Schema.Number.check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })).check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), ), limit: Schema.optionalKey( - Schema.Number.check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(10)), + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })).check( + Schema.isGreaterThanOrEqualTo(10).annotate({ + expected: "a value greater than or equal to 10", + }), + ), ), }); export const V1ListActionRunsOutput = Schema.Array( @@ -3600,17 +6274,28 @@ export const V1ListActionRunsOutput = Schema.Array( updated_at: Schema.String, }), ), - git_config: Schema.optionalKey(Schema.Union([Schema.Json, Schema.Null])), + git_config: Schema.optionalKey( + Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), + ), workdir: Schema.Union([Schema.String, Schema.Null]), - check_run_id: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), + check_run_id: Schema.Union([ + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + Schema.Null, + ]), created_at: Schema.String, updated_at: Schema.String, }), ); export const V1ListAllBackupsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllBackupsOutput = Schema.Struct({ region: Schema.String, @@ -3618,7 +6303,17 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), is_physical_backup: Schema.Boolean, status: Schema.Literals([ "COMPLETED", @@ -3632,40 +6327,94 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), + latest_physical_backup_date_unix: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), }), }); export const V1ListAllBranchesInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllBranchesOutput = Schema.Array(BranchResponse); export const V1ListAllBucketsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllBucketsOutput = Schema.Array(V1StorageBucketResponse); export const V1ListAllFunctionsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllFunctionsOutput = Schema.Array(FunctionResponse); export const V1ListAllNetworkBansInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllNetworkBansOutput = Schema.Struct({ banned_ipv4_addresses: Schema.Array(Schema.String), }); export const V1ListAllNetworkBansEnrichedInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllNetworkBansEnrichedOutput = Schema.Struct({ banned_ipv4_addresses: Schema.Array( @@ -3681,16 +6430,28 @@ export const V1ListAllOrganizationsOutput = Schema.Array(OrganizationResponseV1) export const V1ListAllProjectsInput = Schema.Struct({}); export const V1ListAllProjectsOutput = Schema.Array(V1ProjectWithDatabaseResponse); export const V1ListAllSecretsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllSecretsOutput = Schema.Array(SecretResponse); export const V1ListAllSnippetsInput = Schema.Struct({ project_ref: Schema.optionalKey( - Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), ), cursor: Schema.optionalKey(Schema.String), limit: Schema.optionalKey(Schema.String), @@ -3707,10 +6468,16 @@ export const V1ListAllSnippetsOutput = Schema.Struct({ visibility: Schema.Literals(["user", "project", "org", "public"]), name: Schema.String, description: Schema.Union([Schema.String, Schema.Null]), - project: Schema.Struct({ id: Schema.Number.check(Schema.isFinite()), name: Schema.String }), - owner: Schema.Struct({ id: Schema.Number.check(Schema.isFinite()), username: Schema.String }), + project: Schema.Struct({ + id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + name: Schema.String, + }), + owner: Schema.Struct({ + id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + username: Schema.String, + }), updated_by: Schema.Struct({ - id: Schema.Number.check(Schema.isFinite()), + id: Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), username: Schema.String, }), favorite: Schema.Boolean, @@ -3719,9 +6486,15 @@ export const V1ListAllSnippetsOutput = Schema.Struct({ cursor: Schema.optionalKey(Schema.String), }); export const V1ListAllSsoProviderInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAllSsoProviderOutput = Schema.Struct({ items: Schema.Array( @@ -3740,7 +6513,16 @@ export const V1ListAllSsoProviderOutput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -3772,9 +6554,15 @@ export const V1ListAllSsoProviderOutput = Schema.Struct({ ), }); export const V1ListAvailableRestoreVersionsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListAvailableRestoreVersionsOutput = Schema.Struct({ available_versions: Schema.Array( @@ -3786,96 +6574,183 @@ export const V1ListAvailableRestoreVersionsOutput = Schema.Struct({ ), }); export const V1ListJitAccessInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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 })), + ).annotate({ + expected: + "a string matching the 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).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), + 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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}$", - ), + ), + }), ), - ), - 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 })), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), + 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListMigrationHistoryOutput = Schema.Array( Schema.Struct({ - version: Schema.String.check(Schema.isMinLength(1)), + version: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), name: Schema.optionalKey(Schema.String), }), ); export const V1ListOrganizationMembersInput = Schema.Struct({ - slug: Schema.String.check(Schema.isPattern(new RegExp("^[\\w-]+$"))), + slug: Schema.String.check( + Schema.isPattern(new RegExp("^[\\w-]+$")).annotate({ + expected: "a string matching the RegExp ^[\\w-]+$", + }), + ), }); export const V1ListOrganizationMembersOutput = Schema.Array(V1OrganizationMemberResponse); export const V1ListProjectAddonsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ListProjectAddonsOutput = Schema.Struct({ selected_addons: Schema.Array( @@ -3891,8 +6766,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().annotate({ expected: "a finite number" })), + }), + 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", @@ -3920,107 +6849,55 @@ 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, type: Schema.Literals(["fixed", "usage"]), interval: Schema.Literals(["monthly", "hourly"]), - amount: Schema.Number.check(Schema.isFinite()), + amount: Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), }), - meta: Schema.optionalKey( - Schema.Json.annotate({ description: "Any JSON-serializable value" }), - ), + meta: Schema.optionalKey(ListProjectAddonsResponseJsonValue), }), ), }), ), }); export const V1ListProjectTpaIntegrationsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + }), + ), + ]), migration_version: Schema.optionalKey(Schema.String), }); export const V1MergeABranchOutput = Schema.Struct({ @@ -4028,22 +6905,58 @@ export const V1MergeABranchOutput = Schema.Struct({ message: Schema.Literal("ok"), }); export const V1ModifyDatabaseDiskInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), 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().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + size_gb: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), throughput_mibps: Schema.optionalKey( - Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 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().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), + size_gb: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ) + .check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" })), type: Schema.Literal("io2"), }), ], @@ -4051,13 +6964,24 @@ export const V1ModifyDatabaseDiskInput = Schema.Struct({ ), }); export const V1OauthAuthorizeProjectClaimInput = Schema.Struct({ - project_ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + project_ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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"]), redirect_uri: Schema.String, @@ -4067,17 +6991,33 @@ export const V1OauthAuthorizeProjectClaimInput = Schema.Struct({ code_challenge_method: Schema.optionalKey(Schema.Literals(["plain", "sha256", "S256"])), }); export const V1PatchAMigrationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - version: Schema.String.check(Schema.isPattern(new RegExp("^\\d+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + version: Schema.String.check( + Schema.isPattern(new RegExp("^\\d+$")).annotate({ + expected: "a string matching the RegExp ^\\d+$", + }), + ), name: Schema.optionalKey(Schema.String), rollback: Schema.optionalKey(Schema.String), }); export const V1PatchNetworkRestrictionsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), add: Schema.optionalKey( Schema.Struct({ dbAllowedCidrs: Schema.optionalKey(Schema.Array(Schema.String)), @@ -4113,32 +7053,64 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + }), + ), + ]), migration_version: Schema.optionalKey(Schema.String), }); export const V1PushABranchOutput = Schema.Struct({ @@ -4146,90 +7118,145 @@ export const V1PushABranchOutput = Schema.Struct({ message: Schema.Literal("ok"), }); export const V1ReadOnlyQueryInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - query: Schema.String.check(Schema.isMinLength(1)), - parameters: Schema.optionalKey(Schema.Array(Schema.Json)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + query: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + parameters: Schema.optionalKey(Schema.Array(Schema.Json.annotate({ expected: "JSON value" }))), }); export const V1RemoveAReadReplicaInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), database_identifier: Schema.String, }); 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" }, - ), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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"), + ]), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + }), + ), + ]), migration_version: Schema.optionalKey(Schema.String), }); export const V1ResetABranchOutput = Schema.Struct({ @@ -4237,83 +7264,163 @@ export const V1ResetABranchOutput = Schema.Struct({ message: Schema.Literal("ok"), }); export const V1RestartAProjectInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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 V1RestoreABranchOutput = Schema.Struct({ message: Schema.Literal("Branch restoration initiated"), }); export const V1RestoreAProjectInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); 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()), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + id: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), }); export const V1RestorePitrBackupInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), recovery_time_target_unix: Schema.Number.annotate({ format: "int64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, refresh_token: Schema.String, }); export const V1RollbackMigrationsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - gte: Schema.String.check(Schema.isPattern(new RegExp("^\\d+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + gte: Schema.String.check( + Schema.isPattern(new RegExp("^\\d+$")).annotate({ + expected: "a string matching the RegExp ^\\d+$", + }), + ), }); export const V1RunAQueryInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - query: Schema.String.check(Schema.isMinLength(1)), - parameters: Schema.optionalKey(Schema.Array(Schema.Json)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + query: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + parameters: Schema.optionalKey(Schema.Array(Schema.Json.annotate({ expected: "JSON value" }))), read_only: Schema.optionalKey(Schema.Boolean), }); export const V1ScrapeProjectMetricsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1ScrapeProjectMetricsOutput = Schema.String; export const V1SetupAReadReplicaInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), read_replica_region: Schema.Literals([ "us-east-1", "us-east-2", @@ -4336,33 +7443,51 @@ export const V1SetupAReadReplicaInput = Schema.Struct({ ]).annotate({ description: "Region you want your read replica to reside in" }), }); export const V1ShutdownRealtimeInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1UndoInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - name: Schema.String.check(Schema.isMaxLength(20)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + name: Schema.String.check( + Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 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).annotate({ expected: "a value with a length of at least 20" })) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), ), - ], - { mode: "oneOf" }, - ), + 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)$", + }), + ), + ]), branch_name: Schema.optionalKey(Schema.String), git_branch: Schema.optionalKey(Schema.String), reset_on_push: Schema.optionalKey( @@ -4393,19 +7518,37 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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, project_ref: Schema.String, 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), latest_check_run_id: Schema.optionalKey( Schema.Number.annotate({ description: "This field is deprecated and will not be populated.", - }).check(Schema.isFinite()), + }).check(Schema.isFinite().annotate({ expected: "a finite number" })), ), persistent: Schema.Boolean, status: Schema.Literals([ @@ -4418,12 +7561,52 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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", @@ -4445,14 +7628,30 @@ export const V1UpdateABranchConfigOutput = Schema.Struct({ ), }); export const V1UpdateAFunctionInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - 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_-]+$")))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + function_slug: Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + expected: "a string matching the RegExp ^[A-Za-z0-9_-]+$", + }), + ), + slug: Schema.optionalKey( + Schema.String.check( + Schema.isPattern(new RegExp("^[A-Za-z0-9_-]+$")).annotate({ + expected: "a string matching the 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.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), @@ -4463,9 +7662,41 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + created_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + updated_at: Schema.Number.annotate({ format: "int64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), verify_jwt: Schema.optionalKey(Schema.Boolean), import_map: Schema.optionalKey(Schema.Boolean), entrypoint_path: Schema.optionalKey(Schema.String), @@ -4473,24 +7704,53 @@ export const V1UpdateAFunctionOutput = Schema.Struct({ ezbr_sha256: Schema.optionalKey(Schema.String), }); export const V1UpdateAProjectInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - name: Schema.String.check(Schema.isMinLength(1)).check(Schema.isMaxLength(256)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + name: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ).check(Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })), }); export const V1UpdateAProjectOutput = Schema.Struct({ - id: Schema.Number.check(Schema.isInt()), + id: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ref: Schema.String, name: Schema.String, }); export const V1UpdateASsoProviderInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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), metadata_url: Schema.optionalKey(Schema.String), @@ -4502,7 +7762,14 @@ export const V1UpdateASsoProviderInput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -4532,7 +7799,16 @@ export const V1UpdateASsoProviderOutput = Schema.Struct({ Schema.Struct({ name: Schema.optionalKey(Schema.String), names: Schema.optionalKey(Schema.Array(Schema.String)), - default: Schema.optionalKey(Schema.Json), + default: Schema.optionalKey( + Schema.Union([ + Schema.Struct({}), + Schema.Number.check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.String, + Schema.Boolean, + ]), + ), array: Schema.optionalKey(Schema.Boolean), }), ), @@ -4562,9 +7838,15 @@ export const V1UpdateASsoProviderOutput = Schema.Struct({ updated_at: Schema.optionalKey(Schema.String), }); export const V1UpdateActionRunStatusInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), run_id: Schema.String, clone: Schema.optionalKey( Schema.Literals(["CREATED", "DEAD", "EXITED", "PAUSED", "REMOVING", "RESTARTING", "RUNNING"]), @@ -4590,23 +7872,56 @@ export const V1UpdateActionRunStatusInput = Schema.Struct({ }); export const V1UpdateActionRunStatusOutput = Schema.Struct({ message: Schema.Literal("ok") }); export const V1UpdateAuthServiceConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), site_url: Schema.optionalKey( - Schema.Union([Schema.String.check(Schema.isPattern(new RegExp("^[^,]+$"))), Schema.Null]), + Schema.Union([ + Schema.String.check( + Schema.isPattern(new RegExp("^[^,]+$")).annotate({ + expected: "a string matching the RegExp ^[^,]+$", + }), + ), + Schema.Null, + ]), ), disable_signup: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), jwt_exp: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(604800)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(604800).annotate({ + expected: "a value less than or equal to 604800", + }), + ), Schema.Null, ]), ), 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,}$", + ), + ).annotate({ + expected: + "a string matching the 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])), @@ -4614,9 +7929,17 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ smtp_pass: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), smtp_max_frequency: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(32767)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(32767).annotate({ + expected: "a value less than or equal to 32767", + }), + ), Schema.Null, ]), ), @@ -4710,9 +8033,17 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ ), mfa_max_enrolled_factors: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), @@ -4722,88 +8053,163 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ external_phone_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), saml_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), saml_external_url: Schema.optionalKey( - Schema.Union([Schema.String.check(Schema.isPattern(new RegExp("^[^,]+$"))), Schema.Null]), + Schema.Union([ + Schema.String.check( + Schema.isPattern(new RegExp("^[^,]+$")).annotate({ + expected: "a string matching the RegExp ^[^,]+$", + }), + ), + Schema.Null, + ]), ), security_sb_forwarded_for_enabled: Schema.optionalKey( Schema.Union([Schema.Boolean, Schema.Null]), ), security_captcha_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), security_captcha_provider: Schema.optionalKey( - Schema.Union([Schema.Literals(["turnstile", "hcaptcha"]), Schema.Union([Schema.Null])]), + Schema.Union([Schema.Literal("turnstile"), Schema.Literal("hcaptcha"), Schema.Null]), ), security_captcha_secret: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sessions_timebox: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })).check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), sessions_inactivity_timeout: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isFinite()).check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })).check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), sessions_single_per_user: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), sessions_tags: Schema.optionalKey( Schema.Union([ - Schema.String.check(Schema.isPattern(new RegExp("^\\s*([a-zA-Z0-9_-]+(\\s*,+\\s*)?)*\\s*$"))), + Schema.String.check( + Schema.isPattern(new RegExp("^\\s*([a-zA-Z0-9_-]+(\\s*,+\\s*)?)*\\s*$")).annotate({ + expected: "a string matching the RegExp ^\\s*([a-zA-Z0-9_-]+(\\s*,+\\s*)?)*\\s*$", + }), + ), Schema.Null, ]), ), rate_limit_anonymous_users: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), rate_limit_email_sent: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), rate_limit_sms_sent: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), rate_limit_verify: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), rate_limit_token_refresh: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), rate_limit_otp: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), rate_limit_web3: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), @@ -4814,21 +8220,29 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ password_hibp_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), password_min_length: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(6)) - .check(Schema.isLessThanOrEqualTo(32767)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(6).annotate({ + expected: "a value greater than or equal to 6", + }), + ) + .check( + Schema.isLessThanOrEqualTo(32767).annotate({ + expected: "a value less than or equal to 32767", + }), + ), Schema.Null, ]), ), password_required_characters: Schema.optionalKey( Schema.Union([ - Schema.Literals([ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", - "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", + Schema.Literal("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789"), + Schema.Literal("abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789"), + Schema.Literal( "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~", - "", - ]), - Schema.Union([Schema.Null]), + ), + Schema.Literal(""), + Schema.Null, ]), ), security_manual_linking_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), @@ -4837,63 +8251,129 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ ), security_refresh_token_reuse_interval: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), mailer_otp_exp: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), ), mailer_otp_length: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(6)) - .check(Schema.isLessThanOrEqualTo(10)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(6).annotate({ + expected: "a value greater than or equal to 6", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10).annotate({ expected: "a value less than or equal to 10" }), + ), Schema.Null, ]), ), sms_autoconfirm: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), sms_max_frequency: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(32767)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(32767).annotate({ + expected: "a value less than or equal to 32767", + }), + ), Schema.Null, ]), ), sms_otp_exp: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(2147483647)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483647).annotate({ + expected: "a value less than or equal to 2147483647", + }), + ), Schema.Null, ]), ), sms_otp_length: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(32767)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(32767).annotate({ + expected: "a value less than or equal to 32767", + }), + ), ), sms_provider: Schema.optionalKey( Schema.Union([ - Schema.Literals(["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"]), - Schema.Union([Schema.Null]), + Schema.Literal("messagebird"), + Schema.Literal("textlocal"), + Schema.Literal("twilio"), + Schema.Literal("twilio_verify"), + Schema.Literal("vonage"), + Schema.Null, ]), ), sms_messagebird_access_key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sms_messagebird_originator: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sms_test_otp: Schema.optionalKey( Schema.Union([ - Schema.String.check(Schema.isPattern(new RegExp("^([0-9]{1,15}=[0-9]+,?)*$"))), + Schema.String.check( + Schema.isPattern(new RegExp("^([0-9]{1,15}=[0-9]+,?)*$")).annotate({ + expected: "a string matching the RegExp ^([0-9]{1,15}=[0-9]+,?)*$", + }), + ), Schema.Null, ]), ), 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)))$", + ), + ).annotate({ + expected: + "a string matching the 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])), @@ -5044,13 +8524,39 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), ), db_max_pool_size_unit: Schema.optionalKey( - Schema.Union([Schema.Literals(["connections", "percent"]), Schema.Union([Schema.Null])]), + Schema.Union([Schema.Literal("connections"), Schema.Literal("percent"), Schema.Null]), ), api_max_request_duration: Schema.optionalKey( - Schema.Union([Schema.Number.check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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])), @@ -5064,17 +8570,33 @@ export const V1UpdateAuthServiceConfigInput = Schema.Struct({ mfa_phone_verify_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), mfa_phone_max_frequency: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(32767)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(32767).annotate({ + expected: "a value less than or equal to 32767", + }), + ), Schema.Null, ]), ), mfa_phone_otp_length: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(32767)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(32767).annotate({ + expected: "a value less than or equal to 32767", + }), + ), Schema.Null, ]), ), @@ -5089,11 +8611,38 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + db_max_pool_size: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), db_max_pool_size_unit: Schema.Union([ - Schema.Literals(["connections", "percent"]), - Schema.Union([Schema.Null]), + Schema.Literal("connections"), + Schema.Literal("percent"), + Schema.Null, ]), disable_signup: Schema.Union([Schema.Boolean, Schema.Null]), external_anonymous_users_enabled: Schema.Union([Schema.Boolean, Schema.Null]), @@ -5212,11 +8761,47 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + mailer_otp_length: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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]), @@ -5263,7 +8848,20 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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]), @@ -5274,30 +8872,157 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), password_required_characters: Schema.Union([ - Schema.Literals([ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", - "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789", + Schema.Literal("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789"), + Schema.Literal("abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789"), + Schema.Literal( "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~", - "", - ]), - Schema.Union([Schema.Null]), + ), + Schema.Literal(""), + Schema.Null, + ]), + rate_limit_anonymous_users: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_email_sent: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_sms_sent: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_token_refresh: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_verify: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_otp: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + rate_limit_web3: Schema.Union([ + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + 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]), 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]), @@ -5305,35 +9030,101 @@ export const V1UpdateAuthServiceConfigOutput = Schema.Struct({ security_sb_forwarded_for_enabled: Schema.Union([Schema.Boolean, Schema.Null]), security_captcha_enabled: Schema.Union([Schema.Boolean, Schema.Null]), security_captcha_provider: Schema.Union([ - Schema.Literals(["turnstile", "hcaptcha"]), - Schema.Union([Schema.Null]), + Schema.Literal("turnstile"), + Schema.Literal("hcaptcha"), + Schema.Null, ]), 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), Schema.Null, ]), security_update_password_require_reauthentication: Schema.Union([Schema.Boolean, Schema.Null]), - sessions_inactivity_timeout: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), + sessions_inactivity_timeout: Schema.Union([ + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + Schema.Null, + ]), sessions_single_per_user: Schema.Union([Schema.Boolean, Schema.Null]), sessions_tags: Schema.Union([Schema.String, Schema.Null]), - sessions_timebox: Schema.Union([Schema.Number.check(Schema.isFinite()), Schema.Null]), + sessions_timebox: Schema.Union([ + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), + sms_otp_length: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), sms_provider: Schema.Union([ - Schema.Literals(["messagebird", "textlocal", "twilio", "twilio_verify", "vonage"]), - Schema.Union([Schema.Null]), + Schema.Literal("messagebird"), + Schema.Literal("textlocal"), + Schema.Literal("twilio"), + Schema.Literal("twilio_verify"), + Schema.Literal("vonage"), + Schema.Null, ]), 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)))$", + ), + ).annotate({ + expected: + "a string matching the 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]), @@ -5348,9 +9139,34 @@ 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,}$", + ), + ).annotate({ + expected: + "a string matching the 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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]), @@ -5360,37 +9176,94 @@ 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().annotate({ expected: "an integer" }), + ) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), }); export const V1UpdateBackupScheduleInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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+)?)?$"), + ).annotate({ + expected: + "a string matching the 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+)?)?$"), + ).annotate({ + expected: + "a string matching the 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)))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - password: Schema.String.check(Schema.isMinLength(4)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + password: Schema.String.check( + Schema.isMinLength(4).annotate({ expected: "a value with a length of at least 4" }), + ), }); export const V1UpdateDatabasePasswordOutput = Schema.Struct({ message: Schema.String }); export const V1UpdateHostnameConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), - custom_hostname: Schema.String.check(Schema.isMinLength(1)).check(Schema.isMaxLength(253)), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + custom_hostname: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ).check(Schema.isMaxLength(253).annotate({ expected: "a value with a length of at most 253" })), }); export const V1UpdateHostnameConfigOutput = Schema.Struct({ status: Schema.optionalKey( @@ -5405,8 +9278,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, @@ -5429,25 +9302,68 @@ export const V1UpdateHostnameConfigOutput = Schema.Struct({ }), }); export const V1UpdateJitAccessInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), user_id: Schema.String.annotate({ format: "uuid" }) - .check(Schema.isMinLength(1)) + .check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 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)$", + ), + ).annotate({ + expected: + "a string matching the 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( Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + }), + ), + }), + ), ), }), ), @@ -5459,19 +9375,56 @@ 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)$", + ), + ).annotate({ + expected: + "a string matching the 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( Schema.Struct({ - role: Schema.String.check(Schema.isMinLength(1)), - expires_at: Schema.optionalKey(Schema.Number.check(Schema.isFinite())), + role: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), + expires_at: Schema.optionalKey( + Schema.Number.check(Schema.isFinite().annotate({ expected: "a finite number" })), + ), 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + ), + ).annotate({ + expected: + "a string matching the 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])$", + }), + ), + }), + ), ), }), ), @@ -5480,9 +9433,15 @@ export const V1UpdateJitAccessOutput = Schema.Struct({ ), }); export const V1UpdateJitAccessConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), state: Schema.Literals(["enabled", "disabled"]), }); export const V1UpdateJitAccessConfigOutput = Schema.Union( @@ -5503,9 +9462,15 @@ export const V1UpdateJitAccessConfigOutput = Schema.Union( { mode: "oneOf" }, ); export const V1UpdateNetworkRestrictionsInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), dbAllowedCidrs: Schema.optionalKey(Schema.Array(Schema.String)), dbAllowedCidrsV6: Schema.optionalKey(Schema.Array(Schema.String)), }); @@ -5528,13 +9493,41 @@ 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), root_key: Schema.String.annotate({ description: "The pgsodium root key: 32 bytes, hex-encoded (64 characters).", }), @@ -5545,14 +9538,28 @@ export const V1UpdatePgsodiumConfigOutput = Schema.Struct({ }), }); export const V1UpdatePoolerConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), default_pool_size: Schema.optionalKey( Schema.Union([ - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(3000)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(3000).annotate({ + expected: "a value less than or equal to 3000", + }), + ), Schema.Null, ]), ), @@ -5563,19 +9570,40 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + Schema.Null, + ]), pool_mode: Schema.String, }); export const V1UpdatePostgresConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), effective_cache_size: Schema.optionalKey(Schema.String), logical_decoding_work_mem: Schema.optionalKey(Schema.String), "cron.log_statement": Schema.optionalKey(Schema.Boolean), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_checkpoints: Schema.optionalKey(Schema.Boolean), @@ -5587,76 +9615,172 @@ export const V1UpdatePostgresConfigInput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_temp_files: Schema.optionalKey(Schema.String), maintenance_work_mem: Schema.optionalKey(Schema.String), track_activity_query_size: Schema.optionalKey(Schema.String), max_connections: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), max_locks_per_transaction: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(10)) - .check(Schema.isLessThanOrEqualTo(2147483640)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(10).annotate({ + expected: "a value greater than or equal to 10", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483640).annotate({ + expected: "a value less than or equal to 2147483640", + }), + ), ), max_logical_replication_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), max_parallel_maintenance_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), ), max_parallel_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), ), max_parallel_workers_per_gather: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), + ), + max_replication_slots: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ), - max_replication_slots: Schema.optionalKey(Schema.Number.check(Schema.isInt())), 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), max_sync_workers_per_subscription: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), max_worker_processes: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), session_replication_role: Schema.optionalKey(Schema.Literals(["origin", "replica", "local"])), shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), track_commit_timestamp: Schema.optionalKey(Schema.Boolean), wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), hot_standby_feedback: Schema.optionalKey(Schema.Boolean), @@ -5668,7 +9792,9 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ "cron.log_statement": Schema.optionalKey(Schema.Boolean), log_autovacuum_min_duration: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_checkpoints: Schema.optionalKey(Schema.Boolean), @@ -5680,137 +9806,317 @@ export const V1UpdatePostgresConfigOutput = Schema.Struct({ log_replication_commands: Schema.optionalKey(Schema.Boolean), log_startup_progress_interval: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), log_temp_files: Schema.optionalKey(Schema.String), maintenance_work_mem: Schema.optionalKey(Schema.String), track_activity_query_size: Schema.optionalKey(Schema.String), max_connections: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), max_locks_per_transaction: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(10)) - .check(Schema.isLessThanOrEqualTo(2147483640)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(10).annotate({ + expected: "a value greater than or equal to 10", + }), + ) + .check( + Schema.isLessThanOrEqualTo(2147483640).annotate({ + expected: "a value less than or equal to 2147483640", + }), + ), ), max_logical_replication_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), max_parallel_maintenance_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), ), max_parallel_workers: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), ), max_parallel_workers_per_gather: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1024)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1024).annotate({ + expected: "a value less than or equal to 1024", + }), + ), + ), + max_replication_slots: Schema.optionalKey( + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), ), - max_replication_slots: Schema.optionalKey(Schema.Number.check(Schema.isInt())), 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), max_sync_workers_per_subscription: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + ), max_worker_processes: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(262143)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(262143).annotate({ + expected: "a value less than or equal to 262143", + }), + ), ), session_replication_role: Schema.optionalKey(Schema.Literals(["origin", "replica", "local"])), shared_buffers: Schema.optionalKey(Schema.String), statement_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), track_commit_timestamp: Schema.optionalKey(Schema.Boolean), wal_keep_size: Schema.optionalKey(Schema.String), wal_sender_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: ms" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), work_mem: Schema.optionalKey(Schema.String), checkpoint_timeout: Schema.optionalKey( Schema.String.annotate({ description: "Default unit: s" }).check( - Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")), + Schema.isPattern(new RegExp("^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$")).annotate({ + expected: "a string matching the RegExp ^(-?[0-9]+(?:\\.[0-9]+)?)(us|ms|s|min|h|d)?$", + }), ), ), hot_standby_feedback: Schema.optionalKey(Schema.Boolean), }); export const V1UpdatePostgrestServiceConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), db_extra_search_path: Schema.optionalKey(Schema.String), db_schema: Schema.optionalKey(Schema.String), max_rows: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1000000)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1000000).annotate({ + expected: "a value less than or equal to 1000000", + }), + ), ), db_pool: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(1000)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(1000).annotate({ + expected: "a value less than or equal to 1000", + }), + ), ), db_pool_acquisition_timeout: Schema.optionalKey( - Schema.Number.check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(60)), + Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(60).annotate({ expected: "a value less than or equal to 60" }), + ), ), }); export const V1UpdatePostgrestServiceConfigOutput = Schema.Struct({ db_schema: Schema.String, - max_rows: Schema.Number.check(Schema.isInt()), + max_rows: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(-9007199254740991).annotate({ + expected: "a value greater than or equal to -9007199254740991", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), Schema.Null, ]), }); export const V1UpdateProjectApiKeyInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.Union([Schema.String, Schema.Boolean])), name: Schema.optionalKey( - Schema.String.check(Schema.isMinLength(4)) - .check(Schema.isMaxLength(64)) - .check(Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$"))), + Schema.String.check( + Schema.isMinLength(4).annotate({ expected: "a value with a length of at least 4" }), + ) + .check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })) + .check( + Schema.isPattern(new RegExp("^[a-z_][a-z0-9_]+$")).annotate({ + expected: "a string matching the 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + Schema.Null, + ]), ), }); export const V1UpdateProjectApiKeyOutput = Schema.Struct({ @@ -5818,8 +10124,10 @@ export const V1UpdateProjectApiKeyOutput = Schema.Struct({ id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), type: Schema.optionalKey( Schema.Union([ - Schema.Literals(["legacy", "publishable", "secret"]), - Schema.Union([Schema.Null]), + Schema.Literal("legacy"), + Schema.Literal("publishable"), + Schema.Literal("secret"), + Schema.Null, ]), ), prefix: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -5827,105 +10135,244 @@ 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.annotate({ expected: "JSON value" })).check( + Schema.isPropertyNames(Schema.String).annotate({ + expected: "an object with property names matching the schema", + }), + ), + 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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, + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), + enabled: Schema.Union([Schema.String, Schema.Boolean]), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), status: Schema.Literals(["in_use", "previously_used", "revoked", "standby"]), }); 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)$", + ), + ).annotate({ + expected: + "a string matching the 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.annotate({ expected: "JSON value" }), 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))$", + ), + ).annotate({ + expected: + "a string matching the 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))$", + ), + ).annotate({ + expected: + "a string matching the 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)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), private_only: Schema.optionalKey( Schema.Boolean.annotate({ description: "Whether to only allow private channels" }), ), connection_pool: Schema.optionalKey( Schema.Number.annotate({ description: "Sets connection pool size for Realtime Authorization" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(100)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" }), + ), ), max_concurrent_users: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of concurrent users rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(50000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(50000).annotate({ + expected: "a value less than or equal to 50000", + }), + ), ), max_events_per_second: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of events per second rate per channel limit", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(50000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(50000).annotate({ + expected: "a value less than or equal to 50000", + }), + ), ), max_bytes_per_second: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of bytes per second rate per channel limit", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(10000000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000000).annotate({ + expected: "a value less than or equal to 10000000", + }), + ), ), max_channels_per_client: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of channels per client rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(10000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000).annotate({ + expected: "a value less than or equal to 10000", + }), + ), ), max_joins_per_second: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of joins per second rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(5000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(5000).annotate({ + expected: "a value less than or equal to 5000", + }), + ), ), max_presence_events_per_second: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of presence events per second rate limit", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(5000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(5000).annotate({ + expected: "a value less than or equal to 5000", + }), + ), ), max_payload_size_in_kb: Schema.optionalKey( Schema.Number.annotate({ description: "Sets maximum number of payload size in KB rate limit" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)) - .check(Schema.isLessThanOrEqualTo(10000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ) + .check( + Schema.isLessThanOrEqualTo(10000).annotate({ + expected: "a value less than or equal to 10000", + }), + ), ), suspend: Schema.optionalKey( Schema.Boolean.annotate({ @@ -5938,9 +10385,15 @@ export const V1UpdateRealtimeConfigInput = Schema.Struct({ ), }); export const V1UpdateSslEnforcementConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), requestedConfig: Schema.Struct({ database: Schema.Boolean }), }); export const V1UpdateSslEnforcementConfigOutput = Schema.Struct({ @@ -5948,14 +10401,28 @@ export const V1UpdateSslEnforcementConfigOutput = Schema.Struct({ appliedSuccessfully: Schema.Boolean, }); export const V1UpdateStorageConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), fileSizeLimit: Schema.optionalKey( Schema.Number.annotate({ format: "int64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)) - .check(Schema.isLessThanOrEqualTo(536870912000)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(536870912000).annotate({ + expected: "a value less than or equal to 536870912000", + }), + ), ), features: Schema.optionalKey( Schema.Struct({ @@ -5965,18 +10432,66 @@ 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + maxTables: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + maxCatalogs: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 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().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), + maxIndexes: Schema.Number.check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ) + .check( + Schema.isLessThanOrEqualTo(9007199254740991).annotate({ + expected: "a value less than or equal to 9007199254740991", + }), + ), }), ), }), @@ -5986,9 +10501,15 @@ export const V1UpdateStorageConfigInput = Schema.Struct({ ), }); export const V1UpgradePostgresVersionInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), target_version: Schema.String, release_channel: Schema.optionalKey( Schema.Literals(["internal", "alpha", "beta", "ga", "withdrawn", "preview"]), @@ -5996,18 +10517,32 @@ export const V1UpgradePostgresVersionInput = Schema.Struct({ }); export const V1UpgradePostgresVersionOutput = Schema.Struct({ tracking_id: Schema.String }); export const V1UpsertAMigrationInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), "Idempotency-Key": Schema.optionalKey(Schema.String), - query: Schema.String.check(Schema.isMinLength(1)), + query: Schema.String.check( + Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" }), + ), name: Schema.optionalKey(Schema.String), rollback: Schema.optionalKey(Schema.String), }); export const V1VerifyDnsConfigInput = Schema.Struct({ - ref: Schema.String.check(Schema.isMinLength(20)) - .check(Schema.isMaxLength(20)) - .check(Schema.isPattern(new RegExp("^[a-z]+$"))), + ref: Schema.String.check( + Schema.isMinLength(20).annotate({ expected: "a value with a length of at least 20" }), + ) + .check(Schema.isMaxLength(20).annotate({ expected: "a value with a length of at most 20" })) + .check( + Schema.isPattern(new RegExp("^[a-z]+$")).annotate({ + expected: "a string matching the RegExp ^[a-z]+$", + }), + ), }); export const V1VerifyDnsConfigOutput = Schema.Struct({ status: Schema.optionalKey( @@ -6022,8 +10557,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, @@ -6299,7 +10834,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"], @@ -6535,6 +11070,8 @@ export const operationDefinitions = { "kps_enabled", "desired_instance_size", "template_url", + "release_channel", + "postgres_engine", "high_availability", ], }, @@ -7003,7 +11540,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"], @@ -7886,7 +12423,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"], @@ -7988,7 +12525,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"], @@ -8193,7 +12730,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"], @@ -8935,7 +13472,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"] 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");