From 5c0264e3bae5eff29a55343222087c202c877fa1 Mon Sep 17 00:00:00 2001 From: "supabase-cli-releaser[bot]" <246109035+supabase-cli-releaser[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 20:05:57 +0000 Subject: [PATCH] chore: sync API types from infrastructure (#7246) This PR was automatically created to sync API types from the infrastructure repository. Changes were detected after refreshing `apps/cli-go/api/v1-openapi.yaml` from the latest spec from infrastructure, and `apps/cli-go/pkg/api` is regenerated from it. The snapshot diff is the upstream API change and is worth reading: it is marked `linguist-generated`, so GitHub collapses it behind a "Load diff" click rather than hiding it. Co-authored-by: supabase-cli-releaser[bot] <246109035+supabase-cli-releaser[bot]@users.noreply.github.com> --- apps/cli-go/api/v1-openapi.yaml | 58 +++++++++++++++++++++++++++++--- apps/cli-go/pkg/api/types.gen.go | 35 +++++++++++++++++-- 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/apps/cli-go/api/v1-openapi.yaml b/apps/cli-go/api/v1-openapi.yaml index 7181246025..210608ae7c 100644 --- a/apps/cli-go/api/v1-openapi.yaml +++ b/apps/cli-go/api/v1-openapi.yaml @@ -6965,11 +6965,10 @@ paths: content: application/vnd.denoland.eszip: schema: - type: string - format: binary + $ref: '#/components/schemas/V1UpdateFunctionBodyEszip' application/json: schema: - $ref: '#/components/schemas/V1UpdateFunctionBody' + $ref: '#/components/schemas/V1UpdateFunctionBodyJson' responses: '200': description: '' @@ -14826,7 +14825,7 @@ components: StreamableFile: type: object properties: {} - V1UpdateFunctionBody: + V1UpdateFunctionBodyJson: type: object properties: name: @@ -14839,6 +14838,57 @@ components: name: Hello World body: Deno.serve(() => new Response('Hello again!')) verify_jwt: true + V1UpdateFunctionBodyEszip: + type: string + format: binary + contentEncoding: binary + description: >+ + Raw Brotli-compressed ESZIP binary file. + + + **Validation requirements** - The file must start with the four magic + bytes `EZBR` (hex: `45 5A 42 52`). + + - The `ezbr_sha256` query parameter must contain the SHA-256 hash of the + uploaded ESZIP payload. + + + **Example** + + ```javascript + + import { readFile } from 'node:fs/promises'; + + import { brotliCompress } from 'node:zlib'; + + import { promisify } from 'node:util'; + + import { createHash } from 'node:crypto'; + + + const compress = promisify(brotliCompress); + + const marker = Buffer.from('EZBR', 'ascii'); + + + const file = await readFile('./function.eszip'); + + const compressed = await compress(file); + + + const payload = Buffer.concat([marker, compressed]); + + + const ezbr_sha256 = createHash('sha256') + .update(payload) + .digest('hex'); + + console.log(ezbr_sha256); + + ``` + + examples: + - Binary Brotli-compressed ESZIP file V1StorageBucketResponse_Output: type: object properties: diff --git a/apps/cli-go/pkg/api/types.gen.go b/apps/cli-go/pkg/api/types.gen.go index 727e183552..4ab675df0a 100644 --- a/apps/cli-go/pkg/api/types.gen.go +++ b/apps/cli-go/pkg/api/types.gen.go @@ -8978,8 +8978,37 @@ type V1UpdateBackupScheduleBody struct { ScheduleFor string `json:"schedule_for"` } -// V1UpdateFunctionBody defines model for V1UpdateFunctionBody. -type V1UpdateFunctionBody struct { +// V1UpdateFunctionBodyEszip Raw Brotli-compressed ESZIP binary file. +// +// **Validation requirements** - The file must start with the four magic bytes `EZBR` (hex: `45 5A 42 52`). +// - The `ezbr_sha256` query parameter must contain the SHA-256 hash of the uploaded ESZIP payload. +// +// **Example** +// ```javascript +// import { readFile } from 'node:fs/promises'; +// import { brotliCompress } from 'node:zlib'; +// import { promisify } from 'node:util'; +// import { createHash } from 'node:crypto'; +// +// const compress = promisify(brotliCompress); +// const marker = Buffer.from('EZBR', 'ascii'); +// +// const file = await readFile('./function.eszip'); +// const compressed = await compress(file); +// +// const payload = Buffer.concat([marker, compressed]); +// +// const ezbr_sha256 = createHash('sha256') +// +// .update(payload) +// .digest('hex'); +// +// console.log(ezbr_sha256); +// ``` +type V1UpdateFunctionBodyEszip = openapi_types.File + +// V1UpdateFunctionBodyJson defines model for V1UpdateFunctionBodyJson. +type V1UpdateFunctionBodyJson struct { Body *string `json:"body,omitempty"` Name *string `json:"name,omitempty"` VerifyJwt *bool `json:"verify_jwt,omitempty"` @@ -9532,7 +9561,7 @@ type V1BulkUpdateFunctionsJSONRequestBody = BulkUpdateFunctionBody type V1DeployAFunctionMultipartRequestBody = FunctionDeployBody // V1UpdateAFunctionJSONRequestBody defines body for V1UpdateAFunction for application/json ContentType. -type V1UpdateAFunctionJSONRequestBody = V1UpdateFunctionBody +type V1UpdateAFunctionJSONRequestBody = V1UpdateFunctionBodyJson // V1UpdateJitAccessConfigJSONRequestBody defines body for V1UpdateJitAccessConfig for application/json ContentType. type V1UpdateJitAccessConfigJSONRequestBody = JitAccessRequestRequest