From b867ff6c521b6b424b86fcfd78988929b401d093 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 9 Oct 2025 12:05:34 -0400 Subject: [PATCH 01/14] First. --- package-lock.json | 40 +++++++++- .../@apphosting/adapter-nextjs/package.json | 6 +- .../adapter-nextjs/src/bin/build.ts | 67 ++-------------- .../@apphosting/adapter-nextjs/src/index.ts | 78 ++++++++++++++++++- .../adapter-nextjs/src/utils.spec.ts | 2 +- .../@apphosting/adapter-nextjs/src/utils.ts | 3 +- 6 files changed, 129 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index 82d5fb20..a8e39e4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1345,6 +1345,10 @@ "resolved": "packages/@apphosting/adapter-nextjs", "link": true }, + "node_modules/@apphosting/adapter-nextjs-exp": { + "resolved": "packages/@apphosting/adapter-nextjs-exp", + "link": true + }, "node_modules/@apphosting/build": { "resolved": "packages/@apphosting/build", "link": true @@ -25650,6 +25654,40 @@ } } }, + "packages/@apphosting/adapter-nextjs-exp": { + "version": "15.0.0", + "license": "Apache-2.0", + "dependencies": { + "@apphosting/common": "*", + "fs-extra": "^11.1.1", + "yaml": "^2.3.4" + }, + "bin": { + "apphosting-adapter-nextjs-build": "dist/bin/build.js", + "apphosting-adapter-nextjs-create": "dist/bin/create.js" + }, + "devDependencies": { + "@types/fs-extra": "*", + "@types/mocha": "*", + "@types/tmp": "*", + "mocha": "*", + "next": "~14.0.0", + "semver": "*", + "tmp": "*", + "ts-mocha": "*", + "ts-node": "*", + "typescript": "*", + "verdaccio": "^5.30.3" + }, + "peerDependencies": { + "next": "*" + }, + "peerDependenciesMeta": { + "next": { + "optional": true + } + } + }, "packages/@apphosting/build": { "version": "0.1.6", "license": "Apache-2.0", @@ -25753,7 +25791,7 @@ } }, "packages/@apphosting/common": { - "version": "0.0.8", + "version": "0.0.9", "license": "Apache-2.0" }, "packages/@apphosting/create": { diff --git a/packages/@apphosting/adapter-nextjs/package.json b/packages/@apphosting/adapter-nextjs/package.json index 3490ab47..b5ba93cd 100644 --- a/packages/@apphosting/adapter-nextjs/package.json +++ b/packages/@apphosting/adapter-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@apphosting/adapter-nextjs", - "version": "14.0.18", + "version": "15.0.0", "main": "dist/index.js", "description": "Experimental addon to the Firebase CLI to add web framework support", "repository": { @@ -21,7 +21,7 @@ "type": "module", "sideEffects": false, "scripts": { - "build": "rm -rf dist && tsc && chmod +x ./dist/bin/*", + "build": "rm -rf dist && tsc && chmod +x ./dist/bin/* && npx -y esbuild ./dist/index.js --bundle --format=cjs --platform=node --outfile=./dist/index.cjs", "test": "npm run test:unit && npm run test:functional", "test:unit": "ts-mocha -p tsconfig.json 'src/**/*.spec.ts' 'src/*.spec.ts'", "test:functional": "node --loader ts-node/esm ./e2e/run-local.ts", @@ -30,7 +30,7 @@ }, "exports": { ".": { - "node": "./dist/index.js", + "node": "./dist/index.cjs", "default": null }, "./dist/*": { diff --git a/packages/@apphosting/adapter-nextjs/src/bin/build.ts b/packages/@apphosting/adapter-nextjs/src/bin/build.ts index 1572adee..f0ef92cd 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/build.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/build.ts @@ -2,19 +2,10 @@ import { loadConfig, populateOutputBundleOptions, - generateBuildOutput, validateOutputDirectory, - getAdapterMetadata, - exists, } from "../utils.js"; import { join } from "path"; import { getBuildOptions, runBuild } from "@apphosting/common"; -import { - addRouteOverrides, - overrideNextConfig, - restoreNextConfig, - validateNextConfigOverride, -} from "../overrides.js"; const root = process.cwd(); const opts = getBuildOptions(); @@ -26,53 +17,11 @@ process.env.NEXT_TELEMETRY_DISABLED = "1"; const nextConfig = await loadConfig(root, opts.projectDirectory); -/** - * Override user's Next Config to optimize the app for Firebase App Hosting - * and validate that the override resulted in a valid config that Next.js can - * load. - * - * We restore the user's Next Config at the end of the build, after the config file has been - * copied over to the output directory, so that the user's original code is not modified. - * - * If the app does not have a next.config.[js|mjs|ts] file in the first place, - * then can skip config override. - * - * Note: loadConfig always returns a fileName (default: next.config.js) even if - * one does not exist in the app's root: https://github.com/vercel/next.js/blob/23681508ca34b66a6ef55965c5eac57de20eb67f/packages/next/src/server/config.ts#L1115 - */ -const nextConfigPath = join(root, nextConfig.configFileName); -if (await exists(nextConfigPath)) { - await overrideNextConfig(root, nextConfig.configFileName); - await validateNextConfigOverride(root, opts.projectDirectory, nextConfig.configFileName); -} - -try { - await runBuild(); - - const adapterMetadata = getAdapterMetadata(); - const nextBuildDirectory = join(opts.projectDirectory, nextConfig.distDir); - const outputBundleOptions = populateOutputBundleOptions( - root, - opts.projectDirectory, - nextBuildDirectory, - ); - - await addRouteOverrides( - outputBundleOptions.outputDirectoryAppPath, - nextConfig.distDir, - adapterMetadata, - ); - - const nextjsVersion = process.env.FRAMEWORK_VERSION || "unspecified"; - await generateBuildOutput( - root, - opts.projectDirectory, - outputBundleOptions, - nextBuildDirectory, - nextjsVersion, - adapterMetadata, - ); - await validateOutputDirectory(outputBundleOptions, nextBuildDirectory); -} finally { - await restoreNextConfig(root, nextConfig.configFileName); -} +await runBuild(); +const nextBuildDirectory = join(opts.projectDirectory, nextConfig.distDir); +const outputBundleOptions = populateOutputBundleOptions( + root, + opts.projectDirectory, + nextBuildDirectory, +); +await validateOutputDirectory(outputBundleOptions, nextBuildDirectory); diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index cb0ff5c3..f51f6839 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -1 +1,77 @@ -export {}; +import { generateBuildOutput, getAdapterMetadata, populateOutputBundleOptions } from "./utils.js"; +import { getBuildOptions } from "@apphosting/common/dist/index.js"; + +// TODO can we override from the default config? +const fahOptimizedConfig = (config: any) => ({ + ...config, + images: { + ...(config.images || {}), + ...(config.images?.unoptimized === undefined && config.images?.loader === undefined + ? { unoptimized: true } + : {}), + }, + headers: async () => { + const originalHeaders = config.headers && await config.headers() || []; + const adapterMetadata = getAdapterMetadata(); + // TODO add our middleware header OR not... :P + return [ + ...originalHeaders, + { + source: "/(.*)", + headers: [{ + key: "x-fah-adapter", + value: `nextjs-${adapterMetadata.adapterVersion}`, + }], + }, + ] + }, + experimental: { + ...(config.experimental || {}), + nodeMiddleware: true, + }, + output: 'standalone', + }); + +// TODO import the type from next +interface NextAdapter { + name: string; + modifyConfig?: (config: any, context: { phase: string }) => Promise | any; + onBuildComplete?: (context: any) => Promise | void; +} +const adapter: NextAdapter = { + name: '@apphosting/adapter-nextjs', + // FEEDBACK: we need to be able to override user-defined config, before defaults injected + // it would be nice if this where a seperate phase or callback + async modifyConfig(config, { phase }) { + if (phase === 'phase-production-build') { + return fahOptimizedConfig(config); + } + // TODO override config for production build + return config; + }, + async onBuildComplete(context) { + const nextBuildDirectory = context.distDir; + const outputBundleOptions = populateOutputBundleOptions( + context.repoRoot, + context.projectDir, + nextBuildDirectory, + ); + + const adapterMetadata = getAdapterMetadata(); + + const root = process.cwd(); + const opts = getBuildOptions(); + + const nextjsVersion = process.env.FRAMEWORK_VERSION || context.nextVersion || "unspecified"; + await generateBuildOutput( + root, + opts.projectDirectory, + outputBundleOptions, + nextBuildDirectory, + nextjsVersion, + adapterMetadata, + ); + }, +}; + +module.exports = adapter; diff --git a/packages/@apphosting/adapter-nextjs/src/utils.spec.ts b/packages/@apphosting/adapter-nextjs/src/utils.spec.ts index 5ae25a08..c55f4dc5 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.spec.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.spec.ts @@ -4,7 +4,7 @@ import assert from "assert"; import fs from "fs"; import path from "path"; import os from "os"; -import { RoutesManifest, MiddlewareManifest } from "../src/interfaces.js"; +import { RoutesManifest, MiddlewareManifest } from "./interfaces.js"; describe("manifest utils", () => { let tmpDir: string; diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index 3c6ab548..fb92ca6f 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -165,8 +165,7 @@ async function copyResources( } export function getAdapterMetadata(): AdapterMetadata { - const directoryName = dirname(fileURLToPath(import.meta.url)); - const packageJsonPath = `${directoryName}/../package.json`; + const packageJsonPath = `${__dirname}/../package.json`; if (!existsSync(packageJsonPath)) { throw new Error(`Next.js adapter package.json file does not exist at ${packageJsonPath}`); } From 49efdcc2d5c52ef185073446ca2830dc439b1b7c Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 9 Oct 2025 12:59:25 -0400 Subject: [PATCH 02/14] Cleanup --- package-lock.json | 997 +++++++++++++----- .../@apphosting/adapter-nextjs/package.json | 2 +- .../adapter-nextjs/src/bin/build.ts | 22 +- .../@apphosting/adapter-nextjs/src/index.ts | 79 +- .../adapter-nextjs/src/overrides.spec.ts | 445 -------- .../adapter-nextjs/src/overrides.ts | 229 ---- .../@apphosting/adapter-nextjs/src/utils.ts | 69 +- 7 files changed, 798 insertions(+), 1045 deletions(-) delete mode 100644 packages/@apphosting/adapter-nextjs/src/overrides.spec.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/overrides.ts diff --git a/package-lock.json b/package-lock.json index a8e39e4e..e8f0ed10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1345,10 +1345,6 @@ "resolved": "packages/@apphosting/adapter-nextjs", "link": true }, - "node_modules/@apphosting/adapter-nextjs-exp": { - "resolved": "packages/@apphosting/adapter-nextjs-exp", - "link": true - }, "node_modules/@apphosting/build": { "resolved": "packages/@apphosting/build", "link": true @@ -3362,10 +3358,11 @@ } }, "node_modules/@emnapi/runtime": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", - "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", + "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -5224,6 +5221,17 @@ "node": ">=6.9.0" } }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18" + } + }, "node_modules/@img/sharp-darwin-arm64": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", @@ -5332,6 +5340,23 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.3.tgz", + "integrity": "sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@img/sharp-libvips-linux-s390x": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", @@ -5440,6 +5465,29 @@ "@img/sharp-libvips-linux-arm64": "1.0.4" } }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.4.tgz", + "integrity": "sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.3" + } + }, "node_modules/@img/sharp-linux-s390x": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", @@ -5547,6 +5595,26 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.4.tgz", + "integrity": "sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@img/sharp-win32-ia32": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", @@ -6294,156 +6362,6 @@ "node": ">= 0.4" } }, - "node_modules/@next/env": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.4.tgz", - "integrity": "sha512-irQnbMLbUNQpP1wcE5NstJtbuA/69kRfzBrpAD7Gsn8zm/CY6YQYc3HQBz8QPxwISG26tIm5afvvVbu508oBeQ==", - "dev": true - }, - "node_modules/@next/swc-darwin-arm64": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.4.tgz", - "integrity": "sha512-mF05E/5uPthWzyYDyptcwHptucf/jj09i2SXBPwNzbgBNc+XnwzrL0U6BmPjQeOL+FiB+iG1gwBeq7mlDjSRPg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-darwin-x64": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.4.tgz", - "integrity": "sha512-IZQ3C7Bx0k2rYtrZZxKKiusMTM9WWcK5ajyhOZkYYTCc8xytmwSzR1skU7qLgVT/EY9xtXDG0WhY6fyujnI3rw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.4.tgz", - "integrity": "sha512-VwwZKrBQo/MGb1VOrxJ6LrKvbpo7UbROuyMRvQKTFKhNaXjUmKTu7wxVkIuCARAfiI8JpaWAnKR+D6tzpCcM4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.4.tgz", - "integrity": "sha512-8QftwPEW37XxXoAwsn+nXlodKWHfpMaSvt81W43Wh8dv0gkheD+30ezWMcFGHLI71KiWmHK5PSQbTQGUiidvLQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.4.tgz", - "integrity": "sha512-/s/Pme3VKfZAfISlYVq2hzFS8AcAIOTnoKupc/j4WlvF6GQ0VouS2Q2KEgPuO1eMBwakWPB1aYFIA4VNVh667A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-musl": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.4.tgz", - "integrity": "sha512-m8z/6Fyal4L9Bnlxde5g2Mfa1Z7dasMQyhEhskDATpqr+Y0mjOBZcXQ7G5U+vgL22cI4T7MfvgtrM2jdopqWaw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.4.tgz", - "integrity": "sha512-7Wv4PRiWIAWbm5XrGz3D8HUkCVDMMz9igffZG4NB1p4u1KoItwx9qjATHz88kwCEal/HXmbShucaslXCQXUM5w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.4.tgz", - "integrity": "sha512-zLeNEAPULsl0phfGb4kdzF/cAVIfaC7hY+kt0/d+y9mzcZHsMS3hAS829WbJ31DkSlVKQeHEjZHIdhN+Pg7Gyg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.4.tgz", - "integrity": "sha512-yEh2+R8qDlDCjxVpzOTEpBLQTEFAcP2A8fUFLaWNap9GitYKkKv1//y2S6XY6zsR4rCOPRpU7plYDR+az2n30A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@ngtools/webpack": { "version": "17.1.2", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-17.1.2.tgz", @@ -9273,15 +9191,6 @@ "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", "dev": true }, - "node_modules/@swc/helpers": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", - "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", - "dev": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -13215,10 +13124,11 @@ } }, "node_modules/detect-libc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -18497,53 +18407,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/next": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/next/-/next-14.0.4.tgz", - "integrity": "sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==", - "dev": true, - "dependencies": { - "@next/env": "14.0.4", - "@swc/helpers": "0.5.2", - "busboy": "1.6.0", - "caniuse-lite": "^1.0.30001406", - "graceful-fs": "^4.2.11", - "postcss": "8.4.31", - "styled-jsx": "5.1.1", - "watchpack": "2.4.0" - }, - "bin": { - "next": "dist/bin/next" - }, - "engines": { - "node": ">=18.17.0" - }, - "optionalDependencies": { - "@next/swc-darwin-arm64": "14.0.4", - "@next/swc-darwin-x64": "14.0.4", - "@next/swc-linux-arm64-gnu": "14.0.4", - "@next/swc-linux-arm64-musl": "14.0.4", - "@next/swc-linux-x64-gnu": "14.0.4", - "@next/swc-linux-x64-musl": "14.0.4", - "@next/swc-win32-arm64-msvc": "14.0.4", - "@next/swc-win32-ia32-msvc": "14.0.4", - "@next/swc-win32-x64-msvc": "14.0.4" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.1.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "sass": "^1.3.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "sass": { - "optional": true - } - } - }, "node_modules/nice-napi": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz", @@ -23177,29 +23040,6 @@ "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", "optional": true }, - "node_modules/styled-jsx": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", - "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", - "dev": true, - "dependencies": { - "client-only": "0.0.1" - }, - "engines": { - "node": ">= 12.0.0" - }, - "peerDependencies": { - "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "babel-plugin-macros": { - "optional": true - } - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -25621,7 +25461,7 @@ } }, "packages/@apphosting/adapter-nextjs": { - "version": "14.0.18", + "version": "15.0.0", "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", @@ -25637,7 +25477,7 @@ "@types/mocha": "*", "@types/tmp": "*", "mocha": "*", - "next": "~14.0.0", + "next": "15.6.0-canary.54", "semver": "*", "tmp": "*", "ts-mocha": "*", @@ -25656,6 +25496,7 @@ }, "packages/@apphosting/adapter-nextjs-exp": { "version": "15.0.0", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", @@ -25688,6 +25529,680 @@ } } }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.4.tgz", + "integrity": "sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-darwin-x64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.4.tgz", + "integrity": "sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.3.tgz", + "integrity": "sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.3.tgz", + "integrity": "sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.3.tgz", + "integrity": "sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.3.tgz", + "integrity": "sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.3.tgz", + "integrity": "sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.3.tgz", + "integrity": "sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.3.tgz", + "integrity": "sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.3.tgz", + "integrity": "sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-linux-arm": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.4.tgz", + "integrity": "sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-linux-arm64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.4.tgz", + "integrity": "sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-linux-s390x": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.4.tgz", + "integrity": "sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-linux-x64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.4.tgz", + "integrity": "sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.4.tgz", + "integrity": "sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.4.tgz", + "integrity": "sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.3" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-wasm32": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.4.tgz", + "integrity": "sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.5.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-win32-ia32": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.4.tgz", + "integrity": "sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-win32-x64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.4.tgz", + "integrity": "sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/env": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.6.0-canary.54.tgz", + "integrity": "sha512-JgxtLpWVwu7iAC2oKmXSEZlAn7ogsPVWqBVGftwj9QpP0ufHASbt3UTHBXo2Fc4/Msl8PYeL19DlahcRfUDwaQ==", + "dev": true, + "license": "MIT" + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-darwin-arm64": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.6.0-canary.54.tgz", + "integrity": "sha512-B+QjESWfG3LdzQ9FhpmIrJQdYmJP9VhulKxaYUAimA2T+E+qxTk+IfeVkwqOmqWcubZeVBOLiREE+VOPXZtnAQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-darwin-x64": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.6.0-canary.54.tgz", + "integrity": "sha512-loW60NZS+xvItpdMRBCF1N0JJ98JmDmEH1jDsqO0VzQsrgS3cNnbVslnC6N3+7ndMDN+reasYA9gfkvFVn1Aww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.6.0-canary.54.tgz", + "integrity": "sha512-p66oPQzprGvp1TEvtNFuEiWxfflHOsvfJBfVJpOefmwnwsHbys2wSeA2tJD2xk8yzk5+ChT1X168atpKBdMKgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-linux-arm64-musl": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.6.0-canary.54.tgz", + "integrity": "sha512-JER2Y58ywlAQTa3eds3p6tNu9ts7nwVf31XBoA59yNIwQ1sgAm4+MGhs257FS/AW7FRclbSJw+FspEaq1SxbOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-linux-x64-gnu": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.6.0-canary.54.tgz", + "integrity": "sha512-lyc7WPq8l7wNS5l22ylDBcZw4m0+3kWKVuCQEL4u8RVHVkqds2XiW6T8hrdKMoHUynBJQxn0OnUvLTT7+1NCpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-linux-x64-musl": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.6.0-canary.54.tgz", + "integrity": "sha512-NKa4/hFvHpSq7hvCzrnRwXyfj3PN7/Cquaz8aAlELfzEc+gGDUg2KjXwhEqtf4Br4PppLlDJSJZBr5hnCKJkLA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.6.0-canary.54.tgz", + "integrity": "sha512-Zgib659a4e1fyunnyvP2WPClJei+riSVElY6ON5kNKu9sxVJNRHg6NidaJvJlv0kC+Twxwvrr9NF2h76hLpXsQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@next/swc-win32-x64-msvc": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.6.0-canary.54.tgz", + "integrity": "sha512-/17K8vkgT5H4RbNFL6clVdtVnz5W/xLj1194uDF6ThiVfXG9Ml4mG3Jitiz2TUYS9uhAcwyhbCuqqR2/FcvFvg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/next": { + "version": "15.6.0-canary.54", + "resolved": "https://registry.npmjs.org/next/-/next-15.6.0-canary.54.tgz", + "integrity": "sha512-y7nLDe600/T6rbAz5JjQOCSHUzn9vm0t+OXy7F8qv+ZHCSaMj/hXgOiu9i4Z9O59v+rUrNV8n/vXi5yxgm7ZWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@next/env": "15.6.0-canary.54", + "@swc/helpers": "0.5.15", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=20.9.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.6.0-canary.54", + "@next/swc-darwin-x64": "15.6.0-canary.54", + "@next/swc-linux-arm64-gnu": "15.6.0-canary.54", + "@next/swc-linux-arm64-musl": "15.6.0-canary.54", + "@next/swc-linux-x64-gnu": "15.6.0-canary.54", + "@next/swc-linux-x64-musl": "15.6.0-canary.54", + "@next/swc-win32-arm64-msvc": "15.6.0-canary.54", + "@next/swc-win32-x64-msvc": "15.6.0-canary.54", + "sharp": "^0.34.4" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.51.1", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/sharp": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.4.tgz", + "integrity": "sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.0", + "semver": "^7.7.2" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.4", + "@img/sharp-darwin-x64": "0.34.4", + "@img/sharp-libvips-darwin-arm64": "1.2.3", + "@img/sharp-libvips-darwin-x64": "1.2.3", + "@img/sharp-libvips-linux-arm": "1.2.3", + "@img/sharp-libvips-linux-arm64": "1.2.3", + "@img/sharp-libvips-linux-ppc64": "1.2.3", + "@img/sharp-libvips-linux-s390x": "1.2.3", + "@img/sharp-libvips-linux-x64": "1.2.3", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.3", + "@img/sharp-libvips-linuxmusl-x64": "1.2.3", + "@img/sharp-linux-arm": "0.34.4", + "@img/sharp-linux-arm64": "0.34.4", + "@img/sharp-linux-ppc64": "0.34.4", + "@img/sharp-linux-s390x": "0.34.4", + "@img/sharp-linux-x64": "0.34.4", + "@img/sharp-linuxmusl-arm64": "0.34.4", + "@img/sharp-linuxmusl-x64": "0.34.4", + "@img/sharp-wasm32": "0.34.4", + "@img/sharp-win32-arm64": "0.34.4", + "@img/sharp-win32-ia32": "0.34.4", + "@img/sharp-win32-x64": "0.34.4" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, "packages/@apphosting/build": { "version": "0.1.6", "license": "Apache-2.0", diff --git a/packages/@apphosting/adapter-nextjs/package.json b/packages/@apphosting/adapter-nextjs/package.json index b5ba93cd..0984abe6 100644 --- a/packages/@apphosting/adapter-nextjs/package.json +++ b/packages/@apphosting/adapter-nextjs/package.json @@ -60,7 +60,7 @@ "@types/mocha": "*", "@types/tmp": "*", "mocha": "*", - "next": "~14.0.0", + "next": "15.6.0-canary.54", "semver": "*", "tmp": "*", "ts-mocha": "*", diff --git a/packages/@apphosting/adapter-nextjs/src/bin/build.ts b/packages/@apphosting/adapter-nextjs/src/bin/build.ts index f0ef92cd..cfb0c223 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/build.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/build.ts @@ -1,27 +1,7 @@ #! /usr/bin/env node -import { - loadConfig, - populateOutputBundleOptions, - validateOutputDirectory, -} from "../utils.js"; -import { join } from "path"; -import { getBuildOptions, runBuild } from "@apphosting/common"; +import { runBuild } from "@apphosting/common"; -const root = process.cwd(); -const opts = getBuildOptions(); - -// Set standalone mode -process.env.NEXT_PRIVATE_STANDALONE = "true"; // Opt-out sending telemetry to Vercel process.env.NEXT_TELEMETRY_DISABLED = "1"; -const nextConfig = await loadConfig(root, opts.projectDirectory); - await runBuild(); -const nextBuildDirectory = join(opts.projectDirectory, nextConfig.distDir); -const outputBundleOptions = populateOutputBundleOptions( - root, - opts.projectDirectory, - nextBuildDirectory, -); -await validateOutputDirectory(outputBundleOptions, nextBuildDirectory); diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index f51f6839..ba82dc6b 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -1,50 +1,42 @@ -import { generateBuildOutput, getAdapterMetadata, populateOutputBundleOptions } from "./utils.js"; +import { generateBuildOutput, getAdapterMetadata, populateOutputBundleOptions, validateOutputDirectory } from "./utils.js"; import { getBuildOptions } from "@apphosting/common/dist/index.js"; +import type { NextAdapter } from "next"; -// TODO can we override from the default config? -const fahOptimizedConfig = (config: any) => ({ - ...config, - images: { - ...(config.images || {}), - ...(config.images?.unoptimized === undefined && config.images?.loader === undefined - ? { unoptimized: true } - : {}), - }, - headers: async () => { - const originalHeaders = config.headers && await config.headers() || []; - const adapterMetadata = getAdapterMetadata(); - // TODO add our middleware header OR not... :P - return [ - ...originalHeaders, - { - source: "/(.*)", - headers: [{ - key: "x-fah-adapter", - value: `nextjs-${adapterMetadata.adapterVersion}`, - }], - }, - ] - }, - experimental: { - ...(config.experimental || {}), - nodeMiddleware: true, - }, - output: 'standalone', - }); - -// TODO import the type from next -interface NextAdapter { - name: string; - modifyConfig?: (config: any, context: { phase: string }) => Promise | any; - onBuildComplete?: (context: any) => Promise | void; -} const adapter: NextAdapter = { name: '@apphosting/adapter-nextjs', // FEEDBACK: we need to be able to override user-defined config, before defaults injected - // it would be nice if this where a seperate phase or callback + // it would be nice if this where a separate phase or callback async modifyConfig(config, { phase }) { if (phase === 'phase-production-build') { - return fahOptimizedConfig(config); + return { + ...config, + images: { + ...(config.images || {}), + ...(config.images?.unoptimized === undefined && config.images?.loader === undefined + ? { unoptimized: true } + : {}), + }, + headers: async () => { + const originalHeaders = config.headers && await config.headers() || []; + const adapterMetadata = getAdapterMetadata(); + // TODO add our middleware header OR not... :P + return [ + ...originalHeaders, + { + source: "/(.*)", + headers: [{ + key: "x-fah-adapter", + value: `nextjs-${adapterMetadata.adapterVersion}`, + }], + }, + ] + }, + experimental: { + ...(config.experimental || {}), + nodeMiddleware: true, + }, + output: 'standalone', + } } // TODO override config for production build return config; @@ -57,12 +49,17 @@ const adapter: NextAdapter = { nextBuildDirectory, ); + if (context.outputs.middleware) { + throw new Error("Next.js middleware is not supported with the experimental App Hosting adapter."); + } + const adapterMetadata = getAdapterMetadata(); const root = process.cwd(); const opts = getBuildOptions(); const nextjsVersion = process.env.FRAMEWORK_VERSION || context.nextVersion || "unspecified"; + await generateBuildOutput( root, opts.projectDirectory, @@ -71,6 +68,8 @@ const adapter: NextAdapter = { nextjsVersion, adapterMetadata, ); + + await validateOutputDirectory(outputBundleOptions, nextBuildDirectory); }, }; diff --git a/packages/@apphosting/adapter-nextjs/src/overrides.spec.ts b/packages/@apphosting/adapter-nextjs/src/overrides.spec.ts deleted file mode 100644 index e223037c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/overrides.spec.ts +++ /dev/null @@ -1,445 +0,0 @@ -import assert from "assert"; -import fs from "fs"; -import path from "path"; -import os from "os"; -import { RoutesManifest, MiddlewareManifest } from "./interfaces.js"; -const importOverrides = import("@apphosting/adapter-nextjs/dist/overrides.js"); - -describe("route overrides", () => { - let tmpDir: string; - let routesManifestPath: string; - let middlewareManifestPath: string; - - beforeEach(() => { - tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "test-manifests-")); - routesManifestPath = path.join(tmpDir, ".next", "routes-manifest.json"); - middlewareManifestPath = path.join(tmpDir, ".next", "server", "middleware-manifest.json"); - - fs.mkdirSync(path.dirname(routesManifestPath), { recursive: true }); - fs.mkdirSync(path.dirname(middlewareManifestPath), { recursive: true }); - }); - - it("should add default fah headers to routes manifest", async () => { - const { addRouteOverrides } = await importOverrides; - const initialManifest: RoutesManifest = { - version: 3, - basePath: "", - pages404: true, - staticRoutes: [], - dynamicRoutes: [], - dataRoutes: [], - headers: [ - { - source: "/existing", - headers: [{ key: "X-Custom", value: "test" }], - regex: "^/existing$", - }, - ], - rewrites: [], - redirects: [], - }; - - fs.writeFileSync(routesManifestPath, JSON.stringify(initialManifest)); - fs.writeFileSync( - middlewareManifestPath, - JSON.stringify({ version: 1, sortedMiddleware: [], middleware: {}, functions: {} }), - ); - - await addRouteOverrides(tmpDir, ".next", { - adapterPackageName: "@apphosting/adapter-nextjs", - adapterVersion: "1.0.0", - }); - - const updatedManifest = JSON.parse( - fs.readFileSync(routesManifestPath, "utf-8"), - ) as RoutesManifest; - - const expectedManifest: RoutesManifest = { - version: 3, - basePath: "", - pages404: true, - staticRoutes: [], - dynamicRoutes: [], - dataRoutes: [], - redirects: [], - rewrites: [], - headers: [ - { - source: "/existing", - headers: [{ key: "X-Custom", value: "test" }], - regex: "^/existing$", - }, - { - source: "/:path*", - regex: "^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))?(?:/)?$", - headers: [ - { - key: "x-fah-adapter", - value: "nextjs-1.0.0", - }, - ], - }, - ], - }; - - assert.deepStrictEqual(updatedManifest, expectedManifest); - }); - - it("should add middleware header only to routes for which middleware is enabled", async () => { - const { addRouteOverrides } = await importOverrides; - const initialManifest: RoutesManifest = { - version: 3, - basePath: "", - pages404: true, - staticRoutes: [], - dynamicRoutes: [], - dataRoutes: [], - headers: [], - rewrites: [], - redirects: [], - }; - - const middlewareManifest: MiddlewareManifest = { - version: 3, - sortedMiddleware: ["/"], - middleware: { - "/": { - files: ["middleware.ts"], - name: "middleware", - page: "/", - matchers: [ - { - regexp: "/hello", - originalSource: "/hello", - }, - ], - }, - }, - functions: {}, - }; - - fs.writeFileSync(routesManifestPath, JSON.stringify(initialManifest)); - fs.writeFileSync(middlewareManifestPath, JSON.stringify(middlewareManifest)); - - await addRouteOverrides(tmpDir, ".next", { - adapterPackageName: "@apphosting/adapter-nextjs", - adapterVersion: "1.0.0", - }); - - const updatedManifest = JSON.parse( - fs.readFileSync(routesManifestPath, "utf-8"), - ) as RoutesManifest; - - assert.strictEqual(updatedManifest.headers.length, 2); - - const expectedManifest: RoutesManifest = { - version: 3, - basePath: "", - pages404: true, - staticRoutes: [], - dynamicRoutes: [], - dataRoutes: [], - rewrites: [], - redirects: [], - headers: [ - { - source: "/:path*", - regex: "^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))?(?:/)?$", - headers: [ - { - key: "x-fah-adapter", - value: "nextjs-1.0.0", - }, - ], - }, - { - source: "/hello", - regex: "/hello", - headers: [{ key: "x-fah-middleware", value: "true" }], - }, - ], - }; - - assert.deepStrictEqual(updatedManifest, expectedManifest); - }); - - afterEach(() => { - fs.rmSync(tmpDir, { recursive: true, force: true }); - }); -}); - -describe("next config overrides", () => { - let tmpDir: string; - const nextConfigOverrideBody = ` - // This file was automatically generated by Firebase App Hosting adapter - const fahOptimizedConfig = (config) => ({ - ...config, - images: { - ...(config.images || {}), - ...(config.images?.unoptimized === undefined && config.images?.loader === undefined - ? { unoptimized: true } - : {}), - }, - }); - - const config = typeof originalConfig === 'function' - ? async (...args) => { - const resolvedConfig = await originalConfig(...args); - return fahOptimizedConfig(resolvedConfig); - } - : fahOptimizedConfig(originalConfig); - `; - - beforeEach(() => { - tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "test-overrides")); - }); - - it("should set images.unoptimized to true - js normal config", async () => { - const { overrideNextConfig } = await importOverrides; - const originalConfig = ` - // @ts-check - - /** @type {import('next').NextConfig} */ - const nextConfig = { - /* config options here */ - } - - module.exports = nextConfig - `; - - fs.writeFileSync(path.join(tmpDir, "next.config.js"), originalConfig); - await overrideNextConfig(tmpDir, "next.config.js"); - - const updatedConfig = fs.readFileSync(path.join(tmpDir, "next.config.js"), "utf-8"); - - assert.equal( - normalizeWhitespace(updatedConfig), - normalizeWhitespace(` - // @ts-nocheck - const originalConfig = require('./next.config.original.js'); - - ${nextConfigOverrideBody} - - module.exports = config; - `), - ); - }); - - it("should set images.unoptimized to true - ECMAScript Modules", async () => { - const { overrideNextConfig } = await importOverrides; - const originalConfig = ` - // @ts-check - - /** - * @type {import('next').NextConfig} - */ - const nextConfig = { - /* config options here */ - } - - export default nextConfig - `; - - fs.writeFileSync(path.join(tmpDir, "next.config.mjs"), originalConfig); - await overrideNextConfig(tmpDir, "next.config.mjs"); - - const updatedConfig = fs.readFileSync(path.join(tmpDir, "next.config.mjs"), "utf-8"); - assert.equal( - normalizeWhitespace(updatedConfig), - normalizeWhitespace(` - // @ts-nocheck - import originalConfig from './next.config.original.mjs'; - - ${nextConfigOverrideBody} - - export default config; - `), - ); - }); - - it("should set images.unoptimized to true - ECMAScript Function", async () => { - const { overrideNextConfig } = await importOverrides; - const originalConfig = ` - // @ts-check - - export default (phase, { defaultConfig }) => { - /** - * @type {import('next').NextConfig} - */ - const nextConfig = { - /* config options here */ - } - return nextConfig - } - `; - - fs.writeFileSync(path.join(tmpDir, "next.config.mjs"), originalConfig); - await overrideNextConfig(tmpDir, "next.config.mjs"); - - const updatedConfig = fs.readFileSync(path.join(tmpDir, "next.config.mjs"), "utf-8"); - assert.equal( - normalizeWhitespace(updatedConfig), - normalizeWhitespace(` - // @ts-nocheck - import originalConfig from './next.config.original.mjs'; - - ${nextConfigOverrideBody} - - export default config; - `), - ); - }); - - it("should set images.unoptimized to true - TypeScript", async () => { - const { overrideNextConfig } = await importOverrides; - const originalConfig = ` - import type { NextConfig } from 'next' - - const nextConfig: NextConfig = { - /* config options here */ - } - - export default nextConfig - `; - - fs.writeFileSync(path.join(tmpDir, "next.config.ts"), originalConfig); - await overrideNextConfig(tmpDir, "next.config.ts"); - - const updatedConfig = fs.readFileSync(path.join(tmpDir, "next.config.ts"), "utf-8"); - assert.equal( - normalizeWhitespace(updatedConfig), - normalizeWhitespace(` - // @ts-nocheck - import originalConfig from './next.config.original'; - - ${nextConfigOverrideBody} - - module.exports = config; - `), - ); - }); - - it("should not do anything if no next.config.* file exists", async () => { - const { overrideNextConfig } = await importOverrides; - await overrideNextConfig(tmpDir, "next.config.js"); - - // Assert that no next.config* files were created - const files = fs.readdirSync(tmpDir); - const nextConfigFiles = files.filter((file) => file.startsWith("next.config")); - assert.strictEqual(nextConfigFiles.length, 0, "No next.config files should exist"); - }); -}); - -describe("validateNextConfigOverride", () => { - let tmpDir: string; - let root: string; - let projectRoot: string; - let originalConfigFileName: string; - let newConfigFileName: string; - let originalConfigPath: string; - let newConfigPath: string; - - beforeEach(() => { - tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "test-next-config-override")); - root = tmpDir; - projectRoot = tmpDir; - originalConfigFileName = "next.config.js"; - newConfigFileName = "next.config.original.js"; - originalConfigPath = path.join(root, originalConfigFileName); - newConfigPath = path.join(root, newConfigFileName); - - fs.mkdirSync(root, { recursive: true }); - }); - - afterEach(() => { - fs.rmSync(tmpDir, { recursive: true, force: true }); - }); - - it("should throw an error when new config file doesn't exist", async () => { - fs.writeFileSync(originalConfigPath, "module.exports = {}"); - - const { validateNextConfigOverride } = await importOverrides; - - await assert.rejects( - async () => await validateNextConfigOverride(root, projectRoot, originalConfigFileName), - /New Next.js config file not found/, - ); - }); - - it("should throw an error when original config file doesn't exist", async () => { - fs.writeFileSync(newConfigPath, "module.exports = {}"); - - const { validateNextConfigOverride } = await importOverrides; - - await assert.rejects( - async () => await validateNextConfigOverride(root, projectRoot, originalConfigFileName), - /Original Next.js config file not found/, - ); - }); -}); - -describe("next config restore", () => { - let tmpDir: string; - const nextConfigOriginalBody = ` - // @ts-check - - /** @type {import('next').NextConfig} */ - const nextConfig = { - /* config options here */ - } - - module.exports = nextConfig - `; - const nextConfigBody = ` - // This file was automatically generated by Firebase App Hosting adapter - const fahOptimizedConfig = (config) => ({ - ...config, - images: { - ...(config.images || {}), - ...(config.images?.unoptimized === undefined && config.images?.loader === undefined - ? { unoptimized: true } - : {}), - }, - }); - - const config = typeof originalConfig === 'function' - ? async (...args) => { - const resolvedConfig = await originalConfig(...args); - return fahOptimizedConfig(resolvedConfig); - } - : fahOptimizedConfig(originalConfig); - `; - - beforeEach(() => { - tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "test-overrides")); - }); - - it("handle no original config file found", async () => { - const { restoreNextConfig } = await importOverrides; - fs.writeFileSync(path.join(tmpDir, "next.config.mjs"), nextConfigBody); - await restoreNextConfig(tmpDir, "next.config.mjs"); - - const restoredConfig = fs.readFileSync(path.join(tmpDir, "next.config.mjs"), "utf-8"); - assert.equal(restoredConfig, nextConfigBody); - }); - - it("handle no config file found", async () => { - const { restoreNextConfig } = await importOverrides; - assert.doesNotReject(restoreNextConfig(tmpDir, "next.config.mjs")); - }); - - it("original config file restored", async () => { - const { restoreNextConfig } = await importOverrides; - fs.writeFileSync(path.join(tmpDir, "next.config.mjs"), nextConfigBody); - fs.writeFileSync(path.join(tmpDir, "next.config.original.mjs"), nextConfigOriginalBody); - await restoreNextConfig(tmpDir, "next.config.mjs"); - - const restoredConfig = fs.readFileSync(path.join(tmpDir, "next.config.mjs"), "utf-8"); - assert.equal(restoredConfig, nextConfigOriginalBody); - }); -}); - -// Normalize whitespace for comparison -function normalizeWhitespace(str: string) { - return str.replace(/\s+/g, " ").trim(); -} diff --git a/packages/@apphosting/adapter-nextjs/src/overrides.ts b/packages/@apphosting/adapter-nextjs/src/overrides.ts deleted file mode 100644 index 5edd0d54..00000000 --- a/packages/@apphosting/adapter-nextjs/src/overrides.ts +++ /dev/null @@ -1,229 +0,0 @@ -import { AdapterMetadata } from "./interfaces.js"; -import { - loadRouteManifest, - writeRouteManifest, - loadMiddlewareManifest, - exists, - writeFile, - loadConfig, -} from "./utils.js"; -import { join, extname } from "path"; -import { rename as renamePromise } from "fs/promises"; - -/** - * Overrides the user's Next Config file (next.config.[ts|js|mjs]) to add configs - * optimized for Firebase App Hosting. - */ -export async function overrideNextConfig(projectRoot: string, nextConfigFileName: string) { - console.log(`Overriding Next Config to add configs optmized for Firebase App Hosting`); - // Check if the file exists in the current working directory - const configPath = join(projectRoot, nextConfigFileName); - - if (!(await exists(configPath))) { - console.log(`No Next.js config file found at ${configPath}`); - return; - } - - // Determine the file extension - const fileExtension = extname(nextConfigFileName); - const originalConfigName = `next.config.original${fileExtension}`; - - // Rename the original config file - try { - const originalPath = join(projectRoot, originalConfigName); - await renamePromise(configPath, originalPath); - - // Create a new config file with the appropriate import - let importStatement; - switch (fileExtension) { - case ".js": - importStatement = `const originalConfig = require('./${originalConfigName}');`; - break; - case ".mjs": - importStatement = `import originalConfig from './${originalConfigName}';`; - break; - case ".ts": - importStatement = `import originalConfig from './${originalConfigName.replace( - ".ts", - "", - )}';`; - break; - default: - throw new Error( - `Unsupported file extension for Next Config: "${fileExtension}", please use ".js", ".mjs", or ".ts"`, - ); - } - - // Create the new config content with our overrides - const newConfigContent = getCustomNextConfig(importStatement, fileExtension); - - // Write the new config file - await writeFile(join(projectRoot, nextConfigFileName), newConfigContent); - console.log(`Successfully created ${nextConfigFileName} with Firebase App Hosting overrides`); - } catch (error) { - console.error(`Error overriding Next.js config: ${error}`); - throw error; - } -} - -/** - * Returns a custom Next.js config that optimizes the app for Firebase App Hosting. - * - * Current overrides include: - * - images.unoptimized = true, unless user explicitly sets images.unoptimized to false or - * is using a custom image loader. - * @param importStatement The import statement for the original config. - * @param fileExtension The file extension of the original config. Use ".js", ".mjs", or ".ts" - * @return The custom Next.js config. - */ -function getCustomNextConfig(importStatement: string, fileExtension: string) { - return ` - // @ts-nocheck - ${importStatement} - - // This file was automatically generated by Firebase App Hosting adapter - const fahOptimizedConfig = (config) => ({ - ...config, - images: { - ...(config.images || {}), - ...(config.images?.unoptimized === undefined && config.images?.loader === undefined - ? { unoptimized: true } - : {}), - }, - }); - - const config = typeof originalConfig === 'function' - ? async (...args) => { - const resolvedConfig = await originalConfig(...args); - return fahOptimizedConfig(resolvedConfig); - } - : fahOptimizedConfig(originalConfig); - - ${fileExtension === ".mjs" ? "export default config;" : "module.exports = config;"} - `; -} - -/** - * This function is used to validate the state of an app after running the - * overrideNextConfig. It validates that: - * 1. original next config is preserved - * 2. a new next config is created - * 3. new next config can be loaded by NextJs without any issues. - */ -export async function validateNextConfigOverride( - root: string, - projectRoot: string, - originalConfigFileName: string, -) { - const originalConfigExtension = extname(originalConfigFileName); - const newConfigFileName = `next.config.original${originalConfigExtension}`; - const newConfigFilePath = join(root, newConfigFileName); - if (!(await exists(newConfigFilePath))) { - throw new Error( - `Next Config Override Failed: New Next.js config file not found at ${newConfigFilePath}`, - ); - } - - const originalNextConfigFilePath = join(root, originalConfigFileName); - if (!(await exists(originalNextConfigFilePath))) { - throw new Error( - `Next Config Override Failed: Original Next.js config file not found at ${originalNextConfigFilePath}`, - ); - } - - try { - await loadConfig(root, projectRoot); - } catch (error) { - throw new Error( - `Resulting Next Config is invalid: ${ - error instanceof Error ? error.message : "Unknown error" - }`, - ); - } -} - -/** - * Restores the user's original Next Config file (next.config.original.[ts|js|mjs]) - * to leave user code the way we found it. - */ -export async function restoreNextConfig(projectRoot: string, nextConfigFileName: string) { - // Determine the file extension - const fileExtension = extname(nextConfigFileName); - const originalConfigPath = join(projectRoot, `next.config.original${fileExtension}`); - - if (!(await exists(originalConfigPath))) { - // No backup file found, nothing to restore. - return; - } - console.log(`Restoring original next config in project root`); - - const configPath = join(projectRoot, nextConfigFileName); - try { - await renamePromise(originalConfigPath, configPath); - } catch (error) { - console.error(`Error restoring Next config: ${error}`); - } -} - -/** - * Modifies the app's route manifest (routes-manifest.json) to add Firebase App Hosting - * specific overrides (i.e headers). - * - * It adds the following headers to all routes: - * - x-fah-adapter: The Firebase App Hosting adapter version used to build the app. - * - * It also adds the following headers to all routes for which middleware is enabled: - * - x-fah-middleware: When middleware is enabled. - * @param appPath The path to the app directory. - * @param distDir The path to the dist directory. - * @param adapterMetadata The adapter metadata. - */ -export async function addRouteOverrides( - appPath: string, - distDir: string, - adapterMetadata: AdapterMetadata, -) { - const routeManifest = loadRouteManifest(appPath, distDir); - - // Add the adapter version to all routes - routeManifest.headers.push({ - source: "/:path*", - headers: [ - { - key: "x-fah-adapter", - value: `nextjs-${adapterMetadata.adapterVersion}`, - }, - ], - /* - NextJs converts the source string to a regex using path-to-regexp (https://github.com/pillarjs/path-to-regexp) at - build time: https://github.com/vercel/next.js/blob/canary/packages/next/src/build/index.ts#L1273. - This regex is then used to match the route against the request path. - - This regex was generated by building a sample NextJs app with the source string `/:path*` and then inspecting the - routes-manifest.json file. - */ - regex: "^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))?(?:/)?$", - }); - - // Add the middleware header to all routes for which middleware is enabled - const middlewareManifest = loadMiddlewareManifest(appPath, distDir); - const rootMiddleware = middlewareManifest.middleware["/"]; - if (rootMiddleware?.matchers) { - console.log("Middleware detected, adding middleware headers to matching routes"); - - rootMiddleware.matchers.forEach((matcher) => { - routeManifest.headers.push({ - source: matcher.originalSource, - headers: [ - { - key: "x-fah-middleware", - value: "true", - }, - ], - regex: matcher.regexp, - }); - }); - } - - await writeRouteManifest(appPath, distDir, routeManifest); -} diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index fb92ca6f..a0d5555c 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -1,85 +1,18 @@ import fsExtra from "fs-extra"; -import { createRequire } from "node:module"; import { join, dirname, relative, normalize } from "path"; -import { fileURLToPath } from "url"; import { stringify as yamlStringify } from "yaml"; -import { PHASE_PRODUCTION_BUILD, ROUTES_MANIFEST, MIDDLEWARE_MANIFEST } from "./constants.js"; import { OutputBundleOptions, - RoutesManifest, AdapterMetadata, - MiddlewareManifest, } from "./interfaces.js"; -import { NextConfigComplete } from "next/dist/server/config-shared.js"; import { OutputBundleConfig, updateOrCreateGitignore } from "@apphosting/common"; +import { fileURLToPath } from "url"; // fs-extra is CJS, readJson can't be imported using shorthand export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsSync, ensureDir } = fsExtra; -// Loads the user's next.config.js file. -export async function loadConfig(root: string, projectRoot: string): Promise { - // createRequire() gives us access to Node's CommonJS implementation of require.resolve() - // (https://nodejs.org/api/module.html#modulecreaterequirefilename). - // We use the require.resolve() resolution algorithm to get the path to the next config module, - // which may reside in the node_modules folder at a higher level in the directory structure - // (e.g. for monorepo projects). - // Note that ESM has an equivalent (https://nodejs.org/api/esm.html#importmetaresolvespecifier), - // but the feature is still experimental. - const require = createRequire(import.meta.url); - const configPath = require.resolve("next/dist/server/config.js", { paths: [projectRoot] }); - // dynamically load NextJS so this can be used in an NPX context - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - const { default: nextServerConfig }: { default: typeof import("next/dist/server/config.js") } = - await import(configPath); - - const loadConfig = nextServerConfig.default; - return await loadConfig(PHASE_PRODUCTION_BUILD, root); -} - -/** - * Loads the route manifest from the standalone directory. - * @param standalonePath The path to the standalone directory. - * @param distDir The path to the dist directory. - * @return The route manifest. - */ -export function loadRouteManifest(standalonePath: string, distDir: string): RoutesManifest { - const manifestPath = join(standalonePath, distDir, ROUTES_MANIFEST); - const json = readFileSync(manifestPath, "utf-8"); - return JSON.parse(json) as RoutesManifest; -} - -/** - * Loads the middleware manifest from the standalone directory. - * @param standalonePath The path to the standalone directory. - * @param distDir The path to the dist directory. - * @return The middleware manifest. - */ -export function loadMiddlewareManifest( - standalonePath: string, - distDir: string, -): MiddlewareManifest { - const manifestPath = join(standalonePath, distDir, `server/${MIDDLEWARE_MANIFEST}`); - const json = readFileSync(manifestPath, "utf-8"); - return JSON.parse(json) as MiddlewareManifest; -} - -/** - * Writes the route manifest to the standalone directory. - * @param standalonePath The path to the standalone directory. - * @param distDir The path to the dist directory. - * @param customManifest The route manifest to write. - */ -export async function writeRouteManifest( - standalonePath: string, - distDir: string, - customManifest: RoutesManifest, -): Promise { - const manifestPath = join(standalonePath, distDir, ROUTES_MANIFEST); - await writeFile(manifestPath, JSON.stringify(customManifest)); -} - export const isMain = (meta: ImportMeta): boolean => { if (!meta) return false; if (!process.argv[1]) return false; From d40954fa8a01a29339c813df5791bace371fdc8d Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 9 Oct 2025 17:14:31 -0400 Subject: [PATCH 03/14] Middleware working again --- .../adapter-nextjs/src/bin/build.spec.ts | 20 ------- .../adapter-nextjs/src/bin/build.ts | 25 +++++++- .../@apphosting/adapter-nextjs/src/index.ts | 29 ++++------ .../adapter-nextjs/src/overrides.ts | 40 +++++++++++++ .../@apphosting/adapter-nextjs/src/utils.ts | 58 +++++++++++++++++-- 5 files changed, 130 insertions(+), 42 deletions(-) create mode 100644 packages/@apphosting/adapter-nextjs/src/overrides.ts diff --git a/packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts b/packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts index e98d9f52..e68d5731 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts @@ -50,8 +50,6 @@ describe("build commands", () => { tmpDir, outputBundleOptions, path.join(tmpDir, ".next"), - defaultNextVersion, - adapterMetadata, ); await validateOutputDirectory(outputBundleOptions, path.join(tmpDir, ".next")); @@ -116,8 +114,6 @@ outputFiles: serverFilePath: path.join(tmpDir, ".next", "standalone", "apps", "next-app", "server.js"), }, path.join(tmpDir, ".next"), - defaultNextVersion, - adapterMetadata, ); const expectedFiles = { @@ -154,11 +150,6 @@ outputFiles: tmpDir, outputBundleOptions, path.join(tmpDir, ".next"), - defaultNextVersion, - { - adapterPackageName: "@apphosting/adapter-nextjs", - adapterVersion: "14.0.1", - }, ); assert.rejects( async () => await validateOutputDirectory(outputBundleOptions, path.join(tmpDir, ".next")), @@ -184,8 +175,6 @@ outputFiles: serverFilePath: path.join(standaloneAppPath, "server.js"), }, path.join(tmpDir, ".next"), - defaultNextVersion, - adapterMetadata, ); const expectedFiles = { @@ -214,8 +203,6 @@ outputFiles: tmpDir, outputBundleOptions, path.join(tmpDir, ".next"), - defaultNextVersion, - adapterMetadata, ); await validateOutputDirectory(outputBundleOptions, path.join(tmpDir, ".next")); @@ -240,11 +227,6 @@ outputFiles: tmpDir, outputBundleOptions, path.join(tmpDir, ".next"), - defaultNextVersion, - { - adapterPackageName: "@apphosting/adapter-nextjs", - adapterVersion: "14.0.1", - }, ); await validateOutputDirectory(outputBundleOptions, path.join(tmpDir, ".next")); @@ -276,8 +258,6 @@ outputFiles: tmpDir, outputBundleOptions, path.join(tmpDir, ".next"), - defaultNextVersion, - adapterMetadata, ); await validateOutputDirectory(outputBundleOptions, path.join(tmpDir, ".next")); diff --git a/packages/@apphosting/adapter-nextjs/src/bin/build.ts b/packages/@apphosting/adapter-nextjs/src/bin/build.ts index cfb0c223..52b84632 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/build.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/build.ts @@ -1,7 +1,30 @@ #! /usr/bin/env node -import { runBuild } from "@apphosting/common"; +import { getBuildOptions, runBuild } from "@apphosting/common"; +import { generateBuildOutput, getAdapterMetadata, loadConfig, populateOutputBundleOptions, validateOutputDirectory } from "../utils.js"; +import { join } from "node:path"; // Opt-out sending telemetry to Vercel process.env.NEXT_TELEMETRY_DISABLED = "1"; await runBuild(); + +const opts = getBuildOptions(); +const root = process.cwd(); + +const nextConfig = await loadConfig(root, opts.projectDirectory); + +const nextBuildDirectory = join(opts.projectDirectory, nextConfig.distDir); +const outputBundleOptions = populateOutputBundleOptions( + root, + opts.projectDirectory, + nextBuildDirectory, +); + +await generateBuildOutput( + root, + opts.projectDirectory, + outputBundleOptions, + nextBuildDirectory, +); + +await validateOutputDirectory(outputBundleOptions, nextBuildDirectory); diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index ba82dc6b..4203d0e7 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -1,13 +1,14 @@ -import { generateBuildOutput, getAdapterMetadata, populateOutputBundleOptions, validateOutputDirectory } from "./utils.js"; -import { getBuildOptions } from "@apphosting/common/dist/index.js"; +import { generateBundleYaml, getAdapterMetadata, populateOutputBundleOptions } from "./utils.js"; import type { NextAdapter } from "next"; +import { addRouteOverrides } from "./overrides.js"; +import { PHASE_PRODUCTION_BUILD } from "./constants.js"; const adapter: NextAdapter = { name: '@apphosting/adapter-nextjs', // FEEDBACK: we need to be able to override user-defined config, before defaults injected // it would be nice if this where a separate phase or callback async modifyConfig(config, { phase }) { - if (phase === 'phase-production-build') { + if (phase === PHASE_PRODUCTION_BUILD) { return { ...config, images: { @@ -42,34 +43,28 @@ const adapter: NextAdapter = { return config; }, async onBuildComplete(context) { + const nextBuildDirectory = context.distDir; + + if (context.outputs.middleware?.config?.matchers) { + await addRouteOverrides(nextBuildDirectory, context.outputs.middleware.config.matchers); + } + + // TODO standalone is not bundled yet... const outputBundleOptions = populateOutputBundleOptions( context.repoRoot, context.projectDir, nextBuildDirectory, ); - if (context.outputs.middleware) { - throw new Error("Next.js middleware is not supported with the experimental App Hosting adapter."); - } - const adapterMetadata = getAdapterMetadata(); const root = process.cwd(); - const opts = getBuildOptions(); const nextjsVersion = process.env.FRAMEWORK_VERSION || context.nextVersion || "unspecified"; - await generateBuildOutput( - root, - opts.projectDirectory, - outputBundleOptions, - nextBuildDirectory, - nextjsVersion, - adapterMetadata, - ); + await generateBundleYaml(outputBundleOptions, root, nextjsVersion, adapterMetadata); - await validateOutputDirectory(outputBundleOptions, nextBuildDirectory); }, }; diff --git a/packages/@apphosting/adapter-nextjs/src/overrides.ts b/packages/@apphosting/adapter-nextjs/src/overrides.ts new file mode 100644 index 00000000..a2d7f656 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/overrides.ts @@ -0,0 +1,40 @@ +import type { MiddlewareMatcher } from "next/dist/build/analysis/get-page-static-info.js"; +import { + loadRouteManifest, + writeRouteManifest, +} from "./utils.js"; + +/** + * Modifies the app's route manifest (routes-manifest.json) to add Firebase App Hosting + * specific overrides (i.e headers). + * + * It adds the following headers to all routes: + * - x-fah-adapter: The Firebase App Hosting adapter version used to build the app. + * + * It also adds the following headers to all routes for which middleware is enabled: + * - x-fah-middleware: When middleware is enabled. + * @param appPath The path to the app directory. + * @param distDir The path to the dist directory. + * @param adapterMetadata The adapter metadata. + */ +export async function addRouteOverrides( + distDir: string, + middlewareMatchers: MiddlewareMatcher[], +) { + const routeManifest = loadRouteManifest(distDir); + + middlewareMatchers.forEach((matcher) => { + routeManifest.headers.push({ + source: matcher.originalSource, + headers: [ + { + key: "x-fah-middleware", + value: "true", + }, + ], + regex: matcher.regexp, + }); + }); + + await writeRouteManifest(distDir, routeManifest); +} \ No newline at end of file diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index a0d5555c..2e535027 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -1,14 +1,19 @@ import fsExtra from "fs-extra"; import { join, dirname, relative, normalize } from "path"; import { stringify as yamlStringify } from "yaml"; +import { createRequire } from "node:module"; import { OutputBundleOptions, AdapterMetadata, + RoutesManifest, } from "./interfaces.js"; import { OutputBundleConfig, updateOrCreateGitignore } from "@apphosting/common"; import { fileURLToPath } from "url"; +import { PHASE_PRODUCTION_BUILD, ROUTES_MANIFEST } from "./constants.js"; +import type { NextConfigComplete } from "next/dist/server/config-shared.js"; + // fs-extra is CJS, readJson can't be imported using shorthand export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsSync, ensureDir } = fsExtra; @@ -19,6 +24,27 @@ export const isMain = (meta: ImportMeta): boolean => { return process.argv[1] === fileURLToPath(meta.url); }; +// Loads the user's next.config.js file. +export async function loadConfig(root: string, projectRoot: string): Promise { + // createRequire() gives us access to Node's CommonJS implementation of require.resolve() + // (https://nodejs.org/api/module.html#modulecreaterequirefilename). + // We use the require.resolve() resolution algorithm to get the path to the next config module, + // which may reside in the node_modules folder at a higher level in the directory structure + // (e.g. for monorepo projects). + // Note that ESM has an equivalent (https://nodejs.org/api/esm.html#importmetaresolvespecifier), + // but the feature is still experimental. + const require = createRequire(import.meta.url); + const configPath = require.resolve("next/dist/server/config.js", { paths: [projectRoot] }); + // dynamically load NextJS so this can be used in an NPX context + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const { default: nextServerConfig }: { default: typeof import("next/dist/server/config.js") } = + await import(configPath); + + const loadConfig = nextServerConfig.default; + return await loadConfig(PHASE_PRODUCTION_BUILD, root); +} + + /** * Provides the paths in the output bundle for the built artifacts. * @param rootDir The root directory of the uploaded source code. @@ -48,6 +74,33 @@ export function populateOutputBundleOptions( }; } +/** + * Loads the route manifest from the standalone directory. + * @param standalonePath The path to the standalone directory. + * @param distDir The path to the dist directory. + * @return The route manifest. + */ +export function loadRouteManifest(distDir: string): RoutesManifest { + const manifestPath = join(distDir, ROUTES_MANIFEST); + const json = readFileSync(manifestPath, "utf-8"); + return JSON.parse(json) as RoutesManifest; +} + + +/** + * Writes the route manifest to the standalone directory. + * @param standalonePath The path to the standalone directory. + * @param distDir The path to the dist directory. + * @param customManifest The route manifest to write. + */ +export async function writeRouteManifest( + distDir: string, + customManifest: RoutesManifest, +): Promise { + const manifestPath = join(distDir, ROUTES_MANIFEST); + await writeFile(manifestPath, JSON.stringify(customManifest)); +} + /** * Copy static assets and other resources into the standlone directory, also generates the bundle.yaml * @param rootDir The root directory of the uploaded source code. @@ -59,14 +112,11 @@ export async function generateBuildOutput( appDir: string, opts: OutputBundleOptions, nextBuildDirectory: string, - nextVersion: string, - adapterMetadata: AdapterMetadata, ): Promise { const staticDirectory = join(nextBuildDirectory, "static"); await Promise.all([ copy(staticDirectory, opts.outputStaticDirectoryPath, { overwrite: true }), copyResources(appDir, opts.outputDirectoryAppPath, opts.bundleYamlPath), - generateBundleYaml(opts, rootDir, nextVersion, adapterMetadata), ]); // generateBundleYaml creates the output directory (if it does not already exist). // We need to make sure it is gitignored. @@ -111,7 +161,7 @@ export function getAdapterMetadata(): AdapterMetadata { } // generate bundle.yaml -async function generateBundleYaml( +export async function generateBundleYaml( opts: OutputBundleOptions, cwd: string, nextVersion: string, From a1a011ecd8a068562b75ba398bd58fc57826dbc0 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 9 Oct 2025 17:17:24 -0400 Subject: [PATCH 04/14] Note --- packages/@apphosting/adapter-nextjs/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index 4203d0e7..7f4d7c13 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -42,6 +42,8 @@ const adapter: NextAdapter = { // TODO override config for production build return config; }, + // This fires before standalone is bundled, so we need to pick things back up after build in bin/build.ts + // FEEDBACK: can we get a hook after bundle? async onBuildComplete(context) { const nextBuildDirectory = context.distDir; @@ -50,7 +52,6 @@ const adapter: NextAdapter = { await addRouteOverrides(nextBuildDirectory, context.outputs.middleware.config.matchers); } - // TODO standalone is not bundled yet... const outputBundleOptions = populateOutputBundleOptions( context.repoRoot, context.projectDir, From 19459dfb5fcdb1d4e6739c43bd9246c3d1750d2e Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 16 Oct 2025 17:58:30 -0400 Subject: [PATCH 05/14] something --- .gitmodules | 0 package-lock.json | 183 +- .../adapter-nextjs/clean_protos.cjs | 62 + .../@apphosting/adapter-nextjs/package.json | 7 +- .../adapter-nextjs/src/bin/build.ts | 2 +- .../adapter-nextjs/src/bin/serve.cts | 299 + .../envoy/config/core/v3/Address.ts | 18 + .../envoy/config/core/v3/AsyncDataSource.ts | 15 + .../envoy/config/core/v3/BackoffStrategy.ts | 13 + .../envoy/config/core/v3/BindConfig.ts | 25 + .../envoy/config/core/v3/BuildVersion.ts | 14 + .../envoy/config/core/v3/CidrRange.ts | 13 + .../envoy/config/core/v3/ControlPlane.ts | 10 + .../envoy/config/core/v3/DataSource.ts | 20 + .../config/core/v3/EnvoyInternalAddress.ts | 13 + .../envoy/config/core/v3/Extension.ts | 21 + .../config/core/v3/ExtraSourceAddress.ts | 14 + .../envoy/config/core/v3/HeaderMap.ts | 11 + .../envoy/config/core/v3/HeaderValue.ts | 14 + .../envoy/config/core/v3/HeaderValueOption.ts | 39 + .../envoy/config/core/v3/HttpUri.ts | 16 + .../envoy/config/core/v3/KeyValue.ts | 12 + .../envoy/config/core/v3/KeyValueAppend.ts | 37 + .../envoy/config/core/v3/KeyValueMutation.ts | 13 + .../envoy/config/core/v3/KeyValuePair.ts | 13 + .../envoy/config/core/v3/Locality.ts | 14 + .../envoy/config/core/v3/Metadata.ts | 14 + .../envoy/config/core/v3/Node.ts | 37 + .../envoy/config/core/v3/Pipe.ts | 12 + .../envoy/config/core/v3/QueryParameter.ts | 12 + .../envoy/config/core/v3/RemoteDataSource.ts | 16 + .../envoy/config/core/v3/RequestMethod.ts | 38 + .../envoy/config/core/v3/RetryPolicy.ts | 46 + .../envoy/config/core/v3/RoutingPriority.ts | 14 + .../envoy/config/core/v3/RuntimeDouble.ts | 12 + .../config/core/v3/RuntimeFeatureFlag.ts | 13 + .../core/v3/RuntimeFractionalPercent.ts | 13 + .../envoy/config/core/v3/RuntimePercent.ts | 13 + .../envoy/config/core/v3/RuntimeUInt32.ts | 12 + .../envoy/config/core/v3/SocketAddress.ts | 38 + .../envoy/config/core/v3/SocketOption.ts | 64 + .../config/core/v3/SocketOptionsOverride.ts | 11 + .../envoy/config/core/v3/TcpKeepalive.ts | 15 + .../envoy/config/core/v3/TrafficDirection.ts | 17 + .../envoy/config/core/v3/TransportSocket.ts | 14 + .../config/core/v3/TypedExtensionConfig.ts | 13 + .../envoy/config/core/v3/WatchedDirectory.ts | 10 + .../http/ext_proc/v3/ProcessingMode.ts | 62 + .../envoy/service/ext_proc/v3/BodyMutation.ts | 16 + .../envoy/service/ext_proc/v3/BodyResponse.ts | 11 + .../service/ext_proc/v3/CommonResponse.ts | 36 + .../service/ext_proc/v3/ExternalProcessor.ts | 23 + .../envoy/service/ext_proc/v3/GrpcStatus.ts | 10 + .../service/ext_proc/v3/HeaderMutation.ts | 13 + .../service/ext_proc/v3/HeadersResponse.ts | 11 + .../envoy/service/ext_proc/v3/HttpBody.ts | 12 + .../envoy/service/ext_proc/v3/HttpHeaders.ts | 16 + .../envoy/service/ext_proc/v3/HttpTrailers.ts | 11 + .../service/ext_proc/v3/ImmediateResponse.ts | 21 + .../service/ext_proc/v3/ProcessingRequest.ts | 35 + .../service/ext_proc/v3/ProcessingResponse.ts | 36 + .../ext_proc/v3/ProtocolConfiguration.ts | 15 + .../ext_proc/v3/StreamedBodyResponse.ts | 12 + .../service/ext_proc/v3/TrailersResponse.ts | 11 + .../envoy/type/v3/FractionalPercent.ts | 30 + .../envoy/type/v3/HttpStatus.ts | 11 + .../generated-types/envoy/type/v3/Percent.ts | 10 + .../envoy/type/v3/SemanticVersion.ts | 14 + .../envoy/type/v3/StatusCode.ts | 179 + .../src/generated-types/external_processor.ts | 331 + .../generated-types/google/protobuf/Any.ts | 13 + .../google/protobuf/BoolValue.ts | 10 + .../google/protobuf/BytesValue.ts | 10 + .../google/protobuf/DescriptorProto.ts | 59 + .../google/protobuf/DoubleValue.ts | 10 + .../google/protobuf/Duration.ts | 13 + .../google/protobuf/Edition.ts | 44 + .../google/protobuf/EnumDescriptorProto.ts | 33 + .../google/protobuf/EnumOptions.ts | 23 + .../protobuf/EnumValueDescriptorProto.ts | 15 + .../google/protobuf/EnumValueOptions.ts | 28 + .../google/protobuf/ExtensionRangeOptions.ts | 49 + .../google/protobuf/FeatureSet.ts | 183 + .../google/protobuf/FeatureSetDefaults.ts | 28 + .../google/protobuf/FieldDescriptorProto.ts | 112 + .../google/protobuf/FieldOptions.ts | 169 + .../google/protobuf/FileDescriptorProto.ts | 43 + .../google/protobuf/FileDescriptorSet.ts | 11 + .../google/protobuf/FileOptions.ts | 79 + .../google/protobuf/FloatValue.ts | 10 + .../google/protobuf/GeneratedCodeInfo.ts | 44 + .../google/protobuf/Int32Value.ts | 10 + .../google/protobuf/Int64Value.ts | 11 + .../google/protobuf/ListValue.ts | 11 + .../google/protobuf/MessageOptions.ts | 37 + .../google/protobuf/MethodDescriptorProto.ts | 21 + .../google/protobuf/MethodOptions.ts | 36 + .../google/protobuf/NullValue.ts | 11 + .../google/protobuf/OneofDescriptorProto.ts | 13 + .../google/protobuf/OneofOptions.ts | 16 + .../google/protobuf/ServiceDescriptorProto.ts | 16 + .../google/protobuf/ServiceOptions.ts | 16 + .../google/protobuf/SourceCodeInfo.ts | 26 + .../google/protobuf/StringValue.ts | 10 + .../generated-types/google/protobuf/Struct.ts | 11 + .../google/protobuf/SymbolVisibility.ts | 17 + .../google/protobuf/Timestamp.ts | 13 + .../google/protobuf/UInt32Value.ts | 10 + .../google/protobuf/UInt64Value.ts | 11 + .../google/protobuf/UninterpretedOption.ts | 33 + .../generated-types/google/protobuf/Value.ts | 24 + .../annotations/FieldMigrateAnnotation.ts | 12 + .../udpa/annotations/FileMigrateAnnotation.ts | 10 + .../udpa/annotations/MigrateAnnotation.ts | 10 + .../udpa/annotations/PackageVersionStatus.ts | 20 + .../udpa/annotations/StatusAnnotation.ts | 13 + .../udpa/annotations/VersioningAnnotation.ts | 10 + .../src/generated-types/validate/AnyRules.ts | 14 + .../src/generated-types/validate/BoolRules.ts | 10 + .../generated-types/validate/BytesRules.ts | 38 + .../generated-types/validate/DoubleRules.ts | 24 + .../generated-types/validate/DurationRules.ts | 25 + .../src/generated-types/validate/EnumRules.ts | 16 + .../generated-types/validate/FieldRules.ts | 75 + .../generated-types/validate/Fixed32Rules.ts | 24 + .../generated-types/validate/Fixed64Rules.ts | 25 + .../generated-types/validate/FloatRules.ts | 24 + .../generated-types/validate/Int32Rules.ts | 24 + .../generated-types/validate/Int64Rules.ts | 25 + .../generated-types/validate/KnownRegex.ts | 17 + .../src/generated-types/validate/MapRules.ts | 22 + .../generated-types/validate/MessageRules.ts | 12 + .../generated-types/validate/RepeatedRules.ts | 20 + .../generated-types/validate/SFixed32Rules.ts | 24 + .../generated-types/validate/SFixed64Rules.ts | 25 + .../generated-types/validate/SInt32Rules.ts | 24 + .../generated-types/validate/SInt64Rules.ts | 25 + .../generated-types/validate/StringRules.ts | 63 + .../validate/TimestampRules.ts | 28 + .../generated-types/validate/UInt32Rules.ts | 24 + .../generated-types/validate/UInt64Rules.ts | 25 + .../annotations/v3/FieldStatusAnnotation.ts | 10 + .../annotations/v3/FileStatusAnnotation.ts | 10 + .../annotations/v3/MessageStatusAnnotation.ts | 10 + .../annotations/v3/PackageVersionStatus.ts | 20 + .../xds/annotations/v3/StatusAnnotation.ts | 13 + .../xds/core/v3/ContextParams.ts | 10 + .../@apphosting/adapter-nextjs/src/index.ts | 3 + .../protos/envoy/annotations/deprecation.ts | 9 + .../protos/envoy/config/core/v3/address.ts | 1099 +++ .../protos/envoy/config/core/v3/backoff.ts | 136 + .../src/protos/envoy/config/core/v3/base.ts | 3749 +++++++++ .../protos/envoy/config/core/v3/extension.ts | 135 + .../protos/envoy/config/core/v3/http_uri.ts | 159 + .../envoy/config/core/v3/socket_option.ts | 585 ++ .../http/ext_proc/v3/processing_mode.ts | 352 + .../service/ext_proc/v3/external_processor.ts | 2456 ++++++ .../src/protos/envoy/type/v3/http_status.ts | 526 ++ .../src/protos/envoy/type/v3/percent.ts | 247 + .../protos/envoy/type/v3/semantic_version.ts | 138 + .../src/protos/google/protobuf/any.ts | 259 + .../src/protos/google/protobuf/descriptor.ts | 6975 +++++++++++++++++ .../src/protos/google/protobuf/duration.ts | 189 + .../src/protos/google/protobuf/struct.ts | 588 ++ .../src/protos/google/protobuf/timestamp.ts | 219 + .../src/protos/google/protobuf/wrappers.ts | 699 ++ .../src/protos/udpa/annotations/migrate.ts | 251 + .../src/protos/udpa/annotations/status.ts | 172 + .../src/protos/udpa/annotations/versioning.ts | 104 + .../src/protos/validate/validate.ts | 5869 ++++++++++++++ .../src/protos/xds/annotations/v3/status.ts | 361 + .../src/protos/xds/core/v3/context_params.ts | 211 + .../@apphosting/adapter-nextjs/src/utils.ts | 13 +- .../@apphosting/adapter-nextjs/tsconfig.json | 1 + .../.dataconnect/schema/main/input.gql | 302 + .../.dataconnect/schema/main/mutation.gql | 20 +- .../.dataconnect/schema/main/query.gql | 30 +- .../.dataconnect/schema/main/relation.gql | 242 + .../.dataconnect/schema/prelude.gql | 722 +- 179 files changed, 30898 insertions(+), 301 deletions(-) create mode 100644 .gitmodules create mode 100644 packages/@apphosting/adapter-nextjs/clean_protos.cjs create mode 100644 packages/@apphosting/adapter-nextjs/src/bin/serve.cts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts create mode 100644 starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..e69de29b diff --git a/package-lock.json b/package-lock.json index e8f0ed10..858ef8da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3276,6 +3276,13 @@ "node": ">=6.9.0" } }, + "node_modules/@bufbuild/protobuf": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.9.0.tgz", + "integrity": "sha512-rnJenoStJ8nvmt9Gzye8nkYd6V22xUAnu4086ER7h1zJ508vStko4pMvDeQ446ilDTFpV5wnoc5YS7XvMwwMqA==", + "dev": true, + "license": "(Apache-2.0 AND BSD-3-Clause)" + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -6124,6 +6131,16 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@jsdoc/salty": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.7.tgz", @@ -11860,6 +11877,19 @@ } ] }, + "node_modules/case-anything": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -12043,7 +12073,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "devOptional": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -12057,7 +12086,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "devOptional": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -13299,6 +13327,29 @@ "node": ">=12" } }, + "node_modules/dprint-node": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", + "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/dprint-node/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -13584,7 +13635,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "devOptional": true, "engines": { "node": ">=6" } @@ -14882,7 +14932,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "devOptional": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -17374,8 +17423,7 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "devOptional": true + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, "node_modules/lodash.clonedeep": { "version": "4.5.0", @@ -20736,10 +20784,11 @@ } }, "node_modules/protobufjs": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", - "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -20826,6 +20875,19 @@ "node": ">=10" } }, + "node_modules/protoc": { + "version": "32.1.0", + "resolved": "https://registry.npmjs.org/protoc/-/protoc-32.1.0.tgz", + "integrity": "sha512-yICJJCGHJLM9ao5W2V4CGp1d7xuBsdHzgVDw6L8mdDtoIcqzN3arNPOm9Jx4Ufp5vfhQfJGkNUDo6mm/SLPdXw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "protoc": "protoc.cjs" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/protocols": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", @@ -21545,7 +21607,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -23690,6 +23751,42 @@ "node": ">=0.3.1" } }, + "node_modules/ts-poet": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.12.0.tgz", + "integrity": "sha512-xo+iRNMWqyvXpFTaOAvLPA5QAWO6TZrSUs5s4Odaya3epqofBu/fMLHEWl8jPmjhA0s9sgj9sNvF1BmaQlmQkA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dprint-node": "^1.0.8" + } + }, + "node_modules/ts-proto": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-2.7.7.tgz", + "integrity": "sha512-/OfN9/Yriji2bbpOysZ/Jzc96isOKz+eBTJEcKaIZ0PR6x1TNgVm4Lz0zfbo+J0jwFO7fJjJyssefBPQ0o1V9A==", + "dev": true, + "license": "ISC", + "dependencies": { + "@bufbuild/protobuf": "^2.0.0", + "case-anything": "^2.1.13", + "ts-poet": "^6.12.0", + "ts-proto-descriptors": "2.0.0" + }, + "bin": { + "protoc-gen-ts_proto": "protoc-gen-ts_proto" + } + }, + "node_modules/ts-proto-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-2.0.0.tgz", + "integrity": "sha512-wHcTH3xIv11jxgkX5OyCSFfw27agpInAd6yh89hKG6zqIXnjW9SYqSER2CVQxdPj4czeOhGagNvZBEbJPy7qkw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@bufbuild/protobuf": "^2.0.0" + } + }, "node_modules/tsconfig-paths": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", @@ -25185,7 +25282,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "devOptional": true, "engines": { "node": ">=10" } @@ -25465,12 +25561,15 @@ "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", + "@grpc/grpc-js": "^1.14.0", + "@grpc/proto-loader": "^0.8.0", "fs-extra": "^11.1.1", "yaml": "^2.3.4" }, "bin": { "apphosting-adapter-nextjs-build": "dist/bin/build.js", - "apphosting-adapter-nextjs-create": "dist/bin/create.js" + "apphosting-adapter-nextjs-create": "dist/bin/create.js", + "apphosting-adapter-nextjs-serve": "dist/bin/serve.js" }, "devDependencies": { "@types/fs-extra": "*", @@ -25478,10 +25577,12 @@ "@types/tmp": "*", "mocha": "*", "next": "15.6.0-canary.54", + "protoc": "^32.1.0", "semver": "*", "tmp": "*", "ts-mocha": "*", "ts-node": "*", + "ts-proto": "^2.7.7", "typescript": "*", "verdaccio": "^5.30.3" }, @@ -25529,6 +25630,37 @@ } } }, + "packages/@apphosting/adapter-nextjs/node_modules/@grpc/grpc-js": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.0.tgz", + "integrity": "sha512-N8Jx6PaYzcTRNzirReJCtADVoq4z7+1KQ4E70jTg/koQiMoUSN1kbNjPOqpPbhMFhfU1/l7ixspPl8dNY+FoUg==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@grpc/proto-loader": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz", + "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==", + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.3", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, "packages/@apphosting/adapter-nextjs/node_modules/@img/sharp-darwin-arm64": { "version": "0.34.4", "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.4.tgz", @@ -26203,6 +26335,33 @@ "dev": true, "license": "0BSD" }, + "packages/@apphosting/adapter-nextjs/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "packages/@apphosting/build": { "version": "0.1.6", "license": "Apache-2.0", diff --git a/packages/@apphosting/adapter-nextjs/clean_protos.cjs b/packages/@apphosting/adapter-nextjs/clean_protos.cjs new file mode 100644 index 00000000..576845ac --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/clean_protos.cjs @@ -0,0 +1,62 @@ +const fs = require('fs'); +const path = require('path'); + +const TARGET_DIR = './src/protos'; + +// This regex finds lines with relative imports. +// It captures three groups: +// 1. The part before the path (e.g., `from '`) +// 2. The relative path itself (e.g., `./some/file`) +// 3. The closing quote (e.g., `'`) +const IMPORT_REGEX = /(from\s+['"])(\.\.?\/[^'"]+)(['"])/g; + +/** + * Recursively walks a directory and applies a file processing function. + * @param {string} directory The directory to walk. + * @param {(filePath: string) => void} processFile The function to apply to each file. + */ +function walkDirectory(directory, processFile) { + const items = fs.readdirSync(directory); + for (const item of items) { + const fullPath = path.join(directory, item); + const stat = fs.statSync(fullPath); + if (stat.isDirectory()) { + walkDirectory(fullPath, processFile); + } else if (fullPath.endsWith('.ts')) { + processFile(fullPath); + } + } +} + +/** + * Reads a TypeScript file, adds '.js' extensions to relative imports, + * and writes the changes back to the file. + * @param {string} filePath The path to the TypeScript file. + */ +function addJsExtensions(filePath) { + let content = fs.readFileSync(filePath, 'utf8'); + let changesMade = false; + + const newContent = content.replace(IMPORT_REGEX, (match, pre, importPath, post) => { + // Check if the path already has an extension. + // path.extname() returns the extension (e.g., '.js') or an empty string. + if (path.extname(importPath)) { + return match; // No change needed + } + + changesMade = true; + const newImportPath = `${importPath}.js`; + return `${pre}${newImportPath}${post}`; + }); + + if (changesMade) { + fs.writeFileSync(filePath, newContent, 'utf8'); + } +} + +try { + walkDirectory(TARGET_DIR, addJsExtensions); +} catch (error) { + console.error(`Error processing files: ${error.message}`); + process.exit(1); +} diff --git a/packages/@apphosting/adapter-nextjs/package.json b/packages/@apphosting/adapter-nextjs/package.json index 0984abe6..e8c0f19f 100644 --- a/packages/@apphosting/adapter-nextjs/package.json +++ b/packages/@apphosting/adapter-nextjs/package.json @@ -9,6 +9,7 @@ }, "bin": { "apphosting-adapter-nextjs-build": "dist/bin/build.js", + "apphosting-adapter-nextjs-serve": "dist/bin/serve.js", "apphosting-adapter-nextjs-create": "dist/bin/create.js" }, "author": { @@ -21,7 +22,8 @@ "type": "module", "sideEffects": false, "scripts": { - "build": "rm -rf dist && tsc && chmod +x ./dist/bin/* && npx -y esbuild ./dist/index.js --bundle --format=cjs --platform=node --outfile=./dist/index.cjs", + "build:protos": "npx protoc -I=../../../submodules/envoy/api -I=../../../submodules/googleapis -I=../../../submodules/udpa -I=../../../submodules/protobuf/src -I=../../../submodules/protoc-gen-validate -I=../../../submodules/xds --plugin=\"$(pwd)/../../../node_modules/.bin/protoc-gen-ts_proto\" --ts_proto_out=./src/protos --ts_proto_opt=forceLong=string,esModuleInterop=true,outputServices=grpc-js ../../../submodules/envoy/api/envoy/service/ext_proc/v3/external_processor.proto && node ./clean_protos.cjs", + "build": "npm run build:protos && rm -rf dist && tsc && chmod +x ./dist/bin/* && npx -y esbuild ./dist/index.js --bundle --format=cjs --platform=node --outfile=./dist/index.cjs", "test": "npm run test:unit && npm run test:functional", "test:unit": "ts-mocha -p tsconfig.json 'src/**/*.spec.ts' 'src/*.spec.ts'", "test:functional": "node --loader ts-node/esm ./e2e/run-local.ts", @@ -44,6 +46,7 @@ "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", + "@grpc/grpc-js": "^1.14.0", "fs-extra": "^11.1.1", "yaml": "^2.3.4" }, @@ -61,10 +64,12 @@ "@types/tmp": "*", "mocha": "*", "next": "15.6.0-canary.54", + "protoc": "^32.1.0", "semver": "*", "tmp": "*", "ts-mocha": "*", "ts-node": "*", + "ts-proto": "^2.7.7", "typescript": "*", "verdaccio": "^5.30.3" } diff --git a/packages/@apphosting/adapter-nextjs/src/bin/build.ts b/packages/@apphosting/adapter-nextjs/src/bin/build.ts index 52b84632..61bc1743 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/build.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/build.ts @@ -1,6 +1,6 @@ #! /usr/bin/env node import { getBuildOptions, runBuild } from "@apphosting/common"; -import { generateBuildOutput, getAdapterMetadata, loadConfig, populateOutputBundleOptions, validateOutputDirectory } from "../utils.js"; +import { generateBuildOutput, loadConfig, populateOutputBundleOptions, validateOutputDirectory } from "../utils.js"; import { join } from "node:path"; // Opt-out sending telemetry to Vercel diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.cts b/packages/@apphosting/adapter-nextjs/src/bin/serve.cts new file mode 100644 index 00000000..f9028c55 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.cts @@ -0,0 +1,299 @@ +import { readFileSync } from "node:fs"; +import { createServer, ServerResponse, IncomingMessage } from "node:http"; +import { join } from "node:path"; + +import { + ExternalProcessorServer, + ProcessingRequest, + ProcessingResponse, + ExternalProcessorService, + CommonResponse_ResponseStatus, +} from '../protos/envoy/service/ext_proc/v3/external_processor.js'; +import { HeaderValueOption, HeaderValueOption_HeaderAppendAction } from '../protos/envoy/config/core/v3/base.js'; +import grpc from "@grpc/grpc-js"; + +const dir = process.cwd(); + +const port = parseInt(process.env.PORT!, 10) || 3000 +const hostname = process.env.HOSTNAME || '0.0.0.0' + +let keepAliveTimeout: number | undefined = parseInt(process.env.KEEP_ALIVE_TIMEOUT!, 10); + +// (bundle.yaml) +// service_calls: +// - matcher: +// - path: /api/** +// - header_exists: x-foo +// on: +// - request_headers +// - response_headers + +// rewrites, redirects (before_files, after_files) + +const conf = JSON.parse(readFileSync(join(dir, ".next", "required-server-files.json"), "utf-8")).config; + +const extProcService: ExternalProcessorServer = { + process(call): void { + console.log('New processing stream initiated...'); + + call.on('data', (request: ProcessingRequest) => { + // 1. Handle Request Headers + if (request.requestHeaders) { + console.log('Processing REQUEST_HEADERS...'); + + const newHeader: HeaderValueOption = { + header: { + key: 'x-callout-processed-ts', + rawValue: Uint8Array.from(Buffer.from('true')), + value: "true", + }, + appendAction: HeaderValueOption_HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD, + append: true, + keepEmptyValue: true, + }; + + const response: ProcessingResponse = { + requestHeaders: { + response: { + headerMutation: { + setHeaders: [newHeader], + removeHeaders: [], + }, + status: CommonResponse_ResponseStatus.CONTINUE, + bodyMutation: undefined, + trailers: undefined, + clearRouteCache: false, + } + }, + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; + call.write(response); + } + + // 2. Handle Request Body + else if (request.requestBody) { + console.log('Processing REQUEST_BODY...'); + + const response: ProcessingResponse = { + requestBody: { + response: { + headerMutation: undefined, + status: CommonResponse_ResponseStatus.CONTINUE, + bodyMutation: undefined, + trailers: undefined, + clearRouteCache: false, + }, + }, + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; + call.write(response); + } + + // 3. Handle Request Trailers + else if (request.requestTrailers) { + console.log('Processing REQUEST_TRAILERS...'); + + const response: ProcessingResponse = { + requestTrailers: { + headerMutation: { + setHeaders: [], + removeHeaders: [], + }, + }, + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; + call.write(response); + } + + // 4. Handle Response Headers + else if (request.responseHeaders) { + console.log('Processing RESPONSE_HEADERS...'); + + const response: ProcessingResponse = { + // --- The oneof property --- + responseHeaders: { + response: { + headerMutation: undefined, + status: CommonResponse_ResponseStatus.CONTINUE, + bodyMutation: undefined, + trailers: undefined, + clearRouteCache: false, + } + }, + // --- Required top-level properties --- + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; + call.write(response); + } + + // 5. Handle Response Body + else if (request.responseBody) { + console.log('Processing RESPONSE_BODY...'); + + const response: ProcessingResponse = { + // --- The oneof property --- + responseBody: { + response: { + headerMutation: undefined, + status: CommonResponse_ResponseStatus.CONTINUE, + bodyMutation: undefined, + trailers: undefined, + clearRouteCache: false, + }, + }, + // --- Required top-level properties --- + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; + call.write(response); + } + + // 6. Handle Response Trailers + else if (request.responseTrailers) { + console.log('Processing RESPONSE_TRAILERS...'); + + const response: ProcessingResponse = { + // --- The oneof property --- + responseTrailers: { + headerMutation: { + setHeaders: [], + removeHeaders: [], + }, + }, + // --- Required top-level properties --- + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; + call.write(response); + } + }); + + call.on('error', (err) => { + console.error('Stream error:', err); + }); + + call.on('end', () => { + console.log('Processing stream ended.'); + call.end(); + }); + }, +}; + +const server = new grpc.Server(); + +// Add the ExternalProcessor service with our `process` handler +server.addService(ExternalProcessorService, extProcService); + +// The load balancer requires HTTP/2, so you must use +// createSsl for a production environment. +// For this example, we use insecure credentials. +const grpcPort = '8080'; +server.bindAsync( + `0.0.0.0:${grpcPort}`, + grpc.ServerCredentials.createInsecure(), // <-- Use createSsl() in production + (err, port) => { + if (err) { + console.error('Failed to bind server:', err); + return; + } + console.log(`gRPC Callout Server running on port ${port}`); + } +); + +process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(conf); + +process.setMaxListeners(1_000); + +if ( + Number.isNaN(keepAliveTimeout) || + !Number.isFinite(keepAliveTimeout) || + keepAliveTimeout < 0 +) { + keepAliveTimeout = undefined +} + +const NextServer = require("next/dist/server/next-server.js"); +const minimalServer = new NextServer.default({ + conf, + dev: false, + dir, + hostname, + port, + minimalMode: true, +}); + +// While demoing in envoy was simple enough, to do this on GCP edge we have two +// main problems: +// 1. We need to prevent EOF from being dispatched so we can stitch the +// resume response to the end of the preamble. proxy-wasm ABI doesn't +// currently allow this. If we didn't care about CDN, we could hack +// into the adapter by being clever about chunked encoding but the +// whole point is to be CDN-friendly. +// 2. The HTTP sidecar request doesn't allow streaming in proxy-wasm ATM. +// Solution: +// GRPC could solve #2 but that leaves us with #1. +// Solution is to invert the logic—use the sidecar for preamble and the main +// request for resumption. +// This causes more issues: +// 1. proxy-wasm can't change the main request method (resume is a POST) +// 2. we've now broken streaming for apps/routes not using PPR +// While we can patch #1 in the adapter, there's no simple (multi-tenant) +// solution for #1 that doesn't require we know the PPR routes ahead of time +// and thus, this can't be done without control-plane coordination. + +// TODO spin up NodeJS middleware as a GRPC service + +// TODO spin up PPR resumption as a GRPC service + + +const { NEXT_REQUEST_META } = require("next/dist/server/request-meta.js"); + +async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse) { + if (req.method !== 'GET' && req.method !== 'HEAD') return; + if (!res.getHeaderNames().includes('x-nextjs-postponed')) return; + // TODO memoize/import this symbol outside the function + // TODO import the type from NextJS + const metadata = (req as any)[NEXT_REQUEST_META]; + // TODO investigate if there's a better / more stable way to get the postpone token + const cacheEntry = await metadata.incrementalCache.get(metadata.match.definition.pathname, { kind: metadata.match.definition.kind, isRoutePPREnabled: true }); + res.appendHeader('x-fah-postponed', Buffer.from(cacheEntry.value.postponed).toString('base64url')); +} + +async function requestHandle(req: IncomingMessage, res: ServerResponse) { + const originalWrite = res.write.bind(res); + let resolveHeaders: Promise | undefined; + // We need to append our headers before the body starts getting written + res.write = function () { + resolveHeaders ||= injectAppHostingHeaders(req, res); + resolveHeaders.then(() => { + // @ts-expect-error TODO fix the type + const written = originalWrite(...arguments); + if (written) res.emit("drain"); + }) + return false; + }; + const originalEnd = res.end.bind(res); + res.end = function () { + resolveHeaders ||= injectAppHostingHeaders(req, res); + resolveHeaders.then(() => { + originalEnd(...arguments); + }); + return res; + }; + await minimalServer.prepare(); + return await minimalServer.getRequestHandler()(req, res); +}; + +createServer({ keepAliveTimeout }, requestHandle).listen(port, hostname, () => { + console.log(`minimal listening on http://${hostname}:${port}.`); +}); diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts new file mode 100644 index 00000000..17e71df6 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts @@ -0,0 +1,18 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + +import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './SocketAddress.js'; +import type { Pipe as _envoy_config_core_v3_Pipe, Pipe__Output as _envoy_config_core_v3_Pipe__Output } from './Pipe.js'; +import type { EnvoyInternalAddress as _envoy_config_core_v3_EnvoyInternalAddress, EnvoyInternalAddress__Output as _envoy_config_core_v3_EnvoyInternalAddress__Output } from './EnvoyInternalAddress.js'; + +export interface Address { + 'socketAddress'?: (_envoy_config_core_v3_SocketAddress | null); + 'pipe'?: (_envoy_config_core_v3_Pipe | null); + 'envoyInternalAddress'?: (_envoy_config_core_v3_EnvoyInternalAddress | null); + 'address'?: "socketAddress"|"pipe"|"envoyInternalAddress"; +} + +export interface Address__Output { + 'socketAddress'?: (_envoy_config_core_v3_SocketAddress__Output); + 'pipe'?: (_envoy_config_core_v3_Pipe__Output); + 'envoyInternalAddress'?: (_envoy_config_core_v3_EnvoyInternalAddress__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts new file mode 100644 index 00000000..06af9c29 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts @@ -0,0 +1,15 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { DataSource as _envoy_config_core_v3_DataSource, DataSource__Output as _envoy_config_core_v3_DataSource__Output } from './DataSource.js'; +import type { RemoteDataSource as _envoy_config_core_v3_RemoteDataSource, RemoteDataSource__Output as _envoy_config_core_v3_RemoteDataSource__Output } from './RemoteDataSource.js'; + +export interface AsyncDataSource { + 'local'?: (_envoy_config_core_v3_DataSource | null); + 'remote'?: (_envoy_config_core_v3_RemoteDataSource | null); + 'specifier'?: "local"|"remote"; +} + +export interface AsyncDataSource__Output { + 'local'?: (_envoy_config_core_v3_DataSource__Output); + 'remote'?: (_envoy_config_core_v3_RemoteDataSource__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts new file mode 100644 index 00000000..0adf9458 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/backoff.proto + +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration.js'; + +export interface BackoffStrategy { + 'baseInterval'?: (_google_protobuf_Duration | null); + 'maxInterval'?: (_google_protobuf_Duration | null); +} + +export interface BackoffStrategy__Output { + 'baseInterval'?: (_google_protobuf_Duration__Output); + 'maxInterval'?: (_google_protobuf_Duration__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts new file mode 100644 index 00000000..8b19e352 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts @@ -0,0 +1,25 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + +import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './SocketAddress.js'; +import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue.js'; +import type { SocketOption as _envoy_config_core_v3_SocketOption, SocketOption__Output as _envoy_config_core_v3_SocketOption__Output } from './SocketOption.js'; +import type { ExtraSourceAddress as _envoy_config_core_v3_ExtraSourceAddress, ExtraSourceAddress__Output as _envoy_config_core_v3_ExtraSourceAddress__Output } from './ExtraSourceAddress.js'; +import type { TypedExtensionConfig as _envoy_config_core_v3_TypedExtensionConfig, TypedExtensionConfig__Output as _envoy_config_core_v3_TypedExtensionConfig__Output } from './TypedExtensionConfig.js'; + +export interface BindConfig { + 'sourceAddress'?: (_envoy_config_core_v3_SocketAddress | null); + 'freebind'?: (_google_protobuf_BoolValue | null); + 'socketOptions'?: (_envoy_config_core_v3_SocketOption)[]; + 'additionalSourceAddresses'?: (_envoy_config_core_v3_SocketAddress)[]; + 'extraSourceAddresses'?: (_envoy_config_core_v3_ExtraSourceAddress)[]; + 'localAddressSelector'?: (_envoy_config_core_v3_TypedExtensionConfig | null); +} + +export interface BindConfig__Output { + 'sourceAddress'?: (_envoy_config_core_v3_SocketAddress__Output); + 'freebind'?: (_google_protobuf_BoolValue__Output); + 'socketOptions'?: (_envoy_config_core_v3_SocketOption__Output)[]; + 'additionalSourceAddresses'?: (_envoy_config_core_v3_SocketAddress__Output)[]; + 'extraSourceAddresses'?: (_envoy_config_core_v3_ExtraSourceAddress__Output)[]; + 'localAddressSelector'?: (_envoy_config_core_v3_TypedExtensionConfig__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts new file mode 100644 index 00000000..828d80e1 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { SemanticVersion as _envoy_type_v3_SemanticVersion, SemanticVersion__Output as _envoy_type_v3_SemanticVersion__Output } from '../../../type/v3/SemanticVersion.js'; +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; + +export interface BuildVersion { + 'version'?: (_envoy_type_v3_SemanticVersion | null); + 'metadata'?: (_google_protobuf_Struct | null); +} + +export interface BuildVersion__Output { + 'version'?: (_envoy_type_v3_SemanticVersion__Output); + 'metadata'?: (_google_protobuf_Struct__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts new file mode 100644 index 00000000..99dad4d0 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + +import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value.js'; + +export interface CidrRange { + 'addressPrefix'?: (string); + 'prefixLen'?: (_google_protobuf_UInt32Value | null); +} + +export interface CidrRange__Output { + 'addressPrefix'?: (string); + 'prefixLen'?: (_google_protobuf_UInt32Value__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts new file mode 100644 index 00000000..657419e2 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts @@ -0,0 +1,10 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface ControlPlane { + 'identifier'?: (string); +} + +export interface ControlPlane__Output { + 'identifier'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts new file mode 100644 index 00000000..f3fba9e1 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts @@ -0,0 +1,20 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { WatchedDirectory as _envoy_config_core_v3_WatchedDirectory, WatchedDirectory__Output as _envoy_config_core_v3_WatchedDirectory__Output } from './WatchedDirectory.js'; + +export interface DataSource { + 'filename'?: (string); + 'inlineBytes'?: (Buffer | Uint8Array | string); + 'inlineString'?: (string); + 'environmentVariable'?: (string); + 'watchedDirectory'?: (_envoy_config_core_v3_WatchedDirectory | null); + 'specifier'?: "filename"|"inlineBytes"|"inlineString"|"environmentVariable"; +} + +export interface DataSource__Output { + 'filename'?: (string); + 'inlineBytes'?: (Buffer); + 'inlineString'?: (string); + 'environmentVariable'?: (string); + 'watchedDirectory'?: (_envoy_config_core_v3_WatchedDirectory__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts new file mode 100644 index 00000000..16c04700 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + + +export interface EnvoyInternalAddress { + 'serverListenerName'?: (string); + 'endpointId'?: (string); + 'addressNameSpecifier'?: "serverListenerName"; +} + +export interface EnvoyInternalAddress__Output { + 'serverListenerName'?: (string); + 'endpointId'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts new file mode 100644 index 00000000..d874c506 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts @@ -0,0 +1,21 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { BuildVersion as _envoy_config_core_v3_BuildVersion, BuildVersion__Output as _envoy_config_core_v3_BuildVersion__Output } from './BuildVersion.js'; + +export interface Extension { + 'name'?: (string); + 'category'?: (string); + 'typeDescriptor'?: (string); + 'version'?: (_envoy_config_core_v3_BuildVersion | null); + 'disabled'?: (boolean); + 'typeUrls'?: (string)[]; +} + +export interface Extension__Output { + 'name'?: (string); + 'category'?: (string); + 'typeDescriptor'?: (string); + 'version'?: (_envoy_config_core_v3_BuildVersion__Output); + 'disabled'?: (boolean); + 'typeUrls'?: (string)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts new file mode 100644 index 00000000..b0db7022 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + +import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './SocketAddress.js'; +import type { SocketOptionsOverride as _envoy_config_core_v3_SocketOptionsOverride, SocketOptionsOverride__Output as _envoy_config_core_v3_SocketOptionsOverride__Output } from './SocketOptionsOverride.js'; + +export interface ExtraSourceAddress { + 'address'?: (_envoy_config_core_v3_SocketAddress | null); + 'socketOptions'?: (_envoy_config_core_v3_SocketOptionsOverride | null); +} + +export interface ExtraSourceAddress__Output { + 'address'?: (_envoy_config_core_v3_SocketAddress__Output); + 'socketOptions'?: (_envoy_config_core_v3_SocketOptionsOverride__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts new file mode 100644 index 00000000..337c6a12 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { HeaderValue as _envoy_config_core_v3_HeaderValue, HeaderValue__Output as _envoy_config_core_v3_HeaderValue__Output } from './HeaderValue.js'; + +export interface HeaderMap { + 'headers'?: (_envoy_config_core_v3_HeaderValue)[]; +} + +export interface HeaderMap__Output { + 'headers'?: (_envoy_config_core_v3_HeaderValue__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts new file mode 100644 index 00000000..08e29715 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface HeaderValue { + 'key'?: (string); + 'value'?: (string); + 'rawValue'?: (Buffer | Uint8Array | string); +} + +export interface HeaderValue__Output { + 'key'?: (string); + 'value'?: (string); + 'rawValue'?: (Buffer); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts new file mode 100644 index 00000000..58ed5b9d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts @@ -0,0 +1,39 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { HeaderValue as _envoy_config_core_v3_HeaderValue, HeaderValue__Output as _envoy_config_core_v3_HeaderValue__Output } from './HeaderValue.js'; +import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue.js'; + +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +export const _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction = { + APPEND_IF_EXISTS_OR_ADD: 0, + ADD_IF_ABSENT: 1, + OVERWRITE_IF_EXISTS_OR_ADD: 2, + OVERWRITE_IF_EXISTS: 3, +} as const; + +export type _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction = + | 'APPEND_IF_EXISTS_OR_ADD' + | 0 + | 'ADD_IF_ABSENT' + | 1 + | 'OVERWRITE_IF_EXISTS_OR_ADD' + | 2 + | 'OVERWRITE_IF_EXISTS' + | 3 + +export type _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction__Output = typeof _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction[keyof typeof _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction] + +export interface HeaderValueOption { + 'header'?: (_envoy_config_core_v3_HeaderValue | null); + 'append'?: (_google_protobuf_BoolValue | null); + 'appendAction'?: (_envoy_config_core_v3_HeaderValueOption_HeaderAppendAction); + 'keepEmptyValue'?: (boolean); +} + +export interface HeaderValueOption__Output { + 'header'?: (_envoy_config_core_v3_HeaderValue__Output); + 'append'?: (_google_protobuf_BoolValue__Output); + 'appendAction'?: (_envoy_config_core_v3_HeaderValueOption_HeaderAppendAction__Output); + 'keepEmptyValue'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts new file mode 100644 index 00000000..3893ca97 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts @@ -0,0 +1,16 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/http_uri.proto + +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration.js'; + +export interface HttpUri { + 'uri'?: (string); + 'cluster'?: (string); + 'timeout'?: (_google_protobuf_Duration | null); + 'httpUpstreamType'?: "cluster"; +} + +export interface HttpUri__Output { + 'uri'?: (string); + 'cluster'?: (string); + 'timeout'?: (_google_protobuf_Duration__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts new file mode 100644 index 00000000..3886428d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface KeyValue { + 'key'?: (string); + 'value'?: (Buffer | Uint8Array | string); +} + +export interface KeyValue__Output { + 'key'?: (string); + 'value'?: (Buffer); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts new file mode 100644 index 00000000..87c2518c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts @@ -0,0 +1,37 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { KeyValue as _envoy_config_core_v3_KeyValue, KeyValue__Output as _envoy_config_core_v3_KeyValue__Output } from './KeyValue.js'; +import type { KeyValuePair as _envoy_config_core_v3_KeyValuePair, KeyValuePair__Output as _envoy_config_core_v3_KeyValuePair__Output } from './KeyValuePair.js'; + +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +export const _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction = { + APPEND_IF_EXISTS_OR_ADD: 0, + ADD_IF_ABSENT: 1, + OVERWRITE_IF_EXISTS_OR_ADD: 2, + OVERWRITE_IF_EXISTS: 3, +} as const; + +export type _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction = + | 'APPEND_IF_EXISTS_OR_ADD' + | 0 + | 'ADD_IF_ABSENT' + | 1 + | 'OVERWRITE_IF_EXISTS_OR_ADD' + | 2 + | 'OVERWRITE_IF_EXISTS' + | 3 + +export type _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction__Output = typeof _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction[keyof typeof _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction] + +export interface KeyValueAppend { + 'entry'?: (_envoy_config_core_v3_KeyValue | null); + 'action'?: (_envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction); + 'record'?: (_envoy_config_core_v3_KeyValuePair | null); +} + +export interface KeyValueAppend__Output { + 'entry'?: (_envoy_config_core_v3_KeyValue__Output); + 'action'?: (_envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction__Output); + 'record'?: (_envoy_config_core_v3_KeyValuePair__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts new file mode 100644 index 00000000..56cfaf44 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { KeyValueAppend as _envoy_config_core_v3_KeyValueAppend, KeyValueAppend__Output as _envoy_config_core_v3_KeyValueAppend__Output } from './KeyValueAppend.js'; + +export interface KeyValueMutation { + 'append'?: (_envoy_config_core_v3_KeyValueAppend | null); + 'remove'?: (string); +} + +export interface KeyValueMutation__Output { + 'append'?: (_envoy_config_core_v3_KeyValueAppend__Output); + 'remove'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts new file mode 100644 index 00000000..baf9867d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from '../../../../google/protobuf/Value.js'; + +export interface KeyValuePair { + 'key'?: (string); + 'value'?: (_google_protobuf_Value | null); +} + +export interface KeyValuePair__Output { + 'key'?: (string); + 'value'?: (_google_protobuf_Value__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts new file mode 100644 index 00000000..4da88491 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface Locality { + 'region'?: (string); + 'zone'?: (string); + 'subZone'?: (string); +} + +export interface Locality__Output { + 'region'?: (string); + 'zone'?: (string); + 'subZone'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts new file mode 100644 index 00000000..e065ae91 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; + +export interface Metadata { + 'filterMetadata'?: ({[key: string]: _google_protobuf_Struct}); + 'typedFilterMetadata'?: ({[key: string]: _google_protobuf_Any}); +} + +export interface Metadata__Output { + 'filterMetadata'?: ({[key: string]: _google_protobuf_Struct__Output}); + 'typedFilterMetadata'?: ({[key: string]: _google_protobuf_Any__Output}); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts new file mode 100644 index 00000000..354307b9 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts @@ -0,0 +1,37 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; +import type { Locality as _envoy_config_core_v3_Locality, Locality__Output as _envoy_config_core_v3_Locality__Output } from './Locality.js'; +import type { BuildVersion as _envoy_config_core_v3_BuildVersion, BuildVersion__Output as _envoy_config_core_v3_BuildVersion__Output } from './BuildVersion.js'; +import type { Extension as _envoy_config_core_v3_Extension, Extension__Output as _envoy_config_core_v3_Extension__Output } from './Extension.js'; +import type { Address as _envoy_config_core_v3_Address, Address__Output as _envoy_config_core_v3_Address__Output } from './Address.js'; +import type { ContextParams as _xds_core_v3_ContextParams, ContextParams__Output as _xds_core_v3_ContextParams__Output } from '../../../../xds/core/v3/ContextParams.js'; + +export interface Node { + 'id'?: (string); + 'cluster'?: (string); + 'metadata'?: (_google_protobuf_Struct | null); + 'locality'?: (_envoy_config_core_v3_Locality | null); + 'userAgentName'?: (string); + 'userAgentVersion'?: (string); + 'userAgentBuildVersion'?: (_envoy_config_core_v3_BuildVersion | null); + 'extensions'?: (_envoy_config_core_v3_Extension)[]; + 'clientFeatures'?: (string)[]; + 'listeningAddresses'?: (_envoy_config_core_v3_Address)[]; + 'dynamicParameters'?: ({[key: string]: _xds_core_v3_ContextParams}); + 'userAgentVersionType'?: "userAgentVersion"|"userAgentBuildVersion"; +} + +export interface Node__Output { + 'id'?: (string); + 'cluster'?: (string); + 'metadata'?: (_google_protobuf_Struct__Output); + 'locality'?: (_envoy_config_core_v3_Locality__Output); + 'userAgentName'?: (string); + 'userAgentVersion'?: (string); + 'userAgentBuildVersion'?: (_envoy_config_core_v3_BuildVersion__Output); + 'extensions'?: (_envoy_config_core_v3_Extension__Output)[]; + 'clientFeatures'?: (string)[]; + 'listeningAddresses'?: (_envoy_config_core_v3_Address__Output)[]; + 'dynamicParameters'?: ({[key: string]: _xds_core_v3_ContextParams__Output}); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts new file mode 100644 index 00000000..37abf5c6 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + + +export interface Pipe { + 'path'?: (string); + 'mode'?: (number); +} + +export interface Pipe__Output { + 'path'?: (string); + 'mode'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts new file mode 100644 index 00000000..54e54383 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface QueryParameter { + 'key'?: (string); + 'value'?: (string); +} + +export interface QueryParameter__Output { + 'key'?: (string); + 'value'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts new file mode 100644 index 00000000..2e5ad48b --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts @@ -0,0 +1,16 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { HttpUri as _envoy_config_core_v3_HttpUri, HttpUri__Output as _envoy_config_core_v3_HttpUri__Output } from './HttpUri.js'; +import type { RetryPolicy as _envoy_config_core_v3_RetryPolicy, RetryPolicy__Output as _envoy_config_core_v3_RetryPolicy__Output } from './RetryPolicy.js'; + +export interface RemoteDataSource { + 'httpUri'?: (_envoy_config_core_v3_HttpUri | null); + 'sha256'?: (string); + 'retryPolicy'?: (_envoy_config_core_v3_RetryPolicy | null); +} + +export interface RemoteDataSource__Output { + 'httpUri'?: (_envoy_config_core_v3_HttpUri__Output); + 'sha256'?: (string); + 'retryPolicy'?: (_envoy_config_core_v3_RetryPolicy__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts new file mode 100644 index 00000000..e2d67deb --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts @@ -0,0 +1,38 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +export const RequestMethod = { + METHOD_UNSPECIFIED: 0, + GET: 1, + HEAD: 2, + POST: 3, + PUT: 4, + DELETE: 5, + CONNECT: 6, + OPTIONS: 7, + TRACE: 8, + PATCH: 9, +} as const; + +export type RequestMethod = + | 'METHOD_UNSPECIFIED' + | 0 + | 'GET' + | 1 + | 'HEAD' + | 2 + | 'POST' + | 3 + | 'PUT' + | 4 + | 'DELETE' + | 5 + | 'CONNECT' + | 6 + | 'OPTIONS' + | 7 + | 'TRACE' + | 8 + | 'PATCH' + | 9 + +export type RequestMethod__Output = typeof RequestMethod[keyof typeof RequestMethod] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts new file mode 100644 index 00000000..d2d2a004 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts @@ -0,0 +1,46 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { BackoffStrategy as _envoy_config_core_v3_BackoffStrategy, BackoffStrategy__Output as _envoy_config_core_v3_BackoffStrategy__Output } from './BackoffStrategy.js'; +import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value.js'; +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; +import type { Long } from '@grpc/proto-loader'; + +export interface _envoy_config_core_v3_RetryPolicy_RetryHostPredicate { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any | null); + 'configType'?: "typedConfig"; +} + +export interface _envoy_config_core_v3_RetryPolicy_RetryHostPredicate__Output { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any__Output); +} + +export interface _envoy_config_core_v3_RetryPolicy_RetryPriority { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any | null); + 'configType'?: "typedConfig"; +} + +export interface _envoy_config_core_v3_RetryPolicy_RetryPriority__Output { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any__Output); +} + +export interface RetryPolicy { + 'retryBackOff'?: (_envoy_config_core_v3_BackoffStrategy | null); + 'numRetries'?: (_google_protobuf_UInt32Value | null); + 'retryOn'?: (string); + 'retryPriority'?: (_envoy_config_core_v3_RetryPolicy_RetryPriority | null); + 'retryHostPredicate'?: (_envoy_config_core_v3_RetryPolicy_RetryHostPredicate)[]; + 'hostSelectionRetryMaxAttempts'?: (number | string | Long); +} + +export interface RetryPolicy__Output { + 'retryBackOff'?: (_envoy_config_core_v3_BackoffStrategy__Output); + 'numRetries'?: (_google_protobuf_UInt32Value__Output); + 'retryOn'?: (string); + 'retryPriority'?: (_envoy_config_core_v3_RetryPolicy_RetryPriority__Output); + 'retryHostPredicate'?: (_envoy_config_core_v3_RetryPolicy_RetryHostPredicate__Output)[]; + 'hostSelectionRetryMaxAttempts'?: (Long); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts new file mode 100644 index 00000000..ef8eeb0c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +export const RoutingPriority = { + DEFAULT: 0, + HIGH: 1, +} as const; + +export type RoutingPriority = + | 'DEFAULT' + | 0 + | 'HIGH' + | 1 + +export type RoutingPriority__Output = typeof RoutingPriority[keyof typeof RoutingPriority] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts new file mode 100644 index 00000000..78b897ed --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface RuntimeDouble { + 'defaultValue'?: (number | string); + 'runtimeKey'?: (string); +} + +export interface RuntimeDouble__Output { + 'defaultValue'?: (number); + 'runtimeKey'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts new file mode 100644 index 00000000..63b38f64 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue.js'; + +export interface RuntimeFeatureFlag { + 'defaultValue'?: (_google_protobuf_BoolValue | null); + 'runtimeKey'?: (string); +} + +export interface RuntimeFeatureFlag__Output { + 'defaultValue'?: (_google_protobuf_BoolValue__Output); + 'runtimeKey'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts new file mode 100644 index 00000000..804b9f50 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { FractionalPercent as _envoy_type_v3_FractionalPercent, FractionalPercent__Output as _envoy_type_v3_FractionalPercent__Output } from '../../../type/v3/FractionalPercent.js'; + +export interface RuntimeFractionalPercent { + 'defaultValue'?: (_envoy_type_v3_FractionalPercent | null); + 'runtimeKey'?: (string); +} + +export interface RuntimeFractionalPercent__Output { + 'defaultValue'?: (_envoy_type_v3_FractionalPercent__Output); + 'runtimeKey'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts new file mode 100644 index 00000000..4788869f --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { Percent as _envoy_type_v3_Percent, Percent__Output as _envoy_type_v3_Percent__Output } from '../../../type/v3/Percent.js'; + +export interface RuntimePercent { + 'defaultValue'?: (_envoy_type_v3_Percent | null); + 'runtimeKey'?: (string); +} + +export interface RuntimePercent__Output { + 'defaultValue'?: (_envoy_type_v3_Percent__Output); + 'runtimeKey'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts new file mode 100644 index 00000000..cf0a2379 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface RuntimeUInt32 { + 'defaultValue'?: (number); + 'runtimeKey'?: (string); +} + +export interface RuntimeUInt32__Output { + 'defaultValue'?: (number); + 'runtimeKey'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts new file mode 100644 index 00000000..926814ac --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts @@ -0,0 +1,38 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + + +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + +export const _envoy_config_core_v3_SocketAddress_Protocol = { + TCP: 0, + UDP: 1, +} as const; + +export type _envoy_config_core_v3_SocketAddress_Protocol = + | 'TCP' + | 0 + | 'UDP' + | 1 + +export type _envoy_config_core_v3_SocketAddress_Protocol__Output = typeof _envoy_config_core_v3_SocketAddress_Protocol[keyof typeof _envoy_config_core_v3_SocketAddress_Protocol] + +export interface SocketAddress { + 'protocol'?: (_envoy_config_core_v3_SocketAddress_Protocol); + 'address'?: (string); + 'portValue'?: (number); + 'namedPort'?: (string); + 'resolverName'?: (string); + 'ipv4Compat'?: (boolean); + 'networkNamespaceFilepath'?: (string); + 'portSpecifier'?: "portValue"|"namedPort"; +} + +export interface SocketAddress__Output { + 'protocol'?: (_envoy_config_core_v3_SocketAddress_Protocol__Output); + 'address'?: (string); + 'portValue'?: (number); + 'namedPort'?: (string); + 'resolverName'?: (string); + 'ipv4Compat'?: (boolean); + 'networkNamespaceFilepath'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts new file mode 100644 index 00000000..82b4d9dc --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts @@ -0,0 +1,64 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/socket_option.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface _envoy_config_core_v3_SocketOption_SocketType_Datagram { +} + +export interface _envoy_config_core_v3_SocketOption_SocketType_Datagram__Output { +} + +// Original file: ../../../envoy/api/envoy/config/core/v3/socket_option.proto + +export const _envoy_config_core_v3_SocketOption_SocketState = { + STATE_PREBIND: 0, + STATE_BOUND: 1, + STATE_LISTENING: 2, +} as const; + +export type _envoy_config_core_v3_SocketOption_SocketState = + | 'STATE_PREBIND' + | 0 + | 'STATE_BOUND' + | 1 + | 'STATE_LISTENING' + | 2 + +export type _envoy_config_core_v3_SocketOption_SocketState__Output = typeof _envoy_config_core_v3_SocketOption_SocketState[keyof typeof _envoy_config_core_v3_SocketOption_SocketState] + +export interface _envoy_config_core_v3_SocketOption_SocketType { + 'stream'?: (_envoy_config_core_v3_SocketOption_SocketType_Stream | null); + 'datagram'?: (_envoy_config_core_v3_SocketOption_SocketType_Datagram | null); +} + +export interface _envoy_config_core_v3_SocketOption_SocketType__Output { + 'stream'?: (_envoy_config_core_v3_SocketOption_SocketType_Stream__Output); + 'datagram'?: (_envoy_config_core_v3_SocketOption_SocketType_Datagram__Output); +} + +export interface _envoy_config_core_v3_SocketOption_SocketType_Stream { +} + +export interface _envoy_config_core_v3_SocketOption_SocketType_Stream__Output { +} + +export interface SocketOption { + 'description'?: (string); + 'level'?: (number | string | Long); + 'name'?: (number | string | Long); + 'intValue'?: (number | string | Long); + 'bufValue'?: (Buffer | Uint8Array | string); + 'state'?: (_envoy_config_core_v3_SocketOption_SocketState); + 'type'?: (_envoy_config_core_v3_SocketOption_SocketType | null); + 'value'?: "intValue"|"bufValue"; +} + +export interface SocketOption__Output { + 'description'?: (string); + 'level'?: (Long); + 'name'?: (Long); + 'intValue'?: (Long); + 'bufValue'?: (Buffer); + 'state'?: (_envoy_config_core_v3_SocketOption_SocketState__Output); + 'type'?: (_envoy_config_core_v3_SocketOption_SocketType__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts new file mode 100644 index 00000000..7a0212bb --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/socket_option.proto + +import type { SocketOption as _envoy_config_core_v3_SocketOption, SocketOption__Output as _envoy_config_core_v3_SocketOption__Output } from './SocketOption.js'; + +export interface SocketOptionsOverride { + 'socketOptions'?: (_envoy_config_core_v3_SocketOption)[]; +} + +export interface SocketOptionsOverride__Output { + 'socketOptions'?: (_envoy_config_core_v3_SocketOption__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts new file mode 100644 index 00000000..f43242bc --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts @@ -0,0 +1,15 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto + +import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value.js'; + +export interface TcpKeepalive { + 'keepaliveProbes'?: (_google_protobuf_UInt32Value | null); + 'keepaliveTime'?: (_google_protobuf_UInt32Value | null); + 'keepaliveInterval'?: (_google_protobuf_UInt32Value | null); +} + +export interface TcpKeepalive__Output { + 'keepaliveProbes'?: (_google_protobuf_UInt32Value__Output); + 'keepaliveTime'?: (_google_protobuf_UInt32Value__Output); + 'keepaliveInterval'?: (_google_protobuf_UInt32Value__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts new file mode 100644 index 00000000..5c2bb8a1 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts @@ -0,0 +1,17 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +export const TrafficDirection = { + UNSPECIFIED: 0, + INBOUND: 1, + OUTBOUND: 2, +} as const; + +export type TrafficDirection = + | 'UNSPECIFIED' + | 0 + | 'INBOUND' + | 1 + | 'OUTBOUND' + | 2 + +export type TrafficDirection__Output = typeof TrafficDirection[keyof typeof TrafficDirection] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts new file mode 100644 index 00000000..0c0e04ca --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; + +export interface TransportSocket { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any | null); + 'configType'?: "typedConfig"; +} + +export interface TransportSocket__Output { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts new file mode 100644 index 00000000..5f6c8a7d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/extension.proto + +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; + +export interface TypedExtensionConfig { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any | null); +} + +export interface TypedExtensionConfig__Output { + 'name'?: (string); + 'typedConfig'?: (_google_protobuf_Any__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts new file mode 100644 index 00000000..7b503731 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts @@ -0,0 +1,10 @@ +// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto + + +export interface WatchedDirectory { + 'path'?: (string); +} + +export interface WatchedDirectory__Output { + 'path'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts new file mode 100644 index 00000000..3bb1c551 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts @@ -0,0 +1,62 @@ +// Original file: ../../../envoy/api/envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + + +// Original file: ../../../envoy/api/envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +export const _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode = { + NONE: 0, + STREAMED: 1, + BUFFERED: 2, + BUFFERED_PARTIAL: 3, + FULL_DUPLEX_STREAMED: 4, +} as const; + +export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode = + | 'NONE' + | 0 + | 'STREAMED' + | 1 + | 'BUFFERED' + | 2 + | 'BUFFERED_PARTIAL' + | 3 + | 'FULL_DUPLEX_STREAMED' + | 4 + +export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output = typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode[keyof typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode] + +// Original file: ../../../envoy/api/envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +export const _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode = { + DEFAULT: 0, + SEND: 1, + SKIP: 2, +} as const; + +export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode = + | 'DEFAULT' + | 0 + | 'SEND' + | 1 + | 'SKIP' + | 2 + +export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output = typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode[keyof typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode] + +export interface ProcessingMode { + 'requestHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); + 'responseHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); + 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); + 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); + 'requestTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); + 'responseTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); +} + +export interface ProcessingMode__Output { + 'requestHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); + 'responseHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); + 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); + 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); + 'requestTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); + 'responseTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts new file mode 100644 index 00000000..9f28bc3b --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts @@ -0,0 +1,16 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { StreamedBodyResponse as _envoy_service_ext_proc_v3_StreamedBodyResponse, StreamedBodyResponse__Output as _envoy_service_ext_proc_v3_StreamedBodyResponse__Output } from './StreamedBodyResponse.js'; + +export interface BodyMutation { + 'body'?: (Buffer | Uint8Array | string); + 'clearBody'?: (boolean); + 'streamedResponse'?: (_envoy_service_ext_proc_v3_StreamedBodyResponse | null); + 'mutation'?: "body"|"clearBody"|"streamedResponse"; +} + +export interface BodyMutation__Output { + 'body'?: (Buffer); + 'clearBody'?: (boolean); + 'streamedResponse'?: (_envoy_service_ext_proc_v3_StreamedBodyResponse__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts new file mode 100644 index 00000000..77b2fca0 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { CommonResponse as _envoy_service_ext_proc_v3_CommonResponse, CommonResponse__Output as _envoy_service_ext_proc_v3_CommonResponse__Output } from './CommonResponse.js'; + +export interface BodyResponse { + 'response'?: (_envoy_service_ext_proc_v3_CommonResponse | null); +} + +export interface BodyResponse__Output { + 'response'?: (_envoy_service_ext_proc_v3_CommonResponse__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts new file mode 100644 index 00000000..da132b50 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts @@ -0,0 +1,36 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './HeaderMutation.js'; +import type { BodyMutation as _envoy_service_ext_proc_v3_BodyMutation, BodyMutation__Output as _envoy_service_ext_proc_v3_BodyMutation__Output } from './BodyMutation.js'; +import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from '../../../config/core/v3/HeaderMap.js'; + +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +export const _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus = { + CONTINUE: 0, + CONTINUE_AND_REPLACE: 1, +} as const; + +export type _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus = + | 'CONTINUE' + | 0 + | 'CONTINUE_AND_REPLACE' + | 1 + +export type _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus__Output = typeof _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus[keyof typeof _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus] + +export interface CommonResponse { + 'status'?: (_envoy_service_ext_proc_v3_CommonResponse_ResponseStatus); + 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation | null); + 'bodyMutation'?: (_envoy_service_ext_proc_v3_BodyMutation | null); + 'trailers'?: (_envoy_config_core_v3_HeaderMap | null); + 'clearRouteCache'?: (boolean); +} + +export interface CommonResponse__Output { + 'status'?: (_envoy_service_ext_proc_v3_CommonResponse_ResponseStatus__Output); + 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation__Output); + 'bodyMutation'?: (_envoy_service_ext_proc_v3_BodyMutation__Output); + 'trailers'?: (_envoy_config_core_v3_HeaderMap__Output); + 'clearRouteCache'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts new file mode 100644 index 00000000..61bec98c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts @@ -0,0 +1,23 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type * as grpc from '@grpc/grpc-js' +import type { MethodDefinition } from '@grpc/proto-loader' +import type { ProcessingRequest as _envoy_service_ext_proc_v3_ProcessingRequest, ProcessingRequest__Output as _envoy_service_ext_proc_v3_ProcessingRequest__Output } from './ProcessingRequest.js'; +import type { ProcessingResponse as _envoy_service_ext_proc_v3_ProcessingResponse, ProcessingResponse__Output as _envoy_service_ext_proc_v3_ProcessingResponse__Output } from './ProcessingResponse.js'; + +export interface ExternalProcessorClient extends grpc.Client { + Process(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; + Process(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; + process(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; + process(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; + +} + +export interface ExternalProcessorHandlers extends grpc.UntypedServiceImplementation { + Process: grpc.handleBidiStreamingCall<_envoy_service_ext_proc_v3_ProcessingRequest__Output, _envoy_service_ext_proc_v3_ProcessingResponse>; + +} + +export interface ExternalProcessorDefinition extends grpc.ServiceDefinition { + Process: MethodDefinition<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse, _envoy_service_ext_proc_v3_ProcessingRequest__Output, _envoy_service_ext_proc_v3_ProcessingResponse__Output> +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts new file mode 100644 index 00000000..45d500d0 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts @@ -0,0 +1,10 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + + +export interface GrpcStatus { + 'status'?: (number); +} + +export interface GrpcStatus__Output { + 'status'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts new file mode 100644 index 00000000..c5a04a65 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts @@ -0,0 +1,13 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HeaderValueOption as _envoy_config_core_v3_HeaderValueOption, HeaderValueOption__Output as _envoy_config_core_v3_HeaderValueOption__Output } from '../../../config/core/v3/HeaderValueOption.js'; + +export interface HeaderMutation { + 'setHeaders'?: (_envoy_config_core_v3_HeaderValueOption)[]; + 'removeHeaders'?: (string)[]; +} + +export interface HeaderMutation__Output { + 'setHeaders'?: (_envoy_config_core_v3_HeaderValueOption__Output)[]; + 'removeHeaders'?: (string)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts new file mode 100644 index 00000000..36a16dec --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { CommonResponse as _envoy_service_ext_proc_v3_CommonResponse, CommonResponse__Output as _envoy_service_ext_proc_v3_CommonResponse__Output } from './CommonResponse.js'; + +export interface HeadersResponse { + 'response'?: (_envoy_service_ext_proc_v3_CommonResponse | null); +} + +export interface HeadersResponse__Output { + 'response'?: (_envoy_service_ext_proc_v3_CommonResponse__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts new file mode 100644 index 00000000..49702a8e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + + +export interface HttpBody { + 'body'?: (Buffer | Uint8Array | string); + 'endOfStream'?: (boolean); +} + +export interface HttpBody__Output { + 'body'?: (Buffer); + 'endOfStream'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts new file mode 100644 index 00000000..9c239b14 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts @@ -0,0 +1,16 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from '../../../config/core/v3/HeaderMap.js'; +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; + +export interface HttpHeaders { + 'headers'?: (_envoy_config_core_v3_HeaderMap | null); + 'attributes'?: ({[key: string]: _google_protobuf_Struct}); + 'endOfStream'?: (boolean); +} + +export interface HttpHeaders__Output { + 'headers'?: (_envoy_config_core_v3_HeaderMap__Output); + 'attributes'?: ({[key: string]: _google_protobuf_Struct__Output}); + 'endOfStream'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts new file mode 100644 index 00000000..51fbecc4 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from '../../../config/core/v3/HeaderMap.js'; + +export interface HttpTrailers { + 'trailers'?: (_envoy_config_core_v3_HeaderMap | null); +} + +export interface HttpTrailers__Output { + 'trailers'?: (_envoy_config_core_v3_HeaderMap__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts new file mode 100644 index 00000000..e4d2bf3d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts @@ -0,0 +1,21 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HttpStatus as _envoy_type_v3_HttpStatus, HttpStatus__Output as _envoy_type_v3_HttpStatus__Output } from '../../../type/v3/HttpStatus.js'; +import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './HeaderMutation.js'; +import type { GrpcStatus as _envoy_service_ext_proc_v3_GrpcStatus, GrpcStatus__Output as _envoy_service_ext_proc_v3_GrpcStatus__Output } from './GrpcStatus.js'; + +export interface ImmediateResponse { + 'status'?: (_envoy_type_v3_HttpStatus | null); + 'headers'?: (_envoy_service_ext_proc_v3_HeaderMutation | null); + 'body'?: (Buffer | Uint8Array | string); + 'grpcStatus'?: (_envoy_service_ext_proc_v3_GrpcStatus | null); + 'details'?: (string); +} + +export interface ImmediateResponse__Output { + 'status'?: (_envoy_type_v3_HttpStatus__Output); + 'headers'?: (_envoy_service_ext_proc_v3_HeaderMutation__Output); + 'body'?: (Buffer); + 'grpcStatus'?: (_envoy_service_ext_proc_v3_GrpcStatus__Output); + 'details'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts new file mode 100644 index 00000000..85fc2c61 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts @@ -0,0 +1,35 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HttpHeaders as _envoy_service_ext_proc_v3_HttpHeaders, HttpHeaders__Output as _envoy_service_ext_proc_v3_HttpHeaders__Output } from './HttpHeaders.js'; +import type { HttpBody as _envoy_service_ext_proc_v3_HttpBody, HttpBody__Output as _envoy_service_ext_proc_v3_HttpBody__Output } from './HttpBody.js'; +import type { HttpTrailers as _envoy_service_ext_proc_v3_HttpTrailers, HttpTrailers__Output as _envoy_service_ext_proc_v3_HttpTrailers__Output } from './HttpTrailers.js'; +import type { Metadata as _envoy_config_core_v3_Metadata, Metadata__Output as _envoy_config_core_v3_Metadata__Output } from '../../../config/core/v3/Metadata.js'; +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; +import type { ProtocolConfiguration as _envoy_service_ext_proc_v3_ProtocolConfiguration, ProtocolConfiguration__Output as _envoy_service_ext_proc_v3_ProtocolConfiguration__Output } from './ProtocolConfiguration.js'; + +export interface ProcessingRequest { + 'requestHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders | null); + 'responseHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders | null); + 'requestBody'?: (_envoy_service_ext_proc_v3_HttpBody | null); + 'responseBody'?: (_envoy_service_ext_proc_v3_HttpBody | null); + 'requestTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers | null); + 'responseTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers | null); + 'metadataContext'?: (_envoy_config_core_v3_Metadata | null); + 'attributes'?: ({[key: string]: _google_protobuf_Struct}); + 'observabilityMode'?: (boolean); + 'protocolConfig'?: (_envoy_service_ext_proc_v3_ProtocolConfiguration | null); + 'request'?: "requestHeaders"|"responseHeaders"|"requestBody"|"responseBody"|"requestTrailers"|"responseTrailers"; +} + +export interface ProcessingRequest__Output { + 'requestHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders__Output); + 'responseHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders__Output); + 'requestBody'?: (_envoy_service_ext_proc_v3_HttpBody__Output); + 'responseBody'?: (_envoy_service_ext_proc_v3_HttpBody__Output); + 'requestTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers__Output); + 'responseTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers__Output); + 'metadataContext'?: (_envoy_config_core_v3_Metadata__Output); + 'attributes'?: ({[key: string]: _google_protobuf_Struct__Output}); + 'observabilityMode'?: (boolean); + 'protocolConfig'?: (_envoy_service_ext_proc_v3_ProtocolConfiguration__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts new file mode 100644 index 00000000..b973f430 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts @@ -0,0 +1,36 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HeadersResponse as _envoy_service_ext_proc_v3_HeadersResponse, HeadersResponse__Output as _envoy_service_ext_proc_v3_HeadersResponse__Output } from './HeadersResponse.js'; +import type { BodyResponse as _envoy_service_ext_proc_v3_BodyResponse, BodyResponse__Output as _envoy_service_ext_proc_v3_BodyResponse__Output } from './BodyResponse.js'; +import type { TrailersResponse as _envoy_service_ext_proc_v3_TrailersResponse, TrailersResponse__Output as _envoy_service_ext_proc_v3_TrailersResponse__Output } from './TrailersResponse.js'; +import type { ImmediateResponse as _envoy_service_ext_proc_v3_ImmediateResponse, ImmediateResponse__Output as _envoy_service_ext_proc_v3_ImmediateResponse__Output } from './ImmediateResponse.js'; +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; +import type { ProcessingMode as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode, ProcessingMode__Output as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output } from '../../../extensions/filters/http/ext_proc/v3/ProcessingMode.js'; +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration.js'; + +export interface ProcessingResponse { + 'requestHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse | null); + 'responseHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse | null); + 'requestBody'?: (_envoy_service_ext_proc_v3_BodyResponse | null); + 'responseBody'?: (_envoy_service_ext_proc_v3_BodyResponse | null); + 'requestTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse | null); + 'responseTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse | null); + 'immediateResponse'?: (_envoy_service_ext_proc_v3_ImmediateResponse | null); + 'dynamicMetadata'?: (_google_protobuf_Struct | null); + 'modeOverride'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode | null); + 'overrideMessageTimeout'?: (_google_protobuf_Duration | null); + 'response'?: "requestHeaders"|"responseHeaders"|"requestBody"|"responseBody"|"requestTrailers"|"responseTrailers"|"immediateResponse"; +} + +export interface ProcessingResponse__Output { + 'requestHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse__Output); + 'responseHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse__Output); + 'requestBody'?: (_envoy_service_ext_proc_v3_BodyResponse__Output); + 'responseBody'?: (_envoy_service_ext_proc_v3_BodyResponse__Output); + 'requestTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse__Output); + 'responseTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse__Output); + 'immediateResponse'?: (_envoy_service_ext_proc_v3_ImmediateResponse__Output); + 'dynamicMetadata'?: (_google_protobuf_Struct__Output); + 'modeOverride'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output); + 'overrideMessageTimeout'?: (_google_protobuf_Duration__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts new file mode 100644 index 00000000..7c6b1d88 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts @@ -0,0 +1,15 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode, _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output } from '../../../extensions/filters/http/ext_proc/v3/ProcessingMode.js'; + +export interface ProtocolConfiguration { + 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); + 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); + 'sendBodyWithoutWaitingForHeaderResponse'?: (boolean); +} + +export interface ProtocolConfiguration__Output { + 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); + 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); + 'sendBodyWithoutWaitingForHeaderResponse'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts new file mode 100644 index 00000000..1b1d3e69 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts @@ -0,0 +1,12 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + + +export interface StreamedBodyResponse { + 'body'?: (Buffer | Uint8Array | string); + 'endOfStream'?: (boolean); +} + +export interface StreamedBodyResponse__Output { + 'body'?: (Buffer); + 'endOfStream'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts new file mode 100644 index 00000000..319ce0d1 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto + +import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './HeaderMutation.js'; + +export interface TrailersResponse { + 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation | null); +} + +export interface TrailersResponse__Output { + 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts new file mode 100644 index 00000000..9d899036 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts @@ -0,0 +1,30 @@ +// Original file: ../../../envoy/api/envoy/type/v3/percent.proto + + +// Original file: ../../../envoy/api/envoy/type/v3/percent.proto + +export const _envoy_type_v3_FractionalPercent_DenominatorType = { + HUNDRED: 0, + TEN_THOUSAND: 1, + MILLION: 2, +} as const; + +export type _envoy_type_v3_FractionalPercent_DenominatorType = + | 'HUNDRED' + | 0 + | 'TEN_THOUSAND' + | 1 + | 'MILLION' + | 2 + +export type _envoy_type_v3_FractionalPercent_DenominatorType__Output = typeof _envoy_type_v3_FractionalPercent_DenominatorType[keyof typeof _envoy_type_v3_FractionalPercent_DenominatorType] + +export interface FractionalPercent { + 'numerator'?: (number); + 'denominator'?: (_envoy_type_v3_FractionalPercent_DenominatorType); +} + +export interface FractionalPercent__Output { + 'numerator'?: (number); + 'denominator'?: (_envoy_type_v3_FractionalPercent_DenominatorType__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts new file mode 100644 index 00000000..f9decd96 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts @@ -0,0 +1,11 @@ +// Original file: ../../../envoy/api/envoy/type/v3/http_status.proto + +import type { StatusCode as _envoy_type_v3_StatusCode, StatusCode__Output as _envoy_type_v3_StatusCode__Output } from './StatusCode.js'; + +export interface HttpStatus { + 'code'?: (_envoy_type_v3_StatusCode); +} + +export interface HttpStatus__Output { + 'code'?: (_envoy_type_v3_StatusCode__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts new file mode 100644 index 00000000..08911c28 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts @@ -0,0 +1,10 @@ +// Original file: ../../../envoy/api/envoy/type/v3/percent.proto + + +export interface Percent { + 'value'?: (number | string); +} + +export interface Percent__Output { + 'value'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts new file mode 100644 index 00000000..a7804638 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts @@ -0,0 +1,14 @@ +// Original file: ../../../envoy/api/envoy/type/v3/semantic_version.proto + + +export interface SemanticVersion { + 'majorNumber'?: (number); + 'minorNumber'?: (number); + 'patch'?: (number); +} + +export interface SemanticVersion__Output { + 'majorNumber'?: (number); + 'minorNumber'?: (number); + 'patch'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts new file mode 100644 index 00000000..16d3d146 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts @@ -0,0 +1,179 @@ +// Original file: ../../../envoy/api/envoy/type/v3/http_status.proto + +export const StatusCode = { + Empty: 0, + Continue: 100, + OK: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + IMUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + URITooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HTTPVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +} as const; + +export type StatusCode = + | 'Empty' + | 0 + | 'Continue' + | 100 + | 'OK' + | 200 + | 'Created' + | 201 + | 'Accepted' + | 202 + | 'NonAuthoritativeInformation' + | 203 + | 'NoContent' + | 204 + | 'ResetContent' + | 205 + | 'PartialContent' + | 206 + | 'MultiStatus' + | 207 + | 'AlreadyReported' + | 208 + | 'IMUsed' + | 226 + | 'MultipleChoices' + | 300 + | 'MovedPermanently' + | 301 + | 'Found' + | 302 + | 'SeeOther' + | 303 + | 'NotModified' + | 304 + | 'UseProxy' + | 305 + | 'TemporaryRedirect' + | 307 + | 'PermanentRedirect' + | 308 + | 'BadRequest' + | 400 + | 'Unauthorized' + | 401 + | 'PaymentRequired' + | 402 + | 'Forbidden' + | 403 + | 'NotFound' + | 404 + | 'MethodNotAllowed' + | 405 + | 'NotAcceptable' + | 406 + | 'ProxyAuthenticationRequired' + | 407 + | 'RequestTimeout' + | 408 + | 'Conflict' + | 409 + | 'Gone' + | 410 + | 'LengthRequired' + | 411 + | 'PreconditionFailed' + | 412 + | 'PayloadTooLarge' + | 413 + | 'URITooLong' + | 414 + | 'UnsupportedMediaType' + | 415 + | 'RangeNotSatisfiable' + | 416 + | 'ExpectationFailed' + | 417 + | 'MisdirectedRequest' + | 421 + | 'UnprocessableEntity' + | 422 + | 'Locked' + | 423 + | 'FailedDependency' + | 424 + | 'UpgradeRequired' + | 426 + | 'PreconditionRequired' + | 428 + | 'TooManyRequests' + | 429 + | 'RequestHeaderFieldsTooLarge' + | 431 + | 'InternalServerError' + | 500 + | 'NotImplemented' + | 501 + | 'BadGateway' + | 502 + | 'ServiceUnavailable' + | 503 + | 'GatewayTimeout' + | 504 + | 'HTTPVersionNotSupported' + | 505 + | 'VariantAlsoNegotiates' + | 506 + | 'InsufficientStorage' + | 507 + | 'LoopDetected' + | 508 + | 'NotExtended' + | 510 + | 'NetworkAuthenticationRequired' + | 511 + +export type StatusCode__Output = typeof StatusCode[keyof typeof StatusCode] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts new file mode 100644 index 00000000..b6f55d9e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts @@ -0,0 +1,331 @@ +import type * as grpc from '@grpc/grpc-js'; +import type { EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader'; + +import type { Address as _envoy_config_core_v3_Address, Address__Output as _envoy_config_core_v3_Address__Output } from './envoy/config/core/v3/Address.js'; +import type { AsyncDataSource as _envoy_config_core_v3_AsyncDataSource, AsyncDataSource__Output as _envoy_config_core_v3_AsyncDataSource__Output } from './envoy/config/core/v3/AsyncDataSource.js'; +import type { BackoffStrategy as _envoy_config_core_v3_BackoffStrategy, BackoffStrategy__Output as _envoy_config_core_v3_BackoffStrategy__Output } from './envoy/config/core/v3/BackoffStrategy.js'; +import type { BindConfig as _envoy_config_core_v3_BindConfig, BindConfig__Output as _envoy_config_core_v3_BindConfig__Output } from './envoy/config/core/v3/BindConfig.js'; +import type { BuildVersion as _envoy_config_core_v3_BuildVersion, BuildVersion__Output as _envoy_config_core_v3_BuildVersion__Output } from './envoy/config/core/v3/BuildVersion.js'; +import type { CidrRange as _envoy_config_core_v3_CidrRange, CidrRange__Output as _envoy_config_core_v3_CidrRange__Output } from './envoy/config/core/v3/CidrRange.js'; +import type { ControlPlane as _envoy_config_core_v3_ControlPlane, ControlPlane__Output as _envoy_config_core_v3_ControlPlane__Output } from './envoy/config/core/v3/ControlPlane.js'; +import type { DataSource as _envoy_config_core_v3_DataSource, DataSource__Output as _envoy_config_core_v3_DataSource__Output } from './envoy/config/core/v3/DataSource.js'; +import type { EnvoyInternalAddress as _envoy_config_core_v3_EnvoyInternalAddress, EnvoyInternalAddress__Output as _envoy_config_core_v3_EnvoyInternalAddress__Output } from './envoy/config/core/v3/EnvoyInternalAddress.js'; +import type { Extension as _envoy_config_core_v3_Extension, Extension__Output as _envoy_config_core_v3_Extension__Output } from './envoy/config/core/v3/Extension.js'; +import type { ExtraSourceAddress as _envoy_config_core_v3_ExtraSourceAddress, ExtraSourceAddress__Output as _envoy_config_core_v3_ExtraSourceAddress__Output } from './envoy/config/core/v3/ExtraSourceAddress.js'; +import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from './envoy/config/core/v3/HeaderMap.js'; +import type { HeaderValue as _envoy_config_core_v3_HeaderValue, HeaderValue__Output as _envoy_config_core_v3_HeaderValue__Output } from './envoy/config/core/v3/HeaderValue.js'; +import type { HeaderValueOption as _envoy_config_core_v3_HeaderValueOption, HeaderValueOption__Output as _envoy_config_core_v3_HeaderValueOption__Output } from './envoy/config/core/v3/HeaderValueOption.js'; +import type { HttpUri as _envoy_config_core_v3_HttpUri, HttpUri__Output as _envoy_config_core_v3_HttpUri__Output } from './envoy/config/core/v3/HttpUri.js'; +import type { KeyValue as _envoy_config_core_v3_KeyValue, KeyValue__Output as _envoy_config_core_v3_KeyValue__Output } from './envoy/config/core/v3/KeyValue.js'; +import type { KeyValueAppend as _envoy_config_core_v3_KeyValueAppend, KeyValueAppend__Output as _envoy_config_core_v3_KeyValueAppend__Output } from './envoy/config/core/v3/KeyValueAppend.js'; +import type { KeyValueMutation as _envoy_config_core_v3_KeyValueMutation, KeyValueMutation__Output as _envoy_config_core_v3_KeyValueMutation__Output } from './envoy/config/core/v3/KeyValueMutation.js'; +import type { KeyValuePair as _envoy_config_core_v3_KeyValuePair, KeyValuePair__Output as _envoy_config_core_v3_KeyValuePair__Output } from './envoy/config/core/v3/KeyValuePair.js'; +import type { Locality as _envoy_config_core_v3_Locality, Locality__Output as _envoy_config_core_v3_Locality__Output } from './envoy/config/core/v3/Locality.js'; +import type { Metadata as _envoy_config_core_v3_Metadata, Metadata__Output as _envoy_config_core_v3_Metadata__Output } from './envoy/config/core/v3/Metadata.js'; +import type { Node as _envoy_config_core_v3_Node, Node__Output as _envoy_config_core_v3_Node__Output } from './envoy/config/core/v3/Node.js'; +import type { Pipe as _envoy_config_core_v3_Pipe, Pipe__Output as _envoy_config_core_v3_Pipe__Output } from './envoy/config/core/v3/Pipe.js'; +import type { QueryParameter as _envoy_config_core_v3_QueryParameter, QueryParameter__Output as _envoy_config_core_v3_QueryParameter__Output } from './envoy/config/core/v3/QueryParameter.js'; +import type { RemoteDataSource as _envoy_config_core_v3_RemoteDataSource, RemoteDataSource__Output as _envoy_config_core_v3_RemoteDataSource__Output } from './envoy/config/core/v3/RemoteDataSource.js'; +import type { RetryPolicy as _envoy_config_core_v3_RetryPolicy, RetryPolicy__Output as _envoy_config_core_v3_RetryPolicy__Output } from './envoy/config/core/v3/RetryPolicy.js'; +import type { RuntimeDouble as _envoy_config_core_v3_RuntimeDouble, RuntimeDouble__Output as _envoy_config_core_v3_RuntimeDouble__Output } from './envoy/config/core/v3/RuntimeDouble.js'; +import type { RuntimeFeatureFlag as _envoy_config_core_v3_RuntimeFeatureFlag, RuntimeFeatureFlag__Output as _envoy_config_core_v3_RuntimeFeatureFlag__Output } from './envoy/config/core/v3/RuntimeFeatureFlag.js'; +import type { RuntimeFractionalPercent as _envoy_config_core_v3_RuntimeFractionalPercent, RuntimeFractionalPercent__Output as _envoy_config_core_v3_RuntimeFractionalPercent__Output } from './envoy/config/core/v3/RuntimeFractionalPercent.js'; +import type { RuntimePercent as _envoy_config_core_v3_RuntimePercent, RuntimePercent__Output as _envoy_config_core_v3_RuntimePercent__Output } from './envoy/config/core/v3/RuntimePercent.js'; +import type { RuntimeUInt32 as _envoy_config_core_v3_RuntimeUInt32, RuntimeUInt32__Output as _envoy_config_core_v3_RuntimeUInt32__Output } from './envoy/config/core/v3/RuntimeUInt32.js'; +import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './envoy/config/core/v3/SocketAddress.js'; +import type { SocketOption as _envoy_config_core_v3_SocketOption, SocketOption__Output as _envoy_config_core_v3_SocketOption__Output } from './envoy/config/core/v3/SocketOption.js'; +import type { SocketOptionsOverride as _envoy_config_core_v3_SocketOptionsOverride, SocketOptionsOverride__Output as _envoy_config_core_v3_SocketOptionsOverride__Output } from './envoy/config/core/v3/SocketOptionsOverride.js'; +import type { TcpKeepalive as _envoy_config_core_v3_TcpKeepalive, TcpKeepalive__Output as _envoy_config_core_v3_TcpKeepalive__Output } from './envoy/config/core/v3/TcpKeepalive.js'; +import type { TransportSocket as _envoy_config_core_v3_TransportSocket, TransportSocket__Output as _envoy_config_core_v3_TransportSocket__Output } from './envoy/config/core/v3/TransportSocket.js'; +import type { TypedExtensionConfig as _envoy_config_core_v3_TypedExtensionConfig, TypedExtensionConfig__Output as _envoy_config_core_v3_TypedExtensionConfig__Output } from './envoy/config/core/v3/TypedExtensionConfig.js'; +import type { WatchedDirectory as _envoy_config_core_v3_WatchedDirectory, WatchedDirectory__Output as _envoy_config_core_v3_WatchedDirectory__Output } from './envoy/config/core/v3/WatchedDirectory.js'; +import type { ProcessingMode as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode, ProcessingMode__Output as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output } from './envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.js'; +import type { BodyMutation as _envoy_service_ext_proc_v3_BodyMutation, BodyMutation__Output as _envoy_service_ext_proc_v3_BodyMutation__Output } from './envoy/service/ext_proc/v3/BodyMutation.js'; +import type { BodyResponse as _envoy_service_ext_proc_v3_BodyResponse, BodyResponse__Output as _envoy_service_ext_proc_v3_BodyResponse__Output } from './envoy/service/ext_proc/v3/BodyResponse.js'; +import type { CommonResponse as _envoy_service_ext_proc_v3_CommonResponse, CommonResponse__Output as _envoy_service_ext_proc_v3_CommonResponse__Output } from './envoy/service/ext_proc/v3/CommonResponse.js'; +import type { ExternalProcessorClient as _envoy_service_ext_proc_v3_ExternalProcessorClient, ExternalProcessorDefinition as _envoy_service_ext_proc_v3_ExternalProcessorDefinition } from './envoy/service/ext_proc/v3/ExternalProcessor.js'; +import type { GrpcStatus as _envoy_service_ext_proc_v3_GrpcStatus, GrpcStatus__Output as _envoy_service_ext_proc_v3_GrpcStatus__Output } from './envoy/service/ext_proc/v3/GrpcStatus.js'; +import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './envoy/service/ext_proc/v3/HeaderMutation.js'; +import type { HeadersResponse as _envoy_service_ext_proc_v3_HeadersResponse, HeadersResponse__Output as _envoy_service_ext_proc_v3_HeadersResponse__Output } from './envoy/service/ext_proc/v3/HeadersResponse.js'; +import type { HttpBody as _envoy_service_ext_proc_v3_HttpBody, HttpBody__Output as _envoy_service_ext_proc_v3_HttpBody__Output } from './envoy/service/ext_proc/v3/HttpBody.js'; +import type { HttpHeaders as _envoy_service_ext_proc_v3_HttpHeaders, HttpHeaders__Output as _envoy_service_ext_proc_v3_HttpHeaders__Output } from './envoy/service/ext_proc/v3/HttpHeaders.js'; +import type { HttpTrailers as _envoy_service_ext_proc_v3_HttpTrailers, HttpTrailers__Output as _envoy_service_ext_proc_v3_HttpTrailers__Output } from './envoy/service/ext_proc/v3/HttpTrailers.js'; +import type { ImmediateResponse as _envoy_service_ext_proc_v3_ImmediateResponse, ImmediateResponse__Output as _envoy_service_ext_proc_v3_ImmediateResponse__Output } from './envoy/service/ext_proc/v3/ImmediateResponse.js'; +import type { ProcessingRequest as _envoy_service_ext_proc_v3_ProcessingRequest, ProcessingRequest__Output as _envoy_service_ext_proc_v3_ProcessingRequest__Output } from './envoy/service/ext_proc/v3/ProcessingRequest.js'; +import type { ProcessingResponse as _envoy_service_ext_proc_v3_ProcessingResponse, ProcessingResponse__Output as _envoy_service_ext_proc_v3_ProcessingResponse__Output } from './envoy/service/ext_proc/v3/ProcessingResponse.js'; +import type { ProtocolConfiguration as _envoy_service_ext_proc_v3_ProtocolConfiguration, ProtocolConfiguration__Output as _envoy_service_ext_proc_v3_ProtocolConfiguration__Output } from './envoy/service/ext_proc/v3/ProtocolConfiguration.js'; +import type { StreamedBodyResponse as _envoy_service_ext_proc_v3_StreamedBodyResponse, StreamedBodyResponse__Output as _envoy_service_ext_proc_v3_StreamedBodyResponse__Output } from './envoy/service/ext_proc/v3/StreamedBodyResponse.js'; +import type { TrailersResponse as _envoy_service_ext_proc_v3_TrailersResponse, TrailersResponse__Output as _envoy_service_ext_proc_v3_TrailersResponse__Output } from './envoy/service/ext_proc/v3/TrailersResponse.js'; +import type { FractionalPercent as _envoy_type_v3_FractionalPercent, FractionalPercent__Output as _envoy_type_v3_FractionalPercent__Output } from './envoy/type/v3/FractionalPercent.js'; +import type { HttpStatus as _envoy_type_v3_HttpStatus, HttpStatus__Output as _envoy_type_v3_HttpStatus__Output } from './envoy/type/v3/HttpStatus.js'; +import type { Percent as _envoy_type_v3_Percent, Percent__Output as _envoy_type_v3_Percent__Output } from './envoy/type/v3/Percent.js'; +import type { SemanticVersion as _envoy_type_v3_SemanticVersion, SemanticVersion__Output as _envoy_type_v3_SemanticVersion__Output } from './envoy/type/v3/SemanticVersion.js'; +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from './google/protobuf/Any.js'; +import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from './google/protobuf/BoolValue.js'; +import type { BytesValue as _google_protobuf_BytesValue, BytesValue__Output as _google_protobuf_BytesValue__Output } from './google/protobuf/BytesValue.js'; +import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './google/protobuf/DescriptorProto.js'; +import type { DoubleValue as _google_protobuf_DoubleValue, DoubleValue__Output as _google_protobuf_DoubleValue__Output } from './google/protobuf/DoubleValue.js'; +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from './google/protobuf/Duration.js'; +import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './google/protobuf/EnumDescriptorProto.js'; +import type { EnumOptions as _google_protobuf_EnumOptions, EnumOptions__Output as _google_protobuf_EnumOptions__Output } from './google/protobuf/EnumOptions.js'; +import type { EnumValueDescriptorProto as _google_protobuf_EnumValueDescriptorProto, EnumValueDescriptorProto__Output as _google_protobuf_EnumValueDescriptorProto__Output } from './google/protobuf/EnumValueDescriptorProto.js'; +import type { EnumValueOptions as _google_protobuf_EnumValueOptions, EnumValueOptions__Output as _google_protobuf_EnumValueOptions__Output } from './google/protobuf/EnumValueOptions.js'; +import type { ExtensionRangeOptions as _google_protobuf_ExtensionRangeOptions, ExtensionRangeOptions__Output as _google_protobuf_ExtensionRangeOptions__Output } from './google/protobuf/ExtensionRangeOptions.js'; +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './google/protobuf/FeatureSet.js'; +import type { FeatureSetDefaults as _google_protobuf_FeatureSetDefaults, FeatureSetDefaults__Output as _google_protobuf_FeatureSetDefaults__Output } from './google/protobuf/FeatureSetDefaults.js'; +import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './google/protobuf/FieldDescriptorProto.js'; +import type { FieldOptions as _google_protobuf_FieldOptions, FieldOptions__Output as _google_protobuf_FieldOptions__Output } from './google/protobuf/FieldOptions.js'; +import type { FileDescriptorProto as _google_protobuf_FileDescriptorProto, FileDescriptorProto__Output as _google_protobuf_FileDescriptorProto__Output } from './google/protobuf/FileDescriptorProto.js'; +import type { FileDescriptorSet as _google_protobuf_FileDescriptorSet, FileDescriptorSet__Output as _google_protobuf_FileDescriptorSet__Output } from './google/protobuf/FileDescriptorSet.js'; +import type { FileOptions as _google_protobuf_FileOptions, FileOptions__Output as _google_protobuf_FileOptions__Output } from './google/protobuf/FileOptions.js'; +import type { FloatValue as _google_protobuf_FloatValue, FloatValue__Output as _google_protobuf_FloatValue__Output } from './google/protobuf/FloatValue.js'; +import type { GeneratedCodeInfo as _google_protobuf_GeneratedCodeInfo, GeneratedCodeInfo__Output as _google_protobuf_GeneratedCodeInfo__Output } from './google/protobuf/GeneratedCodeInfo.js'; +import type { Int32Value as _google_protobuf_Int32Value, Int32Value__Output as _google_protobuf_Int32Value__Output } from './google/protobuf/Int32Value.js'; +import type { Int64Value as _google_protobuf_Int64Value, Int64Value__Output as _google_protobuf_Int64Value__Output } from './google/protobuf/Int64Value.js'; +import type { ListValue as _google_protobuf_ListValue, ListValue__Output as _google_protobuf_ListValue__Output } from './google/protobuf/ListValue.js'; +import type { MessageOptions as _google_protobuf_MessageOptions, MessageOptions__Output as _google_protobuf_MessageOptions__Output } from './google/protobuf/MessageOptions.js'; +import type { MethodDescriptorProto as _google_protobuf_MethodDescriptorProto, MethodDescriptorProto__Output as _google_protobuf_MethodDescriptorProto__Output } from './google/protobuf/MethodDescriptorProto.js'; +import type { MethodOptions as _google_protobuf_MethodOptions, MethodOptions__Output as _google_protobuf_MethodOptions__Output } from './google/protobuf/MethodOptions.js'; +import type { OneofDescriptorProto as _google_protobuf_OneofDescriptorProto, OneofDescriptorProto__Output as _google_protobuf_OneofDescriptorProto__Output } from './google/protobuf/OneofDescriptorProto.js'; +import type { OneofOptions as _google_protobuf_OneofOptions, OneofOptions__Output as _google_protobuf_OneofOptions__Output } from './google/protobuf/OneofOptions.js'; +import type { ServiceDescriptorProto as _google_protobuf_ServiceDescriptorProto, ServiceDescriptorProto__Output as _google_protobuf_ServiceDescriptorProto__Output } from './google/protobuf/ServiceDescriptorProto.js'; +import type { ServiceOptions as _google_protobuf_ServiceOptions, ServiceOptions__Output as _google_protobuf_ServiceOptions__Output } from './google/protobuf/ServiceOptions.js'; +import type { SourceCodeInfo as _google_protobuf_SourceCodeInfo, SourceCodeInfo__Output as _google_protobuf_SourceCodeInfo__Output } from './google/protobuf/SourceCodeInfo.js'; +import type { StringValue as _google_protobuf_StringValue, StringValue__Output as _google_protobuf_StringValue__Output } from './google/protobuf/StringValue.js'; +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from './google/protobuf/Struct.js'; +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from './google/protobuf/Timestamp.js'; +import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from './google/protobuf/UInt32Value.js'; +import type { UInt64Value as _google_protobuf_UInt64Value, UInt64Value__Output as _google_protobuf_UInt64Value__Output } from './google/protobuf/UInt64Value.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './google/protobuf/UninterpretedOption.js'; +import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from './google/protobuf/Value.js'; +import type { FieldMigrateAnnotation as _udpa_annotations_FieldMigrateAnnotation, FieldMigrateAnnotation__Output as _udpa_annotations_FieldMigrateAnnotation__Output } from './udpa/annotations/FieldMigrateAnnotation.js'; +import type { FileMigrateAnnotation as _udpa_annotations_FileMigrateAnnotation, FileMigrateAnnotation__Output as _udpa_annotations_FileMigrateAnnotation__Output } from './udpa/annotations/FileMigrateAnnotation.js'; +import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from './udpa/annotations/MigrateAnnotation.js'; +import type { StatusAnnotation as _udpa_annotations_StatusAnnotation, StatusAnnotation__Output as _udpa_annotations_StatusAnnotation__Output } from './udpa/annotations/StatusAnnotation.js'; +import type { VersioningAnnotation as _udpa_annotations_VersioningAnnotation, VersioningAnnotation__Output as _udpa_annotations_VersioningAnnotation__Output } from './udpa/annotations/VersioningAnnotation.js'; +import type { AnyRules as _validate_AnyRules, AnyRules__Output as _validate_AnyRules__Output } from './validate/AnyRules.js'; +import type { BoolRules as _validate_BoolRules, BoolRules__Output as _validate_BoolRules__Output } from './validate/BoolRules.js'; +import type { BytesRules as _validate_BytesRules, BytesRules__Output as _validate_BytesRules__Output } from './validate/BytesRules.js'; +import type { DoubleRules as _validate_DoubleRules, DoubleRules__Output as _validate_DoubleRules__Output } from './validate/DoubleRules.js'; +import type { DurationRules as _validate_DurationRules, DurationRules__Output as _validate_DurationRules__Output } from './validate/DurationRules.js'; +import type { EnumRules as _validate_EnumRules, EnumRules__Output as _validate_EnumRules__Output } from './validate/EnumRules.js'; +import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './validate/FieldRules.js'; +import type { Fixed32Rules as _validate_Fixed32Rules, Fixed32Rules__Output as _validate_Fixed32Rules__Output } from './validate/Fixed32Rules.js'; +import type { Fixed64Rules as _validate_Fixed64Rules, Fixed64Rules__Output as _validate_Fixed64Rules__Output } from './validate/Fixed64Rules.js'; +import type { FloatRules as _validate_FloatRules, FloatRules__Output as _validate_FloatRules__Output } from './validate/FloatRules.js'; +import type { Int32Rules as _validate_Int32Rules, Int32Rules__Output as _validate_Int32Rules__Output } from './validate/Int32Rules.js'; +import type { Int64Rules as _validate_Int64Rules, Int64Rules__Output as _validate_Int64Rules__Output } from './validate/Int64Rules.js'; +import type { MapRules as _validate_MapRules, MapRules__Output as _validate_MapRules__Output } from './validate/MapRules.js'; +import type { MessageRules as _validate_MessageRules, MessageRules__Output as _validate_MessageRules__Output } from './validate/MessageRules.js'; +import type { RepeatedRules as _validate_RepeatedRules, RepeatedRules__Output as _validate_RepeatedRules__Output } from './validate/RepeatedRules.js'; +import type { SFixed32Rules as _validate_SFixed32Rules, SFixed32Rules__Output as _validate_SFixed32Rules__Output } from './validate/SFixed32Rules.js'; +import type { SFixed64Rules as _validate_SFixed64Rules, SFixed64Rules__Output as _validate_SFixed64Rules__Output } from './validate/SFixed64Rules.js'; +import type { SInt32Rules as _validate_SInt32Rules, SInt32Rules__Output as _validate_SInt32Rules__Output } from './validate/SInt32Rules.js'; +import type { SInt64Rules as _validate_SInt64Rules, SInt64Rules__Output as _validate_SInt64Rules__Output } from './validate/SInt64Rules.js'; +import type { StringRules as _validate_StringRules, StringRules__Output as _validate_StringRules__Output } from './validate/StringRules.js'; +import type { TimestampRules as _validate_TimestampRules, TimestampRules__Output as _validate_TimestampRules__Output } from './validate/TimestampRules.js'; +import type { UInt32Rules as _validate_UInt32Rules, UInt32Rules__Output as _validate_UInt32Rules__Output } from './validate/UInt32Rules.js'; +import type { UInt64Rules as _validate_UInt64Rules, UInt64Rules__Output as _validate_UInt64Rules__Output } from './validate/UInt64Rules.js'; +import type { FieldStatusAnnotation as _xds_annotations_v3_FieldStatusAnnotation, FieldStatusAnnotation__Output as _xds_annotations_v3_FieldStatusAnnotation__Output } from './xds/annotations/v3/FieldStatusAnnotation.js'; +import type { FileStatusAnnotation as _xds_annotations_v3_FileStatusAnnotation, FileStatusAnnotation__Output as _xds_annotations_v3_FileStatusAnnotation__Output } from './xds/annotations/v3/FileStatusAnnotation.js'; +import type { MessageStatusAnnotation as _xds_annotations_v3_MessageStatusAnnotation, MessageStatusAnnotation__Output as _xds_annotations_v3_MessageStatusAnnotation__Output } from './xds/annotations/v3/MessageStatusAnnotation.js'; +import type { StatusAnnotation as _xds_annotations_v3_StatusAnnotation, StatusAnnotation__Output as _xds_annotations_v3_StatusAnnotation__Output } from './xds/annotations/v3/StatusAnnotation.js'; +import type { ContextParams as _xds_core_v3_ContextParams, ContextParams__Output as _xds_core_v3_ContextParams__Output } from './xds/core/v3/ContextParams.js'; + +type SubtypeConstructor any, Subtype> = { + new(...args: ConstructorParameters): Subtype; +}; + +export interface ProtoGrpcType { + envoy: { + annotations: { + } + config: { + core: { + v3: { + Address: MessageTypeDefinition<_envoy_config_core_v3_Address, _envoy_config_core_v3_Address__Output> + AsyncDataSource: MessageTypeDefinition<_envoy_config_core_v3_AsyncDataSource, _envoy_config_core_v3_AsyncDataSource__Output> + BackoffStrategy: MessageTypeDefinition<_envoy_config_core_v3_BackoffStrategy, _envoy_config_core_v3_BackoffStrategy__Output> + BindConfig: MessageTypeDefinition<_envoy_config_core_v3_BindConfig, _envoy_config_core_v3_BindConfig__Output> + BuildVersion: MessageTypeDefinition<_envoy_config_core_v3_BuildVersion, _envoy_config_core_v3_BuildVersion__Output> + CidrRange: MessageTypeDefinition<_envoy_config_core_v3_CidrRange, _envoy_config_core_v3_CidrRange__Output> + ControlPlane: MessageTypeDefinition<_envoy_config_core_v3_ControlPlane, _envoy_config_core_v3_ControlPlane__Output> + DataSource: MessageTypeDefinition<_envoy_config_core_v3_DataSource, _envoy_config_core_v3_DataSource__Output> + EnvoyInternalAddress: MessageTypeDefinition<_envoy_config_core_v3_EnvoyInternalAddress, _envoy_config_core_v3_EnvoyInternalAddress__Output> + Extension: MessageTypeDefinition<_envoy_config_core_v3_Extension, _envoy_config_core_v3_Extension__Output> + ExtraSourceAddress: MessageTypeDefinition<_envoy_config_core_v3_ExtraSourceAddress, _envoy_config_core_v3_ExtraSourceAddress__Output> + HeaderMap: MessageTypeDefinition<_envoy_config_core_v3_HeaderMap, _envoy_config_core_v3_HeaderMap__Output> + HeaderValue: MessageTypeDefinition<_envoy_config_core_v3_HeaderValue, _envoy_config_core_v3_HeaderValue__Output> + HeaderValueOption: MessageTypeDefinition<_envoy_config_core_v3_HeaderValueOption, _envoy_config_core_v3_HeaderValueOption__Output> + HttpUri: MessageTypeDefinition<_envoy_config_core_v3_HttpUri, _envoy_config_core_v3_HttpUri__Output> + KeyValue: MessageTypeDefinition<_envoy_config_core_v3_KeyValue, _envoy_config_core_v3_KeyValue__Output> + KeyValueAppend: MessageTypeDefinition<_envoy_config_core_v3_KeyValueAppend, _envoy_config_core_v3_KeyValueAppend__Output> + KeyValueMutation: MessageTypeDefinition<_envoy_config_core_v3_KeyValueMutation, _envoy_config_core_v3_KeyValueMutation__Output> + KeyValuePair: MessageTypeDefinition<_envoy_config_core_v3_KeyValuePair, _envoy_config_core_v3_KeyValuePair__Output> + Locality: MessageTypeDefinition<_envoy_config_core_v3_Locality, _envoy_config_core_v3_Locality__Output> + Metadata: MessageTypeDefinition<_envoy_config_core_v3_Metadata, _envoy_config_core_v3_Metadata__Output> + Node: MessageTypeDefinition<_envoy_config_core_v3_Node, _envoy_config_core_v3_Node__Output> + Pipe: MessageTypeDefinition<_envoy_config_core_v3_Pipe, _envoy_config_core_v3_Pipe__Output> + QueryParameter: MessageTypeDefinition<_envoy_config_core_v3_QueryParameter, _envoy_config_core_v3_QueryParameter__Output> + RemoteDataSource: MessageTypeDefinition<_envoy_config_core_v3_RemoteDataSource, _envoy_config_core_v3_RemoteDataSource__Output> + RequestMethod: EnumTypeDefinition + RetryPolicy: MessageTypeDefinition<_envoy_config_core_v3_RetryPolicy, _envoy_config_core_v3_RetryPolicy__Output> + RoutingPriority: EnumTypeDefinition + RuntimeDouble: MessageTypeDefinition<_envoy_config_core_v3_RuntimeDouble, _envoy_config_core_v3_RuntimeDouble__Output> + RuntimeFeatureFlag: MessageTypeDefinition<_envoy_config_core_v3_RuntimeFeatureFlag, _envoy_config_core_v3_RuntimeFeatureFlag__Output> + RuntimeFractionalPercent: MessageTypeDefinition<_envoy_config_core_v3_RuntimeFractionalPercent, _envoy_config_core_v3_RuntimeFractionalPercent__Output> + RuntimePercent: MessageTypeDefinition<_envoy_config_core_v3_RuntimePercent, _envoy_config_core_v3_RuntimePercent__Output> + RuntimeUInt32: MessageTypeDefinition<_envoy_config_core_v3_RuntimeUInt32, _envoy_config_core_v3_RuntimeUInt32__Output> + SocketAddress: MessageTypeDefinition<_envoy_config_core_v3_SocketAddress, _envoy_config_core_v3_SocketAddress__Output> + SocketOption: MessageTypeDefinition<_envoy_config_core_v3_SocketOption, _envoy_config_core_v3_SocketOption__Output> + SocketOptionsOverride: MessageTypeDefinition<_envoy_config_core_v3_SocketOptionsOverride, _envoy_config_core_v3_SocketOptionsOverride__Output> + TcpKeepalive: MessageTypeDefinition<_envoy_config_core_v3_TcpKeepalive, _envoy_config_core_v3_TcpKeepalive__Output> + TrafficDirection: EnumTypeDefinition + TransportSocket: MessageTypeDefinition<_envoy_config_core_v3_TransportSocket, _envoy_config_core_v3_TransportSocket__Output> + TypedExtensionConfig: MessageTypeDefinition<_envoy_config_core_v3_TypedExtensionConfig, _envoy_config_core_v3_TypedExtensionConfig__Output> + WatchedDirectory: MessageTypeDefinition<_envoy_config_core_v3_WatchedDirectory, _envoy_config_core_v3_WatchedDirectory__Output> + } + } + } + extensions: { + filters: { + http: { + ext_proc: { + v3: { + ProcessingMode: MessageTypeDefinition<_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode, _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output> + } + } + } + } + } + service: { + ext_proc: { + v3: { + BodyMutation: MessageTypeDefinition<_envoy_service_ext_proc_v3_BodyMutation, _envoy_service_ext_proc_v3_BodyMutation__Output> + BodyResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_BodyResponse, _envoy_service_ext_proc_v3_BodyResponse__Output> + CommonResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_CommonResponse, _envoy_service_ext_proc_v3_CommonResponse__Output> + ExternalProcessor: SubtypeConstructor & { service: _envoy_service_ext_proc_v3_ExternalProcessorDefinition } + GrpcStatus: MessageTypeDefinition<_envoy_service_ext_proc_v3_GrpcStatus, _envoy_service_ext_proc_v3_GrpcStatus__Output> + HeaderMutation: MessageTypeDefinition<_envoy_service_ext_proc_v3_HeaderMutation, _envoy_service_ext_proc_v3_HeaderMutation__Output> + HeadersResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_HeadersResponse, _envoy_service_ext_proc_v3_HeadersResponse__Output> + HttpBody: MessageTypeDefinition<_envoy_service_ext_proc_v3_HttpBody, _envoy_service_ext_proc_v3_HttpBody__Output> + HttpHeaders: MessageTypeDefinition<_envoy_service_ext_proc_v3_HttpHeaders, _envoy_service_ext_proc_v3_HttpHeaders__Output> + HttpTrailers: MessageTypeDefinition<_envoy_service_ext_proc_v3_HttpTrailers, _envoy_service_ext_proc_v3_HttpTrailers__Output> + ImmediateResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_ImmediateResponse, _envoy_service_ext_proc_v3_ImmediateResponse__Output> + ProcessingRequest: MessageTypeDefinition<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingRequest__Output> + ProcessingResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_ProcessingResponse, _envoy_service_ext_proc_v3_ProcessingResponse__Output> + ProtocolConfiguration: MessageTypeDefinition<_envoy_service_ext_proc_v3_ProtocolConfiguration, _envoy_service_ext_proc_v3_ProtocolConfiguration__Output> + StreamedBodyResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_StreamedBodyResponse, _envoy_service_ext_proc_v3_StreamedBodyResponse__Output> + TrailersResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_TrailersResponse, _envoy_service_ext_proc_v3_TrailersResponse__Output> + } + } + } + type: { + v3: { + FractionalPercent: MessageTypeDefinition<_envoy_type_v3_FractionalPercent, _envoy_type_v3_FractionalPercent__Output> + HttpStatus: MessageTypeDefinition<_envoy_type_v3_HttpStatus, _envoy_type_v3_HttpStatus__Output> + Percent: MessageTypeDefinition<_envoy_type_v3_Percent, _envoy_type_v3_Percent__Output> + SemanticVersion: MessageTypeDefinition<_envoy_type_v3_SemanticVersion, _envoy_type_v3_SemanticVersion__Output> + StatusCode: EnumTypeDefinition + } + } + } + google: { + protobuf: { + Any: MessageTypeDefinition<_google_protobuf_Any, _google_protobuf_Any__Output> + BoolValue: MessageTypeDefinition<_google_protobuf_BoolValue, _google_protobuf_BoolValue__Output> + BytesValue: MessageTypeDefinition<_google_protobuf_BytesValue, _google_protobuf_BytesValue__Output> + DescriptorProto: MessageTypeDefinition<_google_protobuf_DescriptorProto, _google_protobuf_DescriptorProto__Output> + DoubleValue: MessageTypeDefinition<_google_protobuf_DoubleValue, _google_protobuf_DoubleValue__Output> + Duration: MessageTypeDefinition<_google_protobuf_Duration, _google_protobuf_Duration__Output> + Edition: EnumTypeDefinition + EnumDescriptorProto: MessageTypeDefinition<_google_protobuf_EnumDescriptorProto, _google_protobuf_EnumDescriptorProto__Output> + EnumOptions: MessageTypeDefinition<_google_protobuf_EnumOptions, _google_protobuf_EnumOptions__Output> + EnumValueDescriptorProto: MessageTypeDefinition<_google_protobuf_EnumValueDescriptorProto, _google_protobuf_EnumValueDescriptorProto__Output> + EnumValueOptions: MessageTypeDefinition<_google_protobuf_EnumValueOptions, _google_protobuf_EnumValueOptions__Output> + ExtensionRangeOptions: MessageTypeDefinition<_google_protobuf_ExtensionRangeOptions, _google_protobuf_ExtensionRangeOptions__Output> + FeatureSet: MessageTypeDefinition<_google_protobuf_FeatureSet, _google_protobuf_FeatureSet__Output> + FeatureSetDefaults: MessageTypeDefinition<_google_protobuf_FeatureSetDefaults, _google_protobuf_FeatureSetDefaults__Output> + FieldDescriptorProto: MessageTypeDefinition<_google_protobuf_FieldDescriptorProto, _google_protobuf_FieldDescriptorProto__Output> + FieldOptions: MessageTypeDefinition<_google_protobuf_FieldOptions, _google_protobuf_FieldOptions__Output> + FileDescriptorProto: MessageTypeDefinition<_google_protobuf_FileDescriptorProto, _google_protobuf_FileDescriptorProto__Output> + FileDescriptorSet: MessageTypeDefinition<_google_protobuf_FileDescriptorSet, _google_protobuf_FileDescriptorSet__Output> + FileOptions: MessageTypeDefinition<_google_protobuf_FileOptions, _google_protobuf_FileOptions__Output> + FloatValue: MessageTypeDefinition<_google_protobuf_FloatValue, _google_protobuf_FloatValue__Output> + GeneratedCodeInfo: MessageTypeDefinition<_google_protobuf_GeneratedCodeInfo, _google_protobuf_GeneratedCodeInfo__Output> + Int32Value: MessageTypeDefinition<_google_protobuf_Int32Value, _google_protobuf_Int32Value__Output> + Int64Value: MessageTypeDefinition<_google_protobuf_Int64Value, _google_protobuf_Int64Value__Output> + ListValue: MessageTypeDefinition<_google_protobuf_ListValue, _google_protobuf_ListValue__Output> + MessageOptions: MessageTypeDefinition<_google_protobuf_MessageOptions, _google_protobuf_MessageOptions__Output> + MethodDescriptorProto: MessageTypeDefinition<_google_protobuf_MethodDescriptorProto, _google_protobuf_MethodDescriptorProto__Output> + MethodOptions: MessageTypeDefinition<_google_protobuf_MethodOptions, _google_protobuf_MethodOptions__Output> + NullValue: EnumTypeDefinition + OneofDescriptorProto: MessageTypeDefinition<_google_protobuf_OneofDescriptorProto, _google_protobuf_OneofDescriptorProto__Output> + OneofOptions: MessageTypeDefinition<_google_protobuf_OneofOptions, _google_protobuf_OneofOptions__Output> + ServiceDescriptorProto: MessageTypeDefinition<_google_protobuf_ServiceDescriptorProto, _google_protobuf_ServiceDescriptorProto__Output> + ServiceOptions: MessageTypeDefinition<_google_protobuf_ServiceOptions, _google_protobuf_ServiceOptions__Output> + SourceCodeInfo: MessageTypeDefinition<_google_protobuf_SourceCodeInfo, _google_protobuf_SourceCodeInfo__Output> + StringValue: MessageTypeDefinition<_google_protobuf_StringValue, _google_protobuf_StringValue__Output> + Struct: MessageTypeDefinition<_google_protobuf_Struct, _google_protobuf_Struct__Output> + SymbolVisibility: EnumTypeDefinition + Timestamp: MessageTypeDefinition<_google_protobuf_Timestamp, _google_protobuf_Timestamp__Output> + UInt32Value: MessageTypeDefinition<_google_protobuf_UInt32Value, _google_protobuf_UInt32Value__Output> + UInt64Value: MessageTypeDefinition<_google_protobuf_UInt64Value, _google_protobuf_UInt64Value__Output> + UninterpretedOption: MessageTypeDefinition<_google_protobuf_UninterpretedOption, _google_protobuf_UninterpretedOption__Output> + Value: MessageTypeDefinition<_google_protobuf_Value, _google_protobuf_Value__Output> + } + } + udpa: { + annotations: { + FieldMigrateAnnotation: MessageTypeDefinition<_udpa_annotations_FieldMigrateAnnotation, _udpa_annotations_FieldMigrateAnnotation__Output> + FileMigrateAnnotation: MessageTypeDefinition<_udpa_annotations_FileMigrateAnnotation, _udpa_annotations_FileMigrateAnnotation__Output> + MigrateAnnotation: MessageTypeDefinition<_udpa_annotations_MigrateAnnotation, _udpa_annotations_MigrateAnnotation__Output> + PackageVersionStatus: EnumTypeDefinition + StatusAnnotation: MessageTypeDefinition<_udpa_annotations_StatusAnnotation, _udpa_annotations_StatusAnnotation__Output> + VersioningAnnotation: MessageTypeDefinition<_udpa_annotations_VersioningAnnotation, _udpa_annotations_VersioningAnnotation__Output> + } + } + validate: { + AnyRules: MessageTypeDefinition<_validate_AnyRules, _validate_AnyRules__Output> + BoolRules: MessageTypeDefinition<_validate_BoolRules, _validate_BoolRules__Output> + BytesRules: MessageTypeDefinition<_validate_BytesRules, _validate_BytesRules__Output> + DoubleRules: MessageTypeDefinition<_validate_DoubleRules, _validate_DoubleRules__Output> + DurationRules: MessageTypeDefinition<_validate_DurationRules, _validate_DurationRules__Output> + EnumRules: MessageTypeDefinition<_validate_EnumRules, _validate_EnumRules__Output> + FieldRules: MessageTypeDefinition<_validate_FieldRules, _validate_FieldRules__Output> + Fixed32Rules: MessageTypeDefinition<_validate_Fixed32Rules, _validate_Fixed32Rules__Output> + Fixed64Rules: MessageTypeDefinition<_validate_Fixed64Rules, _validate_Fixed64Rules__Output> + FloatRules: MessageTypeDefinition<_validate_FloatRules, _validate_FloatRules__Output> + Int32Rules: MessageTypeDefinition<_validate_Int32Rules, _validate_Int32Rules__Output> + Int64Rules: MessageTypeDefinition<_validate_Int64Rules, _validate_Int64Rules__Output> + KnownRegex: EnumTypeDefinition + MapRules: MessageTypeDefinition<_validate_MapRules, _validate_MapRules__Output> + MessageRules: MessageTypeDefinition<_validate_MessageRules, _validate_MessageRules__Output> + RepeatedRules: MessageTypeDefinition<_validate_RepeatedRules, _validate_RepeatedRules__Output> + SFixed32Rules: MessageTypeDefinition<_validate_SFixed32Rules, _validate_SFixed32Rules__Output> + SFixed64Rules: MessageTypeDefinition<_validate_SFixed64Rules, _validate_SFixed64Rules__Output> + SInt32Rules: MessageTypeDefinition<_validate_SInt32Rules, _validate_SInt32Rules__Output> + SInt64Rules: MessageTypeDefinition<_validate_SInt64Rules, _validate_SInt64Rules__Output> + StringRules: MessageTypeDefinition<_validate_StringRules, _validate_StringRules__Output> + TimestampRules: MessageTypeDefinition<_validate_TimestampRules, _validate_TimestampRules__Output> + UInt32Rules: MessageTypeDefinition<_validate_UInt32Rules, _validate_UInt32Rules__Output> + UInt64Rules: MessageTypeDefinition<_validate_UInt64Rules, _validate_UInt64Rules__Output> + } + xds: { + annotations: { + v3: { + FieldStatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_FieldStatusAnnotation, _xds_annotations_v3_FieldStatusAnnotation__Output> + FileStatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_FileStatusAnnotation, _xds_annotations_v3_FileStatusAnnotation__Output> + MessageStatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_MessageStatusAnnotation, _xds_annotations_v3_MessageStatusAnnotation__Output> + PackageVersionStatus: EnumTypeDefinition + StatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_StatusAnnotation, _xds_annotations_v3_StatusAnnotation__Output> + } + } + core: { + v3: { + ContextParams: MessageTypeDefinition<_xds_core_v3_ContextParams, _xds_core_v3_ContextParams__Output> + } + } + } +} + diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts new file mode 100644 index 00000000..0608455f --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts @@ -0,0 +1,13 @@ +// Original file: null + +import type { AnyExtension } from '@grpc/proto-loader'; + +export type Any = AnyExtension | { + type_url: string; + value: Buffer | Uint8Array | string; +} + +export interface Any__Output { + 'type_url'?: (string); + 'value'?: (Buffer); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts new file mode 100644 index 00000000..2faea889 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface BoolValue { + 'value'?: (boolean); +} + +export interface BoolValue__Output { + 'value'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts new file mode 100644 index 00000000..c828166f --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface BytesValue { + 'value'?: (Buffer | Uint8Array | string); +} + +export interface BytesValue__Output { + 'value'?: (Buffer); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts new file mode 100644 index 00000000..c8506028 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts @@ -0,0 +1,59 @@ +// Original file: null + +import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './FieldDescriptorProto.js'; +import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './DescriptorProto.js'; +import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './EnumDescriptorProto.js'; +import type { MessageOptions as _google_protobuf_MessageOptions, MessageOptions__Output as _google_protobuf_MessageOptions__Output } from './MessageOptions.js'; +import type { OneofDescriptorProto as _google_protobuf_OneofDescriptorProto, OneofDescriptorProto__Output as _google_protobuf_OneofDescriptorProto__Output } from './OneofDescriptorProto.js'; +import type { SymbolVisibility as _google_protobuf_SymbolVisibility, SymbolVisibility__Output as _google_protobuf_SymbolVisibility__Output } from './SymbolVisibility.js'; +import type { ExtensionRangeOptions as _google_protobuf_ExtensionRangeOptions, ExtensionRangeOptions__Output as _google_protobuf_ExtensionRangeOptions__Output } from './ExtensionRangeOptions.js'; + +export interface _google_protobuf_DescriptorProto_ExtensionRange { + 'start'?: (number); + 'end'?: (number); + 'options'?: (_google_protobuf_ExtensionRangeOptions | null); +} + +export interface _google_protobuf_DescriptorProto_ExtensionRange__Output { + 'start'?: (number); + 'end'?: (number); + 'options'?: (_google_protobuf_ExtensionRangeOptions__Output); +} + +export interface _google_protobuf_DescriptorProto_ReservedRange { + 'start'?: (number); + 'end'?: (number); +} + +export interface _google_protobuf_DescriptorProto_ReservedRange__Output { + 'start'?: (number); + 'end'?: (number); +} + +export interface DescriptorProto { + 'name'?: (string); + 'field'?: (_google_protobuf_FieldDescriptorProto)[]; + 'nestedType'?: (_google_protobuf_DescriptorProto)[]; + 'enumType'?: (_google_protobuf_EnumDescriptorProto)[]; + 'extensionRange'?: (_google_protobuf_DescriptorProto_ExtensionRange)[]; + 'extension'?: (_google_protobuf_FieldDescriptorProto)[]; + 'options'?: (_google_protobuf_MessageOptions | null); + 'oneofDecl'?: (_google_protobuf_OneofDescriptorProto)[]; + 'reservedRange'?: (_google_protobuf_DescriptorProto_ReservedRange)[]; + 'reservedName'?: (string)[]; + 'visibility'?: (_google_protobuf_SymbolVisibility); +} + +export interface DescriptorProto__Output { + 'name'?: (string); + 'field'?: (_google_protobuf_FieldDescriptorProto__Output)[]; + 'nestedType'?: (_google_protobuf_DescriptorProto__Output)[]; + 'enumType'?: (_google_protobuf_EnumDescriptorProto__Output)[]; + 'extensionRange'?: (_google_protobuf_DescriptorProto_ExtensionRange__Output)[]; + 'extension'?: (_google_protobuf_FieldDescriptorProto__Output)[]; + 'options'?: (_google_protobuf_MessageOptions__Output); + 'oneofDecl'?: (_google_protobuf_OneofDescriptorProto__Output)[]; + 'reservedRange'?: (_google_protobuf_DescriptorProto_ReservedRange__Output)[]; + 'reservedName'?: (string)[]; + 'visibility'?: (_google_protobuf_SymbolVisibility__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts new file mode 100644 index 00000000..c3207ed7 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface DoubleValue { + 'value'?: (number | string); +} + +export interface DoubleValue__Output { + 'value'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts new file mode 100644 index 00000000..b9316e6d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts @@ -0,0 +1,13 @@ +// Original file: null + +import type { Long } from '@grpc/proto-loader'; + +export interface Duration { + 'seconds'?: (number | string | Long); + 'nanos'?: (number); +} + +export interface Duration__Output { + 'seconds'?: (Long); + 'nanos'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts new file mode 100644 index 00000000..1585402f --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts @@ -0,0 +1,44 @@ +// Original file: null + +export const Edition = { + EDITION_UNKNOWN: 0, + EDITION_LEGACY: 900, + EDITION_PROTO2: 998, + EDITION_PROTO3: 999, + EDITION_2023: 1000, + EDITION_2024: 1001, + EDITION_1_TEST_ONLY: 1, + EDITION_2_TEST_ONLY: 2, + EDITION_99997_TEST_ONLY: 99997, + EDITION_99998_TEST_ONLY: 99998, + EDITION_99999_TEST_ONLY: 99999, + EDITION_MAX: 2147483647, +} as const; + +export type Edition = + | 'EDITION_UNKNOWN' + | 0 + | 'EDITION_LEGACY' + | 900 + | 'EDITION_PROTO2' + | 998 + | 'EDITION_PROTO3' + | 999 + | 'EDITION_2023' + | 1000 + | 'EDITION_2024' + | 1001 + | 'EDITION_1_TEST_ONLY' + | 1 + | 'EDITION_2_TEST_ONLY' + | 2 + | 'EDITION_99997_TEST_ONLY' + | 99997 + | 'EDITION_99998_TEST_ONLY' + | 99998 + | 'EDITION_99999_TEST_ONLY' + | 99999 + | 'EDITION_MAX' + | 2147483647 + +export type Edition__Output = typeof Edition[keyof typeof Edition] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts new file mode 100644 index 00000000..0cedc8be --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts @@ -0,0 +1,33 @@ +// Original file: null + +import type { EnumValueDescriptorProto as _google_protobuf_EnumValueDescriptorProto, EnumValueDescriptorProto__Output as _google_protobuf_EnumValueDescriptorProto__Output } from './EnumValueDescriptorProto.js'; +import type { EnumOptions as _google_protobuf_EnumOptions, EnumOptions__Output as _google_protobuf_EnumOptions__Output } from './EnumOptions.js'; +import type { SymbolVisibility as _google_protobuf_SymbolVisibility, SymbolVisibility__Output as _google_protobuf_SymbolVisibility__Output } from './SymbolVisibility.js'; + +export interface _google_protobuf_EnumDescriptorProto_EnumReservedRange { + 'start'?: (number); + 'end'?: (number); +} + +export interface _google_protobuf_EnumDescriptorProto_EnumReservedRange__Output { + 'start'?: (number); + 'end'?: (number); +} + +export interface EnumDescriptorProto { + 'name'?: (string); + 'value'?: (_google_protobuf_EnumValueDescriptorProto)[]; + 'options'?: (_google_protobuf_EnumOptions | null); + 'reservedRange'?: (_google_protobuf_EnumDescriptorProto_EnumReservedRange)[]; + 'reservedName'?: (string)[]; + 'visibility'?: (_google_protobuf_SymbolVisibility); +} + +export interface EnumDescriptorProto__Output { + 'name'?: (string); + 'value'?: (_google_protobuf_EnumValueDescriptorProto__Output)[]; + 'options'?: (_google_protobuf_EnumOptions__Output); + 'reservedRange'?: (_google_protobuf_EnumDescriptorProto_EnumReservedRange__Output)[]; + 'reservedName'?: (string)[]; + 'visibility'?: (_google_protobuf_SymbolVisibility__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts new file mode 100644 index 00000000..32b0be80 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts @@ -0,0 +1,23 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; +import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation.js'; + +export interface EnumOptions { + 'allowAlias'?: (boolean); + 'deprecated'?: (boolean); + 'deprecatedLegacyJsonFieldConflicts'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; + '.udpa.annotations.enumMigrate'?: (_udpa_annotations_MigrateAnnotation | null); +} + +export interface EnumOptions__Output { + 'allowAlias'?: (boolean); + 'deprecated'?: (boolean); + 'deprecatedLegacyJsonFieldConflicts'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; + '.udpa.annotations.enumMigrate'?: (_udpa_annotations_MigrateAnnotation__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts new file mode 100644 index 00000000..791c76fa --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts @@ -0,0 +1,15 @@ +// Original file: null + +import type { EnumValueOptions as _google_protobuf_EnumValueOptions, EnumValueOptions__Output as _google_protobuf_EnumValueOptions__Output } from './EnumValueOptions.js'; + +export interface EnumValueDescriptorProto { + 'name'?: (string); + 'number'?: (number); + 'options'?: (_google_protobuf_EnumValueOptions | null); +} + +export interface EnumValueDescriptorProto__Output { + 'name'?: (string); + 'number'?: (number); + 'options'?: (_google_protobuf_EnumValueOptions__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts new file mode 100644 index 00000000..c85b7581 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts @@ -0,0 +1,28 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { _google_protobuf_FieldOptions_FeatureSupport, _google_protobuf_FieldOptions_FeatureSupport__Output } from './FieldOptions.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; +import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation.js'; + +export interface EnumValueOptions { + 'deprecated'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet | null); + 'debugRedact'?: (boolean); + 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; + '.envoy.annotations.disallowedByDefaultEnum'?: (boolean); + '.udpa.annotations.enumValueMigrate'?: (_udpa_annotations_MigrateAnnotation | null); + '.envoy.annotations.deprecatedAtMinorVersionEnum'?: (string); +} + +export interface EnumValueOptions__Output { + 'deprecated'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'debugRedact'?: (boolean); + 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; + '.envoy.annotations.disallowedByDefaultEnum'?: (boolean); + '.udpa.annotations.enumValueMigrate'?: (_udpa_annotations_MigrateAnnotation__Output); + '.envoy.annotations.deprecatedAtMinorVersionEnum'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts new file mode 100644 index 00000000..62046136 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts @@ -0,0 +1,49 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; + +export interface _google_protobuf_ExtensionRangeOptions_Declaration { + 'number'?: (number); + 'fullName'?: (string); + 'type'?: (string); + 'reserved'?: (boolean); + 'repeated'?: (boolean); +} + +export interface _google_protobuf_ExtensionRangeOptions_Declaration__Output { + 'number'?: (number); + 'fullName'?: (string); + 'type'?: (string); + 'reserved'?: (boolean); + 'repeated'?: (boolean); +} + +// Original file: null + +export const _google_protobuf_ExtensionRangeOptions_VerificationState = { + DECLARATION: 0, + UNVERIFIED: 1, +} as const; + +export type _google_protobuf_ExtensionRangeOptions_VerificationState = + | 'DECLARATION' + | 0 + | 'UNVERIFIED' + | 1 + +export type _google_protobuf_ExtensionRangeOptions_VerificationState__Output = typeof _google_protobuf_ExtensionRangeOptions_VerificationState[keyof typeof _google_protobuf_ExtensionRangeOptions_VerificationState] + +export interface ExtensionRangeOptions { + 'declaration'?: (_google_protobuf_ExtensionRangeOptions_Declaration)[]; + 'verification'?: (_google_protobuf_ExtensionRangeOptions_VerificationState); + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; +} + +export interface ExtensionRangeOptions__Output { + 'declaration'?: (_google_protobuf_ExtensionRangeOptions_Declaration__Output)[]; + 'verification'?: (_google_protobuf_ExtensionRangeOptions_VerificationState__Output); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts new file mode 100644 index 00000000..32b75e65 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts @@ -0,0 +1,183 @@ +// Original file: null + + +// Original file: null + +export const _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility = { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: 0, + EXPORT_ALL: 1, + EXPORT_TOP_LEVEL: 2, + LOCAL_ALL: 3, + STRICT: 4, +} as const; + +export type _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility = + | 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN' + | 0 + | 'EXPORT_ALL' + | 1 + | 'EXPORT_TOP_LEVEL' + | 2 + | 'LOCAL_ALL' + | 3 + | 'STRICT' + | 4 + +export type _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility__Output = typeof _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility[keyof typeof _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility] + +// Original file: null + +export const _google_protobuf_FeatureSet_EnforceNamingStyle = { + ENFORCE_NAMING_STYLE_UNKNOWN: 0, + STYLE2024: 1, + STYLE_LEGACY: 2, +} as const; + +export type _google_protobuf_FeatureSet_EnforceNamingStyle = + | 'ENFORCE_NAMING_STYLE_UNKNOWN' + | 0 + | 'STYLE2024' + | 1 + | 'STYLE_LEGACY' + | 2 + +export type _google_protobuf_FeatureSet_EnforceNamingStyle__Output = typeof _google_protobuf_FeatureSet_EnforceNamingStyle[keyof typeof _google_protobuf_FeatureSet_EnforceNamingStyle] + +// Original file: null + +export const _google_protobuf_FeatureSet_EnumType = { + ENUM_TYPE_UNKNOWN: 0, + OPEN: 1, + CLOSED: 2, +} as const; + +export type _google_protobuf_FeatureSet_EnumType = + | 'ENUM_TYPE_UNKNOWN' + | 0 + | 'OPEN' + | 1 + | 'CLOSED' + | 2 + +export type _google_protobuf_FeatureSet_EnumType__Output = typeof _google_protobuf_FeatureSet_EnumType[keyof typeof _google_protobuf_FeatureSet_EnumType] + +// Original file: null + +export const _google_protobuf_FeatureSet_FieldPresence = { + FIELD_PRESENCE_UNKNOWN: 0, + EXPLICIT: 1, + IMPLICIT: 2, + LEGACY_REQUIRED: 3, +} as const; + +export type _google_protobuf_FeatureSet_FieldPresence = + | 'FIELD_PRESENCE_UNKNOWN' + | 0 + | 'EXPLICIT' + | 1 + | 'IMPLICIT' + | 2 + | 'LEGACY_REQUIRED' + | 3 + +export type _google_protobuf_FeatureSet_FieldPresence__Output = typeof _google_protobuf_FeatureSet_FieldPresence[keyof typeof _google_protobuf_FeatureSet_FieldPresence] + +// Original file: null + +export const _google_protobuf_FeatureSet_JsonFormat = { + JSON_FORMAT_UNKNOWN: 0, + ALLOW: 1, + LEGACY_BEST_EFFORT: 2, +} as const; + +export type _google_protobuf_FeatureSet_JsonFormat = + | 'JSON_FORMAT_UNKNOWN' + | 0 + | 'ALLOW' + | 1 + | 'LEGACY_BEST_EFFORT' + | 2 + +export type _google_protobuf_FeatureSet_JsonFormat__Output = typeof _google_protobuf_FeatureSet_JsonFormat[keyof typeof _google_protobuf_FeatureSet_JsonFormat] + +// Original file: null + +export const _google_protobuf_FeatureSet_MessageEncoding = { + MESSAGE_ENCODING_UNKNOWN: 0, + LENGTH_PREFIXED: 1, + DELIMITED: 2, +} as const; + +export type _google_protobuf_FeatureSet_MessageEncoding = + | 'MESSAGE_ENCODING_UNKNOWN' + | 0 + | 'LENGTH_PREFIXED' + | 1 + | 'DELIMITED' + | 2 + +export type _google_protobuf_FeatureSet_MessageEncoding__Output = typeof _google_protobuf_FeatureSet_MessageEncoding[keyof typeof _google_protobuf_FeatureSet_MessageEncoding] + +// Original file: null + +export const _google_protobuf_FeatureSet_RepeatedFieldEncoding = { + REPEATED_FIELD_ENCODING_UNKNOWN: 0, + PACKED: 1, + EXPANDED: 2, +} as const; + +export type _google_protobuf_FeatureSet_RepeatedFieldEncoding = + | 'REPEATED_FIELD_ENCODING_UNKNOWN' + | 0 + | 'PACKED' + | 1 + | 'EXPANDED' + | 2 + +export type _google_protobuf_FeatureSet_RepeatedFieldEncoding__Output = typeof _google_protobuf_FeatureSet_RepeatedFieldEncoding[keyof typeof _google_protobuf_FeatureSet_RepeatedFieldEncoding] + +// Original file: null + +export const _google_protobuf_FeatureSet_Utf8Validation = { + UTF8_VALIDATION_UNKNOWN: 0, + VERIFY: 2, + NONE: 3, +} as const; + +export type _google_protobuf_FeatureSet_Utf8Validation = + | 'UTF8_VALIDATION_UNKNOWN' + | 0 + | 'VERIFY' + | 2 + | 'NONE' + | 3 + +export type _google_protobuf_FeatureSet_Utf8Validation__Output = typeof _google_protobuf_FeatureSet_Utf8Validation[keyof typeof _google_protobuf_FeatureSet_Utf8Validation] + +export interface _google_protobuf_FeatureSet_VisibilityFeature { +} + +export interface _google_protobuf_FeatureSet_VisibilityFeature__Output { +} + +export interface FeatureSet { + 'fieldPresence'?: (_google_protobuf_FeatureSet_FieldPresence); + 'enumType'?: (_google_protobuf_FeatureSet_EnumType); + 'repeatedFieldEncoding'?: (_google_protobuf_FeatureSet_RepeatedFieldEncoding); + 'utf8Validation'?: (_google_protobuf_FeatureSet_Utf8Validation); + 'messageEncoding'?: (_google_protobuf_FeatureSet_MessageEncoding); + 'jsonFormat'?: (_google_protobuf_FeatureSet_JsonFormat); + 'enforceNamingStyle'?: (_google_protobuf_FeatureSet_EnforceNamingStyle); + 'defaultSymbolVisibility'?: (_google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility); +} + +export interface FeatureSet__Output { + 'fieldPresence'?: (_google_protobuf_FeatureSet_FieldPresence__Output); + 'enumType'?: (_google_protobuf_FeatureSet_EnumType__Output); + 'repeatedFieldEncoding'?: (_google_protobuf_FeatureSet_RepeatedFieldEncoding__Output); + 'utf8Validation'?: (_google_protobuf_FeatureSet_Utf8Validation__Output); + 'messageEncoding'?: (_google_protobuf_FeatureSet_MessageEncoding__Output); + 'jsonFormat'?: (_google_protobuf_FeatureSet_JsonFormat__Output); + 'enforceNamingStyle'?: (_google_protobuf_FeatureSet_EnforceNamingStyle__Output); + 'defaultSymbolVisibility'?: (_google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts new file mode 100644 index 00000000..63e9be74 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts @@ -0,0 +1,28 @@ +// Original file: null + +import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from './Edition.js'; +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; + +export interface _google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault { + 'edition'?: (_google_protobuf_Edition); + 'overridableFeatures'?: (_google_protobuf_FeatureSet | null); + 'fixedFeatures'?: (_google_protobuf_FeatureSet | null); +} + +export interface _google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__Output { + 'edition'?: (_google_protobuf_Edition__Output); + 'overridableFeatures'?: (_google_protobuf_FeatureSet__Output); + 'fixedFeatures'?: (_google_protobuf_FeatureSet__Output); +} + +export interface FeatureSetDefaults { + 'defaults'?: (_google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault)[]; + 'minimumEdition'?: (_google_protobuf_Edition); + 'maximumEdition'?: (_google_protobuf_Edition); +} + +export interface FeatureSetDefaults__Output { + 'defaults'?: (_google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__Output)[]; + 'minimumEdition'?: (_google_protobuf_Edition__Output); + 'maximumEdition'?: (_google_protobuf_Edition__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts new file mode 100644 index 00000000..6ca685bd --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts @@ -0,0 +1,112 @@ +// Original file: null + +import type { FieldOptions as _google_protobuf_FieldOptions, FieldOptions__Output as _google_protobuf_FieldOptions__Output } from './FieldOptions.js'; + +// Original file: null + +export const _google_protobuf_FieldDescriptorProto_Label = { + LABEL_OPTIONAL: 1, + LABEL_REPEATED: 3, + LABEL_REQUIRED: 2, +} as const; + +export type _google_protobuf_FieldDescriptorProto_Label = + | 'LABEL_OPTIONAL' + | 1 + | 'LABEL_REPEATED' + | 3 + | 'LABEL_REQUIRED' + | 2 + +export type _google_protobuf_FieldDescriptorProto_Label__Output = typeof _google_protobuf_FieldDescriptorProto_Label[keyof typeof _google_protobuf_FieldDescriptorProto_Label] + +// Original file: null + +export const _google_protobuf_FieldDescriptorProto_Type = { + TYPE_DOUBLE: 1, + TYPE_FLOAT: 2, + TYPE_INT64: 3, + TYPE_UINT64: 4, + TYPE_INT32: 5, + TYPE_FIXED64: 6, + TYPE_FIXED32: 7, + TYPE_BOOL: 8, + TYPE_STRING: 9, + TYPE_GROUP: 10, + TYPE_MESSAGE: 11, + TYPE_BYTES: 12, + TYPE_UINT32: 13, + TYPE_ENUM: 14, + TYPE_SFIXED32: 15, + TYPE_SFIXED64: 16, + TYPE_SINT32: 17, + TYPE_SINT64: 18, +} as const; + +export type _google_protobuf_FieldDescriptorProto_Type = + | 'TYPE_DOUBLE' + | 1 + | 'TYPE_FLOAT' + | 2 + | 'TYPE_INT64' + | 3 + | 'TYPE_UINT64' + | 4 + | 'TYPE_INT32' + | 5 + | 'TYPE_FIXED64' + | 6 + | 'TYPE_FIXED32' + | 7 + | 'TYPE_BOOL' + | 8 + | 'TYPE_STRING' + | 9 + | 'TYPE_GROUP' + | 10 + | 'TYPE_MESSAGE' + | 11 + | 'TYPE_BYTES' + | 12 + | 'TYPE_UINT32' + | 13 + | 'TYPE_ENUM' + | 14 + | 'TYPE_SFIXED32' + | 15 + | 'TYPE_SFIXED64' + | 16 + | 'TYPE_SINT32' + | 17 + | 'TYPE_SINT64' + | 18 + +export type _google_protobuf_FieldDescriptorProto_Type__Output = typeof _google_protobuf_FieldDescriptorProto_Type[keyof typeof _google_protobuf_FieldDescriptorProto_Type] + +export interface FieldDescriptorProto { + 'name'?: (string); + 'extendee'?: (string); + 'number'?: (number); + 'label'?: (_google_protobuf_FieldDescriptorProto_Label); + 'type'?: (_google_protobuf_FieldDescriptorProto_Type); + 'typeName'?: (string); + 'defaultValue'?: (string); + 'options'?: (_google_protobuf_FieldOptions | null); + 'oneofIndex'?: (number); + 'jsonName'?: (string); + 'proto3Optional'?: (boolean); +} + +export interface FieldDescriptorProto__Output { + 'name'?: (string); + 'extendee'?: (string); + 'number'?: (number); + 'label'?: (_google_protobuf_FieldDescriptorProto_Label__Output); + 'type'?: (_google_protobuf_FieldDescriptorProto_Type__Output); + 'typeName'?: (string); + 'defaultValue'?: (string); + 'options'?: (_google_protobuf_FieldOptions__Output); + 'oneofIndex'?: (number); + 'jsonName'?: (string); + 'proto3Optional'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts new file mode 100644 index 00000000..1722cced --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts @@ -0,0 +1,169 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; +import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from '../../validate/FieldRules.js'; +import type { FieldMigrateAnnotation as _udpa_annotations_FieldMigrateAnnotation, FieldMigrateAnnotation__Output as _udpa_annotations_FieldMigrateAnnotation__Output } from '../../udpa/annotations/FieldMigrateAnnotation.js'; +import type { FieldStatusAnnotation as _xds_annotations_v3_FieldStatusAnnotation, FieldStatusAnnotation__Output as _xds_annotations_v3_FieldStatusAnnotation__Output } from '../../xds/annotations/v3/FieldStatusAnnotation.js'; +import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from './Edition.js'; + +// Original file: null + +export const _google_protobuf_FieldOptions_CType = { + STRING: 0, + CORD: 1, + STRING_PIECE: 2, +} as const; + +export type _google_protobuf_FieldOptions_CType = + | 'STRING' + | 0 + | 'CORD' + | 1 + | 'STRING_PIECE' + | 2 + +export type _google_protobuf_FieldOptions_CType__Output = typeof _google_protobuf_FieldOptions_CType[keyof typeof _google_protobuf_FieldOptions_CType] + +export interface _google_protobuf_FieldOptions_EditionDefault { + 'edition'?: (_google_protobuf_Edition); + 'value'?: (string); +} + +export interface _google_protobuf_FieldOptions_EditionDefault__Output { + 'edition'?: (_google_protobuf_Edition__Output); + 'value'?: (string); +} + +export interface _google_protobuf_FieldOptions_FeatureSupport { + 'editionIntroduced'?: (_google_protobuf_Edition); + 'editionDeprecated'?: (_google_protobuf_Edition); + 'deprecationWarning'?: (string); + 'editionRemoved'?: (_google_protobuf_Edition); +} + +export interface _google_protobuf_FieldOptions_FeatureSupport__Output { + 'editionIntroduced'?: (_google_protobuf_Edition__Output); + 'editionDeprecated'?: (_google_protobuf_Edition__Output); + 'deprecationWarning'?: (string); + 'editionRemoved'?: (_google_protobuf_Edition__Output); +} + +// Original file: null + +export const _google_protobuf_FieldOptions_JSType = { + JS_NORMAL: 0, + JS_STRING: 1, + JS_NUMBER: 2, +} as const; + +export type _google_protobuf_FieldOptions_JSType = + | 'JS_NORMAL' + | 0 + | 'JS_STRING' + | 1 + | 'JS_NUMBER' + | 2 + +export type _google_protobuf_FieldOptions_JSType__Output = typeof _google_protobuf_FieldOptions_JSType[keyof typeof _google_protobuf_FieldOptions_JSType] + +// Original file: null + +export const _google_protobuf_FieldOptions_OptionRetention = { + RETENTION_UNKNOWN: 0, + RETENTION_RUNTIME: 1, + RETENTION_SOURCE: 2, +} as const; + +export type _google_protobuf_FieldOptions_OptionRetention = + | 'RETENTION_UNKNOWN' + | 0 + | 'RETENTION_RUNTIME' + | 1 + | 'RETENTION_SOURCE' + | 2 + +export type _google_protobuf_FieldOptions_OptionRetention__Output = typeof _google_protobuf_FieldOptions_OptionRetention[keyof typeof _google_protobuf_FieldOptions_OptionRetention] + +// Original file: null + +export const _google_protobuf_FieldOptions_OptionTargetType = { + TARGET_TYPE_UNKNOWN: 0, + TARGET_TYPE_FILE: 1, + TARGET_TYPE_EXTENSION_RANGE: 2, + TARGET_TYPE_MESSAGE: 3, + TARGET_TYPE_FIELD: 4, + TARGET_TYPE_ONEOF: 5, + TARGET_TYPE_ENUM: 6, + TARGET_TYPE_ENUM_ENTRY: 7, + TARGET_TYPE_SERVICE: 8, + TARGET_TYPE_METHOD: 9, +} as const; + +export type _google_protobuf_FieldOptions_OptionTargetType = + | 'TARGET_TYPE_UNKNOWN' + | 0 + | 'TARGET_TYPE_FILE' + | 1 + | 'TARGET_TYPE_EXTENSION_RANGE' + | 2 + | 'TARGET_TYPE_MESSAGE' + | 3 + | 'TARGET_TYPE_FIELD' + | 4 + | 'TARGET_TYPE_ONEOF' + | 5 + | 'TARGET_TYPE_ENUM' + | 6 + | 'TARGET_TYPE_ENUM_ENTRY' + | 7 + | 'TARGET_TYPE_SERVICE' + | 8 + | 'TARGET_TYPE_METHOD' + | 9 + +export type _google_protobuf_FieldOptions_OptionTargetType__Output = typeof _google_protobuf_FieldOptions_OptionTargetType[keyof typeof _google_protobuf_FieldOptions_OptionTargetType] + +export interface FieldOptions { + 'ctype'?: (_google_protobuf_FieldOptions_CType); + 'packed'?: (boolean); + 'deprecated'?: (boolean); + 'lazy'?: (boolean); + 'jstype'?: (_google_protobuf_FieldOptions_JSType); + 'weak'?: (boolean); + 'unverifiedLazy'?: (boolean); + 'debugRedact'?: (boolean); + 'retention'?: (_google_protobuf_FieldOptions_OptionRetention); + 'targets'?: (_google_protobuf_FieldOptions_OptionTargetType)[]; + 'editionDefaults'?: (_google_protobuf_FieldOptions_EditionDefault)[]; + 'features'?: (_google_protobuf_FeatureSet | null); + 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; + '.validate.rules'?: (_validate_FieldRules | null); + '.envoy.annotations.deprecatedAtMinorVersion'?: (string); + '.udpa.annotations.fieldMigrate'?: (_udpa_annotations_FieldMigrateAnnotation | null); + '.envoy.annotations.disallowedByDefault'?: (boolean); + '.xds.annotations.v3.fieldStatus'?: (_xds_annotations_v3_FieldStatusAnnotation | null); +} + +export interface FieldOptions__Output { + 'ctype'?: (_google_protobuf_FieldOptions_CType__Output); + 'packed'?: (boolean); + 'deprecated'?: (boolean); + 'lazy'?: (boolean); + 'jstype'?: (_google_protobuf_FieldOptions_JSType__Output); + 'weak'?: (boolean); + 'unverifiedLazy'?: (boolean); + 'debugRedact'?: (boolean); + 'retention'?: (_google_protobuf_FieldOptions_OptionRetention__Output); + 'targets'?: (_google_protobuf_FieldOptions_OptionTargetType__Output)[]; + 'editionDefaults'?: (_google_protobuf_FieldOptions_EditionDefault__Output)[]; + 'features'?: (_google_protobuf_FeatureSet__Output); + 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; + '.validate.rules'?: (_validate_FieldRules__Output); + '.envoy.annotations.deprecatedAtMinorVersion'?: (string); + '.udpa.annotations.fieldMigrate'?: (_udpa_annotations_FieldMigrateAnnotation__Output); + '.envoy.annotations.disallowedByDefault'?: (boolean); + '.xds.annotations.v3.fieldStatus'?: (_xds_annotations_v3_FieldStatusAnnotation__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts new file mode 100644 index 00000000..bc95b81b --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts @@ -0,0 +1,43 @@ +// Original file: null + +import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './DescriptorProto.js'; +import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './EnumDescriptorProto.js'; +import type { ServiceDescriptorProto as _google_protobuf_ServiceDescriptorProto, ServiceDescriptorProto__Output as _google_protobuf_ServiceDescriptorProto__Output } from './ServiceDescriptorProto.js'; +import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './FieldDescriptorProto.js'; +import type { FileOptions as _google_protobuf_FileOptions, FileOptions__Output as _google_protobuf_FileOptions__Output } from './FileOptions.js'; +import type { SourceCodeInfo as _google_protobuf_SourceCodeInfo, SourceCodeInfo__Output as _google_protobuf_SourceCodeInfo__Output } from './SourceCodeInfo.js'; +import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from './Edition.js'; + +export interface FileDescriptorProto { + 'name'?: (string); + 'package'?: (string); + 'dependency'?: (string)[]; + 'messageType'?: (_google_protobuf_DescriptorProto)[]; + 'enumType'?: (_google_protobuf_EnumDescriptorProto)[]; + 'service'?: (_google_protobuf_ServiceDescriptorProto)[]; + 'extension'?: (_google_protobuf_FieldDescriptorProto)[]; + 'options'?: (_google_protobuf_FileOptions | null); + 'sourceCodeInfo'?: (_google_protobuf_SourceCodeInfo | null); + 'publicDependency'?: (number)[]; + 'weakDependency'?: (number)[]; + 'syntax'?: (string); + 'edition'?: (_google_protobuf_Edition); + 'optionDependency'?: (string)[]; +} + +export interface FileDescriptorProto__Output { + 'name'?: (string); + 'package'?: (string); + 'dependency'?: (string)[]; + 'messageType'?: (_google_protobuf_DescriptorProto__Output)[]; + 'enumType'?: (_google_protobuf_EnumDescriptorProto__Output)[]; + 'service'?: (_google_protobuf_ServiceDescriptorProto__Output)[]; + 'extension'?: (_google_protobuf_FieldDescriptorProto__Output)[]; + 'options'?: (_google_protobuf_FileOptions__Output); + 'sourceCodeInfo'?: (_google_protobuf_SourceCodeInfo__Output); + 'publicDependency'?: (number)[]; + 'weakDependency'?: (number)[]; + 'syntax'?: (string); + 'edition'?: (_google_protobuf_Edition__Output); + 'optionDependency'?: (string)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts new file mode 100644 index 00000000..775bfa17 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts @@ -0,0 +1,11 @@ +// Original file: null + +import type { FileDescriptorProto as _google_protobuf_FileDescriptorProto, FileDescriptorProto__Output as _google_protobuf_FileDescriptorProto__Output } from './FileDescriptorProto.js'; + +export interface FileDescriptorSet { + 'file'?: (_google_protobuf_FileDescriptorProto)[]; +} + +export interface FileDescriptorSet__Output { + 'file'?: (_google_protobuf_FileDescriptorProto__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts new file mode 100644 index 00000000..66f80dd8 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts @@ -0,0 +1,79 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; +import type { FileMigrateAnnotation as _udpa_annotations_FileMigrateAnnotation, FileMigrateAnnotation__Output as _udpa_annotations_FileMigrateAnnotation__Output } from '../../udpa/annotations/FileMigrateAnnotation.js'; +import type { StatusAnnotation as _udpa_annotations_StatusAnnotation, StatusAnnotation__Output as _udpa_annotations_StatusAnnotation__Output } from '../../udpa/annotations/StatusAnnotation.js'; +import type { FileStatusAnnotation as _xds_annotations_v3_FileStatusAnnotation, FileStatusAnnotation__Output as _xds_annotations_v3_FileStatusAnnotation__Output } from '../../xds/annotations/v3/FileStatusAnnotation.js'; + +// Original file: null + +export const _google_protobuf_FileOptions_OptimizeMode = { + SPEED: 1, + CODE_SIZE: 2, + LITE_RUNTIME: 3, +} as const; + +export type _google_protobuf_FileOptions_OptimizeMode = + | 'SPEED' + | 1 + | 'CODE_SIZE' + | 2 + | 'LITE_RUNTIME' + | 3 + +export type _google_protobuf_FileOptions_OptimizeMode__Output = typeof _google_protobuf_FileOptions_OptimizeMode[keyof typeof _google_protobuf_FileOptions_OptimizeMode] + +export interface FileOptions { + 'javaPackage'?: (string); + 'javaOuterClassname'?: (string); + 'optimizeFor'?: (_google_protobuf_FileOptions_OptimizeMode); + 'javaMultipleFiles'?: (boolean); + 'goPackage'?: (string); + 'ccGenericServices'?: (boolean); + 'javaGenericServices'?: (boolean); + 'pyGenericServices'?: (boolean); + 'javaGenerateEqualsAndHash'?: (boolean); + 'deprecated'?: (boolean); + 'javaStringCheckUtf8'?: (boolean); + 'ccEnableArenas'?: (boolean); + 'objcClassPrefix'?: (string); + 'csharpNamespace'?: (string); + 'swiftPrefix'?: (string); + 'phpClassPrefix'?: (string); + 'phpNamespace'?: (string); + 'phpMetadataNamespace'?: (string); + 'rubyPackage'?: (string); + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; + '.udpa.annotations.fileMigrate'?: (_udpa_annotations_FileMigrateAnnotation | null); + '.udpa.annotations.fileStatus'?: (_udpa_annotations_StatusAnnotation | null); + '.xds.annotations.v3.fileStatus'?: (_xds_annotations_v3_FileStatusAnnotation | null); +} + +export interface FileOptions__Output { + 'javaPackage'?: (string); + 'javaOuterClassname'?: (string); + 'optimizeFor'?: (_google_protobuf_FileOptions_OptimizeMode__Output); + 'javaMultipleFiles'?: (boolean); + 'goPackage'?: (string); + 'ccGenericServices'?: (boolean); + 'javaGenericServices'?: (boolean); + 'pyGenericServices'?: (boolean); + 'javaGenerateEqualsAndHash'?: (boolean); + 'deprecated'?: (boolean); + 'javaStringCheckUtf8'?: (boolean); + 'ccEnableArenas'?: (boolean); + 'objcClassPrefix'?: (string); + 'csharpNamespace'?: (string); + 'swiftPrefix'?: (string); + 'phpClassPrefix'?: (string); + 'phpNamespace'?: (string); + 'phpMetadataNamespace'?: (string); + 'rubyPackage'?: (string); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; + '.udpa.annotations.fileMigrate'?: (_udpa_annotations_FileMigrateAnnotation__Output); + '.udpa.annotations.fileStatus'?: (_udpa_annotations_StatusAnnotation__Output); + '.xds.annotations.v3.fileStatus'?: (_xds_annotations_v3_FileStatusAnnotation__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts new file mode 100644 index 00000000..5f0aba0c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface FloatValue { + 'value'?: (number | string); +} + +export interface FloatValue__Output { + 'value'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts new file mode 100644 index 00000000..0de3b924 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts @@ -0,0 +1,44 @@ +// Original file: null + + +export interface _google_protobuf_GeneratedCodeInfo_Annotation { + 'path'?: (number)[]; + 'sourceFile'?: (string); + 'begin'?: (number); + 'end'?: (number); + 'semantic'?: (_google_protobuf_GeneratedCodeInfo_Annotation_Semantic); +} + +export interface _google_protobuf_GeneratedCodeInfo_Annotation__Output { + 'path'?: (number)[]; + 'sourceFile'?: (string); + 'begin'?: (number); + 'end'?: (number); + 'semantic'?: (_google_protobuf_GeneratedCodeInfo_Annotation_Semantic__Output); +} + +// Original file: null + +export const _google_protobuf_GeneratedCodeInfo_Annotation_Semantic = { + NONE: 0, + SET: 1, + ALIAS: 2, +} as const; + +export type _google_protobuf_GeneratedCodeInfo_Annotation_Semantic = + | 'NONE' + | 0 + | 'SET' + | 1 + | 'ALIAS' + | 2 + +export type _google_protobuf_GeneratedCodeInfo_Annotation_Semantic__Output = typeof _google_protobuf_GeneratedCodeInfo_Annotation_Semantic[keyof typeof _google_protobuf_GeneratedCodeInfo_Annotation_Semantic] + +export interface GeneratedCodeInfo { + 'annotation'?: (_google_protobuf_GeneratedCodeInfo_Annotation)[]; +} + +export interface GeneratedCodeInfo__Output { + 'annotation'?: (_google_protobuf_GeneratedCodeInfo_Annotation__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts new file mode 100644 index 00000000..fd597474 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface Int32Value { + 'value'?: (number); +} + +export interface Int32Value__Output { + 'value'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts new file mode 100644 index 00000000..2a544921 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts @@ -0,0 +1,11 @@ +// Original file: null + +import type { Long } from '@grpc/proto-loader'; + +export interface Int64Value { + 'value'?: (number | string | Long); +} + +export interface Int64Value__Output { + 'value'?: (Long); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts new file mode 100644 index 00000000..bcf92385 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts @@ -0,0 +1,11 @@ +// Original file: null + +import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from './Value.js'; + +export interface ListValue { + 'values'?: (_google_protobuf_Value)[]; +} + +export interface ListValue__Output { + 'values'?: (_google_protobuf_Value__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts new file mode 100644 index 00000000..5d33bf0c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts @@ -0,0 +1,37 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; +import type { VersioningAnnotation as _udpa_annotations_VersioningAnnotation, VersioningAnnotation__Output as _udpa_annotations_VersioningAnnotation__Output } from '../../udpa/annotations/VersioningAnnotation.js'; +import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation.js'; +import type { MessageStatusAnnotation as _xds_annotations_v3_MessageStatusAnnotation, MessageStatusAnnotation__Output as _xds_annotations_v3_MessageStatusAnnotation__Output } from '../../xds/annotations/v3/MessageStatusAnnotation.js'; + +export interface MessageOptions { + 'messageSetWireFormat'?: (boolean); + 'noStandardDescriptorAccessor'?: (boolean); + 'deprecated'?: (boolean); + 'mapEntry'?: (boolean); + 'deprecatedLegacyJsonFieldConflicts'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; + '.validate.disabled'?: (boolean); + '.validate.ignored'?: (boolean); + '.udpa.annotations.versioning'?: (_udpa_annotations_VersioningAnnotation | null); + '.udpa.annotations.messageMigrate'?: (_udpa_annotations_MigrateAnnotation | null); + '.xds.annotations.v3.messageStatus'?: (_xds_annotations_v3_MessageStatusAnnotation | null); +} + +export interface MessageOptions__Output { + 'messageSetWireFormat'?: (boolean); + 'noStandardDescriptorAccessor'?: (boolean); + 'deprecated'?: (boolean); + 'mapEntry'?: (boolean); + 'deprecatedLegacyJsonFieldConflicts'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; + '.validate.disabled'?: (boolean); + '.validate.ignored'?: (boolean); + '.udpa.annotations.versioning'?: (_udpa_annotations_VersioningAnnotation__Output); + '.udpa.annotations.messageMigrate'?: (_udpa_annotations_MigrateAnnotation__Output); + '.xds.annotations.v3.messageStatus'?: (_xds_annotations_v3_MessageStatusAnnotation__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts new file mode 100644 index 00000000..ba9f9509 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts @@ -0,0 +1,21 @@ +// Original file: null + +import type { MethodOptions as _google_protobuf_MethodOptions, MethodOptions__Output as _google_protobuf_MethodOptions__Output } from './MethodOptions.js'; + +export interface MethodDescriptorProto { + 'name'?: (string); + 'inputType'?: (string); + 'outputType'?: (string); + 'options'?: (_google_protobuf_MethodOptions | null); + 'clientStreaming'?: (boolean); + 'serverStreaming'?: (boolean); +} + +export interface MethodDescriptorProto__Output { + 'name'?: (string); + 'inputType'?: (string); + 'outputType'?: (string); + 'options'?: (_google_protobuf_MethodOptions__Output); + 'clientStreaming'?: (boolean); + 'serverStreaming'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts new file mode 100644 index 00000000..97df27c4 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts @@ -0,0 +1,36 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; + +// Original file: null + +export const _google_protobuf_MethodOptions_IdempotencyLevel = { + IDEMPOTENCY_UNKNOWN: 0, + NO_SIDE_EFFECTS: 1, + IDEMPOTENT: 2, +} as const; + +export type _google_protobuf_MethodOptions_IdempotencyLevel = + | 'IDEMPOTENCY_UNKNOWN' + | 0 + | 'NO_SIDE_EFFECTS' + | 1 + | 'IDEMPOTENT' + | 2 + +export type _google_protobuf_MethodOptions_IdempotencyLevel__Output = typeof _google_protobuf_MethodOptions_IdempotencyLevel[keyof typeof _google_protobuf_MethodOptions_IdempotencyLevel] + +export interface MethodOptions { + 'deprecated'?: (boolean); + 'idempotencyLevel'?: (_google_protobuf_MethodOptions_IdempotencyLevel); + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; +} + +export interface MethodOptions__Output { + 'deprecated'?: (boolean); + 'idempotencyLevel'?: (_google_protobuf_MethodOptions_IdempotencyLevel__Output); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts new file mode 100644 index 00000000..a04f8d14 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts @@ -0,0 +1,11 @@ +// Original file: null + +export const NullValue = { + NULL_VALUE: 0, +} as const; + +export type NullValue = + | 'NULL_VALUE' + | 0 + +export type NullValue__Output = typeof NullValue[keyof typeof NullValue] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts new file mode 100644 index 00000000..75179518 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts @@ -0,0 +1,13 @@ +// Original file: null + +import type { OneofOptions as _google_protobuf_OneofOptions, OneofOptions__Output as _google_protobuf_OneofOptions__Output } from './OneofOptions.js'; + +export interface OneofDescriptorProto { + 'name'?: (string); + 'options'?: (_google_protobuf_OneofOptions | null); +} + +export interface OneofDescriptorProto__Output { + 'name'?: (string); + 'options'?: (_google_protobuf_OneofOptions__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts new file mode 100644 index 00000000..33db9411 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts @@ -0,0 +1,16 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; + +export interface OneofOptions { + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; + '.validate.required'?: (boolean); +} + +export interface OneofOptions__Output { + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; + '.validate.required'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts new file mode 100644 index 00000000..7878e45d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts @@ -0,0 +1,16 @@ +// Original file: null + +import type { MethodDescriptorProto as _google_protobuf_MethodDescriptorProto, MethodDescriptorProto__Output as _google_protobuf_MethodDescriptorProto__Output } from './MethodDescriptorProto.js'; +import type { ServiceOptions as _google_protobuf_ServiceOptions, ServiceOptions__Output as _google_protobuf_ServiceOptions__Output } from './ServiceOptions.js'; + +export interface ServiceDescriptorProto { + 'name'?: (string); + 'method'?: (_google_protobuf_MethodDescriptorProto)[]; + 'options'?: (_google_protobuf_ServiceOptions | null); +} + +export interface ServiceDescriptorProto__Output { + 'name'?: (string); + 'method'?: (_google_protobuf_MethodDescriptorProto__Output)[]; + 'options'?: (_google_protobuf_ServiceOptions__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts new file mode 100644 index 00000000..69fa6269 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts @@ -0,0 +1,16 @@ +// Original file: null + +import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; +import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; + +export interface ServiceOptions { + 'deprecated'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet | null); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; +} + +export interface ServiceOptions__Output { + 'deprecated'?: (boolean); + 'features'?: (_google_protobuf_FeatureSet__Output); + 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts new file mode 100644 index 00000000..ace0d39e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts @@ -0,0 +1,26 @@ +// Original file: null + + +export interface _google_protobuf_SourceCodeInfo_Location { + 'path'?: (number)[]; + 'span'?: (number)[]; + 'leadingComments'?: (string); + 'trailingComments'?: (string); + 'leadingDetachedComments'?: (string)[]; +} + +export interface _google_protobuf_SourceCodeInfo_Location__Output { + 'path'?: (number)[]; + 'span'?: (number)[]; + 'leadingComments'?: (string); + 'trailingComments'?: (string); + 'leadingDetachedComments'?: (string)[]; +} + +export interface SourceCodeInfo { + 'location'?: (_google_protobuf_SourceCodeInfo_Location)[]; +} + +export interface SourceCodeInfo__Output { + 'location'?: (_google_protobuf_SourceCodeInfo_Location__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts new file mode 100644 index 00000000..cefd9a1d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface StringValue { + 'value'?: (string); +} + +export interface StringValue__Output { + 'value'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts new file mode 100644 index 00000000..0652421d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts @@ -0,0 +1,11 @@ +// Original file: null + +import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from './Value.js'; + +export interface Struct { + 'fields'?: ({[key: string]: _google_protobuf_Value}); +} + +export interface Struct__Output { + 'fields'?: ({[key: string]: _google_protobuf_Value__Output}); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts new file mode 100644 index 00000000..f49b63f9 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts @@ -0,0 +1,17 @@ +// Original file: null + +export const SymbolVisibility = { + VISIBILITY_UNSET: 0, + VISIBILITY_LOCAL: 1, + VISIBILITY_EXPORT: 2, +} as const; + +export type SymbolVisibility = + | 'VISIBILITY_UNSET' + | 0 + | 'VISIBILITY_LOCAL' + | 1 + | 'VISIBILITY_EXPORT' + | 2 + +export type SymbolVisibility__Output = typeof SymbolVisibility[keyof typeof SymbolVisibility] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts new file mode 100644 index 00000000..a5c4edd6 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts @@ -0,0 +1,13 @@ +// Original file: null + +import type { Long } from '@grpc/proto-loader'; + +export interface Timestamp { + 'seconds'?: (number | string | Long); + 'nanos'?: (number); +} + +export interface Timestamp__Output { + 'seconds'?: (Long); + 'nanos'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts new file mode 100644 index 00000000..93a6a8d8 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts @@ -0,0 +1,10 @@ +// Original file: null + + +export interface UInt32Value { + 'value'?: (number); +} + +export interface UInt32Value__Output { + 'value'?: (number); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts new file mode 100644 index 00000000..20e010ec --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts @@ -0,0 +1,11 @@ +// Original file: null + +import type { Long } from '@grpc/proto-loader'; + +export interface UInt64Value { + 'value'?: (number | string | Long); +} + +export interface UInt64Value__Output { + 'value'?: (Long); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts new file mode 100644 index 00000000..0fcc97e0 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts @@ -0,0 +1,33 @@ +// Original file: null + +import type { Long } from '@grpc/proto-loader'; + +export interface _google_protobuf_UninterpretedOption_NamePart { + 'namePart'?: (string); + 'isExtension'?: (boolean); +} + +export interface _google_protobuf_UninterpretedOption_NamePart__Output { + 'namePart'?: (string); + 'isExtension'?: (boolean); +} + +export interface UninterpretedOption { + 'name'?: (_google_protobuf_UninterpretedOption_NamePart)[]; + 'identifierValue'?: (string); + 'positiveIntValue'?: (number | string | Long); + 'negativeIntValue'?: (number | string | Long); + 'doubleValue'?: (number | string); + 'stringValue'?: (Buffer | Uint8Array | string); + 'aggregateValue'?: (string); +} + +export interface UninterpretedOption__Output { + 'name'?: (_google_protobuf_UninterpretedOption_NamePart__Output)[]; + 'identifierValue'?: (string); + 'positiveIntValue'?: (Long); + 'negativeIntValue'?: (Long); + 'doubleValue'?: (number); + 'stringValue'?: (Buffer); + 'aggregateValue'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts new file mode 100644 index 00000000..e14489ab --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts @@ -0,0 +1,24 @@ +// Original file: null + +import type { NullValue as _google_protobuf_NullValue, NullValue__Output as _google_protobuf_NullValue__Output } from './NullValue.js'; +import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from './Struct.js'; +import type { ListValue as _google_protobuf_ListValue, ListValue__Output as _google_protobuf_ListValue__Output } from './ListValue.js'; + +export interface Value { + 'nullValue'?: (_google_protobuf_NullValue); + 'numberValue'?: (number | string); + 'stringValue'?: (string); + 'boolValue'?: (boolean); + 'structValue'?: (_google_protobuf_Struct | null); + 'listValue'?: (_google_protobuf_ListValue | null); + 'kind'?: "nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"; +} + +export interface Value__Output { + 'nullValue'?: (_google_protobuf_NullValue__Output); + 'numberValue'?: (number); + 'stringValue'?: (string); + 'boolValue'?: (boolean); + 'structValue'?: (_google_protobuf_Struct__Output); + 'listValue'?: (_google_protobuf_ListValue__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts new file mode 100644 index 00000000..10f75b5f --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts @@ -0,0 +1,12 @@ +// Original file: ../../../udpa/udpa/annotations/migrate.proto + + +export interface FieldMigrateAnnotation { + 'rename'?: (string); + 'oneofPromotion'?: (string); +} + +export interface FieldMigrateAnnotation__Output { + 'rename'?: (string); + 'oneofPromotion'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts new file mode 100644 index 00000000..7246ff0e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts @@ -0,0 +1,10 @@ +// Original file: ../../../udpa/udpa/annotations/migrate.proto + + +export interface FileMigrateAnnotation { + 'moveToPackage'?: (string); +} + +export interface FileMigrateAnnotation__Output { + 'moveToPackage'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts new file mode 100644 index 00000000..65511331 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts @@ -0,0 +1,10 @@ +// Original file: ../../../udpa/udpa/annotations/migrate.proto + + +export interface MigrateAnnotation { + 'rename'?: (string); +} + +export interface MigrateAnnotation__Output { + 'rename'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts new file mode 100644 index 00000000..931bbcd4 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts @@ -0,0 +1,20 @@ +// Original file: ../../../udpa/udpa/annotations/status.proto + +export const PackageVersionStatus = { + UNKNOWN: 0, + FROZEN: 1, + ACTIVE: 2, + NEXT_MAJOR_VERSION_CANDIDATE: 3, +} as const; + +export type PackageVersionStatus = + | 'UNKNOWN' + | 0 + | 'FROZEN' + | 1 + | 'ACTIVE' + | 2 + | 'NEXT_MAJOR_VERSION_CANDIDATE' + | 3 + +export type PackageVersionStatus__Output = typeof PackageVersionStatus[keyof typeof PackageVersionStatus] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts new file mode 100644 index 00000000..4048b8c6 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts @@ -0,0 +1,13 @@ +// Original file: ../../../udpa/udpa/annotations/status.proto + +import type { PackageVersionStatus as _udpa_annotations_PackageVersionStatus, PackageVersionStatus__Output as _udpa_annotations_PackageVersionStatus__Output } from './PackageVersionStatus.js'; + +export interface StatusAnnotation { + 'workInProgress'?: (boolean); + 'packageVersionStatus'?: (_udpa_annotations_PackageVersionStatus); +} + +export interface StatusAnnotation__Output { + 'workInProgress'?: (boolean); + 'packageVersionStatus'?: (_udpa_annotations_PackageVersionStatus__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts new file mode 100644 index 00000000..2797b956 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts @@ -0,0 +1,10 @@ +// Original file: ../../../udpa/udpa/annotations/versioning.proto + + +export interface VersioningAnnotation { + 'previousMessageType'?: (string); +} + +export interface VersioningAnnotation__Output { + 'previousMessageType'?: (string); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts new file mode 100644 index 00000000..94fb2c04 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts @@ -0,0 +1,14 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface AnyRules { + 'required'?: (boolean); + 'in'?: (string)[]; + 'notIn'?: (string)[]; +} + +export interface AnyRules__Output { + 'required'?: (boolean); + 'in'?: (string)[]; + 'notIn'?: (string)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts new file mode 100644 index 00000000..d89f9592 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts @@ -0,0 +1,10 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface BoolRules { + 'const'?: (boolean); +} + +export interface BoolRules__Output { + 'const'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts new file mode 100644 index 00000000..1688c270 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts @@ -0,0 +1,38 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface BytesRules { + 'const'?: (Buffer | Uint8Array | string); + 'minLen'?: (number | string | Long); + 'maxLen'?: (number | string | Long); + 'pattern'?: (string); + 'prefix'?: (Buffer | Uint8Array | string); + 'suffix'?: (Buffer | Uint8Array | string); + 'contains'?: (Buffer | Uint8Array | string); + 'in'?: (Buffer | Uint8Array | string)[]; + 'notIn'?: (Buffer | Uint8Array | string)[]; + 'ip'?: (boolean); + 'ipv4'?: (boolean); + 'ipv6'?: (boolean); + 'len'?: (number | string | Long); + 'ignoreEmpty'?: (boolean); + 'wellKnown'?: "ip"|"ipv4"|"ipv6"; +} + +export interface BytesRules__Output { + 'const'?: (Buffer); + 'minLen'?: (Long); + 'maxLen'?: (Long); + 'pattern'?: (string); + 'prefix'?: (Buffer); + 'suffix'?: (Buffer); + 'contains'?: (Buffer); + 'in'?: (Buffer)[]; + 'notIn'?: (Buffer)[]; + 'ip'?: (boolean); + 'ipv4'?: (boolean); + 'ipv6'?: (boolean); + 'len'?: (Long); + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts new file mode 100644 index 00000000..29c5c90c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface DoubleRules { + 'const'?: (number | string); + 'lt'?: (number | string); + 'lte'?: (number | string); + 'gt'?: (number | string); + 'gte'?: (number | string); + 'in'?: (number | string)[]; + 'notIn'?: (number | string)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface DoubleRules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts new file mode 100644 index 00000000..426e2e64 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts @@ -0,0 +1,25 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../google/protobuf/Duration.js'; + +export interface DurationRules { + 'required'?: (boolean); + 'const'?: (_google_protobuf_Duration | null); + 'lt'?: (_google_protobuf_Duration | null); + 'lte'?: (_google_protobuf_Duration | null); + 'gt'?: (_google_protobuf_Duration | null); + 'gte'?: (_google_protobuf_Duration | null); + 'in'?: (_google_protobuf_Duration)[]; + 'notIn'?: (_google_protobuf_Duration)[]; +} + +export interface DurationRules__Output { + 'required'?: (boolean); + 'const'?: (_google_protobuf_Duration__Output); + 'lt'?: (_google_protobuf_Duration__Output); + 'lte'?: (_google_protobuf_Duration__Output); + 'gt'?: (_google_protobuf_Duration__Output); + 'gte'?: (_google_protobuf_Duration__Output); + 'in'?: (_google_protobuf_Duration__Output)[]; + 'notIn'?: (_google_protobuf_Duration__Output)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts new file mode 100644 index 00000000..a448fa80 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts @@ -0,0 +1,16 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface EnumRules { + 'const'?: (number); + 'definedOnly'?: (boolean); + 'in'?: (number)[]; + 'notIn'?: (number)[]; +} + +export interface EnumRules__Output { + 'const'?: (number); + 'definedOnly'?: (boolean); + 'in'?: (number)[]; + 'notIn'?: (number)[]; +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts new file mode 100644 index 00000000..27858a4b --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts @@ -0,0 +1,75 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { FloatRules as _validate_FloatRules, FloatRules__Output as _validate_FloatRules__Output } from './FloatRules.js'; +import type { DoubleRules as _validate_DoubleRules, DoubleRules__Output as _validate_DoubleRules__Output } from './DoubleRules.js'; +import type { Int32Rules as _validate_Int32Rules, Int32Rules__Output as _validate_Int32Rules__Output } from './Int32Rules.js'; +import type { Int64Rules as _validate_Int64Rules, Int64Rules__Output as _validate_Int64Rules__Output } from './Int64Rules.js'; +import type { UInt32Rules as _validate_UInt32Rules, UInt32Rules__Output as _validate_UInt32Rules__Output } from './UInt32Rules.js'; +import type { UInt64Rules as _validate_UInt64Rules, UInt64Rules__Output as _validate_UInt64Rules__Output } from './UInt64Rules.js'; +import type { SInt32Rules as _validate_SInt32Rules, SInt32Rules__Output as _validate_SInt32Rules__Output } from './SInt32Rules.js'; +import type { SInt64Rules as _validate_SInt64Rules, SInt64Rules__Output as _validate_SInt64Rules__Output } from './SInt64Rules.js'; +import type { Fixed32Rules as _validate_Fixed32Rules, Fixed32Rules__Output as _validate_Fixed32Rules__Output } from './Fixed32Rules.js'; +import type { Fixed64Rules as _validate_Fixed64Rules, Fixed64Rules__Output as _validate_Fixed64Rules__Output } from './Fixed64Rules.js'; +import type { SFixed32Rules as _validate_SFixed32Rules, SFixed32Rules__Output as _validate_SFixed32Rules__Output } from './SFixed32Rules.js'; +import type { SFixed64Rules as _validate_SFixed64Rules, SFixed64Rules__Output as _validate_SFixed64Rules__Output } from './SFixed64Rules.js'; +import type { BoolRules as _validate_BoolRules, BoolRules__Output as _validate_BoolRules__Output } from './BoolRules.js'; +import type { StringRules as _validate_StringRules, StringRules__Output as _validate_StringRules__Output } from './StringRules.js'; +import type { BytesRules as _validate_BytesRules, BytesRules__Output as _validate_BytesRules__Output } from './BytesRules.js'; +import type { EnumRules as _validate_EnumRules, EnumRules__Output as _validate_EnumRules__Output } from './EnumRules.js'; +import type { MessageRules as _validate_MessageRules, MessageRules__Output as _validate_MessageRules__Output } from './MessageRules.js'; +import type { RepeatedRules as _validate_RepeatedRules, RepeatedRules__Output as _validate_RepeatedRules__Output } from './RepeatedRules.js'; +import type { MapRules as _validate_MapRules, MapRules__Output as _validate_MapRules__Output } from './MapRules.js'; +import type { AnyRules as _validate_AnyRules, AnyRules__Output as _validate_AnyRules__Output } from './AnyRules.js'; +import type { DurationRules as _validate_DurationRules, DurationRules__Output as _validate_DurationRules__Output } from './DurationRules.js'; +import type { TimestampRules as _validate_TimestampRules, TimestampRules__Output as _validate_TimestampRules__Output } from './TimestampRules.js'; + +export interface FieldRules { + 'float'?: (_validate_FloatRules | null); + 'double'?: (_validate_DoubleRules | null); + 'int32'?: (_validate_Int32Rules | null); + 'int64'?: (_validate_Int64Rules | null); + 'uint32'?: (_validate_UInt32Rules | null); + 'uint64'?: (_validate_UInt64Rules | null); + 'sint32'?: (_validate_SInt32Rules | null); + 'sint64'?: (_validate_SInt64Rules | null); + 'fixed32'?: (_validate_Fixed32Rules | null); + 'fixed64'?: (_validate_Fixed64Rules | null); + 'sfixed32'?: (_validate_SFixed32Rules | null); + 'sfixed64'?: (_validate_SFixed64Rules | null); + 'bool'?: (_validate_BoolRules | null); + 'string'?: (_validate_StringRules | null); + 'bytes'?: (_validate_BytesRules | null); + 'enum'?: (_validate_EnumRules | null); + 'message'?: (_validate_MessageRules | null); + 'repeated'?: (_validate_RepeatedRules | null); + 'map'?: (_validate_MapRules | null); + 'any'?: (_validate_AnyRules | null); + 'duration'?: (_validate_DurationRules | null); + 'timestamp'?: (_validate_TimestampRules | null); + 'type'?: "float"|"double"|"int32"|"int64"|"uint32"|"uint64"|"sint32"|"sint64"|"fixed32"|"fixed64"|"sfixed32"|"sfixed64"|"bool"|"string"|"bytes"|"enum"|"repeated"|"map"|"any"|"duration"|"timestamp"; +} + +export interface FieldRules__Output { + 'float'?: (_validate_FloatRules__Output); + 'double'?: (_validate_DoubleRules__Output); + 'int32'?: (_validate_Int32Rules__Output); + 'int64'?: (_validate_Int64Rules__Output); + 'uint32'?: (_validate_UInt32Rules__Output); + 'uint64'?: (_validate_UInt64Rules__Output); + 'sint32'?: (_validate_SInt32Rules__Output); + 'sint64'?: (_validate_SInt64Rules__Output); + 'fixed32'?: (_validate_Fixed32Rules__Output); + 'fixed64'?: (_validate_Fixed64Rules__Output); + 'sfixed32'?: (_validate_SFixed32Rules__Output); + 'sfixed64'?: (_validate_SFixed64Rules__Output); + 'bool'?: (_validate_BoolRules__Output); + 'string'?: (_validate_StringRules__Output); + 'bytes'?: (_validate_BytesRules__Output); + 'enum'?: (_validate_EnumRules__Output); + 'message'?: (_validate_MessageRules__Output); + 'repeated'?: (_validate_RepeatedRules__Output); + 'map'?: (_validate_MapRules__Output); + 'any'?: (_validate_AnyRules__Output); + 'duration'?: (_validate_DurationRules__Output); + 'timestamp'?: (_validate_TimestampRules__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts new file mode 100644 index 00000000..499420ac --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface Fixed32Rules { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface Fixed32Rules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts new file mode 100644 index 00000000..538ae7df --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts @@ -0,0 +1,25 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface Fixed64Rules { + 'const'?: (number | string | Long); + 'lt'?: (number | string | Long); + 'lte'?: (number | string | Long); + 'gt'?: (number | string | Long); + 'gte'?: (number | string | Long); + 'in'?: (number | string | Long)[]; + 'notIn'?: (number | string | Long)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface Fixed64Rules__Output { + 'const'?: (Long); + 'lt'?: (Long); + 'lte'?: (Long); + 'gt'?: (Long); + 'gte'?: (Long); + 'in'?: (Long)[]; + 'notIn'?: (Long)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts new file mode 100644 index 00000000..7bee5f92 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface FloatRules { + 'const'?: (number | string); + 'lt'?: (number | string); + 'lte'?: (number | string); + 'gt'?: (number | string); + 'gte'?: (number | string); + 'in'?: (number | string)[]; + 'notIn'?: (number | string)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface FloatRules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts new file mode 100644 index 00000000..bf708ce5 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface Int32Rules { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface Int32Rules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts new file mode 100644 index 00000000..092a4749 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts @@ -0,0 +1,25 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface Int64Rules { + 'const'?: (number | string | Long); + 'lt'?: (number | string | Long); + 'lte'?: (number | string | Long); + 'gt'?: (number | string | Long); + 'gte'?: (number | string | Long); + 'in'?: (number | string | Long)[]; + 'notIn'?: (number | string | Long)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface Int64Rules__Output { + 'const'?: (Long); + 'lt'?: (Long); + 'lte'?: (Long); + 'gt'?: (Long); + 'gte'?: (Long); + 'in'?: (Long)[]; + 'notIn'?: (Long)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts new file mode 100644 index 00000000..2a65528d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts @@ -0,0 +1,17 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +export const KnownRegex = { + UNKNOWN: 0, + HTTP_HEADER_NAME: 1, + HTTP_HEADER_VALUE: 2, +} as const; + +export type KnownRegex = + | 'UNKNOWN' + | 0 + | 'HTTP_HEADER_NAME' + | 1 + | 'HTTP_HEADER_VALUE' + | 2 + +export type KnownRegex__Output = typeof KnownRegex[keyof typeof KnownRegex] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts new file mode 100644 index 00000000..3abbf204 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts @@ -0,0 +1,22 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './FieldRules.js'; +import type { Long } from '@grpc/proto-loader'; + +export interface MapRules { + 'minPairs'?: (number | string | Long); + 'maxPairs'?: (number | string | Long); + 'noSparse'?: (boolean); + 'keys'?: (_validate_FieldRules | null); + 'values'?: (_validate_FieldRules | null); + 'ignoreEmpty'?: (boolean); +} + +export interface MapRules__Output { + 'minPairs'?: (Long); + 'maxPairs'?: (Long); + 'noSparse'?: (boolean); + 'keys'?: (_validate_FieldRules__Output); + 'values'?: (_validate_FieldRules__Output); + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts new file mode 100644 index 00000000..f9b29f5b --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts @@ -0,0 +1,12 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface MessageRules { + 'skip'?: (boolean); + 'required'?: (boolean); +} + +export interface MessageRules__Output { + 'skip'?: (boolean); + 'required'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts new file mode 100644 index 00000000..996aedfe --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts @@ -0,0 +1,20 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './FieldRules.js'; +import type { Long } from '@grpc/proto-loader'; + +export interface RepeatedRules { + 'minItems'?: (number | string | Long); + 'maxItems'?: (number | string | Long); + 'unique'?: (boolean); + 'items'?: (_validate_FieldRules | null); + 'ignoreEmpty'?: (boolean); +} + +export interface RepeatedRules__Output { + 'minItems'?: (Long); + 'maxItems'?: (Long); + 'unique'?: (boolean); + 'items'?: (_validate_FieldRules__Output); + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts new file mode 100644 index 00000000..7c1f4af6 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface SFixed32Rules { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface SFixed32Rules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts new file mode 100644 index 00000000..368d9df4 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts @@ -0,0 +1,25 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface SFixed64Rules { + 'const'?: (number | string | Long); + 'lt'?: (number | string | Long); + 'lte'?: (number | string | Long); + 'gt'?: (number | string | Long); + 'gte'?: (number | string | Long); + 'in'?: (number | string | Long)[]; + 'notIn'?: (number | string | Long)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface SFixed64Rules__Output { + 'const'?: (Long); + 'lt'?: (Long); + 'lte'?: (Long); + 'gt'?: (Long); + 'gte'?: (Long); + 'in'?: (Long)[]; + 'notIn'?: (Long)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts new file mode 100644 index 00000000..7cd2a837 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface SInt32Rules { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface SInt32Rules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts new file mode 100644 index 00000000..268d5c25 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts @@ -0,0 +1,25 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface SInt64Rules { + 'const'?: (number | string | Long); + 'lt'?: (number | string | Long); + 'lte'?: (number | string | Long); + 'gt'?: (number | string | Long); + 'gte'?: (number | string | Long); + 'in'?: (number | string | Long)[]; + 'notIn'?: (number | string | Long)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface SInt64Rules__Output { + 'const'?: (Long); + 'lt'?: (Long); + 'lte'?: (Long); + 'gt'?: (Long); + 'gte'?: (Long); + 'in'?: (Long)[]; + 'notIn'?: (Long)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts new file mode 100644 index 00000000..9856dc0a --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts @@ -0,0 +1,63 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { KnownRegex as _validate_KnownRegex, KnownRegex__Output as _validate_KnownRegex__Output } from './KnownRegex.js'; +import type { Long } from '@grpc/proto-loader'; + +export interface StringRules { + 'const'?: (string); + 'minLen'?: (number | string | Long); + 'maxLen'?: (number | string | Long); + 'minBytes'?: (number | string | Long); + 'maxBytes'?: (number | string | Long); + 'pattern'?: (string); + 'prefix'?: (string); + 'suffix'?: (string); + 'contains'?: (string); + 'in'?: (string)[]; + 'notIn'?: (string)[]; + 'email'?: (boolean); + 'hostname'?: (boolean); + 'ip'?: (boolean); + 'ipv4'?: (boolean); + 'ipv6'?: (boolean); + 'uri'?: (boolean); + 'uriRef'?: (boolean); + 'len'?: (number | string | Long); + 'lenBytes'?: (number | string | Long); + 'address'?: (boolean); + 'uuid'?: (boolean); + 'notContains'?: (string); + 'wellKnownRegex'?: (_validate_KnownRegex); + 'strict'?: (boolean); + 'ignoreEmpty'?: (boolean); + 'wellKnown'?: "email"|"hostname"|"ip"|"ipv4"|"ipv6"|"uri"|"uriRef"|"address"|"uuid"|"wellKnownRegex"; +} + +export interface StringRules__Output { + 'const'?: (string); + 'minLen'?: (Long); + 'maxLen'?: (Long); + 'minBytes'?: (Long); + 'maxBytes'?: (Long); + 'pattern'?: (string); + 'prefix'?: (string); + 'suffix'?: (string); + 'contains'?: (string); + 'in'?: (string)[]; + 'notIn'?: (string)[]; + 'email'?: (boolean); + 'hostname'?: (boolean); + 'ip'?: (boolean); + 'ipv4'?: (boolean); + 'ipv6'?: (boolean); + 'uri'?: (boolean); + 'uriRef'?: (boolean); + 'len'?: (Long); + 'lenBytes'?: (Long); + 'address'?: (boolean); + 'uuid'?: (boolean); + 'notContains'?: (string); + 'wellKnownRegex'?: (_validate_KnownRegex__Output); + 'strict'?: (boolean); + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts new file mode 100644 index 00000000..3d405293 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts @@ -0,0 +1,28 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../google/protobuf/Timestamp.js'; +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../google/protobuf/Duration.js'; + +export interface TimestampRules { + 'required'?: (boolean); + 'const'?: (_google_protobuf_Timestamp | null); + 'lt'?: (_google_protobuf_Timestamp | null); + 'lte'?: (_google_protobuf_Timestamp | null); + 'gt'?: (_google_protobuf_Timestamp | null); + 'gte'?: (_google_protobuf_Timestamp | null); + 'ltNow'?: (boolean); + 'gtNow'?: (boolean); + 'within'?: (_google_protobuf_Duration | null); +} + +export interface TimestampRules__Output { + 'required'?: (boolean); + 'const'?: (_google_protobuf_Timestamp__Output); + 'lt'?: (_google_protobuf_Timestamp__Output); + 'lte'?: (_google_protobuf_Timestamp__Output); + 'gt'?: (_google_protobuf_Timestamp__Output); + 'gte'?: (_google_protobuf_Timestamp__Output); + 'ltNow'?: (boolean); + 'gtNow'?: (boolean); + 'within'?: (_google_protobuf_Duration__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts new file mode 100644 index 00000000..e5d8e3be --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts @@ -0,0 +1,24 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + + +export interface UInt32Rules { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface UInt32Rules__Output { + 'const'?: (number); + 'lt'?: (number); + 'lte'?: (number); + 'gt'?: (number); + 'gte'?: (number); + 'in'?: (number)[]; + 'notIn'?: (number)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts new file mode 100644 index 00000000..7efbb4b2 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts @@ -0,0 +1,25 @@ +// Original file: ../../../protoc-gen-validate/validate/validate.proto + +import type { Long } from '@grpc/proto-loader'; + +export interface UInt64Rules { + 'const'?: (number | string | Long); + 'lt'?: (number | string | Long); + 'lte'?: (number | string | Long); + 'gt'?: (number | string | Long); + 'gte'?: (number | string | Long); + 'in'?: (number | string | Long)[]; + 'notIn'?: (number | string | Long)[]; + 'ignoreEmpty'?: (boolean); +} + +export interface UInt64Rules__Output { + 'const'?: (Long); + 'lt'?: (Long); + 'lte'?: (Long); + 'gt'?: (Long); + 'gte'?: (Long); + 'in'?: (Long)[]; + 'notIn'?: (Long)[]; + 'ignoreEmpty'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts new file mode 100644 index 00000000..82eadf86 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts @@ -0,0 +1,10 @@ +// Original file: ../../../xds/xds/annotations/v3/status.proto + + +export interface FieldStatusAnnotation { + 'workInProgress'?: (boolean); +} + +export interface FieldStatusAnnotation__Output { + 'workInProgress'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts new file mode 100644 index 00000000..43cabe9e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts @@ -0,0 +1,10 @@ +// Original file: ../../../xds/xds/annotations/v3/status.proto + + +export interface FileStatusAnnotation { + 'workInProgress'?: (boolean); +} + +export interface FileStatusAnnotation__Output { + 'workInProgress'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts new file mode 100644 index 00000000..3eff2788 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts @@ -0,0 +1,10 @@ +// Original file: ../../../xds/xds/annotations/v3/status.proto + + +export interface MessageStatusAnnotation { + 'workInProgress'?: (boolean); +} + +export interface MessageStatusAnnotation__Output { + 'workInProgress'?: (boolean); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts new file mode 100644 index 00000000..ede75c75 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts @@ -0,0 +1,20 @@ +// Original file: ../../../xds/xds/annotations/v3/status.proto + +export const PackageVersionStatus = { + UNKNOWN: 0, + FROZEN: 1, + ACTIVE: 2, + NEXT_MAJOR_VERSION_CANDIDATE: 3, +} as const; + +export type PackageVersionStatus = + | 'UNKNOWN' + | 0 + | 'FROZEN' + | 1 + | 'ACTIVE' + | 2 + | 'NEXT_MAJOR_VERSION_CANDIDATE' + | 3 + +export type PackageVersionStatus__Output = typeof PackageVersionStatus[keyof typeof PackageVersionStatus] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts new file mode 100644 index 00000000..c370824a --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts @@ -0,0 +1,13 @@ +// Original file: ../../../xds/xds/annotations/v3/status.proto + +import type { PackageVersionStatus as _xds_annotations_v3_PackageVersionStatus, PackageVersionStatus__Output as _xds_annotations_v3_PackageVersionStatus__Output } from './PackageVersionStatus.js'; + +export interface StatusAnnotation { + 'workInProgress'?: (boolean); + 'packageVersionStatus'?: (_xds_annotations_v3_PackageVersionStatus); +} + +export interface StatusAnnotation__Output { + 'workInProgress'?: (boolean); + 'packageVersionStatus'?: (_xds_annotations_v3_PackageVersionStatus__Output); +} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts new file mode 100644 index 00000000..a8bbbf67 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts @@ -0,0 +1,10 @@ +// Original file: ../../../udpa/xds/core/v3/context_params.proto + + +export interface ContextParams { + 'params'?: ({[key: string]: string}); +} + +export interface ContextParams__Output { + 'params'?: ({[key: string]: string}); +} diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index 7f4d7c13..b4c5944d 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -58,6 +58,9 @@ const adapter: NextAdapter = { nextBuildDirectory, ); + console.log(context.outputs.prerenders.filter(it => !!it.pprChain && it.config.renderingMode === "PARTIALLY_STATIC").map(it => it.pathname)); + console.log(context.outputs); + const adapterMetadata = getAdapterMetadata(); const root = process.cwd(); diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts new file mode 100644 index 00000000..3eecf267 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts @@ -0,0 +1,9 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/annotations/deprecation.proto + +/* eslint-disable */ + +export const protobufPackage = "envoy.annotations"; diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts new file mode 100644 index 00000000..2cfd89f3 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts @@ -0,0 +1,1099 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/config/core/v3/address.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { BoolValue, UInt32Value } from "../../../../google/protobuf/wrappers.js"; +import { TypedExtensionConfig } from "./extension.js"; +import { SocketOption, SocketOptionsOverride } from "./socket_option.js"; + +export const protobufPackage = "envoy.config.core.v3"; + +export interface Pipe { + /** + * Unix Domain Socket path. On Linux, paths starting with '@' will use the + * abstract namespace. The starting '@' is replaced by a null byte by Envoy. + * Paths starting with '@' will result in an error in environments other than + * Linux. + */ + path: string; + /** The mode for the Pipe. Not applicable for abstract sockets. */ + mode: number; +} + +/** + * The address represents an envoy internal listener. + * [#comment: TODO(asraa): When address available, remove workaround from test/server/server_fuzz_test.cc:30.] + */ +export interface EnvoyInternalAddress { + /** + * Specifies the :ref:`name ` of the + * internal listener. + */ + serverListenerName?: + | string + | undefined; + /** + * Specifies an endpoint identifier to distinguish between multiple endpoints for the same internal listener in a + * single upstream pool. Only used in the upstream addresses for tracking changes to individual endpoints. This, for + * example, may be set to the final destination IP for the target internal listener. + */ + endpointId: string; +} + +/** [#next-free-field: 8] */ +export interface SocketAddress { + protocol: SocketAddress_Protocol; + /** + * The address for this socket. :ref:`Listeners ` will bind + * to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` + * to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: + * It is possible to distinguish a Listener address via the prefix/suffix matching + * in :ref:`FilterChainMatch `.] When used + * within an upstream :ref:`BindConfig `, the address + * controls the source address of outbound connections. For :ref:`clusters + * `, the cluster type determines whether the + * address must be an IP (``STATIC`` or ``EDS`` clusters) or a hostname resolved by DNS + * (``STRICT_DNS`` or ``LOGICAL_DNS`` clusters). Address resolution can be customized + * via :ref:`resolver_name `. + */ + address: string; + portValue?: + | number + | undefined; + /** + * This is only valid if :ref:`resolver_name + * ` is specified below and the + * named resolver is capable of named port resolution. + */ + namedPort?: + | string + | undefined; + /** + * The name of the custom resolver. This must have been registered with Envoy. If + * this is empty, a context dependent default applies. If the address is a concrete + * IP address, no resolution will occur. If address is a hostname this + * should be set for resolution other than DNS. Specifying a custom resolver with + * ``STRICT_DNS`` or ``LOGICAL_DNS`` will generate an error at runtime. + */ + resolverName: string; + /** + * When binding to an IPv6 address above, this enables `IPv4 compatibility + * `_. Binding to ``::`` will + * allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into + * IPv6 space as ``::FFFF:``. + */ + ipv4Compat: boolean; + /** + * Filepath that specifies the Linux network namespace this socket will be created in (see ``man 7 + * network_namespaces``). If this field is set, Envoy will create the socket in the specified + * network namespace. + * + * .. note:: + * Setting this parameter requires Envoy to run with the ``CAP_NET_ADMIN`` capability. + * + * .. attention:: + * Network namespaces are only configurable on Linux. Otherwise, this field has no effect. + */ + networkNamespaceFilepath: string; +} + +export enum SocketAddress_Protocol { + TCP = 0, + UDP = 1, + UNRECOGNIZED = -1, +} + +export function socketAddress_ProtocolFromJSON(object: any): SocketAddress_Protocol { + switch (object) { + case 0: + case "TCP": + return SocketAddress_Protocol.TCP; + case 1: + case "UDP": + return SocketAddress_Protocol.UDP; + case -1: + case "UNRECOGNIZED": + default: + return SocketAddress_Protocol.UNRECOGNIZED; + } +} + +export function socketAddress_ProtocolToJSON(object: SocketAddress_Protocol): string { + switch (object) { + case SocketAddress_Protocol.TCP: + return "TCP"; + case SocketAddress_Protocol.UDP: + return "UDP"; + case SocketAddress_Protocol.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface TcpKeepalive { + /** + * Maximum number of keepalive probes to send without response before deciding + * the connection is dead. Default is to use the OS level configuration (unless + * overridden, Linux defaults to 9.) + */ + keepaliveProbes: + | number + | undefined; + /** + * The number of seconds a connection needs to be idle before keep-alive probes + * start being sent. Default is to use the OS level configuration (unless + * overridden, Linux defaults to 7200s (i.e., 2 hours.) + */ + keepaliveTime: + | number + | undefined; + /** + * The number of seconds between keep-alive probes. Default is to use the OS + * level configuration (unless overridden, Linux defaults to 75s.) + */ + keepaliveInterval: number | undefined; +} + +export interface ExtraSourceAddress { + /** The additional address to bind. */ + address: + | SocketAddress + | undefined; + /** + * Additional socket options that may not be present in Envoy source code or + * precompiled binaries. If specified, this will override the + * :ref:`socket_options ` + * in the BindConfig. If specified with no + * :ref:`socket_options ` + * or an empty list of :ref:`socket_options `, + * it means no socket option will apply. + */ + socketOptions: SocketOptionsOverride | undefined; +} + +/** [#next-free-field: 7] */ +export interface BindConfig { + /** The address to bind to when creating a socket. */ + sourceAddress: + | SocketAddress + | undefined; + /** + * Whether to set the ``IP_FREEBIND`` option when creating the socket. When this + * flag is set to true, allows the :ref:`source_address + * ` to be an IP address + * that is not configured on the system running Envoy. When this flag is set + * to false, the option ``IP_FREEBIND`` is disabled on the socket. When this + * flag is not set (default), the socket is not modified, i.e. the option is + * neither enabled nor disabled. + */ + freebind: + | boolean + | undefined; + /** + * Additional socket options that may not be present in Envoy source code or + * precompiled binaries. + */ + socketOptions: SocketOption[]; + /** + * Extra source addresses appended to the address specified in the ``source_address`` + * field. This enables to specify multiple source addresses. + * The source address selection is determined by :ref:`local_address_selector + * `. + */ + extraSourceAddresses: ExtraSourceAddress[]; + /** + * Deprecated by + * :ref:`extra_source_addresses ` + * + * @deprecated + */ + additionalSourceAddresses: SocketAddress[]; + /** + * Custom local address selector to override the default (i.e. + * :ref:`DefaultLocalAddressSelector + * `). + * [#extension-category: envoy.upstream.local_address_selector] + */ + localAddressSelector: TypedExtensionConfig | undefined; +} + +/** + * Addresses specify either a logical or physical address and port, which are + * used to tell Envoy where to bind/listen, connect to upstream and find + * management servers. + */ +export interface Address { + socketAddress?: SocketAddress | undefined; + pipe?: + | Pipe + | undefined; + /** + * Specifies a user-space address handled by :ref:`internal listeners + * `. + */ + envoyInternalAddress?: EnvoyInternalAddress | undefined; +} + +/** + * CidrRange specifies an IP Address and a prefix length to construct + * the subnet mask for a `CIDR `_ range. + */ +export interface CidrRange { + /** IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``. */ + addressPrefix: string; + /** Length of prefix, e.g. 0, 32. Defaults to 0 when unset. */ + prefixLen: number | undefined; +} + +function createBasePipe(): Pipe { + return { path: "", mode: 0 }; +} + +export const Pipe: MessageFns = { + encode(message: Pipe, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.mode !== 0) { + writer.uint32(16).uint32(message.mode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Pipe { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePipe(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.path = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.mode = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Pipe { + return { + path: isSet(object.path) ? globalThis.String(object.path) : "", + mode: isSet(object.mode) ? globalThis.Number(object.mode) : 0, + }; + }, + + toJSON(message: Pipe): unknown { + const obj: any = {}; + if (message.path !== "") { + obj.path = message.path; + } + if (message.mode !== 0) { + obj.mode = Math.round(message.mode); + } + return obj; + }, + + create, I>>(base?: I): Pipe { + return Pipe.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Pipe { + const message = createBasePipe(); + message.path = object.path ?? ""; + message.mode = object.mode ?? 0; + return message; + }, +}; + +function createBaseEnvoyInternalAddress(): EnvoyInternalAddress { + return { serverListenerName: undefined, endpointId: "" }; +} + +export const EnvoyInternalAddress: MessageFns = { + encode(message: EnvoyInternalAddress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.serverListenerName !== undefined) { + writer.uint32(10).string(message.serverListenerName); + } + if (message.endpointId !== "") { + writer.uint32(18).string(message.endpointId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnvoyInternalAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnvoyInternalAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.serverListenerName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.endpointId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnvoyInternalAddress { + return { + serverListenerName: isSet(object.serverListenerName) ? globalThis.String(object.serverListenerName) : undefined, + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + }; + }, + + toJSON(message: EnvoyInternalAddress): unknown { + const obj: any = {}; + if (message.serverListenerName !== undefined) { + obj.serverListenerName = message.serverListenerName; + } + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + return obj; + }, + + create, I>>(base?: I): EnvoyInternalAddress { + return EnvoyInternalAddress.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): EnvoyInternalAddress { + const message = createBaseEnvoyInternalAddress(); + message.serverListenerName = object.serverListenerName ?? undefined; + message.endpointId = object.endpointId ?? ""; + return message; + }, +}; + +function createBaseSocketAddress(): SocketAddress { + return { + protocol: 0, + address: "", + portValue: undefined, + namedPort: undefined, + resolverName: "", + ipv4Compat: false, + networkNamespaceFilepath: "", + }; +} + +export const SocketAddress: MessageFns = { + encode(message: SocketAddress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.protocol !== 0) { + writer.uint32(8).int32(message.protocol); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.portValue !== undefined) { + writer.uint32(24).uint32(message.portValue); + } + if (message.namedPort !== undefined) { + writer.uint32(34).string(message.namedPort); + } + if (message.resolverName !== "") { + writer.uint32(42).string(message.resolverName); + } + if (message.ipv4Compat !== false) { + writer.uint32(48).bool(message.ipv4Compat); + } + if (message.networkNamespaceFilepath !== "") { + writer.uint32(58).string(message.networkNamespaceFilepath); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SocketAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSocketAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.protocol = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.address = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.portValue = reader.uint32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.namedPort = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.resolverName = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.ipv4Compat = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.networkNamespaceFilepath = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SocketAddress { + return { + protocol: isSet(object.protocol) ? socketAddress_ProtocolFromJSON(object.protocol) : 0, + address: isSet(object.address) ? globalThis.String(object.address) : "", + portValue: isSet(object.portValue) ? globalThis.Number(object.portValue) : undefined, + namedPort: isSet(object.namedPort) ? globalThis.String(object.namedPort) : undefined, + resolverName: isSet(object.resolverName) ? globalThis.String(object.resolverName) : "", + ipv4Compat: isSet(object.ipv4Compat) ? globalThis.Boolean(object.ipv4Compat) : false, + networkNamespaceFilepath: isSet(object.networkNamespaceFilepath) + ? globalThis.String(object.networkNamespaceFilepath) + : "", + }; + }, + + toJSON(message: SocketAddress): unknown { + const obj: any = {}; + if (message.protocol !== 0) { + obj.protocol = socketAddress_ProtocolToJSON(message.protocol); + } + if (message.address !== "") { + obj.address = message.address; + } + if (message.portValue !== undefined) { + obj.portValue = Math.round(message.portValue); + } + if (message.namedPort !== undefined) { + obj.namedPort = message.namedPort; + } + if (message.resolverName !== "") { + obj.resolverName = message.resolverName; + } + if (message.ipv4Compat !== false) { + obj.ipv4Compat = message.ipv4Compat; + } + if (message.networkNamespaceFilepath !== "") { + obj.networkNamespaceFilepath = message.networkNamespaceFilepath; + } + return obj; + }, + + create, I>>(base?: I): SocketAddress { + return SocketAddress.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SocketAddress { + const message = createBaseSocketAddress(); + message.protocol = object.protocol ?? 0; + message.address = object.address ?? ""; + message.portValue = object.portValue ?? undefined; + message.namedPort = object.namedPort ?? undefined; + message.resolverName = object.resolverName ?? ""; + message.ipv4Compat = object.ipv4Compat ?? false; + message.networkNamespaceFilepath = object.networkNamespaceFilepath ?? ""; + return message; + }, +}; + +function createBaseTcpKeepalive(): TcpKeepalive { + return { keepaliveProbes: undefined, keepaliveTime: undefined, keepaliveInterval: undefined }; +} + +export const TcpKeepalive: MessageFns = { + encode(message: TcpKeepalive, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.keepaliveProbes !== undefined) { + UInt32Value.encode({ value: message.keepaliveProbes! }, writer.uint32(10).fork()).join(); + } + if (message.keepaliveTime !== undefined) { + UInt32Value.encode({ value: message.keepaliveTime! }, writer.uint32(18).fork()).join(); + } + if (message.keepaliveInterval !== undefined) { + UInt32Value.encode({ value: message.keepaliveInterval! }, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TcpKeepalive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTcpKeepalive(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.keepaliveProbes = UInt32Value.decode(reader, reader.uint32()).value; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.keepaliveTime = UInt32Value.decode(reader, reader.uint32()).value; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.keepaliveInterval = UInt32Value.decode(reader, reader.uint32()).value; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TcpKeepalive { + return { + keepaliveProbes: isSet(object.keepaliveProbes) ? Number(object.keepaliveProbes) : undefined, + keepaliveTime: isSet(object.keepaliveTime) ? Number(object.keepaliveTime) : undefined, + keepaliveInterval: isSet(object.keepaliveInterval) ? Number(object.keepaliveInterval) : undefined, + }; + }, + + toJSON(message: TcpKeepalive): unknown { + const obj: any = {}; + if (message.keepaliveProbes !== undefined) { + obj.keepaliveProbes = message.keepaliveProbes; + } + if (message.keepaliveTime !== undefined) { + obj.keepaliveTime = message.keepaliveTime; + } + if (message.keepaliveInterval !== undefined) { + obj.keepaliveInterval = message.keepaliveInterval; + } + return obj; + }, + + create, I>>(base?: I): TcpKeepalive { + return TcpKeepalive.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TcpKeepalive { + const message = createBaseTcpKeepalive(); + message.keepaliveProbes = object.keepaliveProbes ?? undefined; + message.keepaliveTime = object.keepaliveTime ?? undefined; + message.keepaliveInterval = object.keepaliveInterval ?? undefined; + return message; + }, +}; + +function createBaseExtraSourceAddress(): ExtraSourceAddress { + return { address: undefined, socketOptions: undefined }; +} + +export const ExtraSourceAddress: MessageFns = { + encode(message: ExtraSourceAddress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.address !== undefined) { + SocketAddress.encode(message.address, writer.uint32(10).fork()).join(); + } + if (message.socketOptions !== undefined) { + SocketOptionsOverride.encode(message.socketOptions, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExtraSourceAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtraSourceAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.address = SocketAddress.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.socketOptions = SocketOptionsOverride.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExtraSourceAddress { + return { + address: isSet(object.address) ? SocketAddress.fromJSON(object.address) : undefined, + socketOptions: isSet(object.socketOptions) ? SocketOptionsOverride.fromJSON(object.socketOptions) : undefined, + }; + }, + + toJSON(message: ExtraSourceAddress): unknown { + const obj: any = {}; + if (message.address !== undefined) { + obj.address = SocketAddress.toJSON(message.address); + } + if (message.socketOptions !== undefined) { + obj.socketOptions = SocketOptionsOverride.toJSON(message.socketOptions); + } + return obj; + }, + + create, I>>(base?: I): ExtraSourceAddress { + return ExtraSourceAddress.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ExtraSourceAddress { + const message = createBaseExtraSourceAddress(); + message.address = (object.address !== undefined && object.address !== null) + ? SocketAddress.fromPartial(object.address) + : undefined; + message.socketOptions = (object.socketOptions !== undefined && object.socketOptions !== null) + ? SocketOptionsOverride.fromPartial(object.socketOptions) + : undefined; + return message; + }, +}; + +function createBaseBindConfig(): BindConfig { + return { + sourceAddress: undefined, + freebind: undefined, + socketOptions: [], + extraSourceAddresses: [], + additionalSourceAddresses: [], + localAddressSelector: undefined, + }; +} + +export const BindConfig: MessageFns = { + encode(message: BindConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sourceAddress !== undefined) { + SocketAddress.encode(message.sourceAddress, writer.uint32(10).fork()).join(); + } + if (message.freebind !== undefined) { + BoolValue.encode({ value: message.freebind! }, writer.uint32(18).fork()).join(); + } + for (const v of message.socketOptions) { + SocketOption.encode(v!, writer.uint32(26).fork()).join(); + } + for (const v of message.extraSourceAddresses) { + ExtraSourceAddress.encode(v!, writer.uint32(42).fork()).join(); + } + for (const v of message.additionalSourceAddresses) { + SocketAddress.encode(v!, writer.uint32(34).fork()).join(); + } + if (message.localAddressSelector !== undefined) { + TypedExtensionConfig.encode(message.localAddressSelector, writer.uint32(50).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BindConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBindConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sourceAddress = SocketAddress.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.freebind = BoolValue.decode(reader, reader.uint32()).value; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.socketOptions.push(SocketOption.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.extraSourceAddresses.push(ExtraSourceAddress.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.additionalSourceAddresses.push(SocketAddress.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.localAddressSelector = TypedExtensionConfig.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BindConfig { + return { + sourceAddress: isSet(object.sourceAddress) ? SocketAddress.fromJSON(object.sourceAddress) : undefined, + freebind: isSet(object.freebind) ? Boolean(object.freebind) : undefined, + socketOptions: globalThis.Array.isArray(object?.socketOptions) + ? object.socketOptions.map((e: any) => SocketOption.fromJSON(e)) + : [], + extraSourceAddresses: globalThis.Array.isArray(object?.extraSourceAddresses) + ? object.extraSourceAddresses.map((e: any) => ExtraSourceAddress.fromJSON(e)) + : [], + additionalSourceAddresses: globalThis.Array.isArray(object?.additionalSourceAddresses) + ? object.additionalSourceAddresses.map((e: any) => SocketAddress.fromJSON(e)) + : [], + localAddressSelector: isSet(object.localAddressSelector) + ? TypedExtensionConfig.fromJSON(object.localAddressSelector) + : undefined, + }; + }, + + toJSON(message: BindConfig): unknown { + const obj: any = {}; + if (message.sourceAddress !== undefined) { + obj.sourceAddress = SocketAddress.toJSON(message.sourceAddress); + } + if (message.freebind !== undefined) { + obj.freebind = message.freebind; + } + if (message.socketOptions?.length) { + obj.socketOptions = message.socketOptions.map((e) => SocketOption.toJSON(e)); + } + if (message.extraSourceAddresses?.length) { + obj.extraSourceAddresses = message.extraSourceAddresses.map((e) => ExtraSourceAddress.toJSON(e)); + } + if (message.additionalSourceAddresses?.length) { + obj.additionalSourceAddresses = message.additionalSourceAddresses.map((e) => SocketAddress.toJSON(e)); + } + if (message.localAddressSelector !== undefined) { + obj.localAddressSelector = TypedExtensionConfig.toJSON(message.localAddressSelector); + } + return obj; + }, + + create, I>>(base?: I): BindConfig { + return BindConfig.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BindConfig { + const message = createBaseBindConfig(); + message.sourceAddress = (object.sourceAddress !== undefined && object.sourceAddress !== null) + ? SocketAddress.fromPartial(object.sourceAddress) + : undefined; + message.freebind = object.freebind ?? undefined; + message.socketOptions = object.socketOptions?.map((e) => SocketOption.fromPartial(e)) || []; + message.extraSourceAddresses = object.extraSourceAddresses?.map((e) => ExtraSourceAddress.fromPartial(e)) || []; + message.additionalSourceAddresses = object.additionalSourceAddresses?.map((e) => SocketAddress.fromPartial(e)) || + []; + message.localAddressSelector = (object.localAddressSelector !== undefined && object.localAddressSelector !== null) + ? TypedExtensionConfig.fromPartial(object.localAddressSelector) + : undefined; + return message; + }, +}; + +function createBaseAddress(): Address { + return { socketAddress: undefined, pipe: undefined, envoyInternalAddress: undefined }; +} + +export const Address: MessageFns
= { + encode(message: Address, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.socketAddress !== undefined) { + SocketAddress.encode(message.socketAddress, writer.uint32(10).fork()).join(); + } + if (message.pipe !== undefined) { + Pipe.encode(message.pipe, writer.uint32(18).fork()).join(); + } + if (message.envoyInternalAddress !== undefined) { + EnvoyInternalAddress.encode(message.envoyInternalAddress, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Address { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.socketAddress = SocketAddress.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.pipe = Pipe.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.envoyInternalAddress = EnvoyInternalAddress.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Address { + return { + socketAddress: isSet(object.socketAddress) ? SocketAddress.fromJSON(object.socketAddress) : undefined, + pipe: isSet(object.pipe) ? Pipe.fromJSON(object.pipe) : undefined, + envoyInternalAddress: isSet(object.envoyInternalAddress) + ? EnvoyInternalAddress.fromJSON(object.envoyInternalAddress) + : undefined, + }; + }, + + toJSON(message: Address): unknown { + const obj: any = {}; + if (message.socketAddress !== undefined) { + obj.socketAddress = SocketAddress.toJSON(message.socketAddress); + } + if (message.pipe !== undefined) { + obj.pipe = Pipe.toJSON(message.pipe); + } + if (message.envoyInternalAddress !== undefined) { + obj.envoyInternalAddress = EnvoyInternalAddress.toJSON(message.envoyInternalAddress); + } + return obj; + }, + + create, I>>(base?: I): Address { + return Address.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Address { + const message = createBaseAddress(); + message.socketAddress = (object.socketAddress !== undefined && object.socketAddress !== null) + ? SocketAddress.fromPartial(object.socketAddress) + : undefined; + message.pipe = (object.pipe !== undefined && object.pipe !== null) ? Pipe.fromPartial(object.pipe) : undefined; + message.envoyInternalAddress = (object.envoyInternalAddress !== undefined && object.envoyInternalAddress !== null) + ? EnvoyInternalAddress.fromPartial(object.envoyInternalAddress) + : undefined; + return message; + }, +}; + +function createBaseCidrRange(): CidrRange { + return { addressPrefix: "", prefixLen: undefined }; +} + +export const CidrRange: MessageFns = { + encode(message: CidrRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.addressPrefix !== "") { + writer.uint32(10).string(message.addressPrefix); + } + if (message.prefixLen !== undefined) { + UInt32Value.encode({ value: message.prefixLen! }, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CidrRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCidrRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.addressPrefix = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.prefixLen = UInt32Value.decode(reader, reader.uint32()).value; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CidrRange { + return { + addressPrefix: isSet(object.addressPrefix) ? globalThis.String(object.addressPrefix) : "", + prefixLen: isSet(object.prefixLen) ? Number(object.prefixLen) : undefined, + }; + }, + + toJSON(message: CidrRange): unknown { + const obj: any = {}; + if (message.addressPrefix !== "") { + obj.addressPrefix = message.addressPrefix; + } + if (message.prefixLen !== undefined) { + obj.prefixLen = message.prefixLen; + } + return obj; + }, + + create, I>>(base?: I): CidrRange { + return CidrRange.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CidrRange { + const message = createBaseCidrRange(); + message.addressPrefix = object.addressPrefix ?? ""; + message.prefixLen = object.prefixLen ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts new file mode 100644 index 00000000..01a2592d --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts @@ -0,0 +1,136 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/config/core/v3/backoff.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Duration } from "../../../../google/protobuf/duration.js"; + +export const protobufPackage = "envoy.config.core.v3"; + +/** Configuration defining a jittered exponential back off strategy. */ +export interface BackoffStrategy { + /** + * The base interval to be used for the next back off computation. It should + * be greater than zero and less than or equal to :ref:`max_interval + * `. + */ + baseInterval: + | Duration + | undefined; + /** + * Specifies the maximum interval between retries. This parameter is optional, + * but must be greater than or equal to the :ref:`base_interval + * ` if set. The default + * is 10 times the :ref:`base_interval + * `. + */ + maxInterval: Duration | undefined; +} + +function createBaseBackoffStrategy(): BackoffStrategy { + return { baseInterval: undefined, maxInterval: undefined }; +} + +export const BackoffStrategy: MessageFns = { + encode(message: BackoffStrategy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.baseInterval !== undefined) { + Duration.encode(message.baseInterval, writer.uint32(10).fork()).join(); + } + if (message.maxInterval !== undefined) { + Duration.encode(message.maxInterval, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BackoffStrategy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBackoffStrategy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.baseInterval = Duration.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.maxInterval = Duration.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BackoffStrategy { + return { + baseInterval: isSet(object.baseInterval) ? Duration.fromJSON(object.baseInterval) : undefined, + maxInterval: isSet(object.maxInterval) ? Duration.fromJSON(object.maxInterval) : undefined, + }; + }, + + toJSON(message: BackoffStrategy): unknown { + const obj: any = {}; + if (message.baseInterval !== undefined) { + obj.baseInterval = Duration.toJSON(message.baseInterval); + } + if (message.maxInterval !== undefined) { + obj.maxInterval = Duration.toJSON(message.maxInterval); + } + return obj; + }, + + create, I>>(base?: I): BackoffStrategy { + return BackoffStrategy.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BackoffStrategy { + const message = createBaseBackoffStrategy(); + message.baseInterval = (object.baseInterval !== undefined && object.baseInterval !== null) + ? Duration.fromPartial(object.baseInterval) + : undefined; + message.maxInterval = (object.maxInterval !== undefined && object.maxInterval !== null) + ? Duration.fromPartial(object.maxInterval) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts new file mode 100644 index 00000000..523a7fac --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts @@ -0,0 +1,3749 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/config/core/v3/base.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Any } from "../../../../google/protobuf/any.js"; +import { Struct, Value } from "../../../../google/protobuf/struct.js"; +import { BoolValue, UInt32Value } from "../../../../google/protobuf/wrappers.js"; +import { ContextParams } from "../../../../xds/core/v3/context_params.js"; +import { FractionalPercent, Percent } from "../../../type/v3/percent.js"; +import { SemanticVersion } from "../../../type/v3/semantic_version.js"; +import { Address } from "./address.js"; +import { BackoffStrategy } from "./backoff.js"; +import { HttpUri } from "./http_uri.js"; + +export const protobufPackage = "envoy.config.core.v3"; + +/** + * Envoy supports :ref:`upstream priority routing + * ` both at the route and the virtual + * cluster level. The current priority implementation uses different connection + * pool and circuit breaking settings for each priority level. This means that + * even for HTTP/2 requests, two physical connections will be used to an + * upstream host. In the future Envoy will likely support true HTTP/2 priority + * over a single upstream connection. + */ +export enum RoutingPriority { + DEFAULT = 0, + HIGH = 1, + UNRECOGNIZED = -1, +} + +export function routingPriorityFromJSON(object: any): RoutingPriority { + switch (object) { + case 0: + case "DEFAULT": + return RoutingPriority.DEFAULT; + case 1: + case "HIGH": + return RoutingPriority.HIGH; + case -1: + case "UNRECOGNIZED": + default: + return RoutingPriority.UNRECOGNIZED; + } +} + +export function routingPriorityToJSON(object: RoutingPriority): string { + switch (object) { + case RoutingPriority.DEFAULT: + return "DEFAULT"; + case RoutingPriority.HIGH: + return "HIGH"; + case RoutingPriority.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** HTTP request method. */ +export enum RequestMethod { + METHOD_UNSPECIFIED = 0, + GET = 1, + HEAD = 2, + POST = 3, + PUT = 4, + DELETE = 5, + CONNECT = 6, + OPTIONS = 7, + TRACE = 8, + PATCH = 9, + UNRECOGNIZED = -1, +} + +export function requestMethodFromJSON(object: any): RequestMethod { + switch (object) { + case 0: + case "METHOD_UNSPECIFIED": + return RequestMethod.METHOD_UNSPECIFIED; + case 1: + case "GET": + return RequestMethod.GET; + case 2: + case "HEAD": + return RequestMethod.HEAD; + case 3: + case "POST": + return RequestMethod.POST; + case 4: + case "PUT": + return RequestMethod.PUT; + case 5: + case "DELETE": + return RequestMethod.DELETE; + case 6: + case "CONNECT": + return RequestMethod.CONNECT; + case 7: + case "OPTIONS": + return RequestMethod.OPTIONS; + case 8: + case "TRACE": + return RequestMethod.TRACE; + case 9: + case "PATCH": + return RequestMethod.PATCH; + case -1: + case "UNRECOGNIZED": + default: + return RequestMethod.UNRECOGNIZED; + } +} + +export function requestMethodToJSON(object: RequestMethod): string { + switch (object) { + case RequestMethod.METHOD_UNSPECIFIED: + return "METHOD_UNSPECIFIED"; + case RequestMethod.GET: + return "GET"; + case RequestMethod.HEAD: + return "HEAD"; + case RequestMethod.POST: + return "POST"; + case RequestMethod.PUT: + return "PUT"; + case RequestMethod.DELETE: + return "DELETE"; + case RequestMethod.CONNECT: + return "CONNECT"; + case RequestMethod.OPTIONS: + return "OPTIONS"; + case RequestMethod.TRACE: + return "TRACE"; + case RequestMethod.PATCH: + return "PATCH"; + case RequestMethod.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Identifies the direction of the traffic relative to the local Envoy. */ +export enum TrafficDirection { + /** UNSPECIFIED - Default option is unspecified. */ + UNSPECIFIED = 0, + /** INBOUND - The transport is used for incoming traffic. */ + INBOUND = 1, + /** OUTBOUND - The transport is used for outgoing traffic. */ + OUTBOUND = 2, + UNRECOGNIZED = -1, +} + +export function trafficDirectionFromJSON(object: any): TrafficDirection { + switch (object) { + case 0: + case "UNSPECIFIED": + return TrafficDirection.UNSPECIFIED; + case 1: + case "INBOUND": + return TrafficDirection.INBOUND; + case 2: + case "OUTBOUND": + return TrafficDirection.OUTBOUND; + case -1: + case "UNRECOGNIZED": + default: + return TrafficDirection.UNRECOGNIZED; + } +} + +export function trafficDirectionToJSON(object: TrafficDirection): string { + switch (object) { + case TrafficDirection.UNSPECIFIED: + return "UNSPECIFIED"; + case TrafficDirection.INBOUND: + return "INBOUND"; + case TrafficDirection.OUTBOUND: + return "OUTBOUND"; + case TrafficDirection.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Identifies location of where either Envoy runs or where upstream hosts run. */ +export interface Locality { + /** Region this :ref:`zone ` belongs to. */ + region: string; + /** + * Defines the local service zone where Envoy is running. Though optional, it + * should be set if discovery service routing is used and the discovery + * service exposes :ref:`zone data `, + * either in this message or via :option:`--service-zone`. The meaning of zone + * is context dependent, e.g. `Availability Zone (AZ) + * `_ + * on AWS, `Zone `_ on + * GCP, etc. + */ + zone: string; + /** + * When used for locality of upstream hosts, this field further splits zone + * into smaller chunks of sub-zones so they can be load balanced + * independently. + */ + subZone: string; +} + +/** + * BuildVersion combines SemVer version of extension with free-form build information + * (i.e. 'alpha', 'private-build') as a set of strings. + */ +export interface BuildVersion { + /** SemVer version of extension. */ + version: + | SemanticVersion + | undefined; + /** + * Free-form build information. + * Envoy defines several well known keys in the source/common/version/version.h file + */ + metadata: { [key: string]: any } | undefined; +} + +/** + * Version and identification for an Envoy extension. + * [#next-free-field: 7] + */ +export interface Extension { + /** + * This is the name of the Envoy filter as specified in the Envoy + * configuration, e.g. envoy.filters.http.router, com.acme.widget. + */ + name: string; + /** + * Category of the extension. + * Extension category names use reverse DNS notation. For instance "envoy.filters.listener" + * for Envoy's built-in listener filters or "com.acme.filters.http" for HTTP filters from + * acme.com vendor. + * [#comment:TODO(yanavlasov): Link to the doc with existing envoy category names.] + */ + category: string; + /** + * [#not-implemented-hide:] Type descriptor of extension configuration proto. + * [#comment:TODO(yanavlasov): Link to the doc with existing configuration protos.] + * [#comment:TODO(yanavlasov): Add tests when PR #9391 lands.] + * + * @deprecated + */ + typeDescriptor: string; + /** + * The version is a property of the extension and maintained independently + * of other extensions and the Envoy API. + * This field is not set when extension did not provide version information. + */ + version: + | BuildVersion + | undefined; + /** Indicates that the extension is present but was disabled via dynamic configuration. */ + disabled: boolean; + /** Type URLs of extension configuration protos. */ + typeUrls: string[]; +} + +/** + * Identifies a specific Envoy instance. The node identifier is presented to the + * management server, which may use this identifier to distinguish per Envoy + * configuration for serving. + * [#next-free-field: 13] + */ +export interface Node { + /** + * An opaque node identifier for the Envoy node. This also provides the local + * service node name. It should be set if any of the following features are + * used: :ref:`statsd `, :ref:`CDS + * `, and :ref:`HTTP tracing + * `, either in this message or via + * :option:`--service-node`. + */ + id: string; + /** + * Defines the local service cluster name where Envoy is running. Though + * optional, it should be set if any of the following features are used: + * :ref:`statsd `, :ref:`health check cluster + * verification + * `, + * :ref:`runtime override directory `, + * :ref:`user agent addition + * `, + * :ref:`HTTP global rate limiting `, + * :ref:`CDS `, and :ref:`HTTP tracing + * `, either in this message or via + * :option:`--service-cluster`. + */ + cluster: string; + /** + * Opaque metadata extending the node identifier. Envoy will pass this + * directly to the management server. + */ + metadata: + | { [key: string]: any } + | undefined; + /** + * Map from xDS resource type URL to dynamic context parameters. These may vary at runtime (unlike + * other fields in this message). For example, the xDS client may have a shard identifier that + * changes during the lifetime of the xDS client. In Envoy, this would be achieved by updating the + * dynamic context on the Server::Instance's LocalInfo context provider. The shard ID dynamic + * parameter then appears in this field during future discovery requests. + */ + dynamicParameters: { [key: string]: ContextParams }; + /** Locality specifying where the Envoy instance is running. */ + locality: + | Locality + | undefined; + /** + * Free-form string that identifies the entity requesting config. + * E.g. "envoy" or "grpc" + */ + userAgentName: string; + /** + * Free-form string that identifies the version of the entity requesting config. + * E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" + */ + userAgentVersion?: + | string + | undefined; + /** Structured version of the entity requesting config. */ + userAgentBuildVersion?: + | BuildVersion + | undefined; + /** List of extensions and their versions supported by the node. */ + extensions: Extension[]; + /** + * Client feature support list. These are well known features described + * in the Envoy API repository for a given major version of an API. Client features + * use reverse DNS naming scheme, for example ``com.acme.feature``. + * See :ref:`the list of features ` that xDS client may + * support. + */ + clientFeatures: string[]; + /** + * Known listening ports on the node as a generic hint to the management server + * for filtering :ref:`listeners ` to be returned. For example, + * if there is a listener bound to port 80, the list can optionally contain the + * SocketAddress ``(0.0.0.0,80)``. The field is optional and just a hint. + * + * @deprecated + */ + listeningAddresses: Address[]; +} + +export interface Node_DynamicParametersEntry { + key: string; + value: ContextParams | undefined; +} + +/** + * Metadata provides additional inputs to filters based on matched listeners, + * filter chains, routes and endpoints. It is structured as a map, usually from + * filter name (in reverse DNS format) to metadata specific to the filter. Metadata + * key-values for a filter are merged as connection and request handling occurs, + * with later values for the same key overriding earlier values. + * + * An example use of metadata is providing additional values to + * http_connection_manager in the envoy.http_connection_manager.access_log + * namespace. + * + * Another example use of metadata is to per service config info in cluster metadata, which may get + * consumed by multiple filters. + * + * For load balancing, Metadata provides a means to subset cluster endpoints. + * Endpoints have a Metadata object associated and routes contain a Metadata + * object to match against. There are some well defined metadata used today for + * this purpose: + * + * * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an + * endpoint and is also used during header processing + * (x-envoy-upstream-canary) and for stats purposes. + * [#next-major-version: move to type/metadata/v2] + */ +export interface Metadata { + /** + * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` + * namespace is reserved for Envoy's built-in filters. + * If both ``filter_metadata`` and + * :ref:`typed_filter_metadata ` + * fields are present in the metadata with same keys, + * only ``typed_filter_metadata`` field will be parsed. + */ + filterMetadata: { [key: string]: { [key: string]: any } | undefined }; + /** + * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` + * namespace is reserved for Envoy's built-in filters. + * The value is encoded as google.protobuf.Any. + * If both :ref:`filter_metadata ` + * and ``typed_filter_metadata`` fields are present in the metadata with same keys, + * only ``typed_filter_metadata`` field will be parsed. + */ + typedFilterMetadata: { [key: string]: Any }; +} + +export interface Metadata_FilterMetadataEntry { + key: string; + value: { [key: string]: any } | undefined; +} + +export interface Metadata_TypedFilterMetadataEntry { + key: string; + value: Any | undefined; +} + +/** Runtime derived uint32 with a default when not specified. */ +export interface RuntimeUInt32 { + /** Default value if runtime value is not available. */ + defaultValue: number; + /** Runtime key to get value for comparison. This value is used if defined. */ + runtimeKey: string; +} + +/** Runtime derived percentage with a default when not specified. */ +export interface RuntimePercent { + /** Default value if runtime value is not available. */ + defaultValue: + | Percent + | undefined; + /** Runtime key to get value for comparison. This value is used if defined. */ + runtimeKey: string; +} + +/** Runtime derived double with a default when not specified. */ +export interface RuntimeDouble { + /** Default value if runtime value is not available. */ + defaultValue: number; + /** Runtime key to get value for comparison. This value is used if defined. */ + runtimeKey: string; +} + +/** Runtime derived bool with a default when not specified. */ +export interface RuntimeFeatureFlag { + /** Default value if runtime value is not available. */ + defaultValue: + | boolean + | undefined; + /** + * Runtime key to get value for comparison. This value is used if defined. The boolean value must + * be represented via its + * `canonical JSON encoding `_. + */ + runtimeKey: string; +} + +/** + * Please use :ref:`KeyValuePair ` instead. + * [#not-implemented-hide:] + */ +export interface KeyValue { + /** + * The key of the key/value pair. + * + * @deprecated + */ + key: string; + /** + * The value of the key/value pair. + * + * The ``bytes`` type is used. This means if JSON or YAML is used to to represent the + * configuration, the value must be base64 encoded. This is unfriendly for users in most + * use scenarios of this message. + * + * @deprecated + */ + value: Uint8Array; +} + +export interface KeyValuePair { + /** The key of the key/value pair. */ + key: string; + /** The value of the key/value pair. */ + value: any | undefined; +} + +/** + * Key/value pair plus option to control append behavior. This is used to specify + * key/value pairs that should be appended to a set of existing key/value pairs. + */ +export interface KeyValueAppend { + /** The single key/value pair record to be appended or overridden. This field must be set. */ + record: + | KeyValuePair + | undefined; + /** + * Key/value pair entry that this option to append or overwrite. This field is deprecated + * and please use :ref:`record ` + * as replacement. + * [#not-implemented-hide:] + * + * @deprecated + */ + entry: + | KeyValue + | undefined; + /** + * Describes the action taken to append/overwrite the given value for an existing + * key or to only add this key if it's absent. + */ + action: KeyValueAppend_KeyValueAppendAction; +} + +/** Describes the supported actions types for key/value pair append action. */ +export enum KeyValueAppend_KeyValueAppendAction { + /** + * APPEND_IF_EXISTS_OR_ADD - If the key already exists, this action will result in the following behavior: + * + * - Comma-concatenated value if multiple values are not allowed. + * - New value added to the list of values if multiple values are allowed. + * + * If the key doesn't exist then this will add pair with specified key and value. + */ + APPEND_IF_EXISTS_OR_ADD = 0, + /** + * ADD_IF_ABSENT - This action will add the key/value pair if it doesn't already exist. If the + * key already exists then this will be a no-op. + */ + ADD_IF_ABSENT = 1, + /** + * OVERWRITE_IF_EXISTS_OR_ADD - This action will overwrite the specified value by discarding any existing + * values if the key already exists. If the key doesn't exist then this will add + * the pair with specified key and value. + */ + OVERWRITE_IF_EXISTS_OR_ADD = 2, + /** + * OVERWRITE_IF_EXISTS - This action will overwrite the specified value by discarding any existing + * values if the key already exists. If the key doesn't exist then this will + * be no-op. + */ + OVERWRITE_IF_EXISTS = 3, + UNRECOGNIZED = -1, +} + +export function keyValueAppend_KeyValueAppendActionFromJSON(object: any): KeyValueAppend_KeyValueAppendAction { + switch (object) { + case 0: + case "APPEND_IF_EXISTS_OR_ADD": + return KeyValueAppend_KeyValueAppendAction.APPEND_IF_EXISTS_OR_ADD; + case 1: + case "ADD_IF_ABSENT": + return KeyValueAppend_KeyValueAppendAction.ADD_IF_ABSENT; + case 2: + case "OVERWRITE_IF_EXISTS_OR_ADD": + return KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS_OR_ADD; + case 3: + case "OVERWRITE_IF_EXISTS": + return KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS; + case -1: + case "UNRECOGNIZED": + default: + return KeyValueAppend_KeyValueAppendAction.UNRECOGNIZED; + } +} + +export function keyValueAppend_KeyValueAppendActionToJSON(object: KeyValueAppend_KeyValueAppendAction): string { + switch (object) { + case KeyValueAppend_KeyValueAppendAction.APPEND_IF_EXISTS_OR_ADD: + return "APPEND_IF_EXISTS_OR_ADD"; + case KeyValueAppend_KeyValueAppendAction.ADD_IF_ABSENT: + return "ADD_IF_ABSENT"; + case KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS_OR_ADD: + return "OVERWRITE_IF_EXISTS_OR_ADD"; + case KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS: + return "OVERWRITE_IF_EXISTS"; + case KeyValueAppend_KeyValueAppendAction.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Key/value pair to append or remove. */ +export interface KeyValueMutation { + /** + * Key/value pair to append or overwrite. Only one of ``append`` or ``remove`` can be set or + * the configuration will be rejected. + */ + append: + | KeyValueAppend + | undefined; + /** + * Key to remove. Only one of ``append`` or ``remove`` can be set or the configuration will be + * rejected. + */ + remove: string; +} + +/** Query parameter name/value pair. */ +export interface QueryParameter { + /** The key of the query parameter. Case sensitive. */ + key: string; + /** The value of the query parameter. */ + value: string; +} + +/** Header name/value pair. */ +export interface HeaderValue { + /** Header name. */ + key: string; + /** + * Header value. + * + * The same :ref:`format specifier ` as used for + * :ref:`HTTP access logging ` applies here, however + * unknown header values are replaced with the empty string instead of ``-``. + * Header value is encoded as string. This does not work for non-utf8 characters. + * Only one of ``value`` or ``raw_value`` can be set. + */ + value: string; + /** + * Header value is encoded as bytes which can support non-utf8 characters. + * Only one of ``value`` or ``raw_value`` can be set. + */ + rawValue: Uint8Array; +} + +/** Header name/value pair plus option to control append behavior. */ +export interface HeaderValueOption { + /** Header name/value pair that this option applies to. */ + header: + | HeaderValue + | undefined; + /** + * Should the value be appended? If true (default), the value is appended to + * existing values. Otherwise it replaces any existing values. + * This field is deprecated and please use + * :ref:`append_action ` as replacement. + * + * .. note:: + * The :ref:`external authorization service ` and + * :ref:`external processor service ` have + * default value (``false``) for this field. + * + * @deprecated + */ + append: + | boolean + | undefined; + /** + * Describes the action taken to append/overwrite the given value for an existing header + * or to only add this header if it's absent. + * Value defaults to :ref:`APPEND_IF_EXISTS_OR_ADD + * `. + */ + appendAction: HeaderValueOption_HeaderAppendAction; + /** + * Is the header value allowed to be empty? If false (default), custom headers with empty values are dropped, + * otherwise they are added. + */ + keepEmptyValue: boolean; +} + +/** Describes the supported actions types for header append action. */ +export enum HeaderValueOption_HeaderAppendAction { + /** + * APPEND_IF_EXISTS_OR_ADD - If the header already exists, this action will result in: + * + * - Comma-concatenated for predefined inline headers. + * - Duplicate header added in the ``HeaderMap`` for other headers. + * + * If the header doesn't exist then this will add new header with specified key and value. + */ + APPEND_IF_EXISTS_OR_ADD = 0, + /** + * ADD_IF_ABSENT - This action will add the header if it doesn't already exist. If the header + * already exists then this will be a no-op. + */ + ADD_IF_ABSENT = 1, + /** + * OVERWRITE_IF_EXISTS_OR_ADD - This action will overwrite the specified value by discarding any existing values if + * the header already exists. If the header doesn't exist then this will add the header + * with specified key and value. + */ + OVERWRITE_IF_EXISTS_OR_ADD = 2, + /** + * OVERWRITE_IF_EXISTS - This action will overwrite the specified value by discarding any existing values if + * the header already exists. If the header doesn't exist then this will be no-op. + */ + OVERWRITE_IF_EXISTS = 3, + UNRECOGNIZED = -1, +} + +export function headerValueOption_HeaderAppendActionFromJSON(object: any): HeaderValueOption_HeaderAppendAction { + switch (object) { + case 0: + case "APPEND_IF_EXISTS_OR_ADD": + return HeaderValueOption_HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD; + case 1: + case "ADD_IF_ABSENT": + return HeaderValueOption_HeaderAppendAction.ADD_IF_ABSENT; + case 2: + case "OVERWRITE_IF_EXISTS_OR_ADD": + return HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS_OR_ADD; + case 3: + case "OVERWRITE_IF_EXISTS": + return HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS; + case -1: + case "UNRECOGNIZED": + default: + return HeaderValueOption_HeaderAppendAction.UNRECOGNIZED; + } +} + +export function headerValueOption_HeaderAppendActionToJSON(object: HeaderValueOption_HeaderAppendAction): string { + switch (object) { + case HeaderValueOption_HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD: + return "APPEND_IF_EXISTS_OR_ADD"; + case HeaderValueOption_HeaderAppendAction.ADD_IF_ABSENT: + return "ADD_IF_ABSENT"; + case HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS_OR_ADD: + return "OVERWRITE_IF_EXISTS_OR_ADD"; + case HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS: + return "OVERWRITE_IF_EXISTS"; + case HeaderValueOption_HeaderAppendAction.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Wrapper for a set of headers. */ +export interface HeaderMap { + /** A list of header names and their values. */ + headers: HeaderValue[]; +} + +/** + * A directory that is watched for changes, e.g. by inotify on Linux. Move/rename + * events inside this directory trigger the watch. + */ +export interface WatchedDirectory { + /** Directory path to watch. */ + path: string; +} + +/** + * Data source consisting of a file, an inline value, or an environment variable. + * [#next-free-field: 6] + */ +export interface DataSource { + /** Local filesystem data source. */ + filename?: + | string + | undefined; + /** Bytes inlined in the configuration. */ + inlineBytes?: + | Uint8Array + | undefined; + /** String inlined in the configuration. */ + inlineString?: + | string + | undefined; + /** Environment variable data source. */ + environmentVariable?: + | string + | undefined; + /** + * Watched directory that is watched for file changes. If this is set explicitly, the file + * specified in the ``filename`` field will be reloaded when relevant file move events occur. + * + * .. note:: + * This field only makes sense when the ``filename`` field is set. + * + * .. note:: + * Envoy only updates when the file is replaced by a file move, and not when the file is + * edited in place. + * + * .. note:: + * Not all use cases of ``DataSource`` support watching directories. It depends on the + * specific usage of the ``DataSource``. See the documentation of the parent message for + * details. + */ + watchedDirectory: WatchedDirectory | undefined; +} + +/** + * The message specifies the retry policy of remote data source when fetching fails. + * [#next-free-field: 7] + */ +export interface RetryPolicy { + /** + * Specifies parameters that control :ref:`retry backoff strategy `. + * This parameter is optional, in which case the default base interval is 1000 milliseconds. The + * default maximum interval is 10 times the base interval. + */ + retryBackOff: + | BackoffStrategy + | undefined; + /** + * Specifies the allowed number of retries. This parameter is optional and + * defaults to 1. + */ + numRetries: + | number + | undefined; + /** For details, see :ref:`retry_on `. */ + retryOn: string; + /** For details, see :ref:`retry_priority `. */ + retryPriority: + | RetryPolicy_RetryPriority + | undefined; + /** For details, see :ref:`RetryHostPredicate `. */ + retryHostPredicate: RetryPolicy_RetryHostPredicate[]; + /** For details, see :ref:`host_selection_retry_max_attempts `. */ + hostSelectionRetryMaxAttempts: string; +} + +/** See :ref:`RetryPriority `. */ +export interface RetryPolicy_RetryPriority { + name: string; + typedConfig?: Any | undefined; +} + +/** See :ref:`RetryHostPredicate `. */ +export interface RetryPolicy_RetryHostPredicate { + name: string; + typedConfig?: Any | undefined; +} + +/** The message specifies how to fetch data from remote and how to verify it. */ +export interface RemoteDataSource { + /** The HTTP URI to fetch the remote data. */ + httpUri: + | HttpUri + | undefined; + /** SHA256 string for verifying data. */ + sha256: string; + /** Retry policy for fetching remote data. */ + retryPolicy: RetryPolicy | undefined; +} + +/** Async data source which support async data fetch. */ +export interface AsyncDataSource { + /** Local async data source. */ + local?: + | DataSource + | undefined; + /** Remote async data source. */ + remote?: RemoteDataSource | undefined; +} + +/** + * Configuration for transport socket in :ref:`listeners ` and + * :ref:`clusters `. If the configuration is + * empty, a default transport socket implementation and configuration will be + * chosen based on the platform and existence of tls_context. + */ +export interface TransportSocket { + /** + * The name of the transport socket to instantiate. The name must match a supported transport + * socket implementation. + */ + name: string; + typedConfig?: Any | undefined; +} + +/** + * Runtime derived FractionalPercent with defaults for when the numerator or denominator is not + * specified via a runtime key. + * + * .. note:: + * + * Parsing of the runtime key's data is implemented such that it may be represented as a + * :ref:`FractionalPercent ` proto represented as JSON/YAML + * and may also be represented as an integer with the assumption that the value is an integral + * percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse + * as a ``FractionalPercent`` whose numerator is 42 and denominator is HUNDRED. + */ +export interface RuntimeFractionalPercent { + /** Default value if the runtime value's for the numerator/denominator keys are not available. */ + defaultValue: + | FractionalPercent + | undefined; + /** Runtime key for a YAML representation of a FractionalPercent. */ + runtimeKey: string; +} + +/** Identifies a specific ControlPlane instance that Envoy is connected to. */ +export interface ControlPlane { + /** + * An opaque control plane identifier that uniquely identifies an instance + * of control plane. This can be used to identify which control plane instance, + * the Envoy is connected to. + */ + identifier: string; +} + +function createBaseLocality(): Locality { + return { region: "", zone: "", subZone: "" }; +} + +export const Locality: MessageFns = { + encode(message: Locality, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.region !== "") { + writer.uint32(10).string(message.region); + } + if (message.zone !== "") { + writer.uint32(18).string(message.zone); + } + if (message.subZone !== "") { + writer.uint32(26).string(message.subZone); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Locality { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLocality(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.region = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.zone = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.subZone = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Locality { + return { + region: isSet(object.region) ? globalThis.String(object.region) : "", + zone: isSet(object.zone) ? globalThis.String(object.zone) : "", + subZone: isSet(object.subZone) ? globalThis.String(object.subZone) : "", + }; + }, + + toJSON(message: Locality): unknown { + const obj: any = {}; + if (message.region !== "") { + obj.region = message.region; + } + if (message.zone !== "") { + obj.zone = message.zone; + } + if (message.subZone !== "") { + obj.subZone = message.subZone; + } + return obj; + }, + + create, I>>(base?: I): Locality { + return Locality.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Locality { + const message = createBaseLocality(); + message.region = object.region ?? ""; + message.zone = object.zone ?? ""; + message.subZone = object.subZone ?? ""; + return message; + }, +}; + +function createBaseBuildVersion(): BuildVersion { + return { version: undefined, metadata: undefined }; +} + +export const BuildVersion: MessageFns = { + encode(message: BuildVersion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.version !== undefined) { + SemanticVersion.encode(message.version, writer.uint32(10).fork()).join(); + } + if (message.metadata !== undefined) { + Struct.encode(Struct.wrap(message.metadata), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BuildVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBuildVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.version = SemanticVersion.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BuildVersion { + return { + version: isSet(object.version) ? SemanticVersion.fromJSON(object.version) : undefined, + metadata: isObject(object.metadata) ? object.metadata : undefined, + }; + }, + + toJSON(message: BuildVersion): unknown { + const obj: any = {}; + if (message.version !== undefined) { + obj.version = SemanticVersion.toJSON(message.version); + } + if (message.metadata !== undefined) { + obj.metadata = message.metadata; + } + return obj; + }, + + create, I>>(base?: I): BuildVersion { + return BuildVersion.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BuildVersion { + const message = createBaseBuildVersion(); + message.version = (object.version !== undefined && object.version !== null) + ? SemanticVersion.fromPartial(object.version) + : undefined; + message.metadata = object.metadata ?? undefined; + return message; + }, +}; + +function createBaseExtension(): Extension { + return { name: "", category: "", typeDescriptor: "", version: undefined, disabled: false, typeUrls: [] }; +} + +export const Extension: MessageFns = { + encode(message: Extension, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.category !== "") { + writer.uint32(18).string(message.category); + } + if (message.typeDescriptor !== "") { + writer.uint32(26).string(message.typeDescriptor); + } + if (message.version !== undefined) { + BuildVersion.encode(message.version, writer.uint32(34).fork()).join(); + } + if (message.disabled !== false) { + writer.uint32(40).bool(message.disabled); + } + for (const v of message.typeUrls) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Extension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.category = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.typeDescriptor = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.version = BuildVersion.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.disabled = reader.bool(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.typeUrls.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Extension { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + category: isSet(object.category) ? globalThis.String(object.category) : "", + typeDescriptor: isSet(object.typeDescriptor) ? globalThis.String(object.typeDescriptor) : "", + version: isSet(object.version) ? BuildVersion.fromJSON(object.version) : undefined, + disabled: isSet(object.disabled) ? globalThis.Boolean(object.disabled) : false, + typeUrls: globalThis.Array.isArray(object?.typeUrls) ? object.typeUrls.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: Extension): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.category !== "") { + obj.category = message.category; + } + if (message.typeDescriptor !== "") { + obj.typeDescriptor = message.typeDescriptor; + } + if (message.version !== undefined) { + obj.version = BuildVersion.toJSON(message.version); + } + if (message.disabled !== false) { + obj.disabled = message.disabled; + } + if (message.typeUrls?.length) { + obj.typeUrls = message.typeUrls; + } + return obj; + }, + + create, I>>(base?: I): Extension { + return Extension.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Extension { + const message = createBaseExtension(); + message.name = object.name ?? ""; + message.category = object.category ?? ""; + message.typeDescriptor = object.typeDescriptor ?? ""; + message.version = (object.version !== undefined && object.version !== null) + ? BuildVersion.fromPartial(object.version) + : undefined; + message.disabled = object.disabled ?? false; + message.typeUrls = object.typeUrls?.map((e) => e) || []; + return message; + }, +}; + +function createBaseNode(): Node { + return { + id: "", + cluster: "", + metadata: undefined, + dynamicParameters: {}, + locality: undefined, + userAgentName: "", + userAgentVersion: undefined, + userAgentBuildVersion: undefined, + extensions: [], + clientFeatures: [], + listeningAddresses: [], + }; +} + +export const Node: MessageFns = { + encode(message: Node, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.cluster !== "") { + writer.uint32(18).string(message.cluster); + } + if (message.metadata !== undefined) { + Struct.encode(Struct.wrap(message.metadata), writer.uint32(26).fork()).join(); + } + Object.entries(message.dynamicParameters).forEach(([key, value]) => { + Node_DynamicParametersEntry.encode({ key: key as any, value }, writer.uint32(98).fork()).join(); + }); + if (message.locality !== undefined) { + Locality.encode(message.locality, writer.uint32(34).fork()).join(); + } + if (message.userAgentName !== "") { + writer.uint32(50).string(message.userAgentName); + } + if (message.userAgentVersion !== undefined) { + writer.uint32(58).string(message.userAgentVersion); + } + if (message.userAgentBuildVersion !== undefined) { + BuildVersion.encode(message.userAgentBuildVersion, writer.uint32(66).fork()).join(); + } + for (const v of message.extensions) { + Extension.encode(v!, writer.uint32(74).fork()).join(); + } + for (const v of message.clientFeatures) { + writer.uint32(82).string(v!); + } + for (const v of message.listeningAddresses) { + Address.encode(v!, writer.uint32(90).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Node { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.cluster = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + const entry12 = Node_DynamicParametersEntry.decode(reader, reader.uint32()); + if (entry12.value !== undefined) { + message.dynamicParameters[entry12.key] = entry12.value; + } + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.locality = Locality.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.userAgentName = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.userAgentVersion = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.userAgentBuildVersion = BuildVersion.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.extensions.push(Extension.decode(reader, reader.uint32())); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.clientFeatures.push(reader.string()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.listeningAddresses.push(Address.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Node { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "", + metadata: isObject(object.metadata) ? object.metadata : undefined, + dynamicParameters: isObject(object.dynamicParameters) + ? Object.entries(object.dynamicParameters).reduce<{ [key: string]: ContextParams }>((acc, [key, value]) => { + acc[key] = ContextParams.fromJSON(value); + return acc; + }, {}) + : {}, + locality: isSet(object.locality) ? Locality.fromJSON(object.locality) : undefined, + userAgentName: isSet(object.userAgentName) ? globalThis.String(object.userAgentName) : "", + userAgentVersion: isSet(object.userAgentVersion) ? globalThis.String(object.userAgentVersion) : undefined, + userAgentBuildVersion: isSet(object.userAgentBuildVersion) + ? BuildVersion.fromJSON(object.userAgentBuildVersion) + : undefined, + extensions: globalThis.Array.isArray(object?.extensions) + ? object.extensions.map((e: any) => Extension.fromJSON(e)) + : [], + clientFeatures: globalThis.Array.isArray(object?.clientFeatures) + ? object.clientFeatures.map((e: any) => globalThis.String(e)) + : [], + listeningAddresses: globalThis.Array.isArray(object?.listeningAddresses) + ? object.listeningAddresses.map((e: any) => Address.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Node): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.cluster !== "") { + obj.cluster = message.cluster; + } + if (message.metadata !== undefined) { + obj.metadata = message.metadata; + } + if (message.dynamicParameters) { + const entries = Object.entries(message.dynamicParameters); + if (entries.length > 0) { + obj.dynamicParameters = {}; + entries.forEach(([k, v]) => { + obj.dynamicParameters[k] = ContextParams.toJSON(v); + }); + } + } + if (message.locality !== undefined) { + obj.locality = Locality.toJSON(message.locality); + } + if (message.userAgentName !== "") { + obj.userAgentName = message.userAgentName; + } + if (message.userAgentVersion !== undefined) { + obj.userAgentVersion = message.userAgentVersion; + } + if (message.userAgentBuildVersion !== undefined) { + obj.userAgentBuildVersion = BuildVersion.toJSON(message.userAgentBuildVersion); + } + if (message.extensions?.length) { + obj.extensions = message.extensions.map((e) => Extension.toJSON(e)); + } + if (message.clientFeatures?.length) { + obj.clientFeatures = message.clientFeatures; + } + if (message.listeningAddresses?.length) { + obj.listeningAddresses = message.listeningAddresses.map((e) => Address.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Node { + return Node.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Node { + const message = createBaseNode(); + message.id = object.id ?? ""; + message.cluster = object.cluster ?? ""; + message.metadata = object.metadata ?? undefined; + message.dynamicParameters = Object.entries(object.dynamicParameters ?? {}).reduce<{ [key: string]: ContextParams }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = ContextParams.fromPartial(value); + } + return acc; + }, + {}, + ); + message.locality = (object.locality !== undefined && object.locality !== null) + ? Locality.fromPartial(object.locality) + : undefined; + message.userAgentName = object.userAgentName ?? ""; + message.userAgentVersion = object.userAgentVersion ?? undefined; + message.userAgentBuildVersion = + (object.userAgentBuildVersion !== undefined && object.userAgentBuildVersion !== null) + ? BuildVersion.fromPartial(object.userAgentBuildVersion) + : undefined; + message.extensions = object.extensions?.map((e) => Extension.fromPartial(e)) || []; + message.clientFeatures = object.clientFeatures?.map((e) => e) || []; + message.listeningAddresses = object.listeningAddresses?.map((e) => Address.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseNode_DynamicParametersEntry(): Node_DynamicParametersEntry { + return { key: "", value: undefined }; +} + +export const Node_DynamicParametersEntry: MessageFns = { + encode(message: Node_DynamicParametersEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + ContextParams.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Node_DynamicParametersEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNode_DynamicParametersEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = ContextParams.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Node_DynamicParametersEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? ContextParams.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Node_DynamicParametersEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = ContextParams.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Node_DynamicParametersEntry { + return Node_DynamicParametersEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Node_DynamicParametersEntry { + const message = createBaseNode_DynamicParametersEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? ContextParams.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseMetadata(): Metadata { + return { filterMetadata: {}, typedFilterMetadata: {} }; +} + +export const Metadata: MessageFns = { + encode(message: Metadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.filterMetadata).forEach(([key, value]) => { + if (value !== undefined) { + Metadata_FilterMetadataEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + } + }); + Object.entries(message.typedFilterMetadata).forEach(([key, value]) => { + Metadata_TypedFilterMetadataEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = Metadata_FilterMetadataEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.filterMetadata[entry1.key] = entry1.value; + } + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = Metadata_TypedFilterMetadataEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.typedFilterMetadata[entry2.key] = entry2.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Metadata { + return { + filterMetadata: isObject(object.filterMetadata) + ? Object.entries(object.filterMetadata).reduce<{ [key: string]: { [key: string]: any } | undefined }>( + (acc, [key, value]) => { + acc[key] = value as { [key: string]: any } | undefined; + return acc; + }, + {}, + ) + : {}, + typedFilterMetadata: isObject(object.typedFilterMetadata) + ? Object.entries(object.typedFilterMetadata).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Metadata): unknown { + const obj: any = {}; + if (message.filterMetadata) { + const entries = Object.entries(message.filterMetadata); + if (entries.length > 0) { + obj.filterMetadata = {}; + entries.forEach(([k, v]) => { + obj.filterMetadata[k] = v; + }); + } + } + if (message.typedFilterMetadata) { + const entries = Object.entries(message.typedFilterMetadata); + if (entries.length > 0) { + obj.typedFilterMetadata = {}; + entries.forEach(([k, v]) => { + obj.typedFilterMetadata[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): Metadata { + return Metadata.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Metadata { + const message = createBaseMetadata(); + message.filterMetadata = Object.entries(object.filterMetadata ?? {}).reduce< + { [key: string]: { [key: string]: any } | undefined } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, {}); + message.typedFilterMetadata = Object.entries(object.typedFilterMetadata ?? {}).reduce<{ [key: string]: Any }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseMetadata_FilterMetadataEntry(): Metadata_FilterMetadataEntry { + return { key: "", value: undefined }; +} + +export const Metadata_FilterMetadataEntry: MessageFns = { + encode(message: Metadata_FilterMetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Metadata_FilterMetadataEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata_FilterMetadataEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Metadata_FilterMetadataEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isObject(object.value) ? object.value : undefined, + }; + }, + + toJSON(message: Metadata_FilterMetadataEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Metadata_FilterMetadataEntry { + return Metadata_FilterMetadataEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Metadata_FilterMetadataEntry { + const message = createBaseMetadata_FilterMetadataEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseMetadata_TypedFilterMetadataEntry(): Metadata_TypedFilterMetadataEntry { + return { key: "", value: undefined }; +} + +export const Metadata_TypedFilterMetadataEntry: MessageFns = { + encode(message: Metadata_TypedFilterMetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Metadata_TypedFilterMetadataEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata_TypedFilterMetadataEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Metadata_TypedFilterMetadataEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Metadata_TypedFilterMetadataEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): Metadata_TypedFilterMetadataEntry { + return Metadata_TypedFilterMetadataEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Metadata_TypedFilterMetadataEntry { + const message = createBaseMetadata_TypedFilterMetadataEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseRuntimeUInt32(): RuntimeUInt32 { + return { defaultValue: 0, runtimeKey: "" }; +} + +export const RuntimeUInt32: MessageFns = { + encode(message: RuntimeUInt32, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.defaultValue !== 0) { + writer.uint32(16).uint32(message.defaultValue); + } + if (message.runtimeKey !== "") { + writer.uint32(26).string(message.runtimeKey); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuntimeUInt32 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuntimeUInt32(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 16) { + break; + } + + message.defaultValue = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.runtimeKey = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuntimeUInt32 { + return { + defaultValue: isSet(object.defaultValue) ? globalThis.Number(object.defaultValue) : 0, + runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", + }; + }, + + toJSON(message: RuntimeUInt32): unknown { + const obj: any = {}; + if (message.defaultValue !== 0) { + obj.defaultValue = Math.round(message.defaultValue); + } + if (message.runtimeKey !== "") { + obj.runtimeKey = message.runtimeKey; + } + return obj; + }, + + create, I>>(base?: I): RuntimeUInt32 { + return RuntimeUInt32.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RuntimeUInt32 { + const message = createBaseRuntimeUInt32(); + message.defaultValue = object.defaultValue ?? 0; + message.runtimeKey = object.runtimeKey ?? ""; + return message; + }, +}; + +function createBaseRuntimePercent(): RuntimePercent { + return { defaultValue: undefined, runtimeKey: "" }; +} + +export const RuntimePercent: MessageFns = { + encode(message: RuntimePercent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.defaultValue !== undefined) { + Percent.encode(message.defaultValue, writer.uint32(10).fork()).join(); + } + if (message.runtimeKey !== "") { + writer.uint32(18).string(message.runtimeKey); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuntimePercent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuntimePercent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.defaultValue = Percent.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.runtimeKey = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuntimePercent { + return { + defaultValue: isSet(object.defaultValue) ? Percent.fromJSON(object.defaultValue) : undefined, + runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", + }; + }, + + toJSON(message: RuntimePercent): unknown { + const obj: any = {}; + if (message.defaultValue !== undefined) { + obj.defaultValue = Percent.toJSON(message.defaultValue); + } + if (message.runtimeKey !== "") { + obj.runtimeKey = message.runtimeKey; + } + return obj; + }, + + create, I>>(base?: I): RuntimePercent { + return RuntimePercent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RuntimePercent { + const message = createBaseRuntimePercent(); + message.defaultValue = (object.defaultValue !== undefined && object.defaultValue !== null) + ? Percent.fromPartial(object.defaultValue) + : undefined; + message.runtimeKey = object.runtimeKey ?? ""; + return message; + }, +}; + +function createBaseRuntimeDouble(): RuntimeDouble { + return { defaultValue: 0, runtimeKey: "" }; +} + +export const RuntimeDouble: MessageFns = { + encode(message: RuntimeDouble, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.defaultValue !== 0) { + writer.uint32(9).double(message.defaultValue); + } + if (message.runtimeKey !== "") { + writer.uint32(18).string(message.runtimeKey); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuntimeDouble { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuntimeDouble(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.defaultValue = reader.double(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.runtimeKey = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuntimeDouble { + return { + defaultValue: isSet(object.defaultValue) ? globalThis.Number(object.defaultValue) : 0, + runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", + }; + }, + + toJSON(message: RuntimeDouble): unknown { + const obj: any = {}; + if (message.defaultValue !== 0) { + obj.defaultValue = message.defaultValue; + } + if (message.runtimeKey !== "") { + obj.runtimeKey = message.runtimeKey; + } + return obj; + }, + + create, I>>(base?: I): RuntimeDouble { + return RuntimeDouble.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RuntimeDouble { + const message = createBaseRuntimeDouble(); + message.defaultValue = object.defaultValue ?? 0; + message.runtimeKey = object.runtimeKey ?? ""; + return message; + }, +}; + +function createBaseRuntimeFeatureFlag(): RuntimeFeatureFlag { + return { defaultValue: undefined, runtimeKey: "" }; +} + +export const RuntimeFeatureFlag: MessageFns = { + encode(message: RuntimeFeatureFlag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.defaultValue !== undefined) { + BoolValue.encode({ value: message.defaultValue! }, writer.uint32(10).fork()).join(); + } + if (message.runtimeKey !== "") { + writer.uint32(18).string(message.runtimeKey); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuntimeFeatureFlag { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuntimeFeatureFlag(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.defaultValue = BoolValue.decode(reader, reader.uint32()).value; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.runtimeKey = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuntimeFeatureFlag { + return { + defaultValue: isSet(object.defaultValue) ? Boolean(object.defaultValue) : undefined, + runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", + }; + }, + + toJSON(message: RuntimeFeatureFlag): unknown { + const obj: any = {}; + if (message.defaultValue !== undefined) { + obj.defaultValue = message.defaultValue; + } + if (message.runtimeKey !== "") { + obj.runtimeKey = message.runtimeKey; + } + return obj; + }, + + create, I>>(base?: I): RuntimeFeatureFlag { + return RuntimeFeatureFlag.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RuntimeFeatureFlag { + const message = createBaseRuntimeFeatureFlag(); + message.defaultValue = object.defaultValue ?? undefined; + message.runtimeKey = object.runtimeKey ?? ""; + return message; + }, +}; + +function createBaseKeyValue(): KeyValue { + return { key: "", value: new Uint8Array(0) }; +} + +export const KeyValue: MessageFns = { + encode(message: KeyValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): KeyValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKeyValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.bytes(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): KeyValue { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0), + }; + }, + + toJSON(message: KeyValue): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value.length !== 0) { + obj.value = base64FromBytes(message.value); + } + return obj; + }, + + create, I>>(base?: I): KeyValue { + return KeyValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): KeyValue { + const message = createBaseKeyValue(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseKeyValuePair(): KeyValuePair { + return { key: "", value: undefined }; +} + +export const KeyValuePair: MessageFns = { + encode(message: KeyValuePair, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): KeyValuePair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKeyValuePair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): KeyValuePair { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: KeyValuePair): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): KeyValuePair { + return KeyValuePair.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): KeyValuePair { + const message = createBaseKeyValuePair(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseKeyValueAppend(): KeyValueAppend { + return { record: undefined, entry: undefined, action: 0 }; +} + +export const KeyValueAppend: MessageFns = { + encode(message: KeyValueAppend, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.record !== undefined) { + KeyValuePair.encode(message.record, writer.uint32(26).fork()).join(); + } + if (message.entry !== undefined) { + KeyValue.encode(message.entry, writer.uint32(10).fork()).join(); + } + if (message.action !== 0) { + writer.uint32(16).int32(message.action); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): KeyValueAppend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKeyValueAppend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 26) { + break; + } + + message.record = KeyValuePair.decode(reader, reader.uint32()); + continue; + } + case 1: { + if (tag !== 10) { + break; + } + + message.entry = KeyValue.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.action = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): KeyValueAppend { + return { + record: isSet(object.record) ? KeyValuePair.fromJSON(object.record) : undefined, + entry: isSet(object.entry) ? KeyValue.fromJSON(object.entry) : undefined, + action: isSet(object.action) ? keyValueAppend_KeyValueAppendActionFromJSON(object.action) : 0, + }; + }, + + toJSON(message: KeyValueAppend): unknown { + const obj: any = {}; + if (message.record !== undefined) { + obj.record = KeyValuePair.toJSON(message.record); + } + if (message.entry !== undefined) { + obj.entry = KeyValue.toJSON(message.entry); + } + if (message.action !== 0) { + obj.action = keyValueAppend_KeyValueAppendActionToJSON(message.action); + } + return obj; + }, + + create, I>>(base?: I): KeyValueAppend { + return KeyValueAppend.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): KeyValueAppend { + const message = createBaseKeyValueAppend(); + message.record = (object.record !== undefined && object.record !== null) + ? KeyValuePair.fromPartial(object.record) + : undefined; + message.entry = (object.entry !== undefined && object.entry !== null) + ? KeyValue.fromPartial(object.entry) + : undefined; + message.action = object.action ?? 0; + return message; + }, +}; + +function createBaseKeyValueMutation(): KeyValueMutation { + return { append: undefined, remove: "" }; +} + +export const KeyValueMutation: MessageFns = { + encode(message: KeyValueMutation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.append !== undefined) { + KeyValueAppend.encode(message.append, writer.uint32(10).fork()).join(); + } + if (message.remove !== "") { + writer.uint32(18).string(message.remove); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): KeyValueMutation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKeyValueMutation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.append = KeyValueAppend.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.remove = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): KeyValueMutation { + return { + append: isSet(object.append) ? KeyValueAppend.fromJSON(object.append) : undefined, + remove: isSet(object.remove) ? globalThis.String(object.remove) : "", + }; + }, + + toJSON(message: KeyValueMutation): unknown { + const obj: any = {}; + if (message.append !== undefined) { + obj.append = KeyValueAppend.toJSON(message.append); + } + if (message.remove !== "") { + obj.remove = message.remove; + } + return obj; + }, + + create, I>>(base?: I): KeyValueMutation { + return KeyValueMutation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): KeyValueMutation { + const message = createBaseKeyValueMutation(); + message.append = (object.append !== undefined && object.append !== null) + ? KeyValueAppend.fromPartial(object.append) + : undefined; + message.remove = object.remove ?? ""; + return message; + }, +}; + +function createBaseQueryParameter(): QueryParameter { + return { key: "", value: "" }; +} + +export const QueryParameter: MessageFns = { + encode(message: QueryParameter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): QueryParameter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParameter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryParameter { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: QueryParameter): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): QueryParameter { + return QueryParameter.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): QueryParameter { + const message = createBaseQueryParameter(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseHeaderValue(): HeaderValue { + return { key: "", value: "", rawValue: new Uint8Array(0) }; +} + +export const HeaderValue: MessageFns = { + encode(message: HeaderValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + if (message.rawValue.length !== 0) { + writer.uint32(26).bytes(message.rawValue); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeaderValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.rawValue = reader.bytes(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeaderValue { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + rawValue: isSet(object.rawValue) ? bytesFromBase64(object.rawValue) : new Uint8Array(0), + }; + }, + + toJSON(message: HeaderValue): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + if (message.rawValue.length !== 0) { + obj.rawValue = base64FromBytes(message.rawValue); + } + return obj; + }, + + create, I>>(base?: I): HeaderValue { + return HeaderValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HeaderValue { + const message = createBaseHeaderValue(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + message.rawValue = object.rawValue ?? new Uint8Array(0); + return message; + }, +}; + +function createBaseHeaderValueOption(): HeaderValueOption { + return { header: undefined, append: undefined, appendAction: 0, keepEmptyValue: false }; +} + +export const HeaderValueOption: MessageFns = { + encode(message: HeaderValueOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.header !== undefined) { + HeaderValue.encode(message.header, writer.uint32(10).fork()).join(); + } + if (message.append !== undefined) { + BoolValue.encode({ value: message.append! }, writer.uint32(18).fork()).join(); + } + if (message.appendAction !== 0) { + writer.uint32(24).int32(message.appendAction); + } + if (message.keepEmptyValue !== false) { + writer.uint32(32).bool(message.keepEmptyValue); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeaderValueOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderValueOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.header = HeaderValue.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.append = BoolValue.decode(reader, reader.uint32()).value; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.appendAction = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.keepEmptyValue = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeaderValueOption { + return { + header: isSet(object.header) ? HeaderValue.fromJSON(object.header) : undefined, + append: isSet(object.append) ? Boolean(object.append) : undefined, + appendAction: isSet(object.appendAction) ? headerValueOption_HeaderAppendActionFromJSON(object.appendAction) : 0, + keepEmptyValue: isSet(object.keepEmptyValue) ? globalThis.Boolean(object.keepEmptyValue) : false, + }; + }, + + toJSON(message: HeaderValueOption): unknown { + const obj: any = {}; + if (message.header !== undefined) { + obj.header = HeaderValue.toJSON(message.header); + } + if (message.append !== undefined) { + obj.append = message.append; + } + if (message.appendAction !== 0) { + obj.appendAction = headerValueOption_HeaderAppendActionToJSON(message.appendAction); + } + if (message.keepEmptyValue !== false) { + obj.keepEmptyValue = message.keepEmptyValue; + } + return obj; + }, + + create, I>>(base?: I): HeaderValueOption { + return HeaderValueOption.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HeaderValueOption { + const message = createBaseHeaderValueOption(); + message.header = (object.header !== undefined && object.header !== null) + ? HeaderValue.fromPartial(object.header) + : undefined; + message.append = object.append ?? undefined; + message.appendAction = object.appendAction ?? 0; + message.keepEmptyValue = object.keepEmptyValue ?? false; + return message; + }, +}; + +function createBaseHeaderMap(): HeaderMap { + return { headers: [] }; +} + +export const HeaderMap: MessageFns = { + encode(message: HeaderMap, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.headers) { + HeaderValue.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeaderMap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderMap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.headers.push(HeaderValue.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeaderMap { + return { + headers: globalThis.Array.isArray(object?.headers) ? object.headers.map((e: any) => HeaderValue.fromJSON(e)) : [], + }; + }, + + toJSON(message: HeaderMap): unknown { + const obj: any = {}; + if (message.headers?.length) { + obj.headers = message.headers.map((e) => HeaderValue.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): HeaderMap { + return HeaderMap.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HeaderMap { + const message = createBaseHeaderMap(); + message.headers = object.headers?.map((e) => HeaderValue.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseWatchedDirectory(): WatchedDirectory { + return { path: "" }; +} + +export const WatchedDirectory: MessageFns = { + encode(message: WatchedDirectory, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WatchedDirectory { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWatchedDirectory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.path = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WatchedDirectory { + return { path: isSet(object.path) ? globalThis.String(object.path) : "" }; + }, + + toJSON(message: WatchedDirectory): unknown { + const obj: any = {}; + if (message.path !== "") { + obj.path = message.path; + } + return obj; + }, + + create, I>>(base?: I): WatchedDirectory { + return WatchedDirectory.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): WatchedDirectory { + const message = createBaseWatchedDirectory(); + message.path = object.path ?? ""; + return message; + }, +}; + +function createBaseDataSource(): DataSource { + return { + filename: undefined, + inlineBytes: undefined, + inlineString: undefined, + environmentVariable: undefined, + watchedDirectory: undefined, + }; +} + +export const DataSource: MessageFns = { + encode(message: DataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.filename !== undefined) { + writer.uint32(10).string(message.filename); + } + if (message.inlineBytes !== undefined) { + writer.uint32(18).bytes(message.inlineBytes); + } + if (message.inlineString !== undefined) { + writer.uint32(26).string(message.inlineString); + } + if (message.environmentVariable !== undefined) { + writer.uint32(34).string(message.environmentVariable); + } + if (message.watchedDirectory !== undefined) { + WatchedDirectory.encode(message.watchedDirectory, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataSource { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataSource(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.filename = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.inlineBytes = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.inlineString = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.environmentVariable = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.watchedDirectory = WatchedDirectory.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataSource { + return { + filename: isSet(object.filename) ? globalThis.String(object.filename) : undefined, + inlineBytes: isSet(object.inlineBytes) ? bytesFromBase64(object.inlineBytes) : undefined, + inlineString: isSet(object.inlineString) ? globalThis.String(object.inlineString) : undefined, + environmentVariable: isSet(object.environmentVariable) + ? globalThis.String(object.environmentVariable) + : undefined, + watchedDirectory: isSet(object.watchedDirectory) ? WatchedDirectory.fromJSON(object.watchedDirectory) : undefined, + }; + }, + + toJSON(message: DataSource): unknown { + const obj: any = {}; + if (message.filename !== undefined) { + obj.filename = message.filename; + } + if (message.inlineBytes !== undefined) { + obj.inlineBytes = base64FromBytes(message.inlineBytes); + } + if (message.inlineString !== undefined) { + obj.inlineString = message.inlineString; + } + if (message.environmentVariable !== undefined) { + obj.environmentVariable = message.environmentVariable; + } + if (message.watchedDirectory !== undefined) { + obj.watchedDirectory = WatchedDirectory.toJSON(message.watchedDirectory); + } + return obj; + }, + + create, I>>(base?: I): DataSource { + return DataSource.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DataSource { + const message = createBaseDataSource(); + message.filename = object.filename ?? undefined; + message.inlineBytes = object.inlineBytes ?? undefined; + message.inlineString = object.inlineString ?? undefined; + message.environmentVariable = object.environmentVariable ?? undefined; + message.watchedDirectory = (object.watchedDirectory !== undefined && object.watchedDirectory !== null) + ? WatchedDirectory.fromPartial(object.watchedDirectory) + : undefined; + return message; + }, +}; + +function createBaseRetryPolicy(): RetryPolicy { + return { + retryBackOff: undefined, + numRetries: undefined, + retryOn: "", + retryPriority: undefined, + retryHostPredicate: [], + hostSelectionRetryMaxAttempts: "0", + }; +} + +export const RetryPolicy: MessageFns = { + encode(message: RetryPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.retryBackOff !== undefined) { + BackoffStrategy.encode(message.retryBackOff, writer.uint32(10).fork()).join(); + } + if (message.numRetries !== undefined) { + UInt32Value.encode({ value: message.numRetries! }, writer.uint32(18).fork()).join(); + } + if (message.retryOn !== "") { + writer.uint32(26).string(message.retryOn); + } + if (message.retryPriority !== undefined) { + RetryPolicy_RetryPriority.encode(message.retryPriority, writer.uint32(34).fork()).join(); + } + for (const v of message.retryHostPredicate) { + RetryPolicy_RetryHostPredicate.encode(v!, writer.uint32(42).fork()).join(); + } + if (message.hostSelectionRetryMaxAttempts !== "0") { + writer.uint32(48).int64(message.hostSelectionRetryMaxAttempts); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RetryPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRetryPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.retryBackOff = BackoffStrategy.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.numRetries = UInt32Value.decode(reader, reader.uint32()).value; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.retryOn = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.retryPriority = RetryPolicy_RetryPriority.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.retryHostPredicate.push(RetryPolicy_RetryHostPredicate.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.hostSelectionRetryMaxAttempts = reader.int64().toString(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RetryPolicy { + return { + retryBackOff: isSet(object.retryBackOff) ? BackoffStrategy.fromJSON(object.retryBackOff) : undefined, + numRetries: isSet(object.numRetries) ? Number(object.numRetries) : undefined, + retryOn: isSet(object.retryOn) ? globalThis.String(object.retryOn) : "", + retryPriority: isSet(object.retryPriority) ? RetryPolicy_RetryPriority.fromJSON(object.retryPriority) : undefined, + retryHostPredicate: globalThis.Array.isArray(object?.retryHostPredicate) + ? object.retryHostPredicate.map((e: any) => RetryPolicy_RetryHostPredicate.fromJSON(e)) + : [], + hostSelectionRetryMaxAttempts: isSet(object.hostSelectionRetryMaxAttempts) + ? globalThis.String(object.hostSelectionRetryMaxAttempts) + : "0", + }; + }, + + toJSON(message: RetryPolicy): unknown { + const obj: any = {}; + if (message.retryBackOff !== undefined) { + obj.retryBackOff = BackoffStrategy.toJSON(message.retryBackOff); + } + if (message.numRetries !== undefined) { + obj.numRetries = message.numRetries; + } + if (message.retryOn !== "") { + obj.retryOn = message.retryOn; + } + if (message.retryPriority !== undefined) { + obj.retryPriority = RetryPolicy_RetryPriority.toJSON(message.retryPriority); + } + if (message.retryHostPredicate?.length) { + obj.retryHostPredicate = message.retryHostPredicate.map((e) => RetryPolicy_RetryHostPredicate.toJSON(e)); + } + if (message.hostSelectionRetryMaxAttempts !== "0") { + obj.hostSelectionRetryMaxAttempts = message.hostSelectionRetryMaxAttempts; + } + return obj; + }, + + create, I>>(base?: I): RetryPolicy { + return RetryPolicy.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RetryPolicy { + const message = createBaseRetryPolicy(); + message.retryBackOff = (object.retryBackOff !== undefined && object.retryBackOff !== null) + ? BackoffStrategy.fromPartial(object.retryBackOff) + : undefined; + message.numRetries = object.numRetries ?? undefined; + message.retryOn = object.retryOn ?? ""; + message.retryPriority = (object.retryPriority !== undefined && object.retryPriority !== null) + ? RetryPolicy_RetryPriority.fromPartial(object.retryPriority) + : undefined; + message.retryHostPredicate = object.retryHostPredicate?.map((e) => RetryPolicy_RetryHostPredicate.fromPartial(e)) || + []; + message.hostSelectionRetryMaxAttempts = object.hostSelectionRetryMaxAttempts ?? "0"; + return message; + }, +}; + +function createBaseRetryPolicy_RetryPriority(): RetryPolicy_RetryPriority { + return { name: "", typedConfig: undefined }; +} + +export const RetryPolicy_RetryPriority: MessageFns = { + encode(message: RetryPolicy_RetryPriority, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.typedConfig !== undefined) { + Any.encode(message.typedConfig, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RetryPolicy_RetryPriority { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRetryPolicy_RetryPriority(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.typedConfig = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RetryPolicy_RetryPriority { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, + }; + }, + + toJSON(message: RetryPolicy_RetryPriority): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.typedConfig !== undefined) { + obj.typedConfig = Any.toJSON(message.typedConfig); + } + return obj; + }, + + create, I>>(base?: I): RetryPolicy_RetryPriority { + return RetryPolicy_RetryPriority.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RetryPolicy_RetryPriority { + const message = createBaseRetryPolicy_RetryPriority(); + message.name = object.name ?? ""; + message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) + ? Any.fromPartial(object.typedConfig) + : undefined; + return message; + }, +}; + +function createBaseRetryPolicy_RetryHostPredicate(): RetryPolicy_RetryHostPredicate { + return { name: "", typedConfig: undefined }; +} + +export const RetryPolicy_RetryHostPredicate: MessageFns = { + encode(message: RetryPolicy_RetryHostPredicate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.typedConfig !== undefined) { + Any.encode(message.typedConfig, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RetryPolicy_RetryHostPredicate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRetryPolicy_RetryHostPredicate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.typedConfig = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RetryPolicy_RetryHostPredicate { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, + }; + }, + + toJSON(message: RetryPolicy_RetryHostPredicate): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.typedConfig !== undefined) { + obj.typedConfig = Any.toJSON(message.typedConfig); + } + return obj; + }, + + create, I>>(base?: I): RetryPolicy_RetryHostPredicate { + return RetryPolicy_RetryHostPredicate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): RetryPolicy_RetryHostPredicate { + const message = createBaseRetryPolicy_RetryHostPredicate(); + message.name = object.name ?? ""; + message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) + ? Any.fromPartial(object.typedConfig) + : undefined; + return message; + }, +}; + +function createBaseRemoteDataSource(): RemoteDataSource { + return { httpUri: undefined, sha256: "", retryPolicy: undefined }; +} + +export const RemoteDataSource: MessageFns = { + encode(message: RemoteDataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.httpUri !== undefined) { + HttpUri.encode(message.httpUri, writer.uint32(10).fork()).join(); + } + if (message.sha256 !== "") { + writer.uint32(18).string(message.sha256); + } + if (message.retryPolicy !== undefined) { + RetryPolicy.encode(message.retryPolicy, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RemoteDataSource { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRemoteDataSource(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.httpUri = HttpUri.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.sha256 = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.retryPolicy = RetryPolicy.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RemoteDataSource { + return { + httpUri: isSet(object.httpUri) ? HttpUri.fromJSON(object.httpUri) : undefined, + sha256: isSet(object.sha256) ? globalThis.String(object.sha256) : "", + retryPolicy: isSet(object.retryPolicy) ? RetryPolicy.fromJSON(object.retryPolicy) : undefined, + }; + }, + + toJSON(message: RemoteDataSource): unknown { + const obj: any = {}; + if (message.httpUri !== undefined) { + obj.httpUri = HttpUri.toJSON(message.httpUri); + } + if (message.sha256 !== "") { + obj.sha256 = message.sha256; + } + if (message.retryPolicy !== undefined) { + obj.retryPolicy = RetryPolicy.toJSON(message.retryPolicy); + } + return obj; + }, + + create, I>>(base?: I): RemoteDataSource { + return RemoteDataSource.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RemoteDataSource { + const message = createBaseRemoteDataSource(); + message.httpUri = (object.httpUri !== undefined && object.httpUri !== null) + ? HttpUri.fromPartial(object.httpUri) + : undefined; + message.sha256 = object.sha256 ?? ""; + message.retryPolicy = (object.retryPolicy !== undefined && object.retryPolicy !== null) + ? RetryPolicy.fromPartial(object.retryPolicy) + : undefined; + return message; + }, +}; + +function createBaseAsyncDataSource(): AsyncDataSource { + return { local: undefined, remote: undefined }; +} + +export const AsyncDataSource: MessageFns = { + encode(message: AsyncDataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.local !== undefined) { + DataSource.encode(message.local, writer.uint32(10).fork()).join(); + } + if (message.remote !== undefined) { + RemoteDataSource.encode(message.remote, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AsyncDataSource { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAsyncDataSource(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.local = DataSource.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.remote = RemoteDataSource.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AsyncDataSource { + return { + local: isSet(object.local) ? DataSource.fromJSON(object.local) : undefined, + remote: isSet(object.remote) ? RemoteDataSource.fromJSON(object.remote) : undefined, + }; + }, + + toJSON(message: AsyncDataSource): unknown { + const obj: any = {}; + if (message.local !== undefined) { + obj.local = DataSource.toJSON(message.local); + } + if (message.remote !== undefined) { + obj.remote = RemoteDataSource.toJSON(message.remote); + } + return obj; + }, + + create, I>>(base?: I): AsyncDataSource { + return AsyncDataSource.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): AsyncDataSource { + const message = createBaseAsyncDataSource(); + message.local = (object.local !== undefined && object.local !== null) + ? DataSource.fromPartial(object.local) + : undefined; + message.remote = (object.remote !== undefined && object.remote !== null) + ? RemoteDataSource.fromPartial(object.remote) + : undefined; + return message; + }, +}; + +function createBaseTransportSocket(): TransportSocket { + return { name: "", typedConfig: undefined }; +} + +export const TransportSocket: MessageFns = { + encode(message: TransportSocket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.typedConfig !== undefined) { + Any.encode(message.typedConfig, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TransportSocket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransportSocket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.typedConfig = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TransportSocket { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, + }; + }, + + toJSON(message: TransportSocket): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.typedConfig !== undefined) { + obj.typedConfig = Any.toJSON(message.typedConfig); + } + return obj; + }, + + create, I>>(base?: I): TransportSocket { + return TransportSocket.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TransportSocket { + const message = createBaseTransportSocket(); + message.name = object.name ?? ""; + message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) + ? Any.fromPartial(object.typedConfig) + : undefined; + return message; + }, +}; + +function createBaseRuntimeFractionalPercent(): RuntimeFractionalPercent { + return { defaultValue: undefined, runtimeKey: "" }; +} + +export const RuntimeFractionalPercent: MessageFns = { + encode(message: RuntimeFractionalPercent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.defaultValue !== undefined) { + FractionalPercent.encode(message.defaultValue, writer.uint32(10).fork()).join(); + } + if (message.runtimeKey !== "") { + writer.uint32(18).string(message.runtimeKey); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuntimeFractionalPercent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuntimeFractionalPercent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.defaultValue = FractionalPercent.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.runtimeKey = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuntimeFractionalPercent { + return { + defaultValue: isSet(object.defaultValue) ? FractionalPercent.fromJSON(object.defaultValue) : undefined, + runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", + }; + }, + + toJSON(message: RuntimeFractionalPercent): unknown { + const obj: any = {}; + if (message.defaultValue !== undefined) { + obj.defaultValue = FractionalPercent.toJSON(message.defaultValue); + } + if (message.runtimeKey !== "") { + obj.runtimeKey = message.runtimeKey; + } + return obj; + }, + + create, I>>(base?: I): RuntimeFractionalPercent { + return RuntimeFractionalPercent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RuntimeFractionalPercent { + const message = createBaseRuntimeFractionalPercent(); + message.defaultValue = (object.defaultValue !== undefined && object.defaultValue !== null) + ? FractionalPercent.fromPartial(object.defaultValue) + : undefined; + message.runtimeKey = object.runtimeKey ?? ""; + return message; + }, +}; + +function createBaseControlPlane(): ControlPlane { + return { identifier: "" }; +} + +export const ControlPlane: MessageFns = { + encode(message: ControlPlane, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ControlPlane { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseControlPlane(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.identifier = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ControlPlane { + return { identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "" }; + }, + + toJSON(message: ControlPlane): unknown { + const obj: any = {}; + if (message.identifier !== "") { + obj.identifier = message.identifier; + } + return obj; + }, + + create, I>>(base?: I): ControlPlane { + return ControlPlane.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ControlPlane { + const message = createBaseControlPlane(); + message.identifier = object.identifier ?? ""; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts new file mode 100644 index 00000000..b2189ad1 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/config/core/v3/extension.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Any } from "../../../../google/protobuf/any.js"; + +export const protobufPackage = "envoy.config.core.v3"; + +/** + * Message type for extension configuration. + * [#next-major-version: revisit all existing typed_config that doesn't use this wrapper.]. + */ +export interface TypedExtensionConfig { + /** + * The name of an extension. This is not used to select the extension, instead + * it serves the role of an opaque identifier. + */ + name: string; + /** + * The typed config for the extension. The type URL will be used to identify + * the extension. In the case that the type URL is ``xds.type.v3.TypedStruct`` + * (or, for historical reasons, ``udpa.type.v1.TypedStruct``), the inner type + * URL of ``TypedStruct`` will be utilized. See the + * :ref:`extension configuration overview + * ` for further details. + */ + typedConfig: Any | undefined; +} + +function createBaseTypedExtensionConfig(): TypedExtensionConfig { + return { name: "", typedConfig: undefined }; +} + +export const TypedExtensionConfig: MessageFns = { + encode(message: TypedExtensionConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.typedConfig !== undefined) { + Any.encode(message.typedConfig, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TypedExtensionConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTypedExtensionConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.typedConfig = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TypedExtensionConfig { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, + }; + }, + + toJSON(message: TypedExtensionConfig): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.typedConfig !== undefined) { + obj.typedConfig = Any.toJSON(message.typedConfig); + } + return obj; + }, + + create, I>>(base?: I): TypedExtensionConfig { + return TypedExtensionConfig.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TypedExtensionConfig { + const message = createBaseTypedExtensionConfig(); + message.name = object.name ?? ""; + message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) + ? Any.fromPartial(object.typedConfig) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts new file mode 100644 index 00000000..93497d1c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts @@ -0,0 +1,159 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/config/core/v3/http_uri.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Duration } from "../../../../google/protobuf/duration.js"; + +export const protobufPackage = "envoy.config.core.v3"; + +/** Envoy external URI descriptor */ +export interface HttpUri { + /** + * The HTTP server URI. It should be a full FQDN with protocol, host and path. + * + * Example: + * + * .. code-block:: yaml + * + * uri: https://www.googleapis.com/oauth2/v1/certs + */ + uri: string; + /** + * A cluster is created in the Envoy "cluster_manager" config + * section. This field specifies the cluster name. + * + * Example: + * + * .. code-block:: yaml + * + * cluster: jwks_cluster + */ + cluster?: + | string + | undefined; + /** Sets the maximum duration in milliseconds that a response can take to arrive upon request. */ + timeout: Duration | undefined; +} + +function createBaseHttpUri(): HttpUri { + return { uri: "", cluster: undefined, timeout: undefined }; +} + +export const HttpUri: MessageFns = { + encode(message: HttpUri, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.uri !== "") { + writer.uint32(10).string(message.uri); + } + if (message.cluster !== undefined) { + writer.uint32(18).string(message.cluster); + } + if (message.timeout !== undefined) { + Duration.encode(message.timeout, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpUri { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpUri(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.uri = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.cluster = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.timeout = Duration.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpUri { + return { + uri: isSet(object.uri) ? globalThis.String(object.uri) : "", + cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : undefined, + timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined, + }; + }, + + toJSON(message: HttpUri): unknown { + const obj: any = {}; + if (message.uri !== "") { + obj.uri = message.uri; + } + if (message.cluster !== undefined) { + obj.cluster = message.cluster; + } + if (message.timeout !== undefined) { + obj.timeout = Duration.toJSON(message.timeout); + } + return obj; + }, + + create, I>>(base?: I): HttpUri { + return HttpUri.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpUri { + const message = createBaseHttpUri(); + message.uri = object.uri ?? ""; + message.cluster = object.cluster ?? undefined; + message.timeout = (object.timeout !== undefined && object.timeout !== null) + ? Duration.fromPartial(object.timeout) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts new file mode 100644 index 00000000..b1fbc895 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts @@ -0,0 +1,585 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/config/core/v3/socket_option.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "envoy.config.core.v3"; + +/** + * Generic socket option message. This would be used to set socket options that + * might not exist in upstream kernels or precompiled Envoy binaries. + * + * For example: + * + * .. code-block:: json + * + * { + * "description": "support tcp keep alive", + * "state": 0, + * "level": 1, + * "name": 9, + * "int_value": 1, + * } + * + * 1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux. + * With the above configuration, `TCP Keep-Alives `_ + * can be enabled in socket with Linux, which can be used in + * :ref:`listener's` or + * :ref:`admin's ` socket_options etc. + * + * It should be noted that the name or level may have different values on different platforms. + * [#next-free-field: 8] + */ +export interface SocketOption { + /** + * An optional name to give this socket option for debugging, etc. + * Uniqueness is not required and no special meaning is assumed. + */ + description: string; + /** Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP */ + level: string; + /** The numeric name as passed to setsockopt */ + name: string; + /** Because many sockopts take an int value. */ + intValue?: + | string + | undefined; + /** Otherwise it's a byte buffer. */ + bufValue?: + | Uint8Array + | undefined; + /** + * The state in which the option will be applied. When used in BindConfig + * STATE_PREBIND is currently the only valid value. + */ + state: SocketOption_SocketState; + /** + * Apply the socket option to the specified `socket type `_. + * If not specified, the socket option will be applied to all socket types. + */ + type: SocketOption_SocketType | undefined; +} + +export enum SocketOption_SocketState { + /** STATE_PREBIND - Socket options are applied after socket creation but before binding the socket to a port */ + STATE_PREBIND = 0, + /** STATE_BOUND - Socket options are applied after binding the socket to a port but before calling listen() */ + STATE_BOUND = 1, + /** STATE_LISTENING - Socket options are applied after calling listen() */ + STATE_LISTENING = 2, + UNRECOGNIZED = -1, +} + +export function socketOption_SocketStateFromJSON(object: any): SocketOption_SocketState { + switch (object) { + case 0: + case "STATE_PREBIND": + return SocketOption_SocketState.STATE_PREBIND; + case 1: + case "STATE_BOUND": + return SocketOption_SocketState.STATE_BOUND; + case 2: + case "STATE_LISTENING": + return SocketOption_SocketState.STATE_LISTENING; + case -1: + case "UNRECOGNIZED": + default: + return SocketOption_SocketState.UNRECOGNIZED; + } +} + +export function socketOption_SocketStateToJSON(object: SocketOption_SocketState): string { + switch (object) { + case SocketOption_SocketState.STATE_PREBIND: + return "STATE_PREBIND"; + case SocketOption_SocketState.STATE_BOUND: + return "STATE_BOUND"; + case SocketOption_SocketState.STATE_LISTENING: + return "STATE_LISTENING"; + case SocketOption_SocketState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * The `socket type `_ to apply the socket option to. + * Only one field should be set. If multiple fields are set, the precedence order will determine + * the selected one. If none of the fields is set, the socket option will be applied to all socket types. + * + * For example: + * If :ref:`stream ` is set, + * it takes precedence over :ref:`datagram `. + */ +export interface SocketOption_SocketType { + /** Apply the socket option to the stream socket type. */ + stream: + | SocketOption_SocketType_Stream + | undefined; + /** Apply the socket option to the datagram socket type. */ + datagram: SocketOption_SocketType_Datagram | undefined; +} + +/** The stream socket type. */ +export interface SocketOption_SocketType_Stream { +} + +/** The datagram socket type. */ +export interface SocketOption_SocketType_Datagram { +} + +export interface SocketOptionsOverride { + socketOptions: SocketOption[]; +} + +function createBaseSocketOption(): SocketOption { + return { + description: "", + level: "0", + name: "0", + intValue: undefined, + bufValue: undefined, + state: 0, + type: undefined, + }; +} + +export const SocketOption: MessageFns = { + encode(message: SocketOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + if (message.level !== "0") { + writer.uint32(16).int64(message.level); + } + if (message.name !== "0") { + writer.uint32(24).int64(message.name); + } + if (message.intValue !== undefined) { + writer.uint32(32).int64(message.intValue); + } + if (message.bufValue !== undefined) { + writer.uint32(42).bytes(message.bufValue); + } + if (message.state !== 0) { + writer.uint32(48).int32(message.state); + } + if (message.type !== undefined) { + SocketOption_SocketType.encode(message.type, writer.uint32(58).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SocketOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSocketOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.description = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.level = reader.int64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.name = reader.int64().toString(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.intValue = reader.int64().toString(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.bufValue = reader.bytes(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.state = reader.int32() as any; + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.type = SocketOption_SocketType.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SocketOption { + return { + description: isSet(object.description) ? globalThis.String(object.description) : "", + level: isSet(object.level) ? globalThis.String(object.level) : "0", + name: isSet(object.name) ? globalThis.String(object.name) : "0", + intValue: isSet(object.intValue) ? globalThis.String(object.intValue) : undefined, + bufValue: isSet(object.bufValue) ? bytesFromBase64(object.bufValue) : undefined, + state: isSet(object.state) ? socketOption_SocketStateFromJSON(object.state) : 0, + type: isSet(object.type) ? SocketOption_SocketType.fromJSON(object.type) : undefined, + }; + }, + + toJSON(message: SocketOption): unknown { + const obj: any = {}; + if (message.description !== "") { + obj.description = message.description; + } + if (message.level !== "0") { + obj.level = message.level; + } + if (message.name !== "0") { + obj.name = message.name; + } + if (message.intValue !== undefined) { + obj.intValue = message.intValue; + } + if (message.bufValue !== undefined) { + obj.bufValue = base64FromBytes(message.bufValue); + } + if (message.state !== 0) { + obj.state = socketOption_SocketStateToJSON(message.state); + } + if (message.type !== undefined) { + obj.type = SocketOption_SocketType.toJSON(message.type); + } + return obj; + }, + + create, I>>(base?: I): SocketOption { + return SocketOption.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SocketOption { + const message = createBaseSocketOption(); + message.description = object.description ?? ""; + message.level = object.level ?? "0"; + message.name = object.name ?? "0"; + message.intValue = object.intValue ?? undefined; + message.bufValue = object.bufValue ?? undefined; + message.state = object.state ?? 0; + message.type = (object.type !== undefined && object.type !== null) + ? SocketOption_SocketType.fromPartial(object.type) + : undefined; + return message; + }, +}; + +function createBaseSocketOption_SocketType(): SocketOption_SocketType { + return { stream: undefined, datagram: undefined }; +} + +export const SocketOption_SocketType: MessageFns = { + encode(message: SocketOption_SocketType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.stream !== undefined) { + SocketOption_SocketType_Stream.encode(message.stream, writer.uint32(10).fork()).join(); + } + if (message.datagram !== undefined) { + SocketOption_SocketType_Datagram.encode(message.datagram, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SocketOption_SocketType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSocketOption_SocketType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.stream = SocketOption_SocketType_Stream.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.datagram = SocketOption_SocketType_Datagram.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SocketOption_SocketType { + return { + stream: isSet(object.stream) ? SocketOption_SocketType_Stream.fromJSON(object.stream) : undefined, + datagram: isSet(object.datagram) ? SocketOption_SocketType_Datagram.fromJSON(object.datagram) : undefined, + }; + }, + + toJSON(message: SocketOption_SocketType): unknown { + const obj: any = {}; + if (message.stream !== undefined) { + obj.stream = SocketOption_SocketType_Stream.toJSON(message.stream); + } + if (message.datagram !== undefined) { + obj.datagram = SocketOption_SocketType_Datagram.toJSON(message.datagram); + } + return obj; + }, + + create, I>>(base?: I): SocketOption_SocketType { + return SocketOption_SocketType.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SocketOption_SocketType { + const message = createBaseSocketOption_SocketType(); + message.stream = (object.stream !== undefined && object.stream !== null) + ? SocketOption_SocketType_Stream.fromPartial(object.stream) + : undefined; + message.datagram = (object.datagram !== undefined && object.datagram !== null) + ? SocketOption_SocketType_Datagram.fromPartial(object.datagram) + : undefined; + return message; + }, +}; + +function createBaseSocketOption_SocketType_Stream(): SocketOption_SocketType_Stream { + return {}; +} + +export const SocketOption_SocketType_Stream: MessageFns = { + encode(_: SocketOption_SocketType_Stream, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SocketOption_SocketType_Stream { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSocketOption_SocketType_Stream(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): SocketOption_SocketType_Stream { + return {}; + }, + + toJSON(_: SocketOption_SocketType_Stream): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): SocketOption_SocketType_Stream { + return SocketOption_SocketType_Stream.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): SocketOption_SocketType_Stream { + const message = createBaseSocketOption_SocketType_Stream(); + return message; + }, +}; + +function createBaseSocketOption_SocketType_Datagram(): SocketOption_SocketType_Datagram { + return {}; +} + +export const SocketOption_SocketType_Datagram: MessageFns = { + encode(_: SocketOption_SocketType_Datagram, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SocketOption_SocketType_Datagram { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSocketOption_SocketType_Datagram(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): SocketOption_SocketType_Datagram { + return {}; + }, + + toJSON(_: SocketOption_SocketType_Datagram): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): SocketOption_SocketType_Datagram { + return SocketOption_SocketType_Datagram.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + _: I, + ): SocketOption_SocketType_Datagram { + const message = createBaseSocketOption_SocketType_Datagram(); + return message; + }, +}; + +function createBaseSocketOptionsOverride(): SocketOptionsOverride { + return { socketOptions: [] }; +} + +export const SocketOptionsOverride: MessageFns = { + encode(message: SocketOptionsOverride, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.socketOptions) { + SocketOption.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SocketOptionsOverride { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSocketOptionsOverride(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.socketOptions.push(SocketOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SocketOptionsOverride { + return { + socketOptions: globalThis.Array.isArray(object?.socketOptions) + ? object.socketOptions.map((e: any) => SocketOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SocketOptionsOverride): unknown { + const obj: any = {}; + if (message.socketOptions?.length) { + obj.socketOptions = message.socketOptions.map((e) => SocketOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): SocketOptionsOverride { + return SocketOptionsOverride.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SocketOptionsOverride { + const message = createBaseSocketOptionsOverride(); + message.socketOptions = object.socketOptions?.map((e) => SocketOption.fromPartial(e)) || []; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts new file mode 100644 index 00000000..a024e3b9 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts @@ -0,0 +1,352 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "envoy.extensions.filters.http.ext_proc.v3"; + +/** [#next-free-field: 7] */ +export interface ProcessingMode { + /** + * How to handle the request header. Default is "SEND". + * Note this field is ignored in :ref:`mode_override + * `, since mode + * overrides can only affect messages exchanged after the request header is processed. + */ + requestHeaderMode: ProcessingMode_HeaderSendMode; + /** How to handle the response header. Default is "SEND". */ + responseHeaderMode: ProcessingMode_HeaderSendMode; + /** How to handle the request body. Default is "NONE". */ + requestBodyMode: ProcessingMode_BodySendMode; + /** How do handle the response body. Default is "NONE". */ + responseBodyMode: ProcessingMode_BodySendMode; + /** How to handle the request trailers. Default is "SKIP". */ + requestTrailerMode: ProcessingMode_HeaderSendMode; + /** How to handle the response trailers. Default is "SKIP". */ + responseTrailerMode: ProcessingMode_HeaderSendMode; +} + +/** Control how headers and trailers are handled */ +export enum ProcessingMode_HeaderSendMode { + /** + * DEFAULT - When used to configure the ext_proc filter :ref:`processing_mode + * `, + * the default HeaderSendMode depends on which part of the message is being processed. By + * default, request and response headers are sent, while trailers are skipped. + * + * When used in :ref:`mode_override + * ` or + * :ref:`allowed_override_modes + * `, + * a value of DEFAULT indicates that there is no change from the behavior that is configured for + * the filter in :ref:`processing_mode + * `. + */ + DEFAULT = 0, + /** SEND - Send the header or trailer. */ + SEND = 1, + /** SKIP - Do not send the header or trailer. */ + SKIP = 2, + UNRECOGNIZED = -1, +} + +export function processingMode_HeaderSendModeFromJSON(object: any): ProcessingMode_HeaderSendMode { + switch (object) { + case 0: + case "DEFAULT": + return ProcessingMode_HeaderSendMode.DEFAULT; + case 1: + case "SEND": + return ProcessingMode_HeaderSendMode.SEND; + case 2: + case "SKIP": + return ProcessingMode_HeaderSendMode.SKIP; + case -1: + case "UNRECOGNIZED": + default: + return ProcessingMode_HeaderSendMode.UNRECOGNIZED; + } +} + +export function processingMode_HeaderSendModeToJSON(object: ProcessingMode_HeaderSendMode): string { + switch (object) { + case ProcessingMode_HeaderSendMode.DEFAULT: + return "DEFAULT"; + case ProcessingMode_HeaderSendMode.SEND: + return "SEND"; + case ProcessingMode_HeaderSendMode.SKIP: + return "SKIP"; + case ProcessingMode_HeaderSendMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * Control how the request and response bodies are handled + * When body mutation by external processor is enabled, ext_proc filter will always remove + * the content length header in four cases below because content length can not be guaranteed + * to be set correctly: + * 1) STREAMED BodySendMode: header processing completes before body mutation comes back. + * 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. + * 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. + * 4) FULL_DUPLEX_STREAMED BodySendMode: header processing completes before body mutation comes back. + * + * In Envoy's http1 codec implementation, removing content length will enable chunked transfer + * encoding whenever feasible. The recipient (either client or server) must be able + * to parse and decode the chunked transfer coding. + * (see `details in RFC9112 `_). + * + * In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is + * external processor's responsibility to set the content length correctly matched to the length + * of mutated body. If they don't match, the corresponding body mutation will be rejected and + * local reply will be sent with an error message. + */ +export enum ProcessingMode_BodySendMode { + /** NONE - Do not send the body at all. This is the default. */ + NONE = 0, + /** STREAMED - Stream the body to the server in pieces as they are seen. */ + STREAMED = 1, + /** + * BUFFERED - Buffer the message body in memory and send the entire body at once. + * If the body exceeds the configured buffer limit, then the + * downstream system will receive an error. + */ + BUFFERED = 2, + /** + * BUFFERED_PARTIAL - Buffer the message body in memory and send the entire body in one + * chunk. If the body exceeds the configured buffer limit, then the body contents + * up to the buffer limit will be sent. + */ + BUFFERED_PARTIAL = 3, + FULL_DUPLEX_STREAMED = 4, + UNRECOGNIZED = -1, +} + +export function processingMode_BodySendModeFromJSON(object: any): ProcessingMode_BodySendMode { + switch (object) { + case 0: + case "NONE": + return ProcessingMode_BodySendMode.NONE; + case 1: + case "STREAMED": + return ProcessingMode_BodySendMode.STREAMED; + case 2: + case "BUFFERED": + return ProcessingMode_BodySendMode.BUFFERED; + case 3: + case "BUFFERED_PARTIAL": + return ProcessingMode_BodySendMode.BUFFERED_PARTIAL; + case 4: + case "FULL_DUPLEX_STREAMED": + return ProcessingMode_BodySendMode.FULL_DUPLEX_STREAMED; + case -1: + case "UNRECOGNIZED": + default: + return ProcessingMode_BodySendMode.UNRECOGNIZED; + } +} + +export function processingMode_BodySendModeToJSON(object: ProcessingMode_BodySendMode): string { + switch (object) { + case ProcessingMode_BodySendMode.NONE: + return "NONE"; + case ProcessingMode_BodySendMode.STREAMED: + return "STREAMED"; + case ProcessingMode_BodySendMode.BUFFERED: + return "BUFFERED"; + case ProcessingMode_BodySendMode.BUFFERED_PARTIAL: + return "BUFFERED_PARTIAL"; + case ProcessingMode_BodySendMode.FULL_DUPLEX_STREAMED: + return "FULL_DUPLEX_STREAMED"; + case ProcessingMode_BodySendMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +function createBaseProcessingMode(): ProcessingMode { + return { + requestHeaderMode: 0, + responseHeaderMode: 0, + requestBodyMode: 0, + responseBodyMode: 0, + requestTrailerMode: 0, + responseTrailerMode: 0, + }; +} + +export const ProcessingMode: MessageFns = { + encode(message: ProcessingMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.requestHeaderMode !== 0) { + writer.uint32(8).int32(message.requestHeaderMode); + } + if (message.responseHeaderMode !== 0) { + writer.uint32(16).int32(message.responseHeaderMode); + } + if (message.requestBodyMode !== 0) { + writer.uint32(24).int32(message.requestBodyMode); + } + if (message.responseBodyMode !== 0) { + writer.uint32(32).int32(message.responseBodyMode); + } + if (message.requestTrailerMode !== 0) { + writer.uint32(40).int32(message.requestTrailerMode); + } + if (message.responseTrailerMode !== 0) { + writer.uint32(48).int32(message.responseTrailerMode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ProcessingMode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProcessingMode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.requestHeaderMode = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.responseHeaderMode = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.requestBodyMode = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.responseBodyMode = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.requestTrailerMode = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.responseTrailerMode = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProcessingMode { + return { + requestHeaderMode: isSet(object.requestHeaderMode) + ? processingMode_HeaderSendModeFromJSON(object.requestHeaderMode) + : 0, + responseHeaderMode: isSet(object.responseHeaderMode) + ? processingMode_HeaderSendModeFromJSON(object.responseHeaderMode) + : 0, + requestBodyMode: isSet(object.requestBodyMode) ? processingMode_BodySendModeFromJSON(object.requestBodyMode) : 0, + responseBodyMode: isSet(object.responseBodyMode) + ? processingMode_BodySendModeFromJSON(object.responseBodyMode) + : 0, + requestTrailerMode: isSet(object.requestTrailerMode) + ? processingMode_HeaderSendModeFromJSON(object.requestTrailerMode) + : 0, + responseTrailerMode: isSet(object.responseTrailerMode) + ? processingMode_HeaderSendModeFromJSON(object.responseTrailerMode) + : 0, + }; + }, + + toJSON(message: ProcessingMode): unknown { + const obj: any = {}; + if (message.requestHeaderMode !== 0) { + obj.requestHeaderMode = processingMode_HeaderSendModeToJSON(message.requestHeaderMode); + } + if (message.responseHeaderMode !== 0) { + obj.responseHeaderMode = processingMode_HeaderSendModeToJSON(message.responseHeaderMode); + } + if (message.requestBodyMode !== 0) { + obj.requestBodyMode = processingMode_BodySendModeToJSON(message.requestBodyMode); + } + if (message.responseBodyMode !== 0) { + obj.responseBodyMode = processingMode_BodySendModeToJSON(message.responseBodyMode); + } + if (message.requestTrailerMode !== 0) { + obj.requestTrailerMode = processingMode_HeaderSendModeToJSON(message.requestTrailerMode); + } + if (message.responseTrailerMode !== 0) { + obj.responseTrailerMode = processingMode_HeaderSendModeToJSON(message.responseTrailerMode); + } + return obj; + }, + + create, I>>(base?: I): ProcessingMode { + return ProcessingMode.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ProcessingMode { + const message = createBaseProcessingMode(); + message.requestHeaderMode = object.requestHeaderMode ?? 0; + message.responseHeaderMode = object.responseHeaderMode ?? 0; + message.requestBodyMode = object.requestBodyMode ?? 0; + message.responseBodyMode = object.responseBodyMode ?? 0; + message.requestTrailerMode = object.requestTrailerMode ?? 0; + message.responseTrailerMode = object.responseTrailerMode ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts new file mode 100644 index 00000000..3afd1ece --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts @@ -0,0 +1,2456 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/service/ext_proc/v3/external_processor.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { + type CallOptions, + type ChannelCredentials, + Client, + type ClientDuplexStream, + type ClientOptions, + type handleBidiStreamingCall, + makeGenericClientConstructor, + type Metadata, + type UntypedServiceImplementation, +} from "@grpc/grpc-js"; +import { Duration } from "../../../../google/protobuf/duration.js"; +import { Struct } from "../../../../google/protobuf/struct.js"; +import { HeaderMap, HeaderValueOption, Metadata as Metadata1 } from "../../../config/core/v3/base.js"; +import { + ProcessingMode, + ProcessingMode_BodySendMode, + processingMode_BodySendModeFromJSON, + processingMode_BodySendModeToJSON, +} from "../../../extensions/filters/http/ext_proc/v3/processing_mode.js"; +import { HttpStatus } from "../../../type/v3/http_status.js"; + +export const protobufPackage = "envoy.service.ext_proc.v3"; + +/** + * This message specifies the filter protocol configurations which will be sent to the ext_proc + * server in a :ref:`ProcessingRequest `. + * If the server does not support these protocol configurations, it may choose to close the gRPC stream. + * If the server supports these protocol configurations, it should respond based on the API specifications. + */ +export interface ProtocolConfiguration { + /** + * Specify the filter configuration :ref:`request_body_mode + * ` + */ + requestBodyMode: ProcessingMode_BodySendMode; + /** + * Specify the filter configuration :ref:`response_body_mode + * ` + */ + responseBodyMode: ProcessingMode_BodySendMode; + /** + * Specify the filter configuration :ref:`send_body_without_waiting_for_header_response + * ` + * If the client is waiting for a header response from the server, setting ``true`` means the client will send body to the server + * as they arrive. Setting ``false`` means the client will buffer the arrived data and not send it to the server immediately. + */ + sendBodyWithoutWaitingForHeaderResponse: boolean; +} + +/** + * This represents the different types of messages that the data plane can send + * to an external processing server. + * [#next-free-field: 12] + */ +export interface ProcessingRequest { + /** + * Information about the HTTP request headers, as well as peer info and additional + * properties. Unless ``observability_mode`` is ``true``, the server must send back a + * HeaderResponse message, an ImmediateResponse message, or close the stream. + */ + requestHeaders?: + | HttpHeaders + | undefined; + /** + * Information about the HTTP response headers, as well as peer info and additional + * properties. Unless ``observability_mode`` is ``true``, the server must send back a + * HeaderResponse message or close the stream. + */ + responseHeaders?: + | HttpHeaders + | undefined; + /** + * A chunk of the HTTP request body. Unless ``observability_mode`` is true, the server must send back + * a BodyResponse message, an ImmediateResponse message, or close the stream. + */ + requestBody?: + | HttpBody + | undefined; + /** + * A chunk of the HTTP response body. Unless ``observability_mode`` is ``true``, the server must send back + * a BodyResponse message or close the stream. + */ + responseBody?: + | HttpBody + | undefined; + /** + * The HTTP trailers for the request path. Unless ``observability_mode`` is ``true``, the server + * must send back a TrailerResponse message or close the stream. + * + * This message is only sent if the trailers processing mode is set to ``SEND`` and + * the original downstream request has trailers. + */ + requestTrailers?: + | HttpTrailers + | undefined; + /** + * The HTTP trailers for the response path. Unless ``observability_mode`` is ``true``, the server + * must send back a TrailerResponse message or close the stream. + * + * This message is only sent if the trailers processing mode is set to ``SEND`` and + * the original upstream response has trailers. + */ + responseTrailers?: + | HttpTrailers + | undefined; + /** Dynamic metadata associated with the request. */ + metadataContext: + | Metadata1 + | undefined; + /** + * The values of properties selected by the ``request_attributes`` + * or ``response_attributes`` list in the configuration. Each entry + * in the list is populated from the standard + * :ref:`attributes ` supported in the data plane. + */ + attributes: { [key: string]: { [key: string]: any } | undefined }; + /** + * Specify whether the filter that sent this request is running in :ref:`observability_mode + * ` + * and defaults to false. + * + * * A value of ``false`` indicates that the server must respond + * to this message by either sending back a matching ProcessingResponse message, + * or by closing the stream. + * * A value of ``true`` indicates that the server should not respond to this message, as any + * responses will be ignored. However, it may still close the stream to indicate that no more messages + * are needed. + */ + observabilityMode: boolean; + /** + * Specify the filter protocol configurations to be sent to the server. + * ``protocol_config`` is only encoded in the first ``ProcessingRequest`` message from the client to the server. + */ + protocolConfig: ProtocolConfiguration | undefined; +} + +export interface ProcessingRequest_AttributesEntry { + key: string; + value: { [key: string]: any } | undefined; +} + +/** + * This represents the different types of messages the server may send back to the data plane + * when the ``observability_mode`` field in the received ProcessingRequest is set to false. + * + * * If the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is not set to ``FULL_DUPLEX_STREAMED``, then for every received ProcessingRequest, + * the server must send back exactly one ProcessingResponse message. + * * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined + * for this mode to send the ProcessingResponse messages. + * [#next-free-field: 11] + */ +export interface ProcessingResponse { + /** + * The server must send back this message in response to a message with the + * ``request_headers`` field set. + */ + requestHeaders?: + | HeadersResponse + | undefined; + /** + * The server must send back this message in response to a message with the + * ``response_headers`` field set. + */ + responseHeaders?: + | HeadersResponse + | undefined; + /** + * The server must send back this message in response to a message with + * the ``request_body`` field set. + */ + requestBody?: + | BodyResponse + | undefined; + /** + * The server must send back this message in response to a message with + * the ``response_body`` field set. + */ + responseBody?: + | BodyResponse + | undefined; + /** + * The server must send back this message in response to a message with + * the ``request_trailers`` field set. + */ + requestTrailers?: + | TrailersResponse + | undefined; + /** + * The server must send back this message in response to a message with + * the ``response_trailers`` field set. + */ + responseTrailers?: + | TrailersResponse + | undefined; + /** + * If specified, attempt to create a locally generated response, send it + * downstream, and stop processing additional filters and ignore any + * additional messages received from the remote server for this request or + * response. If a response has already started -- for example, if this + * message is sent response to a ``response_body`` message -- then + * this will either ship the reply directly to the downstream codec, + * or reset the stream. + */ + immediateResponse?: + | ImmediateResponse + | undefined; + /** + * Optional metadata that will be emitted as dynamic metadata to be consumed by + * following filters. This metadata will be placed in the namespace(s) specified by the top-level + * field name(s) of the struct. + */ + dynamicMetadata: + | { [key: string]: any } + | undefined; + /** + * Override how parts of the HTTP request and response are processed + * for the duration of this particular request/response only. Servers + * may use this to intelligently control how requests are processed + * based on the headers and other metadata that they see. + * This field is only applicable when servers responding to the header requests. + * If it is set in the response to the body or trailer requests, it will be ignored by the data plane. + * It is also ignored by the data plane when the ext_proc filter config + * :ref:`allow_mode_override + * ` + * is set to false, or + * :ref:`send_body_without_waiting_for_header_response + * ` + * is set to true. + */ + modeOverride: + | ProcessingMode + | undefined; + /** + * When ext_proc server receives a request message, in case it needs more + * time to process the message, it sends back a ProcessingResponse message + * with a new timeout value. When the data plane receives this response + * message, it ignores other fields in the response, just stop the original + * timer, which has the timeout value specified in + * :ref:`message_timeout + * ` + * and start a new timer with this ``override_message_timeout`` value and keep the + * data plane ext_proc filter state machine intact. + * Has to be >= 1ms and <= + * :ref:`max_message_timeout ` + * Such message can be sent at most once in a particular data plane ext_proc filter processing state. + * To enable this API, one has to set ``max_message_timeout`` to a number >= 1ms. + */ + overrideMessageTimeout: Duration | undefined; +} + +/** + * This message is sent to the external server when the HTTP request and responses + * are first received. + */ +export interface HttpHeaders { + /** + * The HTTP request headers. All header keys will be + * lower-cased, because HTTP header keys are case-insensitive. + * The header value is encoded in the + * :ref:`raw_value ` field. + */ + headers: + | HeaderMap + | undefined; + /** + * [#not-implemented-hide:] + * This field is deprecated and not implemented. Attributes will be sent in + * the top-level :ref:`attributes ` field. + */ + trailers: HeaderMap | undefined; +} + +/** + * This message is sent by the external server to the data plane after ``HttpHeaders`` was + * sent to it. + */ +export interface HeadersResponse { + /** + * Details the modifications (if any) to be made by the data plane to the current + * request/response. + */ + response: CommonResponse | undefined; +} + +/** + * This message is sent by the external server to the data plane after ``HttpBody`` was + * sent to it. + */ +export interface BodyResponse { + /** + * Details the modifications (if any) to be made by the data plane to the current + * request/response. + */ + response: CommonResponse | undefined; +} + +/** + * This message is sent by the external server to the data plane after ``HttpTrailers`` was + * sent to it. + */ +export interface TrailersResponse { + /** + * Details the modifications (if any) to be made by the data plane to the current + * request/response trailers. + */ + headerMutation: HeaderMutation | undefined; +} + +/** + * This message contains common fields between header and body responses. + * [#next-free-field: 6] + */ +export interface CommonResponse { + /** + * If set, provide additional direction on how the data plane should + * handle the rest of the HTTP filter chain. + */ + status: CommonResponse_ResponseStatus; + /** + * Instructions on how to manipulate the headers. When responding to an + * HttpBody request, header mutations will only take effect if + * the current processing mode for the body is BUFFERED. + */ + headerMutation: + | HeaderMutation + | undefined; + /** + * Replace the body of the last message sent to the remote server on this + * stream. If responding to an HttpBody request, simply replace or clear + * the body chunk that was sent with that request. Body mutations may take + * effect in response either to ``header`` or ``body`` messages. When it is + * in response to ``header`` messages, it only take effect if the + * :ref:`status ` + * is set to CONTINUE_AND_REPLACE. + */ + bodyMutation: + | BodyMutation + | undefined; + /** + * [#not-implemented-hide:] + * Add new trailers to the message. This may be used when responding to either a + * HttpHeaders or HttpBody message, but only if this message is returned + * along with the CONTINUE_AND_REPLACE status. + * The header value is encoded in the + * :ref:`raw_value ` field. + */ + trailers: + | HeaderMap + | undefined; + /** + * Clear the route cache for the current client request. This is necessary + * if the remote server modified headers that are used to calculate the route. + * This field is ignored in the response direction. This field is also ignored + * if the data plane ext_proc filter is in the upstream filter chain. + */ + clearRouteCache: boolean; +} + +/** The status of the response. */ +export enum CommonResponse_ResponseStatus { + /** + * CONTINUE - Apply the mutation instructions in this message to the + * request or response, and then continue processing the filter + * stream as normal. This is the default. + */ + CONTINUE = 0, + /** + * CONTINUE_AND_REPLACE - Apply the specified header mutation, replace the body with the body + * specified in the body mutation (if present), and do not send any + * further messages for this request or response even if the processing + * mode is configured to do so. + * + * When used in response to a request_headers or response_headers message, + * this status makes it possible to either completely replace the body + * while discarding the original body, or to add a body to a message that + * formerly did not have one. + * + * In other words, this response makes it possible to turn an HTTP GET + * into a POST, PUT, or PATCH. + */ + CONTINUE_AND_REPLACE = 1, + UNRECOGNIZED = -1, +} + +export function commonResponse_ResponseStatusFromJSON(object: any): CommonResponse_ResponseStatus { + switch (object) { + case 0: + case "CONTINUE": + return CommonResponse_ResponseStatus.CONTINUE; + case 1: + case "CONTINUE_AND_REPLACE": + return CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE; + case -1: + case "UNRECOGNIZED": + default: + return CommonResponse_ResponseStatus.UNRECOGNIZED; + } +} + +export function commonResponse_ResponseStatusToJSON(object: CommonResponse_ResponseStatus): string { + switch (object) { + case CommonResponse_ResponseStatus.CONTINUE: + return "CONTINUE"; + case CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE: + return "CONTINUE_AND_REPLACE"; + case CommonResponse_ResponseStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * This message causes the filter to attempt to create a locally + * generated response, send it downstream, stop processing + * additional filters, and ignore any additional messages received + * from the remote server for this request or response. If a response + * has already started, then this will either ship the reply directly + * to the downstream codec, or reset the stream. + * [#next-free-field: 6] + */ +export interface ImmediateResponse { + /** The response code to return. */ + status: + | HttpStatus + | undefined; + /** Apply changes to the default headers, which will include content-type. */ + headers: + | HeaderMutation + | undefined; + /** + * The message body to return with the response which is sent using the + * text/plain content type, or encoded in the grpc-message header. + */ + body: Uint8Array; + /** If set, then include a gRPC status trailer. */ + grpcStatus: + | GrpcStatus + | undefined; + /** + * A string detailing why this local reply was sent, which may be included + * in log and debug output (e.g. this populates the %RESPONSE_CODE_DETAILS% + * command operator field for use in access logging). + */ + details: string; +} + +/** This message specifies a gRPC status for an ImmediateResponse message. */ +export interface GrpcStatus { + /** The actual gRPC status. */ + status: number; +} + +/** + * Change HTTP headers or trailers by appending, replacing, or removing + * headers. + */ +export interface HeaderMutation { + /** + * Add or replace HTTP headers. Attempts to set the value of + * any ``x-envoy`` header, and attempts to set the ``:method``, + * ``:authority``, ``:scheme``, or ``host`` headers will be ignored. + * The header value is encoded in the + * :ref:`raw_value ` field. + */ + setHeaders: HeaderValueOption[]; + /** + * Remove these HTTP headers. Attempts to remove system headers -- + * any header starting with ``:``, plus ``host`` -- will be ignored. + */ + removeHeaders: string[]; +} + +/** The body response message corresponding to FULL_DUPLEX_STREAMED body mode. */ +export interface StreamedBodyResponse { + /** The body response chunk that will be passed to the upstream/downstream by the data plane. */ + body: Uint8Array; + /** + * The server sets this flag to true if it has received a body request with + * :ref:`end_of_stream ` set to true, + * and this is the last chunk of body responses. + */ + endOfStream: boolean; +} + +/** This message specifies the body mutation the server sends to the data plane. */ +export interface BodyMutation { + /** + * The entire body to replace. + * Should only be used when the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is not set to ``FULL_DUPLEX_STREAMED``. + */ + body?: + | Uint8Array + | undefined; + /** + * Clear the corresponding body chunk. + * Should only be used when the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is not set to ``FULL_DUPLEX_STREAMED``. + * Clear the corresponding body chunk. + */ + clearBody?: + | boolean + | undefined; + /** + * Must be used when the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is set to ``FULL_DUPLEX_STREAMED``. + */ + streamedResponse?: StreamedBodyResponse | undefined; +} + +function createBaseProtocolConfiguration(): ProtocolConfiguration { + return { requestBodyMode: 0, responseBodyMode: 0, sendBodyWithoutWaitingForHeaderResponse: false }; +} + +export const ProtocolConfiguration: MessageFns = { + encode(message: ProtocolConfiguration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.requestBodyMode !== 0) { + writer.uint32(8).int32(message.requestBodyMode); + } + if (message.responseBodyMode !== 0) { + writer.uint32(16).int32(message.responseBodyMode); + } + if (message.sendBodyWithoutWaitingForHeaderResponse !== false) { + writer.uint32(24).bool(message.sendBodyWithoutWaitingForHeaderResponse); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ProtocolConfiguration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProtocolConfiguration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.requestBodyMode = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.responseBodyMode = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.sendBodyWithoutWaitingForHeaderResponse = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProtocolConfiguration { + return { + requestBodyMode: isSet(object.requestBodyMode) ? processingMode_BodySendModeFromJSON(object.requestBodyMode) : 0, + responseBodyMode: isSet(object.responseBodyMode) + ? processingMode_BodySendModeFromJSON(object.responseBodyMode) + : 0, + sendBodyWithoutWaitingForHeaderResponse: isSet(object.sendBodyWithoutWaitingForHeaderResponse) + ? globalThis.Boolean(object.sendBodyWithoutWaitingForHeaderResponse) + : false, + }; + }, + + toJSON(message: ProtocolConfiguration): unknown { + const obj: any = {}; + if (message.requestBodyMode !== 0) { + obj.requestBodyMode = processingMode_BodySendModeToJSON(message.requestBodyMode); + } + if (message.responseBodyMode !== 0) { + obj.responseBodyMode = processingMode_BodySendModeToJSON(message.responseBodyMode); + } + if (message.sendBodyWithoutWaitingForHeaderResponse !== false) { + obj.sendBodyWithoutWaitingForHeaderResponse = message.sendBodyWithoutWaitingForHeaderResponse; + } + return obj; + }, + + create, I>>(base?: I): ProtocolConfiguration { + return ProtocolConfiguration.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ProtocolConfiguration { + const message = createBaseProtocolConfiguration(); + message.requestBodyMode = object.requestBodyMode ?? 0; + message.responseBodyMode = object.responseBodyMode ?? 0; + message.sendBodyWithoutWaitingForHeaderResponse = object.sendBodyWithoutWaitingForHeaderResponse ?? false; + return message; + }, +}; + +function createBaseProcessingRequest(): ProcessingRequest { + return { + requestHeaders: undefined, + responseHeaders: undefined, + requestBody: undefined, + responseBody: undefined, + requestTrailers: undefined, + responseTrailers: undefined, + metadataContext: undefined, + attributes: {}, + observabilityMode: false, + protocolConfig: undefined, + }; +} + +export const ProcessingRequest: MessageFns = { + encode(message: ProcessingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.requestHeaders !== undefined) { + HttpHeaders.encode(message.requestHeaders, writer.uint32(18).fork()).join(); + } + if (message.responseHeaders !== undefined) { + HttpHeaders.encode(message.responseHeaders, writer.uint32(26).fork()).join(); + } + if (message.requestBody !== undefined) { + HttpBody.encode(message.requestBody, writer.uint32(34).fork()).join(); + } + if (message.responseBody !== undefined) { + HttpBody.encode(message.responseBody, writer.uint32(42).fork()).join(); + } + if (message.requestTrailers !== undefined) { + HttpTrailers.encode(message.requestTrailers, writer.uint32(50).fork()).join(); + } + if (message.responseTrailers !== undefined) { + HttpTrailers.encode(message.responseTrailers, writer.uint32(58).fork()).join(); + } + if (message.metadataContext !== undefined) { + Metadata1.encode(message.metadataContext, writer.uint32(66).fork()).join(); + } + Object.entries(message.attributes).forEach(([key, value]) => { + if (value !== undefined) { + ProcessingRequest_AttributesEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join(); + } + }); + if (message.observabilityMode !== false) { + writer.uint32(80).bool(message.observabilityMode); + } + if (message.protocolConfig !== undefined) { + ProtocolConfiguration.encode(message.protocolConfig, writer.uint32(90).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ProcessingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProcessingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + message.requestHeaders = HttpHeaders.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.responseHeaders = HttpHeaders.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.requestBody = HttpBody.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.responseBody = HttpBody.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.requestTrailers = HttpTrailers.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.responseTrailers = HttpTrailers.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.metadataContext = Metadata1.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + const entry9 = ProcessingRequest_AttributesEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.attributes[entry9.key] = entry9.value; + } + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.observabilityMode = reader.bool(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.protocolConfig = ProtocolConfiguration.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProcessingRequest { + return { + requestHeaders: isSet(object.requestHeaders) ? HttpHeaders.fromJSON(object.requestHeaders) : undefined, + responseHeaders: isSet(object.responseHeaders) ? HttpHeaders.fromJSON(object.responseHeaders) : undefined, + requestBody: isSet(object.requestBody) ? HttpBody.fromJSON(object.requestBody) : undefined, + responseBody: isSet(object.responseBody) ? HttpBody.fromJSON(object.responseBody) : undefined, + requestTrailers: isSet(object.requestTrailers) ? HttpTrailers.fromJSON(object.requestTrailers) : undefined, + responseTrailers: isSet(object.responseTrailers) ? HttpTrailers.fromJSON(object.responseTrailers) : undefined, + metadataContext: isSet(object.metadataContext) ? Metadata1.fromJSON(object.metadataContext) : undefined, + attributes: isObject(object.attributes) + ? Object.entries(object.attributes).reduce<{ [key: string]: { [key: string]: any } | undefined }>( + (acc, [key, value]) => { + acc[key] = value as { [key: string]: any } | undefined; + return acc; + }, + {}, + ) + : {}, + observabilityMode: isSet(object.observabilityMode) ? globalThis.Boolean(object.observabilityMode) : false, + protocolConfig: isSet(object.protocolConfig) ? ProtocolConfiguration.fromJSON(object.protocolConfig) : undefined, + }; + }, + + toJSON(message: ProcessingRequest): unknown { + const obj: any = {}; + if (message.requestHeaders !== undefined) { + obj.requestHeaders = HttpHeaders.toJSON(message.requestHeaders); + } + if (message.responseHeaders !== undefined) { + obj.responseHeaders = HttpHeaders.toJSON(message.responseHeaders); + } + if (message.requestBody !== undefined) { + obj.requestBody = HttpBody.toJSON(message.requestBody); + } + if (message.responseBody !== undefined) { + obj.responseBody = HttpBody.toJSON(message.responseBody); + } + if (message.requestTrailers !== undefined) { + obj.requestTrailers = HttpTrailers.toJSON(message.requestTrailers); + } + if (message.responseTrailers !== undefined) { + obj.responseTrailers = HttpTrailers.toJSON(message.responseTrailers); + } + if (message.metadataContext !== undefined) { + obj.metadataContext = Metadata1.toJSON(message.metadataContext); + } + if (message.attributes) { + const entries = Object.entries(message.attributes); + if (entries.length > 0) { + obj.attributes = {}; + entries.forEach(([k, v]) => { + obj.attributes[k] = v; + }); + } + } + if (message.observabilityMode !== false) { + obj.observabilityMode = message.observabilityMode; + } + if (message.protocolConfig !== undefined) { + obj.protocolConfig = ProtocolConfiguration.toJSON(message.protocolConfig); + } + return obj; + }, + + create, I>>(base?: I): ProcessingRequest { + return ProcessingRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ProcessingRequest { + const message = createBaseProcessingRequest(); + message.requestHeaders = (object.requestHeaders !== undefined && object.requestHeaders !== null) + ? HttpHeaders.fromPartial(object.requestHeaders) + : undefined; + message.responseHeaders = (object.responseHeaders !== undefined && object.responseHeaders !== null) + ? HttpHeaders.fromPartial(object.responseHeaders) + : undefined; + message.requestBody = (object.requestBody !== undefined && object.requestBody !== null) + ? HttpBody.fromPartial(object.requestBody) + : undefined; + message.responseBody = (object.responseBody !== undefined && object.responseBody !== null) + ? HttpBody.fromPartial(object.responseBody) + : undefined; + message.requestTrailers = (object.requestTrailers !== undefined && object.requestTrailers !== null) + ? HttpTrailers.fromPartial(object.requestTrailers) + : undefined; + message.responseTrailers = (object.responseTrailers !== undefined && object.responseTrailers !== null) + ? HttpTrailers.fromPartial(object.responseTrailers) + : undefined; + message.metadataContext = (object.metadataContext !== undefined && object.metadataContext !== null) + ? Metadata1.fromPartial(object.metadataContext) + : undefined; + message.attributes = Object.entries(object.attributes ?? {}).reduce< + { [key: string]: { [key: string]: any } | undefined } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, {}); + message.observabilityMode = object.observabilityMode ?? false; + message.protocolConfig = (object.protocolConfig !== undefined && object.protocolConfig !== null) + ? ProtocolConfiguration.fromPartial(object.protocolConfig) + : undefined; + return message; + }, +}; + +function createBaseProcessingRequest_AttributesEntry(): ProcessingRequest_AttributesEntry { + return { key: "", value: undefined }; +} + +export const ProcessingRequest_AttributesEntry: MessageFns = { + encode(message: ProcessingRequest_AttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ProcessingRequest_AttributesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProcessingRequest_AttributesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProcessingRequest_AttributesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isObject(object.value) ? object.value : undefined, + }; + }, + + toJSON(message: ProcessingRequest_AttributesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create, I>>( + base?: I, + ): ProcessingRequest_AttributesEntry { + return ProcessingRequest_AttributesEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ProcessingRequest_AttributesEntry { + const message = createBaseProcessingRequest_AttributesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseProcessingResponse(): ProcessingResponse { + return { + requestHeaders: undefined, + responseHeaders: undefined, + requestBody: undefined, + responseBody: undefined, + requestTrailers: undefined, + responseTrailers: undefined, + immediateResponse: undefined, + dynamicMetadata: undefined, + modeOverride: undefined, + overrideMessageTimeout: undefined, + }; +} + +export const ProcessingResponse: MessageFns = { + encode(message: ProcessingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.requestHeaders !== undefined) { + HeadersResponse.encode(message.requestHeaders, writer.uint32(10).fork()).join(); + } + if (message.responseHeaders !== undefined) { + HeadersResponse.encode(message.responseHeaders, writer.uint32(18).fork()).join(); + } + if (message.requestBody !== undefined) { + BodyResponse.encode(message.requestBody, writer.uint32(26).fork()).join(); + } + if (message.responseBody !== undefined) { + BodyResponse.encode(message.responseBody, writer.uint32(34).fork()).join(); + } + if (message.requestTrailers !== undefined) { + TrailersResponse.encode(message.requestTrailers, writer.uint32(42).fork()).join(); + } + if (message.responseTrailers !== undefined) { + TrailersResponse.encode(message.responseTrailers, writer.uint32(50).fork()).join(); + } + if (message.immediateResponse !== undefined) { + ImmediateResponse.encode(message.immediateResponse, writer.uint32(58).fork()).join(); + } + if (message.dynamicMetadata !== undefined) { + Struct.encode(Struct.wrap(message.dynamicMetadata), writer.uint32(66).fork()).join(); + } + if (message.modeOverride !== undefined) { + ProcessingMode.encode(message.modeOverride, writer.uint32(74).fork()).join(); + } + if (message.overrideMessageTimeout !== undefined) { + Duration.encode(message.overrideMessageTimeout, writer.uint32(82).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ProcessingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProcessingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.requestHeaders = HeadersResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.responseHeaders = HeadersResponse.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.requestBody = BodyResponse.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.responseBody = BodyResponse.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.requestTrailers = TrailersResponse.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.responseTrailers = TrailersResponse.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.immediateResponse = ImmediateResponse.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.dynamicMetadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.modeOverride = ProcessingMode.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.overrideMessageTimeout = Duration.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProcessingResponse { + return { + requestHeaders: isSet(object.requestHeaders) ? HeadersResponse.fromJSON(object.requestHeaders) : undefined, + responseHeaders: isSet(object.responseHeaders) ? HeadersResponse.fromJSON(object.responseHeaders) : undefined, + requestBody: isSet(object.requestBody) ? BodyResponse.fromJSON(object.requestBody) : undefined, + responseBody: isSet(object.responseBody) ? BodyResponse.fromJSON(object.responseBody) : undefined, + requestTrailers: isSet(object.requestTrailers) ? TrailersResponse.fromJSON(object.requestTrailers) : undefined, + responseTrailers: isSet(object.responseTrailers) ? TrailersResponse.fromJSON(object.responseTrailers) : undefined, + immediateResponse: isSet(object.immediateResponse) + ? ImmediateResponse.fromJSON(object.immediateResponse) + : undefined, + dynamicMetadata: isObject(object.dynamicMetadata) ? object.dynamicMetadata : undefined, + modeOverride: isSet(object.modeOverride) ? ProcessingMode.fromJSON(object.modeOverride) : undefined, + overrideMessageTimeout: isSet(object.overrideMessageTimeout) + ? Duration.fromJSON(object.overrideMessageTimeout) + : undefined, + }; + }, + + toJSON(message: ProcessingResponse): unknown { + const obj: any = {}; + if (message.requestHeaders !== undefined) { + obj.requestHeaders = HeadersResponse.toJSON(message.requestHeaders); + } + if (message.responseHeaders !== undefined) { + obj.responseHeaders = HeadersResponse.toJSON(message.responseHeaders); + } + if (message.requestBody !== undefined) { + obj.requestBody = BodyResponse.toJSON(message.requestBody); + } + if (message.responseBody !== undefined) { + obj.responseBody = BodyResponse.toJSON(message.responseBody); + } + if (message.requestTrailers !== undefined) { + obj.requestTrailers = TrailersResponse.toJSON(message.requestTrailers); + } + if (message.responseTrailers !== undefined) { + obj.responseTrailers = TrailersResponse.toJSON(message.responseTrailers); + } + if (message.immediateResponse !== undefined) { + obj.immediateResponse = ImmediateResponse.toJSON(message.immediateResponse); + } + if (message.dynamicMetadata !== undefined) { + obj.dynamicMetadata = message.dynamicMetadata; + } + if (message.modeOverride !== undefined) { + obj.modeOverride = ProcessingMode.toJSON(message.modeOverride); + } + if (message.overrideMessageTimeout !== undefined) { + obj.overrideMessageTimeout = Duration.toJSON(message.overrideMessageTimeout); + } + return obj; + }, + + create, I>>(base?: I): ProcessingResponse { + return ProcessingResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ProcessingResponse { + const message = createBaseProcessingResponse(); + message.requestHeaders = (object.requestHeaders !== undefined && object.requestHeaders !== null) + ? HeadersResponse.fromPartial(object.requestHeaders) + : undefined; + message.responseHeaders = (object.responseHeaders !== undefined && object.responseHeaders !== null) + ? HeadersResponse.fromPartial(object.responseHeaders) + : undefined; + message.requestBody = (object.requestBody !== undefined && object.requestBody !== null) + ? BodyResponse.fromPartial(object.requestBody) + : undefined; + message.responseBody = (object.responseBody !== undefined && object.responseBody !== null) + ? BodyResponse.fromPartial(object.responseBody) + : undefined; + message.requestTrailers = (object.requestTrailers !== undefined && object.requestTrailers !== null) + ? TrailersResponse.fromPartial(object.requestTrailers) + : undefined; + message.responseTrailers = (object.responseTrailers !== undefined && object.responseTrailers !== null) + ? TrailersResponse.fromPartial(object.responseTrailers) + : undefined; + message.immediateResponse = (object.immediateResponse !== undefined && object.immediateResponse !== null) + ? ImmediateResponse.fromPartial(object.immediateResponse) + : undefined; + message.dynamicMetadata = object.dynamicMetadata ?? undefined; + message.modeOverride = (object.modeOverride !== undefined && object.modeOverride !== null) + ? ProcessingMode.fromPartial(object.modeOverride) + : undefined; + message.overrideMessageTimeout = + (object.overrideMessageTimeout !== undefined && object.overrideMessageTimeout !== null) + ? Duration.fromPartial(object.overrideMessageTimeout) + : undefined; + return message; + }, +}; + +function createBaseHttpHeaders(): HttpHeaders { + return { headers: undefined, attributes: {}, endOfStream: false }; +} + +export const HttpHeaders: MessageFns = { + encode(message: HttpHeaders, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.headers !== undefined) { + HeaderMap.encode(message.headers, writer.uint32(10).fork()).join(); + } + Object.entries(message.attributes).forEach(([key, value]) => { + if (value !== undefined) { + HttpHeaders_AttributesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + } + }); + if (message.endOfStream !== false) { + writer.uint32(24).bool(message.endOfStream); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpHeaders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpHeaders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.headers = HeaderMap.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = HttpHeaders_AttributesEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.attributes[entry2.key] = entry2.value; + } + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.endOfStream = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpHeaders { + return { + headers: isSet(object.headers) ? HeaderMap.fromJSON(object.headers) : undefined, + attributes: isObject(object.attributes) + ? Object.entries(object.attributes).reduce<{ [key: string]: { [key: string]: any } | undefined }>( + (acc, [key, value]) => { + acc[key] = value as { [key: string]: any } | undefined; + return acc; + }, + {}, + ) + : {}, + endOfStream: isSet(object.endOfStream) ? globalThis.Boolean(object.endOfStream) : false, + }; + }, + + toJSON(message: HttpHeaders): unknown { + const obj: any = {}; + if (message.headers !== undefined) { + obj.headers = HeaderMap.toJSON(message.headers); + } + if (message.attributes) { + const entries = Object.entries(message.attributes); + if (entries.length > 0) { + obj.attributes = {}; + entries.forEach(([k, v]) => { + obj.attributes[k] = v; + }); + } + } + if (message.endOfStream !== false) { + obj.endOfStream = message.endOfStream; + } + return obj; + }, + + create, I>>(base?: I): HttpHeaders { + return HttpHeaders.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpHeaders { + const message = createBaseHttpHeaders(); + message.headers = (object.headers !== undefined && object.headers !== null) + ? HeaderMap.fromPartial(object.headers) + : undefined; + message.attributes = Object.entries(object.attributes ?? {}).reduce< + { [key: string]: { [key: string]: any } | undefined } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, {}); + message.endOfStream = object.endOfStream ?? false; + return message; + }, +}; + +function createBaseHttpHeaders_AttributesEntry(): HttpHeaders_AttributesEntry { + return { key: "", value: undefined }; +} + +export const HttpHeaders_AttributesEntry: MessageFns = { + encode(message: HttpHeaders_AttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpHeaders_AttributesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpHeaders_AttributesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpHeaders_AttributesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isObject(object.value) ? object.value : undefined, + }; + }, + + toJSON(message: HttpHeaders_AttributesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): HttpHeaders_AttributesEntry { + return HttpHeaders_AttributesEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpHeaders_AttributesEntry { + const message = createBaseHttpHeaders_AttributesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseHttpBody(): HttpBody { + return { body: new Uint8Array(0), endOfStream: false }; +} + +export const HttpBody: MessageFns = { + encode(message: HttpBody, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.body.length !== 0) { + writer.uint32(10).bytes(message.body); + } + if (message.endOfStream !== false) { + writer.uint32(16).bool(message.endOfStream); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpBody { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpBody(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.body = reader.bytes(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.endOfStream = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpBody { + return { + body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), + endOfStream: isSet(object.endOfStream) ? globalThis.Boolean(object.endOfStream) : false, + }; + }, + + toJSON(message: HttpBody): unknown { + const obj: any = {}; + if (message.body.length !== 0) { + obj.body = base64FromBytes(message.body); + } + if (message.endOfStream !== false) { + obj.endOfStream = message.endOfStream; + } + return obj; + }, + + create, I>>(base?: I): HttpBody { + return HttpBody.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpBody { + const message = createBaseHttpBody(); + message.body = object.body ?? new Uint8Array(0); + message.endOfStream = object.endOfStream ?? false; + return message; + }, +}; + +function createBaseHttpTrailers(): HttpTrailers { + return { trailers: undefined }; +} + +export const HttpTrailers: MessageFns = { + encode(message: HttpTrailers, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.trailers !== undefined) { + HeaderMap.encode(message.trailers, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpTrailers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpTrailers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.trailers = HeaderMap.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpTrailers { + return { trailers: isSet(object.trailers) ? HeaderMap.fromJSON(object.trailers) : undefined }; + }, + + toJSON(message: HttpTrailers): unknown { + const obj: any = {}; + if (message.trailers !== undefined) { + obj.trailers = HeaderMap.toJSON(message.trailers); + } + return obj; + }, + + create, I>>(base?: I): HttpTrailers { + return HttpTrailers.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpTrailers { + const message = createBaseHttpTrailers(); + message.trailers = (object.trailers !== undefined && object.trailers !== null) + ? HeaderMap.fromPartial(object.trailers) + : undefined; + return message; + }, +}; + +function createBaseHeadersResponse(): HeadersResponse { + return { response: undefined }; +} + +export const HeadersResponse: MessageFns = { + encode(message: HeadersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.response !== undefined) { + CommonResponse.encode(message.response, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeadersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeadersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.response = CommonResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeadersResponse { + return { response: isSet(object.response) ? CommonResponse.fromJSON(object.response) : undefined }; + }, + + toJSON(message: HeadersResponse): unknown { + const obj: any = {}; + if (message.response !== undefined) { + obj.response = CommonResponse.toJSON(message.response); + } + return obj; + }, + + create, I>>(base?: I): HeadersResponse { + return HeadersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HeadersResponse { + const message = createBaseHeadersResponse(); + message.response = (object.response !== undefined && object.response !== null) + ? CommonResponse.fromPartial(object.response) + : undefined; + return message; + }, +}; + +function createBaseBodyResponse(): BodyResponse { + return { response: undefined }; +} + +export const BodyResponse: MessageFns = { + encode(message: BodyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.response !== undefined) { + CommonResponse.encode(message.response, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BodyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBodyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.response = CommonResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BodyResponse { + return { response: isSet(object.response) ? CommonResponse.fromJSON(object.response) : undefined }; + }, + + toJSON(message: BodyResponse): unknown { + const obj: any = {}; + if (message.response !== undefined) { + obj.response = CommonResponse.toJSON(message.response); + } + return obj; + }, + + create, I>>(base?: I): BodyResponse { + return BodyResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BodyResponse { + const message = createBaseBodyResponse(); + message.response = (object.response !== undefined && object.response !== null) + ? CommonResponse.fromPartial(object.response) + : undefined; + return message; + }, +}; + +function createBaseTrailersResponse(): TrailersResponse { + return { headerMutation: undefined }; +} + +export const TrailersResponse: MessageFns = { + encode(message: TrailersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.headerMutation !== undefined) { + HeaderMutation.encode(message.headerMutation, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TrailersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrailersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.headerMutation = HeaderMutation.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TrailersResponse { + return { + headerMutation: isSet(object.headerMutation) ? HeaderMutation.fromJSON(object.headerMutation) : undefined, + }; + }, + + toJSON(message: TrailersResponse): unknown { + const obj: any = {}; + if (message.headerMutation !== undefined) { + obj.headerMutation = HeaderMutation.toJSON(message.headerMutation); + } + return obj; + }, + + create, I>>(base?: I): TrailersResponse { + return TrailersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TrailersResponse { + const message = createBaseTrailersResponse(); + message.headerMutation = (object.headerMutation !== undefined && object.headerMutation !== null) + ? HeaderMutation.fromPartial(object.headerMutation) + : undefined; + return message; + }, +}; + +function createBaseCommonResponse(): CommonResponse { + return { status: 0, headerMutation: undefined, bodyMutation: undefined, trailers: undefined, clearRouteCache: false }; +} + +export const CommonResponse: MessageFns = { + encode(message: CommonResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.headerMutation !== undefined) { + HeaderMutation.encode(message.headerMutation, writer.uint32(18).fork()).join(); + } + if (message.bodyMutation !== undefined) { + BodyMutation.encode(message.bodyMutation, writer.uint32(26).fork()).join(); + } + if (message.trailers !== undefined) { + HeaderMap.encode(message.trailers, writer.uint32(34).fork()).join(); + } + if (message.clearRouteCache !== false) { + writer.uint32(40).bool(message.clearRouteCache); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CommonResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommonResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.status = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.headerMutation = HeaderMutation.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.bodyMutation = BodyMutation.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.trailers = HeaderMap.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.clearRouteCache = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CommonResponse { + return { + status: isSet(object.status) ? commonResponse_ResponseStatusFromJSON(object.status) : 0, + headerMutation: isSet(object.headerMutation) ? HeaderMutation.fromJSON(object.headerMutation) : undefined, + bodyMutation: isSet(object.bodyMutation) ? BodyMutation.fromJSON(object.bodyMutation) : undefined, + trailers: isSet(object.trailers) ? HeaderMap.fromJSON(object.trailers) : undefined, + clearRouteCache: isSet(object.clearRouteCache) ? globalThis.Boolean(object.clearRouteCache) : false, + }; + }, + + toJSON(message: CommonResponse): unknown { + const obj: any = {}; + if (message.status !== 0) { + obj.status = commonResponse_ResponseStatusToJSON(message.status); + } + if (message.headerMutation !== undefined) { + obj.headerMutation = HeaderMutation.toJSON(message.headerMutation); + } + if (message.bodyMutation !== undefined) { + obj.bodyMutation = BodyMutation.toJSON(message.bodyMutation); + } + if (message.trailers !== undefined) { + obj.trailers = HeaderMap.toJSON(message.trailers); + } + if (message.clearRouteCache !== false) { + obj.clearRouteCache = message.clearRouteCache; + } + return obj; + }, + + create, I>>(base?: I): CommonResponse { + return CommonResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CommonResponse { + const message = createBaseCommonResponse(); + message.status = object.status ?? 0; + message.headerMutation = (object.headerMutation !== undefined && object.headerMutation !== null) + ? HeaderMutation.fromPartial(object.headerMutation) + : undefined; + message.bodyMutation = (object.bodyMutation !== undefined && object.bodyMutation !== null) + ? BodyMutation.fromPartial(object.bodyMutation) + : undefined; + message.trailers = (object.trailers !== undefined && object.trailers !== null) + ? HeaderMap.fromPartial(object.trailers) + : undefined; + message.clearRouteCache = object.clearRouteCache ?? false; + return message; + }, +}; + +function createBaseImmediateResponse(): ImmediateResponse { + return { status: undefined, headers: undefined, body: new Uint8Array(0), grpcStatus: undefined, details: "" }; +} + +export const ImmediateResponse: MessageFns = { + encode(message: ImmediateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.status !== undefined) { + HttpStatus.encode(message.status, writer.uint32(10).fork()).join(); + } + if (message.headers !== undefined) { + HeaderMutation.encode(message.headers, writer.uint32(18).fork()).join(); + } + if (message.body.length !== 0) { + writer.uint32(26).bytes(message.body); + } + if (message.grpcStatus !== undefined) { + GrpcStatus.encode(message.grpcStatus, writer.uint32(34).fork()).join(); + } + if (message.details !== "") { + writer.uint32(42).string(message.details); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImmediateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImmediateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.status = HttpStatus.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.headers = HeaderMutation.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.body = reader.bytes(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.grpcStatus = GrpcStatus.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.details = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImmediateResponse { + return { + status: isSet(object.status) ? HttpStatus.fromJSON(object.status) : undefined, + headers: isSet(object.headers) ? HeaderMutation.fromJSON(object.headers) : undefined, + body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), + grpcStatus: isSet(object.grpcStatus) ? GrpcStatus.fromJSON(object.grpcStatus) : undefined, + details: isSet(object.details) ? globalThis.String(object.details) : "", + }; + }, + + toJSON(message: ImmediateResponse): unknown { + const obj: any = {}; + if (message.status !== undefined) { + obj.status = HttpStatus.toJSON(message.status); + } + if (message.headers !== undefined) { + obj.headers = HeaderMutation.toJSON(message.headers); + } + if (message.body.length !== 0) { + obj.body = base64FromBytes(message.body); + } + if (message.grpcStatus !== undefined) { + obj.grpcStatus = GrpcStatus.toJSON(message.grpcStatus); + } + if (message.details !== "") { + obj.details = message.details; + } + return obj; + }, + + create, I>>(base?: I): ImmediateResponse { + return ImmediateResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ImmediateResponse { + const message = createBaseImmediateResponse(); + message.status = (object.status !== undefined && object.status !== null) + ? HttpStatus.fromPartial(object.status) + : undefined; + message.headers = (object.headers !== undefined && object.headers !== null) + ? HeaderMutation.fromPartial(object.headers) + : undefined; + message.body = object.body ?? new Uint8Array(0); + message.grpcStatus = (object.grpcStatus !== undefined && object.grpcStatus !== null) + ? GrpcStatus.fromPartial(object.grpcStatus) + : undefined; + message.details = object.details ?? ""; + return message; + }, +}; + +function createBaseGrpcStatus(): GrpcStatus { + return { status: 0 }; +} + +export const GrpcStatus: MessageFns = { + encode(message: GrpcStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).uint32(message.status); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GrpcStatus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrpcStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.status = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GrpcStatus { + return { status: isSet(object.status) ? globalThis.Number(object.status) : 0 }; + }, + + toJSON(message: GrpcStatus): unknown { + const obj: any = {}; + if (message.status !== 0) { + obj.status = Math.round(message.status); + } + return obj; + }, + + create, I>>(base?: I): GrpcStatus { + return GrpcStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GrpcStatus { + const message = createBaseGrpcStatus(); + message.status = object.status ?? 0; + return message; + }, +}; + +function createBaseHeaderMutation(): HeaderMutation { + return { setHeaders: [], removeHeaders: [] }; +} + +export const HeaderMutation: MessageFns = { + encode(message: HeaderMutation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.setHeaders) { + HeaderValueOption.encode(v!, writer.uint32(10).fork()).join(); + } + for (const v of message.removeHeaders) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeaderMutation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderMutation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.setHeaders.push(HeaderValueOption.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.removeHeaders.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeaderMutation { + return { + setHeaders: globalThis.Array.isArray(object?.setHeaders) + ? object.setHeaders.map((e: any) => HeaderValueOption.fromJSON(e)) + : [], + removeHeaders: globalThis.Array.isArray(object?.removeHeaders) + ? object.removeHeaders.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: HeaderMutation): unknown { + const obj: any = {}; + if (message.setHeaders?.length) { + obj.setHeaders = message.setHeaders.map((e) => HeaderValueOption.toJSON(e)); + } + if (message.removeHeaders?.length) { + obj.removeHeaders = message.removeHeaders; + } + return obj; + }, + + create, I>>(base?: I): HeaderMutation { + return HeaderMutation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HeaderMutation { + const message = createBaseHeaderMutation(); + message.setHeaders = object.setHeaders?.map((e) => HeaderValueOption.fromPartial(e)) || []; + message.removeHeaders = object.removeHeaders?.map((e) => e) || []; + return message; + }, +}; + +function createBaseStreamedBodyResponse(): StreamedBodyResponse { + return { body: new Uint8Array(0), endOfStream: false }; +} + +export const StreamedBodyResponse: MessageFns = { + encode(message: StreamedBodyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.body.length !== 0) { + writer.uint32(10).bytes(message.body); + } + if (message.endOfStream !== false) { + writer.uint32(16).bool(message.endOfStream); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StreamedBodyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamedBodyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.body = reader.bytes(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.endOfStream = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StreamedBodyResponse { + return { + body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), + endOfStream: isSet(object.endOfStream) ? globalThis.Boolean(object.endOfStream) : false, + }; + }, + + toJSON(message: StreamedBodyResponse): unknown { + const obj: any = {}; + if (message.body.length !== 0) { + obj.body = base64FromBytes(message.body); + } + if (message.endOfStream !== false) { + obj.endOfStream = message.endOfStream; + } + return obj; + }, + + create, I>>(base?: I): StreamedBodyResponse { + return StreamedBodyResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): StreamedBodyResponse { + const message = createBaseStreamedBodyResponse(); + message.body = object.body ?? new Uint8Array(0); + message.endOfStream = object.endOfStream ?? false; + return message; + }, +}; + +function createBaseBodyMutation(): BodyMutation { + return { body: undefined, clearBody: undefined, streamedResponse: undefined }; +} + +export const BodyMutation: MessageFns = { + encode(message: BodyMutation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.body !== undefined) { + writer.uint32(10).bytes(message.body); + } + if (message.clearBody !== undefined) { + writer.uint32(16).bool(message.clearBody); + } + if (message.streamedResponse !== undefined) { + StreamedBodyResponse.encode(message.streamedResponse, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BodyMutation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBodyMutation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.body = reader.bytes(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.clearBody = reader.bool(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.streamedResponse = StreamedBodyResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BodyMutation { + return { + body: isSet(object.body) ? bytesFromBase64(object.body) : undefined, + clearBody: isSet(object.clearBody) ? globalThis.Boolean(object.clearBody) : undefined, + streamedResponse: isSet(object.streamedResponse) + ? StreamedBodyResponse.fromJSON(object.streamedResponse) + : undefined, + }; + }, + + toJSON(message: BodyMutation): unknown { + const obj: any = {}; + if (message.body !== undefined) { + obj.body = base64FromBytes(message.body); + } + if (message.clearBody !== undefined) { + obj.clearBody = message.clearBody; + } + if (message.streamedResponse !== undefined) { + obj.streamedResponse = StreamedBodyResponse.toJSON(message.streamedResponse); + } + return obj; + }, + + create, I>>(base?: I): BodyMutation { + return BodyMutation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BodyMutation { + const message = createBaseBodyMutation(); + message.body = object.body ?? undefined; + message.clearBody = object.clearBody ?? undefined; + message.streamedResponse = (object.streamedResponse !== undefined && object.streamedResponse !== null) + ? StreamedBodyResponse.fromPartial(object.streamedResponse) + : undefined; + return message; + }, +}; + +/** + * A service that can access and modify HTTP requests and responses + * as part of a filter chain. + * The overall external processing protocol works like this: + * + * 1. The data plane sends to the service information about the HTTP request. + * 2. The service sends back a ProcessingResponse message that directs + * the data plane to either stop processing, continue without it, or send + * it the next chunk of the message body. + * 3. If so requested, the data plane sends the server the message body in + * chunks, or the entire body at once. In either case, the server may send + * back a ProcessingResponse for each message it receives, or wait for + * a certain amount of body chunks received before streaming back the + * ProcessingResponse messages. + * 4. If so requested, the data plane sends the server the HTTP trailers, + * and the server sends back a ProcessingResponse. + * 5. At this point, request processing is done, and we pick up again + * at step 1 when the data plane receives a response from the upstream + * server. + * 6. At any point above, if the server closes the gRPC stream cleanly, + * then the data plane proceeds without consulting the server. + * 7. At any point above, if the server closes the gRPC stream with an error, + * then the data plane returns a 500 error to the client, unless the filter + * was configured to ignore errors. + * + * In other words, the process is a request/response conversation, but + * using a gRPC stream to make it easier for the server to + * maintain state. + */ +export type ExternalProcessorService = typeof ExternalProcessorService; +export const ExternalProcessorService = { + /** + * This begins the bidirectional stream that the data plane will use to + * give the server control over what the filter does. The actual + * protocol is described by the ProcessingRequest and ProcessingResponse + * messages below. + */ + process: { + path: "/envoy.service.ext_proc.v3.ExternalProcessor/Process", + requestStream: true, + responseStream: true, + requestSerialize: (value: ProcessingRequest): Buffer => Buffer.from(ProcessingRequest.encode(value).finish()), + requestDeserialize: (value: Buffer): ProcessingRequest => ProcessingRequest.decode(value), + responseSerialize: (value: ProcessingResponse): Buffer => Buffer.from(ProcessingResponse.encode(value).finish()), + responseDeserialize: (value: Buffer): ProcessingResponse => ProcessingResponse.decode(value), + }, +} as const; + +export interface ExternalProcessorServer extends UntypedServiceImplementation { + /** + * This begins the bidirectional stream that the data plane will use to + * give the server control over what the filter does. The actual + * protocol is described by the ProcessingRequest and ProcessingResponse + * messages below. + */ + process: handleBidiStreamingCall; +} + +export interface ExternalProcessorClient extends Client { + /** + * This begins the bidirectional stream that the data plane will use to + * give the server control over what the filter does. The actual + * protocol is described by the ProcessingRequest and ProcessingResponse + * messages below. + */ + process(): ClientDuplexStream; + process(options: Partial): ClientDuplexStream; + process( + metadata: Metadata, + options?: Partial, + ): ClientDuplexStream; +} + +export const ExternalProcessorClient = makeGenericClientConstructor( + ExternalProcessorService, + "envoy.service.ext_proc.v3.ExternalProcessor", +) as unknown as { + new (address: string, credentials: ChannelCredentials, options?: Partial): ExternalProcessorClient; + service: typeof ExternalProcessorService; + serviceName: string; +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts new file mode 100644 index 00000000..5f431353 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts @@ -0,0 +1,526 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/type/v3/http_status.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "envoy.type.v3"; + +/** + * HTTP response codes supported in Envoy. + * For more details: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + */ +export enum StatusCode { + /** + * Empty - Empty - This code not part of the HTTP status code specification, but it is needed for proto + * `enum` type. + */ + Empty = 0, + /** Continue - Continue - ``100`` status code. */ + Continue = 100, + /** OK - OK - ``200`` status code. */ + OK = 200, + /** Created - Created - ``201`` status code. */ + Created = 201, + /** Accepted - Accepted - ``202`` status code. */ + Accepted = 202, + /** NonAuthoritativeInformation - NonAuthoritativeInformation - ``203`` status code. */ + NonAuthoritativeInformation = 203, + /** NoContent - NoContent - ``204`` status code. */ + NoContent = 204, + /** ResetContent - ResetContent - ``205`` status code. */ + ResetContent = 205, + /** PartialContent - PartialContent - ``206`` status code. */ + PartialContent = 206, + /** MultiStatus - MultiStatus - ``207`` status code. */ + MultiStatus = 207, + /** AlreadyReported - AlreadyReported - ``208`` status code. */ + AlreadyReported = 208, + /** IMUsed - IMUsed - ``226`` status code. */ + IMUsed = 226, + /** MultipleChoices - MultipleChoices - ``300`` status code. */ + MultipleChoices = 300, + /** MovedPermanently - MovedPermanently - ``301`` status code. */ + MovedPermanently = 301, + /** Found - Found - ``302`` status code. */ + Found = 302, + /** SeeOther - SeeOther - ``303`` status code. */ + SeeOther = 303, + /** NotModified - NotModified - ``304`` status code. */ + NotModified = 304, + /** UseProxy - UseProxy - ``305`` status code. */ + UseProxy = 305, + /** TemporaryRedirect - TemporaryRedirect - ``307`` status code. */ + TemporaryRedirect = 307, + /** PermanentRedirect - PermanentRedirect - ``308`` status code. */ + PermanentRedirect = 308, + /** BadRequest - BadRequest - ``400`` status code. */ + BadRequest = 400, + /** Unauthorized - Unauthorized - ``401`` status code. */ + Unauthorized = 401, + /** PaymentRequired - PaymentRequired - ``402`` status code. */ + PaymentRequired = 402, + /** Forbidden - Forbidden - ``403`` status code. */ + Forbidden = 403, + /** NotFound - NotFound - ``404`` status code. */ + NotFound = 404, + /** MethodNotAllowed - MethodNotAllowed - ``405`` status code. */ + MethodNotAllowed = 405, + /** NotAcceptable - NotAcceptable - ``406`` status code. */ + NotAcceptable = 406, + /** ProxyAuthenticationRequired - ProxyAuthenticationRequired - ``407`` status code. */ + ProxyAuthenticationRequired = 407, + /** RequestTimeout - RequestTimeout - ``408`` status code. */ + RequestTimeout = 408, + /** Conflict - Conflict - ``409`` status code. */ + Conflict = 409, + /** Gone - Gone - ``410`` status code. */ + Gone = 410, + /** LengthRequired - LengthRequired - ``411`` status code. */ + LengthRequired = 411, + /** PreconditionFailed - PreconditionFailed - ``412`` status code. */ + PreconditionFailed = 412, + /** PayloadTooLarge - PayloadTooLarge - ``413`` status code. */ + PayloadTooLarge = 413, + /** URITooLong - URITooLong - ``414`` status code. */ + URITooLong = 414, + /** UnsupportedMediaType - UnsupportedMediaType - ``415`` status code. */ + UnsupportedMediaType = 415, + /** RangeNotSatisfiable - RangeNotSatisfiable - ``416`` status code. */ + RangeNotSatisfiable = 416, + /** ExpectationFailed - ExpectationFailed - ``417`` status code. */ + ExpectationFailed = 417, + /** MisdirectedRequest - MisdirectedRequest - ``421`` status code. */ + MisdirectedRequest = 421, + /** UnprocessableEntity - UnprocessableEntity - ``422`` status code. */ + UnprocessableEntity = 422, + /** Locked - Locked - ``423`` status code. */ + Locked = 423, + /** FailedDependency - FailedDependency - ``424`` status code. */ + FailedDependency = 424, + /** UpgradeRequired - UpgradeRequired - ``426`` status code. */ + UpgradeRequired = 426, + /** PreconditionRequired - PreconditionRequired - ``428`` status code. */ + PreconditionRequired = 428, + /** TooManyRequests - TooManyRequests - ``429`` status code. */ + TooManyRequests = 429, + /** RequestHeaderFieldsTooLarge - RequestHeaderFieldsTooLarge - ``431`` status code. */ + RequestHeaderFieldsTooLarge = 431, + /** InternalServerError - InternalServerError - ``500`` status code. */ + InternalServerError = 500, + /** NotImplemented - NotImplemented - ``501`` status code. */ + NotImplemented = 501, + /** BadGateway - BadGateway - ``502`` status code. */ + BadGateway = 502, + /** ServiceUnavailable - ServiceUnavailable - ``503`` status code. */ + ServiceUnavailable = 503, + /** GatewayTimeout - GatewayTimeout - ``504`` status code. */ + GatewayTimeout = 504, + /** HTTPVersionNotSupported - HTTPVersionNotSupported - ``505`` status code. */ + HTTPVersionNotSupported = 505, + /** VariantAlsoNegotiates - VariantAlsoNegotiates - ``506`` status code. */ + VariantAlsoNegotiates = 506, + /** InsufficientStorage - InsufficientStorage - ``507`` status code. */ + InsufficientStorage = 507, + /** LoopDetected - LoopDetected - ``508`` status code. */ + LoopDetected = 508, + /** NotExtended - NotExtended - ``510`` status code. */ + NotExtended = 510, + /** NetworkAuthenticationRequired - NetworkAuthenticationRequired - ``511`` status code. */ + NetworkAuthenticationRequired = 511, + UNRECOGNIZED = -1, +} + +export function statusCodeFromJSON(object: any): StatusCode { + switch (object) { + case 0: + case "Empty": + return StatusCode.Empty; + case 100: + case "Continue": + return StatusCode.Continue; + case 200: + case "OK": + return StatusCode.OK; + case 201: + case "Created": + return StatusCode.Created; + case 202: + case "Accepted": + return StatusCode.Accepted; + case 203: + case "NonAuthoritativeInformation": + return StatusCode.NonAuthoritativeInformation; + case 204: + case "NoContent": + return StatusCode.NoContent; + case 205: + case "ResetContent": + return StatusCode.ResetContent; + case 206: + case "PartialContent": + return StatusCode.PartialContent; + case 207: + case "MultiStatus": + return StatusCode.MultiStatus; + case 208: + case "AlreadyReported": + return StatusCode.AlreadyReported; + case 226: + case "IMUsed": + return StatusCode.IMUsed; + case 300: + case "MultipleChoices": + return StatusCode.MultipleChoices; + case 301: + case "MovedPermanently": + return StatusCode.MovedPermanently; + case 302: + case "Found": + return StatusCode.Found; + case 303: + case "SeeOther": + return StatusCode.SeeOther; + case 304: + case "NotModified": + return StatusCode.NotModified; + case 305: + case "UseProxy": + return StatusCode.UseProxy; + case 307: + case "TemporaryRedirect": + return StatusCode.TemporaryRedirect; + case 308: + case "PermanentRedirect": + return StatusCode.PermanentRedirect; + case 400: + case "BadRequest": + return StatusCode.BadRequest; + case 401: + case "Unauthorized": + return StatusCode.Unauthorized; + case 402: + case "PaymentRequired": + return StatusCode.PaymentRequired; + case 403: + case "Forbidden": + return StatusCode.Forbidden; + case 404: + case "NotFound": + return StatusCode.NotFound; + case 405: + case "MethodNotAllowed": + return StatusCode.MethodNotAllowed; + case 406: + case "NotAcceptable": + return StatusCode.NotAcceptable; + case 407: + case "ProxyAuthenticationRequired": + return StatusCode.ProxyAuthenticationRequired; + case 408: + case "RequestTimeout": + return StatusCode.RequestTimeout; + case 409: + case "Conflict": + return StatusCode.Conflict; + case 410: + case "Gone": + return StatusCode.Gone; + case 411: + case "LengthRequired": + return StatusCode.LengthRequired; + case 412: + case "PreconditionFailed": + return StatusCode.PreconditionFailed; + case 413: + case "PayloadTooLarge": + return StatusCode.PayloadTooLarge; + case 414: + case "URITooLong": + return StatusCode.URITooLong; + case 415: + case "UnsupportedMediaType": + return StatusCode.UnsupportedMediaType; + case 416: + case "RangeNotSatisfiable": + return StatusCode.RangeNotSatisfiable; + case 417: + case "ExpectationFailed": + return StatusCode.ExpectationFailed; + case 421: + case "MisdirectedRequest": + return StatusCode.MisdirectedRequest; + case 422: + case "UnprocessableEntity": + return StatusCode.UnprocessableEntity; + case 423: + case "Locked": + return StatusCode.Locked; + case 424: + case "FailedDependency": + return StatusCode.FailedDependency; + case 426: + case "UpgradeRequired": + return StatusCode.UpgradeRequired; + case 428: + case "PreconditionRequired": + return StatusCode.PreconditionRequired; + case 429: + case "TooManyRequests": + return StatusCode.TooManyRequests; + case 431: + case "RequestHeaderFieldsTooLarge": + return StatusCode.RequestHeaderFieldsTooLarge; + case 500: + case "InternalServerError": + return StatusCode.InternalServerError; + case 501: + case "NotImplemented": + return StatusCode.NotImplemented; + case 502: + case "BadGateway": + return StatusCode.BadGateway; + case 503: + case "ServiceUnavailable": + return StatusCode.ServiceUnavailable; + case 504: + case "GatewayTimeout": + return StatusCode.GatewayTimeout; + case 505: + case "HTTPVersionNotSupported": + return StatusCode.HTTPVersionNotSupported; + case 506: + case "VariantAlsoNegotiates": + return StatusCode.VariantAlsoNegotiates; + case 507: + case "InsufficientStorage": + return StatusCode.InsufficientStorage; + case 508: + case "LoopDetected": + return StatusCode.LoopDetected; + case 510: + case "NotExtended": + return StatusCode.NotExtended; + case 511: + case "NetworkAuthenticationRequired": + return StatusCode.NetworkAuthenticationRequired; + case -1: + case "UNRECOGNIZED": + default: + return StatusCode.UNRECOGNIZED; + } +} + +export function statusCodeToJSON(object: StatusCode): string { + switch (object) { + case StatusCode.Empty: + return "Empty"; + case StatusCode.Continue: + return "Continue"; + case StatusCode.OK: + return "OK"; + case StatusCode.Created: + return "Created"; + case StatusCode.Accepted: + return "Accepted"; + case StatusCode.NonAuthoritativeInformation: + return "NonAuthoritativeInformation"; + case StatusCode.NoContent: + return "NoContent"; + case StatusCode.ResetContent: + return "ResetContent"; + case StatusCode.PartialContent: + return "PartialContent"; + case StatusCode.MultiStatus: + return "MultiStatus"; + case StatusCode.AlreadyReported: + return "AlreadyReported"; + case StatusCode.IMUsed: + return "IMUsed"; + case StatusCode.MultipleChoices: + return "MultipleChoices"; + case StatusCode.MovedPermanently: + return "MovedPermanently"; + case StatusCode.Found: + return "Found"; + case StatusCode.SeeOther: + return "SeeOther"; + case StatusCode.NotModified: + return "NotModified"; + case StatusCode.UseProxy: + return "UseProxy"; + case StatusCode.TemporaryRedirect: + return "TemporaryRedirect"; + case StatusCode.PermanentRedirect: + return "PermanentRedirect"; + case StatusCode.BadRequest: + return "BadRequest"; + case StatusCode.Unauthorized: + return "Unauthorized"; + case StatusCode.PaymentRequired: + return "PaymentRequired"; + case StatusCode.Forbidden: + return "Forbidden"; + case StatusCode.NotFound: + return "NotFound"; + case StatusCode.MethodNotAllowed: + return "MethodNotAllowed"; + case StatusCode.NotAcceptable: + return "NotAcceptable"; + case StatusCode.ProxyAuthenticationRequired: + return "ProxyAuthenticationRequired"; + case StatusCode.RequestTimeout: + return "RequestTimeout"; + case StatusCode.Conflict: + return "Conflict"; + case StatusCode.Gone: + return "Gone"; + case StatusCode.LengthRequired: + return "LengthRequired"; + case StatusCode.PreconditionFailed: + return "PreconditionFailed"; + case StatusCode.PayloadTooLarge: + return "PayloadTooLarge"; + case StatusCode.URITooLong: + return "URITooLong"; + case StatusCode.UnsupportedMediaType: + return "UnsupportedMediaType"; + case StatusCode.RangeNotSatisfiable: + return "RangeNotSatisfiable"; + case StatusCode.ExpectationFailed: + return "ExpectationFailed"; + case StatusCode.MisdirectedRequest: + return "MisdirectedRequest"; + case StatusCode.UnprocessableEntity: + return "UnprocessableEntity"; + case StatusCode.Locked: + return "Locked"; + case StatusCode.FailedDependency: + return "FailedDependency"; + case StatusCode.UpgradeRequired: + return "UpgradeRequired"; + case StatusCode.PreconditionRequired: + return "PreconditionRequired"; + case StatusCode.TooManyRequests: + return "TooManyRequests"; + case StatusCode.RequestHeaderFieldsTooLarge: + return "RequestHeaderFieldsTooLarge"; + case StatusCode.InternalServerError: + return "InternalServerError"; + case StatusCode.NotImplemented: + return "NotImplemented"; + case StatusCode.BadGateway: + return "BadGateway"; + case StatusCode.ServiceUnavailable: + return "ServiceUnavailable"; + case StatusCode.GatewayTimeout: + return "GatewayTimeout"; + case StatusCode.HTTPVersionNotSupported: + return "HTTPVersionNotSupported"; + case StatusCode.VariantAlsoNegotiates: + return "VariantAlsoNegotiates"; + case StatusCode.InsufficientStorage: + return "InsufficientStorage"; + case StatusCode.LoopDetected: + return "LoopDetected"; + case StatusCode.NotExtended: + return "NotExtended"; + case StatusCode.NetworkAuthenticationRequired: + return "NetworkAuthenticationRequired"; + case StatusCode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** HTTP status. */ +export interface HttpStatus { + /** Supplies HTTP response code. */ + code: StatusCode; +} + +function createBaseHttpStatus(): HttpStatus { + return { code: 0 }; +} + +export const HttpStatus: MessageFns = { + encode(message: HttpStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).int32(message.code); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpStatus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.code = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpStatus { + return { code: isSet(object.code) ? statusCodeFromJSON(object.code) : 0 }; + }, + + toJSON(message: HttpStatus): unknown { + const obj: any = {}; + if (message.code !== 0) { + obj.code = statusCodeToJSON(message.code); + } + return obj; + }, + + create, I>>(base?: I): HttpStatus { + return HttpStatus.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): HttpStatus { + const message = createBaseHttpStatus(); + message.code = object.code ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts new file mode 100644 index 00000000..231a69cb --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts @@ -0,0 +1,247 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/type/v3/percent.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "envoy.type.v3"; + +/** Identifies a percentage, in the range [0.0, 100.0]. */ +export interface Percent { + value: number; +} + +/** + * A fractional percentage is used in cases in which for performance reasons performing floating + * point to integer conversions during randomness calculations is undesirable. The message includes + * both a numerator and denominator that together determine the final fractional value. + * + * * **Example**: 1/100 = 1%. + * * **Example**: 3/10000 = 0.03%. + */ +export interface FractionalPercent { + /** Specifies the numerator. Defaults to 0. */ + numerator: number; + /** + * Specifies the denominator. If the denominator specified is less than the numerator, the final + * fractional percentage is capped at 1 (100%). + */ + denominator: FractionalPercent_DenominatorType; +} + +/** Fraction percentages support several fixed denominator values. */ +export enum FractionalPercent_DenominatorType { + /** + * HUNDRED - 100. + * + * **Example**: 1/100 = 1%. + */ + HUNDRED = 0, + /** + * TEN_THOUSAND - 10,000. + * + * **Example**: 1/10000 = 0.01%. + */ + TEN_THOUSAND = 1, + /** + * MILLION - 1,000,000. + * + * **Example**: 1/1000000 = 0.0001%. + */ + MILLION = 2, + UNRECOGNIZED = -1, +} + +export function fractionalPercent_DenominatorTypeFromJSON(object: any): FractionalPercent_DenominatorType { + switch (object) { + case 0: + case "HUNDRED": + return FractionalPercent_DenominatorType.HUNDRED; + case 1: + case "TEN_THOUSAND": + return FractionalPercent_DenominatorType.TEN_THOUSAND; + case 2: + case "MILLION": + return FractionalPercent_DenominatorType.MILLION; + case -1: + case "UNRECOGNIZED": + default: + return FractionalPercent_DenominatorType.UNRECOGNIZED; + } +} + +export function fractionalPercent_DenominatorTypeToJSON(object: FractionalPercent_DenominatorType): string { + switch (object) { + case FractionalPercent_DenominatorType.HUNDRED: + return "HUNDRED"; + case FractionalPercent_DenominatorType.TEN_THOUSAND: + return "TEN_THOUSAND"; + case FractionalPercent_DenominatorType.MILLION: + return "MILLION"; + case FractionalPercent_DenominatorType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +function createBasePercent(): Percent { + return { value: 0 }; +} + +export const Percent: MessageFns = { + encode(message: Percent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(9).double(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Percent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePercent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.value = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Percent { + return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; + }, + + toJSON(message: Percent): unknown { + const obj: any = {}; + if (message.value !== 0) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Percent { + return Percent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Percent { + const message = createBasePercent(); + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseFractionalPercent(): FractionalPercent { + return { numerator: 0, denominator: 0 }; +} + +export const FractionalPercent: MessageFns = { + encode(message: FractionalPercent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.numerator !== 0) { + writer.uint32(8).uint32(message.numerator); + } + if (message.denominator !== 0) { + writer.uint32(16).int32(message.denominator); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FractionalPercent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFractionalPercent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.numerator = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.denominator = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FractionalPercent { + return { + numerator: isSet(object.numerator) ? globalThis.Number(object.numerator) : 0, + denominator: isSet(object.denominator) ? fractionalPercent_DenominatorTypeFromJSON(object.denominator) : 0, + }; + }, + + toJSON(message: FractionalPercent): unknown { + const obj: any = {}; + if (message.numerator !== 0) { + obj.numerator = Math.round(message.numerator); + } + if (message.denominator !== 0) { + obj.denominator = fractionalPercent_DenominatorTypeToJSON(message.denominator); + } + return obj; + }, + + create, I>>(base?: I): FractionalPercent { + return FractionalPercent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FractionalPercent { + const message = createBaseFractionalPercent(); + message.numerator = object.numerator ?? 0; + message.denominator = object.denominator ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts new file mode 100644 index 00000000..5fa5e849 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts @@ -0,0 +1,138 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: envoy/type/v3/semantic_version.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "envoy.type.v3"; + +/** + * Envoy uses SemVer (https://semver.org/). Major/minor versions indicate + * expected behaviors and APIs, the patch version field is used only + * for security fixes and can be generally ignored. + */ +export interface SemanticVersion { + majorNumber: number; + minorNumber: number; + patch: number; +} + +function createBaseSemanticVersion(): SemanticVersion { + return { majorNumber: 0, minorNumber: 0, patch: 0 }; +} + +export const SemanticVersion: MessageFns = { + encode(message: SemanticVersion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.majorNumber !== 0) { + writer.uint32(8).uint32(message.majorNumber); + } + if (message.minorNumber !== 0) { + writer.uint32(16).uint32(message.minorNumber); + } + if (message.patch !== 0) { + writer.uint32(24).uint32(message.patch); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SemanticVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSemanticVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.majorNumber = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.minorNumber = reader.uint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.patch = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SemanticVersion { + return { + majorNumber: isSet(object.majorNumber) ? globalThis.Number(object.majorNumber) : 0, + minorNumber: isSet(object.minorNumber) ? globalThis.Number(object.minorNumber) : 0, + patch: isSet(object.patch) ? globalThis.Number(object.patch) : 0, + }; + }, + + toJSON(message: SemanticVersion): unknown { + const obj: any = {}; + if (message.majorNumber !== 0) { + obj.majorNumber = Math.round(message.majorNumber); + } + if (message.minorNumber !== 0) { + obj.minorNumber = Math.round(message.minorNumber); + } + if (message.patch !== 0) { + obj.patch = Math.round(message.patch); + } + return obj; + }, + + create, I>>(base?: I): SemanticVersion { + return SemanticVersion.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SemanticVersion { + const message = createBaseSemanticVersion(); + message.majorNumber = object.majorNumber ?? 0; + message.minorNumber = object.minorNumber ?? 0; + message.patch = object.patch ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts new file mode 100644 index 00000000..065a51ad --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts @@ -0,0 +1,259 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: google/protobuf/any.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array(0) }; +} + +export const Any: MessageFns = { + encode(message: Any, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.typeUrl = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.bytes(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + if (message.typeUrl !== "") { + obj.typeUrl = message.typeUrl; + } + if (message.value.length !== 0) { + obj.value = base64FromBytes(message.value); + } + return obj; + }, + + create, I>>(base?: I): Any { + return Any.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(0); + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts new file mode 100644 index 00000000..4adebdf2 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts @@ -0,0 +1,6975 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: google/protobuf/descriptor.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** The full set of known editions. */ +export enum Edition { + /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ + EDITION_UNKNOWN = 0, + /** + * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + */ + EDITION_LEGACY = 900, + /** + * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + */ + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + /** + * EDITION_2023 - Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + */ + EDITION_2023 = 1000, + EDITION_2024 = 1001, + /** + * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + */ + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + /** + * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + */ + EDITION_MAX = 2147483647, + UNRECOGNIZED = -1, +} + +export function editionFromJSON(object: any): Edition { + switch (object) { + case 0: + case "EDITION_UNKNOWN": + return Edition.EDITION_UNKNOWN; + case 900: + case "EDITION_LEGACY": + return Edition.EDITION_LEGACY; + case 998: + case "EDITION_PROTO2": + return Edition.EDITION_PROTO2; + case 999: + case "EDITION_PROTO3": + return Edition.EDITION_PROTO3; + case 1000: + case "EDITION_2023": + return Edition.EDITION_2023; + case 1001: + case "EDITION_2024": + return Edition.EDITION_2024; + case 1: + case "EDITION_1_TEST_ONLY": + return Edition.EDITION_1_TEST_ONLY; + case 2: + case "EDITION_2_TEST_ONLY": + return Edition.EDITION_2_TEST_ONLY; + case 99997: + case "EDITION_99997_TEST_ONLY": + return Edition.EDITION_99997_TEST_ONLY; + case 99998: + case "EDITION_99998_TEST_ONLY": + return Edition.EDITION_99998_TEST_ONLY; + case 99999: + case "EDITION_99999_TEST_ONLY": + return Edition.EDITION_99999_TEST_ONLY; + case 2147483647: + case "EDITION_MAX": + return Edition.EDITION_MAX; + case -1: + case "UNRECOGNIZED": + default: + return Edition.UNRECOGNIZED; + } +} + +export function editionToJSON(object: Edition): string { + switch (object) { + case Edition.EDITION_UNKNOWN: + return "EDITION_UNKNOWN"; + case Edition.EDITION_LEGACY: + return "EDITION_LEGACY"; + case Edition.EDITION_PROTO2: + return "EDITION_PROTO2"; + case Edition.EDITION_PROTO3: + return "EDITION_PROTO3"; + case Edition.EDITION_2023: + return "EDITION_2023"; + case Edition.EDITION_2024: + return "EDITION_2024"; + case Edition.EDITION_1_TEST_ONLY: + return "EDITION_1_TEST_ONLY"; + case Edition.EDITION_2_TEST_ONLY: + return "EDITION_2_TEST_ONLY"; + case Edition.EDITION_99997_TEST_ONLY: + return "EDITION_99997_TEST_ONLY"; + case Edition.EDITION_99998_TEST_ONLY: + return "EDITION_99998_TEST_ONLY"; + case Edition.EDITION_99999_TEST_ONLY: + return "EDITION_99999_TEST_ONLY"; + case Edition.EDITION_MAX: + return "EDITION_MAX"; + case Edition.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + */ +export enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2, + UNRECOGNIZED = -1, +} + +export function symbolVisibilityFromJSON(object: any): SymbolVisibility { + switch (object) { + case 0: + case "VISIBILITY_UNSET": + return SymbolVisibility.VISIBILITY_UNSET; + case 1: + case "VISIBILITY_LOCAL": + return SymbolVisibility.VISIBILITY_LOCAL; + case 2: + case "VISIBILITY_EXPORT": + return SymbolVisibility.VISIBILITY_EXPORT; + case -1: + case "UNRECOGNIZED": + default: + return SymbolVisibility.UNRECOGNIZED; + } +} + +export function symbolVisibilityToJSON(object: SymbolVisibility): string { + switch (object) { + case SymbolVisibility.VISIBILITY_UNSET: + return "VISIBILITY_UNSET"; + case SymbolVisibility.VISIBILITY_LOCAL: + return "VISIBILITY_LOCAL"; + case SymbolVisibility.VISIBILITY_EXPORT: + return "VISIBILITY_EXPORT"; + case SymbolVisibility.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name?: + | string + | undefined; + /** e.g. "foo", "foo.bar", etc. */ + package?: + | string + | undefined; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + */ + optionDependency: string[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: + | FileOptions + | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: + | SourceCodeInfo + | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + syntax?: + | string + | undefined; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + edition?: Edition | undefined; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name?: string | undefined; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions | undefined; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; + /** Support for `export` and `local` keywords on enums. */ + visibility?: SymbolVisibility | undefined; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start?: + | number + | undefined; + /** Exclusive. */ + end?: number | undefined; + options?: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start?: + | number + | undefined; + /** Exclusive. */ + end?: number | undefined; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + */ + verification?: ExtensionRangeOptions_VerificationState | undefined; +} + +/** The verification state of the extension range. */ +export enum ExtensionRangeOptions_VerificationState { + /** DECLARATION - All the extensions of the range must be declared. */ + DECLARATION = 0, + UNVERIFIED = 1, + UNRECOGNIZED = -1, +} + +export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState { + switch (object) { + case 0: + case "DECLARATION": + return ExtensionRangeOptions_VerificationState.DECLARATION; + case 1: + case "UNVERIFIED": + return ExtensionRangeOptions_VerificationState.UNVERIFIED; + case -1: + case "UNRECOGNIZED": + default: + return ExtensionRangeOptions_VerificationState.UNRECOGNIZED; + } +} + +export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string { + switch (object) { + case ExtensionRangeOptions_VerificationState.DECLARATION: + return "DECLARATION"; + case ExtensionRangeOptions_VerificationState.UNVERIFIED: + return "UNVERIFIED"; + case ExtensionRangeOptions_VerificationState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface ExtensionRangeOptions_Declaration { + /** The extension number declared within the extension range. */ + number?: + | number + | undefined; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + */ + fullName?: + | string + | undefined; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + */ + type?: + | string + | undefined; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + */ + reserved?: + | boolean + | undefined; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + */ + repeated?: boolean | undefined; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name?: string | undefined; + number?: number | undefined; + label?: + | FieldDescriptorProto_Label + | undefined; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type?: + | FieldDescriptorProto_Type + | undefined; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName?: + | string + | undefined; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee?: + | string + | undefined; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + */ + defaultValue?: + | string + | undefined; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex?: + | number + | undefined; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName?: string | undefined; + options?: + | FieldOptions + | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional?: boolean | undefined; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + /** + * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + */ + LABEL_REQUIRED = 2, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name?: string | undefined; + options?: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name?: string | undefined; + value: EnumValueDescriptorProto[]; + options?: + | EnumOptions + | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; + /** Support for `export` and `local` keywords on enums. */ + visibility?: SymbolVisibility | undefined; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start?: + | number + | undefined; + /** Inclusive. */ + end?: number | undefined; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name?: string | undefined; + number?: number | undefined; + options?: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name?: string | undefined; + method: MethodDescriptorProto[]; + options?: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name?: + | string + | undefined; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType?: string | undefined; + outputType?: string | undefined; + options?: + | MethodOptions + | undefined; + /** Identifies if client streams multiple client messages */ + clientStreaming?: + | boolean + | undefined; + /** Identifies if server streams multiple server messages */ + serverStreaming?: boolean | undefined; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage?: + | string + | undefined; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + javaOuterClassname?: + | string + | undefined; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles?: + | boolean + | undefined; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash?: + | boolean + | undefined; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + */ + javaStringCheckUtf8?: boolean | undefined; + optimizeFor?: + | FileOptions_OptimizeMode + | undefined; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage?: + | string + | undefined; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices?: boolean | undefined; + javaGenericServices?: boolean | undefined; + pyGenericServices?: + | boolean + | undefined; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated?: + | boolean + | undefined; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas?: + | boolean + | undefined; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix?: + | string + | undefined; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace?: + | string + | undefined; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix?: + | string + | undefined; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix?: + | string + | undefined; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace?: + | string + | undefined; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace?: + | string + | undefined; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage?: + | string + | undefined; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat?: + | boolean + | undefined; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor?: + | boolean + | undefined; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated?: + | boolean + | undefined; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry?: + | boolean + | undefined; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: + | boolean + | undefined; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + */ + ctype?: + | FieldOptions_CType + | undefined; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + */ + packed?: + | boolean + | undefined; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype?: + | FieldOptions_JSType + | undefined; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + */ + lazy?: + | boolean + | undefined; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy?: + | boolean + | undefined; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated?: + | boolean + | undefined; + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * @deprecated + */ + weak?: + | boolean + | undefined; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debugRedact?: boolean | undefined; + retention?: FieldOptions_OptionRetention | undefined; + targets: FieldOptions_OptionTargetType[]; + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet | undefined; + featureSupport?: + | FieldOptions_FeatureSupport + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + /** + * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + */ + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ +export enum FieldOptions_OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { + switch (object) { + case 0: + case "RETENTION_UNKNOWN": + return FieldOptions_OptionRetention.RETENTION_UNKNOWN; + case 1: + case "RETENTION_RUNTIME": + return FieldOptions_OptionRetention.RETENTION_RUNTIME; + case 2: + case "RETENTION_SOURCE": + return FieldOptions_OptionRetention.RETENTION_SOURCE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionRetention.UNRECOGNIZED; + } +} + +export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { + switch (object) { + case FieldOptions_OptionRetention.RETENTION_UNKNOWN: + return "RETENTION_UNKNOWN"; + case FieldOptions_OptionRetention.RETENTION_RUNTIME: + return "RETENTION_RUNTIME"; + case FieldOptions_OptionRetention.RETENTION_SOURCE: + return "RETENTION_SOURCE"; + case FieldOptions_OptionRetention.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + */ +export enum FieldOptions_OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9, + UNRECOGNIZED = -1, +} + +export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { + switch (object) { + case 0: + case "TARGET_TYPE_UNKNOWN": + return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; + case 1: + case "TARGET_TYPE_FILE": + return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; + case 2: + case "TARGET_TYPE_EXTENSION_RANGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; + case 3: + case "TARGET_TYPE_MESSAGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; + case 4: + case "TARGET_TYPE_FIELD": + return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; + case 5: + case "TARGET_TYPE_ONEOF": + return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; + case 6: + case "TARGET_TYPE_ENUM": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; + case 7: + case "TARGET_TYPE_ENUM_ENTRY": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; + case 8: + case "TARGET_TYPE_SERVICE": + return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; + case 9: + case "TARGET_TYPE_METHOD": + return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionTargetType.UNRECOGNIZED; + } +} + +export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { + switch (object) { + case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: + return "TARGET_TYPE_UNKNOWN"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: + return "TARGET_TYPE_FILE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: + return "TARGET_TYPE_EXTENSION_RANGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: + return "TARGET_TYPE_MESSAGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: + return "TARGET_TYPE_FIELD"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: + return "TARGET_TYPE_ONEOF"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: + return "TARGET_TYPE_ENUM"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: + return "TARGET_TYPE_ENUM_ENTRY"; + case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: + return "TARGET_TYPE_SERVICE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: + return "TARGET_TYPE_METHOD"; + case FieldOptions_OptionTargetType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface FieldOptions_EditionDefault { + edition?: + | Edition + | undefined; + /** Textproto value. */ + value?: string | undefined; +} + +/** Information about the support window of a feature. */ +export interface FieldOptions_FeatureSupport { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + */ + editionIntroduced?: + | Edition + | undefined; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + */ + editionDeprecated?: + | Edition + | undefined; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + */ + deprecationWarning?: + | string + | undefined; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + */ + editionRemoved?: Edition | undefined; +} + +export interface OneofOptions { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias?: + | boolean + | undefined; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated?: + | boolean + | undefined; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: + | boolean + | undefined; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated?: + | boolean + | undefined; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + */ + debugRedact?: + | boolean + | undefined; + /** Information about the support window of a feature value. */ + featureSupport?: + | FieldOptions_FeatureSupport + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated?: + | boolean + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated?: boolean | undefined; + idempotencyLevel?: + | MethodOptions_IdempotencyLevel + | undefined; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue?: string | undefined; + positiveIntValue?: string | undefined; + negativeIntValue?: string | undefined; + doubleValue?: number | undefined; + stringValue?: Uint8Array | undefined; + aggregateValue?: string | undefined; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} + +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + */ +export interface FeatureSet { + fieldPresence?: FeatureSet_FieldPresence | undefined; + enumType?: FeatureSet_EnumType | undefined; + repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding | undefined; + utf8Validation?: FeatureSet_Utf8Validation | undefined; + messageEncoding?: FeatureSet_MessageEncoding | undefined; + jsonFormat?: FeatureSet_JsonFormat | undefined; + enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined; + defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibility | undefined; +} + +export enum FeatureSet_FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3, + UNRECOGNIZED = -1, +} + +export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence { + switch (object) { + case 0: + case "FIELD_PRESENCE_UNKNOWN": + return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN; + case 1: + case "EXPLICIT": + return FeatureSet_FieldPresence.EXPLICIT; + case 2: + case "IMPLICIT": + return FeatureSet_FieldPresence.IMPLICIT; + case 3: + case "LEGACY_REQUIRED": + return FeatureSet_FieldPresence.LEGACY_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_FieldPresence.UNRECOGNIZED; + } +} + +export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string { + switch (object) { + case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN: + return "FIELD_PRESENCE_UNKNOWN"; + case FeatureSet_FieldPresence.EXPLICIT: + return "EXPLICIT"; + case FeatureSet_FieldPresence.IMPLICIT: + return "IMPLICIT"; + case FeatureSet_FieldPresence.LEGACY_REQUIRED: + return "LEGACY_REQUIRED"; + case FeatureSet_FieldPresence.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType { + switch (object) { + case 0: + case "ENUM_TYPE_UNKNOWN": + return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN; + case 1: + case "OPEN": + return FeatureSet_EnumType.OPEN; + case 2: + case "CLOSED": + return FeatureSet_EnumType.CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_EnumType.UNRECOGNIZED; + } +} + +export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string { + switch (object) { + case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN: + return "ENUM_TYPE_UNKNOWN"; + case FeatureSet_EnumType.OPEN: + return "OPEN"; + case FeatureSet_EnumType.CLOSED: + return "CLOSED"; + case FeatureSet_EnumType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding { + switch (object) { + case 0: + case "REPEATED_FIELD_ENCODING_UNKNOWN": + return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN; + case 1: + case "PACKED": + return FeatureSet_RepeatedFieldEncoding.PACKED; + case 2: + case "EXPANDED": + return FeatureSet_RepeatedFieldEncoding.EXPANDED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED; + } +} + +export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string { + switch (object) { + case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN: + return "REPEATED_FIELD_ENCODING_UNKNOWN"; + case FeatureSet_RepeatedFieldEncoding.PACKED: + return "PACKED"; + case FeatureSet_RepeatedFieldEncoding.EXPANDED: + return "EXPANDED"; + case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3, + UNRECOGNIZED = -1, +} + +export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation { + switch (object) { + case 0: + case "UTF8_VALIDATION_UNKNOWN": + return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; + case 2: + case "VERIFY": + return FeatureSet_Utf8Validation.VERIFY; + case 3: + case "NONE": + return FeatureSet_Utf8Validation.NONE; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_Utf8Validation.UNRECOGNIZED; + } +} + +export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string { + switch (object) { + case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN: + return "UTF8_VALIDATION_UNKNOWN"; + case FeatureSet_Utf8Validation.VERIFY: + return "VERIFY"; + case FeatureSet_Utf8Validation.NONE: + return "NONE"; + case FeatureSet_Utf8Validation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding { + switch (object) { + case 0: + case "MESSAGE_ENCODING_UNKNOWN": + return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; + case 1: + case "LENGTH_PREFIXED": + return FeatureSet_MessageEncoding.LENGTH_PREFIXED; + case 2: + case "DELIMITED": + return FeatureSet_MessageEncoding.DELIMITED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_MessageEncoding.UNRECOGNIZED; + } +} + +export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string { + switch (object) { + case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN: + return "MESSAGE_ENCODING_UNKNOWN"; + case FeatureSet_MessageEncoding.LENGTH_PREFIXED: + return "LENGTH_PREFIXED"; + case FeatureSet_MessageEncoding.DELIMITED: + return "DELIMITED"; + case FeatureSet_MessageEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat { + switch (object) { + case 0: + case "JSON_FORMAT_UNKNOWN": + return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; + case 1: + case "ALLOW": + return FeatureSet_JsonFormat.ALLOW; + case 2: + case "LEGACY_BEST_EFFORT": + return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_JsonFormat.UNRECOGNIZED; + } +} + +export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string { + switch (object) { + case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN: + return "JSON_FORMAT_UNKNOWN"; + case FeatureSet_JsonFormat.ALLOW: + return "ALLOW"; + case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT: + return "LEGACY_BEST_EFFORT"; + case FeatureSet_JsonFormat.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle { + switch (object) { + case 0: + case "ENFORCE_NAMING_STYLE_UNKNOWN": + return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN; + case 1: + case "STYLE2024": + return FeatureSet_EnforceNamingStyle.STYLE2024; + case 2: + case "STYLE_LEGACY": + return FeatureSet_EnforceNamingStyle.STYLE_LEGACY; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_EnforceNamingStyle.UNRECOGNIZED; + } +} + +export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string { + switch (object) { + case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN: + return "ENFORCE_NAMING_STYLE_UNKNOWN"; + case FeatureSet_EnforceNamingStyle.STYLE2024: + return "STYLE2024"; + case FeatureSet_EnforceNamingStyle.STYLE_LEGACY: + return "STYLE_LEGACY"; + case FeatureSet_EnforceNamingStyle.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface FeatureSet_VisibilityFeature { +} + +export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + /** EXPORT_ALL - Default pre-EDITION_2024, all UNSET visibility are export. */ + EXPORT_ALL = 1, + /** EXPORT_TOP_LEVEL - All top-level symbols default to export, nested default to local. */ + EXPORT_TOP_LEVEL = 2, + /** LOCAL_ALL - All symbols default to local. */ + LOCAL_ALL = 3, + /** + * STRICT - All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + */ + STRICT = 4, + UNRECOGNIZED = -1, +} + +export function featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON( + object: any, +): FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + switch (object) { + case 0: + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN; + case 1: + case "EXPORT_ALL": + return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL; + case 2: + case "EXPORT_TOP_LEVEL": + return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL; + case 3: + case "LOCAL_ALL": + return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL; + case 4: + case "STRICT": + return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED; + } +} + +export function featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON( + object: FeatureSet_VisibilityFeature_DefaultSymbolVisibility, +): string { + switch (object) { + case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: + return "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"; + case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL: + return "EXPORT_ALL"; + case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL: + return "EXPORT_TOP_LEVEL"; + case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL: + return "LOCAL_ALL"; + case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT: + return "STRICT"; + case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + */ +export interface FeatureSetDefaults { + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + */ + minimumEdition?: + | Edition + | undefined; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + */ + maximumEdition?: Edition | undefined; +} + +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + */ +export interface FeatureSetDefaults_FeatureSetEditionDefault { + edition?: + | Edition + | undefined; + /** Defaults of features that can be overridden in this edition. */ + overridableFeatures?: + | FeatureSet + | undefined; + /** Defaults of features that can't be overridden in this edition. */ + fixedFeatures?: FeatureSet | undefined; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments?: string | undefined; + trailingComments?: string | undefined; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile?: + | string + | undefined; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin?: + | number + | undefined; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end?: number | undefined; + semantic?: GeneratedCodeInfo_Annotation_Semantic | undefined; +} + +/** + * Represents the identified object's effect on the element in the original + * .proto file. + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** NONE - There is no effect or the effect is indescribable. */ + NONE = 0, + /** SET - The element is set or otherwise mutated. */ + SET = 1, + /** ALIAS - An alias to the element is returned. */ + ALIAS = 2, + UNRECOGNIZED = -1, +} + +export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { + switch (object) { + case 0: + case "NONE": + return GeneratedCodeInfo_Annotation_Semantic.NONE; + case 1: + case "SET": + return GeneratedCodeInfo_Annotation_Semantic.SET; + case 2: + case "ALIAS": + return GeneratedCodeInfo_Annotation_Semantic.ALIAS; + case -1: + case "UNRECOGNIZED": + default: + return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; + } +} + +export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { + switch (object) { + case GeneratedCodeInfo_Annotation_Semantic.NONE: + return "NONE"; + case GeneratedCodeInfo_Annotation_Semantic.SET: + return "SET"; + case GeneratedCodeInfo_Annotation_Semantic.ALIAS: + return "ALIAS"; + case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} + +export const FileDescriptorSet: MessageFns = { + encode(message: FileDescriptorSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + return { + file: globalThis.Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [], + }; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file?.length) { + obj.file = message.file.map((e) => FileDescriptorProto.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): FileDescriptorSet { + return FileDescriptorSet.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + optionDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "", + edition: 0, + }; +} + +export const FileDescriptorProto: MessageFns = { + encode(message: FileDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== undefined && message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + for (const v of message.publicDependency) { + writer.uint32(80).int32(v!); + } + for (const v of message.weakDependency) { + writer.uint32(88).int32(v!); + } + for (const v of message.optionDependency) { + writer.uint32(122).string(v!); + } + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).join(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).join(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).join(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).join(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).join(); + } + if (message.syntax !== undefined && message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + if (message.edition !== undefined && message.edition !== 0) { + writer.uint32(112).int32(message.edition); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.package = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.dependency.push(reader.string()); + continue; + } + case 10: { + if (tag === 80) { + message.publicDependency.push(reader.int32()); + + continue; + } + + if (tag === 82) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + + continue; + } + + break; + } + case 11: { + if (tag === 88) { + message.weakDependency.push(reader.int32()); + + continue; + } + + if (tag === 90) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + + continue; + } + + break; + } + case 15: { + if (tag !== 122) { + break; + } + + message.optionDependency.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.options = FileOptions.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.syntax = reader.string(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.edition = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + package: isSet(object.package) ? globalThis.String(object.package) : "", + dependency: globalThis.Array.isArray(object?.dependency) + ? object.dependency.map((e: any) => globalThis.String(e)) + : [], + publicDependency: globalThis.Array.isArray(object?.publicDependency) + ? object.publicDependency.map((e: any) => globalThis.Number(e)) + : [], + weakDependency: globalThis.Array.isArray(object?.weakDependency) + ? object.weakDependency.map((e: any) => globalThis.Number(e)) + : [], + optionDependency: globalThis.Array.isArray(object?.optionDependency) + ? object.optionDependency.map((e: any) => globalThis.String(e)) + : [], + messageType: globalThis.Array.isArray(object?.messageType) + ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: globalThis.Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + service: globalThis.Array.isArray(object?.service) + ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) + : [], + extension: globalThis.Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, + sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, + syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : "", + edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, + }; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.package !== undefined && message.package !== "") { + obj.package = message.package; + } + if (message.dependency?.length) { + obj.dependency = message.dependency; + } + if (message.publicDependency?.length) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); + } + if (message.weakDependency?.length) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); + } + if (message.optionDependency?.length) { + obj.optionDependency = message.optionDependency; + } + if (message.messageType?.length) { + obj.messageType = message.messageType.map((e) => DescriptorProto.toJSON(e)); + } + if (message.enumType?.length) { + obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + } + if (message.service?.length) { + obj.service = message.service.map((e) => ServiceDescriptorProto.toJSON(e)); + } + if (message.extension?.length) { + obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = FileOptions.toJSON(message.options); + } + if (message.sourceCodeInfo !== undefined) { + obj.sourceCodeInfo = SourceCodeInfo.toJSON(message.sourceCodeInfo); + } + if (message.syntax !== undefined && message.syntax !== "") { + obj.syntax = message.syntax; + } + if (message.edition !== undefined && message.edition !== 0) { + obj.edition = editionToJSON(message.edition); + } + return obj; + }, + + create, I>>(base?: I): FileDescriptorProto { + return FileDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.publicDependency?.map((e) => e) || []; + message.weakDependency = object.weakDependency?.map((e) => e) || []; + message.optionDependency = object.optionDependency?.map((e) => e) || []; + message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? FileOptions.fromPartial(object.options) + : undefined; + message.sourceCodeInfo = (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined; + message.syntax = object.syntax ?? ""; + message.edition = object.edition ?? 0; + return message; + }, +}; + +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + visibility: 0, + }; +} + +export const DescriptorProto: MessageFns = { + encode(message: DescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).join(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).join(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).join(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).join(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).join(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).join(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + if (message.visibility !== undefined && message.visibility !== 0) { + writer.uint32(88).int32(message.visibility); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.options = MessageOptions.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.visibility = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + field: globalThis.Array.isArray(object?.field) + ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + extension: globalThis.Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + nestedType: globalThis.Array.isArray(object?.nestedType) + ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: globalThis.Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + extensionRange: globalThis.Array.isArray(object?.extensionRange) + ? object.extensionRange.map((e: any) => DescriptorProto_ExtensionRange.fromJSON(e)) + : [], + oneofDecl: globalThis.Array.isArray(object?.oneofDecl) + ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? MessageOptions.fromJSON(object.options) : undefined, + reservedRange: globalThis.Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(e)) + : [], + reservedName: globalThis.Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => globalThis.String(e)) + : [], + visibility: isSet(object.visibility) ? symbolVisibilityFromJSON(object.visibility) : 0, + }; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.field?.length) { + obj.field = message.field.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.extension?.length) { + obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.nestedType?.length) { + obj.nestedType = message.nestedType.map((e) => DescriptorProto.toJSON(e)); + } + if (message.enumType?.length) { + obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + } + if (message.extensionRange?.length) { + obj.extensionRange = message.extensionRange.map((e) => DescriptorProto_ExtensionRange.toJSON(e)); + } + if (message.oneofDecl?.length) { + obj.oneofDecl = message.oneofDecl.map((e) => OneofDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = MessageOptions.toJSON(message.options); + } + if (message.reservedRange?.length) { + obj.reservedRange = message.reservedRange.map((e) => DescriptorProto_ReservedRange.toJSON(e)); + } + if (message.reservedName?.length) { + obj.reservedName = message.reservedName; + } + if (message.visibility !== undefined && message.visibility !== 0) { + obj.visibility = symbolVisibilityToJSON(message.visibility); + } + return obj; + }, + + create, I>>(base?: I): DescriptorProto { + return DescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = object.extensionRange?.map((e) => DescriptorProto_ExtensionRange.fromPartial(e)) || []; + message.oneofDecl = object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? MessageOptions.fromPartial(object.options) + : undefined; + message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + message.visibility = object.visibility ?? 0; + return message; + }, +}; + +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} + +export const DescriptorProto_ExtensionRange: MessageFns = { + encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + return { + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + if (message.options !== undefined) { + obj.options = ExtensionRangeOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>(base?: I): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = (object.options !== undefined && object.options !== null) + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} + +export const DescriptorProto_ReservedRange: MessageFns = { + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + return { + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create, I>>(base?: I): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [], declaration: [], features: undefined, verification: 1 }; +} + +export const ExtensionRangeOptions: MessageFns = { + encode(message: ExtensionRangeOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + for (const v of message.declaration) { + ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).join(); + } + if (message.verification !== undefined && message.verification !== 1) { + writer.uint32(24).int32(message.verification); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32())); + continue; + } + case 50: { + if (tag !== 402) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.verification = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + return { + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + declaration: globalThis.Array.isArray(object?.declaration) + ? object.declaration.map((e: any) => ExtensionRangeOptions_Declaration.fromJSON(e)) + : [], + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + verification: isSet(object.verification) + ? extensionRangeOptions_VerificationStateFromJSON(object.verification) + : 1, + }; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + if (message.declaration?.length) { + obj.declaration = message.declaration.map((e) => ExtensionRangeOptions_Declaration.toJSON(e)); + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.verification !== undefined && message.verification !== 1) { + obj.verification = extensionRangeOptions_VerificationStateToJSON(message.verification); + } + return obj; + }, + + create, I>>(base?: I): ExtensionRangeOptions { + return ExtensionRangeOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + message.declaration = object.declaration?.map((e) => ExtensionRangeOptions_Declaration.fromPartial(e)) || []; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.verification = object.verification ?? 1; + return message; + }, +}; + +function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration { + return { number: 0, fullName: "", type: "", reserved: false, repeated: false }; +} + +export const ExtensionRangeOptions_Declaration: MessageFns = { + encode(message: ExtensionRangeOptions_Declaration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.number !== undefined && message.number !== 0) { + writer.uint32(8).int32(message.number); + } + if (message.fullName !== undefined && message.fullName !== "") { + writer.uint32(18).string(message.fullName); + } + if (message.type !== undefined && message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.reserved !== undefined && message.reserved !== false) { + writer.uint32(40).bool(message.reserved); + } + if (message.repeated !== undefined && message.repeated !== false) { + writer.uint32(48).bool(message.repeated); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions_Declaration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.number = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fullName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.type = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.reserved = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.repeated = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions_Declaration { + return { + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + reserved: isSet(object.reserved) ? globalThis.Boolean(object.reserved) : false, + repeated: isSet(object.repeated) ? globalThis.Boolean(object.repeated) : false, + }; + }, + + toJSON(message: ExtensionRangeOptions_Declaration): unknown { + const obj: any = {}; + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.fullName !== undefined && message.fullName !== "") { + obj.fullName = message.fullName; + } + if (message.type !== undefined && message.type !== "") { + obj.type = message.type; + } + if (message.reserved !== undefined && message.reserved !== false) { + obj.reserved = message.reserved; + } + if (message.repeated !== undefined && message.repeated !== false) { + obj.repeated = message.repeated; + } + return obj; + }, + + create, I>>( + base?: I, + ): ExtensionRangeOptions_Declaration { + return ExtensionRangeOptions_Declaration.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ExtensionRangeOptions_Declaration { + const message = createBaseExtensionRangeOptions_Declaration(); + message.number = object.number ?? 0; + message.fullName = object.fullName ?? ""; + message.type = object.type ?? ""; + message.reserved = object.reserved ?? false; + message.repeated = object.repeated ?? false; + return message; + }, +}; + +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined, + proto3Optional: false, + }; +} + +export const FieldDescriptorProto: MessageFns = { + encode(message: FieldDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== undefined && message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== undefined && message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== undefined && message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== undefined && message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== undefined && message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== undefined && message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== undefined && message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).join(); + } + if (message.proto3Optional !== undefined && message.proto3Optional !== false) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.number = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.label = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.type = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.typeName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.extendee = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.defaultValue = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.oneofIndex = reader.int32(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.jsonName = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.options = FieldOptions.decode(reader, reader.uint32()); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.proto3Optional = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 1, + typeName: isSet(object.typeName) ? globalThis.String(object.typeName) : "", + extendee: isSet(object.extendee) ? globalThis.String(object.extendee) : "", + defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "", + oneofIndex: isSet(object.oneofIndex) ? globalThis.Number(object.oneofIndex) : 0, + jsonName: isSet(object.jsonName) ? globalThis.String(object.jsonName) : "", + options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined, + proto3Optional: isSet(object.proto3Optional) ? globalThis.Boolean(object.proto3Optional) : false, + }; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.label !== undefined && message.label !== 1) { + obj.label = fieldDescriptorProto_LabelToJSON(message.label); + } + if (message.type !== undefined && message.type !== 1) { + obj.type = fieldDescriptorProto_TypeToJSON(message.type); + } + if (message.typeName !== undefined && message.typeName !== "") { + obj.typeName = message.typeName; + } + if (message.extendee !== undefined && message.extendee !== "") { + obj.extendee = message.extendee; + } + if (message.defaultValue !== undefined && message.defaultValue !== "") { + obj.defaultValue = message.defaultValue; + } + if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { + obj.oneofIndex = Math.round(message.oneofIndex); + } + if (message.jsonName !== undefined && message.jsonName !== "") { + obj.jsonName = message.jsonName; + } + if (message.options !== undefined) { + obj.options = FieldOptions.toJSON(message.options); + } + if (message.proto3Optional !== undefined && message.proto3Optional !== false) { + obj.proto3Optional = message.proto3Optional; + } + return obj; + }, + + create, I>>(base?: I): FieldDescriptorProto { + return FieldDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? FieldOptions.fromPartial(object.options) + : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, +}; + +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} + +export const OneofDescriptorProto: MessageFns = { + encode(message: OneofDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.options = OneofOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.options !== undefined) { + obj.options = OneofOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>(base?: I): OneofDescriptorProto { + return OneofDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? OneofOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [], visibility: 0 }; +} + +export const EnumDescriptorProto: MessageFns = { + encode(message: EnumDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).join(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + if (message.visibility !== undefined && message.visibility !== 0) { + writer.uint32(48).int32(message.visibility); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = EnumOptions.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.visibility = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + value: globalThis.Array.isArray(object?.value) + ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, + reservedRange: globalThis.Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(e)) + : [], + reservedName: globalThis.Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => globalThis.String(e)) + : [], + visibility: isSet(object.visibility) ? symbolVisibilityFromJSON(object.visibility) : 0, + }; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.value?.length) { + obj.value = message.value.map((e) => EnumValueDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = EnumOptions.toJSON(message.options); + } + if (message.reservedRange?.length) { + obj.reservedRange = message.reservedRange.map((e) => EnumDescriptorProto_EnumReservedRange.toJSON(e)); + } + if (message.reservedName?.length) { + obj.reservedName = message.reservedName; + } + if (message.visibility !== undefined && message.visibility !== 0) { + obj.visibility = symbolVisibilityToJSON(message.visibility); + } + return obj; + }, + + create, I>>(base?: I): EnumDescriptorProto { + return EnumDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? EnumOptions.fromPartial(object.options) + : undefined; + message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || + []; + message.reservedName = object.reservedName?.map((e) => e) || []; + message.visibility = object.visibility ?? 0; + return message; + }, +}; + +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} + +export const EnumDescriptorProto_EnumReservedRange: MessageFns = { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + return { + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create, I>>( + base?: I, + ): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} + +export const EnumValueDescriptorProto: MessageFns = { + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== undefined && message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.number = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = EnumValueOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.options !== undefined) { + obj.options = EnumValueOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>(base?: I): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = (object.options !== undefined && object.options !== null) + ? EnumValueOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} + +export const ServiceDescriptorProto: MessageFns = { + encode(message: ServiceDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = ServiceOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + method: globalThis.Array.isArray(object?.method) + ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? ServiceOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.method?.length) { + obj.method = message.method.map((e) => MethodDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = ServiceOptions.toJSON(message.options); + } + return obj; + }, + + create, I>>(base?: I): ServiceDescriptorProto { + return ServiceDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? ServiceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} + +export const MethodDescriptorProto: MessageFns = { + encode(message: MethodDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== undefined && message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== undefined && message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).join(); + } + if (message.clientStreaming !== undefined && message.clientStreaming !== false) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming !== undefined && message.serverStreaming !== false) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.inputType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.outputType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.options = MethodOptions.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.clientStreaming = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.serverStreaming = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + inputType: isSet(object.inputType) ? globalThis.String(object.inputType) : "", + outputType: isSet(object.outputType) ? globalThis.String(object.outputType) : "", + options: isSet(object.options) ? MethodOptions.fromJSON(object.options) : undefined, + clientStreaming: isSet(object.clientStreaming) ? globalThis.Boolean(object.clientStreaming) : false, + serverStreaming: isSet(object.serverStreaming) ? globalThis.Boolean(object.serverStreaming) : false, + }; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.inputType !== undefined && message.inputType !== "") { + obj.inputType = message.inputType; + } + if (message.outputType !== undefined && message.outputType !== "") { + obj.outputType = message.outputType; + } + if (message.options !== undefined) { + obj.options = MethodOptions.toJSON(message.options); + } + if (message.clientStreaming !== undefined && message.clientStreaming !== false) { + obj.clientStreaming = message.clientStreaming; + } + if (message.serverStreaming !== undefined && message.serverStreaming !== false) { + obj.serverStreaming = message.serverStreaming; + } + return obj; + }, + + create, I>>(base?: I): MethodDescriptorProto { + return MethodDescriptorProto.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? MethodOptions.fromPartial(object.options) + : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, +}; + +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + deprecated: false, + ccEnableArenas: true, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + features: undefined, + uninterpretedOption: [], + }; +} + +export const FileOptions: MessageFns = { + encode(message: FileOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.javaPackage !== undefined && message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== undefined && message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== undefined && message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== undefined && message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.javaPackage = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.javaOuterClassname = reader.string(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.javaMultipleFiles = reader.bool(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.javaGenerateEqualsAndHash = reader.bool(); + continue; + } + case 27: { + if (tag !== 216) { + break; + } + + message.javaStringCheckUtf8 = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.optimizeFor = reader.int32() as any; + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.goPackage = reader.string(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.ccGenericServices = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.javaGenericServices = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.pyGenericServices = reader.bool(); + continue; + } + case 23: { + if (tag !== 184) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 31: { + if (tag !== 248) { + break; + } + + message.ccEnableArenas = reader.bool(); + continue; + } + case 36: { + if (tag !== 290) { + break; + } + + message.objcClassPrefix = reader.string(); + continue; + } + case 37: { + if (tag !== 298) { + break; + } + + message.csharpNamespace = reader.string(); + continue; + } + case 39: { + if (tag !== 314) { + break; + } + + message.swiftPrefix = reader.string(); + continue; + } + case 40: { + if (tag !== 322) { + break; + } + + message.phpClassPrefix = reader.string(); + continue; + } + case 41: { + if (tag !== 330) { + break; + } + + message.phpNamespace = reader.string(); + continue; + } + case 44: { + if (tag !== 354) { + break; + } + + message.phpMetadataNamespace = reader.string(); + continue; + } + case 45: { + if (tag !== 362) { + break; + } + + message.rubyPackage = reader.string(); + continue; + } + case 50: { + if (tag !== 402) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileOptions { + return { + javaPackage: isSet(object.javaPackage) ? globalThis.String(object.javaPackage) : "", + javaOuterClassname: isSet(object.javaOuterClassname) ? globalThis.String(object.javaOuterClassname) : "", + javaMultipleFiles: isSet(object.javaMultipleFiles) ? globalThis.Boolean(object.javaMultipleFiles) : false, + javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) + ? globalThis.Boolean(object.javaGenerateEqualsAndHash) + : false, + javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? globalThis.Boolean(object.javaStringCheckUtf8) : false, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1, + goPackage: isSet(object.goPackage) ? globalThis.String(object.goPackage) : "", + ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false, + javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false, + pyGenericServices: isSet(object.pyGenericServices) ? globalThis.Boolean(object.pyGenericServices) : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + ccEnableArenas: isSet(object.ccEnableArenas) ? globalThis.Boolean(object.ccEnableArenas) : true, + objcClassPrefix: isSet(object.objcClassPrefix) ? globalThis.String(object.objcClassPrefix) : "", + csharpNamespace: isSet(object.csharpNamespace) ? globalThis.String(object.csharpNamespace) : "", + swiftPrefix: isSet(object.swiftPrefix) ? globalThis.String(object.swiftPrefix) : "", + phpClassPrefix: isSet(object.phpClassPrefix) ? globalThis.String(object.phpClassPrefix) : "", + phpNamespace: isSet(object.phpNamespace) ? globalThis.String(object.phpNamespace) : "", + phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? globalThis.String(object.phpMetadataNamespace) : "", + rubyPackage: isSet(object.rubyPackage) ? globalThis.String(object.rubyPackage) : "", + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + if (message.javaPackage !== undefined && message.javaPackage !== "") { + obj.javaPackage = message.javaPackage; + } + if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { + obj.javaOuterClassname = message.javaOuterClassname; + } + if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { + obj.javaMultipleFiles = message.javaMultipleFiles; + } + if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { + obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + } + if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { + obj.javaStringCheckUtf8 = message.javaStringCheckUtf8; + } + if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { + obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor); + } + if (message.goPackage !== undefined && message.goPackage !== "") { + obj.goPackage = message.goPackage; + } + if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { + obj.ccGenericServices = message.ccGenericServices; + } + if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { + obj.javaGenericServices = message.javaGenericServices; + } + if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { + obj.pyGenericServices = message.pyGenericServices; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { + obj.ccEnableArenas = message.ccEnableArenas; + } + if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { + obj.objcClassPrefix = message.objcClassPrefix; + } + if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { + obj.csharpNamespace = message.csharpNamespace; + } + if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { + obj.swiftPrefix = message.swiftPrefix; + } + if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { + obj.phpClassPrefix = message.phpClassPrefix; + } + if (message.phpNamespace !== undefined && message.phpNamespace !== "") { + obj.phpNamespace = message.phpNamespace; + } + if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { + obj.phpMetadataNamespace = message.phpMetadataNamespace; + } + if (message.rubyPackage !== undefined && message.rubyPackage !== "") { + obj.rubyPackage = message.rubyPackage; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): FileOptions { + return FileOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? true; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [], + }; +} + +export const MessageOptions: MessageFns = { + encode(message: MessageOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry !== undefined && message.mapEntry !== false) { + writer.uint32(56).bool(message.mapEntry); + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(98).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.messageSetWireFormat = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.noStandardDescriptorAccessor = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.mapEntry = reader.bool(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageOptions { + return { + messageSetWireFormat: isSet(object.messageSetWireFormat) + ? globalThis.Boolean(object.messageSetWireFormat) + : false, + noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) + ? globalThis.Boolean(object.noStandardDescriptorAccessor) + : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + mapEntry: isSet(object.mapEntry) ? globalThis.Boolean(object.mapEntry) : false, + deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) + ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) + : false, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { + obj.messageSetWireFormat = message.messageSetWireFormat; + } + if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { + obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.mapEntry !== undefined && message.mapEntry !== false) { + obj.mapEntry = message.mapEntry; + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): MessageOptions { + return MessageOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 0, + targets: [], + editionDefaults: [], + features: undefined, + featureSupport: undefined, + uninterpretedOption: [], + }; +} + +export const FieldOptions: MessageFns = { + encode(message: FieldOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.ctype !== undefined && message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed !== undefined && message.packed !== false) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== undefined && message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy !== undefined && message.lazy !== false) { + writer.uint32(40).bool(message.lazy); + } + if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak !== undefined && message.weak !== false) { + writer.uint32(80).bool(message.weak); + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + writer.uint32(128).bool(message.debugRedact); + } + if (message.retention !== undefined && message.retention !== 0) { + writer.uint32(136).int32(message.retention); + } + for (const v of message.targets) { + writer.uint32(152).int32(v!); + } + for (const v of message.editionDefaults) { + FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).join(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(170).fork()).join(); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.ctype = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.packed = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.jstype = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.lazy = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.unverifiedLazy = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.weak = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.debugRedact = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.retention = reader.int32() as any; + continue; + } + case 19: { + if (tag === 152) { + message.targets.push(reader.int32() as any); + + continue; + } + + if (tag === 154) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.targets.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 20: { + if (tag !== 162) { + break; + } + + message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32())); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 22: { + if (tag !== 178) { + break; + } + + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions { + return { + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false, + unverifiedLazy: isSet(object.unverifiedLazy) ? globalThis.Boolean(object.unverifiedLazy) : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false, + debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, + retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0, + targets: globalThis.Array.isArray(object?.targets) + ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e)) + : [], + editionDefaults: globalThis.Array.isArray(object?.editionDefaults) + ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e)) + : [], + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + featureSupport: isSet(object.featureSupport) + ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport) + : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + if (message.ctype !== undefined && message.ctype !== 0) { + obj.ctype = fieldOptions_CTypeToJSON(message.ctype); + } + if (message.packed !== undefined && message.packed !== false) { + obj.packed = message.packed; + } + if (message.jstype !== undefined && message.jstype !== 0) { + obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); + } + if (message.lazy !== undefined && message.lazy !== false) { + obj.lazy = message.lazy; + } + if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { + obj.unverifiedLazy = message.unverifiedLazy; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.weak !== undefined && message.weak !== false) { + obj.weak = message.weak; + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + obj.debugRedact = message.debugRedact; + } + if (message.retention !== undefined && message.retention !== 0) { + obj.retention = fieldOptions_OptionRetentionToJSON(message.retention); + } + if (message.targets?.length) { + obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e)); + } + if (message.editionDefaults?.length) { + obj.editionDefaults = message.editionDefaults.map((e) => FieldOptions_EditionDefault.toJSON(e)); + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.featureSupport !== undefined) { + obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): FieldOptions { + return FieldOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 0; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 0; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.debugRedact = object.debugRedact ?? false; + message.retention = object.retention ?? 0; + message.targets = object.targets?.map((e) => e) || []; + message.editionDefaults = object.editionDefaults?.map((e) => FieldOptions_EditionDefault.fromPartial(e)) || []; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null) + ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault { + return { edition: 0, value: "" }; +} + +export const FieldOptions_EditionDefault: MessageFns = { + encode(message: FieldOptions_EditionDefault, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.edition !== undefined && message.edition !== 0) { + writer.uint32(24).int32(message.edition); + } + if (message.value !== undefined && message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_EditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_EditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 24) { + break; + } + + message.edition = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions_EditionDefault { + return { + edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: FieldOptions_EditionDefault): unknown { + const obj: any = {}; + if (message.edition !== undefined && message.edition !== 0) { + obj.edition = editionToJSON(message.edition); + } + if (message.value !== undefined && message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): FieldOptions_EditionDefault { + return FieldOptions_EditionDefault.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldOptions_EditionDefault { + const message = createBaseFieldOptions_EditionDefault(); + message.edition = object.edition ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport { + return { editionIntroduced: 0, editionDeprecated: 0, deprecationWarning: "", editionRemoved: 0 }; +} + +export const FieldOptions_FeatureSupport: MessageFns = { + encode(message: FieldOptions_FeatureSupport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { + writer.uint32(8).int32(message.editionIntroduced); + } + if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { + writer.uint32(16).int32(message.editionDeprecated); + } + if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { + writer.uint32(26).string(message.deprecationWarning); + } + if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { + writer.uint32(32).int32(message.editionRemoved); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_FeatureSupport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_FeatureSupport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.editionIntroduced = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.editionDeprecated = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.deprecationWarning = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.editionRemoved = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions_FeatureSupport { + return { + editionIntroduced: isSet(object.editionIntroduced) ? editionFromJSON(object.editionIntroduced) : 0, + editionDeprecated: isSet(object.editionDeprecated) ? editionFromJSON(object.editionDeprecated) : 0, + deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "", + editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : 0, + }; + }, + + toJSON(message: FieldOptions_FeatureSupport): unknown { + const obj: any = {}; + if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { + obj.editionIntroduced = editionToJSON(message.editionIntroduced); + } + if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { + obj.editionDeprecated = editionToJSON(message.editionDeprecated); + } + if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { + obj.deprecationWarning = message.deprecationWarning; + } + if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { + obj.editionRemoved = editionToJSON(message.editionRemoved); + } + return obj; + }, + + create, I>>(base?: I): FieldOptions_FeatureSupport { + return FieldOptions_FeatureSupport.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldOptions_FeatureSupport { + const message = createBaseFieldOptions_FeatureSupport(); + message.editionIntroduced = object.editionIntroduced ?? 0; + message.editionDeprecated = object.editionDeprecated ?? 0; + message.deprecationWarning = object.deprecationWarning ?? ""; + message.editionRemoved = object.editionRemoved ?? 0; + return message; + }, +}; + +function createBaseOneofOptions(): OneofOptions { + return { features: undefined, uninterpretedOption: [] }; +} + +export const OneofOptions: MessageFns = { + encode(message: OneofOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(10).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OneofOptions { + return { + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): OneofOptions { + return OneofOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEnumOptions(): EnumOptions { + return { + allowAlias: false, + deprecated: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [], + }; +} + +export const EnumOptions: MessageFns = { + encode(message: EnumOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.allowAlias !== undefined && message.allowAlias !== false) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(58).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 16) { + break; + } + + message.allowAlias = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumOptions { + return { + allowAlias: isSet(object.allowAlias) ? globalThis.Boolean(object.allowAlias) : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) + ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) + : false, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + if (message.allowAlias !== undefined && message.allowAlias !== false) { + obj.allowAlias = message.allowAlias; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): EnumOptions { + return EnumOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEnumValueOptions(): EnumValueOptions { + return { + deprecated: false, + features: undefined, + debugRedact: false, + featureSupport: undefined, + uninterpretedOption: [], + }; +} + +export const EnumValueOptions: MessageFns = { + encode(message: EnumValueOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(8).bool(message.deprecated); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(18).fork()).join(); + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + writer.uint32(24).bool(message.debugRedact); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(34).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.debugRedact = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + return { + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, + featureSupport: isSet(object.featureSupport) + ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport) + : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + obj.debugRedact = message.debugRedact; + } + if (message.featureSupport !== undefined) { + obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): EnumValueOptions { + return EnumValueOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.debugRedact = object.debugRedact ?? false; + message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null) + ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseServiceOptions(): ServiceOptions { + return { features: undefined, deprecated: false, uninterpretedOption: [] }; +} + +export const ServiceOptions: MessageFns = { + encode(message: ServiceOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(274).fork()).join(); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + if (tag !== 274) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 33: { + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + return { + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): ServiceOptions { + return ServiceOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, features: undefined, uninterpretedOption: [] }; +} + +export const MethodOptions: MessageFns = { + encode(message: MethodOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(282).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 34: { + if (tag !== 272) { + break; + } + + message.idempotencyLevel = reader.int32() as any; + continue; + } + case 35: { + if (tag !== 282) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MethodOptions { + return { + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + idempotencyLevel: isSet(object.idempotencyLevel) + ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) + : 0, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { + obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel); + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): MethodOptions { + return MethodOptions.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 0; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: "0", + negativeIntValue: "0", + doubleValue: 0, + stringValue: new Uint8Array(0), + aggregateValue: "", + }; +} + +export const UninterpretedOption: MessageFns = { + encode(message: UninterpretedOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.identifierValue !== undefined && message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== undefined && message.positiveIntValue !== "0") { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== undefined && message.negativeIntValue !== "0") { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== undefined && message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue !== undefined && message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== undefined && message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.identifierValue = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.positiveIntValue = reader.uint64().toString(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.negativeIntValue = reader.int64().toString(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.doubleValue = reader.double(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.stringValue = reader.bytes(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.aggregateValue = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + return { + name: globalThis.Array.isArray(object?.name) + ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) + : [], + identifierValue: isSet(object.identifierValue) ? globalThis.String(object.identifierValue) : "", + positiveIntValue: isSet(object.positiveIntValue) ? globalThis.String(object.positiveIntValue) : "0", + negativeIntValue: isSet(object.negativeIntValue) ? globalThis.String(object.negativeIntValue) : "0", + doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : 0, + stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(0), + aggregateValue: isSet(object.aggregateValue) ? globalThis.String(object.aggregateValue) : "", + }; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name?.length) { + obj.name = message.name.map((e) => UninterpretedOption_NamePart.toJSON(e)); + } + if (message.identifierValue !== undefined && message.identifierValue !== "") { + obj.identifierValue = message.identifierValue; + } + if (message.positiveIntValue !== undefined && message.positiveIntValue !== "0") { + obj.positiveIntValue = message.positiveIntValue; + } + if (message.negativeIntValue !== undefined && message.negativeIntValue !== "0") { + obj.negativeIntValue = message.negativeIntValue; + } + if (message.doubleValue !== undefined && message.doubleValue !== 0) { + obj.doubleValue = message.doubleValue; + } + if (message.stringValue !== undefined && message.stringValue.length !== 0) { + obj.stringValue = base64FromBytes(message.stringValue); + } + if (message.aggregateValue !== undefined && message.aggregateValue !== "") { + obj.aggregateValue = message.aggregateValue; + } + return obj; + }, + + create, I>>(base?: I): UninterpretedOption { + return UninterpretedOption.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = object.positiveIntValue ?? "0"; + message.negativeIntValue = object.negativeIntValue ?? "0"; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(0); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, +}; + +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} + +export const UninterpretedOption_NamePart: MessageFns = { + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension !== false) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.namePart = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.isExtension = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + return { + namePart: isSet(object.namePart) ? globalThis.String(object.namePart) : "", + isExtension: isSet(object.isExtension) ? globalThis.Boolean(object.isExtension) : false, + }; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + if (message.namePart !== "") { + obj.namePart = message.namePart; + } + if (message.isExtension !== false) { + obj.isExtension = message.isExtension; + } + return obj; + }, + + create, I>>(base?: I): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, +}; + +function createBaseFeatureSet(): FeatureSet { + return { + fieldPresence: 0, + enumType: 0, + repeatedFieldEncoding: 0, + utf8Validation: 0, + messageEncoding: 0, + jsonFormat: 0, + enforceNamingStyle: 0, + defaultSymbolVisibility: 0, + }; +} + +export const FeatureSet: MessageFns = { + encode(message: FeatureSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { + writer.uint32(8).int32(message.fieldPresence); + } + if (message.enumType !== undefined && message.enumType !== 0) { + writer.uint32(16).int32(message.enumType); + } + if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { + writer.uint32(24).int32(message.repeatedFieldEncoding); + } + if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { + writer.uint32(32).int32(message.utf8Validation); + } + if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { + writer.uint32(40).int32(message.messageEncoding); + } + if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { + writer.uint32(48).int32(message.jsonFormat); + } + if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { + writer.uint32(56).int32(message.enforceNamingStyle); + } + if (message.defaultSymbolVisibility !== undefined && message.defaultSymbolVisibility !== 0) { + writer.uint32(64).int32(message.defaultSymbolVisibility); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.fieldPresence = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.enumType = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.repeatedFieldEncoding = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.utf8Validation = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.messageEncoding = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.jsonFormat = reader.int32() as any; + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.enforceNamingStyle = reader.int32() as any; + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.defaultSymbolVisibility = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FeatureSet { + return { + fieldPresence: isSet(object.fieldPresence) ? featureSet_FieldPresenceFromJSON(object.fieldPresence) : 0, + enumType: isSet(object.enumType) ? featureSet_EnumTypeFromJSON(object.enumType) : 0, + repeatedFieldEncoding: isSet(object.repeatedFieldEncoding) + ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding) + : 0, + utf8Validation: isSet(object.utf8Validation) ? featureSet_Utf8ValidationFromJSON(object.utf8Validation) : 0, + messageEncoding: isSet(object.messageEncoding) ? featureSet_MessageEncodingFromJSON(object.messageEncoding) : 0, + jsonFormat: isSet(object.jsonFormat) ? featureSet_JsonFormatFromJSON(object.jsonFormat) : 0, + enforceNamingStyle: isSet(object.enforceNamingStyle) + ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle) + : 0, + defaultSymbolVisibility: isSet(object.defaultSymbolVisibility) + ? featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(object.defaultSymbolVisibility) + : 0, + }; + }, + + toJSON(message: FeatureSet): unknown { + const obj: any = {}; + if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { + obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence); + } + if (message.enumType !== undefined && message.enumType !== 0) { + obj.enumType = featureSet_EnumTypeToJSON(message.enumType); + } + if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { + obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding); + } + if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { + obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation); + } + if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { + obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding); + } + if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { + obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat); + } + if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { + obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle); + } + if (message.defaultSymbolVisibility !== undefined && message.defaultSymbolVisibility !== 0) { + obj.defaultSymbolVisibility = featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON( + message.defaultSymbolVisibility, + ); + } + return obj; + }, + + create, I>>(base?: I): FeatureSet { + return FeatureSet.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FeatureSet { + const message = createBaseFeatureSet(); + message.fieldPresence = object.fieldPresence ?? 0; + message.enumType = object.enumType ?? 0; + message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 0; + message.utf8Validation = object.utf8Validation ?? 0; + message.messageEncoding = object.messageEncoding ?? 0; + message.jsonFormat = object.jsonFormat ?? 0; + message.enforceNamingStyle = object.enforceNamingStyle ?? 0; + message.defaultSymbolVisibility = object.defaultSymbolVisibility ?? 0; + return message; + }, +}; + +function createBaseFeatureSet_VisibilityFeature(): FeatureSet_VisibilityFeature { + return {}; +} + +export const FeatureSet_VisibilityFeature: MessageFns = { + encode(_: FeatureSet_VisibilityFeature, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet_VisibilityFeature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSet_VisibilityFeature(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): FeatureSet_VisibilityFeature { + return {}; + }, + + toJSON(_: FeatureSet_VisibilityFeature): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): FeatureSet_VisibilityFeature { + return FeatureSet_VisibilityFeature.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): FeatureSet_VisibilityFeature { + const message = createBaseFeatureSet_VisibilityFeature(); + return message; + }, +}; + +function createBaseFeatureSetDefaults(): FeatureSetDefaults { + return { defaults: [], minimumEdition: 0, maximumEdition: 0 }; +} + +export const FeatureSetDefaults: MessageFns = { + encode(message: FeatureSetDefaults, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.defaults) { + FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).join(); + } + if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { + writer.uint32(32).int32(message.minimumEdition); + } + if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { + writer.uint32(40).int32(message.maximumEdition); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.minimumEdition = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.maximumEdition = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FeatureSetDefaults { + return { + defaults: globalThis.Array.isArray(object?.defaults) + ? object.defaults.map((e: any) => FeatureSetDefaults_FeatureSetEditionDefault.fromJSON(e)) + : [], + minimumEdition: isSet(object.minimumEdition) ? editionFromJSON(object.minimumEdition) : 0, + maximumEdition: isSet(object.maximumEdition) ? editionFromJSON(object.maximumEdition) : 0, + }; + }, + + toJSON(message: FeatureSetDefaults): unknown { + const obj: any = {}; + if (message.defaults?.length) { + obj.defaults = message.defaults.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.toJSON(e)); + } + if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { + obj.minimumEdition = editionToJSON(message.minimumEdition); + } + if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { + obj.maximumEdition = editionToJSON(message.maximumEdition); + } + return obj; + }, + + create, I>>(base?: I): FeatureSetDefaults { + return FeatureSetDefaults.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FeatureSetDefaults { + const message = createBaseFeatureSetDefaults(); + message.defaults = object.defaults?.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || []; + message.minimumEdition = object.minimumEdition ?? 0; + message.maximumEdition = object.maximumEdition ?? 0; + return message; + }, +}; + +function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault { + return { edition: 0, overridableFeatures: undefined, fixedFeatures: undefined }; +} + +export const FeatureSetDefaults_FeatureSetEditionDefault: MessageFns = { + encode( + message: FeatureSetDefaults_FeatureSetEditionDefault, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.edition !== undefined && message.edition !== 0) { + writer.uint32(24).int32(message.edition); + } + if (message.overridableFeatures !== undefined) { + FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).join(); + } + if (message.fixedFeatures !== undefined) { + FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 24) { + break; + } + + message.edition = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.overridableFeatures = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.fixedFeatures = FeatureSet.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault { + return { + edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, + overridableFeatures: isSet(object.overridableFeatures) + ? FeatureSet.fromJSON(object.overridableFeatures) + : undefined, + fixedFeatures: isSet(object.fixedFeatures) ? FeatureSet.fromJSON(object.fixedFeatures) : undefined, + }; + }, + + toJSON(message: FeatureSetDefaults_FeatureSetEditionDefault): unknown { + const obj: any = {}; + if (message.edition !== undefined && message.edition !== 0) { + obj.edition = editionToJSON(message.edition); + } + if (message.overridableFeatures !== undefined) { + obj.overridableFeatures = FeatureSet.toJSON(message.overridableFeatures); + } + if (message.fixedFeatures !== undefined) { + obj.fixedFeatures = FeatureSet.toJSON(message.fixedFeatures); + } + return obj; + }, + + create, I>>( + base?: I, + ): FeatureSetDefaults_FeatureSetEditionDefault { + return FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): FeatureSetDefaults_FeatureSetEditionDefault { + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + message.edition = object.edition ?? 0; + message.overridableFeatures = (object.overridableFeatures !== undefined && object.overridableFeatures !== null) + ? FeatureSet.fromPartial(object.overridableFeatures) + : undefined; + message.fixedFeatures = (object.fixedFeatures !== undefined && object.fixedFeatures !== null) + ? FeatureSet.fromPartial(object.fixedFeatures) + : undefined; + return message; + }, +}; + +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} + +export const SourceCodeInfo: MessageFns = { + encode(message: SourceCodeInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + return { + location: globalThis.Array.isArray(object?.location) + ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location?.length) { + obj.location = message.location.map((e) => SourceCodeInfo_Location.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): SourceCodeInfo { + return SourceCodeInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} + +export const SourceCodeInfo_Location: MessageFns = { + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.join(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.join(); + if (message.leadingComments !== undefined && message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== undefined && message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + } + case 2: { + if (tag === 16) { + message.span.push(reader.int32()); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + + continue; + } + + break; + } + case 3: { + if (tag !== 26) { + break; + } + + message.leadingComments = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.trailingComments = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.leadingDetachedComments.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + return { + path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.Number(e)) : [], + span: globalThis.Array.isArray(object?.span) ? object.span.map((e: any) => globalThis.Number(e)) : [], + leadingComments: isSet(object.leadingComments) ? globalThis.String(object.leadingComments) : "", + trailingComments: isSet(object.trailingComments) ? globalThis.String(object.trailingComments) : "", + leadingDetachedComments: globalThis.Array.isArray(object?.leadingDetachedComments) + ? object.leadingDetachedComments.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path?.length) { + obj.path = message.path.map((e) => Math.round(e)); + } + if (message.span?.length) { + obj.span = message.span.map((e) => Math.round(e)); + } + if (message.leadingComments !== undefined && message.leadingComments !== "") { + obj.leadingComments = message.leadingComments; + } + if (message.trailingComments !== undefined && message.trailingComments !== "") { + obj.trailingComments = message.trailingComments; + } + if (message.leadingDetachedComments?.length) { + obj.leadingDetachedComments = message.leadingDetachedComments; + } + return obj; + }, + + create, I>>(base?: I): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = object.leadingDetachedComments?.map((e) => e) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} + +export const GeneratedCodeInfo: MessageFns = { + encode(message: GeneratedCodeInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + return { + annotation: globalThis.Array.isArray(object?.annotation) + ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation?.length) { + obj.annotation = message.annotation.map((e) => GeneratedCodeInfo_Annotation.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): GeneratedCodeInfo { + return GeneratedCodeInfo.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; +} + +export const GeneratedCodeInfo_Annotation: MessageFns = { + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.join(); + if (message.sourceFile !== undefined && message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== undefined && message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(32).int32(message.end); + } + if (message.semantic !== undefined && message.semantic !== 0) { + writer.uint32(40).int32(message.semantic); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + } + case 2: { + if (tag !== 18) { + break; + } + + message.sourceFile = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.begin = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.end = reader.int32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.semantic = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + return { + path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.Number(e)) : [], + sourceFile: isSet(object.sourceFile) ? globalThis.String(object.sourceFile) : "", + begin: isSet(object.begin) ? globalThis.Number(object.begin) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0, + }; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path?.length) { + obj.path = message.path.map((e) => Math.round(e)); + } + if (message.sourceFile !== undefined && message.sourceFile !== "") { + obj.sourceFile = message.sourceFile; + } + if (message.begin !== undefined && message.begin !== 0) { + obj.begin = Math.round(message.begin); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + if (message.semantic !== undefined && message.semantic !== 0) { + obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic); + } + return obj; + }, + + create, I>>(base?: I): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + message.semantic = object.semantic ?? 0; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts new file mode 100644 index 00000000..fdc858b2 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: google/protobuf/duration.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: string; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +function createBaseDuration(): Duration { + return { seconds: "0", nanos: 0 }; +} + +export const Duration: MessageFns = { + encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.seconds !== "0") { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.seconds = reader.int64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Duration { + return { + seconds: isSet(object.seconds) ? globalThis.String(object.seconds) : "0", + nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, + }; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + if (message.seconds !== "0") { + obj.seconds = message.seconds; + } + if (message.nanos !== 0) { + obj.nanos = Math.round(message.nanos); + } + return obj; + }, + + create, I>>(base?: I): Duration { + return Duration.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? "0"; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts new file mode 100644 index 00000000..809915fb --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts @@ -0,0 +1,588 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: google/protobuf/struct.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = 0, + UNRECOGNIZED = -1, +} + +export function nullValueFromJSON(object: any): NullValue { + switch (object) { + case 0: + case "NULL_VALUE": + return NullValue.NULL_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return NullValue.UNRECOGNIZED; + } +} + +export function nullValueToJSON(object: NullValue): string { + switch (object) { + case NullValue.NULL_VALUE: + return "NULL_VALUE"; + case NullValue.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { [key: string]: any | undefined }; +} + +export interface Struct_FieldsEntry { + key: string; + value: any | undefined; +} + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + /** Represents a null value. */ + nullValue?: + | NullValue + | undefined; + /** Represents a double value. */ + numberValue?: + | number + | undefined; + /** Represents a string value. */ + stringValue?: + | string + | undefined; + /** Represents a boolean value. */ + boolValue?: + | boolean + | undefined; + /** Represents a structured value. */ + structValue?: + | { [key: string]: any } + | undefined; + /** Represents a repeated `Value`. */ + listValue?: Array | undefined; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: any[]; +} + +function createBaseStruct(): Struct { + return { fields: {} }; +} + +export const Struct: MessageFns & StructWrapperFns = { + encode(message: Struct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.fields).forEach(([key, value]) => { + if (value !== undefined) { + Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Struct { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.fields[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Struct { + return { + fields: isObject(object.fields) + ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Struct): unknown { + const obj: any = {}; + if (message.fields) { + const entries = Object.entries(message.fields); + if (entries.length > 0) { + obj.fields = {}; + entries.forEach(([k, v]) => { + obj.fields[k] = v; + }); + } + } + return obj; + }, + + create, I>>(base?: I): Struct { + return Struct.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Struct { + const message = createBaseStruct(); + message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, + + wrap(object: { [key: string]: any } | undefined): Struct { + const struct = createBaseStruct(); + + if (object !== undefined) { + for (const key of Object.keys(object)) { + struct.fields[key] = object[key]; + } + } + return struct; + }, + + unwrap(message: Struct): { [key: string]: any } { + const object: { [key: string]: any } = {}; + if (message.fields) { + for (const key of Object.keys(message.fields)) { + object[key] = message.fields[key]; + } + } + return object; + }, +}; + +function createBaseStruct_FieldsEntry(): Struct_FieldsEntry { + return { key: "", value: undefined }; +} + +export const Struct_FieldsEntry: MessageFns = { + encode(message: Struct_FieldsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Struct_FieldsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct_FieldsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Struct_FieldsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Struct_FieldsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Struct_FieldsEntry { + return Struct_FieldsEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Struct_FieldsEntry { + const message = createBaseStruct_FieldsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseValue(): Value { + return { + nullValue: undefined, + numberValue: undefined, + stringValue: undefined, + boolValue: undefined, + structValue: undefined, + listValue: undefined, + }; +} + +export const Value: MessageFns & AnyValueWrapperFns = { + encode(message: Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.nullValue !== undefined) { + writer.uint32(8).int32(message.nullValue); + } + if (message.numberValue !== undefined) { + writer.uint32(17).double(message.numberValue); + } + if (message.stringValue !== undefined) { + writer.uint32(26).string(message.stringValue); + } + if (message.boolValue !== undefined) { + writer.uint32(32).bool(message.boolValue); + } + if (message.structValue !== undefined) { + Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join(); + } + if (message.listValue !== undefined) { + ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.nullValue = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.numberValue = reader.double(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.stringValue = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.boolValue = reader.bool(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Value { + return { + nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined, + numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined, + stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined, + boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined, + structValue: isObject(object.structValue) ? object.structValue : undefined, + listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined, + }; + }, + + toJSON(message: Value): unknown { + const obj: any = {}; + if (message.nullValue !== undefined) { + obj.nullValue = nullValueToJSON(message.nullValue); + } + if (message.numberValue !== undefined) { + obj.numberValue = message.numberValue; + } + if (message.stringValue !== undefined) { + obj.stringValue = message.stringValue; + } + if (message.boolValue !== undefined) { + obj.boolValue = message.boolValue; + } + if (message.structValue !== undefined) { + obj.structValue = message.structValue; + } + if (message.listValue !== undefined) { + obj.listValue = message.listValue; + } + return obj; + }, + + create, I>>(base?: I): Value { + return Value.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Value { + const message = createBaseValue(); + message.nullValue = object.nullValue ?? undefined; + message.numberValue = object.numberValue ?? undefined; + message.stringValue = object.stringValue ?? undefined; + message.boolValue = object.boolValue ?? undefined; + message.structValue = object.structValue ?? undefined; + message.listValue = object.listValue ?? undefined; + return message; + }, + + wrap(value: any): Value { + const result = createBaseValue(); + if (value === null) { + result.nullValue = NullValue.NULL_VALUE; + } else if (typeof value === "boolean") { + result.boolValue = value; + } else if (typeof value === "number") { + result.numberValue = value; + } else if (typeof value === "string") { + result.stringValue = value; + } else if (globalThis.Array.isArray(value)) { + result.listValue = value; + } else if (typeof value === "object") { + result.structValue = value; + } else if (typeof value !== "undefined") { + throw new globalThis.Error("Unsupported any value type: " + typeof value); + } + return result; + }, + + unwrap(message: any): string | number | boolean | Object | null | Array | undefined { + if (message.stringValue !== undefined) { + return message.stringValue; + } else if (message?.numberValue !== undefined) { + return message.numberValue; + } else if (message?.boolValue !== undefined) { + return message.boolValue; + } else if (message?.structValue !== undefined) { + return message.structValue as any; + } else if (message?.listValue !== undefined) { + return message.listValue; + } else if (message?.nullValue !== undefined) { + return null; + } + return undefined; + }, +}; + +function createBaseListValue(): ListValue { + return { values: [] }; +} + +export const ListValue: MessageFns & ListValueWrapperFns = { + encode(message: ListValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.values) { + Value.encode(Value.wrap(v!), writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListValue { + return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] }; + }, + + toJSON(message: ListValue): unknown { + const obj: any = {}; + if (message.values?.length) { + obj.values = message.values; + } + return obj; + }, + + create, I>>(base?: I): ListValue { + return ListValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ListValue { + const message = createBaseListValue(); + message.values = object.values?.map((e) => e) || []; + return message; + }, + + wrap(array: Array | undefined): ListValue { + const result = createBaseListValue(); + result.values = array ?? []; + return result; + }, + + unwrap(message: ListValue): Array { + if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) { + return message.values; + } else { + return message as any; + } + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} + +export interface StructWrapperFns { + wrap(object: { [key: string]: any } | undefined): Struct; + unwrap(message: Struct): { [key: string]: any }; +} + +export interface AnyValueWrapperFns { + wrap(value: any): Value; + unwrap(message: any): string | number | boolean | Object | null | Array | undefined; +} + +export interface ListValueWrapperFns { + wrap(array: Array | undefined): ListValue; + unwrap(message: ListValue): Array; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts new file mode 100644 index 00000000..794218a2 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts @@ -0,0 +1,219 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: google/protobuf/timestamp.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + * be between -62135596800 and 253402300799 inclusive (which corresponds to + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). + */ + seconds: string; + /** + * Non-negative fractions of a second at nanosecond resolution. This field is + * the nanosecond portion of the duration, not an alternative to seconds. + * Negative second values with fractions must still have non-negative nanos + * values that count forward in time. Must be between 0 and 999,999,999 + * inclusive. + */ + nanos: number; +} + +function createBaseTimestamp(): Timestamp { + return { seconds: "0", nanos: 0 }; +} + +export const Timestamp: MessageFns = { + encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.seconds !== "0") { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.seconds = reader.int64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Timestamp { + return { + seconds: isSet(object.seconds) ? globalThis.String(object.seconds) : "0", + nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + if (message.seconds !== "0") { + obj.seconds = message.seconds; + } + if (message.nanos !== 0) { + obj.nanos = Math.round(message.nanos); + } + return obj; + }, + + create, I>>(base?: I): Timestamp { + return Timestamp.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? "0"; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts new file mode 100644 index 00000000..9b675c63 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts @@ -0,0 +1,699 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: google/protobuf/wrappers.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface DoubleValue { + /** The double value. */ + value: number; +} + +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface FloatValue { + /** The float value. */ + value: number; +} + +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface Int64Value { + /** The int64 value. */ + value: string; +} + +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface UInt64Value { + /** The uint64 value. */ + value: string; +} + +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface Int32Value { + /** The int32 value. */ + value: number; +} + +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface UInt32Value { + /** The uint32 value. */ + value: number; +} + +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface BoolValue { + /** The bool value. */ + value: boolean; +} + +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface StringValue { + /** The string value. */ + value: string; +} + +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + */ +export interface BytesValue { + /** The bytes value. */ + value: Uint8Array; +} + +function createBaseDoubleValue(): DoubleValue { + return { value: 0 }; +} + +export const DoubleValue: MessageFns = { + encode(message: DoubleValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(9).double(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DoubleValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.value = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DoubleValue { + return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; + }, + + toJSON(message: DoubleValue): unknown { + const obj: any = {}; + if (message.value !== 0) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): DoubleValue { + return DoubleValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DoubleValue { + const message = createBaseDoubleValue(); + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseFloatValue(): FloatValue { + return { value: 0 }; +} + +export const FloatValue: MessageFns = { + encode(message: FloatValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(13).float(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FloatValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFloatValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.value = reader.float(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FloatValue { + return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; + }, + + toJSON(message: FloatValue): unknown { + const obj: any = {}; + if (message.value !== 0) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): FloatValue { + return FloatValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FloatValue { + const message = createBaseFloatValue(); + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseInt64Value(): Int64Value { + return { value: "0" }; +} + +export const Int64Value: MessageFns = { + encode(message: Int64Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== "0") { + writer.uint32(8).int64(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Int64Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt64Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.value = reader.int64().toString(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Int64Value { + return { value: isSet(object.value) ? globalThis.String(object.value) : "0" }; + }, + + toJSON(message: Int64Value): unknown { + const obj: any = {}; + if (message.value !== "0") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Int64Value { + return Int64Value.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Int64Value { + const message = createBaseInt64Value(); + message.value = object.value ?? "0"; + return message; + }, +}; + +function createBaseUInt64Value(): UInt64Value { + return { value: "0" }; +} + +export const UInt64Value: MessageFns = { + encode(message: UInt64Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== "0") { + writer.uint32(8).uint64(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UInt64Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt64Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.value = reader.uint64().toString(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UInt64Value { + return { value: isSet(object.value) ? globalThis.String(object.value) : "0" }; + }, + + toJSON(message: UInt64Value): unknown { + const obj: any = {}; + if (message.value !== "0") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): UInt64Value { + return UInt64Value.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UInt64Value { + const message = createBaseUInt64Value(); + message.value = object.value ?? "0"; + return message; + }, +}; + +function createBaseInt32Value(): Int32Value { + return { value: 0 }; +} + +export const Int32Value: MessageFns = { + encode(message: Int32Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Int32Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt32Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.value = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Int32Value { + return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; + }, + + toJSON(message: Int32Value): unknown { + const obj: any = {}; + if (message.value !== 0) { + obj.value = Math.round(message.value); + } + return obj; + }, + + create, I>>(base?: I): Int32Value { + return Int32Value.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Int32Value { + const message = createBaseInt32Value(); + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseUInt32Value(): UInt32Value { + return { value: 0 }; +} + +export const UInt32Value: MessageFns = { + encode(message: UInt32Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).uint32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UInt32Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt32Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.value = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UInt32Value { + return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; + }, + + toJSON(message: UInt32Value): unknown { + const obj: any = {}; + if (message.value !== 0) { + obj.value = Math.round(message.value); + } + return obj; + }, + + create, I>>(base?: I): UInt32Value { + return UInt32Value.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UInt32Value { + const message = createBaseUInt32Value(); + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseBoolValue(): BoolValue { + return { value: false }; +} + +export const BoolValue: MessageFns = { + encode(message: BoolValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== false) { + writer.uint32(8).bool(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BoolValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoolValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.value = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BoolValue { + return { value: isSet(object.value) ? globalThis.Boolean(object.value) : false }; + }, + + toJSON(message: BoolValue): unknown { + const obj: any = {}; + if (message.value !== false) { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): BoolValue { + return BoolValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BoolValue { + const message = createBaseBoolValue(); + message.value = object.value ?? false; + return message; + }, +}; + +function createBaseStringValue(): StringValue { + return { value: "" }; +} + +export const StringValue: MessageFns = { + encode(message: StringValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== "") { + writer.uint32(10).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StringValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StringValue { + return { value: isSet(object.value) ? globalThis.String(object.value) : "" }; + }, + + toJSON(message: StringValue): unknown { + const obj: any = {}; + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): StringValue { + return StringValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): StringValue { + const message = createBaseStringValue(); + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseBytesValue(): BytesValue { + return { value: new Uint8Array(0) }; +} + +export const BytesValue: MessageFns = { + encode(message: BytesValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value.length !== 0) { + writer.uint32(10).bytes(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BytesValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBytesValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.value = reader.bytes(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BytesValue { + return { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0) }; + }, + + toJSON(message: BytesValue): unknown { + const obj: any = {}; + if (message.value.length !== 0) { + obj.value = base64FromBytes(message.value); + } + return obj; + }, + + create, I>>(base?: I): BytesValue { + return BytesValue.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BytesValue { + const message = createBaseBytesValue(); + message.value = object.value ?? new Uint8Array(0); + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts new file mode 100644 index 00000000..78d3956f --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts @@ -0,0 +1,251 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: udpa/annotations/migrate.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "udpa.annotations"; + +export interface MigrateAnnotation { + /** Rename the message/enum/enum value in next version. */ + rename: string; +} + +export interface FieldMigrateAnnotation { + /** Rename the field in next version. */ + rename: string; + /** + * Add the field to a named oneof in next version. If this already exists, the + * field will join its siblings under the oneof, otherwise a new oneof will be + * created with the given name. + */ + oneofPromotion: string; +} + +export interface FileMigrateAnnotation { + /** + * Move all types in the file to another package, this implies changing proto + * file path. + */ + moveToPackage: string; +} + +function createBaseMigrateAnnotation(): MigrateAnnotation { + return { rename: "" }; +} + +export const MigrateAnnotation: MessageFns = { + encode(message: MigrateAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.rename !== "") { + writer.uint32(10).string(message.rename); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MigrateAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.rename = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MigrateAnnotation { + return { rename: isSet(object.rename) ? globalThis.String(object.rename) : "" }; + }, + + toJSON(message: MigrateAnnotation): unknown { + const obj: any = {}; + if (message.rename !== "") { + obj.rename = message.rename; + } + return obj; + }, + + create, I>>(base?: I): MigrateAnnotation { + return MigrateAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MigrateAnnotation { + const message = createBaseMigrateAnnotation(); + message.rename = object.rename ?? ""; + return message; + }, +}; + +function createBaseFieldMigrateAnnotation(): FieldMigrateAnnotation { + return { rename: "", oneofPromotion: "" }; +} + +export const FieldMigrateAnnotation: MessageFns = { + encode(message: FieldMigrateAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.rename !== "") { + writer.uint32(10).string(message.rename); + } + if (message.oneofPromotion !== "") { + writer.uint32(18).string(message.oneofPromotion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldMigrateAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldMigrateAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.rename = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.oneofPromotion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldMigrateAnnotation { + return { + rename: isSet(object.rename) ? globalThis.String(object.rename) : "", + oneofPromotion: isSet(object.oneofPromotion) ? globalThis.String(object.oneofPromotion) : "", + }; + }, + + toJSON(message: FieldMigrateAnnotation): unknown { + const obj: any = {}; + if (message.rename !== "") { + obj.rename = message.rename; + } + if (message.oneofPromotion !== "") { + obj.oneofPromotion = message.oneofPromotion; + } + return obj; + }, + + create, I>>(base?: I): FieldMigrateAnnotation { + return FieldMigrateAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldMigrateAnnotation { + const message = createBaseFieldMigrateAnnotation(); + message.rename = object.rename ?? ""; + message.oneofPromotion = object.oneofPromotion ?? ""; + return message; + }, +}; + +function createBaseFileMigrateAnnotation(): FileMigrateAnnotation { + return { moveToPackage: "" }; +} + +export const FileMigrateAnnotation: MessageFns = { + encode(message: FileMigrateAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.moveToPackage !== "") { + writer.uint32(18).string(message.moveToPackage); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileMigrateAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileMigrateAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + message.moveToPackage = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileMigrateAnnotation { + return { moveToPackage: isSet(object.moveToPackage) ? globalThis.String(object.moveToPackage) : "" }; + }, + + toJSON(message: FileMigrateAnnotation): unknown { + const obj: any = {}; + if (message.moveToPackage !== "") { + obj.moveToPackage = message.moveToPackage; + } + return obj; + }, + + create, I>>(base?: I): FileMigrateAnnotation { + return FileMigrateAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FileMigrateAnnotation { + const message = createBaseFileMigrateAnnotation(); + message.moveToPackage = object.moveToPackage ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts new file mode 100644 index 00000000..0a273b51 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: udpa/annotations/status.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "udpa.annotations"; + +export enum PackageVersionStatus { + /** UNKNOWN - Unknown package version status. */ + UNKNOWN = 0, + /** FROZEN - This version of the package is frozen. */ + FROZEN = 1, + /** ACTIVE - This version of the package is the active development version. */ + ACTIVE = 2, + /** + * NEXT_MAJOR_VERSION_CANDIDATE - This version of the package is the candidate for the next major version. It + * is typically machine generated from the active development version. + */ + NEXT_MAJOR_VERSION_CANDIDATE = 3, + UNRECOGNIZED = -1, +} + +export function packageVersionStatusFromJSON(object: any): PackageVersionStatus { + switch (object) { + case 0: + case "UNKNOWN": + return PackageVersionStatus.UNKNOWN; + case 1: + case "FROZEN": + return PackageVersionStatus.FROZEN; + case 2: + case "ACTIVE": + return PackageVersionStatus.ACTIVE; + case 3: + case "NEXT_MAJOR_VERSION_CANDIDATE": + return PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE; + case -1: + case "UNRECOGNIZED": + default: + return PackageVersionStatus.UNRECOGNIZED; + } +} + +export function packageVersionStatusToJSON(object: PackageVersionStatus): string { + switch (object) { + case PackageVersionStatus.UNKNOWN: + return "UNKNOWN"; + case PackageVersionStatus.FROZEN: + return "FROZEN"; + case PackageVersionStatus.ACTIVE: + return "ACTIVE"; + case PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE: + return "NEXT_MAJOR_VERSION_CANDIDATE"; + case PackageVersionStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface StatusAnnotation { + /** The entity is work-in-progress and subject to breaking changes. */ + workInProgress: boolean; + /** The entity belongs to a package with the given version status. */ + packageVersionStatus: PackageVersionStatus; +} + +function createBaseStatusAnnotation(): StatusAnnotation { + return { workInProgress: false, packageVersionStatus: 0 }; +} + +export const StatusAnnotation: MessageFns = { + encode(message: StatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.workInProgress !== false) { + writer.uint32(8).bool(message.workInProgress); + } + if (message.packageVersionStatus !== 0) { + writer.uint32(16).int32(message.packageVersionStatus); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StatusAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.workInProgress = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.packageVersionStatus = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StatusAnnotation { + return { + workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false, + packageVersionStatus: isSet(object.packageVersionStatus) + ? packageVersionStatusFromJSON(object.packageVersionStatus) + : 0, + }; + }, + + toJSON(message: StatusAnnotation): unknown { + const obj: any = {}; + if (message.workInProgress !== false) { + obj.workInProgress = message.workInProgress; + } + if (message.packageVersionStatus !== 0) { + obj.packageVersionStatus = packageVersionStatusToJSON(message.packageVersionStatus); + } + return obj; + }, + + create, I>>(base?: I): StatusAnnotation { + return StatusAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): StatusAnnotation { + const message = createBaseStatusAnnotation(); + message.workInProgress = object.workInProgress ?? false; + message.packageVersionStatus = object.packageVersionStatus ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts new file mode 100644 index 00000000..1b057c72 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts @@ -0,0 +1,104 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: udpa/annotations/versioning.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "udpa.annotations"; + +export interface VersioningAnnotation { + /** + * Track the previous message type. E.g. this message might be + * udpa.foo.v3alpha.Foo and it was previously udpa.bar.v2.Bar. This + * information is consumed by UDPA via proto descriptors. + */ + previousMessageType: string; +} + +function createBaseVersioningAnnotation(): VersioningAnnotation { + return { previousMessageType: "" }; +} + +export const VersioningAnnotation: MessageFns = { + encode(message: VersioningAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.previousMessageType !== "") { + writer.uint32(10).string(message.previousMessageType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): VersioningAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersioningAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.previousMessageType = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): VersioningAnnotation { + return { + previousMessageType: isSet(object.previousMessageType) ? globalThis.String(object.previousMessageType) : "", + }; + }, + + toJSON(message: VersioningAnnotation): unknown { + const obj: any = {}; + if (message.previousMessageType !== "") { + obj.previousMessageType = message.previousMessageType; + } + return obj; + }, + + create, I>>(base?: I): VersioningAnnotation { + return VersioningAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): VersioningAnnotation { + const message = createBaseVersioningAnnotation(); + message.previousMessageType = object.previousMessageType ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts b/packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts new file mode 100644 index 00000000..64d91d9e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts @@ -0,0 +1,5869 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: validate/validate.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Duration } from "../google/protobuf/duration.js"; +import { Timestamp } from "../google/protobuf/timestamp.js"; + +export const protobufPackage = "validate"; + +/** WellKnownRegex contain some well-known patterns. */ +export enum KnownRegex { + UNKNOWN = 0, + /** HTTP_HEADER_NAME - HTTP header name as defined by RFC 7230. */ + HTTP_HEADER_NAME = 1, + /** HTTP_HEADER_VALUE - HTTP header value as defined by RFC 7230. */ + HTTP_HEADER_VALUE = 2, + UNRECOGNIZED = -1, +} + +export function knownRegexFromJSON(object: any): KnownRegex { + switch (object) { + case 0: + case "UNKNOWN": + return KnownRegex.UNKNOWN; + case 1: + case "HTTP_HEADER_NAME": + return KnownRegex.HTTP_HEADER_NAME; + case 2: + case "HTTP_HEADER_VALUE": + return KnownRegex.HTTP_HEADER_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return KnownRegex.UNRECOGNIZED; + } +} + +export function knownRegexToJSON(object: KnownRegex): string { + switch (object) { + case KnownRegex.UNKNOWN: + return "UNKNOWN"; + case KnownRegex.HTTP_HEADER_NAME: + return "HTTP_HEADER_NAME"; + case KnownRegex.HTTP_HEADER_VALUE: + return "HTTP_HEADER_VALUE"; + case KnownRegex.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * FieldRules encapsulates the rules for each type of field. Depending on the + * field, the correct set should be used to ensure proper validations. + */ +export interface FieldRules { + message?: + | MessageRules + | undefined; + /** Scalar Field Types */ + float?: FloatRules | undefined; + double?: DoubleRules | undefined; + int32?: Int32Rules | undefined; + int64?: Int64Rules | undefined; + uint32?: UInt32Rules | undefined; + uint64?: UInt64Rules | undefined; + sint32?: SInt32Rules | undefined; + sint64?: SInt64Rules | undefined; + fixed32?: Fixed32Rules | undefined; + fixed64?: Fixed64Rules | undefined; + sfixed32?: SFixed32Rules | undefined; + sfixed64?: SFixed64Rules | undefined; + bool?: BoolRules | undefined; + string?: StringRules | undefined; + bytes?: + | BytesRules + | undefined; + /** Complex Field Types */ + enum?: EnumRules | undefined; + repeated?: RepeatedRules | undefined; + map?: + | MapRules + | undefined; + /** Well-Known Field Types */ + any?: AnyRules | undefined; + duration?: DurationRules | undefined; + timestamp?: TimestampRules | undefined; +} + +/** FloatRules describes the constraints applied to `float` values */ +export interface FloatRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** DoubleRules describes the constraints applied to `double` values */ +export interface DoubleRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Int32Rules describes the constraints applied to `int32` values */ +export interface Int32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Int64Rules describes the constraints applied to `int64` values */ +export interface Int64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | string + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | string + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | string + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** UInt32Rules describes the constraints applied to `uint32` values */ +export interface UInt32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** UInt64Rules describes the constraints applied to `uint64` values */ +export interface UInt64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | string + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | string + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | string + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SInt32Rules describes the constraints applied to `sint32` values */ +export interface SInt32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SInt64Rules describes the constraints applied to `sint64` values */ +export interface SInt64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | string + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | string + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | string + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Fixed32Rules describes the constraints applied to `fixed32` values */ +export interface Fixed32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Fixed64Rules describes the constraints applied to `fixed64` values */ +export interface Fixed64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | string + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | string + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | string + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SFixed32Rules describes the constraints applied to `sfixed32` values */ +export interface SFixed32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SFixed64Rules describes the constraints applied to `sfixed64` values */ +export interface SFixed64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | string + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | string + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | string + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** BoolRules describes the constraints applied to `bool` values */ +export interface BoolRules { + /** Const specifies that this field must be exactly the specified value */ + const?: boolean | undefined; +} + +/** StringRules describe the constraints applied to `string` values */ +export interface StringRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Len specifies that this field must be the specified number of + * characters (Unicode code points). Note that the number of + * characters may differ from the number of bytes in the string. + */ + len?: + | string + | undefined; + /** + * MinLen specifies that this field must be the specified number of + * characters (Unicode code points) at a minimum. Note that the number of + * characters may differ from the number of bytes in the string. + */ + minLen?: + | string + | undefined; + /** + * MaxLen specifies that this field must be the specified number of + * characters (Unicode code points) at a maximum. Note that the number of + * characters may differ from the number of bytes in the string. + */ + maxLen?: + | string + | undefined; + /** LenBytes specifies that this field must be the specified number of bytes */ + lenBytes?: + | string + | undefined; + /** + * MinBytes specifies that this field must be the specified number of bytes + * at a minimum + */ + minBytes?: + | string + | undefined; + /** + * MaxBytes specifies that this field must be the specified number of bytes + * at a maximum + */ + maxBytes?: + | string + | undefined; + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + */ + pattern?: + | string + | undefined; + /** + * Prefix specifies that this field must have the specified substring at + * the beginning of the string. + */ + prefix?: + | string + | undefined; + /** + * Suffix specifies that this field must have the specified substring at + * the end of the string. + */ + suffix?: + | string + | undefined; + /** + * Contains specifies that this field must have the specified substring + * anywhere in the string. + */ + contains?: + | string + | undefined; + /** + * NotContains specifies that this field cannot have the specified substring + * anywhere in the string. + */ + notContains?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * Email specifies that the field must be a valid email address as + * defined by RFC 5322 + */ + email?: + | boolean + | undefined; + /** + * Hostname specifies that the field must be a valid hostname as + * defined by RFC 1034. This constraint does not support + * internationalized domain names (IDNs). + */ + hostname?: + | boolean + | undefined; + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address. + * Valid IPv6 addresses should not include surrounding square brackets. + */ + ip?: + | boolean + | undefined; + /** Ipv4 specifies that the field must be a valid IPv4 address. */ + ipv4?: + | boolean + | undefined; + /** + * Ipv6 specifies that the field must be a valid IPv6 address. Valid + * IPv6 addresses should not include surrounding square brackets. + */ + ipv6?: + | boolean + | undefined; + /** + * Uri specifies that the field must be a valid, absolute URI as defined + * by RFC 3986 + */ + uri?: + | boolean + | undefined; + /** + * UriRef specifies that the field must be a valid URI as defined by RFC + * 3986 and may be relative or absolute. + */ + uriRef?: + | boolean + | undefined; + /** + * Address specifies that the field must be either a valid hostname as + * defined by RFC 1034 (which does not support internationalized domain + * names or IDNs), or it can be a valid IP (v4 or v6). + */ + address?: + | boolean + | undefined; + /** + * Uuid specifies that the field must be a valid UUID as defined by + * RFC 4122 + */ + uuid?: + | boolean + | undefined; + /** WellKnownRegex specifies a common well known pattern defined as a regex. */ + wellKnownRegex?: + | KnownRegex + | undefined; + /** + * This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable + * strict header validation. + * By default, this is true, and HTTP header validations are RFC-compliant. + * Setting to false will enable a looser validations that only disallows + * \r\n\0 characters, which can be used to bypass header matching rules. + */ + strict?: + | boolean + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** BytesRules describe the constraints applied to `bytes` values */ +export interface BytesRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Uint8Array + | undefined; + /** Len specifies that this field must be the specified number of bytes */ + len?: + | string + | undefined; + /** + * MinLen specifies that this field must be the specified number of bytes + * at a minimum + */ + minLen?: + | string + | undefined; + /** + * MaxLen specifies that this field must be the specified number of bytes + * at a maximum + */ + maxLen?: + | string + | undefined; + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + */ + pattern?: + | string + | undefined; + /** + * Prefix specifies that this field must have the specified bytes at the + * beginning of the string. + */ + prefix?: + | Uint8Array + | undefined; + /** + * Suffix specifies that this field must have the specified bytes at the + * end of the string. + */ + suffix?: + | Uint8Array + | undefined; + /** + * Contains specifies that this field must have the specified bytes + * anywhere in the string. + */ + contains?: + | Uint8Array + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Uint8Array[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Uint8Array[]; + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address in + * byte format + */ + ip?: + | boolean + | undefined; + /** + * Ipv4 specifies that the field must be a valid IPv4 address in byte + * format + */ + ipv4?: + | boolean + | undefined; + /** + * Ipv6 specifies that the field must be a valid IPv6 address in byte + * format + */ + ipv6?: + | boolean + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** EnumRules describe the constraints applied to enum values */ +export interface EnumRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * DefinedOnly specifies that this field must be only one of the defined + * values for this enum, failing on any undefined value. + */ + definedOnly?: + | boolean + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; +} + +/** + * MessageRules describe the constraints applied to embedded message values. + * For message-type fields, validation is performed recursively. + */ +export interface MessageRules { + /** + * Skip specifies that the validation rules of this field should not be + * evaluated + */ + skip?: + | boolean + | undefined; + /** Required specifies that this field must be set */ + required?: boolean | undefined; +} + +/** RepeatedRules describe the constraints applied to `repeated` values */ +export interface RepeatedRules { + /** + * MinItems specifies that this field must have the specified number of + * items at a minimum + */ + minItems?: + | string + | undefined; + /** + * MaxItems specifies that this field must have the specified number of + * items at a maximum + */ + maxItems?: + | string + | undefined; + /** + * Unique specifies that all elements in this field must be unique. This + * constraint is only applicable to scalar and enum types (messages are not + * supported). + */ + unique?: + | boolean + | undefined; + /** + * Items specifies the constraints to be applied to each item in the field. + * Repeated message fields will still execute validation against each item + * unless skip is specified here. + */ + items?: + | FieldRules + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** MapRules describe the constraints applied to `map` values */ +export interface MapRules { + /** + * MinPairs specifies that this field must have the specified number of + * KVs at a minimum + */ + minPairs?: + | string + | undefined; + /** + * MaxPairs specifies that this field must have the specified number of + * KVs at a maximum + */ + maxPairs?: + | string + | undefined; + /** + * NoSparse specifies values in this field cannot be unset. This only + * applies to map's with message value types. + */ + noSparse?: + | boolean + | undefined; + /** Keys specifies the constraints to be applied to each key in the field. */ + keys?: + | FieldRules + | undefined; + /** + * Values specifies the constraints to be applied to the value of each key + * in the field. Message values will still have their validations evaluated + * unless skip is specified here. + */ + values?: + | FieldRules + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** + * AnyRules describe constraints applied exclusively to the + * `google.protobuf.Any` well-known type + */ +export interface AnyRules { + /** Required specifies that this field must be set */ + required?: + | boolean + | undefined; + /** + * In specifies that this field's `type_url` must be equal to one of the + * specified values. + */ + in: string[]; + /** + * NotIn specifies that this field's `type_url` must not be equal to any of + * the specified values. + */ + notIn: string[]; +} + +/** + * DurationRules describe the constraints applied exclusively to the + * `google.protobuf.Duration` well-known type + */ +export interface DurationRules { + /** Required specifies that this field must be set */ + required?: + | boolean + | undefined; + /** Const specifies that this field must be exactly the specified value */ + const?: + | Duration + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Duration + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * inclusive + */ + lte?: + | Duration + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + */ + gt?: + | Duration + | undefined; + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + */ + gte?: + | Duration + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Duration[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Duration[]; +} + +/** + * TimestampRules describe the constraints applied exclusively to the + * `google.protobuf.Timestamp` well-known type + */ +export interface TimestampRules { + /** Required specifies that this field must be set */ + required?: + | boolean + | undefined; + /** Const specifies that this field must be exactly the specified value */ + const?: + | Date + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Date + | undefined; + /** + * Lte specifies that this field must be less than the specified value, + * inclusive + */ + lte?: + | Date + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + */ + gt?: + | Date + | undefined; + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + */ + gte?: + | Date + | undefined; + /** + * LtNow specifies that this must be less than the current time. LtNow + * can only be used with the Within rule. + */ + ltNow?: + | boolean + | undefined; + /** + * GtNow specifies that this must be greater than the current time. GtNow + * can only be used with the Within rule. + */ + gtNow?: + | boolean + | undefined; + /** + * Within specifies that this field must be within this duration of the + * current time. This constraint can be used alone or with the LtNow and + * GtNow rules. + */ + within?: Duration | undefined; +} + +function createBaseFieldRules(): FieldRules { + return { + message: undefined, + float: undefined, + double: undefined, + int32: undefined, + int64: undefined, + uint32: undefined, + uint64: undefined, + sint32: undefined, + sint64: undefined, + fixed32: undefined, + fixed64: undefined, + sfixed32: undefined, + sfixed64: undefined, + bool: undefined, + string: undefined, + bytes: undefined, + enum: undefined, + repeated: undefined, + map: undefined, + any: undefined, + duration: undefined, + timestamp: undefined, + }; +} + +export const FieldRules: MessageFns = { + encode(message: FieldRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.message !== undefined) { + MessageRules.encode(message.message, writer.uint32(138).fork()).join(); + } + if (message.float !== undefined) { + FloatRules.encode(message.float, writer.uint32(10).fork()).join(); + } + if (message.double !== undefined) { + DoubleRules.encode(message.double, writer.uint32(18).fork()).join(); + } + if (message.int32 !== undefined) { + Int32Rules.encode(message.int32, writer.uint32(26).fork()).join(); + } + if (message.int64 !== undefined) { + Int64Rules.encode(message.int64, writer.uint32(34).fork()).join(); + } + if (message.uint32 !== undefined) { + UInt32Rules.encode(message.uint32, writer.uint32(42).fork()).join(); + } + if (message.uint64 !== undefined) { + UInt64Rules.encode(message.uint64, writer.uint32(50).fork()).join(); + } + if (message.sint32 !== undefined) { + SInt32Rules.encode(message.sint32, writer.uint32(58).fork()).join(); + } + if (message.sint64 !== undefined) { + SInt64Rules.encode(message.sint64, writer.uint32(66).fork()).join(); + } + if (message.fixed32 !== undefined) { + Fixed32Rules.encode(message.fixed32, writer.uint32(74).fork()).join(); + } + if (message.fixed64 !== undefined) { + Fixed64Rules.encode(message.fixed64, writer.uint32(82).fork()).join(); + } + if (message.sfixed32 !== undefined) { + SFixed32Rules.encode(message.sfixed32, writer.uint32(90).fork()).join(); + } + if (message.sfixed64 !== undefined) { + SFixed64Rules.encode(message.sfixed64, writer.uint32(98).fork()).join(); + } + if (message.bool !== undefined) { + BoolRules.encode(message.bool, writer.uint32(106).fork()).join(); + } + if (message.string !== undefined) { + StringRules.encode(message.string, writer.uint32(114).fork()).join(); + } + if (message.bytes !== undefined) { + BytesRules.encode(message.bytes, writer.uint32(122).fork()).join(); + } + if (message.enum !== undefined) { + EnumRules.encode(message.enum, writer.uint32(130).fork()).join(); + } + if (message.repeated !== undefined) { + RepeatedRules.encode(message.repeated, writer.uint32(146).fork()).join(); + } + if (message.map !== undefined) { + MapRules.encode(message.map, writer.uint32(154).fork()).join(); + } + if (message.any !== undefined) { + AnyRules.encode(message.any, writer.uint32(162).fork()).join(); + } + if (message.duration !== undefined) { + DurationRules.encode(message.duration, writer.uint32(170).fork()).join(); + } + if (message.timestamp !== undefined) { + TimestampRules.encode(message.timestamp, writer.uint32(178).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 17: { + if (tag !== 138) { + break; + } + + message.message = MessageRules.decode(reader, reader.uint32()); + continue; + } + case 1: { + if (tag !== 10) { + break; + } + + message.float = FloatRules.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.double = DoubleRules.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.int32 = Int32Rules.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.int64 = Int64Rules.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.uint32 = UInt32Rules.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.uint64 = UInt64Rules.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.sint32 = SInt32Rules.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.sint64 = SInt64Rules.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.fixed32 = Fixed32Rules.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.fixed64 = Fixed64Rules.decode(reader, reader.uint32()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.sfixed32 = SFixed32Rules.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.sfixed64 = SFixed64Rules.decode(reader, reader.uint32()); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.bool = BoolRules.decode(reader, reader.uint32()); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.string = StringRules.decode(reader, reader.uint32()); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.bytes = BytesRules.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.enum = EnumRules.decode(reader, reader.uint32()); + continue; + } + case 18: { + if (tag !== 146) { + break; + } + + message.repeated = RepeatedRules.decode(reader, reader.uint32()); + continue; + } + case 19: { + if (tag !== 154) { + break; + } + + message.map = MapRules.decode(reader, reader.uint32()); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.any = AnyRules.decode(reader, reader.uint32()); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.duration = DurationRules.decode(reader, reader.uint32()); + continue; + } + case 22: { + if (tag !== 178) { + break; + } + + message.timestamp = TimestampRules.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldRules { + return { + message: isSet(object.message) ? MessageRules.fromJSON(object.message) : undefined, + float: isSet(object.float) ? FloatRules.fromJSON(object.float) : undefined, + double: isSet(object.double) ? DoubleRules.fromJSON(object.double) : undefined, + int32: isSet(object.int32) ? Int32Rules.fromJSON(object.int32) : undefined, + int64: isSet(object.int64) ? Int64Rules.fromJSON(object.int64) : undefined, + uint32: isSet(object.uint32) ? UInt32Rules.fromJSON(object.uint32) : undefined, + uint64: isSet(object.uint64) ? UInt64Rules.fromJSON(object.uint64) : undefined, + sint32: isSet(object.sint32) ? SInt32Rules.fromJSON(object.sint32) : undefined, + sint64: isSet(object.sint64) ? SInt64Rules.fromJSON(object.sint64) : undefined, + fixed32: isSet(object.fixed32) ? Fixed32Rules.fromJSON(object.fixed32) : undefined, + fixed64: isSet(object.fixed64) ? Fixed64Rules.fromJSON(object.fixed64) : undefined, + sfixed32: isSet(object.sfixed32) ? SFixed32Rules.fromJSON(object.sfixed32) : undefined, + sfixed64: isSet(object.sfixed64) ? SFixed64Rules.fromJSON(object.sfixed64) : undefined, + bool: isSet(object.bool) ? BoolRules.fromJSON(object.bool) : undefined, + string: isSet(object.string) ? StringRules.fromJSON(object.string) : undefined, + bytes: isSet(object.bytes) ? BytesRules.fromJSON(object.bytes) : undefined, + enum: isSet(object.enum) ? EnumRules.fromJSON(object.enum) : undefined, + repeated: isSet(object.repeated) ? RepeatedRules.fromJSON(object.repeated) : undefined, + map: isSet(object.map) ? MapRules.fromJSON(object.map) : undefined, + any: isSet(object.any) ? AnyRules.fromJSON(object.any) : undefined, + duration: isSet(object.duration) ? DurationRules.fromJSON(object.duration) : undefined, + timestamp: isSet(object.timestamp) ? TimestampRules.fromJSON(object.timestamp) : undefined, + }; + }, + + toJSON(message: FieldRules): unknown { + const obj: any = {}; + if (message.message !== undefined) { + obj.message = MessageRules.toJSON(message.message); + } + if (message.float !== undefined) { + obj.float = FloatRules.toJSON(message.float); + } + if (message.double !== undefined) { + obj.double = DoubleRules.toJSON(message.double); + } + if (message.int32 !== undefined) { + obj.int32 = Int32Rules.toJSON(message.int32); + } + if (message.int64 !== undefined) { + obj.int64 = Int64Rules.toJSON(message.int64); + } + if (message.uint32 !== undefined) { + obj.uint32 = UInt32Rules.toJSON(message.uint32); + } + if (message.uint64 !== undefined) { + obj.uint64 = UInt64Rules.toJSON(message.uint64); + } + if (message.sint32 !== undefined) { + obj.sint32 = SInt32Rules.toJSON(message.sint32); + } + if (message.sint64 !== undefined) { + obj.sint64 = SInt64Rules.toJSON(message.sint64); + } + if (message.fixed32 !== undefined) { + obj.fixed32 = Fixed32Rules.toJSON(message.fixed32); + } + if (message.fixed64 !== undefined) { + obj.fixed64 = Fixed64Rules.toJSON(message.fixed64); + } + if (message.sfixed32 !== undefined) { + obj.sfixed32 = SFixed32Rules.toJSON(message.sfixed32); + } + if (message.sfixed64 !== undefined) { + obj.sfixed64 = SFixed64Rules.toJSON(message.sfixed64); + } + if (message.bool !== undefined) { + obj.bool = BoolRules.toJSON(message.bool); + } + if (message.string !== undefined) { + obj.string = StringRules.toJSON(message.string); + } + if (message.bytes !== undefined) { + obj.bytes = BytesRules.toJSON(message.bytes); + } + if (message.enum !== undefined) { + obj.enum = EnumRules.toJSON(message.enum); + } + if (message.repeated !== undefined) { + obj.repeated = RepeatedRules.toJSON(message.repeated); + } + if (message.map !== undefined) { + obj.map = MapRules.toJSON(message.map); + } + if (message.any !== undefined) { + obj.any = AnyRules.toJSON(message.any); + } + if (message.duration !== undefined) { + obj.duration = DurationRules.toJSON(message.duration); + } + if (message.timestamp !== undefined) { + obj.timestamp = TimestampRules.toJSON(message.timestamp); + } + return obj; + }, + + create, I>>(base?: I): FieldRules { + return FieldRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldRules { + const message = createBaseFieldRules(); + message.message = (object.message !== undefined && object.message !== null) + ? MessageRules.fromPartial(object.message) + : undefined; + message.float = (object.float !== undefined && object.float !== null) + ? FloatRules.fromPartial(object.float) + : undefined; + message.double = (object.double !== undefined && object.double !== null) + ? DoubleRules.fromPartial(object.double) + : undefined; + message.int32 = (object.int32 !== undefined && object.int32 !== null) + ? Int32Rules.fromPartial(object.int32) + : undefined; + message.int64 = (object.int64 !== undefined && object.int64 !== null) + ? Int64Rules.fromPartial(object.int64) + : undefined; + message.uint32 = (object.uint32 !== undefined && object.uint32 !== null) + ? UInt32Rules.fromPartial(object.uint32) + : undefined; + message.uint64 = (object.uint64 !== undefined && object.uint64 !== null) + ? UInt64Rules.fromPartial(object.uint64) + : undefined; + message.sint32 = (object.sint32 !== undefined && object.sint32 !== null) + ? SInt32Rules.fromPartial(object.sint32) + : undefined; + message.sint64 = (object.sint64 !== undefined && object.sint64 !== null) + ? SInt64Rules.fromPartial(object.sint64) + : undefined; + message.fixed32 = (object.fixed32 !== undefined && object.fixed32 !== null) + ? Fixed32Rules.fromPartial(object.fixed32) + : undefined; + message.fixed64 = (object.fixed64 !== undefined && object.fixed64 !== null) + ? Fixed64Rules.fromPartial(object.fixed64) + : undefined; + message.sfixed32 = (object.sfixed32 !== undefined && object.sfixed32 !== null) + ? SFixed32Rules.fromPartial(object.sfixed32) + : undefined; + message.sfixed64 = (object.sfixed64 !== undefined && object.sfixed64 !== null) + ? SFixed64Rules.fromPartial(object.sfixed64) + : undefined; + message.bool = (object.bool !== undefined && object.bool !== null) ? BoolRules.fromPartial(object.bool) : undefined; + message.string = (object.string !== undefined && object.string !== null) + ? StringRules.fromPartial(object.string) + : undefined; + message.bytes = (object.bytes !== undefined && object.bytes !== null) + ? BytesRules.fromPartial(object.bytes) + : undefined; + message.enum = (object.enum !== undefined && object.enum !== null) ? EnumRules.fromPartial(object.enum) : undefined; + message.repeated = (object.repeated !== undefined && object.repeated !== null) + ? RepeatedRules.fromPartial(object.repeated) + : undefined; + message.map = (object.map !== undefined && object.map !== null) ? MapRules.fromPartial(object.map) : undefined; + message.any = (object.any !== undefined && object.any !== null) ? AnyRules.fromPartial(object.any) : undefined; + message.duration = (object.duration !== undefined && object.duration !== null) + ? DurationRules.fromPartial(object.duration) + : undefined; + message.timestamp = (object.timestamp !== undefined && object.timestamp !== null) + ? TimestampRules.fromPartial(object.timestamp) + : undefined; + return message; + }, +}; + +function createBaseFloatRules(): FloatRules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const FloatRules: MessageFns = { + encode(message: FloatRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(13).float(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(21).float(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(29).float(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(37).float(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(45).float(message.gte); + } + for (const v of message.in) { + writer.uint32(53).float(v!); + } + for (const v of message.notIn) { + writer.uint32(61).float(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FloatRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFloatRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.const = reader.float(); + continue; + } + case 2: { + if (tag !== 21) { + break; + } + + message.lt = reader.float(); + continue; + } + case 3: { + if (tag !== 29) { + break; + } + + message.lte = reader.float(); + continue; + } + case 4: { + if (tag !== 37) { + break; + } + + message.gt = reader.float(); + continue; + } + case 5: { + if (tag !== 45) { + break; + } + + message.gte = reader.float(); + continue; + } + case 6: { + if (tag === 53) { + message.in.push(reader.float()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.float()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 61) { + message.notIn.push(reader.float()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.float()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FloatRules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: FloatRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): FloatRules { + return FloatRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FloatRules { + const message = createBaseFloatRules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseDoubleRules(): DoubleRules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const DoubleRules: MessageFns = { + encode(message: DoubleRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(9).double(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(17).double(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(25).double(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(33).double(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(41).double(message.gte); + } + for (const v of message.in) { + writer.uint32(49).double(v!); + } + for (const v of message.notIn) { + writer.uint32(57).double(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DoubleRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.const = reader.double(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.lt = reader.double(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.lte = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.gt = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.gte = reader.double(); + continue; + } + case 6: { + if (tag === 49) { + message.in.push(reader.double()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.double()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 57) { + message.notIn.push(reader.double()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.double()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DoubleRules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: DoubleRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): DoubleRules { + return DoubleRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DoubleRules { + const message = createBaseDoubleRules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseInt32Rules(): Int32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const Int32Rules: MessageFns = { + encode(message: Int32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).int32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(16).int32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(24).int32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(32).int32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(40).int32(message.gte); + } + for (const v of message.in) { + writer.uint32(48).int32(v!); + } + for (const v of message.notIn) { + writer.uint32(56).int32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Int32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.int32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.int32(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.int32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.int32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.int32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.int32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Int32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Int32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): Int32Rules { + return Int32Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Int32Rules { + const message = createBaseInt32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseInt64Rules(): Int64Rules { + return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; +} + +export const Int64Rules: MessageFns = { + encode(message: Int64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "0") { + writer.uint32(8).int64(message.const); + } + if (message.lt !== undefined && message.lt !== "0") { + writer.uint32(16).int64(message.lt); + } + if (message.lte !== undefined && message.lte !== "0") { + writer.uint32(24).int64(message.lte); + } + if (message.gt !== undefined && message.gt !== "0") { + writer.uint32(32).int64(message.gt); + } + if (message.gte !== undefined && message.gte !== "0") { + writer.uint32(40).int64(message.gte); + } + for (const v of message.in) { + writer.uint32(48).int64(v!); + } + for (const v of message.notIn) { + writer.uint32(56).int64(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Int64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.int64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.int64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.int64().toString(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.int64().toString(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.int64().toString(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.int64().toString()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.int64().toString()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.int64().toString()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.int64().toString()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Int64Rules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "0", + lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", + lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", + gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", + gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Int64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "0") { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== "0") { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== "0") { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== "0") { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== "0") { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): Int64Rules { + return Int64Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Int64Rules { + const message = createBaseInt64Rules(); + message.const = object.const ?? "0"; + message.lt = object.lt ?? "0"; + message.lte = object.lte ?? "0"; + message.gt = object.gt ?? "0"; + message.gte = object.gte ?? "0"; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseUInt32Rules(): UInt32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const UInt32Rules: MessageFns = { + encode(message: UInt32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).uint32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(16).uint32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(24).uint32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(32).uint32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(40).uint32(message.gte); + } + for (const v of message.in) { + writer.uint32(48).uint32(v!); + } + for (const v of message.notIn) { + writer.uint32(56).uint32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UInt32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.uint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.uint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.uint32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.uint32(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.uint32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.uint32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.uint32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.uint32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UInt32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: UInt32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): UInt32Rules { + return UInt32Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UInt32Rules { + const message = createBaseUInt32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseUInt64Rules(): UInt64Rules { + return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; +} + +export const UInt64Rules: MessageFns = { + encode(message: UInt64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "0") { + writer.uint32(8).uint64(message.const); + } + if (message.lt !== undefined && message.lt !== "0") { + writer.uint32(16).uint64(message.lt); + } + if (message.lte !== undefined && message.lte !== "0") { + writer.uint32(24).uint64(message.lte); + } + if (message.gt !== undefined && message.gt !== "0") { + writer.uint32(32).uint64(message.gt); + } + if (message.gte !== undefined && message.gte !== "0") { + writer.uint32(40).uint64(message.gte); + } + for (const v of message.in) { + writer.uint32(48).uint64(v!); + } + for (const v of message.notIn) { + writer.uint32(56).uint64(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UInt64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.uint64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.uint64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.uint64().toString(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.uint64().toString(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.uint64().toString(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.uint64().toString()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.uint64().toString()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.uint64().toString()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.uint64().toString()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UInt64Rules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "0", + lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", + lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", + gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", + gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: UInt64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "0") { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== "0") { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== "0") { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== "0") { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== "0") { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): UInt64Rules { + return UInt64Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UInt64Rules { + const message = createBaseUInt64Rules(); + message.const = object.const ?? "0"; + message.lt = object.lt ?? "0"; + message.lte = object.lte ?? "0"; + message.gt = object.gt ?? "0"; + message.gte = object.gte ?? "0"; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSInt32Rules(): SInt32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const SInt32Rules: MessageFns = { + encode(message: SInt32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).sint32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(16).sint32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(24).sint32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(32).sint32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(40).sint32(message.gte); + } + for (const v of message.in) { + writer.uint32(48).sint32(v!); + } + for (const v of message.notIn) { + writer.uint32(56).sint32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SInt32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSInt32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.sint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.sint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.sint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.sint32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.sint32(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.sint32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.sint32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.sint32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.sint32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SInt32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SInt32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): SInt32Rules { + return SInt32Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SInt32Rules { + const message = createBaseSInt32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSInt64Rules(): SInt64Rules { + return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; +} + +export const SInt64Rules: MessageFns = { + encode(message: SInt64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "0") { + writer.uint32(8).sint64(message.const); + } + if (message.lt !== undefined && message.lt !== "0") { + writer.uint32(16).sint64(message.lt); + } + if (message.lte !== undefined && message.lte !== "0") { + writer.uint32(24).sint64(message.lte); + } + if (message.gt !== undefined && message.gt !== "0") { + writer.uint32(32).sint64(message.gt); + } + if (message.gte !== undefined && message.gte !== "0") { + writer.uint32(40).sint64(message.gte); + } + for (const v of message.in) { + writer.uint32(48).sint64(v!); + } + for (const v of message.notIn) { + writer.uint32(56).sint64(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SInt64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSInt64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.sint64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.sint64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.sint64().toString(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.sint64().toString(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.sint64().toString(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.sint64().toString()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.sint64().toString()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.sint64().toString()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.sint64().toString()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SInt64Rules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "0", + lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", + lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", + gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", + gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SInt64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "0") { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== "0") { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== "0") { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== "0") { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== "0") { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): SInt64Rules { + return SInt64Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SInt64Rules { + const message = createBaseSInt64Rules(); + message.const = object.const ?? "0"; + message.lt = object.lt ?? "0"; + message.lte = object.lte ?? "0"; + message.gt = object.gt ?? "0"; + message.gte = object.gte ?? "0"; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseFixed32Rules(): Fixed32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const Fixed32Rules: MessageFns = { + encode(message: Fixed32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(13).fixed32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(21).fixed32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(29).fixed32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(37).fixed32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(45).fixed32(message.gte); + } + for (const v of message.in) { + writer.uint32(53).fixed32(v!); + } + for (const v of message.notIn) { + writer.uint32(61).fixed32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Fixed32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFixed32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.const = reader.fixed32(); + continue; + } + case 2: { + if (tag !== 21) { + break; + } + + message.lt = reader.fixed32(); + continue; + } + case 3: { + if (tag !== 29) { + break; + } + + message.lte = reader.fixed32(); + continue; + } + case 4: { + if (tag !== 37) { + break; + } + + message.gt = reader.fixed32(); + continue; + } + case 5: { + if (tag !== 45) { + break; + } + + message.gte = reader.fixed32(); + continue; + } + case 6: { + if (tag === 53) { + message.in.push(reader.fixed32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.fixed32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 61) { + message.notIn.push(reader.fixed32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.fixed32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Fixed32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Fixed32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): Fixed32Rules { + return Fixed32Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Fixed32Rules { + const message = createBaseFixed32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseFixed64Rules(): Fixed64Rules { + return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; +} + +export const Fixed64Rules: MessageFns = { + encode(message: Fixed64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "0") { + writer.uint32(9).fixed64(message.const); + } + if (message.lt !== undefined && message.lt !== "0") { + writer.uint32(17).fixed64(message.lt); + } + if (message.lte !== undefined && message.lte !== "0") { + writer.uint32(25).fixed64(message.lte); + } + if (message.gt !== undefined && message.gt !== "0") { + writer.uint32(33).fixed64(message.gt); + } + if (message.gte !== undefined && message.gte !== "0") { + writer.uint32(41).fixed64(message.gte); + } + for (const v of message.in) { + writer.uint32(49).fixed64(v!); + } + for (const v of message.notIn) { + writer.uint32(57).fixed64(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Fixed64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFixed64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.const = reader.fixed64().toString(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.lt = reader.fixed64().toString(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.lte = reader.fixed64().toString(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.gt = reader.fixed64().toString(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.gte = reader.fixed64().toString(); + continue; + } + case 6: { + if (tag === 49) { + message.in.push(reader.fixed64().toString()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.fixed64().toString()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 57) { + message.notIn.push(reader.fixed64().toString()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.fixed64().toString()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Fixed64Rules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "0", + lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", + lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", + gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", + gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Fixed64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "0") { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== "0") { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== "0") { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== "0") { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== "0") { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): Fixed64Rules { + return Fixed64Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Fixed64Rules { + const message = createBaseFixed64Rules(); + message.const = object.const ?? "0"; + message.lt = object.lt ?? "0"; + message.lte = object.lte ?? "0"; + message.gt = object.gt ?? "0"; + message.gte = object.gte ?? "0"; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSFixed32Rules(): SFixed32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const SFixed32Rules: MessageFns = { + encode(message: SFixed32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(13).sfixed32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(21).sfixed32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(29).sfixed32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(37).sfixed32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(45).sfixed32(message.gte); + } + for (const v of message.in) { + writer.uint32(53).sfixed32(v!); + } + for (const v of message.notIn) { + writer.uint32(61).sfixed32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SFixed32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSFixed32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.const = reader.sfixed32(); + continue; + } + case 2: { + if (tag !== 21) { + break; + } + + message.lt = reader.sfixed32(); + continue; + } + case 3: { + if (tag !== 29) { + break; + } + + message.lte = reader.sfixed32(); + continue; + } + case 4: { + if (tag !== 37) { + break; + } + + message.gt = reader.sfixed32(); + continue; + } + case 5: { + if (tag !== 45) { + break; + } + + message.gte = reader.sfixed32(); + continue; + } + case 6: { + if (tag === 53) { + message.in.push(reader.sfixed32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.sfixed32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 61) { + message.notIn.push(reader.sfixed32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.sfixed32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SFixed32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SFixed32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): SFixed32Rules { + return SFixed32Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SFixed32Rules { + const message = createBaseSFixed32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSFixed64Rules(): SFixed64Rules { + return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; +} + +export const SFixed64Rules: MessageFns = { + encode(message: SFixed64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "0") { + writer.uint32(9).sfixed64(message.const); + } + if (message.lt !== undefined && message.lt !== "0") { + writer.uint32(17).sfixed64(message.lt); + } + if (message.lte !== undefined && message.lte !== "0") { + writer.uint32(25).sfixed64(message.lte); + } + if (message.gt !== undefined && message.gt !== "0") { + writer.uint32(33).sfixed64(message.gt); + } + if (message.gte !== undefined && message.gte !== "0") { + writer.uint32(41).sfixed64(message.gte); + } + for (const v of message.in) { + writer.uint32(49).sfixed64(v!); + } + for (const v of message.notIn) { + writer.uint32(57).sfixed64(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SFixed64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSFixed64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.const = reader.sfixed64().toString(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.lt = reader.sfixed64().toString(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.lte = reader.sfixed64().toString(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.gt = reader.sfixed64().toString(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.gte = reader.sfixed64().toString(); + continue; + } + case 6: { + if (tag === 49) { + message.in.push(reader.sfixed64().toString()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.sfixed64().toString()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 57) { + message.notIn.push(reader.sfixed64().toString()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.sfixed64().toString()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SFixed64Rules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "0", + lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", + lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", + gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", + gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SFixed64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "0") { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== "0") { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== "0") { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== "0") { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== "0") { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): SFixed64Rules { + return SFixed64Rules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SFixed64Rules { + const message = createBaseSFixed64Rules(); + message.const = object.const ?? "0"; + message.lt = object.lt ?? "0"; + message.lte = object.lte ?? "0"; + message.gt = object.gt ?? "0"; + message.gte = object.gte ?? "0"; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseBoolRules(): BoolRules { + return { const: false }; +} + +export const BoolRules: MessageFns = { + encode(message: BoolRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== false) { + writer.uint32(8).bool(message.const); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BoolRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoolRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BoolRules { + return { const: isSet(object.const) ? globalThis.Boolean(object.const) : false }; + }, + + toJSON(message: BoolRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== false) { + obj.const = message.const; + } + return obj; + }, + + create, I>>(base?: I): BoolRules { + return BoolRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BoolRules { + const message = createBaseBoolRules(); + message.const = object.const ?? false; + return message; + }, +}; + +function createBaseStringRules(): StringRules { + return { + const: "", + len: "0", + minLen: "0", + maxLen: "0", + lenBytes: "0", + minBytes: "0", + maxBytes: "0", + pattern: "", + prefix: "", + suffix: "", + contains: "", + notContains: "", + in: [], + notIn: [], + email: undefined, + hostname: undefined, + ip: undefined, + ipv4: undefined, + ipv6: undefined, + uri: undefined, + uriRef: undefined, + address: undefined, + uuid: undefined, + wellKnownRegex: undefined, + strict: true, + ignoreEmpty: false, + }; +} + +export const StringRules: MessageFns = { + encode(message: StringRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "") { + writer.uint32(10).string(message.const); + } + if (message.len !== undefined && message.len !== "0") { + writer.uint32(152).uint64(message.len); + } + if (message.minLen !== undefined && message.minLen !== "0") { + writer.uint32(16).uint64(message.minLen); + } + if (message.maxLen !== undefined && message.maxLen !== "0") { + writer.uint32(24).uint64(message.maxLen); + } + if (message.lenBytes !== undefined && message.lenBytes !== "0") { + writer.uint32(160).uint64(message.lenBytes); + } + if (message.minBytes !== undefined && message.minBytes !== "0") { + writer.uint32(32).uint64(message.minBytes); + } + if (message.maxBytes !== undefined && message.maxBytes !== "0") { + writer.uint32(40).uint64(message.maxBytes); + } + if (message.pattern !== undefined && message.pattern !== "") { + writer.uint32(50).string(message.pattern); + } + if (message.prefix !== undefined && message.prefix !== "") { + writer.uint32(58).string(message.prefix); + } + if (message.suffix !== undefined && message.suffix !== "") { + writer.uint32(66).string(message.suffix); + } + if (message.contains !== undefined && message.contains !== "") { + writer.uint32(74).string(message.contains); + } + if (message.notContains !== undefined && message.notContains !== "") { + writer.uint32(186).string(message.notContains); + } + for (const v of message.in) { + writer.uint32(82).string(v!); + } + for (const v of message.notIn) { + writer.uint32(90).string(v!); + } + if (message.email !== undefined) { + writer.uint32(96).bool(message.email); + } + if (message.hostname !== undefined) { + writer.uint32(104).bool(message.hostname); + } + if (message.ip !== undefined) { + writer.uint32(112).bool(message.ip); + } + if (message.ipv4 !== undefined) { + writer.uint32(120).bool(message.ipv4); + } + if (message.ipv6 !== undefined) { + writer.uint32(128).bool(message.ipv6); + } + if (message.uri !== undefined) { + writer.uint32(136).bool(message.uri); + } + if (message.uriRef !== undefined) { + writer.uint32(144).bool(message.uriRef); + } + if (message.address !== undefined) { + writer.uint32(168).bool(message.address); + } + if (message.uuid !== undefined) { + writer.uint32(176).bool(message.uuid); + } + if (message.wellKnownRegex !== undefined) { + writer.uint32(192).int32(message.wellKnownRegex); + } + if (message.strict !== undefined && message.strict !== true) { + writer.uint32(200).bool(message.strict); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(208).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StringRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.const = reader.string(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.len = reader.uint64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.minLen = reader.uint64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.maxLen = reader.uint64().toString(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.lenBytes = reader.uint64().toString(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.minBytes = reader.uint64().toString(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.maxBytes = reader.uint64().toString(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.pattern = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.prefix = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.suffix = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.contains = reader.string(); + continue; + } + case 23: { + if (tag !== 186) { + break; + } + + message.notContains = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.in.push(reader.string()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notIn.push(reader.string()); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.email = reader.bool(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.hostname = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.ip = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.ipv4 = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.ipv6 = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.uri = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.uriRef = reader.bool(); + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.address = reader.bool(); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.uuid = reader.bool(); + continue; + } + case 24: { + if (tag !== 192) { + break; + } + + message.wellKnownRegex = reader.int32() as any; + continue; + } + case 25: { + if (tag !== 200) { + break; + } + + message.strict = reader.bool(); + continue; + } + case 26: { + if (tag !== 208) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StringRules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "", + len: isSet(object.len) ? globalThis.String(object.len) : "0", + minLen: isSet(object.minLen) ? globalThis.String(object.minLen) : "0", + maxLen: isSet(object.maxLen) ? globalThis.String(object.maxLen) : "0", + lenBytes: isSet(object.lenBytes) ? globalThis.String(object.lenBytes) : "0", + minBytes: isSet(object.minBytes) ? globalThis.String(object.minBytes) : "0", + maxBytes: isSet(object.maxBytes) ? globalThis.String(object.maxBytes) : "0", + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", + prefix: isSet(object.prefix) ? globalThis.String(object.prefix) : "", + suffix: isSet(object.suffix) ? globalThis.String(object.suffix) : "", + contains: isSet(object.contains) ? globalThis.String(object.contains) : "", + notContains: isSet(object.notContains) ? globalThis.String(object.notContains) : "", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + email: isSet(object.email) ? globalThis.Boolean(object.email) : undefined, + hostname: isSet(object.hostname) ? globalThis.Boolean(object.hostname) : undefined, + ip: isSet(object.ip) ? globalThis.Boolean(object.ip) : undefined, + ipv4: isSet(object.ipv4) ? globalThis.Boolean(object.ipv4) : undefined, + ipv6: isSet(object.ipv6) ? globalThis.Boolean(object.ipv6) : undefined, + uri: isSet(object.uri) ? globalThis.Boolean(object.uri) : undefined, + uriRef: isSet(object.uriRef) ? globalThis.Boolean(object.uriRef) : undefined, + address: isSet(object.address) ? globalThis.Boolean(object.address) : undefined, + uuid: isSet(object.uuid) ? globalThis.Boolean(object.uuid) : undefined, + wellKnownRegex: isSet(object.wellKnownRegex) ? knownRegexFromJSON(object.wellKnownRegex) : undefined, + strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : true, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: StringRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "") { + obj.const = message.const; + } + if (message.len !== undefined && message.len !== "0") { + obj.len = message.len; + } + if (message.minLen !== undefined && message.minLen !== "0") { + obj.minLen = message.minLen; + } + if (message.maxLen !== undefined && message.maxLen !== "0") { + obj.maxLen = message.maxLen; + } + if (message.lenBytes !== undefined && message.lenBytes !== "0") { + obj.lenBytes = message.lenBytes; + } + if (message.minBytes !== undefined && message.minBytes !== "0") { + obj.minBytes = message.minBytes; + } + if (message.maxBytes !== undefined && message.maxBytes !== "0") { + obj.maxBytes = message.maxBytes; + } + if (message.pattern !== undefined && message.pattern !== "") { + obj.pattern = message.pattern; + } + if (message.prefix !== undefined && message.prefix !== "") { + obj.prefix = message.prefix; + } + if (message.suffix !== undefined && message.suffix !== "") { + obj.suffix = message.suffix; + } + if (message.contains !== undefined && message.contains !== "") { + obj.contains = message.contains; + } + if (message.notContains !== undefined && message.notContains !== "") { + obj.notContains = message.notContains; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.email !== undefined) { + obj.email = message.email; + } + if (message.hostname !== undefined) { + obj.hostname = message.hostname; + } + if (message.ip !== undefined) { + obj.ip = message.ip; + } + if (message.ipv4 !== undefined) { + obj.ipv4 = message.ipv4; + } + if (message.ipv6 !== undefined) { + obj.ipv6 = message.ipv6; + } + if (message.uri !== undefined) { + obj.uri = message.uri; + } + if (message.uriRef !== undefined) { + obj.uriRef = message.uriRef; + } + if (message.address !== undefined) { + obj.address = message.address; + } + if (message.uuid !== undefined) { + obj.uuid = message.uuid; + } + if (message.wellKnownRegex !== undefined) { + obj.wellKnownRegex = knownRegexToJSON(message.wellKnownRegex); + } + if (message.strict !== undefined && message.strict !== true) { + obj.strict = message.strict; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): StringRules { + return StringRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): StringRules { + const message = createBaseStringRules(); + message.const = object.const ?? ""; + message.len = object.len ?? "0"; + message.minLen = object.minLen ?? "0"; + message.maxLen = object.maxLen ?? "0"; + message.lenBytes = object.lenBytes ?? "0"; + message.minBytes = object.minBytes ?? "0"; + message.maxBytes = object.maxBytes ?? "0"; + message.pattern = object.pattern ?? ""; + message.prefix = object.prefix ?? ""; + message.suffix = object.suffix ?? ""; + message.contains = object.contains ?? ""; + message.notContains = object.notContains ?? ""; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.email = object.email ?? undefined; + message.hostname = object.hostname ?? undefined; + message.ip = object.ip ?? undefined; + message.ipv4 = object.ipv4 ?? undefined; + message.ipv6 = object.ipv6 ?? undefined; + message.uri = object.uri ?? undefined; + message.uriRef = object.uriRef ?? undefined; + message.address = object.address ?? undefined; + message.uuid = object.uuid ?? undefined; + message.wellKnownRegex = object.wellKnownRegex ?? undefined; + message.strict = object.strict ?? true; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseBytesRules(): BytesRules { + return { + const: new Uint8Array(0), + len: "0", + minLen: "0", + maxLen: "0", + pattern: "", + prefix: new Uint8Array(0), + suffix: new Uint8Array(0), + contains: new Uint8Array(0), + in: [], + notIn: [], + ip: undefined, + ipv4: undefined, + ipv6: undefined, + ignoreEmpty: false, + }; +} + +export const BytesRules: MessageFns = { + encode(message: BytesRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const.length !== 0) { + writer.uint32(10).bytes(message.const); + } + if (message.len !== undefined && message.len !== "0") { + writer.uint32(104).uint64(message.len); + } + if (message.minLen !== undefined && message.minLen !== "0") { + writer.uint32(16).uint64(message.minLen); + } + if (message.maxLen !== undefined && message.maxLen !== "0") { + writer.uint32(24).uint64(message.maxLen); + } + if (message.pattern !== undefined && message.pattern !== "") { + writer.uint32(34).string(message.pattern); + } + if (message.prefix !== undefined && message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + if (message.suffix !== undefined && message.suffix.length !== 0) { + writer.uint32(50).bytes(message.suffix); + } + if (message.contains !== undefined && message.contains.length !== 0) { + writer.uint32(58).bytes(message.contains); + } + for (const v of message.in) { + writer.uint32(66).bytes(v!); + } + for (const v of message.notIn) { + writer.uint32(74).bytes(v!); + } + if (message.ip !== undefined) { + writer.uint32(80).bool(message.ip); + } + if (message.ipv4 !== undefined) { + writer.uint32(88).bool(message.ipv4); + } + if (message.ipv6 !== undefined) { + writer.uint32(96).bool(message.ipv6); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(112).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BytesRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBytesRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.const = reader.bytes(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.len = reader.uint64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.minLen = reader.uint64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.maxLen = reader.uint64().toString(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.pattern = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.prefix = reader.bytes(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.suffix = reader.bytes(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.contains = reader.bytes(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.in.push(reader.bytes()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.notIn.push(reader.bytes()); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.ip = reader.bool(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.ipv4 = reader.bool(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.ipv6 = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BytesRules { + return { + const: isSet(object.const) ? bytesFromBase64(object.const) : new Uint8Array(0), + len: isSet(object.len) ? globalThis.String(object.len) : "0", + minLen: isSet(object.minLen) ? globalThis.String(object.minLen) : "0", + maxLen: isSet(object.maxLen) ? globalThis.String(object.maxLen) : "0", + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", + prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(0), + suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array(0), + contains: isSet(object.contains) ? bytesFromBase64(object.contains) : new Uint8Array(0), + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => bytesFromBase64(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => bytesFromBase64(e)) : [], + ip: isSet(object.ip) ? globalThis.Boolean(object.ip) : undefined, + ipv4: isSet(object.ipv4) ? globalThis.Boolean(object.ipv4) : undefined, + ipv6: isSet(object.ipv6) ? globalThis.Boolean(object.ipv6) : undefined, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: BytesRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const.length !== 0) { + obj.const = base64FromBytes(message.const); + } + if (message.len !== undefined && message.len !== "0") { + obj.len = message.len; + } + if (message.minLen !== undefined && message.minLen !== "0") { + obj.minLen = message.minLen; + } + if (message.maxLen !== undefined && message.maxLen !== "0") { + obj.maxLen = message.maxLen; + } + if (message.pattern !== undefined && message.pattern !== "") { + obj.pattern = message.pattern; + } + if (message.prefix !== undefined && message.prefix.length !== 0) { + obj.prefix = base64FromBytes(message.prefix); + } + if (message.suffix !== undefined && message.suffix.length !== 0) { + obj.suffix = base64FromBytes(message.suffix); + } + if (message.contains !== undefined && message.contains.length !== 0) { + obj.contains = base64FromBytes(message.contains); + } + if (message.in?.length) { + obj.in = message.in.map((e) => base64FromBytes(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => base64FromBytes(e)); + } + if (message.ip !== undefined) { + obj.ip = message.ip; + } + if (message.ipv4 !== undefined) { + obj.ipv4 = message.ipv4; + } + if (message.ipv6 !== undefined) { + obj.ipv6 = message.ipv6; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): BytesRules { + return BytesRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BytesRules { + const message = createBaseBytesRules(); + message.const = object.const ?? new Uint8Array(0); + message.len = object.len ?? "0"; + message.minLen = object.minLen ?? "0"; + message.maxLen = object.maxLen ?? "0"; + message.pattern = object.pattern ?? ""; + message.prefix = object.prefix ?? new Uint8Array(0); + message.suffix = object.suffix ?? new Uint8Array(0); + message.contains = object.contains ?? new Uint8Array(0); + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ip = object.ip ?? undefined; + message.ipv4 = object.ipv4 ?? undefined; + message.ipv6 = object.ipv6 ?? undefined; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseEnumRules(): EnumRules { + return { const: 0, definedOnly: false, in: [], notIn: [] }; +} + +export const EnumRules: MessageFns = { + encode(message: EnumRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).int32(message.const); + } + if (message.definedOnly !== undefined && message.definedOnly !== false) { + writer.uint32(16).bool(message.definedOnly); + } + for (const v of message.in) { + writer.uint32(24).int32(v!); + } + for (const v of message.notIn) { + writer.uint32(32).int32(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.definedOnly = reader.bool(); + continue; + } + case 3: { + if (tag === 24) { + message.in.push(reader.int32()); + + continue; + } + + if (tag === 26) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.int32()); + } + + continue; + } + + break; + } + case 4: { + if (tag === 32) { + message.notIn.push(reader.int32()); + + continue; + } + + if (tag === 34) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.int32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumRules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + definedOnly: isSet(object.definedOnly) ? globalThis.Boolean(object.definedOnly) : false, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + }; + }, + + toJSON(message: EnumRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.definedOnly !== undefined && message.definedOnly !== false) { + obj.definedOnly = message.definedOnly; + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + return obj; + }, + + create, I>>(base?: I): EnumRules { + return EnumRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): EnumRules { + const message = createBaseEnumRules(); + message.const = object.const ?? 0; + message.definedOnly = object.definedOnly ?? false; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMessageRules(): MessageRules { + return { skip: false, required: false }; +} + +export const MessageRules: MessageFns = { + encode(message: MessageRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.skip !== undefined && message.skip !== false) { + writer.uint32(8).bool(message.skip); + } + if (message.required !== undefined && message.required !== false) { + writer.uint32(16).bool(message.required); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MessageRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.skip = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.required = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageRules { + return { + skip: isSet(object.skip) ? globalThis.Boolean(object.skip) : false, + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + }; + }, + + toJSON(message: MessageRules): unknown { + const obj: any = {}; + if (message.skip !== undefined && message.skip !== false) { + obj.skip = message.skip; + } + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + return obj; + }, + + create, I>>(base?: I): MessageRules { + return MessageRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MessageRules { + const message = createBaseMessageRules(); + message.skip = object.skip ?? false; + message.required = object.required ?? false; + return message; + }, +}; + +function createBaseRepeatedRules(): RepeatedRules { + return { minItems: "0", maxItems: "0", unique: false, items: undefined, ignoreEmpty: false }; +} + +export const RepeatedRules: MessageFns = { + encode(message: RepeatedRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.minItems !== undefined && message.minItems !== "0") { + writer.uint32(8).uint64(message.minItems); + } + if (message.maxItems !== undefined && message.maxItems !== "0") { + writer.uint32(16).uint64(message.maxItems); + } + if (message.unique !== undefined && message.unique !== false) { + writer.uint32(24).bool(message.unique); + } + if (message.items !== undefined) { + FieldRules.encode(message.items, writer.uint32(34).fork()).join(); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(40).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RepeatedRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRepeatedRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.minItems = reader.uint64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.maxItems = reader.uint64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.unique = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.items = FieldRules.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RepeatedRules { + return { + minItems: isSet(object.minItems) ? globalThis.String(object.minItems) : "0", + maxItems: isSet(object.maxItems) ? globalThis.String(object.maxItems) : "0", + unique: isSet(object.unique) ? globalThis.Boolean(object.unique) : false, + items: isSet(object.items) ? FieldRules.fromJSON(object.items) : undefined, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: RepeatedRules): unknown { + const obj: any = {}; + if (message.minItems !== undefined && message.minItems !== "0") { + obj.minItems = message.minItems; + } + if (message.maxItems !== undefined && message.maxItems !== "0") { + obj.maxItems = message.maxItems; + } + if (message.unique !== undefined && message.unique !== false) { + obj.unique = message.unique; + } + if (message.items !== undefined) { + obj.items = FieldRules.toJSON(message.items); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): RepeatedRules { + return RepeatedRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RepeatedRules { + const message = createBaseRepeatedRules(); + message.minItems = object.minItems ?? "0"; + message.maxItems = object.maxItems ?? "0"; + message.unique = object.unique ?? false; + message.items = (object.items !== undefined && object.items !== null) + ? FieldRules.fromPartial(object.items) + : undefined; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseMapRules(): MapRules { + return { minPairs: "0", maxPairs: "0", noSparse: false, keys: undefined, values: undefined, ignoreEmpty: false }; +} + +export const MapRules: MessageFns = { + encode(message: MapRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.minPairs !== undefined && message.minPairs !== "0") { + writer.uint32(8).uint64(message.minPairs); + } + if (message.maxPairs !== undefined && message.maxPairs !== "0") { + writer.uint32(16).uint64(message.maxPairs); + } + if (message.noSparse !== undefined && message.noSparse !== false) { + writer.uint32(24).bool(message.noSparse); + } + if (message.keys !== undefined) { + FieldRules.encode(message.keys, writer.uint32(34).fork()).join(); + } + if (message.values !== undefined) { + FieldRules.encode(message.values, writer.uint32(42).fork()).join(); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(48).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MapRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMapRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.minPairs = reader.uint64().toString(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.maxPairs = reader.uint64().toString(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.noSparse = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.keys = FieldRules.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.values = FieldRules.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MapRules { + return { + minPairs: isSet(object.minPairs) ? globalThis.String(object.minPairs) : "0", + maxPairs: isSet(object.maxPairs) ? globalThis.String(object.maxPairs) : "0", + noSparse: isSet(object.noSparse) ? globalThis.Boolean(object.noSparse) : false, + keys: isSet(object.keys) ? FieldRules.fromJSON(object.keys) : undefined, + values: isSet(object.values) ? FieldRules.fromJSON(object.values) : undefined, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: MapRules): unknown { + const obj: any = {}; + if (message.minPairs !== undefined && message.minPairs !== "0") { + obj.minPairs = message.minPairs; + } + if (message.maxPairs !== undefined && message.maxPairs !== "0") { + obj.maxPairs = message.maxPairs; + } + if (message.noSparse !== undefined && message.noSparse !== false) { + obj.noSparse = message.noSparse; + } + if (message.keys !== undefined) { + obj.keys = FieldRules.toJSON(message.keys); + } + if (message.values !== undefined) { + obj.values = FieldRules.toJSON(message.values); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create, I>>(base?: I): MapRules { + return MapRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MapRules { + const message = createBaseMapRules(); + message.minPairs = object.minPairs ?? "0"; + message.maxPairs = object.maxPairs ?? "0"; + message.noSparse = object.noSparse ?? false; + message.keys = (object.keys !== undefined && object.keys !== null) + ? FieldRules.fromPartial(object.keys) + : undefined; + message.values = (object.values !== undefined && object.values !== null) + ? FieldRules.fromPartial(object.values) + : undefined; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseAnyRules(): AnyRules { + return { required: false, in: [], notIn: [] }; +} + +export const AnyRules: MessageFns = { + encode(message: AnyRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.required !== undefined && message.required !== false) { + writer.uint32(8).bool(message.required); + } + for (const v of message.in) { + writer.uint32(18).string(v!); + } + for (const v of message.notIn) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AnyRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAnyRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.required = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.in.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.notIn.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AnyRules { + return { + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: AnyRules): unknown { + const obj: any = {}; + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + return obj; + }, + + create, I>>(base?: I): AnyRules { + return AnyRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): AnyRules { + const message = createBaseAnyRules(); + message.required = object.required ?? false; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDurationRules(): DurationRules { + return { + required: false, + const: undefined, + lt: undefined, + lte: undefined, + gt: undefined, + gte: undefined, + in: [], + notIn: [], + }; +} + +export const DurationRules: MessageFns = { + encode(message: DurationRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.required !== undefined && message.required !== false) { + writer.uint32(8).bool(message.required); + } + if (message.const !== undefined) { + Duration.encode(message.const, writer.uint32(18).fork()).join(); + } + if (message.lt !== undefined) { + Duration.encode(message.lt, writer.uint32(26).fork()).join(); + } + if (message.lte !== undefined) { + Duration.encode(message.lte, writer.uint32(34).fork()).join(); + } + if (message.gt !== undefined) { + Duration.encode(message.gt, writer.uint32(42).fork()).join(); + } + if (message.gte !== undefined) { + Duration.encode(message.gte, writer.uint32(50).fork()).join(); + } + for (const v of message.in) { + Duration.encode(v!, writer.uint32(58).fork()).join(); + } + for (const v of message.notIn) { + Duration.encode(v!, writer.uint32(66).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DurationRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDurationRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.required = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.const = Duration.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.lt = Duration.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.lte = Duration.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.gt = Duration.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.gte = Duration.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.in.push(Duration.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.notIn.push(Duration.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DurationRules { + return { + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + const: isSet(object.const) ? Duration.fromJSON(object.const) : undefined, + lt: isSet(object.lt) ? Duration.fromJSON(object.lt) : undefined, + lte: isSet(object.lte) ? Duration.fromJSON(object.lte) : undefined, + gt: isSet(object.gt) ? Duration.fromJSON(object.gt) : undefined, + gte: isSet(object.gte) ? Duration.fromJSON(object.gte) : undefined, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Duration.fromJSON(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Duration.fromJSON(e)) : [], + }; + }, + + toJSON(message: DurationRules): unknown { + const obj: any = {}; + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + if (message.const !== undefined) { + obj.const = Duration.toJSON(message.const); + } + if (message.lt !== undefined) { + obj.lt = Duration.toJSON(message.lt); + } + if (message.lte !== undefined) { + obj.lte = Duration.toJSON(message.lte); + } + if (message.gt !== undefined) { + obj.gt = Duration.toJSON(message.gt); + } + if (message.gte !== undefined) { + obj.gte = Duration.toJSON(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Duration.toJSON(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Duration.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): DurationRules { + return DurationRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DurationRules { + const message = createBaseDurationRules(); + message.required = object.required ?? false; + message.const = (object.const !== undefined && object.const !== null) + ? Duration.fromPartial(object.const) + : undefined; + message.lt = (object.lt !== undefined && object.lt !== null) ? Duration.fromPartial(object.lt) : undefined; + message.lte = (object.lte !== undefined && object.lte !== null) ? Duration.fromPartial(object.lte) : undefined; + message.gt = (object.gt !== undefined && object.gt !== null) ? Duration.fromPartial(object.gt) : undefined; + message.gte = (object.gte !== undefined && object.gte !== null) ? Duration.fromPartial(object.gte) : undefined; + message.in = object.in?.map((e) => Duration.fromPartial(e)) || []; + message.notIn = object.notIn?.map((e) => Duration.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseTimestampRules(): TimestampRules { + return { + required: false, + const: undefined, + lt: undefined, + lte: undefined, + gt: undefined, + gte: undefined, + ltNow: false, + gtNow: false, + within: undefined, + }; +} + +export const TimestampRules: MessageFns = { + encode(message: TimestampRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.required !== undefined && message.required !== false) { + writer.uint32(8).bool(message.required); + } + if (message.const !== undefined) { + Timestamp.encode(toTimestamp(message.const), writer.uint32(18).fork()).join(); + } + if (message.lt !== undefined) { + Timestamp.encode(toTimestamp(message.lt), writer.uint32(26).fork()).join(); + } + if (message.lte !== undefined) { + Timestamp.encode(toTimestamp(message.lte), writer.uint32(34).fork()).join(); + } + if (message.gt !== undefined) { + Timestamp.encode(toTimestamp(message.gt), writer.uint32(42).fork()).join(); + } + if (message.gte !== undefined) { + Timestamp.encode(toTimestamp(message.gte), writer.uint32(50).fork()).join(); + } + if (message.ltNow !== undefined && message.ltNow !== false) { + writer.uint32(56).bool(message.ltNow); + } + if (message.gtNow !== undefined && message.gtNow !== false) { + writer.uint32(64).bool(message.gtNow); + } + if (message.within !== undefined) { + Duration.encode(message.within, writer.uint32(74).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TimestampRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestampRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.required = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.const = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.lt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.lte = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.gt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.gte = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.ltNow = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.gtNow = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.within = Duration.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TimestampRules { + return { + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + const: isSet(object.const) ? fromJsonTimestamp(object.const) : undefined, + lt: isSet(object.lt) ? fromJsonTimestamp(object.lt) : undefined, + lte: isSet(object.lte) ? fromJsonTimestamp(object.lte) : undefined, + gt: isSet(object.gt) ? fromJsonTimestamp(object.gt) : undefined, + gte: isSet(object.gte) ? fromJsonTimestamp(object.gte) : undefined, + ltNow: isSet(object.ltNow) ? globalThis.Boolean(object.ltNow) : false, + gtNow: isSet(object.gtNow) ? globalThis.Boolean(object.gtNow) : false, + within: isSet(object.within) ? Duration.fromJSON(object.within) : undefined, + }; + }, + + toJSON(message: TimestampRules): unknown { + const obj: any = {}; + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + if (message.const !== undefined) { + obj.const = message.const.toISOString(); + } + if (message.lt !== undefined) { + obj.lt = message.lt.toISOString(); + } + if (message.lte !== undefined) { + obj.lte = message.lte.toISOString(); + } + if (message.gt !== undefined) { + obj.gt = message.gt.toISOString(); + } + if (message.gte !== undefined) { + obj.gte = message.gte.toISOString(); + } + if (message.ltNow !== undefined && message.ltNow !== false) { + obj.ltNow = message.ltNow; + } + if (message.gtNow !== undefined && message.gtNow !== false) { + obj.gtNow = message.gtNow; + } + if (message.within !== undefined) { + obj.within = Duration.toJSON(message.within); + } + return obj; + }, + + create, I>>(base?: I): TimestampRules { + return TimestampRules.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TimestampRules { + const message = createBaseTimestampRules(); + message.required = object.required ?? false; + message.const = object.const ?? undefined; + message.lt = object.lt ?? undefined; + message.lte = object.lte ?? undefined; + message.gt = object.gt ?? undefined; + message.gte = object.gte ?? undefined; + message.ltNow = object.ltNow ?? false; + message.gtNow = object.gtNow ?? false; + message.within = (object.within !== undefined && object.within !== null) + ? Duration.fromPartial(object.within) + : undefined; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function toTimestamp(date: Date): Timestamp { + const seconds = Math.trunc(date.getTime() / 1_000).toString(); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (globalThis.Number(t.seconds) || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new globalThis.Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof globalThis.Date) { + return o; + } else if (typeof o === "string") { + return new globalThis.Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts b/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts new file mode 100644 index 00000000..f355c799 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts @@ -0,0 +1,361 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: xds/annotations/v3/status.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "xds.annotations.v3"; + +export enum PackageVersionStatus { + /** UNKNOWN - Unknown package version status. */ + UNKNOWN = 0, + /** FROZEN - This version of the package is frozen. */ + FROZEN = 1, + /** ACTIVE - This version of the package is the active development version. */ + ACTIVE = 2, + /** + * NEXT_MAJOR_VERSION_CANDIDATE - This version of the package is the candidate for the next major version. It + * is typically machine generated from the active development version. + */ + NEXT_MAJOR_VERSION_CANDIDATE = 3, + UNRECOGNIZED = -1, +} + +export function packageVersionStatusFromJSON(object: any): PackageVersionStatus { + switch (object) { + case 0: + case "UNKNOWN": + return PackageVersionStatus.UNKNOWN; + case 1: + case "FROZEN": + return PackageVersionStatus.FROZEN; + case 2: + case "ACTIVE": + return PackageVersionStatus.ACTIVE; + case 3: + case "NEXT_MAJOR_VERSION_CANDIDATE": + return PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE; + case -1: + case "UNRECOGNIZED": + default: + return PackageVersionStatus.UNRECOGNIZED; + } +} + +export function packageVersionStatusToJSON(object: PackageVersionStatus): string { + switch (object) { + case PackageVersionStatus.UNKNOWN: + return "UNKNOWN"; + case PackageVersionStatus.FROZEN: + return "FROZEN"; + case PackageVersionStatus.ACTIVE: + return "ACTIVE"; + case PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE: + return "NEXT_MAJOR_VERSION_CANDIDATE"; + case PackageVersionStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface FileStatusAnnotation { + /** The entity is work-in-progress and subject to breaking changes. */ + workInProgress: boolean; +} + +export interface MessageStatusAnnotation { + /** The entity is work-in-progress and subject to breaking changes. */ + workInProgress: boolean; +} + +export interface FieldStatusAnnotation { + /** The entity is work-in-progress and subject to breaking changes. */ + workInProgress: boolean; +} + +export interface StatusAnnotation { + /** The entity is work-in-progress and subject to breaking changes. */ + workInProgress: boolean; + /** The entity belongs to a package with the given version status. */ + packageVersionStatus: PackageVersionStatus; +} + +function createBaseFileStatusAnnotation(): FileStatusAnnotation { + return { workInProgress: false }; +} + +export const FileStatusAnnotation: MessageFns = { + encode(message: FileStatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.workInProgress !== false) { + writer.uint32(8).bool(message.workInProgress); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileStatusAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileStatusAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.workInProgress = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileStatusAnnotation { + return { workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false }; + }, + + toJSON(message: FileStatusAnnotation): unknown { + const obj: any = {}; + if (message.workInProgress !== false) { + obj.workInProgress = message.workInProgress; + } + return obj; + }, + + create, I>>(base?: I): FileStatusAnnotation { + return FileStatusAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FileStatusAnnotation { + const message = createBaseFileStatusAnnotation(); + message.workInProgress = object.workInProgress ?? false; + return message; + }, +}; + +function createBaseMessageStatusAnnotation(): MessageStatusAnnotation { + return { workInProgress: false }; +} + +export const MessageStatusAnnotation: MessageFns = { + encode(message: MessageStatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.workInProgress !== false) { + writer.uint32(8).bool(message.workInProgress); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MessageStatusAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageStatusAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.workInProgress = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageStatusAnnotation { + return { workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false }; + }, + + toJSON(message: MessageStatusAnnotation): unknown { + const obj: any = {}; + if (message.workInProgress !== false) { + obj.workInProgress = message.workInProgress; + } + return obj; + }, + + create, I>>(base?: I): MessageStatusAnnotation { + return MessageStatusAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MessageStatusAnnotation { + const message = createBaseMessageStatusAnnotation(); + message.workInProgress = object.workInProgress ?? false; + return message; + }, +}; + +function createBaseFieldStatusAnnotation(): FieldStatusAnnotation { + return { workInProgress: false }; +} + +export const FieldStatusAnnotation: MessageFns = { + encode(message: FieldStatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.workInProgress !== false) { + writer.uint32(8).bool(message.workInProgress); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldStatusAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldStatusAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.workInProgress = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldStatusAnnotation { + return { workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false }; + }, + + toJSON(message: FieldStatusAnnotation): unknown { + const obj: any = {}; + if (message.workInProgress !== false) { + obj.workInProgress = message.workInProgress; + } + return obj; + }, + + create, I>>(base?: I): FieldStatusAnnotation { + return FieldStatusAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FieldStatusAnnotation { + const message = createBaseFieldStatusAnnotation(); + message.workInProgress = object.workInProgress ?? false; + return message; + }, +}; + +function createBaseStatusAnnotation(): StatusAnnotation { + return { workInProgress: false, packageVersionStatus: 0 }; +} + +export const StatusAnnotation: MessageFns = { + encode(message: StatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.workInProgress !== false) { + writer.uint32(8).bool(message.workInProgress); + } + if (message.packageVersionStatus !== 0) { + writer.uint32(16).int32(message.packageVersionStatus); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StatusAnnotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusAnnotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.workInProgress = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.packageVersionStatus = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StatusAnnotation { + return { + workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false, + packageVersionStatus: isSet(object.packageVersionStatus) + ? packageVersionStatusFromJSON(object.packageVersionStatus) + : 0, + }; + }, + + toJSON(message: StatusAnnotation): unknown { + const obj: any = {}; + if (message.workInProgress !== false) { + obj.workInProgress = message.workInProgress; + } + if (message.packageVersionStatus !== 0) { + obj.packageVersionStatus = packageVersionStatusToJSON(message.packageVersionStatus); + } + return obj; + }, + + create, I>>(base?: I): StatusAnnotation { + return StatusAnnotation.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): StatusAnnotation { + const message = createBaseStatusAnnotation(); + message.workInProgress = object.workInProgress ?? false; + message.packageVersionStatus = object.packageVersionStatus ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts b/packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts new file mode 100644 index 00000000..7e885f3b --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts @@ -0,0 +1,211 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.7.7 +// protoc v6.32.1 +// source: xds/core/v3/context_params.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "xds.core.v3"; + +/** + * Additional parameters that can be used to select resource variants. These include any + * global context parameters, per-resource type client feature capabilities and per-resource + * type functional attributes. All per-resource type attributes will be `xds.resource.` + * prefixed and some of these are documented below: + * `xds.resource.listening_address`: The value is "IP:port" (e.g. "10.1.1.3:8080") which is + * the listening address of a Listener. Used in a Listener resource query. + */ +export interface ContextParams { + params: { [key: string]: string }; +} + +export interface ContextParams_ParamsEntry { + key: string; + value: string; +} + +function createBaseContextParams(): ContextParams { + return { params: {} }; +} + +export const ContextParams: MessageFns = { + encode(message: ContextParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.params).forEach(([key, value]) => { + ContextParams_ParamsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContextParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContextParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = ContextParams_ParamsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.params[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContextParams { + return { + params: isObject(object.params) + ? Object.entries(object.params).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: ContextParams): unknown { + const obj: any = {}; + if (message.params) { + const entries = Object.entries(message.params); + if (entries.length > 0) { + obj.params = {}; + entries.forEach(([k, v]) => { + obj.params[k] = v; + }); + } + } + return obj; + }, + + create, I>>(base?: I): ContextParams { + return ContextParams.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ContextParams { + const message = createBaseContextParams(); + message.params = Object.entries(object.params ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseContextParams_ParamsEntry(): ContextParams_ParamsEntry { + return { key: "", value: "" }; +} + +export const ContextParams_ParamsEntry: MessageFns = { + encode(message: ContextParams_ParamsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContextParams_ParamsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContextParams_ParamsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContextParams_ParamsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: ContextParams_ParamsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): ContextParams_ParamsEntry { + return ContextParams_ParamsEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ContextParams_ParamsEntry { + const message = createBaseContextParams_ParamsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index 2e535027..ff00b7a9 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -13,6 +13,7 @@ import { fileURLToPath } from "url"; import { PHASE_PRODUCTION_BUILD, ROUTES_MANIFEST } from "./constants.js"; import type { NextConfigComplete } from "next/dist/server/config-shared.js"; +import { execSync, spawnSync } from "node:child_process"; // fs-extra is CJS, readJson can't be imported using shorthand export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsSync, ensureDir } = @@ -102,7 +103,7 @@ export async function writeRouteManifest( } /** - * Copy static assets and other resources into the standlone directory, also generates the bundle.yaml + * Copy static assets and other resources into the standalone directory, also generates the bundle.yaml * @param rootDir The root directory of the uploaded source code. * @param outputBundleOptions The target location of built artifacts in the output bundle. * @param nextBuildDirectory The location of the .next directory. @@ -116,12 +117,13 @@ export async function generateBuildOutput( const staticDirectory = join(nextBuildDirectory, "static"); await Promise.all([ copy(staticDirectory, opts.outputStaticDirectoryPath, { overwrite: true }), - copyResources(appDir, opts.outputDirectoryAppPath, opts.bundleYamlPath), + //copyResources(appDir, opts.outputDirectoryAppPath, opts.bundleYamlPath), ]); // generateBundleYaml creates the output directory (if it does not already exist). // We need to make sure it is gitignored. const normalizedBundleDir = normalize(relative(rootDir, opts.outputDirectoryBasePath)); updateOrCreateGitignore(rootDir, [`/${normalizedBundleDir}/`]); + await copy(join(appDir, "node_modules/@apphosting/adapter-nextjs"), join(opts.outputDirectoryAppPath, "adapter"), { overwrite: true }); return; } @@ -135,7 +137,8 @@ async function copyResources( const appDirExists = await exists(appDir); if (!appDirExists) return; const pathsToCopy = await readdir(appDir); - for (const path of pathsToCopy) { + console.log(pathsToCopy); + await Promise.all(pathsToCopy.map(async (path) => { const isbundleYamlDir = join(appDir, path) === dirname(bundleYamlPath); const existsInOutputBundle = await exists(join(outputBundleAppDir, path)); // Keep apphosting.yaml files in the root directory still, as later steps expect them to be there @@ -143,7 +146,7 @@ async function copyResources( if (!isbundleYamlDir && !existsInOutputBundle && !isApphostingYaml) { await copy(join(appDir, path), join(outputBundleAppDir, path)); } - } + })); return; } @@ -171,7 +174,7 @@ export async function generateBundleYaml( const outputBundle: OutputBundleConfig = { version: "v1", runConfig: { - runCommand: `node ${normalize(relative(cwd, opts.serverFilePath))}`, + runCommand: `cd ${normalize(relative(cwd, opts.outputDirectoryAppPath))} && node ./adapter/dist/bin/serve.cjs`, }, metadata: { ...adapterMetadata, diff --git a/packages/@apphosting/adapter-nextjs/tsconfig.json b/packages/@apphosting/adapter-nextjs/tsconfig.json index 0b56b766..607d9ffd 100644 --- a/packages/@apphosting/adapter-nextjs/tsconfig.json +++ b/packages/@apphosting/adapter-nextjs/tsconfig.json @@ -8,6 +8,7 @@ "include": [ "src/index.ts", "src/bin/*.ts", + "src/bin/*.cts" ], "exclude": [ "src/*.spec.ts" diff --git a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/input.gql b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/input.gql index 037e0876..0396f16c 100644 --- a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/input.gql +++ b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/input.gql @@ -59,6 +59,14 @@ input Product_Data { """ price: Float """ + ✨ `_expr` server value variant of `price` (✨ Generated from Field `Product`.`price` of type `Float!`) + """ + price_expr: Float_Expr + """ + ✨ `_update` server value variant of `price` (✨ Generated from Field `Product`.`price` of type `Float!`) + """ + price_update: [Float_Update!] + """ ✨ Generated from Field `Product`.`productID` of type `String!` """ productID: String @@ -138,6 +146,79 @@ input Product_FirstRow { where: Product_Filter } """ +✨ Generated having input type for table 'Product'. This input allows you to filter groups during aggregate queries using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. +""" +input Product_Having { + """ + Apply multiple Having conditions using `AND` logic. + """ + _and: [Product_Having!] + """ + Whether to apply DISTINCT to the aggregate function. + """ + _distinct: Boolean + """ + Negate the result of the provided Having condition. + """ + _not: Product_Having + """ + Apply multiple Having conditions using `OR` logic. + """ + _or: [Product_Having!] + """ + ✨ Generated from Field `Product`.`_count` of type `Int!` + """ + _count: Int_Filter + """ + ✨ Generated from Field `Product`.`descriptionEmbedding_count` of type `Int!` + """ + descriptionEmbedding_count: Int_Filter + """ + ✨ Generated from Field `Product`.`description_count` of type `Int!` + """ + description_count: Int_Filter + """ + ✨ Generated from Field `Product`.`id_count` of type `Int!` + """ + id_count: Int_Filter + """ + ✨ Generated from Field `Product`.`nameEmbedding_count` of type `Int!` + """ + nameEmbedding_count: Int_Filter + """ + ✨ Generated from Field `Product`.`name_count` of type `Int!` + """ + name_count: Int_Filter + """ + ✨ Generated from Field `Product`.`price_count` of type `Int!` + """ + price_count: Int_Filter + """ + ✨ Generated from Field `Product`.`productID_count` of type `Int!` + """ + productID_count: Int_Filter + """ + ✨ Generated from Field `Product`.`productSlug_count` of type `Int!` + """ + productSlug_count: Int_Filter + """ + ✨ Generated from Field `Product`.`price_sum` of type `Float` + """ + price_sum: Float_Filter + """ + ✨ Generated from Field `Product`.`price_avg` of type `Float` + """ + price_avg: Float_Filter + """ + ✨ Generated from Field `Product`.`price_min` of type `Float` + """ + price_min: Float_Filter + """ + ✨ Generated from Field `Product`.`price_max` of type `Float` + """ + price_max: Float_Filter +} +""" ✨ Generated key input type for table 'Product'. It represents the primary key fields used to uniquely identify a row in the table. """ input Product_Key { @@ -199,6 +280,58 @@ input Product_Order { ✨ Generated from Field `Product`.`productSlug` of type `String!` """ productSlug: OrderDirection + """ + ✨ Generated from Field `Product`.`_count` of type `Int!` + """ + _count: OrderDirection + """ + ✨ Generated from Field `Product`.`descriptionEmbedding_count` of type `Int!` + """ + descriptionEmbedding_count: OrderDirection + """ + ✨ Generated from Field `Product`.`description_count` of type `Int!` + """ + description_count: OrderDirection + """ + ✨ Generated from Field `Product`.`id_count` of type `Int!` + """ + id_count: OrderDirection + """ + ✨ Generated from Field `Product`.`nameEmbedding_count` of type `Int!` + """ + nameEmbedding_count: OrderDirection + """ + ✨ Generated from Field `Product`.`name_count` of type `Int!` + """ + name_count: OrderDirection + """ + ✨ Generated from Field `Product`.`price_count` of type `Int!` + """ + price_count: OrderDirection + """ + ✨ Generated from Field `Product`.`productID_count` of type `Int!` + """ + productID_count: OrderDirection + """ + ✨ Generated from Field `Product`.`productSlug_count` of type `Int!` + """ + productSlug_count: OrderDirection + """ + ✨ Generated from Field `Product`.`price_sum` of type `Float` + """ + price_sum: OrderDirection + """ + ✨ Generated from Field `Product`.`price_avg` of type `Float` + """ + price_avg: OrderDirection + """ + ✨ Generated from Field `Product`.`price_min` of type `Float` + """ + price_min: OrderDirection + """ + ✨ Generated from Field `Product`.`price_max` of type `Float` + """ + price_max: OrderDirection } """ ✨ Generated data input type for table 'Review'. It includes all necessary fields for creating or upserting rows into table. @@ -241,6 +374,10 @@ input Review_Data { """ createdAt_expr: Date_Expr """ + ✨ `_update` server value variant of `createdAt` (✨ Generated from Field `Review`.`createdAt` of type `Date!`) + """ + createdAt_update: [Date_Update!] + """ ✨ Generated from Field `Review`.`productID` of type `String!` """ productID: String @@ -269,6 +406,14 @@ input Review_Data { """ rating: Float """ + ✨ `_expr` server value variant of `rating` (✨ Generated from Field `Review`.`rating` of type `Float!`) + """ + rating_expr: Float_Expr + """ + ✨ `_update` server value variant of `rating` (✨ Generated from Field `Review`.`rating` of type `Float!`) + """ + rating_update: [Float_Update!] + """ ✨ Generated from Field `Review`.`userID` of type `String!` """ userID: String @@ -356,6 +501,95 @@ input Review_FirstRow { where: Review_Filter } """ +✨ Generated having input type for table 'Review'. This input allows you to filter groups during aggregate queries using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. +""" +input Review_Having { + """ + Apply multiple Having conditions using `AND` logic. + """ + _and: [Review_Having!] + """ + Whether to apply DISTINCT to the aggregate function. + """ + _distinct: Boolean + """ + Negate the result of the provided Having condition. + """ + _not: Review_Having + """ + Apply multiple Having conditions using `OR` logic. + """ + _or: [Review_Having!] + """ + ✨ Generated from Field `Review`.`_count` of type `Int!` + """ + _count: Int_Filter + """ + ✨ Generated from Field `Review`.`contentEmbedding_count` of type `Int!` + """ + contentEmbedding_count: Int_Filter + """ + ✨ Generated from Field `Review`.`content_count` of type `Int!` + """ + content_count: Int_Filter + """ + ✨ Generated from Field `Review`.`createdAt_count` of type `Int!` + """ + createdAt_count: Int_Filter + """ + ✨ Generated from Field `Review`.`id_count` of type `Int!` + """ + id_count: Int_Filter + """ + ✨ Generated from Field `Review`.`productID_count` of type `Int!` + """ + productID_count: Int_Filter + """ + ✨ Generated from Field `Review`.`productName_count` of type `Int!` + """ + productName_count: Int_Filter + """ + ✨ Generated from Field `Review`.`productSlug_count` of type `Int!` + """ + productSlug_count: Int_Filter + """ + ✨ Generated from Field `Review`.`rating_count` of type `Int!` + """ + rating_count: Int_Filter + """ + ✨ Generated from Field `Review`.`userID_count` of type `Int!` + """ + userID_count: Int_Filter + """ + ✨ Generated from Field `Review`.`userName_count` of type `Int!` + """ + userName_count: Int_Filter + """ + ✨ Generated from Field `Review`.`rating_sum` of type `Float` + """ + rating_sum: Float_Filter + """ + ✨ Generated from Field `Review`.`rating_avg` of type `Float` + """ + rating_avg: Float_Filter + """ + ✨ Generated from Field `Review`.`createdAt_min` of type `Date` + """ + createdAt_min: Date_Filter + """ + ✨ Generated from Field `Review`.`rating_min` of type `Float` + """ + rating_min: Float_Filter + """ + ✨ Generated from Field `Review`.`createdAt_max` of type `Date` + """ + createdAt_max: Date_Filter + """ + ✨ Generated from Field `Review`.`rating_max` of type `Float` + """ + rating_max: Float_Filter +} +""" ✨ Generated key input type for table 'Review'. It represents the primary key fields used to uniquely identify a row in the table. """ input Review_Key { @@ -425,4 +659,72 @@ input Review_Order { ✨ Generated from Field `Review`.`userName` of type `String!` """ userName: OrderDirection + """ + ✨ Generated from Field `Review`.`_count` of type `Int!` + """ + _count: OrderDirection + """ + ✨ Generated from Field `Review`.`contentEmbedding_count` of type `Int!` + """ + contentEmbedding_count: OrderDirection + """ + ✨ Generated from Field `Review`.`content_count` of type `Int!` + """ + content_count: OrderDirection + """ + ✨ Generated from Field `Review`.`createdAt_count` of type `Int!` + """ + createdAt_count: OrderDirection + """ + ✨ Generated from Field `Review`.`id_count` of type `Int!` + """ + id_count: OrderDirection + """ + ✨ Generated from Field `Review`.`productID_count` of type `Int!` + """ + productID_count: OrderDirection + """ + ✨ Generated from Field `Review`.`productName_count` of type `Int!` + """ + productName_count: OrderDirection + """ + ✨ Generated from Field `Review`.`productSlug_count` of type `Int!` + """ + productSlug_count: OrderDirection + """ + ✨ Generated from Field `Review`.`rating_count` of type `Int!` + """ + rating_count: OrderDirection + """ + ✨ Generated from Field `Review`.`userID_count` of type `Int!` + """ + userID_count: OrderDirection + """ + ✨ Generated from Field `Review`.`userName_count` of type `Int!` + """ + userName_count: OrderDirection + """ + ✨ Generated from Field `Review`.`rating_sum` of type `Float` + """ + rating_sum: OrderDirection + """ + ✨ Generated from Field `Review`.`rating_avg` of type `Float` + """ + rating_avg: OrderDirection + """ + ✨ Generated from Field `Review`.`createdAt_min` of type `Date` + """ + createdAt_min: OrderDirection + """ + ✨ Generated from Field `Review`.`rating_min` of type `Float` + """ + rating_min: OrderDirection + """ + ✨ Generated from Field `Review`.`createdAt_max` of type `Date` + """ + createdAt_max: OrderDirection + """ + ✨ Generated from Field `Review`.`rating_max` of type `Float` + """ + rating_max: OrderDirection } diff --git a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql index e6047c25..307ef99f 100644 --- a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql +++ b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql @@ -1,6 +1,6 @@ extend type Mutation { """ - ✨ Insert a single `Product` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert a single `Product` into the table and return its key. Columns not specified in `data` will receive defaults (e.g. `null`). """ product_insert( """ @@ -9,7 +9,7 @@ extend type Mutation { data: Product_Data! ): Product_KeyOutput! @fdc_generated(from: "Product", purpose: INSERT_SINGLE) """ - ✨ Insert a single `Review` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert a single `Review` into the table and return its key. Columns not specified in `data` will receive defaults (e.g. `null`). """ review_insert( """ @@ -18,7 +18,7 @@ extend type Mutation { data: Review_Data! ): Review_KeyOutput! @fdc_generated(from: "Review", purpose: INSERT_SINGLE) """ - ✨ Insert `Product` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert `Product` objects into the table and return their keys. Columns not specified in `data` will receive defaults (e.g. `null`). """ product_insertMany( """ @@ -27,7 +27,7 @@ extend type Mutation { data: [Product_Data!]! ): [Product_KeyOutput!]! @fdc_generated(from: "Product", purpose: INSERT_MULTIPLE) """ - ✨ Insert `Review` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert `Review` objects into the table and return their keys. Columns not specified in `data` will receive defaults (e.g. `null`). """ review_insertMany( """ @@ -36,7 +36,7 @@ extend type Mutation { data: [Review_Data!]! ): [Review_KeyOutput!]! @fdc_generated(from: "Review", purpose: INSERT_MULTIPLE) """ - ✨ Insert or update a single `Product` into the table, based on the primary key. Returns the key of the newly inserted `Product`. + ✨ Insert or update a single `Product` into the table, based on the primary key. Returns the key of the newly inserted or existing updated `Product`. """ product_upsert( """ @@ -45,7 +45,7 @@ extend type Mutation { data: Product_Data! ): Product_KeyOutput! @fdc_generated(from: "Product", purpose: UPSERT_SINGLE) """ - ✨ Insert or update a single `Review` into the table, based on the primary key. Returns the key of the newly inserted `Review`. + ✨ Insert or update a single `Review` into the table, based on the primary key. Returns the key of the newly inserted or existing updated `Review`. """ review_upsert( """ @@ -54,7 +54,7 @@ extend type Mutation { data: Review_Data! ): Review_KeyOutput! @fdc_generated(from: "Review", purpose: UPSERT_SINGLE) """ - ✨ Insert or update `Product` objects into the table, based on the primary key. Returns the key of the newly inserted `Product`. + ✨ Insert or update `Product` objects into the table, based on the primary key. Returns the key of the newly inserted or existing updated `Product`. """ product_upsertMany( """ @@ -63,7 +63,7 @@ extend type Mutation { data: [Product_Data!]! ): [Product_KeyOutput!]! @fdc_generated(from: "Product", purpose: UPSERT_MULTIPLE) """ - ✨ Insert or update `Review` objects into the table, based on the primary key. Returns the key of the newly inserted `Review`. + ✨ Insert or update `Review` objects into the table, based on the primary key. Returns the key of the newly inserted or existing updated `Review`. """ review_upsertMany( """ @@ -72,7 +72,7 @@ extend type Mutation { data: [Review_Data!]! ): [Review_KeyOutput!]! @fdc_generated(from: "Review", purpose: UPSERT_MULTIPLE) """ - ✨ Update a single `Product` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. + ✨ Update a single `Product` based on `id`, `key` or `first`, setting columns specified in `data`. Returns the key of the updated `Product` or `null` if not found. """ product_update( """ @@ -96,7 +96,7 @@ extend type Mutation { data: Product_Data! ): Product_KeyOutput @fdc_generated(from: "Product", purpose: UPDATE_SINGLE) """ - ✨ Update a single `Review` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. + ✨ Update a single `Review` based on `id`, `key` or `first`, setting columns specified in `data`. Returns the key of the updated `Review` or `null` if not found. """ review_update( """ diff --git a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/query.gql b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/query.gql index 9483d11f..04250e08 100644 --- a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/query.gql +++ b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/query.gql @@ -38,7 +38,7 @@ extend type Query { first: Review_FirstRow ): Review @fdc_generated(from: "Review", purpose: QUERY_SINGLE) """ - ✨ List `Product` objects in the table, optionally filtered by `where` conditions. + ✨ List `Product` objects in the table and return selected fields, optionally filtered by `where` conditions """ products( """ @@ -60,9 +60,19 @@ extend type Query { Maximum number of rows to return (defaults to 100 rows). """ limit: Int = 100 + + """ + Set to true to return distinct results. + """ + distinct: Boolean = false + + """ + Filter condition to apply to the groups of aggregate queries. + """ + having: Product_Having ): [Product!]! @fdc_generated(from: "Product", purpose: QUERY_MULTIPLE) """ - ✨ List `Review` objects in the table, optionally filtered by `where` conditions. + ✨ List `Review` objects in the table and return selected fields, optionally filtered by `where` conditions """ reviews( """ @@ -84,9 +94,19 @@ extend type Query { Maximum number of rows to return (defaults to 100 rows). """ limit: Int = 100 + + """ + Set to true to return distinct results. + """ + distinct: Boolean = false + + """ + Filter condition to apply to the groups of aggregate queries. + """ + having: Review_Having ): [Review!]! @fdc_generated(from: "Review", purpose: QUERY_MULTIPLE) """ - ✨ List `Product` objects ordered by vector similarity between the `descriptionEmbedding` field and `compare_embed`. + ✨ List `Product` objects and return selected fields, ordered by vector similarity between the `descriptionEmbedding` field and `compare_embed`. (Alternatively, `compare` can be used if the input is a raw Vector.) """ products_descriptionEmbedding_similarity( @@ -121,7 +141,7 @@ extend type Query { limit: Int = 100 ): [Product!]! @fdc_generated(from: "Product.descriptionEmbedding", purpose: QUERY_MULTIPLE_BY_SIMILARITY) """ - ✨ List `Product` objects ordered by vector similarity between the `nameEmbedding` field and `compare_embed`. + ✨ List `Product` objects and return selected fields, ordered by vector similarity between the `nameEmbedding` field and `compare_embed`. (Alternatively, `compare` can be used if the input is a raw Vector.) """ products_nameEmbedding_similarity( @@ -156,7 +176,7 @@ extend type Query { limit: Int = 100 ): [Product!]! @fdc_generated(from: "Product.nameEmbedding", purpose: QUERY_MULTIPLE_BY_SIMILARITY) """ - ✨ List `Review` objects ordered by vector similarity between the `contentEmbedding` field and `compare_embed`. + ✨ List `Review` objects and return selected fields, ordered by vector similarity between the `contentEmbedding` field and `compare_embed`. (Alternatively, `compare` can be used if the input is a raw Vector.) """ reviews_contentEmbedding_similarity( diff --git a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql new file mode 100644 index 00000000..981266ff --- /dev/null +++ b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql @@ -0,0 +1,242 @@ +extend type Product { + """ + Implicit metadata field that cannot be written. It provides extra information about query results. + """ + _metadata: _Metadata @fdc_generated(from: "Product", purpose: METADATA_FIELD) + """ + ✨ Count the number of rows in the `Product` table. + """ + _count: Int! @fdc_generated(from: "Product.", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `descriptionEmbedding` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + descriptionEmbedding_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.descriptionEmbedding", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `description` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + description_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.description", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `id` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + id_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.id", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `nameEmbedding` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + nameEmbedding_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.nameEmbedding", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `name` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + name_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.name", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `price` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + price_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.price", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `productID` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + productID_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.productID", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Product` table where the `productSlug` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + productSlug_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Product.productSlug", purpose: QUERY_COUNT) + """ + ✨ Sum the `price` field in the `Product` table. + """ + price_sum( + """ + Set to true to sum the distinct values. + """ + distinct: Boolean = false + ): Float @fdc_generated(from: "Product.price", purpose: QUERY_SUM) + """ + ✨ Average the `price` field in the `Product` table. + """ + price_avg( + """ + Set to true to average the distinct values. + """ + distinct: Boolean = false + ): Float @fdc_generated(from: "Product.price", purpose: QUERY_AVG) + """ + ✨ Minimum of the `price` field in the `Product` table. + """ + price_min: Float @fdc_generated(from: "Product.price", purpose: QUERY_MIN) + """ + ✨ Maximum of the `price` field in the `Product` table. + """ + price_max: Float @fdc_generated(from: "Product.price", purpose: QUERY_MAX) +} +extend type Review { + """ + Implicit metadata field that cannot be written. It provides extra information about query results. + """ + _metadata: _Metadata @fdc_generated(from: "Review", purpose: METADATA_FIELD) + """ + ✨ Count the number of rows in the `Review` table. + """ + _count: Int! @fdc_generated(from: "Review.", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `contentEmbedding` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + contentEmbedding_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.contentEmbedding", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `content` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + content_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.content", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `createdAt` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + createdAt_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.createdAt", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `id` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + id_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.id", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `productID` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + productID_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.productID", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `productName` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + productName_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.productName", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `productSlug` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + productSlug_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.productSlug", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `rating` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + rating_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.rating", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `userID` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + userID_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.userID", purpose: QUERY_COUNT) + """ + ✨ Count the number of rows in the `Review` table where the `userName` field is non-null. Pass the `distinct` argument to instead count the number of distinct values. + """ + userName_count( + """ + Set to true to count the number of distinct values. + """ + distinct: Boolean = false + ): Int! @fdc_generated(from: "Review.userName", purpose: QUERY_COUNT) + """ + ✨ Sum the `rating` field in the `Review` table. + """ + rating_sum( + """ + Set to true to sum the distinct values. + """ + distinct: Boolean = false + ): Float @fdc_generated(from: "Review.rating", purpose: QUERY_SUM) + """ + ✨ Average the `rating` field in the `Review` table. + """ + rating_avg( + """ + Set to true to average the distinct values. + """ + distinct: Boolean = false + ): Float @fdc_generated(from: "Review.rating", purpose: QUERY_AVG) + """ + ✨ Minimum of the `createdAt` field in the `Review` table. + """ + createdAt_min: Date @fdc_generated(from: "Review.createdAt", purpose: QUERY_MIN) + """ + ✨ Minimum of the `rating` field in the `Review` table. + """ + rating_min: Float @fdc_generated(from: "Review.rating", purpose: QUERY_MIN) + """ + ✨ Maximum of the `createdAt` field in the `Review` table. + """ + createdAt_max: Date @fdc_generated(from: "Review.createdAt", purpose: QUERY_MAX) + """ + ✨ Maximum of the `rating` field in the `Review` table. + """ + rating_max: Float @fdc_generated(from: "Review.rating", purpose: QUERY_MAX) +} diff --git a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/prelude.gql b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/prelude.gql index bc21c044..28894fd7 100644 --- a/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/prelude.gql +++ b/starters/nextjs/shopify-ecommerce/dataconnect/.dataconnect/schema/prelude.gql @@ -1,5 +1,5 @@ "AccessLevel specifies coarse access policies for common situations." -enum AccessLevel { +enum AccessLevel @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { """ This operation is accessible to anyone, with or without authentication. Equivalent to: `@auth(expr: "true")` @@ -54,20 +54,36 @@ directive @auth( Exactly one of `level` and `expr` should be specified. """ expr: Boolean_Expr @fdc_oneOf(required: true) + """ + If the `@auth` on this operation is considered insecure, then developer + acknowledgement is required to deploy this operation, for new operations. + `@auth` is considered insecure if `level: PUBLIC`, or if + `level: USER/USER_ANON/USER_EMAIL_VERIFIED` and `auth.uid` is not referenced + in the operation. + If `insecureReason` is set, no further developer acknowledgement is needed. + """ + insecureReason: String ) on QUERY | MUTATION - """ Require that this mutation always run in a DB transaction. Mutations with `@transaction` are guaranteed to either fully succeed or fully -fail. If any of the fields within the transaction fails, the entire transaction -is rolled back. From a client standpoint, any failure behaves as if the entire -request had failed with a request error and execution had not begun. +fail. Upon the first error in a transaction (either an execution error or failed +`@check`), the transaction will be rolled back. In the GraphQL response, all +fields within the transaction will be `null`, each with an error raised. + +- Fields that have been already evaluated will be nullified due to the rollback + and a "(rolled back)" error will be reported on each of them. +- The execution error or failed `@check` will be reported on the current field. +- Subsequent fields will not be executed. An `(aborted)` error will be reported + on each subsequent field. Mutations without `@transaction` would execute each root field one after -another in sequence. It surfaces any errors as partial [field errors](https://spec.graphql.org/October2021/#sec-Errors.Field-errors), -but not impacts the subsequent executions. +another in sequence. They surface any errors as partial +[field errors](https://spec.graphql.org/October2021/#sec-Errors.Field-errors), +but does not impact the execution of subsequent fields. However, failed +`@check`s still terminate the entire operation. The `@transaction` directive cannot be added to queries for now. Currently, queries cannot fail partially, the response data is not guaranteed @@ -75,6 +91,75 @@ to be a consistent snapshot. """ directive @transaction on MUTATION +""" +Redact a part of the response from the client. + +Redacted fields are still evaluated for side effects (including data changes and +`@check`) and the results are still available to later steps in CEL expressions +(via `response.fieldName`). +""" +directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + +""" +Ensure this field is present and is not null or `[]`, or abort the request / transaction. + +A CEL expression, `expr` is used to test the field value. It defaults to +rejecting null and `[]` but a custom expression can be provided instead. + +If the field occurs multiple times (i.e. directly or indirectly nested under a +list), `expr` will be executed once for each occurrence and `@check` succeeds if +all values succeed. `@check` fails when the field is not present at all (i.e. +all ancestor paths contain `null` or `[]`), unless `optional` is true. + +If a `@check` fails in a mutation, the top-level field containing it will be +replaced with a partial error, whose message can be customzied via the `message` +argument. Each subsequent top-level fields will return an aborted error (i.e. +not executed). To rollback previous steps, see `@transaction`. +""" +directive @check( + """ + The CEL expression to test the field value (or values if nested under a list). + + Within the CEL expression, a special value `this` evaluates to the field that + this directive is attached to. If this field occurs multiple times because + any ancestor is a list, each occurrence is tested with `this` bound to each + value. When the field itself is a list or object, `this` follows the same + structure (including all descendants selected in case of objects). + + For any given path, if an ancestor is `null` or `[]`, the field will not be + reached and the CEL evaluation will be skipped for that path. In other words, + evaluation only takes place when `this` is `null` or non-null, but never + undefined. (See also the `optional` argument.) + """ + expr: Boolean_Expr! = "!(this in [null, []])" + """ + The error message to return to the client if the check fails. + + Defaults to "permission denied" if not specified. + """ + message: String! = "permission denied" + """ + Whether the check should pass or fail (default) when the field is not present. + + A field will not be reached at a given path if its parent or any ancestor is + `[]` or `null`. When this happens to all paths, the field will not be present + anywhere in the response tree. In other words, `expr` is evaluated 0 times. + By default, @check will automatically fail in this case. Set this argument to + `true` to make it pass even if no tests are run (a.k.a. "vacuously true"). + """ + optional: Boolean = false +) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT + +""" +Marks an element of a GraphQL operation as no longer supported for client use. +The Firebase Data Connect backend will continue supporting this element, +but it will no longer be visible in the generated SDKs. +""" +directive @retired( + "Provides the reason for retirement." + reason: String +) on QUERY | MUTATION | FIELD | VARIABLE_DEFINITION + "Query filter criteria for `String` scalar fields." input String_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." @@ -120,6 +205,25 @@ input String_Filter { `LIKE '%value'` """ endsWith: String + """ + Match based on the provided pattern. + """ + pattern: String_Pattern +} + +input String_Pattern { + """ + Match using LIKE semantics (https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE) + """ + like: String @fdc_oneOf + """ + Match against a POSIX regular expression. + """ + regex: String @fdc_oneOf + """ + If true, match patterns case-insensitively. + """ + ignoreCase: Boolean } "Query filter criteris for `[String!]` scalar fields." @@ -139,9 +243,19 @@ input UUID_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." isNull: Boolean "Match if field is exactly equal to provided value." - eq: UUID + eq: UUID @fdc_oneOf(group: "eq") + """ + Match if field is exactly equal to the result of the provided server value + expression. + """ + eq_expr: UUID_Expr @fdc_oneOf(group: "eq") "Match if field is not equal to provided value." - ne: UUID + ne: UUID @fdc_oneOf(group: "ne") + """ + Match if field is not equal to the result of the provided server value + expression. + """ + ne_expr: UUID_Expr @fdc_oneOf(group: "ne") "Match if field value is among the provided list of values." in: [UUID!] "Match if field value is not among the provided list of values." @@ -165,21 +279,51 @@ input Int_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." isNull: Boolean "Match if field is exactly equal to provided value." - eq: Int + eq: Int @fdc_oneOf(group: "eq") + """ + Match if field is exactly equal to the result of the provided server value + expression. + """ + eq_expr: Int_Expr @fdc_oneOf(group: "eq") "Match if field is not equal to provided value." - ne: Int + ne: Int @fdc_oneOf(group: "ne") + """ + Match if field is not equal to the result of the provided server value + expression. + """ + ne_expr: Int_Expr @fdc_oneOf(group: "ne") "Match if field value is among the provided list of values." in: [Int!] "Match if field value is not among the provided list of values." nin: [Int!] "Match if field value is greater than the provided value." - gt: Int + gt: Int @fdc_oneOf(group: "gt") + """ + Match if field value is greater than the result of the provided server value + expression. + """ + gt_expr: Int_Expr @fdc_oneOf(group: "gt") "Match if field value is greater than or equal to the provided value." - ge: Int + ge: Int @fdc_oneOf(group: "ge") + """ + Match if field value is greater than or equal to the result of the provided + server value expression. + """ + ge_expr: Int_Expr @fdc_oneOf(group: "ge") "Match if field value is less than the provided value." - lt: Int + lt: Int @fdc_oneOf(group: "lt") + """ + Match if field value is less than the result of the provided server value + expression. + """ + lt_expr: Int_Expr @fdc_oneOf(group: "lt") "Match if field value is less than or equal to the provided value." - le: Int + le: Int @fdc_oneOf(group: "le") + """ + Match if field value is less than or equal to the result of the provided + server value expression. + """ + le_expr: Int_Expr @fdc_oneOf(group: "le") } "Query filter criteris for `[Int!]` scalar fields." @@ -199,21 +343,51 @@ input Int64_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." isNull: Boolean "Match if field is exactly equal to provided value." - eq: Int64 + eq: Int64 @fdc_oneOf(group: "eq") + """ + Match if field is exactly equal to the result of the provided server value + expression. + """ + eq_expr: Int64_Expr @fdc_oneOf(group: "eq") "Match if field is not equal to provided value." - ne: Int64 + ne: Int64 @fdc_oneOf(group: "ne") + """ + Match if field is not equal to the result of the provided server value + expression. + """ + ne_expr: Int64_Expr @fdc_oneOf(group: "ne") "Match if field value is among the provided list of values." in: [Int64!] "Match if field value is not among the provided list of values." nin: [Int64!] "Match if field value is greater than the provided value." - gt: Int64 + gt: Int64 @fdc_oneOf(group: "gt") + """ + Match if field value is greater than the result of the provided server value + expression. + """ + gt_expr: Int64_Expr @fdc_oneOf(group: "gt") "Match if field value is greater than or equal to the provided value." - ge: Int64 + ge: Int64 @fdc_oneOf(group: "ge") + """ + Match if field value is greater than or equal to the result of the provided + server value expression. + """ + ge_expr: Int64_Expr @fdc_oneOf(group: "ge") "Match if field value is less than the provided value." - lt: Int64 + lt: Int64 @fdc_oneOf(group: "lt") + """ + Match if field value is less than the result of the provided server value + expression. + """ + lt_expr: Int64_Expr @fdc_oneOf(group: "lt") "Match if field value is less than or equal to the provided value." - le: Int64 + le: Int64 @fdc_oneOf(group: "le") + """ + Match if field value is less than or equal to the result of the provided + server value expression. + """ + le_expr: Int64_Expr @fdc_oneOf(group: "le") } "Query filter criteria for `[Int64!]` scalar fields." @@ -233,21 +407,51 @@ input Float_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." isNull: Boolean "Match if field is exactly equal to provided value." - eq: Float + eq: Float @fdc_oneOf(group: "eq") + """ + Match if field is exactly equal to the result of the provided server value + expression. + """ + eq_expr: Float_Expr @fdc_oneOf(group: "eq") "Match if field is not equal to provided value." - ne: Float + ne: Float @fdc_oneOf(group: "ne") + """ + Match if field is not equal to the result of the provided server value + expression. + """ + ne_expr: Float_Expr @fdc_oneOf(group: "ne") "Match if field value is among the provided list of values." in: [Float!] "Match if field value is not among the provided list of values." nin: [Float!] "Match if field value is greater than the provided value." - gt: Float + gt: Float @fdc_oneOf(group: "gt") + """ + Match if field value is greater than the result of the provided server value + expression. + """ + gt_expr: Float_Expr @fdc_oneOf(group: "gt") "Match if field value is greater than or equal to the provided value." - ge: Float + ge: Float @fdc_oneOf(group: "ge") + """ + Match if field value is greater than or equal to the result of the provided + server value expression. + """ + ge_expr: Float_Expr @fdc_oneOf(group: "ge") "Match if field value is less than the provided value." - lt: Float + lt: Float @fdc_oneOf(group: "lt") + """ + Match if field value is less than the result of the provided server value + expression. + """ + lt_expr: Float_Expr @fdc_oneOf(group: "lt") "Match if field value is less than or equal to the provided value." - le: Float + le: Float @fdc_oneOf(group: "le") + """ + Match if field value is less than or equal to the result of the provided + server value expression. + """ + le_expr: Float_Expr @fdc_oneOf(group: "le") } "Query filter criteria for `[Float!]` scalar fields." @@ -267,9 +471,15 @@ input Boolean_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." isNull: Boolean "Match if field is exactly equal to provided value." - eq: Boolean + eq: Boolean @fdc_oneOf(group: "eq") + "Match if field is equal to the result of the provided expression." + eq_expr: Boolean_Expr @fdc_oneOf(group: "eq") "Match if field is not equal to provided value." - ne: Boolean + ne: Boolean @fdc_oneOf(group: "ne") + """ + Match if field does not match the result of the provided expression. + """ + ne_expr: Boolean_Expr @fdc_oneOf(group: "ne") "Match if field value is among the provided list of values." in: [Boolean!] "Match if field value is not among the provided list of values." @@ -293,9 +503,19 @@ input Any_Filter { "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." isNull: Boolean "Match if field is exactly equal to provided value." - eq: Any + eq: Any @fdc_oneOf(group: "eq") + """ + Match if field is exactly equal to the result of the provided server value + expression. + """ + eq_expr: Any_Expr @fdc_oneOf(group: "eq") "Match if field is not equal to provided value." - ne: Any + ne: Any @fdc_oneOf(group: "ne") + """ + Match if field is not equal to the result of the provided server value + expression. + """ + ne_expr: Any_Expr @fdc_oneOf(group: "ne") "Match if field value is among the provided list of values." in: [Any!] "Match if field value is not among the provided list of values." @@ -314,6 +534,50 @@ input Any_ListFilter { excludesAll: [Any!] } +""" +Mark a string field as searchable. +When this directive is added, the field will be indexed for full-text search, +and a _search field will be generated at the query root. +This directive accepts a `language` argument that defaults to `"english"` in +case no value is specified. +See: +- go/fdc-full-text-search +""" +directive @searchable( + """ + Language of the fields that you are searching over can be specified here + (e.g. "french", "spanish", etc.). + Defaults to "english" if not specified. + """ + language: String = "english") on FIELD_DEFINITION + +extend type _Metadata { + # During full text search, the relevance of the query term to this row. + # In other cases, this field is not set. + relevance: Float +} + + +enum Search_QueryFormat @fdc_forbiddenAsFieldType { + """ + Allows search engine style semantics (e.g. quoted strings, AND and OR). + """ + QUERY, + """ + Splits the query into words and does ANDs between them. + """ + PLAIN, + """ + Matches an exact phrase. Requires the words to be in the same order (i.e. "brown + dog" will not match "brown and red dog"). + """ + PHRASE, + """ + Create complex queries using the full set of tsquery operators. + """ + ADVANCED, +} + """ (Internal) A string that uniquely identifies a type, field, and so on. @@ -326,15 +590,28 @@ scalar SchemaCoordinate @fdc_forbiddenAsVariableType "(Internal) The purpose of a generated type or field." -enum GeneratedPurpose { +enum GeneratedPurpose @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { # Implicit fields added to the table types as columns. IMPLICIT_KEY_FIELD IMPLICIT_REF_FIELD + # Generated static fields extended to table types. + METADATA_FIELD + # Relational non-column fields extended to table types. QUERY_MULTIPLE_ONE_TO_MANY QUERY_MULTIPLE_MANY_TO_MANY + # Generated fields for aggregates + QUERY_COUNT + QUERY_SUM + QUERY_AVG + QUERY_MIN + QUERY_MAX + + # Generated field for full text search + QUERY_MULTIPLE_BY_FULL_TEXT_SEARCH + # Top-level Query fields. QUERY_SINGLE QUERY_MULTIPLE @@ -397,20 +674,6 @@ type _Doc { markdown: String! } -"(Internal) Added to things that may be removed from FDC and will soon be no longer usable in schema or operations." -directive @fdc_deprecated(reason: String = "No longer supported") on - | SCHEMA - | SCALAR - | OBJECT - | FIELD_DEFINITION - | ARGUMENT_DEFINITION - | INTERFACE - | UNION - | ENUM - | ENUM_VALUE - | INPUT_OBJECT - | INPUT_FIELD_DEFINITION - "(Internal) Added to scalars representing quoted CEL expressions." directive @fdc_celExpression( "The expected CEL type that the expression should evaluate to." @@ -445,6 +708,26 @@ directive @fdc_oneOf( required: Boolean! = false ) repeatable on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION +""" +The `_Metadata` type is used to return metadata about a field in a response. +""" +type _Metadata { + # During vector similarity search, the distance between the query vector and + # this row's vector. In other cases, this field is not set. + distance: Float +} + +type Mutation { + """ + Run a query during the mutation and add fields into the response. + + Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON. + + Note: Data fetched this way can be handy for permission checks. See @check. + """ + query: Query +} + """ `UUID` is a string of hexadecimal digits representing an RFC4122-compliant UUID. @@ -554,7 +837,7 @@ scalar Any @specifiedBy(url: "https://www.json.org/json-en.html") The `Void` scalar type represents the absence of any value. It is typically used in operations where no value is expected in return. """ -scalar Void +scalar Void @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType """ The `True` scalar type only accepts the boolean value `true`. @@ -611,19 +894,50 @@ scalar UUID_Expr @fdc_example(value: "uuidV4()", description: "Generates a new random UUID (version 4) every time.") """ -A Common Expression Language (CEL) expression whose return type is unspecified. +A Common Expression Language (CEL) expression that returns a Int at runtime. +""" +scalar Int_Expr + @specifiedBy(url: "https://github.com/google/cel-spec") + @fdc_celExpression(returnType: "int") + @fdc_forbiddenAsVariableType + @fdc_forbiddenAsFieldType + @fdc_example(value: "2 * 4", description: "Evaluates to 8.") + @fdc_example(value: "vars.foo.size()", description: "Assuming `vars.foo` is a string, it will evaluate to the length of the string.") + + +""" +A Common Expression Language (CEL) expression that returns a Int64 at runtime. +""" +scalar Int64_Expr + @specifiedBy(url: "https://github.com/google/cel-spec") + @fdc_celExpression(returnType: "int64") + @fdc_forbiddenAsVariableType + @fdc_forbiddenAsFieldType + @fdc_example(value: "5000*1000*1000", description: "Evaluates to 5e9.") -**Limitation**: Only a limited set of expressions are currently supported for each -type. +""" +A Common Expression Language (CEL) expression that returns a Float at runtime. +""" +scalar Float_Expr + @specifiedBy(url: "https://github.com/google/cel-spec") + @fdc_celExpression(returnType: "float") + @fdc_forbiddenAsVariableType + @fdc_forbiddenAsFieldType + @fdc_example(value: "2.0 * 4.0", description: "Evaluates to 8.0.") + +""" +A Common Expression Language (CEL) expression whose return type is valid JSON. + +Examples: + - `{'A' : 'B'}` (Evaluates to a JSON object.) + - `['A', 'B']` (Evaluates to a JSON array.) + - `{'A' 1, 'B': [1, 2, {'foo': 'bar'}]}` (Nested JSON objects and arrays.) """ scalar Any_Expr @specifiedBy(url: "https://github.com/google/cel-spec") @fdc_celExpression @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType - @fdc_example(value: "auth.uid", description: "The ID of the currently logged in user in Firebase Auth. (Errors if not logged in.)") - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID version 4 (formatted as 32 lower-case hex digits without delimiters if result type is String).") - @fdc_example(value: "request.time", description: "The timestamp when the request is received (with microseconds precision).") """ A PostgreSQL value expression whose return type is unspecified. @@ -983,7 +1297,7 @@ type OneTable @table { ``` Data Connect generates the necessary foreign key constraint. -```graphql +```sql CREATE TABLE "public"."many_table" ( "id" uuid NOT NULL DEFAULT uuid_generate_v4(), "ref_field_id" uuid NOT NULL, @@ -1162,7 +1476,7 @@ directive @ref( ) on FIELD_DEFINITION "Defines the orderBy direction in a query." -enum OrderDirection { +enum OrderDirection @fdc_forbiddenAsFieldType { "Results are ordered in ascending order." ASC "Results are ordered in descending order." @@ -1263,7 +1577,7 @@ directive @index( ) repeatable on FIELD_DEFINITION | OBJECT "Specifies the sorting order for database indexes." -enum IndexFieldOrder { +enum IndexFieldOrder @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { "Sorts the field in ascending order (from lowest to highest)." ASC "Sorts the field in descending order (from highest to lowest)." @@ -1271,7 +1585,7 @@ enum IndexFieldOrder { } "Defines the type of index to be used in the database." -enum IndexType { +enum IndexType @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { "A general-purpose index type commonly used for sorting and searching." BTREE "Generalized Inverted Index, optimized for indexing composite values such as arrays." @@ -1516,59 +1830,46 @@ input Timestamp_ListFilter { excludesAll: [Timestamp!] } -"Update input of a `Date` value." +"Update input of a `Date` value. Only one of `inc` or `dec` may be specified." input Date_Update { - "Set the field to the provided date." - set: Date @fdc_oneOf(group: "set") - "Set the field to the provided date CEL expression." - set_expr: Date_Expr @fdc_oneOf(group: "set") - "Set the field to the provided relative date." - set_date: Date_Relative @fdc_oneOf(group: "set") + "Increment the field by a provided duration." + inc: Date_Duration @fdc_oneOf + "Decrement the field by a provided duration." + dec: Date_Duration @fdc_oneOf } -"Update input of a `Date` list value." +"Update input of a `Date` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Date_ListUpdate { - "Replace the current list with the provided list of `Date` values." - set: [Date!] "Append the provided `Date` values to the existing list." - append: [Date!] + append: [Date!] @fdc_oneOf "Prepend the provided `Date` values to the existing list." - prepend: [Date!] - "Remove the date value at the specified index." - delete: Int - "The index of the list to perform updates." - i: Int - "Update the date value at the specified index." - update: Date + prepend: [Date!] @fdc_oneOf + "Append any `Date` values that do not already exist to the list." + add: [Date!] @fdc_oneOf + "Remove all occurrences of each `Date` from the list." + remove: [Date!] @fdc_oneOf } -"Update input of a `Timestamp` value." +"Update input of a `Timestamp` value. Only one of `inc` or `dec` may be specified." input Timestamp_Update { - "Set the field to the provided timestamp." - set: Timestamp @fdc_oneOf(group: "set") - "Set the field to the provided timestamp CEL expression." - set_expr: Timestamp_Expr @fdc_oneOf(group: "set") - "Set the field to the provided relative timestamp." - set_time: Timestamp_Relative @fdc_oneOf(group: "set") + "Increment the field by a provided duration." + inc: Timestamp_Duration @fdc_oneOf + "Decrement the field by a provided duration." + dec: Timestamp_Duration @fdc_oneOf } -"Update input of an `Timestamp` list value." +"Update input of an `Timestamp` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Timestamp_ListUpdate { - "Replace the current list with the provided list of `Timestamp` values." - set: [Timestamp!] "Append the provided `Timestamp` values to the existing list." - append: [Timestamp!] + append: [Timestamp!] @fdc_oneOf "Prepend the provided `Timestamp` values to the existing list." - prepend: [Timestamp!] - "Remove the timestamp value at the specified index." - delete: Int - "The index of the list to perform updates." - i: Int - "Update the timestamp value at the specified index." - update: Timestamp + prepend: [Timestamp!] @fdc_oneOf + "Append any `Timestamp` values that do not already exist to the list." + add: [Timestamp!] @fdc_oneOf + "Remove all occurrences of each `Timestamp` from the list." + remove: [Timestamp!] @fdc_oneOf } - "A runtime-calculated `Timestamp` value relative to `now` or `at`." input Timestamp_Relative @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { "Match for the current time." @@ -1653,132 +1954,112 @@ enum Date_Interval @fdc_forbiddenAsFieldType { YEAR } -"Update input of a `String` value." -input String_Update { - "Set the field to a provided value." - set: String @fdc_oneOf(group: "set") - "Set the field to a provided server value expression." - set_expr: String_Expr @fdc_oneOf(group: "set") -} - -"Update input of a `String` list value." +"Update input of a `String` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input String_ListUpdate { - "Set the list with the provided values." - set: [String!] "Append the provided values to the existing list." - append: [String!] + append: [String!] @fdc_oneOf "Prepend the provided values to the existing list." - prepend: [String!] + prepend: [String!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [String!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [String!] @fdc_oneOf } -"Update input of a `UUID` value." -input UUID_Update { - "Set the field to a provided UUID." - set: UUID @fdc_oneOf(group: "set") - "Set the field to a provided UUID expression." - set_expr: UUID_Expr @fdc_oneOf(group: "set") -} - -"Update input of an `ID` list value." +"Update input of an `ID` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input UUID_ListUpdate { - "Set the list with the provided list of UUIDs." - set: [UUID!] "Append the provided UUIDs to the existing list." - append: [UUID!] + append: [UUID!] @fdc_oneOf "Prepend the provided UUIDs to the existing list." - prepend: [UUID!] + prepend: [UUID!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [UUID!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [UUID!] @fdc_oneOf } -"Update input of an `Int` value." +"Update input of an `Int` value. Only one of `inc` or `dec` may be specified." input Int_Update { - "Set the field to a provided value." - set: Int "Increment the field by a provided value." - inc: Int + inc: Int @fdc_oneOf "Decrement the field by a provided value." - dec: Int + dec: Int @fdc_oneOf } -"Update input of an `Int` list value." +"Update input of an `Int` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Int_ListUpdate { - "Set the list with the provided values." - set: [Int!] "Append the provided list of values to the existing list." - append: [Int!] + append: [Int!] @fdc_oneOf "Prepend the provided list of values to the existing list." - prepend: [Int!] + prepend: [Int!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [Int!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [Int!] @fdc_oneOf } -"Update input of an `Int64` value." +"Update input of an `Int64` value. Only one of `inc` or `dec` may be specified." input Int64_Update { - "Set the field to a provided value." - set: Int64 "Increment the field by a provided value." - inc: Int64 + inc: Int64 @fdc_oneOf "Decrement the field by a provided value." - dec: Int64 + dec: Int64 @fdc_oneOf } -"Update input of an `Int64` list value." +"Update input of an `Int64` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Int64_ListUpdate { - "Replace the list with the provided values." - set: [Int64!] "Append the provided list of values to the existing list." - append: [Int64!] + append: [Int64!] @fdc_oneOf "Prepend the provided list of values to the existing list." - prepend: [Int64!] + prepend: [Int64!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [Int64!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [Int64!] @fdc_oneOf } -"Update input of a `Float` value." +"Update input of a `Float` value. Only one of `inc` or `dec` may be specified." input Float_Update { - "Set the field to a provided value." - set: Float "Increment the field by a provided value." - inc: Float + inc: Float @fdc_oneOf "Decrement the field by a provided value." - dec: Float + dec: Float @fdc_oneOf } -"Update input of a `Float` list value." +"Update input of a `Float` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Float_ListUpdate { - "Set the list with the provided values." - set: [Float!] "Append the provided list of values to the existing list." - append: [Float!] + append: [Float!] @fdc_oneOf "Prepend the provided list of values to the existing list." - prepend: [Float!] -} - -"Update input of a `Boolean` value." -input Boolean_Update { - "Set the field to a provided value." - set: Boolean + prepend: [Float!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [Float!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [Float!] @fdc_oneOf } -"Update input of a `Boolean` list value." +"Update input of a `Boolean` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Boolean_ListUpdate { - "Set the list with the provided values." - set: [Boolean!] "Append the provided list of values to the existing list." - append: [Boolean!] + append: [Boolean!] @fdc_oneOf "Prepend the provided list of values to the existing list." - prepend: [Boolean!] -} - -"Update input of an `Any` value." -input Any_Update { - "Set the field to a provided value." - set: Any + prepend: [Boolean!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [Boolean!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [Boolean!] @fdc_oneOf } -"Update input of an `Any` list value." +"Update input of an `Any` list value. Only one of `append`, `prepend`, `add`, or `remove` may be specified." input Any_ListUpdate { - "Set the list with the provided values." - set: [Any!] "Append the provided list of values to the existing list." - append: [Any!] + append: [Any!] @fdc_oneOf "Prepend the provided list of values to the existing list." - prepend: [Any!] + prepend: [Any!] @fdc_oneOf + "Append values that do not already exist to the list." + add: [Any!] @fdc_oneOf + "Remove all occurrences of each value from the list." + remove: [Any!] @fdc_oneOf } type Query { @@ -1807,7 +2088,7 @@ Defaults to `INNER_PRODUCT`. View [all vector functions](https://github.com/pgvector/pgvector?tab=readme-ov-file#vector-functions). """ -enum VectorSimilarityMethod { +enum VectorSimilarityMethod @fdc_forbiddenAsFieldType { "Measures the Euclidean (L2) distance between two vectors." L2 "Measures the cosine similarity between two vectors." @@ -1841,31 +2122,6 @@ input Vector_ListFilter { excludesAll: [Vector!] } -"Update input of a Vector value." -input Vector_Update { - "Set the field to the provided vector value." - set: Vector @fdc_oneOf(group: "set") - "Set the field to the vector embedding result from a text input." - set_embed: Vector_Embed @fdc_oneOf(group: "set") -} - - -"Update input of a Vector list value." -input Vector_ListUpdate { - "Replace the current list with the provided list of Vector values." - set: [Vector] - "Append the provided Vector values to the existing list." - append: [Vector] - "Prepend the provided Vector values to the existing list." - prepend: [Vector] - "Delete the vector at the specified index." - delete: Int - "The index of the vector to be updated." - i: Int - "Update the vector at the specified index." - update: Vector -} - """ Create a vector embedding of text using the given model on Vertex AI. @@ -1934,73 +2190,5 @@ scalar Vector_Embed_Model @fdc_example(value: "textembedding-gecko@001", description: "An older version of the textembedding-gecko model") @fdc_example(value: "text-embedding-004", description: "Another text embedding model") -""" -Redact a part of the response from the client. - -Redacted fields are still evaluated for side effects (including data changes and -`@check`) and the results are still available to later steps in CEL expressions -(via `response.fieldName`). -""" -directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT - -""" -Ensure this field is present and is not null or `[]`, or abort the request / transaction. - -A CEL expression, `expr` is used to test the field value. It defaults to -rejecting null and `[]` but a custom expression can be provided instead. - -If the field occurs multiple times (i.e. directly or indirectly nested under a -list), `expr` will be executed once for each occurrence and `@check` succeeds if -all values succeed. `@check` fails when the field is not present at all (i.e. -all ancestor paths contain `null` or `[]`), unless `optional` is true. - -If a `@check` fails in a mutation, the top-level field containing it will be -replaced with a partial error, whose message can be customzied via the `message` -argument. Each subsequent top-level fields will return an aborted error (i.e. -not executed). To rollback previous steps, see `@transaction`. -""" -directive @check( - """ - The CEL expression to test the field value (or values if nested under a list). - - Within the CEL expression, a special value `this` evaluates to the field that - this directive is attached to. If this field occurs multiple times because - any ancestor is a list, each occurrence is tested with `this` bound to each - value. When the field itself is a list or object, `this` follows the same - structure (including all decendants selected in case of objects). - - For any given path, if an ancestor is `null` or `[]`, the field will not be - reached and the CEL evaluation will be skipped for that path. In other words, - evaluation only takes place when `this` is `null` or non-null, but never - undefined. (See also the `optional` argument.) - """ - expr: Boolean_Expr! = "!(this in [null, []])" - """ - The error message to return to the client if the check fails. - - Defaults to "permission denied" if not specified. - """ - message: String! = "permission denied" - """ - Whether the check should pass or fail (default) when the field is not present. - - A field will not be reached at a given path if its parent or any ancestor is - `[]` or `null`. When this happens to all paths, the field will not be present - anywhere in the response tree. In other words, `expr` is evaluated 0 times. - By default, @check will automatically fail in this case. Set this argument to - `true` to make it pass even if no tests are run (a.k.a. "vacuously true"). - """ - optional: Boolean = false -) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT - -type Mutation { - """ - Run a query during the mutation and add fields into the response. - - Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON. - - Note: Data fetched this way can be handy for permission checks. See @check. - """ - query: Query -} +# Intentionally left blank. From 304f0ba1d544f1af1b5e2402bde1733a1f252b8b Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 16 Oct 2025 17:58:53 -0400 Subject: [PATCH 06/14] modules --- .gitmodules | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitmodules b/.gitmodules index e69de29b..3b61f4a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,18 @@ +[submodule "packages/googleapis"] + path = packages/googleapis + url = git@github.com:googleapis/googleapis.git +[submodule "packages/envoy"] + path = packages/envoy + url = git@github.com:envoyproxy/envoy.git +[submodule "packages/udpa"] + path = packages/udpa + url = git@github.com:cncf/udpa.git +[submodule "packages/protobuf"] + path = packages/protobuf + url = git@github.com:protocolbuffers/protobuf.git +[submodule "packages/protoc-gen-validate"] + path = packages/protoc-gen-validate + url = git@github.com:bufbuild/protoc-gen-validate.git +[submodule "packages/xds"] + path = packages/xds + url = git@github.com:cncf/xds.git From a7e227a2d97fc343a912fbd453a45919a6c0e298 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 16 Oct 2025 21:14:58 -0400 Subject: [PATCH 07/14] Clean up protos --- .gitmodules | 18 - package-lock.json | 819 +- .../@apphosting/adapter-nextjs/buf.gen.yaml | 19 + .../@apphosting/adapter-nextjs/package.json | 10 +- .../src/bin/{serve.cts => serve.ts} | 80 +- .../envoy/config/core/v3/Address.ts | 18 - .../envoy/config/core/v3/AsyncDataSource.ts | 15 - .../envoy/config/core/v3/BackoffStrategy.ts | 13 - .../envoy/config/core/v3/BindConfig.ts | 25 - .../envoy/config/core/v3/BuildVersion.ts | 14 - .../envoy/config/core/v3/CidrRange.ts | 13 - .../envoy/config/core/v3/ControlPlane.ts | 10 - .../envoy/config/core/v3/DataSource.ts | 20 - .../config/core/v3/EnvoyInternalAddress.ts | 13 - .../envoy/config/core/v3/Extension.ts | 21 - .../config/core/v3/ExtraSourceAddress.ts | 14 - .../envoy/config/core/v3/HeaderMap.ts | 11 - .../envoy/config/core/v3/HeaderValue.ts | 14 - .../envoy/config/core/v3/HeaderValueOption.ts | 39 - .../envoy/config/core/v3/HttpUri.ts | 16 - .../envoy/config/core/v3/KeyValue.ts | 12 - .../envoy/config/core/v3/KeyValueAppend.ts | 37 - .../envoy/config/core/v3/KeyValueMutation.ts | 13 - .../envoy/config/core/v3/KeyValuePair.ts | 13 - .../envoy/config/core/v3/Locality.ts | 14 - .../envoy/config/core/v3/Metadata.ts | 14 - .../envoy/config/core/v3/Node.ts | 37 - .../envoy/config/core/v3/Pipe.ts | 12 - .../envoy/config/core/v3/QueryParameter.ts | 12 - .../envoy/config/core/v3/RemoteDataSource.ts | 16 - .../envoy/config/core/v3/RequestMethod.ts | 38 - .../envoy/config/core/v3/RetryPolicy.ts | 46 - .../envoy/config/core/v3/RoutingPriority.ts | 14 - .../envoy/config/core/v3/RuntimeDouble.ts | 12 - .../config/core/v3/RuntimeFeatureFlag.ts | 13 - .../core/v3/RuntimeFractionalPercent.ts | 13 - .../envoy/config/core/v3/RuntimePercent.ts | 13 - .../envoy/config/core/v3/RuntimeUInt32.ts | 12 - .../envoy/config/core/v3/SocketAddress.ts | 38 - .../envoy/config/core/v3/SocketOption.ts | 64 - .../config/core/v3/SocketOptionsOverride.ts | 11 - .../envoy/config/core/v3/TcpKeepalive.ts | 15 - .../envoy/config/core/v3/TrafficDirection.ts | 17 - .../envoy/config/core/v3/TransportSocket.ts | 14 - .../config/core/v3/TypedExtensionConfig.ts | 13 - .../envoy/config/core/v3/WatchedDirectory.ts | 10 - .../http/ext_proc/v3/ProcessingMode.ts | 62 - .../envoy/service/ext_proc/v3/BodyMutation.ts | 16 - .../envoy/service/ext_proc/v3/BodyResponse.ts | 11 - .../service/ext_proc/v3/CommonResponse.ts | 36 - .../service/ext_proc/v3/ExternalProcessor.ts | 23 - .../envoy/service/ext_proc/v3/GrpcStatus.ts | 10 - .../service/ext_proc/v3/HeaderMutation.ts | 13 - .../service/ext_proc/v3/HeadersResponse.ts | 11 - .../envoy/service/ext_proc/v3/HttpBody.ts | 12 - .../envoy/service/ext_proc/v3/HttpHeaders.ts | 16 - .../envoy/service/ext_proc/v3/HttpTrailers.ts | 11 - .../service/ext_proc/v3/ImmediateResponse.ts | 21 - .../service/ext_proc/v3/ProcessingRequest.ts | 35 - .../service/ext_proc/v3/ProcessingResponse.ts | 36 - .../ext_proc/v3/ProtocolConfiguration.ts | 15 - .../ext_proc/v3/StreamedBodyResponse.ts | 12 - .../service/ext_proc/v3/TrailersResponse.ts | 11 - .../envoy/type/v3/FractionalPercent.ts | 30 - .../envoy/type/v3/HttpStatus.ts | 11 - .../generated-types/envoy/type/v3/Percent.ts | 10 - .../envoy/type/v3/SemanticVersion.ts | 14 - .../envoy/type/v3/StatusCode.ts | 179 - .../src/generated-types/external_processor.ts | 331 - .../generated-types/google/protobuf/Any.ts | 13 - .../google/protobuf/BoolValue.ts | 10 - .../google/protobuf/BytesValue.ts | 10 - .../google/protobuf/DescriptorProto.ts | 59 - .../google/protobuf/DoubleValue.ts | 10 - .../google/protobuf/Duration.ts | 13 - .../google/protobuf/Edition.ts | 44 - .../google/protobuf/EnumDescriptorProto.ts | 33 - .../google/protobuf/EnumOptions.ts | 23 - .../protobuf/EnumValueDescriptorProto.ts | 15 - .../google/protobuf/EnumValueOptions.ts | 28 - .../google/protobuf/ExtensionRangeOptions.ts | 49 - .../google/protobuf/FeatureSet.ts | 183 - .../google/protobuf/FeatureSetDefaults.ts | 28 - .../google/protobuf/FieldDescriptorProto.ts | 112 - .../google/protobuf/FieldOptions.ts | 169 - .../google/protobuf/FileDescriptorProto.ts | 43 - .../google/protobuf/FileDescriptorSet.ts | 11 - .../google/protobuf/FileOptions.ts | 79 - .../google/protobuf/FloatValue.ts | 10 - .../google/protobuf/GeneratedCodeInfo.ts | 44 - .../google/protobuf/Int32Value.ts | 10 - .../google/protobuf/Int64Value.ts | 11 - .../google/protobuf/ListValue.ts | 11 - .../google/protobuf/MessageOptions.ts | 37 - .../google/protobuf/MethodDescriptorProto.ts | 21 - .../google/protobuf/MethodOptions.ts | 36 - .../google/protobuf/NullValue.ts | 11 - .../google/protobuf/OneofDescriptorProto.ts | 13 - .../google/protobuf/OneofOptions.ts | 16 - .../google/protobuf/ServiceDescriptorProto.ts | 16 - .../google/protobuf/ServiceOptions.ts | 16 - .../google/protobuf/SourceCodeInfo.ts | 26 - .../google/protobuf/StringValue.ts | 10 - .../generated-types/google/protobuf/Struct.ts | 11 - .../google/protobuf/SymbolVisibility.ts | 17 - .../google/protobuf/Timestamp.ts | 13 - .../google/protobuf/UInt32Value.ts | 10 - .../google/protobuf/UInt64Value.ts | 11 - .../google/protobuf/UninterpretedOption.ts | 33 - .../generated-types/google/protobuf/Value.ts | 24 - .../annotations/FieldMigrateAnnotation.ts | 12 - .../udpa/annotations/FileMigrateAnnotation.ts | 10 - .../udpa/annotations/MigrateAnnotation.ts | 10 - .../udpa/annotations/PackageVersionStatus.ts | 20 - .../udpa/annotations/StatusAnnotation.ts | 13 - .../udpa/annotations/VersioningAnnotation.ts | 10 - .../src/generated-types/validate/AnyRules.ts | 14 - .../src/generated-types/validate/BoolRules.ts | 10 - .../generated-types/validate/BytesRules.ts | 38 - .../generated-types/validate/DoubleRules.ts | 24 - .../generated-types/validate/DurationRules.ts | 25 - .../src/generated-types/validate/EnumRules.ts | 16 - .../generated-types/validate/FieldRules.ts | 75 - .../generated-types/validate/Fixed32Rules.ts | 24 - .../generated-types/validate/Fixed64Rules.ts | 25 - .../generated-types/validate/FloatRules.ts | 24 - .../generated-types/validate/Int32Rules.ts | 24 - .../generated-types/validate/Int64Rules.ts | 25 - .../generated-types/validate/KnownRegex.ts | 17 - .../src/generated-types/validate/MapRules.ts | 22 - .../generated-types/validate/MessageRules.ts | 12 - .../generated-types/validate/RepeatedRules.ts | 20 - .../generated-types/validate/SFixed32Rules.ts | 24 - .../generated-types/validate/SFixed64Rules.ts | 25 - .../generated-types/validate/SInt32Rules.ts | 24 - .../generated-types/validate/SInt64Rules.ts | 25 - .../generated-types/validate/StringRules.ts | 63 - .../validate/TimestampRules.ts | 28 - .../generated-types/validate/UInt32Rules.ts | 24 - .../generated-types/validate/UInt64Rules.ts | 25 - .../annotations/v3/FieldStatusAnnotation.ts | 10 - .../annotations/v3/FileStatusAnnotation.ts | 10 - .../annotations/v3/MessageStatusAnnotation.ts | 10 - .../annotations/v3/PackageVersionStatus.ts | 20 - .../xds/annotations/v3/StatusAnnotation.ts | 13 - .../xds/core/v3/ContextParams.ts | 10 - .../protos/envoy/annotations/deprecation.ts | 9 - .../envoy/annotations/deprecation_pb.ts | 24 + .../protos/envoy/config/core/v3/address.ts | 1099 --- .../protos/envoy/config/core/v3/backoff.ts | 136 - .../src/protos/envoy/config/core/v3/base.ts | 3749 --------- .../protos/envoy/config/core/v3/base_pb.ts | 248 + .../protos/envoy/config/core/v3/extension.ts | 135 - .../protos/envoy/config/core/v3/http_uri.ts | 159 - .../envoy/config/core/v3/socket_option.ts | 585 -- .../http/ext_proc/v3/processing_mode.ts | 352 - .../http/ext_proc/v3/processing_mode_pb.ts | 188 + .../service/ext_proc/v3/external_processor.ts | 2456 ------ .../ext_proc/v3/external_processor_pb.ts | 860 ++ .../src/protos/envoy/type/v3/http_status.ts | 526 -- .../protos/envoy/type/v3/http_status_pb.ts | 452 ++ .../src/protos/envoy/type/v3/percent.ts | 247 - .../protos/envoy/type/v3/semantic_version.ts | 138 - .../src/protos/google/protobuf/any.ts | 259 - .../src/protos/google/protobuf/descriptor.ts | 6975 ----------------- .../src/protos/google/protobuf/duration.ts | 189 - .../src/protos/google/protobuf/struct.ts | 588 -- .../src/protos/google/protobuf/timestamp.ts | 219 - .../src/protos/google/protobuf/wrappers.ts | 699 -- .../src/protos/udpa/annotations/migrate.ts | 251 - .../src/protos/udpa/annotations/migrate_pb.ts | 38 + .../src/protos/udpa/annotations/status.ts | 172 - .../src/protos/udpa/annotations/status_pb.ts | 84 + .../src/protos/udpa/annotations/versioning.ts | 104 - .../protos/udpa/annotations/versioning_pb.ts | 39 + .../src/protos/validate/validate.ts | 5869 -------------- .../src/protos/validate/validate_pb.ts | 1984 +++++ .../src/protos/xds/annotations/v3/status.ts | 361 - .../protos/xds/annotations/v3/status_pb.ts | 80 + .../src/protos/xds/core/v3/context_params.ts | 211 - .../@apphosting/adapter-nextjs/src/utils.ts | 3 +- 181 files changed, 4866 insertions(+), 29393 deletions(-) delete mode 100644 .gitmodules create mode 100644 packages/@apphosting/adapter-nextjs/buf.gen.yaml rename packages/@apphosting/adapter-nextjs/src/bin/{serve.cts => serve.ts} (84%) delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts create mode 100644 packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3b61f4a6..00000000 --- a/.gitmodules +++ /dev/null @@ -1,18 +0,0 @@ -[submodule "packages/googleapis"] - path = packages/googleapis - url = git@github.com:googleapis/googleapis.git -[submodule "packages/envoy"] - path = packages/envoy - url = git@github.com:envoyproxy/envoy.git -[submodule "packages/udpa"] - path = packages/udpa - url = git@github.com:cncf/udpa.git -[submodule "packages/protobuf"] - path = packages/protobuf - url = git@github.com:protocolbuffers/protobuf.git -[submodule "packages/protoc-gen-validate"] - path = packages/protoc-gen-validate - url = git@github.com:bufbuild/protoc-gen-validate.git -[submodule "packages/xds"] - path = packages/xds - url = git@github.com:cncf/xds.git diff --git a/package-lock.json b/package-lock.json index 858ef8da..0932af6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3276,13 +3276,247 @@ "node": ">=6.9.0" } }, + "node_modules/@bufbuild/buf": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.58.0.tgz", + "integrity": "sha512-/R+6kyZijftKDFLwY2JlvXqreZrIkz6jvcsmILXC0HwjkJ8dcADSPS93CFTZrtDQfui6K/GCJOsZrNbY5SLRyA==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "buf": "bin/buf", + "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", + "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@bufbuild/buf-darwin-arm64": "1.58.0", + "@bufbuild/buf-darwin-x64": "1.58.0", + "@bufbuild/buf-linux-aarch64": "1.58.0", + "@bufbuild/buf-linux-armv7": "1.58.0", + "@bufbuild/buf-linux-x64": "1.58.0", + "@bufbuild/buf-win32-arm64": "1.58.0", + "@bufbuild/buf-win32-x64": "1.58.0" + } + }, + "node_modules/@bufbuild/buf-darwin-arm64": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.58.0.tgz", + "integrity": "sha512-bMlTG23f7oIrroVM7dijbCxwLy+fd4QOAkmnIkZ922UIuwXkexr8TWzrul4Ivs0Af6aOWNzQSyHrh3UkGNZa2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-darwin-x64": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.58.0.tgz", + "integrity": "sha512-sNOu4ta7IDaQi4F66BXk76AQVCr0H10Ic7UFfU9ELs1f+FP+JYsQRU5CrWeaDWnLUTu3o4EZqwC6AvhGLOJUnw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-aarch64": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.58.0.tgz", + "integrity": "sha512-UE3tmIBpA4tK4Y34602UAbCFJzZVuRrFoXys5qSu9LnqhP9OF+vT6x9SXpAlQigmq3VGwNr8wgxD17ys2oDEmA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-armv7": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-armv7/-/buf-linux-armv7-1.58.0.tgz", + "integrity": "sha512-6V0bEseFAcNGP8IyHb1b3dEr/FpeuN6A/gHNotJ8zZbtyWsKEPsiSNomED8bARvW/3hs802khVJAUeD0duIpAw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-x64": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.58.0.tgz", + "integrity": "sha512-k2xOlOky3IY9Zxeih5vccfp/MDfO0UPZfGYxkYJ7reNuUTtJEOWfzuQxeZY+E8q1W83RtIwGjAVhbKYCGA1MpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-arm64": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.58.0.tgz", + "integrity": "sha512-GXNjYaOyjJ2J4hhCkldsc3r6eS1YqQ+qOHsn/PvtcxUkzV6UN5HoLoh0Bx/NStZOA4QqCEfQphLUqJLvwBuhbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-x64": { + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.58.0.tgz", + "integrity": "sha512-5o1d/7lEeDXuTyroiro+rRmFAbKIaKjVCFZwF0pPISUmIANFzvI41UpzciMQACXCSnYQdEcNHLtZRGCzGT9GiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@bufbuild/protobuf": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.9.0.tgz", "integrity": "sha512-rnJenoStJ8nvmt9Gzye8nkYd6V22xUAnu4086ER7h1zJ508vStko4pMvDeQ446ilDTFpV5wnoc5YS7XvMwwMqA==", - "dev": true, "license": "(Apache-2.0 AND BSD-3-Clause)" }, + "node_modules/@bufbuild/protoc-gen-es": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-2.9.0.tgz", + "integrity": "sha512-g54rrHLKc7fnxN25ikynstRxR19M5G5l/hyqut2JoypJ9iU9QgUE63zEm8PNvVfBd4r5PEzWPfbWy5MNOeuMKQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "2.9.0", + "@bufbuild/protoplugin": "2.9.0" + }, + "bin": { + "protoc-gen-es": "bin/protoc-gen-es" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "2.9.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protobuf": { + "optional": true + } + } + }, + "node_modules/@bufbuild/protoplugin": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-2.9.0.tgz", + "integrity": "sha512-uoiwNVYoTq+AyqaV1L6pBazGx5fXOO89L0NSR9/7hEfo0Y8n9T1jsKGu4mkitLmP3z+8gJREaule1mMuKBPyYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "2.9.0", + "@typescript/vfs": "^1.5.2", + "typescript": "5.4.5" + } + }, + "node_modules/@bufbuild/protoplugin/node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@connectrpc/connect": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-2.1.0.tgz", + "integrity": "sha512-xhiwnYlJNHzmFsRw+iSPIwXR/xweTvTw8x5HiwWp10sbVtd4OpOXbRgE7V58xs1EC17fzusF1f5uOAy24OkBuA==", + "license": "Apache-2.0", + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0" + } + }, + "node_modules/@connectrpc/connect-fastify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-fastify/-/connect-fastify-2.1.0.tgz", + "integrity": "sha512-5xPxUGQnawXgw0ZmgMGtEUN81aIJZOvgHw/j9USERffRDOUNcqMNcVCQ5ay+grc1XlkkC3AdQLWV2yctAzWg9g==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0", + "@connectrpc/connect": "2.1.0", + "@connectrpc/connect-node": "2.1.0", + "fastify": "^4.22.1 || ^5.1.0" + } + }, + "node_modules/@connectrpc/connect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-node/-/connect-node-2.1.0.tgz", + "integrity": "sha512-6akCXZSX5uWHLR654ne9Tnq7AnPUkLS65NvgsI5885xBkcuVy2APBd8sA4sLqaplUt84cVEr6LhjEFNx6W1KtQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0", + "@connectrpc/connect": "2.1.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -3835,6 +4069,66 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/ajv-compiler": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-4.0.4.tgz", + "integrity": "sha512-VfPkOSmob5YqH4ZUYW4ESVV5dDNbmtNEKJADFm43Hn/T48RxTZjUIBouadRDb4M/qr8g5bAxxu40/MGxvCPDrw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0" + } + }, + "node_modules/@fastify/ajv-compiler/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@fastify/ajv-compiler/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@fastify/ajv-compiler/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, "node_modules/@fastify/busboy": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-1.2.1.tgz", @@ -3846,6 +4140,105 @@ "node": ">=14" } }, + "node_modules/@fastify/error": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz", + "integrity": "sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-5.0.3.tgz", + "integrity": "sha512-uik7yYHkLr6fxd8hJSZ8c+xF4WafPK+XzneQDPU+D10r5X19GW8lJcom2YijX2+qtFF1ENJlHXKFM9ouXNJYgQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fast-json-stringify": "^6.0.0" + } + }, + "node_modules/@fastify/forwarded": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@fastify/forwarded/-/forwarded-3.0.1.tgz", + "integrity": "sha512-JqDochHFqXs3C3Ml3gOY58zM7OqO9ENqPo0UqAjAjH8L01fRZqwX9iLeX34//kiJubF7r2ZQHtBRU36vONbLlw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.2.1.tgz", + "integrity": "sha512-OA3KGBCy6KtIvLf8DINC5880o5iBlDX4SxzLQS8HorJAbqluzLRn80UXU0bxZn7UOFhFgpRJDasfwn9nG4FG4A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/@fastify/proxy-addr": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@fastify/proxy-addr/-/proxy-addr-5.1.0.tgz", + "integrity": "sha512-INS+6gh91cLUjB+PVHfu1UqcB76Sqtpyp7bnL+FYojhjygvOPA9ctiD/JDKsyD9Xgu4hUhCSJBPig/w7duNajw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/forwarded": "^3.0.0", + "ipaddr.js": "^2.1.0" + } + }, + "node_modules/@fastify/proxy-addr/node_modules/ipaddr.js": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", + "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, "node_modules/@firebase/analytics": { "version": "0.10.7", "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.7.tgz", @@ -9932,6 +10325,19 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript/vfs": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.1.tgz", + "integrity": "sha512-JwoxboBh7Oz1v38tPbkrZ62ZXNHAk9bJ7c9x0eI5zBfBnBYGhURdbnh7Z4smN/MV48Y5OCcZb58n972UtbazsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.1" + }, + "peerDependencies": { + "typescript": "*" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -10759,6 +11165,12 @@ "node": ">=6.5" } }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==", + "license": "MIT" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -11160,7 +11572,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", - "dev": true, "engines": { "node": ">=8.0.0" } @@ -11202,6 +11613,16 @@ "postcss": "^8.1.0" } }, + "node_modules/avvio": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-9.1.0.tgz", + "integrity": "sha512-fYASnYi600CsH/j9EQov7lECAniYiBFiiAtBNuZYLA2leLe9qOvZzqYHFjtIj6gD2VMoMLP14834LFWvr4IfDw==", + "license": "MIT", + "dependencies": { + "@fastify/error": "^4.0.0", + "fastq": "^1.17.1" + } + }, "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -13127,8 +13548,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -14164,11 +14583,16 @@ "node >=0.6.0" ] }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==", + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "devOptional": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-diff": { "version": "1.3.0", @@ -14216,12 +14640,84 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-json-stringify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-6.1.1.tgz", + "integrity": "sha512-DbgptncYEXZqDUOEl4krff4mUiVrTZZVI7BBrQR/T3BqMj/eM1flTC1Uk2uUoLcWCxjT95xKulV/Lc6hhOZsBQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/merge-json-schemas": "^0.2.0", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^3.0.0", + "json-schema-ref-resolver": "^3.0.0", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-json-stringify/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/fast-json-stringify/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/fast-json-stringify/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "devOptional": true }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "license": "MIT", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, "node_modules/fast-redact": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", @@ -14243,6 +14739,22 @@ "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==", "optional": true }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fast-xml-parser": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", @@ -14265,11 +14777,136 @@ "fxparser": "src/cli/cli.js" } }, + "node_modules/fastify": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-5.6.1.tgz", + "integrity": "sha512-WjjlOciBF0K8pDUPZoGPhqhKrQJ02I8DKaDIfO51EL0kbSMwQFl85cRwhOvmSDWoukNOdTo27gLN549pLCcH7Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/ajv-compiler": "^4.0.0", + "@fastify/error": "^4.0.0", + "@fastify/fast-json-stringify-compiler": "^5.0.0", + "@fastify/proxy-addr": "^5.0.0", + "abstract-logging": "^2.0.1", + "avvio": "^9.0.0", + "fast-json-stringify": "^6.0.0", + "find-my-way": "^9.0.0", + "light-my-request": "^6.0.0", + "pino": "^9.0.0", + "process-warning": "^5.0.0", + "rfdc": "^1.3.1", + "secure-json-parse": "^4.0.0", + "semver": "^7.6.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/fastify/node_modules/pino": { + "version": "9.13.1", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.13.1.tgz", + "integrity": "sha512-Szuj+ViDTjKPQYiKumGmEn3frdl+ZPSdosHyt9SnUevFosOkMY2b7ipxlEctNKPmMD/VibeBI+ZcZCJK+4DPuw==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^2.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "slow-redact": "^0.3.0", + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/fastify/node_modules/pino-abstract-transport": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", + "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", + "license": "MIT", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/fastify/node_modules/pino-std-serializers": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", + "license": "MIT" + }, + "node_modules/fastify/node_modules/process-warning": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", + "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/fastify/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fastify/node_modules/sonic-boom": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", + "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/fastify/node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/fastify/node_modules/thread-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", + "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", + "license": "MIT", + "dependencies": { + "real-require": "^0.2.0" + } + }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -14506,6 +15143,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-my-way": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.3.0.tgz", + "integrity": "sha512-eRoFWQw+Yv2tuYlK2pjFS2jGXSxSppAs3hSQjfxVKxM5amECzIgYYc1FEI8ZmhSh/Ig+FrKEz43NLRKJjYCZVg==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^5.0.0" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -16586,6 +17237,25 @@ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, + "node_modules/json-schema-ref-resolver": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-3.0.0.tgz", + "integrity": "sha512-hOrZIVL5jyYFjzk7+y7n5JDzGlU8rfWDuYyHwGa2WA8/pcmMHezp2xsVwxrebD/Q9t8Nc5DboieySDpCp4WG4A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -17312,6 +17982,52 @@ } } }, + "node_modules/light-my-request": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-6.6.0.tgz", + "integrity": "sha512-CHYbu8RtboSIoVsHZ6Ye4cj4Aw/yg2oAFimlF7mNvfDV192LR7nDiKtSIfCuLT7KokPSTn/9kfVLm5OGN0A28A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause", + "dependencies": { + "cookie": "^1.0.1", + "process-warning": "^4.0.0", + "set-cookie-parser": "^2.6.0" + } + }, + "node_modules/light-my-request/node_modules/cookie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/light-my-request/node_modules/process-warning": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.1.tgz", + "integrity": "sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, "node_modules/limiter": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", @@ -19427,7 +20143,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", - "dev": true, "engines": { "node": ">=14.0.0" } @@ -21052,8 +21767,7 @@ "node_modules/quick-format-unescaped": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", - "dev": true + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" }, "node_modules/quick-lru": { "version": "4.0.1", @@ -21501,7 +22215,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", - "dev": true, "engines": { "node": ">= 12.13.0" } @@ -21615,7 +22328,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -21725,6 +22437,15 @@ "node": ">=8" } }, + "node_modules/ret": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", + "integrity": "sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", @@ -21751,12 +22472,17 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -21876,11 +22602,29 @@ } ] }, + "node_modules/safe-regex2": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.0.0.tgz", + "integrity": "sha512-YwJwe5a51WlK7KbOJREPdjNrpViQBI3p4T50lfwPuDhZnE3XGVTlGvi+aolc5+RvxDD6bnUmjVsU9n1eboLUYw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + } + }, "node_modules/safe-stable-stringify": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", - "dev": true, "engines": { "node": ">=10" } @@ -22014,6 +22758,22 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, + "node_modules/secure-json-parse": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.0.tgz", + "integrity": "sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -22208,8 +22968,7 @@ "node_modules/set-cookie-parser": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.0.tgz", - "integrity": "sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==", - "dev": true + "integrity": "sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==" }, "node_modules/set-function-length": { "version": "1.2.2", @@ -22637,6 +23396,12 @@ "node": ">=8" } }, + "node_modules/slow-redact": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/slow-redact/-/slow-redact-0.3.2.tgz", + "integrity": "sha512-MseHyi2+E/hBRqdOi5COy6wZ7j7DxXRz9NkseavNYSvvWC06D8a5cidVZX3tcG5eCW3NIyVU4zT63hw0Q486jw==", + "license": "MIT" + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -23488,6 +24253,15 @@ "node": ">=8.0" } }, + "node_modules/toad-cache": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.0.tgz", + "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -25561,8 +26335,9 @@ "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", + "@connectrpc/connect": "^2.1.0", "@grpc/grpc-js": "^1.14.0", - "@grpc/proto-loader": "^0.8.0", + "fastify": "^5.6.1", "fs-extra": "^11.1.1", "yaml": "^2.3.4" }, @@ -25572,6 +26347,10 @@ "apphosting-adapter-nextjs-serve": "dist/bin/serve.js" }, "devDependencies": { + "@bufbuild/buf": "^1.58.0", + "@bufbuild/protobuf": "^2.9.0", + "@bufbuild/protoc-gen-es": "^2.9.0", + "@connectrpc/connect-fastify": "^2.1.0", "@types/fs-extra": "*", "@types/mocha": "*", "@types/tmp": "*", diff --git a/packages/@apphosting/adapter-nextjs/buf.gen.yaml b/packages/@apphosting/adapter-nextjs/buf.gen.yaml new file mode 100644 index 00000000..23641671 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/buf.gen.yaml @@ -0,0 +1,19 @@ +# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml +version: v2 +inputs: + - module: buf.build/envoyproxy/envoy:main + types: + - "envoy.service.ext_proc.v3.ExternalProcessor" + - module: buf.build/cncf/xds:main + types: + - "udpa.annotations.VersioningAnnotation" + - "udpa.annotations.FileMigrateAnnotation" + - "udpa.annotations.StatusAnnotation" + - "xds.annotations.v3.StatusAnnotation" + - module: buf.build/envoyproxy/protoc-gen-validate:main + paths: + - "validate/validate.proto" +plugins: + - local: protoc-gen-es + opt: target=ts + out: src/protos \ No newline at end of file diff --git a/packages/@apphosting/adapter-nextjs/package.json b/packages/@apphosting/adapter-nextjs/package.json index e8c0f19f..569dd8fa 100644 --- a/packages/@apphosting/adapter-nextjs/package.json +++ b/packages/@apphosting/adapter-nextjs/package.json @@ -22,8 +22,8 @@ "type": "module", "sideEffects": false, "scripts": { - "build:protos": "npx protoc -I=../../../submodules/envoy/api -I=../../../submodules/googleapis -I=../../../submodules/udpa -I=../../../submodules/protobuf/src -I=../../../submodules/protoc-gen-validate -I=../../../submodules/xds --plugin=\"$(pwd)/../../../node_modules/.bin/protoc-gen-ts_proto\" --ts_proto_out=./src/protos --ts_proto_opt=forceLong=string,esModuleInterop=true,outputServices=grpc-js ../../../submodules/envoy/api/envoy/service/ext_proc/v3/external_processor.proto && node ./clean_protos.cjs", - "build": "npm run build:protos && rm -rf dist && tsc && chmod +x ./dist/bin/* && npx -y esbuild ./dist/index.js --bundle --format=cjs --platform=node --outfile=./dist/index.cjs", + "build:protos": "npx buf generate && node ./clean_protos.cjs", + "build": "npm run build:protos && rm -rf dist && tsc && chmod +x ./dist/bin/* && npx -y esbuild ./dist/index.js --bundle --format=cjs --platform=node --outfile=./dist/index.cjs && npx -y esbuild ./src/bin/serve.ts --bundle --format=esm --platform=node --outfile=./dist/bin/serve.js --external:fastify --external:next", "test": "npm run test:unit && npm run test:functional", "test:unit": "ts-mocha -p tsconfig.json 'src/**/*.spec.ts' 'src/*.spec.ts'", "test:functional": "node --loader ts-node/esm ./e2e/run-local.ts", @@ -46,7 +46,9 @@ "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", + "@connectrpc/connect": "^2.1.0", "@grpc/grpc-js": "^1.14.0", + "fastify": "^5.6.1", "fs-extra": "^11.1.1", "yaml": "^2.3.4" }, @@ -59,6 +61,10 @@ } }, "devDependencies": { + "@bufbuild/buf": "^1.58.0", + "@bufbuild/protobuf": "^2.9.0", + "@bufbuild/protoc-gen-es": "^2.9.0", + "@connectrpc/connect-fastify": "^2.1.0", "@types/fs-extra": "*", "@types/mocha": "*", "@types/tmp": "*", diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.cts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts similarity index 84% rename from packages/@apphosting/adapter-nextjs/src/bin/serve.cts rename to packages/@apphosting/adapter-nextjs/src/bin/serve.ts index f9028c55..2d5d2d1c 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.cts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -1,22 +1,23 @@ import { readFileSync } from "node:fs"; -import { createServer, ServerResponse, IncomingMessage } from "node:http"; +import { ServerResponse, IncomingMessage } from "node:http"; import { join } from "node:path"; +import fastify from "fastify"; -import { - ExternalProcessorServer, - ProcessingRequest, - ProcessingResponse, - ExternalProcessorService, - CommonResponse_ResponseStatus, -} from '../protos/envoy/service/ext_proc/v3/external_processor.js'; -import { HeaderValueOption, HeaderValueOption_HeaderAppendAction } from '../protos/envoy/config/core/v3/base.js'; -import grpc from "@grpc/grpc-js"; +import { ExternalProcessor, ProcessingRequest } from "../protos/envoy/service/ext_proc/v3/external_processor_pb.js" + +import { ConnectRouter } from "@connectrpc/connect"; +import { fastifyConnectPlugin } from "@connectrpc/connect-fastify"; + +import { NEXT_REQUEST_META } from "next/dist/server/request-meta.js"; const dir = process.cwd(); const port = parseInt(process.env.PORT!, 10) || 3000 const hostname = process.env.HOSTNAME || '0.0.0.0' +// @ts-ignore +process.env.NODE_ENV = "production"; + let keepAliveTimeout: number | undefined = parseInt(process.env.KEEP_ALIVE_TIMEOUT!, 10); // (bundle.yaml) @@ -31,7 +32,7 @@ let keepAliveTimeout: number | undefined = parseInt(process.env.KEEP_ALIVE_TIMEO // rewrites, redirects (before_files, after_files) const conf = JSON.parse(readFileSync(join(dir, ".next", "required-server-files.json"), "utf-8")).config; - +/* const extProcService: ExternalProcessorServer = { process(call): void { console.log('New processing stream initiated...'); @@ -188,27 +189,18 @@ const extProcService: ExternalProcessorServer = { }); }, }; +*/ -const server = new grpc.Server(); - -// Add the ExternalProcessor service with our `process` handler -server.addService(ExternalProcessorService, extProcService); - -// The load balancer requires HTTP/2, so you must use -// createSsl for a production environment. -// For this example, we use insecure credentials. -const grpcPort = '8080'; -server.bindAsync( - `0.0.0.0:${grpcPort}`, - grpc.ServerCredentials.createInsecure(), // <-- Use createSsl() in production - (err, port) => { - if (err) { - console.error('Failed to bind server:', err); - return; - } - console.log(`gRPC Callout Server running on port ${port}`); +async function *processCalls(calls: AsyncIterable) { + for await (const call of calls) { + console.log(call); + // yield { }; } -); +} + +function routes(router: ConnectRouter) { + router.service(ExternalProcessor, { process: processCalls }); +} process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(conf); @@ -222,14 +214,17 @@ if ( keepAliveTimeout = undefined } -const NextServer = require("next/dist/server/next-server.js"); -const minimalServer = new NextServer.default({ +const resolveNextServer = import("next/dist/server/next-server.js").then(async ({ default: NextServer }) => { + const server = new NextServer.default({ conf, dev: false, dir, hostname, port, minimalMode: true, + }); + await server.prepare(); + return server; }); // While demoing in envoy was simple enough, to do this on GCP edge we have two @@ -255,9 +250,6 @@ const minimalServer = new NextServer.default({ // TODO spin up PPR resumption as a GRPC service - -const { NEXT_REQUEST_META } = require("next/dist/server/request-meta.js"); - async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse) { if (req.method !== 'GET' && req.method !== 'HEAD') return; if (!res.getHeaderNames().includes('x-nextjs-postponed')) return; @@ -290,10 +282,20 @@ async function requestHandle(req: IncomingMessage, res: ServerResponse) { }); return res; }; - await minimalServer.prepare(); - return await minimalServer.getRequestHandler()(req, res); + return (await resolveNextServer).getRequestHandler()(req, res); }; -createServer({ keepAliveTimeout }, requestHandle).listen(port, hostname, () => { - console.log(`minimal listening on http://${hostname}:${port}.`); + +const httpServer = fastify(); +await httpServer.register(fastifyConnectPlugin, { routes }); + +httpServer.all("*", function(req, res) { + requestHandle(req.raw, res.raw); +}); + +await httpServer.ready(); + +httpServer.listen({ host: hostname, port, }, (err, address) => { + if (err) return console.error(err); + console.log(`Server listening on ${address}`); }); diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts deleted file mode 100644 index 17e71df6..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Address.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - -import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './SocketAddress.js'; -import type { Pipe as _envoy_config_core_v3_Pipe, Pipe__Output as _envoy_config_core_v3_Pipe__Output } from './Pipe.js'; -import type { EnvoyInternalAddress as _envoy_config_core_v3_EnvoyInternalAddress, EnvoyInternalAddress__Output as _envoy_config_core_v3_EnvoyInternalAddress__Output } from './EnvoyInternalAddress.js'; - -export interface Address { - 'socketAddress'?: (_envoy_config_core_v3_SocketAddress | null); - 'pipe'?: (_envoy_config_core_v3_Pipe | null); - 'envoyInternalAddress'?: (_envoy_config_core_v3_EnvoyInternalAddress | null); - 'address'?: "socketAddress"|"pipe"|"envoyInternalAddress"; -} - -export interface Address__Output { - 'socketAddress'?: (_envoy_config_core_v3_SocketAddress__Output); - 'pipe'?: (_envoy_config_core_v3_Pipe__Output); - 'envoyInternalAddress'?: (_envoy_config_core_v3_EnvoyInternalAddress__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts deleted file mode 100644 index 06af9c29..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/AsyncDataSource.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { DataSource as _envoy_config_core_v3_DataSource, DataSource__Output as _envoy_config_core_v3_DataSource__Output } from './DataSource.js'; -import type { RemoteDataSource as _envoy_config_core_v3_RemoteDataSource, RemoteDataSource__Output as _envoy_config_core_v3_RemoteDataSource__Output } from './RemoteDataSource.js'; - -export interface AsyncDataSource { - 'local'?: (_envoy_config_core_v3_DataSource | null); - 'remote'?: (_envoy_config_core_v3_RemoteDataSource | null); - 'specifier'?: "local"|"remote"; -} - -export interface AsyncDataSource__Output { - 'local'?: (_envoy_config_core_v3_DataSource__Output); - 'remote'?: (_envoy_config_core_v3_RemoteDataSource__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts deleted file mode 100644 index 0adf9458..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BackoffStrategy.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/backoff.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration.js'; - -export interface BackoffStrategy { - 'baseInterval'?: (_google_protobuf_Duration | null); - 'maxInterval'?: (_google_protobuf_Duration | null); -} - -export interface BackoffStrategy__Output { - 'baseInterval'?: (_google_protobuf_Duration__Output); - 'maxInterval'?: (_google_protobuf_Duration__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts deleted file mode 100644 index 8b19e352..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BindConfig.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - -import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './SocketAddress.js'; -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue.js'; -import type { SocketOption as _envoy_config_core_v3_SocketOption, SocketOption__Output as _envoy_config_core_v3_SocketOption__Output } from './SocketOption.js'; -import type { ExtraSourceAddress as _envoy_config_core_v3_ExtraSourceAddress, ExtraSourceAddress__Output as _envoy_config_core_v3_ExtraSourceAddress__Output } from './ExtraSourceAddress.js'; -import type { TypedExtensionConfig as _envoy_config_core_v3_TypedExtensionConfig, TypedExtensionConfig__Output as _envoy_config_core_v3_TypedExtensionConfig__Output } from './TypedExtensionConfig.js'; - -export interface BindConfig { - 'sourceAddress'?: (_envoy_config_core_v3_SocketAddress | null); - 'freebind'?: (_google_protobuf_BoolValue | null); - 'socketOptions'?: (_envoy_config_core_v3_SocketOption)[]; - 'additionalSourceAddresses'?: (_envoy_config_core_v3_SocketAddress)[]; - 'extraSourceAddresses'?: (_envoy_config_core_v3_ExtraSourceAddress)[]; - 'localAddressSelector'?: (_envoy_config_core_v3_TypedExtensionConfig | null); -} - -export interface BindConfig__Output { - 'sourceAddress'?: (_envoy_config_core_v3_SocketAddress__Output); - 'freebind'?: (_google_protobuf_BoolValue__Output); - 'socketOptions'?: (_envoy_config_core_v3_SocketOption__Output)[]; - 'additionalSourceAddresses'?: (_envoy_config_core_v3_SocketAddress__Output)[]; - 'extraSourceAddresses'?: (_envoy_config_core_v3_ExtraSourceAddress__Output)[]; - 'localAddressSelector'?: (_envoy_config_core_v3_TypedExtensionConfig__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts deleted file mode 100644 index 828d80e1..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/BuildVersion.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { SemanticVersion as _envoy_type_v3_SemanticVersion, SemanticVersion__Output as _envoy_type_v3_SemanticVersion__Output } from '../../../type/v3/SemanticVersion.js'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; - -export interface BuildVersion { - 'version'?: (_envoy_type_v3_SemanticVersion | null); - 'metadata'?: (_google_protobuf_Struct | null); -} - -export interface BuildVersion__Output { - 'version'?: (_envoy_type_v3_SemanticVersion__Output); - 'metadata'?: (_google_protobuf_Struct__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts deleted file mode 100644 index 99dad4d0..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/CidrRange.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value.js'; - -export interface CidrRange { - 'addressPrefix'?: (string); - 'prefixLen'?: (_google_protobuf_UInt32Value | null); -} - -export interface CidrRange__Output { - 'addressPrefix'?: (string); - 'prefixLen'?: (_google_protobuf_UInt32Value__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts deleted file mode 100644 index 657419e2..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ControlPlane.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface ControlPlane { - 'identifier'?: (string); -} - -export interface ControlPlane__Output { - 'identifier'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts deleted file mode 100644 index f3fba9e1..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/DataSource.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { WatchedDirectory as _envoy_config_core_v3_WatchedDirectory, WatchedDirectory__Output as _envoy_config_core_v3_WatchedDirectory__Output } from './WatchedDirectory.js'; - -export interface DataSource { - 'filename'?: (string); - 'inlineBytes'?: (Buffer | Uint8Array | string); - 'inlineString'?: (string); - 'environmentVariable'?: (string); - 'watchedDirectory'?: (_envoy_config_core_v3_WatchedDirectory | null); - 'specifier'?: "filename"|"inlineBytes"|"inlineString"|"environmentVariable"; -} - -export interface DataSource__Output { - 'filename'?: (string); - 'inlineBytes'?: (Buffer); - 'inlineString'?: (string); - 'environmentVariable'?: (string); - 'watchedDirectory'?: (_envoy_config_core_v3_WatchedDirectory__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts deleted file mode 100644 index 16c04700..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/EnvoyInternalAddress.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - - -export interface EnvoyInternalAddress { - 'serverListenerName'?: (string); - 'endpointId'?: (string); - 'addressNameSpecifier'?: "serverListenerName"; -} - -export interface EnvoyInternalAddress__Output { - 'serverListenerName'?: (string); - 'endpointId'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts deleted file mode 100644 index d874c506..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Extension.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { BuildVersion as _envoy_config_core_v3_BuildVersion, BuildVersion__Output as _envoy_config_core_v3_BuildVersion__Output } from './BuildVersion.js'; - -export interface Extension { - 'name'?: (string); - 'category'?: (string); - 'typeDescriptor'?: (string); - 'version'?: (_envoy_config_core_v3_BuildVersion | null); - 'disabled'?: (boolean); - 'typeUrls'?: (string)[]; -} - -export interface Extension__Output { - 'name'?: (string); - 'category'?: (string); - 'typeDescriptor'?: (string); - 'version'?: (_envoy_config_core_v3_BuildVersion__Output); - 'disabled'?: (boolean); - 'typeUrls'?: (string)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts deleted file mode 100644 index b0db7022..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/ExtraSourceAddress.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - -import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './SocketAddress.js'; -import type { SocketOptionsOverride as _envoy_config_core_v3_SocketOptionsOverride, SocketOptionsOverride__Output as _envoy_config_core_v3_SocketOptionsOverride__Output } from './SocketOptionsOverride.js'; - -export interface ExtraSourceAddress { - 'address'?: (_envoy_config_core_v3_SocketAddress | null); - 'socketOptions'?: (_envoy_config_core_v3_SocketOptionsOverride | null); -} - -export interface ExtraSourceAddress__Output { - 'address'?: (_envoy_config_core_v3_SocketAddress__Output); - 'socketOptions'?: (_envoy_config_core_v3_SocketOptionsOverride__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts deleted file mode 100644 index 337c6a12..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderMap.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { HeaderValue as _envoy_config_core_v3_HeaderValue, HeaderValue__Output as _envoy_config_core_v3_HeaderValue__Output } from './HeaderValue.js'; - -export interface HeaderMap { - 'headers'?: (_envoy_config_core_v3_HeaderValue)[]; -} - -export interface HeaderMap__Output { - 'headers'?: (_envoy_config_core_v3_HeaderValue__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts deleted file mode 100644 index 08e29715..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface HeaderValue { - 'key'?: (string); - 'value'?: (string); - 'rawValue'?: (Buffer | Uint8Array | string); -} - -export interface HeaderValue__Output { - 'key'?: (string); - 'value'?: (string); - 'rawValue'?: (Buffer); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts deleted file mode 100644 index 58ed5b9d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HeaderValueOption.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { HeaderValue as _envoy_config_core_v3_HeaderValue, HeaderValue__Output as _envoy_config_core_v3_HeaderValue__Output } from './HeaderValue.js'; -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue.js'; - -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -export const _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction = { - APPEND_IF_EXISTS_OR_ADD: 0, - ADD_IF_ABSENT: 1, - OVERWRITE_IF_EXISTS_OR_ADD: 2, - OVERWRITE_IF_EXISTS: 3, -} as const; - -export type _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction = - | 'APPEND_IF_EXISTS_OR_ADD' - | 0 - | 'ADD_IF_ABSENT' - | 1 - | 'OVERWRITE_IF_EXISTS_OR_ADD' - | 2 - | 'OVERWRITE_IF_EXISTS' - | 3 - -export type _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction__Output = typeof _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction[keyof typeof _envoy_config_core_v3_HeaderValueOption_HeaderAppendAction] - -export interface HeaderValueOption { - 'header'?: (_envoy_config_core_v3_HeaderValue | null); - 'append'?: (_google_protobuf_BoolValue | null); - 'appendAction'?: (_envoy_config_core_v3_HeaderValueOption_HeaderAppendAction); - 'keepEmptyValue'?: (boolean); -} - -export interface HeaderValueOption__Output { - 'header'?: (_envoy_config_core_v3_HeaderValue__Output); - 'append'?: (_google_protobuf_BoolValue__Output); - 'appendAction'?: (_envoy_config_core_v3_HeaderValueOption_HeaderAppendAction__Output); - 'keepEmptyValue'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts deleted file mode 100644 index 3893ca97..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/HttpUri.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/http_uri.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration.js'; - -export interface HttpUri { - 'uri'?: (string); - 'cluster'?: (string); - 'timeout'?: (_google_protobuf_Duration | null); - 'httpUpstreamType'?: "cluster"; -} - -export interface HttpUri__Output { - 'uri'?: (string); - 'cluster'?: (string); - 'timeout'?: (_google_protobuf_Duration__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts deleted file mode 100644 index 3886428d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface KeyValue { - 'key'?: (string); - 'value'?: (Buffer | Uint8Array | string); -} - -export interface KeyValue__Output { - 'key'?: (string); - 'value'?: (Buffer); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts deleted file mode 100644 index 87c2518c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueAppend.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { KeyValue as _envoy_config_core_v3_KeyValue, KeyValue__Output as _envoy_config_core_v3_KeyValue__Output } from './KeyValue.js'; -import type { KeyValuePair as _envoy_config_core_v3_KeyValuePair, KeyValuePair__Output as _envoy_config_core_v3_KeyValuePair__Output } from './KeyValuePair.js'; - -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -export const _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction = { - APPEND_IF_EXISTS_OR_ADD: 0, - ADD_IF_ABSENT: 1, - OVERWRITE_IF_EXISTS_OR_ADD: 2, - OVERWRITE_IF_EXISTS: 3, -} as const; - -export type _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction = - | 'APPEND_IF_EXISTS_OR_ADD' - | 0 - | 'ADD_IF_ABSENT' - | 1 - | 'OVERWRITE_IF_EXISTS_OR_ADD' - | 2 - | 'OVERWRITE_IF_EXISTS' - | 3 - -export type _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction__Output = typeof _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction[keyof typeof _envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction] - -export interface KeyValueAppend { - 'entry'?: (_envoy_config_core_v3_KeyValue | null); - 'action'?: (_envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction); - 'record'?: (_envoy_config_core_v3_KeyValuePair | null); -} - -export interface KeyValueAppend__Output { - 'entry'?: (_envoy_config_core_v3_KeyValue__Output); - 'action'?: (_envoy_config_core_v3_KeyValueAppend_KeyValueAppendAction__Output); - 'record'?: (_envoy_config_core_v3_KeyValuePair__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts deleted file mode 100644 index 56cfaf44..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValueMutation.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { KeyValueAppend as _envoy_config_core_v3_KeyValueAppend, KeyValueAppend__Output as _envoy_config_core_v3_KeyValueAppend__Output } from './KeyValueAppend.js'; - -export interface KeyValueMutation { - 'append'?: (_envoy_config_core_v3_KeyValueAppend | null); - 'remove'?: (string); -} - -export interface KeyValueMutation__Output { - 'append'?: (_envoy_config_core_v3_KeyValueAppend__Output); - 'remove'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts deleted file mode 100644 index baf9867d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/KeyValuePair.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from '../../../../google/protobuf/Value.js'; - -export interface KeyValuePair { - 'key'?: (string); - 'value'?: (_google_protobuf_Value | null); -} - -export interface KeyValuePair__Output { - 'key'?: (string); - 'value'?: (_google_protobuf_Value__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts deleted file mode 100644 index 4da88491..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Locality.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface Locality { - 'region'?: (string); - 'zone'?: (string); - 'subZone'?: (string); -} - -export interface Locality__Output { - 'region'?: (string); - 'zone'?: (string); - 'subZone'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts deleted file mode 100644 index e065ae91..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Metadata.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; - -export interface Metadata { - 'filterMetadata'?: ({[key: string]: _google_protobuf_Struct}); - 'typedFilterMetadata'?: ({[key: string]: _google_protobuf_Any}); -} - -export interface Metadata__Output { - 'filterMetadata'?: ({[key: string]: _google_protobuf_Struct__Output}); - 'typedFilterMetadata'?: ({[key: string]: _google_protobuf_Any__Output}); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts deleted file mode 100644 index 354307b9..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Node.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; -import type { Locality as _envoy_config_core_v3_Locality, Locality__Output as _envoy_config_core_v3_Locality__Output } from './Locality.js'; -import type { BuildVersion as _envoy_config_core_v3_BuildVersion, BuildVersion__Output as _envoy_config_core_v3_BuildVersion__Output } from './BuildVersion.js'; -import type { Extension as _envoy_config_core_v3_Extension, Extension__Output as _envoy_config_core_v3_Extension__Output } from './Extension.js'; -import type { Address as _envoy_config_core_v3_Address, Address__Output as _envoy_config_core_v3_Address__Output } from './Address.js'; -import type { ContextParams as _xds_core_v3_ContextParams, ContextParams__Output as _xds_core_v3_ContextParams__Output } from '../../../../xds/core/v3/ContextParams.js'; - -export interface Node { - 'id'?: (string); - 'cluster'?: (string); - 'metadata'?: (_google_protobuf_Struct | null); - 'locality'?: (_envoy_config_core_v3_Locality | null); - 'userAgentName'?: (string); - 'userAgentVersion'?: (string); - 'userAgentBuildVersion'?: (_envoy_config_core_v3_BuildVersion | null); - 'extensions'?: (_envoy_config_core_v3_Extension)[]; - 'clientFeatures'?: (string)[]; - 'listeningAddresses'?: (_envoy_config_core_v3_Address)[]; - 'dynamicParameters'?: ({[key: string]: _xds_core_v3_ContextParams}); - 'userAgentVersionType'?: "userAgentVersion"|"userAgentBuildVersion"; -} - -export interface Node__Output { - 'id'?: (string); - 'cluster'?: (string); - 'metadata'?: (_google_protobuf_Struct__Output); - 'locality'?: (_envoy_config_core_v3_Locality__Output); - 'userAgentName'?: (string); - 'userAgentVersion'?: (string); - 'userAgentBuildVersion'?: (_envoy_config_core_v3_BuildVersion__Output); - 'extensions'?: (_envoy_config_core_v3_Extension__Output)[]; - 'clientFeatures'?: (string)[]; - 'listeningAddresses'?: (_envoy_config_core_v3_Address__Output)[]; - 'dynamicParameters'?: ({[key: string]: _xds_core_v3_ContextParams__Output}); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts deleted file mode 100644 index 37abf5c6..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/Pipe.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - - -export interface Pipe { - 'path'?: (string); - 'mode'?: (number); -} - -export interface Pipe__Output { - 'path'?: (string); - 'mode'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts deleted file mode 100644 index 54e54383..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/QueryParameter.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface QueryParameter { - 'key'?: (string); - 'value'?: (string); -} - -export interface QueryParameter__Output { - 'key'?: (string); - 'value'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts deleted file mode 100644 index 2e5ad48b..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RemoteDataSource.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { HttpUri as _envoy_config_core_v3_HttpUri, HttpUri__Output as _envoy_config_core_v3_HttpUri__Output } from './HttpUri.js'; -import type { RetryPolicy as _envoy_config_core_v3_RetryPolicy, RetryPolicy__Output as _envoy_config_core_v3_RetryPolicy__Output } from './RetryPolicy.js'; - -export interface RemoteDataSource { - 'httpUri'?: (_envoy_config_core_v3_HttpUri | null); - 'sha256'?: (string); - 'retryPolicy'?: (_envoy_config_core_v3_RetryPolicy | null); -} - -export interface RemoteDataSource__Output { - 'httpUri'?: (_envoy_config_core_v3_HttpUri__Output); - 'sha256'?: (string); - 'retryPolicy'?: (_envoy_config_core_v3_RetryPolicy__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts deleted file mode 100644 index e2d67deb..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RequestMethod.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -export const RequestMethod = { - METHOD_UNSPECIFIED: 0, - GET: 1, - HEAD: 2, - POST: 3, - PUT: 4, - DELETE: 5, - CONNECT: 6, - OPTIONS: 7, - TRACE: 8, - PATCH: 9, -} as const; - -export type RequestMethod = - | 'METHOD_UNSPECIFIED' - | 0 - | 'GET' - | 1 - | 'HEAD' - | 2 - | 'POST' - | 3 - | 'PUT' - | 4 - | 'DELETE' - | 5 - | 'CONNECT' - | 6 - | 'OPTIONS' - | 7 - | 'TRACE' - | 8 - | 'PATCH' - | 9 - -export type RequestMethod__Output = typeof RequestMethod[keyof typeof RequestMethod] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts deleted file mode 100644 index d2d2a004..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RetryPolicy.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { BackoffStrategy as _envoy_config_core_v3_BackoffStrategy, BackoffStrategy__Output as _envoy_config_core_v3_BackoffStrategy__Output } from './BackoffStrategy.js'; -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value.js'; -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; -import type { Long } from '@grpc/proto-loader'; - -export interface _envoy_config_core_v3_RetryPolicy_RetryHostPredicate { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any | null); - 'configType'?: "typedConfig"; -} - -export interface _envoy_config_core_v3_RetryPolicy_RetryHostPredicate__Output { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any__Output); -} - -export interface _envoy_config_core_v3_RetryPolicy_RetryPriority { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any | null); - 'configType'?: "typedConfig"; -} - -export interface _envoy_config_core_v3_RetryPolicy_RetryPriority__Output { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any__Output); -} - -export interface RetryPolicy { - 'retryBackOff'?: (_envoy_config_core_v3_BackoffStrategy | null); - 'numRetries'?: (_google_protobuf_UInt32Value | null); - 'retryOn'?: (string); - 'retryPriority'?: (_envoy_config_core_v3_RetryPolicy_RetryPriority | null); - 'retryHostPredicate'?: (_envoy_config_core_v3_RetryPolicy_RetryHostPredicate)[]; - 'hostSelectionRetryMaxAttempts'?: (number | string | Long); -} - -export interface RetryPolicy__Output { - 'retryBackOff'?: (_envoy_config_core_v3_BackoffStrategy__Output); - 'numRetries'?: (_google_protobuf_UInt32Value__Output); - 'retryOn'?: (string); - 'retryPriority'?: (_envoy_config_core_v3_RetryPolicy_RetryPriority__Output); - 'retryHostPredicate'?: (_envoy_config_core_v3_RetryPolicy_RetryHostPredicate__Output)[]; - 'hostSelectionRetryMaxAttempts'?: (Long); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts deleted file mode 100644 index ef8eeb0c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RoutingPriority.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -export const RoutingPriority = { - DEFAULT: 0, - HIGH: 1, -} as const; - -export type RoutingPriority = - | 'DEFAULT' - | 0 - | 'HIGH' - | 1 - -export type RoutingPriority__Output = typeof RoutingPriority[keyof typeof RoutingPriority] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts deleted file mode 100644 index 78b897ed..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeDouble.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface RuntimeDouble { - 'defaultValue'?: (number | string); - 'runtimeKey'?: (string); -} - -export interface RuntimeDouble__Output { - 'defaultValue'?: (number); - 'runtimeKey'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts deleted file mode 100644 index 63b38f64..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFeatureFlag.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue.js'; - -export interface RuntimeFeatureFlag { - 'defaultValue'?: (_google_protobuf_BoolValue | null); - 'runtimeKey'?: (string); -} - -export interface RuntimeFeatureFlag__Output { - 'defaultValue'?: (_google_protobuf_BoolValue__Output); - 'runtimeKey'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts deleted file mode 100644 index 804b9f50..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeFractionalPercent.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { FractionalPercent as _envoy_type_v3_FractionalPercent, FractionalPercent__Output as _envoy_type_v3_FractionalPercent__Output } from '../../../type/v3/FractionalPercent.js'; - -export interface RuntimeFractionalPercent { - 'defaultValue'?: (_envoy_type_v3_FractionalPercent | null); - 'runtimeKey'?: (string); -} - -export interface RuntimeFractionalPercent__Output { - 'defaultValue'?: (_envoy_type_v3_FractionalPercent__Output); - 'runtimeKey'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts deleted file mode 100644 index 4788869f..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimePercent.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { Percent as _envoy_type_v3_Percent, Percent__Output as _envoy_type_v3_Percent__Output } from '../../../type/v3/Percent.js'; - -export interface RuntimePercent { - 'defaultValue'?: (_envoy_type_v3_Percent | null); - 'runtimeKey'?: (string); -} - -export interface RuntimePercent__Output { - 'defaultValue'?: (_envoy_type_v3_Percent__Output); - 'runtimeKey'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts deleted file mode 100644 index cf0a2379..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/RuntimeUInt32.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface RuntimeUInt32 { - 'defaultValue'?: (number); - 'runtimeKey'?: (string); -} - -export interface RuntimeUInt32__Output { - 'defaultValue'?: (number); - 'runtimeKey'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts deleted file mode 100644 index 926814ac..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketAddress.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - - -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - -export const _envoy_config_core_v3_SocketAddress_Protocol = { - TCP: 0, - UDP: 1, -} as const; - -export type _envoy_config_core_v3_SocketAddress_Protocol = - | 'TCP' - | 0 - | 'UDP' - | 1 - -export type _envoy_config_core_v3_SocketAddress_Protocol__Output = typeof _envoy_config_core_v3_SocketAddress_Protocol[keyof typeof _envoy_config_core_v3_SocketAddress_Protocol] - -export interface SocketAddress { - 'protocol'?: (_envoy_config_core_v3_SocketAddress_Protocol); - 'address'?: (string); - 'portValue'?: (number); - 'namedPort'?: (string); - 'resolverName'?: (string); - 'ipv4Compat'?: (boolean); - 'networkNamespaceFilepath'?: (string); - 'portSpecifier'?: "portValue"|"namedPort"; -} - -export interface SocketAddress__Output { - 'protocol'?: (_envoy_config_core_v3_SocketAddress_Protocol__Output); - 'address'?: (string); - 'portValue'?: (number); - 'namedPort'?: (string); - 'resolverName'?: (string); - 'ipv4Compat'?: (boolean); - 'networkNamespaceFilepath'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts deleted file mode 100644 index 82b4d9dc..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOption.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/socket_option.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface _envoy_config_core_v3_SocketOption_SocketType_Datagram { -} - -export interface _envoy_config_core_v3_SocketOption_SocketType_Datagram__Output { -} - -// Original file: ../../../envoy/api/envoy/config/core/v3/socket_option.proto - -export const _envoy_config_core_v3_SocketOption_SocketState = { - STATE_PREBIND: 0, - STATE_BOUND: 1, - STATE_LISTENING: 2, -} as const; - -export type _envoy_config_core_v3_SocketOption_SocketState = - | 'STATE_PREBIND' - | 0 - | 'STATE_BOUND' - | 1 - | 'STATE_LISTENING' - | 2 - -export type _envoy_config_core_v3_SocketOption_SocketState__Output = typeof _envoy_config_core_v3_SocketOption_SocketState[keyof typeof _envoy_config_core_v3_SocketOption_SocketState] - -export interface _envoy_config_core_v3_SocketOption_SocketType { - 'stream'?: (_envoy_config_core_v3_SocketOption_SocketType_Stream | null); - 'datagram'?: (_envoy_config_core_v3_SocketOption_SocketType_Datagram | null); -} - -export interface _envoy_config_core_v3_SocketOption_SocketType__Output { - 'stream'?: (_envoy_config_core_v3_SocketOption_SocketType_Stream__Output); - 'datagram'?: (_envoy_config_core_v3_SocketOption_SocketType_Datagram__Output); -} - -export interface _envoy_config_core_v3_SocketOption_SocketType_Stream { -} - -export interface _envoy_config_core_v3_SocketOption_SocketType_Stream__Output { -} - -export interface SocketOption { - 'description'?: (string); - 'level'?: (number | string | Long); - 'name'?: (number | string | Long); - 'intValue'?: (number | string | Long); - 'bufValue'?: (Buffer | Uint8Array | string); - 'state'?: (_envoy_config_core_v3_SocketOption_SocketState); - 'type'?: (_envoy_config_core_v3_SocketOption_SocketType | null); - 'value'?: "intValue"|"bufValue"; -} - -export interface SocketOption__Output { - 'description'?: (string); - 'level'?: (Long); - 'name'?: (Long); - 'intValue'?: (Long); - 'bufValue'?: (Buffer); - 'state'?: (_envoy_config_core_v3_SocketOption_SocketState__Output); - 'type'?: (_envoy_config_core_v3_SocketOption_SocketType__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts deleted file mode 100644 index 7a0212bb..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/SocketOptionsOverride.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/socket_option.proto - -import type { SocketOption as _envoy_config_core_v3_SocketOption, SocketOption__Output as _envoy_config_core_v3_SocketOption__Output } from './SocketOption.js'; - -export interface SocketOptionsOverride { - 'socketOptions'?: (_envoy_config_core_v3_SocketOption)[]; -} - -export interface SocketOptionsOverride__Output { - 'socketOptions'?: (_envoy_config_core_v3_SocketOption__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts deleted file mode 100644 index f43242bc..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TcpKeepalive.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/address.proto - -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value.js'; - -export interface TcpKeepalive { - 'keepaliveProbes'?: (_google_protobuf_UInt32Value | null); - 'keepaliveTime'?: (_google_protobuf_UInt32Value | null); - 'keepaliveInterval'?: (_google_protobuf_UInt32Value | null); -} - -export interface TcpKeepalive__Output { - 'keepaliveProbes'?: (_google_protobuf_UInt32Value__Output); - 'keepaliveTime'?: (_google_protobuf_UInt32Value__Output); - 'keepaliveInterval'?: (_google_protobuf_UInt32Value__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts deleted file mode 100644 index 5c2bb8a1..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TrafficDirection.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -export const TrafficDirection = { - UNSPECIFIED: 0, - INBOUND: 1, - OUTBOUND: 2, -} as const; - -export type TrafficDirection = - | 'UNSPECIFIED' - | 0 - | 'INBOUND' - | 1 - | 'OUTBOUND' - | 2 - -export type TrafficDirection__Output = typeof TrafficDirection[keyof typeof TrafficDirection] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts deleted file mode 100644 index 0c0e04ca..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TransportSocket.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; - -export interface TransportSocket { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any | null); - 'configType'?: "typedConfig"; -} - -export interface TransportSocket__Output { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts deleted file mode 100644 index 5f6c8a7d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/TypedExtensionConfig.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/extension.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any.js'; - -export interface TypedExtensionConfig { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any | null); -} - -export interface TypedExtensionConfig__Output { - 'name'?: (string); - 'typedConfig'?: (_google_protobuf_Any__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts deleted file mode 100644 index 7b503731..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/config/core/v3/WatchedDirectory.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../envoy/api/envoy/config/core/v3/base.proto - - -export interface WatchedDirectory { - 'path'?: (string); -} - -export interface WatchedDirectory__Output { - 'path'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts deleted file mode 100644 index 3bb1c551..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Original file: ../../../envoy/api/envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto - - -// Original file: ../../../envoy/api/envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto - -export const _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode = { - NONE: 0, - STREAMED: 1, - BUFFERED: 2, - BUFFERED_PARTIAL: 3, - FULL_DUPLEX_STREAMED: 4, -} as const; - -export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode = - | 'NONE' - | 0 - | 'STREAMED' - | 1 - | 'BUFFERED' - | 2 - | 'BUFFERED_PARTIAL' - | 3 - | 'FULL_DUPLEX_STREAMED' - | 4 - -export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output = typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode[keyof typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode] - -// Original file: ../../../envoy/api/envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto - -export const _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode = { - DEFAULT: 0, - SEND: 1, - SKIP: 2, -} as const; - -export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode = - | 'DEFAULT' - | 0 - | 'SEND' - | 1 - | 'SKIP' - | 2 - -export type _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output = typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode[keyof typeof _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode] - -export interface ProcessingMode { - 'requestHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); - 'responseHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); - 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); - 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); - 'requestTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); - 'responseTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode); -} - -export interface ProcessingMode__Output { - 'requestHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); - 'responseHeaderMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); - 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); - 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); - 'requestTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); - 'responseTrailerMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_HeaderSendMode__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts deleted file mode 100644 index 9f28bc3b..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyMutation.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { StreamedBodyResponse as _envoy_service_ext_proc_v3_StreamedBodyResponse, StreamedBodyResponse__Output as _envoy_service_ext_proc_v3_StreamedBodyResponse__Output } from './StreamedBodyResponse.js'; - -export interface BodyMutation { - 'body'?: (Buffer | Uint8Array | string); - 'clearBody'?: (boolean); - 'streamedResponse'?: (_envoy_service_ext_proc_v3_StreamedBodyResponse | null); - 'mutation'?: "body"|"clearBody"|"streamedResponse"; -} - -export interface BodyMutation__Output { - 'body'?: (Buffer); - 'clearBody'?: (boolean); - 'streamedResponse'?: (_envoy_service_ext_proc_v3_StreamedBodyResponse__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts deleted file mode 100644 index 77b2fca0..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/BodyResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { CommonResponse as _envoy_service_ext_proc_v3_CommonResponse, CommonResponse__Output as _envoy_service_ext_proc_v3_CommonResponse__Output } from './CommonResponse.js'; - -export interface BodyResponse { - 'response'?: (_envoy_service_ext_proc_v3_CommonResponse | null); -} - -export interface BodyResponse__Output { - 'response'?: (_envoy_service_ext_proc_v3_CommonResponse__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts deleted file mode 100644 index da132b50..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/CommonResponse.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './HeaderMutation.js'; -import type { BodyMutation as _envoy_service_ext_proc_v3_BodyMutation, BodyMutation__Output as _envoy_service_ext_proc_v3_BodyMutation__Output } from './BodyMutation.js'; -import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from '../../../config/core/v3/HeaderMap.js'; - -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -export const _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus = { - CONTINUE: 0, - CONTINUE_AND_REPLACE: 1, -} as const; - -export type _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus = - | 'CONTINUE' - | 0 - | 'CONTINUE_AND_REPLACE' - | 1 - -export type _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus__Output = typeof _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus[keyof typeof _envoy_service_ext_proc_v3_CommonResponse_ResponseStatus] - -export interface CommonResponse { - 'status'?: (_envoy_service_ext_proc_v3_CommonResponse_ResponseStatus); - 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation | null); - 'bodyMutation'?: (_envoy_service_ext_proc_v3_BodyMutation | null); - 'trailers'?: (_envoy_config_core_v3_HeaderMap | null); - 'clearRouteCache'?: (boolean); -} - -export interface CommonResponse__Output { - 'status'?: (_envoy_service_ext_proc_v3_CommonResponse_ResponseStatus__Output); - 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation__Output); - 'bodyMutation'?: (_envoy_service_ext_proc_v3_BodyMutation__Output); - 'trailers'?: (_envoy_config_core_v3_HeaderMap__Output); - 'clearRouteCache'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts deleted file mode 100644 index 61bec98c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ExternalProcessor.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type * as grpc from '@grpc/grpc-js' -import type { MethodDefinition } from '@grpc/proto-loader' -import type { ProcessingRequest as _envoy_service_ext_proc_v3_ProcessingRequest, ProcessingRequest__Output as _envoy_service_ext_proc_v3_ProcessingRequest__Output } from './ProcessingRequest.js'; -import type { ProcessingResponse as _envoy_service_ext_proc_v3_ProcessingResponse, ProcessingResponse__Output as _envoy_service_ext_proc_v3_ProcessingResponse__Output } from './ProcessingResponse.js'; - -export interface ExternalProcessorClient extends grpc.Client { - Process(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; - Process(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; - process(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; - process(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse__Output>; - -} - -export interface ExternalProcessorHandlers extends grpc.UntypedServiceImplementation { - Process: grpc.handleBidiStreamingCall<_envoy_service_ext_proc_v3_ProcessingRequest__Output, _envoy_service_ext_proc_v3_ProcessingResponse>; - -} - -export interface ExternalProcessorDefinition extends grpc.ServiceDefinition { - Process: MethodDefinition<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingResponse, _envoy_service_ext_proc_v3_ProcessingRequest__Output, _envoy_service_ext_proc_v3_ProcessingResponse__Output> -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts deleted file mode 100644 index 45d500d0..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/GrpcStatus.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - - -export interface GrpcStatus { - 'status'?: (number); -} - -export interface GrpcStatus__Output { - 'status'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts deleted file mode 100644 index c5a04a65..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeaderMutation.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HeaderValueOption as _envoy_config_core_v3_HeaderValueOption, HeaderValueOption__Output as _envoy_config_core_v3_HeaderValueOption__Output } from '../../../config/core/v3/HeaderValueOption.js'; - -export interface HeaderMutation { - 'setHeaders'?: (_envoy_config_core_v3_HeaderValueOption)[]; - 'removeHeaders'?: (string)[]; -} - -export interface HeaderMutation__Output { - 'setHeaders'?: (_envoy_config_core_v3_HeaderValueOption__Output)[]; - 'removeHeaders'?: (string)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts deleted file mode 100644 index 36a16dec..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HeadersResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { CommonResponse as _envoy_service_ext_proc_v3_CommonResponse, CommonResponse__Output as _envoy_service_ext_proc_v3_CommonResponse__Output } from './CommonResponse.js'; - -export interface HeadersResponse { - 'response'?: (_envoy_service_ext_proc_v3_CommonResponse | null); -} - -export interface HeadersResponse__Output { - 'response'?: (_envoy_service_ext_proc_v3_CommonResponse__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts deleted file mode 100644 index 49702a8e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpBody.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - - -export interface HttpBody { - 'body'?: (Buffer | Uint8Array | string); - 'endOfStream'?: (boolean); -} - -export interface HttpBody__Output { - 'body'?: (Buffer); - 'endOfStream'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts deleted file mode 100644 index 9c239b14..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpHeaders.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from '../../../config/core/v3/HeaderMap.js'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; - -export interface HttpHeaders { - 'headers'?: (_envoy_config_core_v3_HeaderMap | null); - 'attributes'?: ({[key: string]: _google_protobuf_Struct}); - 'endOfStream'?: (boolean); -} - -export interface HttpHeaders__Output { - 'headers'?: (_envoy_config_core_v3_HeaderMap__Output); - 'attributes'?: ({[key: string]: _google_protobuf_Struct__Output}); - 'endOfStream'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts deleted file mode 100644 index 51fbecc4..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/HttpTrailers.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from '../../../config/core/v3/HeaderMap.js'; - -export interface HttpTrailers { - 'trailers'?: (_envoy_config_core_v3_HeaderMap | null); -} - -export interface HttpTrailers__Output { - 'trailers'?: (_envoy_config_core_v3_HeaderMap__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts deleted file mode 100644 index e4d2bf3d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ImmediateResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HttpStatus as _envoy_type_v3_HttpStatus, HttpStatus__Output as _envoy_type_v3_HttpStatus__Output } from '../../../type/v3/HttpStatus.js'; -import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './HeaderMutation.js'; -import type { GrpcStatus as _envoy_service_ext_proc_v3_GrpcStatus, GrpcStatus__Output as _envoy_service_ext_proc_v3_GrpcStatus__Output } from './GrpcStatus.js'; - -export interface ImmediateResponse { - 'status'?: (_envoy_type_v3_HttpStatus | null); - 'headers'?: (_envoy_service_ext_proc_v3_HeaderMutation | null); - 'body'?: (Buffer | Uint8Array | string); - 'grpcStatus'?: (_envoy_service_ext_proc_v3_GrpcStatus | null); - 'details'?: (string); -} - -export interface ImmediateResponse__Output { - 'status'?: (_envoy_type_v3_HttpStatus__Output); - 'headers'?: (_envoy_service_ext_proc_v3_HeaderMutation__Output); - 'body'?: (Buffer); - 'grpcStatus'?: (_envoy_service_ext_proc_v3_GrpcStatus__Output); - 'details'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts deleted file mode 100644 index 85fc2c61..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingRequest.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HttpHeaders as _envoy_service_ext_proc_v3_HttpHeaders, HttpHeaders__Output as _envoy_service_ext_proc_v3_HttpHeaders__Output } from './HttpHeaders.js'; -import type { HttpBody as _envoy_service_ext_proc_v3_HttpBody, HttpBody__Output as _envoy_service_ext_proc_v3_HttpBody__Output } from './HttpBody.js'; -import type { HttpTrailers as _envoy_service_ext_proc_v3_HttpTrailers, HttpTrailers__Output as _envoy_service_ext_proc_v3_HttpTrailers__Output } from './HttpTrailers.js'; -import type { Metadata as _envoy_config_core_v3_Metadata, Metadata__Output as _envoy_config_core_v3_Metadata__Output } from '../../../config/core/v3/Metadata.js'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; -import type { ProtocolConfiguration as _envoy_service_ext_proc_v3_ProtocolConfiguration, ProtocolConfiguration__Output as _envoy_service_ext_proc_v3_ProtocolConfiguration__Output } from './ProtocolConfiguration.js'; - -export interface ProcessingRequest { - 'requestHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders | null); - 'responseHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders | null); - 'requestBody'?: (_envoy_service_ext_proc_v3_HttpBody | null); - 'responseBody'?: (_envoy_service_ext_proc_v3_HttpBody | null); - 'requestTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers | null); - 'responseTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers | null); - 'metadataContext'?: (_envoy_config_core_v3_Metadata | null); - 'attributes'?: ({[key: string]: _google_protobuf_Struct}); - 'observabilityMode'?: (boolean); - 'protocolConfig'?: (_envoy_service_ext_proc_v3_ProtocolConfiguration | null); - 'request'?: "requestHeaders"|"responseHeaders"|"requestBody"|"responseBody"|"requestTrailers"|"responseTrailers"; -} - -export interface ProcessingRequest__Output { - 'requestHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders__Output); - 'responseHeaders'?: (_envoy_service_ext_proc_v3_HttpHeaders__Output); - 'requestBody'?: (_envoy_service_ext_proc_v3_HttpBody__Output); - 'responseBody'?: (_envoy_service_ext_proc_v3_HttpBody__Output); - 'requestTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers__Output); - 'responseTrailers'?: (_envoy_service_ext_proc_v3_HttpTrailers__Output); - 'metadataContext'?: (_envoy_config_core_v3_Metadata__Output); - 'attributes'?: ({[key: string]: _google_protobuf_Struct__Output}); - 'observabilityMode'?: (boolean); - 'protocolConfig'?: (_envoy_service_ext_proc_v3_ProtocolConfiguration__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts deleted file mode 100644 index b973f430..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProcessingResponse.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HeadersResponse as _envoy_service_ext_proc_v3_HeadersResponse, HeadersResponse__Output as _envoy_service_ext_proc_v3_HeadersResponse__Output } from './HeadersResponse.js'; -import type { BodyResponse as _envoy_service_ext_proc_v3_BodyResponse, BodyResponse__Output as _envoy_service_ext_proc_v3_BodyResponse__Output } from './BodyResponse.js'; -import type { TrailersResponse as _envoy_service_ext_proc_v3_TrailersResponse, TrailersResponse__Output as _envoy_service_ext_proc_v3_TrailersResponse__Output } from './TrailersResponse.js'; -import type { ImmediateResponse as _envoy_service_ext_proc_v3_ImmediateResponse, ImmediateResponse__Output as _envoy_service_ext_proc_v3_ImmediateResponse__Output } from './ImmediateResponse.js'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct.js'; -import type { ProcessingMode as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode, ProcessingMode__Output as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output } from '../../../extensions/filters/http/ext_proc/v3/ProcessingMode.js'; -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration.js'; - -export interface ProcessingResponse { - 'requestHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse | null); - 'responseHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse | null); - 'requestBody'?: (_envoy_service_ext_proc_v3_BodyResponse | null); - 'responseBody'?: (_envoy_service_ext_proc_v3_BodyResponse | null); - 'requestTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse | null); - 'responseTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse | null); - 'immediateResponse'?: (_envoy_service_ext_proc_v3_ImmediateResponse | null); - 'dynamicMetadata'?: (_google_protobuf_Struct | null); - 'modeOverride'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode | null); - 'overrideMessageTimeout'?: (_google_protobuf_Duration | null); - 'response'?: "requestHeaders"|"responseHeaders"|"requestBody"|"responseBody"|"requestTrailers"|"responseTrailers"|"immediateResponse"; -} - -export interface ProcessingResponse__Output { - 'requestHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse__Output); - 'responseHeaders'?: (_envoy_service_ext_proc_v3_HeadersResponse__Output); - 'requestBody'?: (_envoy_service_ext_proc_v3_BodyResponse__Output); - 'responseBody'?: (_envoy_service_ext_proc_v3_BodyResponse__Output); - 'requestTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse__Output); - 'responseTrailers'?: (_envoy_service_ext_proc_v3_TrailersResponse__Output); - 'immediateResponse'?: (_envoy_service_ext_proc_v3_ImmediateResponse__Output); - 'dynamicMetadata'?: (_google_protobuf_Struct__Output); - 'modeOverride'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output); - 'overrideMessageTimeout'?: (_google_protobuf_Duration__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts deleted file mode 100644 index 7c6b1d88..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/ProtocolConfiguration.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode, _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output } from '../../../extensions/filters/http/ext_proc/v3/ProcessingMode.js'; - -export interface ProtocolConfiguration { - 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); - 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode); - 'sendBodyWithoutWaitingForHeaderResponse'?: (boolean); -} - -export interface ProtocolConfiguration__Output { - 'requestBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); - 'responseBodyMode'?: (_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode_BodySendMode__Output); - 'sendBodyWithoutWaitingForHeaderResponse'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts deleted file mode 100644 index 1b1d3e69..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/StreamedBodyResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - - -export interface StreamedBodyResponse { - 'body'?: (Buffer | Uint8Array | string); - 'endOfStream'?: (boolean); -} - -export interface StreamedBodyResponse__Output { - 'body'?: (Buffer); - 'endOfStream'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts deleted file mode 100644 index 319ce0d1..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/service/ext_proc/v3/TrailersResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/service/ext_proc/v3/external_processor.proto - -import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './HeaderMutation.js'; - -export interface TrailersResponse { - 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation | null); -} - -export interface TrailersResponse__Output { - 'headerMutation'?: (_envoy_service_ext_proc_v3_HeaderMutation__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts deleted file mode 100644 index 9d899036..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/FractionalPercent.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Original file: ../../../envoy/api/envoy/type/v3/percent.proto - - -// Original file: ../../../envoy/api/envoy/type/v3/percent.proto - -export const _envoy_type_v3_FractionalPercent_DenominatorType = { - HUNDRED: 0, - TEN_THOUSAND: 1, - MILLION: 2, -} as const; - -export type _envoy_type_v3_FractionalPercent_DenominatorType = - | 'HUNDRED' - | 0 - | 'TEN_THOUSAND' - | 1 - | 'MILLION' - | 2 - -export type _envoy_type_v3_FractionalPercent_DenominatorType__Output = typeof _envoy_type_v3_FractionalPercent_DenominatorType[keyof typeof _envoy_type_v3_FractionalPercent_DenominatorType] - -export interface FractionalPercent { - 'numerator'?: (number); - 'denominator'?: (_envoy_type_v3_FractionalPercent_DenominatorType); -} - -export interface FractionalPercent__Output { - 'numerator'?: (number); - 'denominator'?: (_envoy_type_v3_FractionalPercent_DenominatorType__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts deleted file mode 100644 index f9decd96..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/HttpStatus.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: ../../../envoy/api/envoy/type/v3/http_status.proto - -import type { StatusCode as _envoy_type_v3_StatusCode, StatusCode__Output as _envoy_type_v3_StatusCode__Output } from './StatusCode.js'; - -export interface HttpStatus { - 'code'?: (_envoy_type_v3_StatusCode); -} - -export interface HttpStatus__Output { - 'code'?: (_envoy_type_v3_StatusCode__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts deleted file mode 100644 index 08911c28..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/Percent.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../envoy/api/envoy/type/v3/percent.proto - - -export interface Percent { - 'value'?: (number | string); -} - -export interface Percent__Output { - 'value'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts deleted file mode 100644 index a7804638..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/SemanticVersion.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../envoy/api/envoy/type/v3/semantic_version.proto - - -export interface SemanticVersion { - 'majorNumber'?: (number); - 'minorNumber'?: (number); - 'patch'?: (number); -} - -export interface SemanticVersion__Output { - 'majorNumber'?: (number); - 'minorNumber'?: (number); - 'patch'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts deleted file mode 100644 index 16d3d146..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/envoy/type/v3/StatusCode.ts +++ /dev/null @@ -1,179 +0,0 @@ -// Original file: ../../../envoy/api/envoy/type/v3/http_status.proto - -export const StatusCode = { - Empty: 0, - Continue: 100, - OK: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - IMUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - URITooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HTTPVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, -} as const; - -export type StatusCode = - | 'Empty' - | 0 - | 'Continue' - | 100 - | 'OK' - | 200 - | 'Created' - | 201 - | 'Accepted' - | 202 - | 'NonAuthoritativeInformation' - | 203 - | 'NoContent' - | 204 - | 'ResetContent' - | 205 - | 'PartialContent' - | 206 - | 'MultiStatus' - | 207 - | 'AlreadyReported' - | 208 - | 'IMUsed' - | 226 - | 'MultipleChoices' - | 300 - | 'MovedPermanently' - | 301 - | 'Found' - | 302 - | 'SeeOther' - | 303 - | 'NotModified' - | 304 - | 'UseProxy' - | 305 - | 'TemporaryRedirect' - | 307 - | 'PermanentRedirect' - | 308 - | 'BadRequest' - | 400 - | 'Unauthorized' - | 401 - | 'PaymentRequired' - | 402 - | 'Forbidden' - | 403 - | 'NotFound' - | 404 - | 'MethodNotAllowed' - | 405 - | 'NotAcceptable' - | 406 - | 'ProxyAuthenticationRequired' - | 407 - | 'RequestTimeout' - | 408 - | 'Conflict' - | 409 - | 'Gone' - | 410 - | 'LengthRequired' - | 411 - | 'PreconditionFailed' - | 412 - | 'PayloadTooLarge' - | 413 - | 'URITooLong' - | 414 - | 'UnsupportedMediaType' - | 415 - | 'RangeNotSatisfiable' - | 416 - | 'ExpectationFailed' - | 417 - | 'MisdirectedRequest' - | 421 - | 'UnprocessableEntity' - | 422 - | 'Locked' - | 423 - | 'FailedDependency' - | 424 - | 'UpgradeRequired' - | 426 - | 'PreconditionRequired' - | 428 - | 'TooManyRequests' - | 429 - | 'RequestHeaderFieldsTooLarge' - | 431 - | 'InternalServerError' - | 500 - | 'NotImplemented' - | 501 - | 'BadGateway' - | 502 - | 'ServiceUnavailable' - | 503 - | 'GatewayTimeout' - | 504 - | 'HTTPVersionNotSupported' - | 505 - | 'VariantAlsoNegotiates' - | 506 - | 'InsufficientStorage' - | 507 - | 'LoopDetected' - | 508 - | 'NotExtended' - | 510 - | 'NetworkAuthenticationRequired' - | 511 - -export type StatusCode__Output = typeof StatusCode[keyof typeof StatusCode] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts deleted file mode 100644 index b6f55d9e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/external_processor.ts +++ /dev/null @@ -1,331 +0,0 @@ -import type * as grpc from '@grpc/grpc-js'; -import type { EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader'; - -import type { Address as _envoy_config_core_v3_Address, Address__Output as _envoy_config_core_v3_Address__Output } from './envoy/config/core/v3/Address.js'; -import type { AsyncDataSource as _envoy_config_core_v3_AsyncDataSource, AsyncDataSource__Output as _envoy_config_core_v3_AsyncDataSource__Output } from './envoy/config/core/v3/AsyncDataSource.js'; -import type { BackoffStrategy as _envoy_config_core_v3_BackoffStrategy, BackoffStrategy__Output as _envoy_config_core_v3_BackoffStrategy__Output } from './envoy/config/core/v3/BackoffStrategy.js'; -import type { BindConfig as _envoy_config_core_v3_BindConfig, BindConfig__Output as _envoy_config_core_v3_BindConfig__Output } from './envoy/config/core/v3/BindConfig.js'; -import type { BuildVersion as _envoy_config_core_v3_BuildVersion, BuildVersion__Output as _envoy_config_core_v3_BuildVersion__Output } from './envoy/config/core/v3/BuildVersion.js'; -import type { CidrRange as _envoy_config_core_v3_CidrRange, CidrRange__Output as _envoy_config_core_v3_CidrRange__Output } from './envoy/config/core/v3/CidrRange.js'; -import type { ControlPlane as _envoy_config_core_v3_ControlPlane, ControlPlane__Output as _envoy_config_core_v3_ControlPlane__Output } from './envoy/config/core/v3/ControlPlane.js'; -import type { DataSource as _envoy_config_core_v3_DataSource, DataSource__Output as _envoy_config_core_v3_DataSource__Output } from './envoy/config/core/v3/DataSource.js'; -import type { EnvoyInternalAddress as _envoy_config_core_v3_EnvoyInternalAddress, EnvoyInternalAddress__Output as _envoy_config_core_v3_EnvoyInternalAddress__Output } from './envoy/config/core/v3/EnvoyInternalAddress.js'; -import type { Extension as _envoy_config_core_v3_Extension, Extension__Output as _envoy_config_core_v3_Extension__Output } from './envoy/config/core/v3/Extension.js'; -import type { ExtraSourceAddress as _envoy_config_core_v3_ExtraSourceAddress, ExtraSourceAddress__Output as _envoy_config_core_v3_ExtraSourceAddress__Output } from './envoy/config/core/v3/ExtraSourceAddress.js'; -import type { HeaderMap as _envoy_config_core_v3_HeaderMap, HeaderMap__Output as _envoy_config_core_v3_HeaderMap__Output } from './envoy/config/core/v3/HeaderMap.js'; -import type { HeaderValue as _envoy_config_core_v3_HeaderValue, HeaderValue__Output as _envoy_config_core_v3_HeaderValue__Output } from './envoy/config/core/v3/HeaderValue.js'; -import type { HeaderValueOption as _envoy_config_core_v3_HeaderValueOption, HeaderValueOption__Output as _envoy_config_core_v3_HeaderValueOption__Output } from './envoy/config/core/v3/HeaderValueOption.js'; -import type { HttpUri as _envoy_config_core_v3_HttpUri, HttpUri__Output as _envoy_config_core_v3_HttpUri__Output } from './envoy/config/core/v3/HttpUri.js'; -import type { KeyValue as _envoy_config_core_v3_KeyValue, KeyValue__Output as _envoy_config_core_v3_KeyValue__Output } from './envoy/config/core/v3/KeyValue.js'; -import type { KeyValueAppend as _envoy_config_core_v3_KeyValueAppend, KeyValueAppend__Output as _envoy_config_core_v3_KeyValueAppend__Output } from './envoy/config/core/v3/KeyValueAppend.js'; -import type { KeyValueMutation as _envoy_config_core_v3_KeyValueMutation, KeyValueMutation__Output as _envoy_config_core_v3_KeyValueMutation__Output } from './envoy/config/core/v3/KeyValueMutation.js'; -import type { KeyValuePair as _envoy_config_core_v3_KeyValuePair, KeyValuePair__Output as _envoy_config_core_v3_KeyValuePair__Output } from './envoy/config/core/v3/KeyValuePair.js'; -import type { Locality as _envoy_config_core_v3_Locality, Locality__Output as _envoy_config_core_v3_Locality__Output } from './envoy/config/core/v3/Locality.js'; -import type { Metadata as _envoy_config_core_v3_Metadata, Metadata__Output as _envoy_config_core_v3_Metadata__Output } from './envoy/config/core/v3/Metadata.js'; -import type { Node as _envoy_config_core_v3_Node, Node__Output as _envoy_config_core_v3_Node__Output } from './envoy/config/core/v3/Node.js'; -import type { Pipe as _envoy_config_core_v3_Pipe, Pipe__Output as _envoy_config_core_v3_Pipe__Output } from './envoy/config/core/v3/Pipe.js'; -import type { QueryParameter as _envoy_config_core_v3_QueryParameter, QueryParameter__Output as _envoy_config_core_v3_QueryParameter__Output } from './envoy/config/core/v3/QueryParameter.js'; -import type { RemoteDataSource as _envoy_config_core_v3_RemoteDataSource, RemoteDataSource__Output as _envoy_config_core_v3_RemoteDataSource__Output } from './envoy/config/core/v3/RemoteDataSource.js'; -import type { RetryPolicy as _envoy_config_core_v3_RetryPolicy, RetryPolicy__Output as _envoy_config_core_v3_RetryPolicy__Output } from './envoy/config/core/v3/RetryPolicy.js'; -import type { RuntimeDouble as _envoy_config_core_v3_RuntimeDouble, RuntimeDouble__Output as _envoy_config_core_v3_RuntimeDouble__Output } from './envoy/config/core/v3/RuntimeDouble.js'; -import type { RuntimeFeatureFlag as _envoy_config_core_v3_RuntimeFeatureFlag, RuntimeFeatureFlag__Output as _envoy_config_core_v3_RuntimeFeatureFlag__Output } from './envoy/config/core/v3/RuntimeFeatureFlag.js'; -import type { RuntimeFractionalPercent as _envoy_config_core_v3_RuntimeFractionalPercent, RuntimeFractionalPercent__Output as _envoy_config_core_v3_RuntimeFractionalPercent__Output } from './envoy/config/core/v3/RuntimeFractionalPercent.js'; -import type { RuntimePercent as _envoy_config_core_v3_RuntimePercent, RuntimePercent__Output as _envoy_config_core_v3_RuntimePercent__Output } from './envoy/config/core/v3/RuntimePercent.js'; -import type { RuntimeUInt32 as _envoy_config_core_v3_RuntimeUInt32, RuntimeUInt32__Output as _envoy_config_core_v3_RuntimeUInt32__Output } from './envoy/config/core/v3/RuntimeUInt32.js'; -import type { SocketAddress as _envoy_config_core_v3_SocketAddress, SocketAddress__Output as _envoy_config_core_v3_SocketAddress__Output } from './envoy/config/core/v3/SocketAddress.js'; -import type { SocketOption as _envoy_config_core_v3_SocketOption, SocketOption__Output as _envoy_config_core_v3_SocketOption__Output } from './envoy/config/core/v3/SocketOption.js'; -import type { SocketOptionsOverride as _envoy_config_core_v3_SocketOptionsOverride, SocketOptionsOverride__Output as _envoy_config_core_v3_SocketOptionsOverride__Output } from './envoy/config/core/v3/SocketOptionsOverride.js'; -import type { TcpKeepalive as _envoy_config_core_v3_TcpKeepalive, TcpKeepalive__Output as _envoy_config_core_v3_TcpKeepalive__Output } from './envoy/config/core/v3/TcpKeepalive.js'; -import type { TransportSocket as _envoy_config_core_v3_TransportSocket, TransportSocket__Output as _envoy_config_core_v3_TransportSocket__Output } from './envoy/config/core/v3/TransportSocket.js'; -import type { TypedExtensionConfig as _envoy_config_core_v3_TypedExtensionConfig, TypedExtensionConfig__Output as _envoy_config_core_v3_TypedExtensionConfig__Output } from './envoy/config/core/v3/TypedExtensionConfig.js'; -import type { WatchedDirectory as _envoy_config_core_v3_WatchedDirectory, WatchedDirectory__Output as _envoy_config_core_v3_WatchedDirectory__Output } from './envoy/config/core/v3/WatchedDirectory.js'; -import type { ProcessingMode as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode, ProcessingMode__Output as _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output } from './envoy/extensions/filters/http/ext_proc/v3/ProcessingMode.js'; -import type { BodyMutation as _envoy_service_ext_proc_v3_BodyMutation, BodyMutation__Output as _envoy_service_ext_proc_v3_BodyMutation__Output } from './envoy/service/ext_proc/v3/BodyMutation.js'; -import type { BodyResponse as _envoy_service_ext_proc_v3_BodyResponse, BodyResponse__Output as _envoy_service_ext_proc_v3_BodyResponse__Output } from './envoy/service/ext_proc/v3/BodyResponse.js'; -import type { CommonResponse as _envoy_service_ext_proc_v3_CommonResponse, CommonResponse__Output as _envoy_service_ext_proc_v3_CommonResponse__Output } from './envoy/service/ext_proc/v3/CommonResponse.js'; -import type { ExternalProcessorClient as _envoy_service_ext_proc_v3_ExternalProcessorClient, ExternalProcessorDefinition as _envoy_service_ext_proc_v3_ExternalProcessorDefinition } from './envoy/service/ext_proc/v3/ExternalProcessor.js'; -import type { GrpcStatus as _envoy_service_ext_proc_v3_GrpcStatus, GrpcStatus__Output as _envoy_service_ext_proc_v3_GrpcStatus__Output } from './envoy/service/ext_proc/v3/GrpcStatus.js'; -import type { HeaderMutation as _envoy_service_ext_proc_v3_HeaderMutation, HeaderMutation__Output as _envoy_service_ext_proc_v3_HeaderMutation__Output } from './envoy/service/ext_proc/v3/HeaderMutation.js'; -import type { HeadersResponse as _envoy_service_ext_proc_v3_HeadersResponse, HeadersResponse__Output as _envoy_service_ext_proc_v3_HeadersResponse__Output } from './envoy/service/ext_proc/v3/HeadersResponse.js'; -import type { HttpBody as _envoy_service_ext_proc_v3_HttpBody, HttpBody__Output as _envoy_service_ext_proc_v3_HttpBody__Output } from './envoy/service/ext_proc/v3/HttpBody.js'; -import type { HttpHeaders as _envoy_service_ext_proc_v3_HttpHeaders, HttpHeaders__Output as _envoy_service_ext_proc_v3_HttpHeaders__Output } from './envoy/service/ext_proc/v3/HttpHeaders.js'; -import type { HttpTrailers as _envoy_service_ext_proc_v3_HttpTrailers, HttpTrailers__Output as _envoy_service_ext_proc_v3_HttpTrailers__Output } from './envoy/service/ext_proc/v3/HttpTrailers.js'; -import type { ImmediateResponse as _envoy_service_ext_proc_v3_ImmediateResponse, ImmediateResponse__Output as _envoy_service_ext_proc_v3_ImmediateResponse__Output } from './envoy/service/ext_proc/v3/ImmediateResponse.js'; -import type { ProcessingRequest as _envoy_service_ext_proc_v3_ProcessingRequest, ProcessingRequest__Output as _envoy_service_ext_proc_v3_ProcessingRequest__Output } from './envoy/service/ext_proc/v3/ProcessingRequest.js'; -import type { ProcessingResponse as _envoy_service_ext_proc_v3_ProcessingResponse, ProcessingResponse__Output as _envoy_service_ext_proc_v3_ProcessingResponse__Output } from './envoy/service/ext_proc/v3/ProcessingResponse.js'; -import type { ProtocolConfiguration as _envoy_service_ext_proc_v3_ProtocolConfiguration, ProtocolConfiguration__Output as _envoy_service_ext_proc_v3_ProtocolConfiguration__Output } from './envoy/service/ext_proc/v3/ProtocolConfiguration.js'; -import type { StreamedBodyResponse as _envoy_service_ext_proc_v3_StreamedBodyResponse, StreamedBodyResponse__Output as _envoy_service_ext_proc_v3_StreamedBodyResponse__Output } from './envoy/service/ext_proc/v3/StreamedBodyResponse.js'; -import type { TrailersResponse as _envoy_service_ext_proc_v3_TrailersResponse, TrailersResponse__Output as _envoy_service_ext_proc_v3_TrailersResponse__Output } from './envoy/service/ext_proc/v3/TrailersResponse.js'; -import type { FractionalPercent as _envoy_type_v3_FractionalPercent, FractionalPercent__Output as _envoy_type_v3_FractionalPercent__Output } from './envoy/type/v3/FractionalPercent.js'; -import type { HttpStatus as _envoy_type_v3_HttpStatus, HttpStatus__Output as _envoy_type_v3_HttpStatus__Output } from './envoy/type/v3/HttpStatus.js'; -import type { Percent as _envoy_type_v3_Percent, Percent__Output as _envoy_type_v3_Percent__Output } from './envoy/type/v3/Percent.js'; -import type { SemanticVersion as _envoy_type_v3_SemanticVersion, SemanticVersion__Output as _envoy_type_v3_SemanticVersion__Output } from './envoy/type/v3/SemanticVersion.js'; -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from './google/protobuf/Any.js'; -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from './google/protobuf/BoolValue.js'; -import type { BytesValue as _google_protobuf_BytesValue, BytesValue__Output as _google_protobuf_BytesValue__Output } from './google/protobuf/BytesValue.js'; -import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './google/protobuf/DescriptorProto.js'; -import type { DoubleValue as _google_protobuf_DoubleValue, DoubleValue__Output as _google_protobuf_DoubleValue__Output } from './google/protobuf/DoubleValue.js'; -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from './google/protobuf/Duration.js'; -import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './google/protobuf/EnumDescriptorProto.js'; -import type { EnumOptions as _google_protobuf_EnumOptions, EnumOptions__Output as _google_protobuf_EnumOptions__Output } from './google/protobuf/EnumOptions.js'; -import type { EnumValueDescriptorProto as _google_protobuf_EnumValueDescriptorProto, EnumValueDescriptorProto__Output as _google_protobuf_EnumValueDescriptorProto__Output } from './google/protobuf/EnumValueDescriptorProto.js'; -import type { EnumValueOptions as _google_protobuf_EnumValueOptions, EnumValueOptions__Output as _google_protobuf_EnumValueOptions__Output } from './google/protobuf/EnumValueOptions.js'; -import type { ExtensionRangeOptions as _google_protobuf_ExtensionRangeOptions, ExtensionRangeOptions__Output as _google_protobuf_ExtensionRangeOptions__Output } from './google/protobuf/ExtensionRangeOptions.js'; -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './google/protobuf/FeatureSet.js'; -import type { FeatureSetDefaults as _google_protobuf_FeatureSetDefaults, FeatureSetDefaults__Output as _google_protobuf_FeatureSetDefaults__Output } from './google/protobuf/FeatureSetDefaults.js'; -import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './google/protobuf/FieldDescriptorProto.js'; -import type { FieldOptions as _google_protobuf_FieldOptions, FieldOptions__Output as _google_protobuf_FieldOptions__Output } from './google/protobuf/FieldOptions.js'; -import type { FileDescriptorProto as _google_protobuf_FileDescriptorProto, FileDescriptorProto__Output as _google_protobuf_FileDescriptorProto__Output } from './google/protobuf/FileDescriptorProto.js'; -import type { FileDescriptorSet as _google_protobuf_FileDescriptorSet, FileDescriptorSet__Output as _google_protobuf_FileDescriptorSet__Output } from './google/protobuf/FileDescriptorSet.js'; -import type { FileOptions as _google_protobuf_FileOptions, FileOptions__Output as _google_protobuf_FileOptions__Output } from './google/protobuf/FileOptions.js'; -import type { FloatValue as _google_protobuf_FloatValue, FloatValue__Output as _google_protobuf_FloatValue__Output } from './google/protobuf/FloatValue.js'; -import type { GeneratedCodeInfo as _google_protobuf_GeneratedCodeInfo, GeneratedCodeInfo__Output as _google_protobuf_GeneratedCodeInfo__Output } from './google/protobuf/GeneratedCodeInfo.js'; -import type { Int32Value as _google_protobuf_Int32Value, Int32Value__Output as _google_protobuf_Int32Value__Output } from './google/protobuf/Int32Value.js'; -import type { Int64Value as _google_protobuf_Int64Value, Int64Value__Output as _google_protobuf_Int64Value__Output } from './google/protobuf/Int64Value.js'; -import type { ListValue as _google_protobuf_ListValue, ListValue__Output as _google_protobuf_ListValue__Output } from './google/protobuf/ListValue.js'; -import type { MessageOptions as _google_protobuf_MessageOptions, MessageOptions__Output as _google_protobuf_MessageOptions__Output } from './google/protobuf/MessageOptions.js'; -import type { MethodDescriptorProto as _google_protobuf_MethodDescriptorProto, MethodDescriptorProto__Output as _google_protobuf_MethodDescriptorProto__Output } from './google/protobuf/MethodDescriptorProto.js'; -import type { MethodOptions as _google_protobuf_MethodOptions, MethodOptions__Output as _google_protobuf_MethodOptions__Output } from './google/protobuf/MethodOptions.js'; -import type { OneofDescriptorProto as _google_protobuf_OneofDescriptorProto, OneofDescriptorProto__Output as _google_protobuf_OneofDescriptorProto__Output } from './google/protobuf/OneofDescriptorProto.js'; -import type { OneofOptions as _google_protobuf_OneofOptions, OneofOptions__Output as _google_protobuf_OneofOptions__Output } from './google/protobuf/OneofOptions.js'; -import type { ServiceDescriptorProto as _google_protobuf_ServiceDescriptorProto, ServiceDescriptorProto__Output as _google_protobuf_ServiceDescriptorProto__Output } from './google/protobuf/ServiceDescriptorProto.js'; -import type { ServiceOptions as _google_protobuf_ServiceOptions, ServiceOptions__Output as _google_protobuf_ServiceOptions__Output } from './google/protobuf/ServiceOptions.js'; -import type { SourceCodeInfo as _google_protobuf_SourceCodeInfo, SourceCodeInfo__Output as _google_protobuf_SourceCodeInfo__Output } from './google/protobuf/SourceCodeInfo.js'; -import type { StringValue as _google_protobuf_StringValue, StringValue__Output as _google_protobuf_StringValue__Output } from './google/protobuf/StringValue.js'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from './google/protobuf/Struct.js'; -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from './google/protobuf/Timestamp.js'; -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from './google/protobuf/UInt32Value.js'; -import type { UInt64Value as _google_protobuf_UInt64Value, UInt64Value__Output as _google_protobuf_UInt64Value__Output } from './google/protobuf/UInt64Value.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './google/protobuf/UninterpretedOption.js'; -import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from './google/protobuf/Value.js'; -import type { FieldMigrateAnnotation as _udpa_annotations_FieldMigrateAnnotation, FieldMigrateAnnotation__Output as _udpa_annotations_FieldMigrateAnnotation__Output } from './udpa/annotations/FieldMigrateAnnotation.js'; -import type { FileMigrateAnnotation as _udpa_annotations_FileMigrateAnnotation, FileMigrateAnnotation__Output as _udpa_annotations_FileMigrateAnnotation__Output } from './udpa/annotations/FileMigrateAnnotation.js'; -import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from './udpa/annotations/MigrateAnnotation.js'; -import type { StatusAnnotation as _udpa_annotations_StatusAnnotation, StatusAnnotation__Output as _udpa_annotations_StatusAnnotation__Output } from './udpa/annotations/StatusAnnotation.js'; -import type { VersioningAnnotation as _udpa_annotations_VersioningAnnotation, VersioningAnnotation__Output as _udpa_annotations_VersioningAnnotation__Output } from './udpa/annotations/VersioningAnnotation.js'; -import type { AnyRules as _validate_AnyRules, AnyRules__Output as _validate_AnyRules__Output } from './validate/AnyRules.js'; -import type { BoolRules as _validate_BoolRules, BoolRules__Output as _validate_BoolRules__Output } from './validate/BoolRules.js'; -import type { BytesRules as _validate_BytesRules, BytesRules__Output as _validate_BytesRules__Output } from './validate/BytesRules.js'; -import type { DoubleRules as _validate_DoubleRules, DoubleRules__Output as _validate_DoubleRules__Output } from './validate/DoubleRules.js'; -import type { DurationRules as _validate_DurationRules, DurationRules__Output as _validate_DurationRules__Output } from './validate/DurationRules.js'; -import type { EnumRules as _validate_EnumRules, EnumRules__Output as _validate_EnumRules__Output } from './validate/EnumRules.js'; -import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './validate/FieldRules.js'; -import type { Fixed32Rules as _validate_Fixed32Rules, Fixed32Rules__Output as _validate_Fixed32Rules__Output } from './validate/Fixed32Rules.js'; -import type { Fixed64Rules as _validate_Fixed64Rules, Fixed64Rules__Output as _validate_Fixed64Rules__Output } from './validate/Fixed64Rules.js'; -import type { FloatRules as _validate_FloatRules, FloatRules__Output as _validate_FloatRules__Output } from './validate/FloatRules.js'; -import type { Int32Rules as _validate_Int32Rules, Int32Rules__Output as _validate_Int32Rules__Output } from './validate/Int32Rules.js'; -import type { Int64Rules as _validate_Int64Rules, Int64Rules__Output as _validate_Int64Rules__Output } from './validate/Int64Rules.js'; -import type { MapRules as _validate_MapRules, MapRules__Output as _validate_MapRules__Output } from './validate/MapRules.js'; -import type { MessageRules as _validate_MessageRules, MessageRules__Output as _validate_MessageRules__Output } from './validate/MessageRules.js'; -import type { RepeatedRules as _validate_RepeatedRules, RepeatedRules__Output as _validate_RepeatedRules__Output } from './validate/RepeatedRules.js'; -import type { SFixed32Rules as _validate_SFixed32Rules, SFixed32Rules__Output as _validate_SFixed32Rules__Output } from './validate/SFixed32Rules.js'; -import type { SFixed64Rules as _validate_SFixed64Rules, SFixed64Rules__Output as _validate_SFixed64Rules__Output } from './validate/SFixed64Rules.js'; -import type { SInt32Rules as _validate_SInt32Rules, SInt32Rules__Output as _validate_SInt32Rules__Output } from './validate/SInt32Rules.js'; -import type { SInt64Rules as _validate_SInt64Rules, SInt64Rules__Output as _validate_SInt64Rules__Output } from './validate/SInt64Rules.js'; -import type { StringRules as _validate_StringRules, StringRules__Output as _validate_StringRules__Output } from './validate/StringRules.js'; -import type { TimestampRules as _validate_TimestampRules, TimestampRules__Output as _validate_TimestampRules__Output } from './validate/TimestampRules.js'; -import type { UInt32Rules as _validate_UInt32Rules, UInt32Rules__Output as _validate_UInt32Rules__Output } from './validate/UInt32Rules.js'; -import type { UInt64Rules as _validate_UInt64Rules, UInt64Rules__Output as _validate_UInt64Rules__Output } from './validate/UInt64Rules.js'; -import type { FieldStatusAnnotation as _xds_annotations_v3_FieldStatusAnnotation, FieldStatusAnnotation__Output as _xds_annotations_v3_FieldStatusAnnotation__Output } from './xds/annotations/v3/FieldStatusAnnotation.js'; -import type { FileStatusAnnotation as _xds_annotations_v3_FileStatusAnnotation, FileStatusAnnotation__Output as _xds_annotations_v3_FileStatusAnnotation__Output } from './xds/annotations/v3/FileStatusAnnotation.js'; -import type { MessageStatusAnnotation as _xds_annotations_v3_MessageStatusAnnotation, MessageStatusAnnotation__Output as _xds_annotations_v3_MessageStatusAnnotation__Output } from './xds/annotations/v3/MessageStatusAnnotation.js'; -import type { StatusAnnotation as _xds_annotations_v3_StatusAnnotation, StatusAnnotation__Output as _xds_annotations_v3_StatusAnnotation__Output } from './xds/annotations/v3/StatusAnnotation.js'; -import type { ContextParams as _xds_core_v3_ContextParams, ContextParams__Output as _xds_core_v3_ContextParams__Output } from './xds/core/v3/ContextParams.js'; - -type SubtypeConstructor any, Subtype> = { - new(...args: ConstructorParameters): Subtype; -}; - -export interface ProtoGrpcType { - envoy: { - annotations: { - } - config: { - core: { - v3: { - Address: MessageTypeDefinition<_envoy_config_core_v3_Address, _envoy_config_core_v3_Address__Output> - AsyncDataSource: MessageTypeDefinition<_envoy_config_core_v3_AsyncDataSource, _envoy_config_core_v3_AsyncDataSource__Output> - BackoffStrategy: MessageTypeDefinition<_envoy_config_core_v3_BackoffStrategy, _envoy_config_core_v3_BackoffStrategy__Output> - BindConfig: MessageTypeDefinition<_envoy_config_core_v3_BindConfig, _envoy_config_core_v3_BindConfig__Output> - BuildVersion: MessageTypeDefinition<_envoy_config_core_v3_BuildVersion, _envoy_config_core_v3_BuildVersion__Output> - CidrRange: MessageTypeDefinition<_envoy_config_core_v3_CidrRange, _envoy_config_core_v3_CidrRange__Output> - ControlPlane: MessageTypeDefinition<_envoy_config_core_v3_ControlPlane, _envoy_config_core_v3_ControlPlane__Output> - DataSource: MessageTypeDefinition<_envoy_config_core_v3_DataSource, _envoy_config_core_v3_DataSource__Output> - EnvoyInternalAddress: MessageTypeDefinition<_envoy_config_core_v3_EnvoyInternalAddress, _envoy_config_core_v3_EnvoyInternalAddress__Output> - Extension: MessageTypeDefinition<_envoy_config_core_v3_Extension, _envoy_config_core_v3_Extension__Output> - ExtraSourceAddress: MessageTypeDefinition<_envoy_config_core_v3_ExtraSourceAddress, _envoy_config_core_v3_ExtraSourceAddress__Output> - HeaderMap: MessageTypeDefinition<_envoy_config_core_v3_HeaderMap, _envoy_config_core_v3_HeaderMap__Output> - HeaderValue: MessageTypeDefinition<_envoy_config_core_v3_HeaderValue, _envoy_config_core_v3_HeaderValue__Output> - HeaderValueOption: MessageTypeDefinition<_envoy_config_core_v3_HeaderValueOption, _envoy_config_core_v3_HeaderValueOption__Output> - HttpUri: MessageTypeDefinition<_envoy_config_core_v3_HttpUri, _envoy_config_core_v3_HttpUri__Output> - KeyValue: MessageTypeDefinition<_envoy_config_core_v3_KeyValue, _envoy_config_core_v3_KeyValue__Output> - KeyValueAppend: MessageTypeDefinition<_envoy_config_core_v3_KeyValueAppend, _envoy_config_core_v3_KeyValueAppend__Output> - KeyValueMutation: MessageTypeDefinition<_envoy_config_core_v3_KeyValueMutation, _envoy_config_core_v3_KeyValueMutation__Output> - KeyValuePair: MessageTypeDefinition<_envoy_config_core_v3_KeyValuePair, _envoy_config_core_v3_KeyValuePair__Output> - Locality: MessageTypeDefinition<_envoy_config_core_v3_Locality, _envoy_config_core_v3_Locality__Output> - Metadata: MessageTypeDefinition<_envoy_config_core_v3_Metadata, _envoy_config_core_v3_Metadata__Output> - Node: MessageTypeDefinition<_envoy_config_core_v3_Node, _envoy_config_core_v3_Node__Output> - Pipe: MessageTypeDefinition<_envoy_config_core_v3_Pipe, _envoy_config_core_v3_Pipe__Output> - QueryParameter: MessageTypeDefinition<_envoy_config_core_v3_QueryParameter, _envoy_config_core_v3_QueryParameter__Output> - RemoteDataSource: MessageTypeDefinition<_envoy_config_core_v3_RemoteDataSource, _envoy_config_core_v3_RemoteDataSource__Output> - RequestMethod: EnumTypeDefinition - RetryPolicy: MessageTypeDefinition<_envoy_config_core_v3_RetryPolicy, _envoy_config_core_v3_RetryPolicy__Output> - RoutingPriority: EnumTypeDefinition - RuntimeDouble: MessageTypeDefinition<_envoy_config_core_v3_RuntimeDouble, _envoy_config_core_v3_RuntimeDouble__Output> - RuntimeFeatureFlag: MessageTypeDefinition<_envoy_config_core_v3_RuntimeFeatureFlag, _envoy_config_core_v3_RuntimeFeatureFlag__Output> - RuntimeFractionalPercent: MessageTypeDefinition<_envoy_config_core_v3_RuntimeFractionalPercent, _envoy_config_core_v3_RuntimeFractionalPercent__Output> - RuntimePercent: MessageTypeDefinition<_envoy_config_core_v3_RuntimePercent, _envoy_config_core_v3_RuntimePercent__Output> - RuntimeUInt32: MessageTypeDefinition<_envoy_config_core_v3_RuntimeUInt32, _envoy_config_core_v3_RuntimeUInt32__Output> - SocketAddress: MessageTypeDefinition<_envoy_config_core_v3_SocketAddress, _envoy_config_core_v3_SocketAddress__Output> - SocketOption: MessageTypeDefinition<_envoy_config_core_v3_SocketOption, _envoy_config_core_v3_SocketOption__Output> - SocketOptionsOverride: MessageTypeDefinition<_envoy_config_core_v3_SocketOptionsOverride, _envoy_config_core_v3_SocketOptionsOverride__Output> - TcpKeepalive: MessageTypeDefinition<_envoy_config_core_v3_TcpKeepalive, _envoy_config_core_v3_TcpKeepalive__Output> - TrafficDirection: EnumTypeDefinition - TransportSocket: MessageTypeDefinition<_envoy_config_core_v3_TransportSocket, _envoy_config_core_v3_TransportSocket__Output> - TypedExtensionConfig: MessageTypeDefinition<_envoy_config_core_v3_TypedExtensionConfig, _envoy_config_core_v3_TypedExtensionConfig__Output> - WatchedDirectory: MessageTypeDefinition<_envoy_config_core_v3_WatchedDirectory, _envoy_config_core_v3_WatchedDirectory__Output> - } - } - } - extensions: { - filters: { - http: { - ext_proc: { - v3: { - ProcessingMode: MessageTypeDefinition<_envoy_extensions_filters_http_ext_proc_v3_ProcessingMode, _envoy_extensions_filters_http_ext_proc_v3_ProcessingMode__Output> - } - } - } - } - } - service: { - ext_proc: { - v3: { - BodyMutation: MessageTypeDefinition<_envoy_service_ext_proc_v3_BodyMutation, _envoy_service_ext_proc_v3_BodyMutation__Output> - BodyResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_BodyResponse, _envoy_service_ext_proc_v3_BodyResponse__Output> - CommonResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_CommonResponse, _envoy_service_ext_proc_v3_CommonResponse__Output> - ExternalProcessor: SubtypeConstructor & { service: _envoy_service_ext_proc_v3_ExternalProcessorDefinition } - GrpcStatus: MessageTypeDefinition<_envoy_service_ext_proc_v3_GrpcStatus, _envoy_service_ext_proc_v3_GrpcStatus__Output> - HeaderMutation: MessageTypeDefinition<_envoy_service_ext_proc_v3_HeaderMutation, _envoy_service_ext_proc_v3_HeaderMutation__Output> - HeadersResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_HeadersResponse, _envoy_service_ext_proc_v3_HeadersResponse__Output> - HttpBody: MessageTypeDefinition<_envoy_service_ext_proc_v3_HttpBody, _envoy_service_ext_proc_v3_HttpBody__Output> - HttpHeaders: MessageTypeDefinition<_envoy_service_ext_proc_v3_HttpHeaders, _envoy_service_ext_proc_v3_HttpHeaders__Output> - HttpTrailers: MessageTypeDefinition<_envoy_service_ext_proc_v3_HttpTrailers, _envoy_service_ext_proc_v3_HttpTrailers__Output> - ImmediateResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_ImmediateResponse, _envoy_service_ext_proc_v3_ImmediateResponse__Output> - ProcessingRequest: MessageTypeDefinition<_envoy_service_ext_proc_v3_ProcessingRequest, _envoy_service_ext_proc_v3_ProcessingRequest__Output> - ProcessingResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_ProcessingResponse, _envoy_service_ext_proc_v3_ProcessingResponse__Output> - ProtocolConfiguration: MessageTypeDefinition<_envoy_service_ext_proc_v3_ProtocolConfiguration, _envoy_service_ext_proc_v3_ProtocolConfiguration__Output> - StreamedBodyResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_StreamedBodyResponse, _envoy_service_ext_proc_v3_StreamedBodyResponse__Output> - TrailersResponse: MessageTypeDefinition<_envoy_service_ext_proc_v3_TrailersResponse, _envoy_service_ext_proc_v3_TrailersResponse__Output> - } - } - } - type: { - v3: { - FractionalPercent: MessageTypeDefinition<_envoy_type_v3_FractionalPercent, _envoy_type_v3_FractionalPercent__Output> - HttpStatus: MessageTypeDefinition<_envoy_type_v3_HttpStatus, _envoy_type_v3_HttpStatus__Output> - Percent: MessageTypeDefinition<_envoy_type_v3_Percent, _envoy_type_v3_Percent__Output> - SemanticVersion: MessageTypeDefinition<_envoy_type_v3_SemanticVersion, _envoy_type_v3_SemanticVersion__Output> - StatusCode: EnumTypeDefinition - } - } - } - google: { - protobuf: { - Any: MessageTypeDefinition<_google_protobuf_Any, _google_protobuf_Any__Output> - BoolValue: MessageTypeDefinition<_google_protobuf_BoolValue, _google_protobuf_BoolValue__Output> - BytesValue: MessageTypeDefinition<_google_protobuf_BytesValue, _google_protobuf_BytesValue__Output> - DescriptorProto: MessageTypeDefinition<_google_protobuf_DescriptorProto, _google_protobuf_DescriptorProto__Output> - DoubleValue: MessageTypeDefinition<_google_protobuf_DoubleValue, _google_protobuf_DoubleValue__Output> - Duration: MessageTypeDefinition<_google_protobuf_Duration, _google_protobuf_Duration__Output> - Edition: EnumTypeDefinition - EnumDescriptorProto: MessageTypeDefinition<_google_protobuf_EnumDescriptorProto, _google_protobuf_EnumDescriptorProto__Output> - EnumOptions: MessageTypeDefinition<_google_protobuf_EnumOptions, _google_protobuf_EnumOptions__Output> - EnumValueDescriptorProto: MessageTypeDefinition<_google_protobuf_EnumValueDescriptorProto, _google_protobuf_EnumValueDescriptorProto__Output> - EnumValueOptions: MessageTypeDefinition<_google_protobuf_EnumValueOptions, _google_protobuf_EnumValueOptions__Output> - ExtensionRangeOptions: MessageTypeDefinition<_google_protobuf_ExtensionRangeOptions, _google_protobuf_ExtensionRangeOptions__Output> - FeatureSet: MessageTypeDefinition<_google_protobuf_FeatureSet, _google_protobuf_FeatureSet__Output> - FeatureSetDefaults: MessageTypeDefinition<_google_protobuf_FeatureSetDefaults, _google_protobuf_FeatureSetDefaults__Output> - FieldDescriptorProto: MessageTypeDefinition<_google_protobuf_FieldDescriptorProto, _google_protobuf_FieldDescriptorProto__Output> - FieldOptions: MessageTypeDefinition<_google_protobuf_FieldOptions, _google_protobuf_FieldOptions__Output> - FileDescriptorProto: MessageTypeDefinition<_google_protobuf_FileDescriptorProto, _google_protobuf_FileDescriptorProto__Output> - FileDescriptorSet: MessageTypeDefinition<_google_protobuf_FileDescriptorSet, _google_protobuf_FileDescriptorSet__Output> - FileOptions: MessageTypeDefinition<_google_protobuf_FileOptions, _google_protobuf_FileOptions__Output> - FloatValue: MessageTypeDefinition<_google_protobuf_FloatValue, _google_protobuf_FloatValue__Output> - GeneratedCodeInfo: MessageTypeDefinition<_google_protobuf_GeneratedCodeInfo, _google_protobuf_GeneratedCodeInfo__Output> - Int32Value: MessageTypeDefinition<_google_protobuf_Int32Value, _google_protobuf_Int32Value__Output> - Int64Value: MessageTypeDefinition<_google_protobuf_Int64Value, _google_protobuf_Int64Value__Output> - ListValue: MessageTypeDefinition<_google_protobuf_ListValue, _google_protobuf_ListValue__Output> - MessageOptions: MessageTypeDefinition<_google_protobuf_MessageOptions, _google_protobuf_MessageOptions__Output> - MethodDescriptorProto: MessageTypeDefinition<_google_protobuf_MethodDescriptorProto, _google_protobuf_MethodDescriptorProto__Output> - MethodOptions: MessageTypeDefinition<_google_protobuf_MethodOptions, _google_protobuf_MethodOptions__Output> - NullValue: EnumTypeDefinition - OneofDescriptorProto: MessageTypeDefinition<_google_protobuf_OneofDescriptorProto, _google_protobuf_OneofDescriptorProto__Output> - OneofOptions: MessageTypeDefinition<_google_protobuf_OneofOptions, _google_protobuf_OneofOptions__Output> - ServiceDescriptorProto: MessageTypeDefinition<_google_protobuf_ServiceDescriptorProto, _google_protobuf_ServiceDescriptorProto__Output> - ServiceOptions: MessageTypeDefinition<_google_protobuf_ServiceOptions, _google_protobuf_ServiceOptions__Output> - SourceCodeInfo: MessageTypeDefinition<_google_protobuf_SourceCodeInfo, _google_protobuf_SourceCodeInfo__Output> - StringValue: MessageTypeDefinition<_google_protobuf_StringValue, _google_protobuf_StringValue__Output> - Struct: MessageTypeDefinition<_google_protobuf_Struct, _google_protobuf_Struct__Output> - SymbolVisibility: EnumTypeDefinition - Timestamp: MessageTypeDefinition<_google_protobuf_Timestamp, _google_protobuf_Timestamp__Output> - UInt32Value: MessageTypeDefinition<_google_protobuf_UInt32Value, _google_protobuf_UInt32Value__Output> - UInt64Value: MessageTypeDefinition<_google_protobuf_UInt64Value, _google_protobuf_UInt64Value__Output> - UninterpretedOption: MessageTypeDefinition<_google_protobuf_UninterpretedOption, _google_protobuf_UninterpretedOption__Output> - Value: MessageTypeDefinition<_google_protobuf_Value, _google_protobuf_Value__Output> - } - } - udpa: { - annotations: { - FieldMigrateAnnotation: MessageTypeDefinition<_udpa_annotations_FieldMigrateAnnotation, _udpa_annotations_FieldMigrateAnnotation__Output> - FileMigrateAnnotation: MessageTypeDefinition<_udpa_annotations_FileMigrateAnnotation, _udpa_annotations_FileMigrateAnnotation__Output> - MigrateAnnotation: MessageTypeDefinition<_udpa_annotations_MigrateAnnotation, _udpa_annotations_MigrateAnnotation__Output> - PackageVersionStatus: EnumTypeDefinition - StatusAnnotation: MessageTypeDefinition<_udpa_annotations_StatusAnnotation, _udpa_annotations_StatusAnnotation__Output> - VersioningAnnotation: MessageTypeDefinition<_udpa_annotations_VersioningAnnotation, _udpa_annotations_VersioningAnnotation__Output> - } - } - validate: { - AnyRules: MessageTypeDefinition<_validate_AnyRules, _validate_AnyRules__Output> - BoolRules: MessageTypeDefinition<_validate_BoolRules, _validate_BoolRules__Output> - BytesRules: MessageTypeDefinition<_validate_BytesRules, _validate_BytesRules__Output> - DoubleRules: MessageTypeDefinition<_validate_DoubleRules, _validate_DoubleRules__Output> - DurationRules: MessageTypeDefinition<_validate_DurationRules, _validate_DurationRules__Output> - EnumRules: MessageTypeDefinition<_validate_EnumRules, _validate_EnumRules__Output> - FieldRules: MessageTypeDefinition<_validate_FieldRules, _validate_FieldRules__Output> - Fixed32Rules: MessageTypeDefinition<_validate_Fixed32Rules, _validate_Fixed32Rules__Output> - Fixed64Rules: MessageTypeDefinition<_validate_Fixed64Rules, _validate_Fixed64Rules__Output> - FloatRules: MessageTypeDefinition<_validate_FloatRules, _validate_FloatRules__Output> - Int32Rules: MessageTypeDefinition<_validate_Int32Rules, _validate_Int32Rules__Output> - Int64Rules: MessageTypeDefinition<_validate_Int64Rules, _validate_Int64Rules__Output> - KnownRegex: EnumTypeDefinition - MapRules: MessageTypeDefinition<_validate_MapRules, _validate_MapRules__Output> - MessageRules: MessageTypeDefinition<_validate_MessageRules, _validate_MessageRules__Output> - RepeatedRules: MessageTypeDefinition<_validate_RepeatedRules, _validate_RepeatedRules__Output> - SFixed32Rules: MessageTypeDefinition<_validate_SFixed32Rules, _validate_SFixed32Rules__Output> - SFixed64Rules: MessageTypeDefinition<_validate_SFixed64Rules, _validate_SFixed64Rules__Output> - SInt32Rules: MessageTypeDefinition<_validate_SInt32Rules, _validate_SInt32Rules__Output> - SInt64Rules: MessageTypeDefinition<_validate_SInt64Rules, _validate_SInt64Rules__Output> - StringRules: MessageTypeDefinition<_validate_StringRules, _validate_StringRules__Output> - TimestampRules: MessageTypeDefinition<_validate_TimestampRules, _validate_TimestampRules__Output> - UInt32Rules: MessageTypeDefinition<_validate_UInt32Rules, _validate_UInt32Rules__Output> - UInt64Rules: MessageTypeDefinition<_validate_UInt64Rules, _validate_UInt64Rules__Output> - } - xds: { - annotations: { - v3: { - FieldStatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_FieldStatusAnnotation, _xds_annotations_v3_FieldStatusAnnotation__Output> - FileStatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_FileStatusAnnotation, _xds_annotations_v3_FileStatusAnnotation__Output> - MessageStatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_MessageStatusAnnotation, _xds_annotations_v3_MessageStatusAnnotation__Output> - PackageVersionStatus: EnumTypeDefinition - StatusAnnotation: MessageTypeDefinition<_xds_annotations_v3_StatusAnnotation, _xds_annotations_v3_StatusAnnotation__Output> - } - } - core: { - v3: { - ContextParams: MessageTypeDefinition<_xds_core_v3_ContextParams, _xds_core_v3_ContextParams__Output> - } - } - } -} - diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts deleted file mode 100644 index 0608455f..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Any.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { AnyExtension } from '@grpc/proto-loader'; - -export type Any = AnyExtension | { - type_url: string; - value: Buffer | Uint8Array | string; -} - -export interface Any__Output { - 'type_url'?: (string); - 'value'?: (Buffer); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts deleted file mode 100644 index 2faea889..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BoolValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface BoolValue { - 'value'?: (boolean); -} - -export interface BoolValue__Output { - 'value'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts deleted file mode 100644 index c828166f..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/BytesValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface BytesValue { - 'value'?: (Buffer | Uint8Array | string); -} - -export interface BytesValue__Output { - 'value'?: (Buffer); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts deleted file mode 100644 index c8506028..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DescriptorProto.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Original file: null - -import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './FieldDescriptorProto.js'; -import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './DescriptorProto.js'; -import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './EnumDescriptorProto.js'; -import type { MessageOptions as _google_protobuf_MessageOptions, MessageOptions__Output as _google_protobuf_MessageOptions__Output } from './MessageOptions.js'; -import type { OneofDescriptorProto as _google_protobuf_OneofDescriptorProto, OneofDescriptorProto__Output as _google_protobuf_OneofDescriptorProto__Output } from './OneofDescriptorProto.js'; -import type { SymbolVisibility as _google_protobuf_SymbolVisibility, SymbolVisibility__Output as _google_protobuf_SymbolVisibility__Output } from './SymbolVisibility.js'; -import type { ExtensionRangeOptions as _google_protobuf_ExtensionRangeOptions, ExtensionRangeOptions__Output as _google_protobuf_ExtensionRangeOptions__Output } from './ExtensionRangeOptions.js'; - -export interface _google_protobuf_DescriptorProto_ExtensionRange { - 'start'?: (number); - 'end'?: (number); - 'options'?: (_google_protobuf_ExtensionRangeOptions | null); -} - -export interface _google_protobuf_DescriptorProto_ExtensionRange__Output { - 'start'?: (number); - 'end'?: (number); - 'options'?: (_google_protobuf_ExtensionRangeOptions__Output); -} - -export interface _google_protobuf_DescriptorProto_ReservedRange { - 'start'?: (number); - 'end'?: (number); -} - -export interface _google_protobuf_DescriptorProto_ReservedRange__Output { - 'start'?: (number); - 'end'?: (number); -} - -export interface DescriptorProto { - 'name'?: (string); - 'field'?: (_google_protobuf_FieldDescriptorProto)[]; - 'nestedType'?: (_google_protobuf_DescriptorProto)[]; - 'enumType'?: (_google_protobuf_EnumDescriptorProto)[]; - 'extensionRange'?: (_google_protobuf_DescriptorProto_ExtensionRange)[]; - 'extension'?: (_google_protobuf_FieldDescriptorProto)[]; - 'options'?: (_google_protobuf_MessageOptions | null); - 'oneofDecl'?: (_google_protobuf_OneofDescriptorProto)[]; - 'reservedRange'?: (_google_protobuf_DescriptorProto_ReservedRange)[]; - 'reservedName'?: (string)[]; - 'visibility'?: (_google_protobuf_SymbolVisibility); -} - -export interface DescriptorProto__Output { - 'name'?: (string); - 'field'?: (_google_protobuf_FieldDescriptorProto__Output)[]; - 'nestedType'?: (_google_protobuf_DescriptorProto__Output)[]; - 'enumType'?: (_google_protobuf_EnumDescriptorProto__Output)[]; - 'extensionRange'?: (_google_protobuf_DescriptorProto_ExtensionRange__Output)[]; - 'extension'?: (_google_protobuf_FieldDescriptorProto__Output)[]; - 'options'?: (_google_protobuf_MessageOptions__Output); - 'oneofDecl'?: (_google_protobuf_OneofDescriptorProto__Output)[]; - 'reservedRange'?: (_google_protobuf_DescriptorProto_ReservedRange__Output)[]; - 'reservedName'?: (string)[]; - 'visibility'?: (_google_protobuf_SymbolVisibility__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts deleted file mode 100644 index c3207ed7..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/DoubleValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface DoubleValue { - 'value'?: (number | string); -} - -export interface DoubleValue__Output { - 'value'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts deleted file mode 100644 index b9316e6d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Duration.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface Duration { - 'seconds'?: (number | string | Long); - 'nanos'?: (number); -} - -export interface Duration__Output { - 'seconds'?: (Long); - 'nanos'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts deleted file mode 100644 index 1585402f..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Edition.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Original file: null - -export const Edition = { - EDITION_UNKNOWN: 0, - EDITION_LEGACY: 900, - EDITION_PROTO2: 998, - EDITION_PROTO3: 999, - EDITION_2023: 1000, - EDITION_2024: 1001, - EDITION_1_TEST_ONLY: 1, - EDITION_2_TEST_ONLY: 2, - EDITION_99997_TEST_ONLY: 99997, - EDITION_99998_TEST_ONLY: 99998, - EDITION_99999_TEST_ONLY: 99999, - EDITION_MAX: 2147483647, -} as const; - -export type Edition = - | 'EDITION_UNKNOWN' - | 0 - | 'EDITION_LEGACY' - | 900 - | 'EDITION_PROTO2' - | 998 - | 'EDITION_PROTO3' - | 999 - | 'EDITION_2023' - | 1000 - | 'EDITION_2024' - | 1001 - | 'EDITION_1_TEST_ONLY' - | 1 - | 'EDITION_2_TEST_ONLY' - | 2 - | 'EDITION_99997_TEST_ONLY' - | 99997 - | 'EDITION_99998_TEST_ONLY' - | 99998 - | 'EDITION_99999_TEST_ONLY' - | 99999 - | 'EDITION_MAX' - | 2147483647 - -export type Edition__Output = typeof Edition[keyof typeof Edition] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts deleted file mode 100644 index 0cedc8be..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumDescriptorProto.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: null - -import type { EnumValueDescriptorProto as _google_protobuf_EnumValueDescriptorProto, EnumValueDescriptorProto__Output as _google_protobuf_EnumValueDescriptorProto__Output } from './EnumValueDescriptorProto.js'; -import type { EnumOptions as _google_protobuf_EnumOptions, EnumOptions__Output as _google_protobuf_EnumOptions__Output } from './EnumOptions.js'; -import type { SymbolVisibility as _google_protobuf_SymbolVisibility, SymbolVisibility__Output as _google_protobuf_SymbolVisibility__Output } from './SymbolVisibility.js'; - -export interface _google_protobuf_EnumDescriptorProto_EnumReservedRange { - 'start'?: (number); - 'end'?: (number); -} - -export interface _google_protobuf_EnumDescriptorProto_EnumReservedRange__Output { - 'start'?: (number); - 'end'?: (number); -} - -export interface EnumDescriptorProto { - 'name'?: (string); - 'value'?: (_google_protobuf_EnumValueDescriptorProto)[]; - 'options'?: (_google_protobuf_EnumOptions | null); - 'reservedRange'?: (_google_protobuf_EnumDescriptorProto_EnumReservedRange)[]; - 'reservedName'?: (string)[]; - 'visibility'?: (_google_protobuf_SymbolVisibility); -} - -export interface EnumDescriptorProto__Output { - 'name'?: (string); - 'value'?: (_google_protobuf_EnumValueDescriptorProto__Output)[]; - 'options'?: (_google_protobuf_EnumOptions__Output); - 'reservedRange'?: (_google_protobuf_EnumDescriptorProto_EnumReservedRange__Output)[]; - 'reservedName'?: (string)[]; - 'visibility'?: (_google_protobuf_SymbolVisibility__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts deleted file mode 100644 index 32b0be80..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumOptions.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; -import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation.js'; - -export interface EnumOptions { - 'allowAlias'?: (boolean); - 'deprecated'?: (boolean); - 'deprecatedLegacyJsonFieldConflicts'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; - '.udpa.annotations.enumMigrate'?: (_udpa_annotations_MigrateAnnotation | null); -} - -export interface EnumOptions__Output { - 'allowAlias'?: (boolean); - 'deprecated'?: (boolean); - 'deprecatedLegacyJsonFieldConflicts'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; - '.udpa.annotations.enumMigrate'?: (_udpa_annotations_MigrateAnnotation__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts deleted file mode 100644 index 791c76fa..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueDescriptorProto.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Original file: null - -import type { EnumValueOptions as _google_protobuf_EnumValueOptions, EnumValueOptions__Output as _google_protobuf_EnumValueOptions__Output } from './EnumValueOptions.js'; - -export interface EnumValueDescriptorProto { - 'name'?: (string); - 'number'?: (number); - 'options'?: (_google_protobuf_EnumValueOptions | null); -} - -export interface EnumValueDescriptorProto__Output { - 'name'?: (string); - 'number'?: (number); - 'options'?: (_google_protobuf_EnumValueOptions__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts deleted file mode 100644 index c85b7581..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/EnumValueOptions.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { _google_protobuf_FieldOptions_FeatureSupport, _google_protobuf_FieldOptions_FeatureSupport__Output } from './FieldOptions.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; -import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation.js'; - -export interface EnumValueOptions { - 'deprecated'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet | null); - 'debugRedact'?: (boolean); - 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; - '.envoy.annotations.disallowedByDefaultEnum'?: (boolean); - '.udpa.annotations.enumValueMigrate'?: (_udpa_annotations_MigrateAnnotation | null); - '.envoy.annotations.deprecatedAtMinorVersionEnum'?: (string); -} - -export interface EnumValueOptions__Output { - 'deprecated'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'debugRedact'?: (boolean); - 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; - '.envoy.annotations.disallowedByDefaultEnum'?: (boolean); - '.udpa.annotations.enumValueMigrate'?: (_udpa_annotations_MigrateAnnotation__Output); - '.envoy.annotations.deprecatedAtMinorVersionEnum'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts deleted file mode 100644 index 62046136..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ExtensionRangeOptions.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; - -export interface _google_protobuf_ExtensionRangeOptions_Declaration { - 'number'?: (number); - 'fullName'?: (string); - 'type'?: (string); - 'reserved'?: (boolean); - 'repeated'?: (boolean); -} - -export interface _google_protobuf_ExtensionRangeOptions_Declaration__Output { - 'number'?: (number); - 'fullName'?: (string); - 'type'?: (string); - 'reserved'?: (boolean); - 'repeated'?: (boolean); -} - -// Original file: null - -export const _google_protobuf_ExtensionRangeOptions_VerificationState = { - DECLARATION: 0, - UNVERIFIED: 1, -} as const; - -export type _google_protobuf_ExtensionRangeOptions_VerificationState = - | 'DECLARATION' - | 0 - | 'UNVERIFIED' - | 1 - -export type _google_protobuf_ExtensionRangeOptions_VerificationState__Output = typeof _google_protobuf_ExtensionRangeOptions_VerificationState[keyof typeof _google_protobuf_ExtensionRangeOptions_VerificationState] - -export interface ExtensionRangeOptions { - 'declaration'?: (_google_protobuf_ExtensionRangeOptions_Declaration)[]; - 'verification'?: (_google_protobuf_ExtensionRangeOptions_VerificationState); - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; -} - -export interface ExtensionRangeOptions__Output { - 'declaration'?: (_google_protobuf_ExtensionRangeOptions_Declaration__Output)[]; - 'verification'?: (_google_protobuf_ExtensionRangeOptions_VerificationState__Output); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts deleted file mode 100644 index 32b75e65..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSet.ts +++ /dev/null @@ -1,183 +0,0 @@ -// Original file: null - - -// Original file: null - -export const _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility = { - DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: 0, - EXPORT_ALL: 1, - EXPORT_TOP_LEVEL: 2, - LOCAL_ALL: 3, - STRICT: 4, -} as const; - -export type _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility = - | 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN' - | 0 - | 'EXPORT_ALL' - | 1 - | 'EXPORT_TOP_LEVEL' - | 2 - | 'LOCAL_ALL' - | 3 - | 'STRICT' - | 4 - -export type _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility__Output = typeof _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility[keyof typeof _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility] - -// Original file: null - -export const _google_protobuf_FeatureSet_EnforceNamingStyle = { - ENFORCE_NAMING_STYLE_UNKNOWN: 0, - STYLE2024: 1, - STYLE_LEGACY: 2, -} as const; - -export type _google_protobuf_FeatureSet_EnforceNamingStyle = - | 'ENFORCE_NAMING_STYLE_UNKNOWN' - | 0 - | 'STYLE2024' - | 1 - | 'STYLE_LEGACY' - | 2 - -export type _google_protobuf_FeatureSet_EnforceNamingStyle__Output = typeof _google_protobuf_FeatureSet_EnforceNamingStyle[keyof typeof _google_protobuf_FeatureSet_EnforceNamingStyle] - -// Original file: null - -export const _google_protobuf_FeatureSet_EnumType = { - ENUM_TYPE_UNKNOWN: 0, - OPEN: 1, - CLOSED: 2, -} as const; - -export type _google_protobuf_FeatureSet_EnumType = - | 'ENUM_TYPE_UNKNOWN' - | 0 - | 'OPEN' - | 1 - | 'CLOSED' - | 2 - -export type _google_protobuf_FeatureSet_EnumType__Output = typeof _google_protobuf_FeatureSet_EnumType[keyof typeof _google_protobuf_FeatureSet_EnumType] - -// Original file: null - -export const _google_protobuf_FeatureSet_FieldPresence = { - FIELD_PRESENCE_UNKNOWN: 0, - EXPLICIT: 1, - IMPLICIT: 2, - LEGACY_REQUIRED: 3, -} as const; - -export type _google_protobuf_FeatureSet_FieldPresence = - | 'FIELD_PRESENCE_UNKNOWN' - | 0 - | 'EXPLICIT' - | 1 - | 'IMPLICIT' - | 2 - | 'LEGACY_REQUIRED' - | 3 - -export type _google_protobuf_FeatureSet_FieldPresence__Output = typeof _google_protobuf_FeatureSet_FieldPresence[keyof typeof _google_protobuf_FeatureSet_FieldPresence] - -// Original file: null - -export const _google_protobuf_FeatureSet_JsonFormat = { - JSON_FORMAT_UNKNOWN: 0, - ALLOW: 1, - LEGACY_BEST_EFFORT: 2, -} as const; - -export type _google_protobuf_FeatureSet_JsonFormat = - | 'JSON_FORMAT_UNKNOWN' - | 0 - | 'ALLOW' - | 1 - | 'LEGACY_BEST_EFFORT' - | 2 - -export type _google_protobuf_FeatureSet_JsonFormat__Output = typeof _google_protobuf_FeatureSet_JsonFormat[keyof typeof _google_protobuf_FeatureSet_JsonFormat] - -// Original file: null - -export const _google_protobuf_FeatureSet_MessageEncoding = { - MESSAGE_ENCODING_UNKNOWN: 0, - LENGTH_PREFIXED: 1, - DELIMITED: 2, -} as const; - -export type _google_protobuf_FeatureSet_MessageEncoding = - | 'MESSAGE_ENCODING_UNKNOWN' - | 0 - | 'LENGTH_PREFIXED' - | 1 - | 'DELIMITED' - | 2 - -export type _google_protobuf_FeatureSet_MessageEncoding__Output = typeof _google_protobuf_FeatureSet_MessageEncoding[keyof typeof _google_protobuf_FeatureSet_MessageEncoding] - -// Original file: null - -export const _google_protobuf_FeatureSet_RepeatedFieldEncoding = { - REPEATED_FIELD_ENCODING_UNKNOWN: 0, - PACKED: 1, - EXPANDED: 2, -} as const; - -export type _google_protobuf_FeatureSet_RepeatedFieldEncoding = - | 'REPEATED_FIELD_ENCODING_UNKNOWN' - | 0 - | 'PACKED' - | 1 - | 'EXPANDED' - | 2 - -export type _google_protobuf_FeatureSet_RepeatedFieldEncoding__Output = typeof _google_protobuf_FeatureSet_RepeatedFieldEncoding[keyof typeof _google_protobuf_FeatureSet_RepeatedFieldEncoding] - -// Original file: null - -export const _google_protobuf_FeatureSet_Utf8Validation = { - UTF8_VALIDATION_UNKNOWN: 0, - VERIFY: 2, - NONE: 3, -} as const; - -export type _google_protobuf_FeatureSet_Utf8Validation = - | 'UTF8_VALIDATION_UNKNOWN' - | 0 - | 'VERIFY' - | 2 - | 'NONE' - | 3 - -export type _google_protobuf_FeatureSet_Utf8Validation__Output = typeof _google_protobuf_FeatureSet_Utf8Validation[keyof typeof _google_protobuf_FeatureSet_Utf8Validation] - -export interface _google_protobuf_FeatureSet_VisibilityFeature { -} - -export interface _google_protobuf_FeatureSet_VisibilityFeature__Output { -} - -export interface FeatureSet { - 'fieldPresence'?: (_google_protobuf_FeatureSet_FieldPresence); - 'enumType'?: (_google_protobuf_FeatureSet_EnumType); - 'repeatedFieldEncoding'?: (_google_protobuf_FeatureSet_RepeatedFieldEncoding); - 'utf8Validation'?: (_google_protobuf_FeatureSet_Utf8Validation); - 'messageEncoding'?: (_google_protobuf_FeatureSet_MessageEncoding); - 'jsonFormat'?: (_google_protobuf_FeatureSet_JsonFormat); - 'enforceNamingStyle'?: (_google_protobuf_FeatureSet_EnforceNamingStyle); - 'defaultSymbolVisibility'?: (_google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility); -} - -export interface FeatureSet__Output { - 'fieldPresence'?: (_google_protobuf_FeatureSet_FieldPresence__Output); - 'enumType'?: (_google_protobuf_FeatureSet_EnumType__Output); - 'repeatedFieldEncoding'?: (_google_protobuf_FeatureSet_RepeatedFieldEncoding__Output); - 'utf8Validation'?: (_google_protobuf_FeatureSet_Utf8Validation__Output); - 'messageEncoding'?: (_google_protobuf_FeatureSet_MessageEncoding__Output); - 'jsonFormat'?: (_google_protobuf_FeatureSet_JsonFormat__Output); - 'enforceNamingStyle'?: (_google_protobuf_FeatureSet_EnforceNamingStyle__Output); - 'defaultSymbolVisibility'?: (_google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts deleted file mode 100644 index 63e9be74..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FeatureSetDefaults.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Original file: null - -import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from './Edition.js'; -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; - -export interface _google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault { - 'edition'?: (_google_protobuf_Edition); - 'overridableFeatures'?: (_google_protobuf_FeatureSet | null); - 'fixedFeatures'?: (_google_protobuf_FeatureSet | null); -} - -export interface _google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__Output { - 'edition'?: (_google_protobuf_Edition__Output); - 'overridableFeatures'?: (_google_protobuf_FeatureSet__Output); - 'fixedFeatures'?: (_google_protobuf_FeatureSet__Output); -} - -export interface FeatureSetDefaults { - 'defaults'?: (_google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault)[]; - 'minimumEdition'?: (_google_protobuf_Edition); - 'maximumEdition'?: (_google_protobuf_Edition); -} - -export interface FeatureSetDefaults__Output { - 'defaults'?: (_google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__Output)[]; - 'minimumEdition'?: (_google_protobuf_Edition__Output); - 'maximumEdition'?: (_google_protobuf_Edition__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts deleted file mode 100644 index 6ca685bd..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldDescriptorProto.ts +++ /dev/null @@ -1,112 +0,0 @@ -// Original file: null - -import type { FieldOptions as _google_protobuf_FieldOptions, FieldOptions__Output as _google_protobuf_FieldOptions__Output } from './FieldOptions.js'; - -// Original file: null - -export const _google_protobuf_FieldDescriptorProto_Label = { - LABEL_OPTIONAL: 1, - LABEL_REPEATED: 3, - LABEL_REQUIRED: 2, -} as const; - -export type _google_protobuf_FieldDescriptorProto_Label = - | 'LABEL_OPTIONAL' - | 1 - | 'LABEL_REPEATED' - | 3 - | 'LABEL_REQUIRED' - | 2 - -export type _google_protobuf_FieldDescriptorProto_Label__Output = typeof _google_protobuf_FieldDescriptorProto_Label[keyof typeof _google_protobuf_FieldDescriptorProto_Label] - -// Original file: null - -export const _google_protobuf_FieldDescriptorProto_Type = { - TYPE_DOUBLE: 1, - TYPE_FLOAT: 2, - TYPE_INT64: 3, - TYPE_UINT64: 4, - TYPE_INT32: 5, - TYPE_FIXED64: 6, - TYPE_FIXED32: 7, - TYPE_BOOL: 8, - TYPE_STRING: 9, - TYPE_GROUP: 10, - TYPE_MESSAGE: 11, - TYPE_BYTES: 12, - TYPE_UINT32: 13, - TYPE_ENUM: 14, - TYPE_SFIXED32: 15, - TYPE_SFIXED64: 16, - TYPE_SINT32: 17, - TYPE_SINT64: 18, -} as const; - -export type _google_protobuf_FieldDescriptorProto_Type = - | 'TYPE_DOUBLE' - | 1 - | 'TYPE_FLOAT' - | 2 - | 'TYPE_INT64' - | 3 - | 'TYPE_UINT64' - | 4 - | 'TYPE_INT32' - | 5 - | 'TYPE_FIXED64' - | 6 - | 'TYPE_FIXED32' - | 7 - | 'TYPE_BOOL' - | 8 - | 'TYPE_STRING' - | 9 - | 'TYPE_GROUP' - | 10 - | 'TYPE_MESSAGE' - | 11 - | 'TYPE_BYTES' - | 12 - | 'TYPE_UINT32' - | 13 - | 'TYPE_ENUM' - | 14 - | 'TYPE_SFIXED32' - | 15 - | 'TYPE_SFIXED64' - | 16 - | 'TYPE_SINT32' - | 17 - | 'TYPE_SINT64' - | 18 - -export type _google_protobuf_FieldDescriptorProto_Type__Output = typeof _google_protobuf_FieldDescriptorProto_Type[keyof typeof _google_protobuf_FieldDescriptorProto_Type] - -export interface FieldDescriptorProto { - 'name'?: (string); - 'extendee'?: (string); - 'number'?: (number); - 'label'?: (_google_protobuf_FieldDescriptorProto_Label); - 'type'?: (_google_protobuf_FieldDescriptorProto_Type); - 'typeName'?: (string); - 'defaultValue'?: (string); - 'options'?: (_google_protobuf_FieldOptions | null); - 'oneofIndex'?: (number); - 'jsonName'?: (string); - 'proto3Optional'?: (boolean); -} - -export interface FieldDescriptorProto__Output { - 'name'?: (string); - 'extendee'?: (string); - 'number'?: (number); - 'label'?: (_google_protobuf_FieldDescriptorProto_Label__Output); - 'type'?: (_google_protobuf_FieldDescriptorProto_Type__Output); - 'typeName'?: (string); - 'defaultValue'?: (string); - 'options'?: (_google_protobuf_FieldOptions__Output); - 'oneofIndex'?: (number); - 'jsonName'?: (string); - 'proto3Optional'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts deleted file mode 100644 index 1722cced..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FieldOptions.ts +++ /dev/null @@ -1,169 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; -import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from '../../validate/FieldRules.js'; -import type { FieldMigrateAnnotation as _udpa_annotations_FieldMigrateAnnotation, FieldMigrateAnnotation__Output as _udpa_annotations_FieldMigrateAnnotation__Output } from '../../udpa/annotations/FieldMigrateAnnotation.js'; -import type { FieldStatusAnnotation as _xds_annotations_v3_FieldStatusAnnotation, FieldStatusAnnotation__Output as _xds_annotations_v3_FieldStatusAnnotation__Output } from '../../xds/annotations/v3/FieldStatusAnnotation.js'; -import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from './Edition.js'; - -// Original file: null - -export const _google_protobuf_FieldOptions_CType = { - STRING: 0, - CORD: 1, - STRING_PIECE: 2, -} as const; - -export type _google_protobuf_FieldOptions_CType = - | 'STRING' - | 0 - | 'CORD' - | 1 - | 'STRING_PIECE' - | 2 - -export type _google_protobuf_FieldOptions_CType__Output = typeof _google_protobuf_FieldOptions_CType[keyof typeof _google_protobuf_FieldOptions_CType] - -export interface _google_protobuf_FieldOptions_EditionDefault { - 'edition'?: (_google_protobuf_Edition); - 'value'?: (string); -} - -export interface _google_protobuf_FieldOptions_EditionDefault__Output { - 'edition'?: (_google_protobuf_Edition__Output); - 'value'?: (string); -} - -export interface _google_protobuf_FieldOptions_FeatureSupport { - 'editionIntroduced'?: (_google_protobuf_Edition); - 'editionDeprecated'?: (_google_protobuf_Edition); - 'deprecationWarning'?: (string); - 'editionRemoved'?: (_google_protobuf_Edition); -} - -export interface _google_protobuf_FieldOptions_FeatureSupport__Output { - 'editionIntroduced'?: (_google_protobuf_Edition__Output); - 'editionDeprecated'?: (_google_protobuf_Edition__Output); - 'deprecationWarning'?: (string); - 'editionRemoved'?: (_google_protobuf_Edition__Output); -} - -// Original file: null - -export const _google_protobuf_FieldOptions_JSType = { - JS_NORMAL: 0, - JS_STRING: 1, - JS_NUMBER: 2, -} as const; - -export type _google_protobuf_FieldOptions_JSType = - | 'JS_NORMAL' - | 0 - | 'JS_STRING' - | 1 - | 'JS_NUMBER' - | 2 - -export type _google_protobuf_FieldOptions_JSType__Output = typeof _google_protobuf_FieldOptions_JSType[keyof typeof _google_protobuf_FieldOptions_JSType] - -// Original file: null - -export const _google_protobuf_FieldOptions_OptionRetention = { - RETENTION_UNKNOWN: 0, - RETENTION_RUNTIME: 1, - RETENTION_SOURCE: 2, -} as const; - -export type _google_protobuf_FieldOptions_OptionRetention = - | 'RETENTION_UNKNOWN' - | 0 - | 'RETENTION_RUNTIME' - | 1 - | 'RETENTION_SOURCE' - | 2 - -export type _google_protobuf_FieldOptions_OptionRetention__Output = typeof _google_protobuf_FieldOptions_OptionRetention[keyof typeof _google_protobuf_FieldOptions_OptionRetention] - -// Original file: null - -export const _google_protobuf_FieldOptions_OptionTargetType = { - TARGET_TYPE_UNKNOWN: 0, - TARGET_TYPE_FILE: 1, - TARGET_TYPE_EXTENSION_RANGE: 2, - TARGET_TYPE_MESSAGE: 3, - TARGET_TYPE_FIELD: 4, - TARGET_TYPE_ONEOF: 5, - TARGET_TYPE_ENUM: 6, - TARGET_TYPE_ENUM_ENTRY: 7, - TARGET_TYPE_SERVICE: 8, - TARGET_TYPE_METHOD: 9, -} as const; - -export type _google_protobuf_FieldOptions_OptionTargetType = - | 'TARGET_TYPE_UNKNOWN' - | 0 - | 'TARGET_TYPE_FILE' - | 1 - | 'TARGET_TYPE_EXTENSION_RANGE' - | 2 - | 'TARGET_TYPE_MESSAGE' - | 3 - | 'TARGET_TYPE_FIELD' - | 4 - | 'TARGET_TYPE_ONEOF' - | 5 - | 'TARGET_TYPE_ENUM' - | 6 - | 'TARGET_TYPE_ENUM_ENTRY' - | 7 - | 'TARGET_TYPE_SERVICE' - | 8 - | 'TARGET_TYPE_METHOD' - | 9 - -export type _google_protobuf_FieldOptions_OptionTargetType__Output = typeof _google_protobuf_FieldOptions_OptionTargetType[keyof typeof _google_protobuf_FieldOptions_OptionTargetType] - -export interface FieldOptions { - 'ctype'?: (_google_protobuf_FieldOptions_CType); - 'packed'?: (boolean); - 'deprecated'?: (boolean); - 'lazy'?: (boolean); - 'jstype'?: (_google_protobuf_FieldOptions_JSType); - 'weak'?: (boolean); - 'unverifiedLazy'?: (boolean); - 'debugRedact'?: (boolean); - 'retention'?: (_google_protobuf_FieldOptions_OptionRetention); - 'targets'?: (_google_protobuf_FieldOptions_OptionTargetType)[]; - 'editionDefaults'?: (_google_protobuf_FieldOptions_EditionDefault)[]; - 'features'?: (_google_protobuf_FeatureSet | null); - 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; - '.validate.rules'?: (_validate_FieldRules | null); - '.envoy.annotations.deprecatedAtMinorVersion'?: (string); - '.udpa.annotations.fieldMigrate'?: (_udpa_annotations_FieldMigrateAnnotation | null); - '.envoy.annotations.disallowedByDefault'?: (boolean); - '.xds.annotations.v3.fieldStatus'?: (_xds_annotations_v3_FieldStatusAnnotation | null); -} - -export interface FieldOptions__Output { - 'ctype'?: (_google_protobuf_FieldOptions_CType__Output); - 'packed'?: (boolean); - 'deprecated'?: (boolean); - 'lazy'?: (boolean); - 'jstype'?: (_google_protobuf_FieldOptions_JSType__Output); - 'weak'?: (boolean); - 'unverifiedLazy'?: (boolean); - 'debugRedact'?: (boolean); - 'retention'?: (_google_protobuf_FieldOptions_OptionRetention__Output); - 'targets'?: (_google_protobuf_FieldOptions_OptionTargetType__Output)[]; - 'editionDefaults'?: (_google_protobuf_FieldOptions_EditionDefault__Output)[]; - 'features'?: (_google_protobuf_FeatureSet__Output); - 'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; - '.validate.rules'?: (_validate_FieldRules__Output); - '.envoy.annotations.deprecatedAtMinorVersion'?: (string); - '.udpa.annotations.fieldMigrate'?: (_udpa_annotations_FieldMigrateAnnotation__Output); - '.envoy.annotations.disallowedByDefault'?: (boolean); - '.xds.annotations.v3.fieldStatus'?: (_xds_annotations_v3_FieldStatusAnnotation__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts deleted file mode 100644 index bc95b81b..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorProto.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Original file: null - -import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './DescriptorProto.js'; -import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './EnumDescriptorProto.js'; -import type { ServiceDescriptorProto as _google_protobuf_ServiceDescriptorProto, ServiceDescriptorProto__Output as _google_protobuf_ServiceDescriptorProto__Output } from './ServiceDescriptorProto.js'; -import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './FieldDescriptorProto.js'; -import type { FileOptions as _google_protobuf_FileOptions, FileOptions__Output as _google_protobuf_FileOptions__Output } from './FileOptions.js'; -import type { SourceCodeInfo as _google_protobuf_SourceCodeInfo, SourceCodeInfo__Output as _google_protobuf_SourceCodeInfo__Output } from './SourceCodeInfo.js'; -import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from './Edition.js'; - -export interface FileDescriptorProto { - 'name'?: (string); - 'package'?: (string); - 'dependency'?: (string)[]; - 'messageType'?: (_google_protobuf_DescriptorProto)[]; - 'enumType'?: (_google_protobuf_EnumDescriptorProto)[]; - 'service'?: (_google_protobuf_ServiceDescriptorProto)[]; - 'extension'?: (_google_protobuf_FieldDescriptorProto)[]; - 'options'?: (_google_protobuf_FileOptions | null); - 'sourceCodeInfo'?: (_google_protobuf_SourceCodeInfo | null); - 'publicDependency'?: (number)[]; - 'weakDependency'?: (number)[]; - 'syntax'?: (string); - 'edition'?: (_google_protobuf_Edition); - 'optionDependency'?: (string)[]; -} - -export interface FileDescriptorProto__Output { - 'name'?: (string); - 'package'?: (string); - 'dependency'?: (string)[]; - 'messageType'?: (_google_protobuf_DescriptorProto__Output)[]; - 'enumType'?: (_google_protobuf_EnumDescriptorProto__Output)[]; - 'service'?: (_google_protobuf_ServiceDescriptorProto__Output)[]; - 'extension'?: (_google_protobuf_FieldDescriptorProto__Output)[]; - 'options'?: (_google_protobuf_FileOptions__Output); - 'sourceCodeInfo'?: (_google_protobuf_SourceCodeInfo__Output); - 'publicDependency'?: (number)[]; - 'weakDependency'?: (number)[]; - 'syntax'?: (string); - 'edition'?: (_google_protobuf_Edition__Output); - 'optionDependency'?: (string)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts deleted file mode 100644 index 775bfa17..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileDescriptorSet.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { FileDescriptorProto as _google_protobuf_FileDescriptorProto, FileDescriptorProto__Output as _google_protobuf_FileDescriptorProto__Output } from './FileDescriptorProto.js'; - -export interface FileDescriptorSet { - 'file'?: (_google_protobuf_FileDescriptorProto)[]; -} - -export interface FileDescriptorSet__Output { - 'file'?: (_google_protobuf_FileDescriptorProto__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts deleted file mode 100644 index 66f80dd8..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FileOptions.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; -import type { FileMigrateAnnotation as _udpa_annotations_FileMigrateAnnotation, FileMigrateAnnotation__Output as _udpa_annotations_FileMigrateAnnotation__Output } from '../../udpa/annotations/FileMigrateAnnotation.js'; -import type { StatusAnnotation as _udpa_annotations_StatusAnnotation, StatusAnnotation__Output as _udpa_annotations_StatusAnnotation__Output } from '../../udpa/annotations/StatusAnnotation.js'; -import type { FileStatusAnnotation as _xds_annotations_v3_FileStatusAnnotation, FileStatusAnnotation__Output as _xds_annotations_v3_FileStatusAnnotation__Output } from '../../xds/annotations/v3/FileStatusAnnotation.js'; - -// Original file: null - -export const _google_protobuf_FileOptions_OptimizeMode = { - SPEED: 1, - CODE_SIZE: 2, - LITE_RUNTIME: 3, -} as const; - -export type _google_protobuf_FileOptions_OptimizeMode = - | 'SPEED' - | 1 - | 'CODE_SIZE' - | 2 - | 'LITE_RUNTIME' - | 3 - -export type _google_protobuf_FileOptions_OptimizeMode__Output = typeof _google_protobuf_FileOptions_OptimizeMode[keyof typeof _google_protobuf_FileOptions_OptimizeMode] - -export interface FileOptions { - 'javaPackage'?: (string); - 'javaOuterClassname'?: (string); - 'optimizeFor'?: (_google_protobuf_FileOptions_OptimizeMode); - 'javaMultipleFiles'?: (boolean); - 'goPackage'?: (string); - 'ccGenericServices'?: (boolean); - 'javaGenericServices'?: (boolean); - 'pyGenericServices'?: (boolean); - 'javaGenerateEqualsAndHash'?: (boolean); - 'deprecated'?: (boolean); - 'javaStringCheckUtf8'?: (boolean); - 'ccEnableArenas'?: (boolean); - 'objcClassPrefix'?: (string); - 'csharpNamespace'?: (string); - 'swiftPrefix'?: (string); - 'phpClassPrefix'?: (string); - 'phpNamespace'?: (string); - 'phpMetadataNamespace'?: (string); - 'rubyPackage'?: (string); - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; - '.udpa.annotations.fileMigrate'?: (_udpa_annotations_FileMigrateAnnotation | null); - '.udpa.annotations.fileStatus'?: (_udpa_annotations_StatusAnnotation | null); - '.xds.annotations.v3.fileStatus'?: (_xds_annotations_v3_FileStatusAnnotation | null); -} - -export interface FileOptions__Output { - 'javaPackage'?: (string); - 'javaOuterClassname'?: (string); - 'optimizeFor'?: (_google_protobuf_FileOptions_OptimizeMode__Output); - 'javaMultipleFiles'?: (boolean); - 'goPackage'?: (string); - 'ccGenericServices'?: (boolean); - 'javaGenericServices'?: (boolean); - 'pyGenericServices'?: (boolean); - 'javaGenerateEqualsAndHash'?: (boolean); - 'deprecated'?: (boolean); - 'javaStringCheckUtf8'?: (boolean); - 'ccEnableArenas'?: (boolean); - 'objcClassPrefix'?: (string); - 'csharpNamespace'?: (string); - 'swiftPrefix'?: (string); - 'phpClassPrefix'?: (string); - 'phpNamespace'?: (string); - 'phpMetadataNamespace'?: (string); - 'rubyPackage'?: (string); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; - '.udpa.annotations.fileMigrate'?: (_udpa_annotations_FileMigrateAnnotation__Output); - '.udpa.annotations.fileStatus'?: (_udpa_annotations_StatusAnnotation__Output); - '.xds.annotations.v3.fileStatus'?: (_xds_annotations_v3_FileStatusAnnotation__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts deleted file mode 100644 index 5f0aba0c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/FloatValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface FloatValue { - 'value'?: (number | string); -} - -export interface FloatValue__Output { - 'value'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts deleted file mode 100644 index 0de3b924..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/GeneratedCodeInfo.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Original file: null - - -export interface _google_protobuf_GeneratedCodeInfo_Annotation { - 'path'?: (number)[]; - 'sourceFile'?: (string); - 'begin'?: (number); - 'end'?: (number); - 'semantic'?: (_google_protobuf_GeneratedCodeInfo_Annotation_Semantic); -} - -export interface _google_protobuf_GeneratedCodeInfo_Annotation__Output { - 'path'?: (number)[]; - 'sourceFile'?: (string); - 'begin'?: (number); - 'end'?: (number); - 'semantic'?: (_google_protobuf_GeneratedCodeInfo_Annotation_Semantic__Output); -} - -// Original file: null - -export const _google_protobuf_GeneratedCodeInfo_Annotation_Semantic = { - NONE: 0, - SET: 1, - ALIAS: 2, -} as const; - -export type _google_protobuf_GeneratedCodeInfo_Annotation_Semantic = - | 'NONE' - | 0 - | 'SET' - | 1 - | 'ALIAS' - | 2 - -export type _google_protobuf_GeneratedCodeInfo_Annotation_Semantic__Output = typeof _google_protobuf_GeneratedCodeInfo_Annotation_Semantic[keyof typeof _google_protobuf_GeneratedCodeInfo_Annotation_Semantic] - -export interface GeneratedCodeInfo { - 'annotation'?: (_google_protobuf_GeneratedCodeInfo_Annotation)[]; -} - -export interface GeneratedCodeInfo__Output { - 'annotation'?: (_google_protobuf_GeneratedCodeInfo_Annotation__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts deleted file mode 100644 index fd597474..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int32Value.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface Int32Value { - 'value'?: (number); -} - -export interface Int32Value__Output { - 'value'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts deleted file mode 100644 index 2a544921..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Int64Value.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface Int64Value { - 'value'?: (number | string | Long); -} - -export interface Int64Value__Output { - 'value'?: (Long); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts deleted file mode 100644 index bcf92385..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ListValue.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from './Value.js'; - -export interface ListValue { - 'values'?: (_google_protobuf_Value)[]; -} - -export interface ListValue__Output { - 'values'?: (_google_protobuf_Value__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts deleted file mode 100644 index 5d33bf0c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MessageOptions.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; -import type { VersioningAnnotation as _udpa_annotations_VersioningAnnotation, VersioningAnnotation__Output as _udpa_annotations_VersioningAnnotation__Output } from '../../udpa/annotations/VersioningAnnotation.js'; -import type { MigrateAnnotation as _udpa_annotations_MigrateAnnotation, MigrateAnnotation__Output as _udpa_annotations_MigrateAnnotation__Output } from '../../udpa/annotations/MigrateAnnotation.js'; -import type { MessageStatusAnnotation as _xds_annotations_v3_MessageStatusAnnotation, MessageStatusAnnotation__Output as _xds_annotations_v3_MessageStatusAnnotation__Output } from '../../xds/annotations/v3/MessageStatusAnnotation.js'; - -export interface MessageOptions { - 'messageSetWireFormat'?: (boolean); - 'noStandardDescriptorAccessor'?: (boolean); - 'deprecated'?: (boolean); - 'mapEntry'?: (boolean); - 'deprecatedLegacyJsonFieldConflicts'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; - '.validate.disabled'?: (boolean); - '.validate.ignored'?: (boolean); - '.udpa.annotations.versioning'?: (_udpa_annotations_VersioningAnnotation | null); - '.udpa.annotations.messageMigrate'?: (_udpa_annotations_MigrateAnnotation | null); - '.xds.annotations.v3.messageStatus'?: (_xds_annotations_v3_MessageStatusAnnotation | null); -} - -export interface MessageOptions__Output { - 'messageSetWireFormat'?: (boolean); - 'noStandardDescriptorAccessor'?: (boolean); - 'deprecated'?: (boolean); - 'mapEntry'?: (boolean); - 'deprecatedLegacyJsonFieldConflicts'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; - '.validate.disabled'?: (boolean); - '.validate.ignored'?: (boolean); - '.udpa.annotations.versioning'?: (_udpa_annotations_VersioningAnnotation__Output); - '.udpa.annotations.messageMigrate'?: (_udpa_annotations_MigrateAnnotation__Output); - '.xds.annotations.v3.messageStatus'?: (_xds_annotations_v3_MessageStatusAnnotation__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts deleted file mode 100644 index ba9f9509..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodDescriptorProto.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Original file: null - -import type { MethodOptions as _google_protobuf_MethodOptions, MethodOptions__Output as _google_protobuf_MethodOptions__Output } from './MethodOptions.js'; - -export interface MethodDescriptorProto { - 'name'?: (string); - 'inputType'?: (string); - 'outputType'?: (string); - 'options'?: (_google_protobuf_MethodOptions | null); - 'clientStreaming'?: (boolean); - 'serverStreaming'?: (boolean); -} - -export interface MethodDescriptorProto__Output { - 'name'?: (string); - 'inputType'?: (string); - 'outputType'?: (string); - 'options'?: (_google_protobuf_MethodOptions__Output); - 'clientStreaming'?: (boolean); - 'serverStreaming'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts deleted file mode 100644 index 97df27c4..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/MethodOptions.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; - -// Original file: null - -export const _google_protobuf_MethodOptions_IdempotencyLevel = { - IDEMPOTENCY_UNKNOWN: 0, - NO_SIDE_EFFECTS: 1, - IDEMPOTENT: 2, -} as const; - -export type _google_protobuf_MethodOptions_IdempotencyLevel = - | 'IDEMPOTENCY_UNKNOWN' - | 0 - | 'NO_SIDE_EFFECTS' - | 1 - | 'IDEMPOTENT' - | 2 - -export type _google_protobuf_MethodOptions_IdempotencyLevel__Output = typeof _google_protobuf_MethodOptions_IdempotencyLevel[keyof typeof _google_protobuf_MethodOptions_IdempotencyLevel] - -export interface MethodOptions { - 'deprecated'?: (boolean); - 'idempotencyLevel'?: (_google_protobuf_MethodOptions_IdempotencyLevel); - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; -} - -export interface MethodOptions__Output { - 'deprecated'?: (boolean); - 'idempotencyLevel'?: (_google_protobuf_MethodOptions_IdempotencyLevel__Output); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts deleted file mode 100644 index a04f8d14..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/NullValue.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -export const NullValue = { - NULL_VALUE: 0, -} as const; - -export type NullValue = - | 'NULL_VALUE' - | 0 - -export type NullValue__Output = typeof NullValue[keyof typeof NullValue] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts deleted file mode 100644 index 75179518..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofDescriptorProto.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { OneofOptions as _google_protobuf_OneofOptions, OneofOptions__Output as _google_protobuf_OneofOptions__Output } from './OneofOptions.js'; - -export interface OneofDescriptorProto { - 'name'?: (string); - 'options'?: (_google_protobuf_OneofOptions | null); -} - -export interface OneofDescriptorProto__Output { - 'name'?: (string); - 'options'?: (_google_protobuf_OneofOptions__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts deleted file mode 100644 index 33db9411..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/OneofOptions.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; - -export interface OneofOptions { - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; - '.validate.required'?: (boolean); -} - -export interface OneofOptions__Output { - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; - '.validate.required'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts deleted file mode 100644 index 7878e45d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceDescriptorProto.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: null - -import type { MethodDescriptorProto as _google_protobuf_MethodDescriptorProto, MethodDescriptorProto__Output as _google_protobuf_MethodDescriptorProto__Output } from './MethodDescriptorProto.js'; -import type { ServiceOptions as _google_protobuf_ServiceOptions, ServiceOptions__Output as _google_protobuf_ServiceOptions__Output } from './ServiceOptions.js'; - -export interface ServiceDescriptorProto { - 'name'?: (string); - 'method'?: (_google_protobuf_MethodDescriptorProto)[]; - 'options'?: (_google_protobuf_ServiceOptions | null); -} - -export interface ServiceDescriptorProto__Output { - 'name'?: (string); - 'method'?: (_google_protobuf_MethodDescriptorProto__Output)[]; - 'options'?: (_google_protobuf_ServiceOptions__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts deleted file mode 100644 index 69fa6269..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/ServiceOptions.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: null - -import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './FeatureSet.js'; -import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './UninterpretedOption.js'; - -export interface ServiceOptions { - 'deprecated'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet | null); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[]; -} - -export interface ServiceOptions__Output { - 'deprecated'?: (boolean); - 'features'?: (_google_protobuf_FeatureSet__Output); - 'uninterpretedOption'?: (_google_protobuf_UninterpretedOption__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts deleted file mode 100644 index ace0d39e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SourceCodeInfo.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Original file: null - - -export interface _google_protobuf_SourceCodeInfo_Location { - 'path'?: (number)[]; - 'span'?: (number)[]; - 'leadingComments'?: (string); - 'trailingComments'?: (string); - 'leadingDetachedComments'?: (string)[]; -} - -export interface _google_protobuf_SourceCodeInfo_Location__Output { - 'path'?: (number)[]; - 'span'?: (number)[]; - 'leadingComments'?: (string); - 'trailingComments'?: (string); - 'leadingDetachedComments'?: (string)[]; -} - -export interface SourceCodeInfo { - 'location'?: (_google_protobuf_SourceCodeInfo_Location)[]; -} - -export interface SourceCodeInfo__Output { - 'location'?: (_google_protobuf_SourceCodeInfo_Location__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts deleted file mode 100644 index cefd9a1d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/StringValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface StringValue { - 'value'?: (string); -} - -export interface StringValue__Output { - 'value'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts deleted file mode 100644 index 0652421d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Struct.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { Value as _google_protobuf_Value, Value__Output as _google_protobuf_Value__Output } from './Value.js'; - -export interface Struct { - 'fields'?: ({[key: string]: _google_protobuf_Value}); -} - -export interface Struct__Output { - 'fields'?: ({[key: string]: _google_protobuf_Value__Output}); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts deleted file mode 100644 index f49b63f9..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/SymbolVisibility.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: null - -export const SymbolVisibility = { - VISIBILITY_UNSET: 0, - VISIBILITY_LOCAL: 1, - VISIBILITY_EXPORT: 2, -} as const; - -export type SymbolVisibility = - | 'VISIBILITY_UNSET' - | 0 - | 'VISIBILITY_LOCAL' - | 1 - | 'VISIBILITY_EXPORT' - | 2 - -export type SymbolVisibility__Output = typeof SymbolVisibility[keyof typeof SymbolVisibility] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts deleted file mode 100644 index a5c4edd6..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Timestamp.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface Timestamp { - 'seconds'?: (number | string | Long); - 'nanos'?: (number); -} - -export interface Timestamp__Output { - 'seconds'?: (Long); - 'nanos'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts deleted file mode 100644 index 93a6a8d8..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt32Value.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: null - - -export interface UInt32Value { - 'value'?: (number); -} - -export interface UInt32Value__Output { - 'value'?: (number); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts deleted file mode 100644 index 20e010ec..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UInt64Value.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface UInt64Value { - 'value'?: (number | string | Long); -} - -export interface UInt64Value__Output { - 'value'?: (Long); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts deleted file mode 100644 index 0fcc97e0..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/UninterpretedOption.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: null - -import type { Long } from '@grpc/proto-loader'; - -export interface _google_protobuf_UninterpretedOption_NamePart { - 'namePart'?: (string); - 'isExtension'?: (boolean); -} - -export interface _google_protobuf_UninterpretedOption_NamePart__Output { - 'namePart'?: (string); - 'isExtension'?: (boolean); -} - -export interface UninterpretedOption { - 'name'?: (_google_protobuf_UninterpretedOption_NamePart)[]; - 'identifierValue'?: (string); - 'positiveIntValue'?: (number | string | Long); - 'negativeIntValue'?: (number | string | Long); - 'doubleValue'?: (number | string); - 'stringValue'?: (Buffer | Uint8Array | string); - 'aggregateValue'?: (string); -} - -export interface UninterpretedOption__Output { - 'name'?: (_google_protobuf_UninterpretedOption_NamePart__Output)[]; - 'identifierValue'?: (string); - 'positiveIntValue'?: (Long); - 'negativeIntValue'?: (Long); - 'doubleValue'?: (number); - 'stringValue'?: (Buffer); - 'aggregateValue'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts deleted file mode 100644 index e14489ab..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/google/protobuf/Value.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: null - -import type { NullValue as _google_protobuf_NullValue, NullValue__Output as _google_protobuf_NullValue__Output } from './NullValue.js'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from './Struct.js'; -import type { ListValue as _google_protobuf_ListValue, ListValue__Output as _google_protobuf_ListValue__Output } from './ListValue.js'; - -export interface Value { - 'nullValue'?: (_google_protobuf_NullValue); - 'numberValue'?: (number | string); - 'stringValue'?: (string); - 'boolValue'?: (boolean); - 'structValue'?: (_google_protobuf_Struct | null); - 'listValue'?: (_google_protobuf_ListValue | null); - 'kind'?: "nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"; -} - -export interface Value__Output { - 'nullValue'?: (_google_protobuf_NullValue__Output); - 'numberValue'?: (number); - 'stringValue'?: (string); - 'boolValue'?: (boolean); - 'structValue'?: (_google_protobuf_Struct__Output); - 'listValue'?: (_google_protobuf_ListValue__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts deleted file mode 100644 index 10f75b5f..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FieldMigrateAnnotation.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../udpa/udpa/annotations/migrate.proto - - -export interface FieldMigrateAnnotation { - 'rename'?: (string); - 'oneofPromotion'?: (string); -} - -export interface FieldMigrateAnnotation__Output { - 'rename'?: (string); - 'oneofPromotion'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts deleted file mode 100644 index 7246ff0e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/FileMigrateAnnotation.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../udpa/udpa/annotations/migrate.proto - - -export interface FileMigrateAnnotation { - 'moveToPackage'?: (string); -} - -export interface FileMigrateAnnotation__Output { - 'moveToPackage'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts deleted file mode 100644 index 65511331..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/MigrateAnnotation.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../udpa/udpa/annotations/migrate.proto - - -export interface MigrateAnnotation { - 'rename'?: (string); -} - -export interface MigrateAnnotation__Output { - 'rename'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts deleted file mode 100644 index 931bbcd4..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/PackageVersionStatus.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Original file: ../../../udpa/udpa/annotations/status.proto - -export const PackageVersionStatus = { - UNKNOWN: 0, - FROZEN: 1, - ACTIVE: 2, - NEXT_MAJOR_VERSION_CANDIDATE: 3, -} as const; - -export type PackageVersionStatus = - | 'UNKNOWN' - | 0 - | 'FROZEN' - | 1 - | 'ACTIVE' - | 2 - | 'NEXT_MAJOR_VERSION_CANDIDATE' - | 3 - -export type PackageVersionStatus__Output = typeof PackageVersionStatus[keyof typeof PackageVersionStatus] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts deleted file mode 100644 index 4048b8c6..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/StatusAnnotation.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../udpa/udpa/annotations/status.proto - -import type { PackageVersionStatus as _udpa_annotations_PackageVersionStatus, PackageVersionStatus__Output as _udpa_annotations_PackageVersionStatus__Output } from './PackageVersionStatus.js'; - -export interface StatusAnnotation { - 'workInProgress'?: (boolean); - 'packageVersionStatus'?: (_udpa_annotations_PackageVersionStatus); -} - -export interface StatusAnnotation__Output { - 'workInProgress'?: (boolean); - 'packageVersionStatus'?: (_udpa_annotations_PackageVersionStatus__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts deleted file mode 100644 index 2797b956..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/udpa/annotations/VersioningAnnotation.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../udpa/udpa/annotations/versioning.proto - - -export interface VersioningAnnotation { - 'previousMessageType'?: (string); -} - -export interface VersioningAnnotation__Output { - 'previousMessageType'?: (string); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts deleted file mode 100644 index 94fb2c04..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/AnyRules.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface AnyRules { - 'required'?: (boolean); - 'in'?: (string)[]; - 'notIn'?: (string)[]; -} - -export interface AnyRules__Output { - 'required'?: (boolean); - 'in'?: (string)[]; - 'notIn'?: (string)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts deleted file mode 100644 index d89f9592..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BoolRules.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface BoolRules { - 'const'?: (boolean); -} - -export interface BoolRules__Output { - 'const'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts deleted file mode 100644 index 1688c270..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/BytesRules.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface BytesRules { - 'const'?: (Buffer | Uint8Array | string); - 'minLen'?: (number | string | Long); - 'maxLen'?: (number | string | Long); - 'pattern'?: (string); - 'prefix'?: (Buffer | Uint8Array | string); - 'suffix'?: (Buffer | Uint8Array | string); - 'contains'?: (Buffer | Uint8Array | string); - 'in'?: (Buffer | Uint8Array | string)[]; - 'notIn'?: (Buffer | Uint8Array | string)[]; - 'ip'?: (boolean); - 'ipv4'?: (boolean); - 'ipv6'?: (boolean); - 'len'?: (number | string | Long); - 'ignoreEmpty'?: (boolean); - 'wellKnown'?: "ip"|"ipv4"|"ipv6"; -} - -export interface BytesRules__Output { - 'const'?: (Buffer); - 'minLen'?: (Long); - 'maxLen'?: (Long); - 'pattern'?: (string); - 'prefix'?: (Buffer); - 'suffix'?: (Buffer); - 'contains'?: (Buffer); - 'in'?: (Buffer)[]; - 'notIn'?: (Buffer)[]; - 'ip'?: (boolean); - 'ipv4'?: (boolean); - 'ipv6'?: (boolean); - 'len'?: (Long); - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts deleted file mode 100644 index 29c5c90c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DoubleRules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface DoubleRules { - 'const'?: (number | string); - 'lt'?: (number | string); - 'lte'?: (number | string); - 'gt'?: (number | string); - 'gte'?: (number | string); - 'in'?: (number | string)[]; - 'notIn'?: (number | string)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface DoubleRules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts deleted file mode 100644 index 426e2e64..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/DurationRules.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../google/protobuf/Duration.js'; - -export interface DurationRules { - 'required'?: (boolean); - 'const'?: (_google_protobuf_Duration | null); - 'lt'?: (_google_protobuf_Duration | null); - 'lte'?: (_google_protobuf_Duration | null); - 'gt'?: (_google_protobuf_Duration | null); - 'gte'?: (_google_protobuf_Duration | null); - 'in'?: (_google_protobuf_Duration)[]; - 'notIn'?: (_google_protobuf_Duration)[]; -} - -export interface DurationRules__Output { - 'required'?: (boolean); - 'const'?: (_google_protobuf_Duration__Output); - 'lt'?: (_google_protobuf_Duration__Output); - 'lte'?: (_google_protobuf_Duration__Output); - 'gt'?: (_google_protobuf_Duration__Output); - 'gte'?: (_google_protobuf_Duration__Output); - 'in'?: (_google_protobuf_Duration__Output)[]; - 'notIn'?: (_google_protobuf_Duration__Output)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts deleted file mode 100644 index a448fa80..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/EnumRules.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface EnumRules { - 'const'?: (number); - 'definedOnly'?: (boolean); - 'in'?: (number)[]; - 'notIn'?: (number)[]; -} - -export interface EnumRules__Output { - 'const'?: (number); - 'definedOnly'?: (boolean); - 'in'?: (number)[]; - 'notIn'?: (number)[]; -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts deleted file mode 100644 index 27858a4b..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FieldRules.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { FloatRules as _validate_FloatRules, FloatRules__Output as _validate_FloatRules__Output } from './FloatRules.js'; -import type { DoubleRules as _validate_DoubleRules, DoubleRules__Output as _validate_DoubleRules__Output } from './DoubleRules.js'; -import type { Int32Rules as _validate_Int32Rules, Int32Rules__Output as _validate_Int32Rules__Output } from './Int32Rules.js'; -import type { Int64Rules as _validate_Int64Rules, Int64Rules__Output as _validate_Int64Rules__Output } from './Int64Rules.js'; -import type { UInt32Rules as _validate_UInt32Rules, UInt32Rules__Output as _validate_UInt32Rules__Output } from './UInt32Rules.js'; -import type { UInt64Rules as _validate_UInt64Rules, UInt64Rules__Output as _validate_UInt64Rules__Output } from './UInt64Rules.js'; -import type { SInt32Rules as _validate_SInt32Rules, SInt32Rules__Output as _validate_SInt32Rules__Output } from './SInt32Rules.js'; -import type { SInt64Rules as _validate_SInt64Rules, SInt64Rules__Output as _validate_SInt64Rules__Output } from './SInt64Rules.js'; -import type { Fixed32Rules as _validate_Fixed32Rules, Fixed32Rules__Output as _validate_Fixed32Rules__Output } from './Fixed32Rules.js'; -import type { Fixed64Rules as _validate_Fixed64Rules, Fixed64Rules__Output as _validate_Fixed64Rules__Output } from './Fixed64Rules.js'; -import type { SFixed32Rules as _validate_SFixed32Rules, SFixed32Rules__Output as _validate_SFixed32Rules__Output } from './SFixed32Rules.js'; -import type { SFixed64Rules as _validate_SFixed64Rules, SFixed64Rules__Output as _validate_SFixed64Rules__Output } from './SFixed64Rules.js'; -import type { BoolRules as _validate_BoolRules, BoolRules__Output as _validate_BoolRules__Output } from './BoolRules.js'; -import type { StringRules as _validate_StringRules, StringRules__Output as _validate_StringRules__Output } from './StringRules.js'; -import type { BytesRules as _validate_BytesRules, BytesRules__Output as _validate_BytesRules__Output } from './BytesRules.js'; -import type { EnumRules as _validate_EnumRules, EnumRules__Output as _validate_EnumRules__Output } from './EnumRules.js'; -import type { MessageRules as _validate_MessageRules, MessageRules__Output as _validate_MessageRules__Output } from './MessageRules.js'; -import type { RepeatedRules as _validate_RepeatedRules, RepeatedRules__Output as _validate_RepeatedRules__Output } from './RepeatedRules.js'; -import type { MapRules as _validate_MapRules, MapRules__Output as _validate_MapRules__Output } from './MapRules.js'; -import type { AnyRules as _validate_AnyRules, AnyRules__Output as _validate_AnyRules__Output } from './AnyRules.js'; -import type { DurationRules as _validate_DurationRules, DurationRules__Output as _validate_DurationRules__Output } from './DurationRules.js'; -import type { TimestampRules as _validate_TimestampRules, TimestampRules__Output as _validate_TimestampRules__Output } from './TimestampRules.js'; - -export interface FieldRules { - 'float'?: (_validate_FloatRules | null); - 'double'?: (_validate_DoubleRules | null); - 'int32'?: (_validate_Int32Rules | null); - 'int64'?: (_validate_Int64Rules | null); - 'uint32'?: (_validate_UInt32Rules | null); - 'uint64'?: (_validate_UInt64Rules | null); - 'sint32'?: (_validate_SInt32Rules | null); - 'sint64'?: (_validate_SInt64Rules | null); - 'fixed32'?: (_validate_Fixed32Rules | null); - 'fixed64'?: (_validate_Fixed64Rules | null); - 'sfixed32'?: (_validate_SFixed32Rules | null); - 'sfixed64'?: (_validate_SFixed64Rules | null); - 'bool'?: (_validate_BoolRules | null); - 'string'?: (_validate_StringRules | null); - 'bytes'?: (_validate_BytesRules | null); - 'enum'?: (_validate_EnumRules | null); - 'message'?: (_validate_MessageRules | null); - 'repeated'?: (_validate_RepeatedRules | null); - 'map'?: (_validate_MapRules | null); - 'any'?: (_validate_AnyRules | null); - 'duration'?: (_validate_DurationRules | null); - 'timestamp'?: (_validate_TimestampRules | null); - 'type'?: "float"|"double"|"int32"|"int64"|"uint32"|"uint64"|"sint32"|"sint64"|"fixed32"|"fixed64"|"sfixed32"|"sfixed64"|"bool"|"string"|"bytes"|"enum"|"repeated"|"map"|"any"|"duration"|"timestamp"; -} - -export interface FieldRules__Output { - 'float'?: (_validate_FloatRules__Output); - 'double'?: (_validate_DoubleRules__Output); - 'int32'?: (_validate_Int32Rules__Output); - 'int64'?: (_validate_Int64Rules__Output); - 'uint32'?: (_validate_UInt32Rules__Output); - 'uint64'?: (_validate_UInt64Rules__Output); - 'sint32'?: (_validate_SInt32Rules__Output); - 'sint64'?: (_validate_SInt64Rules__Output); - 'fixed32'?: (_validate_Fixed32Rules__Output); - 'fixed64'?: (_validate_Fixed64Rules__Output); - 'sfixed32'?: (_validate_SFixed32Rules__Output); - 'sfixed64'?: (_validate_SFixed64Rules__Output); - 'bool'?: (_validate_BoolRules__Output); - 'string'?: (_validate_StringRules__Output); - 'bytes'?: (_validate_BytesRules__Output); - 'enum'?: (_validate_EnumRules__Output); - 'message'?: (_validate_MessageRules__Output); - 'repeated'?: (_validate_RepeatedRules__Output); - 'map'?: (_validate_MapRules__Output); - 'any'?: (_validate_AnyRules__Output); - 'duration'?: (_validate_DurationRules__Output); - 'timestamp'?: (_validate_TimestampRules__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts deleted file mode 100644 index 499420ac..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed32Rules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface Fixed32Rules { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface Fixed32Rules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts deleted file mode 100644 index 538ae7df..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Fixed64Rules.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface Fixed64Rules { - 'const'?: (number | string | Long); - 'lt'?: (number | string | Long); - 'lte'?: (number | string | Long); - 'gt'?: (number | string | Long); - 'gte'?: (number | string | Long); - 'in'?: (number | string | Long)[]; - 'notIn'?: (number | string | Long)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface Fixed64Rules__Output { - 'const'?: (Long); - 'lt'?: (Long); - 'lte'?: (Long); - 'gt'?: (Long); - 'gte'?: (Long); - 'in'?: (Long)[]; - 'notIn'?: (Long)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts deleted file mode 100644 index 7bee5f92..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/FloatRules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface FloatRules { - 'const'?: (number | string); - 'lt'?: (number | string); - 'lte'?: (number | string); - 'gt'?: (number | string); - 'gte'?: (number | string); - 'in'?: (number | string)[]; - 'notIn'?: (number | string)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface FloatRules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts deleted file mode 100644 index bf708ce5..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int32Rules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface Int32Rules { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface Int32Rules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts deleted file mode 100644 index 092a4749..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/Int64Rules.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface Int64Rules { - 'const'?: (number | string | Long); - 'lt'?: (number | string | Long); - 'lte'?: (number | string | Long); - 'gt'?: (number | string | Long); - 'gte'?: (number | string | Long); - 'in'?: (number | string | Long)[]; - 'notIn'?: (number | string | Long)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface Int64Rules__Output { - 'const'?: (Long); - 'lt'?: (Long); - 'lte'?: (Long); - 'gt'?: (Long); - 'gte'?: (Long); - 'in'?: (Long)[]; - 'notIn'?: (Long)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts deleted file mode 100644 index 2a65528d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/KnownRegex.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -export const KnownRegex = { - UNKNOWN: 0, - HTTP_HEADER_NAME: 1, - HTTP_HEADER_VALUE: 2, -} as const; - -export type KnownRegex = - | 'UNKNOWN' - | 0 - | 'HTTP_HEADER_NAME' - | 1 - | 'HTTP_HEADER_VALUE' - | 2 - -export type KnownRegex__Output = typeof KnownRegex[keyof typeof KnownRegex] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts deleted file mode 100644 index 3abbf204..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MapRules.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './FieldRules.js'; -import type { Long } from '@grpc/proto-loader'; - -export interface MapRules { - 'minPairs'?: (number | string | Long); - 'maxPairs'?: (number | string | Long); - 'noSparse'?: (boolean); - 'keys'?: (_validate_FieldRules | null); - 'values'?: (_validate_FieldRules | null); - 'ignoreEmpty'?: (boolean); -} - -export interface MapRules__Output { - 'minPairs'?: (Long); - 'maxPairs'?: (Long); - 'noSparse'?: (boolean); - 'keys'?: (_validate_FieldRules__Output); - 'values'?: (_validate_FieldRules__Output); - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts deleted file mode 100644 index f9b29f5b..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/MessageRules.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface MessageRules { - 'skip'?: (boolean); - 'required'?: (boolean); -} - -export interface MessageRules__Output { - 'skip'?: (boolean); - 'required'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts deleted file mode 100644 index 996aedfe..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/RepeatedRules.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './FieldRules.js'; -import type { Long } from '@grpc/proto-loader'; - -export interface RepeatedRules { - 'minItems'?: (number | string | Long); - 'maxItems'?: (number | string | Long); - 'unique'?: (boolean); - 'items'?: (_validate_FieldRules | null); - 'ignoreEmpty'?: (boolean); -} - -export interface RepeatedRules__Output { - 'minItems'?: (Long); - 'maxItems'?: (Long); - 'unique'?: (boolean); - 'items'?: (_validate_FieldRules__Output); - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts deleted file mode 100644 index 7c1f4af6..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed32Rules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface SFixed32Rules { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface SFixed32Rules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts deleted file mode 100644 index 368d9df4..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SFixed64Rules.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface SFixed64Rules { - 'const'?: (number | string | Long); - 'lt'?: (number | string | Long); - 'lte'?: (number | string | Long); - 'gt'?: (number | string | Long); - 'gte'?: (number | string | Long); - 'in'?: (number | string | Long)[]; - 'notIn'?: (number | string | Long)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface SFixed64Rules__Output { - 'const'?: (Long); - 'lt'?: (Long); - 'lte'?: (Long); - 'gt'?: (Long); - 'gte'?: (Long); - 'in'?: (Long)[]; - 'notIn'?: (Long)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts deleted file mode 100644 index 7cd2a837..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt32Rules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface SInt32Rules { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface SInt32Rules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts deleted file mode 100644 index 268d5c25..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/SInt64Rules.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface SInt64Rules { - 'const'?: (number | string | Long); - 'lt'?: (number | string | Long); - 'lte'?: (number | string | Long); - 'gt'?: (number | string | Long); - 'gte'?: (number | string | Long); - 'in'?: (number | string | Long)[]; - 'notIn'?: (number | string | Long)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface SInt64Rules__Output { - 'const'?: (Long); - 'lt'?: (Long); - 'lte'?: (Long); - 'gt'?: (Long); - 'gte'?: (Long); - 'in'?: (Long)[]; - 'notIn'?: (Long)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts deleted file mode 100644 index 9856dc0a..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/StringRules.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { KnownRegex as _validate_KnownRegex, KnownRegex__Output as _validate_KnownRegex__Output } from './KnownRegex.js'; -import type { Long } from '@grpc/proto-loader'; - -export interface StringRules { - 'const'?: (string); - 'minLen'?: (number | string | Long); - 'maxLen'?: (number | string | Long); - 'minBytes'?: (number | string | Long); - 'maxBytes'?: (number | string | Long); - 'pattern'?: (string); - 'prefix'?: (string); - 'suffix'?: (string); - 'contains'?: (string); - 'in'?: (string)[]; - 'notIn'?: (string)[]; - 'email'?: (boolean); - 'hostname'?: (boolean); - 'ip'?: (boolean); - 'ipv4'?: (boolean); - 'ipv6'?: (boolean); - 'uri'?: (boolean); - 'uriRef'?: (boolean); - 'len'?: (number | string | Long); - 'lenBytes'?: (number | string | Long); - 'address'?: (boolean); - 'uuid'?: (boolean); - 'notContains'?: (string); - 'wellKnownRegex'?: (_validate_KnownRegex); - 'strict'?: (boolean); - 'ignoreEmpty'?: (boolean); - 'wellKnown'?: "email"|"hostname"|"ip"|"ipv4"|"ipv6"|"uri"|"uriRef"|"address"|"uuid"|"wellKnownRegex"; -} - -export interface StringRules__Output { - 'const'?: (string); - 'minLen'?: (Long); - 'maxLen'?: (Long); - 'minBytes'?: (Long); - 'maxBytes'?: (Long); - 'pattern'?: (string); - 'prefix'?: (string); - 'suffix'?: (string); - 'contains'?: (string); - 'in'?: (string)[]; - 'notIn'?: (string)[]; - 'email'?: (boolean); - 'hostname'?: (boolean); - 'ip'?: (boolean); - 'ipv4'?: (boolean); - 'ipv6'?: (boolean); - 'uri'?: (boolean); - 'uriRef'?: (boolean); - 'len'?: (Long); - 'lenBytes'?: (Long); - 'address'?: (boolean); - 'uuid'?: (boolean); - 'notContains'?: (string); - 'wellKnownRegex'?: (_validate_KnownRegex__Output); - 'strict'?: (boolean); - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts deleted file mode 100644 index 3d405293..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/TimestampRules.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../google/protobuf/Timestamp.js'; -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../google/protobuf/Duration.js'; - -export interface TimestampRules { - 'required'?: (boolean); - 'const'?: (_google_protobuf_Timestamp | null); - 'lt'?: (_google_protobuf_Timestamp | null); - 'lte'?: (_google_protobuf_Timestamp | null); - 'gt'?: (_google_protobuf_Timestamp | null); - 'gte'?: (_google_protobuf_Timestamp | null); - 'ltNow'?: (boolean); - 'gtNow'?: (boolean); - 'within'?: (_google_protobuf_Duration | null); -} - -export interface TimestampRules__Output { - 'required'?: (boolean); - 'const'?: (_google_protobuf_Timestamp__Output); - 'lt'?: (_google_protobuf_Timestamp__Output); - 'lte'?: (_google_protobuf_Timestamp__Output); - 'gt'?: (_google_protobuf_Timestamp__Output); - 'gte'?: (_google_protobuf_Timestamp__Output); - 'ltNow'?: (boolean); - 'gtNow'?: (boolean); - 'within'?: (_google_protobuf_Duration__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts deleted file mode 100644 index e5d8e3be..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt32Rules.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - - -export interface UInt32Rules { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface UInt32Rules__Output { - 'const'?: (number); - 'lt'?: (number); - 'lte'?: (number); - 'gt'?: (number); - 'gte'?: (number); - 'in'?: (number)[]; - 'notIn'?: (number)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts deleted file mode 100644 index 7efbb4b2..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/validate/UInt64Rules.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Original file: ../../../protoc-gen-validate/validate/validate.proto - -import type { Long } from '@grpc/proto-loader'; - -export interface UInt64Rules { - 'const'?: (number | string | Long); - 'lt'?: (number | string | Long); - 'lte'?: (number | string | Long); - 'gt'?: (number | string | Long); - 'gte'?: (number | string | Long); - 'in'?: (number | string | Long)[]; - 'notIn'?: (number | string | Long)[]; - 'ignoreEmpty'?: (boolean); -} - -export interface UInt64Rules__Output { - 'const'?: (Long); - 'lt'?: (Long); - 'lte'?: (Long); - 'gt'?: (Long); - 'gte'?: (Long); - 'in'?: (Long)[]; - 'notIn'?: (Long)[]; - 'ignoreEmpty'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts deleted file mode 100644 index 82eadf86..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FieldStatusAnnotation.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../xds/xds/annotations/v3/status.proto - - -export interface FieldStatusAnnotation { - 'workInProgress'?: (boolean); -} - -export interface FieldStatusAnnotation__Output { - 'workInProgress'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts deleted file mode 100644 index 43cabe9e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/FileStatusAnnotation.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../xds/xds/annotations/v3/status.proto - - -export interface FileStatusAnnotation { - 'workInProgress'?: (boolean); -} - -export interface FileStatusAnnotation__Output { - 'workInProgress'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts deleted file mode 100644 index 3eff2788..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/MessageStatusAnnotation.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../xds/xds/annotations/v3/status.proto - - -export interface MessageStatusAnnotation { - 'workInProgress'?: (boolean); -} - -export interface MessageStatusAnnotation__Output { - 'workInProgress'?: (boolean); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts deleted file mode 100644 index ede75c75..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/PackageVersionStatus.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Original file: ../../../xds/xds/annotations/v3/status.proto - -export const PackageVersionStatus = { - UNKNOWN: 0, - FROZEN: 1, - ACTIVE: 2, - NEXT_MAJOR_VERSION_CANDIDATE: 3, -} as const; - -export type PackageVersionStatus = - | 'UNKNOWN' - | 0 - | 'FROZEN' - | 1 - | 'ACTIVE' - | 2 - | 'NEXT_MAJOR_VERSION_CANDIDATE' - | 3 - -export type PackageVersionStatus__Output = typeof PackageVersionStatus[keyof typeof PackageVersionStatus] diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts deleted file mode 100644 index c370824a..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/annotations/v3/StatusAnnotation.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Original file: ../../../xds/xds/annotations/v3/status.proto - -import type { PackageVersionStatus as _xds_annotations_v3_PackageVersionStatus, PackageVersionStatus__Output as _xds_annotations_v3_PackageVersionStatus__Output } from './PackageVersionStatus.js'; - -export interface StatusAnnotation { - 'workInProgress'?: (boolean); - 'packageVersionStatus'?: (_xds_annotations_v3_PackageVersionStatus); -} - -export interface StatusAnnotation__Output { - 'workInProgress'?: (boolean); - 'packageVersionStatus'?: (_xds_annotations_v3_PackageVersionStatus__Output); -} diff --git a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts b/packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts deleted file mode 100644 index a8bbbf67..00000000 --- a/packages/@apphosting/adapter-nextjs/src/generated-types/xds/core/v3/ContextParams.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Original file: ../../../udpa/xds/core/v3/context_params.proto - - -export interface ContextParams { - 'params'?: ({[key: string]: string}); -} - -export interface ContextParams__Output { - 'params'?: ({[key: string]: string}); -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts deleted file mode 100644 index 3eecf267..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/annotations/deprecation.proto - -/* eslint-disable */ - -export const protobufPackage = "envoy.annotations"; diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts new file mode 100644 index 00000000..fea40271 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts @@ -0,0 +1,24 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file envoy/annotations/deprecation.proto (package envoy.annotations, syntax proto3) +/* eslint-disable */ + +import type { GenExtension, GenFile } from "@bufbuild/protobuf/codegenv2"; +import { extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; +import type { FieldOptions } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; + +/** + * Describes the file envoy/annotations/deprecation.proto. + */ +export const file_envoy_annotations_deprecation: GenFile = /*@__PURE__*/ + fileDesc("CiNlbnZveS9hbm5vdGF0aW9ucy9kZXByZWNhdGlvbi5wcm90bxIRZW52b3kuYW5ub3RhdGlvbnM6XwobZGVwcmVjYXRlZF9hdF9taW5vcl92ZXJzaW9uEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxjy6IBLIAEoCVIYZGVwcmVjYXRlZEF0TWlub3JWZXJzaW9uQjpaOGdpdGh1Yi5jb20vZW52b3lwcm94eS9nby1jb250cm9sLXBsYW5lL2Vudm95L2Fubm90YXRpb25zYgZwcm90bzM", [file_google_protobuf_descriptor]); + +/** + * The API major and minor version on which the field was deprecated + * (e.g., "3.5" for major version 3 and minor version 5). + * + * @generated from extension: string deprecated_at_minor_version = 157299826; + */ +export const deprecated_at_minor_version: GenExtension = /*@__PURE__*/ + extDesc(file_envoy_annotations_deprecation, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts deleted file mode 100644 index 2cfd89f3..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/address.ts +++ /dev/null @@ -1,1099 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/config/core/v3/address.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { BoolValue, UInt32Value } from "../../../../google/protobuf/wrappers.js"; -import { TypedExtensionConfig } from "./extension.js"; -import { SocketOption, SocketOptionsOverride } from "./socket_option.js"; - -export const protobufPackage = "envoy.config.core.v3"; - -export interface Pipe { - /** - * Unix Domain Socket path. On Linux, paths starting with '@' will use the - * abstract namespace. The starting '@' is replaced by a null byte by Envoy. - * Paths starting with '@' will result in an error in environments other than - * Linux. - */ - path: string; - /** The mode for the Pipe. Not applicable for abstract sockets. */ - mode: number; -} - -/** - * The address represents an envoy internal listener. - * [#comment: TODO(asraa): When address available, remove workaround from test/server/server_fuzz_test.cc:30.] - */ -export interface EnvoyInternalAddress { - /** - * Specifies the :ref:`name ` of the - * internal listener. - */ - serverListenerName?: - | string - | undefined; - /** - * Specifies an endpoint identifier to distinguish between multiple endpoints for the same internal listener in a - * single upstream pool. Only used in the upstream addresses for tracking changes to individual endpoints. This, for - * example, may be set to the final destination IP for the target internal listener. - */ - endpointId: string; -} - -/** [#next-free-field: 8] */ -export interface SocketAddress { - protocol: SocketAddress_Protocol; - /** - * The address for this socket. :ref:`Listeners ` will bind - * to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` - * to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: - * It is possible to distinguish a Listener address via the prefix/suffix matching - * in :ref:`FilterChainMatch `.] When used - * within an upstream :ref:`BindConfig `, the address - * controls the source address of outbound connections. For :ref:`clusters - * `, the cluster type determines whether the - * address must be an IP (``STATIC`` or ``EDS`` clusters) or a hostname resolved by DNS - * (``STRICT_DNS`` or ``LOGICAL_DNS`` clusters). Address resolution can be customized - * via :ref:`resolver_name `. - */ - address: string; - portValue?: - | number - | undefined; - /** - * This is only valid if :ref:`resolver_name - * ` is specified below and the - * named resolver is capable of named port resolution. - */ - namedPort?: - | string - | undefined; - /** - * The name of the custom resolver. This must have been registered with Envoy. If - * this is empty, a context dependent default applies. If the address is a concrete - * IP address, no resolution will occur. If address is a hostname this - * should be set for resolution other than DNS. Specifying a custom resolver with - * ``STRICT_DNS`` or ``LOGICAL_DNS`` will generate an error at runtime. - */ - resolverName: string; - /** - * When binding to an IPv6 address above, this enables `IPv4 compatibility - * `_. Binding to ``::`` will - * allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into - * IPv6 space as ``::FFFF:``. - */ - ipv4Compat: boolean; - /** - * Filepath that specifies the Linux network namespace this socket will be created in (see ``man 7 - * network_namespaces``). If this field is set, Envoy will create the socket in the specified - * network namespace. - * - * .. note:: - * Setting this parameter requires Envoy to run with the ``CAP_NET_ADMIN`` capability. - * - * .. attention:: - * Network namespaces are only configurable on Linux. Otherwise, this field has no effect. - */ - networkNamespaceFilepath: string; -} - -export enum SocketAddress_Protocol { - TCP = 0, - UDP = 1, - UNRECOGNIZED = -1, -} - -export function socketAddress_ProtocolFromJSON(object: any): SocketAddress_Protocol { - switch (object) { - case 0: - case "TCP": - return SocketAddress_Protocol.TCP; - case 1: - case "UDP": - return SocketAddress_Protocol.UDP; - case -1: - case "UNRECOGNIZED": - default: - return SocketAddress_Protocol.UNRECOGNIZED; - } -} - -export function socketAddress_ProtocolToJSON(object: SocketAddress_Protocol): string { - switch (object) { - case SocketAddress_Protocol.TCP: - return "TCP"; - case SocketAddress_Protocol.UDP: - return "UDP"; - case SocketAddress_Protocol.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface TcpKeepalive { - /** - * Maximum number of keepalive probes to send without response before deciding - * the connection is dead. Default is to use the OS level configuration (unless - * overridden, Linux defaults to 9.) - */ - keepaliveProbes: - | number - | undefined; - /** - * The number of seconds a connection needs to be idle before keep-alive probes - * start being sent. Default is to use the OS level configuration (unless - * overridden, Linux defaults to 7200s (i.e., 2 hours.) - */ - keepaliveTime: - | number - | undefined; - /** - * The number of seconds between keep-alive probes. Default is to use the OS - * level configuration (unless overridden, Linux defaults to 75s.) - */ - keepaliveInterval: number | undefined; -} - -export interface ExtraSourceAddress { - /** The additional address to bind. */ - address: - | SocketAddress - | undefined; - /** - * Additional socket options that may not be present in Envoy source code or - * precompiled binaries. If specified, this will override the - * :ref:`socket_options ` - * in the BindConfig. If specified with no - * :ref:`socket_options ` - * or an empty list of :ref:`socket_options `, - * it means no socket option will apply. - */ - socketOptions: SocketOptionsOverride | undefined; -} - -/** [#next-free-field: 7] */ -export interface BindConfig { - /** The address to bind to when creating a socket. */ - sourceAddress: - | SocketAddress - | undefined; - /** - * Whether to set the ``IP_FREEBIND`` option when creating the socket. When this - * flag is set to true, allows the :ref:`source_address - * ` to be an IP address - * that is not configured on the system running Envoy. When this flag is set - * to false, the option ``IP_FREEBIND`` is disabled on the socket. When this - * flag is not set (default), the socket is not modified, i.e. the option is - * neither enabled nor disabled. - */ - freebind: - | boolean - | undefined; - /** - * Additional socket options that may not be present in Envoy source code or - * precompiled binaries. - */ - socketOptions: SocketOption[]; - /** - * Extra source addresses appended to the address specified in the ``source_address`` - * field. This enables to specify multiple source addresses. - * The source address selection is determined by :ref:`local_address_selector - * `. - */ - extraSourceAddresses: ExtraSourceAddress[]; - /** - * Deprecated by - * :ref:`extra_source_addresses ` - * - * @deprecated - */ - additionalSourceAddresses: SocketAddress[]; - /** - * Custom local address selector to override the default (i.e. - * :ref:`DefaultLocalAddressSelector - * `). - * [#extension-category: envoy.upstream.local_address_selector] - */ - localAddressSelector: TypedExtensionConfig | undefined; -} - -/** - * Addresses specify either a logical or physical address and port, which are - * used to tell Envoy where to bind/listen, connect to upstream and find - * management servers. - */ -export interface Address { - socketAddress?: SocketAddress | undefined; - pipe?: - | Pipe - | undefined; - /** - * Specifies a user-space address handled by :ref:`internal listeners - * `. - */ - envoyInternalAddress?: EnvoyInternalAddress | undefined; -} - -/** - * CidrRange specifies an IP Address and a prefix length to construct - * the subnet mask for a `CIDR `_ range. - */ -export interface CidrRange { - /** IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``. */ - addressPrefix: string; - /** Length of prefix, e.g. 0, 32. Defaults to 0 when unset. */ - prefixLen: number | undefined; -} - -function createBasePipe(): Pipe { - return { path: "", mode: 0 }; -} - -export const Pipe: MessageFns = { - encode(message: Pipe, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.path !== "") { - writer.uint32(10).string(message.path); - } - if (message.mode !== 0) { - writer.uint32(16).uint32(message.mode); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Pipe { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePipe(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.path = reader.string(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.mode = reader.uint32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Pipe { - return { - path: isSet(object.path) ? globalThis.String(object.path) : "", - mode: isSet(object.mode) ? globalThis.Number(object.mode) : 0, - }; - }, - - toJSON(message: Pipe): unknown { - const obj: any = {}; - if (message.path !== "") { - obj.path = message.path; - } - if (message.mode !== 0) { - obj.mode = Math.round(message.mode); - } - return obj; - }, - - create, I>>(base?: I): Pipe { - return Pipe.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Pipe { - const message = createBasePipe(); - message.path = object.path ?? ""; - message.mode = object.mode ?? 0; - return message; - }, -}; - -function createBaseEnvoyInternalAddress(): EnvoyInternalAddress { - return { serverListenerName: undefined, endpointId: "" }; -} - -export const EnvoyInternalAddress: MessageFns = { - encode(message: EnvoyInternalAddress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.serverListenerName !== undefined) { - writer.uint32(10).string(message.serverListenerName); - } - if (message.endpointId !== "") { - writer.uint32(18).string(message.endpointId); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnvoyInternalAddress { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnvoyInternalAddress(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.serverListenerName = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.endpointId = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnvoyInternalAddress { - return { - serverListenerName: isSet(object.serverListenerName) ? globalThis.String(object.serverListenerName) : undefined, - endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", - }; - }, - - toJSON(message: EnvoyInternalAddress): unknown { - const obj: any = {}; - if (message.serverListenerName !== undefined) { - obj.serverListenerName = message.serverListenerName; - } - if (message.endpointId !== "") { - obj.endpointId = message.endpointId; - } - return obj; - }, - - create, I>>(base?: I): EnvoyInternalAddress { - return EnvoyInternalAddress.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): EnvoyInternalAddress { - const message = createBaseEnvoyInternalAddress(); - message.serverListenerName = object.serverListenerName ?? undefined; - message.endpointId = object.endpointId ?? ""; - return message; - }, -}; - -function createBaseSocketAddress(): SocketAddress { - return { - protocol: 0, - address: "", - portValue: undefined, - namedPort: undefined, - resolverName: "", - ipv4Compat: false, - networkNamespaceFilepath: "", - }; -} - -export const SocketAddress: MessageFns = { - encode(message: SocketAddress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.protocol !== 0) { - writer.uint32(8).int32(message.protocol); - } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } - if (message.portValue !== undefined) { - writer.uint32(24).uint32(message.portValue); - } - if (message.namedPort !== undefined) { - writer.uint32(34).string(message.namedPort); - } - if (message.resolverName !== "") { - writer.uint32(42).string(message.resolverName); - } - if (message.ipv4Compat !== false) { - writer.uint32(48).bool(message.ipv4Compat); - } - if (message.networkNamespaceFilepath !== "") { - writer.uint32(58).string(message.networkNamespaceFilepath); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SocketAddress { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSocketAddress(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.protocol = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.address = reader.string(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.portValue = reader.uint32(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.namedPort = reader.string(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.resolverName = reader.string(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.ipv4Compat = reader.bool(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.networkNamespaceFilepath = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SocketAddress { - return { - protocol: isSet(object.protocol) ? socketAddress_ProtocolFromJSON(object.protocol) : 0, - address: isSet(object.address) ? globalThis.String(object.address) : "", - portValue: isSet(object.portValue) ? globalThis.Number(object.portValue) : undefined, - namedPort: isSet(object.namedPort) ? globalThis.String(object.namedPort) : undefined, - resolverName: isSet(object.resolverName) ? globalThis.String(object.resolverName) : "", - ipv4Compat: isSet(object.ipv4Compat) ? globalThis.Boolean(object.ipv4Compat) : false, - networkNamespaceFilepath: isSet(object.networkNamespaceFilepath) - ? globalThis.String(object.networkNamespaceFilepath) - : "", - }; - }, - - toJSON(message: SocketAddress): unknown { - const obj: any = {}; - if (message.protocol !== 0) { - obj.protocol = socketAddress_ProtocolToJSON(message.protocol); - } - if (message.address !== "") { - obj.address = message.address; - } - if (message.portValue !== undefined) { - obj.portValue = Math.round(message.portValue); - } - if (message.namedPort !== undefined) { - obj.namedPort = message.namedPort; - } - if (message.resolverName !== "") { - obj.resolverName = message.resolverName; - } - if (message.ipv4Compat !== false) { - obj.ipv4Compat = message.ipv4Compat; - } - if (message.networkNamespaceFilepath !== "") { - obj.networkNamespaceFilepath = message.networkNamespaceFilepath; - } - return obj; - }, - - create, I>>(base?: I): SocketAddress { - return SocketAddress.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SocketAddress { - const message = createBaseSocketAddress(); - message.protocol = object.protocol ?? 0; - message.address = object.address ?? ""; - message.portValue = object.portValue ?? undefined; - message.namedPort = object.namedPort ?? undefined; - message.resolverName = object.resolverName ?? ""; - message.ipv4Compat = object.ipv4Compat ?? false; - message.networkNamespaceFilepath = object.networkNamespaceFilepath ?? ""; - return message; - }, -}; - -function createBaseTcpKeepalive(): TcpKeepalive { - return { keepaliveProbes: undefined, keepaliveTime: undefined, keepaliveInterval: undefined }; -} - -export const TcpKeepalive: MessageFns = { - encode(message: TcpKeepalive, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.keepaliveProbes !== undefined) { - UInt32Value.encode({ value: message.keepaliveProbes! }, writer.uint32(10).fork()).join(); - } - if (message.keepaliveTime !== undefined) { - UInt32Value.encode({ value: message.keepaliveTime! }, writer.uint32(18).fork()).join(); - } - if (message.keepaliveInterval !== undefined) { - UInt32Value.encode({ value: message.keepaliveInterval! }, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): TcpKeepalive { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTcpKeepalive(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.keepaliveProbes = UInt32Value.decode(reader, reader.uint32()).value; - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.keepaliveTime = UInt32Value.decode(reader, reader.uint32()).value; - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.keepaliveInterval = UInt32Value.decode(reader, reader.uint32()).value; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): TcpKeepalive { - return { - keepaliveProbes: isSet(object.keepaliveProbes) ? Number(object.keepaliveProbes) : undefined, - keepaliveTime: isSet(object.keepaliveTime) ? Number(object.keepaliveTime) : undefined, - keepaliveInterval: isSet(object.keepaliveInterval) ? Number(object.keepaliveInterval) : undefined, - }; - }, - - toJSON(message: TcpKeepalive): unknown { - const obj: any = {}; - if (message.keepaliveProbes !== undefined) { - obj.keepaliveProbes = message.keepaliveProbes; - } - if (message.keepaliveTime !== undefined) { - obj.keepaliveTime = message.keepaliveTime; - } - if (message.keepaliveInterval !== undefined) { - obj.keepaliveInterval = message.keepaliveInterval; - } - return obj; - }, - - create, I>>(base?: I): TcpKeepalive { - return TcpKeepalive.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): TcpKeepalive { - const message = createBaseTcpKeepalive(); - message.keepaliveProbes = object.keepaliveProbes ?? undefined; - message.keepaliveTime = object.keepaliveTime ?? undefined; - message.keepaliveInterval = object.keepaliveInterval ?? undefined; - return message; - }, -}; - -function createBaseExtraSourceAddress(): ExtraSourceAddress { - return { address: undefined, socketOptions: undefined }; -} - -export const ExtraSourceAddress: MessageFns = { - encode(message: ExtraSourceAddress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.address !== undefined) { - SocketAddress.encode(message.address, writer.uint32(10).fork()).join(); - } - if (message.socketOptions !== undefined) { - SocketOptionsOverride.encode(message.socketOptions, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ExtraSourceAddress { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtraSourceAddress(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.address = SocketAddress.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.socketOptions = SocketOptionsOverride.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ExtraSourceAddress { - return { - address: isSet(object.address) ? SocketAddress.fromJSON(object.address) : undefined, - socketOptions: isSet(object.socketOptions) ? SocketOptionsOverride.fromJSON(object.socketOptions) : undefined, - }; - }, - - toJSON(message: ExtraSourceAddress): unknown { - const obj: any = {}; - if (message.address !== undefined) { - obj.address = SocketAddress.toJSON(message.address); - } - if (message.socketOptions !== undefined) { - obj.socketOptions = SocketOptionsOverride.toJSON(message.socketOptions); - } - return obj; - }, - - create, I>>(base?: I): ExtraSourceAddress { - return ExtraSourceAddress.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ExtraSourceAddress { - const message = createBaseExtraSourceAddress(); - message.address = (object.address !== undefined && object.address !== null) - ? SocketAddress.fromPartial(object.address) - : undefined; - message.socketOptions = (object.socketOptions !== undefined && object.socketOptions !== null) - ? SocketOptionsOverride.fromPartial(object.socketOptions) - : undefined; - return message; - }, -}; - -function createBaseBindConfig(): BindConfig { - return { - sourceAddress: undefined, - freebind: undefined, - socketOptions: [], - extraSourceAddresses: [], - additionalSourceAddresses: [], - localAddressSelector: undefined, - }; -} - -export const BindConfig: MessageFns = { - encode(message: BindConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.sourceAddress !== undefined) { - SocketAddress.encode(message.sourceAddress, writer.uint32(10).fork()).join(); - } - if (message.freebind !== undefined) { - BoolValue.encode({ value: message.freebind! }, writer.uint32(18).fork()).join(); - } - for (const v of message.socketOptions) { - SocketOption.encode(v!, writer.uint32(26).fork()).join(); - } - for (const v of message.extraSourceAddresses) { - ExtraSourceAddress.encode(v!, writer.uint32(42).fork()).join(); - } - for (const v of message.additionalSourceAddresses) { - SocketAddress.encode(v!, writer.uint32(34).fork()).join(); - } - if (message.localAddressSelector !== undefined) { - TypedExtensionConfig.encode(message.localAddressSelector, writer.uint32(50).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BindConfig { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBindConfig(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.sourceAddress = SocketAddress.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.freebind = BoolValue.decode(reader, reader.uint32()).value; - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.socketOptions.push(SocketOption.decode(reader, reader.uint32())); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.extraSourceAddresses.push(ExtraSourceAddress.decode(reader, reader.uint32())); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.additionalSourceAddresses.push(SocketAddress.decode(reader, reader.uint32())); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.localAddressSelector = TypedExtensionConfig.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BindConfig { - return { - sourceAddress: isSet(object.sourceAddress) ? SocketAddress.fromJSON(object.sourceAddress) : undefined, - freebind: isSet(object.freebind) ? Boolean(object.freebind) : undefined, - socketOptions: globalThis.Array.isArray(object?.socketOptions) - ? object.socketOptions.map((e: any) => SocketOption.fromJSON(e)) - : [], - extraSourceAddresses: globalThis.Array.isArray(object?.extraSourceAddresses) - ? object.extraSourceAddresses.map((e: any) => ExtraSourceAddress.fromJSON(e)) - : [], - additionalSourceAddresses: globalThis.Array.isArray(object?.additionalSourceAddresses) - ? object.additionalSourceAddresses.map((e: any) => SocketAddress.fromJSON(e)) - : [], - localAddressSelector: isSet(object.localAddressSelector) - ? TypedExtensionConfig.fromJSON(object.localAddressSelector) - : undefined, - }; - }, - - toJSON(message: BindConfig): unknown { - const obj: any = {}; - if (message.sourceAddress !== undefined) { - obj.sourceAddress = SocketAddress.toJSON(message.sourceAddress); - } - if (message.freebind !== undefined) { - obj.freebind = message.freebind; - } - if (message.socketOptions?.length) { - obj.socketOptions = message.socketOptions.map((e) => SocketOption.toJSON(e)); - } - if (message.extraSourceAddresses?.length) { - obj.extraSourceAddresses = message.extraSourceAddresses.map((e) => ExtraSourceAddress.toJSON(e)); - } - if (message.additionalSourceAddresses?.length) { - obj.additionalSourceAddresses = message.additionalSourceAddresses.map((e) => SocketAddress.toJSON(e)); - } - if (message.localAddressSelector !== undefined) { - obj.localAddressSelector = TypedExtensionConfig.toJSON(message.localAddressSelector); - } - return obj; - }, - - create, I>>(base?: I): BindConfig { - return BindConfig.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BindConfig { - const message = createBaseBindConfig(); - message.sourceAddress = (object.sourceAddress !== undefined && object.sourceAddress !== null) - ? SocketAddress.fromPartial(object.sourceAddress) - : undefined; - message.freebind = object.freebind ?? undefined; - message.socketOptions = object.socketOptions?.map((e) => SocketOption.fromPartial(e)) || []; - message.extraSourceAddresses = object.extraSourceAddresses?.map((e) => ExtraSourceAddress.fromPartial(e)) || []; - message.additionalSourceAddresses = object.additionalSourceAddresses?.map((e) => SocketAddress.fromPartial(e)) || - []; - message.localAddressSelector = (object.localAddressSelector !== undefined && object.localAddressSelector !== null) - ? TypedExtensionConfig.fromPartial(object.localAddressSelector) - : undefined; - return message; - }, -}; - -function createBaseAddress(): Address { - return { socketAddress: undefined, pipe: undefined, envoyInternalAddress: undefined }; -} - -export const Address: MessageFns
= { - encode(message: Address, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.socketAddress !== undefined) { - SocketAddress.encode(message.socketAddress, writer.uint32(10).fork()).join(); - } - if (message.pipe !== undefined) { - Pipe.encode(message.pipe, writer.uint32(18).fork()).join(); - } - if (message.envoyInternalAddress !== undefined) { - EnvoyInternalAddress.encode(message.envoyInternalAddress, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Address { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAddress(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.socketAddress = SocketAddress.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.pipe = Pipe.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.envoyInternalAddress = EnvoyInternalAddress.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Address { - return { - socketAddress: isSet(object.socketAddress) ? SocketAddress.fromJSON(object.socketAddress) : undefined, - pipe: isSet(object.pipe) ? Pipe.fromJSON(object.pipe) : undefined, - envoyInternalAddress: isSet(object.envoyInternalAddress) - ? EnvoyInternalAddress.fromJSON(object.envoyInternalAddress) - : undefined, - }; - }, - - toJSON(message: Address): unknown { - const obj: any = {}; - if (message.socketAddress !== undefined) { - obj.socketAddress = SocketAddress.toJSON(message.socketAddress); - } - if (message.pipe !== undefined) { - obj.pipe = Pipe.toJSON(message.pipe); - } - if (message.envoyInternalAddress !== undefined) { - obj.envoyInternalAddress = EnvoyInternalAddress.toJSON(message.envoyInternalAddress); - } - return obj; - }, - - create, I>>(base?: I): Address { - return Address.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Address { - const message = createBaseAddress(); - message.socketAddress = (object.socketAddress !== undefined && object.socketAddress !== null) - ? SocketAddress.fromPartial(object.socketAddress) - : undefined; - message.pipe = (object.pipe !== undefined && object.pipe !== null) ? Pipe.fromPartial(object.pipe) : undefined; - message.envoyInternalAddress = (object.envoyInternalAddress !== undefined && object.envoyInternalAddress !== null) - ? EnvoyInternalAddress.fromPartial(object.envoyInternalAddress) - : undefined; - return message; - }, -}; - -function createBaseCidrRange(): CidrRange { - return { addressPrefix: "", prefixLen: undefined }; -} - -export const CidrRange: MessageFns = { - encode(message: CidrRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.addressPrefix !== "") { - writer.uint32(10).string(message.addressPrefix); - } - if (message.prefixLen !== undefined) { - UInt32Value.encode({ value: message.prefixLen! }, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): CidrRange { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCidrRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.addressPrefix = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.prefixLen = UInt32Value.decode(reader, reader.uint32()).value; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): CidrRange { - return { - addressPrefix: isSet(object.addressPrefix) ? globalThis.String(object.addressPrefix) : "", - prefixLen: isSet(object.prefixLen) ? Number(object.prefixLen) : undefined, - }; - }, - - toJSON(message: CidrRange): unknown { - const obj: any = {}; - if (message.addressPrefix !== "") { - obj.addressPrefix = message.addressPrefix; - } - if (message.prefixLen !== undefined) { - obj.prefixLen = message.prefixLen; - } - return obj; - }, - - create, I>>(base?: I): CidrRange { - return CidrRange.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): CidrRange { - const message = createBaseCidrRange(); - message.addressPrefix = object.addressPrefix ?? ""; - message.prefixLen = object.prefixLen ?? undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts deleted file mode 100644 index 01a2592d..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/backoff.ts +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/config/core/v3/backoff.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { Duration } from "../../../../google/protobuf/duration.js"; - -export const protobufPackage = "envoy.config.core.v3"; - -/** Configuration defining a jittered exponential back off strategy. */ -export interface BackoffStrategy { - /** - * The base interval to be used for the next back off computation. It should - * be greater than zero and less than or equal to :ref:`max_interval - * `. - */ - baseInterval: - | Duration - | undefined; - /** - * Specifies the maximum interval between retries. This parameter is optional, - * but must be greater than or equal to the :ref:`base_interval - * ` if set. The default - * is 10 times the :ref:`base_interval - * `. - */ - maxInterval: Duration | undefined; -} - -function createBaseBackoffStrategy(): BackoffStrategy { - return { baseInterval: undefined, maxInterval: undefined }; -} - -export const BackoffStrategy: MessageFns = { - encode(message: BackoffStrategy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.baseInterval !== undefined) { - Duration.encode(message.baseInterval, writer.uint32(10).fork()).join(); - } - if (message.maxInterval !== undefined) { - Duration.encode(message.maxInterval, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BackoffStrategy { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBackoffStrategy(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.baseInterval = Duration.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.maxInterval = Duration.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BackoffStrategy { - return { - baseInterval: isSet(object.baseInterval) ? Duration.fromJSON(object.baseInterval) : undefined, - maxInterval: isSet(object.maxInterval) ? Duration.fromJSON(object.maxInterval) : undefined, - }; - }, - - toJSON(message: BackoffStrategy): unknown { - const obj: any = {}; - if (message.baseInterval !== undefined) { - obj.baseInterval = Duration.toJSON(message.baseInterval); - } - if (message.maxInterval !== undefined) { - obj.maxInterval = Duration.toJSON(message.maxInterval); - } - return obj; - }, - - create, I>>(base?: I): BackoffStrategy { - return BackoffStrategy.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BackoffStrategy { - const message = createBaseBackoffStrategy(); - message.baseInterval = (object.baseInterval !== undefined && object.baseInterval !== null) - ? Duration.fromPartial(object.baseInterval) - : undefined; - message.maxInterval = (object.maxInterval !== undefined && object.maxInterval !== null) - ? Duration.fromPartial(object.maxInterval) - : undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts deleted file mode 100644 index 523a7fac..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base.ts +++ /dev/null @@ -1,3749 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/config/core/v3/base.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { Any } from "../../../../google/protobuf/any.js"; -import { Struct, Value } from "../../../../google/protobuf/struct.js"; -import { BoolValue, UInt32Value } from "../../../../google/protobuf/wrappers.js"; -import { ContextParams } from "../../../../xds/core/v3/context_params.js"; -import { FractionalPercent, Percent } from "../../../type/v3/percent.js"; -import { SemanticVersion } from "../../../type/v3/semantic_version.js"; -import { Address } from "./address.js"; -import { BackoffStrategy } from "./backoff.js"; -import { HttpUri } from "./http_uri.js"; - -export const protobufPackage = "envoy.config.core.v3"; - -/** - * Envoy supports :ref:`upstream priority routing - * ` both at the route and the virtual - * cluster level. The current priority implementation uses different connection - * pool and circuit breaking settings for each priority level. This means that - * even for HTTP/2 requests, two physical connections will be used to an - * upstream host. In the future Envoy will likely support true HTTP/2 priority - * over a single upstream connection. - */ -export enum RoutingPriority { - DEFAULT = 0, - HIGH = 1, - UNRECOGNIZED = -1, -} - -export function routingPriorityFromJSON(object: any): RoutingPriority { - switch (object) { - case 0: - case "DEFAULT": - return RoutingPriority.DEFAULT; - case 1: - case "HIGH": - return RoutingPriority.HIGH; - case -1: - case "UNRECOGNIZED": - default: - return RoutingPriority.UNRECOGNIZED; - } -} - -export function routingPriorityToJSON(object: RoutingPriority): string { - switch (object) { - case RoutingPriority.DEFAULT: - return "DEFAULT"; - case RoutingPriority.HIGH: - return "HIGH"; - case RoutingPriority.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** HTTP request method. */ -export enum RequestMethod { - METHOD_UNSPECIFIED = 0, - GET = 1, - HEAD = 2, - POST = 3, - PUT = 4, - DELETE = 5, - CONNECT = 6, - OPTIONS = 7, - TRACE = 8, - PATCH = 9, - UNRECOGNIZED = -1, -} - -export function requestMethodFromJSON(object: any): RequestMethod { - switch (object) { - case 0: - case "METHOD_UNSPECIFIED": - return RequestMethod.METHOD_UNSPECIFIED; - case 1: - case "GET": - return RequestMethod.GET; - case 2: - case "HEAD": - return RequestMethod.HEAD; - case 3: - case "POST": - return RequestMethod.POST; - case 4: - case "PUT": - return RequestMethod.PUT; - case 5: - case "DELETE": - return RequestMethod.DELETE; - case 6: - case "CONNECT": - return RequestMethod.CONNECT; - case 7: - case "OPTIONS": - return RequestMethod.OPTIONS; - case 8: - case "TRACE": - return RequestMethod.TRACE; - case 9: - case "PATCH": - return RequestMethod.PATCH; - case -1: - case "UNRECOGNIZED": - default: - return RequestMethod.UNRECOGNIZED; - } -} - -export function requestMethodToJSON(object: RequestMethod): string { - switch (object) { - case RequestMethod.METHOD_UNSPECIFIED: - return "METHOD_UNSPECIFIED"; - case RequestMethod.GET: - return "GET"; - case RequestMethod.HEAD: - return "HEAD"; - case RequestMethod.POST: - return "POST"; - case RequestMethod.PUT: - return "PUT"; - case RequestMethod.DELETE: - return "DELETE"; - case RequestMethod.CONNECT: - return "CONNECT"; - case RequestMethod.OPTIONS: - return "OPTIONS"; - case RequestMethod.TRACE: - return "TRACE"; - case RequestMethod.PATCH: - return "PATCH"; - case RequestMethod.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** Identifies the direction of the traffic relative to the local Envoy. */ -export enum TrafficDirection { - /** UNSPECIFIED - Default option is unspecified. */ - UNSPECIFIED = 0, - /** INBOUND - The transport is used for incoming traffic. */ - INBOUND = 1, - /** OUTBOUND - The transport is used for outgoing traffic. */ - OUTBOUND = 2, - UNRECOGNIZED = -1, -} - -export function trafficDirectionFromJSON(object: any): TrafficDirection { - switch (object) { - case 0: - case "UNSPECIFIED": - return TrafficDirection.UNSPECIFIED; - case 1: - case "INBOUND": - return TrafficDirection.INBOUND; - case 2: - case "OUTBOUND": - return TrafficDirection.OUTBOUND; - case -1: - case "UNRECOGNIZED": - default: - return TrafficDirection.UNRECOGNIZED; - } -} - -export function trafficDirectionToJSON(object: TrafficDirection): string { - switch (object) { - case TrafficDirection.UNSPECIFIED: - return "UNSPECIFIED"; - case TrafficDirection.INBOUND: - return "INBOUND"; - case TrafficDirection.OUTBOUND: - return "OUTBOUND"; - case TrafficDirection.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** Identifies location of where either Envoy runs or where upstream hosts run. */ -export interface Locality { - /** Region this :ref:`zone ` belongs to. */ - region: string; - /** - * Defines the local service zone where Envoy is running. Though optional, it - * should be set if discovery service routing is used and the discovery - * service exposes :ref:`zone data `, - * either in this message or via :option:`--service-zone`. The meaning of zone - * is context dependent, e.g. `Availability Zone (AZ) - * `_ - * on AWS, `Zone `_ on - * GCP, etc. - */ - zone: string; - /** - * When used for locality of upstream hosts, this field further splits zone - * into smaller chunks of sub-zones so they can be load balanced - * independently. - */ - subZone: string; -} - -/** - * BuildVersion combines SemVer version of extension with free-form build information - * (i.e. 'alpha', 'private-build') as a set of strings. - */ -export interface BuildVersion { - /** SemVer version of extension. */ - version: - | SemanticVersion - | undefined; - /** - * Free-form build information. - * Envoy defines several well known keys in the source/common/version/version.h file - */ - metadata: { [key: string]: any } | undefined; -} - -/** - * Version and identification for an Envoy extension. - * [#next-free-field: 7] - */ -export interface Extension { - /** - * This is the name of the Envoy filter as specified in the Envoy - * configuration, e.g. envoy.filters.http.router, com.acme.widget. - */ - name: string; - /** - * Category of the extension. - * Extension category names use reverse DNS notation. For instance "envoy.filters.listener" - * for Envoy's built-in listener filters or "com.acme.filters.http" for HTTP filters from - * acme.com vendor. - * [#comment:TODO(yanavlasov): Link to the doc with existing envoy category names.] - */ - category: string; - /** - * [#not-implemented-hide:] Type descriptor of extension configuration proto. - * [#comment:TODO(yanavlasov): Link to the doc with existing configuration protos.] - * [#comment:TODO(yanavlasov): Add tests when PR #9391 lands.] - * - * @deprecated - */ - typeDescriptor: string; - /** - * The version is a property of the extension and maintained independently - * of other extensions and the Envoy API. - * This field is not set when extension did not provide version information. - */ - version: - | BuildVersion - | undefined; - /** Indicates that the extension is present but was disabled via dynamic configuration. */ - disabled: boolean; - /** Type URLs of extension configuration protos. */ - typeUrls: string[]; -} - -/** - * Identifies a specific Envoy instance. The node identifier is presented to the - * management server, which may use this identifier to distinguish per Envoy - * configuration for serving. - * [#next-free-field: 13] - */ -export interface Node { - /** - * An opaque node identifier for the Envoy node. This also provides the local - * service node name. It should be set if any of the following features are - * used: :ref:`statsd `, :ref:`CDS - * `, and :ref:`HTTP tracing - * `, either in this message or via - * :option:`--service-node`. - */ - id: string; - /** - * Defines the local service cluster name where Envoy is running. Though - * optional, it should be set if any of the following features are used: - * :ref:`statsd `, :ref:`health check cluster - * verification - * `, - * :ref:`runtime override directory `, - * :ref:`user agent addition - * `, - * :ref:`HTTP global rate limiting `, - * :ref:`CDS `, and :ref:`HTTP tracing - * `, either in this message or via - * :option:`--service-cluster`. - */ - cluster: string; - /** - * Opaque metadata extending the node identifier. Envoy will pass this - * directly to the management server. - */ - metadata: - | { [key: string]: any } - | undefined; - /** - * Map from xDS resource type URL to dynamic context parameters. These may vary at runtime (unlike - * other fields in this message). For example, the xDS client may have a shard identifier that - * changes during the lifetime of the xDS client. In Envoy, this would be achieved by updating the - * dynamic context on the Server::Instance's LocalInfo context provider. The shard ID dynamic - * parameter then appears in this field during future discovery requests. - */ - dynamicParameters: { [key: string]: ContextParams }; - /** Locality specifying where the Envoy instance is running. */ - locality: - | Locality - | undefined; - /** - * Free-form string that identifies the entity requesting config. - * E.g. "envoy" or "grpc" - */ - userAgentName: string; - /** - * Free-form string that identifies the version of the entity requesting config. - * E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" - */ - userAgentVersion?: - | string - | undefined; - /** Structured version of the entity requesting config. */ - userAgentBuildVersion?: - | BuildVersion - | undefined; - /** List of extensions and their versions supported by the node. */ - extensions: Extension[]; - /** - * Client feature support list. These are well known features described - * in the Envoy API repository for a given major version of an API. Client features - * use reverse DNS naming scheme, for example ``com.acme.feature``. - * See :ref:`the list of features ` that xDS client may - * support. - */ - clientFeatures: string[]; - /** - * Known listening ports on the node as a generic hint to the management server - * for filtering :ref:`listeners ` to be returned. For example, - * if there is a listener bound to port 80, the list can optionally contain the - * SocketAddress ``(0.0.0.0,80)``. The field is optional and just a hint. - * - * @deprecated - */ - listeningAddresses: Address[]; -} - -export interface Node_DynamicParametersEntry { - key: string; - value: ContextParams | undefined; -} - -/** - * Metadata provides additional inputs to filters based on matched listeners, - * filter chains, routes and endpoints. It is structured as a map, usually from - * filter name (in reverse DNS format) to metadata specific to the filter. Metadata - * key-values for a filter are merged as connection and request handling occurs, - * with later values for the same key overriding earlier values. - * - * An example use of metadata is providing additional values to - * http_connection_manager in the envoy.http_connection_manager.access_log - * namespace. - * - * Another example use of metadata is to per service config info in cluster metadata, which may get - * consumed by multiple filters. - * - * For load balancing, Metadata provides a means to subset cluster endpoints. - * Endpoints have a Metadata object associated and routes contain a Metadata - * object to match against. There are some well defined metadata used today for - * this purpose: - * - * * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an - * endpoint and is also used during header processing - * (x-envoy-upstream-canary) and for stats purposes. - * [#next-major-version: move to type/metadata/v2] - */ -export interface Metadata { - /** - * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` - * namespace is reserved for Envoy's built-in filters. - * If both ``filter_metadata`` and - * :ref:`typed_filter_metadata ` - * fields are present in the metadata with same keys, - * only ``typed_filter_metadata`` field will be parsed. - */ - filterMetadata: { [key: string]: { [key: string]: any } | undefined }; - /** - * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` - * namespace is reserved for Envoy's built-in filters. - * The value is encoded as google.protobuf.Any. - * If both :ref:`filter_metadata ` - * and ``typed_filter_metadata`` fields are present in the metadata with same keys, - * only ``typed_filter_metadata`` field will be parsed. - */ - typedFilterMetadata: { [key: string]: Any }; -} - -export interface Metadata_FilterMetadataEntry { - key: string; - value: { [key: string]: any } | undefined; -} - -export interface Metadata_TypedFilterMetadataEntry { - key: string; - value: Any | undefined; -} - -/** Runtime derived uint32 with a default when not specified. */ -export interface RuntimeUInt32 { - /** Default value if runtime value is not available. */ - defaultValue: number; - /** Runtime key to get value for comparison. This value is used if defined. */ - runtimeKey: string; -} - -/** Runtime derived percentage with a default when not specified. */ -export interface RuntimePercent { - /** Default value if runtime value is not available. */ - defaultValue: - | Percent - | undefined; - /** Runtime key to get value for comparison. This value is used if defined. */ - runtimeKey: string; -} - -/** Runtime derived double with a default when not specified. */ -export interface RuntimeDouble { - /** Default value if runtime value is not available. */ - defaultValue: number; - /** Runtime key to get value for comparison. This value is used if defined. */ - runtimeKey: string; -} - -/** Runtime derived bool with a default when not specified. */ -export interface RuntimeFeatureFlag { - /** Default value if runtime value is not available. */ - defaultValue: - | boolean - | undefined; - /** - * Runtime key to get value for comparison. This value is used if defined. The boolean value must - * be represented via its - * `canonical JSON encoding `_. - */ - runtimeKey: string; -} - -/** - * Please use :ref:`KeyValuePair ` instead. - * [#not-implemented-hide:] - */ -export interface KeyValue { - /** - * The key of the key/value pair. - * - * @deprecated - */ - key: string; - /** - * The value of the key/value pair. - * - * The ``bytes`` type is used. This means if JSON or YAML is used to to represent the - * configuration, the value must be base64 encoded. This is unfriendly for users in most - * use scenarios of this message. - * - * @deprecated - */ - value: Uint8Array; -} - -export interface KeyValuePair { - /** The key of the key/value pair. */ - key: string; - /** The value of the key/value pair. */ - value: any | undefined; -} - -/** - * Key/value pair plus option to control append behavior. This is used to specify - * key/value pairs that should be appended to a set of existing key/value pairs. - */ -export interface KeyValueAppend { - /** The single key/value pair record to be appended or overridden. This field must be set. */ - record: - | KeyValuePair - | undefined; - /** - * Key/value pair entry that this option to append or overwrite. This field is deprecated - * and please use :ref:`record ` - * as replacement. - * [#not-implemented-hide:] - * - * @deprecated - */ - entry: - | KeyValue - | undefined; - /** - * Describes the action taken to append/overwrite the given value for an existing - * key or to only add this key if it's absent. - */ - action: KeyValueAppend_KeyValueAppendAction; -} - -/** Describes the supported actions types for key/value pair append action. */ -export enum KeyValueAppend_KeyValueAppendAction { - /** - * APPEND_IF_EXISTS_OR_ADD - If the key already exists, this action will result in the following behavior: - * - * - Comma-concatenated value if multiple values are not allowed. - * - New value added to the list of values if multiple values are allowed. - * - * If the key doesn't exist then this will add pair with specified key and value. - */ - APPEND_IF_EXISTS_OR_ADD = 0, - /** - * ADD_IF_ABSENT - This action will add the key/value pair if it doesn't already exist. If the - * key already exists then this will be a no-op. - */ - ADD_IF_ABSENT = 1, - /** - * OVERWRITE_IF_EXISTS_OR_ADD - This action will overwrite the specified value by discarding any existing - * values if the key already exists. If the key doesn't exist then this will add - * the pair with specified key and value. - */ - OVERWRITE_IF_EXISTS_OR_ADD = 2, - /** - * OVERWRITE_IF_EXISTS - This action will overwrite the specified value by discarding any existing - * values if the key already exists. If the key doesn't exist then this will - * be no-op. - */ - OVERWRITE_IF_EXISTS = 3, - UNRECOGNIZED = -1, -} - -export function keyValueAppend_KeyValueAppendActionFromJSON(object: any): KeyValueAppend_KeyValueAppendAction { - switch (object) { - case 0: - case "APPEND_IF_EXISTS_OR_ADD": - return KeyValueAppend_KeyValueAppendAction.APPEND_IF_EXISTS_OR_ADD; - case 1: - case "ADD_IF_ABSENT": - return KeyValueAppend_KeyValueAppendAction.ADD_IF_ABSENT; - case 2: - case "OVERWRITE_IF_EXISTS_OR_ADD": - return KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS_OR_ADD; - case 3: - case "OVERWRITE_IF_EXISTS": - return KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS; - case -1: - case "UNRECOGNIZED": - default: - return KeyValueAppend_KeyValueAppendAction.UNRECOGNIZED; - } -} - -export function keyValueAppend_KeyValueAppendActionToJSON(object: KeyValueAppend_KeyValueAppendAction): string { - switch (object) { - case KeyValueAppend_KeyValueAppendAction.APPEND_IF_EXISTS_OR_ADD: - return "APPEND_IF_EXISTS_OR_ADD"; - case KeyValueAppend_KeyValueAppendAction.ADD_IF_ABSENT: - return "ADD_IF_ABSENT"; - case KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS_OR_ADD: - return "OVERWRITE_IF_EXISTS_OR_ADD"; - case KeyValueAppend_KeyValueAppendAction.OVERWRITE_IF_EXISTS: - return "OVERWRITE_IF_EXISTS"; - case KeyValueAppend_KeyValueAppendAction.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** Key/value pair to append or remove. */ -export interface KeyValueMutation { - /** - * Key/value pair to append or overwrite. Only one of ``append`` or ``remove`` can be set or - * the configuration will be rejected. - */ - append: - | KeyValueAppend - | undefined; - /** - * Key to remove. Only one of ``append`` or ``remove`` can be set or the configuration will be - * rejected. - */ - remove: string; -} - -/** Query parameter name/value pair. */ -export interface QueryParameter { - /** The key of the query parameter. Case sensitive. */ - key: string; - /** The value of the query parameter. */ - value: string; -} - -/** Header name/value pair. */ -export interface HeaderValue { - /** Header name. */ - key: string; - /** - * Header value. - * - * The same :ref:`format specifier ` as used for - * :ref:`HTTP access logging ` applies here, however - * unknown header values are replaced with the empty string instead of ``-``. - * Header value is encoded as string. This does not work for non-utf8 characters. - * Only one of ``value`` or ``raw_value`` can be set. - */ - value: string; - /** - * Header value is encoded as bytes which can support non-utf8 characters. - * Only one of ``value`` or ``raw_value`` can be set. - */ - rawValue: Uint8Array; -} - -/** Header name/value pair plus option to control append behavior. */ -export interface HeaderValueOption { - /** Header name/value pair that this option applies to. */ - header: - | HeaderValue - | undefined; - /** - * Should the value be appended? If true (default), the value is appended to - * existing values. Otherwise it replaces any existing values. - * This field is deprecated and please use - * :ref:`append_action ` as replacement. - * - * .. note:: - * The :ref:`external authorization service ` and - * :ref:`external processor service ` have - * default value (``false``) for this field. - * - * @deprecated - */ - append: - | boolean - | undefined; - /** - * Describes the action taken to append/overwrite the given value for an existing header - * or to only add this header if it's absent. - * Value defaults to :ref:`APPEND_IF_EXISTS_OR_ADD - * `. - */ - appendAction: HeaderValueOption_HeaderAppendAction; - /** - * Is the header value allowed to be empty? If false (default), custom headers with empty values are dropped, - * otherwise they are added. - */ - keepEmptyValue: boolean; -} - -/** Describes the supported actions types for header append action. */ -export enum HeaderValueOption_HeaderAppendAction { - /** - * APPEND_IF_EXISTS_OR_ADD - If the header already exists, this action will result in: - * - * - Comma-concatenated for predefined inline headers. - * - Duplicate header added in the ``HeaderMap`` for other headers. - * - * If the header doesn't exist then this will add new header with specified key and value. - */ - APPEND_IF_EXISTS_OR_ADD = 0, - /** - * ADD_IF_ABSENT - This action will add the header if it doesn't already exist. If the header - * already exists then this will be a no-op. - */ - ADD_IF_ABSENT = 1, - /** - * OVERWRITE_IF_EXISTS_OR_ADD - This action will overwrite the specified value by discarding any existing values if - * the header already exists. If the header doesn't exist then this will add the header - * with specified key and value. - */ - OVERWRITE_IF_EXISTS_OR_ADD = 2, - /** - * OVERWRITE_IF_EXISTS - This action will overwrite the specified value by discarding any existing values if - * the header already exists. If the header doesn't exist then this will be no-op. - */ - OVERWRITE_IF_EXISTS = 3, - UNRECOGNIZED = -1, -} - -export function headerValueOption_HeaderAppendActionFromJSON(object: any): HeaderValueOption_HeaderAppendAction { - switch (object) { - case 0: - case "APPEND_IF_EXISTS_OR_ADD": - return HeaderValueOption_HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD; - case 1: - case "ADD_IF_ABSENT": - return HeaderValueOption_HeaderAppendAction.ADD_IF_ABSENT; - case 2: - case "OVERWRITE_IF_EXISTS_OR_ADD": - return HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS_OR_ADD; - case 3: - case "OVERWRITE_IF_EXISTS": - return HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS; - case -1: - case "UNRECOGNIZED": - default: - return HeaderValueOption_HeaderAppendAction.UNRECOGNIZED; - } -} - -export function headerValueOption_HeaderAppendActionToJSON(object: HeaderValueOption_HeaderAppendAction): string { - switch (object) { - case HeaderValueOption_HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD: - return "APPEND_IF_EXISTS_OR_ADD"; - case HeaderValueOption_HeaderAppendAction.ADD_IF_ABSENT: - return "ADD_IF_ABSENT"; - case HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS_OR_ADD: - return "OVERWRITE_IF_EXISTS_OR_ADD"; - case HeaderValueOption_HeaderAppendAction.OVERWRITE_IF_EXISTS: - return "OVERWRITE_IF_EXISTS"; - case HeaderValueOption_HeaderAppendAction.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** Wrapper for a set of headers. */ -export interface HeaderMap { - /** A list of header names and their values. */ - headers: HeaderValue[]; -} - -/** - * A directory that is watched for changes, e.g. by inotify on Linux. Move/rename - * events inside this directory trigger the watch. - */ -export interface WatchedDirectory { - /** Directory path to watch. */ - path: string; -} - -/** - * Data source consisting of a file, an inline value, or an environment variable. - * [#next-free-field: 6] - */ -export interface DataSource { - /** Local filesystem data source. */ - filename?: - | string - | undefined; - /** Bytes inlined in the configuration. */ - inlineBytes?: - | Uint8Array - | undefined; - /** String inlined in the configuration. */ - inlineString?: - | string - | undefined; - /** Environment variable data source. */ - environmentVariable?: - | string - | undefined; - /** - * Watched directory that is watched for file changes. If this is set explicitly, the file - * specified in the ``filename`` field will be reloaded when relevant file move events occur. - * - * .. note:: - * This field only makes sense when the ``filename`` field is set. - * - * .. note:: - * Envoy only updates when the file is replaced by a file move, and not when the file is - * edited in place. - * - * .. note:: - * Not all use cases of ``DataSource`` support watching directories. It depends on the - * specific usage of the ``DataSource``. See the documentation of the parent message for - * details. - */ - watchedDirectory: WatchedDirectory | undefined; -} - -/** - * The message specifies the retry policy of remote data source when fetching fails. - * [#next-free-field: 7] - */ -export interface RetryPolicy { - /** - * Specifies parameters that control :ref:`retry backoff strategy `. - * This parameter is optional, in which case the default base interval is 1000 milliseconds. The - * default maximum interval is 10 times the base interval. - */ - retryBackOff: - | BackoffStrategy - | undefined; - /** - * Specifies the allowed number of retries. This parameter is optional and - * defaults to 1. - */ - numRetries: - | number - | undefined; - /** For details, see :ref:`retry_on `. */ - retryOn: string; - /** For details, see :ref:`retry_priority `. */ - retryPriority: - | RetryPolicy_RetryPriority - | undefined; - /** For details, see :ref:`RetryHostPredicate `. */ - retryHostPredicate: RetryPolicy_RetryHostPredicate[]; - /** For details, see :ref:`host_selection_retry_max_attempts `. */ - hostSelectionRetryMaxAttempts: string; -} - -/** See :ref:`RetryPriority `. */ -export interface RetryPolicy_RetryPriority { - name: string; - typedConfig?: Any | undefined; -} - -/** See :ref:`RetryHostPredicate `. */ -export interface RetryPolicy_RetryHostPredicate { - name: string; - typedConfig?: Any | undefined; -} - -/** The message specifies how to fetch data from remote and how to verify it. */ -export interface RemoteDataSource { - /** The HTTP URI to fetch the remote data. */ - httpUri: - | HttpUri - | undefined; - /** SHA256 string for verifying data. */ - sha256: string; - /** Retry policy for fetching remote data. */ - retryPolicy: RetryPolicy | undefined; -} - -/** Async data source which support async data fetch. */ -export interface AsyncDataSource { - /** Local async data source. */ - local?: - | DataSource - | undefined; - /** Remote async data source. */ - remote?: RemoteDataSource | undefined; -} - -/** - * Configuration for transport socket in :ref:`listeners ` and - * :ref:`clusters `. If the configuration is - * empty, a default transport socket implementation and configuration will be - * chosen based on the platform and existence of tls_context. - */ -export interface TransportSocket { - /** - * The name of the transport socket to instantiate. The name must match a supported transport - * socket implementation. - */ - name: string; - typedConfig?: Any | undefined; -} - -/** - * Runtime derived FractionalPercent with defaults for when the numerator or denominator is not - * specified via a runtime key. - * - * .. note:: - * - * Parsing of the runtime key's data is implemented such that it may be represented as a - * :ref:`FractionalPercent ` proto represented as JSON/YAML - * and may also be represented as an integer with the assumption that the value is an integral - * percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse - * as a ``FractionalPercent`` whose numerator is 42 and denominator is HUNDRED. - */ -export interface RuntimeFractionalPercent { - /** Default value if the runtime value's for the numerator/denominator keys are not available. */ - defaultValue: - | FractionalPercent - | undefined; - /** Runtime key for a YAML representation of a FractionalPercent. */ - runtimeKey: string; -} - -/** Identifies a specific ControlPlane instance that Envoy is connected to. */ -export interface ControlPlane { - /** - * An opaque control plane identifier that uniquely identifies an instance - * of control plane. This can be used to identify which control plane instance, - * the Envoy is connected to. - */ - identifier: string; -} - -function createBaseLocality(): Locality { - return { region: "", zone: "", subZone: "" }; -} - -export const Locality: MessageFns = { - encode(message: Locality, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.region !== "") { - writer.uint32(10).string(message.region); - } - if (message.zone !== "") { - writer.uint32(18).string(message.zone); - } - if (message.subZone !== "") { - writer.uint32(26).string(message.subZone); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Locality { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLocality(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.region = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.zone = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.subZone = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Locality { - return { - region: isSet(object.region) ? globalThis.String(object.region) : "", - zone: isSet(object.zone) ? globalThis.String(object.zone) : "", - subZone: isSet(object.subZone) ? globalThis.String(object.subZone) : "", - }; - }, - - toJSON(message: Locality): unknown { - const obj: any = {}; - if (message.region !== "") { - obj.region = message.region; - } - if (message.zone !== "") { - obj.zone = message.zone; - } - if (message.subZone !== "") { - obj.subZone = message.subZone; - } - return obj; - }, - - create, I>>(base?: I): Locality { - return Locality.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Locality { - const message = createBaseLocality(); - message.region = object.region ?? ""; - message.zone = object.zone ?? ""; - message.subZone = object.subZone ?? ""; - return message; - }, -}; - -function createBaseBuildVersion(): BuildVersion { - return { version: undefined, metadata: undefined }; -} - -export const BuildVersion: MessageFns = { - encode(message: BuildVersion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.version !== undefined) { - SemanticVersion.encode(message.version, writer.uint32(10).fork()).join(); - } - if (message.metadata !== undefined) { - Struct.encode(Struct.wrap(message.metadata), writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BuildVersion { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBuildVersion(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.version = SemanticVersion.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BuildVersion { - return { - version: isSet(object.version) ? SemanticVersion.fromJSON(object.version) : undefined, - metadata: isObject(object.metadata) ? object.metadata : undefined, - }; - }, - - toJSON(message: BuildVersion): unknown { - const obj: any = {}; - if (message.version !== undefined) { - obj.version = SemanticVersion.toJSON(message.version); - } - if (message.metadata !== undefined) { - obj.metadata = message.metadata; - } - return obj; - }, - - create, I>>(base?: I): BuildVersion { - return BuildVersion.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BuildVersion { - const message = createBaseBuildVersion(); - message.version = (object.version !== undefined && object.version !== null) - ? SemanticVersion.fromPartial(object.version) - : undefined; - message.metadata = object.metadata ?? undefined; - return message; - }, -}; - -function createBaseExtension(): Extension { - return { name: "", category: "", typeDescriptor: "", version: undefined, disabled: false, typeUrls: [] }; -} - -export const Extension: MessageFns = { - encode(message: Extension, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.category !== "") { - writer.uint32(18).string(message.category); - } - if (message.typeDescriptor !== "") { - writer.uint32(26).string(message.typeDescriptor); - } - if (message.version !== undefined) { - BuildVersion.encode(message.version, writer.uint32(34).fork()).join(); - } - if (message.disabled !== false) { - writer.uint32(40).bool(message.disabled); - } - for (const v of message.typeUrls) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Extension { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtension(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.category = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.typeDescriptor = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.version = BuildVersion.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.disabled = reader.bool(); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.typeUrls.push(reader.string()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Extension { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - category: isSet(object.category) ? globalThis.String(object.category) : "", - typeDescriptor: isSet(object.typeDescriptor) ? globalThis.String(object.typeDescriptor) : "", - version: isSet(object.version) ? BuildVersion.fromJSON(object.version) : undefined, - disabled: isSet(object.disabled) ? globalThis.Boolean(object.disabled) : false, - typeUrls: globalThis.Array.isArray(object?.typeUrls) ? object.typeUrls.map((e: any) => globalThis.String(e)) : [], - }; - }, - - toJSON(message: Extension): unknown { - const obj: any = {}; - if (message.name !== "") { - obj.name = message.name; - } - if (message.category !== "") { - obj.category = message.category; - } - if (message.typeDescriptor !== "") { - obj.typeDescriptor = message.typeDescriptor; - } - if (message.version !== undefined) { - obj.version = BuildVersion.toJSON(message.version); - } - if (message.disabled !== false) { - obj.disabled = message.disabled; - } - if (message.typeUrls?.length) { - obj.typeUrls = message.typeUrls; - } - return obj; - }, - - create, I>>(base?: I): Extension { - return Extension.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Extension { - const message = createBaseExtension(); - message.name = object.name ?? ""; - message.category = object.category ?? ""; - message.typeDescriptor = object.typeDescriptor ?? ""; - message.version = (object.version !== undefined && object.version !== null) - ? BuildVersion.fromPartial(object.version) - : undefined; - message.disabled = object.disabled ?? false; - message.typeUrls = object.typeUrls?.map((e) => e) || []; - return message; - }, -}; - -function createBaseNode(): Node { - return { - id: "", - cluster: "", - metadata: undefined, - dynamicParameters: {}, - locality: undefined, - userAgentName: "", - userAgentVersion: undefined, - userAgentBuildVersion: undefined, - extensions: [], - clientFeatures: [], - listeningAddresses: [], - }; -} - -export const Node: MessageFns = { - encode(message: Node, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.id !== "") { - writer.uint32(10).string(message.id); - } - if (message.cluster !== "") { - writer.uint32(18).string(message.cluster); - } - if (message.metadata !== undefined) { - Struct.encode(Struct.wrap(message.metadata), writer.uint32(26).fork()).join(); - } - Object.entries(message.dynamicParameters).forEach(([key, value]) => { - Node_DynamicParametersEntry.encode({ key: key as any, value }, writer.uint32(98).fork()).join(); - }); - if (message.locality !== undefined) { - Locality.encode(message.locality, writer.uint32(34).fork()).join(); - } - if (message.userAgentName !== "") { - writer.uint32(50).string(message.userAgentName); - } - if (message.userAgentVersion !== undefined) { - writer.uint32(58).string(message.userAgentVersion); - } - if (message.userAgentBuildVersion !== undefined) { - BuildVersion.encode(message.userAgentBuildVersion, writer.uint32(66).fork()).join(); - } - for (const v of message.extensions) { - Extension.encode(v!, writer.uint32(74).fork()).join(); - } - for (const v of message.clientFeatures) { - writer.uint32(82).string(v!); - } - for (const v of message.listeningAddresses) { - Address.encode(v!, writer.uint32(90).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Node { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNode(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.id = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.cluster = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - case 12: { - if (tag !== 98) { - break; - } - - const entry12 = Node_DynamicParametersEntry.decode(reader, reader.uint32()); - if (entry12.value !== undefined) { - message.dynamicParameters[entry12.key] = entry12.value; - } - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.locality = Locality.decode(reader, reader.uint32()); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.userAgentName = reader.string(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.userAgentVersion = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.userAgentBuildVersion = BuildVersion.decode(reader, reader.uint32()); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.extensions.push(Extension.decode(reader, reader.uint32())); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.clientFeatures.push(reader.string()); - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.listeningAddresses.push(Address.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Node { - return { - id: isSet(object.id) ? globalThis.String(object.id) : "", - cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "", - metadata: isObject(object.metadata) ? object.metadata : undefined, - dynamicParameters: isObject(object.dynamicParameters) - ? Object.entries(object.dynamicParameters).reduce<{ [key: string]: ContextParams }>((acc, [key, value]) => { - acc[key] = ContextParams.fromJSON(value); - return acc; - }, {}) - : {}, - locality: isSet(object.locality) ? Locality.fromJSON(object.locality) : undefined, - userAgentName: isSet(object.userAgentName) ? globalThis.String(object.userAgentName) : "", - userAgentVersion: isSet(object.userAgentVersion) ? globalThis.String(object.userAgentVersion) : undefined, - userAgentBuildVersion: isSet(object.userAgentBuildVersion) - ? BuildVersion.fromJSON(object.userAgentBuildVersion) - : undefined, - extensions: globalThis.Array.isArray(object?.extensions) - ? object.extensions.map((e: any) => Extension.fromJSON(e)) - : [], - clientFeatures: globalThis.Array.isArray(object?.clientFeatures) - ? object.clientFeatures.map((e: any) => globalThis.String(e)) - : [], - listeningAddresses: globalThis.Array.isArray(object?.listeningAddresses) - ? object.listeningAddresses.map((e: any) => Address.fromJSON(e)) - : [], - }; - }, - - toJSON(message: Node): unknown { - const obj: any = {}; - if (message.id !== "") { - obj.id = message.id; - } - if (message.cluster !== "") { - obj.cluster = message.cluster; - } - if (message.metadata !== undefined) { - obj.metadata = message.metadata; - } - if (message.dynamicParameters) { - const entries = Object.entries(message.dynamicParameters); - if (entries.length > 0) { - obj.dynamicParameters = {}; - entries.forEach(([k, v]) => { - obj.dynamicParameters[k] = ContextParams.toJSON(v); - }); - } - } - if (message.locality !== undefined) { - obj.locality = Locality.toJSON(message.locality); - } - if (message.userAgentName !== "") { - obj.userAgentName = message.userAgentName; - } - if (message.userAgentVersion !== undefined) { - obj.userAgentVersion = message.userAgentVersion; - } - if (message.userAgentBuildVersion !== undefined) { - obj.userAgentBuildVersion = BuildVersion.toJSON(message.userAgentBuildVersion); - } - if (message.extensions?.length) { - obj.extensions = message.extensions.map((e) => Extension.toJSON(e)); - } - if (message.clientFeatures?.length) { - obj.clientFeatures = message.clientFeatures; - } - if (message.listeningAddresses?.length) { - obj.listeningAddresses = message.listeningAddresses.map((e) => Address.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): Node { - return Node.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Node { - const message = createBaseNode(); - message.id = object.id ?? ""; - message.cluster = object.cluster ?? ""; - message.metadata = object.metadata ?? undefined; - message.dynamicParameters = Object.entries(object.dynamicParameters ?? {}).reduce<{ [key: string]: ContextParams }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[key] = ContextParams.fromPartial(value); - } - return acc; - }, - {}, - ); - message.locality = (object.locality !== undefined && object.locality !== null) - ? Locality.fromPartial(object.locality) - : undefined; - message.userAgentName = object.userAgentName ?? ""; - message.userAgentVersion = object.userAgentVersion ?? undefined; - message.userAgentBuildVersion = - (object.userAgentBuildVersion !== undefined && object.userAgentBuildVersion !== null) - ? BuildVersion.fromPartial(object.userAgentBuildVersion) - : undefined; - message.extensions = object.extensions?.map((e) => Extension.fromPartial(e)) || []; - message.clientFeatures = object.clientFeatures?.map((e) => e) || []; - message.listeningAddresses = object.listeningAddresses?.map((e) => Address.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseNode_DynamicParametersEntry(): Node_DynamicParametersEntry { - return { key: "", value: undefined }; -} - -export const Node_DynamicParametersEntry: MessageFns = { - encode(message: Node_DynamicParametersEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - ContextParams.encode(message.value, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Node_DynamicParametersEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNode_DynamicParametersEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = ContextParams.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Node_DynamicParametersEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? ContextParams.fromJSON(object.value) : undefined, - }; - }, - - toJSON(message: Node_DynamicParametersEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = ContextParams.toJSON(message.value); - } - return obj; - }, - - create, I>>(base?: I): Node_DynamicParametersEntry { - return Node_DynamicParametersEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Node_DynamicParametersEntry { - const message = createBaseNode_DynamicParametersEntry(); - message.key = object.key ?? ""; - message.value = (object.value !== undefined && object.value !== null) - ? ContextParams.fromPartial(object.value) - : undefined; - return message; - }, -}; - -function createBaseMetadata(): Metadata { - return { filterMetadata: {}, typedFilterMetadata: {} }; -} - -export const Metadata: MessageFns = { - encode(message: Metadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - Object.entries(message.filterMetadata).forEach(([key, value]) => { - if (value !== undefined) { - Metadata_FilterMetadataEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); - } - }); - Object.entries(message.typedFilterMetadata).forEach(([key, value]) => { - Metadata_TypedFilterMetadataEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); - }); - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Metadata { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetadata(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - const entry1 = Metadata_FilterMetadataEntry.decode(reader, reader.uint32()); - if (entry1.value !== undefined) { - message.filterMetadata[entry1.key] = entry1.value; - } - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - const entry2 = Metadata_TypedFilterMetadataEntry.decode(reader, reader.uint32()); - if (entry2.value !== undefined) { - message.typedFilterMetadata[entry2.key] = entry2.value; - } - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Metadata { - return { - filterMetadata: isObject(object.filterMetadata) - ? Object.entries(object.filterMetadata).reduce<{ [key: string]: { [key: string]: any } | undefined }>( - (acc, [key, value]) => { - acc[key] = value as { [key: string]: any } | undefined; - return acc; - }, - {}, - ) - : {}, - typedFilterMetadata: isObject(object.typedFilterMetadata) - ? Object.entries(object.typedFilterMetadata).reduce<{ [key: string]: Any }>((acc, [key, value]) => { - acc[key] = Any.fromJSON(value); - return acc; - }, {}) - : {}, - }; - }, - - toJSON(message: Metadata): unknown { - const obj: any = {}; - if (message.filterMetadata) { - const entries = Object.entries(message.filterMetadata); - if (entries.length > 0) { - obj.filterMetadata = {}; - entries.forEach(([k, v]) => { - obj.filterMetadata[k] = v; - }); - } - } - if (message.typedFilterMetadata) { - const entries = Object.entries(message.typedFilterMetadata); - if (entries.length > 0) { - obj.typedFilterMetadata = {}; - entries.forEach(([k, v]) => { - obj.typedFilterMetadata[k] = Any.toJSON(v); - }); - } - } - return obj; - }, - - create, I>>(base?: I): Metadata { - return Metadata.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Metadata { - const message = createBaseMetadata(); - message.filterMetadata = Object.entries(object.filterMetadata ?? {}).reduce< - { [key: string]: { [key: string]: any } | undefined } - >((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); - message.typedFilterMetadata = Object.entries(object.typedFilterMetadata ?? {}).reduce<{ [key: string]: Any }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[key] = Any.fromPartial(value); - } - return acc; - }, - {}, - ); - return message; - }, -}; - -function createBaseMetadata_FilterMetadataEntry(): Metadata_FilterMetadataEntry { - return { key: "", value: undefined }; -} - -export const Metadata_FilterMetadataEntry: MessageFns = { - encode(message: Metadata_FilterMetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Metadata_FilterMetadataEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetadata_FilterMetadataEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Metadata_FilterMetadataEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isObject(object.value) ? object.value : undefined, - }; - }, - - toJSON(message: Metadata_FilterMetadataEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): Metadata_FilterMetadataEntry { - return Metadata_FilterMetadataEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Metadata_FilterMetadataEntry { - const message = createBaseMetadata_FilterMetadataEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; - return message; - }, -}; - -function createBaseMetadata_TypedFilterMetadataEntry(): Metadata_TypedFilterMetadataEntry { - return { key: "", value: undefined }; -} - -export const Metadata_TypedFilterMetadataEntry: MessageFns = { - encode(message: Metadata_TypedFilterMetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - Any.encode(message.value, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Metadata_TypedFilterMetadataEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetadata_TypedFilterMetadataEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Any.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Metadata_TypedFilterMetadataEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, - }; - }, - - toJSON(message: Metadata_TypedFilterMetadataEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = Any.toJSON(message.value); - } - return obj; - }, - - create, I>>( - base?: I, - ): Metadata_TypedFilterMetadataEntry { - return Metadata_TypedFilterMetadataEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): Metadata_TypedFilterMetadataEntry { - const message = createBaseMetadata_TypedFilterMetadataEntry(); - message.key = object.key ?? ""; - message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; - return message; - }, -}; - -function createBaseRuntimeUInt32(): RuntimeUInt32 { - return { defaultValue: 0, runtimeKey: "" }; -} - -export const RuntimeUInt32: MessageFns = { - encode(message: RuntimeUInt32, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.defaultValue !== 0) { - writer.uint32(16).uint32(message.defaultValue); - } - if (message.runtimeKey !== "") { - writer.uint32(26).string(message.runtimeKey); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RuntimeUInt32 { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRuntimeUInt32(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (tag !== 16) { - break; - } - - message.defaultValue = reader.uint32(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.runtimeKey = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RuntimeUInt32 { - return { - defaultValue: isSet(object.defaultValue) ? globalThis.Number(object.defaultValue) : 0, - runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", - }; - }, - - toJSON(message: RuntimeUInt32): unknown { - const obj: any = {}; - if (message.defaultValue !== 0) { - obj.defaultValue = Math.round(message.defaultValue); - } - if (message.runtimeKey !== "") { - obj.runtimeKey = message.runtimeKey; - } - return obj; - }, - - create, I>>(base?: I): RuntimeUInt32 { - return RuntimeUInt32.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RuntimeUInt32 { - const message = createBaseRuntimeUInt32(); - message.defaultValue = object.defaultValue ?? 0; - message.runtimeKey = object.runtimeKey ?? ""; - return message; - }, -}; - -function createBaseRuntimePercent(): RuntimePercent { - return { defaultValue: undefined, runtimeKey: "" }; -} - -export const RuntimePercent: MessageFns = { - encode(message: RuntimePercent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.defaultValue !== undefined) { - Percent.encode(message.defaultValue, writer.uint32(10).fork()).join(); - } - if (message.runtimeKey !== "") { - writer.uint32(18).string(message.runtimeKey); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RuntimePercent { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRuntimePercent(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.defaultValue = Percent.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.runtimeKey = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RuntimePercent { - return { - defaultValue: isSet(object.defaultValue) ? Percent.fromJSON(object.defaultValue) : undefined, - runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", - }; - }, - - toJSON(message: RuntimePercent): unknown { - const obj: any = {}; - if (message.defaultValue !== undefined) { - obj.defaultValue = Percent.toJSON(message.defaultValue); - } - if (message.runtimeKey !== "") { - obj.runtimeKey = message.runtimeKey; - } - return obj; - }, - - create, I>>(base?: I): RuntimePercent { - return RuntimePercent.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RuntimePercent { - const message = createBaseRuntimePercent(); - message.defaultValue = (object.defaultValue !== undefined && object.defaultValue !== null) - ? Percent.fromPartial(object.defaultValue) - : undefined; - message.runtimeKey = object.runtimeKey ?? ""; - return message; - }, -}; - -function createBaseRuntimeDouble(): RuntimeDouble { - return { defaultValue: 0, runtimeKey: "" }; -} - -export const RuntimeDouble: MessageFns = { - encode(message: RuntimeDouble, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.defaultValue !== 0) { - writer.uint32(9).double(message.defaultValue); - } - if (message.runtimeKey !== "") { - writer.uint32(18).string(message.runtimeKey); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RuntimeDouble { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRuntimeDouble(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 9) { - break; - } - - message.defaultValue = reader.double(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.runtimeKey = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RuntimeDouble { - return { - defaultValue: isSet(object.defaultValue) ? globalThis.Number(object.defaultValue) : 0, - runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", - }; - }, - - toJSON(message: RuntimeDouble): unknown { - const obj: any = {}; - if (message.defaultValue !== 0) { - obj.defaultValue = message.defaultValue; - } - if (message.runtimeKey !== "") { - obj.runtimeKey = message.runtimeKey; - } - return obj; - }, - - create, I>>(base?: I): RuntimeDouble { - return RuntimeDouble.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RuntimeDouble { - const message = createBaseRuntimeDouble(); - message.defaultValue = object.defaultValue ?? 0; - message.runtimeKey = object.runtimeKey ?? ""; - return message; - }, -}; - -function createBaseRuntimeFeatureFlag(): RuntimeFeatureFlag { - return { defaultValue: undefined, runtimeKey: "" }; -} - -export const RuntimeFeatureFlag: MessageFns = { - encode(message: RuntimeFeatureFlag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.defaultValue !== undefined) { - BoolValue.encode({ value: message.defaultValue! }, writer.uint32(10).fork()).join(); - } - if (message.runtimeKey !== "") { - writer.uint32(18).string(message.runtimeKey); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RuntimeFeatureFlag { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRuntimeFeatureFlag(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.defaultValue = BoolValue.decode(reader, reader.uint32()).value; - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.runtimeKey = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RuntimeFeatureFlag { - return { - defaultValue: isSet(object.defaultValue) ? Boolean(object.defaultValue) : undefined, - runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", - }; - }, - - toJSON(message: RuntimeFeatureFlag): unknown { - const obj: any = {}; - if (message.defaultValue !== undefined) { - obj.defaultValue = message.defaultValue; - } - if (message.runtimeKey !== "") { - obj.runtimeKey = message.runtimeKey; - } - return obj; - }, - - create, I>>(base?: I): RuntimeFeatureFlag { - return RuntimeFeatureFlag.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RuntimeFeatureFlag { - const message = createBaseRuntimeFeatureFlag(); - message.defaultValue = object.defaultValue ?? undefined; - message.runtimeKey = object.runtimeKey ?? ""; - return message; - }, -}; - -function createBaseKeyValue(): KeyValue { - return { key: "", value: new Uint8Array(0) }; -} - -export const KeyValue: MessageFns = { - encode(message: KeyValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): KeyValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseKeyValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = reader.bytes(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): KeyValue { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0), - }; - }, - - toJSON(message: KeyValue): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value.length !== 0) { - obj.value = base64FromBytes(message.value); - } - return obj; - }, - - create, I>>(base?: I): KeyValue { - return KeyValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): KeyValue { - const message = createBaseKeyValue(); - message.key = object.key ?? ""; - message.value = object.value ?? new Uint8Array(0); - return message; - }, -}; - -function createBaseKeyValuePair(): KeyValuePair { - return { key: "", value: undefined }; -} - -export const KeyValuePair: MessageFns = { - encode(message: KeyValuePair, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): KeyValuePair { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseKeyValuePair(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): KeyValuePair { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; - }, - - toJSON(message: KeyValuePair): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): KeyValuePair { - return KeyValuePair.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): KeyValuePair { - const message = createBaseKeyValuePair(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; - return message; - }, -}; - -function createBaseKeyValueAppend(): KeyValueAppend { - return { record: undefined, entry: undefined, action: 0 }; -} - -export const KeyValueAppend: MessageFns = { - encode(message: KeyValueAppend, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.record !== undefined) { - KeyValuePair.encode(message.record, writer.uint32(26).fork()).join(); - } - if (message.entry !== undefined) { - KeyValue.encode(message.entry, writer.uint32(10).fork()).join(); - } - if (message.action !== 0) { - writer.uint32(16).int32(message.action); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): KeyValueAppend { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseKeyValueAppend(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - if (tag !== 26) { - break; - } - - message.record = KeyValuePair.decode(reader, reader.uint32()); - continue; - } - case 1: { - if (tag !== 10) { - break; - } - - message.entry = KeyValue.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.action = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): KeyValueAppend { - return { - record: isSet(object.record) ? KeyValuePair.fromJSON(object.record) : undefined, - entry: isSet(object.entry) ? KeyValue.fromJSON(object.entry) : undefined, - action: isSet(object.action) ? keyValueAppend_KeyValueAppendActionFromJSON(object.action) : 0, - }; - }, - - toJSON(message: KeyValueAppend): unknown { - const obj: any = {}; - if (message.record !== undefined) { - obj.record = KeyValuePair.toJSON(message.record); - } - if (message.entry !== undefined) { - obj.entry = KeyValue.toJSON(message.entry); - } - if (message.action !== 0) { - obj.action = keyValueAppend_KeyValueAppendActionToJSON(message.action); - } - return obj; - }, - - create, I>>(base?: I): KeyValueAppend { - return KeyValueAppend.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): KeyValueAppend { - const message = createBaseKeyValueAppend(); - message.record = (object.record !== undefined && object.record !== null) - ? KeyValuePair.fromPartial(object.record) - : undefined; - message.entry = (object.entry !== undefined && object.entry !== null) - ? KeyValue.fromPartial(object.entry) - : undefined; - message.action = object.action ?? 0; - return message; - }, -}; - -function createBaseKeyValueMutation(): KeyValueMutation { - return { append: undefined, remove: "" }; -} - -export const KeyValueMutation: MessageFns = { - encode(message: KeyValueMutation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.append !== undefined) { - KeyValueAppend.encode(message.append, writer.uint32(10).fork()).join(); - } - if (message.remove !== "") { - writer.uint32(18).string(message.remove); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): KeyValueMutation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseKeyValueMutation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.append = KeyValueAppend.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.remove = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): KeyValueMutation { - return { - append: isSet(object.append) ? KeyValueAppend.fromJSON(object.append) : undefined, - remove: isSet(object.remove) ? globalThis.String(object.remove) : "", - }; - }, - - toJSON(message: KeyValueMutation): unknown { - const obj: any = {}; - if (message.append !== undefined) { - obj.append = KeyValueAppend.toJSON(message.append); - } - if (message.remove !== "") { - obj.remove = message.remove; - } - return obj; - }, - - create, I>>(base?: I): KeyValueMutation { - return KeyValueMutation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): KeyValueMutation { - const message = createBaseKeyValueMutation(); - message.append = (object.append !== undefined && object.append !== null) - ? KeyValueAppend.fromPartial(object.append) - : undefined; - message.remove = object.remove ?? ""; - return message; - }, -}; - -function createBaseQueryParameter(): QueryParameter { - return { key: "", value: "" }; -} - -export const QueryParameter: MessageFns = { - encode(message: QueryParameter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): QueryParameter { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParameter(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): QueryParameter { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? globalThis.String(object.value) : "", - }; - }, - - toJSON(message: QueryParameter): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== "") { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): QueryParameter { - return QueryParameter.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): QueryParameter { - const message = createBaseQueryParameter(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, -}; - -function createBaseHeaderValue(): HeaderValue { - return { key: "", value: "", rawValue: new Uint8Array(0) }; -} - -export const HeaderValue: MessageFns = { - encode(message: HeaderValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - if (message.rawValue.length !== 0) { - writer.uint32(26).bytes(message.rawValue); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HeaderValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeaderValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.rawValue = reader.bytes(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HeaderValue { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? globalThis.String(object.value) : "", - rawValue: isSet(object.rawValue) ? bytesFromBase64(object.rawValue) : new Uint8Array(0), - }; - }, - - toJSON(message: HeaderValue): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== "") { - obj.value = message.value; - } - if (message.rawValue.length !== 0) { - obj.rawValue = base64FromBytes(message.rawValue); - } - return obj; - }, - - create, I>>(base?: I): HeaderValue { - return HeaderValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HeaderValue { - const message = createBaseHeaderValue(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - message.rawValue = object.rawValue ?? new Uint8Array(0); - return message; - }, -}; - -function createBaseHeaderValueOption(): HeaderValueOption { - return { header: undefined, append: undefined, appendAction: 0, keepEmptyValue: false }; -} - -export const HeaderValueOption: MessageFns = { - encode(message: HeaderValueOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.header !== undefined) { - HeaderValue.encode(message.header, writer.uint32(10).fork()).join(); - } - if (message.append !== undefined) { - BoolValue.encode({ value: message.append! }, writer.uint32(18).fork()).join(); - } - if (message.appendAction !== 0) { - writer.uint32(24).int32(message.appendAction); - } - if (message.keepEmptyValue !== false) { - writer.uint32(32).bool(message.keepEmptyValue); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HeaderValueOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeaderValueOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.header = HeaderValue.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.append = BoolValue.decode(reader, reader.uint32()).value; - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.appendAction = reader.int32() as any; - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.keepEmptyValue = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HeaderValueOption { - return { - header: isSet(object.header) ? HeaderValue.fromJSON(object.header) : undefined, - append: isSet(object.append) ? Boolean(object.append) : undefined, - appendAction: isSet(object.appendAction) ? headerValueOption_HeaderAppendActionFromJSON(object.appendAction) : 0, - keepEmptyValue: isSet(object.keepEmptyValue) ? globalThis.Boolean(object.keepEmptyValue) : false, - }; - }, - - toJSON(message: HeaderValueOption): unknown { - const obj: any = {}; - if (message.header !== undefined) { - obj.header = HeaderValue.toJSON(message.header); - } - if (message.append !== undefined) { - obj.append = message.append; - } - if (message.appendAction !== 0) { - obj.appendAction = headerValueOption_HeaderAppendActionToJSON(message.appendAction); - } - if (message.keepEmptyValue !== false) { - obj.keepEmptyValue = message.keepEmptyValue; - } - return obj; - }, - - create, I>>(base?: I): HeaderValueOption { - return HeaderValueOption.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HeaderValueOption { - const message = createBaseHeaderValueOption(); - message.header = (object.header !== undefined && object.header !== null) - ? HeaderValue.fromPartial(object.header) - : undefined; - message.append = object.append ?? undefined; - message.appendAction = object.appendAction ?? 0; - message.keepEmptyValue = object.keepEmptyValue ?? false; - return message; - }, -}; - -function createBaseHeaderMap(): HeaderMap { - return { headers: [] }; -} - -export const HeaderMap: MessageFns = { - encode(message: HeaderMap, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.headers) { - HeaderValue.encode(v!, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HeaderMap { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeaderMap(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.headers.push(HeaderValue.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HeaderMap { - return { - headers: globalThis.Array.isArray(object?.headers) ? object.headers.map((e: any) => HeaderValue.fromJSON(e)) : [], - }; - }, - - toJSON(message: HeaderMap): unknown { - const obj: any = {}; - if (message.headers?.length) { - obj.headers = message.headers.map((e) => HeaderValue.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): HeaderMap { - return HeaderMap.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HeaderMap { - const message = createBaseHeaderMap(); - message.headers = object.headers?.map((e) => HeaderValue.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseWatchedDirectory(): WatchedDirectory { - return { path: "" }; -} - -export const WatchedDirectory: MessageFns = { - encode(message: WatchedDirectory, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.path !== "") { - writer.uint32(10).string(message.path); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): WatchedDirectory { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseWatchedDirectory(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.path = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): WatchedDirectory { - return { path: isSet(object.path) ? globalThis.String(object.path) : "" }; - }, - - toJSON(message: WatchedDirectory): unknown { - const obj: any = {}; - if (message.path !== "") { - obj.path = message.path; - } - return obj; - }, - - create, I>>(base?: I): WatchedDirectory { - return WatchedDirectory.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): WatchedDirectory { - const message = createBaseWatchedDirectory(); - message.path = object.path ?? ""; - return message; - }, -}; - -function createBaseDataSource(): DataSource { - return { - filename: undefined, - inlineBytes: undefined, - inlineString: undefined, - environmentVariable: undefined, - watchedDirectory: undefined, - }; -} - -export const DataSource: MessageFns = { - encode(message: DataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.filename !== undefined) { - writer.uint32(10).string(message.filename); - } - if (message.inlineBytes !== undefined) { - writer.uint32(18).bytes(message.inlineBytes); - } - if (message.inlineString !== undefined) { - writer.uint32(26).string(message.inlineString); - } - if (message.environmentVariable !== undefined) { - writer.uint32(34).string(message.environmentVariable); - } - if (message.watchedDirectory !== undefined) { - WatchedDirectory.encode(message.watchedDirectory, writer.uint32(42).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DataSource { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDataSource(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.filename = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.inlineBytes = reader.bytes(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.inlineString = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.environmentVariable = reader.string(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.watchedDirectory = WatchedDirectory.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DataSource { - return { - filename: isSet(object.filename) ? globalThis.String(object.filename) : undefined, - inlineBytes: isSet(object.inlineBytes) ? bytesFromBase64(object.inlineBytes) : undefined, - inlineString: isSet(object.inlineString) ? globalThis.String(object.inlineString) : undefined, - environmentVariable: isSet(object.environmentVariable) - ? globalThis.String(object.environmentVariable) - : undefined, - watchedDirectory: isSet(object.watchedDirectory) ? WatchedDirectory.fromJSON(object.watchedDirectory) : undefined, - }; - }, - - toJSON(message: DataSource): unknown { - const obj: any = {}; - if (message.filename !== undefined) { - obj.filename = message.filename; - } - if (message.inlineBytes !== undefined) { - obj.inlineBytes = base64FromBytes(message.inlineBytes); - } - if (message.inlineString !== undefined) { - obj.inlineString = message.inlineString; - } - if (message.environmentVariable !== undefined) { - obj.environmentVariable = message.environmentVariable; - } - if (message.watchedDirectory !== undefined) { - obj.watchedDirectory = WatchedDirectory.toJSON(message.watchedDirectory); - } - return obj; - }, - - create, I>>(base?: I): DataSource { - return DataSource.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): DataSource { - const message = createBaseDataSource(); - message.filename = object.filename ?? undefined; - message.inlineBytes = object.inlineBytes ?? undefined; - message.inlineString = object.inlineString ?? undefined; - message.environmentVariable = object.environmentVariable ?? undefined; - message.watchedDirectory = (object.watchedDirectory !== undefined && object.watchedDirectory !== null) - ? WatchedDirectory.fromPartial(object.watchedDirectory) - : undefined; - return message; - }, -}; - -function createBaseRetryPolicy(): RetryPolicy { - return { - retryBackOff: undefined, - numRetries: undefined, - retryOn: "", - retryPriority: undefined, - retryHostPredicate: [], - hostSelectionRetryMaxAttempts: "0", - }; -} - -export const RetryPolicy: MessageFns = { - encode(message: RetryPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.retryBackOff !== undefined) { - BackoffStrategy.encode(message.retryBackOff, writer.uint32(10).fork()).join(); - } - if (message.numRetries !== undefined) { - UInt32Value.encode({ value: message.numRetries! }, writer.uint32(18).fork()).join(); - } - if (message.retryOn !== "") { - writer.uint32(26).string(message.retryOn); - } - if (message.retryPriority !== undefined) { - RetryPolicy_RetryPriority.encode(message.retryPriority, writer.uint32(34).fork()).join(); - } - for (const v of message.retryHostPredicate) { - RetryPolicy_RetryHostPredicate.encode(v!, writer.uint32(42).fork()).join(); - } - if (message.hostSelectionRetryMaxAttempts !== "0") { - writer.uint32(48).int64(message.hostSelectionRetryMaxAttempts); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RetryPolicy { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRetryPolicy(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.retryBackOff = BackoffStrategy.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.numRetries = UInt32Value.decode(reader, reader.uint32()).value; - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.retryOn = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.retryPriority = RetryPolicy_RetryPriority.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.retryHostPredicate.push(RetryPolicy_RetryHostPredicate.decode(reader, reader.uint32())); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.hostSelectionRetryMaxAttempts = reader.int64().toString(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RetryPolicy { - return { - retryBackOff: isSet(object.retryBackOff) ? BackoffStrategy.fromJSON(object.retryBackOff) : undefined, - numRetries: isSet(object.numRetries) ? Number(object.numRetries) : undefined, - retryOn: isSet(object.retryOn) ? globalThis.String(object.retryOn) : "", - retryPriority: isSet(object.retryPriority) ? RetryPolicy_RetryPriority.fromJSON(object.retryPriority) : undefined, - retryHostPredicate: globalThis.Array.isArray(object?.retryHostPredicate) - ? object.retryHostPredicate.map((e: any) => RetryPolicy_RetryHostPredicate.fromJSON(e)) - : [], - hostSelectionRetryMaxAttempts: isSet(object.hostSelectionRetryMaxAttempts) - ? globalThis.String(object.hostSelectionRetryMaxAttempts) - : "0", - }; - }, - - toJSON(message: RetryPolicy): unknown { - const obj: any = {}; - if (message.retryBackOff !== undefined) { - obj.retryBackOff = BackoffStrategy.toJSON(message.retryBackOff); - } - if (message.numRetries !== undefined) { - obj.numRetries = message.numRetries; - } - if (message.retryOn !== "") { - obj.retryOn = message.retryOn; - } - if (message.retryPriority !== undefined) { - obj.retryPriority = RetryPolicy_RetryPriority.toJSON(message.retryPriority); - } - if (message.retryHostPredicate?.length) { - obj.retryHostPredicate = message.retryHostPredicate.map((e) => RetryPolicy_RetryHostPredicate.toJSON(e)); - } - if (message.hostSelectionRetryMaxAttempts !== "0") { - obj.hostSelectionRetryMaxAttempts = message.hostSelectionRetryMaxAttempts; - } - return obj; - }, - - create, I>>(base?: I): RetryPolicy { - return RetryPolicy.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RetryPolicy { - const message = createBaseRetryPolicy(); - message.retryBackOff = (object.retryBackOff !== undefined && object.retryBackOff !== null) - ? BackoffStrategy.fromPartial(object.retryBackOff) - : undefined; - message.numRetries = object.numRetries ?? undefined; - message.retryOn = object.retryOn ?? ""; - message.retryPriority = (object.retryPriority !== undefined && object.retryPriority !== null) - ? RetryPolicy_RetryPriority.fromPartial(object.retryPriority) - : undefined; - message.retryHostPredicate = object.retryHostPredicate?.map((e) => RetryPolicy_RetryHostPredicate.fromPartial(e)) || - []; - message.hostSelectionRetryMaxAttempts = object.hostSelectionRetryMaxAttempts ?? "0"; - return message; - }, -}; - -function createBaseRetryPolicy_RetryPriority(): RetryPolicy_RetryPriority { - return { name: "", typedConfig: undefined }; -} - -export const RetryPolicy_RetryPriority: MessageFns = { - encode(message: RetryPolicy_RetryPriority, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.typedConfig !== undefined) { - Any.encode(message.typedConfig, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RetryPolicy_RetryPriority { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRetryPolicy_RetryPriority(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.typedConfig = Any.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RetryPolicy_RetryPriority { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, - }; - }, - - toJSON(message: RetryPolicy_RetryPriority): unknown { - const obj: any = {}; - if (message.name !== "") { - obj.name = message.name; - } - if (message.typedConfig !== undefined) { - obj.typedConfig = Any.toJSON(message.typedConfig); - } - return obj; - }, - - create, I>>(base?: I): RetryPolicy_RetryPriority { - return RetryPolicy_RetryPriority.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RetryPolicy_RetryPriority { - const message = createBaseRetryPolicy_RetryPriority(); - message.name = object.name ?? ""; - message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) - ? Any.fromPartial(object.typedConfig) - : undefined; - return message; - }, -}; - -function createBaseRetryPolicy_RetryHostPredicate(): RetryPolicy_RetryHostPredicate { - return { name: "", typedConfig: undefined }; -} - -export const RetryPolicy_RetryHostPredicate: MessageFns = { - encode(message: RetryPolicy_RetryHostPredicate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.typedConfig !== undefined) { - Any.encode(message.typedConfig, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RetryPolicy_RetryHostPredicate { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRetryPolicy_RetryHostPredicate(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.typedConfig = Any.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RetryPolicy_RetryHostPredicate { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, - }; - }, - - toJSON(message: RetryPolicy_RetryHostPredicate): unknown { - const obj: any = {}; - if (message.name !== "") { - obj.name = message.name; - } - if (message.typedConfig !== undefined) { - obj.typedConfig = Any.toJSON(message.typedConfig); - } - return obj; - }, - - create, I>>(base?: I): RetryPolicy_RetryHostPredicate { - return RetryPolicy_RetryHostPredicate.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): RetryPolicy_RetryHostPredicate { - const message = createBaseRetryPolicy_RetryHostPredicate(); - message.name = object.name ?? ""; - message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) - ? Any.fromPartial(object.typedConfig) - : undefined; - return message; - }, -}; - -function createBaseRemoteDataSource(): RemoteDataSource { - return { httpUri: undefined, sha256: "", retryPolicy: undefined }; -} - -export const RemoteDataSource: MessageFns = { - encode(message: RemoteDataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.httpUri !== undefined) { - HttpUri.encode(message.httpUri, writer.uint32(10).fork()).join(); - } - if (message.sha256 !== "") { - writer.uint32(18).string(message.sha256); - } - if (message.retryPolicy !== undefined) { - RetryPolicy.encode(message.retryPolicy, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RemoteDataSource { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRemoteDataSource(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.httpUri = HttpUri.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.sha256 = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.retryPolicy = RetryPolicy.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RemoteDataSource { - return { - httpUri: isSet(object.httpUri) ? HttpUri.fromJSON(object.httpUri) : undefined, - sha256: isSet(object.sha256) ? globalThis.String(object.sha256) : "", - retryPolicy: isSet(object.retryPolicy) ? RetryPolicy.fromJSON(object.retryPolicy) : undefined, - }; - }, - - toJSON(message: RemoteDataSource): unknown { - const obj: any = {}; - if (message.httpUri !== undefined) { - obj.httpUri = HttpUri.toJSON(message.httpUri); - } - if (message.sha256 !== "") { - obj.sha256 = message.sha256; - } - if (message.retryPolicy !== undefined) { - obj.retryPolicy = RetryPolicy.toJSON(message.retryPolicy); - } - return obj; - }, - - create, I>>(base?: I): RemoteDataSource { - return RemoteDataSource.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RemoteDataSource { - const message = createBaseRemoteDataSource(); - message.httpUri = (object.httpUri !== undefined && object.httpUri !== null) - ? HttpUri.fromPartial(object.httpUri) - : undefined; - message.sha256 = object.sha256 ?? ""; - message.retryPolicy = (object.retryPolicy !== undefined && object.retryPolicy !== null) - ? RetryPolicy.fromPartial(object.retryPolicy) - : undefined; - return message; - }, -}; - -function createBaseAsyncDataSource(): AsyncDataSource { - return { local: undefined, remote: undefined }; -} - -export const AsyncDataSource: MessageFns = { - encode(message: AsyncDataSource, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.local !== undefined) { - DataSource.encode(message.local, writer.uint32(10).fork()).join(); - } - if (message.remote !== undefined) { - RemoteDataSource.encode(message.remote, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): AsyncDataSource { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAsyncDataSource(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.local = DataSource.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.remote = RemoteDataSource.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): AsyncDataSource { - return { - local: isSet(object.local) ? DataSource.fromJSON(object.local) : undefined, - remote: isSet(object.remote) ? RemoteDataSource.fromJSON(object.remote) : undefined, - }; - }, - - toJSON(message: AsyncDataSource): unknown { - const obj: any = {}; - if (message.local !== undefined) { - obj.local = DataSource.toJSON(message.local); - } - if (message.remote !== undefined) { - obj.remote = RemoteDataSource.toJSON(message.remote); - } - return obj; - }, - - create, I>>(base?: I): AsyncDataSource { - return AsyncDataSource.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): AsyncDataSource { - const message = createBaseAsyncDataSource(); - message.local = (object.local !== undefined && object.local !== null) - ? DataSource.fromPartial(object.local) - : undefined; - message.remote = (object.remote !== undefined && object.remote !== null) - ? RemoteDataSource.fromPartial(object.remote) - : undefined; - return message; - }, -}; - -function createBaseTransportSocket(): TransportSocket { - return { name: "", typedConfig: undefined }; -} - -export const TransportSocket: MessageFns = { - encode(message: TransportSocket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.typedConfig !== undefined) { - Any.encode(message.typedConfig, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): TransportSocket { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTransportSocket(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.typedConfig = Any.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): TransportSocket { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, - }; - }, - - toJSON(message: TransportSocket): unknown { - const obj: any = {}; - if (message.name !== "") { - obj.name = message.name; - } - if (message.typedConfig !== undefined) { - obj.typedConfig = Any.toJSON(message.typedConfig); - } - return obj; - }, - - create, I>>(base?: I): TransportSocket { - return TransportSocket.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): TransportSocket { - const message = createBaseTransportSocket(); - message.name = object.name ?? ""; - message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) - ? Any.fromPartial(object.typedConfig) - : undefined; - return message; - }, -}; - -function createBaseRuntimeFractionalPercent(): RuntimeFractionalPercent { - return { defaultValue: undefined, runtimeKey: "" }; -} - -export const RuntimeFractionalPercent: MessageFns = { - encode(message: RuntimeFractionalPercent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.defaultValue !== undefined) { - FractionalPercent.encode(message.defaultValue, writer.uint32(10).fork()).join(); - } - if (message.runtimeKey !== "") { - writer.uint32(18).string(message.runtimeKey); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RuntimeFractionalPercent { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRuntimeFractionalPercent(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.defaultValue = FractionalPercent.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.runtimeKey = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RuntimeFractionalPercent { - return { - defaultValue: isSet(object.defaultValue) ? FractionalPercent.fromJSON(object.defaultValue) : undefined, - runtimeKey: isSet(object.runtimeKey) ? globalThis.String(object.runtimeKey) : "", - }; - }, - - toJSON(message: RuntimeFractionalPercent): unknown { - const obj: any = {}; - if (message.defaultValue !== undefined) { - obj.defaultValue = FractionalPercent.toJSON(message.defaultValue); - } - if (message.runtimeKey !== "") { - obj.runtimeKey = message.runtimeKey; - } - return obj; - }, - - create, I>>(base?: I): RuntimeFractionalPercent { - return RuntimeFractionalPercent.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RuntimeFractionalPercent { - const message = createBaseRuntimeFractionalPercent(); - message.defaultValue = (object.defaultValue !== undefined && object.defaultValue !== null) - ? FractionalPercent.fromPartial(object.defaultValue) - : undefined; - message.runtimeKey = object.runtimeKey ?? ""; - return message; - }, -}; - -function createBaseControlPlane(): ControlPlane { - return { identifier: "" }; -} - -export const ControlPlane: MessageFns = { - encode(message: ControlPlane, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.identifier !== "") { - writer.uint32(10).string(message.identifier); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ControlPlane { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseControlPlane(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.identifier = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ControlPlane { - return { identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "" }; - }, - - toJSON(message: ControlPlane): unknown { - const obj: any = {}; - if (message.identifier !== "") { - obj.identifier = message.identifier; - } - return obj; - }, - - create, I>>(base?: I): ControlPlane { - return ControlPlane.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ControlPlane { - const message = createBaseControlPlane(); - message.identifier = object.identifier ?? ""; - return message; - }, -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts new file mode 100644 index 00000000..6f1eeac3 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts @@ -0,0 +1,248 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file envoy/config/core/v3/base.proto (package envoy.config.core.v3, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Any } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_any, file_google_protobuf_struct, file_google_protobuf_wrappers } from "@bufbuild/protobuf/wkt"; +import { file_envoy_annotations_deprecation } from "../../../annotations/deprecation_pb.js"; +import { file_udpa_annotations_migrate } from "../../../../udpa/annotations/migrate_pb.js"; +import { file_udpa_annotations_status } from "../../../../udpa/annotations/status_pb.js"; +import { file_udpa_annotations_versioning } from "../../../../udpa/annotations/versioning_pb.js"; +import { file_validate_validate } from "../../../../validate/validate_pb.js"; +import type { JsonObject, Message } from "@bufbuild/protobuf"; + +/** + * Describes the file envoy/config/core/v3/base.proto. + */ +export const file_envoy_config_core_v3_base: GenFile = /*@__PURE__*/ + fileDesc("Ch9lbnZveS9jb25maWcvY29yZS92My9iYXNlLnByb3RvEhRlbnZveS5jb25maWcuY29yZS52MyKQAwoITWV0YWRhdGESWQoPZmlsdGVyX21ldGFkYXRhGAEgAygLMjIuZW52b3kuY29uZmlnLmNvcmUudjMuTWV0YWRhdGEuRmlsdGVyTWV0YWRhdGFFbnRyeUIM+kIJmgEGIgRyAhABEmQKFXR5cGVkX2ZpbHRlcl9tZXRhZGF0YRgCIAMoCzI3LmVudm95LmNvbmZpZy5jb3JlLnYzLk1ldGFkYXRhLlR5cGVkRmlsdGVyTWV0YWRhdGFFbnRyeUIM+kIJmgEGIgRyAhABGk4KE0ZpbHRlck1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEiYKBXZhbHVlGAIgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdDoCOAEaUAoYVHlwZWRGaWx0ZXJNZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5Bbnk6AjgBOiGaxYgeHAoaZW52b3kuYXBpLnYyLmNvcmUuTWV0YWRhdGEitwEKC0hlYWRlclZhbHVlEh4KA2tleRgBIAEoCUIR+kIOcgwQASiAgAHIAQDAAQESMAoFdmFsdWUYAiABKAlCIfpCDHIKKICAAcgBAMABAvKY/o8FDBIKdmFsdWVfdHlwZRIwCglyYXdfdmFsdWUYAyABKAxCHfpCCHoGEAAYgIAB8pj+jwUMEgp2YWx1ZV90eXBlOiSaxYgeHwodZW52b3kuYXBpLnYyLmNvcmUuSGVhZGVyVmFsdWUiqwMKEUhlYWRlclZhbHVlT3B0aW9uEjsKBmhlYWRlchgBIAEoCzIhLmVudm95LmNvbmZpZy5jb3JlLnYzLkhlYWRlclZhbHVlQgj6QgWKAQIQARI3CgZhcHBlbmQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlQgsYAZLHhtgEAzMuMBJbCg1hcHBlbmRfYWN0aW9uGAMgASgOMjouZW52b3kuY29uZmlnLmNvcmUudjMuSGVhZGVyVmFsdWVPcHRpb24uSGVhZGVyQXBwZW5kQWN0aW9uQgj6QgWCAQIQARIYChBrZWVwX2VtcHR5X3ZhbHVlGAQgASgIIn0KEkhlYWRlckFwcGVuZEFjdGlvbhIbChdBUFBFTkRfSUZfRVhJU1RTX09SX0FERBAAEhEKDUFERF9JRl9BQlNFTlQQARIeChpPVkVSV1JJVEVfSUZfRVhJU1RTX09SX0FERBACEhcKE09WRVJXUklURV9JRl9FWElTVFMQAzoqmsWIHiUKI2Vudm95LmFwaS52Mi5jb3JlLkhlYWRlclZhbHVlT3B0aW9uImMKCUhlYWRlck1hcBIyCgdoZWFkZXJzGAEgAygLMiEuZW52b3kuY29uZmlnLmNvcmUudjMuSGVhZGVyVmFsdWU6IprFiB4dChtlbnZveS5hcGkudjIuY29yZS5IZWFkZXJNYXBCfQoiaW8uZW52b3lwcm94eS5lbnZveS5jb25maWcuY29yZS52M0IJQmFzZVByb3RvUAFaQmdpdGh1Yi5jb20vZW52b3lwcm94eS9nby1jb250cm9sLXBsYW5lL2Vudm95L2NvbmZpZy9jb3JlL3YzO2NvcmV2M7qAyNEGAhACYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_struct, file_google_protobuf_wrappers, file_envoy_annotations_deprecation, file_udpa_annotations_migrate, file_udpa_annotations_status, file_udpa_annotations_versioning, file_validate_validate]); + +/** + * Metadata provides additional inputs to filters based on matched listeners, + * filter chains, routes and endpoints. It is structured as a map, usually from + * filter name (in reverse DNS format) to metadata specific to the filter. Metadata + * key-values for a filter are merged as connection and request handling occurs, + * with later values for the same key overriding earlier values. + * + * An example use of metadata is providing additional values to + * http_connection_manager in the envoy.http_connection_manager.access_log + * namespace. + * + * Another example use of metadata is to per service config info in cluster metadata, which may get + * consumed by multiple filters. + * + * For load balancing, Metadata provides a means to subset cluster endpoints. + * Endpoints have a Metadata object associated and routes contain a Metadata + * object to match against. There are some well defined metadata used today for + * this purpose: + * + * * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an + * endpoint and is also used during header processing + * (x-envoy-upstream-canary) and for stats purposes. + * [#next-major-version: move to type/metadata/v2] + * + * @generated from message envoy.config.core.v3.Metadata + */ +export type Metadata = Message<"envoy.config.core.v3.Metadata"> & { + /** + * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` + * namespace is reserved for Envoy's built-in filters. + * If both ``filter_metadata`` and + * :ref:`typed_filter_metadata ` + * fields are present in the metadata with same keys, + * only ``typed_filter_metadata`` field will be parsed. + * + * @generated from field: map filter_metadata = 1; + */ + filterMetadata: { [key: string]: JsonObject }; + + /** + * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` + * namespace is reserved for Envoy's built-in filters. + * The value is encoded as google.protobuf.Any. + * If both :ref:`filter_metadata ` + * and ``typed_filter_metadata`` fields are present in the metadata with same keys, + * only ``typed_filter_metadata`` field will be parsed. + * + * @generated from field: map typed_filter_metadata = 2; + */ + typedFilterMetadata: { [key: string]: Any }; +}; + +/** + * Describes the message envoy.config.core.v3.Metadata. + * Use `create(MetadataSchema)` to create a new message. + */ +export const MetadataSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_config_core_v3_base, 0); + +/** + * Header name/value pair. + * + * @generated from message envoy.config.core.v3.HeaderValue + */ +export type HeaderValue = Message<"envoy.config.core.v3.HeaderValue"> & { + /** + * Header name. + * + * @generated from field: string key = 1; + */ + key: string; + + /** + * Header value. + * + * The same :ref:`format specifier ` as used for + * :ref:`HTTP access logging ` applies here, however + * unknown header values are replaced with the empty string instead of ``-``. + * Header value is encoded as string. This does not work for non-utf8 characters. + * Only one of ``value`` or ``raw_value`` can be set. + * + * @generated from field: string value = 2; + */ + value: string; + + /** + * Header value is encoded as bytes which can support non-utf8 characters. + * Only one of ``value`` or ``raw_value`` can be set. + * + * @generated from field: bytes raw_value = 3; + */ + rawValue: Uint8Array; +}; + +/** + * Describes the message envoy.config.core.v3.HeaderValue. + * Use `create(HeaderValueSchema)` to create a new message. + */ +export const HeaderValueSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_config_core_v3_base, 1); + +/** + * Header name/value pair plus option to control append behavior. + * + * @generated from message envoy.config.core.v3.HeaderValueOption + */ +export type HeaderValueOption = Message<"envoy.config.core.v3.HeaderValueOption"> & { + /** + * Header name/value pair that this option applies to. + * + * @generated from field: envoy.config.core.v3.HeaderValue header = 1; + */ + header?: HeaderValue; + + /** + * Should the value be appended? If true (default), the value is appended to + * existing values. Otherwise it replaces any existing values. + * This field is deprecated and please use + * :ref:`append_action ` as replacement. + * + * .. note:: + * The :ref:`external authorization service ` and + * :ref:`external processor service ` have + * default value (``false``) for this field. + * + * @generated from field: google.protobuf.BoolValue append = 2 [deprecated = true]; + * @deprecated + */ + append?: boolean; + + /** + * Describes the action taken to append/overwrite the given value for an existing header + * or to only add this header if it's absent. + * Value defaults to :ref:`APPEND_IF_EXISTS_OR_ADD + * `. + * + * @generated from field: envoy.config.core.v3.HeaderValueOption.HeaderAppendAction append_action = 3; + */ + appendAction: HeaderValueOption_HeaderAppendAction; + + /** + * Is the header value allowed to be empty? If false (default), custom headers with empty values are dropped, + * otherwise they are added. + * + * @generated from field: bool keep_empty_value = 4; + */ + keepEmptyValue: boolean; +}; + +/** + * Describes the message envoy.config.core.v3.HeaderValueOption. + * Use `create(HeaderValueOptionSchema)` to create a new message. + */ +export const HeaderValueOptionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_config_core_v3_base, 2); + +/** + * Describes the supported actions types for header append action. + * + * @generated from enum envoy.config.core.v3.HeaderValueOption.HeaderAppendAction + */ +export enum HeaderValueOption_HeaderAppendAction { + /** + * If the header already exists, this action will result in: + * + * - Comma-concatenated for predefined inline headers. + * - Duplicate header added in the ``HeaderMap`` for other headers. + * + * If the header doesn't exist then this will add new header with specified key and value. + * + * @generated from enum value: APPEND_IF_EXISTS_OR_ADD = 0; + */ + APPEND_IF_EXISTS_OR_ADD = 0, + + /** + * This action will add the header if it doesn't already exist. If the header + * already exists then this will be a no-op. + * + * @generated from enum value: ADD_IF_ABSENT = 1; + */ + ADD_IF_ABSENT = 1, + + /** + * This action will overwrite the specified value by discarding any existing values if + * the header already exists. If the header doesn't exist then this will add the header + * with specified key and value. + * + * @generated from enum value: OVERWRITE_IF_EXISTS_OR_ADD = 2; + */ + OVERWRITE_IF_EXISTS_OR_ADD = 2, + + /** + * This action will overwrite the specified value by discarding any existing values if + * the header already exists. If the header doesn't exist then this will be no-op. + * + * @generated from enum value: OVERWRITE_IF_EXISTS = 3; + */ + OVERWRITE_IF_EXISTS = 3, +} + +/** + * Describes the enum envoy.config.core.v3.HeaderValueOption.HeaderAppendAction. + */ +export const HeaderValueOption_HeaderAppendActionSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_envoy_config_core_v3_base, 2, 0); + +/** + * Wrapper for a set of headers. + * + * @generated from message envoy.config.core.v3.HeaderMap + */ +export type HeaderMap = Message<"envoy.config.core.v3.HeaderMap"> & { + /** + * A list of header names and their values. + * + * @generated from field: repeated envoy.config.core.v3.HeaderValue headers = 1; + */ + headers: HeaderValue[]; +}; + +/** + * Describes the message envoy.config.core.v3.HeaderMap. + * Use `create(HeaderMapSchema)` to create a new message. + */ +export const HeaderMapSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_config_core_v3_base, 3); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts deleted file mode 100644 index b2189ad1..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/extension.ts +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/config/core/v3/extension.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { Any } from "../../../../google/protobuf/any.js"; - -export const protobufPackage = "envoy.config.core.v3"; - -/** - * Message type for extension configuration. - * [#next-major-version: revisit all existing typed_config that doesn't use this wrapper.]. - */ -export interface TypedExtensionConfig { - /** - * The name of an extension. This is not used to select the extension, instead - * it serves the role of an opaque identifier. - */ - name: string; - /** - * The typed config for the extension. The type URL will be used to identify - * the extension. In the case that the type URL is ``xds.type.v3.TypedStruct`` - * (or, for historical reasons, ``udpa.type.v1.TypedStruct``), the inner type - * URL of ``TypedStruct`` will be utilized. See the - * :ref:`extension configuration overview - * ` for further details. - */ - typedConfig: Any | undefined; -} - -function createBaseTypedExtensionConfig(): TypedExtensionConfig { - return { name: "", typedConfig: undefined }; -} - -export const TypedExtensionConfig: MessageFns = { - encode(message: TypedExtensionConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.typedConfig !== undefined) { - Any.encode(message.typedConfig, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): TypedExtensionConfig { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTypedExtensionConfig(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.typedConfig = Any.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): TypedExtensionConfig { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - typedConfig: isSet(object.typedConfig) ? Any.fromJSON(object.typedConfig) : undefined, - }; - }, - - toJSON(message: TypedExtensionConfig): unknown { - const obj: any = {}; - if (message.name !== "") { - obj.name = message.name; - } - if (message.typedConfig !== undefined) { - obj.typedConfig = Any.toJSON(message.typedConfig); - } - return obj; - }, - - create, I>>(base?: I): TypedExtensionConfig { - return TypedExtensionConfig.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): TypedExtensionConfig { - const message = createBaseTypedExtensionConfig(); - message.name = object.name ?? ""; - message.typedConfig = (object.typedConfig !== undefined && object.typedConfig !== null) - ? Any.fromPartial(object.typedConfig) - : undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts deleted file mode 100644 index 93497d1c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/http_uri.ts +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/config/core/v3/http_uri.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { Duration } from "../../../../google/protobuf/duration.js"; - -export const protobufPackage = "envoy.config.core.v3"; - -/** Envoy external URI descriptor */ -export interface HttpUri { - /** - * The HTTP server URI. It should be a full FQDN with protocol, host and path. - * - * Example: - * - * .. code-block:: yaml - * - * uri: https://www.googleapis.com/oauth2/v1/certs - */ - uri: string; - /** - * A cluster is created in the Envoy "cluster_manager" config - * section. This field specifies the cluster name. - * - * Example: - * - * .. code-block:: yaml - * - * cluster: jwks_cluster - */ - cluster?: - | string - | undefined; - /** Sets the maximum duration in milliseconds that a response can take to arrive upon request. */ - timeout: Duration | undefined; -} - -function createBaseHttpUri(): HttpUri { - return { uri: "", cluster: undefined, timeout: undefined }; -} - -export const HttpUri: MessageFns = { - encode(message: HttpUri, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.uri !== "") { - writer.uint32(10).string(message.uri); - } - if (message.cluster !== undefined) { - writer.uint32(18).string(message.cluster); - } - if (message.timeout !== undefined) { - Duration.encode(message.timeout, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HttpUri { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpUri(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.uri = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.cluster = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.timeout = Duration.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HttpUri { - return { - uri: isSet(object.uri) ? globalThis.String(object.uri) : "", - cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : undefined, - timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined, - }; - }, - - toJSON(message: HttpUri): unknown { - const obj: any = {}; - if (message.uri !== "") { - obj.uri = message.uri; - } - if (message.cluster !== undefined) { - obj.cluster = message.cluster; - } - if (message.timeout !== undefined) { - obj.timeout = Duration.toJSON(message.timeout); - } - return obj; - }, - - create, I>>(base?: I): HttpUri { - return HttpUri.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpUri { - const message = createBaseHttpUri(); - message.uri = object.uri ?? ""; - message.cluster = object.cluster ?? undefined; - message.timeout = (object.timeout !== undefined && object.timeout !== null) - ? Duration.fromPartial(object.timeout) - : undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts deleted file mode 100644 index b1fbc895..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/socket_option.ts +++ /dev/null @@ -1,585 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/config/core/v3/socket_option.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "envoy.config.core.v3"; - -/** - * Generic socket option message. This would be used to set socket options that - * might not exist in upstream kernels or precompiled Envoy binaries. - * - * For example: - * - * .. code-block:: json - * - * { - * "description": "support tcp keep alive", - * "state": 0, - * "level": 1, - * "name": 9, - * "int_value": 1, - * } - * - * 1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux. - * With the above configuration, `TCP Keep-Alives `_ - * can be enabled in socket with Linux, which can be used in - * :ref:`listener's` or - * :ref:`admin's ` socket_options etc. - * - * It should be noted that the name or level may have different values on different platforms. - * [#next-free-field: 8] - */ -export interface SocketOption { - /** - * An optional name to give this socket option for debugging, etc. - * Uniqueness is not required and no special meaning is assumed. - */ - description: string; - /** Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP */ - level: string; - /** The numeric name as passed to setsockopt */ - name: string; - /** Because many sockopts take an int value. */ - intValue?: - | string - | undefined; - /** Otherwise it's a byte buffer. */ - bufValue?: - | Uint8Array - | undefined; - /** - * The state in which the option will be applied. When used in BindConfig - * STATE_PREBIND is currently the only valid value. - */ - state: SocketOption_SocketState; - /** - * Apply the socket option to the specified `socket type `_. - * If not specified, the socket option will be applied to all socket types. - */ - type: SocketOption_SocketType | undefined; -} - -export enum SocketOption_SocketState { - /** STATE_PREBIND - Socket options are applied after socket creation but before binding the socket to a port */ - STATE_PREBIND = 0, - /** STATE_BOUND - Socket options are applied after binding the socket to a port but before calling listen() */ - STATE_BOUND = 1, - /** STATE_LISTENING - Socket options are applied after calling listen() */ - STATE_LISTENING = 2, - UNRECOGNIZED = -1, -} - -export function socketOption_SocketStateFromJSON(object: any): SocketOption_SocketState { - switch (object) { - case 0: - case "STATE_PREBIND": - return SocketOption_SocketState.STATE_PREBIND; - case 1: - case "STATE_BOUND": - return SocketOption_SocketState.STATE_BOUND; - case 2: - case "STATE_LISTENING": - return SocketOption_SocketState.STATE_LISTENING; - case -1: - case "UNRECOGNIZED": - default: - return SocketOption_SocketState.UNRECOGNIZED; - } -} - -export function socketOption_SocketStateToJSON(object: SocketOption_SocketState): string { - switch (object) { - case SocketOption_SocketState.STATE_PREBIND: - return "STATE_PREBIND"; - case SocketOption_SocketState.STATE_BOUND: - return "STATE_BOUND"; - case SocketOption_SocketState.STATE_LISTENING: - return "STATE_LISTENING"; - case SocketOption_SocketState.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * The `socket type `_ to apply the socket option to. - * Only one field should be set. If multiple fields are set, the precedence order will determine - * the selected one. If none of the fields is set, the socket option will be applied to all socket types. - * - * For example: - * If :ref:`stream ` is set, - * it takes precedence over :ref:`datagram `. - */ -export interface SocketOption_SocketType { - /** Apply the socket option to the stream socket type. */ - stream: - | SocketOption_SocketType_Stream - | undefined; - /** Apply the socket option to the datagram socket type. */ - datagram: SocketOption_SocketType_Datagram | undefined; -} - -/** The stream socket type. */ -export interface SocketOption_SocketType_Stream { -} - -/** The datagram socket type. */ -export interface SocketOption_SocketType_Datagram { -} - -export interface SocketOptionsOverride { - socketOptions: SocketOption[]; -} - -function createBaseSocketOption(): SocketOption { - return { - description: "", - level: "0", - name: "0", - intValue: undefined, - bufValue: undefined, - state: 0, - type: undefined, - }; -} - -export const SocketOption: MessageFns = { - encode(message: SocketOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.description !== "") { - writer.uint32(10).string(message.description); - } - if (message.level !== "0") { - writer.uint32(16).int64(message.level); - } - if (message.name !== "0") { - writer.uint32(24).int64(message.name); - } - if (message.intValue !== undefined) { - writer.uint32(32).int64(message.intValue); - } - if (message.bufValue !== undefined) { - writer.uint32(42).bytes(message.bufValue); - } - if (message.state !== 0) { - writer.uint32(48).int32(message.state); - } - if (message.type !== undefined) { - SocketOption_SocketType.encode(message.type, writer.uint32(58).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SocketOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSocketOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.description = reader.string(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.level = reader.int64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.name = reader.int64().toString(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.intValue = reader.int64().toString(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.bufValue = reader.bytes(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.state = reader.int32() as any; - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.type = SocketOption_SocketType.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SocketOption { - return { - description: isSet(object.description) ? globalThis.String(object.description) : "", - level: isSet(object.level) ? globalThis.String(object.level) : "0", - name: isSet(object.name) ? globalThis.String(object.name) : "0", - intValue: isSet(object.intValue) ? globalThis.String(object.intValue) : undefined, - bufValue: isSet(object.bufValue) ? bytesFromBase64(object.bufValue) : undefined, - state: isSet(object.state) ? socketOption_SocketStateFromJSON(object.state) : 0, - type: isSet(object.type) ? SocketOption_SocketType.fromJSON(object.type) : undefined, - }; - }, - - toJSON(message: SocketOption): unknown { - const obj: any = {}; - if (message.description !== "") { - obj.description = message.description; - } - if (message.level !== "0") { - obj.level = message.level; - } - if (message.name !== "0") { - obj.name = message.name; - } - if (message.intValue !== undefined) { - obj.intValue = message.intValue; - } - if (message.bufValue !== undefined) { - obj.bufValue = base64FromBytes(message.bufValue); - } - if (message.state !== 0) { - obj.state = socketOption_SocketStateToJSON(message.state); - } - if (message.type !== undefined) { - obj.type = SocketOption_SocketType.toJSON(message.type); - } - return obj; - }, - - create, I>>(base?: I): SocketOption { - return SocketOption.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SocketOption { - const message = createBaseSocketOption(); - message.description = object.description ?? ""; - message.level = object.level ?? "0"; - message.name = object.name ?? "0"; - message.intValue = object.intValue ?? undefined; - message.bufValue = object.bufValue ?? undefined; - message.state = object.state ?? 0; - message.type = (object.type !== undefined && object.type !== null) - ? SocketOption_SocketType.fromPartial(object.type) - : undefined; - return message; - }, -}; - -function createBaseSocketOption_SocketType(): SocketOption_SocketType { - return { stream: undefined, datagram: undefined }; -} - -export const SocketOption_SocketType: MessageFns = { - encode(message: SocketOption_SocketType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.stream !== undefined) { - SocketOption_SocketType_Stream.encode(message.stream, writer.uint32(10).fork()).join(); - } - if (message.datagram !== undefined) { - SocketOption_SocketType_Datagram.encode(message.datagram, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SocketOption_SocketType { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSocketOption_SocketType(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.stream = SocketOption_SocketType_Stream.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.datagram = SocketOption_SocketType_Datagram.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SocketOption_SocketType { - return { - stream: isSet(object.stream) ? SocketOption_SocketType_Stream.fromJSON(object.stream) : undefined, - datagram: isSet(object.datagram) ? SocketOption_SocketType_Datagram.fromJSON(object.datagram) : undefined, - }; - }, - - toJSON(message: SocketOption_SocketType): unknown { - const obj: any = {}; - if (message.stream !== undefined) { - obj.stream = SocketOption_SocketType_Stream.toJSON(message.stream); - } - if (message.datagram !== undefined) { - obj.datagram = SocketOption_SocketType_Datagram.toJSON(message.datagram); - } - return obj; - }, - - create, I>>(base?: I): SocketOption_SocketType { - return SocketOption_SocketType.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SocketOption_SocketType { - const message = createBaseSocketOption_SocketType(); - message.stream = (object.stream !== undefined && object.stream !== null) - ? SocketOption_SocketType_Stream.fromPartial(object.stream) - : undefined; - message.datagram = (object.datagram !== undefined && object.datagram !== null) - ? SocketOption_SocketType_Datagram.fromPartial(object.datagram) - : undefined; - return message; - }, -}; - -function createBaseSocketOption_SocketType_Stream(): SocketOption_SocketType_Stream { - return {}; -} - -export const SocketOption_SocketType_Stream: MessageFns = { - encode(_: SocketOption_SocketType_Stream, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SocketOption_SocketType_Stream { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSocketOption_SocketType_Stream(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(_: any): SocketOption_SocketType_Stream { - return {}; - }, - - toJSON(_: SocketOption_SocketType_Stream): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>(base?: I): SocketOption_SocketType_Stream { - return SocketOption_SocketType_Stream.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(_: I): SocketOption_SocketType_Stream { - const message = createBaseSocketOption_SocketType_Stream(); - return message; - }, -}; - -function createBaseSocketOption_SocketType_Datagram(): SocketOption_SocketType_Datagram { - return {}; -} - -export const SocketOption_SocketType_Datagram: MessageFns = { - encode(_: SocketOption_SocketType_Datagram, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SocketOption_SocketType_Datagram { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSocketOption_SocketType_Datagram(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(_: any): SocketOption_SocketType_Datagram { - return {}; - }, - - toJSON(_: SocketOption_SocketType_Datagram): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>( - base?: I, - ): SocketOption_SocketType_Datagram { - return SocketOption_SocketType_Datagram.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - _: I, - ): SocketOption_SocketType_Datagram { - const message = createBaseSocketOption_SocketType_Datagram(); - return message; - }, -}; - -function createBaseSocketOptionsOverride(): SocketOptionsOverride { - return { socketOptions: [] }; -} - -export const SocketOptionsOverride: MessageFns = { - encode(message: SocketOptionsOverride, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.socketOptions) { - SocketOption.encode(v!, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SocketOptionsOverride { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSocketOptionsOverride(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.socketOptions.push(SocketOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SocketOptionsOverride { - return { - socketOptions: globalThis.Array.isArray(object?.socketOptions) - ? object.socketOptions.map((e: any) => SocketOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: SocketOptionsOverride): unknown { - const obj: any = {}; - if (message.socketOptions?.length) { - obj.socketOptions = message.socketOptions.map((e) => SocketOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): SocketOptionsOverride { - return SocketOptionsOverride.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SocketOptionsOverride { - const message = createBaseSocketOptionsOverride(); - message.socketOptions = object.socketOptions?.map((e) => SocketOption.fromPartial(e)) || []; - return message; - }, -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts deleted file mode 100644 index a024e3b9..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode.ts +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "envoy.extensions.filters.http.ext_proc.v3"; - -/** [#next-free-field: 7] */ -export interface ProcessingMode { - /** - * How to handle the request header. Default is "SEND". - * Note this field is ignored in :ref:`mode_override - * `, since mode - * overrides can only affect messages exchanged after the request header is processed. - */ - requestHeaderMode: ProcessingMode_HeaderSendMode; - /** How to handle the response header. Default is "SEND". */ - responseHeaderMode: ProcessingMode_HeaderSendMode; - /** How to handle the request body. Default is "NONE". */ - requestBodyMode: ProcessingMode_BodySendMode; - /** How do handle the response body. Default is "NONE". */ - responseBodyMode: ProcessingMode_BodySendMode; - /** How to handle the request trailers. Default is "SKIP". */ - requestTrailerMode: ProcessingMode_HeaderSendMode; - /** How to handle the response trailers. Default is "SKIP". */ - responseTrailerMode: ProcessingMode_HeaderSendMode; -} - -/** Control how headers and trailers are handled */ -export enum ProcessingMode_HeaderSendMode { - /** - * DEFAULT - When used to configure the ext_proc filter :ref:`processing_mode - * `, - * the default HeaderSendMode depends on which part of the message is being processed. By - * default, request and response headers are sent, while trailers are skipped. - * - * When used in :ref:`mode_override - * ` or - * :ref:`allowed_override_modes - * `, - * a value of DEFAULT indicates that there is no change from the behavior that is configured for - * the filter in :ref:`processing_mode - * `. - */ - DEFAULT = 0, - /** SEND - Send the header or trailer. */ - SEND = 1, - /** SKIP - Do not send the header or trailer. */ - SKIP = 2, - UNRECOGNIZED = -1, -} - -export function processingMode_HeaderSendModeFromJSON(object: any): ProcessingMode_HeaderSendMode { - switch (object) { - case 0: - case "DEFAULT": - return ProcessingMode_HeaderSendMode.DEFAULT; - case 1: - case "SEND": - return ProcessingMode_HeaderSendMode.SEND; - case 2: - case "SKIP": - return ProcessingMode_HeaderSendMode.SKIP; - case -1: - case "UNRECOGNIZED": - default: - return ProcessingMode_HeaderSendMode.UNRECOGNIZED; - } -} - -export function processingMode_HeaderSendModeToJSON(object: ProcessingMode_HeaderSendMode): string { - switch (object) { - case ProcessingMode_HeaderSendMode.DEFAULT: - return "DEFAULT"; - case ProcessingMode_HeaderSendMode.SEND: - return "SEND"; - case ProcessingMode_HeaderSendMode.SKIP: - return "SKIP"; - case ProcessingMode_HeaderSendMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * Control how the request and response bodies are handled - * When body mutation by external processor is enabled, ext_proc filter will always remove - * the content length header in four cases below because content length can not be guaranteed - * to be set correctly: - * 1) STREAMED BodySendMode: header processing completes before body mutation comes back. - * 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. - * 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. - * 4) FULL_DUPLEX_STREAMED BodySendMode: header processing completes before body mutation comes back. - * - * In Envoy's http1 codec implementation, removing content length will enable chunked transfer - * encoding whenever feasible. The recipient (either client or server) must be able - * to parse and decode the chunked transfer coding. - * (see `details in RFC9112 `_). - * - * In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is - * external processor's responsibility to set the content length correctly matched to the length - * of mutated body. If they don't match, the corresponding body mutation will be rejected and - * local reply will be sent with an error message. - */ -export enum ProcessingMode_BodySendMode { - /** NONE - Do not send the body at all. This is the default. */ - NONE = 0, - /** STREAMED - Stream the body to the server in pieces as they are seen. */ - STREAMED = 1, - /** - * BUFFERED - Buffer the message body in memory and send the entire body at once. - * If the body exceeds the configured buffer limit, then the - * downstream system will receive an error. - */ - BUFFERED = 2, - /** - * BUFFERED_PARTIAL - Buffer the message body in memory and send the entire body in one - * chunk. If the body exceeds the configured buffer limit, then the body contents - * up to the buffer limit will be sent. - */ - BUFFERED_PARTIAL = 3, - FULL_DUPLEX_STREAMED = 4, - UNRECOGNIZED = -1, -} - -export function processingMode_BodySendModeFromJSON(object: any): ProcessingMode_BodySendMode { - switch (object) { - case 0: - case "NONE": - return ProcessingMode_BodySendMode.NONE; - case 1: - case "STREAMED": - return ProcessingMode_BodySendMode.STREAMED; - case 2: - case "BUFFERED": - return ProcessingMode_BodySendMode.BUFFERED; - case 3: - case "BUFFERED_PARTIAL": - return ProcessingMode_BodySendMode.BUFFERED_PARTIAL; - case 4: - case "FULL_DUPLEX_STREAMED": - return ProcessingMode_BodySendMode.FULL_DUPLEX_STREAMED; - case -1: - case "UNRECOGNIZED": - default: - return ProcessingMode_BodySendMode.UNRECOGNIZED; - } -} - -export function processingMode_BodySendModeToJSON(object: ProcessingMode_BodySendMode): string { - switch (object) { - case ProcessingMode_BodySendMode.NONE: - return "NONE"; - case ProcessingMode_BodySendMode.STREAMED: - return "STREAMED"; - case ProcessingMode_BodySendMode.BUFFERED: - return "BUFFERED"; - case ProcessingMode_BodySendMode.BUFFERED_PARTIAL: - return "BUFFERED_PARTIAL"; - case ProcessingMode_BodySendMode.FULL_DUPLEX_STREAMED: - return "FULL_DUPLEX_STREAMED"; - case ProcessingMode_BodySendMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -function createBaseProcessingMode(): ProcessingMode { - return { - requestHeaderMode: 0, - responseHeaderMode: 0, - requestBodyMode: 0, - responseBodyMode: 0, - requestTrailerMode: 0, - responseTrailerMode: 0, - }; -} - -export const ProcessingMode: MessageFns = { - encode(message: ProcessingMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.requestHeaderMode !== 0) { - writer.uint32(8).int32(message.requestHeaderMode); - } - if (message.responseHeaderMode !== 0) { - writer.uint32(16).int32(message.responseHeaderMode); - } - if (message.requestBodyMode !== 0) { - writer.uint32(24).int32(message.requestBodyMode); - } - if (message.responseBodyMode !== 0) { - writer.uint32(32).int32(message.responseBodyMode); - } - if (message.requestTrailerMode !== 0) { - writer.uint32(40).int32(message.requestTrailerMode); - } - if (message.responseTrailerMode !== 0) { - writer.uint32(48).int32(message.responseTrailerMode); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ProcessingMode { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessingMode(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.requestHeaderMode = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.responseHeaderMode = reader.int32() as any; - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.requestBodyMode = reader.int32() as any; - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.responseBodyMode = reader.int32() as any; - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.requestTrailerMode = reader.int32() as any; - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.responseTrailerMode = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ProcessingMode { - return { - requestHeaderMode: isSet(object.requestHeaderMode) - ? processingMode_HeaderSendModeFromJSON(object.requestHeaderMode) - : 0, - responseHeaderMode: isSet(object.responseHeaderMode) - ? processingMode_HeaderSendModeFromJSON(object.responseHeaderMode) - : 0, - requestBodyMode: isSet(object.requestBodyMode) ? processingMode_BodySendModeFromJSON(object.requestBodyMode) : 0, - responseBodyMode: isSet(object.responseBodyMode) - ? processingMode_BodySendModeFromJSON(object.responseBodyMode) - : 0, - requestTrailerMode: isSet(object.requestTrailerMode) - ? processingMode_HeaderSendModeFromJSON(object.requestTrailerMode) - : 0, - responseTrailerMode: isSet(object.responseTrailerMode) - ? processingMode_HeaderSendModeFromJSON(object.responseTrailerMode) - : 0, - }; - }, - - toJSON(message: ProcessingMode): unknown { - const obj: any = {}; - if (message.requestHeaderMode !== 0) { - obj.requestHeaderMode = processingMode_HeaderSendModeToJSON(message.requestHeaderMode); - } - if (message.responseHeaderMode !== 0) { - obj.responseHeaderMode = processingMode_HeaderSendModeToJSON(message.responseHeaderMode); - } - if (message.requestBodyMode !== 0) { - obj.requestBodyMode = processingMode_BodySendModeToJSON(message.requestBodyMode); - } - if (message.responseBodyMode !== 0) { - obj.responseBodyMode = processingMode_BodySendModeToJSON(message.responseBodyMode); - } - if (message.requestTrailerMode !== 0) { - obj.requestTrailerMode = processingMode_HeaderSendModeToJSON(message.requestTrailerMode); - } - if (message.responseTrailerMode !== 0) { - obj.responseTrailerMode = processingMode_HeaderSendModeToJSON(message.responseTrailerMode); - } - return obj; - }, - - create, I>>(base?: I): ProcessingMode { - return ProcessingMode.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ProcessingMode { - const message = createBaseProcessingMode(); - message.requestHeaderMode = object.requestHeaderMode ?? 0; - message.responseHeaderMode = object.responseHeaderMode ?? 0; - message.requestBodyMode = object.requestBodyMode ?? 0; - message.responseBodyMode = object.responseBodyMode ?? 0; - message.requestTrailerMode = object.requestTrailerMode ?? 0; - message.responseTrailerMode = object.responseTrailerMode ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts new file mode 100644 index 00000000..90f331bf --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts @@ -0,0 +1,188 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto (package envoy.extensions.filters.http.ext_proc.v3, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_udpa_annotations_status } from "../../../../../../udpa/annotations/status_pb.js"; +import { file_validate_validate } from "../../../../../../validate/validate_pb.js"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto. + */ +export const file_envoy_extensions_filters_http_ext_proc_v3_processing_mode: GenFile = /*@__PURE__*/ + fileDesc("Cj9lbnZveS9leHRlbnNpb25zL2ZpbHRlcnMvaHR0cC9leHRfcHJvYy92My9wcm9jZXNzaW5nX21vZGUucHJvdG8SKWVudm95LmV4dGVuc2lvbnMuZmlsdGVycy5odHRwLmV4dF9wcm9jLnYzIswGCg5Qcm9jZXNzaW5nTW9kZRJvChNyZXF1ZXN0X2hlYWRlcl9tb2RlGAEgASgOMkguZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuSGVhZGVyU2VuZE1vZGVCCPpCBYIBAhABEnAKFHJlc3BvbnNlX2hlYWRlcl9tb2RlGAIgASgOMkguZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuSGVhZGVyU2VuZE1vZGVCCPpCBYIBAhABEmsKEXJlcXVlc3RfYm9keV9tb2RlGAMgASgOMkYuZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuQm9keVNlbmRNb2RlQgj6QgWCAQIQARJsChJyZXNwb25zZV9ib2R5X21vZGUYBCABKA4yRi5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52My5Qcm9jZXNzaW5nTW9kZS5Cb2R5U2VuZE1vZGVCCPpCBYIBAhABEnAKFHJlcXVlc3RfdHJhaWxlcl9tb2RlGAUgASgOMkguZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuSGVhZGVyU2VuZE1vZGVCCPpCBYIBAhABEnEKFXJlc3BvbnNlX3RyYWlsZXJfbW9kZRgGIAEoDjJILmVudm95LmV4dGVuc2lvbnMuZmlsdGVycy5odHRwLmV4dF9wcm9jLnYzLlByb2Nlc3NpbmdNb2RlLkhlYWRlclNlbmRNb2RlQgj6QgWCAQIQASIxCg5IZWFkZXJTZW5kTW9kZRILCgdERUZBVUxUEAASCAoEU0VORBABEggKBFNLSVAQAiJkCgxCb2R5U2VuZE1vZGUSCAoETk9ORRAAEgwKCFNUUkVBTUVEEAESDAoIQlVGRkVSRUQQAhIUChBCVUZGRVJFRF9QQVJUSUFMEAMSGAoURlVMTF9EVVBMRVhfU1RSRUFNRUQQBEK1AQo3aW8uZW52b3lwcm94eS5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52M0ITUHJvY2Vzc2luZ01vZGVQcm90b1ABWltnaXRodWIuY29tL2Vudm95cHJveHkvZ28tY29udHJvbC1wbGFuZS9lbnZveS9leHRlbnNpb25zL2ZpbHRlcnMvaHR0cC9leHRfcHJvYy92MztleHRfcHJvY3YzuoDI0QYCEAJiBnByb3RvMw", [file_udpa_annotations_status, file_validate_validate]); + +/** + * [#next-free-field: 7] + * + * @generated from message envoy.extensions.filters.http.ext_proc.v3.ProcessingMode + */ +export type ProcessingMode = Message<"envoy.extensions.filters.http.ext_proc.v3.ProcessingMode"> & { + /** + * How to handle the request header. Default is "SEND". + * Note this field is ignored in :ref:`mode_override + * `, since mode + * overrides can only affect messages exchanged after the request header is processed. + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode request_header_mode = 1; + */ + requestHeaderMode: ProcessingMode_HeaderSendMode; + + /** + * How to handle the response header. Default is "SEND". + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode response_header_mode = 2; + */ + responseHeaderMode: ProcessingMode_HeaderSendMode; + + /** + * How to handle the request body. Default is "NONE". + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode request_body_mode = 3; + */ + requestBodyMode: ProcessingMode_BodySendMode; + + /** + * How do handle the response body. Default is "NONE". + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode response_body_mode = 4; + */ + responseBodyMode: ProcessingMode_BodySendMode; + + /** + * How to handle the request trailers. Default is "SKIP". + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode request_trailer_mode = 5; + */ + requestTrailerMode: ProcessingMode_HeaderSendMode; + + /** + * How to handle the response trailers. Default is "SKIP". + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode response_trailer_mode = 6; + */ + responseTrailerMode: ProcessingMode_HeaderSendMode; +}; + +/** + * Describes the message envoy.extensions.filters.http.ext_proc.v3.ProcessingMode. + * Use `create(ProcessingModeSchema)` to create a new message. + */ +export const ProcessingModeSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, 0); + +/** + * Control how headers and trailers are handled + * + * @generated from enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode + */ +export enum ProcessingMode_HeaderSendMode { + /** + * When used to configure the ext_proc filter :ref:`processing_mode + * `, + * the default HeaderSendMode depends on which part of the message is being processed. By + * default, request and response headers are sent, while trailers are skipped. + * + * When used in :ref:`mode_override + * ` or + * :ref:`allowed_override_modes + * `, + * a value of DEFAULT indicates that there is no change from the behavior that is configured for + * the filter in :ref:`processing_mode + * `. + * + * @generated from enum value: DEFAULT = 0; + */ + DEFAULT = 0, + + /** + * Send the header or trailer. + * + * @generated from enum value: SEND = 1; + */ + SEND = 1, + + /** + * Do not send the header or trailer. + * + * @generated from enum value: SKIP = 2; + */ + SKIP = 2, +} + +/** + * Describes the enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode. + */ +export const ProcessingMode_HeaderSendModeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, 0, 0); + +/** + * Control how the request and response bodies are handled + * When body mutation by external processor is enabled, ext_proc filter will always remove + * the content length header in four cases below because content length can not be guaranteed + * to be set correctly: + * 1) STREAMED BodySendMode: header processing completes before body mutation comes back. + * 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. + * 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. + * 4) FULL_DUPLEX_STREAMED BodySendMode: header processing completes before body mutation comes back. + * + * In Envoy's http1 codec implementation, removing content length will enable chunked transfer + * encoding whenever feasible. The recipient (either client or server) must be able + * to parse and decode the chunked transfer coding. + * (see `details in RFC9112 `_). + * + * In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is + * external processor's responsibility to set the content length correctly matched to the length + * of mutated body. If they don't match, the corresponding body mutation will be rejected and + * local reply will be sent with an error message. + * + * @generated from enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode + */ +export enum ProcessingMode_BodySendMode { + /** + * Do not send the body at all. This is the default. + * + * @generated from enum value: NONE = 0; + */ + NONE = 0, + + /** + * Stream the body to the server in pieces as they arrive at the + * proxy. + * + * @generated from enum value: STREAMED = 1; + */ + STREAMED = 1, + + /** + * Buffer the message body in memory and send the entire body at once. + * If the body exceeds the configured buffer limit, then the + * downstream system will receive an error. + * + * @generated from enum value: BUFFERED = 2; + */ + BUFFERED = 2, + + /** + * Buffer the message body in memory and send the entire body in one + * chunk. If the body exceeds the configured buffer limit, then the body contents + * up to the buffer limit will be sent. + * + * @generated from enum value: BUFFERED_PARTIAL = 3; + */ + BUFFERED_PARTIAL = 3, + + /** + * @generated from enum value: FULL_DUPLEX_STREAMED = 4; + */ + FULL_DUPLEX_STREAMED = 4, +} + +/** + * Describes the enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode. + */ +export const ProcessingMode_BodySendModeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, 0, 1); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts deleted file mode 100644 index 3afd1ece..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor.ts +++ /dev/null @@ -1,2456 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/service/ext_proc/v3/external_processor.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { - type CallOptions, - type ChannelCredentials, - Client, - type ClientDuplexStream, - type ClientOptions, - type handleBidiStreamingCall, - makeGenericClientConstructor, - type Metadata, - type UntypedServiceImplementation, -} from "@grpc/grpc-js"; -import { Duration } from "../../../../google/protobuf/duration.js"; -import { Struct } from "../../../../google/protobuf/struct.js"; -import { HeaderMap, HeaderValueOption, Metadata as Metadata1 } from "../../../config/core/v3/base.js"; -import { - ProcessingMode, - ProcessingMode_BodySendMode, - processingMode_BodySendModeFromJSON, - processingMode_BodySendModeToJSON, -} from "../../../extensions/filters/http/ext_proc/v3/processing_mode.js"; -import { HttpStatus } from "../../../type/v3/http_status.js"; - -export const protobufPackage = "envoy.service.ext_proc.v3"; - -/** - * This message specifies the filter protocol configurations which will be sent to the ext_proc - * server in a :ref:`ProcessingRequest `. - * If the server does not support these protocol configurations, it may choose to close the gRPC stream. - * If the server supports these protocol configurations, it should respond based on the API specifications. - */ -export interface ProtocolConfiguration { - /** - * Specify the filter configuration :ref:`request_body_mode - * ` - */ - requestBodyMode: ProcessingMode_BodySendMode; - /** - * Specify the filter configuration :ref:`response_body_mode - * ` - */ - responseBodyMode: ProcessingMode_BodySendMode; - /** - * Specify the filter configuration :ref:`send_body_without_waiting_for_header_response - * ` - * If the client is waiting for a header response from the server, setting ``true`` means the client will send body to the server - * as they arrive. Setting ``false`` means the client will buffer the arrived data and not send it to the server immediately. - */ - sendBodyWithoutWaitingForHeaderResponse: boolean; -} - -/** - * This represents the different types of messages that the data plane can send - * to an external processing server. - * [#next-free-field: 12] - */ -export interface ProcessingRequest { - /** - * Information about the HTTP request headers, as well as peer info and additional - * properties. Unless ``observability_mode`` is ``true``, the server must send back a - * HeaderResponse message, an ImmediateResponse message, or close the stream. - */ - requestHeaders?: - | HttpHeaders - | undefined; - /** - * Information about the HTTP response headers, as well as peer info and additional - * properties. Unless ``observability_mode`` is ``true``, the server must send back a - * HeaderResponse message or close the stream. - */ - responseHeaders?: - | HttpHeaders - | undefined; - /** - * A chunk of the HTTP request body. Unless ``observability_mode`` is true, the server must send back - * a BodyResponse message, an ImmediateResponse message, or close the stream. - */ - requestBody?: - | HttpBody - | undefined; - /** - * A chunk of the HTTP response body. Unless ``observability_mode`` is ``true``, the server must send back - * a BodyResponse message or close the stream. - */ - responseBody?: - | HttpBody - | undefined; - /** - * The HTTP trailers for the request path. Unless ``observability_mode`` is ``true``, the server - * must send back a TrailerResponse message or close the stream. - * - * This message is only sent if the trailers processing mode is set to ``SEND`` and - * the original downstream request has trailers. - */ - requestTrailers?: - | HttpTrailers - | undefined; - /** - * The HTTP trailers for the response path. Unless ``observability_mode`` is ``true``, the server - * must send back a TrailerResponse message or close the stream. - * - * This message is only sent if the trailers processing mode is set to ``SEND`` and - * the original upstream response has trailers. - */ - responseTrailers?: - | HttpTrailers - | undefined; - /** Dynamic metadata associated with the request. */ - metadataContext: - | Metadata1 - | undefined; - /** - * The values of properties selected by the ``request_attributes`` - * or ``response_attributes`` list in the configuration. Each entry - * in the list is populated from the standard - * :ref:`attributes ` supported in the data plane. - */ - attributes: { [key: string]: { [key: string]: any } | undefined }; - /** - * Specify whether the filter that sent this request is running in :ref:`observability_mode - * ` - * and defaults to false. - * - * * A value of ``false`` indicates that the server must respond - * to this message by either sending back a matching ProcessingResponse message, - * or by closing the stream. - * * A value of ``true`` indicates that the server should not respond to this message, as any - * responses will be ignored. However, it may still close the stream to indicate that no more messages - * are needed. - */ - observabilityMode: boolean; - /** - * Specify the filter protocol configurations to be sent to the server. - * ``protocol_config`` is only encoded in the first ``ProcessingRequest`` message from the client to the server. - */ - protocolConfig: ProtocolConfiguration | undefined; -} - -export interface ProcessingRequest_AttributesEntry { - key: string; - value: { [key: string]: any } | undefined; -} - -/** - * This represents the different types of messages the server may send back to the data plane - * when the ``observability_mode`` field in the received ProcessingRequest is set to false. - * - * * If the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is not set to ``FULL_DUPLEX_STREAMED``, then for every received ProcessingRequest, - * the server must send back exactly one ProcessingResponse message. - * * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined - * for this mode to send the ProcessingResponse messages. - * [#next-free-field: 11] - */ -export interface ProcessingResponse { - /** - * The server must send back this message in response to a message with the - * ``request_headers`` field set. - */ - requestHeaders?: - | HeadersResponse - | undefined; - /** - * The server must send back this message in response to a message with the - * ``response_headers`` field set. - */ - responseHeaders?: - | HeadersResponse - | undefined; - /** - * The server must send back this message in response to a message with - * the ``request_body`` field set. - */ - requestBody?: - | BodyResponse - | undefined; - /** - * The server must send back this message in response to a message with - * the ``response_body`` field set. - */ - responseBody?: - | BodyResponse - | undefined; - /** - * The server must send back this message in response to a message with - * the ``request_trailers`` field set. - */ - requestTrailers?: - | TrailersResponse - | undefined; - /** - * The server must send back this message in response to a message with - * the ``response_trailers`` field set. - */ - responseTrailers?: - | TrailersResponse - | undefined; - /** - * If specified, attempt to create a locally generated response, send it - * downstream, and stop processing additional filters and ignore any - * additional messages received from the remote server for this request or - * response. If a response has already started -- for example, if this - * message is sent response to a ``response_body`` message -- then - * this will either ship the reply directly to the downstream codec, - * or reset the stream. - */ - immediateResponse?: - | ImmediateResponse - | undefined; - /** - * Optional metadata that will be emitted as dynamic metadata to be consumed by - * following filters. This metadata will be placed in the namespace(s) specified by the top-level - * field name(s) of the struct. - */ - dynamicMetadata: - | { [key: string]: any } - | undefined; - /** - * Override how parts of the HTTP request and response are processed - * for the duration of this particular request/response only. Servers - * may use this to intelligently control how requests are processed - * based on the headers and other metadata that they see. - * This field is only applicable when servers responding to the header requests. - * If it is set in the response to the body or trailer requests, it will be ignored by the data plane. - * It is also ignored by the data plane when the ext_proc filter config - * :ref:`allow_mode_override - * ` - * is set to false, or - * :ref:`send_body_without_waiting_for_header_response - * ` - * is set to true. - */ - modeOverride: - | ProcessingMode - | undefined; - /** - * When ext_proc server receives a request message, in case it needs more - * time to process the message, it sends back a ProcessingResponse message - * with a new timeout value. When the data plane receives this response - * message, it ignores other fields in the response, just stop the original - * timer, which has the timeout value specified in - * :ref:`message_timeout - * ` - * and start a new timer with this ``override_message_timeout`` value and keep the - * data plane ext_proc filter state machine intact. - * Has to be >= 1ms and <= - * :ref:`max_message_timeout ` - * Such message can be sent at most once in a particular data plane ext_proc filter processing state. - * To enable this API, one has to set ``max_message_timeout`` to a number >= 1ms. - */ - overrideMessageTimeout: Duration | undefined; -} - -/** - * This message is sent to the external server when the HTTP request and responses - * are first received. - */ -export interface HttpHeaders { - /** - * The HTTP request headers. All header keys will be - * lower-cased, because HTTP header keys are case-insensitive. - * The header value is encoded in the - * :ref:`raw_value ` field. - */ - headers: - | HeaderMap - | undefined; - /** - * [#not-implemented-hide:] - * This field is deprecated and not implemented. Attributes will be sent in - * the top-level :ref:`attributes ` field. - */ - trailers: HeaderMap | undefined; -} - -/** - * This message is sent by the external server to the data plane after ``HttpHeaders`` was - * sent to it. - */ -export interface HeadersResponse { - /** - * Details the modifications (if any) to be made by the data plane to the current - * request/response. - */ - response: CommonResponse | undefined; -} - -/** - * This message is sent by the external server to the data plane after ``HttpBody`` was - * sent to it. - */ -export interface BodyResponse { - /** - * Details the modifications (if any) to be made by the data plane to the current - * request/response. - */ - response: CommonResponse | undefined; -} - -/** - * This message is sent by the external server to the data plane after ``HttpTrailers`` was - * sent to it. - */ -export interface TrailersResponse { - /** - * Details the modifications (if any) to be made by the data plane to the current - * request/response trailers. - */ - headerMutation: HeaderMutation | undefined; -} - -/** - * This message contains common fields between header and body responses. - * [#next-free-field: 6] - */ -export interface CommonResponse { - /** - * If set, provide additional direction on how the data plane should - * handle the rest of the HTTP filter chain. - */ - status: CommonResponse_ResponseStatus; - /** - * Instructions on how to manipulate the headers. When responding to an - * HttpBody request, header mutations will only take effect if - * the current processing mode for the body is BUFFERED. - */ - headerMutation: - | HeaderMutation - | undefined; - /** - * Replace the body of the last message sent to the remote server on this - * stream. If responding to an HttpBody request, simply replace or clear - * the body chunk that was sent with that request. Body mutations may take - * effect in response either to ``header`` or ``body`` messages. When it is - * in response to ``header`` messages, it only take effect if the - * :ref:`status ` - * is set to CONTINUE_AND_REPLACE. - */ - bodyMutation: - | BodyMutation - | undefined; - /** - * [#not-implemented-hide:] - * Add new trailers to the message. This may be used when responding to either a - * HttpHeaders or HttpBody message, but only if this message is returned - * along with the CONTINUE_AND_REPLACE status. - * The header value is encoded in the - * :ref:`raw_value ` field. - */ - trailers: - | HeaderMap - | undefined; - /** - * Clear the route cache for the current client request. This is necessary - * if the remote server modified headers that are used to calculate the route. - * This field is ignored in the response direction. This field is also ignored - * if the data plane ext_proc filter is in the upstream filter chain. - */ - clearRouteCache: boolean; -} - -/** The status of the response. */ -export enum CommonResponse_ResponseStatus { - /** - * CONTINUE - Apply the mutation instructions in this message to the - * request or response, and then continue processing the filter - * stream as normal. This is the default. - */ - CONTINUE = 0, - /** - * CONTINUE_AND_REPLACE - Apply the specified header mutation, replace the body with the body - * specified in the body mutation (if present), and do not send any - * further messages for this request or response even if the processing - * mode is configured to do so. - * - * When used in response to a request_headers or response_headers message, - * this status makes it possible to either completely replace the body - * while discarding the original body, or to add a body to a message that - * formerly did not have one. - * - * In other words, this response makes it possible to turn an HTTP GET - * into a POST, PUT, or PATCH. - */ - CONTINUE_AND_REPLACE = 1, - UNRECOGNIZED = -1, -} - -export function commonResponse_ResponseStatusFromJSON(object: any): CommonResponse_ResponseStatus { - switch (object) { - case 0: - case "CONTINUE": - return CommonResponse_ResponseStatus.CONTINUE; - case 1: - case "CONTINUE_AND_REPLACE": - return CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE; - case -1: - case "UNRECOGNIZED": - default: - return CommonResponse_ResponseStatus.UNRECOGNIZED; - } -} - -export function commonResponse_ResponseStatusToJSON(object: CommonResponse_ResponseStatus): string { - switch (object) { - case CommonResponse_ResponseStatus.CONTINUE: - return "CONTINUE"; - case CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE: - return "CONTINUE_AND_REPLACE"; - case CommonResponse_ResponseStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * This message causes the filter to attempt to create a locally - * generated response, send it downstream, stop processing - * additional filters, and ignore any additional messages received - * from the remote server for this request or response. If a response - * has already started, then this will either ship the reply directly - * to the downstream codec, or reset the stream. - * [#next-free-field: 6] - */ -export interface ImmediateResponse { - /** The response code to return. */ - status: - | HttpStatus - | undefined; - /** Apply changes to the default headers, which will include content-type. */ - headers: - | HeaderMutation - | undefined; - /** - * The message body to return with the response which is sent using the - * text/plain content type, or encoded in the grpc-message header. - */ - body: Uint8Array; - /** If set, then include a gRPC status trailer. */ - grpcStatus: - | GrpcStatus - | undefined; - /** - * A string detailing why this local reply was sent, which may be included - * in log and debug output (e.g. this populates the %RESPONSE_CODE_DETAILS% - * command operator field for use in access logging). - */ - details: string; -} - -/** This message specifies a gRPC status for an ImmediateResponse message. */ -export interface GrpcStatus { - /** The actual gRPC status. */ - status: number; -} - -/** - * Change HTTP headers or trailers by appending, replacing, or removing - * headers. - */ -export interface HeaderMutation { - /** - * Add or replace HTTP headers. Attempts to set the value of - * any ``x-envoy`` header, and attempts to set the ``:method``, - * ``:authority``, ``:scheme``, or ``host`` headers will be ignored. - * The header value is encoded in the - * :ref:`raw_value ` field. - */ - setHeaders: HeaderValueOption[]; - /** - * Remove these HTTP headers. Attempts to remove system headers -- - * any header starting with ``:``, plus ``host`` -- will be ignored. - */ - removeHeaders: string[]; -} - -/** The body response message corresponding to FULL_DUPLEX_STREAMED body mode. */ -export interface StreamedBodyResponse { - /** The body response chunk that will be passed to the upstream/downstream by the data plane. */ - body: Uint8Array; - /** - * The server sets this flag to true if it has received a body request with - * :ref:`end_of_stream ` set to true, - * and this is the last chunk of body responses. - */ - endOfStream: boolean; -} - -/** This message specifies the body mutation the server sends to the data plane. */ -export interface BodyMutation { - /** - * The entire body to replace. - * Should only be used when the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is not set to ``FULL_DUPLEX_STREAMED``. - */ - body?: - | Uint8Array - | undefined; - /** - * Clear the corresponding body chunk. - * Should only be used when the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is not set to ``FULL_DUPLEX_STREAMED``. - * Clear the corresponding body chunk. - */ - clearBody?: - | boolean - | undefined; - /** - * Must be used when the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is set to ``FULL_DUPLEX_STREAMED``. - */ - streamedResponse?: StreamedBodyResponse | undefined; -} - -function createBaseProtocolConfiguration(): ProtocolConfiguration { - return { requestBodyMode: 0, responseBodyMode: 0, sendBodyWithoutWaitingForHeaderResponse: false }; -} - -export const ProtocolConfiguration: MessageFns = { - encode(message: ProtocolConfiguration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.requestBodyMode !== 0) { - writer.uint32(8).int32(message.requestBodyMode); - } - if (message.responseBodyMode !== 0) { - writer.uint32(16).int32(message.responseBodyMode); - } - if (message.sendBodyWithoutWaitingForHeaderResponse !== false) { - writer.uint32(24).bool(message.sendBodyWithoutWaitingForHeaderResponse); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ProtocolConfiguration { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProtocolConfiguration(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.requestBodyMode = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.responseBodyMode = reader.int32() as any; - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.sendBodyWithoutWaitingForHeaderResponse = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ProtocolConfiguration { - return { - requestBodyMode: isSet(object.requestBodyMode) ? processingMode_BodySendModeFromJSON(object.requestBodyMode) : 0, - responseBodyMode: isSet(object.responseBodyMode) - ? processingMode_BodySendModeFromJSON(object.responseBodyMode) - : 0, - sendBodyWithoutWaitingForHeaderResponse: isSet(object.sendBodyWithoutWaitingForHeaderResponse) - ? globalThis.Boolean(object.sendBodyWithoutWaitingForHeaderResponse) - : false, - }; - }, - - toJSON(message: ProtocolConfiguration): unknown { - const obj: any = {}; - if (message.requestBodyMode !== 0) { - obj.requestBodyMode = processingMode_BodySendModeToJSON(message.requestBodyMode); - } - if (message.responseBodyMode !== 0) { - obj.responseBodyMode = processingMode_BodySendModeToJSON(message.responseBodyMode); - } - if (message.sendBodyWithoutWaitingForHeaderResponse !== false) { - obj.sendBodyWithoutWaitingForHeaderResponse = message.sendBodyWithoutWaitingForHeaderResponse; - } - return obj; - }, - - create, I>>(base?: I): ProtocolConfiguration { - return ProtocolConfiguration.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ProtocolConfiguration { - const message = createBaseProtocolConfiguration(); - message.requestBodyMode = object.requestBodyMode ?? 0; - message.responseBodyMode = object.responseBodyMode ?? 0; - message.sendBodyWithoutWaitingForHeaderResponse = object.sendBodyWithoutWaitingForHeaderResponse ?? false; - return message; - }, -}; - -function createBaseProcessingRequest(): ProcessingRequest { - return { - requestHeaders: undefined, - responseHeaders: undefined, - requestBody: undefined, - responseBody: undefined, - requestTrailers: undefined, - responseTrailers: undefined, - metadataContext: undefined, - attributes: {}, - observabilityMode: false, - protocolConfig: undefined, - }; -} - -export const ProcessingRequest: MessageFns = { - encode(message: ProcessingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.requestHeaders !== undefined) { - HttpHeaders.encode(message.requestHeaders, writer.uint32(18).fork()).join(); - } - if (message.responseHeaders !== undefined) { - HttpHeaders.encode(message.responseHeaders, writer.uint32(26).fork()).join(); - } - if (message.requestBody !== undefined) { - HttpBody.encode(message.requestBody, writer.uint32(34).fork()).join(); - } - if (message.responseBody !== undefined) { - HttpBody.encode(message.responseBody, writer.uint32(42).fork()).join(); - } - if (message.requestTrailers !== undefined) { - HttpTrailers.encode(message.requestTrailers, writer.uint32(50).fork()).join(); - } - if (message.responseTrailers !== undefined) { - HttpTrailers.encode(message.responseTrailers, writer.uint32(58).fork()).join(); - } - if (message.metadataContext !== undefined) { - Metadata1.encode(message.metadataContext, writer.uint32(66).fork()).join(); - } - Object.entries(message.attributes).forEach(([key, value]) => { - if (value !== undefined) { - ProcessingRequest_AttributesEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join(); - } - }); - if (message.observabilityMode !== false) { - writer.uint32(80).bool(message.observabilityMode); - } - if (message.protocolConfig !== undefined) { - ProtocolConfiguration.encode(message.protocolConfig, writer.uint32(90).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ProcessingRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessingRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (tag !== 18) { - break; - } - - message.requestHeaders = HttpHeaders.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.responseHeaders = HttpHeaders.decode(reader, reader.uint32()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.requestBody = HttpBody.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.responseBody = HttpBody.decode(reader, reader.uint32()); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.requestTrailers = HttpTrailers.decode(reader, reader.uint32()); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.responseTrailers = HttpTrailers.decode(reader, reader.uint32()); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.metadataContext = Metadata1.decode(reader, reader.uint32()); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - const entry9 = ProcessingRequest_AttributesEntry.decode(reader, reader.uint32()); - if (entry9.value !== undefined) { - message.attributes[entry9.key] = entry9.value; - } - continue; - } - case 10: { - if (tag !== 80) { - break; - } - - message.observabilityMode = reader.bool(); - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.protocolConfig = ProtocolConfiguration.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ProcessingRequest { - return { - requestHeaders: isSet(object.requestHeaders) ? HttpHeaders.fromJSON(object.requestHeaders) : undefined, - responseHeaders: isSet(object.responseHeaders) ? HttpHeaders.fromJSON(object.responseHeaders) : undefined, - requestBody: isSet(object.requestBody) ? HttpBody.fromJSON(object.requestBody) : undefined, - responseBody: isSet(object.responseBody) ? HttpBody.fromJSON(object.responseBody) : undefined, - requestTrailers: isSet(object.requestTrailers) ? HttpTrailers.fromJSON(object.requestTrailers) : undefined, - responseTrailers: isSet(object.responseTrailers) ? HttpTrailers.fromJSON(object.responseTrailers) : undefined, - metadataContext: isSet(object.metadataContext) ? Metadata1.fromJSON(object.metadataContext) : undefined, - attributes: isObject(object.attributes) - ? Object.entries(object.attributes).reduce<{ [key: string]: { [key: string]: any } | undefined }>( - (acc, [key, value]) => { - acc[key] = value as { [key: string]: any } | undefined; - return acc; - }, - {}, - ) - : {}, - observabilityMode: isSet(object.observabilityMode) ? globalThis.Boolean(object.observabilityMode) : false, - protocolConfig: isSet(object.protocolConfig) ? ProtocolConfiguration.fromJSON(object.protocolConfig) : undefined, - }; - }, - - toJSON(message: ProcessingRequest): unknown { - const obj: any = {}; - if (message.requestHeaders !== undefined) { - obj.requestHeaders = HttpHeaders.toJSON(message.requestHeaders); - } - if (message.responseHeaders !== undefined) { - obj.responseHeaders = HttpHeaders.toJSON(message.responseHeaders); - } - if (message.requestBody !== undefined) { - obj.requestBody = HttpBody.toJSON(message.requestBody); - } - if (message.responseBody !== undefined) { - obj.responseBody = HttpBody.toJSON(message.responseBody); - } - if (message.requestTrailers !== undefined) { - obj.requestTrailers = HttpTrailers.toJSON(message.requestTrailers); - } - if (message.responseTrailers !== undefined) { - obj.responseTrailers = HttpTrailers.toJSON(message.responseTrailers); - } - if (message.metadataContext !== undefined) { - obj.metadataContext = Metadata1.toJSON(message.metadataContext); - } - if (message.attributes) { - const entries = Object.entries(message.attributes); - if (entries.length > 0) { - obj.attributes = {}; - entries.forEach(([k, v]) => { - obj.attributes[k] = v; - }); - } - } - if (message.observabilityMode !== false) { - obj.observabilityMode = message.observabilityMode; - } - if (message.protocolConfig !== undefined) { - obj.protocolConfig = ProtocolConfiguration.toJSON(message.protocolConfig); - } - return obj; - }, - - create, I>>(base?: I): ProcessingRequest { - return ProcessingRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ProcessingRequest { - const message = createBaseProcessingRequest(); - message.requestHeaders = (object.requestHeaders !== undefined && object.requestHeaders !== null) - ? HttpHeaders.fromPartial(object.requestHeaders) - : undefined; - message.responseHeaders = (object.responseHeaders !== undefined && object.responseHeaders !== null) - ? HttpHeaders.fromPartial(object.responseHeaders) - : undefined; - message.requestBody = (object.requestBody !== undefined && object.requestBody !== null) - ? HttpBody.fromPartial(object.requestBody) - : undefined; - message.responseBody = (object.responseBody !== undefined && object.responseBody !== null) - ? HttpBody.fromPartial(object.responseBody) - : undefined; - message.requestTrailers = (object.requestTrailers !== undefined && object.requestTrailers !== null) - ? HttpTrailers.fromPartial(object.requestTrailers) - : undefined; - message.responseTrailers = (object.responseTrailers !== undefined && object.responseTrailers !== null) - ? HttpTrailers.fromPartial(object.responseTrailers) - : undefined; - message.metadataContext = (object.metadataContext !== undefined && object.metadataContext !== null) - ? Metadata1.fromPartial(object.metadataContext) - : undefined; - message.attributes = Object.entries(object.attributes ?? {}).reduce< - { [key: string]: { [key: string]: any } | undefined } - >((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); - message.observabilityMode = object.observabilityMode ?? false; - message.protocolConfig = (object.protocolConfig !== undefined && object.protocolConfig !== null) - ? ProtocolConfiguration.fromPartial(object.protocolConfig) - : undefined; - return message; - }, -}; - -function createBaseProcessingRequest_AttributesEntry(): ProcessingRequest_AttributesEntry { - return { key: "", value: undefined }; -} - -export const ProcessingRequest_AttributesEntry: MessageFns = { - encode(message: ProcessingRequest_AttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ProcessingRequest_AttributesEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessingRequest_AttributesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ProcessingRequest_AttributesEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isObject(object.value) ? object.value : undefined, - }; - }, - - toJSON(message: ProcessingRequest_AttributesEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>( - base?: I, - ): ProcessingRequest_AttributesEntry { - return ProcessingRequest_AttributesEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ProcessingRequest_AttributesEntry { - const message = createBaseProcessingRequest_AttributesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; - return message; - }, -}; - -function createBaseProcessingResponse(): ProcessingResponse { - return { - requestHeaders: undefined, - responseHeaders: undefined, - requestBody: undefined, - responseBody: undefined, - requestTrailers: undefined, - responseTrailers: undefined, - immediateResponse: undefined, - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; -} - -export const ProcessingResponse: MessageFns = { - encode(message: ProcessingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.requestHeaders !== undefined) { - HeadersResponse.encode(message.requestHeaders, writer.uint32(10).fork()).join(); - } - if (message.responseHeaders !== undefined) { - HeadersResponse.encode(message.responseHeaders, writer.uint32(18).fork()).join(); - } - if (message.requestBody !== undefined) { - BodyResponse.encode(message.requestBody, writer.uint32(26).fork()).join(); - } - if (message.responseBody !== undefined) { - BodyResponse.encode(message.responseBody, writer.uint32(34).fork()).join(); - } - if (message.requestTrailers !== undefined) { - TrailersResponse.encode(message.requestTrailers, writer.uint32(42).fork()).join(); - } - if (message.responseTrailers !== undefined) { - TrailersResponse.encode(message.responseTrailers, writer.uint32(50).fork()).join(); - } - if (message.immediateResponse !== undefined) { - ImmediateResponse.encode(message.immediateResponse, writer.uint32(58).fork()).join(); - } - if (message.dynamicMetadata !== undefined) { - Struct.encode(Struct.wrap(message.dynamicMetadata), writer.uint32(66).fork()).join(); - } - if (message.modeOverride !== undefined) { - ProcessingMode.encode(message.modeOverride, writer.uint32(74).fork()).join(); - } - if (message.overrideMessageTimeout !== undefined) { - Duration.encode(message.overrideMessageTimeout, writer.uint32(82).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ProcessingResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessingResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.requestHeaders = HeadersResponse.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.responseHeaders = HeadersResponse.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.requestBody = BodyResponse.decode(reader, reader.uint32()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.responseBody = BodyResponse.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.requestTrailers = TrailersResponse.decode(reader, reader.uint32()); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.responseTrailers = TrailersResponse.decode(reader, reader.uint32()); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.immediateResponse = ImmediateResponse.decode(reader, reader.uint32()); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.dynamicMetadata = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.modeOverride = ProcessingMode.decode(reader, reader.uint32()); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.overrideMessageTimeout = Duration.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ProcessingResponse { - return { - requestHeaders: isSet(object.requestHeaders) ? HeadersResponse.fromJSON(object.requestHeaders) : undefined, - responseHeaders: isSet(object.responseHeaders) ? HeadersResponse.fromJSON(object.responseHeaders) : undefined, - requestBody: isSet(object.requestBody) ? BodyResponse.fromJSON(object.requestBody) : undefined, - responseBody: isSet(object.responseBody) ? BodyResponse.fromJSON(object.responseBody) : undefined, - requestTrailers: isSet(object.requestTrailers) ? TrailersResponse.fromJSON(object.requestTrailers) : undefined, - responseTrailers: isSet(object.responseTrailers) ? TrailersResponse.fromJSON(object.responseTrailers) : undefined, - immediateResponse: isSet(object.immediateResponse) - ? ImmediateResponse.fromJSON(object.immediateResponse) - : undefined, - dynamicMetadata: isObject(object.dynamicMetadata) ? object.dynamicMetadata : undefined, - modeOverride: isSet(object.modeOverride) ? ProcessingMode.fromJSON(object.modeOverride) : undefined, - overrideMessageTimeout: isSet(object.overrideMessageTimeout) - ? Duration.fromJSON(object.overrideMessageTimeout) - : undefined, - }; - }, - - toJSON(message: ProcessingResponse): unknown { - const obj: any = {}; - if (message.requestHeaders !== undefined) { - obj.requestHeaders = HeadersResponse.toJSON(message.requestHeaders); - } - if (message.responseHeaders !== undefined) { - obj.responseHeaders = HeadersResponse.toJSON(message.responseHeaders); - } - if (message.requestBody !== undefined) { - obj.requestBody = BodyResponse.toJSON(message.requestBody); - } - if (message.responseBody !== undefined) { - obj.responseBody = BodyResponse.toJSON(message.responseBody); - } - if (message.requestTrailers !== undefined) { - obj.requestTrailers = TrailersResponse.toJSON(message.requestTrailers); - } - if (message.responseTrailers !== undefined) { - obj.responseTrailers = TrailersResponse.toJSON(message.responseTrailers); - } - if (message.immediateResponse !== undefined) { - obj.immediateResponse = ImmediateResponse.toJSON(message.immediateResponse); - } - if (message.dynamicMetadata !== undefined) { - obj.dynamicMetadata = message.dynamicMetadata; - } - if (message.modeOverride !== undefined) { - obj.modeOverride = ProcessingMode.toJSON(message.modeOverride); - } - if (message.overrideMessageTimeout !== undefined) { - obj.overrideMessageTimeout = Duration.toJSON(message.overrideMessageTimeout); - } - return obj; - }, - - create, I>>(base?: I): ProcessingResponse { - return ProcessingResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ProcessingResponse { - const message = createBaseProcessingResponse(); - message.requestHeaders = (object.requestHeaders !== undefined && object.requestHeaders !== null) - ? HeadersResponse.fromPartial(object.requestHeaders) - : undefined; - message.responseHeaders = (object.responseHeaders !== undefined && object.responseHeaders !== null) - ? HeadersResponse.fromPartial(object.responseHeaders) - : undefined; - message.requestBody = (object.requestBody !== undefined && object.requestBody !== null) - ? BodyResponse.fromPartial(object.requestBody) - : undefined; - message.responseBody = (object.responseBody !== undefined && object.responseBody !== null) - ? BodyResponse.fromPartial(object.responseBody) - : undefined; - message.requestTrailers = (object.requestTrailers !== undefined && object.requestTrailers !== null) - ? TrailersResponse.fromPartial(object.requestTrailers) - : undefined; - message.responseTrailers = (object.responseTrailers !== undefined && object.responseTrailers !== null) - ? TrailersResponse.fromPartial(object.responseTrailers) - : undefined; - message.immediateResponse = (object.immediateResponse !== undefined && object.immediateResponse !== null) - ? ImmediateResponse.fromPartial(object.immediateResponse) - : undefined; - message.dynamicMetadata = object.dynamicMetadata ?? undefined; - message.modeOverride = (object.modeOverride !== undefined && object.modeOverride !== null) - ? ProcessingMode.fromPartial(object.modeOverride) - : undefined; - message.overrideMessageTimeout = - (object.overrideMessageTimeout !== undefined && object.overrideMessageTimeout !== null) - ? Duration.fromPartial(object.overrideMessageTimeout) - : undefined; - return message; - }, -}; - -function createBaseHttpHeaders(): HttpHeaders { - return { headers: undefined, attributes: {}, endOfStream: false }; -} - -export const HttpHeaders: MessageFns = { - encode(message: HttpHeaders, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.headers !== undefined) { - HeaderMap.encode(message.headers, writer.uint32(10).fork()).join(); - } - Object.entries(message.attributes).forEach(([key, value]) => { - if (value !== undefined) { - HttpHeaders_AttributesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); - } - }); - if (message.endOfStream !== false) { - writer.uint32(24).bool(message.endOfStream); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HttpHeaders { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpHeaders(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.headers = HeaderMap.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - const entry2 = HttpHeaders_AttributesEntry.decode(reader, reader.uint32()); - if (entry2.value !== undefined) { - message.attributes[entry2.key] = entry2.value; - } - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.endOfStream = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HttpHeaders { - return { - headers: isSet(object.headers) ? HeaderMap.fromJSON(object.headers) : undefined, - attributes: isObject(object.attributes) - ? Object.entries(object.attributes).reduce<{ [key: string]: { [key: string]: any } | undefined }>( - (acc, [key, value]) => { - acc[key] = value as { [key: string]: any } | undefined; - return acc; - }, - {}, - ) - : {}, - endOfStream: isSet(object.endOfStream) ? globalThis.Boolean(object.endOfStream) : false, - }; - }, - - toJSON(message: HttpHeaders): unknown { - const obj: any = {}; - if (message.headers !== undefined) { - obj.headers = HeaderMap.toJSON(message.headers); - } - if (message.attributes) { - const entries = Object.entries(message.attributes); - if (entries.length > 0) { - obj.attributes = {}; - entries.forEach(([k, v]) => { - obj.attributes[k] = v; - }); - } - } - if (message.endOfStream !== false) { - obj.endOfStream = message.endOfStream; - } - return obj; - }, - - create, I>>(base?: I): HttpHeaders { - return HttpHeaders.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpHeaders { - const message = createBaseHttpHeaders(); - message.headers = (object.headers !== undefined && object.headers !== null) - ? HeaderMap.fromPartial(object.headers) - : undefined; - message.attributes = Object.entries(object.attributes ?? {}).reduce< - { [key: string]: { [key: string]: any } | undefined } - >((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, {}); - message.endOfStream = object.endOfStream ?? false; - return message; - }, -}; - -function createBaseHttpHeaders_AttributesEntry(): HttpHeaders_AttributesEntry { - return { key: "", value: undefined }; -} - -export const HttpHeaders_AttributesEntry: MessageFns = { - encode(message: HttpHeaders_AttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HttpHeaders_AttributesEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpHeaders_AttributesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HttpHeaders_AttributesEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isObject(object.value) ? object.value : undefined, - }; - }, - - toJSON(message: HttpHeaders_AttributesEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): HttpHeaders_AttributesEntry { - return HttpHeaders_AttributesEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpHeaders_AttributesEntry { - const message = createBaseHttpHeaders_AttributesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; - return message; - }, -}; - -function createBaseHttpBody(): HttpBody { - return { body: new Uint8Array(0), endOfStream: false }; -} - -export const HttpBody: MessageFns = { - encode(message: HttpBody, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.body.length !== 0) { - writer.uint32(10).bytes(message.body); - } - if (message.endOfStream !== false) { - writer.uint32(16).bool(message.endOfStream); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HttpBody { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpBody(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.body = reader.bytes(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.endOfStream = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HttpBody { - return { - body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), - endOfStream: isSet(object.endOfStream) ? globalThis.Boolean(object.endOfStream) : false, - }; - }, - - toJSON(message: HttpBody): unknown { - const obj: any = {}; - if (message.body.length !== 0) { - obj.body = base64FromBytes(message.body); - } - if (message.endOfStream !== false) { - obj.endOfStream = message.endOfStream; - } - return obj; - }, - - create, I>>(base?: I): HttpBody { - return HttpBody.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpBody { - const message = createBaseHttpBody(); - message.body = object.body ?? new Uint8Array(0); - message.endOfStream = object.endOfStream ?? false; - return message; - }, -}; - -function createBaseHttpTrailers(): HttpTrailers { - return { trailers: undefined }; -} - -export const HttpTrailers: MessageFns = { - encode(message: HttpTrailers, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.trailers !== undefined) { - HeaderMap.encode(message.trailers, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HttpTrailers { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpTrailers(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.trailers = HeaderMap.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HttpTrailers { - return { trailers: isSet(object.trailers) ? HeaderMap.fromJSON(object.trailers) : undefined }; - }, - - toJSON(message: HttpTrailers): unknown { - const obj: any = {}; - if (message.trailers !== undefined) { - obj.trailers = HeaderMap.toJSON(message.trailers); - } - return obj; - }, - - create, I>>(base?: I): HttpTrailers { - return HttpTrailers.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpTrailers { - const message = createBaseHttpTrailers(); - message.trailers = (object.trailers !== undefined && object.trailers !== null) - ? HeaderMap.fromPartial(object.trailers) - : undefined; - return message; - }, -}; - -function createBaseHeadersResponse(): HeadersResponse { - return { response: undefined }; -} - -export const HeadersResponse: MessageFns = { - encode(message: HeadersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.response !== undefined) { - CommonResponse.encode(message.response, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HeadersResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeadersResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.response = CommonResponse.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HeadersResponse { - return { response: isSet(object.response) ? CommonResponse.fromJSON(object.response) : undefined }; - }, - - toJSON(message: HeadersResponse): unknown { - const obj: any = {}; - if (message.response !== undefined) { - obj.response = CommonResponse.toJSON(message.response); - } - return obj; - }, - - create, I>>(base?: I): HeadersResponse { - return HeadersResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HeadersResponse { - const message = createBaseHeadersResponse(); - message.response = (object.response !== undefined && object.response !== null) - ? CommonResponse.fromPartial(object.response) - : undefined; - return message; - }, -}; - -function createBaseBodyResponse(): BodyResponse { - return { response: undefined }; -} - -export const BodyResponse: MessageFns = { - encode(message: BodyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.response !== undefined) { - CommonResponse.encode(message.response, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BodyResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBodyResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.response = CommonResponse.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BodyResponse { - return { response: isSet(object.response) ? CommonResponse.fromJSON(object.response) : undefined }; - }, - - toJSON(message: BodyResponse): unknown { - const obj: any = {}; - if (message.response !== undefined) { - obj.response = CommonResponse.toJSON(message.response); - } - return obj; - }, - - create, I>>(base?: I): BodyResponse { - return BodyResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BodyResponse { - const message = createBaseBodyResponse(); - message.response = (object.response !== undefined && object.response !== null) - ? CommonResponse.fromPartial(object.response) - : undefined; - return message; - }, -}; - -function createBaseTrailersResponse(): TrailersResponse { - return { headerMutation: undefined }; -} - -export const TrailersResponse: MessageFns = { - encode(message: TrailersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.headerMutation !== undefined) { - HeaderMutation.encode(message.headerMutation, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): TrailersResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTrailersResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.headerMutation = HeaderMutation.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): TrailersResponse { - return { - headerMutation: isSet(object.headerMutation) ? HeaderMutation.fromJSON(object.headerMutation) : undefined, - }; - }, - - toJSON(message: TrailersResponse): unknown { - const obj: any = {}; - if (message.headerMutation !== undefined) { - obj.headerMutation = HeaderMutation.toJSON(message.headerMutation); - } - return obj; - }, - - create, I>>(base?: I): TrailersResponse { - return TrailersResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): TrailersResponse { - const message = createBaseTrailersResponse(); - message.headerMutation = (object.headerMutation !== undefined && object.headerMutation !== null) - ? HeaderMutation.fromPartial(object.headerMutation) - : undefined; - return message; - }, -}; - -function createBaseCommonResponse(): CommonResponse { - return { status: 0, headerMutation: undefined, bodyMutation: undefined, trailers: undefined, clearRouteCache: false }; -} - -export const CommonResponse: MessageFns = { - encode(message: CommonResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.status !== 0) { - writer.uint32(8).int32(message.status); - } - if (message.headerMutation !== undefined) { - HeaderMutation.encode(message.headerMutation, writer.uint32(18).fork()).join(); - } - if (message.bodyMutation !== undefined) { - BodyMutation.encode(message.bodyMutation, writer.uint32(26).fork()).join(); - } - if (message.trailers !== undefined) { - HeaderMap.encode(message.trailers, writer.uint32(34).fork()).join(); - } - if (message.clearRouteCache !== false) { - writer.uint32(40).bool(message.clearRouteCache); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): CommonResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommonResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.status = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.headerMutation = HeaderMutation.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.bodyMutation = BodyMutation.decode(reader, reader.uint32()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.trailers = HeaderMap.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.clearRouteCache = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): CommonResponse { - return { - status: isSet(object.status) ? commonResponse_ResponseStatusFromJSON(object.status) : 0, - headerMutation: isSet(object.headerMutation) ? HeaderMutation.fromJSON(object.headerMutation) : undefined, - bodyMutation: isSet(object.bodyMutation) ? BodyMutation.fromJSON(object.bodyMutation) : undefined, - trailers: isSet(object.trailers) ? HeaderMap.fromJSON(object.trailers) : undefined, - clearRouteCache: isSet(object.clearRouteCache) ? globalThis.Boolean(object.clearRouteCache) : false, - }; - }, - - toJSON(message: CommonResponse): unknown { - const obj: any = {}; - if (message.status !== 0) { - obj.status = commonResponse_ResponseStatusToJSON(message.status); - } - if (message.headerMutation !== undefined) { - obj.headerMutation = HeaderMutation.toJSON(message.headerMutation); - } - if (message.bodyMutation !== undefined) { - obj.bodyMutation = BodyMutation.toJSON(message.bodyMutation); - } - if (message.trailers !== undefined) { - obj.trailers = HeaderMap.toJSON(message.trailers); - } - if (message.clearRouteCache !== false) { - obj.clearRouteCache = message.clearRouteCache; - } - return obj; - }, - - create, I>>(base?: I): CommonResponse { - return CommonResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): CommonResponse { - const message = createBaseCommonResponse(); - message.status = object.status ?? 0; - message.headerMutation = (object.headerMutation !== undefined && object.headerMutation !== null) - ? HeaderMutation.fromPartial(object.headerMutation) - : undefined; - message.bodyMutation = (object.bodyMutation !== undefined && object.bodyMutation !== null) - ? BodyMutation.fromPartial(object.bodyMutation) - : undefined; - message.trailers = (object.trailers !== undefined && object.trailers !== null) - ? HeaderMap.fromPartial(object.trailers) - : undefined; - message.clearRouteCache = object.clearRouteCache ?? false; - return message; - }, -}; - -function createBaseImmediateResponse(): ImmediateResponse { - return { status: undefined, headers: undefined, body: new Uint8Array(0), grpcStatus: undefined, details: "" }; -} - -export const ImmediateResponse: MessageFns = { - encode(message: ImmediateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.status !== undefined) { - HttpStatus.encode(message.status, writer.uint32(10).fork()).join(); - } - if (message.headers !== undefined) { - HeaderMutation.encode(message.headers, writer.uint32(18).fork()).join(); - } - if (message.body.length !== 0) { - writer.uint32(26).bytes(message.body); - } - if (message.grpcStatus !== undefined) { - GrpcStatus.encode(message.grpcStatus, writer.uint32(34).fork()).join(); - } - if (message.details !== "") { - writer.uint32(42).string(message.details); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ImmediateResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImmediateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.status = HttpStatus.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.headers = HeaderMutation.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.body = reader.bytes(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.grpcStatus = GrpcStatus.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.details = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ImmediateResponse { - return { - status: isSet(object.status) ? HttpStatus.fromJSON(object.status) : undefined, - headers: isSet(object.headers) ? HeaderMutation.fromJSON(object.headers) : undefined, - body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), - grpcStatus: isSet(object.grpcStatus) ? GrpcStatus.fromJSON(object.grpcStatus) : undefined, - details: isSet(object.details) ? globalThis.String(object.details) : "", - }; - }, - - toJSON(message: ImmediateResponse): unknown { - const obj: any = {}; - if (message.status !== undefined) { - obj.status = HttpStatus.toJSON(message.status); - } - if (message.headers !== undefined) { - obj.headers = HeaderMutation.toJSON(message.headers); - } - if (message.body.length !== 0) { - obj.body = base64FromBytes(message.body); - } - if (message.grpcStatus !== undefined) { - obj.grpcStatus = GrpcStatus.toJSON(message.grpcStatus); - } - if (message.details !== "") { - obj.details = message.details; - } - return obj; - }, - - create, I>>(base?: I): ImmediateResponse { - return ImmediateResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ImmediateResponse { - const message = createBaseImmediateResponse(); - message.status = (object.status !== undefined && object.status !== null) - ? HttpStatus.fromPartial(object.status) - : undefined; - message.headers = (object.headers !== undefined && object.headers !== null) - ? HeaderMutation.fromPartial(object.headers) - : undefined; - message.body = object.body ?? new Uint8Array(0); - message.grpcStatus = (object.grpcStatus !== undefined && object.grpcStatus !== null) - ? GrpcStatus.fromPartial(object.grpcStatus) - : undefined; - message.details = object.details ?? ""; - return message; - }, -}; - -function createBaseGrpcStatus(): GrpcStatus { - return { status: 0 }; -} - -export const GrpcStatus: MessageFns = { - encode(message: GrpcStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.status !== 0) { - writer.uint32(8).uint32(message.status); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GrpcStatus { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGrpcStatus(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.status = reader.uint32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): GrpcStatus { - return { status: isSet(object.status) ? globalThis.Number(object.status) : 0 }; - }, - - toJSON(message: GrpcStatus): unknown { - const obj: any = {}; - if (message.status !== 0) { - obj.status = Math.round(message.status); - } - return obj; - }, - - create, I>>(base?: I): GrpcStatus { - return GrpcStatus.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GrpcStatus { - const message = createBaseGrpcStatus(); - message.status = object.status ?? 0; - return message; - }, -}; - -function createBaseHeaderMutation(): HeaderMutation { - return { setHeaders: [], removeHeaders: [] }; -} - -export const HeaderMutation: MessageFns = { - encode(message: HeaderMutation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.setHeaders) { - HeaderValueOption.encode(v!, writer.uint32(10).fork()).join(); - } - for (const v of message.removeHeaders) { - writer.uint32(18).string(v!); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HeaderMutation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeaderMutation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.setHeaders.push(HeaderValueOption.decode(reader, reader.uint32())); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.removeHeaders.push(reader.string()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HeaderMutation { - return { - setHeaders: globalThis.Array.isArray(object?.setHeaders) - ? object.setHeaders.map((e: any) => HeaderValueOption.fromJSON(e)) - : [], - removeHeaders: globalThis.Array.isArray(object?.removeHeaders) - ? object.removeHeaders.map((e: any) => globalThis.String(e)) - : [], - }; - }, - - toJSON(message: HeaderMutation): unknown { - const obj: any = {}; - if (message.setHeaders?.length) { - obj.setHeaders = message.setHeaders.map((e) => HeaderValueOption.toJSON(e)); - } - if (message.removeHeaders?.length) { - obj.removeHeaders = message.removeHeaders; - } - return obj; - }, - - create, I>>(base?: I): HeaderMutation { - return HeaderMutation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HeaderMutation { - const message = createBaseHeaderMutation(); - message.setHeaders = object.setHeaders?.map((e) => HeaderValueOption.fromPartial(e)) || []; - message.removeHeaders = object.removeHeaders?.map((e) => e) || []; - return message; - }, -}; - -function createBaseStreamedBodyResponse(): StreamedBodyResponse { - return { body: new Uint8Array(0), endOfStream: false }; -} - -export const StreamedBodyResponse: MessageFns = { - encode(message: StreamedBodyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.body.length !== 0) { - writer.uint32(10).bytes(message.body); - } - if (message.endOfStream !== false) { - writer.uint32(16).bool(message.endOfStream); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): StreamedBodyResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStreamedBodyResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.body = reader.bytes(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.endOfStream = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): StreamedBodyResponse { - return { - body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), - endOfStream: isSet(object.endOfStream) ? globalThis.Boolean(object.endOfStream) : false, - }; - }, - - toJSON(message: StreamedBodyResponse): unknown { - const obj: any = {}; - if (message.body.length !== 0) { - obj.body = base64FromBytes(message.body); - } - if (message.endOfStream !== false) { - obj.endOfStream = message.endOfStream; - } - return obj; - }, - - create, I>>(base?: I): StreamedBodyResponse { - return StreamedBodyResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): StreamedBodyResponse { - const message = createBaseStreamedBodyResponse(); - message.body = object.body ?? new Uint8Array(0); - message.endOfStream = object.endOfStream ?? false; - return message; - }, -}; - -function createBaseBodyMutation(): BodyMutation { - return { body: undefined, clearBody: undefined, streamedResponse: undefined }; -} - -export const BodyMutation: MessageFns = { - encode(message: BodyMutation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.body !== undefined) { - writer.uint32(10).bytes(message.body); - } - if (message.clearBody !== undefined) { - writer.uint32(16).bool(message.clearBody); - } - if (message.streamedResponse !== undefined) { - StreamedBodyResponse.encode(message.streamedResponse, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BodyMutation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBodyMutation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.body = reader.bytes(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.clearBody = reader.bool(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.streamedResponse = StreamedBodyResponse.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BodyMutation { - return { - body: isSet(object.body) ? bytesFromBase64(object.body) : undefined, - clearBody: isSet(object.clearBody) ? globalThis.Boolean(object.clearBody) : undefined, - streamedResponse: isSet(object.streamedResponse) - ? StreamedBodyResponse.fromJSON(object.streamedResponse) - : undefined, - }; - }, - - toJSON(message: BodyMutation): unknown { - const obj: any = {}; - if (message.body !== undefined) { - obj.body = base64FromBytes(message.body); - } - if (message.clearBody !== undefined) { - obj.clearBody = message.clearBody; - } - if (message.streamedResponse !== undefined) { - obj.streamedResponse = StreamedBodyResponse.toJSON(message.streamedResponse); - } - return obj; - }, - - create, I>>(base?: I): BodyMutation { - return BodyMutation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BodyMutation { - const message = createBaseBodyMutation(); - message.body = object.body ?? undefined; - message.clearBody = object.clearBody ?? undefined; - message.streamedResponse = (object.streamedResponse !== undefined && object.streamedResponse !== null) - ? StreamedBodyResponse.fromPartial(object.streamedResponse) - : undefined; - return message; - }, -}; - -/** - * A service that can access and modify HTTP requests and responses - * as part of a filter chain. - * The overall external processing protocol works like this: - * - * 1. The data plane sends to the service information about the HTTP request. - * 2. The service sends back a ProcessingResponse message that directs - * the data plane to either stop processing, continue without it, or send - * it the next chunk of the message body. - * 3. If so requested, the data plane sends the server the message body in - * chunks, or the entire body at once. In either case, the server may send - * back a ProcessingResponse for each message it receives, or wait for - * a certain amount of body chunks received before streaming back the - * ProcessingResponse messages. - * 4. If so requested, the data plane sends the server the HTTP trailers, - * and the server sends back a ProcessingResponse. - * 5. At this point, request processing is done, and we pick up again - * at step 1 when the data plane receives a response from the upstream - * server. - * 6. At any point above, if the server closes the gRPC stream cleanly, - * then the data plane proceeds without consulting the server. - * 7. At any point above, if the server closes the gRPC stream with an error, - * then the data plane returns a 500 error to the client, unless the filter - * was configured to ignore errors. - * - * In other words, the process is a request/response conversation, but - * using a gRPC stream to make it easier for the server to - * maintain state. - */ -export type ExternalProcessorService = typeof ExternalProcessorService; -export const ExternalProcessorService = { - /** - * This begins the bidirectional stream that the data plane will use to - * give the server control over what the filter does. The actual - * protocol is described by the ProcessingRequest and ProcessingResponse - * messages below. - */ - process: { - path: "/envoy.service.ext_proc.v3.ExternalProcessor/Process", - requestStream: true, - responseStream: true, - requestSerialize: (value: ProcessingRequest): Buffer => Buffer.from(ProcessingRequest.encode(value).finish()), - requestDeserialize: (value: Buffer): ProcessingRequest => ProcessingRequest.decode(value), - responseSerialize: (value: ProcessingResponse): Buffer => Buffer.from(ProcessingResponse.encode(value).finish()), - responseDeserialize: (value: Buffer): ProcessingResponse => ProcessingResponse.decode(value), - }, -} as const; - -export interface ExternalProcessorServer extends UntypedServiceImplementation { - /** - * This begins the bidirectional stream that the data plane will use to - * give the server control over what the filter does. The actual - * protocol is described by the ProcessingRequest and ProcessingResponse - * messages below. - */ - process: handleBidiStreamingCall; -} - -export interface ExternalProcessorClient extends Client { - /** - * This begins the bidirectional stream that the data plane will use to - * give the server control over what the filter does. The actual - * protocol is described by the ProcessingRequest and ProcessingResponse - * messages below. - */ - process(): ClientDuplexStream; - process(options: Partial): ClientDuplexStream; - process( - metadata: Metadata, - options?: Partial, - ): ClientDuplexStream; -} - -export const ExternalProcessorClient = makeGenericClientConstructor( - ExternalProcessorService, - "envoy.service.ext_proc.v3.ExternalProcessor", -) as unknown as { - new (address: string, credentials: ChannelCredentials, options?: Partial): ExternalProcessorClient; - service: typeof ExternalProcessorService; - serviceName: string; -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts new file mode 100644 index 00000000..12c57abe --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts @@ -0,0 +1,860 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file envoy/service/ext_proc/v3/external_processor.proto (package envoy.service.ext_proc.v3, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { HeaderMap, HeaderValueOption, Metadata } from "../../../config/core/v3/base_pb.js"; +import { file_envoy_config_core_v3_base } from "../../../config/core/v3/base_pb.js"; +import type { ProcessingMode, ProcessingMode_BodySendMode } from "../../../extensions/filters/http/ext_proc/v3/processing_mode_pb.js"; +import { file_envoy_extensions_filters_http_ext_proc_v3_processing_mode } from "../../../extensions/filters/http/ext_proc/v3/processing_mode_pb.js"; +import type { HttpStatus } from "../../../type/v3/http_status_pb.js"; +import { file_envoy_type_v3_http_status } from "../../../type/v3/http_status_pb.js"; +import type { Duration } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_duration, file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; +import { file_xds_annotations_v3_status } from "../../../../xds/annotations/v3/status_pb.js"; +import { file_envoy_annotations_deprecation } from "../../../annotations/deprecation_pb.js"; +import { file_udpa_annotations_status } from "../../../../udpa/annotations/status_pb.js"; +import { file_validate_validate } from "../../../../validate/validate_pb.js"; +import type { JsonObject, Message } from "@bufbuild/protobuf"; + +/** + * Describes the file envoy/service/ext_proc/v3/external_processor.proto. + */ +export const file_envoy_service_ext_proc_v3_external_processor: GenFile = /*@__PURE__*/ + fileDesc("CjJlbnZveS9zZXJ2aWNlL2V4dF9wcm9jL3YzL2V4dGVybmFsX3Byb2Nlc3Nvci5wcm90bxIZZW52b3kuc2VydmljZS5leHRfcHJvYy52MyKpAgoVUHJvdG9jb2xDb25maWd1cmF0aW9uEmsKEXJlcXVlc3RfYm9keV9tb2RlGAEgASgOMkYuZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuQm9keVNlbmRNb2RlQgj6QgWCAQIQARJsChJyZXNwb25zZV9ib2R5X21vZGUYAiABKA4yRi5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52My5Qcm9jZXNzaW5nTW9kZS5Cb2R5U2VuZE1vZGVCCPpCBYIBAhABEjUKLXNlbmRfYm9keV93aXRob3V0X3dhaXRpbmdfZm9yX2hlYWRlcl9yZXNwb25zZRgDIAEoCCKBBgoRUHJvY2Vzc2luZ1JlcXVlc3QSQQoPcmVxdWVzdF9oZWFkZXJzGAIgASgLMiYuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IdHRwSGVhZGVyc0gAEkIKEHJlc3BvbnNlX2hlYWRlcnMYAyABKAsyJi5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkh0dHBIZWFkZXJzSAASOwoMcmVxdWVzdF9ib2R5GAQgASgLMiMuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IdHRwQm9keUgAEjwKDXJlc3BvbnNlX2JvZHkYBSABKAsyIy5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkh0dHBCb2R5SAASQwoQcmVxdWVzdF90cmFpbGVycxgGIAEoCzInLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuSHR0cFRyYWlsZXJzSAASRAoRcmVzcG9uc2VfdHJhaWxlcnMYByABKAsyJy5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkh0dHBUcmFpbGVyc0gAEjgKEG1ldGFkYXRhX2NvbnRleHQYCCABKAsyHi5lbnZveS5jb25maWcuY29yZS52My5NZXRhZGF0YRJQCgphdHRyaWJ1dGVzGAkgAygLMjwuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Qcm9jZXNzaW5nUmVxdWVzdC5BdHRyaWJ1dGVzRW50cnkSGgoSb2JzZXJ2YWJpbGl0eV9tb2RlGAogASgIEkkKD3Byb3RvY29sX2NvbmZpZxgLIAEoCzIwLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuUHJvdG9jb2xDb25maWd1cmF0aW9uGkoKD0F0dHJpYnV0ZXNFbnRyeRILCgNrZXkYASABKAkSJgoFdmFsdWUYAiABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0OgI4AUIOCgdyZXF1ZXN0EgP4QgFKBAgBEAJSCmFzeW5jX21vZGUi2AUKElByb2Nlc3NpbmdSZXNwb25zZRJFCg9yZXF1ZXN0X2hlYWRlcnMYASABKAsyKi5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkhlYWRlcnNSZXNwb25zZUgAEkYKEHJlc3BvbnNlX2hlYWRlcnMYAiABKAsyKi5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkhlYWRlcnNSZXNwb25zZUgAEj8KDHJlcXVlc3RfYm9keRgDIAEoCzInLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuQm9keVJlc3BvbnNlSAASQAoNcmVzcG9uc2VfYm9keRgEIAEoCzInLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuQm9keVJlc3BvbnNlSAASRwoQcmVxdWVzdF90cmFpbGVycxgFIAEoCzIrLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuVHJhaWxlcnNSZXNwb25zZUgAEkgKEXJlc3BvbnNlX3RyYWlsZXJzGAYgASgLMisuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5UcmFpbGVyc1Jlc3BvbnNlSAASSgoSaW1tZWRpYXRlX3Jlc3BvbnNlGAcgASgLMiwuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5JbW1lZGlhdGVSZXNwb25zZUgAEjEKEGR5bmFtaWNfbWV0YWRhdGEYCCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0ElAKDW1vZGVfb3ZlcnJpZGUYCSABKAsyOS5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52My5Qcm9jZXNzaW5nTW9kZRI7ChhvdmVycmlkZV9tZXNzYWdlX3RpbWVvdXQYCiABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CDwoIcmVzcG9uc2USA/hCASL7AQoLSHR0cEhlYWRlcnMSMAoHaGVhZGVycxgBIAEoCzIfLmVudm95LmNvbmZpZy5jb3JlLnYzLkhlYWRlck1hcBJXCgphdHRyaWJ1dGVzGAIgAygLMjYuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IdHRwSGVhZGVycy5BdHRyaWJ1dGVzRW50cnlCCxgBkseG2AQDMy4wEhUKDWVuZF9vZl9zdHJlYW0YAyABKAgaSgoPQXR0cmlidXRlc0VudHJ5EgsKA2tleRgBIAEoCRImCgV2YWx1ZRgCIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3Q6AjgBIi8KCEh0dHBCb2R5EgwKBGJvZHkYASABKAwSFQoNZW5kX29mX3N0cmVhbRgCIAEoCCJBCgxIdHRwVHJhaWxlcnMSMQoIdHJhaWxlcnMYASABKAsyHy5lbnZveS5jb25maWcuY29yZS52My5IZWFkZXJNYXAiTgoPSGVhZGVyc1Jlc3BvbnNlEjsKCHJlc3BvbnNlGAEgASgLMikuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Db21tb25SZXNwb25zZSJLCgxCb2R5UmVzcG9uc2USOwoIcmVzcG9uc2UYASABKAsyKS5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkNvbW1vblJlc3BvbnNlIlYKEFRyYWlsZXJzUmVzcG9uc2USQgoPaGVhZGVyX211dGF0aW9uGAEgASgLMikuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IZWFkZXJNdXRhdGlvbiLwAgoOQ29tbW9uUmVzcG9uc2USUgoGc3RhdHVzGAEgASgOMjguZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Db21tb25SZXNwb25zZS5SZXNwb25zZVN0YXR1c0II+kIFggECEAESQgoPaGVhZGVyX211dGF0aW9uGAIgASgLMikuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IZWFkZXJNdXRhdGlvbhI+Cg1ib2R5X211dGF0aW9uGAMgASgLMicuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Cb2R5TXV0YXRpb24SMQoIdHJhaWxlcnMYBCABKAsyHy5lbnZveS5jb25maWcuY29yZS52My5IZWFkZXJNYXASGQoRY2xlYXJfcm91dGVfY2FjaGUYBSABKAgiOAoOUmVzcG9uc2VTdGF0dXMSDAoIQ09OVElOVUUQABIYChRDT05USU5VRV9BTkRfUkVQTEFDRRABIt8BChFJbW1lZGlhdGVSZXNwb25zZRIzCgZzdGF0dXMYASABKAsyGS5lbnZveS50eXBlLnYzLkh0dHBTdGF0dXNCCPpCBYoBAhABEjoKB2hlYWRlcnMYAiABKAsyKS5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkhlYWRlck11dGF0aW9uEgwKBGJvZHkYAyABKAwSOgoLZ3JwY19zdGF0dXMYBCABKAsyJS5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkdycGNTdGF0dXMSDwoHZGV0YWlscxgFIAEoCSIcCgpHcnBjU3RhdHVzEg4KBnN0YXR1cxgBIAEoDSJmCg5IZWFkZXJNdXRhdGlvbhI8CgtzZXRfaGVhZGVycxgBIAMoCzInLmVudm95LmNvbmZpZy5jb3JlLnYzLkhlYWRlclZhbHVlT3B0aW9uEhYKDnJlbW92ZV9oZWFkZXJzGAIgAygJIjsKFFN0cmVhbWVkQm9keVJlc3BvbnNlEgwKBGJvZHkYASABKAwSFQoNZW5kX29mX3N0cmVhbRgCIAEoCCKYAQoMQm9keU11dGF0aW9uEg4KBGJvZHkYASABKAxIABIUCgpjbGVhcl9ib2R5GAIgASgISAASVgoRc3RyZWFtZWRfcmVzcG9uc2UYAyABKAsyLy5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLlN0cmVhbWVkQm9keVJlc3BvbnNlQgjSxqThBgIIAUgAQgoKCG11dGF0aW9uMn8KEUV4dGVybmFsUHJvY2Vzc29yEmoKB1Byb2Nlc3MSLC5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLlByb2Nlc3NpbmdSZXF1ZXN0Gi0uZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Qcm9jZXNzaW5nUmVzcG9uc2UoATABQpgBCidpby5lbnZveXByb3h5LmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjNCFkV4dGVybmFsUHJvY2Vzc29yUHJvdG9QAVpLZ2l0aHViLmNvbS9lbnZveXByb3h5L2dvLWNvbnRyb2wtcGxhbmUvZW52b3kvc2VydmljZS9leHRfcHJvYy92MztleHRfcHJvY3YzuoDI0QYCEAJiBnByb3RvMw", [file_envoy_config_core_v3_base, file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, file_envoy_type_v3_http_status, file_google_protobuf_duration, file_google_protobuf_struct, file_xds_annotations_v3_status, file_envoy_annotations_deprecation, file_udpa_annotations_status, file_validate_validate]); + +/** + * This message specifies the filter protocol configurations which will be sent to the ext_proc + * server in a :ref:`ProcessingRequest `. + * If the server does not support these protocol configurations, it may choose to close the gRPC stream. + * If the server supports these protocol configurations, it should respond based on the API specifications. + * + * @generated from message envoy.service.ext_proc.v3.ProtocolConfiguration + */ +export type ProtocolConfiguration = Message<"envoy.service.ext_proc.v3.ProtocolConfiguration"> & { + /** + * Specify the filter configuration :ref:`request_body_mode + * ` + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode request_body_mode = 1; + */ + requestBodyMode: ProcessingMode_BodySendMode; + + /** + * Specify the filter configuration :ref:`response_body_mode + * ` + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode response_body_mode = 2; + */ + responseBodyMode: ProcessingMode_BodySendMode; + + /** + * Specify the filter configuration :ref:`send_body_without_waiting_for_header_response + * ` + * If the client is waiting for a header response from the server, setting ``true`` means the client will send body to the server + * as they arrive. Setting ``false`` means the client will buffer the arrived data and not send it to the server immediately. + * + * @generated from field: bool send_body_without_waiting_for_header_response = 3; + */ + sendBodyWithoutWaitingForHeaderResponse: boolean; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.ProtocolConfiguration. + * Use `create(ProtocolConfigurationSchema)` to create a new message. + */ +export const ProtocolConfigurationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 0); + +/** + * This represents the different types of messages that Envoy can send + * to an external processing server. + * [#next-free-field: 12] + * + * @generated from message envoy.service.ext_proc.v3.ProcessingRequest + */ +export type ProcessingRequest = Message<"envoy.service.ext_proc.v3.ProcessingRequest"> & { + /** + * Each request message will include one of the following sub-messages. Which + * ones are set for a particular HTTP request/response depend on the + * processing mode. + * + * @generated from oneof envoy.service.ext_proc.v3.ProcessingRequest.request + */ + request: { + /** + * Information about the HTTP request headers, as well as peer info and additional + * properties. Unless ``observability_mode`` is ``true``, the server must send back a + * HeaderResponse message, an ImmediateResponse message, or close the stream. + * + * @generated from field: envoy.service.ext_proc.v3.HttpHeaders request_headers = 2; + */ + value: HttpHeaders; + case: "requestHeaders"; + } | { + /** + * Information about the HTTP response headers, as well as peer info and additional + * properties. Unless ``observability_mode`` is ``true``, the server must send back a + * HeaderResponse message or close the stream. + * + * @generated from field: envoy.service.ext_proc.v3.HttpHeaders response_headers = 3; + */ + value: HttpHeaders; + case: "responseHeaders"; + } | { + /** + * A chunk of the HTTP request body. Unless ``observability_mode`` is true, the server must send back + * a BodyResponse message, an ImmediateResponse message, or close the stream. + * + * @generated from field: envoy.service.ext_proc.v3.HttpBody request_body = 4; + */ + value: HttpBody; + case: "requestBody"; + } | { + /** + * A chunk of the HTTP response body. Unless ``observability_mode`` is ``true``, the server must send back + * a BodyResponse message or close the stream. + * + * @generated from field: envoy.service.ext_proc.v3.HttpBody response_body = 5; + */ + value: HttpBody; + case: "responseBody"; + } | { + /** + * The HTTP trailers for the request path. Unless ``observability_mode`` is ``true``, the server + * must send back a TrailerResponse message or close the stream. + * + * This message is only sent if the trailers processing mode is set to ``SEND`` and + * the original downstream request has trailers. + * + * @generated from field: envoy.service.ext_proc.v3.HttpTrailers request_trailers = 6; + */ + value: HttpTrailers; + case: "requestTrailers"; + } | { + /** + * The HTTP trailers for the response path. Unless ``observability_mode`` is ``true``, the server + * must send back a TrailerResponse message or close the stream. + * + * This message is only sent if the trailers processing mode is set to ``SEND`` and + * the original upstream response has trailers. + * + * @generated from field: envoy.service.ext_proc.v3.HttpTrailers response_trailers = 7; + */ + value: HttpTrailers; + case: "responseTrailers"; + } | { case: undefined; value?: undefined }; + + /** + * Dynamic metadata associated with the request. + * + * @generated from field: envoy.config.core.v3.Metadata metadata_context = 8; + */ + metadataContext?: Metadata; + + /** + * The values of properties selected by the ``request_attributes`` + * or ``response_attributes`` list in the configuration. Each entry + * in the list is populated from the standard + * :ref:`attributes ` supported across Envoy. + * + * @generated from field: map attributes = 9; + */ + attributes: { [key: string]: JsonObject }; + + /** + * Specify whether the filter that sent this request is running in :ref:`observability_mode + * ` + * and defaults to false. + * + * * A value of ``false`` indicates that the server must respond + * to this message by either sending back a matching ProcessingResponse message, + * or by closing the stream. + * * A value of ``true`` indicates that the server should not respond to this message, as any + * responses will be ignored. However, it may still close the stream to indicate that no more messages + * are needed. + * + * + * @generated from field: bool observability_mode = 10; + */ + observabilityMode: boolean; + + /** + * Specify the filter protocol configurations to be sent to the server. + * ``protocol_config`` is only encoded in the first ``ProcessingRequest`` message from the client to the server. + * + * @generated from field: envoy.service.ext_proc.v3.ProtocolConfiguration protocol_config = 11; + */ + protocolConfig?: ProtocolConfiguration; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.ProcessingRequest. + * Use `create(ProcessingRequestSchema)` to create a new message. + */ +export const ProcessingRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 1); + +/** + * This represents the different types of messages the server may send back to Envoy + * when the ``observability_mode`` field in the received ProcessingRequest is set to false. + * + * * If the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is not set to ``FULL_DUPLEX_STREAMED``, then for every received ProcessingRequest, + * the server must send back exactly one ProcessingResponse message. + * * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined + * for this mode to send the ProcessingResponse messages. + * [#next-free-field: 11] + * + * @generated from message envoy.service.ext_proc.v3.ProcessingResponse + */ +export type ProcessingResponse = Message<"envoy.service.ext_proc.v3.ProcessingResponse"> & { + /** + * The response type that is sent by the server. + * + * @generated from oneof envoy.service.ext_proc.v3.ProcessingResponse.response + */ + response: { + /** + * The server must send back this message in response to a message with the + * ``request_headers`` field set. + * + * @generated from field: envoy.service.ext_proc.v3.HeadersResponse request_headers = 1; + */ + value: HeadersResponse; + case: "requestHeaders"; + } | { + /** + * The server must send back this message in response to a message with the + * ``response_headers`` field set. + * + * @generated from field: envoy.service.ext_proc.v3.HeadersResponse response_headers = 2; + */ + value: HeadersResponse; + case: "responseHeaders"; + } | { + /** + * The server must send back this message in response to a message with + * the ``request_body`` field set. + * + * @generated from field: envoy.service.ext_proc.v3.BodyResponse request_body = 3; + */ + value: BodyResponse; + case: "requestBody"; + } | { + /** + * The server must send back this message in response to a message with + * the ``response_body`` field set. + * + * @generated from field: envoy.service.ext_proc.v3.BodyResponse response_body = 4; + */ + value: BodyResponse; + case: "responseBody"; + } | { + /** + * The server must send back this message in response to a message with + * the ``request_trailers`` field set. + * + * @generated from field: envoy.service.ext_proc.v3.TrailersResponse request_trailers = 5; + */ + value: TrailersResponse; + case: "requestTrailers"; + } | { + /** + * The server must send back this message in response to a message with + * the ``response_trailers`` field set. + * + * @generated from field: envoy.service.ext_proc.v3.TrailersResponse response_trailers = 6; + */ + value: TrailersResponse; + case: "responseTrailers"; + } | { + /** + * If specified, attempt to create a locally generated response, send it + * downstream, and stop processing additional filters and ignore any + * additional messages received from the remote server for this request or + * response. If a response has already started -- for example, if this + * message is sent response to a ``response_body`` message -- then + * this will either ship the reply directly to the downstream codec, + * or reset the stream. + * + * @generated from field: envoy.service.ext_proc.v3.ImmediateResponse immediate_response = 7; + */ + value: ImmediateResponse; + case: "immediateResponse"; + } | { case: undefined; value?: undefined }; + + /** + * Optional metadata that will be emitted as dynamic metadata to be consumed by + * following filters. This metadata will be placed in the namespace(s) specified by the top-level + * field name(s) of the struct. + * + * @generated from field: google.protobuf.Struct dynamic_metadata = 8; + */ + dynamicMetadata?: JsonObject; + + /** + * Override how parts of the HTTP request and response are processed + * for the duration of this particular request/response only. Servers + * may use this to intelligently control how requests are processed + * based on the headers and other metadata that they see. + * This field is only applicable when servers responding to the header requests. + * If it is set in the response to the body or trailer requests, it will be ignored by Envoy. + * It is also ignored by Envoy when the ext_proc filter config + * :ref:`allow_mode_override + * ` + * is set to false, or + * :ref:`send_body_without_waiting_for_header_response + * ` + * is set to true. + * + * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode mode_override = 9; + */ + modeOverride?: ProcessingMode; + + /** + * When ext_proc server receives a request message, in case it needs more + * time to process the message, it sends back a ProcessingResponse message + * with a new timeout value. When Envoy receives this response message, + * it ignores other fields in the response, just stop the original timer, + * which has the timeout value specified in + * :ref:`message_timeout + * ` + * and start a new timer with this ``override_message_timeout`` value and keep the + * Envoy ext_proc filter state machine intact. + * Has to be >= 1ms and <= + * :ref:`max_message_timeout ` + * Such message can be sent at most once in a particular Envoy ext_proc filter processing state. + * To enable this API, one has to set ``max_message_timeout`` to a number >= 1ms. + * + * @generated from field: google.protobuf.Duration override_message_timeout = 10; + */ + overrideMessageTimeout?: Duration; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.ProcessingResponse. + * Use `create(ProcessingResponseSchema)` to create a new message. + */ +export const ProcessingResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 2); + +/** + * This message is sent to the external server when the HTTP request and responses + * are first received. + * + * @generated from message envoy.service.ext_proc.v3.HttpHeaders + */ +export type HttpHeaders = Message<"envoy.service.ext_proc.v3.HttpHeaders"> & { + /** + * The HTTP request headers. All header keys will be + * lower-cased, because HTTP header keys are case-insensitive. + * The header value is encoded in the + * :ref:`raw_value ` field. + * + * @generated from field: envoy.config.core.v3.HeaderMap headers = 1; + */ + headers?: HeaderMap; + + /** + * [#not-implemented-hide:] + * This field is deprecated and not implemented. Attributes will be sent in + * the top-level :ref:`attributes attributes = 2 [deprecated = true]; + * @deprecated + */ + attributes: { [key: string]: JsonObject }; + + /** + * If ``true``, then there is no message body associated with this + * request or response. + * + * @generated from field: bool end_of_stream = 3; + */ + endOfStream: boolean; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.HttpHeaders. + * Use `create(HttpHeadersSchema)` to create a new message. + */ +export const HttpHeadersSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 3); + +/** + * This message is sent to the external server when the HTTP request and + * response bodies are received. + * + * @generated from message envoy.service.ext_proc.v3.HttpBody + */ +export type HttpBody = Message<"envoy.service.ext_proc.v3.HttpBody"> & { + /** + * The contents of the body in the HTTP request/response. Note that in + * streaming mode multiple ``HttpBody`` messages may be sent. + * + * @generated from field: bytes body = 1; + */ + body: Uint8Array; + + /** + * If ``true``, this will be the last ``HttpBody`` message that will be sent and no + * trailers will be sent for the current request/response. + * + * @generated from field: bool end_of_stream = 2; + */ + endOfStream: boolean; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.HttpBody. + * Use `create(HttpBodySchema)` to create a new message. + */ +export const HttpBodySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 4); + +/** + * This message is sent to the external server when the HTTP request and + * response trailers are received. + * + * @generated from message envoy.service.ext_proc.v3.HttpTrailers + */ +export type HttpTrailers = Message<"envoy.service.ext_proc.v3.HttpTrailers"> & { + /** + * The header value is encoded in the + * :ref:`raw_value ` field. + * + * @generated from field: envoy.config.core.v3.HeaderMap trailers = 1; + */ + trailers?: HeaderMap; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.HttpTrailers. + * Use `create(HttpTrailersSchema)` to create a new message. + */ +export const HttpTrailersSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 5); + +/** + * This message is sent by the external server to Envoy after ``HttpHeaders`` was + * sent to it. + * + * @generated from message envoy.service.ext_proc.v3.HeadersResponse + */ +export type HeadersResponse = Message<"envoy.service.ext_proc.v3.HeadersResponse"> & { + /** + * Details the modifications (if any) to be made by Envoy to the current + * request/response. + * + * @generated from field: envoy.service.ext_proc.v3.CommonResponse response = 1; + */ + response?: CommonResponse; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.HeadersResponse. + * Use `create(HeadersResponseSchema)` to create a new message. + */ +export const HeadersResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 6); + +/** + * This message is sent by the external server to Envoy after ``HttpBody`` was + * sent to it. + * + * @generated from message envoy.service.ext_proc.v3.BodyResponse + */ +export type BodyResponse = Message<"envoy.service.ext_proc.v3.BodyResponse"> & { + /** + * Details the modifications (if any) to be made by Envoy to the current + * request/response. + * + * @generated from field: envoy.service.ext_proc.v3.CommonResponse response = 1; + */ + response?: CommonResponse; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.BodyResponse. + * Use `create(BodyResponseSchema)` to create a new message. + */ +export const BodyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 7); + +/** + * This message is sent by the external server to Envoy after ``HttpTrailers`` was + * sent to it. + * + * @generated from message envoy.service.ext_proc.v3.TrailersResponse + */ +export type TrailersResponse = Message<"envoy.service.ext_proc.v3.TrailersResponse"> & { + /** + * Details the modifications (if any) to be made by Envoy to the current + * request/response trailers. + * + * @generated from field: envoy.service.ext_proc.v3.HeaderMutation header_mutation = 1; + */ + headerMutation?: HeaderMutation; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.TrailersResponse. + * Use `create(TrailersResponseSchema)` to create a new message. + */ +export const TrailersResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 8); + +/** + * This message contains common fields between header and body responses. + * [#next-free-field: 6] + * + * @generated from message envoy.service.ext_proc.v3.CommonResponse + */ +export type CommonResponse = Message<"envoy.service.ext_proc.v3.CommonResponse"> & { + /** + * If set, provide additional direction on how the Envoy proxy should + * handle the rest of the HTTP filter chain. + * + * @generated from field: envoy.service.ext_proc.v3.CommonResponse.ResponseStatus status = 1; + */ + status: CommonResponse_ResponseStatus; + + /** + * Instructions on how to manipulate the headers. When responding to an + * HttpBody request, header mutations will only take effect if + * the current processing mode for the body is BUFFERED. + * + * @generated from field: envoy.service.ext_proc.v3.HeaderMutation header_mutation = 2; + */ + headerMutation?: HeaderMutation; + + /** + * Replace the body of the last message sent to the remote server on this + * stream. If responding to an HttpBody request, simply replace or clear + * the body chunk that was sent with that request. Body mutations may take + * effect in response either to ``header`` or ``body`` messages. When it is + * in response to ``header`` messages, it only take effect if the + * :ref:`status ` + * is set to CONTINUE_AND_REPLACE. + * + * @generated from field: envoy.service.ext_proc.v3.BodyMutation body_mutation = 3; + */ + bodyMutation?: BodyMutation; + + /** + * [#not-implemented-hide:] + * Add new trailers to the message. This may be used when responding to either a + * HttpHeaders or HttpBody message, but only if this message is returned + * along with the CONTINUE_AND_REPLACE status. + * The header value is encoded in the + * :ref:`raw_value ` field. + * + * @generated from field: envoy.config.core.v3.HeaderMap trailers = 4; + */ + trailers?: HeaderMap; + + /** + * Clear the route cache for the current client request. This is necessary + * if the remote server modified headers that are used to calculate the route. + * This field is ignored in the response direction. This field is also ignored + * if the Envoy ext_proc filter is in the upstream filter chain. + * + * @generated from field: bool clear_route_cache = 5; + */ + clearRouteCache: boolean; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.CommonResponse. + * Use `create(CommonResponseSchema)` to create a new message. + */ +export const CommonResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 9); + +/** + * The status of the response. + * + * @generated from enum envoy.service.ext_proc.v3.CommonResponse.ResponseStatus + */ +export enum CommonResponse_ResponseStatus { + /** + * Apply the mutation instructions in this message to the + * request or response, and then continue processing the filter + * stream as normal. This is the default. + * + * @generated from enum value: CONTINUE = 0; + */ + CONTINUE = 0, + + /** + * Apply the specified header mutation, replace the body with the body + * specified in the body mutation (if present), and do not send any + * further messages for this request or response even if the processing + * mode is configured to do so. + * + * When used in response to a request_headers or response_headers message, + * this status makes it possible to either completely replace the body + * while discarding the original body, or to add a body to a message that + * formerly did not have one. + * + * In other words, this response makes it possible to turn an HTTP GET + * into a POST, PUT, or PATCH. + * + * @generated from enum value: CONTINUE_AND_REPLACE = 1; + */ + CONTINUE_AND_REPLACE = 1, +} + +/** + * Describes the enum envoy.service.ext_proc.v3.CommonResponse.ResponseStatus. + */ +export const CommonResponse_ResponseStatusSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_envoy_service_ext_proc_v3_external_processor, 9, 0); + +/** + * This message causes the filter to attempt to create a locally + * generated response, send it downstream, stop processing + * additional filters, and ignore any additional messages received + * from the remote server for this request or response. If a response + * has already started, then this will either ship the reply directly + * to the downstream codec, or reset the stream. + * [#next-free-field: 6] + * + * @generated from message envoy.service.ext_proc.v3.ImmediateResponse + */ +export type ImmediateResponse = Message<"envoy.service.ext_proc.v3.ImmediateResponse"> & { + /** + * The response code to return. + * + * @generated from field: envoy.type.v3.HttpStatus status = 1; + */ + status?: HttpStatus; + + /** + * Apply changes to the default headers, which will include content-type. + * + * @generated from field: envoy.service.ext_proc.v3.HeaderMutation headers = 2; + */ + headers?: HeaderMutation; + + /** + * The message body to return with the response which is sent using the + * text/plain content type, or encoded in the grpc-message header. + * + * @generated from field: bytes body = 3; + */ + body: Uint8Array; + + /** + * If set, then include a gRPC status trailer. + * + * @generated from field: envoy.service.ext_proc.v3.GrpcStatus grpc_status = 4; + */ + grpcStatus?: GrpcStatus; + + /** + * A string detailing why this local reply was sent, which may be included + * in log and debug output (e.g. this populates the %RESPONSE_CODE_DETAILS% + * command operator field for use in access logging). + * + * @generated from field: string details = 5; + */ + details: string; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.ImmediateResponse. + * Use `create(ImmediateResponseSchema)` to create a new message. + */ +export const ImmediateResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 10); + +/** + * This message specifies a gRPC status for an ImmediateResponse message. + * + * @generated from message envoy.service.ext_proc.v3.GrpcStatus + */ +export type GrpcStatus = Message<"envoy.service.ext_proc.v3.GrpcStatus"> & { + /** + * The actual gRPC status. + * + * @generated from field: uint32 status = 1; + */ + status: number; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.GrpcStatus. + * Use `create(GrpcStatusSchema)` to create a new message. + */ +export const GrpcStatusSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 11); + +/** + * Change HTTP headers or trailers by appending, replacing, or removing + * headers. + * + * @generated from message envoy.service.ext_proc.v3.HeaderMutation + */ +export type HeaderMutation = Message<"envoy.service.ext_proc.v3.HeaderMutation"> & { + /** + * Add or replace HTTP headers. Attempts to set the value of + * any ``x-envoy`` header, and attempts to set the ``:method``, + * ``:authority``, ``:scheme``, or ``host`` headers will be ignored. + * The header value is encoded in the + * :ref:`raw_value ` field. + * + * @generated from field: repeated envoy.config.core.v3.HeaderValueOption set_headers = 1; + */ + setHeaders: HeaderValueOption[]; + + /** + * Remove these HTTP headers. Attempts to remove system headers -- + * any header starting with ``:``, plus ``host`` -- will be ignored. + * + * @generated from field: repeated string remove_headers = 2; + */ + removeHeaders: string[]; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.HeaderMutation. + * Use `create(HeaderMutationSchema)` to create a new message. + */ +export const HeaderMutationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 12); + +/** + * The body response message corresponding to FULL_DUPLEX_STREAMED body mode. + * + * @generated from message envoy.service.ext_proc.v3.StreamedBodyResponse + */ +export type StreamedBodyResponse = Message<"envoy.service.ext_proc.v3.StreamedBodyResponse"> & { + /** + * The body response chunk that will be passed to the upstream/downstream by Envoy. + * + * @generated from field: bytes body = 1; + */ + body: Uint8Array; + + /** + * The server sets this flag to true if it has received a body request with + * :ref:`end_of_stream ` set to true, + * and this is the last chunk of body responses. + * + * @generated from field: bool end_of_stream = 2; + */ + endOfStream: boolean; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.StreamedBodyResponse. + * Use `create(StreamedBodyResponseSchema)` to create a new message. + */ +export const StreamedBodyResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 13); + +/** + * This message specifies the body mutation the server sends to Envoy. + * + * @generated from message envoy.service.ext_proc.v3.BodyMutation + */ +export type BodyMutation = Message<"envoy.service.ext_proc.v3.BodyMutation"> & { + /** + * The type of mutation for the body. + * + * @generated from oneof envoy.service.ext_proc.v3.BodyMutation.mutation + */ + mutation: { + /** + * The entire body to replace. + * Should only be used when the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is not set to ``FULL_DUPLEX_STREAMED``. + * + * @generated from field: bytes body = 1; + */ + value: Uint8Array; + case: "body"; + } | { + /** + * Clear the corresponding body chunk. + * Should only be used when the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is not set to ``FULL_DUPLEX_STREAMED``. + * Clear the corresponding body chunk. + * + * @generated from field: bool clear_body = 2; + */ + value: boolean; + case: "clearBody"; + } | { + /** + * Must be used when the corresponding ``BodySendMode`` in the + * :ref:`processing_mode ` + * is set to ``FULL_DUPLEX_STREAMED``. + * + * @generated from field: envoy.service.ext_proc.v3.StreamedBodyResponse streamed_response = 3; + */ + value: StreamedBodyResponse; + case: "streamedResponse"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message envoy.service.ext_proc.v3.BodyMutation. + * Use `create(BodyMutationSchema)` to create a new message. + */ +export const BodyMutationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_service_ext_proc_v3_external_processor, 14); + +/** + * A service that can access and modify HTTP requests and responses + * as part of a filter chain. + * The overall external processing protocol works like this: + * + * 1. Envoy sends to the service information about the HTTP request. + * 2. The service sends back a ProcessingResponse message that directs Envoy + * to either stop processing, continue without it, or send it the + * next chunk of the message body. + * 3. If so requested, Envoy sends the server the message body in chunks, + * or the entire body at once. In either case, the server may send back + * a ProcessingResponse for each message it receives, or wait for certain amount + * of body chunks received before streams back the ProcessingResponse messages. + * 4. If so requested, Envoy sends the server the HTTP trailers, + * and the server sends back a ProcessingResponse. + * 5. At this point, request processing is done, and we pick up again + * at step 1 when Envoy receives a response from the upstream server. + * 6. At any point above, if the server closes the gRPC stream cleanly, + * then Envoy proceeds without consulting the server. + * 7. At any point above, if the server closes the gRPC stream with an error, + * then Envoy returns a 500 error to the client, unless the filter + * was configured to ignore errors. + * + * In other words, the process is a request/response conversation, but + * using a gRPC stream to make it easier for the server to + * maintain state. + * + * @generated from service envoy.service.ext_proc.v3.ExternalProcessor + */ +export const ExternalProcessor: GenService<{ + /** + * This begins the bidirectional stream that Envoy will use to + * give the server control over what the filter does. The actual + * protocol is described by the ProcessingRequest and ProcessingResponse + * messages below. + * + * @generated from rpc envoy.service.ext_proc.v3.ExternalProcessor.Process + */ + process: { + methodKind: "bidi_streaming"; + input: typeof ProcessingRequestSchema; + output: typeof ProcessingResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_envoy_service_ext_proc_v3_external_processor, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts deleted file mode 100644 index 5f431353..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status.ts +++ /dev/null @@ -1,526 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/type/v3/http_status.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "envoy.type.v3"; - -/** - * HTTP response codes supported in Envoy. - * For more details: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - */ -export enum StatusCode { - /** - * Empty - Empty - This code not part of the HTTP status code specification, but it is needed for proto - * `enum` type. - */ - Empty = 0, - /** Continue - Continue - ``100`` status code. */ - Continue = 100, - /** OK - OK - ``200`` status code. */ - OK = 200, - /** Created - Created - ``201`` status code. */ - Created = 201, - /** Accepted - Accepted - ``202`` status code. */ - Accepted = 202, - /** NonAuthoritativeInformation - NonAuthoritativeInformation - ``203`` status code. */ - NonAuthoritativeInformation = 203, - /** NoContent - NoContent - ``204`` status code. */ - NoContent = 204, - /** ResetContent - ResetContent - ``205`` status code. */ - ResetContent = 205, - /** PartialContent - PartialContent - ``206`` status code. */ - PartialContent = 206, - /** MultiStatus - MultiStatus - ``207`` status code. */ - MultiStatus = 207, - /** AlreadyReported - AlreadyReported - ``208`` status code. */ - AlreadyReported = 208, - /** IMUsed - IMUsed - ``226`` status code. */ - IMUsed = 226, - /** MultipleChoices - MultipleChoices - ``300`` status code. */ - MultipleChoices = 300, - /** MovedPermanently - MovedPermanently - ``301`` status code. */ - MovedPermanently = 301, - /** Found - Found - ``302`` status code. */ - Found = 302, - /** SeeOther - SeeOther - ``303`` status code. */ - SeeOther = 303, - /** NotModified - NotModified - ``304`` status code. */ - NotModified = 304, - /** UseProxy - UseProxy - ``305`` status code. */ - UseProxy = 305, - /** TemporaryRedirect - TemporaryRedirect - ``307`` status code. */ - TemporaryRedirect = 307, - /** PermanentRedirect - PermanentRedirect - ``308`` status code. */ - PermanentRedirect = 308, - /** BadRequest - BadRequest - ``400`` status code. */ - BadRequest = 400, - /** Unauthorized - Unauthorized - ``401`` status code. */ - Unauthorized = 401, - /** PaymentRequired - PaymentRequired - ``402`` status code. */ - PaymentRequired = 402, - /** Forbidden - Forbidden - ``403`` status code. */ - Forbidden = 403, - /** NotFound - NotFound - ``404`` status code. */ - NotFound = 404, - /** MethodNotAllowed - MethodNotAllowed - ``405`` status code. */ - MethodNotAllowed = 405, - /** NotAcceptable - NotAcceptable - ``406`` status code. */ - NotAcceptable = 406, - /** ProxyAuthenticationRequired - ProxyAuthenticationRequired - ``407`` status code. */ - ProxyAuthenticationRequired = 407, - /** RequestTimeout - RequestTimeout - ``408`` status code. */ - RequestTimeout = 408, - /** Conflict - Conflict - ``409`` status code. */ - Conflict = 409, - /** Gone - Gone - ``410`` status code. */ - Gone = 410, - /** LengthRequired - LengthRequired - ``411`` status code. */ - LengthRequired = 411, - /** PreconditionFailed - PreconditionFailed - ``412`` status code. */ - PreconditionFailed = 412, - /** PayloadTooLarge - PayloadTooLarge - ``413`` status code. */ - PayloadTooLarge = 413, - /** URITooLong - URITooLong - ``414`` status code. */ - URITooLong = 414, - /** UnsupportedMediaType - UnsupportedMediaType - ``415`` status code. */ - UnsupportedMediaType = 415, - /** RangeNotSatisfiable - RangeNotSatisfiable - ``416`` status code. */ - RangeNotSatisfiable = 416, - /** ExpectationFailed - ExpectationFailed - ``417`` status code. */ - ExpectationFailed = 417, - /** MisdirectedRequest - MisdirectedRequest - ``421`` status code. */ - MisdirectedRequest = 421, - /** UnprocessableEntity - UnprocessableEntity - ``422`` status code. */ - UnprocessableEntity = 422, - /** Locked - Locked - ``423`` status code. */ - Locked = 423, - /** FailedDependency - FailedDependency - ``424`` status code. */ - FailedDependency = 424, - /** UpgradeRequired - UpgradeRequired - ``426`` status code. */ - UpgradeRequired = 426, - /** PreconditionRequired - PreconditionRequired - ``428`` status code. */ - PreconditionRequired = 428, - /** TooManyRequests - TooManyRequests - ``429`` status code. */ - TooManyRequests = 429, - /** RequestHeaderFieldsTooLarge - RequestHeaderFieldsTooLarge - ``431`` status code. */ - RequestHeaderFieldsTooLarge = 431, - /** InternalServerError - InternalServerError - ``500`` status code. */ - InternalServerError = 500, - /** NotImplemented - NotImplemented - ``501`` status code. */ - NotImplemented = 501, - /** BadGateway - BadGateway - ``502`` status code. */ - BadGateway = 502, - /** ServiceUnavailable - ServiceUnavailable - ``503`` status code. */ - ServiceUnavailable = 503, - /** GatewayTimeout - GatewayTimeout - ``504`` status code. */ - GatewayTimeout = 504, - /** HTTPVersionNotSupported - HTTPVersionNotSupported - ``505`` status code. */ - HTTPVersionNotSupported = 505, - /** VariantAlsoNegotiates - VariantAlsoNegotiates - ``506`` status code. */ - VariantAlsoNegotiates = 506, - /** InsufficientStorage - InsufficientStorage - ``507`` status code. */ - InsufficientStorage = 507, - /** LoopDetected - LoopDetected - ``508`` status code. */ - LoopDetected = 508, - /** NotExtended - NotExtended - ``510`` status code. */ - NotExtended = 510, - /** NetworkAuthenticationRequired - NetworkAuthenticationRequired - ``511`` status code. */ - NetworkAuthenticationRequired = 511, - UNRECOGNIZED = -1, -} - -export function statusCodeFromJSON(object: any): StatusCode { - switch (object) { - case 0: - case "Empty": - return StatusCode.Empty; - case 100: - case "Continue": - return StatusCode.Continue; - case 200: - case "OK": - return StatusCode.OK; - case 201: - case "Created": - return StatusCode.Created; - case 202: - case "Accepted": - return StatusCode.Accepted; - case 203: - case "NonAuthoritativeInformation": - return StatusCode.NonAuthoritativeInformation; - case 204: - case "NoContent": - return StatusCode.NoContent; - case 205: - case "ResetContent": - return StatusCode.ResetContent; - case 206: - case "PartialContent": - return StatusCode.PartialContent; - case 207: - case "MultiStatus": - return StatusCode.MultiStatus; - case 208: - case "AlreadyReported": - return StatusCode.AlreadyReported; - case 226: - case "IMUsed": - return StatusCode.IMUsed; - case 300: - case "MultipleChoices": - return StatusCode.MultipleChoices; - case 301: - case "MovedPermanently": - return StatusCode.MovedPermanently; - case 302: - case "Found": - return StatusCode.Found; - case 303: - case "SeeOther": - return StatusCode.SeeOther; - case 304: - case "NotModified": - return StatusCode.NotModified; - case 305: - case "UseProxy": - return StatusCode.UseProxy; - case 307: - case "TemporaryRedirect": - return StatusCode.TemporaryRedirect; - case 308: - case "PermanentRedirect": - return StatusCode.PermanentRedirect; - case 400: - case "BadRequest": - return StatusCode.BadRequest; - case 401: - case "Unauthorized": - return StatusCode.Unauthorized; - case 402: - case "PaymentRequired": - return StatusCode.PaymentRequired; - case 403: - case "Forbidden": - return StatusCode.Forbidden; - case 404: - case "NotFound": - return StatusCode.NotFound; - case 405: - case "MethodNotAllowed": - return StatusCode.MethodNotAllowed; - case 406: - case "NotAcceptable": - return StatusCode.NotAcceptable; - case 407: - case "ProxyAuthenticationRequired": - return StatusCode.ProxyAuthenticationRequired; - case 408: - case "RequestTimeout": - return StatusCode.RequestTimeout; - case 409: - case "Conflict": - return StatusCode.Conflict; - case 410: - case "Gone": - return StatusCode.Gone; - case 411: - case "LengthRequired": - return StatusCode.LengthRequired; - case 412: - case "PreconditionFailed": - return StatusCode.PreconditionFailed; - case 413: - case "PayloadTooLarge": - return StatusCode.PayloadTooLarge; - case 414: - case "URITooLong": - return StatusCode.URITooLong; - case 415: - case "UnsupportedMediaType": - return StatusCode.UnsupportedMediaType; - case 416: - case "RangeNotSatisfiable": - return StatusCode.RangeNotSatisfiable; - case 417: - case "ExpectationFailed": - return StatusCode.ExpectationFailed; - case 421: - case "MisdirectedRequest": - return StatusCode.MisdirectedRequest; - case 422: - case "UnprocessableEntity": - return StatusCode.UnprocessableEntity; - case 423: - case "Locked": - return StatusCode.Locked; - case 424: - case "FailedDependency": - return StatusCode.FailedDependency; - case 426: - case "UpgradeRequired": - return StatusCode.UpgradeRequired; - case 428: - case "PreconditionRequired": - return StatusCode.PreconditionRequired; - case 429: - case "TooManyRequests": - return StatusCode.TooManyRequests; - case 431: - case "RequestHeaderFieldsTooLarge": - return StatusCode.RequestHeaderFieldsTooLarge; - case 500: - case "InternalServerError": - return StatusCode.InternalServerError; - case 501: - case "NotImplemented": - return StatusCode.NotImplemented; - case 502: - case "BadGateway": - return StatusCode.BadGateway; - case 503: - case "ServiceUnavailable": - return StatusCode.ServiceUnavailable; - case 504: - case "GatewayTimeout": - return StatusCode.GatewayTimeout; - case 505: - case "HTTPVersionNotSupported": - return StatusCode.HTTPVersionNotSupported; - case 506: - case "VariantAlsoNegotiates": - return StatusCode.VariantAlsoNegotiates; - case 507: - case "InsufficientStorage": - return StatusCode.InsufficientStorage; - case 508: - case "LoopDetected": - return StatusCode.LoopDetected; - case 510: - case "NotExtended": - return StatusCode.NotExtended; - case 511: - case "NetworkAuthenticationRequired": - return StatusCode.NetworkAuthenticationRequired; - case -1: - case "UNRECOGNIZED": - default: - return StatusCode.UNRECOGNIZED; - } -} - -export function statusCodeToJSON(object: StatusCode): string { - switch (object) { - case StatusCode.Empty: - return "Empty"; - case StatusCode.Continue: - return "Continue"; - case StatusCode.OK: - return "OK"; - case StatusCode.Created: - return "Created"; - case StatusCode.Accepted: - return "Accepted"; - case StatusCode.NonAuthoritativeInformation: - return "NonAuthoritativeInformation"; - case StatusCode.NoContent: - return "NoContent"; - case StatusCode.ResetContent: - return "ResetContent"; - case StatusCode.PartialContent: - return "PartialContent"; - case StatusCode.MultiStatus: - return "MultiStatus"; - case StatusCode.AlreadyReported: - return "AlreadyReported"; - case StatusCode.IMUsed: - return "IMUsed"; - case StatusCode.MultipleChoices: - return "MultipleChoices"; - case StatusCode.MovedPermanently: - return "MovedPermanently"; - case StatusCode.Found: - return "Found"; - case StatusCode.SeeOther: - return "SeeOther"; - case StatusCode.NotModified: - return "NotModified"; - case StatusCode.UseProxy: - return "UseProxy"; - case StatusCode.TemporaryRedirect: - return "TemporaryRedirect"; - case StatusCode.PermanentRedirect: - return "PermanentRedirect"; - case StatusCode.BadRequest: - return "BadRequest"; - case StatusCode.Unauthorized: - return "Unauthorized"; - case StatusCode.PaymentRequired: - return "PaymentRequired"; - case StatusCode.Forbidden: - return "Forbidden"; - case StatusCode.NotFound: - return "NotFound"; - case StatusCode.MethodNotAllowed: - return "MethodNotAllowed"; - case StatusCode.NotAcceptable: - return "NotAcceptable"; - case StatusCode.ProxyAuthenticationRequired: - return "ProxyAuthenticationRequired"; - case StatusCode.RequestTimeout: - return "RequestTimeout"; - case StatusCode.Conflict: - return "Conflict"; - case StatusCode.Gone: - return "Gone"; - case StatusCode.LengthRequired: - return "LengthRequired"; - case StatusCode.PreconditionFailed: - return "PreconditionFailed"; - case StatusCode.PayloadTooLarge: - return "PayloadTooLarge"; - case StatusCode.URITooLong: - return "URITooLong"; - case StatusCode.UnsupportedMediaType: - return "UnsupportedMediaType"; - case StatusCode.RangeNotSatisfiable: - return "RangeNotSatisfiable"; - case StatusCode.ExpectationFailed: - return "ExpectationFailed"; - case StatusCode.MisdirectedRequest: - return "MisdirectedRequest"; - case StatusCode.UnprocessableEntity: - return "UnprocessableEntity"; - case StatusCode.Locked: - return "Locked"; - case StatusCode.FailedDependency: - return "FailedDependency"; - case StatusCode.UpgradeRequired: - return "UpgradeRequired"; - case StatusCode.PreconditionRequired: - return "PreconditionRequired"; - case StatusCode.TooManyRequests: - return "TooManyRequests"; - case StatusCode.RequestHeaderFieldsTooLarge: - return "RequestHeaderFieldsTooLarge"; - case StatusCode.InternalServerError: - return "InternalServerError"; - case StatusCode.NotImplemented: - return "NotImplemented"; - case StatusCode.BadGateway: - return "BadGateway"; - case StatusCode.ServiceUnavailable: - return "ServiceUnavailable"; - case StatusCode.GatewayTimeout: - return "GatewayTimeout"; - case StatusCode.HTTPVersionNotSupported: - return "HTTPVersionNotSupported"; - case StatusCode.VariantAlsoNegotiates: - return "VariantAlsoNegotiates"; - case StatusCode.InsufficientStorage: - return "InsufficientStorage"; - case StatusCode.LoopDetected: - return "LoopDetected"; - case StatusCode.NotExtended: - return "NotExtended"; - case StatusCode.NetworkAuthenticationRequired: - return "NetworkAuthenticationRequired"; - case StatusCode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** HTTP status. */ -export interface HttpStatus { - /** Supplies HTTP response code. */ - code: StatusCode; -} - -function createBaseHttpStatus(): HttpStatus { - return { code: 0 }; -} - -export const HttpStatus: MessageFns = { - encode(message: HttpStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).int32(message.code); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): HttpStatus { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpStatus(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.code = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): HttpStatus { - return { code: isSet(object.code) ? statusCodeFromJSON(object.code) : 0 }; - }, - - toJSON(message: HttpStatus): unknown { - const obj: any = {}; - if (message.code !== 0) { - obj.code = statusCodeToJSON(message.code); - } - return obj; - }, - - create, I>>(base?: I): HttpStatus { - return HttpStatus.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpStatus { - const message = createBaseHttpStatus(); - message.code = object.code ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts new file mode 100644 index 00000000..a597912e --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts @@ -0,0 +1,452 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file envoy/type/v3/http_status.proto (package envoy.type.v3, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_udpa_annotations_status } from "../../../udpa/annotations/status_pb.js"; +import { file_udpa_annotations_versioning } from "../../../udpa/annotations/versioning_pb.js"; +import { file_validate_validate } from "../../../validate/validate_pb.js"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file envoy/type/v3/http_status.proto. + */ +export const file_envoy_type_v3_http_status: GenFile = /*@__PURE__*/ + fileDesc("Ch9lbnZveS90eXBlL3YzL2h0dHBfc3RhdHVzLnByb3RvEg1lbnZveS50eXBlLnYzIl8KCkh0dHBTdGF0dXMSMwoEY29kZRgBIAEoDjIZLmVudm95LnR5cGUudjMuU3RhdHVzQ29kZUIK+kIHggEEEAEgADocmsWIHhcKFWVudm95LnR5cGUuSHR0cFN0YXR1cyq1CQoKU3RhdHVzQ29kZRIJCgVFbXB0eRAAEgwKCENvbnRpbnVlEGQSBwoCT0sQyAESDAoHQ3JlYXRlZBDJARINCghBY2NlcHRlZBDKARIgChtOb25BdXRob3JpdGF0aXZlSW5mb3JtYXRpb24QywESDgoJTm9Db250ZW50EMwBEhEKDFJlc2V0Q29udGVudBDNARITCg5QYXJ0aWFsQ29udGVudBDOARIQCgtNdWx0aVN0YXR1cxDPARIUCg9BbHJlYWR5UmVwb3J0ZWQQ0AESCwoGSU1Vc2VkEOIBEhQKD011bHRpcGxlQ2hvaWNlcxCsAhIVChBNb3ZlZFBlcm1hbmVudGx5EK0CEgoKBUZvdW5kEK4CEg0KCFNlZU90aGVyEK8CEhAKC05vdE1vZGlmaWVkELACEg0KCFVzZVByb3h5ELECEhYKEVRlbXBvcmFyeVJlZGlyZWN0ELMCEhYKEVBlcm1hbmVudFJlZGlyZWN0ELQCEg8KCkJhZFJlcXVlc3QQkAMSEQoMVW5hdXRob3JpemVkEJEDEhQKD1BheW1lbnRSZXF1aXJlZBCSAxIOCglGb3JiaWRkZW4QkwMSDQoITm90Rm91bmQQlAMSFQoQTWV0aG9kTm90QWxsb3dlZBCVAxISCg1Ob3RBY2NlcHRhYmxlEJYDEiAKG1Byb3h5QXV0aGVudGljYXRpb25SZXF1aXJlZBCXAxITCg5SZXF1ZXN0VGltZW91dBCYAxINCghDb25mbGljdBCZAxIJCgRHb25lEJoDEhMKDkxlbmd0aFJlcXVpcmVkEJsDEhcKElByZWNvbmRpdGlvbkZhaWxlZBCcAxIUCg9QYXlsb2FkVG9vTGFyZ2UQnQMSDwoKVVJJVG9vTG9uZxCeAxIZChRVbnN1cHBvcnRlZE1lZGlhVHlwZRCfAxIYChNSYW5nZU5vdFNhdGlzZmlhYmxlEKADEhYKEUV4cGVjdGF0aW9uRmFpbGVkEKEDEhcKEk1pc2RpcmVjdGVkUmVxdWVzdBClAxIYChNVbnByb2Nlc3NhYmxlRW50aXR5EKYDEgsKBkxvY2tlZBCnAxIVChBGYWlsZWREZXBlbmRlbmN5EKgDEhQKD1VwZ3JhZGVSZXF1aXJlZBCqAxIZChRQcmVjb25kaXRpb25SZXF1aXJlZBCsAxIUCg9Ub29NYW55UmVxdWVzdHMQrQMSIAobUmVxdWVzdEhlYWRlckZpZWxkc1Rvb0xhcmdlEK8DEhgKE0ludGVybmFsU2VydmVyRXJyb3IQ9AMSEwoOTm90SW1wbGVtZW50ZWQQ9QMSDwoKQmFkR2F0ZXdheRD2AxIXChJTZXJ2aWNlVW5hdmFpbGFibGUQ9wMSEwoOR2F0ZXdheVRpbWVvdXQQ+AMSHAoXSFRUUFZlcnNpb25Ob3RTdXBwb3J0ZWQQ+QMSGgoVVmFyaWFudEFsc29OZWdvdGlhdGVzEPoDEhgKE0luc3VmZmljaWVudFN0b3JhZ2UQ+wMSEQoMTG9vcERldGVjdGVkEPwDEhAKC05vdEV4dGVuZGVkEP4DEiIKHU5ldHdvcmtBdXRoZW50aWNhdGlvblJlcXVpcmVkEP8DQnUKG2lvLmVudm95cHJveHkuZW52b3kudHlwZS52M0IPSHR0cFN0YXR1c1Byb3RvUAFaO2dpdGh1Yi5jb20vZW52b3lwcm94eS9nby1jb250cm9sLXBsYW5lL2Vudm95L3R5cGUvdjM7dHlwZXYzuoDI0QYCEAJiBnByb3RvMw", [file_udpa_annotations_status, file_udpa_annotations_versioning, file_validate_validate]); + +/** + * HTTP status. + * + * @generated from message envoy.type.v3.HttpStatus + */ +export type HttpStatus = Message<"envoy.type.v3.HttpStatus"> & { + /** + * Supplies HTTP response code. + * + * @generated from field: envoy.type.v3.StatusCode code = 1; + */ + code: StatusCode; +}; + +/** + * Describes the message envoy.type.v3.HttpStatus. + * Use `create(HttpStatusSchema)` to create a new message. + */ +export const HttpStatusSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_envoy_type_v3_http_status, 0); + +/** + * HTTP response codes supported in Envoy. + * For more details: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + * + * @generated from enum envoy.type.v3.StatusCode + */ +export enum StatusCode { + /** + * Empty - This code not part of the HTTP status code specification, but it is needed for proto + * `enum` type. + * + * @generated from enum value: Empty = 0; + */ + Empty = 0, + + /** + * Continue - ``100`` status code. + * + * @generated from enum value: Continue = 100; + */ + Continue = 100, + + /** + * OK - ``200`` status code. + * + * @generated from enum value: OK = 200; + */ + OK = 200, + + /** + * Created - ``201`` status code. + * + * @generated from enum value: Created = 201; + */ + Created = 201, + + /** + * Accepted - ``202`` status code. + * + * @generated from enum value: Accepted = 202; + */ + Accepted = 202, + + /** + * NonAuthoritativeInformation - ``203`` status code. + * + * @generated from enum value: NonAuthoritativeInformation = 203; + */ + NonAuthoritativeInformation = 203, + + /** + * NoContent - ``204`` status code. + * + * @generated from enum value: NoContent = 204; + */ + NoContent = 204, + + /** + * ResetContent - ``205`` status code. + * + * @generated from enum value: ResetContent = 205; + */ + ResetContent = 205, + + /** + * PartialContent - ``206`` status code. + * + * @generated from enum value: PartialContent = 206; + */ + PartialContent = 206, + + /** + * MultiStatus - ``207`` status code. + * + * @generated from enum value: MultiStatus = 207; + */ + MultiStatus = 207, + + /** + * AlreadyReported - ``208`` status code. + * + * @generated from enum value: AlreadyReported = 208; + */ + AlreadyReported = 208, + + /** + * IMUsed - ``226`` status code. + * + * @generated from enum value: IMUsed = 226; + */ + IMUsed = 226, + + /** + * MultipleChoices - ``300`` status code. + * + * @generated from enum value: MultipleChoices = 300; + */ + MultipleChoices = 300, + + /** + * MovedPermanently - ``301`` status code. + * + * @generated from enum value: MovedPermanently = 301; + */ + MovedPermanently = 301, + + /** + * Found - ``302`` status code. + * + * @generated from enum value: Found = 302; + */ + Found = 302, + + /** + * SeeOther - ``303`` status code. + * + * @generated from enum value: SeeOther = 303; + */ + SeeOther = 303, + + /** + * NotModified - ``304`` status code. + * + * @generated from enum value: NotModified = 304; + */ + NotModified = 304, + + /** + * UseProxy - ``305`` status code. + * + * @generated from enum value: UseProxy = 305; + */ + UseProxy = 305, + + /** + * TemporaryRedirect - ``307`` status code. + * + * @generated from enum value: TemporaryRedirect = 307; + */ + TemporaryRedirect = 307, + + /** + * PermanentRedirect - ``308`` status code. + * + * @generated from enum value: PermanentRedirect = 308; + */ + PermanentRedirect = 308, + + /** + * BadRequest - ``400`` status code. + * + * @generated from enum value: BadRequest = 400; + */ + BadRequest = 400, + + /** + * Unauthorized - ``401`` status code. + * + * @generated from enum value: Unauthorized = 401; + */ + Unauthorized = 401, + + /** + * PaymentRequired - ``402`` status code. + * + * @generated from enum value: PaymentRequired = 402; + */ + PaymentRequired = 402, + + /** + * Forbidden - ``403`` status code. + * + * @generated from enum value: Forbidden = 403; + */ + Forbidden = 403, + + /** + * NotFound - ``404`` status code. + * + * @generated from enum value: NotFound = 404; + */ + NotFound = 404, + + /** + * MethodNotAllowed - ``405`` status code. + * + * @generated from enum value: MethodNotAllowed = 405; + */ + MethodNotAllowed = 405, + + /** + * NotAcceptable - ``406`` status code. + * + * @generated from enum value: NotAcceptable = 406; + */ + NotAcceptable = 406, + + /** + * ProxyAuthenticationRequired - ``407`` status code. + * + * @generated from enum value: ProxyAuthenticationRequired = 407; + */ + ProxyAuthenticationRequired = 407, + + /** + * RequestTimeout - ``408`` status code. + * + * @generated from enum value: RequestTimeout = 408; + */ + RequestTimeout = 408, + + /** + * Conflict - ``409`` status code. + * + * @generated from enum value: Conflict = 409; + */ + Conflict = 409, + + /** + * Gone - ``410`` status code. + * + * @generated from enum value: Gone = 410; + */ + Gone = 410, + + /** + * LengthRequired - ``411`` status code. + * + * @generated from enum value: LengthRequired = 411; + */ + LengthRequired = 411, + + /** + * PreconditionFailed - ``412`` status code. + * + * @generated from enum value: PreconditionFailed = 412; + */ + PreconditionFailed = 412, + + /** + * PayloadTooLarge - ``413`` status code. + * + * @generated from enum value: PayloadTooLarge = 413; + */ + PayloadTooLarge = 413, + + /** + * URITooLong - ``414`` status code. + * + * @generated from enum value: URITooLong = 414; + */ + URITooLong = 414, + + /** + * UnsupportedMediaType - ``415`` status code. + * + * @generated from enum value: UnsupportedMediaType = 415; + */ + UnsupportedMediaType = 415, + + /** + * RangeNotSatisfiable - ``416`` status code. + * + * @generated from enum value: RangeNotSatisfiable = 416; + */ + RangeNotSatisfiable = 416, + + /** + * ExpectationFailed - ``417`` status code. + * + * @generated from enum value: ExpectationFailed = 417; + */ + ExpectationFailed = 417, + + /** + * MisdirectedRequest - ``421`` status code. + * + * @generated from enum value: MisdirectedRequest = 421; + */ + MisdirectedRequest = 421, + + /** + * UnprocessableEntity - ``422`` status code. + * + * @generated from enum value: UnprocessableEntity = 422; + */ + UnprocessableEntity = 422, + + /** + * Locked - ``423`` status code. + * + * @generated from enum value: Locked = 423; + */ + Locked = 423, + + /** + * FailedDependency - ``424`` status code. + * + * @generated from enum value: FailedDependency = 424; + */ + FailedDependency = 424, + + /** + * UpgradeRequired - ``426`` status code. + * + * @generated from enum value: UpgradeRequired = 426; + */ + UpgradeRequired = 426, + + /** + * PreconditionRequired - ``428`` status code. + * + * @generated from enum value: PreconditionRequired = 428; + */ + PreconditionRequired = 428, + + /** + * TooManyRequests - ``429`` status code. + * + * @generated from enum value: TooManyRequests = 429; + */ + TooManyRequests = 429, + + /** + * RequestHeaderFieldsTooLarge - ``431`` status code. + * + * @generated from enum value: RequestHeaderFieldsTooLarge = 431; + */ + RequestHeaderFieldsTooLarge = 431, + + /** + * InternalServerError - ``500`` status code. + * + * @generated from enum value: InternalServerError = 500; + */ + InternalServerError = 500, + + /** + * NotImplemented - ``501`` status code. + * + * @generated from enum value: NotImplemented = 501; + */ + NotImplemented = 501, + + /** + * BadGateway - ``502`` status code. + * + * @generated from enum value: BadGateway = 502; + */ + BadGateway = 502, + + /** + * ServiceUnavailable - ``503`` status code. + * + * @generated from enum value: ServiceUnavailable = 503; + */ + ServiceUnavailable = 503, + + /** + * GatewayTimeout - ``504`` status code. + * + * @generated from enum value: GatewayTimeout = 504; + */ + GatewayTimeout = 504, + + /** + * HTTPVersionNotSupported - ``505`` status code. + * + * @generated from enum value: HTTPVersionNotSupported = 505; + */ + HTTPVersionNotSupported = 505, + + /** + * VariantAlsoNegotiates - ``506`` status code. + * + * @generated from enum value: VariantAlsoNegotiates = 506; + */ + VariantAlsoNegotiates = 506, + + /** + * InsufficientStorage - ``507`` status code. + * + * @generated from enum value: InsufficientStorage = 507; + */ + InsufficientStorage = 507, + + /** + * LoopDetected - ``508`` status code. + * + * @generated from enum value: LoopDetected = 508; + */ + LoopDetected = 508, + + /** + * NotExtended - ``510`` status code. + * + * @generated from enum value: NotExtended = 510; + */ + NotExtended = 510, + + /** + * NetworkAuthenticationRequired - ``511`` status code. + * + * @generated from enum value: NetworkAuthenticationRequired = 511; + */ + NetworkAuthenticationRequired = 511, +} + +/** + * Describes the enum envoy.type.v3.StatusCode. + */ +export const StatusCodeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_envoy_type_v3_http_status, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts deleted file mode 100644 index 231a69cb..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/percent.ts +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/type/v3/percent.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "envoy.type.v3"; - -/** Identifies a percentage, in the range [0.0, 100.0]. */ -export interface Percent { - value: number; -} - -/** - * A fractional percentage is used in cases in which for performance reasons performing floating - * point to integer conversions during randomness calculations is undesirable. The message includes - * both a numerator and denominator that together determine the final fractional value. - * - * * **Example**: 1/100 = 1%. - * * **Example**: 3/10000 = 0.03%. - */ -export interface FractionalPercent { - /** Specifies the numerator. Defaults to 0. */ - numerator: number; - /** - * Specifies the denominator. If the denominator specified is less than the numerator, the final - * fractional percentage is capped at 1 (100%). - */ - denominator: FractionalPercent_DenominatorType; -} - -/** Fraction percentages support several fixed denominator values. */ -export enum FractionalPercent_DenominatorType { - /** - * HUNDRED - 100. - * - * **Example**: 1/100 = 1%. - */ - HUNDRED = 0, - /** - * TEN_THOUSAND - 10,000. - * - * **Example**: 1/10000 = 0.01%. - */ - TEN_THOUSAND = 1, - /** - * MILLION - 1,000,000. - * - * **Example**: 1/1000000 = 0.0001%. - */ - MILLION = 2, - UNRECOGNIZED = -1, -} - -export function fractionalPercent_DenominatorTypeFromJSON(object: any): FractionalPercent_DenominatorType { - switch (object) { - case 0: - case "HUNDRED": - return FractionalPercent_DenominatorType.HUNDRED; - case 1: - case "TEN_THOUSAND": - return FractionalPercent_DenominatorType.TEN_THOUSAND; - case 2: - case "MILLION": - return FractionalPercent_DenominatorType.MILLION; - case -1: - case "UNRECOGNIZED": - default: - return FractionalPercent_DenominatorType.UNRECOGNIZED; - } -} - -export function fractionalPercent_DenominatorTypeToJSON(object: FractionalPercent_DenominatorType): string { - switch (object) { - case FractionalPercent_DenominatorType.HUNDRED: - return "HUNDRED"; - case FractionalPercent_DenominatorType.TEN_THOUSAND: - return "TEN_THOUSAND"; - case FractionalPercent_DenominatorType.MILLION: - return "MILLION"; - case FractionalPercent_DenominatorType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -function createBasePercent(): Percent { - return { value: 0 }; -} - -export const Percent: MessageFns = { - encode(message: Percent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== 0) { - writer.uint32(9).double(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Percent { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePercent(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 9) { - break; - } - - message.value = reader.double(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Percent { - return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; - }, - - toJSON(message: Percent): unknown { - const obj: any = {}; - if (message.value !== 0) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): Percent { - return Percent.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Percent { - const message = createBasePercent(); - message.value = object.value ?? 0; - return message; - }, -}; - -function createBaseFractionalPercent(): FractionalPercent { - return { numerator: 0, denominator: 0 }; -} - -export const FractionalPercent: MessageFns = { - encode(message: FractionalPercent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.numerator !== 0) { - writer.uint32(8).uint32(message.numerator); - } - if (message.denominator !== 0) { - writer.uint32(16).int32(message.denominator); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FractionalPercent { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFractionalPercent(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.numerator = reader.uint32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.denominator = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FractionalPercent { - return { - numerator: isSet(object.numerator) ? globalThis.Number(object.numerator) : 0, - denominator: isSet(object.denominator) ? fractionalPercent_DenominatorTypeFromJSON(object.denominator) : 0, - }; - }, - - toJSON(message: FractionalPercent): unknown { - const obj: any = {}; - if (message.numerator !== 0) { - obj.numerator = Math.round(message.numerator); - } - if (message.denominator !== 0) { - obj.denominator = fractionalPercent_DenominatorTypeToJSON(message.denominator); - } - return obj; - }, - - create, I>>(base?: I): FractionalPercent { - return FractionalPercent.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FractionalPercent { - const message = createBaseFractionalPercent(); - message.numerator = object.numerator ?? 0; - message.denominator = object.denominator ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts deleted file mode 100644 index 5fa5e849..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/semantic_version.ts +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: envoy/type/v3/semantic_version.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "envoy.type.v3"; - -/** - * Envoy uses SemVer (https://semver.org/). Major/minor versions indicate - * expected behaviors and APIs, the patch version field is used only - * for security fixes and can be generally ignored. - */ -export interface SemanticVersion { - majorNumber: number; - minorNumber: number; - patch: number; -} - -function createBaseSemanticVersion(): SemanticVersion { - return { majorNumber: 0, minorNumber: 0, patch: 0 }; -} - -export const SemanticVersion: MessageFns = { - encode(message: SemanticVersion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.majorNumber !== 0) { - writer.uint32(8).uint32(message.majorNumber); - } - if (message.minorNumber !== 0) { - writer.uint32(16).uint32(message.minorNumber); - } - if (message.patch !== 0) { - writer.uint32(24).uint32(message.patch); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SemanticVersion { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSemanticVersion(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.majorNumber = reader.uint32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.minorNumber = reader.uint32(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.patch = reader.uint32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SemanticVersion { - return { - majorNumber: isSet(object.majorNumber) ? globalThis.Number(object.majorNumber) : 0, - minorNumber: isSet(object.minorNumber) ? globalThis.Number(object.minorNumber) : 0, - patch: isSet(object.patch) ? globalThis.Number(object.patch) : 0, - }; - }, - - toJSON(message: SemanticVersion): unknown { - const obj: any = {}; - if (message.majorNumber !== 0) { - obj.majorNumber = Math.round(message.majorNumber); - } - if (message.minorNumber !== 0) { - obj.minorNumber = Math.round(message.minorNumber); - } - if (message.patch !== 0) { - obj.patch = Math.round(message.patch); - } - return obj; - }, - - create, I>>(base?: I): SemanticVersion { - return SemanticVersion.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SemanticVersion { - const message = createBaseSemanticVersion(); - message.majorNumber = object.majorNumber ?? 0; - message.minorNumber = object.minorNumber ?? 0; - message.patch = object.patch ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts deleted file mode 100644 index 065a51ad..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/any.ts +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: google/protobuf/any.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "google.protobuf"; - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * // or ... - * if (any.isSameTypeAs(Foo.getDefaultInstance())) { - * foo = any.unpack(Foo.getDefaultInstance()); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * JSON - * ==== - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message [google.protobuf.Duration][]): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - */ -export interface Any { - /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a [google.protobuf.Type][] - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. As of May 2023, there are no widely used type server - * implementations and no plans to implement one. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - */ - typeUrl: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: Uint8Array; -} - -function createBaseAny(): Any { - return { typeUrl: "", value: new Uint8Array(0) }; -} - -export const Any: MessageFns = { - encode(message: Any, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.typeUrl !== "") { - writer.uint32(10).string(message.typeUrl); - } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Any { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAny(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.typeUrl = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = reader.bytes(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Any { - return { - typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "", - value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0), - }; - }, - - toJSON(message: Any): unknown { - const obj: any = {}; - if (message.typeUrl !== "") { - obj.typeUrl = message.typeUrl; - } - if (message.value.length !== 0) { - obj.value = base64FromBytes(message.value); - } - return obj; - }, - - create, I>>(base?: I): Any { - return Any.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Any { - const message = createBaseAny(); - message.typeUrl = object.typeUrl ?? ""; - message.value = object.value ?? new Uint8Array(0); - return message; - }, -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts deleted file mode 100644 index 4adebdf2..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/descriptor.ts +++ /dev/null @@ -1,6975 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: google/protobuf/descriptor.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "google.protobuf"; - -/** The full set of known editions. */ -export enum Edition { - /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ - EDITION_UNKNOWN = 0, - /** - * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature - * was first introduced. This is effectively an "infinite past". - */ - EDITION_LEGACY = 900, - /** - * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like - * distinct editions. These can't be used to specify the edition of proto - * files, but feature definitions must supply proto2/proto3 defaults for - * backwards compatibility. - */ - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - /** - * EDITION_2023 - Editions that have been released. The specific values are arbitrary and - * should not be depended on, but they will always be time-ordered for easy - * comparison. - */ - EDITION_2023 = 1000, - EDITION_2024 = 1001, - /** - * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be - * used or relied on outside of tests. - */ - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - /** - * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only - * ever be used by plugins that can expect to never require any changes to - * support a new edition. - */ - EDITION_MAX = 2147483647, - UNRECOGNIZED = -1, -} - -export function editionFromJSON(object: any): Edition { - switch (object) { - case 0: - case "EDITION_UNKNOWN": - return Edition.EDITION_UNKNOWN; - case 900: - case "EDITION_LEGACY": - return Edition.EDITION_LEGACY; - case 998: - case "EDITION_PROTO2": - return Edition.EDITION_PROTO2; - case 999: - case "EDITION_PROTO3": - return Edition.EDITION_PROTO3; - case 1000: - case "EDITION_2023": - return Edition.EDITION_2023; - case 1001: - case "EDITION_2024": - return Edition.EDITION_2024; - case 1: - case "EDITION_1_TEST_ONLY": - return Edition.EDITION_1_TEST_ONLY; - case 2: - case "EDITION_2_TEST_ONLY": - return Edition.EDITION_2_TEST_ONLY; - case 99997: - case "EDITION_99997_TEST_ONLY": - return Edition.EDITION_99997_TEST_ONLY; - case 99998: - case "EDITION_99998_TEST_ONLY": - return Edition.EDITION_99998_TEST_ONLY; - case 99999: - case "EDITION_99999_TEST_ONLY": - return Edition.EDITION_99999_TEST_ONLY; - case 2147483647: - case "EDITION_MAX": - return Edition.EDITION_MAX; - case -1: - case "UNRECOGNIZED": - default: - return Edition.UNRECOGNIZED; - } -} - -export function editionToJSON(object: Edition): string { - switch (object) { - case Edition.EDITION_UNKNOWN: - return "EDITION_UNKNOWN"; - case Edition.EDITION_LEGACY: - return "EDITION_LEGACY"; - case Edition.EDITION_PROTO2: - return "EDITION_PROTO2"; - case Edition.EDITION_PROTO3: - return "EDITION_PROTO3"; - case Edition.EDITION_2023: - return "EDITION_2023"; - case Edition.EDITION_2024: - return "EDITION_2024"; - case Edition.EDITION_1_TEST_ONLY: - return "EDITION_1_TEST_ONLY"; - case Edition.EDITION_2_TEST_ONLY: - return "EDITION_2_TEST_ONLY"; - case Edition.EDITION_99997_TEST_ONLY: - return "EDITION_99997_TEST_ONLY"; - case Edition.EDITION_99998_TEST_ONLY: - return "EDITION_99998_TEST_ONLY"; - case Edition.EDITION_99999_TEST_ONLY: - return "EDITION_99999_TEST_ONLY"; - case Edition.EDITION_MAX: - return "EDITION_MAX"; - case Edition.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * Describes the 'visibility' of a symbol with respect to the proto import - * system. Symbols can only be imported when the visibility rules do not prevent - * it (ex: local symbols cannot be imported). Visibility modifiers can only set - * on `message` and `enum` as they are the only types available to be referenced - * from other files. - */ -export enum SymbolVisibility { - VISIBILITY_UNSET = 0, - VISIBILITY_LOCAL = 1, - VISIBILITY_EXPORT = 2, - UNRECOGNIZED = -1, -} - -export function symbolVisibilityFromJSON(object: any): SymbolVisibility { - switch (object) { - case 0: - case "VISIBILITY_UNSET": - return SymbolVisibility.VISIBILITY_UNSET; - case 1: - case "VISIBILITY_LOCAL": - return SymbolVisibility.VISIBILITY_LOCAL; - case 2: - case "VISIBILITY_EXPORT": - return SymbolVisibility.VISIBILITY_EXPORT; - case -1: - case "UNRECOGNIZED": - default: - return SymbolVisibility.UNRECOGNIZED; - } -} - -export function symbolVisibilityToJSON(object: SymbolVisibility): string { - switch (object) { - case SymbolVisibility.VISIBILITY_UNSET: - return "VISIBILITY_UNSET"; - case SymbolVisibility.VISIBILITY_LOCAL: - return "VISIBILITY_LOCAL"; - case SymbolVisibility.VISIBILITY_EXPORT: - return "VISIBILITY_EXPORT"; - case SymbolVisibility.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface FileDescriptorProto { - /** file name, relative to root of source tree */ - name?: - | string - | undefined; - /** e.g. "foo", "foo.bar", etc. */ - package?: - | string - | undefined; - /** Names of files imported by this file. */ - dependency: string[]; - /** Indexes of the public imported files in the dependency list above. */ - publicDependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weakDependency: number[]; - /** - * Names of files imported by this file purely for the purpose of providing - * option extensions. These are excluded from the dependency list above. - */ - optionDependency: string[]; - /** All top-level definitions in this file. */ - messageType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - service: ServiceDescriptorProto[]; - extension: FieldDescriptorProto[]; - options?: - | FileOptions - | undefined; - /** - * This field contains optional information about the original source code. - * You may safely remove this entire field without harming runtime - * functionality of the descriptors -- the information is needed only by - * development tools. - */ - sourceCodeInfo?: - | SourceCodeInfo - | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2", "proto3", and "editions". - * - * If `edition` is present, this value must be "editions". - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - syntax?: - | string - | undefined; - /** - * The edition of the proto file. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - edition?: Edition | undefined; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name?: string | undefined; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nestedType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - extensionRange: DescriptorProto_ExtensionRange[]; - oneofDecl: OneofDescriptorProto[]; - options?: MessageOptions | undefined; - reservedRange: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reservedName: string[]; - /** Support for `export` and `local` keywords on enums. */ - visibility?: SymbolVisibility | undefined; -} - -export interface DescriptorProto_ExtensionRange { - /** Inclusive. */ - start?: - | number - | undefined; - /** Exclusive. */ - end?: number | undefined; - options?: ExtensionRangeOptions | undefined; -} - -/** - * Range of reserved tag numbers. Reserved tag numbers may not be used by - * fields or extension ranges in the same message. Reserved ranges may - * not overlap. - */ -export interface DescriptorProto_ReservedRange { - /** Inclusive. */ - start?: - | number - | undefined; - /** Exclusive. */ - end?: number | undefined; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; - /** - * For external users: DO NOT USE. We are in the process of open sourcing - * extension declaration and executing internal cleanups before it can be - * used externally. - */ - declaration: ExtensionRangeOptions_Declaration[]; - /** Any features defined in the specific edition. */ - features?: - | FeatureSet - | undefined; - /** - * The verification state of the range. - * TODO: flip the default to DECLARATION once all empty ranges - * are marked as UNVERIFIED. - */ - verification?: ExtensionRangeOptions_VerificationState | undefined; -} - -/** The verification state of the extension range. */ -export enum ExtensionRangeOptions_VerificationState { - /** DECLARATION - All the extensions of the range must be declared. */ - DECLARATION = 0, - UNVERIFIED = 1, - UNRECOGNIZED = -1, -} - -export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState { - switch (object) { - case 0: - case "DECLARATION": - return ExtensionRangeOptions_VerificationState.DECLARATION; - case 1: - case "UNVERIFIED": - return ExtensionRangeOptions_VerificationState.UNVERIFIED; - case -1: - case "UNRECOGNIZED": - default: - return ExtensionRangeOptions_VerificationState.UNRECOGNIZED; - } -} - -export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string { - switch (object) { - case ExtensionRangeOptions_VerificationState.DECLARATION: - return "DECLARATION"; - case ExtensionRangeOptions_VerificationState.UNVERIFIED: - return "UNVERIFIED"; - case ExtensionRangeOptions_VerificationState.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface ExtensionRangeOptions_Declaration { - /** The extension number declared within the extension range. */ - number?: - | number - | undefined; - /** - * The fully-qualified name of the extension field. There must be a leading - * dot in front of the full name. - */ - fullName?: - | string - | undefined; - /** - * The fully-qualified type name of the extension field. Unlike - * Metadata.type, Declaration.type must have a leading dot for messages - * and enums. - */ - type?: - | string - | undefined; - /** - * If true, indicates that the number is reserved in the extension range, - * and any extension field with the number will fail to compile. Set this - * when a declared extension field is deleted. - */ - reserved?: - | boolean - | undefined; - /** - * If true, indicates that the extension must be defined as repeated. - * Otherwise the extension must be defined as optional. - */ - repeated?: boolean | undefined; -} - -/** Describes a field within a message. */ -export interface FieldDescriptorProto { - name?: string | undefined; - number?: number | undefined; - label?: - | FieldDescriptorProto_Label - | undefined; - /** - * If type_name is set, this need not be set. If both this and type_name - * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - */ - type?: - | FieldDescriptorProto_Type - | undefined; - /** - * For message and enum types, this is the name of the type. If the name - * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - * rules are used to find the type (i.e. first the nested types within this - * message are searched, then within the parent, on up to the root - * namespace). - */ - typeName?: - | string - | undefined; - /** - * For extensions, this is the name of the type being extended. It is - * resolved in the same manner as type_name. - */ - extendee?: - | string - | undefined; - /** - * For numeric types, contains the original text representation of the value. - * For booleans, "true" or "false". - * For strings, contains the default text contents (not escaped in any way). - * For bytes, contains the C escaped value. All bytes >= 128 are escaped. - */ - defaultValue?: - | string - | undefined; - /** - * If set, gives the index of a oneof in the containing type's oneof_decl - * list. This field is a member of that oneof. - */ - oneofIndex?: - | number - | undefined; - /** - * JSON name of this field. The value is set by protocol compiler. If the - * user has set a "json_name" option on this field, that option's value - * will be used. Otherwise, it's deduced from the field's name by converting - * it to camelCase. - */ - jsonName?: string | undefined; - options?: - | FieldOptions - | undefined; - /** - * If true, this is a proto3 "optional". When a proto3 field is optional, it - * tracks presence regardless of field type. - * - * When proto3_optional is true, this field must belong to a oneof to signal - * to old proto3 clients that presence is tracked for this field. This oneof - * is known as a "synthetic" oneof, and this field must be its sole member - * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs - * exist in the descriptor only, and do not generate any API. Synthetic oneofs - * must be ordered after all "real" oneofs. - * - * For message fields, proto3_optional doesn't create any semantic change, - * since non-repeated message fields always track presence. However it still - * indicates the semantic detail of whether the user wrote "optional" or not. - * This can be useful for round-tripping the .proto file. For consistency we - * give message fields a synthetic oneof also, even though it is not required - * to track presence. This is especially important because the parser can't - * tell if a field is a message or an enum, so it must always create a - * synthetic oneof. - * - * Proto2 optional fields do not set this flag, because they already indicate - * optional with `LABEL_OPTIONAL`. - */ - proto3Optional?: boolean | undefined; -} - -export enum FieldDescriptorProto_Type { - /** - * TYPE_DOUBLE - 0 is reserved for errors. - * Order is weird for historical reasons. - */ - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - /** - * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - * negative values are likely. - */ - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - /** - * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - * negative values are likely. - */ - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - /** - * TYPE_GROUP - Tag-delimited aggregate. - * Group type is deprecated and not supported after google.protobuf. However, Proto3 - * implementations should still be able to parse the group wire format and - * treat group fields as unknown fields. In Editions, the group wire format - * can be enabled via the `message_encoding` feature. - */ - TYPE_GROUP = 10, - /** TYPE_MESSAGE - Length-delimited aggregate. */ - TYPE_MESSAGE = 11, - /** TYPE_BYTES - New in version 2. */ - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - /** TYPE_SINT32 - Uses ZigZag encoding. */ - TYPE_SINT32 = 17, - /** TYPE_SINT64 - Uses ZigZag encoding. */ - TYPE_SINT64 = 18, - UNRECOGNIZED = -1, -} - -export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { - switch (object) { - case 1: - case "TYPE_DOUBLE": - return FieldDescriptorProto_Type.TYPE_DOUBLE; - case 2: - case "TYPE_FLOAT": - return FieldDescriptorProto_Type.TYPE_FLOAT; - case 3: - case "TYPE_INT64": - return FieldDescriptorProto_Type.TYPE_INT64; - case 4: - case "TYPE_UINT64": - return FieldDescriptorProto_Type.TYPE_UINT64; - case 5: - case "TYPE_INT32": - return FieldDescriptorProto_Type.TYPE_INT32; - case 6: - case "TYPE_FIXED64": - return FieldDescriptorProto_Type.TYPE_FIXED64; - case 7: - case "TYPE_FIXED32": - return FieldDescriptorProto_Type.TYPE_FIXED32; - case 8: - case "TYPE_BOOL": - return FieldDescriptorProto_Type.TYPE_BOOL; - case 9: - case "TYPE_STRING": - return FieldDescriptorProto_Type.TYPE_STRING; - case 10: - case "TYPE_GROUP": - return FieldDescriptorProto_Type.TYPE_GROUP; - case 11: - case "TYPE_MESSAGE": - return FieldDescriptorProto_Type.TYPE_MESSAGE; - case 12: - case "TYPE_BYTES": - return FieldDescriptorProto_Type.TYPE_BYTES; - case 13: - case "TYPE_UINT32": - return FieldDescriptorProto_Type.TYPE_UINT32; - case 14: - case "TYPE_ENUM": - return FieldDescriptorProto_Type.TYPE_ENUM; - case 15: - case "TYPE_SFIXED32": - return FieldDescriptorProto_Type.TYPE_SFIXED32; - case 16: - case "TYPE_SFIXED64": - return FieldDescriptorProto_Type.TYPE_SFIXED64; - case 17: - case "TYPE_SINT32": - return FieldDescriptorProto_Type.TYPE_SINT32; - case 18: - case "TYPE_SINT64": - return FieldDescriptorProto_Type.TYPE_SINT64; - case -1: - case "UNRECOGNIZED": - default: - return FieldDescriptorProto_Type.UNRECOGNIZED; - } -} - -export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { - switch (object) { - case FieldDescriptorProto_Type.TYPE_DOUBLE: - return "TYPE_DOUBLE"; - case FieldDescriptorProto_Type.TYPE_FLOAT: - return "TYPE_FLOAT"; - case FieldDescriptorProto_Type.TYPE_INT64: - return "TYPE_INT64"; - case FieldDescriptorProto_Type.TYPE_UINT64: - return "TYPE_UINT64"; - case FieldDescriptorProto_Type.TYPE_INT32: - return "TYPE_INT32"; - case FieldDescriptorProto_Type.TYPE_FIXED64: - return "TYPE_FIXED64"; - case FieldDescriptorProto_Type.TYPE_FIXED32: - return "TYPE_FIXED32"; - case FieldDescriptorProto_Type.TYPE_BOOL: - return "TYPE_BOOL"; - case FieldDescriptorProto_Type.TYPE_STRING: - return "TYPE_STRING"; - case FieldDescriptorProto_Type.TYPE_GROUP: - return "TYPE_GROUP"; - case FieldDescriptorProto_Type.TYPE_MESSAGE: - return "TYPE_MESSAGE"; - case FieldDescriptorProto_Type.TYPE_BYTES: - return "TYPE_BYTES"; - case FieldDescriptorProto_Type.TYPE_UINT32: - return "TYPE_UINT32"; - case FieldDescriptorProto_Type.TYPE_ENUM: - return "TYPE_ENUM"; - case FieldDescriptorProto_Type.TYPE_SFIXED32: - return "TYPE_SFIXED32"; - case FieldDescriptorProto_Type.TYPE_SFIXED64: - return "TYPE_SFIXED64"; - case FieldDescriptorProto_Type.TYPE_SINT32: - return "TYPE_SINT32"; - case FieldDescriptorProto_Type.TYPE_SINT64: - return "TYPE_SINT64"; - case FieldDescriptorProto_Type.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FieldDescriptorProto_Label { - /** LABEL_OPTIONAL - 0 is reserved for errors */ - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - /** - * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions - * it's explicitly prohibited. In Editions, the `field_presence` feature - * can be used to get this behavior. - */ - LABEL_REQUIRED = 2, - UNRECOGNIZED = -1, -} - -export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { - switch (object) { - case 1: - case "LABEL_OPTIONAL": - return FieldDescriptorProto_Label.LABEL_OPTIONAL; - case 3: - case "LABEL_REPEATED": - return FieldDescriptorProto_Label.LABEL_REPEATED; - case 2: - case "LABEL_REQUIRED": - return FieldDescriptorProto_Label.LABEL_REQUIRED; - case -1: - case "UNRECOGNIZED": - default: - return FieldDescriptorProto_Label.UNRECOGNIZED; - } -} - -export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { - switch (object) { - case FieldDescriptorProto_Label.LABEL_OPTIONAL: - return "LABEL_OPTIONAL"; - case FieldDescriptorProto_Label.LABEL_REPEATED: - return "LABEL_REPEATED"; - case FieldDescriptorProto_Label.LABEL_REQUIRED: - return "LABEL_REQUIRED"; - case FieldDescriptorProto_Label.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name?: string | undefined; - options?: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface EnumDescriptorProto { - name?: string | undefined; - value: EnumValueDescriptorProto[]; - options?: - | EnumOptions - | undefined; - /** - * Range of reserved numeric values. Reserved numeric values may not be used - * by enum values in the same enum declaration. Reserved ranges may not - * overlap. - */ - reservedRange: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reservedName: string[]; - /** Support for `export` and `local` keywords on enums. */ - visibility?: SymbolVisibility | undefined; -} - -/** - * Range of reserved numeric values. Reserved values may not be used by - * entries in the same enum. Reserved ranges may not overlap. - * - * Note that this is distinct from DescriptorProto.ReservedRange in that it - * is inclusive such that it can appropriately represent the entire int32 - * domain. - */ -export interface EnumDescriptorProto_EnumReservedRange { - /** Inclusive. */ - start?: - | number - | undefined; - /** Inclusive. */ - end?: number | undefined; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name?: string | undefined; - number?: number | undefined; - options?: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name?: string | undefined; - method: MethodDescriptorProto[]; - options?: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface MethodDescriptorProto { - name?: - | string - | undefined; - /** - * Input and output type names. These are resolved in the same way as - * FieldDescriptorProto.type_name, but must refer to a message type. - */ - inputType?: string | undefined; - outputType?: string | undefined; - options?: - | MethodOptions - | undefined; - /** Identifies if client streams multiple client messages */ - clientStreaming?: - | boolean - | undefined; - /** Identifies if server streams multiple server messages */ - serverStreaming?: boolean | undefined; -} - -export interface FileOptions { - /** - * Sets the Java package where classes generated from this .proto will be - * placed. By default, the proto package is used, but this is often - * inappropriate because proto packages do not normally start with backwards - * domain names. - */ - javaPackage?: - | string - | undefined; - /** - * Controls the name of the wrapper Java class generated for the .proto file. - * That class will always contain the .proto file's getDescriptor() method as - * well as any top-level extensions defined in the .proto file. - * If java_multiple_files is disabled, then all the other classes from the - * .proto file will be nested inside the single wrapper outer class. - */ - javaOuterClassname?: - | string - | undefined; - /** - * If enabled, then the Java code generator will generate a separate .java - * file for each top-level message, enum, and service defined in the .proto - * file. Thus, these types will *not* be nested inside the wrapper class - * named by java_outer_classname. However, the wrapper class will still be - * generated to contain the file's getDescriptor() method as well as any - * top-level extensions defined in the file. - */ - javaMultipleFiles?: - | boolean - | undefined; - /** - * This option does nothing. - * - * @deprecated - */ - javaGenerateEqualsAndHash?: - | boolean - | undefined; - /** - * A proto2 file can set this to true to opt in to UTF-8 checking for Java, - * which will throw an exception if invalid UTF-8 is parsed from the wire or - * assigned to a string field. - * - * TODO: clarify exactly what kinds of field types this option - * applies to, and update these docs accordingly. - * - * Proto3 files already perform these checks. Setting the option explicitly to - * false has no effect: it cannot be used to opt proto3 files out of UTF-8 - * checks. - */ - javaStringCheckUtf8?: boolean | undefined; - optimizeFor?: - | FileOptions_OptimizeMode - | undefined; - /** - * Sets the Go package where structs generated from this .proto will be - * placed. If omitted, the Go package will be derived from the following: - * - The basename of the package import path, if provided. - * - Otherwise, the package statement in the .proto file, if present. - * - Otherwise, the basename of the .proto file, without extension. - */ - goPackage?: - | string - | undefined; - /** - * Should generic services be generated in each language? "Generic" services - * are not specific to any particular RPC system. They are generated by the - * main code generators in each language (without additional plugins). - * Generic services were the only kind of service generation supported by - * early versions of google.protobuf. - * - * Generic services are now considered deprecated in favor of using plugins - * that generate code specific to your particular RPC system. Therefore, - * these default to false. Old code which depends on generic services should - * explicitly set them to true. - */ - ccGenericServices?: boolean | undefined; - javaGenericServices?: boolean | undefined; - pyGenericServices?: - | boolean - | undefined; - /** - * Is this file deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for everything in the file, or it will be completely ignored; in the very - * least, this is a formalization for deprecating files. - */ - deprecated?: - | boolean - | undefined; - /** - * Enables the use of arenas for the proto messages in this file. This applies - * only to generated classes for C++. - */ - ccEnableArenas?: - | boolean - | undefined; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objcClassPrefix?: - | string - | undefined; - /** Namespace for generated classes; defaults to the package. */ - csharpNamespace?: - | string - | undefined; - /** - * By default Swift generators will take the proto package and CamelCase it - * replacing '.' with underscore and use that to prefix the types/symbols - * defined. When this options is provided, they will use this value instead - * to prefix the types/symbols defined. - */ - swiftPrefix?: - | string - | undefined; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - phpClassPrefix?: - | string - | undefined; - /** - * Use this option to change the namespace of php generated classes. Default - * is empty. When this option is empty, the package name will be used for - * determining the namespace. - */ - phpNamespace?: - | string - | undefined; - /** - * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be - * used for determining the namespace. - */ - phpMetadataNamespace?: - | string - | undefined; - /** - * Use this option to change the package of ruby generated classes. Default - * is empty. When this option is not set, the package name will be used for - * determining the ruby package. - */ - rubyPackage?: - | string - | undefined; - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpretedOption: UninterpretedOption[]; -} - -/** Generated classes can be optimized for speed or code size. */ -export enum FileOptions_OptimizeMode { - /** SPEED - Generate complete code for parsing, serialization, */ - SPEED = 1, - /** CODE_SIZE - etc. */ - CODE_SIZE = 2, - /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ - LITE_RUNTIME = 3, - UNRECOGNIZED = -1, -} - -export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { - switch (object) { - case 1: - case "SPEED": - return FileOptions_OptimizeMode.SPEED; - case 2: - case "CODE_SIZE": - return FileOptions_OptimizeMode.CODE_SIZE; - case 3: - case "LITE_RUNTIME": - return FileOptions_OptimizeMode.LITE_RUNTIME; - case -1: - case "UNRECOGNIZED": - default: - return FileOptions_OptimizeMode.UNRECOGNIZED; - } -} - -export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { - switch (object) { - case FileOptions_OptimizeMode.SPEED: - return "SPEED"; - case FileOptions_OptimizeMode.CODE_SIZE: - return "CODE_SIZE"; - case FileOptions_OptimizeMode.LITE_RUNTIME: - return "LITE_RUNTIME"; - case FileOptions_OptimizeMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface MessageOptions { - /** - * Set true to use the old proto1 MessageSet wire format for extensions. - * This is provided for backwards-compatibility with the MessageSet wire - * format. You should not use this for any other reason: It's less - * efficient, has fewer features, and is more complicated. - * - * The message must be defined exactly as follows: - * message Foo { - * option message_set_wire_format = true; - * extensions 4 to max; - * } - * Note that the message cannot have any defined fields; MessageSets only - * have extensions. - * - * All extensions of your type must be singular messages; e.g. they cannot - * be int32s, enums, or repeated messages. - * - * Because this is an option, the above two restrictions are not enforced by - * the protocol compiler. - */ - messageSetWireFormat?: - | boolean - | undefined; - /** - * Disables the generation of the standard "descriptor()" accessor, which can - * conflict with a field of the same name. This is meant to make migration - * from proto1 easier; new code should avoid fields named "descriptor". - */ - noStandardDescriptorAccessor?: - | boolean - | undefined; - /** - * Is this message deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the message, or it will be completely ignored; in the very least, - * this is a formalization for deprecating messages. - */ - deprecated?: - | boolean - | undefined; - /** - * Whether the message is an automatically generated map entry type for the - * maps field. - * - * For maps fields: - * map map_field = 1; - * The parsed descriptor looks like: - * message MapFieldEntry { - * option map_entry = true; - * optional KeyType key = 1; - * optional ValueType value = 2; - * } - * repeated MapFieldEntry map_field = 1; - * - * Implementations may choose not to generate the map_entry=true message, but - * use a native map in the target language to hold the keys and values. - * The reflection APIs in such implementations still need to work as - * if the field is a repeated message field. - * - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. - */ - mapEntry?: - | boolean - | undefined; - /** - * Enable the legacy handling of JSON field name conflicts. This lowercases - * and strips underscored from the fields before comparison in proto3 only. - * The new behavior takes `json_name` into account and applies to proto2 as - * well. - * - * This should only be used as a temporary measure against broken builds due - * to the change in behavior for JSON field name conflicts. - * - * TODO This is legacy behavior we plan to remove once downstream - * teams have had time to migrate. - * - * @deprecated - */ - deprecatedLegacyJsonFieldConflicts?: - | boolean - | undefined; - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface FieldOptions { - /** - * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is only implemented to support use of - * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - * type "bytes" in the open source release. - * TODO: make ctype actually deprecated. - */ - ctype?: - | FieldOptions_CType - | undefined; - /** - * The packed option can be enabled for repeated primitive fields to enable - * a more efficient representation on the wire. Rather than repeatedly - * writing the tag and type for each element, the entire array is encoded as - * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. This option is prohibited in - * Editions, but the `repeated_field_encoding` feature can be used to control - * the behavior. - */ - packed?: - | boolean - | undefined; - /** - * The jstype option determines the JavaScript type used for values of the - * field. The option is permitted only for 64 bit integral and fixed types - * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - * is represented as JavaScript string, which avoids loss of precision that - * can happen when a large value is converted to a floating point JavaScript. - * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - * use the JavaScript "number" type. The behavior of the default option - * JS_NORMAL is implementation dependent. - * - * This option is an enum to permit additional types to be added, e.g. - * goog.math.Integer. - */ - jstype?: - | FieldOptions_JSType - | undefined; - /** - * Should this field be parsed lazily? Lazy applies only to message-type - * fields. It means that when the outer message is initially parsed, the - * inner message's contents will not be parsed but instead stored in encoded - * form. The inner message will actually be parsed when it is first accessed. - * - * This is only a hint. Implementations are free to choose whether to use - * eager or lazy parsing regardless of the value of this option. However, - * setting this option true suggests that the protocol author believes that - * using lazy parsing on this field is worth the additional bookkeeping - * overhead typically needed to implement it. - * - * This option does not affect the public interface of any generated code; - * all method signatures remain the same. Furthermore, thread-safety of the - * interface is not affected by this option; const methods remain safe to - * call from multiple threads concurrently, while non-const methods continue - * to require exclusive access. - * - * Note that lazy message fields are still eagerly verified to check - * ill-formed wireformat or missing required fields. Calling IsInitialized() - * on the outer message would fail if the inner message has missing required - * fields. Failed verification would result in parsing failure (except when - * uninitialized messages are acceptable). - */ - lazy?: - | boolean - | undefined; - /** - * unverified_lazy does no correctness checks on the byte stream. This should - * only be used where lazy with verification is prohibitive for performance - * reasons. - */ - unverifiedLazy?: - | boolean - | undefined; - /** - * Is this field deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for accessors, or it will be completely ignored; in the very least, this - * is a formalization for deprecating fields. - */ - deprecated?: - | boolean - | undefined; - /** - * DEPRECATED. DO NOT USE! - * For Google-internal migration only. Do not use. - * - * @deprecated - */ - weak?: - | boolean - | undefined; - /** - * Indicate that the field value should not be printed out when using debug - * formats, e.g. when the field contains sensitive credentials. - */ - debugRedact?: boolean | undefined; - retention?: FieldOptions_OptionRetention | undefined; - targets: FieldOptions_OptionTargetType[]; - editionDefaults: FieldOptions_EditionDefault[]; - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: FeatureSet | undefined; - featureSupport?: - | FieldOptions_FeatureSupport - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export enum FieldOptions_CType { - /** STRING - Default mode. */ - STRING = 0, - /** - * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type - * "bytes". It indicates that in C++, the data should be stored in a Cord - * instead of a string. For very large strings, this may reduce memory - * fragmentation. It may also allow better performance when parsing from a - * Cord, or when parsing with aliasing enabled, as the parsed Cord may then - * alias the original buffer. - */ - CORD = 1, - STRING_PIECE = 2, - UNRECOGNIZED = -1, -} - -export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { - switch (object) { - case 0: - case "STRING": - return FieldOptions_CType.STRING; - case 1: - case "CORD": - return FieldOptions_CType.CORD; - case 2: - case "STRING_PIECE": - return FieldOptions_CType.STRING_PIECE; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_CType.UNRECOGNIZED; - } -} - -export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { - switch (object) { - case FieldOptions_CType.STRING: - return "STRING"; - case FieldOptions_CType.CORD: - return "CORD"; - case FieldOptions_CType.STRING_PIECE: - return "STRING_PIECE"; - case FieldOptions_CType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FieldOptions_JSType { - /** JS_NORMAL - Use the default type. */ - JS_NORMAL = 0, - /** JS_STRING - Use JavaScript strings. */ - JS_STRING = 1, - /** JS_NUMBER - Use JavaScript numbers. */ - JS_NUMBER = 2, - UNRECOGNIZED = -1, -} - -export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { - switch (object) { - case 0: - case "JS_NORMAL": - return FieldOptions_JSType.JS_NORMAL; - case 1: - case "JS_STRING": - return FieldOptions_JSType.JS_STRING; - case 2: - case "JS_NUMBER": - return FieldOptions_JSType.JS_NUMBER; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_JSType.UNRECOGNIZED; - } -} - -export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { - switch (object) { - case FieldOptions_JSType.JS_NORMAL: - return "JS_NORMAL"; - case FieldOptions_JSType.JS_STRING: - return "JS_STRING"; - case FieldOptions_JSType.JS_NUMBER: - return "JS_NUMBER"; - case FieldOptions_JSType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ -export enum FieldOptions_OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2, - UNRECOGNIZED = -1, -} - -export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { - switch (object) { - case 0: - case "RETENTION_UNKNOWN": - return FieldOptions_OptionRetention.RETENTION_UNKNOWN; - case 1: - case "RETENTION_RUNTIME": - return FieldOptions_OptionRetention.RETENTION_RUNTIME; - case 2: - case "RETENTION_SOURCE": - return FieldOptions_OptionRetention.RETENTION_SOURCE; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_OptionRetention.UNRECOGNIZED; - } -} - -export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { - switch (object) { - case FieldOptions_OptionRetention.RETENTION_UNKNOWN: - return "RETENTION_UNKNOWN"; - case FieldOptions_OptionRetention.RETENTION_RUNTIME: - return "RETENTION_RUNTIME"; - case FieldOptions_OptionRetention.RETENTION_SOURCE: - return "RETENTION_SOURCE"; - case FieldOptions_OptionRetention.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * This indicates the types of entities that the field may apply to when used - * as an option. If it is unset, then the field may be freely used as an - * option on any kind of entity. - */ -export enum FieldOptions_OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9, - UNRECOGNIZED = -1, -} - -export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { - switch (object) { - case 0: - case "TARGET_TYPE_UNKNOWN": - return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; - case 1: - case "TARGET_TYPE_FILE": - return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; - case 2: - case "TARGET_TYPE_EXTENSION_RANGE": - return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; - case 3: - case "TARGET_TYPE_MESSAGE": - return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; - case 4: - case "TARGET_TYPE_FIELD": - return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; - case 5: - case "TARGET_TYPE_ONEOF": - return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; - case 6: - case "TARGET_TYPE_ENUM": - return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; - case 7: - case "TARGET_TYPE_ENUM_ENTRY": - return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; - case 8: - case "TARGET_TYPE_SERVICE": - return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; - case 9: - case "TARGET_TYPE_METHOD": - return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_OptionTargetType.UNRECOGNIZED; - } -} - -export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { - switch (object) { - case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: - return "TARGET_TYPE_UNKNOWN"; - case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: - return "TARGET_TYPE_FILE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: - return "TARGET_TYPE_EXTENSION_RANGE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: - return "TARGET_TYPE_MESSAGE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: - return "TARGET_TYPE_FIELD"; - case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: - return "TARGET_TYPE_ONEOF"; - case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: - return "TARGET_TYPE_ENUM"; - case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: - return "TARGET_TYPE_ENUM_ENTRY"; - case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: - return "TARGET_TYPE_SERVICE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: - return "TARGET_TYPE_METHOD"; - case FieldOptions_OptionTargetType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface FieldOptions_EditionDefault { - edition?: - | Edition - | undefined; - /** Textproto value. */ - value?: string | undefined; -} - -/** Information about the support window of a feature. */ -export interface FieldOptions_FeatureSupport { - /** - * The edition that this feature was first available in. In editions - * earlier than this one, the default assigned to EDITION_LEGACY will be - * used, and proto files will not be able to override it. - */ - editionIntroduced?: - | Edition - | undefined; - /** - * The edition this feature becomes deprecated in. Using this after this - * edition may trigger warnings. - */ - editionDeprecated?: - | Edition - | undefined; - /** - * The deprecation warning text if this feature is used after the edition it - * was marked deprecated in. - */ - deprecationWarning?: - | string - | undefined; - /** - * The edition this feature is no longer available in. In editions after - * this one, the last default assigned will be used, and proto files will - * not be able to override it. - */ - editionRemoved?: Edition | undefined; -} - -export interface OneofOptions { - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allowAlias?: - | boolean - | undefined; - /** - * Is this enum deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum, or it will be completely ignored; in the very least, this - * is a formalization for deprecating enums. - */ - deprecated?: - | boolean - | undefined; - /** - * Enable the legacy handling of JSON field name conflicts. This lowercases - * and strips underscored from the fields before comparison in proto3 only. - * The new behavior takes `json_name` into account and applies to proto2 as - * well. - * TODO Remove this legacy behavior once downstream teams have - * had time to migrate. - * - * @deprecated - */ - deprecatedLegacyJsonFieldConflicts?: - | boolean - | undefined; - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface EnumValueOptions { - /** - * Is this enum value deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum value, or it will be completely ignored; in the very least, - * this is a formalization for deprecating enum values. - */ - deprecated?: - | boolean - | undefined; - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** - * Indicate that fields annotated with this enum value should not be printed - * out when using debug formats, e.g. when the field contains sensitive - * credentials. - */ - debugRedact?: - | boolean - | undefined; - /** Information about the support window of a feature value. */ - featureSupport?: - | FieldOptions_FeatureSupport - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface ServiceOptions { - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** - * Is this service deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the service, or it will be completely ignored; in the very least, - * this is a formalization for deprecating services. - */ - deprecated?: - | boolean - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface MethodOptions { - /** - * Is this method deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the method, or it will be completely ignored; in the very least, - * this is a formalization for deprecating methods. - */ - deprecated?: boolean | undefined; - idempotencyLevel?: - | MethodOptions_IdempotencyLevel - | undefined; - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -/** - * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - * or neither? HTTP based RPC implementation may choose GET verb for safe - * methods, and PUT verb for idempotent methods instead of the default POST. - */ -export enum MethodOptions_IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - /** NO_SIDE_EFFECTS - implies idempotent */ - NO_SIDE_EFFECTS = 1, - /** IDEMPOTENT - idempotent, but may have side effects */ - IDEMPOTENT = 2, - UNRECOGNIZED = -1, -} - -export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { - switch (object) { - case 0: - case "IDEMPOTENCY_UNKNOWN": - return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; - case 1: - case "NO_SIDE_EFFECTS": - return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; - case 2: - case "IDEMPOTENT": - return MethodOptions_IdempotencyLevel.IDEMPOTENT; - case -1: - case "UNRECOGNIZED": - default: - return MethodOptions_IdempotencyLevel.UNRECOGNIZED; - } -} - -export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { - switch (object) { - case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: - return "IDEMPOTENCY_UNKNOWN"; - case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: - return "NO_SIDE_EFFECTS"; - case MethodOptions_IdempotencyLevel.IDEMPOTENT: - return "IDEMPOTENT"; - case MethodOptions_IdempotencyLevel.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * A message representing a option the parser does not recognize. This only - * appears in options protos created by the compiler::Parser class. - * DescriptorPool resolves these when building Descriptor objects. Therefore, - * options protos in descriptor objects (e.g. returned by Descriptor::options(), - * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - * in them. - */ -export interface UninterpretedOption { - name: UninterpretedOption_NamePart[]; - /** - * The value of the uninterpreted option, in whatever type the tokenizer - * identified it as during parsing. Exactly one of these should be set. - */ - identifierValue?: string | undefined; - positiveIntValue?: string | undefined; - negativeIntValue?: string | undefined; - doubleValue?: number | undefined; - stringValue?: Uint8Array | undefined; - aggregateValue?: string | undefined; -} - -/** - * The name of the uninterpreted option. Each string represents a segment in - * a dot-separated name. is_extension is true iff a segment represents an - * extension (denoted with parentheses in options specs in .proto files). - * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - * "foo.(bar.baz).moo". - */ -export interface UninterpretedOption_NamePart { - namePart: string; - isExtension: boolean; -} - -/** - * TODO Enums in C++ gencode (and potentially other languages) are - * not well scoped. This means that each of the feature enums below can clash - * with each other. The short names we've chosen maximize call-site - * readability, but leave us very open to this scenario. A future feature will - * be designed and implemented to handle this, hopefully before we ever hit a - * conflict here. - */ -export interface FeatureSet { - fieldPresence?: FeatureSet_FieldPresence | undefined; - enumType?: FeatureSet_EnumType | undefined; - repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding | undefined; - utf8Validation?: FeatureSet_Utf8Validation | undefined; - messageEncoding?: FeatureSet_MessageEncoding | undefined; - jsonFormat?: FeatureSet_JsonFormat | undefined; - enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined; - defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibility | undefined; -} - -export enum FeatureSet_FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3, - UNRECOGNIZED = -1, -} - -export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence { - switch (object) { - case 0: - case "FIELD_PRESENCE_UNKNOWN": - return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN; - case 1: - case "EXPLICIT": - return FeatureSet_FieldPresence.EXPLICIT; - case 2: - case "IMPLICIT": - return FeatureSet_FieldPresence.IMPLICIT; - case 3: - case "LEGACY_REQUIRED": - return FeatureSet_FieldPresence.LEGACY_REQUIRED; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_FieldPresence.UNRECOGNIZED; - } -} - -export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string { - switch (object) { - case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN: - return "FIELD_PRESENCE_UNKNOWN"; - case FeatureSet_FieldPresence.EXPLICIT: - return "EXPLICIT"; - case FeatureSet_FieldPresence.IMPLICIT: - return "IMPLICIT"; - case FeatureSet_FieldPresence.LEGACY_REQUIRED: - return "LEGACY_REQUIRED"; - case FeatureSet_FieldPresence.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FeatureSet_EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2, - UNRECOGNIZED = -1, -} - -export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType { - switch (object) { - case 0: - case "ENUM_TYPE_UNKNOWN": - return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN; - case 1: - case "OPEN": - return FeatureSet_EnumType.OPEN; - case 2: - case "CLOSED": - return FeatureSet_EnumType.CLOSED; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_EnumType.UNRECOGNIZED; - } -} - -export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string { - switch (object) { - case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN: - return "ENUM_TYPE_UNKNOWN"; - case FeatureSet_EnumType.OPEN: - return "OPEN"; - case FeatureSet_EnumType.CLOSED: - return "CLOSED"; - case FeatureSet_EnumType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FeatureSet_RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2, - UNRECOGNIZED = -1, -} - -export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding { - switch (object) { - case 0: - case "REPEATED_FIELD_ENCODING_UNKNOWN": - return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN; - case 1: - case "PACKED": - return FeatureSet_RepeatedFieldEncoding.PACKED; - case 2: - case "EXPANDED": - return FeatureSet_RepeatedFieldEncoding.EXPANDED; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED; - } -} - -export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string { - switch (object) { - case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN: - return "REPEATED_FIELD_ENCODING_UNKNOWN"; - case FeatureSet_RepeatedFieldEncoding.PACKED: - return "PACKED"; - case FeatureSet_RepeatedFieldEncoding.EXPANDED: - return "EXPANDED"; - case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FeatureSet_Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3, - UNRECOGNIZED = -1, -} - -export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation { - switch (object) { - case 0: - case "UTF8_VALIDATION_UNKNOWN": - return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; - case 2: - case "VERIFY": - return FeatureSet_Utf8Validation.VERIFY; - case 3: - case "NONE": - return FeatureSet_Utf8Validation.NONE; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_Utf8Validation.UNRECOGNIZED; - } -} - -export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string { - switch (object) { - case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN: - return "UTF8_VALIDATION_UNKNOWN"; - case FeatureSet_Utf8Validation.VERIFY: - return "VERIFY"; - case FeatureSet_Utf8Validation.NONE: - return "NONE"; - case FeatureSet_Utf8Validation.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FeatureSet_MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2, - UNRECOGNIZED = -1, -} - -export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding { - switch (object) { - case 0: - case "MESSAGE_ENCODING_UNKNOWN": - return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; - case 1: - case "LENGTH_PREFIXED": - return FeatureSet_MessageEncoding.LENGTH_PREFIXED; - case 2: - case "DELIMITED": - return FeatureSet_MessageEncoding.DELIMITED; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_MessageEncoding.UNRECOGNIZED; - } -} - -export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string { - switch (object) { - case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN: - return "MESSAGE_ENCODING_UNKNOWN"; - case FeatureSet_MessageEncoding.LENGTH_PREFIXED: - return "LENGTH_PREFIXED"; - case FeatureSet_MessageEncoding.DELIMITED: - return "DELIMITED"; - case FeatureSet_MessageEncoding.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FeatureSet_JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2, - UNRECOGNIZED = -1, -} - -export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat { - switch (object) { - case 0: - case "JSON_FORMAT_UNKNOWN": - return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; - case 1: - case "ALLOW": - return FeatureSet_JsonFormat.ALLOW; - case 2: - case "LEGACY_BEST_EFFORT": - return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_JsonFormat.UNRECOGNIZED; - } -} - -export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string { - switch (object) { - case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN: - return "JSON_FORMAT_UNKNOWN"; - case FeatureSet_JsonFormat.ALLOW: - return "ALLOW"; - case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT: - return "LEGACY_BEST_EFFORT"; - case FeatureSet_JsonFormat.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FeatureSet_EnforceNamingStyle { - ENFORCE_NAMING_STYLE_UNKNOWN = 0, - STYLE2024 = 1, - STYLE_LEGACY = 2, - UNRECOGNIZED = -1, -} - -export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle { - switch (object) { - case 0: - case "ENFORCE_NAMING_STYLE_UNKNOWN": - return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN; - case 1: - case "STYLE2024": - return FeatureSet_EnforceNamingStyle.STYLE2024; - case 2: - case "STYLE_LEGACY": - return FeatureSet_EnforceNamingStyle.STYLE_LEGACY; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_EnforceNamingStyle.UNRECOGNIZED; - } -} - -export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string { - switch (object) { - case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN: - return "ENFORCE_NAMING_STYLE_UNKNOWN"; - case FeatureSet_EnforceNamingStyle.STYLE2024: - return "STYLE2024"; - case FeatureSet_EnforceNamingStyle.STYLE_LEGACY: - return "STYLE_LEGACY"; - case FeatureSet_EnforceNamingStyle.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface FeatureSet_VisibilityFeature { -} - -export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { - DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, - /** EXPORT_ALL - Default pre-EDITION_2024, all UNSET visibility are export. */ - EXPORT_ALL = 1, - /** EXPORT_TOP_LEVEL - All top-level symbols default to export, nested default to local. */ - EXPORT_TOP_LEVEL = 2, - /** LOCAL_ALL - All symbols default to local. */ - LOCAL_ALL = 3, - /** - * STRICT - All symbols local by default. Nested types cannot be exported. - * With special case caveat for message { enum {} reserved 1 to max; } - * This is the recommended setting for new protos. - */ - STRICT = 4, - UNRECOGNIZED = -1, -} - -export function featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON( - object: any, -): FeatureSet_VisibilityFeature_DefaultSymbolVisibility { - switch (object) { - case 0: - case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN; - case 1: - case "EXPORT_ALL": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL; - case 2: - case "EXPORT_TOP_LEVEL": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL; - case 3: - case "LOCAL_ALL": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL; - case 4: - case "STRICT": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED; - } -} - -export function featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON( - object: FeatureSet_VisibilityFeature_DefaultSymbolVisibility, -): string { - switch (object) { - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: - return "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL: - return "EXPORT_ALL"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL: - return "EXPORT_TOP_LEVEL"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL: - return "LOCAL_ALL"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT: - return "STRICT"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * A compiled specification for the defaults of a set of features. These - * messages are generated from FeatureSet extensions and can be used to seed - * feature resolution. The resolution with this object becomes a simple search - * for the closest matching edition, followed by proto merges. - */ -export interface FeatureSetDefaults { - defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; - /** - * The minimum supported edition (inclusive) when this was constructed. - * Editions before this will not have defaults. - */ - minimumEdition?: - | Edition - | undefined; - /** - * The maximum known edition (inclusive) when this was constructed. Editions - * after this will not have reliable defaults. - */ - maximumEdition?: Edition | undefined; -} - -/** - * A map from every known edition with a unique set of defaults to its - * defaults. Not all editions may be contained here. For a given edition, - * the defaults at the closest matching edition ordered at or before it should - * be used. This field must be in strict ascending order by edition. - */ -export interface FeatureSetDefaults_FeatureSetEditionDefault { - edition?: - | Edition - | undefined; - /** Defaults of features that can be overridden in this edition. */ - overridableFeatures?: - | FeatureSet - | undefined; - /** Defaults of features that can't be overridden in this edition. */ - fixedFeatures?: FeatureSet | undefined; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface SourceCodeInfo { - /** - * A Location identifies a piece of source code in a .proto file which - * corresponds to a particular definition. This information is intended - * to be useful to IDEs, code indexers, documentation generators, and similar - * tools. - * - * For example, say we have a file like: - * message Foo { - * optional string foo = 1; - * } - * Let's look at just the field definition: - * optional string foo = 1; - * ^ ^^ ^^ ^ ^^^ - * a bc de f ghi - * We have the following locations: - * span path represents - * [a,i) [ 4, 0, 2, 0 ] The whole field definition. - * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - * - * Notes: - * - A location may refer to a repeated field itself (i.e. not to any - * particular index within it). This is used whenever a set of elements are - * logically enclosed in a single code segment. For example, an entire - * extend block (possibly containing multiple extension definitions) will - * have an outer location whose path refers to the "extensions" repeated - * field without an index. - * - Multiple locations may have the same path. This happens when a single - * logical declaration is spread out across multiple places. The most - * obvious example is the "extend" block again -- there may be multiple - * extend blocks in the same scope, each of which will have the same path. - * - A location's span is not always a subset of its parent's span. For - * example, the "extendee" of an extension declaration appears at the - * beginning of the "extend" block and is shared by all extensions within - * the block. - * - Just because a location's span is a subset of some other location's span - * does not mean that it is a descendant. For example, a "group" defines - * both a type and a field in a single declaration. Thus, the locations - * corresponding to the type and field and their components will overlap. - * - Code which tries to interpret locations should probably be designed to - * ignore those that it doesn't understand, as more types of locations could - * be recorded in the future. - */ - location: SourceCodeInfo_Location[]; -} - -export interface SourceCodeInfo_Location { - /** - * Identifies which part of the FileDescriptorProto was defined at this - * location. - * - * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition appears. - * For example, this path: - * [ 4, 3, 2, 7, 1 ] - * refers to: - * file.message_type(3) // 4, 3 - * .field(7) // 2, 7 - * .name() // 1 - * This is because FileDescriptorProto.message_type has field number 4: - * repeated DescriptorProto message_type = 4; - * and DescriptorProto.field has field number 2: - * repeated FieldDescriptorProto field = 2; - * and FieldDescriptorProto.name has field number 1: - * optional string name = 1; - * - * Thus, the above path gives the location of a field name. If we removed - * the last element: - * [ 4, 3, 2, 7 ] - * this path refers to the whole field declaration (from the beginning - * of the label to the terminating semicolon). - */ - path: number[]; - /** - * Always has exactly three or four elements: start line, start column, - * end line (optional, otherwise assumed same as start line), end column. - * These are packed into a single field for efficiency. Note that line - * and column numbers are zero-based -- typically you will want to add - * 1 to each before displaying to a user. - */ - span: number[]; - /** - * If this SourceCodeInfo represents a complete declaration, these are any - * comments appearing before and after the declaration which appear to be - * attached to the declaration. - * - * A series of line comments appearing on consecutive lines, with no other - * tokens appearing on those lines, will be treated as a single comment. - * - * leading_detached_comments will keep paragraphs of comments that appear - * before (but not connected to) the current element. Each paragraph, - * separated by empty lines, will be one comment element in the repeated - * field. - * - * Only the comment content is provided; comment markers (e.g. //) are - * stripped out. For block comments, leading whitespace and an asterisk - * will be stripped from the beginning of each line other than the first. - * Newlines are included in the output. - * - * Examples: - * - * optional int32 foo = 1; // Comment attached to foo. - * // Comment attached to bar. - * optional int32 bar = 2; - * - * optional string baz = 3; - * // Comment attached to baz. - * // Another line attached to baz. - * - * // Comment attached to moo. - * // - * // Another line attached to moo. - * optional double moo = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to moo or corge because there are blank lines separating it from - * // both. - * - * // Detached comment for corge paragraph 2. - * - * optional string corge = 5; - * /* Block comment attached - * * to corge. Leading asterisks - * * will be removed. * / - * /* Block comment attached to - * * grault. * / - * optional int32 grault = 6; - * - * // ignored detached comments. - */ - leadingComments?: string | undefined; - trailingComments?: string | undefined; - leadingDetachedComments: string[]; -} - -/** - * Describes the relationship between generated code and its original source - * file. A GeneratedCodeInfo message is associated with only one generated - * source file, but may contain references to different source .proto files. - */ -export interface GeneratedCodeInfo { - /** - * An Annotation connects some span of text in generated code to an element - * of its generating .proto file. - */ - annotation: GeneratedCodeInfo_Annotation[]; -} - -export interface GeneratedCodeInfo_Annotation { - /** - * Identifies the element in the original source .proto file. This field - * is formatted the same as SourceCodeInfo.Location.path. - */ - path: number[]; - /** Identifies the filesystem path to the original source .proto. */ - sourceFile?: - | string - | undefined; - /** - * Identifies the starting offset in bytes in the generated code - * that relates to the identified object. - */ - begin?: - | number - | undefined; - /** - * Identifies the ending offset in bytes in the generated code that - * relates to the identified object. The end offset should be one past - * the last relevant byte (so the length of the text = end - begin). - */ - end?: number | undefined; - semantic?: GeneratedCodeInfo_Annotation_Semantic | undefined; -} - -/** - * Represents the identified object's effect on the element in the original - * .proto file. - */ -export enum GeneratedCodeInfo_Annotation_Semantic { - /** NONE - There is no effect or the effect is indescribable. */ - NONE = 0, - /** SET - The element is set or otherwise mutated. */ - SET = 1, - /** ALIAS - An alias to the element is returned. */ - ALIAS = 2, - UNRECOGNIZED = -1, -} - -export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { - switch (object) { - case 0: - case "NONE": - return GeneratedCodeInfo_Annotation_Semantic.NONE; - case 1: - case "SET": - return GeneratedCodeInfo_Annotation_Semantic.SET; - case 2: - case "ALIAS": - return GeneratedCodeInfo_Annotation_Semantic.ALIAS; - case -1: - case "UNRECOGNIZED": - default: - return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; - } -} - -export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { - switch (object) { - case GeneratedCodeInfo_Annotation_Semantic.NONE: - return "NONE"; - case GeneratedCodeInfo_Annotation_Semantic.SET: - return "SET"; - case GeneratedCodeInfo_Annotation_Semantic.ALIAS: - return "ALIAS"; - case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -function createBaseFileDescriptorSet(): FileDescriptorSet { - return { file: [] }; -} - -export const FileDescriptorSet: MessageFns = { - encode(message: FileDescriptorSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorSet(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FileDescriptorSet { - return { - file: globalThis.Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [], - }; - }, - - toJSON(message: FileDescriptorSet): unknown { - const obj: any = {}; - if (message.file?.length) { - obj.file = message.file.map((e) => FileDescriptorProto.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): FileDescriptorSet { - return FileDescriptorSet.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FileDescriptorSet { - const message = createBaseFileDescriptorSet(); - message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFileDescriptorProto(): FileDescriptorProto { - return { - name: "", - package: "", - dependency: [], - publicDependency: [], - weakDependency: [], - optionDependency: [], - messageType: [], - enumType: [], - service: [], - extension: [], - options: undefined, - sourceCodeInfo: undefined, - syntax: "", - edition: 0, - }; -} - -export const FileDescriptorProto: MessageFns = { - encode(message: FileDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.package !== undefined && message.package !== "") { - writer.uint32(18).string(message.package); - } - for (const v of message.dependency) { - writer.uint32(26).string(v!); - } - for (const v of message.publicDependency) { - writer.uint32(80).int32(v!); - } - for (const v of message.weakDependency) { - writer.uint32(88).int32(v!); - } - for (const v of message.optionDependency) { - writer.uint32(122).string(v!); - } - for (const v of message.messageType) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).join(); - } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).join(); - } - for (const v of message.service) { - ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); - } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).join(); - } - if (message.options !== undefined) { - FileOptions.encode(message.options, writer.uint32(66).fork()).join(); - } - if (message.sourceCodeInfo !== undefined) { - SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).join(); - } - if (message.syntax !== undefined && message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - if (message.edition !== undefined && message.edition !== 0) { - writer.uint32(112).int32(message.edition); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.package = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.dependency.push(reader.string()); - continue; - } - case 10: { - if (tag === 80) { - message.publicDependency.push(reader.int32()); - - continue; - } - - if (tag === 82) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.publicDependency.push(reader.int32()); - } - - continue; - } - - break; - } - case 11: { - if (tag === 88) { - message.weakDependency.push(reader.int32()); - - continue; - } - - if (tag === 90) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weakDependency.push(reader.int32()); - } - - continue; - } - - break; - } - case 15: { - if (tag !== 122) { - break; - } - - message.optionDependency.push(reader.string()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.options = FileOptions.decode(reader, reader.uint32()); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); - continue; - } - case 12: { - if (tag !== 98) { - break; - } - - message.syntax = reader.string(); - continue; - } - case 14: { - if (tag !== 112) { - break; - } - - message.edition = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FileDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - package: isSet(object.package) ? globalThis.String(object.package) : "", - dependency: globalThis.Array.isArray(object?.dependency) - ? object.dependency.map((e: any) => globalThis.String(e)) - : [], - publicDependency: globalThis.Array.isArray(object?.publicDependency) - ? object.publicDependency.map((e: any) => globalThis.Number(e)) - : [], - weakDependency: globalThis.Array.isArray(object?.weakDependency) - ? object.weakDependency.map((e: any) => globalThis.Number(e)) - : [], - optionDependency: globalThis.Array.isArray(object?.optionDependency) - ? object.optionDependency.map((e: any) => globalThis.String(e)) - : [], - messageType: globalThis.Array.isArray(object?.messageType) - ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) - : [], - enumType: globalThis.Array.isArray(object?.enumType) - ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) - : [], - service: globalThis.Array.isArray(object?.service) - ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) - : [], - extension: globalThis.Array.isArray(object?.extension) - ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, - sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, - syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : "", - edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, - }; - }, - - toJSON(message: FileDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.package !== undefined && message.package !== "") { - obj.package = message.package; - } - if (message.dependency?.length) { - obj.dependency = message.dependency; - } - if (message.publicDependency?.length) { - obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); - } - if (message.weakDependency?.length) { - obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); - } - if (message.optionDependency?.length) { - obj.optionDependency = message.optionDependency; - } - if (message.messageType?.length) { - obj.messageType = message.messageType.map((e) => DescriptorProto.toJSON(e)); - } - if (message.enumType?.length) { - obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); - } - if (message.service?.length) { - obj.service = message.service.map((e) => ServiceDescriptorProto.toJSON(e)); - } - if (message.extension?.length) { - obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); - } - if (message.options !== undefined) { - obj.options = FileOptions.toJSON(message.options); - } - if (message.sourceCodeInfo !== undefined) { - obj.sourceCodeInfo = SourceCodeInfo.toJSON(message.sourceCodeInfo); - } - if (message.syntax !== undefined && message.syntax !== "") { - obj.syntax = message.syntax; - } - if (message.edition !== undefined && message.edition !== 0) { - obj.edition = editionToJSON(message.edition); - } - return obj; - }, - - create, I>>(base?: I): FileDescriptorProto { - return FileDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FileDescriptorProto { - const message = createBaseFileDescriptorProto(); - message.name = object.name ?? ""; - message.package = object.package ?? ""; - message.dependency = object.dependency?.map((e) => e) || []; - message.publicDependency = object.publicDependency?.map((e) => e) || []; - message.weakDependency = object.weakDependency?.map((e) => e) || []; - message.optionDependency = object.optionDependency?.map((e) => e) || []; - message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? FileOptions.fromPartial(object.options) - : undefined; - message.sourceCodeInfo = (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) - ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) - : undefined; - message.syntax = object.syntax ?? ""; - message.edition = object.edition ?? 0; - return message; - }, -}; - -function createBaseDescriptorProto(): DescriptorProto { - return { - name: "", - field: [], - extension: [], - nestedType: [], - enumType: [], - extensionRange: [], - oneofDecl: [], - options: undefined, - reservedRange: [], - reservedName: [], - visibility: 0, - }; -} - -export const DescriptorProto: MessageFns = { - encode(message: DescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.field) { - FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); - } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); - } - for (const v of message.nestedType) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).join(); - } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).join(); - } - for (const v of message.extensionRange) { - DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).join(); - } - for (const v of message.oneofDecl) { - OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).join(); - } - if (message.options !== undefined) { - MessageOptions.encode(message.options, writer.uint32(58).fork()).join(); - } - for (const v of message.reservedRange) { - DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).join(); - } - for (const v of message.reservedName) { - writer.uint32(82).string(v!); - } - if (message.visibility !== undefined && message.visibility !== 0) { - writer.uint32(88).int32(message.visibility); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.options = MessageOptions.decode(reader, reader.uint32()); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.reservedName.push(reader.string()); - continue; - } - case 11: { - if (tag !== 88) { - break; - } - - message.visibility = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - field: globalThis.Array.isArray(object?.field) - ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - extension: globalThis.Array.isArray(object?.extension) - ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - nestedType: globalThis.Array.isArray(object?.nestedType) - ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) - : [], - enumType: globalThis.Array.isArray(object?.enumType) - ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) - : [], - extensionRange: globalThis.Array.isArray(object?.extensionRange) - ? object.extensionRange.map((e: any) => DescriptorProto_ExtensionRange.fromJSON(e)) - : [], - oneofDecl: globalThis.Array.isArray(object?.oneofDecl) - ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? MessageOptions.fromJSON(object.options) : undefined, - reservedRange: globalThis.Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(e)) - : [], - reservedName: globalThis.Array.isArray(object?.reservedName) - ? object.reservedName.map((e: any) => globalThis.String(e)) - : [], - visibility: isSet(object.visibility) ? symbolVisibilityFromJSON(object.visibility) : 0, - }; - }, - - toJSON(message: DescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.field?.length) { - obj.field = message.field.map((e) => FieldDescriptorProto.toJSON(e)); - } - if (message.extension?.length) { - obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); - } - if (message.nestedType?.length) { - obj.nestedType = message.nestedType.map((e) => DescriptorProto.toJSON(e)); - } - if (message.enumType?.length) { - obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); - } - if (message.extensionRange?.length) { - obj.extensionRange = message.extensionRange.map((e) => DescriptorProto_ExtensionRange.toJSON(e)); - } - if (message.oneofDecl?.length) { - obj.oneofDecl = message.oneofDecl.map((e) => OneofDescriptorProto.toJSON(e)); - } - if (message.options !== undefined) { - obj.options = MessageOptions.toJSON(message.options); - } - if (message.reservedRange?.length) { - obj.reservedRange = message.reservedRange.map((e) => DescriptorProto_ReservedRange.toJSON(e)); - } - if (message.reservedName?.length) { - obj.reservedName = message.reservedName; - } - if (message.visibility !== undefined && message.visibility !== 0) { - obj.visibility = symbolVisibilityToJSON(message.visibility); - } - return obj; - }, - - create, I>>(base?: I): DescriptorProto { - return DescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): DescriptorProto { - const message = createBaseDescriptorProto(); - message.name = object.name ?? ""; - message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.nestedType = object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.extensionRange = object.extensionRange?.map((e) => DescriptorProto_ExtensionRange.fromPartial(e)) || []; - message.oneofDecl = object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? MessageOptions.fromPartial(object.options) - : undefined; - message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || []; - message.reservedName = object.reservedName?.map((e) => e) || []; - message.visibility = object.visibility ?? 0; - return message; - }, -}; - -function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { - return { start: 0, end: 0, options: undefined }; -} - -export const DescriptorProto_ExtensionRange: MessageFns = { - encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.start !== undefined && message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== undefined && message.end !== 0) { - writer.uint32(16).int32(message.end); - } - if (message.options !== undefined) { - ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ExtensionRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.start = reader.int32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.end = reader.int32(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DescriptorProto_ExtensionRange { - return { - start: isSet(object.start) ? globalThis.Number(object.start) : 0, - end: isSet(object.end) ? globalThis.Number(object.end) : 0, - options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined, - }; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - if (message.start !== undefined && message.start !== 0) { - obj.start = Math.round(message.start); - } - if (message.end !== undefined && message.end !== 0) { - obj.end = Math.round(message.end); - } - if (message.options !== undefined) { - obj.options = ExtensionRangeOptions.toJSON(message.options); - } - return obj; - }, - - create, I>>(base?: I): DescriptorProto_ExtensionRange { - return DescriptorProto_ExtensionRange.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): DescriptorProto_ExtensionRange { - const message = createBaseDescriptorProto_ExtensionRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - message.options = (object.options !== undefined && object.options !== null) - ? ExtensionRangeOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { - return { start: 0, end: 0 }; -} - -export const DescriptorProto_ReservedRange: MessageFns = { - encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.start !== undefined && message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== undefined && message.end !== 0) { - writer.uint32(16).int32(message.end); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ReservedRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.start = reader.int32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.end = reader.int32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DescriptorProto_ReservedRange { - return { - start: isSet(object.start) ? globalThis.Number(object.start) : 0, - end: isSet(object.end) ? globalThis.Number(object.end) : 0, - }; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - if (message.start !== undefined && message.start !== 0) { - obj.start = Math.round(message.start); - } - if (message.end !== undefined && message.end !== 0) { - obj.end = Math.round(message.end); - } - return obj; - }, - - create, I>>(base?: I): DescriptorProto_ReservedRange { - return DescriptorProto_ReservedRange.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): DescriptorProto_ReservedRange { - const message = createBaseDescriptorProto_ReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, -}; - -function createBaseExtensionRangeOptions(): ExtensionRangeOptions { - return { uninterpretedOption: [], declaration: [], features: undefined, verification: 1 }; -} - -export const ExtensionRangeOptions: MessageFns = { - encode(message: ExtensionRangeOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - for (const v of message.declaration) { - ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(402).fork()).join(); - } - if (message.verification !== undefined && message.verification !== 1) { - writer.uint32(24).int32(message.verification); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtensionRangeOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32())); - continue; - } - case 50: { - if (tag !== 402) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.verification = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - return { - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - declaration: globalThis.Array.isArray(object?.declaration) - ? object.declaration.map((e: any) => ExtensionRangeOptions_Declaration.fromJSON(e)) - : [], - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - verification: isSet(object.verification) - ? extensionRangeOptions_VerificationStateFromJSON(object.verification) - : 1, - }; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - if (message.declaration?.length) { - obj.declaration = message.declaration.map((e) => ExtensionRangeOptions_Declaration.toJSON(e)); - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.verification !== undefined && message.verification !== 1) { - obj.verification = extensionRangeOptions_VerificationStateToJSON(message.verification); - } - return obj; - }, - - create, I>>(base?: I): ExtensionRangeOptions { - return ExtensionRangeOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ExtensionRangeOptions { - const message = createBaseExtensionRangeOptions(); - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - message.declaration = object.declaration?.map((e) => ExtensionRangeOptions_Declaration.fromPartial(e)) || []; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.verification = object.verification ?? 1; - return message; - }, -}; - -function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration { - return { number: 0, fullName: "", type: "", reserved: false, repeated: false }; -} - -export const ExtensionRangeOptions_Declaration: MessageFns = { - encode(message: ExtensionRangeOptions_Declaration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.number !== undefined && message.number !== 0) { - writer.uint32(8).int32(message.number); - } - if (message.fullName !== undefined && message.fullName !== "") { - writer.uint32(18).string(message.fullName); - } - if (message.type !== undefined && message.type !== "") { - writer.uint32(26).string(message.type); - } - if (message.reserved !== undefined && message.reserved !== false) { - writer.uint32(40).bool(message.reserved); - } - if (message.repeated !== undefined && message.repeated !== false) { - writer.uint32(48).bool(message.repeated); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtensionRangeOptions_Declaration(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.number = reader.int32(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.fullName = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.type = reader.string(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.reserved = reader.bool(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.repeated = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions_Declaration { - return { - number: isSet(object.number) ? globalThis.Number(object.number) : 0, - fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "", - type: isSet(object.type) ? globalThis.String(object.type) : "", - reserved: isSet(object.reserved) ? globalThis.Boolean(object.reserved) : false, - repeated: isSet(object.repeated) ? globalThis.Boolean(object.repeated) : false, - }; - }, - - toJSON(message: ExtensionRangeOptions_Declaration): unknown { - const obj: any = {}; - if (message.number !== undefined && message.number !== 0) { - obj.number = Math.round(message.number); - } - if (message.fullName !== undefined && message.fullName !== "") { - obj.fullName = message.fullName; - } - if (message.type !== undefined && message.type !== "") { - obj.type = message.type; - } - if (message.reserved !== undefined && message.reserved !== false) { - obj.reserved = message.reserved; - } - if (message.repeated !== undefined && message.repeated !== false) { - obj.repeated = message.repeated; - } - return obj; - }, - - create, I>>( - base?: I, - ): ExtensionRangeOptions_Declaration { - return ExtensionRangeOptions_Declaration.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ExtensionRangeOptions_Declaration { - const message = createBaseExtensionRangeOptions_Declaration(); - message.number = object.number ?? 0; - message.fullName = object.fullName ?? ""; - message.type = object.type ?? ""; - message.reserved = object.reserved ?? false; - message.repeated = object.repeated ?? false; - return message; - }, -}; - -function createBaseFieldDescriptorProto(): FieldDescriptorProto { - return { - name: "", - number: 0, - label: 1, - type: 1, - typeName: "", - extendee: "", - defaultValue: "", - oneofIndex: 0, - jsonName: "", - options: undefined, - proto3Optional: false, - }; -} - -export const FieldDescriptorProto: MessageFns = { - encode(message: FieldDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== undefined && message.number !== 0) { - writer.uint32(24).int32(message.number); - } - if (message.label !== undefined && message.label !== 1) { - writer.uint32(32).int32(message.label); - } - if (message.type !== undefined && message.type !== 1) { - writer.uint32(40).int32(message.type); - } - if (message.typeName !== undefined && message.typeName !== "") { - writer.uint32(50).string(message.typeName); - } - if (message.extendee !== undefined && message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.defaultValue !== undefined && message.defaultValue !== "") { - writer.uint32(58).string(message.defaultValue); - } - if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { - writer.uint32(72).int32(message.oneofIndex); - } - if (message.jsonName !== undefined && message.jsonName !== "") { - writer.uint32(82).string(message.jsonName); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).join(); - } - if (message.proto3Optional !== undefined && message.proto3Optional !== false) { - writer.uint32(136).bool(message.proto3Optional); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.number = reader.int32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.label = reader.int32() as any; - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.type = reader.int32() as any; - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.typeName = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.extendee = reader.string(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.defaultValue = reader.string(); - continue; - } - case 9: { - if (tag !== 72) { - break; - } - - message.oneofIndex = reader.int32(); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.jsonName = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.options = FieldOptions.decode(reader, reader.uint32()); - continue; - } - case 17: { - if (tag !== 136) { - break; - } - - message.proto3Optional = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - number: isSet(object.number) ? globalThis.Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 1, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 1, - typeName: isSet(object.typeName) ? globalThis.String(object.typeName) : "", - extendee: isSet(object.extendee) ? globalThis.String(object.extendee) : "", - defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "", - oneofIndex: isSet(object.oneofIndex) ? globalThis.Number(object.oneofIndex) : 0, - jsonName: isSet(object.jsonName) ? globalThis.String(object.jsonName) : "", - options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined, - proto3Optional: isSet(object.proto3Optional) ? globalThis.Boolean(object.proto3Optional) : false, - }; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.number !== undefined && message.number !== 0) { - obj.number = Math.round(message.number); - } - if (message.label !== undefined && message.label !== 1) { - obj.label = fieldDescriptorProto_LabelToJSON(message.label); - } - if (message.type !== undefined && message.type !== 1) { - obj.type = fieldDescriptorProto_TypeToJSON(message.type); - } - if (message.typeName !== undefined && message.typeName !== "") { - obj.typeName = message.typeName; - } - if (message.extendee !== undefined && message.extendee !== "") { - obj.extendee = message.extendee; - } - if (message.defaultValue !== undefined && message.defaultValue !== "") { - obj.defaultValue = message.defaultValue; - } - if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { - obj.oneofIndex = Math.round(message.oneofIndex); - } - if (message.jsonName !== undefined && message.jsonName !== "") { - obj.jsonName = message.jsonName; - } - if (message.options !== undefined) { - obj.options = FieldOptions.toJSON(message.options); - } - if (message.proto3Optional !== undefined && message.proto3Optional !== false) { - obj.proto3Optional = message.proto3Optional; - } - return obj; - }, - - create, I>>(base?: I): FieldDescriptorProto { - return FieldDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldDescriptorProto { - const message = createBaseFieldDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.label = object.label ?? 1; - message.type = object.type ?? 1; - message.typeName = object.typeName ?? ""; - message.extendee = object.extendee ?? ""; - message.defaultValue = object.defaultValue ?? ""; - message.oneofIndex = object.oneofIndex ?? 0; - message.jsonName = object.jsonName ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? FieldOptions.fromPartial(object.options) - : undefined; - message.proto3Optional = object.proto3Optional ?? false; - return message; - }, -}; - -function createBaseOneofDescriptorProto(): OneofDescriptorProto { - return { name: "", options: undefined }; -} - -export const OneofDescriptorProto: MessageFns = { - encode(message: OneofDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.options !== undefined) { - OneofOptions.encode(message.options, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.options = OneofOptions.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): OneofDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined, - }; - }, - - toJSON(message: OneofDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.options !== undefined) { - obj.options = OneofOptions.toJSON(message.options); - } - return obj; - }, - - create, I>>(base?: I): OneofDescriptorProto { - return OneofDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): OneofDescriptorProto { - const message = createBaseOneofDescriptorProto(); - message.name = object.name ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? OneofOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseEnumDescriptorProto(): EnumDescriptorProto { - return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [], visibility: 0 }; -} - -export const EnumDescriptorProto: MessageFns = { - encode(message: EnumDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.value) { - EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.options !== undefined) { - EnumOptions.encode(message.options, writer.uint32(26).fork()).join(); - } - for (const v of message.reservedRange) { - EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).join(); - } - for (const v of message.reservedName) { - writer.uint32(42).string(v!); - } - if (message.visibility !== undefined && message.visibility !== 0) { - writer.uint32(48).int32(message.visibility); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.options = EnumOptions.decode(reader, reader.uint32()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.reservedName.push(reader.string()); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.visibility = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - value: globalThis.Array.isArray(object?.value) - ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, - reservedRange: globalThis.Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(e)) - : [], - reservedName: globalThis.Array.isArray(object?.reservedName) - ? object.reservedName.map((e: any) => globalThis.String(e)) - : [], - visibility: isSet(object.visibility) ? symbolVisibilityFromJSON(object.visibility) : 0, - }; - }, - - toJSON(message: EnumDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.value?.length) { - obj.value = message.value.map((e) => EnumValueDescriptorProto.toJSON(e)); - } - if (message.options !== undefined) { - obj.options = EnumOptions.toJSON(message.options); - } - if (message.reservedRange?.length) { - obj.reservedRange = message.reservedRange.map((e) => EnumDescriptorProto_EnumReservedRange.toJSON(e)); - } - if (message.reservedName?.length) { - obj.reservedName = message.reservedName; - } - if (message.visibility !== undefined && message.visibility !== 0) { - obj.visibility = symbolVisibilityToJSON(message.visibility); - } - return obj; - }, - - create, I>>(base?: I): EnumDescriptorProto { - return EnumDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): EnumDescriptorProto { - const message = createBaseEnumDescriptorProto(); - message.name = object.name ?? ""; - message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? EnumOptions.fromPartial(object.options) - : undefined; - message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || - []; - message.reservedName = object.reservedName?.map((e) => e) || []; - message.visibility = object.visibility ?? 0; - return message; - }, -}; - -function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { - return { start: 0, end: 0 }; -} - -export const EnumDescriptorProto_EnumReservedRange: MessageFns = { - encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.start !== undefined && message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== undefined && message.end !== 0) { - writer.uint32(16).int32(message.end); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.start = reader.int32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.end = reader.int32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - return { - start: isSet(object.start) ? globalThis.Number(object.start) : 0, - end: isSet(object.end) ? globalThis.Number(object.end) : 0, - }; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - if (message.start !== undefined && message.start !== 0) { - obj.start = Math.round(message.start); - } - if (message.end !== undefined && message.end !== 0) { - obj.end = Math.round(message.end); - } - return obj; - }, - - create, I>>( - base?: I, - ): EnumDescriptorProto_EnumReservedRange { - return EnumDescriptorProto_EnumReservedRange.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, -}; - -function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { - return { name: "", number: 0, options: undefined }; -} - -export const EnumValueDescriptorProto: MessageFns = { - encode(message: EnumValueDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== undefined && message.number !== 0) { - writer.uint32(16).int32(message.number); - } - if (message.options !== undefined) { - EnumValueOptions.encode(message.options, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.number = reader.int32(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.options = EnumValueOptions.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnumValueDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - number: isSet(object.number) ? globalThis.Number(object.number) : 0, - options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined, - }; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.number !== undefined && message.number !== 0) { - obj.number = Math.round(message.number); - } - if (message.options !== undefined) { - obj.options = EnumValueOptions.toJSON(message.options); - } - return obj; - }, - - create, I>>(base?: I): EnumValueDescriptorProto { - return EnumValueDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): EnumValueDescriptorProto { - const message = createBaseEnumValueDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.options = (object.options !== undefined && object.options !== null) - ? EnumValueOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseServiceDescriptorProto(): ServiceDescriptorProto { - return { name: "", method: [], options: undefined }; -} - -export const ServiceDescriptorProto: MessageFns = { - encode(message: ServiceDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.method) { - MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.options !== undefined) { - ServiceOptions.encode(message.options, writer.uint32(26).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.options = ServiceOptions.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ServiceDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - method: globalThis.Array.isArray(object?.method) - ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) ? ServiceOptions.fromJSON(object.options) : undefined, - }; - }, - - toJSON(message: ServiceDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.method?.length) { - obj.method = message.method.map((e) => MethodDescriptorProto.toJSON(e)); - } - if (message.options !== undefined) { - obj.options = ServiceOptions.toJSON(message.options); - } - return obj; - }, - - create, I>>(base?: I): ServiceDescriptorProto { - return ServiceDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ServiceDescriptorProto { - const message = createBaseServiceDescriptorProto(); - message.name = object.name ?? ""; - message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? ServiceOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseMethodDescriptorProto(): MethodDescriptorProto { - return { - name: "", - inputType: "", - outputType: "", - options: undefined, - clientStreaming: false, - serverStreaming: false, - }; -} - -export const MethodDescriptorProto: MessageFns = { - encode(message: MethodDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.inputType !== undefined && message.inputType !== "") { - writer.uint32(18).string(message.inputType); - } - if (message.outputType !== undefined && message.outputType !== "") { - writer.uint32(26).string(message.outputType); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).join(); - } - if (message.clientStreaming !== undefined && message.clientStreaming !== false) { - writer.uint32(40).bool(message.clientStreaming); - } - if (message.serverStreaming !== undefined && message.serverStreaming !== false) { - writer.uint32(48).bool(message.serverStreaming); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.inputType = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.outputType = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.options = MethodOptions.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.clientStreaming = reader.bool(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.serverStreaming = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - return { - name: isSet(object.name) ? globalThis.String(object.name) : "", - inputType: isSet(object.inputType) ? globalThis.String(object.inputType) : "", - outputType: isSet(object.outputType) ? globalThis.String(object.outputType) : "", - options: isSet(object.options) ? MethodOptions.fromJSON(object.options) : undefined, - clientStreaming: isSet(object.clientStreaming) ? globalThis.Boolean(object.clientStreaming) : false, - serverStreaming: isSet(object.serverStreaming) ? globalThis.Boolean(object.serverStreaming) : false, - }; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; - } - if (message.inputType !== undefined && message.inputType !== "") { - obj.inputType = message.inputType; - } - if (message.outputType !== undefined && message.outputType !== "") { - obj.outputType = message.outputType; - } - if (message.options !== undefined) { - obj.options = MethodOptions.toJSON(message.options); - } - if (message.clientStreaming !== undefined && message.clientStreaming !== false) { - obj.clientStreaming = message.clientStreaming; - } - if (message.serverStreaming !== undefined && message.serverStreaming !== false) { - obj.serverStreaming = message.serverStreaming; - } - return obj; - }, - - create, I>>(base?: I): MethodDescriptorProto { - return MethodDescriptorProto.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MethodDescriptorProto { - const message = createBaseMethodDescriptorProto(); - message.name = object.name ?? ""; - message.inputType = object.inputType ?? ""; - message.outputType = object.outputType ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? MethodOptions.fromPartial(object.options) - : undefined; - message.clientStreaming = object.clientStreaming ?? false; - message.serverStreaming = object.serverStreaming ?? false; - return message; - }, -}; - -function createBaseFileOptions(): FileOptions { - return { - javaPackage: "", - javaOuterClassname: "", - javaMultipleFiles: false, - javaGenerateEqualsAndHash: false, - javaStringCheckUtf8: false, - optimizeFor: 1, - goPackage: "", - ccGenericServices: false, - javaGenericServices: false, - pyGenericServices: false, - deprecated: false, - ccEnableArenas: true, - objcClassPrefix: "", - csharpNamespace: "", - swiftPrefix: "", - phpClassPrefix: "", - phpNamespace: "", - phpMetadataNamespace: "", - rubyPackage: "", - features: undefined, - uninterpretedOption: [], - }; -} - -export const FileOptions: MessageFns = { - encode(message: FileOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.javaPackage !== undefined && message.javaPackage !== "") { - writer.uint32(10).string(message.javaPackage); - } - if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { - writer.uint32(66).string(message.javaOuterClassname); - } - if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { - writer.uint32(80).bool(message.javaMultipleFiles); - } - if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { - writer.uint32(160).bool(message.javaGenerateEqualsAndHash); - } - if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { - writer.uint32(216).bool(message.javaStringCheckUtf8); - } - if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { - writer.uint32(72).int32(message.optimizeFor); - } - if (message.goPackage !== undefined && message.goPackage !== "") { - writer.uint32(90).string(message.goPackage); - } - if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { - writer.uint32(128).bool(message.ccGenericServices); - } - if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { - writer.uint32(136).bool(message.javaGenericServices); - } - if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { - writer.uint32(144).bool(message.pyGenericServices); - } - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(184).bool(message.deprecated); - } - if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { - writer.uint32(248).bool(message.ccEnableArenas); - } - if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { - writer.uint32(290).string(message.objcClassPrefix); - } - if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { - writer.uint32(298).string(message.csharpNamespace); - } - if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { - writer.uint32(314).string(message.swiftPrefix); - } - if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { - writer.uint32(322).string(message.phpClassPrefix); - } - if (message.phpNamespace !== undefined && message.phpNamespace !== "") { - writer.uint32(330).string(message.phpNamespace); - } - if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { - writer.uint32(354).string(message.phpMetadataNamespace); - } - if (message.rubyPackage !== undefined && message.rubyPackage !== "") { - writer.uint32(362).string(message.rubyPackage); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(402).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.javaPackage = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.javaOuterClassname = reader.string(); - continue; - } - case 10: { - if (tag !== 80) { - break; - } - - message.javaMultipleFiles = reader.bool(); - continue; - } - case 20: { - if (tag !== 160) { - break; - } - - message.javaGenerateEqualsAndHash = reader.bool(); - continue; - } - case 27: { - if (tag !== 216) { - break; - } - - message.javaStringCheckUtf8 = reader.bool(); - continue; - } - case 9: { - if (tag !== 72) { - break; - } - - message.optimizeFor = reader.int32() as any; - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.goPackage = reader.string(); - continue; - } - case 16: { - if (tag !== 128) { - break; - } - - message.ccGenericServices = reader.bool(); - continue; - } - case 17: { - if (tag !== 136) { - break; - } - - message.javaGenericServices = reader.bool(); - continue; - } - case 18: { - if (tag !== 144) { - break; - } - - message.pyGenericServices = reader.bool(); - continue; - } - case 23: { - if (tag !== 184) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 31: { - if (tag !== 248) { - break; - } - - message.ccEnableArenas = reader.bool(); - continue; - } - case 36: { - if (tag !== 290) { - break; - } - - message.objcClassPrefix = reader.string(); - continue; - } - case 37: { - if (tag !== 298) { - break; - } - - message.csharpNamespace = reader.string(); - continue; - } - case 39: { - if (tag !== 314) { - break; - } - - message.swiftPrefix = reader.string(); - continue; - } - case 40: { - if (tag !== 322) { - break; - } - - message.phpClassPrefix = reader.string(); - continue; - } - case 41: { - if (tag !== 330) { - break; - } - - message.phpNamespace = reader.string(); - continue; - } - case 44: { - if (tag !== 354) { - break; - } - - message.phpMetadataNamespace = reader.string(); - continue; - } - case 45: { - if (tag !== 362) { - break; - } - - message.rubyPackage = reader.string(); - continue; - } - case 50: { - if (tag !== 402) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FileOptions { - return { - javaPackage: isSet(object.javaPackage) ? globalThis.String(object.javaPackage) : "", - javaOuterClassname: isSet(object.javaOuterClassname) ? globalThis.String(object.javaOuterClassname) : "", - javaMultipleFiles: isSet(object.javaMultipleFiles) ? globalThis.Boolean(object.javaMultipleFiles) : false, - javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) - ? globalThis.Boolean(object.javaGenerateEqualsAndHash) - : false, - javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? globalThis.Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1, - goPackage: isSet(object.goPackage) ? globalThis.String(object.goPackage) : "", - ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false, - javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false, - pyGenericServices: isSet(object.pyGenericServices) ? globalThis.Boolean(object.pyGenericServices) : false, - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - ccEnableArenas: isSet(object.ccEnableArenas) ? globalThis.Boolean(object.ccEnableArenas) : true, - objcClassPrefix: isSet(object.objcClassPrefix) ? globalThis.String(object.objcClassPrefix) : "", - csharpNamespace: isSet(object.csharpNamespace) ? globalThis.String(object.csharpNamespace) : "", - swiftPrefix: isSet(object.swiftPrefix) ? globalThis.String(object.swiftPrefix) : "", - phpClassPrefix: isSet(object.phpClassPrefix) ? globalThis.String(object.phpClassPrefix) : "", - phpNamespace: isSet(object.phpNamespace) ? globalThis.String(object.phpNamespace) : "", - phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? globalThis.String(object.phpMetadataNamespace) : "", - rubyPackage: isSet(object.rubyPackage) ? globalThis.String(object.rubyPackage) : "", - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - if (message.javaPackage !== undefined && message.javaPackage !== "") { - obj.javaPackage = message.javaPackage; - } - if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { - obj.javaOuterClassname = message.javaOuterClassname; - } - if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { - obj.javaMultipleFiles = message.javaMultipleFiles; - } - if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { - obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - } - if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { - obj.javaStringCheckUtf8 = message.javaStringCheckUtf8; - } - if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { - obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor); - } - if (message.goPackage !== undefined && message.goPackage !== "") { - obj.goPackage = message.goPackage; - } - if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { - obj.ccGenericServices = message.ccGenericServices; - } - if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { - obj.javaGenericServices = message.javaGenericServices; - } - if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { - obj.pyGenericServices = message.pyGenericServices; - } - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { - obj.ccEnableArenas = message.ccEnableArenas; - } - if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { - obj.objcClassPrefix = message.objcClassPrefix; - } - if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { - obj.csharpNamespace = message.csharpNamespace; - } - if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { - obj.swiftPrefix = message.swiftPrefix; - } - if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { - obj.phpClassPrefix = message.phpClassPrefix; - } - if (message.phpNamespace !== undefined && message.phpNamespace !== "") { - obj.phpNamespace = message.phpNamespace; - } - if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { - obj.phpMetadataNamespace = message.phpMetadataNamespace; - } - if (message.rubyPackage !== undefined && message.rubyPackage !== "") { - obj.rubyPackage = message.rubyPackage; - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): FileOptions { - return FileOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FileOptions { - const message = createBaseFileOptions(); - message.javaPackage = object.javaPackage ?? ""; - message.javaOuterClassname = object.javaOuterClassname ?? ""; - message.javaMultipleFiles = object.javaMultipleFiles ?? false; - message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; - message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; - message.optimizeFor = object.optimizeFor ?? 1; - message.goPackage = object.goPackage ?? ""; - message.ccGenericServices = object.ccGenericServices ?? false; - message.javaGenericServices = object.javaGenericServices ?? false; - message.pyGenericServices = object.pyGenericServices ?? false; - message.deprecated = object.deprecated ?? false; - message.ccEnableArenas = object.ccEnableArenas ?? true; - message.objcClassPrefix = object.objcClassPrefix ?? ""; - message.csharpNamespace = object.csharpNamespace ?? ""; - message.swiftPrefix = object.swiftPrefix ?? ""; - message.phpClassPrefix = object.phpClassPrefix ?? ""; - message.phpNamespace = object.phpNamespace ?? ""; - message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; - message.rubyPackage = object.rubyPackage ?? ""; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseMessageOptions(): MessageOptions { - return { - messageSetWireFormat: false, - noStandardDescriptorAccessor: false, - deprecated: false, - mapEntry: false, - deprecatedLegacyJsonFieldConflicts: false, - features: undefined, - uninterpretedOption: [], - }; -} - -export const MessageOptions: MessageFns = { - encode(message: MessageOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { - writer.uint32(8).bool(message.messageSetWireFormat); - } - if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { - writer.uint32(16).bool(message.noStandardDescriptorAccessor); - } - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(24).bool(message.deprecated); - } - if (message.mapEntry !== undefined && message.mapEntry !== false) { - writer.uint32(56).bool(message.mapEntry); - } - if ( - message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false - ) { - writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(98).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.messageSetWireFormat = reader.bool(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.noStandardDescriptorAccessor = reader.bool(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 7: { - if (tag !== 56) { - break; - } - - message.mapEntry = reader.bool(); - continue; - } - case 11: { - if (tag !== 88) { - break; - } - - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - continue; - } - case 12: { - if (tag !== 98) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MessageOptions { - return { - messageSetWireFormat: isSet(object.messageSetWireFormat) - ? globalThis.Boolean(object.messageSetWireFormat) - : false, - noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) - ? globalThis.Boolean(object.noStandardDescriptorAccessor) - : false, - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - mapEntry: isSet(object.mapEntry) ? globalThis.Boolean(object.mapEntry) : false, - deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) - ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) - : false, - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { - obj.messageSetWireFormat = message.messageSetWireFormat; - } - if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { - obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - } - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if (message.mapEntry !== undefined && message.mapEntry !== false) { - obj.mapEntry = message.mapEntry; - } - if ( - message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false - ) { - obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): MessageOptions { - return MessageOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MessageOptions { - const message = createBaseMessageOptions(); - message.messageSetWireFormat = object.messageSetWireFormat ?? false; - message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; - message.deprecated = object.deprecated ?? false; - message.mapEntry = object.mapEntry ?? false; - message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFieldOptions(): FieldOptions { - return { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - unverifiedLazy: false, - deprecated: false, - weak: false, - debugRedact: false, - retention: 0, - targets: [], - editionDefaults: [], - features: undefined, - featureSupport: undefined, - uninterpretedOption: [], - }; -} - -export const FieldOptions: MessageFns = { - encode(message: FieldOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.ctype !== undefined && message.ctype !== 0) { - writer.uint32(8).int32(message.ctype); - } - if (message.packed !== undefined && message.packed !== false) { - writer.uint32(16).bool(message.packed); - } - if (message.jstype !== undefined && message.jstype !== 0) { - writer.uint32(48).int32(message.jstype); - } - if (message.lazy !== undefined && message.lazy !== false) { - writer.uint32(40).bool(message.lazy); - } - if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { - writer.uint32(120).bool(message.unverifiedLazy); - } - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(24).bool(message.deprecated); - } - if (message.weak !== undefined && message.weak !== false) { - writer.uint32(80).bool(message.weak); - } - if (message.debugRedact !== undefined && message.debugRedact !== false) { - writer.uint32(128).bool(message.debugRedact); - } - if (message.retention !== undefined && message.retention !== 0) { - writer.uint32(136).int32(message.retention); - } - for (const v of message.targets) { - writer.uint32(152).int32(v!); - } - for (const v of message.editionDefaults) { - FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).join(); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(170).fork()).join(); - } - if (message.featureSupport !== undefined) { - FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.ctype = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.packed = reader.bool(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.jstype = reader.int32() as any; - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.lazy = reader.bool(); - continue; - } - case 15: { - if (tag !== 120) { - break; - } - - message.unverifiedLazy = reader.bool(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 10: { - if (tag !== 80) { - break; - } - - message.weak = reader.bool(); - continue; - } - case 16: { - if (tag !== 128) { - break; - } - - message.debugRedact = reader.bool(); - continue; - } - case 17: { - if (tag !== 136) { - break; - } - - message.retention = reader.int32() as any; - continue; - } - case 19: { - if (tag === 152) { - message.targets.push(reader.int32() as any); - - continue; - } - - if (tag === 154) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.targets.push(reader.int32() as any); - } - - continue; - } - - break; - } - case 20: { - if (tag !== 162) { - break; - } - - message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32())); - continue; - } - case 21: { - if (tag !== 170) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 22: { - if (tag !== 178) { - break; - } - - message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldOptions { - return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, - packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, - lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false, - unverifiedLazy: isSet(object.unverifiedLazy) ? globalThis.Boolean(object.unverifiedLazy) : false, - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false, - debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, - retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0, - targets: globalThis.Array.isArray(object?.targets) - ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e)) - : [], - editionDefaults: globalThis.Array.isArray(object?.editionDefaults) - ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e)) - : [], - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - featureSupport: isSet(object.featureSupport) - ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport) - : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: FieldOptions): unknown { - const obj: any = {}; - if (message.ctype !== undefined && message.ctype !== 0) { - obj.ctype = fieldOptions_CTypeToJSON(message.ctype); - } - if (message.packed !== undefined && message.packed !== false) { - obj.packed = message.packed; - } - if (message.jstype !== undefined && message.jstype !== 0) { - obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); - } - if (message.lazy !== undefined && message.lazy !== false) { - obj.lazy = message.lazy; - } - if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { - obj.unverifiedLazy = message.unverifiedLazy; - } - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if (message.weak !== undefined && message.weak !== false) { - obj.weak = message.weak; - } - if (message.debugRedact !== undefined && message.debugRedact !== false) { - obj.debugRedact = message.debugRedact; - } - if (message.retention !== undefined && message.retention !== 0) { - obj.retention = fieldOptions_OptionRetentionToJSON(message.retention); - } - if (message.targets?.length) { - obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e)); - } - if (message.editionDefaults?.length) { - obj.editionDefaults = message.editionDefaults.map((e) => FieldOptions_EditionDefault.toJSON(e)); - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.featureSupport !== undefined) { - obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): FieldOptions { - return FieldOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldOptions { - const message = createBaseFieldOptions(); - message.ctype = object.ctype ?? 0; - message.packed = object.packed ?? false; - message.jstype = object.jstype ?? 0; - message.lazy = object.lazy ?? false; - message.unverifiedLazy = object.unverifiedLazy ?? false; - message.deprecated = object.deprecated ?? false; - message.weak = object.weak ?? false; - message.debugRedact = object.debugRedact ?? false; - message.retention = object.retention ?? 0; - message.targets = object.targets?.map((e) => e) || []; - message.editionDefaults = object.editionDefaults?.map((e) => FieldOptions_EditionDefault.fromPartial(e)) || []; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null) - ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault { - return { edition: 0, value: "" }; -} - -export const FieldOptions_EditionDefault: MessageFns = { - encode(message: FieldOptions_EditionDefault, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.edition !== undefined && message.edition !== 0) { - writer.uint32(24).int32(message.edition); - } - if (message.value !== undefined && message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_EditionDefault { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions_EditionDefault(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - if (tag !== 24) { - break; - } - - message.edition = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldOptions_EditionDefault { - return { - edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, - value: isSet(object.value) ? globalThis.String(object.value) : "", - }; - }, - - toJSON(message: FieldOptions_EditionDefault): unknown { - const obj: any = {}; - if (message.edition !== undefined && message.edition !== 0) { - obj.edition = editionToJSON(message.edition); - } - if (message.value !== undefined && message.value !== "") { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): FieldOptions_EditionDefault { - return FieldOptions_EditionDefault.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldOptions_EditionDefault { - const message = createBaseFieldOptions_EditionDefault(); - message.edition = object.edition ?? 0; - message.value = object.value ?? ""; - return message; - }, -}; - -function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport { - return { editionIntroduced: 0, editionDeprecated: 0, deprecationWarning: "", editionRemoved: 0 }; -} - -export const FieldOptions_FeatureSupport: MessageFns = { - encode(message: FieldOptions_FeatureSupport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { - writer.uint32(8).int32(message.editionIntroduced); - } - if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { - writer.uint32(16).int32(message.editionDeprecated); - } - if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { - writer.uint32(26).string(message.deprecationWarning); - } - if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { - writer.uint32(32).int32(message.editionRemoved); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_FeatureSupport { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions_FeatureSupport(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.editionIntroduced = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.editionDeprecated = reader.int32() as any; - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.deprecationWarning = reader.string(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.editionRemoved = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldOptions_FeatureSupport { - return { - editionIntroduced: isSet(object.editionIntroduced) ? editionFromJSON(object.editionIntroduced) : 0, - editionDeprecated: isSet(object.editionDeprecated) ? editionFromJSON(object.editionDeprecated) : 0, - deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "", - editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : 0, - }; - }, - - toJSON(message: FieldOptions_FeatureSupport): unknown { - const obj: any = {}; - if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { - obj.editionIntroduced = editionToJSON(message.editionIntroduced); - } - if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { - obj.editionDeprecated = editionToJSON(message.editionDeprecated); - } - if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { - obj.deprecationWarning = message.deprecationWarning; - } - if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { - obj.editionRemoved = editionToJSON(message.editionRemoved); - } - return obj; - }, - - create, I>>(base?: I): FieldOptions_FeatureSupport { - return FieldOptions_FeatureSupport.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldOptions_FeatureSupport { - const message = createBaseFieldOptions_FeatureSupport(); - message.editionIntroduced = object.editionIntroduced ?? 0; - message.editionDeprecated = object.editionDeprecated ?? 0; - message.deprecationWarning = object.deprecationWarning ?? ""; - message.editionRemoved = object.editionRemoved ?? 0; - return message; - }, -}; - -function createBaseOneofOptions(): OneofOptions { - return { features: undefined, uninterpretedOption: [] }; -} - -export const OneofOptions: MessageFns = { - encode(message: OneofOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(10).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): OneofOptions { - return { - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): OneofOptions { - return OneofOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): OneofOptions { - const message = createBaseOneofOptions(); - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseEnumOptions(): EnumOptions { - return { - allowAlias: false, - deprecated: false, - deprecatedLegacyJsonFieldConflicts: false, - features: undefined, - uninterpretedOption: [], - }; -} - -export const EnumOptions: MessageFns = { - encode(message: EnumOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.allowAlias !== undefined && message.allowAlias !== false) { - writer.uint32(16).bool(message.allowAlias); - } - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(24).bool(message.deprecated); - } - if ( - message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false - ) { - writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(58).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (tag !== 16) { - break; - } - - message.allowAlias = reader.bool(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnumOptions { - return { - allowAlias: isSet(object.allowAlias) ? globalThis.Boolean(object.allowAlias) : false, - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) - ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) - : false, - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - if (message.allowAlias !== undefined && message.allowAlias !== false) { - obj.allowAlias = message.allowAlias; - } - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if ( - message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false - ) { - obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): EnumOptions { - return EnumOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): EnumOptions { - const message = createBaseEnumOptions(); - message.allowAlias = object.allowAlias ?? false; - message.deprecated = object.deprecated ?? false; - message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseEnumValueOptions(): EnumValueOptions { - return { - deprecated: false, - features: undefined, - debugRedact: false, - featureSupport: undefined, - uninterpretedOption: [], - }; -} - -export const EnumValueOptions: MessageFns = { - encode(message: EnumValueOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(8).bool(message.deprecated); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(18).fork()).join(); - } - if (message.debugRedact !== undefined && message.debugRedact !== false) { - writer.uint32(24).bool(message.debugRedact); - } - if (message.featureSupport !== undefined) { - FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(34).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.debugRedact = reader.bool(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - return { - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, - featureSupport: isSet(object.featureSupport) - ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport) - : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.debugRedact !== undefined && message.debugRedact !== false) { - obj.debugRedact = message.debugRedact; - } - if (message.featureSupport !== undefined) { - obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): EnumValueOptions { - return EnumValueOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): EnumValueOptions { - const message = createBaseEnumValueOptions(); - message.deprecated = object.deprecated ?? false; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.debugRedact = object.debugRedact ?? false; - message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null) - ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseServiceOptions(): ServiceOptions { - return { features: undefined, deprecated: false, uninterpretedOption: [] }; -} - -export const ServiceOptions: MessageFns = { - encode(message: ServiceOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(274).fork()).join(); - } - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 34: { - if (tag !== 274) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 33: { - if (tag !== 264) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - return { - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): ServiceOptions { - return ServiceOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ServiceOptions { - const message = createBaseServiceOptions(); - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseMethodOptions(): MethodOptions { - return { deprecated: false, idempotencyLevel: 0, features: undefined, uninterpretedOption: [] }; -} - -export const MethodOptions: MessageFns = { - encode(message: MethodOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.deprecated !== undefined && message.deprecated !== false) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { - writer.uint32(272).int32(message.idempotencyLevel); - } - if (message.features !== undefined) { - FeatureSet.encode(message.features, writer.uint32(282).fork()).join(); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - if (tag !== 264) { - break; - } - - message.deprecated = reader.bool(); - continue; - } - case 34: { - if (tag !== 272) { - break; - } - - message.idempotencyLevel = reader.int32() as any; - continue; - } - case 35: { - if (tag !== 282) { - break; - } - - message.features = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 999: { - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MethodOptions { - return { - deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) - ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) - : 0, - features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, - uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) - : [], - }; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - if (message.deprecated !== undefined && message.deprecated !== false) { - obj.deprecated = message.deprecated; - } - if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { - obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel); - } - if (message.features !== undefined) { - obj.features = FeatureSet.toJSON(message.features); - } - if (message.uninterpretedOption?.length) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): MethodOptions { - return MethodOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MethodOptions { - const message = createBaseMethodOptions(); - message.deprecated = object.deprecated ?? false; - message.idempotencyLevel = object.idempotencyLevel ?? 0; - message.features = (object.features !== undefined && object.features !== null) - ? FeatureSet.fromPartial(object.features) - : undefined; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseUninterpretedOption(): UninterpretedOption { - return { - name: [], - identifierValue: "", - positiveIntValue: "0", - negativeIntValue: "0", - doubleValue: 0, - stringValue: new Uint8Array(0), - aggregateValue: "", - }; -} - -export const UninterpretedOption: MessageFns = { - encode(message: UninterpretedOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.name) { - UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.identifierValue !== undefined && message.identifierValue !== "") { - writer.uint32(26).string(message.identifierValue); - } - if (message.positiveIntValue !== undefined && message.positiveIntValue !== "0") { - writer.uint32(32).uint64(message.positiveIntValue); - } - if (message.negativeIntValue !== undefined && message.negativeIntValue !== "0") { - writer.uint32(40).int64(message.negativeIntValue); - } - if (message.doubleValue !== undefined && message.doubleValue !== 0) { - writer.uint32(49).double(message.doubleValue); - } - if (message.stringValue !== undefined && message.stringValue.length !== 0) { - writer.uint32(58).bytes(message.stringValue); - } - if (message.aggregateValue !== undefined && message.aggregateValue !== "") { - writer.uint32(66).string(message.aggregateValue); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (tag !== 18) { - break; - } - - message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.identifierValue = reader.string(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.positiveIntValue = reader.uint64().toString(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.negativeIntValue = reader.int64().toString(); - continue; - } - case 6: { - if (tag !== 49) { - break; - } - - message.doubleValue = reader.double(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.stringValue = reader.bytes(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.aggregateValue = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - return { - name: globalThis.Array.isArray(object?.name) - ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) - : [], - identifierValue: isSet(object.identifierValue) ? globalThis.String(object.identifierValue) : "", - positiveIntValue: isSet(object.positiveIntValue) ? globalThis.String(object.positiveIntValue) : "0", - negativeIntValue: isSet(object.negativeIntValue) ? globalThis.String(object.negativeIntValue) : "0", - doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : 0, - stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(0), - aggregateValue: isSet(object.aggregateValue) ? globalThis.String(object.aggregateValue) : "", - }; - }, - - toJSON(message: UninterpretedOption): unknown { - const obj: any = {}; - if (message.name?.length) { - obj.name = message.name.map((e) => UninterpretedOption_NamePart.toJSON(e)); - } - if (message.identifierValue !== undefined && message.identifierValue !== "") { - obj.identifierValue = message.identifierValue; - } - if (message.positiveIntValue !== undefined && message.positiveIntValue !== "0") { - obj.positiveIntValue = message.positiveIntValue; - } - if (message.negativeIntValue !== undefined && message.negativeIntValue !== "0") { - obj.negativeIntValue = message.negativeIntValue; - } - if (message.doubleValue !== undefined && message.doubleValue !== 0) { - obj.doubleValue = message.doubleValue; - } - if (message.stringValue !== undefined && message.stringValue.length !== 0) { - obj.stringValue = base64FromBytes(message.stringValue); - } - if (message.aggregateValue !== undefined && message.aggregateValue !== "") { - obj.aggregateValue = message.aggregateValue; - } - return obj; - }, - - create, I>>(base?: I): UninterpretedOption { - return UninterpretedOption.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UninterpretedOption { - const message = createBaseUninterpretedOption(); - message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; - message.identifierValue = object.identifierValue ?? ""; - message.positiveIntValue = object.positiveIntValue ?? "0"; - message.negativeIntValue = object.negativeIntValue ?? "0"; - message.doubleValue = object.doubleValue ?? 0; - message.stringValue = object.stringValue ?? new Uint8Array(0); - message.aggregateValue = object.aggregateValue ?? ""; - return message; - }, -}; - -function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { - return { namePart: "", isExtension: false }; -} - -export const UninterpretedOption_NamePart: MessageFns = { - encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.namePart !== "") { - writer.uint32(10).string(message.namePart); - } - if (message.isExtension !== false) { - writer.uint32(16).bool(message.isExtension); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption_NamePart(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.namePart = reader.string(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.isExtension = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - return { - namePart: isSet(object.namePart) ? globalThis.String(object.namePart) : "", - isExtension: isSet(object.isExtension) ? globalThis.Boolean(object.isExtension) : false, - }; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - if (message.namePart !== "") { - obj.namePart = message.namePart; - } - if (message.isExtension !== false) { - obj.isExtension = message.isExtension; - } - return obj; - }, - - create, I>>(base?: I): UninterpretedOption_NamePart { - return UninterpretedOption_NamePart.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UninterpretedOption_NamePart { - const message = createBaseUninterpretedOption_NamePart(); - message.namePart = object.namePart ?? ""; - message.isExtension = object.isExtension ?? false; - return message; - }, -}; - -function createBaseFeatureSet(): FeatureSet { - return { - fieldPresence: 0, - enumType: 0, - repeatedFieldEncoding: 0, - utf8Validation: 0, - messageEncoding: 0, - jsonFormat: 0, - enforceNamingStyle: 0, - defaultSymbolVisibility: 0, - }; -} - -export const FeatureSet: MessageFns = { - encode(message: FeatureSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { - writer.uint32(8).int32(message.fieldPresence); - } - if (message.enumType !== undefined && message.enumType !== 0) { - writer.uint32(16).int32(message.enumType); - } - if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { - writer.uint32(24).int32(message.repeatedFieldEncoding); - } - if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { - writer.uint32(32).int32(message.utf8Validation); - } - if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { - writer.uint32(40).int32(message.messageEncoding); - } - if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { - writer.uint32(48).int32(message.jsonFormat); - } - if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { - writer.uint32(56).int32(message.enforceNamingStyle); - } - if (message.defaultSymbolVisibility !== undefined && message.defaultSymbolVisibility !== 0) { - writer.uint32(64).int32(message.defaultSymbolVisibility); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeatureSet(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.fieldPresence = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.enumType = reader.int32() as any; - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.repeatedFieldEncoding = reader.int32() as any; - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.utf8Validation = reader.int32() as any; - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.messageEncoding = reader.int32() as any; - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.jsonFormat = reader.int32() as any; - continue; - } - case 7: { - if (tag !== 56) { - break; - } - - message.enforceNamingStyle = reader.int32() as any; - continue; - } - case 8: { - if (tag !== 64) { - break; - } - - message.defaultSymbolVisibility = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FeatureSet { - return { - fieldPresence: isSet(object.fieldPresence) ? featureSet_FieldPresenceFromJSON(object.fieldPresence) : 0, - enumType: isSet(object.enumType) ? featureSet_EnumTypeFromJSON(object.enumType) : 0, - repeatedFieldEncoding: isSet(object.repeatedFieldEncoding) - ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding) - : 0, - utf8Validation: isSet(object.utf8Validation) ? featureSet_Utf8ValidationFromJSON(object.utf8Validation) : 0, - messageEncoding: isSet(object.messageEncoding) ? featureSet_MessageEncodingFromJSON(object.messageEncoding) : 0, - jsonFormat: isSet(object.jsonFormat) ? featureSet_JsonFormatFromJSON(object.jsonFormat) : 0, - enforceNamingStyle: isSet(object.enforceNamingStyle) - ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle) - : 0, - defaultSymbolVisibility: isSet(object.defaultSymbolVisibility) - ? featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(object.defaultSymbolVisibility) - : 0, - }; - }, - - toJSON(message: FeatureSet): unknown { - const obj: any = {}; - if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { - obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence); - } - if (message.enumType !== undefined && message.enumType !== 0) { - obj.enumType = featureSet_EnumTypeToJSON(message.enumType); - } - if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { - obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding); - } - if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { - obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation); - } - if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { - obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding); - } - if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { - obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat); - } - if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { - obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle); - } - if (message.defaultSymbolVisibility !== undefined && message.defaultSymbolVisibility !== 0) { - obj.defaultSymbolVisibility = featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON( - message.defaultSymbolVisibility, - ); - } - return obj; - }, - - create, I>>(base?: I): FeatureSet { - return FeatureSet.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FeatureSet { - const message = createBaseFeatureSet(); - message.fieldPresence = object.fieldPresence ?? 0; - message.enumType = object.enumType ?? 0; - message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 0; - message.utf8Validation = object.utf8Validation ?? 0; - message.messageEncoding = object.messageEncoding ?? 0; - message.jsonFormat = object.jsonFormat ?? 0; - message.enforceNamingStyle = object.enforceNamingStyle ?? 0; - message.defaultSymbolVisibility = object.defaultSymbolVisibility ?? 0; - return message; - }, -}; - -function createBaseFeatureSet_VisibilityFeature(): FeatureSet_VisibilityFeature { - return {}; -} - -export const FeatureSet_VisibilityFeature: MessageFns = { - encode(_: FeatureSet_VisibilityFeature, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet_VisibilityFeature { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeatureSet_VisibilityFeature(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(_: any): FeatureSet_VisibilityFeature { - return {}; - }, - - toJSON(_: FeatureSet_VisibilityFeature): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>(base?: I): FeatureSet_VisibilityFeature { - return FeatureSet_VisibilityFeature.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(_: I): FeatureSet_VisibilityFeature { - const message = createBaseFeatureSet_VisibilityFeature(); - return message; - }, -}; - -function createBaseFeatureSetDefaults(): FeatureSetDefaults { - return { defaults: [], minimumEdition: 0, maximumEdition: 0 }; -} - -export const FeatureSetDefaults: MessageFns = { - encode(message: FeatureSetDefaults, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.defaults) { - FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).join(); - } - if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { - writer.uint32(32).int32(message.minimumEdition); - } - if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { - writer.uint32(40).int32(message.maximumEdition); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeatureSetDefaults(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32())); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.minimumEdition = reader.int32() as any; - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.maximumEdition = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FeatureSetDefaults { - return { - defaults: globalThis.Array.isArray(object?.defaults) - ? object.defaults.map((e: any) => FeatureSetDefaults_FeatureSetEditionDefault.fromJSON(e)) - : [], - minimumEdition: isSet(object.minimumEdition) ? editionFromJSON(object.minimumEdition) : 0, - maximumEdition: isSet(object.maximumEdition) ? editionFromJSON(object.maximumEdition) : 0, - }; - }, - - toJSON(message: FeatureSetDefaults): unknown { - const obj: any = {}; - if (message.defaults?.length) { - obj.defaults = message.defaults.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.toJSON(e)); - } - if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { - obj.minimumEdition = editionToJSON(message.minimumEdition); - } - if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { - obj.maximumEdition = editionToJSON(message.maximumEdition); - } - return obj; - }, - - create, I>>(base?: I): FeatureSetDefaults { - return FeatureSetDefaults.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FeatureSetDefaults { - const message = createBaseFeatureSetDefaults(); - message.defaults = object.defaults?.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || []; - message.minimumEdition = object.minimumEdition ?? 0; - message.maximumEdition = object.maximumEdition ?? 0; - return message; - }, -}; - -function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault { - return { edition: 0, overridableFeatures: undefined, fixedFeatures: undefined }; -} - -export const FeatureSetDefaults_FeatureSetEditionDefault: MessageFns = { - encode( - message: FeatureSetDefaults_FeatureSetEditionDefault, - writer: BinaryWriter = new BinaryWriter(), - ): BinaryWriter { - if (message.edition !== undefined && message.edition !== 0) { - writer.uint32(24).int32(message.edition); - } - if (message.overridableFeatures !== undefined) { - FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).join(); - } - if (message.fixedFeatures !== undefined) { - FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - if (tag !== 24) { - break; - } - - message.edition = reader.int32() as any; - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.overridableFeatures = FeatureSet.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.fixedFeatures = FeatureSet.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault { - return { - edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, - overridableFeatures: isSet(object.overridableFeatures) - ? FeatureSet.fromJSON(object.overridableFeatures) - : undefined, - fixedFeatures: isSet(object.fixedFeatures) ? FeatureSet.fromJSON(object.fixedFeatures) : undefined, - }; - }, - - toJSON(message: FeatureSetDefaults_FeatureSetEditionDefault): unknown { - const obj: any = {}; - if (message.edition !== undefined && message.edition !== 0) { - obj.edition = editionToJSON(message.edition); - } - if (message.overridableFeatures !== undefined) { - obj.overridableFeatures = FeatureSet.toJSON(message.overridableFeatures); - } - if (message.fixedFeatures !== undefined) { - obj.fixedFeatures = FeatureSet.toJSON(message.fixedFeatures); - } - return obj; - }, - - create, I>>( - base?: I, - ): FeatureSetDefaults_FeatureSetEditionDefault { - return FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): FeatureSetDefaults_FeatureSetEditionDefault { - const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); - message.edition = object.edition ?? 0; - message.overridableFeatures = (object.overridableFeatures !== undefined && object.overridableFeatures !== null) - ? FeatureSet.fromPartial(object.overridableFeatures) - : undefined; - message.fixedFeatures = (object.fixedFeatures !== undefined && object.fixedFeatures !== null) - ? FeatureSet.fromPartial(object.fixedFeatures) - : undefined; - return message; - }, -}; - -function createBaseSourceCodeInfo(): SourceCodeInfo { - return { location: [] }; -} - -export const SourceCodeInfo: MessageFns = { - encode(message: SourceCodeInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo { - return { - location: globalThis.Array.isArray(object?.location) - ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) - : [], - }; - }, - - toJSON(message: SourceCodeInfo): unknown { - const obj: any = {}; - if (message.location?.length) { - obj.location = message.location.map((e) => SourceCodeInfo_Location.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): SourceCodeInfo { - return SourceCodeInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SourceCodeInfo { - const message = createBaseSourceCodeInfo(); - message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { - return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; -} - -export const SourceCodeInfo_Location: MessageFns = { - encode(message: SourceCodeInfo_Location, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.join(); - writer.uint32(18).fork(); - for (const v of message.span) { - writer.int32(v); - } - writer.join(); - if (message.leadingComments !== undefined && message.leadingComments !== "") { - writer.uint32(26).string(message.leadingComments); - } - if (message.trailingComments !== undefined && message.trailingComments !== "") { - writer.uint32(34).string(message.trailingComments); - } - for (const v of message.leadingDetachedComments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo_Location(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag === 8) { - message.path.push(reader.int32()); - - continue; - } - - if (tag === 10) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - - continue; - } - - break; - } - case 2: { - if (tag === 16) { - message.span.push(reader.int32()); - - continue; - } - - if (tag === 18) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.span.push(reader.int32()); - } - - continue; - } - - break; - } - case 3: { - if (tag !== 26) { - break; - } - - message.leadingComments = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.trailingComments = reader.string(); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.leadingDetachedComments.push(reader.string()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - return { - path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.Number(e)) : [], - span: globalThis.Array.isArray(object?.span) ? object.span.map((e: any) => globalThis.Number(e)) : [], - leadingComments: isSet(object.leadingComments) ? globalThis.String(object.leadingComments) : "", - trailingComments: isSet(object.trailingComments) ? globalThis.String(object.trailingComments) : "", - leadingDetachedComments: globalThis.Array.isArray(object?.leadingDetachedComments) - ? object.leadingDetachedComments.map((e: any) => globalThis.String(e)) - : [], - }; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path?.length) { - obj.path = message.path.map((e) => Math.round(e)); - } - if (message.span?.length) { - obj.span = message.span.map((e) => Math.round(e)); - } - if (message.leadingComments !== undefined && message.leadingComments !== "") { - obj.leadingComments = message.leadingComments; - } - if (message.trailingComments !== undefined && message.trailingComments !== "") { - obj.trailingComments = message.trailingComments; - } - if (message.leadingDetachedComments?.length) { - obj.leadingDetachedComments = message.leadingDetachedComments; - } - return obj; - }, - - create, I>>(base?: I): SourceCodeInfo_Location { - return SourceCodeInfo_Location.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SourceCodeInfo_Location { - const message = createBaseSourceCodeInfo_Location(); - message.path = object.path?.map((e) => e) || []; - message.span = object.span?.map((e) => e) || []; - message.leadingComments = object.leadingComments ?? ""; - message.trailingComments = object.trailingComments ?? ""; - message.leadingDetachedComments = object.leadingDetachedComments?.map((e) => e) || []; - return message; - }, -}; - -function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { - return { annotation: [] }; -} - -export const GeneratedCodeInfo: MessageFns = { - encode(message: GeneratedCodeInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): GeneratedCodeInfo { - return { - annotation: globalThis.Array.isArray(object?.annotation) - ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) - : [], - }; - }, - - toJSON(message: GeneratedCodeInfo): unknown { - const obj: any = {}; - if (message.annotation?.length) { - obj.annotation = message.annotation.map((e) => GeneratedCodeInfo_Annotation.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): GeneratedCodeInfo { - return GeneratedCodeInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GeneratedCodeInfo { - const message = createBaseGeneratedCodeInfo(); - message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; -} - -export const GeneratedCodeInfo_Annotation: MessageFns = { - encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.join(); - if (message.sourceFile !== undefined && message.sourceFile !== "") { - writer.uint32(18).string(message.sourceFile); - } - if (message.begin !== undefined && message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== undefined && message.end !== 0) { - writer.uint32(32).int32(message.end); - } - if (message.semantic !== undefined && message.semantic !== 0) { - writer.uint32(40).int32(message.semantic); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo_Annotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag === 8) { - message.path.push(reader.int32()); - - continue; - } - - if (tag === 10) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - - continue; - } - - break; - } - case 2: { - if (tag !== 18) { - break; - } - - message.sourceFile = reader.string(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.begin = reader.int32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.end = reader.int32(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.semantic = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): GeneratedCodeInfo_Annotation { - return { - path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.Number(e)) : [], - sourceFile: isSet(object.sourceFile) ? globalThis.String(object.sourceFile) : "", - begin: isSet(object.begin) ? globalThis.Number(object.begin) : 0, - end: isSet(object.end) ? globalThis.Number(object.end) : 0, - semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0, - }; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path?.length) { - obj.path = message.path.map((e) => Math.round(e)); - } - if (message.sourceFile !== undefined && message.sourceFile !== "") { - obj.sourceFile = message.sourceFile; - } - if (message.begin !== undefined && message.begin !== 0) { - obj.begin = Math.round(message.begin); - } - if (message.end !== undefined && message.end !== 0) { - obj.end = Math.round(message.end); - } - if (message.semantic !== undefined && message.semantic !== 0) { - obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic); - } - return obj; - }, - - create, I>>(base?: I): GeneratedCodeInfo_Annotation { - return GeneratedCodeInfo_Annotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GeneratedCodeInfo_Annotation { - const message = createBaseGeneratedCodeInfo_Annotation(); - message.path = object.path?.map((e) => e) || []; - message.sourceFile = object.sourceFile ?? ""; - message.begin = object.begin ?? 0; - message.end = object.end ?? 0; - message.semantic = object.semantic ?? 0; - return message; - }, -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts deleted file mode 100644 index fdc858b2..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/duration.ts +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: google/protobuf/duration.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: string; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -function createBaseDuration(): Duration { - return { seconds: "0", nanos: 0 }; -} - -export const Duration: MessageFns = { - encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.seconds !== "0") { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Duration { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDuration(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.seconds = reader.int64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.nanos = reader.int32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Duration { - return { - seconds: isSet(object.seconds) ? globalThis.String(object.seconds) : "0", - nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, - }; - }, - - toJSON(message: Duration): unknown { - const obj: any = {}; - if (message.seconds !== "0") { - obj.seconds = message.seconds; - } - if (message.nanos !== 0) { - obj.nanos = Math.round(message.nanos); - } - return obj; - }, - - create, I>>(base?: I): Duration { - return Duration.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Duration { - const message = createBaseDuration(); - message.seconds = object.seconds ?? "0"; - message.nanos = object.nanos ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts deleted file mode 100644 index 809915fb..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/struct.ts +++ /dev/null @@ -1,588 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: google/protobuf/struct.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "google.protobuf"; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - */ -export enum NullValue { - /** NULL_VALUE - Null value. */ - NULL_VALUE = 0, - UNRECOGNIZED = -1, -} - -export function nullValueFromJSON(object: any): NullValue { - switch (object) { - case 0: - case "NULL_VALUE": - return NullValue.NULL_VALUE; - case -1: - case "UNRECOGNIZED": - default: - return NullValue.UNRECOGNIZED; - } -} - -export function nullValueToJSON(object: NullValue): string { - switch (object) { - case NullValue.NULL_VALUE: - return "NULL_VALUE"; - case NullValue.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - */ -export interface Struct { - /** Unordered map of dynamically typed values. */ - fields: { [key: string]: any | undefined }; -} - -export interface Struct_FieldsEntry { - key: string; - value: any | undefined; -} - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of these - * variants. Absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - */ -export interface Value { - /** Represents a null value. */ - nullValue?: - | NullValue - | undefined; - /** Represents a double value. */ - numberValue?: - | number - | undefined; - /** Represents a string value. */ - stringValue?: - | string - | undefined; - /** Represents a boolean value. */ - boolValue?: - | boolean - | undefined; - /** Represents a structured value. */ - structValue?: - | { [key: string]: any } - | undefined; - /** Represents a repeated `Value`. */ - listValue?: Array | undefined; -} - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - */ -export interface ListValue { - /** Repeated field of dynamically typed values. */ - values: any[]; -} - -function createBaseStruct(): Struct { - return { fields: {} }; -} - -export const Struct: MessageFns & StructWrapperFns = { - encode(message: Struct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - Object.entries(message.fields).forEach(([key, value]) => { - if (value !== undefined) { - Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); - } - }); - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Struct { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStruct(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()); - if (entry1.value !== undefined) { - message.fields[entry1.key] = entry1.value; - } - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Struct { - return { - fields: isObject(object.fields) - ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { - acc[key] = value as any | undefined; - return acc; - }, {}) - : {}, - }; - }, - - toJSON(message: Struct): unknown { - const obj: any = {}; - if (message.fields) { - const entries = Object.entries(message.fields); - if (entries.length > 0) { - obj.fields = {}; - entries.forEach(([k, v]) => { - obj.fields[k] = v; - }); - } - } - return obj; - }, - - create, I>>(base?: I): Struct { - return Struct.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Struct { - const message = createBaseStruct(); - message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[key] = value; - } - return acc; - }, - {}, - ); - return message; - }, - - wrap(object: { [key: string]: any } | undefined): Struct { - const struct = createBaseStruct(); - - if (object !== undefined) { - for (const key of Object.keys(object)) { - struct.fields[key] = object[key]; - } - } - return struct; - }, - - unwrap(message: Struct): { [key: string]: any } { - const object: { [key: string]: any } = {}; - if (message.fields) { - for (const key of Object.keys(message.fields)) { - object[key] = message.fields[key]; - } - } - return object; - }, -}; - -function createBaseStruct_FieldsEntry(): Struct_FieldsEntry { - return { key: "", value: undefined }; -} - -export const Struct_FieldsEntry: MessageFns = { - encode(message: Struct_FieldsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Struct_FieldsEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStruct_FieldsEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Struct_FieldsEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object?.value) ? object.value : undefined, - }; - }, - - toJSON(message: Struct_FieldsEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): Struct_FieldsEntry { - return Struct_FieldsEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Struct_FieldsEntry { - const message = createBaseStruct_FieldsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; - return message; - }, -}; - -function createBaseValue(): Value { - return { - nullValue: undefined, - numberValue: undefined, - stringValue: undefined, - boolValue: undefined, - structValue: undefined, - listValue: undefined, - }; -} - -export const Value: MessageFns & AnyValueWrapperFns = { - encode(message: Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.nullValue !== undefined) { - writer.uint32(8).int32(message.nullValue); - } - if (message.numberValue !== undefined) { - writer.uint32(17).double(message.numberValue); - } - if (message.stringValue !== undefined) { - writer.uint32(26).string(message.stringValue); - } - if (message.boolValue !== undefined) { - writer.uint32(32).bool(message.boolValue); - } - if (message.structValue !== undefined) { - Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join(); - } - if (message.listValue !== undefined) { - ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Value { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.nullValue = reader.int32() as any; - continue; - } - case 2: { - if (tag !== 17) { - break; - } - - message.numberValue = reader.double(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.stringValue = reader.string(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.boolValue = reader.bool(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32())); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Value { - return { - nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined, - numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined, - stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined, - boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined, - structValue: isObject(object.structValue) ? object.structValue : undefined, - listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined, - }; - }, - - toJSON(message: Value): unknown { - const obj: any = {}; - if (message.nullValue !== undefined) { - obj.nullValue = nullValueToJSON(message.nullValue); - } - if (message.numberValue !== undefined) { - obj.numberValue = message.numberValue; - } - if (message.stringValue !== undefined) { - obj.stringValue = message.stringValue; - } - if (message.boolValue !== undefined) { - obj.boolValue = message.boolValue; - } - if (message.structValue !== undefined) { - obj.structValue = message.structValue; - } - if (message.listValue !== undefined) { - obj.listValue = message.listValue; - } - return obj; - }, - - create, I>>(base?: I): Value { - return Value.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Value { - const message = createBaseValue(); - message.nullValue = object.nullValue ?? undefined; - message.numberValue = object.numberValue ?? undefined; - message.stringValue = object.stringValue ?? undefined; - message.boolValue = object.boolValue ?? undefined; - message.structValue = object.structValue ?? undefined; - message.listValue = object.listValue ?? undefined; - return message; - }, - - wrap(value: any): Value { - const result = createBaseValue(); - if (value === null) { - result.nullValue = NullValue.NULL_VALUE; - } else if (typeof value === "boolean") { - result.boolValue = value; - } else if (typeof value === "number") { - result.numberValue = value; - } else if (typeof value === "string") { - result.stringValue = value; - } else if (globalThis.Array.isArray(value)) { - result.listValue = value; - } else if (typeof value === "object") { - result.structValue = value; - } else if (typeof value !== "undefined") { - throw new globalThis.Error("Unsupported any value type: " + typeof value); - } - return result; - }, - - unwrap(message: any): string | number | boolean | Object | null | Array | undefined { - if (message.stringValue !== undefined) { - return message.stringValue; - } else if (message?.numberValue !== undefined) { - return message.numberValue; - } else if (message?.boolValue !== undefined) { - return message.boolValue; - } else if (message?.structValue !== undefined) { - return message.structValue as any; - } else if (message?.listValue !== undefined) { - return message.listValue; - } else if (message?.nullValue !== undefined) { - return null; - } - return undefined; - }, -}; - -function createBaseListValue(): ListValue { - return { values: [] }; -} - -export const ListValue: MessageFns & ListValueWrapperFns = { - encode(message: ListValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.values) { - Value.encode(Value.wrap(v!), writer.uint32(10).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ListValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ListValue { - return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] }; - }, - - toJSON(message: ListValue): unknown { - const obj: any = {}; - if (message.values?.length) { - obj.values = message.values; - } - return obj; - }, - - create, I>>(base?: I): ListValue { - return ListValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ListValue { - const message = createBaseListValue(); - message.values = object.values?.map((e) => e) || []; - return message; - }, - - wrap(array: Array | undefined): ListValue { - const result = createBaseListValue(); - result.values = array ?? []; - return result; - }, - - unwrap(message: ListValue): Array { - if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) { - return message.values; - } else { - return message as any; - } - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} - -export interface StructWrapperFns { - wrap(object: { [key: string]: any } | undefined): Struct; - unwrap(message: Struct): { [key: string]: any }; -} - -export interface AnyValueWrapperFns { - wrap(value: any): Value; - unwrap(message: any): string | number | boolean | Object | null | Array | undefined; -} - -export interface ListValueWrapperFns { - wrap(array: Array | undefined): ListValue; - unwrap(message: ListValue): Array; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts deleted file mode 100644 index 794218a2..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/timestamp.ts +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: google/protobuf/timestamp.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must - * be between -62135596800 and 253402300799 inclusive (which corresponds to - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). - */ - seconds: string; - /** - * Non-negative fractions of a second at nanosecond resolution. This field is - * the nanosecond portion of the duration, not an alternative to seconds. - * Negative second values with fractions must still have non-negative nanos - * values that count forward in time. Must be between 0 and 999,999,999 - * inclusive. - */ - nanos: number; -} - -function createBaseTimestamp(): Timestamp { - return { seconds: "0", nanos: 0 }; -} - -export const Timestamp: MessageFns = { - encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.seconds !== "0") { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTimestamp(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.seconds = reader.int64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.nanos = reader.int32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Timestamp { - return { - seconds: isSet(object.seconds) ? globalThis.String(object.seconds) : "0", - nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, - }; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - if (message.seconds !== "0") { - obj.seconds = message.seconds; - } - if (message.nanos !== 0) { - obj.nanos = Math.round(message.nanos); - } - return obj; - }, - - create, I>>(base?: I): Timestamp { - return Timestamp.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Timestamp { - const message = createBaseTimestamp(); - message.seconds = object.seconds ?? "0"; - message.nanos = object.nanos ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts b/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts deleted file mode 100644 index 9b675c63..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/google/protobuf/wrappers.ts +++ /dev/null @@ -1,699 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: google/protobuf/wrappers.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "google.protobuf"; - -/** - * Wrapper message for `double`. - * - * The JSON representation for `DoubleValue` is JSON number. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface DoubleValue { - /** The double value. */ - value: number; -} - -/** - * Wrapper message for `float`. - * - * The JSON representation for `FloatValue` is JSON number. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface FloatValue { - /** The float value. */ - value: number; -} - -/** - * Wrapper message for `int64`. - * - * The JSON representation for `Int64Value` is JSON string. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface Int64Value { - /** The int64 value. */ - value: string; -} - -/** - * Wrapper message for `uint64`. - * - * The JSON representation for `UInt64Value` is JSON string. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface UInt64Value { - /** The uint64 value. */ - value: string; -} - -/** - * Wrapper message for `int32`. - * - * The JSON representation for `Int32Value` is JSON number. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface Int32Value { - /** The int32 value. */ - value: number; -} - -/** - * Wrapper message for `uint32`. - * - * The JSON representation for `UInt32Value` is JSON number. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface UInt32Value { - /** The uint32 value. */ - value: number; -} - -/** - * Wrapper message for `bool`. - * - * The JSON representation for `BoolValue` is JSON `true` and `false`. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface BoolValue { - /** The bool value. */ - value: boolean; -} - -/** - * Wrapper message for `string`. - * - * The JSON representation for `StringValue` is JSON string. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface StringValue { - /** The string value. */ - value: string; -} - -/** - * Wrapper message for `bytes`. - * - * The JSON representation for `BytesValue` is JSON string. - * - * Not recommended for use in new APIs, but still useful for legacy APIs and - * has no plan to be removed. - */ -export interface BytesValue { - /** The bytes value. */ - value: Uint8Array; -} - -function createBaseDoubleValue(): DoubleValue { - return { value: 0 }; -} - -export const DoubleValue: MessageFns = { - encode(message: DoubleValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== 0) { - writer.uint32(9).double(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DoubleValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDoubleValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 9) { - break; - } - - message.value = reader.double(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DoubleValue { - return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; - }, - - toJSON(message: DoubleValue): unknown { - const obj: any = {}; - if (message.value !== 0) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): DoubleValue { - return DoubleValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): DoubleValue { - const message = createBaseDoubleValue(); - message.value = object.value ?? 0; - return message; - }, -}; - -function createBaseFloatValue(): FloatValue { - return { value: 0 }; -} - -export const FloatValue: MessageFns = { - encode(message: FloatValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== 0) { - writer.uint32(13).float(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FloatValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFloatValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 13) { - break; - } - - message.value = reader.float(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FloatValue { - return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; - }, - - toJSON(message: FloatValue): unknown { - const obj: any = {}; - if (message.value !== 0) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): FloatValue { - return FloatValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FloatValue { - const message = createBaseFloatValue(); - message.value = object.value ?? 0; - return message; - }, -}; - -function createBaseInt64Value(): Int64Value { - return { value: "0" }; -} - -export const Int64Value: MessageFns = { - encode(message: Int64Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== "0") { - writer.uint32(8).int64(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Int64Value { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInt64Value(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.value = reader.int64().toString(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Int64Value { - return { value: isSet(object.value) ? globalThis.String(object.value) : "0" }; - }, - - toJSON(message: Int64Value): unknown { - const obj: any = {}; - if (message.value !== "0") { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): Int64Value { - return Int64Value.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Int64Value { - const message = createBaseInt64Value(); - message.value = object.value ?? "0"; - return message; - }, -}; - -function createBaseUInt64Value(): UInt64Value { - return { value: "0" }; -} - -export const UInt64Value: MessageFns = { - encode(message: UInt64Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== "0") { - writer.uint32(8).uint64(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UInt64Value { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUInt64Value(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.value = reader.uint64().toString(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UInt64Value { - return { value: isSet(object.value) ? globalThis.String(object.value) : "0" }; - }, - - toJSON(message: UInt64Value): unknown { - const obj: any = {}; - if (message.value !== "0") { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): UInt64Value { - return UInt64Value.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UInt64Value { - const message = createBaseUInt64Value(); - message.value = object.value ?? "0"; - return message; - }, -}; - -function createBaseInt32Value(): Int32Value { - return { value: 0 }; -} - -export const Int32Value: MessageFns = { - encode(message: Int32Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== 0) { - writer.uint32(8).int32(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Int32Value { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInt32Value(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.value = reader.int32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Int32Value { - return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; - }, - - toJSON(message: Int32Value): unknown { - const obj: any = {}; - if (message.value !== 0) { - obj.value = Math.round(message.value); - } - return obj; - }, - - create, I>>(base?: I): Int32Value { - return Int32Value.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Int32Value { - const message = createBaseInt32Value(); - message.value = object.value ?? 0; - return message; - }, -}; - -function createBaseUInt32Value(): UInt32Value { - return { value: 0 }; -} - -export const UInt32Value: MessageFns = { - encode(message: UInt32Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== 0) { - writer.uint32(8).uint32(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UInt32Value { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUInt32Value(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.value = reader.uint32(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UInt32Value { - return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 }; - }, - - toJSON(message: UInt32Value): unknown { - const obj: any = {}; - if (message.value !== 0) { - obj.value = Math.round(message.value); - } - return obj; - }, - - create, I>>(base?: I): UInt32Value { - return UInt32Value.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UInt32Value { - const message = createBaseUInt32Value(); - message.value = object.value ?? 0; - return message; - }, -}; - -function createBaseBoolValue(): BoolValue { - return { value: false }; -} - -export const BoolValue: MessageFns = { - encode(message: BoolValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== false) { - writer.uint32(8).bool(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BoolValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBoolValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.value = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BoolValue { - return { value: isSet(object.value) ? globalThis.Boolean(object.value) : false }; - }, - - toJSON(message: BoolValue): unknown { - const obj: any = {}; - if (message.value !== false) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): BoolValue { - return BoolValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BoolValue { - const message = createBaseBoolValue(); - message.value = object.value ?? false; - return message; - }, -}; - -function createBaseStringValue(): StringValue { - return { value: "" }; -} - -export const StringValue: MessageFns = { - encode(message: StringValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== "") { - writer.uint32(10).string(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): StringValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStringValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.value = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): StringValue { - return { value: isSet(object.value) ? globalThis.String(object.value) : "" }; - }, - - toJSON(message: StringValue): unknown { - const obj: any = {}; - if (message.value !== "") { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): StringValue { - return StringValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): StringValue { - const message = createBaseStringValue(); - message.value = object.value ?? ""; - return message; - }, -}; - -function createBaseBytesValue(): BytesValue { - return { value: new Uint8Array(0) }; -} - -export const BytesValue: MessageFns = { - encode(message: BytesValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value.length !== 0) { - writer.uint32(10).bytes(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BytesValue { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBytesValue(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.value = reader.bytes(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BytesValue { - return { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0) }; - }, - - toJSON(message: BytesValue): unknown { - const obj: any = {}; - if (message.value.length !== 0) { - obj.value = base64FromBytes(message.value); - } - return obj; - }, - - create, I>>(base?: I): BytesValue { - return BytesValue.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BytesValue { - const message = createBaseBytesValue(); - message.value = object.value ?? new Uint8Array(0); - return message; - }, -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts deleted file mode 100644 index 78d3956f..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate.ts +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: udpa/annotations/migrate.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "udpa.annotations"; - -export interface MigrateAnnotation { - /** Rename the message/enum/enum value in next version. */ - rename: string; -} - -export interface FieldMigrateAnnotation { - /** Rename the field in next version. */ - rename: string; - /** - * Add the field to a named oneof in next version. If this already exists, the - * field will join its siblings under the oneof, otherwise a new oneof will be - * created with the given name. - */ - oneofPromotion: string; -} - -export interface FileMigrateAnnotation { - /** - * Move all types in the file to another package, this implies changing proto - * file path. - */ - moveToPackage: string; -} - -function createBaseMigrateAnnotation(): MigrateAnnotation { - return { rename: "" }; -} - -export const MigrateAnnotation: MessageFns = { - encode(message: MigrateAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.rename !== "") { - writer.uint32(10).string(message.rename); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MigrateAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMigrateAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.rename = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MigrateAnnotation { - return { rename: isSet(object.rename) ? globalThis.String(object.rename) : "" }; - }, - - toJSON(message: MigrateAnnotation): unknown { - const obj: any = {}; - if (message.rename !== "") { - obj.rename = message.rename; - } - return obj; - }, - - create, I>>(base?: I): MigrateAnnotation { - return MigrateAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MigrateAnnotation { - const message = createBaseMigrateAnnotation(); - message.rename = object.rename ?? ""; - return message; - }, -}; - -function createBaseFieldMigrateAnnotation(): FieldMigrateAnnotation { - return { rename: "", oneofPromotion: "" }; -} - -export const FieldMigrateAnnotation: MessageFns = { - encode(message: FieldMigrateAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.rename !== "") { - writer.uint32(10).string(message.rename); - } - if (message.oneofPromotion !== "") { - writer.uint32(18).string(message.oneofPromotion); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldMigrateAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldMigrateAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.rename = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.oneofPromotion = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldMigrateAnnotation { - return { - rename: isSet(object.rename) ? globalThis.String(object.rename) : "", - oneofPromotion: isSet(object.oneofPromotion) ? globalThis.String(object.oneofPromotion) : "", - }; - }, - - toJSON(message: FieldMigrateAnnotation): unknown { - const obj: any = {}; - if (message.rename !== "") { - obj.rename = message.rename; - } - if (message.oneofPromotion !== "") { - obj.oneofPromotion = message.oneofPromotion; - } - return obj; - }, - - create, I>>(base?: I): FieldMigrateAnnotation { - return FieldMigrateAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldMigrateAnnotation { - const message = createBaseFieldMigrateAnnotation(); - message.rename = object.rename ?? ""; - message.oneofPromotion = object.oneofPromotion ?? ""; - return message; - }, -}; - -function createBaseFileMigrateAnnotation(): FileMigrateAnnotation { - return { moveToPackage: "" }; -} - -export const FileMigrateAnnotation: MessageFns = { - encode(message: FileMigrateAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.moveToPackage !== "") { - writer.uint32(18).string(message.moveToPackage); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FileMigrateAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileMigrateAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (tag !== 18) { - break; - } - - message.moveToPackage = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FileMigrateAnnotation { - return { moveToPackage: isSet(object.moveToPackage) ? globalThis.String(object.moveToPackage) : "" }; - }, - - toJSON(message: FileMigrateAnnotation): unknown { - const obj: any = {}; - if (message.moveToPackage !== "") { - obj.moveToPackage = message.moveToPackage; - } - return obj; - }, - - create, I>>(base?: I): FileMigrateAnnotation { - return FileMigrateAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FileMigrateAnnotation { - const message = createBaseFileMigrateAnnotation(); - message.moveToPackage = object.moveToPackage ?? ""; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts new file mode 100644 index 00000000..0a6acd05 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts @@ -0,0 +1,38 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file udpa/annotations/migrate.proto (package udpa.annotations, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file udpa/annotations/migrate.proto. + */ +export const file_udpa_annotations_migrate: GenFile = /*@__PURE__*/ + fileDesc("Ch51ZHBhL2Fubm90YXRpb25zL21pZ3JhdGUucHJvdG8SEHVkcGEuYW5ub3RhdGlvbnMiMAoVRmlsZU1pZ3JhdGVBbm5vdGF0aW9uEhcKD21vdmVfdG9fcGFja2FnZRgCIAEoCUIpWidnaXRodWIuY29tL2NuY2YveGRzL2dvL3VkcGEvYW5ub3RhdGlvbnNiBnByb3RvMw"); + +/** + * @generated from message udpa.annotations.FileMigrateAnnotation + */ +export type FileMigrateAnnotation = Message<"udpa.annotations.FileMigrateAnnotation"> & { + /** + * Move all types in the file to another package, this implies changing proto + * file path. + * + * @generated from field: string move_to_package = 2; + */ + moveToPackage: string; +}; + +/** + * Describes the message udpa.annotations.FileMigrateAnnotation. + * Use `create(FileMigrateAnnotationSchema)` to create a new message. + */ +export const FileMigrateAnnotationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_udpa_annotations_migrate, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts deleted file mode 100644 index 0a273b51..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status.ts +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: udpa/annotations/status.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "udpa.annotations"; - -export enum PackageVersionStatus { - /** UNKNOWN - Unknown package version status. */ - UNKNOWN = 0, - /** FROZEN - This version of the package is frozen. */ - FROZEN = 1, - /** ACTIVE - This version of the package is the active development version. */ - ACTIVE = 2, - /** - * NEXT_MAJOR_VERSION_CANDIDATE - This version of the package is the candidate for the next major version. It - * is typically machine generated from the active development version. - */ - NEXT_MAJOR_VERSION_CANDIDATE = 3, - UNRECOGNIZED = -1, -} - -export function packageVersionStatusFromJSON(object: any): PackageVersionStatus { - switch (object) { - case 0: - case "UNKNOWN": - return PackageVersionStatus.UNKNOWN; - case 1: - case "FROZEN": - return PackageVersionStatus.FROZEN; - case 2: - case "ACTIVE": - return PackageVersionStatus.ACTIVE; - case 3: - case "NEXT_MAJOR_VERSION_CANDIDATE": - return PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE; - case -1: - case "UNRECOGNIZED": - default: - return PackageVersionStatus.UNRECOGNIZED; - } -} - -export function packageVersionStatusToJSON(object: PackageVersionStatus): string { - switch (object) { - case PackageVersionStatus.UNKNOWN: - return "UNKNOWN"; - case PackageVersionStatus.FROZEN: - return "FROZEN"; - case PackageVersionStatus.ACTIVE: - return "ACTIVE"; - case PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE: - return "NEXT_MAJOR_VERSION_CANDIDATE"; - case PackageVersionStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface StatusAnnotation { - /** The entity is work-in-progress and subject to breaking changes. */ - workInProgress: boolean; - /** The entity belongs to a package with the given version status. */ - packageVersionStatus: PackageVersionStatus; -} - -function createBaseStatusAnnotation(): StatusAnnotation { - return { workInProgress: false, packageVersionStatus: 0 }; -} - -export const StatusAnnotation: MessageFns = { - encode(message: StatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.workInProgress !== false) { - writer.uint32(8).bool(message.workInProgress); - } - if (message.packageVersionStatus !== 0) { - writer.uint32(16).int32(message.packageVersionStatus); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): StatusAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStatusAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.workInProgress = reader.bool(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.packageVersionStatus = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): StatusAnnotation { - return { - workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false, - packageVersionStatus: isSet(object.packageVersionStatus) - ? packageVersionStatusFromJSON(object.packageVersionStatus) - : 0, - }; - }, - - toJSON(message: StatusAnnotation): unknown { - const obj: any = {}; - if (message.workInProgress !== false) { - obj.workInProgress = message.workInProgress; - } - if (message.packageVersionStatus !== 0) { - obj.packageVersionStatus = packageVersionStatusToJSON(message.packageVersionStatus); - } - return obj; - }, - - create, I>>(base?: I): StatusAnnotation { - return StatusAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): StatusAnnotation { - const message = createBaseStatusAnnotation(); - message.workInProgress = object.workInProgress ?? false; - message.packageVersionStatus = object.packageVersionStatus ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts new file mode 100644 index 00000000..85771028 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts @@ -0,0 +1,84 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file udpa/annotations/status.proto (package udpa.annotations, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file udpa/annotations/status.proto. + */ +export const file_udpa_annotations_status: GenFile = /*@__PURE__*/ + fileDesc("Ch11ZHBhL2Fubm90YXRpb25zL3N0YXR1cy5wcm90bxIQdWRwYS5hbm5vdGF0aW9ucyJ0ChBTdGF0dXNBbm5vdGF0aW9uEhgKEHdvcmtfaW5fcHJvZ3Jlc3MYASABKAgSRgoWcGFja2FnZV92ZXJzaW9uX3N0YXR1cxgCIAEoDjImLnVkcGEuYW5ub3RhdGlvbnMuUGFja2FnZVZlcnNpb25TdGF0dXMqXQoUUGFja2FnZVZlcnNpb25TdGF0dXMSCwoHVU5LTk9XThAAEgoKBkZST1pFThABEgoKBkFDVElWRRACEiAKHE5FWFRfTUFKT1JfVkVSU0lPTl9DQU5ESURBVEUQA0IpWidnaXRodWIuY29tL2NuY2YveGRzL2dvL3VkcGEvYW5ub3RhdGlvbnNiBnByb3RvMw"); + +/** + * @generated from message udpa.annotations.StatusAnnotation + */ +export type StatusAnnotation = Message<"udpa.annotations.StatusAnnotation"> & { + /** + * The entity is work-in-progress and subject to breaking changes. + * + * @generated from field: bool work_in_progress = 1; + */ + workInProgress: boolean; + + /** + * The entity belongs to a package with the given version status. + * + * @generated from field: udpa.annotations.PackageVersionStatus package_version_status = 2; + */ + packageVersionStatus: PackageVersionStatus; +}; + +/** + * Describes the message udpa.annotations.StatusAnnotation. + * Use `create(StatusAnnotationSchema)` to create a new message. + */ +export const StatusAnnotationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_udpa_annotations_status, 0); + +/** + * @generated from enum udpa.annotations.PackageVersionStatus + */ +export enum PackageVersionStatus { + /** + * Unknown package version status. + * + * @generated from enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + + /** + * This version of the package is frozen. + * + * @generated from enum value: FROZEN = 1; + */ + FROZEN = 1, + + /** + * This version of the package is the active development version. + * + * @generated from enum value: ACTIVE = 2; + */ + ACTIVE = 2, + + /** + * This version of the package is the candidate for the next major version. It + * is typically machine generated from the active development version. + * + * @generated from enum value: NEXT_MAJOR_VERSION_CANDIDATE = 3; + */ + NEXT_MAJOR_VERSION_CANDIDATE = 3, +} + +/** + * Describes the enum udpa.annotations.PackageVersionStatus. + */ +export const PackageVersionStatusSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_udpa_annotations_status, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts deleted file mode 100644 index 1b057c72..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: udpa/annotations/versioning.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "udpa.annotations"; - -export interface VersioningAnnotation { - /** - * Track the previous message type. E.g. this message might be - * udpa.foo.v3alpha.Foo and it was previously udpa.bar.v2.Bar. This - * information is consumed by UDPA via proto descriptors. - */ - previousMessageType: string; -} - -function createBaseVersioningAnnotation(): VersioningAnnotation { - return { previousMessageType: "" }; -} - -export const VersioningAnnotation: MessageFns = { - encode(message: VersioningAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.previousMessageType !== "") { - writer.uint32(10).string(message.previousMessageType); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): VersioningAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVersioningAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.previousMessageType = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): VersioningAnnotation { - return { - previousMessageType: isSet(object.previousMessageType) ? globalThis.String(object.previousMessageType) : "", - }; - }, - - toJSON(message: VersioningAnnotation): unknown { - const obj: any = {}; - if (message.previousMessageType !== "") { - obj.previousMessageType = message.previousMessageType; - } - return obj; - }, - - create, I>>(base?: I): VersioningAnnotation { - return VersioningAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): VersioningAnnotation { - const message = createBaseVersioningAnnotation(); - message.previousMessageType = object.previousMessageType ?? ""; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts new file mode 100644 index 00000000..f33b3585 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts @@ -0,0 +1,39 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file udpa/annotations/versioning.proto (package udpa.annotations, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file udpa/annotations/versioning.proto. + */ +export const file_udpa_annotations_versioning: GenFile = /*@__PURE__*/ + fileDesc("CiF1ZHBhL2Fubm90YXRpb25zL3ZlcnNpb25pbmcucHJvdG8SEHVkcGEuYW5ub3RhdGlvbnMiNQoUVmVyc2lvbmluZ0Fubm90YXRpb24SHQoVcHJldmlvdXNfbWVzc2FnZV90eXBlGAEgASgJQilaJ2dpdGh1Yi5jb20vY25jZi94ZHMvZ28vdWRwYS9hbm5vdGF0aW9uc2IGcHJvdG8z"); + +/** + * @generated from message udpa.annotations.VersioningAnnotation + */ +export type VersioningAnnotation = Message<"udpa.annotations.VersioningAnnotation"> & { + /** + * Track the previous message type. E.g. this message might be + * udpa.foo.v3alpha.Foo and it was previously udpa.bar.v2.Bar. This + * information is consumed by UDPA via proto descriptors. + * + * @generated from field: string previous_message_type = 1; + */ + previousMessageType: string; +}; + +/** + * Describes the message udpa.annotations.VersioningAnnotation. + * Use `create(VersioningAnnotationSchema)` to create a new message. + */ +export const VersioningAnnotationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_udpa_annotations_versioning, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts b/packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts deleted file mode 100644 index 64d91d9e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/validate/validate.ts +++ /dev/null @@ -1,5869 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: validate/validate.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { Duration } from "../google/protobuf/duration.js"; -import { Timestamp } from "../google/protobuf/timestamp.js"; - -export const protobufPackage = "validate"; - -/** WellKnownRegex contain some well-known patterns. */ -export enum KnownRegex { - UNKNOWN = 0, - /** HTTP_HEADER_NAME - HTTP header name as defined by RFC 7230. */ - HTTP_HEADER_NAME = 1, - /** HTTP_HEADER_VALUE - HTTP header value as defined by RFC 7230. */ - HTTP_HEADER_VALUE = 2, - UNRECOGNIZED = -1, -} - -export function knownRegexFromJSON(object: any): KnownRegex { - switch (object) { - case 0: - case "UNKNOWN": - return KnownRegex.UNKNOWN; - case 1: - case "HTTP_HEADER_NAME": - return KnownRegex.HTTP_HEADER_NAME; - case 2: - case "HTTP_HEADER_VALUE": - return KnownRegex.HTTP_HEADER_VALUE; - case -1: - case "UNRECOGNIZED": - default: - return KnownRegex.UNRECOGNIZED; - } -} - -export function knownRegexToJSON(object: KnownRegex): string { - switch (object) { - case KnownRegex.UNKNOWN: - return "UNKNOWN"; - case KnownRegex.HTTP_HEADER_NAME: - return "HTTP_HEADER_NAME"; - case KnownRegex.HTTP_HEADER_VALUE: - return "HTTP_HEADER_VALUE"; - case KnownRegex.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * FieldRules encapsulates the rules for each type of field. Depending on the - * field, the correct set should be used to ensure proper validations. - */ -export interface FieldRules { - message?: - | MessageRules - | undefined; - /** Scalar Field Types */ - float?: FloatRules | undefined; - double?: DoubleRules | undefined; - int32?: Int32Rules | undefined; - int64?: Int64Rules | undefined; - uint32?: UInt32Rules | undefined; - uint64?: UInt64Rules | undefined; - sint32?: SInt32Rules | undefined; - sint64?: SInt64Rules | undefined; - fixed32?: Fixed32Rules | undefined; - fixed64?: Fixed64Rules | undefined; - sfixed32?: SFixed32Rules | undefined; - sfixed64?: SFixed64Rules | undefined; - bool?: BoolRules | undefined; - string?: StringRules | undefined; - bytes?: - | BytesRules - | undefined; - /** Complex Field Types */ - enum?: EnumRules | undefined; - repeated?: RepeatedRules | undefined; - map?: - | MapRules - | undefined; - /** Well-Known Field Types */ - any?: AnyRules | undefined; - duration?: DurationRules | undefined; - timestamp?: TimestampRules | undefined; -} - -/** FloatRules describes the constraints applied to `float` values */ -export interface FloatRules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** DoubleRules describes the constraints applied to `double` values */ -export interface DoubleRules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** Int32Rules describes the constraints applied to `int32` values */ -export interface Int32Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** Int64Rules describes the constraints applied to `int64` values */ -export interface Int64Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | string - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | string - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | string - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | string - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | string - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: string[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: string[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** UInt32Rules describes the constraints applied to `uint32` values */ -export interface UInt32Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** UInt64Rules describes the constraints applied to `uint64` values */ -export interface UInt64Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | string - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | string - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | string - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | string - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | string - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: string[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: string[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** SInt32Rules describes the constraints applied to `sint32` values */ -export interface SInt32Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** SInt64Rules describes the constraints applied to `sint64` values */ -export interface SInt64Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | string - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | string - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | string - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | string - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | string - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: string[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: string[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** Fixed32Rules describes the constraints applied to `fixed32` values */ -export interface Fixed32Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** Fixed64Rules describes the constraints applied to `fixed64` values */ -export interface Fixed64Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | string - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | string - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | string - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | string - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | string - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: string[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: string[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** SFixed32Rules describes the constraints applied to `sfixed32` values */ -export interface SFixed32Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | number - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | number - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | number - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | number - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** SFixed64Rules describes the constraints applied to `sfixed64` values */ -export interface SFixed64Rules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | string - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | string - | undefined; - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - */ - lte?: - | string - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - */ - gt?: - | string - | undefined; - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - */ - gte?: - | string - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: string[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: string[]; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** BoolRules describes the constraints applied to `bool` values */ -export interface BoolRules { - /** Const specifies that this field must be exactly the specified value */ - const?: boolean | undefined; -} - -/** StringRules describe the constraints applied to `string` values */ -export interface StringRules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | string - | undefined; - /** - * Len specifies that this field must be the specified number of - * characters (Unicode code points). Note that the number of - * characters may differ from the number of bytes in the string. - */ - len?: - | string - | undefined; - /** - * MinLen specifies that this field must be the specified number of - * characters (Unicode code points) at a minimum. Note that the number of - * characters may differ from the number of bytes in the string. - */ - minLen?: - | string - | undefined; - /** - * MaxLen specifies that this field must be the specified number of - * characters (Unicode code points) at a maximum. Note that the number of - * characters may differ from the number of bytes in the string. - */ - maxLen?: - | string - | undefined; - /** LenBytes specifies that this field must be the specified number of bytes */ - lenBytes?: - | string - | undefined; - /** - * MinBytes specifies that this field must be the specified number of bytes - * at a minimum - */ - minBytes?: - | string - | undefined; - /** - * MaxBytes specifies that this field must be the specified number of bytes - * at a maximum - */ - maxBytes?: - | string - | undefined; - /** - * Pattern specifies that this field must match against the specified - * regular expression (RE2 syntax). The included expression should elide - * any delimiters. - */ - pattern?: - | string - | undefined; - /** - * Prefix specifies that this field must have the specified substring at - * the beginning of the string. - */ - prefix?: - | string - | undefined; - /** - * Suffix specifies that this field must have the specified substring at - * the end of the string. - */ - suffix?: - | string - | undefined; - /** - * Contains specifies that this field must have the specified substring - * anywhere in the string. - */ - contains?: - | string - | undefined; - /** - * NotContains specifies that this field cannot have the specified substring - * anywhere in the string. - */ - notContains?: - | string - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: string[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: string[]; - /** - * Email specifies that the field must be a valid email address as - * defined by RFC 5322 - */ - email?: - | boolean - | undefined; - /** - * Hostname specifies that the field must be a valid hostname as - * defined by RFC 1034. This constraint does not support - * internationalized domain names (IDNs). - */ - hostname?: - | boolean - | undefined; - /** - * Ip specifies that the field must be a valid IP (v4 or v6) address. - * Valid IPv6 addresses should not include surrounding square brackets. - */ - ip?: - | boolean - | undefined; - /** Ipv4 specifies that the field must be a valid IPv4 address. */ - ipv4?: - | boolean - | undefined; - /** - * Ipv6 specifies that the field must be a valid IPv6 address. Valid - * IPv6 addresses should not include surrounding square brackets. - */ - ipv6?: - | boolean - | undefined; - /** - * Uri specifies that the field must be a valid, absolute URI as defined - * by RFC 3986 - */ - uri?: - | boolean - | undefined; - /** - * UriRef specifies that the field must be a valid URI as defined by RFC - * 3986 and may be relative or absolute. - */ - uriRef?: - | boolean - | undefined; - /** - * Address specifies that the field must be either a valid hostname as - * defined by RFC 1034 (which does not support internationalized domain - * names or IDNs), or it can be a valid IP (v4 or v6). - */ - address?: - | boolean - | undefined; - /** - * Uuid specifies that the field must be a valid UUID as defined by - * RFC 4122 - */ - uuid?: - | boolean - | undefined; - /** WellKnownRegex specifies a common well known pattern defined as a regex. */ - wellKnownRegex?: - | KnownRegex - | undefined; - /** - * This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - * strict header validation. - * By default, this is true, and HTTP header validations are RFC-compliant. - * Setting to false will enable a looser validations that only disallows - * \r\n\0 characters, which can be used to bypass header matching rules. - */ - strict?: - | boolean - | undefined; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** BytesRules describe the constraints applied to `bytes` values */ -export interface BytesRules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | Uint8Array - | undefined; - /** Len specifies that this field must be the specified number of bytes */ - len?: - | string - | undefined; - /** - * MinLen specifies that this field must be the specified number of bytes - * at a minimum - */ - minLen?: - | string - | undefined; - /** - * MaxLen specifies that this field must be the specified number of bytes - * at a maximum - */ - maxLen?: - | string - | undefined; - /** - * Pattern specifies that this field must match against the specified - * regular expression (RE2 syntax). The included expression should elide - * any delimiters. - */ - pattern?: - | string - | undefined; - /** - * Prefix specifies that this field must have the specified bytes at the - * beginning of the string. - */ - prefix?: - | Uint8Array - | undefined; - /** - * Suffix specifies that this field must have the specified bytes at the - * end of the string. - */ - suffix?: - | Uint8Array - | undefined; - /** - * Contains specifies that this field must have the specified bytes - * anywhere in the string. - */ - contains?: - | Uint8Array - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: Uint8Array[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: Uint8Array[]; - /** - * Ip specifies that the field must be a valid IP (v4 or v6) address in - * byte format - */ - ip?: - | boolean - | undefined; - /** - * Ipv4 specifies that the field must be a valid IPv4 address in byte - * format - */ - ipv4?: - | boolean - | undefined; - /** - * Ipv6 specifies that the field must be a valid IPv6 address in byte - * format - */ - ipv6?: - | boolean - | undefined; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** EnumRules describe the constraints applied to enum values */ -export interface EnumRules { - /** Const specifies that this field must be exactly the specified value */ - const?: - | number - | undefined; - /** - * DefinedOnly specifies that this field must be only one of the defined - * values for this enum, failing on any undefined value. - */ - definedOnly?: - | boolean - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: number[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: number[]; -} - -/** - * MessageRules describe the constraints applied to embedded message values. - * For message-type fields, validation is performed recursively. - */ -export interface MessageRules { - /** - * Skip specifies that the validation rules of this field should not be - * evaluated - */ - skip?: - | boolean - | undefined; - /** Required specifies that this field must be set */ - required?: boolean | undefined; -} - -/** RepeatedRules describe the constraints applied to `repeated` values */ -export interface RepeatedRules { - /** - * MinItems specifies that this field must have the specified number of - * items at a minimum - */ - minItems?: - | string - | undefined; - /** - * MaxItems specifies that this field must have the specified number of - * items at a maximum - */ - maxItems?: - | string - | undefined; - /** - * Unique specifies that all elements in this field must be unique. This - * constraint is only applicable to scalar and enum types (messages are not - * supported). - */ - unique?: - | boolean - | undefined; - /** - * Items specifies the constraints to be applied to each item in the field. - * Repeated message fields will still execute validation against each item - * unless skip is specified here. - */ - items?: - | FieldRules - | undefined; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** MapRules describe the constraints applied to `map` values */ -export interface MapRules { - /** - * MinPairs specifies that this field must have the specified number of - * KVs at a minimum - */ - minPairs?: - | string - | undefined; - /** - * MaxPairs specifies that this field must have the specified number of - * KVs at a maximum - */ - maxPairs?: - | string - | undefined; - /** - * NoSparse specifies values in this field cannot be unset. This only - * applies to map's with message value types. - */ - noSparse?: - | boolean - | undefined; - /** Keys specifies the constraints to be applied to each key in the field. */ - keys?: - | FieldRules - | undefined; - /** - * Values specifies the constraints to be applied to the value of each key - * in the field. Message values will still have their validations evaluated - * unless skip is specified here. - */ - values?: - | FieldRules - | undefined; - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - */ - ignoreEmpty?: boolean | undefined; -} - -/** - * AnyRules describe constraints applied exclusively to the - * `google.protobuf.Any` well-known type - */ -export interface AnyRules { - /** Required specifies that this field must be set */ - required?: - | boolean - | undefined; - /** - * In specifies that this field's `type_url` must be equal to one of the - * specified values. - */ - in: string[]; - /** - * NotIn specifies that this field's `type_url` must not be equal to any of - * the specified values. - */ - notIn: string[]; -} - -/** - * DurationRules describe the constraints applied exclusively to the - * `google.protobuf.Duration` well-known type - */ -export interface DurationRules { - /** Required specifies that this field must be set */ - required?: - | boolean - | undefined; - /** Const specifies that this field must be exactly the specified value */ - const?: - | Duration - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | Duration - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * inclusive - */ - lte?: - | Duration - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive - */ - gt?: - | Duration - | undefined; - /** - * Gte specifies that this field must be greater than the specified value, - * inclusive - */ - gte?: - | Duration - | undefined; - /** - * In specifies that this field must be equal to one of the specified - * values - */ - in: Duration[]; - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - */ - notIn: Duration[]; -} - -/** - * TimestampRules describe the constraints applied exclusively to the - * `google.protobuf.Timestamp` well-known type - */ -export interface TimestampRules { - /** Required specifies that this field must be set */ - required?: - | boolean - | undefined; - /** Const specifies that this field must be exactly the specified value */ - const?: - | Date - | undefined; - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - */ - lt?: - | Date - | undefined; - /** - * Lte specifies that this field must be less than the specified value, - * inclusive - */ - lte?: - | Date - | undefined; - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive - */ - gt?: - | Date - | undefined; - /** - * Gte specifies that this field must be greater than the specified value, - * inclusive - */ - gte?: - | Date - | undefined; - /** - * LtNow specifies that this must be less than the current time. LtNow - * can only be used with the Within rule. - */ - ltNow?: - | boolean - | undefined; - /** - * GtNow specifies that this must be greater than the current time. GtNow - * can only be used with the Within rule. - */ - gtNow?: - | boolean - | undefined; - /** - * Within specifies that this field must be within this duration of the - * current time. This constraint can be used alone or with the LtNow and - * GtNow rules. - */ - within?: Duration | undefined; -} - -function createBaseFieldRules(): FieldRules { - return { - message: undefined, - float: undefined, - double: undefined, - int32: undefined, - int64: undefined, - uint32: undefined, - uint64: undefined, - sint32: undefined, - sint64: undefined, - fixed32: undefined, - fixed64: undefined, - sfixed32: undefined, - sfixed64: undefined, - bool: undefined, - string: undefined, - bytes: undefined, - enum: undefined, - repeated: undefined, - map: undefined, - any: undefined, - duration: undefined, - timestamp: undefined, - }; -} - -export const FieldRules: MessageFns = { - encode(message: FieldRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.message !== undefined) { - MessageRules.encode(message.message, writer.uint32(138).fork()).join(); - } - if (message.float !== undefined) { - FloatRules.encode(message.float, writer.uint32(10).fork()).join(); - } - if (message.double !== undefined) { - DoubleRules.encode(message.double, writer.uint32(18).fork()).join(); - } - if (message.int32 !== undefined) { - Int32Rules.encode(message.int32, writer.uint32(26).fork()).join(); - } - if (message.int64 !== undefined) { - Int64Rules.encode(message.int64, writer.uint32(34).fork()).join(); - } - if (message.uint32 !== undefined) { - UInt32Rules.encode(message.uint32, writer.uint32(42).fork()).join(); - } - if (message.uint64 !== undefined) { - UInt64Rules.encode(message.uint64, writer.uint32(50).fork()).join(); - } - if (message.sint32 !== undefined) { - SInt32Rules.encode(message.sint32, writer.uint32(58).fork()).join(); - } - if (message.sint64 !== undefined) { - SInt64Rules.encode(message.sint64, writer.uint32(66).fork()).join(); - } - if (message.fixed32 !== undefined) { - Fixed32Rules.encode(message.fixed32, writer.uint32(74).fork()).join(); - } - if (message.fixed64 !== undefined) { - Fixed64Rules.encode(message.fixed64, writer.uint32(82).fork()).join(); - } - if (message.sfixed32 !== undefined) { - SFixed32Rules.encode(message.sfixed32, writer.uint32(90).fork()).join(); - } - if (message.sfixed64 !== undefined) { - SFixed64Rules.encode(message.sfixed64, writer.uint32(98).fork()).join(); - } - if (message.bool !== undefined) { - BoolRules.encode(message.bool, writer.uint32(106).fork()).join(); - } - if (message.string !== undefined) { - StringRules.encode(message.string, writer.uint32(114).fork()).join(); - } - if (message.bytes !== undefined) { - BytesRules.encode(message.bytes, writer.uint32(122).fork()).join(); - } - if (message.enum !== undefined) { - EnumRules.encode(message.enum, writer.uint32(130).fork()).join(); - } - if (message.repeated !== undefined) { - RepeatedRules.encode(message.repeated, writer.uint32(146).fork()).join(); - } - if (message.map !== undefined) { - MapRules.encode(message.map, writer.uint32(154).fork()).join(); - } - if (message.any !== undefined) { - AnyRules.encode(message.any, writer.uint32(162).fork()).join(); - } - if (message.duration !== undefined) { - DurationRules.encode(message.duration, writer.uint32(170).fork()).join(); - } - if (message.timestamp !== undefined) { - TimestampRules.encode(message.timestamp, writer.uint32(178).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 17: { - if (tag !== 138) { - break; - } - - message.message = MessageRules.decode(reader, reader.uint32()); - continue; - } - case 1: { - if (tag !== 10) { - break; - } - - message.float = FloatRules.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.double = DoubleRules.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.int32 = Int32Rules.decode(reader, reader.uint32()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.int64 = Int64Rules.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.uint32 = UInt32Rules.decode(reader, reader.uint32()); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.uint64 = UInt64Rules.decode(reader, reader.uint32()); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.sint32 = SInt32Rules.decode(reader, reader.uint32()); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.sint64 = SInt64Rules.decode(reader, reader.uint32()); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.fixed32 = Fixed32Rules.decode(reader, reader.uint32()); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.fixed64 = Fixed64Rules.decode(reader, reader.uint32()); - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.sfixed32 = SFixed32Rules.decode(reader, reader.uint32()); - continue; - } - case 12: { - if (tag !== 98) { - break; - } - - message.sfixed64 = SFixed64Rules.decode(reader, reader.uint32()); - continue; - } - case 13: { - if (tag !== 106) { - break; - } - - message.bool = BoolRules.decode(reader, reader.uint32()); - continue; - } - case 14: { - if (tag !== 114) { - break; - } - - message.string = StringRules.decode(reader, reader.uint32()); - continue; - } - case 15: { - if (tag !== 122) { - break; - } - - message.bytes = BytesRules.decode(reader, reader.uint32()); - continue; - } - case 16: { - if (tag !== 130) { - break; - } - - message.enum = EnumRules.decode(reader, reader.uint32()); - continue; - } - case 18: { - if (tag !== 146) { - break; - } - - message.repeated = RepeatedRules.decode(reader, reader.uint32()); - continue; - } - case 19: { - if (tag !== 154) { - break; - } - - message.map = MapRules.decode(reader, reader.uint32()); - continue; - } - case 20: { - if (tag !== 162) { - break; - } - - message.any = AnyRules.decode(reader, reader.uint32()); - continue; - } - case 21: { - if (tag !== 170) { - break; - } - - message.duration = DurationRules.decode(reader, reader.uint32()); - continue; - } - case 22: { - if (tag !== 178) { - break; - } - - message.timestamp = TimestampRules.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldRules { - return { - message: isSet(object.message) ? MessageRules.fromJSON(object.message) : undefined, - float: isSet(object.float) ? FloatRules.fromJSON(object.float) : undefined, - double: isSet(object.double) ? DoubleRules.fromJSON(object.double) : undefined, - int32: isSet(object.int32) ? Int32Rules.fromJSON(object.int32) : undefined, - int64: isSet(object.int64) ? Int64Rules.fromJSON(object.int64) : undefined, - uint32: isSet(object.uint32) ? UInt32Rules.fromJSON(object.uint32) : undefined, - uint64: isSet(object.uint64) ? UInt64Rules.fromJSON(object.uint64) : undefined, - sint32: isSet(object.sint32) ? SInt32Rules.fromJSON(object.sint32) : undefined, - sint64: isSet(object.sint64) ? SInt64Rules.fromJSON(object.sint64) : undefined, - fixed32: isSet(object.fixed32) ? Fixed32Rules.fromJSON(object.fixed32) : undefined, - fixed64: isSet(object.fixed64) ? Fixed64Rules.fromJSON(object.fixed64) : undefined, - sfixed32: isSet(object.sfixed32) ? SFixed32Rules.fromJSON(object.sfixed32) : undefined, - sfixed64: isSet(object.sfixed64) ? SFixed64Rules.fromJSON(object.sfixed64) : undefined, - bool: isSet(object.bool) ? BoolRules.fromJSON(object.bool) : undefined, - string: isSet(object.string) ? StringRules.fromJSON(object.string) : undefined, - bytes: isSet(object.bytes) ? BytesRules.fromJSON(object.bytes) : undefined, - enum: isSet(object.enum) ? EnumRules.fromJSON(object.enum) : undefined, - repeated: isSet(object.repeated) ? RepeatedRules.fromJSON(object.repeated) : undefined, - map: isSet(object.map) ? MapRules.fromJSON(object.map) : undefined, - any: isSet(object.any) ? AnyRules.fromJSON(object.any) : undefined, - duration: isSet(object.duration) ? DurationRules.fromJSON(object.duration) : undefined, - timestamp: isSet(object.timestamp) ? TimestampRules.fromJSON(object.timestamp) : undefined, - }; - }, - - toJSON(message: FieldRules): unknown { - const obj: any = {}; - if (message.message !== undefined) { - obj.message = MessageRules.toJSON(message.message); - } - if (message.float !== undefined) { - obj.float = FloatRules.toJSON(message.float); - } - if (message.double !== undefined) { - obj.double = DoubleRules.toJSON(message.double); - } - if (message.int32 !== undefined) { - obj.int32 = Int32Rules.toJSON(message.int32); - } - if (message.int64 !== undefined) { - obj.int64 = Int64Rules.toJSON(message.int64); - } - if (message.uint32 !== undefined) { - obj.uint32 = UInt32Rules.toJSON(message.uint32); - } - if (message.uint64 !== undefined) { - obj.uint64 = UInt64Rules.toJSON(message.uint64); - } - if (message.sint32 !== undefined) { - obj.sint32 = SInt32Rules.toJSON(message.sint32); - } - if (message.sint64 !== undefined) { - obj.sint64 = SInt64Rules.toJSON(message.sint64); - } - if (message.fixed32 !== undefined) { - obj.fixed32 = Fixed32Rules.toJSON(message.fixed32); - } - if (message.fixed64 !== undefined) { - obj.fixed64 = Fixed64Rules.toJSON(message.fixed64); - } - if (message.sfixed32 !== undefined) { - obj.sfixed32 = SFixed32Rules.toJSON(message.sfixed32); - } - if (message.sfixed64 !== undefined) { - obj.sfixed64 = SFixed64Rules.toJSON(message.sfixed64); - } - if (message.bool !== undefined) { - obj.bool = BoolRules.toJSON(message.bool); - } - if (message.string !== undefined) { - obj.string = StringRules.toJSON(message.string); - } - if (message.bytes !== undefined) { - obj.bytes = BytesRules.toJSON(message.bytes); - } - if (message.enum !== undefined) { - obj.enum = EnumRules.toJSON(message.enum); - } - if (message.repeated !== undefined) { - obj.repeated = RepeatedRules.toJSON(message.repeated); - } - if (message.map !== undefined) { - obj.map = MapRules.toJSON(message.map); - } - if (message.any !== undefined) { - obj.any = AnyRules.toJSON(message.any); - } - if (message.duration !== undefined) { - obj.duration = DurationRules.toJSON(message.duration); - } - if (message.timestamp !== undefined) { - obj.timestamp = TimestampRules.toJSON(message.timestamp); - } - return obj; - }, - - create, I>>(base?: I): FieldRules { - return FieldRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldRules { - const message = createBaseFieldRules(); - message.message = (object.message !== undefined && object.message !== null) - ? MessageRules.fromPartial(object.message) - : undefined; - message.float = (object.float !== undefined && object.float !== null) - ? FloatRules.fromPartial(object.float) - : undefined; - message.double = (object.double !== undefined && object.double !== null) - ? DoubleRules.fromPartial(object.double) - : undefined; - message.int32 = (object.int32 !== undefined && object.int32 !== null) - ? Int32Rules.fromPartial(object.int32) - : undefined; - message.int64 = (object.int64 !== undefined && object.int64 !== null) - ? Int64Rules.fromPartial(object.int64) - : undefined; - message.uint32 = (object.uint32 !== undefined && object.uint32 !== null) - ? UInt32Rules.fromPartial(object.uint32) - : undefined; - message.uint64 = (object.uint64 !== undefined && object.uint64 !== null) - ? UInt64Rules.fromPartial(object.uint64) - : undefined; - message.sint32 = (object.sint32 !== undefined && object.sint32 !== null) - ? SInt32Rules.fromPartial(object.sint32) - : undefined; - message.sint64 = (object.sint64 !== undefined && object.sint64 !== null) - ? SInt64Rules.fromPartial(object.sint64) - : undefined; - message.fixed32 = (object.fixed32 !== undefined && object.fixed32 !== null) - ? Fixed32Rules.fromPartial(object.fixed32) - : undefined; - message.fixed64 = (object.fixed64 !== undefined && object.fixed64 !== null) - ? Fixed64Rules.fromPartial(object.fixed64) - : undefined; - message.sfixed32 = (object.sfixed32 !== undefined && object.sfixed32 !== null) - ? SFixed32Rules.fromPartial(object.sfixed32) - : undefined; - message.sfixed64 = (object.sfixed64 !== undefined && object.sfixed64 !== null) - ? SFixed64Rules.fromPartial(object.sfixed64) - : undefined; - message.bool = (object.bool !== undefined && object.bool !== null) ? BoolRules.fromPartial(object.bool) : undefined; - message.string = (object.string !== undefined && object.string !== null) - ? StringRules.fromPartial(object.string) - : undefined; - message.bytes = (object.bytes !== undefined && object.bytes !== null) - ? BytesRules.fromPartial(object.bytes) - : undefined; - message.enum = (object.enum !== undefined && object.enum !== null) ? EnumRules.fromPartial(object.enum) : undefined; - message.repeated = (object.repeated !== undefined && object.repeated !== null) - ? RepeatedRules.fromPartial(object.repeated) - : undefined; - message.map = (object.map !== undefined && object.map !== null) ? MapRules.fromPartial(object.map) : undefined; - message.any = (object.any !== undefined && object.any !== null) ? AnyRules.fromPartial(object.any) : undefined; - message.duration = (object.duration !== undefined && object.duration !== null) - ? DurationRules.fromPartial(object.duration) - : undefined; - message.timestamp = (object.timestamp !== undefined && object.timestamp !== null) - ? TimestampRules.fromPartial(object.timestamp) - : undefined; - return message; - }, -}; - -function createBaseFloatRules(): FloatRules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const FloatRules: MessageFns = { - encode(message: FloatRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(13).float(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(21).float(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(29).float(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(37).float(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(45).float(message.gte); - } - for (const v of message.in) { - writer.uint32(53).float(v!); - } - for (const v of message.notIn) { - writer.uint32(61).float(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FloatRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFloatRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 13) { - break; - } - - message.const = reader.float(); - continue; - } - case 2: { - if (tag !== 21) { - break; - } - - message.lt = reader.float(); - continue; - } - case 3: { - if (tag !== 29) { - break; - } - - message.lte = reader.float(); - continue; - } - case 4: { - if (tag !== 37) { - break; - } - - message.gt = reader.float(); - continue; - } - case 5: { - if (tag !== 45) { - break; - } - - message.gte = reader.float(); - continue; - } - case 6: { - if (tag === 53) { - message.in.push(reader.float()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.float()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 61) { - message.notIn.push(reader.float()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.float()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FloatRules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: FloatRules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): FloatRules { - return FloatRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FloatRules { - const message = createBaseFloatRules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseDoubleRules(): DoubleRules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const DoubleRules: MessageFns = { - encode(message: DoubleRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(9).double(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(17).double(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(25).double(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(33).double(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(41).double(message.gte); - } - for (const v of message.in) { - writer.uint32(49).double(v!); - } - for (const v of message.notIn) { - writer.uint32(57).double(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DoubleRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDoubleRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 9) { - break; - } - - message.const = reader.double(); - continue; - } - case 2: { - if (tag !== 17) { - break; - } - - message.lt = reader.double(); - continue; - } - case 3: { - if (tag !== 25) { - break; - } - - message.lte = reader.double(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.gt = reader.double(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } - - message.gte = reader.double(); - continue; - } - case 6: { - if (tag === 49) { - message.in.push(reader.double()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.double()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 57) { - message.notIn.push(reader.double()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.double()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DoubleRules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: DoubleRules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): DoubleRules { - return DoubleRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): DoubleRules { - const message = createBaseDoubleRules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseInt32Rules(): Int32Rules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const Int32Rules: MessageFns = { - encode(message: Int32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(8).int32(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(16).int32(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(24).int32(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(32).int32(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(40).int32(message.gte); - } - for (const v of message.in) { - writer.uint32(48).int32(v!); - } - for (const v of message.notIn) { - writer.uint32(56).int32(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Int32Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInt32Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.int32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.lt = reader.int32(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.lte = reader.int32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.gt = reader.int32(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.gte = reader.int32(); - continue; - } - case 6: { - if (tag === 48) { - message.in.push(reader.int32()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.int32()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 56) { - message.notIn.push(reader.int32()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.int32()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Int32Rules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: Int32Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = Math.round(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = Math.round(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = Math.round(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = Math.round(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = Math.round(message.gte); - } - if (message.in?.length) { - obj.in = message.in.map((e) => Math.round(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Math.round(e)); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): Int32Rules { - return Int32Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Int32Rules { - const message = createBaseInt32Rules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseInt64Rules(): Int64Rules { - return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; -} - -export const Int64Rules: MessageFns = { - encode(message: Int64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== "0") { - writer.uint32(8).int64(message.const); - } - if (message.lt !== undefined && message.lt !== "0") { - writer.uint32(16).int64(message.lt); - } - if (message.lte !== undefined && message.lte !== "0") { - writer.uint32(24).int64(message.lte); - } - if (message.gt !== undefined && message.gt !== "0") { - writer.uint32(32).int64(message.gt); - } - if (message.gte !== undefined && message.gte !== "0") { - writer.uint32(40).int64(message.gte); - } - for (const v of message.in) { - writer.uint32(48).int64(v!); - } - for (const v of message.notIn) { - writer.uint32(56).int64(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Int64Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInt64Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.int64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.lt = reader.int64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.lte = reader.int64().toString(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.gt = reader.int64().toString(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.gte = reader.int64().toString(); - continue; - } - case 6: { - if (tag === 48) { - message.in.push(reader.int64().toString()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.int64().toString()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 56) { - message.notIn.push(reader.int64().toString()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.int64().toString()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Int64Rules { - return { - const: isSet(object.const) ? globalThis.String(object.const) : "0", - lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", - lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", - gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", - gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: Int64Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== "0") { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== "0") { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== "0") { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== "0") { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== "0") { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): Int64Rules { - return Int64Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Int64Rules { - const message = createBaseInt64Rules(); - message.const = object.const ?? "0"; - message.lt = object.lt ?? "0"; - message.lte = object.lte ?? "0"; - message.gt = object.gt ?? "0"; - message.gte = object.gte ?? "0"; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseUInt32Rules(): UInt32Rules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const UInt32Rules: MessageFns = { - encode(message: UInt32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(8).uint32(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(16).uint32(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(24).uint32(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(32).uint32(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(40).uint32(message.gte); - } - for (const v of message.in) { - writer.uint32(48).uint32(v!); - } - for (const v of message.notIn) { - writer.uint32(56).uint32(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UInt32Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUInt32Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.uint32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.lt = reader.uint32(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.lte = reader.uint32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.gt = reader.uint32(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.gte = reader.uint32(); - continue; - } - case 6: { - if (tag === 48) { - message.in.push(reader.uint32()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.uint32()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 56) { - message.notIn.push(reader.uint32()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.uint32()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UInt32Rules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: UInt32Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = Math.round(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = Math.round(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = Math.round(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = Math.round(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = Math.round(message.gte); - } - if (message.in?.length) { - obj.in = message.in.map((e) => Math.round(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Math.round(e)); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): UInt32Rules { - return UInt32Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UInt32Rules { - const message = createBaseUInt32Rules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseUInt64Rules(): UInt64Rules { - return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; -} - -export const UInt64Rules: MessageFns = { - encode(message: UInt64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== "0") { - writer.uint32(8).uint64(message.const); - } - if (message.lt !== undefined && message.lt !== "0") { - writer.uint32(16).uint64(message.lt); - } - if (message.lte !== undefined && message.lte !== "0") { - writer.uint32(24).uint64(message.lte); - } - if (message.gt !== undefined && message.gt !== "0") { - writer.uint32(32).uint64(message.gt); - } - if (message.gte !== undefined && message.gte !== "0") { - writer.uint32(40).uint64(message.gte); - } - for (const v of message.in) { - writer.uint32(48).uint64(v!); - } - for (const v of message.notIn) { - writer.uint32(56).uint64(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UInt64Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUInt64Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.uint64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.lt = reader.uint64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.lte = reader.uint64().toString(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.gt = reader.uint64().toString(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.gte = reader.uint64().toString(); - continue; - } - case 6: { - if (tag === 48) { - message.in.push(reader.uint64().toString()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.uint64().toString()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 56) { - message.notIn.push(reader.uint64().toString()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.uint64().toString()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UInt64Rules { - return { - const: isSet(object.const) ? globalThis.String(object.const) : "0", - lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", - lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", - gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", - gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: UInt64Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== "0") { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== "0") { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== "0") { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== "0") { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== "0") { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): UInt64Rules { - return UInt64Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UInt64Rules { - const message = createBaseUInt64Rules(); - message.const = object.const ?? "0"; - message.lt = object.lt ?? "0"; - message.lte = object.lte ?? "0"; - message.gt = object.gt ?? "0"; - message.gte = object.gte ?? "0"; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseSInt32Rules(): SInt32Rules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const SInt32Rules: MessageFns = { - encode(message: SInt32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(8).sint32(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(16).sint32(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(24).sint32(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(32).sint32(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(40).sint32(message.gte); - } - for (const v of message.in) { - writer.uint32(48).sint32(v!); - } - for (const v of message.notIn) { - writer.uint32(56).sint32(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SInt32Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSInt32Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.sint32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.lt = reader.sint32(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.lte = reader.sint32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.gt = reader.sint32(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.gte = reader.sint32(); - continue; - } - case 6: { - if (tag === 48) { - message.in.push(reader.sint32()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.sint32()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 56) { - message.notIn.push(reader.sint32()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.sint32()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SInt32Rules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: SInt32Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = Math.round(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = Math.round(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = Math.round(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = Math.round(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = Math.round(message.gte); - } - if (message.in?.length) { - obj.in = message.in.map((e) => Math.round(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Math.round(e)); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): SInt32Rules { - return SInt32Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SInt32Rules { - const message = createBaseSInt32Rules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseSInt64Rules(): SInt64Rules { - return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; -} - -export const SInt64Rules: MessageFns = { - encode(message: SInt64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== "0") { - writer.uint32(8).sint64(message.const); - } - if (message.lt !== undefined && message.lt !== "0") { - writer.uint32(16).sint64(message.lt); - } - if (message.lte !== undefined && message.lte !== "0") { - writer.uint32(24).sint64(message.lte); - } - if (message.gt !== undefined && message.gt !== "0") { - writer.uint32(32).sint64(message.gt); - } - if (message.gte !== undefined && message.gte !== "0") { - writer.uint32(40).sint64(message.gte); - } - for (const v of message.in) { - writer.uint32(48).sint64(v!); - } - for (const v of message.notIn) { - writer.uint32(56).sint64(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SInt64Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSInt64Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.sint64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.lt = reader.sint64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.lte = reader.sint64().toString(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.gt = reader.sint64().toString(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.gte = reader.sint64().toString(); - continue; - } - case 6: { - if (tag === 48) { - message.in.push(reader.sint64().toString()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.sint64().toString()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 56) { - message.notIn.push(reader.sint64().toString()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.sint64().toString()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SInt64Rules { - return { - const: isSet(object.const) ? globalThis.String(object.const) : "0", - lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", - lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", - gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", - gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: SInt64Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== "0") { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== "0") { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== "0") { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== "0") { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== "0") { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): SInt64Rules { - return SInt64Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SInt64Rules { - const message = createBaseSInt64Rules(); - message.const = object.const ?? "0"; - message.lt = object.lt ?? "0"; - message.lte = object.lte ?? "0"; - message.gt = object.gt ?? "0"; - message.gte = object.gte ?? "0"; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseFixed32Rules(): Fixed32Rules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const Fixed32Rules: MessageFns = { - encode(message: Fixed32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(13).fixed32(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(21).fixed32(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(29).fixed32(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(37).fixed32(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(45).fixed32(message.gte); - } - for (const v of message.in) { - writer.uint32(53).fixed32(v!); - } - for (const v of message.notIn) { - writer.uint32(61).fixed32(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Fixed32Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFixed32Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 13) { - break; - } - - message.const = reader.fixed32(); - continue; - } - case 2: { - if (tag !== 21) { - break; - } - - message.lt = reader.fixed32(); - continue; - } - case 3: { - if (tag !== 29) { - break; - } - - message.lte = reader.fixed32(); - continue; - } - case 4: { - if (tag !== 37) { - break; - } - - message.gt = reader.fixed32(); - continue; - } - case 5: { - if (tag !== 45) { - break; - } - - message.gte = reader.fixed32(); - continue; - } - case 6: { - if (tag === 53) { - message.in.push(reader.fixed32()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.fixed32()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 61) { - message.notIn.push(reader.fixed32()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.fixed32()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Fixed32Rules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: Fixed32Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = Math.round(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = Math.round(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = Math.round(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = Math.round(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = Math.round(message.gte); - } - if (message.in?.length) { - obj.in = message.in.map((e) => Math.round(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Math.round(e)); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): Fixed32Rules { - return Fixed32Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Fixed32Rules { - const message = createBaseFixed32Rules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseFixed64Rules(): Fixed64Rules { - return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; -} - -export const Fixed64Rules: MessageFns = { - encode(message: Fixed64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== "0") { - writer.uint32(9).fixed64(message.const); - } - if (message.lt !== undefined && message.lt !== "0") { - writer.uint32(17).fixed64(message.lt); - } - if (message.lte !== undefined && message.lte !== "0") { - writer.uint32(25).fixed64(message.lte); - } - if (message.gt !== undefined && message.gt !== "0") { - writer.uint32(33).fixed64(message.gt); - } - if (message.gte !== undefined && message.gte !== "0") { - writer.uint32(41).fixed64(message.gte); - } - for (const v of message.in) { - writer.uint32(49).fixed64(v!); - } - for (const v of message.notIn) { - writer.uint32(57).fixed64(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): Fixed64Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFixed64Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 9) { - break; - } - - message.const = reader.fixed64().toString(); - continue; - } - case 2: { - if (tag !== 17) { - break; - } - - message.lt = reader.fixed64().toString(); - continue; - } - case 3: { - if (tag !== 25) { - break; - } - - message.lte = reader.fixed64().toString(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.gt = reader.fixed64().toString(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } - - message.gte = reader.fixed64().toString(); - continue; - } - case 6: { - if (tag === 49) { - message.in.push(reader.fixed64().toString()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.fixed64().toString()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 57) { - message.notIn.push(reader.fixed64().toString()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.fixed64().toString()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Fixed64Rules { - return { - const: isSet(object.const) ? globalThis.String(object.const) : "0", - lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", - lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", - gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", - gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: Fixed64Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== "0") { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== "0") { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== "0") { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== "0") { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== "0") { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): Fixed64Rules { - return Fixed64Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Fixed64Rules { - const message = createBaseFixed64Rules(); - message.const = object.const ?? "0"; - message.lt = object.lt ?? "0"; - message.lte = object.lte ?? "0"; - message.gt = object.gt ?? "0"; - message.gte = object.gte ?? "0"; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseSFixed32Rules(): SFixed32Rules { - return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; -} - -export const SFixed32Rules: MessageFns = { - encode(message: SFixed32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(13).sfixed32(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - writer.uint32(21).sfixed32(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - writer.uint32(29).sfixed32(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - writer.uint32(37).sfixed32(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - writer.uint32(45).sfixed32(message.gte); - } - for (const v of message.in) { - writer.uint32(53).sfixed32(v!); - } - for (const v of message.notIn) { - writer.uint32(61).sfixed32(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SFixed32Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSFixed32Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 13) { - break; - } - - message.const = reader.sfixed32(); - continue; - } - case 2: { - if (tag !== 21) { - break; - } - - message.lt = reader.sfixed32(); - continue; - } - case 3: { - if (tag !== 29) { - break; - } - - message.lte = reader.sfixed32(); - continue; - } - case 4: { - if (tag !== 37) { - break; - } - - message.gt = reader.sfixed32(); - continue; - } - case 5: { - if (tag !== 45) { - break; - } - - message.gte = reader.sfixed32(); - continue; - } - case 6: { - if (tag === 53) { - message.in.push(reader.sfixed32()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.sfixed32()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 61) { - message.notIn.push(reader.sfixed32()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.sfixed32()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SFixed32Rules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, - lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, - gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, - gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: SFixed32Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = Math.round(message.const); - } - if (message.lt !== undefined && message.lt !== 0) { - obj.lt = Math.round(message.lt); - } - if (message.lte !== undefined && message.lte !== 0) { - obj.lte = Math.round(message.lte); - } - if (message.gt !== undefined && message.gt !== 0) { - obj.gt = Math.round(message.gt); - } - if (message.gte !== undefined && message.gte !== 0) { - obj.gte = Math.round(message.gte); - } - if (message.in?.length) { - obj.in = message.in.map((e) => Math.round(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Math.round(e)); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): SFixed32Rules { - return SFixed32Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SFixed32Rules { - const message = createBaseSFixed32Rules(); - message.const = object.const ?? 0; - message.lt = object.lt ?? 0; - message.lte = object.lte ?? 0; - message.gt = object.gt ?? 0; - message.gte = object.gte ?? 0; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseSFixed64Rules(): SFixed64Rules { - return { const: "0", lt: "0", lte: "0", gt: "0", gte: "0", in: [], notIn: [], ignoreEmpty: false }; -} - -export const SFixed64Rules: MessageFns = { - encode(message: SFixed64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== "0") { - writer.uint32(9).sfixed64(message.const); - } - if (message.lt !== undefined && message.lt !== "0") { - writer.uint32(17).sfixed64(message.lt); - } - if (message.lte !== undefined && message.lte !== "0") { - writer.uint32(25).sfixed64(message.lte); - } - if (message.gt !== undefined && message.gt !== "0") { - writer.uint32(33).sfixed64(message.gt); - } - if (message.gte !== undefined && message.gte !== "0") { - writer.uint32(41).sfixed64(message.gte); - } - for (const v of message.in) { - writer.uint32(49).sfixed64(v!); - } - for (const v of message.notIn) { - writer.uint32(57).sfixed64(v!); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(64).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SFixed64Rules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSFixed64Rules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 9) { - break; - } - - message.const = reader.sfixed64().toString(); - continue; - } - case 2: { - if (tag !== 17) { - break; - } - - message.lt = reader.sfixed64().toString(); - continue; - } - case 3: { - if (tag !== 25) { - break; - } - - message.lte = reader.sfixed64().toString(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.gt = reader.sfixed64().toString(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } - - message.gte = reader.sfixed64().toString(); - continue; - } - case 6: { - if (tag === 49) { - message.in.push(reader.sfixed64().toString()); - - continue; - } - - if (tag === 50) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.sfixed64().toString()); - } - - continue; - } - - break; - } - case 7: { - if (tag === 57) { - message.notIn.push(reader.sfixed64().toString()); - - continue; - } - - if (tag === 58) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.sfixed64().toString()); - } - - continue; - } - - break; - } - case 8: { - if (tag !== 64) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SFixed64Rules { - return { - const: isSet(object.const) ? globalThis.String(object.const) : "0", - lt: isSet(object.lt) ? globalThis.String(object.lt) : "0", - lte: isSet(object.lte) ? globalThis.String(object.lte) : "0", - gt: isSet(object.gt) ? globalThis.String(object.gt) : "0", - gte: isSet(object.gte) ? globalThis.String(object.gte) : "0", - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: SFixed64Rules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== "0") { - obj.const = message.const; - } - if (message.lt !== undefined && message.lt !== "0") { - obj.lt = message.lt; - } - if (message.lte !== undefined && message.lte !== "0") { - obj.lte = message.lte; - } - if (message.gt !== undefined && message.gt !== "0") { - obj.gt = message.gt; - } - if (message.gte !== undefined && message.gte !== "0") { - obj.gte = message.gte; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): SFixed64Rules { - return SFixed64Rules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SFixed64Rules { - const message = createBaseSFixed64Rules(); - message.const = object.const ?? "0"; - message.lt = object.lt ?? "0"; - message.lte = object.lte ?? "0"; - message.gt = object.gt ?? "0"; - message.gte = object.gte ?? "0"; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseBoolRules(): BoolRules { - return { const: false }; -} - -export const BoolRules: MessageFns = { - encode(message: BoolRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== false) { - writer.uint32(8).bool(message.const); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BoolRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBoolRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BoolRules { - return { const: isSet(object.const) ? globalThis.Boolean(object.const) : false }; - }, - - toJSON(message: BoolRules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== false) { - obj.const = message.const; - } - return obj; - }, - - create, I>>(base?: I): BoolRules { - return BoolRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BoolRules { - const message = createBaseBoolRules(); - message.const = object.const ?? false; - return message; - }, -}; - -function createBaseStringRules(): StringRules { - return { - const: "", - len: "0", - minLen: "0", - maxLen: "0", - lenBytes: "0", - minBytes: "0", - maxBytes: "0", - pattern: "", - prefix: "", - suffix: "", - contains: "", - notContains: "", - in: [], - notIn: [], - email: undefined, - hostname: undefined, - ip: undefined, - ipv4: undefined, - ipv6: undefined, - uri: undefined, - uriRef: undefined, - address: undefined, - uuid: undefined, - wellKnownRegex: undefined, - strict: true, - ignoreEmpty: false, - }; -} - -export const StringRules: MessageFns = { - encode(message: StringRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== "") { - writer.uint32(10).string(message.const); - } - if (message.len !== undefined && message.len !== "0") { - writer.uint32(152).uint64(message.len); - } - if (message.minLen !== undefined && message.minLen !== "0") { - writer.uint32(16).uint64(message.minLen); - } - if (message.maxLen !== undefined && message.maxLen !== "0") { - writer.uint32(24).uint64(message.maxLen); - } - if (message.lenBytes !== undefined && message.lenBytes !== "0") { - writer.uint32(160).uint64(message.lenBytes); - } - if (message.minBytes !== undefined && message.minBytes !== "0") { - writer.uint32(32).uint64(message.minBytes); - } - if (message.maxBytes !== undefined && message.maxBytes !== "0") { - writer.uint32(40).uint64(message.maxBytes); - } - if (message.pattern !== undefined && message.pattern !== "") { - writer.uint32(50).string(message.pattern); - } - if (message.prefix !== undefined && message.prefix !== "") { - writer.uint32(58).string(message.prefix); - } - if (message.suffix !== undefined && message.suffix !== "") { - writer.uint32(66).string(message.suffix); - } - if (message.contains !== undefined && message.contains !== "") { - writer.uint32(74).string(message.contains); - } - if (message.notContains !== undefined && message.notContains !== "") { - writer.uint32(186).string(message.notContains); - } - for (const v of message.in) { - writer.uint32(82).string(v!); - } - for (const v of message.notIn) { - writer.uint32(90).string(v!); - } - if (message.email !== undefined) { - writer.uint32(96).bool(message.email); - } - if (message.hostname !== undefined) { - writer.uint32(104).bool(message.hostname); - } - if (message.ip !== undefined) { - writer.uint32(112).bool(message.ip); - } - if (message.ipv4 !== undefined) { - writer.uint32(120).bool(message.ipv4); - } - if (message.ipv6 !== undefined) { - writer.uint32(128).bool(message.ipv6); - } - if (message.uri !== undefined) { - writer.uint32(136).bool(message.uri); - } - if (message.uriRef !== undefined) { - writer.uint32(144).bool(message.uriRef); - } - if (message.address !== undefined) { - writer.uint32(168).bool(message.address); - } - if (message.uuid !== undefined) { - writer.uint32(176).bool(message.uuid); - } - if (message.wellKnownRegex !== undefined) { - writer.uint32(192).int32(message.wellKnownRegex); - } - if (message.strict !== undefined && message.strict !== true) { - writer.uint32(200).bool(message.strict); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(208).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): StringRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStringRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.const = reader.string(); - continue; - } - case 19: { - if (tag !== 152) { - break; - } - - message.len = reader.uint64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.minLen = reader.uint64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.maxLen = reader.uint64().toString(); - continue; - } - case 20: { - if (tag !== 160) { - break; - } - - message.lenBytes = reader.uint64().toString(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.minBytes = reader.uint64().toString(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.maxBytes = reader.uint64().toString(); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.pattern = reader.string(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.prefix = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.suffix = reader.string(); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.contains = reader.string(); - continue; - } - case 23: { - if (tag !== 186) { - break; - } - - message.notContains = reader.string(); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.in.push(reader.string()); - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.notIn.push(reader.string()); - continue; - } - case 12: { - if (tag !== 96) { - break; - } - - message.email = reader.bool(); - continue; - } - case 13: { - if (tag !== 104) { - break; - } - - message.hostname = reader.bool(); - continue; - } - case 14: { - if (tag !== 112) { - break; - } - - message.ip = reader.bool(); - continue; - } - case 15: { - if (tag !== 120) { - break; - } - - message.ipv4 = reader.bool(); - continue; - } - case 16: { - if (tag !== 128) { - break; - } - - message.ipv6 = reader.bool(); - continue; - } - case 17: { - if (tag !== 136) { - break; - } - - message.uri = reader.bool(); - continue; - } - case 18: { - if (tag !== 144) { - break; - } - - message.uriRef = reader.bool(); - continue; - } - case 21: { - if (tag !== 168) { - break; - } - - message.address = reader.bool(); - continue; - } - case 22: { - if (tag !== 176) { - break; - } - - message.uuid = reader.bool(); - continue; - } - case 24: { - if (tag !== 192) { - break; - } - - message.wellKnownRegex = reader.int32() as any; - continue; - } - case 25: { - if (tag !== 200) { - break; - } - - message.strict = reader.bool(); - continue; - } - case 26: { - if (tag !== 208) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): StringRules { - return { - const: isSet(object.const) ? globalThis.String(object.const) : "", - len: isSet(object.len) ? globalThis.String(object.len) : "0", - minLen: isSet(object.minLen) ? globalThis.String(object.minLen) : "0", - maxLen: isSet(object.maxLen) ? globalThis.String(object.maxLen) : "0", - lenBytes: isSet(object.lenBytes) ? globalThis.String(object.lenBytes) : "0", - minBytes: isSet(object.minBytes) ? globalThis.String(object.minBytes) : "0", - maxBytes: isSet(object.maxBytes) ? globalThis.String(object.maxBytes) : "0", - pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", - prefix: isSet(object.prefix) ? globalThis.String(object.prefix) : "", - suffix: isSet(object.suffix) ? globalThis.String(object.suffix) : "", - contains: isSet(object.contains) ? globalThis.String(object.contains) : "", - notContains: isSet(object.notContains) ? globalThis.String(object.notContains) : "", - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - email: isSet(object.email) ? globalThis.Boolean(object.email) : undefined, - hostname: isSet(object.hostname) ? globalThis.Boolean(object.hostname) : undefined, - ip: isSet(object.ip) ? globalThis.Boolean(object.ip) : undefined, - ipv4: isSet(object.ipv4) ? globalThis.Boolean(object.ipv4) : undefined, - ipv6: isSet(object.ipv6) ? globalThis.Boolean(object.ipv6) : undefined, - uri: isSet(object.uri) ? globalThis.Boolean(object.uri) : undefined, - uriRef: isSet(object.uriRef) ? globalThis.Boolean(object.uriRef) : undefined, - address: isSet(object.address) ? globalThis.Boolean(object.address) : undefined, - uuid: isSet(object.uuid) ? globalThis.Boolean(object.uuid) : undefined, - wellKnownRegex: isSet(object.wellKnownRegex) ? knownRegexFromJSON(object.wellKnownRegex) : undefined, - strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : true, - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: StringRules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== "") { - obj.const = message.const; - } - if (message.len !== undefined && message.len !== "0") { - obj.len = message.len; - } - if (message.minLen !== undefined && message.minLen !== "0") { - obj.minLen = message.minLen; - } - if (message.maxLen !== undefined && message.maxLen !== "0") { - obj.maxLen = message.maxLen; - } - if (message.lenBytes !== undefined && message.lenBytes !== "0") { - obj.lenBytes = message.lenBytes; - } - if (message.minBytes !== undefined && message.minBytes !== "0") { - obj.minBytes = message.minBytes; - } - if (message.maxBytes !== undefined && message.maxBytes !== "0") { - obj.maxBytes = message.maxBytes; - } - if (message.pattern !== undefined && message.pattern !== "") { - obj.pattern = message.pattern; - } - if (message.prefix !== undefined && message.prefix !== "") { - obj.prefix = message.prefix; - } - if (message.suffix !== undefined && message.suffix !== "") { - obj.suffix = message.suffix; - } - if (message.contains !== undefined && message.contains !== "") { - obj.contains = message.contains; - } - if (message.notContains !== undefined && message.notContains !== "") { - obj.notContains = message.notContains; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - if (message.email !== undefined) { - obj.email = message.email; - } - if (message.hostname !== undefined) { - obj.hostname = message.hostname; - } - if (message.ip !== undefined) { - obj.ip = message.ip; - } - if (message.ipv4 !== undefined) { - obj.ipv4 = message.ipv4; - } - if (message.ipv6 !== undefined) { - obj.ipv6 = message.ipv6; - } - if (message.uri !== undefined) { - obj.uri = message.uri; - } - if (message.uriRef !== undefined) { - obj.uriRef = message.uriRef; - } - if (message.address !== undefined) { - obj.address = message.address; - } - if (message.uuid !== undefined) { - obj.uuid = message.uuid; - } - if (message.wellKnownRegex !== undefined) { - obj.wellKnownRegex = knownRegexToJSON(message.wellKnownRegex); - } - if (message.strict !== undefined && message.strict !== true) { - obj.strict = message.strict; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): StringRules { - return StringRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): StringRules { - const message = createBaseStringRules(); - message.const = object.const ?? ""; - message.len = object.len ?? "0"; - message.minLen = object.minLen ?? "0"; - message.maxLen = object.maxLen ?? "0"; - message.lenBytes = object.lenBytes ?? "0"; - message.minBytes = object.minBytes ?? "0"; - message.maxBytes = object.maxBytes ?? "0"; - message.pattern = object.pattern ?? ""; - message.prefix = object.prefix ?? ""; - message.suffix = object.suffix ?? ""; - message.contains = object.contains ?? ""; - message.notContains = object.notContains ?? ""; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.email = object.email ?? undefined; - message.hostname = object.hostname ?? undefined; - message.ip = object.ip ?? undefined; - message.ipv4 = object.ipv4 ?? undefined; - message.ipv6 = object.ipv6 ?? undefined; - message.uri = object.uri ?? undefined; - message.uriRef = object.uriRef ?? undefined; - message.address = object.address ?? undefined; - message.uuid = object.uuid ?? undefined; - message.wellKnownRegex = object.wellKnownRegex ?? undefined; - message.strict = object.strict ?? true; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseBytesRules(): BytesRules { - return { - const: new Uint8Array(0), - len: "0", - minLen: "0", - maxLen: "0", - pattern: "", - prefix: new Uint8Array(0), - suffix: new Uint8Array(0), - contains: new Uint8Array(0), - in: [], - notIn: [], - ip: undefined, - ipv4: undefined, - ipv6: undefined, - ignoreEmpty: false, - }; -} - -export const BytesRules: MessageFns = { - encode(message: BytesRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const.length !== 0) { - writer.uint32(10).bytes(message.const); - } - if (message.len !== undefined && message.len !== "0") { - writer.uint32(104).uint64(message.len); - } - if (message.minLen !== undefined && message.minLen !== "0") { - writer.uint32(16).uint64(message.minLen); - } - if (message.maxLen !== undefined && message.maxLen !== "0") { - writer.uint32(24).uint64(message.maxLen); - } - if (message.pattern !== undefined && message.pattern !== "") { - writer.uint32(34).string(message.pattern); - } - if (message.prefix !== undefined && message.prefix.length !== 0) { - writer.uint32(42).bytes(message.prefix); - } - if (message.suffix !== undefined && message.suffix.length !== 0) { - writer.uint32(50).bytes(message.suffix); - } - if (message.contains !== undefined && message.contains.length !== 0) { - writer.uint32(58).bytes(message.contains); - } - for (const v of message.in) { - writer.uint32(66).bytes(v!); - } - for (const v of message.notIn) { - writer.uint32(74).bytes(v!); - } - if (message.ip !== undefined) { - writer.uint32(80).bool(message.ip); - } - if (message.ipv4 !== undefined) { - writer.uint32(88).bool(message.ipv4); - } - if (message.ipv6 !== undefined) { - writer.uint32(96).bool(message.ipv6); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(112).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): BytesRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBytesRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.const = reader.bytes(); - continue; - } - case 13: { - if (tag !== 104) { - break; - } - - message.len = reader.uint64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.minLen = reader.uint64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.maxLen = reader.uint64().toString(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.pattern = reader.string(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.prefix = reader.bytes(); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.suffix = reader.bytes(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.contains = reader.bytes(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.in.push(reader.bytes()); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.notIn.push(reader.bytes()); - continue; - } - case 10: { - if (tag !== 80) { - break; - } - - message.ip = reader.bool(); - continue; - } - case 11: { - if (tag !== 88) { - break; - } - - message.ipv4 = reader.bool(); - continue; - } - case 12: { - if (tag !== 96) { - break; - } - - message.ipv6 = reader.bool(); - continue; - } - case 14: { - if (tag !== 112) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): BytesRules { - return { - const: isSet(object.const) ? bytesFromBase64(object.const) : new Uint8Array(0), - len: isSet(object.len) ? globalThis.String(object.len) : "0", - minLen: isSet(object.minLen) ? globalThis.String(object.minLen) : "0", - maxLen: isSet(object.maxLen) ? globalThis.String(object.maxLen) : "0", - pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", - prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(0), - suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array(0), - contains: isSet(object.contains) ? bytesFromBase64(object.contains) : new Uint8Array(0), - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => bytesFromBase64(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => bytesFromBase64(e)) : [], - ip: isSet(object.ip) ? globalThis.Boolean(object.ip) : undefined, - ipv4: isSet(object.ipv4) ? globalThis.Boolean(object.ipv4) : undefined, - ipv6: isSet(object.ipv6) ? globalThis.Boolean(object.ipv6) : undefined, - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: BytesRules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const.length !== 0) { - obj.const = base64FromBytes(message.const); - } - if (message.len !== undefined && message.len !== "0") { - obj.len = message.len; - } - if (message.minLen !== undefined && message.minLen !== "0") { - obj.minLen = message.minLen; - } - if (message.maxLen !== undefined && message.maxLen !== "0") { - obj.maxLen = message.maxLen; - } - if (message.pattern !== undefined && message.pattern !== "") { - obj.pattern = message.pattern; - } - if (message.prefix !== undefined && message.prefix.length !== 0) { - obj.prefix = base64FromBytes(message.prefix); - } - if (message.suffix !== undefined && message.suffix.length !== 0) { - obj.suffix = base64FromBytes(message.suffix); - } - if (message.contains !== undefined && message.contains.length !== 0) { - obj.contains = base64FromBytes(message.contains); - } - if (message.in?.length) { - obj.in = message.in.map((e) => base64FromBytes(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => base64FromBytes(e)); - } - if (message.ip !== undefined) { - obj.ip = message.ip; - } - if (message.ipv4 !== undefined) { - obj.ipv4 = message.ipv4; - } - if (message.ipv6 !== undefined) { - obj.ipv6 = message.ipv6; - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): BytesRules { - return BytesRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): BytesRules { - const message = createBaseBytesRules(); - message.const = object.const ?? new Uint8Array(0); - message.len = object.len ?? "0"; - message.minLen = object.minLen ?? "0"; - message.maxLen = object.maxLen ?? "0"; - message.pattern = object.pattern ?? ""; - message.prefix = object.prefix ?? new Uint8Array(0); - message.suffix = object.suffix ?? new Uint8Array(0); - message.contains = object.contains ?? new Uint8Array(0); - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - message.ip = object.ip ?? undefined; - message.ipv4 = object.ipv4 ?? undefined; - message.ipv6 = object.ipv6 ?? undefined; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseEnumRules(): EnumRules { - return { const: 0, definedOnly: false, in: [], notIn: [] }; -} - -export const EnumRules: MessageFns = { - encode(message: EnumRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.const !== undefined && message.const !== 0) { - writer.uint32(8).int32(message.const); - } - if (message.definedOnly !== undefined && message.definedOnly !== false) { - writer.uint32(16).bool(message.definedOnly); - } - for (const v of message.in) { - writer.uint32(24).int32(v!); - } - for (const v of message.notIn) { - writer.uint32(32).int32(v!); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): EnumRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.const = reader.int32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.definedOnly = reader.bool(); - continue; - } - case 3: { - if (tag === 24) { - message.in.push(reader.int32()); - - continue; - } - - if (tag === 26) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.in.push(reader.int32()); - } - - continue; - } - - break; - } - case 4: { - if (tag === 32) { - message.notIn.push(reader.int32()); - - continue; - } - - if (tag === 34) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.notIn.push(reader.int32()); - } - - continue; - } - - break; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): EnumRules { - return { - const: isSet(object.const) ? globalThis.Number(object.const) : 0, - definedOnly: isSet(object.definedOnly) ? globalThis.Boolean(object.definedOnly) : false, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], - }; - }, - - toJSON(message: EnumRules): unknown { - const obj: any = {}; - if (message.const !== undefined && message.const !== 0) { - obj.const = Math.round(message.const); - } - if (message.definedOnly !== undefined && message.definedOnly !== false) { - obj.definedOnly = message.definedOnly; - } - if (message.in?.length) { - obj.in = message.in.map((e) => Math.round(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Math.round(e)); - } - return obj; - }, - - create, I>>(base?: I): EnumRules { - return EnumRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): EnumRules { - const message = createBaseEnumRules(); - message.const = object.const ?? 0; - message.definedOnly = object.definedOnly ?? false; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - return message; - }, -}; - -function createBaseMessageRules(): MessageRules { - return { skip: false, required: false }; -} - -export const MessageRules: MessageFns = { - encode(message: MessageRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.skip !== undefined && message.skip !== false) { - writer.uint32(8).bool(message.skip); - } - if (message.required !== undefined && message.required !== false) { - writer.uint32(16).bool(message.required); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MessageRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.skip = reader.bool(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.required = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MessageRules { - return { - skip: isSet(object.skip) ? globalThis.Boolean(object.skip) : false, - required: isSet(object.required) ? globalThis.Boolean(object.required) : false, - }; - }, - - toJSON(message: MessageRules): unknown { - const obj: any = {}; - if (message.skip !== undefined && message.skip !== false) { - obj.skip = message.skip; - } - if (message.required !== undefined && message.required !== false) { - obj.required = message.required; - } - return obj; - }, - - create, I>>(base?: I): MessageRules { - return MessageRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MessageRules { - const message = createBaseMessageRules(); - message.skip = object.skip ?? false; - message.required = object.required ?? false; - return message; - }, -}; - -function createBaseRepeatedRules(): RepeatedRules { - return { minItems: "0", maxItems: "0", unique: false, items: undefined, ignoreEmpty: false }; -} - -export const RepeatedRules: MessageFns = { - encode(message: RepeatedRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.minItems !== undefined && message.minItems !== "0") { - writer.uint32(8).uint64(message.minItems); - } - if (message.maxItems !== undefined && message.maxItems !== "0") { - writer.uint32(16).uint64(message.maxItems); - } - if (message.unique !== undefined && message.unique !== false) { - writer.uint32(24).bool(message.unique); - } - if (message.items !== undefined) { - FieldRules.encode(message.items, writer.uint32(34).fork()).join(); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(40).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): RepeatedRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRepeatedRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.minItems = reader.uint64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.maxItems = reader.uint64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.unique = reader.bool(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.items = FieldRules.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): RepeatedRules { - return { - minItems: isSet(object.minItems) ? globalThis.String(object.minItems) : "0", - maxItems: isSet(object.maxItems) ? globalThis.String(object.maxItems) : "0", - unique: isSet(object.unique) ? globalThis.Boolean(object.unique) : false, - items: isSet(object.items) ? FieldRules.fromJSON(object.items) : undefined, - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: RepeatedRules): unknown { - const obj: any = {}; - if (message.minItems !== undefined && message.minItems !== "0") { - obj.minItems = message.minItems; - } - if (message.maxItems !== undefined && message.maxItems !== "0") { - obj.maxItems = message.maxItems; - } - if (message.unique !== undefined && message.unique !== false) { - obj.unique = message.unique; - } - if (message.items !== undefined) { - obj.items = FieldRules.toJSON(message.items); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): RepeatedRules { - return RepeatedRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RepeatedRules { - const message = createBaseRepeatedRules(); - message.minItems = object.minItems ?? "0"; - message.maxItems = object.maxItems ?? "0"; - message.unique = object.unique ?? false; - message.items = (object.items !== undefined && object.items !== null) - ? FieldRules.fromPartial(object.items) - : undefined; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseMapRules(): MapRules { - return { minPairs: "0", maxPairs: "0", noSparse: false, keys: undefined, values: undefined, ignoreEmpty: false }; -} - -export const MapRules: MessageFns = { - encode(message: MapRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.minPairs !== undefined && message.minPairs !== "0") { - writer.uint32(8).uint64(message.minPairs); - } - if (message.maxPairs !== undefined && message.maxPairs !== "0") { - writer.uint32(16).uint64(message.maxPairs); - } - if (message.noSparse !== undefined && message.noSparse !== false) { - writer.uint32(24).bool(message.noSparse); - } - if (message.keys !== undefined) { - FieldRules.encode(message.keys, writer.uint32(34).fork()).join(); - } - if (message.values !== undefined) { - FieldRules.encode(message.values, writer.uint32(42).fork()).join(); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - writer.uint32(48).bool(message.ignoreEmpty); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MapRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMapRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.minPairs = reader.uint64().toString(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.maxPairs = reader.uint64().toString(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.noSparse = reader.bool(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.keys = FieldRules.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.values = FieldRules.decode(reader, reader.uint32()); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.ignoreEmpty = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MapRules { - return { - minPairs: isSet(object.minPairs) ? globalThis.String(object.minPairs) : "0", - maxPairs: isSet(object.maxPairs) ? globalThis.String(object.maxPairs) : "0", - noSparse: isSet(object.noSparse) ? globalThis.Boolean(object.noSparse) : false, - keys: isSet(object.keys) ? FieldRules.fromJSON(object.keys) : undefined, - values: isSet(object.values) ? FieldRules.fromJSON(object.values) : undefined, - ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, - }; - }, - - toJSON(message: MapRules): unknown { - const obj: any = {}; - if (message.minPairs !== undefined && message.minPairs !== "0") { - obj.minPairs = message.minPairs; - } - if (message.maxPairs !== undefined && message.maxPairs !== "0") { - obj.maxPairs = message.maxPairs; - } - if (message.noSparse !== undefined && message.noSparse !== false) { - obj.noSparse = message.noSparse; - } - if (message.keys !== undefined) { - obj.keys = FieldRules.toJSON(message.keys); - } - if (message.values !== undefined) { - obj.values = FieldRules.toJSON(message.values); - } - if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { - obj.ignoreEmpty = message.ignoreEmpty; - } - return obj; - }, - - create, I>>(base?: I): MapRules { - return MapRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MapRules { - const message = createBaseMapRules(); - message.minPairs = object.minPairs ?? "0"; - message.maxPairs = object.maxPairs ?? "0"; - message.noSparse = object.noSparse ?? false; - message.keys = (object.keys !== undefined && object.keys !== null) - ? FieldRules.fromPartial(object.keys) - : undefined; - message.values = (object.values !== undefined && object.values !== null) - ? FieldRules.fromPartial(object.values) - : undefined; - message.ignoreEmpty = object.ignoreEmpty ?? false; - return message; - }, -}; - -function createBaseAnyRules(): AnyRules { - return { required: false, in: [], notIn: [] }; -} - -export const AnyRules: MessageFns = { - encode(message: AnyRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.required !== undefined && message.required !== false) { - writer.uint32(8).bool(message.required); - } - for (const v of message.in) { - writer.uint32(18).string(v!); - } - for (const v of message.notIn) { - writer.uint32(26).string(v!); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): AnyRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAnyRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.required = reader.bool(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.in.push(reader.string()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.notIn.push(reader.string()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): AnyRules { - return { - required: isSet(object.required) ? globalThis.Boolean(object.required) : false, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], - }; - }, - - toJSON(message: AnyRules): unknown { - const obj: any = {}; - if (message.required !== undefined && message.required !== false) { - obj.required = message.required; - } - if (message.in?.length) { - obj.in = message.in; - } - if (message.notIn?.length) { - obj.notIn = message.notIn; - } - return obj; - }, - - create, I>>(base?: I): AnyRules { - return AnyRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): AnyRules { - const message = createBaseAnyRules(); - message.required = object.required ?? false; - message.in = object.in?.map((e) => e) || []; - message.notIn = object.notIn?.map((e) => e) || []; - return message; - }, -}; - -function createBaseDurationRules(): DurationRules { - return { - required: false, - const: undefined, - lt: undefined, - lte: undefined, - gt: undefined, - gte: undefined, - in: [], - notIn: [], - }; -} - -export const DurationRules: MessageFns = { - encode(message: DurationRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.required !== undefined && message.required !== false) { - writer.uint32(8).bool(message.required); - } - if (message.const !== undefined) { - Duration.encode(message.const, writer.uint32(18).fork()).join(); - } - if (message.lt !== undefined) { - Duration.encode(message.lt, writer.uint32(26).fork()).join(); - } - if (message.lte !== undefined) { - Duration.encode(message.lte, writer.uint32(34).fork()).join(); - } - if (message.gt !== undefined) { - Duration.encode(message.gt, writer.uint32(42).fork()).join(); - } - if (message.gte !== undefined) { - Duration.encode(message.gte, writer.uint32(50).fork()).join(); - } - for (const v of message.in) { - Duration.encode(v!, writer.uint32(58).fork()).join(); - } - for (const v of message.notIn) { - Duration.encode(v!, writer.uint32(66).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DurationRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDurationRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.required = reader.bool(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.const = Duration.decode(reader, reader.uint32()); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.lt = Duration.decode(reader, reader.uint32()); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.lte = Duration.decode(reader, reader.uint32()); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.gt = Duration.decode(reader, reader.uint32()); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.gte = Duration.decode(reader, reader.uint32()); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.in.push(Duration.decode(reader, reader.uint32())); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.notIn.push(Duration.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DurationRules { - return { - required: isSet(object.required) ? globalThis.Boolean(object.required) : false, - const: isSet(object.const) ? Duration.fromJSON(object.const) : undefined, - lt: isSet(object.lt) ? Duration.fromJSON(object.lt) : undefined, - lte: isSet(object.lte) ? Duration.fromJSON(object.lte) : undefined, - gt: isSet(object.gt) ? Duration.fromJSON(object.gt) : undefined, - gte: isSet(object.gte) ? Duration.fromJSON(object.gte) : undefined, - in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Duration.fromJSON(e)) : [], - notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Duration.fromJSON(e)) : [], - }; - }, - - toJSON(message: DurationRules): unknown { - const obj: any = {}; - if (message.required !== undefined && message.required !== false) { - obj.required = message.required; - } - if (message.const !== undefined) { - obj.const = Duration.toJSON(message.const); - } - if (message.lt !== undefined) { - obj.lt = Duration.toJSON(message.lt); - } - if (message.lte !== undefined) { - obj.lte = Duration.toJSON(message.lte); - } - if (message.gt !== undefined) { - obj.gt = Duration.toJSON(message.gt); - } - if (message.gte !== undefined) { - obj.gte = Duration.toJSON(message.gte); - } - if (message.in?.length) { - obj.in = message.in.map((e) => Duration.toJSON(e)); - } - if (message.notIn?.length) { - obj.notIn = message.notIn.map((e) => Duration.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): DurationRules { - return DurationRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): DurationRules { - const message = createBaseDurationRules(); - message.required = object.required ?? false; - message.const = (object.const !== undefined && object.const !== null) - ? Duration.fromPartial(object.const) - : undefined; - message.lt = (object.lt !== undefined && object.lt !== null) ? Duration.fromPartial(object.lt) : undefined; - message.lte = (object.lte !== undefined && object.lte !== null) ? Duration.fromPartial(object.lte) : undefined; - message.gt = (object.gt !== undefined && object.gt !== null) ? Duration.fromPartial(object.gt) : undefined; - message.gte = (object.gte !== undefined && object.gte !== null) ? Duration.fromPartial(object.gte) : undefined; - message.in = object.in?.map((e) => Duration.fromPartial(e)) || []; - message.notIn = object.notIn?.map((e) => Duration.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseTimestampRules(): TimestampRules { - return { - required: false, - const: undefined, - lt: undefined, - lte: undefined, - gt: undefined, - gte: undefined, - ltNow: false, - gtNow: false, - within: undefined, - }; -} - -export const TimestampRules: MessageFns = { - encode(message: TimestampRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.required !== undefined && message.required !== false) { - writer.uint32(8).bool(message.required); - } - if (message.const !== undefined) { - Timestamp.encode(toTimestamp(message.const), writer.uint32(18).fork()).join(); - } - if (message.lt !== undefined) { - Timestamp.encode(toTimestamp(message.lt), writer.uint32(26).fork()).join(); - } - if (message.lte !== undefined) { - Timestamp.encode(toTimestamp(message.lte), writer.uint32(34).fork()).join(); - } - if (message.gt !== undefined) { - Timestamp.encode(toTimestamp(message.gt), writer.uint32(42).fork()).join(); - } - if (message.gte !== undefined) { - Timestamp.encode(toTimestamp(message.gte), writer.uint32(50).fork()).join(); - } - if (message.ltNow !== undefined && message.ltNow !== false) { - writer.uint32(56).bool(message.ltNow); - } - if (message.gtNow !== undefined && message.gtNow !== false) { - writer.uint32(64).bool(message.gtNow); - } - if (message.within !== undefined) { - Duration.encode(message.within, writer.uint32(74).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): TimestampRules { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTimestampRules(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.required = reader.bool(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.const = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.lt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.lte = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.gt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.gte = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - case 7: { - if (tag !== 56) { - break; - } - - message.ltNow = reader.bool(); - continue; - } - case 8: { - if (tag !== 64) { - break; - } - - message.gtNow = reader.bool(); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.within = Duration.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): TimestampRules { - return { - required: isSet(object.required) ? globalThis.Boolean(object.required) : false, - const: isSet(object.const) ? fromJsonTimestamp(object.const) : undefined, - lt: isSet(object.lt) ? fromJsonTimestamp(object.lt) : undefined, - lte: isSet(object.lte) ? fromJsonTimestamp(object.lte) : undefined, - gt: isSet(object.gt) ? fromJsonTimestamp(object.gt) : undefined, - gte: isSet(object.gte) ? fromJsonTimestamp(object.gte) : undefined, - ltNow: isSet(object.ltNow) ? globalThis.Boolean(object.ltNow) : false, - gtNow: isSet(object.gtNow) ? globalThis.Boolean(object.gtNow) : false, - within: isSet(object.within) ? Duration.fromJSON(object.within) : undefined, - }; - }, - - toJSON(message: TimestampRules): unknown { - const obj: any = {}; - if (message.required !== undefined && message.required !== false) { - obj.required = message.required; - } - if (message.const !== undefined) { - obj.const = message.const.toISOString(); - } - if (message.lt !== undefined) { - obj.lt = message.lt.toISOString(); - } - if (message.lte !== undefined) { - obj.lte = message.lte.toISOString(); - } - if (message.gt !== undefined) { - obj.gt = message.gt.toISOString(); - } - if (message.gte !== undefined) { - obj.gte = message.gte.toISOString(); - } - if (message.ltNow !== undefined && message.ltNow !== false) { - obj.ltNow = message.ltNow; - } - if (message.gtNow !== undefined && message.gtNow !== false) { - obj.gtNow = message.gtNow; - } - if (message.within !== undefined) { - obj.within = Duration.toJSON(message.within); - } - return obj; - }, - - create, I>>(base?: I): TimestampRules { - return TimestampRules.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): TimestampRules { - const message = createBaseTimestampRules(); - message.required = object.required ?? false; - message.const = object.const ?? undefined; - message.lt = object.lt ?? undefined; - message.lte = object.lte ?? undefined; - message.gt = object.gt ?? undefined; - message.gte = object.gte ?? undefined; - message.ltNow = object.ltNow ?? false; - message.gtNow = object.gtNow ?? false; - message.within = (object.within !== undefined && object.within !== null) - ? Duration.fromPartial(object.within) - : undefined; - return message; - }, -}; - -function bytesFromBase64(b64: string): Uint8Array { - if ((globalThis as any).Buffer) { - return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); - } else { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; - } -} - -function base64FromBytes(arr: Uint8Array): string { - if ((globalThis as any).Buffer) { - return globalThis.Buffer.from(arr).toString("base64"); - } else { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); - } -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function toTimestamp(date: Date): Timestamp { - const seconds = Math.trunc(date.getTime() / 1_000).toString(); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = (globalThis.Number(t.seconds) || 0) * 1_000; - millis += (t.nanos || 0) / 1_000_000; - return new globalThis.Date(millis); -} - -function fromJsonTimestamp(o: any): Date { - if (o instanceof globalThis.Date) { - return o; - } else if (typeof o === "string") { - return new globalThis.Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); - } -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts new file mode 100644 index 00000000..c45225c8 --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts @@ -0,0 +1,1984 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file validate/validate.proto (package validate, syntax proto2) +/* eslint-disable */ + +import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Duration, FieldOptions, MessageOptions, OneofOptions, Timestamp } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file validate/validate.proto. + */ +export const file_validate_validate: GenFile = /*@__PURE__*/ + fileDesc("Chd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90bxIIdmFsaWRhdGUimAcKCkZpZWxkUnVsZXMSJwoHbWVzc2FnZRgRIAEoCzIWLnZhbGlkYXRlLk1lc3NhZ2VSdWxlcxIlCgVmbG9hdBgBIAEoCzIULnZhbGlkYXRlLkZsb2F0UnVsZXNIABInCgZkb3VibGUYAiABKAsyFS52YWxpZGF0ZS5Eb3VibGVSdWxlc0gAEiUKBWludDMyGAMgASgLMhQudmFsaWRhdGUuSW50MzJSdWxlc0gAEiUKBWludDY0GAQgASgLMhQudmFsaWRhdGUuSW50NjRSdWxlc0gAEicKBnVpbnQzMhgFIAEoCzIVLnZhbGlkYXRlLlVJbnQzMlJ1bGVzSAASJwoGdWludDY0GAYgASgLMhUudmFsaWRhdGUuVUludDY0UnVsZXNIABInCgZzaW50MzIYByABKAsyFS52YWxpZGF0ZS5TSW50MzJSdWxlc0gAEicKBnNpbnQ2NBgIIAEoCzIVLnZhbGlkYXRlLlNJbnQ2NFJ1bGVzSAASKQoHZml4ZWQzMhgJIAEoCzIWLnZhbGlkYXRlLkZpeGVkMzJSdWxlc0gAEikKB2ZpeGVkNjQYCiABKAsyFi52YWxpZGF0ZS5GaXhlZDY0UnVsZXNIABIrCghzZml4ZWQzMhgLIAEoCzIXLnZhbGlkYXRlLlNGaXhlZDMyUnVsZXNIABIrCghzZml4ZWQ2NBgMIAEoCzIXLnZhbGlkYXRlLlNGaXhlZDY0UnVsZXNIABIjCgRib29sGA0gASgLMhMudmFsaWRhdGUuQm9vbFJ1bGVzSAASJwoGc3RyaW5nGA4gASgLMhUudmFsaWRhdGUuU3RyaW5nUnVsZXNIABIlCgVieXRlcxgPIAEoCzIULnZhbGlkYXRlLkJ5dGVzUnVsZXNIABIjCgRlbnVtGBAgASgLMhMudmFsaWRhdGUuRW51bVJ1bGVzSAASKwoIcmVwZWF0ZWQYEiABKAsyFy52YWxpZGF0ZS5SZXBlYXRlZFJ1bGVzSAASIQoDbWFwGBMgASgLMhIudmFsaWRhdGUuTWFwUnVsZXNIABIhCgNhbnkYFCABKAsyEi52YWxpZGF0ZS5BbnlSdWxlc0gAEisKCGR1cmF0aW9uGBUgASgLMhcudmFsaWRhdGUuRHVyYXRpb25SdWxlc0gAEi0KCXRpbWVzdGFtcBgWIAEoCzIYLnZhbGlkYXRlLlRpbWVzdGFtcFJ1bGVzSABCBgoEdHlwZSJ/CgpGbG9hdFJ1bGVzEg0KBWNvbnN0GAEgASgCEgoKAmx0GAIgASgCEgsKA2x0ZRgDIAEoAhIKCgJndBgEIAEoAhILCgNndGUYBSABKAISCgoCaW4YBiADKAISDgoGbm90X2luGAcgAygCEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCKAAQoLRG91YmxlUnVsZXMSDQoFY29uc3QYASABKAESCgoCbHQYAiABKAESCwoDbHRlGAMgASgBEgoKAmd0GAQgASgBEgsKA2d0ZRgFIAEoARIKCgJpbhgGIAMoARIOCgZub3RfaW4YByADKAESFAoMaWdub3JlX2VtcHR5GAggASgIIn8KCkludDMyUnVsZXMSDQoFY29uc3QYASABKAUSCgoCbHQYAiABKAUSCwoDbHRlGAMgASgFEgoKAmd0GAQgASgFEgsKA2d0ZRgFIAEoBRIKCgJpbhgGIAMoBRIOCgZub3RfaW4YByADKAUSFAoMaWdub3JlX2VtcHR5GAggASgIIn8KCkludDY0UnVsZXMSDQoFY29uc3QYASABKAMSCgoCbHQYAiABKAMSCwoDbHRlGAMgASgDEgoKAmd0GAQgASgDEgsKA2d0ZRgFIAEoAxIKCgJpbhgGIAMoAxIOCgZub3RfaW4YByADKAMSFAoMaWdub3JlX2VtcHR5GAggASgIIoABCgtVSW50MzJSdWxlcxINCgVjb25zdBgBIAEoDRIKCgJsdBgCIAEoDRILCgNsdGUYAyABKA0SCgoCZ3QYBCABKA0SCwoDZ3RlGAUgASgNEgoKAmluGAYgAygNEg4KBm5vdF9pbhgHIAMoDRIUCgxpZ25vcmVfZW1wdHkYCCABKAgigAEKC1VJbnQ2NFJ1bGVzEg0KBWNvbnN0GAEgASgEEgoKAmx0GAIgASgEEgsKA2x0ZRgDIAEoBBIKCgJndBgEIAEoBBILCgNndGUYBSABKAQSCgoCaW4YBiADKAQSDgoGbm90X2luGAcgAygEEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCKAAQoLU0ludDMyUnVsZXMSDQoFY29uc3QYASABKBESCgoCbHQYAiABKBESCwoDbHRlGAMgASgREgoKAmd0GAQgASgREgsKA2d0ZRgFIAEoERIKCgJpbhgGIAMoERIOCgZub3RfaW4YByADKBESFAoMaWdub3JlX2VtcHR5GAggASgIIoABCgtTSW50NjRSdWxlcxINCgVjb25zdBgBIAEoEhIKCgJsdBgCIAEoEhILCgNsdGUYAyABKBISCgoCZ3QYBCABKBISCwoDZ3RlGAUgASgSEgoKAmluGAYgAygSEg4KBm5vdF9pbhgHIAMoEhIUCgxpZ25vcmVfZW1wdHkYCCABKAgigQEKDEZpeGVkMzJSdWxlcxINCgVjb25zdBgBIAEoBxIKCgJsdBgCIAEoBxILCgNsdGUYAyABKAcSCgoCZ3QYBCABKAcSCwoDZ3RlGAUgASgHEgoKAmluGAYgAygHEg4KBm5vdF9pbhgHIAMoBxIUCgxpZ25vcmVfZW1wdHkYCCABKAgigQEKDEZpeGVkNjRSdWxlcxINCgVjb25zdBgBIAEoBhIKCgJsdBgCIAEoBhILCgNsdGUYAyABKAYSCgoCZ3QYBCABKAYSCwoDZ3RlGAUgASgGEgoKAmluGAYgAygGEg4KBm5vdF9pbhgHIAMoBhIUCgxpZ25vcmVfZW1wdHkYCCABKAgiggEKDVNGaXhlZDMyUnVsZXMSDQoFY29uc3QYASABKA8SCgoCbHQYAiABKA8SCwoDbHRlGAMgASgPEgoKAmd0GAQgASgPEgsKA2d0ZRgFIAEoDxIKCgJpbhgGIAMoDxIOCgZub3RfaW4YByADKA8SFAoMaWdub3JlX2VtcHR5GAggASgIIoIBCg1TRml4ZWQ2NFJ1bGVzEg0KBWNvbnN0GAEgASgQEgoKAmx0GAIgASgQEgsKA2x0ZRgDIAEoEBIKCgJndBgEIAEoEBILCgNndGUYBSABKBASCgoCaW4YBiADKBASDgoGbm90X2luGAcgAygQEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCIaCglCb29sUnVsZXMSDQoFY29uc3QYASABKAgi/QMKC1N0cmluZ1J1bGVzEg0KBWNvbnN0GAEgASgJEgsKA2xlbhgTIAEoBBIPCgdtaW5fbGVuGAIgASgEEg8KB21heF9sZW4YAyABKAQSEQoJbGVuX2J5dGVzGBQgASgEEhEKCW1pbl9ieXRlcxgEIAEoBBIRCgltYXhfYnl0ZXMYBSABKAQSDwoHcGF0dGVybhgGIAEoCRIOCgZwcmVmaXgYByABKAkSDgoGc3VmZml4GAggASgJEhAKCGNvbnRhaW5zGAkgASgJEhQKDG5vdF9jb250YWlucxgXIAEoCRIKCgJpbhgKIAMoCRIOCgZub3RfaW4YCyADKAkSDwoFZW1haWwYDCABKAhIABISCghob3N0bmFtZRgNIAEoCEgAEgwKAmlwGA4gASgISAASDgoEaXB2NBgPIAEoCEgAEg4KBGlwdjYYECABKAhIABINCgN1cmkYESABKAhIABIRCgd1cmlfcmVmGBIgASgISAASEQoHYWRkcmVzcxgVIAEoCEgAEg4KBHV1aWQYFiABKAhIABIwChB3ZWxsX2tub3duX3JlZ2V4GBggASgOMhQudmFsaWRhdGUuS25vd25SZWdleEgAEhQKBnN0cmljdBgZIAEoCDoEdHJ1ZRIUCgxpZ25vcmVfZW1wdHkYGiABKAhCDAoKd2VsbF9rbm93biL7AQoKQnl0ZXNSdWxlcxINCgVjb25zdBgBIAEoDBILCgNsZW4YDSABKAQSDwoHbWluX2xlbhgCIAEoBBIPCgdtYXhfbGVuGAMgASgEEg8KB3BhdHRlcm4YBCABKAkSDgoGcHJlZml4GAUgASgMEg4KBnN1ZmZpeBgGIAEoDBIQCghjb250YWlucxgHIAEoDBIKCgJpbhgIIAMoDBIOCgZub3RfaW4YCSADKAwSDAoCaXAYCiABKAhIABIOCgRpcHY0GAsgASgISAASDgoEaXB2NhgMIAEoCEgAEhQKDGlnbm9yZV9lbXB0eRgOIAEoCEIMCgp3ZWxsX2tub3duIkwKCUVudW1SdWxlcxINCgVjb25zdBgBIAEoBRIUCgxkZWZpbmVkX29ubHkYAiABKAgSCgoCaW4YAyADKAUSDgoGbm90X2luGAQgAygFIi4KDE1lc3NhZ2VSdWxlcxIMCgRza2lwGAEgASgIEhAKCHJlcXVpcmVkGAIgASgIIoABCg1SZXBlYXRlZFJ1bGVzEhEKCW1pbl9pdGVtcxgBIAEoBBIRCgltYXhfaXRlbXMYAiABKAQSDgoGdW5pcXVlGAMgASgIEiMKBWl0ZW1zGAQgASgLMhQudmFsaWRhdGUuRmllbGRSdWxlcxIUCgxpZ25vcmVfZW1wdHkYBSABKAgiowEKCE1hcFJ1bGVzEhEKCW1pbl9wYWlycxgBIAEoBBIRCgltYXhfcGFpcnMYAiABKAQSEQoJbm9fc3BhcnNlGAMgASgIEiIKBGtleXMYBCABKAsyFC52YWxpZGF0ZS5GaWVsZFJ1bGVzEiQKBnZhbHVlcxgFIAEoCzIULnZhbGlkYXRlLkZpZWxkUnVsZXMSFAoMaWdub3JlX2VtcHR5GAYgASgIIjgKCEFueVJ1bGVzEhAKCHJlcXVpcmVkGAEgASgIEgoKAmluGAIgAygJEg4KBm5vdF9pbhgDIAMoCSK7AgoNRHVyYXRpb25SdWxlcxIQCghyZXF1aXJlZBgBIAEoCBIoCgVjb25zdBgCIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhIlCgJsdBgDIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhImCgNsdGUYBCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SJQoCZ3QYBSABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SJgoDZ3RlGAYgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEiUKAmluGAcgAygLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEikKBm5vdF9pbhgIIAMoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbiK6AgoOVGltZXN0YW1wUnVsZXMSEAoIcmVxdWlyZWQYASABKAgSKQoFY29uc3QYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmx0GAMgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNsdGUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmd0GAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNndGUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEg4KBmx0X25vdxgHIAEoCBIOCgZndF9ub3cYCCABKAgSKQoGd2l0aGluGAkgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uKkYKCktub3duUmVnZXgSCwoHVU5LTk9XThAAEhQKEEhUVFBfSEVBREVSX05BTUUQARIVChFIVFRQX0hFQURFUl9WQUxVRRACOjwKCGRpc2FibGVkEh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGK8IIAEoCFIIZGlzYWJsZWQ6OgoHaWdub3JlZBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiwCCABKAhSB2lnbm9yZWQ6OgoIcmVxdWlyZWQSHS5nb29nbGUucHJvdG9idWYuT25lb2ZPcHRpb25zGK8IIAEoCFIIcmVxdWlyZWQ6SgoFcnVsZXMSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGK8IIAEoCzIULnZhbGlkYXRlLkZpZWxkUnVsZXNSBXJ1bGVzQlAKGmlvLmVudm95cHJveHkucGd2LnZhbGlkYXRlWjJnaXRodWIuY29tL2Vudm95cHJveHkvcHJvdG9jLWdlbi12YWxpZGF0ZS92YWxpZGF0ZQ", [file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_timestamp]); + +/** + * FieldRules encapsulates the rules for each type of field. Depending on the + * field, the correct set should be used to ensure proper validations. + * + * @generated from message validate.FieldRules + */ +export type FieldRules = Message<"validate.FieldRules"> & { + /** + * @generated from field: optional validate.MessageRules message = 17; + */ + message?: MessageRules; + + /** + * @generated from oneof validate.FieldRules.type + */ + type: { + /** + * Scalar Field Types + * + * @generated from field: validate.FloatRules float = 1; + */ + value: FloatRules; + case: "float"; + } | { + /** + * @generated from field: validate.DoubleRules double = 2; + */ + value: DoubleRules; + case: "double"; + } | { + /** + * @generated from field: validate.Int32Rules int32 = 3; + */ + value: Int32Rules; + case: "int32"; + } | { + /** + * @generated from field: validate.Int64Rules int64 = 4; + */ + value: Int64Rules; + case: "int64"; + } | { + /** + * @generated from field: validate.UInt32Rules uint32 = 5; + */ + value: UInt32Rules; + case: "uint32"; + } | { + /** + * @generated from field: validate.UInt64Rules uint64 = 6; + */ + value: UInt64Rules; + case: "uint64"; + } | { + /** + * @generated from field: validate.SInt32Rules sint32 = 7; + */ + value: SInt32Rules; + case: "sint32"; + } | { + /** + * @generated from field: validate.SInt64Rules sint64 = 8; + */ + value: SInt64Rules; + case: "sint64"; + } | { + /** + * @generated from field: validate.Fixed32Rules fixed32 = 9; + */ + value: Fixed32Rules; + case: "fixed32"; + } | { + /** + * @generated from field: validate.Fixed64Rules fixed64 = 10; + */ + value: Fixed64Rules; + case: "fixed64"; + } | { + /** + * @generated from field: validate.SFixed32Rules sfixed32 = 11; + */ + value: SFixed32Rules; + case: "sfixed32"; + } | { + /** + * @generated from field: validate.SFixed64Rules sfixed64 = 12; + */ + value: SFixed64Rules; + case: "sfixed64"; + } | { + /** + * @generated from field: validate.BoolRules bool = 13; + */ + value: BoolRules; + case: "bool"; + } | { + /** + * @generated from field: validate.StringRules string = 14; + */ + value: StringRules; + case: "string"; + } | { + /** + * @generated from field: validate.BytesRules bytes = 15; + */ + value: BytesRules; + case: "bytes"; + } | { + /** + * Complex Field Types + * + * @generated from field: validate.EnumRules enum = 16; + */ + value: EnumRules; + case: "enum"; + } | { + /** + * @generated from field: validate.RepeatedRules repeated = 18; + */ + value: RepeatedRules; + case: "repeated"; + } | { + /** + * @generated from field: validate.MapRules map = 19; + */ + value: MapRules; + case: "map"; + } | { + /** + * Well-Known Field Types + * + * @generated from field: validate.AnyRules any = 20; + */ + value: AnyRules; + case: "any"; + } | { + /** + * @generated from field: validate.DurationRules duration = 21; + */ + value: DurationRules; + case: "duration"; + } | { + /** + * @generated from field: validate.TimestampRules timestamp = 22; + */ + value: TimestampRules; + case: "timestamp"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message validate.FieldRules. + * Use `create(FieldRulesSchema)` to create a new message. + */ +export const FieldRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 0); + +/** + * FloatRules describes the constraints applied to `float` values + * + * @generated from message validate.FloatRules + */ +export type FloatRules = Message<"validate.FloatRules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional float const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional float lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional float lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional float gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional float gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated float in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated float not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.FloatRules. + * Use `create(FloatRulesSchema)` to create a new message. + */ +export const FloatRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 1); + +/** + * DoubleRules describes the constraints applied to `double` values + * + * @generated from message validate.DoubleRules + */ +export type DoubleRules = Message<"validate.DoubleRules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional double const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional double lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional double lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional double gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional double gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated double in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated double not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.DoubleRules. + * Use `create(DoubleRulesSchema)` to create a new message. + */ +export const DoubleRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 2); + +/** + * Int32Rules describes the constraints applied to `int32` values + * + * @generated from message validate.Int32Rules + */ +export type Int32Rules = Message<"validate.Int32Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional int32 const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional int32 lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional int32 lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional int32 gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional int32 gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated int32 in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated int32 not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.Int32Rules. + * Use `create(Int32RulesSchema)` to create a new message. + */ +export const Int32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 3); + +/** + * Int64Rules describes the constraints applied to `int64` values + * + * @generated from message validate.Int64Rules + */ +export type Int64Rules = Message<"validate.Int64Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional int64 const = 1; + */ + const: bigint; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional int64 lt = 2; + */ + lt: bigint; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional int64 lte = 3; + */ + lte: bigint; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional int64 gt = 4; + */ + gt: bigint; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional int64 gte = 5; + */ + gte: bigint; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated int64 in = 6; + */ + in: bigint[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated int64 not_in = 7; + */ + notIn: bigint[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.Int64Rules. + * Use `create(Int64RulesSchema)` to create a new message. + */ +export const Int64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 4); + +/** + * UInt32Rules describes the constraints applied to `uint32` values + * + * @generated from message validate.UInt32Rules + */ +export type UInt32Rules = Message<"validate.UInt32Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional uint32 const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional uint32 lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional uint32 lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional uint32 gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional uint32 gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated uint32 in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated uint32 not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.UInt32Rules. + * Use `create(UInt32RulesSchema)` to create a new message. + */ +export const UInt32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 5); + +/** + * UInt64Rules describes the constraints applied to `uint64` values + * + * @generated from message validate.UInt64Rules + */ +export type UInt64Rules = Message<"validate.UInt64Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional uint64 const = 1; + */ + const: bigint; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional uint64 lt = 2; + */ + lt: bigint; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional uint64 lte = 3; + */ + lte: bigint; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional uint64 gt = 4; + */ + gt: bigint; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional uint64 gte = 5; + */ + gte: bigint; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated uint64 in = 6; + */ + in: bigint[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated uint64 not_in = 7; + */ + notIn: bigint[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.UInt64Rules. + * Use `create(UInt64RulesSchema)` to create a new message. + */ +export const UInt64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 6); + +/** + * SInt32Rules describes the constraints applied to `sint32` values + * + * @generated from message validate.SInt32Rules + */ +export type SInt32Rules = Message<"validate.SInt32Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional sint32 const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional sint32 lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional sint32 lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional sint32 gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional sint32 gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated sint32 in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated sint32 not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.SInt32Rules. + * Use `create(SInt32RulesSchema)` to create a new message. + */ +export const SInt32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 7); + +/** + * SInt64Rules describes the constraints applied to `sint64` values + * + * @generated from message validate.SInt64Rules + */ +export type SInt64Rules = Message<"validate.SInt64Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional sint64 const = 1; + */ + const: bigint; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional sint64 lt = 2; + */ + lt: bigint; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional sint64 lte = 3; + */ + lte: bigint; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional sint64 gt = 4; + */ + gt: bigint; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional sint64 gte = 5; + */ + gte: bigint; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated sint64 in = 6; + */ + in: bigint[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated sint64 not_in = 7; + */ + notIn: bigint[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.SInt64Rules. + * Use `create(SInt64RulesSchema)` to create a new message. + */ +export const SInt64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 8); + +/** + * Fixed32Rules describes the constraints applied to `fixed32` values + * + * @generated from message validate.Fixed32Rules + */ +export type Fixed32Rules = Message<"validate.Fixed32Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional fixed32 const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional fixed32 lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional fixed32 lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional fixed32 gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional fixed32 gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated fixed32 in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated fixed32 not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.Fixed32Rules. + * Use `create(Fixed32RulesSchema)` to create a new message. + */ +export const Fixed32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 9); + +/** + * Fixed64Rules describes the constraints applied to `fixed64` values + * + * @generated from message validate.Fixed64Rules + */ +export type Fixed64Rules = Message<"validate.Fixed64Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional fixed64 const = 1; + */ + const: bigint; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional fixed64 lt = 2; + */ + lt: bigint; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional fixed64 lte = 3; + */ + lte: bigint; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional fixed64 gt = 4; + */ + gt: bigint; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional fixed64 gte = 5; + */ + gte: bigint; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated fixed64 in = 6; + */ + in: bigint[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated fixed64 not_in = 7; + */ + notIn: bigint[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.Fixed64Rules. + * Use `create(Fixed64RulesSchema)` to create a new message. + */ +export const Fixed64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 10); + +/** + * SFixed32Rules describes the constraints applied to `sfixed32` values + * + * @generated from message validate.SFixed32Rules + */ +export type SFixed32Rules = Message<"validate.SFixed32Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional sfixed32 const = 1; + */ + const: number; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional sfixed32 lt = 2; + */ + lt: number; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional sfixed32 lte = 3; + */ + lte: number; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional sfixed32 gt = 4; + */ + gt: number; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional sfixed32 gte = 5; + */ + gte: number; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated sfixed32 in = 6; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated sfixed32 not_in = 7; + */ + notIn: number[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.SFixed32Rules. + * Use `create(SFixed32RulesSchema)` to create a new message. + */ +export const SFixed32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 11); + +/** + * SFixed64Rules describes the constraints applied to `sfixed64` values + * + * @generated from message validate.SFixed64Rules + */ +export type SFixed64Rules = Message<"validate.SFixed64Rules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional sfixed64 const = 1; + */ + const: bigint; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional sfixed64 lt = 2; + */ + lt: bigint; + + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from field: optional sfixed64 lte = 3; + */ + lte: bigint; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + * + * @generated from field: optional sfixed64 gt = 4; + */ + gt: bigint; + + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + * + * @generated from field: optional sfixed64 gte = 5; + */ + gte: bigint; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated sfixed64 in = 6; + */ + in: bigint[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated sfixed64 not_in = 7; + */ + notIn: bigint[]; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 8; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.SFixed64Rules. + * Use `create(SFixed64RulesSchema)` to create a new message. + */ +export const SFixed64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 12); + +/** + * BoolRules describes the constraints applied to `bool` values + * + * @generated from message validate.BoolRules + */ +export type BoolRules = Message<"validate.BoolRules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional bool const = 1; + */ + const: boolean; +}; + +/** + * Describes the message validate.BoolRules. + * Use `create(BoolRulesSchema)` to create a new message. + */ +export const BoolRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 13); + +/** + * StringRules describe the constraints applied to `string` values + * + * @generated from message validate.StringRules + */ +export type StringRules = Message<"validate.StringRules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional string const = 1; + */ + const: string; + + /** + * Len specifies that this field must be the specified number of + * characters (Unicode code points). Note that the number of + * characters may differ from the number of bytes in the string. + * + * @generated from field: optional uint64 len = 19; + */ + len: bigint; + + /** + * MinLen specifies that this field must be the specified number of + * characters (Unicode code points) at a minimum. Note that the number of + * characters may differ from the number of bytes in the string. + * + * @generated from field: optional uint64 min_len = 2; + */ + minLen: bigint; + + /** + * MaxLen specifies that this field must be the specified number of + * characters (Unicode code points) at a maximum. Note that the number of + * characters may differ from the number of bytes in the string. + * + * @generated from field: optional uint64 max_len = 3; + */ + maxLen: bigint; + + /** + * LenBytes specifies that this field must be the specified number of bytes + * + * @generated from field: optional uint64 len_bytes = 20; + */ + lenBytes: bigint; + + /** + * MinBytes specifies that this field must be the specified number of bytes + * at a minimum + * + * @generated from field: optional uint64 min_bytes = 4; + */ + minBytes: bigint; + + /** + * MaxBytes specifies that this field must be the specified number of bytes + * at a maximum + * + * @generated from field: optional uint64 max_bytes = 5; + */ + maxBytes: bigint; + + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + * + * @generated from field: optional string pattern = 6; + */ + pattern: string; + + /** + * Prefix specifies that this field must have the specified substring at + * the beginning of the string. + * + * @generated from field: optional string prefix = 7; + */ + prefix: string; + + /** + * Suffix specifies that this field must have the specified substring at + * the end of the string. + * + * @generated from field: optional string suffix = 8; + */ + suffix: string; + + /** + * Contains specifies that this field must have the specified substring + * anywhere in the string. + * + * @generated from field: optional string contains = 9; + */ + contains: string; + + /** + * NotContains specifies that this field cannot have the specified substring + * anywhere in the string. + * + * @generated from field: optional string not_contains = 23; + */ + notContains: string; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated string in = 10; + */ + in: string[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated string not_in = 11; + */ + notIn: string[]; + + /** + * WellKnown rules provide advanced constraints against common string + * patterns + * + * @generated from oneof validate.StringRules.well_known + */ + wellKnown: { + /** + * Email specifies that the field must be a valid email address as + * defined by RFC 5322 + * + * @generated from field: bool email = 12; + */ + value: boolean; + case: "email"; + } | { + /** + * Hostname specifies that the field must be a valid hostname as + * defined by RFC 1034. This constraint does not support + * internationalized domain names (IDNs). + * + * @generated from field: bool hostname = 13; + */ + value: boolean; + case: "hostname"; + } | { + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address. + * Valid IPv6 addresses should not include surrounding square brackets. + * + * @generated from field: bool ip = 14; + */ + value: boolean; + case: "ip"; + } | { + /** + * Ipv4 specifies that the field must be a valid IPv4 address. + * + * @generated from field: bool ipv4 = 15; + */ + value: boolean; + case: "ipv4"; + } | { + /** + * Ipv6 specifies that the field must be a valid IPv6 address. Valid + * IPv6 addresses should not include surrounding square brackets. + * + * @generated from field: bool ipv6 = 16; + */ + value: boolean; + case: "ipv6"; + } | { + /** + * Uri specifies that the field must be a valid, absolute URI as defined + * by RFC 3986 + * + * @generated from field: bool uri = 17; + */ + value: boolean; + case: "uri"; + } | { + /** + * UriRef specifies that the field must be a valid URI as defined by RFC + * 3986 and may be relative or absolute. + * + * @generated from field: bool uri_ref = 18; + */ + value: boolean; + case: "uriRef"; + } | { + /** + * Address specifies that the field must be either a valid hostname as + * defined by RFC 1034 (which does not support internationalized domain + * names or IDNs), or it can be a valid IP (v4 or v6). + * + * @generated from field: bool address = 21; + */ + value: boolean; + case: "address"; + } | { + /** + * Uuid specifies that the field must be a valid UUID as defined by + * RFC 4122 + * + * @generated from field: bool uuid = 22; + */ + value: boolean; + case: "uuid"; + } | { + /** + * WellKnownRegex specifies a common well known pattern defined as a regex. + * + * @generated from field: validate.KnownRegex well_known_regex = 24; + */ + value: KnownRegex; + case: "wellKnownRegex"; + } | { case: undefined; value?: undefined }; + + /** + * This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable + * strict header validation. + * By default, this is true, and HTTP header validations are RFC-compliant. + * Setting to false will enable a looser validations that only disallows + * \r\n\0 characters, which can be used to bypass header matching rules. + * + * @generated from field: optional bool strict = 25 [default = true]; + */ + strict: boolean; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 26; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.StringRules. + * Use `create(StringRulesSchema)` to create a new message. + */ +export const StringRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 14); + +/** + * BytesRules describe the constraints applied to `bytes` values + * + * @generated from message validate.BytesRules + */ +export type BytesRules = Message<"validate.BytesRules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional bytes const = 1; + */ + const: Uint8Array; + + /** + * Len specifies that this field must be the specified number of bytes + * + * @generated from field: optional uint64 len = 13; + */ + len: bigint; + + /** + * MinLen specifies that this field must be the specified number of bytes + * at a minimum + * + * @generated from field: optional uint64 min_len = 2; + */ + minLen: bigint; + + /** + * MaxLen specifies that this field must be the specified number of bytes + * at a maximum + * + * @generated from field: optional uint64 max_len = 3; + */ + maxLen: bigint; + + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + * + * @generated from field: optional string pattern = 4; + */ + pattern: string; + + /** + * Prefix specifies that this field must have the specified bytes at the + * beginning of the string. + * + * @generated from field: optional bytes prefix = 5; + */ + prefix: Uint8Array; + + /** + * Suffix specifies that this field must have the specified bytes at the + * end of the string. + * + * @generated from field: optional bytes suffix = 6; + */ + suffix: Uint8Array; + + /** + * Contains specifies that this field must have the specified bytes + * anywhere in the string. + * + * @generated from field: optional bytes contains = 7; + */ + contains: Uint8Array; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated bytes in = 8; + */ + in: Uint8Array[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated bytes not_in = 9; + */ + notIn: Uint8Array[]; + + /** + * WellKnown rules provide advanced constraints against common byte + * patterns + * + * @generated from oneof validate.BytesRules.well_known + */ + wellKnown: { + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address in + * byte format + * + * @generated from field: bool ip = 10; + */ + value: boolean; + case: "ip"; + } | { + /** + * Ipv4 specifies that the field must be a valid IPv4 address in byte + * format + * + * @generated from field: bool ipv4 = 11; + */ + value: boolean; + case: "ipv4"; + } | { + /** + * Ipv6 specifies that the field must be a valid IPv6 address in byte + * format + * + * @generated from field: bool ipv6 = 12; + */ + value: boolean; + case: "ipv6"; + } | { case: undefined; value?: undefined }; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 14; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.BytesRules. + * Use `create(BytesRulesSchema)` to create a new message. + */ +export const BytesRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 15); + +/** + * EnumRules describe the constraints applied to enum values + * + * @generated from message validate.EnumRules + */ +export type EnumRules = Message<"validate.EnumRules"> & { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional int32 const = 1; + */ + const: number; + + /** + * DefinedOnly specifies that this field must be only one of the defined + * values for this enum, failing on any undefined value. + * + * @generated from field: optional bool defined_only = 2; + */ + definedOnly: boolean; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated int32 in = 3; + */ + in: number[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated int32 not_in = 4; + */ + notIn: number[]; +}; + +/** + * Describes the message validate.EnumRules. + * Use `create(EnumRulesSchema)` to create a new message. + */ +export const EnumRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 16); + +/** + * MessageRules describe the constraints applied to embedded message values. + * For message-type fields, validation is performed recursively. + * + * @generated from message validate.MessageRules + */ +export type MessageRules = Message<"validate.MessageRules"> & { + /** + * Skip specifies that the validation rules of this field should not be + * evaluated + * + * @generated from field: optional bool skip = 1; + */ + skip: boolean; + + /** + * Required specifies that this field must be set + * + * @generated from field: optional bool required = 2; + */ + required: boolean; +}; + +/** + * Describes the message validate.MessageRules. + * Use `create(MessageRulesSchema)` to create a new message. + */ +export const MessageRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 17); + +/** + * RepeatedRules describe the constraints applied to `repeated` values + * + * @generated from message validate.RepeatedRules + */ +export type RepeatedRules = Message<"validate.RepeatedRules"> & { + /** + * MinItems specifies that this field must have the specified number of + * items at a minimum + * + * @generated from field: optional uint64 min_items = 1; + */ + minItems: bigint; + + /** + * MaxItems specifies that this field must have the specified number of + * items at a maximum + * + * @generated from field: optional uint64 max_items = 2; + */ + maxItems: bigint; + + /** + * Unique specifies that all elements in this field must be unique. This + * constraint is only applicable to scalar and enum types (messages are not + * supported). + * + * @generated from field: optional bool unique = 3; + */ + unique: boolean; + + /** + * Items specifies the constraints to be applied to each item in the field. + * Repeated message fields will still execute validation against each item + * unless skip is specified here. + * + * @generated from field: optional validate.FieldRules items = 4; + */ + items?: FieldRules; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 5; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.RepeatedRules. + * Use `create(RepeatedRulesSchema)` to create a new message. + */ +export const RepeatedRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 18); + +/** + * MapRules describe the constraints applied to `map` values + * + * @generated from message validate.MapRules + */ +export type MapRules = Message<"validate.MapRules"> & { + /** + * MinPairs specifies that this field must have the specified number of + * KVs at a minimum + * + * @generated from field: optional uint64 min_pairs = 1; + */ + minPairs: bigint; + + /** + * MaxPairs specifies that this field must have the specified number of + * KVs at a maximum + * + * @generated from field: optional uint64 max_pairs = 2; + */ + maxPairs: bigint; + + /** + * NoSparse specifies values in this field cannot be unset. This only + * applies to map's with message value types. + * + * @generated from field: optional bool no_sparse = 3; + */ + noSparse: boolean; + + /** + * Keys specifies the constraints to be applied to each key in the field. + * + * @generated from field: optional validate.FieldRules keys = 4; + */ + keys?: FieldRules; + + /** + * Values specifies the constraints to be applied to the value of each key + * in the field. Message values will still have their validations evaluated + * unless skip is specified here. + * + * @generated from field: optional validate.FieldRules values = 5; + */ + values?: FieldRules; + + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from field: optional bool ignore_empty = 6; + */ + ignoreEmpty: boolean; +}; + +/** + * Describes the message validate.MapRules. + * Use `create(MapRulesSchema)` to create a new message. + */ +export const MapRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 19); + +/** + * AnyRules describe constraints applied exclusively to the + * `google.protobuf.Any` well-known type + * + * @generated from message validate.AnyRules + */ +export type AnyRules = Message<"validate.AnyRules"> & { + /** + * Required specifies that this field must be set + * + * @generated from field: optional bool required = 1; + */ + required: boolean; + + /** + * In specifies that this field's `type_url` must be equal to one of the + * specified values. + * + * @generated from field: repeated string in = 2; + */ + in: string[]; + + /** + * NotIn specifies that this field's `type_url` must not be equal to any of + * the specified values. + * + * @generated from field: repeated string not_in = 3; + */ + notIn: string[]; +}; + +/** + * Describes the message validate.AnyRules. + * Use `create(AnyRulesSchema)` to create a new message. + */ +export const AnyRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 20); + +/** + * DurationRules describe the constraints applied exclusively to the + * `google.protobuf.Duration` well-known type + * + * @generated from message validate.DurationRules + */ +export type DurationRules = Message<"validate.DurationRules"> & { + /** + * Required specifies that this field must be set + * + * @generated from field: optional bool required = 1; + */ + required: boolean; + + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional google.protobuf.Duration const = 2; + */ + const?: Duration; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional google.protobuf.Duration lt = 3; + */ + lt?: Duration; + + /** + * Lt specifies that this field must be less than the specified value, + * inclusive + * + * @generated from field: optional google.protobuf.Duration lte = 4; + */ + lte?: Duration; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + * + * @generated from field: optional google.protobuf.Duration gt = 5; + */ + gt?: Duration; + + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + * + * @generated from field: optional google.protobuf.Duration gte = 6; + */ + gte?: Duration; + + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from field: repeated google.protobuf.Duration in = 7; + */ + in: Duration[]; + + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from field: repeated google.protobuf.Duration not_in = 8; + */ + notIn: Duration[]; +}; + +/** + * Describes the message validate.DurationRules. + * Use `create(DurationRulesSchema)` to create a new message. + */ +export const DurationRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 21); + +/** + * TimestampRules describe the constraints applied exclusively to the + * `google.protobuf.Timestamp` well-known type + * + * @generated from message validate.TimestampRules + */ +export type TimestampRules = Message<"validate.TimestampRules"> & { + /** + * Required specifies that this field must be set + * + * @generated from field: optional bool required = 1; + */ + required: boolean; + + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from field: optional google.protobuf.Timestamp const = 2; + */ + const?: Timestamp; + + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from field: optional google.protobuf.Timestamp lt = 3; + */ + lt?: Timestamp; + + /** + * Lte specifies that this field must be less than the specified value, + * inclusive + * + * @generated from field: optional google.protobuf.Timestamp lte = 4; + */ + lte?: Timestamp; + + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + * + * @generated from field: optional google.protobuf.Timestamp gt = 5; + */ + gt?: Timestamp; + + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + * + * @generated from field: optional google.protobuf.Timestamp gte = 6; + */ + gte?: Timestamp; + + /** + * LtNow specifies that this must be less than the current time. LtNow + * can only be used with the Within rule. + * + * @generated from field: optional bool lt_now = 7; + */ + ltNow: boolean; + + /** + * GtNow specifies that this must be greater than the current time. GtNow + * can only be used with the Within rule. + * + * @generated from field: optional bool gt_now = 8; + */ + gtNow: boolean; + + /** + * Within specifies that this field must be within this duration of the + * current time. This constraint can be used alone or with the LtNow and + * GtNow rules. + * + * @generated from field: optional google.protobuf.Duration within = 9; + */ + within?: Duration; +}; + +/** + * Describes the message validate.TimestampRules. + * Use `create(TimestampRulesSchema)` to create a new message. + */ +export const TimestampRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_validate_validate, 22); + +/** + * WellKnownRegex contain some well-known patterns. + * + * @generated from enum validate.KnownRegex + */ +export enum KnownRegex { + /** + * @generated from enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + + /** + * HTTP header name as defined by RFC 7230. + * + * @generated from enum value: HTTP_HEADER_NAME = 1; + */ + HTTP_HEADER_NAME = 1, + + /** + * HTTP header value as defined by RFC 7230. + * + * @generated from enum value: HTTP_HEADER_VALUE = 2; + */ + HTTP_HEADER_VALUE = 2, +} + +/** + * Describes the enum validate.KnownRegex. + */ +export const KnownRegexSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_validate_validate, 0); + +/** + * Disabled nullifies any validation rules for this message, including any + * message fields associated with it that do support validation. + * + * @generated from extension: optional bool disabled = 1071; + */ +export const disabled: GenExtension = /*@__PURE__*/ + extDesc(file_validate_validate, 0); + +/** + * Ignore skips generation of validation methods for this message. + * + * @generated from extension: optional bool ignored = 1072; + */ +export const ignored: GenExtension = /*@__PURE__*/ + extDesc(file_validate_validate, 1); + +/** + * Required ensures that exactly one the field options in a oneof is set; + * validation fails if no fields in the oneof are set. + * + * @generated from extension: optional bool required = 1071; + */ +export const required: GenExtension = /*@__PURE__*/ + extDesc(file_validate_validate, 2); + +/** + * Rules specify the validations to be performed on this field. By default, + * no validation is performed against a field. + * + * @generated from extension: optional validate.FieldRules rules = 1071; + */ +export const rules: GenExtension = /*@__PURE__*/ + extDesc(file_validate_validate, 3); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts b/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts deleted file mode 100644 index f355c799..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status.ts +++ /dev/null @@ -1,361 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: xds/annotations/v3/status.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "xds.annotations.v3"; - -export enum PackageVersionStatus { - /** UNKNOWN - Unknown package version status. */ - UNKNOWN = 0, - /** FROZEN - This version of the package is frozen. */ - FROZEN = 1, - /** ACTIVE - This version of the package is the active development version. */ - ACTIVE = 2, - /** - * NEXT_MAJOR_VERSION_CANDIDATE - This version of the package is the candidate for the next major version. It - * is typically machine generated from the active development version. - */ - NEXT_MAJOR_VERSION_CANDIDATE = 3, - UNRECOGNIZED = -1, -} - -export function packageVersionStatusFromJSON(object: any): PackageVersionStatus { - switch (object) { - case 0: - case "UNKNOWN": - return PackageVersionStatus.UNKNOWN; - case 1: - case "FROZEN": - return PackageVersionStatus.FROZEN; - case 2: - case "ACTIVE": - return PackageVersionStatus.ACTIVE; - case 3: - case "NEXT_MAJOR_VERSION_CANDIDATE": - return PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE; - case -1: - case "UNRECOGNIZED": - default: - return PackageVersionStatus.UNRECOGNIZED; - } -} - -export function packageVersionStatusToJSON(object: PackageVersionStatus): string { - switch (object) { - case PackageVersionStatus.UNKNOWN: - return "UNKNOWN"; - case PackageVersionStatus.FROZEN: - return "FROZEN"; - case PackageVersionStatus.ACTIVE: - return "ACTIVE"; - case PackageVersionStatus.NEXT_MAJOR_VERSION_CANDIDATE: - return "NEXT_MAJOR_VERSION_CANDIDATE"; - case PackageVersionStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface FileStatusAnnotation { - /** The entity is work-in-progress and subject to breaking changes. */ - workInProgress: boolean; -} - -export interface MessageStatusAnnotation { - /** The entity is work-in-progress and subject to breaking changes. */ - workInProgress: boolean; -} - -export interface FieldStatusAnnotation { - /** The entity is work-in-progress and subject to breaking changes. */ - workInProgress: boolean; -} - -export interface StatusAnnotation { - /** The entity is work-in-progress and subject to breaking changes. */ - workInProgress: boolean; - /** The entity belongs to a package with the given version status. */ - packageVersionStatus: PackageVersionStatus; -} - -function createBaseFileStatusAnnotation(): FileStatusAnnotation { - return { workInProgress: false }; -} - -export const FileStatusAnnotation: MessageFns = { - encode(message: FileStatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.workInProgress !== false) { - writer.uint32(8).bool(message.workInProgress); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FileStatusAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileStatusAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.workInProgress = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FileStatusAnnotation { - return { workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false }; - }, - - toJSON(message: FileStatusAnnotation): unknown { - const obj: any = {}; - if (message.workInProgress !== false) { - obj.workInProgress = message.workInProgress; - } - return obj; - }, - - create, I>>(base?: I): FileStatusAnnotation { - return FileStatusAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FileStatusAnnotation { - const message = createBaseFileStatusAnnotation(); - message.workInProgress = object.workInProgress ?? false; - return message; - }, -}; - -function createBaseMessageStatusAnnotation(): MessageStatusAnnotation { - return { workInProgress: false }; -} - -export const MessageStatusAnnotation: MessageFns = { - encode(message: MessageStatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.workInProgress !== false) { - writer.uint32(8).bool(message.workInProgress); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): MessageStatusAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageStatusAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.workInProgress = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): MessageStatusAnnotation { - return { workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false }; - }, - - toJSON(message: MessageStatusAnnotation): unknown { - const obj: any = {}; - if (message.workInProgress !== false) { - obj.workInProgress = message.workInProgress; - } - return obj; - }, - - create, I>>(base?: I): MessageStatusAnnotation { - return MessageStatusAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MessageStatusAnnotation { - const message = createBaseMessageStatusAnnotation(); - message.workInProgress = object.workInProgress ?? false; - return message; - }, -}; - -function createBaseFieldStatusAnnotation(): FieldStatusAnnotation { - return { workInProgress: false }; -} - -export const FieldStatusAnnotation: MessageFns = { - encode(message: FieldStatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.workInProgress !== false) { - writer.uint32(8).bool(message.workInProgress); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FieldStatusAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldStatusAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.workInProgress = reader.bool(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): FieldStatusAnnotation { - return { workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false }; - }, - - toJSON(message: FieldStatusAnnotation): unknown { - const obj: any = {}; - if (message.workInProgress !== false) { - obj.workInProgress = message.workInProgress; - } - return obj; - }, - - create, I>>(base?: I): FieldStatusAnnotation { - return FieldStatusAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FieldStatusAnnotation { - const message = createBaseFieldStatusAnnotation(); - message.workInProgress = object.workInProgress ?? false; - return message; - }, -}; - -function createBaseStatusAnnotation(): StatusAnnotation { - return { workInProgress: false, packageVersionStatus: 0 }; -} - -export const StatusAnnotation: MessageFns = { - encode(message: StatusAnnotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.workInProgress !== false) { - writer.uint32(8).bool(message.workInProgress); - } - if (message.packageVersionStatus !== 0) { - writer.uint32(16).int32(message.packageVersionStatus); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): StatusAnnotation { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStatusAnnotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.workInProgress = reader.bool(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.packageVersionStatus = reader.int32() as any; - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): StatusAnnotation { - return { - workInProgress: isSet(object.workInProgress) ? globalThis.Boolean(object.workInProgress) : false, - packageVersionStatus: isSet(object.packageVersionStatus) - ? packageVersionStatusFromJSON(object.packageVersionStatus) - : 0, - }; - }, - - toJSON(message: StatusAnnotation): unknown { - const obj: any = {}; - if (message.workInProgress !== false) { - obj.workInProgress = message.workInProgress; - } - if (message.packageVersionStatus !== 0) { - obj.packageVersionStatus = packageVersionStatusToJSON(message.packageVersionStatus); - } - return obj; - }, - - create, I>>(base?: I): StatusAnnotation { - return StatusAnnotation.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): StatusAnnotation { - const message = createBaseStatusAnnotation(); - message.workInProgress = object.workInProgress ?? false; - message.packageVersionStatus = object.packageVersionStatus ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts new file mode 100644 index 00000000..e3687e0c --- /dev/null +++ b/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts @@ -0,0 +1,80 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" +// @generated from file xds/annotations/v3/status.proto (package xds.annotations.v3, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file xds/annotations/v3/status.proto. + */ +export const file_xds_annotations_v3_status: GenFile = /*@__PURE__*/ + fileDesc("Ch94ZHMvYW5ub3RhdGlvbnMvdjMvc3RhdHVzLnByb3RvEhJ4ZHMuYW5ub3RhdGlvbnMudjMidgoQU3RhdHVzQW5ub3RhdGlvbhIYChB3b3JrX2luX3Byb2dyZXNzGAEgASgIEkgKFnBhY2thZ2VfdmVyc2lvbl9zdGF0dXMYAiABKA4yKC54ZHMuYW5ub3RhdGlvbnMudjMuUGFja2FnZVZlcnNpb25TdGF0dXMqXQoUUGFja2FnZVZlcnNpb25TdGF0dXMSCwoHVU5LTk9XThAAEgoKBkZST1pFThABEgoKBkFDVElWRRACEiAKHE5FWFRfTUFKT1JfVkVSU0lPTl9DQU5ESURBVEUQA0IrWilnaXRodWIuY29tL2NuY2YveGRzL2dvL3hkcy9hbm5vdGF0aW9ucy92M2IGcHJvdG8z"); + +/** + * @generated from message xds.annotations.v3.StatusAnnotation + */ +export type StatusAnnotation = Message<"xds.annotations.v3.StatusAnnotation"> & { + /** + * The entity is work-in-progress and subject to breaking changes. + * + * @generated from field: bool work_in_progress = 1; + */ + workInProgress: boolean; + + /** + * The entity belongs to a package with the given version status. + * + * @generated from field: xds.annotations.v3.PackageVersionStatus package_version_status = 2; + */ + packageVersionStatus: PackageVersionStatus; +}; + +/** + * Describes the message xds.annotations.v3.StatusAnnotation. + * Use `create(StatusAnnotationSchema)` to create a new message. + */ +export const StatusAnnotationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_xds_annotations_v3_status, 0); + +/** + * @generated from enum xds.annotations.v3.PackageVersionStatus + */ +export enum PackageVersionStatus { + /** + * Unknown package version status. + * + * @generated from enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + + /** + * This version of the package is frozen. + * + * @generated from enum value: FROZEN = 1; + */ + FROZEN = 1, + + /** + * This version of the package is the active development version. + * + * @generated from enum value: ACTIVE = 2; + */ + ACTIVE = 2, + + /** + * This version of the package is the candidate for the next major version. It + * is typically machine generated from the active development version. + * + * @generated from enum value: NEXT_MAJOR_VERSION_CANDIDATE = 3; + */ + NEXT_MAJOR_VERSION_CANDIDATE = 3, +} + +/** + * Describes the enum xds.annotations.v3.PackageVersionStatus. + */ +export const PackageVersionStatusSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_xds_annotations_v3_status, 0); + diff --git a/packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts b/packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts deleted file mode 100644 index 7e885f3b..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/xds/core/v3/context_params.ts +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.7.7 -// protoc v6.32.1 -// source: xds/core/v3/context_params.proto - -/* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; - -export const protobufPackage = "xds.core.v3"; - -/** - * Additional parameters that can be used to select resource variants. These include any - * global context parameters, per-resource type client feature capabilities and per-resource - * type functional attributes. All per-resource type attributes will be `xds.resource.` - * prefixed and some of these are documented below: - * `xds.resource.listening_address`: The value is "IP:port" (e.g. "10.1.1.3:8080") which is - * the listening address of a Listener. Used in a Listener resource query. - */ -export interface ContextParams { - params: { [key: string]: string }; -} - -export interface ContextParams_ParamsEntry { - key: string; - value: string; -} - -function createBaseContextParams(): ContextParams { - return { params: {} }; -} - -export const ContextParams: MessageFns = { - encode(message: ContextParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - Object.entries(message.params).forEach(([key, value]) => { - ContextParams_ParamsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); - }); - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ContextParams { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContextParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - const entry1 = ContextParams_ParamsEntry.decode(reader, reader.uint32()); - if (entry1.value !== undefined) { - message.params[entry1.key] = entry1.value; - } - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ContextParams { - return { - params: isObject(object.params) - ? Object.entries(object.params).reduce<{ [key: string]: string }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}) - : {}, - }; - }, - - toJSON(message: ContextParams): unknown { - const obj: any = {}; - if (message.params) { - const entries = Object.entries(message.params); - if (entries.length > 0) { - obj.params = {}; - entries.forEach(([k, v]) => { - obj.params[k] = v; - }); - } - } - return obj; - }, - - create, I>>(base?: I): ContextParams { - return ContextParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ContextParams { - const message = createBaseContextParams(); - message.params = Object.entries(object.params ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = globalThis.String(value); - } - return acc; - }, {}); - return message; - }, -}; - -function createBaseContextParams_ParamsEntry(): ContextParams_ParamsEntry { - return { key: "", value: "" }; -} - -export const ContextParams_ParamsEntry: MessageFns = { - encode(message: ContextParams_ParamsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ContextParams_ParamsEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContextParams_ParamsEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ContextParams_ParamsEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? globalThis.String(object.value) : "", - }; - }, - - toJSON(message: ContextParams_ParamsEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== "") { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): ContextParams_ParamsEntry { - return ContextParams_ParamsEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ContextParams_ParamsEntry { - const message = createBaseContextParams_ParamsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isObject(value: any): boolean { - return typeof value === "object" && value !== null; -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export interface MessageFns { - encode(message: T, writer?: BinaryWriter): BinaryWriter; - decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; -} diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index ff00b7a9..9dd61a9c 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -124,6 +124,7 @@ export async function generateBuildOutput( const normalizedBundleDir = normalize(relative(rootDir, opts.outputDirectoryBasePath)); updateOrCreateGitignore(rootDir, [`/${normalizedBundleDir}/`]); await copy(join(appDir, "node_modules/@apphosting/adapter-nextjs"), join(opts.outputDirectoryAppPath, "adapter"), { overwrite: true }); + spawnSync("npm", ["i", "--omit=dev"], { shell: true, cwd: join(opts.outputDirectoryAppPath, "adapter")}); return; } @@ -174,7 +175,7 @@ export async function generateBundleYaml( const outputBundle: OutputBundleConfig = { version: "v1", runConfig: { - runCommand: `cd ${normalize(relative(cwd, opts.outputDirectoryAppPath))} && node ./adapter/dist/bin/serve.cjs`, + runCommand: `cd ${normalize(relative(cwd, opts.outputDirectoryAppPath))} && node ./adapter/dist/bin/serve.js`, }, metadata: { ...adapterMetadata, From d8d2dc266fa451baa51da7c05d933da275295c30 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 22 Oct 2025 17:07:47 -0700 Subject: [PATCH 08/14] Service extension callouts --- package-lock.json | 166 +++++ .../@apphosting/adapter-nextjs/package.json | 3 +- .../adapter-nextjs/src/bin/serve.ts | 634 +++++++++++------- .../@apphosting/adapter-nextjs/src/utils.ts | 20 +- 4 files changed, 583 insertions(+), 240 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0932af6d..ef73e749 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26037,6 +26037,16 @@ } } }, + "node_modules/xhr2": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz", + "integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/xmlcreate": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", @@ -26347,6 +26357,8 @@ "apphosting-adapter-nextjs-serve": "dist/bin/serve.js" }, "devDependencies": { + "@angular/platform-server": "^20.3.6", + "@angular/ssr": "^20.3.6", "@bufbuild/buf": "^1.58.0", "@bufbuild/protobuf": "^2.9.0", "@bufbuild/protoc-gen-es": "^2.9.0", @@ -26409,6 +26421,151 @@ } } }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/common": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.6.tgz", + "integrity": "sha512-+gHMuFe0wz4f+vfGZ2q+fSQSYaY7KlN7QdDrFqLnA7H2sythzhXvRbXEtp4DkPjihh9gupXg2MeLh1ROy5AfSw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@angular/core": "20.3.6", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/compiler": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.6.tgz", + "integrity": "sha512-OdjXBsAsnn7qiW6fSHClwn9XwjVxhtO9+RbDc6Mf+YPCnJq0s8T78H2fc8VdJFp/Rs+tMZcwwjd9VZPm8+2XWA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/core": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.6.tgz", + "integrity": "sha512-sDURQWnjwE4Y750u/5qwkZEYMoI4CrKghnx4aKulxCnohR3//C78wvz6p8MtCuqYfzGkdQZDYFg8tgAz17qgPw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@angular/compiler": "20.3.6", + "rxjs": "^6.5.3 || ^7.4.0", + "zone.js": "~0.15.0" + }, + "peerDependenciesMeta": { + "@angular/compiler": { + "optional": true + }, + "zone.js": { + "optional": true + } + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/platform-browser": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.6.tgz", + "integrity": "sha512-gFp1yd+HtRN8XdpMatRLO5w6FLIzsnF31lD2Duo4BUTCoMAMdfaNT6FtcvNdKu7ANo27Ke26fxEEE2bh6FU98A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@angular/animations": "20.3.6", + "@angular/common": "20.3.6", + "@angular/core": "20.3.6" + }, + "peerDependenciesMeta": { + "@angular/animations": { + "optional": true + } + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/platform-server": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/platform-server/-/platform-server-20.3.6.tgz", + "integrity": "sha512-fWF20pZYt8+4ZbNEwQsSgvBc11g8QWiVW7a0ybPvn7fy4LsTLWPzpolGK54k3FqWTQsZfzt+tVcNS709FPETfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0", + "xhr2": "^0.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@angular/common": "20.3.6", + "@angular/compiler": "20.3.6", + "@angular/core": "20.3.6", + "@angular/platform-browser": "20.3.6", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/router": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.6.tgz", + "integrity": "sha512-fSAYOR9nKpH5PoBYFNdII3nAFl2maUrYiISU33CnGwb7J7Q0s09k231c/P5tVN4URi+jdADVwiBI8cIYk8SVrg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@angular/common": "20.3.6", + "@angular/core": "20.3.6", + "@angular/platform-browser": "20.3.6", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "packages/@apphosting/adapter-nextjs/node_modules/@angular/ssr": { + "version": "20.3.6", + "resolved": "https://registry.npmjs.org/@angular/ssr/-/ssr-20.3.6.tgz", + "integrity": "sha512-YABzCGfjwQ+WSUuInwBGS35pNO2zUHJeCzyj6CZ0sqRVR0qt3KvEzk1RVvR33X1bKePFHurn8NYPkcvLSpBvhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": "^20.0.0", + "@angular/core": "^20.0.0", + "@angular/platform-server": "^20.0.0", + "@angular/router": "^20.0.0" + }, + "peerDependenciesMeta": { + "@angular/platform-server": { + "optional": true + } + } + }, "packages/@apphosting/adapter-nextjs/node_modules/@grpc/grpc-js": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.0.tgz", @@ -27141,6 +27298,15 @@ "node": ">=12" } }, + "packages/@apphosting/adapter-nextjs/node_modules/zone.js": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", + "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "packages/@apphosting/build": { "version": "0.1.6", "license": "Apache-2.0", diff --git a/packages/@apphosting/adapter-nextjs/package.json b/packages/@apphosting/adapter-nextjs/package.json index 569dd8fa..1886ba02 100644 --- a/packages/@apphosting/adapter-nextjs/package.json +++ b/packages/@apphosting/adapter-nextjs/package.json @@ -46,8 +46,6 @@ "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", - "@connectrpc/connect": "^2.1.0", - "@grpc/grpc-js": "^1.14.0", "fastify": "^5.6.1", "fs-extra": "^11.1.1", "yaml": "^2.3.4" @@ -61,6 +59,7 @@ } }, "devDependencies": { + "@connectrpc/connect": "^2.1.0", "@bufbuild/buf": "^1.58.0", "@bufbuild/protobuf": "^2.9.0", "@bufbuild/protoc-gen-es": "^2.9.0", diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index 2d5d2d1c..c1f3c9c8 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -1,16 +1,17 @@ +#! /usr/bin/env node import { readFileSync } from "node:fs"; import { ServerResponse, IncomingMessage } from "node:http"; import { join } from "node:path"; import fastify from "fastify"; -import { ExternalProcessor, ProcessingRequest } from "../protos/envoy/service/ext_proc/v3/external_processor_pb.js" - -import { ConnectRouter } from "@connectrpc/connect"; +import { CommonResponse_ResponseStatus, ExternalProcessor } from "../protos/envoy/service/ext_proc/v3/external_processor_pb.js" import { fastifyConnectPlugin } from "@connectrpc/connect-fastify"; -import { NEXT_REQUEST_META } from "next/dist/server/request-meta.js"; +import type { Http2ServerRequest, Http2ServerResponse } from "node:http2"; +import { HeaderMap, HeaderValue } from "../protos/envoy/config/core/v3/base_pb.js"; +import { Socket } from "node:net"; -const dir = process.cwd(); +const dir = join(process.cwd(), process.argv[2] || ".next/standalone"); const port = parseInt(process.env.PORT!, 10) || 3000 const hostname = process.env.HOSTNAME || '0.0.0.0' @@ -20,192 +21,21 @@ process.env.NODE_ENV = "production"; let keepAliveTimeout: number | undefined = parseInt(process.env.KEEP_ALIVE_TIMEOUT!, 10); -// (bundle.yaml) -// service_calls: -// - matcher: -// - path: /api/** -// - header_exists: x-foo -// on: -// - request_headers -// - response_headers - -// rewrites, redirects (before_files, after_files) - const conf = JSON.parse(readFileSync(join(dir, ".next", "required-server-files.json"), "utf-8")).config; -/* -const extProcService: ExternalProcessorServer = { - process(call): void { - console.log('New processing stream initiated...'); - - call.on('data', (request: ProcessingRequest) => { - // 1. Handle Request Headers - if (request.requestHeaders) { - console.log('Processing REQUEST_HEADERS...'); - - const newHeader: HeaderValueOption = { - header: { - key: 'x-callout-processed-ts', - rawValue: Uint8Array.from(Buffer.from('true')), - value: "true", - }, - appendAction: HeaderValueOption_HeaderAppendAction.APPEND_IF_EXISTS_OR_ADD, - append: true, - keepEmptyValue: true, - }; - - const response: ProcessingResponse = { - requestHeaders: { - response: { - headerMutation: { - setHeaders: [newHeader], - removeHeaders: [], - }, - status: CommonResponse_ResponseStatus.CONTINUE, - bodyMutation: undefined, - trailers: undefined, - clearRouteCache: false, - } - }, - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; - call.write(response); - } - - // 2. Handle Request Body - else if (request.requestBody) { - console.log('Processing REQUEST_BODY...'); - - const response: ProcessingResponse = { - requestBody: { - response: { - headerMutation: undefined, - status: CommonResponse_ResponseStatus.CONTINUE, - bodyMutation: undefined, - trailers: undefined, - clearRouteCache: false, - }, - }, - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; - call.write(response); - } - - // 3. Handle Request Trailers - else if (request.requestTrailers) { - console.log('Processing REQUEST_TRAILERS...'); - - const response: ProcessingResponse = { - requestTrailers: { - headerMutation: { - setHeaders: [], - removeHeaders: [], - }, - }, - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; - call.write(response); - } - - // 4. Handle Response Headers - else if (request.responseHeaders) { - console.log('Processing RESPONSE_HEADERS...'); - - const response: ProcessingResponse = { - // --- The oneof property --- - responseHeaders: { - response: { - headerMutation: undefined, - status: CommonResponse_ResponseStatus.CONTINUE, - bodyMutation: undefined, - trailers: undefined, - clearRouteCache: false, - } - }, - // --- Required top-level properties --- - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; - call.write(response); - } - - // 5. Handle Response Body - else if (request.responseBody) { - console.log('Processing RESPONSE_BODY...'); - - const response: ProcessingResponse = { - // --- The oneof property --- - responseBody: { - response: { - headerMutation: undefined, - status: CommonResponse_ResponseStatus.CONTINUE, - bodyMutation: undefined, - trailers: undefined, - clearRouteCache: false, - }, - }, - // --- Required top-level properties --- - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; - call.write(response); - } - - // 6. Handle Response Trailers - else if (request.responseTrailers) { - console.log('Processing RESPONSE_TRAILERS...'); - - const response: ProcessingResponse = { - // --- The oneof property --- - responseTrailers: { - headerMutation: { - setHeaders: [], - removeHeaders: [], - }, - }, - // --- Required top-level properties --- - dynamicMetadata: undefined, - modeOverride: undefined, - overrideMessageTimeout: undefined, - }; - call.write(response); - } - }); - - call.on('error', (err) => { - console.error('Stream error:', err); - }); - - call.on('end', () => { - console.log('Processing stream ended.'); - call.end(); - }); - }, -}; -*/ - -async function *processCalls(calls: AsyncIterable) { - for await (const call of calls) { - console.log(call); - // yield { }; - } -} - -function routes(router: ConnectRouter) { - router.service(ExternalProcessor, { process: processCalls }); -} process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(conf); process.setMaxListeners(1_000); +const resolveMiddleware = import(join(dir, ".next/server/middleware.js")); + +// TODO don't hardcode +const matchers = [ + '/about/:path*', + '/((?!_next|firebase|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)', + '/private/:path*', +].map(it => new RegExp(it)); + if ( Number.isNaN(keepAliveTimeout) || !Number.isFinite(keepAliveTimeout) || @@ -214,38 +44,21 @@ if ( keepAliveTimeout = undefined } -const resolveNextServer = import("next/dist/server/next-server.js").then(async ({ default: NextServer }) => { +const minimalMode = !!process.env.FAH_MINIMAL_MODE; + +const resolveNextServer = import(join(dir, "node_modules/next/dist/server/next-server.js")).then(async ({ default: NextServer }) => { const server = new NextServer.default({ conf, dev: false, dir, hostname, port, - minimalMode: true, + minimalMode, }); await server.prepare(); return server; }); -// While demoing in envoy was simple enough, to do this on GCP edge we have two -// main problems: -// 1. We need to prevent EOF from being dispatched so we can stitch the -// resume response to the end of the preamble. proxy-wasm ABI doesn't -// currently allow this. If we didn't care about CDN, we could hack -// into the adapter by being clever about chunked encoding but the -// whole point is to be CDN-friendly. -// 2. The HTTP sidecar request doesn't allow streaming in proxy-wasm ATM. -// Solution: -// GRPC could solve #2 but that leaves us with #1. -// Solution is to invert the logic—use the sidecar for preamble and the main -// request for resumption. -// This causes more issues: -// 1. proxy-wasm can't change the main request method (resume is a POST) -// 2. we've now broken streaming for apps/routes not using PPR -// While we can patch #1 in the adapter, there's no simple (multi-tenant) -// solution for #1 that doesn't require we know the PPR routes ahead of time -// and thus, this can't be done without control-plane coordination. - // TODO spin up NodeJS middleware as a GRPC service // TODO spin up PPR resumption as a GRPC service @@ -255,6 +68,7 @@ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse if (!res.getHeaderNames().includes('x-nextjs-postponed')) return; // TODO memoize/import this symbol outside the function // TODO import the type from NextJS + const { NEXT_REQUEST_META } = await import(join(dir, "node_modules/next/dist/server/request-meta.js")); const metadata = (req as any)[NEXT_REQUEST_META]; // TODO investigate if there's a better / more stable way to get the postpone token const cacheEntry = await metadata.incrementalCache.get(metadata.match.definition.pathname, { kind: metadata.match.definition.kind, isRoutePPREnabled: true }); @@ -262,36 +76,394 @@ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse } async function requestHandle(req: IncomingMessage, res: ServerResponse) { - const originalWrite = res.write.bind(res); - let resolveHeaders: Promise | undefined; - // We need to append our headers before the body starts getting written - res.write = function () { - resolveHeaders ||= injectAppHostingHeaders(req, res); - resolveHeaders.then(() => { - // @ts-expect-error TODO fix the type - const written = originalWrite(...arguments); - if (written) res.emit("drain"); - }) - return false; - }; - const originalEnd = res.end.bind(res); - res.end = function () { - resolveHeaders ||= injectAppHostingHeaders(req, res); - resolveHeaders.then(() => { - originalEnd(...arguments); - }); - return res; - }; + if (minimalMode) { + const originalWrite = res.write.bind(res); + let resolveHeaders: Promise | undefined; + // We need to append our headers before the body starts getting written + res.write = function () { + resolveHeaders ||= injectAppHostingHeaders(req, res); + resolveHeaders.then(() => { + // @ts-expect-error TODO fix the type + const written = originalWrite(...arguments); + if (written) res.emit("drain"); + }) + return false; + }; + const originalEnd = res.end.bind(res); + res.end = function () { + resolveHeaders ||= injectAppHostingHeaders(req, res); + resolveHeaders.then(() => { + originalEnd(...arguments); + }); + return res; + }; + } return (await resolveNextServer).getRequestHandler()(req, res); }; +const USING_CALLOUTS = !!process.env.FAH_USING_CALLOUTS; +const commonFastifyOptions = { }; +let httpServer; + +if (USING_CALLOUTS) { + + httpServer = fastify({ http2: true, ...commonFastifyOptions }); + + await httpServer.register(fastifyConnectPlugin, { + routes: (router) => router.service(ExternalProcessor, { + process: async function *processCallouts(callouts) { + let requestHeaders: HeaderValue[] = []; + let resolveResumeResponse: Promise|undefined; + let resumeSocket: Socket; + for await (const callout of callouts) { + switch (callout.request.case) { + case "requestHeaders": { + requestHeaders = callout.request.value.headers?.headers || []; + break; + } + case "requestBody": { + // TODO make a converter to a fetch request, make a helper to extract these headers + const path = requestHeaders.find((it) => it.key === ":path")?.value || "/"; + const method = requestHeaders.find((it) => it.key === ":method")?.value || "GET"; + const referrer = requestHeaders.find((it) => it.key === "referer")?.value; + const authority = requestHeaders.find((it) => it.key === ":authority")?.value || hostname; + if (!matchers.some(it => path.match(it))) break; + // middleware is intended for v8 isolates, with the fetch api + const middlewareRequest = { + url: `http://${authority}${path}`, // TODO look into using authority + method, + // filter out http2 pseudo-headers, next chokes on these + headers: Object.fromEntries(requestHeaders.filter((it) => !it.key.startsWith(":")).map((it) => [it.key, it.value]) || []), + // keepalive: req.keepalive, + destination: 'document', + credentials: 'same-origin', + bodyUsed: false, + body: callout.request.value.body, // TODO handle endOfStream + mode: "navigate", + redirect: "follow", + referrer, + }; + const middleware = await resolveMiddleware; + let middlewareResponse: Response; + try { + middlewareResponse = await middleware.default({ request: middlewareRequest }); + } catch (err) { + console.error("Middleware execution failed:", err); + yield { + response: { + case: "requestBody", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + bodyMutation: { body: Buffer.from("Internal Server Error") }, + end_stream: true, + headerMutation: { + setHeaders: [ + { header: { key: ":status", value: "500" } }, + ] + }, + }, + + }, + }, + }; + continue; + } + if (middlewareResponse.headers.has("x-middleware-next")) break; + const middlewareResponseHeaders = Object.fromEntries(middlewareResponse.headers); + delete middlewareResponseHeaders["x-middleware-next"]; // Clean up middleware-specific header, TODO clean up other headers + + // Convert the Fetch Headers object to the { key, value } array Envoy expects + const responseHeaders = Object.entries(middlewareResponseHeaders).map(([key, value]) => ({ + header: { key, value }, + })); + + // This tells Envoy to STOP processing and send this response immediately. + yield { + response: { + case: "requestBody", // We are responding to the requestHeaders callout + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + headerMutation: { + setHeaders: [ + ...responseHeaders, // Set the headers from the middleware + { header: { key: ":status", value: middlewareResponse.status.toString() } }, + ] + }, + bodyMutation: { + mutation: { + case: 'body', + // TODO stream over the body and yield + value: Uint8Array.from(Buffer.from(await middlewareResponse.text())) + }, + }, + end_stream: true + }, + }, + }, + } + break; + } + case "responseHeaders": { + const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.value; + if (!postponedToken) break; + yield { + response: { + case: "responseHeaders", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE, + headerMutation: { + setHeaders: [ + { header: { key: "transfer-encoding", value: "chunked" } }, + ], + removeHeaders: ["x-fah-postponed", "content-length"], + }, + }, + }, + }, + } + const nextServer = await resolveNextServer; + resumeSocket = new Socket(); + const resumeRequest = new IncomingMessage(resumeSocket); + resumeRequest.url = `/_next/postponed/resume${requestHeaders.find((it) => it.key === ":path")?.value || "/"}`; + resumeRequest.method = "POST"; + for (const header in requestHeaders) { + if (header.startsWith(":")) continue; // drop HTTP2 pseudo headers + resumeRequest.headers[header] = requestHeaders[header].value; + } + const resumeResponse = new ServerResponse(resumeRequest); + resolveResumeResponse = nextServer.getRequestHandler()(resumeRequest, resumeResponse).then(() => resumeResponse); + resumeSocket.write(Uint8Array.from(Buffer.from(postponedToken, "base64url"))); + resumeSocket.end(); + continue; + } + case "responseBody": { + if (!resolveResumeResponse) break; + yield { + response: { + case: "responseBody", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + bodyMutation: { body: callout.request.value.body }, + end_stream: false, + }, + }, + }, + }; + if (!callout.request.value.endOfStream) continue; + for await (const body of resumeSocket!) { + yield { + response: { + case: "responseBody", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + bodyMutation: { body }, + end_stream: false, + }, + }, + }, + } + } + yield { + response: { + case: "responseBody", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + bodyMutation: { body: Buffer.alloc(0) }, + end_stream: true, + }, + }, + }, + } + continue; + } + } + yield {}; + } + } + }), + }); -const httpServer = fastify(); -await httpServer.register(fastifyConnectPlugin, { routes }); -httpServer.all("*", function(req, res) { - requestHandle(req.raw, res.raw); -}); + /** + * Creates a mock http.IncomingMessage from an http2.Http2ServerRequest. + * * @param {Http2ServerRequest} h2req - The real HTTP/2 request. + * @returns {IncomingMessage} - The mock HTTP/1 request. + */ + function createMockIncomingMessage(h2req: Http2ServerRequest): IncomingMessage { + // 1. Create a real IncomingMessage to get the correct prototype + // @ts-expect-error + const socket = h2req.stream.session.socket as Socket; + const mockReq = new IncomingMessage(socket); + + // 2. Map HTTP/2 properties to their HTTP/1 equivalents + // (Http2ServerRequest already has these, but we are making a *new* object) + mockReq.method = h2req.method; + mockReq.url = h2req.url; + mockReq.headers = h2req.headers; + mockReq.rawHeaders = h2req.rawHeaders; + mockReq.httpVersion = '2.0'; + mockReq.httpVersionMajor = 2; + mockReq.httpVersionMinor = 0; + + // 3. Map other common properties + mockReq.aborted = h2req.aborted; + mockReq.complete = h2req.complete; + // @ts-expect-error + mockReq.trailers = h2req.trailers; + + // 4. Proxy the data stream events from the H2 request to the H1 mock + h2req.on('data', (chunk: Buffer | string) => mockReq.emit('data', chunk)); + h2req.on('end', () => mockReq.emit('end')); + h2req.on('error', (err: Error) => mockReq.emit('error', err)); + h2req.on('close', () => mockReq.emit('close')); + + // 5. Proxy stream methods + // @ts-expect-error + mockReq.pause = () => h2req.pause(); + // @ts-expect-error + mockReq.resume = () => h2req.resume(); + mockReq.isPaused = () => h2req.isPaused(); + // @ts-expect-error + mockReq.destroy = (err?: Error) => h2req.destroy(err); + // @ts-expect-error + mockReq.setTimeout = (msecs: number, cb?: () => void) => h2req.setTimeout(msecs, cb); + + return mockReq; + } + + /** + * Creates a mock http.ServerResponse from an http2.Http2ServerResponse. + * * @param {Http2ServerRequest} h2req - The real H2 request (needed for context). + * @param {Http2ServerResponse} h2res - The real H2 response. + * @returns {ServerResponse} - The mock HTTP/1 response. + */ + function createMockServerResponse( + h2req: Http2ServerRequest, + h2res: Http2ServerResponse + ): ServerResponse { + + // 1. Create a real ServerResponse to get the correct prototype. + const mockReq = { method: h2req.method, url: h2req.url } as IncomingMessage; + const mockRes = new ServerResponse(mockReq); + + // 2. Set the underlying socket + // @ts-expect-error + mockRes.socket = h2res.stream.session.socket as Socket; + // @ts-expect-error + mockRes.connection = mockRes.socket; + + // 3. Override the core I/O methods + + mockRes.writeHead = ( + statusCode: number, + statusMessage?: string | Record, + headers?: Record + ): ServerResponse => { + if (mockRes.headersSent) return mockRes; + + let finalHeaders: Record = {}; + + // Handle (statusCode, headers) signature + if (typeof statusMessage === 'object') { + headers = statusMessage; + // statusMessage is not used in H2 + } + + // Combine headers set via setHeader() with explicit headers + const existingHeaders = mockRes.getHeaders(); + finalHeaders = { ...existingHeaders, ...headers }; + + // 1. Call the real H2 response + h2res.writeHead(statusCode, finalHeaders); + + // 2. --- THE FIX --- + // Manually set the internal property that 'headersSent' getter uses. + // This is "private" but necessary for shims. + (mockRes as any)._headerSent = true; + + // 3. Also set the public statusCode so it's correct + mockRes.statusCode = statusCode; + return mockRes; // Return self for chaining + }; + + mockRes.write = ( + chunk: any, + encoding?: BufferEncoding | ((error?: Error | null) => void), + callback?: (error?: Error | null) => void + ): boolean => { + if (!mockRes.headersSent) { + mockRes.writeHead(mockRes.statusCode || 200); + } + + // Handle overloads + let cb = callback; + let enc: BufferEncoding = 'utf8'; + if (typeof encoding === 'function') { + cb = encoding; + } else if (typeof encoding === 'string') { + enc = encoding; + } + + return h2res.write(chunk, enc, cb); + }; + + mockRes.end = ( + chunk?: any, + encoding?: BufferEncoding | (() => void), + callback?: () => void + ): ServerResponse => { + if (!mockRes.headersSent) { + mockRes.writeHead(mockRes.statusCode || 200); + } + + // Handle overloads + let cb = callback; + let enc: BufferEncoding = 'utf8'; + if (typeof encoding === 'function') { + cb = encoding; + } else if (typeof encoding === 'string') { + enc = encoding; + } + + h2res.end(chunk, enc, cb); + return mockRes; + }; + + // 4. Proxy events and methods + h2res.stream.on('close', () => mockRes.emit('close')); + h2res.stream.on('error', (err: Error) => mockRes.emit('error', err)); + h2res.on('timeout', () => mockRes.emit('timeout')); + + // @ts-expect-error + mockRes.setTimeout = (msecs: number, cb?: () => void) => h2res.setTimeout(msecs, cb); + // @ts-expect-error + mockRes.destroy = (err?: Error) => h2res.destroy(err); + + return mockRes; + } + + + httpServer.all("*", function(fastifyRequest, fastifyReply) { + const req = createMockIncomingMessage(fastifyRequest.raw); + const res = createMockServerResponse(fastifyRequest.raw, fastifyReply.raw); + requestHandle(req, res); + }); + +} else { + + httpServer = fastify({ ...commonFastifyOptions }); + + httpServer.all("*", function(fastifyRequest, fastifyReply) { + requestHandle(fastifyRequest.raw, fastifyReply.raw); + }); + +} await httpServer.ready(); diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index 9dd61a9c..fc4ea9f9 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -13,7 +13,7 @@ import { fileURLToPath } from "url"; import { PHASE_PRODUCTION_BUILD, ROUTES_MANIFEST } from "./constants.js"; import type { NextConfigComplete } from "next/dist/server/config-shared.js"; -import { execSync, spawnSync } from "node:child_process"; +import { spawnSync } from "node:child_process"; // fs-extra is CJS, readJson can't be imported using shorthand export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsSync, ensureDir } = @@ -114,11 +114,16 @@ export async function generateBuildOutput( opts: OutputBundleOptions, nextBuildDirectory: string, ): Promise { - const staticDirectory = join(nextBuildDirectory, "static"); - await Promise.all([ - copy(staticDirectory, opts.outputStaticDirectoryPath, { overwrite: true }), - //copyResources(appDir, opts.outputDirectoryAppPath, opts.bundleYamlPath), - ]); + const minimalMode = !!process.env.FAH_MINIMAL_MODE; + if (!minimalMode) { + const staticDirectory = join(nextBuildDirectory, "static"); + const publicDirectory = join(appDir, "public"); + await Promise.all([ + copy(staticDirectory, opts.outputStaticDirectoryPath, { overwrite: true }), + copy(publicDirectory, opts.outputPublicDirectoryPath, { overwrite: true }).catch(() => undefined), + //copyResources(appDir, opts.outputDirectoryAppPath, opts.bundleYamlPath), + ]); + } // generateBundleYaml creates the output directory (if it does not already exist). // We need to make sure it is gitignored. const normalizedBundleDir = normalize(relative(rootDir, opts.outputDirectoryBasePath)); @@ -172,10 +177,11 @@ export async function generateBundleYaml( adapterMetadata: AdapterMetadata, ): Promise { await ensureDir(opts.outputDirectoryBasePath); + const path = normalize(relative(cwd, join(opts.outputDirectoryAppPath))); const outputBundle: OutputBundleConfig = { version: "v1", runConfig: { - runCommand: `cd ${normalize(relative(cwd, opts.outputDirectoryAppPath))} && node ./adapter/dist/bin/serve.js`, + runCommand: `node ${join(path, "adapter", "dist", "bin", "serve.js")} ${path}`, }, metadata: { ...adapterMetadata, From 7fccb71f3e34cacd07ffc82a0724fcb3cf5559ff Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 23 Oct 2025 10:53:53 -0700 Subject: [PATCH 09/14] PPR handled by callouts --- .../adapter-nextjs/src/bin/serve.ts | 236 +++++++++++------- .../@apphosting/adapter-nextjs/src/index.ts | 8 +- .../http/ext_proc/v3/processing_mode_pb.ts | 3 +- .../ext_proc/v3/external_processor_pb.ts | 68 ++--- 4 files changed, 187 insertions(+), 128 deletions(-) diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index c1f3c9c8..c8b23c86 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -3,19 +3,26 @@ import { readFileSync } from "node:fs"; import { ServerResponse, IncomingMessage } from "node:http"; import { join } from "node:path"; import fastify from "fastify"; +import { AsyncLocalStorage } from "node:async_hooks"; +import { parse } from "node:url"; import { CommonResponse_ResponseStatus, ExternalProcessor } from "../protos/envoy/service/ext_proc/v3/external_processor_pb.js" import { fastifyConnectPlugin } from "@connectrpc/connect-fastify"; import type { Http2ServerRequest, Http2ServerResponse } from "node:http2"; -import { HeaderMap, HeaderValue } from "../protos/envoy/config/core/v3/base_pb.js"; +import { HeaderValue } from "../protos/envoy/config/core/v3/base_pb.js"; import { Socket } from "node:net"; +import { PassThrough } from "node:stream"; const dir = join(process.cwd(), process.argv[2] || ".next/standalone"); const port = parseInt(process.env.PORT!, 10) || 3000 const hostname = process.env.HOSTNAME || '0.0.0.0' +// @ts-ignore +globalThis.self = globalThis; +globalThis.AsyncLocalStorage = AsyncLocalStorage; + // @ts-ignore process.env.NODE_ENV = "production"; @@ -44,8 +51,6 @@ if ( keepAliveTimeout = undefined } -const minimalMode = !!process.env.FAH_MINIMAL_MODE; - const resolveNextServer = import(join(dir, "node_modules/next/dist/server/next-server.js")).then(async ({ default: NextServer }) => { const server = new NextServer.default({ conf, @@ -53,16 +58,12 @@ const resolveNextServer = import(join(dir, "node_modules/next/dist/server/next-s dir, hostname, port, - minimalMode, + minimalMode: true, }); await server.prepare(); return server; }); -// TODO spin up NodeJS middleware as a GRPC service - -// TODO spin up PPR resumption as a GRPC service - async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse) { if (req.method !== 'GET' && req.method !== 'HEAD') return; if (!res.getHeaderNames().includes('x-nextjs-postponed')) return; @@ -70,13 +71,14 @@ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse // TODO import the type from NextJS const { NEXT_REQUEST_META } = await import(join(dir, "node_modules/next/dist/server/request-meta.js")); const metadata = (req as any)[NEXT_REQUEST_META]; - // TODO investigate if there's a better / more stable way to get the postpone token + // TODO use a stable API to get the reumption token const cacheEntry = await metadata.incrementalCache.get(metadata.match.definition.pathname, { kind: metadata.match.definition.kind, isRoutePPREnabled: true }); res.appendHeader('x-fah-postponed', Buffer.from(cacheEntry.value.postponed).toString('base64url')); } async function requestHandle(req: IncomingMessage, res: ServerResponse) { - if (minimalMode) { + const isPPR = req.url === "/"; + if (isPPR) { const originalWrite = res.write.bind(res); let resolveHeaders: Promise | undefined; // We need to append our headers before the body starts getting written @@ -98,47 +100,57 @@ async function requestHandle(req: IncomingMessage, res: ServerResponse) { return res; }; } - return (await resolveNextServer).getRequestHandler()(req, res); + const parsedUrl = parse(req.url!, true); + const nextServer = await resolveNextServer; + return nextServer.getRequestHandler()(req, res, parsedUrl); }; const USING_CALLOUTS = !!process.env.FAH_USING_CALLOUTS; +const SERVE_H2C = !!process.env.FAH_SERVE_H2C; const commonFastifyOptions = { }; -let httpServer; +const httpServer = fastify({ http2: SERVE_H2C, ...commonFastifyOptions } as {}); if (USING_CALLOUTS) { - httpServer = fastify({ http2: true, ...commonFastifyOptions }); - - await httpServer.register(fastifyConnectPlugin, { + const grpcServer = fastify({ http2: true, ...commonFastifyOptions } as {}); + + await grpcServer.register(fastifyConnectPlugin, { routes: (router) => router.service(ExternalProcessor, { process: async function *processCallouts(callouts) { let requestHeaders: HeaderValue[] = []; - let resolveResumeResponse: Promise|undefined; - let resumeSocket: Socket; + let resolveResumeBuffer: Promise|undefined; + let path: string|undefined = undefined; + const getRequestHeader = (key: string) => { + const header = requestHeaders.find((it) => it.key === key); + if (header) return header.value || new TextDecoder().decode(header.rawValue); + return undefined; + } for await (const callout of callouts) { switch (callout.request.case) { case "requestHeaders": { requestHeaders = callout.request.value.headers?.headers || []; - break; + path = getRequestHeader(":path"); + if (!callout.request.value.endOfStream) break; } case "requestBody": { // TODO make a converter to a fetch request, make a helper to extract these headers - const path = requestHeaders.find((it) => it.key === ":path")?.value || "/"; - const method = requestHeaders.find((it) => it.key === ":method")?.value || "GET"; - const referrer = requestHeaders.find((it) => it.key === "referer")?.value; - const authority = requestHeaders.find((it) => it.key === ":authority")?.value || hostname; - if (!matchers.some(it => path.match(it))) break; + const method = getRequestHeader(":method")!; + const scheme = getRequestHeader(":scheme")!; + const referrer = getRequestHeader("referer"); + const authority = getRequestHeader(":authority")!; + if (!matchers.some(it => path?.match(it))) break; // middleware is intended for v8 isolates, with the fetch api const middlewareRequest = { - url: `http://${authority}${path}`, // TODO look into using authority + url: `${scheme}://${authority}${path}`, method, // filter out http2 pseudo-headers, next chokes on these - headers: Object.fromEntries(requestHeaders.filter((it) => !it.key.startsWith(":")).map((it) => [it.key, it.value]) || []), + headers: Object.fromEntries(requestHeaders.filter((it) => !it.key.startsWith(":")).map((it) => [it.key, it.value || new TextDecoder().decode(it.rawValue)]) || []), // keepalive: req.keepalive, destination: 'document', credentials: 'same-origin', bodyUsed: false, - body: callout.request.value.body, // TODO handle endOfStream + // @ts-ignore + body: callout.request.case === "requestBody" ? callout.request.value.body : undefined, mode: "navigate", redirect: "follow", referrer, @@ -146,24 +158,17 @@ if (USING_CALLOUTS) { const middleware = await resolveMiddleware; let middlewareResponse: Response; try { - middlewareResponse = await middleware.default({ request: middlewareRequest }); + const result = await middleware.default.default({ request: middlewareRequest }); + await result.waitUntil; + middlewareResponse = result.response; } catch (err) { console.error("Middleware execution failed:", err); yield { response: { - case: "requestBody", + case: "immediateResponse", value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { body: Buffer.from("Internal Server Error") }, - end_stream: true, - headerMutation: { - setHeaders: [ - { header: { key: ":status", value: "500" } }, - ] - }, - }, - + status: { code: 500 }, + body: Uint8Array.from(Buffer.from("Internal Server Error")), }, }, }; @@ -174,39 +179,26 @@ if (USING_CALLOUTS) { delete middlewareResponseHeaders["x-middleware-next"]; // Clean up middleware-specific header, TODO clean up other headers // Convert the Fetch Headers object to the { key, value } array Envoy expects - const responseHeaders = Object.entries(middlewareResponseHeaders).map(([key, value]) => ({ - header: { key, value }, + const setHeaders = Object.entries(middlewareResponseHeaders).map(([key, value]) => ({ + header: { key, rawValue: Uint8Array.from(Buffer.from(value)) }, })); - // This tells Envoy to STOP processing and send this response immediately. yield { response: { - case: "requestBody", // We are responding to the requestHeaders callout + case: "immediateResponse", value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - headerMutation: { - setHeaders: [ - ...responseHeaders, // Set the headers from the middleware - { header: { key: ":status", value: middlewareResponse.status.toString() } }, - ] - }, - bodyMutation: { - mutation: { - case: 'body', - // TODO stream over the body and yield - value: Uint8Array.from(Buffer.from(await middlewareResponse.text())) - }, - }, - end_stream: true + status: { code: middlewareResponse.status }, + headers: { + setHeaders }, + body: Uint8Array.from(Buffer.from(await middlewareResponse.text())), }, - }, + } } - break; + continue; } case "responseHeaders": { - const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.value; + const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.rawValue; if (!postponedToken) break; yield { response: { @@ -216,7 +208,7 @@ if (USING_CALLOUTS) { status: CommonResponse_ResponseStatus.CONTINUE, headerMutation: { setHeaders: [ - { header: { key: "transfer-encoding", value: "chunked" } }, + { header: { key: "transfer-encoding", rawValue: Uint8Array.from(Buffer.from("chunked")) } }, ], removeHeaders: ["x-fah-postponed", "content-length"], }, @@ -224,71 +216,138 @@ if (USING_CALLOUTS) { }, }, } - const nextServer = await resolveNextServer; - resumeSocket = new Socket(); - const resumeRequest = new IncomingMessage(resumeSocket); - resumeRequest.url = `/_next/postponed/resume${requestHeaders.find((it) => it.key === ":path")?.value || "/"}`; - resumeRequest.method = "POST"; - for (const header in requestHeaders) { - if (header.startsWith(":")) continue; // drop HTTP2 pseudo headers - resumeRequest.headers[header] = requestHeaders[header].value; - } - const resumeResponse = new ServerResponse(resumeRequest); - resolveResumeResponse = nextServer.getRequestHandler()(resumeRequest, resumeResponse).then(() => resumeResponse); - resumeSocket.write(Uint8Array.from(Buffer.from(postponedToken, "base64url"))); - resumeSocket.end(); + + resolveResumeBuffer = new Promise(async (resolve) => { + const socket = new Socket(); + const resumeRequest = new IncomingMessage(socket); + const postponed = Buffer.from(new TextDecoder().decode(postponedToken), "base64url").toString(); + + const resumePath = `/_next/postponed/resume${path === "/" ? "/index" : path}`; + resumeRequest.url = resumePath; + resumeRequest.method = "POST"; + resumeRequest.httpVersion = "1.1"; + resumeRequest.httpVersionMajor = 1; + resumeRequest.httpVersionMinor = 1; + resumeRequest.push(postponed.trim()); + resumeRequest.push(null); + + for (const header of requestHeaders) { + // drop HTTP2 pseudo headers + if (header.key.startsWith(":")) continue; + resumeRequest.headers[header.key] = getRequestHeader(header.key); + } + resumeRequest.headers['x-matched-path'] = resumePath; + resumeRequest.headers['next-resume'] = "1"; + + const resumeResponse = new ServerResponse(resumeRequest); + const intermediaryStream = new PassThrough(); + + resumeResponse.write = (data) => { + const result = intermediaryStream.push(data); + if (!result) intermediaryStream.on("drain", () => resumeResponse.emit("drain")); + return result; + }; + + resumeResponse.end = (data) => { + if (data) intermediaryStream.push(data); + intermediaryStream.end(); + return resumeResponse; + } + + const nextServer = await resolveNextServer; + const parsedUrl = parse(resumePath, true); + nextServer.getRequestHandler()(resumeRequest, resumeResponse, parsedUrl); + resolve(intermediaryStream); + }).catch((e) => { + console.error(e); + // TODO figure out how to tell react we crashed and need to client render + const intermediaryStream = new PassThrough(); + return intermediaryStream; + }); + continue; } case "responseBody": { - if (!resolveResumeResponse) break; + //if (!resolveResumeBuffer) break; + const end_stream = !resolveResumeBuffer && callout.request.value.endOfStream; + + // OK now that we're duplex streaming, we need to replace everythign with a stream + // TODO look into switching mode for PPR + const body = callout.request.value.body; yield { response: { case: "responseBody", value: { response: { status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { body: callout.request.value.body }, - end_stream: false, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: end_stream } } }, + end_stream, }, }, }, }; + if (!callout.request.value.endOfStream) continue; - for await (const body of resumeSocket!) { + + const resumeBuffer = await resolveResumeBuffer!; + resolveResumeBuffer = undefined; + + for await (const body of resumeBuffer) { yield { response: { case: "responseBody", value: { response: { status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { body }, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: false } } }, end_stream: false, }, }, }, - } + }; } + yield { response: { case: "responseBody", value: { response: { status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { body: Buffer.alloc(0) }, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body: Buffer.alloc(0), endOfStream: true } } }, end_stream: true, }, }, }, - } + }; continue; } } - yield {}; + const empty = {}; + yield { + response: { + case: callout.request.case, + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE, + } + } + } + } as (typeof empty); } } }), }); + await grpcServer.ready(); + + grpcServer.listen({ host: hostname, port: port+1 }, (err, address) => { + if (err) return console.error(err); + console.log(`RPC listening on ${address}`); + }); + +} + +if (SERVE_H2C) { /** * Creates a mock http.IncomingMessage from an http2.Http2ServerRequest. @@ -448,17 +507,16 @@ if (USING_CALLOUTS) { return mockRes; } - httpServer.all("*", function(fastifyRequest, fastifyReply) { + // @ts-ignore const req = createMockIncomingMessage(fastifyRequest.raw); + // @ts-ignore const res = createMockServerResponse(fastifyRequest.raw, fastifyReply.raw); requestHandle(req, res); }); } else { - httpServer = fastify({ ...commonFastifyOptions }); - httpServer.all("*", function(fastifyRequest, fastifyReply) { requestHandle(fastifyRequest.raw, fastifyReply.raw); }); @@ -469,5 +527,5 @@ await httpServer.ready(); httpServer.listen({ host: hostname, port, }, (err, address) => { if (err) return console.error(err); - console.log(`Server listening on ${address}`); + console.log(`NextJS listening on ${address}`); }); diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index b4c5944d..e8e89b62 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -7,8 +7,9 @@ const adapter: NextAdapter = { name: '@apphosting/adapter-nextjs', // FEEDBACK: we need to be able to override user-defined config, before defaults injected // it would be nice if this where a separate phase or callback - async modifyConfig(config, { phase }) { - if (phase === PHASE_PRODUCTION_BUILD) { + async modifyConfig(config, context) { + console.log(JSON.stringify(context)); + if (context.phase === PHASE_PRODUCTION_BUILD) { return { ...config, images: { @@ -58,8 +59,7 @@ const adapter: NextAdapter = { nextBuildDirectory, ); - console.log(context.outputs.prerenders.filter(it => !!it.pprChain && it.config.renderingMode === "PARTIALLY_STATIC").map(it => it.pathname)); - console.log(context.outputs); + console.log(JSON.stringify(context)); const adapterMetadata = getAdapterMetadata(); diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts index 90f331bf..a73b0747 100644 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts @@ -149,8 +149,7 @@ export enum ProcessingMode_BodySendMode { NONE = 0, /** - * Stream the body to the server in pieces as they arrive at the - * proxy. + * Stream the body to the server in pieces as they are seen. * * @generated from enum value: STREAMED = 1; */ diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts index 12c57abe..50e93a19 100644 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts +++ b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts @@ -68,7 +68,7 @@ export const ProtocolConfigurationSchema: GenMessage = /* messageDesc(file_envoy_service_ext_proc_v3_external_processor, 0); /** - * This represents the different types of messages that Envoy can send + * This represents the different types of messages that the data plane can send * to an external processing server. * [#next-free-field: 12] * @@ -157,7 +157,7 @@ export type ProcessingRequest = Message<"envoy.service.ext_proc.v3.ProcessingReq * The values of properties selected by the ``request_attributes`` * or ``response_attributes`` list in the configuration. Each entry * in the list is populated from the standard - * :ref:`attributes ` supported across Envoy. + * :ref:`attributes ` supported in the data plane. * * @generated from field: map attributes = 9; */ @@ -197,7 +197,7 @@ export const ProcessingRequestSchema: GenMessage = /*@__PURE_ messageDesc(file_envoy_service_ext_proc_v3_external_processor, 1); /** - * This represents the different types of messages the server may send back to Envoy + * This represents the different types of messages the server may send back to the data plane * when the ``observability_mode`` field in the received ProcessingRequest is set to false. * * * If the corresponding ``BodySendMode`` in the @@ -301,8 +301,8 @@ export type ProcessingResponse = Message<"envoy.service.ext_proc.v3.ProcessingRe * may use this to intelligently control how requests are processed * based on the headers and other metadata that they see. * This field is only applicable when servers responding to the header requests. - * If it is set in the response to the body or trailer requests, it will be ignored by Envoy. - * It is also ignored by Envoy when the ext_proc filter config + * If it is set in the response to the body or trailer requests, it will be ignored by the data plane. + * It is also ignored by the data plane when the ext_proc filter config * :ref:`allow_mode_override * ` * is set to false, or @@ -317,16 +317,16 @@ export type ProcessingResponse = Message<"envoy.service.ext_proc.v3.ProcessingRe /** * When ext_proc server receives a request message, in case it needs more * time to process the message, it sends back a ProcessingResponse message - * with a new timeout value. When Envoy receives this response message, - * it ignores other fields in the response, just stop the original timer, - * which has the timeout value specified in + * with a new timeout value. When the data plane receives this response + * message, it ignores other fields in the response, just stop the original + * timer, which has the timeout value specified in * :ref:`message_timeout * ` * and start a new timer with this ``override_message_timeout`` value and keep the - * Envoy ext_proc filter state machine intact. + * data plane ext_proc filter state machine intact. * Has to be >= 1ms and <= * :ref:`max_message_timeout ` - * Such message can be sent at most once in a particular Envoy ext_proc filter processing state. + * Such message can be sent at most once in a particular data plane ext_proc filter processing state. * To enable this API, one has to set ``max_message_timeout`` to a number >= 1ms. * * @generated from field: google.protobuf.Duration override_message_timeout = 10; @@ -440,14 +440,14 @@ export const HttpTrailersSchema: GenMessage = /*@__PURE__*/ messageDesc(file_envoy_service_ext_proc_v3_external_processor, 5); /** - * This message is sent by the external server to Envoy after ``HttpHeaders`` was + * This message is sent by the external server to the data plane after ``HttpHeaders`` was * sent to it. * * @generated from message envoy.service.ext_proc.v3.HeadersResponse */ export type HeadersResponse = Message<"envoy.service.ext_proc.v3.HeadersResponse"> & { /** - * Details the modifications (if any) to be made by Envoy to the current + * Details the modifications (if any) to be made by the data plane to the current * request/response. * * @generated from field: envoy.service.ext_proc.v3.CommonResponse response = 1; @@ -463,14 +463,14 @@ export const HeadersResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_envoy_service_ext_proc_v3_external_processor, 6); /** - * This message is sent by the external server to Envoy after ``HttpBody`` was + * This message is sent by the external server to the data plane after ``HttpBody`` was * sent to it. * * @generated from message envoy.service.ext_proc.v3.BodyResponse */ export type BodyResponse = Message<"envoy.service.ext_proc.v3.BodyResponse"> & { /** - * Details the modifications (if any) to be made by Envoy to the current + * Details the modifications (if any) to be made by the data plane to the current * request/response. * * @generated from field: envoy.service.ext_proc.v3.CommonResponse response = 1; @@ -486,14 +486,14 @@ export const BodyResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_envoy_service_ext_proc_v3_external_processor, 7); /** - * This message is sent by the external server to Envoy after ``HttpTrailers`` was + * This message is sent by the external server to the data plane after ``HttpTrailers`` was * sent to it. * * @generated from message envoy.service.ext_proc.v3.TrailersResponse */ export type TrailersResponse = Message<"envoy.service.ext_proc.v3.TrailersResponse"> & { /** - * Details the modifications (if any) to be made by Envoy to the current + * Details the modifications (if any) to be made by the data plane to the current * request/response trailers. * * @generated from field: envoy.service.ext_proc.v3.HeaderMutation header_mutation = 1; @@ -516,7 +516,7 @@ export const TrailersResponseSchema: GenMessage = /*@__PURE__* */ export type CommonResponse = Message<"envoy.service.ext_proc.v3.CommonResponse"> & { /** - * If set, provide additional direction on how the Envoy proxy should + * If set, provide additional direction on how the data plane should * handle the rest of the HTTP filter chain. * * @generated from field: envoy.service.ext_proc.v3.CommonResponse.ResponseStatus status = 1; @@ -561,7 +561,7 @@ export type CommonResponse = Message<"envoy.service.ext_proc.v3.CommonResponse"> * Clear the route cache for the current client request. This is necessary * if the remote server modified headers that are used to calculate the route. * This field is ignored in the response direction. This field is also ignored - * if the Envoy ext_proc filter is in the upstream filter chain. + * if the data plane ext_proc filter is in the upstream filter chain. * * @generated from field: bool clear_route_cache = 5; */ @@ -735,7 +735,7 @@ export const HeaderMutationSchema: GenMessage = /*@__PURE__*/ */ export type StreamedBodyResponse = Message<"envoy.service.ext_proc.v3.StreamedBodyResponse"> & { /** - * The body response chunk that will be passed to the upstream/downstream by Envoy. + * The body response chunk that will be passed to the upstream/downstream by the data plane. * * @generated from field: bytes body = 1; */ @@ -759,7 +759,7 @@ export const StreamedBodyResponseSchema: GenMessage = /*@_ messageDesc(file_envoy_service_ext_proc_v3_external_processor, 13); /** - * This message specifies the body mutation the server sends to Envoy. + * This message specifies the body mutation the server sends to the data plane. * * @generated from message envoy.service.ext_proc.v3.BodyMutation */ @@ -817,22 +817,24 @@ export const BodyMutationSchema: GenMessage = /*@__PURE__*/ * as part of a filter chain. * The overall external processing protocol works like this: * - * 1. Envoy sends to the service information about the HTTP request. - * 2. The service sends back a ProcessingResponse message that directs Envoy - * to either stop processing, continue without it, or send it the - * next chunk of the message body. - * 3. If so requested, Envoy sends the server the message body in chunks, - * or the entire body at once. In either case, the server may send back - * a ProcessingResponse for each message it receives, or wait for certain amount - * of body chunks received before streams back the ProcessingResponse messages. - * 4. If so requested, Envoy sends the server the HTTP trailers, + * 1. The data plane sends to the service information about the HTTP request. + * 2. The service sends back a ProcessingResponse message that directs + * the data plane to either stop processing, continue without it, or send + * it the next chunk of the message body. + * 3. If so requested, the data plane sends the server the message body in + * chunks, or the entire body at once. In either case, the server may send + * back a ProcessingResponse for each message it receives, or wait for + * a certain amount of body chunks received before streaming back the + * ProcessingResponse messages. + * 4. If so requested, the data plane sends the server the HTTP trailers, * and the server sends back a ProcessingResponse. * 5. At this point, request processing is done, and we pick up again - * at step 1 when Envoy receives a response from the upstream server. + * at step 1 when the data plane receives a response from the upstream + * server. * 6. At any point above, if the server closes the gRPC stream cleanly, - * then Envoy proceeds without consulting the server. + * then the data plane proceeds without consulting the server. * 7. At any point above, if the server closes the gRPC stream with an error, - * then Envoy returns a 500 error to the client, unless the filter + * then the data plane returns a 500 error to the client, unless the filter * was configured to ignore errors. * * In other words, the process is a request/response conversation, but @@ -843,7 +845,7 @@ export const BodyMutationSchema: GenMessage = /*@__PURE__*/ */ export const ExternalProcessor: GenService<{ /** - * This begins the bidirectional stream that Envoy will use to + * This begins the bidirectional stream that the data plane will use to * give the server control over what the filter does. The actual * protocol is described by the ProcessingRequest and ProcessingResponse * messages below. From b60a0ae35b71d4acd75e3fba7756f2bb4c54b660 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 23 Oct 2025 14:06:03 -0700 Subject: [PATCH 10/14] Drop h2c stuff for now --- .../adapter-nextjs/src/bin/serve.ts | 584 ++++++------------ 1 file changed, 200 insertions(+), 384 deletions(-) diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index c8b23c86..c6836611 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -1,6 +1,6 @@ #! /usr/bin/env node import { readFileSync } from "node:fs"; -import { ServerResponse, IncomingMessage } from "node:http"; +import { ServerResponse, IncomingMessage, createServer } from "node:http"; import { join } from "node:path"; import fastify from "fastify"; import { AsyncLocalStorage } from "node:async_hooks"; @@ -9,7 +9,6 @@ import { parse } from "node:url"; import { CommonResponse_ResponseStatus, ExternalProcessor } from "../protos/envoy/service/ext_proc/v3/external_processor_pb.js" import { fastifyConnectPlugin } from "@connectrpc/connect-fastify"; -import type { Http2ServerRequest, Http2ServerResponse } from "node:http2"; import { HeaderValue } from "../protos/envoy/config/core/v3/base_pb.js"; import { Socket } from "node:net"; import { PassThrough } from "node:stream"; @@ -105,427 +104,244 @@ async function requestHandle(req: IncomingMessage, res: ServerResponse) { return nextServer.getRequestHandler()(req, res, parsedUrl); }; -const USING_CALLOUTS = !!process.env.FAH_USING_CALLOUTS; -const SERVE_H2C = !!process.env.FAH_SERVE_H2C; -const commonFastifyOptions = { }; -const httpServer = fastify({ http2: SERVE_H2C, ...commonFastifyOptions } as {}); - -if (USING_CALLOUTS) { - - const grpcServer = fastify({ http2: true, ...commonFastifyOptions } as {}); - - await grpcServer.register(fastifyConnectPlugin, { - routes: (router) => router.service(ExternalProcessor, { - process: async function *processCallouts(callouts) { - let requestHeaders: HeaderValue[] = []; - let resolveResumeBuffer: Promise|undefined; - let path: string|undefined = undefined; - const getRequestHeader = (key: string) => { - const header = requestHeaders.find((it) => it.key === key); - if (header) return header.value || new TextDecoder().decode(header.rawValue); - return undefined; - } - for await (const callout of callouts) { - switch (callout.request.case) { - case "requestHeaders": { - requestHeaders = callout.request.value.headers?.headers || []; - path = getRequestHeader(":path"); - if (!callout.request.value.endOfStream) break; - } - case "requestBody": { - // TODO make a converter to a fetch request, make a helper to extract these headers - const method = getRequestHeader(":method")!; - const scheme = getRequestHeader(":scheme")!; - const referrer = getRequestHeader("referer"); - const authority = getRequestHeader(":authority")!; - if (!matchers.some(it => path?.match(it))) break; - // middleware is intended for v8 isolates, with the fetch api - const middlewareRequest = { - url: `${scheme}://${authority}${path}`, - method, - // filter out http2 pseudo-headers, next chokes on these - headers: Object.fromEntries(requestHeaders.filter((it) => !it.key.startsWith(":")).map((it) => [it.key, it.value || new TextDecoder().decode(it.rawValue)]) || []), - // keepalive: req.keepalive, - destination: 'document', - credentials: 'same-origin', - bodyUsed: false, - // @ts-ignore - body: callout.request.case === "requestBody" ? callout.request.value.body : undefined, - mode: "navigate", - redirect: "follow", - referrer, - }; - const middleware = await resolveMiddleware; - let middlewareResponse: Response; - try { - const result = await middleware.default.default({ request: middlewareRequest }); - await result.waitUntil; - middlewareResponse = result.response; - } catch (err) { - console.error("Middleware execution failed:", err); - yield { - response: { - case: "immediateResponse", - value: { - status: { code: 500 }, - body: Uint8Array.from(Buffer.from("Internal Server Error")), - }, - }, - }; - continue; - } - if (middlewareResponse.headers.has("x-middleware-next")) break; - const middlewareResponseHeaders = Object.fromEntries(middlewareResponse.headers); - delete middlewareResponseHeaders["x-middleware-next"]; // Clean up middleware-specific header, TODO clean up other headers - // Convert the Fetch Headers object to the { key, value } array Envoy expects - const setHeaders = Object.entries(middlewareResponseHeaders).map(([key, value]) => ({ - header: { key, rawValue: Uint8Array.from(Buffer.from(value)) }, - })); +const grpcServer = fastify({ http2: true } as {}); +await grpcServer.register(fastifyConnectPlugin, { + routes: (router) => router.service(ExternalProcessor, { + process: async function *processCallouts(callouts) { + let requestHeaders: HeaderValue[] = []; + let resolveResumeBuffer: Promise|undefined; + let path: string|undefined = undefined; + const getRequestHeader = (key: string) => { + const header = requestHeaders.find((it) => it.key === key); + if (header) return header.value || new TextDecoder().decode(header.rawValue); + return undefined; + } + for await (const callout of callouts) { + switch (callout.request.case) { + case "requestHeaders": { + requestHeaders = callout.request.value.headers?.headers || []; + path = getRequestHeader(":path"); + if (!callout.request.value.endOfStream) break; + } + case "requestBody": { + // TODO make a converter to a fetch request, make a helper to extract these headers + const method = getRequestHeader(":method")!; + const scheme = getRequestHeader(":scheme")!; + const referrer = getRequestHeader("referer"); + const authority = getRequestHeader(":authority")!; + if (!matchers.some(it => path?.match(it))) break; + // middleware is intended for v8 isolates, with the fetch api + const middlewareRequest = { + url: `${scheme}://${authority}${path}`, + method, + // filter out http2 pseudo-headers, next chokes on these + headers: Object.fromEntries(requestHeaders.filter((it) => !it.key.startsWith(":")).map((it) => [it.key, it.value || new TextDecoder().decode(it.rawValue)]) || []), + // keepalive: req.keepalive, + destination: 'document', + credentials: 'same-origin', + bodyUsed: false, + // @ts-ignore + body: callout.request.case === "requestBody" ? callout.request.value.body : undefined, + mode: "navigate", + redirect: "follow", + referrer, + }; + const middleware = await resolveMiddleware; + let middlewareResponse: Response; + try { + const result = await middleware.default.default({ request: middlewareRequest }); + await result.waitUntil; + middlewareResponse = result.response; + } catch (err) { + console.error("Middleware execution failed:", err); yield { response: { case: "immediateResponse", value: { - status: { code: middlewareResponse.status }, - headers: { - setHeaders - }, - body: Uint8Array.from(Buffer.from(await middlewareResponse.text())), + status: { code: 500 }, + body: Uint8Array.from(Buffer.from("Internal Server Error")), }, - } - } + }, + }; continue; } - case "responseHeaders": { - const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.rawValue; - if (!postponedToken) break; - yield { - response: { - case: "responseHeaders", - value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE, - headerMutation: { - setHeaders: [ - { header: { key: "transfer-encoding", rawValue: Uint8Array.from(Buffer.from("chunked")) } }, - ], - removeHeaders: ["x-fah-postponed", "content-length"], - }, - }, + if (middlewareResponse.headers.has("x-middleware-next")) break; + const middlewareResponseHeaders = Object.fromEntries(middlewareResponse.headers); + delete middlewareResponseHeaders["x-middleware-next"]; // Clean up middleware-specific header, TODO clean up other headers + + // Convert the Fetch Headers object to the { key, value } array Envoy expects + const setHeaders = Object.entries(middlewareResponseHeaders).map(([key, value]) => ({ + header: { key, rawValue: Uint8Array.from(Buffer.from(value)) }, + })); + + yield { + response: { + case: "immediateResponse", + value: { + status: { code: middlewareResponse.status }, + headers: { + setHeaders }, + body: Uint8Array.from(Buffer.from(await middlewareResponse.text())), }, } - - resolveResumeBuffer = new Promise(async (resolve) => { - const socket = new Socket(); - const resumeRequest = new IncomingMessage(socket); - const postponed = Buffer.from(new TextDecoder().decode(postponedToken), "base64url").toString(); - - const resumePath = `/_next/postponed/resume${path === "/" ? "/index" : path}`; - resumeRequest.url = resumePath; - resumeRequest.method = "POST"; - resumeRequest.httpVersion = "1.1"; - resumeRequest.httpVersionMajor = 1; - resumeRequest.httpVersionMinor = 1; - resumeRequest.push(postponed.trim()); - resumeRequest.push(null); - - for (const header of requestHeaders) { - // drop HTTP2 pseudo headers - if (header.key.startsWith(":")) continue; - resumeRequest.headers[header.key] = getRequestHeader(header.key); - } - resumeRequest.headers['x-matched-path'] = resumePath; - resumeRequest.headers['next-resume'] = "1"; - - const resumeResponse = new ServerResponse(resumeRequest); - const intermediaryStream = new PassThrough(); - - resumeResponse.write = (data) => { - const result = intermediaryStream.push(data); - if (!result) intermediaryStream.on("drain", () => resumeResponse.emit("drain")); - return result; - }; - - resumeResponse.end = (data) => { - if (data) intermediaryStream.push(data); - intermediaryStream.end(); - return resumeResponse; - } - - const nextServer = await resolveNextServer; - const parsedUrl = parse(resumePath, true); - nextServer.getRequestHandler()(resumeRequest, resumeResponse, parsedUrl); - resolve(intermediaryStream); - }).catch((e) => { - console.error(e); - // TODO figure out how to tell react we crashed and need to client render - const intermediaryStream = new PassThrough(); - return intermediaryStream; - }); - - continue; } - case "responseBody": { - //if (!resolveResumeBuffer) break; - const end_stream = !resolveResumeBuffer && callout.request.value.endOfStream; - - // OK now that we're duplex streaming, we need to replace everythign with a stream - // TODO look into switching mode for PPR - const body = callout.request.value.body; - yield { - response: { - case: "responseBody", - value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: end_stream } } }, - end_stream, + continue; + } + case "responseHeaders": { + const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.rawValue; + if (!postponedToken) break; + yield { + response: { + case: "responseHeaders", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE, + headerMutation: { + setHeaders: [ + { header: { key: "transfer-encoding", rawValue: Uint8Array.from(Buffer.from("chunked")) } }, + ], + removeHeaders: ["x-fah-postponed", "content-length"], }, }, }, + }, + } + + resolveResumeBuffer = new Promise(async (resolve) => { + const socket = new Socket(); + const resumeRequest = new IncomingMessage(socket); + const postponed = Buffer.from(new TextDecoder().decode(postponedToken), "base64url").toString(); + + const resumePath = `/_next/postponed/resume${path === "/" ? "/index" : path}`; + resumeRequest.url = resumePath; + resumeRequest.method = "POST"; + resumeRequest.httpVersion = "1.1"; + resumeRequest.httpVersionMajor = 1; + resumeRequest.httpVersionMinor = 1; + resumeRequest.push(postponed.trim()); + resumeRequest.push(null); + + for (const header of requestHeaders) { + // drop HTTP2 pseudo headers + if (header.key.startsWith(":")) continue; + resumeRequest.headers[header.key] = getRequestHeader(header.key); + } + resumeRequest.headers['x-matched-path'] = resumePath; + resumeRequest.headers['next-resume'] = "1"; + + const resumeResponse = new ServerResponse(resumeRequest); + const intermediaryStream = new PassThrough(); + + resumeResponse.write = (data) => { + const result = intermediaryStream.push(data); + if (!result) intermediaryStream.on("drain", () => resumeResponse.emit("drain")); + return result; }; - if (!callout.request.value.endOfStream) continue; - - const resumeBuffer = await resolveResumeBuffer!; - resolveResumeBuffer = undefined; - - for await (const body of resumeBuffer) { - yield { + resumeResponse.end = (data) => { + if (data) intermediaryStream.push(data); + intermediaryStream.end(); + return resumeResponse; + } + + const nextServer = await resolveNextServer; + const parsedUrl = parse(resumePath, true); + nextServer.getRequestHandler()(resumeRequest, resumeResponse, parsedUrl); + resolve(intermediaryStream); + }).catch((e) => { + console.error(e); + // TODO figure out how to tell react we crashed and need to client render + const intermediaryStream = new PassThrough(); + return intermediaryStream; + }); + + continue; + } + case "responseBody": { + //if (!resolveResumeBuffer) break; + const end_stream = !resolveResumeBuffer && callout.request.value.endOfStream; + + // OK now that we're duplex streaming, we need to replace everythign with a stream + // TODO look into switching mode for PPR + const body = callout.request.value.body; + yield { + response: { + case: "responseBody", + value: { response: { - case: "responseBody", - value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: false } } }, - end_stream: false, - }, - }, + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: end_stream } } }, + end_stream, }, - }; - } + }, + }, + }; + if (!callout.request.value.endOfStream) continue; + + const resumeBuffer = await resolveResumeBuffer!; + resolveResumeBuffer = undefined; + + for await (const body of resumeBuffer) { yield { response: { case: "responseBody", value: { response: { status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { mutation: { case: 'streamedResponse', value: { body: Buffer.alloc(0), endOfStream: true } } }, - end_stream: true, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: false } } }, + end_stream: false, }, }, }, }; - continue; } + + yield { + response: { + case: "responseBody", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body: Buffer.alloc(0), endOfStream: true } } }, + end_stream: true, + }, + }, + }, + }; + continue; } - const empty = {}; - yield { - response: { - case: callout.request.case, - value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE, - } + } + const empty = {}; + yield { + response: { + case: callout.request.case, + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE, } } - } as (typeof empty); - } - } - }), - }); - - await grpcServer.ready(); - - grpcServer.listen({ host: hostname, port: port+1 }, (err, address) => { - if (err) return console.error(err); - console.log(`RPC listening on ${address}`); - }); - -} - -if (SERVE_H2C) { - - /** - * Creates a mock http.IncomingMessage from an http2.Http2ServerRequest. - * * @param {Http2ServerRequest} h2req - The real HTTP/2 request. - * @returns {IncomingMessage} - The mock HTTP/1 request. - */ - function createMockIncomingMessage(h2req: Http2ServerRequest): IncomingMessage { - // 1. Create a real IncomingMessage to get the correct prototype - // @ts-expect-error - const socket = h2req.stream.session.socket as Socket; - const mockReq = new IncomingMessage(socket); - - // 2. Map HTTP/2 properties to their HTTP/1 equivalents - // (Http2ServerRequest already has these, but we are making a *new* object) - mockReq.method = h2req.method; - mockReq.url = h2req.url; - mockReq.headers = h2req.headers; - mockReq.rawHeaders = h2req.rawHeaders; - mockReq.httpVersion = '2.0'; - mockReq.httpVersionMajor = 2; - mockReq.httpVersionMinor = 0; - - // 3. Map other common properties - mockReq.aborted = h2req.aborted; - mockReq.complete = h2req.complete; - // @ts-expect-error - mockReq.trailers = h2req.trailers; - - // 4. Proxy the data stream events from the H2 request to the H1 mock - h2req.on('data', (chunk: Buffer | string) => mockReq.emit('data', chunk)); - h2req.on('end', () => mockReq.emit('end')); - h2req.on('error', (err: Error) => mockReq.emit('error', err)); - h2req.on('close', () => mockReq.emit('close')); - - // 5. Proxy stream methods - // @ts-expect-error - mockReq.pause = () => h2req.pause(); - // @ts-expect-error - mockReq.resume = () => h2req.resume(); - mockReq.isPaused = () => h2req.isPaused(); - // @ts-expect-error - mockReq.destroy = (err?: Error) => h2req.destroy(err); - // @ts-expect-error - mockReq.setTimeout = (msecs: number, cb?: () => void) => h2req.setTimeout(msecs, cb); - - return mockReq; - } - - /** - * Creates a mock http.ServerResponse from an http2.Http2ServerResponse. - * * @param {Http2ServerRequest} h2req - The real H2 request (needed for context). - * @param {Http2ServerResponse} h2res - The real H2 response. - * @returns {ServerResponse} - The mock HTTP/1 response. - */ - function createMockServerResponse( - h2req: Http2ServerRequest, - h2res: Http2ServerResponse - ): ServerResponse { - - // 1. Create a real ServerResponse to get the correct prototype. - const mockReq = { method: h2req.method, url: h2req.url } as IncomingMessage; - const mockRes = new ServerResponse(mockReq); - - // 2. Set the underlying socket - // @ts-expect-error - mockRes.socket = h2res.stream.session.socket as Socket; - // @ts-expect-error - mockRes.connection = mockRes.socket; - - // 3. Override the core I/O methods - - mockRes.writeHead = ( - statusCode: number, - statusMessage?: string | Record, - headers?: Record - ): ServerResponse => { - if (mockRes.headersSent) return mockRes; - - let finalHeaders: Record = {}; - - // Handle (statusCode, headers) signature - if (typeof statusMessage === 'object') { - headers = statusMessage; - // statusMessage is not used in H2 - } - - // Combine headers set via setHeader() with explicit headers - const existingHeaders = mockRes.getHeaders(); - finalHeaders = { ...existingHeaders, ...headers }; - - // 1. Call the real H2 response - h2res.writeHead(statusCode, finalHeaders); - - // 2. --- THE FIX --- - // Manually set the internal property that 'headersSent' getter uses. - // This is "private" but necessary for shims. - (mockRes as any)._headerSent = true; - - // 3. Also set the public statusCode so it's correct - mockRes.statusCode = statusCode; - return mockRes; // Return self for chaining - }; - - mockRes.write = ( - chunk: any, - encoding?: BufferEncoding | ((error?: Error | null) => void), - callback?: (error?: Error | null) => void - ): boolean => { - if (!mockRes.headersSent) { - mockRes.writeHead(mockRes.statusCode || 200); - } - - // Handle overloads - let cb = callback; - let enc: BufferEncoding = 'utf8'; - if (typeof encoding === 'function') { - cb = encoding; - } else if (typeof encoding === 'string') { - enc = encoding; - } - - return h2res.write(chunk, enc, cb); - }; - - mockRes.end = ( - chunk?: any, - encoding?: BufferEncoding | (() => void), - callback?: () => void - ): ServerResponse => { - if (!mockRes.headersSent) { - mockRes.writeHead(mockRes.statusCode || 200); - } - - // Handle overloads - let cb = callback; - let enc: BufferEncoding = 'utf8'; - if (typeof encoding === 'function') { - cb = encoding; - } else if (typeof encoding === 'string') { - enc = encoding; + } + } as (typeof empty); } - - h2res.end(chunk, enc, cb); - return mockRes; - }; - - // 4. Proxy events and methods - h2res.stream.on('close', () => mockRes.emit('close')); - h2res.stream.on('error', (err: Error) => mockRes.emit('error', err)); - h2res.on('timeout', () => mockRes.emit('timeout')); - - // @ts-expect-error - mockRes.setTimeout = (msecs: number, cb?: () => void) => h2res.setTimeout(msecs, cb); - // @ts-expect-error - mockRes.destroy = (err?: Error) => h2res.destroy(err); - - return mockRes; - } - - httpServer.all("*", function(fastifyRequest, fastifyReply) { - // @ts-ignore - const req = createMockIncomingMessage(fastifyRequest.raw); - // @ts-ignore - const res = createMockServerResponse(fastifyRequest.raw, fastifyReply.raw); - requestHandle(req, res); - }); - -} else { + } + }), +}); - httpServer.all("*", function(fastifyRequest, fastifyReply) { - requestHandle(fastifyRequest.raw, fastifyReply.raw); - }); -} +createServer(requestHandle).listen(port, hostname, () => { + console.log(`NextJS listening on http://${hostname}:${port}`); +}).on("error", (err) => { + console.error(err); + process.exit(1); +}); -await httpServer.ready(); +await grpcServer.ready(); -httpServer.listen({ host: hostname, port, }, (err, address) => { +grpcServer.listen({ host: hostname, port: port+1 }, (err, address) => { if (err) return console.error(err); - console.log(`NextJS listening on ${address}`); + console.log(`RPC listening on ${address}`); }); From 3c0b07d8e16aebcac5289e6befdd8907eeed5a3f Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 23 Oct 2025 20:05:01 -0700 Subject: [PATCH 11/14] Comments --- .../adapter-nextjs/src/bin/serve.ts | 177 +++++++++++++++++- 1 file changed, 167 insertions(+), 10 deletions(-) diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index c6836611..99f81d47 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -13,35 +13,46 @@ import { HeaderValue } from "../protos/envoy/config/core/v3/base_pb.js"; import { Socket } from "node:net"; import { PassThrough } from "node:stream"; +// The standalone directory is the root of the Next.js application. const dir = join(process.cwd(), process.argv[2] || ".next/standalone"); +// Standard NodeJS HTTP server port and hostname. const port = parseInt(process.env.PORT!, 10) || 3000 const hostname = process.env.HOSTNAME || '0.0.0.0' +// Polyfill for the `self` global object, used by Next.js in minimal mode. // @ts-ignore globalThis.self = globalThis; +// Polyfill for the `AsyncLocalStorage` global object, used by Next.js in minimal mode. globalThis.AsyncLocalStorage = AsyncLocalStorage; +// Required by Next.js in minimal mode. // @ts-ignore process.env.NODE_ENV = "production"; +// Allow the keep-alive timeout to be configured. let keepAliveTimeout: number | undefined = parseInt(process.env.KEEP_ALIVE_TIMEOUT!, 10); +// Load the Next.js configuration from the standalone directory. const conf = JSON.parse(readFileSync(join(dir, ".next", "required-server-files.json"), "utf-8")).config; +// Pass the Next.js configuration to the Next.js server. process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(conf); +// Increase the max listeners to prevent warnings when many requests are in-flight. process.setMaxListeners(1_000); +// Dynamically import the Next.js middleware. const resolveMiddleware = import(join(dir, ".next/server/middleware.js")); -// TODO don't hardcode +// TODO don't hardcode these matchers, they should be derived from the build output. const matchers = [ '/about/:path*', '/((?!_next|firebase|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)', '/private/:path*', ].map(it => new RegExp(it)); +// If the keep-alive timeout is not a valid number, use the default. if ( Number.isNaN(keepAliveTimeout) || !Number.isFinite(keepAliveTimeout) || @@ -50,6 +61,7 @@ if ( keepAliveTimeout = undefined } +// Initialize the Next.js server in minimal mode. const resolveNextServer = import(join(dir, "node_modules/next/dist/server/next-server.js")).then(async ({ default: NextServer }) => { const server = new NextServer.default({ conf, @@ -63,6 +75,16 @@ const resolveNextServer = import(join(dir, "node_modules/next/dist/server/next-s return server; }); +/** + * Injects App Hosting specific headers into the response. + * + * This is used to communicate the postponed state of a page to the App Hosting backend. + * The backend will then use this information to resume the request when the page is + * ready. + * + * @param req The incoming request. + * @param res The server response. + */ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse) { if (req.method !== 'GET' && req.method !== 'HEAD') return; if (!res.getHeaderNames().includes('x-nextjs-postponed')) return; @@ -75,9 +97,31 @@ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse res.appendHeader('x-fah-postponed', Buffer.from(cacheEntry.value.postponed).toString('base64url')); } +/** + * Handles incoming HTTP requests. + * + * This function is the entry point for all HTTP requests. It is responsible for + * proxying requests to the Next.js server and for handling PPR (Partial Prerendering) + * requests. + * + * @param req The incoming request. + * @param res The server response. + */ async function requestHandle(req: IncomingMessage, res: ServerResponse) { + // This is a temporary workaround to enable PPR for the home page. const isPPR = req.url === "/"; if (isPPR) { + /** + * This is a critical interception. The Next.js server (`getRequestHandler`) + * takes full control of the `ServerResponse` object and doesn't provide + * a simple "beforeWrite" hook. + * + * To inject our `x-fah-postponed` header *before* Next.js sends the + * first body chunk, we must monkey-patch `res.write` and `res.end`. + * We wrap them in a promise (`resolveHeaders`) to ensure our + * `injectAppHostingHeaders` function runs exactly once before any + * data is sent to the client. + */ const originalWrite = res.write.bind(res); let resolveHeaders: Promise | undefined; // We need to append our headers before the body starts getting written @@ -104,25 +148,60 @@ async function requestHandle(req: IncomingMessage, res: ServerResponse) { return nextServer.getRequestHandler()(req, res, parsedUrl); }; - +/** + * The gRPC server that handles Envoy's external processing requests. + * + * This server is responsible for handling all gRPC requests from Envoy. It is + * used to implement middleware and to resume PPR requests. + */ const grpcServer = fastify({ http2: true } as {}); await grpcServer.register(fastifyConnectPlugin, { routes: (router) => router.service(ExternalProcessor, { + /** + * The `process` function is the entry point for all gRPC requests. + * + * It is a bidirectional streaming RPC that allows the data plane to send + * information about the HTTP request to the service and for the service to + * send back a `ProcessingResponse` message that directs the data plane on + * how to handle the request. + * + * https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ext_proc/v3/external_processor.proto + * + * @param callouts The stream of `ProcessingRequest` messages from the data plane. + */ process: async function *processCallouts(callouts) { let requestHeaders: HeaderValue[] = []; let resolveResumeBuffer: Promise|undefined; let path: string|undefined = undefined; + // For whatever reason the header.value is always an empty string at least with + // my local version of envoy. I have to decode the rawValue every time const getRequestHeader = (key: string) => { const header = requestHeaders.find((it) => it.key === key); if (header) return header.value || new TextDecoder().decode(header.rawValue); return undefined; } for await (const callout of callouts) { + console.log(callout); switch (callout.request.case) { case "requestHeaders": { requestHeaders = callout.request.value.headers?.headers || []; + // TODO look at the callout attributes, can we send thing like path + // so we don't have to parse from the pseudo headers path = getRequestHeader(":path"); + /** + * `requestHeaders` is the first callout we get. If `endOfStream` is + * true, it's a `GET` (or other body-less request), and we can run + * the middleware logic immediately. When there is no body + * `requestBody` would not otherwise be called. + * + * We do this by *intentionally falling through* to the `requestBody` + * case below, which contains our unified middleware logic. + * + * If `endOfStream` is false (e.g., a `POST`), we `break` and wait + * for the `requestBody` callout to arrive, which will then + * execute the *same* logic block. + */ if (!callout.request.value.endOfStream) break; } case "requestBody": { @@ -131,8 +210,14 @@ await grpcServer.register(fastifyConnectPlugin, { const scheme = getRequestHeader(":scheme")!; const referrer = getRequestHeader("referer"); const authority = getRequestHeader(":authority")!; + + // If the path does not match any of the middleware matchers, we can + // skip the middleware execution. if (!matchers.some(it => path?.match(it))) break; - // middleware is intended for v8 isolates, with the fetch api + + // Next.js middleware is intended for v8 isolates, with the fetch api. + // We construct a Fetch API compliant request object to pass to the + // middleware. const middlewareRequest = { url: `${scheme}://${authority}${path}`, method, @@ -167,6 +252,9 @@ await grpcServer.register(fastifyConnectPlugin, { }; continue; } + // If the middleware returns a response with the `x-middleware-next` + // header, it means we should continue processing the request as if + // the middleware was not there. if (middlewareResponse.headers.has("x-middleware-next")) break; const middlewareResponseHeaders = Object.fromEntries(middlewareResponse.headers); delete middlewareResponseHeaders["x-middleware-next"]; // Clean up middleware-specific header, TODO clean up other headers @@ -176,6 +264,8 @@ await grpcServer.register(fastifyConnectPlugin, { header: { key, rawValue: Uint8Array.from(Buffer.from(value)) }, })); + // If the middleware returns a response, we send it back to the client + // and stop processing the request. yield { response: { case: "immediateResponse", @@ -191,8 +281,14 @@ await grpcServer.register(fastifyConnectPlugin, { continue; } case "responseHeaders": { + // This is where we handle PPR resumption. + // If the response has a `x-fah-postponed` header, it means the page + // is in a postponed state and we need to resume it. const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.rawValue; if (!postponedToken) break; + // We tell Envoy to continue processing the request, but we also + // modify the headers to indicate that the response is chunked and + // to remove the `x-fah-postponed` and `content-length` headers. yield { response: { case: "responseHeaders", @@ -210,11 +306,17 @@ await grpcServer.register(fastifyConnectPlugin, { }, } + // We then kick off the resume request, so it's happening in parallel to the GET's + // body being sent to the client. Buffer it up. resolveResumeBuffer = new Promise(async (resolve) => { const socket = new Socket(); const resumeRequest = new IncomingMessage(socket); const postponed = Buffer.from(new TextDecoder().decode(postponedToken), "base64url").toString(); + // We construct a new request to the Next.js server to resume the + // postponed page. + // This is the old way of doing PPR resumption, I'm having trouble with it in NextJS 16 + // TODO investigate a stable API or why this is bugging out on me const resumePath = `/_next/postponed/resume${path === "/" ? "/index" : path}`; resumeRequest.url = resumePath; resumeRequest.method = "POST"; @@ -235,6 +337,23 @@ await grpcServer.register(fastifyConnectPlugin, { const resumeResponse = new ServerResponse(resumeRequest); const intermediaryStream = new PassThrough(); + /** + * This is the core of the PPR streaming workaround. We cannot + * directly `await` the `resumeResponse` as it's a "push-style" + * classic Node.js stream, not a modern "pull-style" async iterable. + * + * To fix this, we create an `intermediaryStream` (a PassThrough) + * and manually override `resumeResponse.write` and `resumeResponse.end`. + * + * This effectively "pipes" the data from the Next.js handler (which + * *thinks* it's writing to a normal socket) into our intermediary + * stream, which we *can* await in the `responseBody` case. + * + * There's probably a "better" way of doing but the old school pipes + * in NodeJS are rough. It might be better to start with the new + * fetch style request/response and convert to InboundMessage / + * ServerResponse from those more modern APIs. + */ resumeResponse.write = (data) => { const result = intermediaryStream.push(data); if (!result) intermediaryStream.on("drain", () => resumeResponse.emit("drain")); @@ -261,11 +380,38 @@ await grpcServer.register(fastifyConnectPlugin, { continue; } case "responseBody": { - //if (!resolveResumeBuffer) break; + // Let the original GET request be fulfilled, since we're using NextJS minimal-mode + // that request will be served in a CDN friendly manner, hopefully we have a hit ;) + + /** + * -------------------- Full-Duplex Mode ---------------------- + * + * Because we're using `streamedResponse` later (for PPR), we are + * we've configured Envoy for full-duplex streaming mode. + * + * In this mode, Envoy *always* expects us to send `streamedResponse` + * mutations. If we just `yield` a simple `CONTINUE` (our fallback) + * for a non-PPR request, Envoy's state machine gets confused + * and it will segfault. + * + * Therefore, for *all* requests, we must replace the response + * body with a stream, even if that stream is just the *original* + * response body. + * + * TODO: look into switching mode dynamically using `mode_override` + * in `responseHeaders` to avoid this for non-PPR requests. + * + * This logic determines the "passthrough" end_stream state. + * `end_stream` should *only* be true if: + * 1. We are *not* doing a PPR resume (`!resolveResumeBuffer`) + * 2. AND the original upstream chunk was the last one. + * + * TODO name resolveResumeBuffer better + */ const end_stream = !resolveResumeBuffer && callout.request.value.endOfStream; - // OK now that we're duplex streaming, we need to replace everythign with a stream - // TODO look into switching mode for PPR + // Serve up the original response, only EOF if this is not a PPR request and the + // original chunk was EOF. const body = callout.request.value.body; yield { response: { @@ -273,6 +419,7 @@ await grpcServer.register(fastifyConnectPlugin, { value: { response: { status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + // Note: We use 'streamedResponse' even for the pass-through. bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: end_stream } } }, end_stream, }, @@ -280,11 +427,16 @@ await grpcServer.register(fastifyConnectPlugin, { }, }; + // If the original response wasn't EOF yet, continue serving chunks (which will call this + // case again. if (!callout.request.value.endOfStream) continue; const resumeBuffer = await resolveResumeBuffer!; - resolveResumeBuffer = undefined; + resolveResumeBuffer = undefined; // TODO do I need to do this? + // Ok, let's start streaming in the PPR resume response + // full duplex mode is what allows us to yield multiple times, so we can stream, this + // is a marked improvement over the primitives available in proxy-Wasm at the moment. for await (const body of resumeBuffer) { yield { response: { @@ -300,6 +452,7 @@ await grpcServer.register(fastifyConnectPlugin, { }; } + // Finally send EOF yield { response: { case: "responseBody", @@ -314,9 +467,12 @@ await grpcServer.register(fastifyConnectPlugin, { }; continue; } + // TODO can we intercept trailers to handle waitFor functionality? } + // If we fall through the switch, it means we are not handling the + // request in any special way, so we just tell Envoy to continue. const empty = {}; - yield { + yield { response: { case: callout.request.case, value: { @@ -331,7 +487,7 @@ await grpcServer.register(fastifyConnectPlugin, { }), }); - +// Create the main HTTP server. createServer(requestHandle).listen(port, hostname, () => { console.log(`NextJS listening on http://${hostname}:${port}`); }).on("error", (err) => { @@ -341,7 +497,8 @@ createServer(requestHandle).listen(port, hostname, () => { await grpcServer.ready(); +// Start the gRPC server. grpcServer.listen({ host: hostname, port: port+1 }, (err, address) => { if (err) return console.error(err); console.log(`RPC listening on ${address}`); -}); +}); \ No newline at end of file From 5b1b8cfbd0c2ec2c66cf76d6d09e341233db629b Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 23 Oct 2025 20:22:06 -0700 Subject: [PATCH 12/14] chdir --- packages/@apphosting/adapter-nextjs/src/bin/serve.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index 99f81d47..68c8e79d 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -15,6 +15,7 @@ import { PassThrough } from "node:stream"; // The standalone directory is the root of the Next.js application. const dir = join(process.cwd(), process.argv[2] || ".next/standalone"); +process.chdir(dir); // Standard NodeJS HTTP server port and hostname. const port = parseInt(process.env.PORT!, 10) || 3000 @@ -112,9 +113,8 @@ async function requestHandle(req: IncomingMessage, res: ServerResponse) { const isPPR = req.url === "/"; if (isPPR) { /** - * This is a critical interception. The Next.js server (`getRequestHandler`) - * takes full control of the `ServerResponse` object and doesn't provide - * a simple "beforeWrite" hook. + * Next.js uses a request handler (`getRequestHandler`) which takes full + * `ServerResponse` object and doesn't provide any lifecycle hook. * * To inject our `x-fah-postponed` header *before* Next.js sends the * first body chunk, we must monkey-patch `res.write` and `res.end`. @@ -182,7 +182,6 @@ await grpcServer.register(fastifyConnectPlugin, { return undefined; } for await (const callout of callouts) { - console.log(callout); switch (callout.request.case) { case "requestHeaders": { requestHeaders = callout.request.value.headers?.headers || []; @@ -386,8 +385,8 @@ await grpcServer.register(fastifyConnectPlugin, { /** * -------------------- Full-Duplex Mode ---------------------- * - * Because we're using `streamedResponse` later (for PPR), we are - * we've configured Envoy for full-duplex streaming mode. + * Because we're using `streamedResponse` later (for PPR), we've + * configured Envoy for full-duplex streaming mode. * * In this mode, Envoy *always* expects us to send `streamedResponse` * mutations. If we just `yield` a simple `CONTINUE` (our fallback) From 365fba9dd7fdd455956ed3b2e51ee49535151597 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Mon, 27 Oct 2025 22:56:57 -0400 Subject: [PATCH 13/14] Content-length and fix for x-matched-path --- packages/@apphosting/adapter-nextjs/src/bin/serve.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index 68c8e79d..a795e6dc 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -310,19 +310,21 @@ await grpcServer.register(fastifyConnectPlugin, { resolveResumeBuffer = new Promise(async (resolve) => { const socket = new Socket(); const resumeRequest = new IncomingMessage(socket); - const postponed = Buffer.from(new TextDecoder().decode(postponedToken), "base64url").toString(); + const tokenString = new TextDecoder().decode(postponedToken); + const resumeData = Buffer.from(tokenString, "base64url"); // We construct a new request to the Next.js server to resume the // postponed page. // This is the old way of doing PPR resumption, I'm having trouble with it in NextJS 16 // TODO investigate a stable API or why this is bugging out on me - const resumePath = `/_next/postponed/resume${path === "/" ? "/index" : path}`; + const matchedPath = path === "/" ? "/index" : path; + const resumePath = `/_next/postponed/resume${matchedPath}`; resumeRequest.url = resumePath; resumeRequest.method = "POST"; resumeRequest.httpVersion = "1.1"; resumeRequest.httpVersionMajor = 1; resumeRequest.httpVersionMinor = 1; - resumeRequest.push(postponed.trim()); + resumeRequest.push(resumeData); resumeRequest.push(null); for (const header of requestHeaders) { @@ -330,8 +332,9 @@ await grpcServer.register(fastifyConnectPlugin, { if (header.key.startsWith(":")) continue; resumeRequest.headers[header.key] = getRequestHeader(header.key); } - resumeRequest.headers['x-matched-path'] = resumePath; + resumeRequest.headers['x-matched-path'] = matchedPath; resumeRequest.headers['next-resume'] = "1"; + resumeRequest.headers['content-length'] = Buffer.byteLength(resumeData).toString(); const resumeResponse = new ServerResponse(resumeRequest); const intermediaryStream = new PassThrough(); From 8570e0886a2d69c13d69de1c0870e776f303ab2c Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 30 Oct 2025 16:30:29 -0400 Subject: [PATCH 14/14] Moving away from the POST hack --- .../@apphosting/adapter-nextjs/.gitignore | 1 + .../adapter-nextjs/src/bin/build.ts | 2 + .../adapter-nextjs/src/bin/serve.ts | 221 +- .../@apphosting/adapter-nextjs/src/index.ts | 3 +- .../envoy/annotations/deprecation_pb.ts | 24 - .../protos/envoy/config/core/v3/base_pb.ts | 248 --- .../http/ext_proc/v3/processing_mode_pb.ts | 187 -- .../ext_proc/v3/external_processor_pb.ts | 862 ------- .../protos/envoy/type/v3/http_status_pb.ts | 452 ---- .../src/protos/udpa/annotations/migrate_pb.ts | 38 - .../src/protos/udpa/annotations/status_pb.ts | 84 - .../protos/udpa/annotations/versioning_pb.ts | 39 - .../src/protos/validate/validate_pb.ts | 1984 ----------------- .../protos/xds/annotations/v3/status_pb.ts | 80 - 14 files changed, 148 insertions(+), 4077 deletions(-) delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts delete mode 100644 packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts diff --git a/packages/@apphosting/adapter-nextjs/.gitignore b/packages/@apphosting/adapter-nextjs/.gitignore index e69de29b..3ab5a3c0 100644 --- a/packages/@apphosting/adapter-nextjs/.gitignore +++ b/packages/@apphosting/adapter-nextjs/.gitignore @@ -0,0 +1 @@ +src/protos \ No newline at end of file diff --git a/packages/@apphosting/adapter-nextjs/src/bin/build.ts b/packages/@apphosting/adapter-nextjs/src/bin/build.ts index 61bc1743..2e5744ad 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/build.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/build.ts @@ -6,6 +6,8 @@ import { join } from "node:path"; // Opt-out sending telemetry to Vercel process.env.NEXT_TELEMETRY_DISABLED = "1"; +process.env.NEXT_ADAPTER_PATH = join(import.meta.dirname, "..", "index.cjs"); + await runBuild(); const opts = getBuildOptions(); diff --git a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts index a795e6dc..177b0ca3 100644 --- a/packages/@apphosting/adapter-nextjs/src/bin/serve.ts +++ b/packages/@apphosting/adapter-nextjs/src/bin/serve.ts @@ -12,6 +12,10 @@ import { fastifyConnectPlugin } from "@connectrpc/connect-fastify"; import { HeaderValue } from "../protos/envoy/config/core/v3/base_pb.js"; import { Socket } from "node:net"; import { PassThrough } from "node:stream"; +import { ProcessingMode_BodySendMode, ProcessingMode_HeaderSendMode } from "../protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.js"; + +// TODO bundle this rather than write/read from file +const buildContext = JSON.parse(readFileSync(join(process.cwd(), '.apphosting', 'output.json')).toString()); // The standalone directory is the root of the Next.js application. const dir = join(process.cwd(), process.argv[2] || ".next/standalone"); @@ -30,12 +34,15 @@ globalThis.AsyncLocalStorage = AsyncLocalStorage; // Required by Next.js in minimal mode. // @ts-ignore process.env.NODE_ENV = "production"; +//process.env.MINIMAL_MODE = "1"; // Allow the keep-alive timeout to be configured. let keepAliveTimeout: number | undefined = parseInt(process.env.KEEP_ALIVE_TIMEOUT!, 10); // Load the Next.js configuration from the standalone directory. -const conf = JSON.parse(readFileSync(join(dir, ".next", "required-server-files.json"), "utf-8")).config; +// TODO fix the types and jazz +const conf = { ...buildContext.config } as any; +conf.compress = false; // Pass the Next.js configuration to the Next.js server. process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(conf); @@ -47,11 +54,32 @@ process.setMaxListeners(1_000); const resolveMiddleware = import(join(dir, ".next/server/middleware.js")); // TODO don't hardcode these matchers, they should be derived from the build output. -const matchers = [ - '/about/:path*', - '/((?!_next|firebase|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)', - '/private/:path*', -].map(it => new RegExp(it)); +const middlewareMatchers: Array = buildContext.outputs.middleware.config.matchers.map((it: any) => new RegExp(it.sourceRegex)); + +const isPPRPath = (path: string) => { + const dynamicPathMatch = buildContext.routes.dynamicRoutes.find((it: any) => path.match(new RegExp(it.sourceRegex)))?.source; + const matchingPrerender = buildContext.outputs.prerenders.find((it: any) => it.pathname === dynamicPathMatch || it.pathname === path); + return matchingPrerender?.config?.renderingMode === "PARTIALLY_STATIC"; +} + +const getAppPage = (path: string) => { + const dynamicPathMatch = buildContext.routes.dynamicRoutes.find((it: any) => path.match(new RegExp(it.sourceRegex)))?.source; + return buildContext.outputs.appPages.find((it: any) => it.id === (dynamicPathMatch || path)); +} + +const getPrerender = (path: string) => { + const dynamicPathMatch = buildContext.routes.dynamicRoutes.find((it: any) => path.match(new RegExp(it.sourceRegex)))?.source; + return buildContext.outputs.prerenders.find((it: any) => it.id === (dynamicPathMatch || path)); +} + +const getMatchedDestination = (path: string) => { + for (const dynamicRoute of buildContext.routes.dynamicRoutes) { + const match = path.match(new RegExp(dynamicRoute.sourceRegex)); + if (match) { + return Object.entries(match.groups || {}).reduce((acc, [key, value]) => { return acc.replace(`\$${key}`, value) }, dynamicRoute.destination as string); + } + } +} // If the keep-alive timeout is not a valid number, use the default. if ( @@ -93,7 +121,7 @@ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse // TODO import the type from NextJS const { NEXT_REQUEST_META } = await import(join(dir, "node_modules/next/dist/server/request-meta.js")); const metadata = (req as any)[NEXT_REQUEST_META]; - // TODO use a stable API to get the reumption token + // TODO use a stable API to get the resumption token const cacheEntry = await metadata.incrementalCache.get(metadata.match.definition.pathname, { kind: metadata.match.definition.kind, isRoutePPREnabled: true }); res.appendHeader('x-fah-postponed', Buffer.from(cacheEntry.value.postponed).toString('base64url')); } @@ -109,43 +137,47 @@ async function injectAppHostingHeaders(req: IncomingMessage, res: ServerResponse * @param res The server response. */ async function requestHandle(req: IncomingMessage, res: ServerResponse) { - // This is a temporary workaround to enable PPR for the home page. - const isPPR = req.url === "/"; - if (isPPR) { - /** - * Next.js uses a request handler (`getRequestHandler`) which takes full - * `ServerResponse` object and doesn't provide any lifecycle hook. - * - * To inject our `x-fah-postponed` header *before* Next.js sends the - * first body chunk, we must monkey-patch `res.write` and `res.end`. - * We wrap them in a promise (`resolveHeaders`) to ensure our - * `injectAppHostingHeaders` function runs exactly once before any - * data is sent to the client. - */ - const originalWrite = res.write.bind(res); - let resolveHeaders: Promise | undefined; - // We need to append our headers before the body starts getting written - res.write = function () { - resolveHeaders ||= injectAppHostingHeaders(req, res); - resolveHeaders.then(() => { - // @ts-expect-error TODO fix the type - const written = originalWrite(...arguments); - if (written) res.emit("drain"); - }) - return false; - }; - const originalEnd = res.end.bind(res); - res.end = function () { - resolveHeaders ||= injectAppHostingHeaders(req, res); - resolveHeaders.then(() => { - originalEnd(...arguments); - }); - return res; - }; - } - const parsedUrl = parse(req.url!, true); - const nextServer = await resolveNextServer; - return nextServer.getRequestHandler()(req, res, parsedUrl); + const path = parse(req.url || '/', true).path || "/"; + const isPPR = ['GET', 'HEAD'].includes(req.method || 'GET') && isPPRPath(path); + const prerender = getPrerender(path); + const postponed = prerender?.fallback.postponedState; + // TODO this is a bug with the adapter spec, not seeing postponeData for "/" + if (isPPR && !postponed) { + console.error(`Unable to find postponed state for ${path} appending to response as x-fah-postponed`); + /** + * Next.js uses a request handler (`getRequestHandler`) which takes full + * `ServerResponse` object and doesn't provide any lifecycle hook. + * + * To inject our `x-fah-postponed` header *before* Next.js sends the + * first body chunk, we must monkey-patch `res.write` and `res.end`. + * We wrap them in a promise (`resolveHeaders`) to ensure our + * `injectAppHostingHeaders` function runs exactly once before any + * data is sent to the client. + */ + const originalWrite = res.write.bind(res); + let resolveHeaders: Promise | undefined; + // We need to append our headers before the body starts getting written + res.write = function () { + resolveHeaders ||= injectAppHostingHeaders(req, res); + resolveHeaders.then(() => { + // @ts-expect-error TODO fix the type + const written = originalWrite(...arguments); + if (written) res.emit("drain"); + }) + return false; + }; + const originalEnd = res.end.bind(res); + res.end = function () { + resolveHeaders ||= injectAppHostingHeaders(req, res); + resolveHeaders.then(() => { + originalEnd(...arguments); + }); + return res; + }; + } + const parsedUrl = parse(req.url!, true); + const nextServer = await resolveNextServer; + return nextServer.getRequestHandler()(req, res, parsedUrl); }; /** @@ -174,6 +206,8 @@ await grpcServer.register(fastifyConnectPlugin, { let requestHeaders: HeaderValue[] = []; let resolveResumeBuffer: Promise|undefined; let path: string|undefined = undefined; + let method: string|undefined = undefined; + let postponed: string|undefined = undefined; // For whatever reason the header.value is always an empty string at least with // my local version of envoy. I have to decode the rawValue every time const getRequestHeader = (key: string) => { @@ -182,12 +216,33 @@ await grpcServer.register(fastifyConnectPlugin, { return undefined; } for await (const callout of callouts) { + let modeOverride: any = {}; // TODO fix types + if (path) console.log(method, callout.request.case, path); switch (callout.request.case) { case "requestHeaders": { requestHeaders = callout.request.value.headers?.headers || []; // TODO look at the callout attributes, can we send thing like path // so we don't have to parse from the pseudo headers - path = getRequestHeader(":path"); + path = parse(getRequestHeader(":path") || "/", true).path!; + method = getRequestHeader(":method") || "GET"; + console.log(method, "requestHeaders", path); + const hasMiddleware = middlewareMatchers.some(it => path?.match(it)); + const usesPPR = ['GET', 'HEAD'].includes(method) && isPPRPath(path); + const hasRequestBody = !callout.request.value.endOfStream; + + // TODO only response on PPR + if (hasMiddleware && hasRequestBody) { + modeOverride.requestBodyMode = ProcessingMode_BodySendMode.BUFFERED; + } + + if (usesPPR) { + modeOverride.responseHeaderMode = ProcessingMode_HeaderSendMode.SEND; + modeOverride.responseBodyMode = ProcessingMode_BodySendMode.FULL_DUPLEX_STREAMED; + modeOverride.responseTrailerMode = ProcessingMode_HeaderSendMode.SEND; + }; + + if (!hasMiddleware) break; + /** * `requestHeaders` is the first callout we get. If `endOfStream` is * true, it's a `GET` (or other body-less request), and we can run @@ -201,18 +256,17 @@ await grpcServer.register(fastifyConnectPlugin, { * for the `requestBody` callout to arrive, which will then * execute the *same* logic block. */ - if (!callout.request.value.endOfStream) break; + if (hasRequestBody) break; } case "requestBody": { // TODO make a converter to a fetch request, make a helper to extract these headers - const method = getRequestHeader(":method")!; const scheme = getRequestHeader(":scheme")!; const referrer = getRequestHeader("referer"); const authority = getRequestHeader(":authority")!; // If the path does not match any of the middleware matchers, we can // skip the middleware execution. - if (!matchers.some(it => path?.match(it))) break; + if (!middlewareMatchers.some(it => path?.match(it))) break; // Next.js middleware is intended for v8 isolates, with the fetch api. // We construct a Fetch API compliant request object to pass to the @@ -283,8 +337,15 @@ await grpcServer.register(fastifyConnectPlugin, { // This is where we handle PPR resumption. // If the response has a `x-fah-postponed` header, it means the page // is in a postponed state and we need to resume it. - const postponedToken = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.rawValue; - if (!postponedToken) break; + const isPPR = ['GET', 'HEAD'].includes(method!) && isPPRPath(path!); + if (!isPPR) break; + + const postponedHeaderValue = callout.request.value.headers?.headers.find((it) => it.key === "x-fah-postponed")?.rawValue; + if (postponedHeaderValue) { + const tokenString = new TextDecoder().decode(postponedHeaderValue); + postponed = Buffer.from(tokenString, "base64url").toString(); + } + // We tell Envoy to continue processing the request, but we also // modify the headers to indicate that the response is chunked and // to remove the `x-fah-postponed` and `content-length` headers. @@ -298,7 +359,7 @@ await grpcServer.register(fastifyConnectPlugin, { setHeaders: [ { header: { key: "transfer-encoding", rawValue: Uint8Array.from(Buffer.from("chunked")) } }, ], - removeHeaders: ["x-fah-postponed", "content-length"], + removeHeaders: ["content-length"], }, }, }, @@ -310,31 +371,32 @@ await grpcServer.register(fastifyConnectPlugin, { resolveResumeBuffer = new Promise(async (resolve) => { const socket = new Socket(); const resumeRequest = new IncomingMessage(socket); - const tokenString = new TextDecoder().decode(postponedToken); - const resumeData = Buffer.from(tokenString, "base64url"); + + const prerender = getPrerender(path!); + postponed ||= prerender?.fallback.postponedState; + + const appPage = getAppPage(path!); + if (!appPage) throw new Error('ahhhhhhhh!'); // We construct a new request to the Next.js server to resume the // postponed page. // This is the old way of doing PPR resumption, I'm having trouble with it in NextJS 16 // TODO investigate a stable API or why this is bugging out on me - const matchedPath = path === "/" ? "/index" : path; - const resumePath = `/_next/postponed/resume${matchedPath}`; - resumeRequest.url = resumePath; - resumeRequest.method = "POST"; + resumeRequest.url = path; + resumeRequest.method = method; resumeRequest.httpVersion = "1.1"; resumeRequest.httpVersionMajor = 1; resumeRequest.httpVersionMinor = 1; - resumeRequest.push(resumeData); - resumeRequest.push(null); + + const { NEXT_REQUEST_META } = await import(join(dir, "node_modules/next/dist/server/request-meta.js")); + (resumeRequest as any)[NEXT_REQUEST_META] = { postponed }; for (const header of requestHeaders) { // drop HTTP2 pseudo headers if (header.key.startsWith(":")) continue; resumeRequest.headers[header.key] = getRequestHeader(header.key); } - resumeRequest.headers['x-matched-path'] = matchedPath; resumeRequest.headers['next-resume'] = "1"; - resumeRequest.headers['content-length'] = Buffer.byteLength(resumeData).toString(); const resumeResponse = new ServerResponse(resumeRequest); const intermediaryStream = new PassThrough(); @@ -368,9 +430,9 @@ await grpcServer.register(fastifyConnectPlugin, { return resumeResponse; } - const nextServer = await resolveNextServer; - const parsedUrl = parse(resumePath, true); - nextServer.getRequestHandler()(resumeRequest, resumeResponse, parsedUrl); + const parsedUrl = parse(path!, true); + const appRouteFunction = await import(appPage.filePath); + appRouteFunction.default.handler(resumeRequest, resumeResponse, parsedUrl); resolve(intermediaryStream); }).catch((e) => { console.error(e); @@ -415,19 +477,21 @@ await grpcServer.register(fastifyConnectPlugin, { // Serve up the original response, only EOF if this is not a PPR request and the // original chunk was EOF. const body = callout.request.value.body; - yield { - response: { - case: "responseBody", - value: { - response: { - status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - // Note: We use 'streamedResponse' even for the pass-through. - bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: end_stream } } }, - end_stream, + if (body.byteLength) { + yield { + response: { + case: "responseBody", + value: { + response: { + status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, + // Note: We use 'streamedResponse' even for the pass-through. + bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: end_stream } } }, + end_stream, + }, }, }, - }, - }; + }; + } // If the original response wasn't EOF yet, continue serving chunks (which will call this // case again. @@ -446,7 +510,7 @@ await grpcServer.register(fastifyConnectPlugin, { value: { response: { status: CommonResponse_ResponseStatus.CONTINUE_AND_REPLACE, - bodyMutation: { mutation: { case: 'streamedResponse', value: { body, endOfStream: false } } }, + bodyMutation: { mutation: { case: 'streamedResponse', value: { body: Uint8Array.from(body), endOfStream: false } } }, end_stream: false, }, }, @@ -481,8 +545,9 @@ await grpcServer.register(fastifyConnectPlugin, { response: { status: CommonResponse_ResponseStatus.CONTINUE, } - } - } + }, + }, + modeOverride: modeOverride!, } as (typeof empty); } } diff --git a/packages/@apphosting/adapter-nextjs/src/index.ts b/packages/@apphosting/adapter-nextjs/src/index.ts index e8e89b62..e488f57d 100644 --- a/packages/@apphosting/adapter-nextjs/src/index.ts +++ b/packages/@apphosting/adapter-nextjs/src/index.ts @@ -2,6 +2,7 @@ import { generateBundleYaml, getAdapterMetadata, populateOutputBundleOptions } f import type { NextAdapter } from "next"; import { addRouteOverrides } from "./overrides.js"; import { PHASE_PRODUCTION_BUILD } from "./constants.js"; +import { writeFile } from "fs-extra"; const adapter: NextAdapter = { name: '@apphosting/adapter-nextjs', @@ -59,7 +60,7 @@ const adapter: NextAdapter = { nextBuildDirectory, ); - console.log(JSON.stringify(context)); + await writeFile(`${outputBundleOptions.outputDirectoryBasePath}/output.json`, JSON.stringify(context)); const adapterMetadata = getAdapterMetadata(); diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts deleted file mode 100644 index fea40271..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/annotations/deprecation_pb.ts +++ /dev/null @@ -1,24 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file envoy/annotations/deprecation.proto (package envoy.annotations, syntax proto3) -/* eslint-disable */ - -import type { GenExtension, GenFile } from "@bufbuild/protobuf/codegenv2"; -import { extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; -import type { FieldOptions } from "@bufbuild/protobuf/wkt"; -import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; - -/** - * Describes the file envoy/annotations/deprecation.proto. - */ -export const file_envoy_annotations_deprecation: GenFile = /*@__PURE__*/ - fileDesc("CiNlbnZveS9hbm5vdGF0aW9ucy9kZXByZWNhdGlvbi5wcm90bxIRZW52b3kuYW5ub3RhdGlvbnM6XwobZGVwcmVjYXRlZF9hdF9taW5vcl92ZXJzaW9uEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxjy6IBLIAEoCVIYZGVwcmVjYXRlZEF0TWlub3JWZXJzaW9uQjpaOGdpdGh1Yi5jb20vZW52b3lwcm94eS9nby1jb250cm9sLXBsYW5lL2Vudm95L2Fubm90YXRpb25zYgZwcm90bzM", [file_google_protobuf_descriptor]); - -/** - * The API major and minor version on which the field was deprecated - * (e.g., "3.5" for major version 3 and minor version 5). - * - * @generated from extension: string deprecated_at_minor_version = 157299826; - */ -export const deprecated_at_minor_version: GenExtension = /*@__PURE__*/ - extDesc(file_envoy_annotations_deprecation, 0); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts deleted file mode 100644 index 6f1eeac3..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/config/core/v3/base_pb.ts +++ /dev/null @@ -1,248 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file envoy/config/core/v3/base.proto (package envoy.config.core.v3, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Any } from "@bufbuild/protobuf/wkt"; -import { file_google_protobuf_any, file_google_protobuf_struct, file_google_protobuf_wrappers } from "@bufbuild/protobuf/wkt"; -import { file_envoy_annotations_deprecation } from "../../../annotations/deprecation_pb.js"; -import { file_udpa_annotations_migrate } from "../../../../udpa/annotations/migrate_pb.js"; -import { file_udpa_annotations_status } from "../../../../udpa/annotations/status_pb.js"; -import { file_udpa_annotations_versioning } from "../../../../udpa/annotations/versioning_pb.js"; -import { file_validate_validate } from "../../../../validate/validate_pb.js"; -import type { JsonObject, Message } from "@bufbuild/protobuf"; - -/** - * Describes the file envoy/config/core/v3/base.proto. - */ -export const file_envoy_config_core_v3_base: GenFile = /*@__PURE__*/ - fileDesc("Ch9lbnZveS9jb25maWcvY29yZS92My9iYXNlLnByb3RvEhRlbnZveS5jb25maWcuY29yZS52MyKQAwoITWV0YWRhdGESWQoPZmlsdGVyX21ldGFkYXRhGAEgAygLMjIuZW52b3kuY29uZmlnLmNvcmUudjMuTWV0YWRhdGEuRmlsdGVyTWV0YWRhdGFFbnRyeUIM+kIJmgEGIgRyAhABEmQKFXR5cGVkX2ZpbHRlcl9tZXRhZGF0YRgCIAMoCzI3LmVudm95LmNvbmZpZy5jb3JlLnYzLk1ldGFkYXRhLlR5cGVkRmlsdGVyTWV0YWRhdGFFbnRyeUIM+kIJmgEGIgRyAhABGk4KE0ZpbHRlck1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEiYKBXZhbHVlGAIgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdDoCOAEaUAoYVHlwZWRGaWx0ZXJNZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5Bbnk6AjgBOiGaxYgeHAoaZW52b3kuYXBpLnYyLmNvcmUuTWV0YWRhdGEitwEKC0hlYWRlclZhbHVlEh4KA2tleRgBIAEoCUIR+kIOcgwQASiAgAHIAQDAAQESMAoFdmFsdWUYAiABKAlCIfpCDHIKKICAAcgBAMABAvKY/o8FDBIKdmFsdWVfdHlwZRIwCglyYXdfdmFsdWUYAyABKAxCHfpCCHoGEAAYgIAB8pj+jwUMEgp2YWx1ZV90eXBlOiSaxYgeHwodZW52b3kuYXBpLnYyLmNvcmUuSGVhZGVyVmFsdWUiqwMKEUhlYWRlclZhbHVlT3B0aW9uEjsKBmhlYWRlchgBIAEoCzIhLmVudm95LmNvbmZpZy5jb3JlLnYzLkhlYWRlclZhbHVlQgj6QgWKAQIQARI3CgZhcHBlbmQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlQgsYAZLHhtgEAzMuMBJbCg1hcHBlbmRfYWN0aW9uGAMgASgOMjouZW52b3kuY29uZmlnLmNvcmUudjMuSGVhZGVyVmFsdWVPcHRpb24uSGVhZGVyQXBwZW5kQWN0aW9uQgj6QgWCAQIQARIYChBrZWVwX2VtcHR5X3ZhbHVlGAQgASgIIn0KEkhlYWRlckFwcGVuZEFjdGlvbhIbChdBUFBFTkRfSUZfRVhJU1RTX09SX0FERBAAEhEKDUFERF9JRl9BQlNFTlQQARIeChpPVkVSV1JJVEVfSUZfRVhJU1RTX09SX0FERBACEhcKE09WRVJXUklURV9JRl9FWElTVFMQAzoqmsWIHiUKI2Vudm95LmFwaS52Mi5jb3JlLkhlYWRlclZhbHVlT3B0aW9uImMKCUhlYWRlck1hcBIyCgdoZWFkZXJzGAEgAygLMiEuZW52b3kuY29uZmlnLmNvcmUudjMuSGVhZGVyVmFsdWU6IprFiB4dChtlbnZveS5hcGkudjIuY29yZS5IZWFkZXJNYXBCfQoiaW8uZW52b3lwcm94eS5lbnZveS5jb25maWcuY29yZS52M0IJQmFzZVByb3RvUAFaQmdpdGh1Yi5jb20vZW52b3lwcm94eS9nby1jb250cm9sLXBsYW5lL2Vudm95L2NvbmZpZy9jb3JlL3YzO2NvcmV2M7qAyNEGAhACYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_struct, file_google_protobuf_wrappers, file_envoy_annotations_deprecation, file_udpa_annotations_migrate, file_udpa_annotations_status, file_udpa_annotations_versioning, file_validate_validate]); - -/** - * Metadata provides additional inputs to filters based on matched listeners, - * filter chains, routes and endpoints. It is structured as a map, usually from - * filter name (in reverse DNS format) to metadata specific to the filter. Metadata - * key-values for a filter are merged as connection and request handling occurs, - * with later values for the same key overriding earlier values. - * - * An example use of metadata is providing additional values to - * http_connection_manager in the envoy.http_connection_manager.access_log - * namespace. - * - * Another example use of metadata is to per service config info in cluster metadata, which may get - * consumed by multiple filters. - * - * For load balancing, Metadata provides a means to subset cluster endpoints. - * Endpoints have a Metadata object associated and routes contain a Metadata - * object to match against. There are some well defined metadata used today for - * this purpose: - * - * * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an - * endpoint and is also used during header processing - * (x-envoy-upstream-canary) and for stats purposes. - * [#next-major-version: move to type/metadata/v2] - * - * @generated from message envoy.config.core.v3.Metadata - */ -export type Metadata = Message<"envoy.config.core.v3.Metadata"> & { - /** - * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` - * namespace is reserved for Envoy's built-in filters. - * If both ``filter_metadata`` and - * :ref:`typed_filter_metadata ` - * fields are present in the metadata with same keys, - * only ``typed_filter_metadata`` field will be parsed. - * - * @generated from field: map filter_metadata = 1; - */ - filterMetadata: { [key: string]: JsonObject }; - - /** - * Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` - * namespace is reserved for Envoy's built-in filters. - * The value is encoded as google.protobuf.Any. - * If both :ref:`filter_metadata ` - * and ``typed_filter_metadata`` fields are present in the metadata with same keys, - * only ``typed_filter_metadata`` field will be parsed. - * - * @generated from field: map typed_filter_metadata = 2; - */ - typedFilterMetadata: { [key: string]: Any }; -}; - -/** - * Describes the message envoy.config.core.v3.Metadata. - * Use `create(MetadataSchema)` to create a new message. - */ -export const MetadataSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_config_core_v3_base, 0); - -/** - * Header name/value pair. - * - * @generated from message envoy.config.core.v3.HeaderValue - */ -export type HeaderValue = Message<"envoy.config.core.v3.HeaderValue"> & { - /** - * Header name. - * - * @generated from field: string key = 1; - */ - key: string; - - /** - * Header value. - * - * The same :ref:`format specifier ` as used for - * :ref:`HTTP access logging ` applies here, however - * unknown header values are replaced with the empty string instead of ``-``. - * Header value is encoded as string. This does not work for non-utf8 characters. - * Only one of ``value`` or ``raw_value`` can be set. - * - * @generated from field: string value = 2; - */ - value: string; - - /** - * Header value is encoded as bytes which can support non-utf8 characters. - * Only one of ``value`` or ``raw_value`` can be set. - * - * @generated from field: bytes raw_value = 3; - */ - rawValue: Uint8Array; -}; - -/** - * Describes the message envoy.config.core.v3.HeaderValue. - * Use `create(HeaderValueSchema)` to create a new message. - */ -export const HeaderValueSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_config_core_v3_base, 1); - -/** - * Header name/value pair plus option to control append behavior. - * - * @generated from message envoy.config.core.v3.HeaderValueOption - */ -export type HeaderValueOption = Message<"envoy.config.core.v3.HeaderValueOption"> & { - /** - * Header name/value pair that this option applies to. - * - * @generated from field: envoy.config.core.v3.HeaderValue header = 1; - */ - header?: HeaderValue; - - /** - * Should the value be appended? If true (default), the value is appended to - * existing values. Otherwise it replaces any existing values. - * This field is deprecated and please use - * :ref:`append_action ` as replacement. - * - * .. note:: - * The :ref:`external authorization service ` and - * :ref:`external processor service ` have - * default value (``false``) for this field. - * - * @generated from field: google.protobuf.BoolValue append = 2 [deprecated = true]; - * @deprecated - */ - append?: boolean; - - /** - * Describes the action taken to append/overwrite the given value for an existing header - * or to only add this header if it's absent. - * Value defaults to :ref:`APPEND_IF_EXISTS_OR_ADD - * `. - * - * @generated from field: envoy.config.core.v3.HeaderValueOption.HeaderAppendAction append_action = 3; - */ - appendAction: HeaderValueOption_HeaderAppendAction; - - /** - * Is the header value allowed to be empty? If false (default), custom headers with empty values are dropped, - * otherwise they are added. - * - * @generated from field: bool keep_empty_value = 4; - */ - keepEmptyValue: boolean; -}; - -/** - * Describes the message envoy.config.core.v3.HeaderValueOption. - * Use `create(HeaderValueOptionSchema)` to create a new message. - */ -export const HeaderValueOptionSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_config_core_v3_base, 2); - -/** - * Describes the supported actions types for header append action. - * - * @generated from enum envoy.config.core.v3.HeaderValueOption.HeaderAppendAction - */ -export enum HeaderValueOption_HeaderAppendAction { - /** - * If the header already exists, this action will result in: - * - * - Comma-concatenated for predefined inline headers. - * - Duplicate header added in the ``HeaderMap`` for other headers. - * - * If the header doesn't exist then this will add new header with specified key and value. - * - * @generated from enum value: APPEND_IF_EXISTS_OR_ADD = 0; - */ - APPEND_IF_EXISTS_OR_ADD = 0, - - /** - * This action will add the header if it doesn't already exist. If the header - * already exists then this will be a no-op. - * - * @generated from enum value: ADD_IF_ABSENT = 1; - */ - ADD_IF_ABSENT = 1, - - /** - * This action will overwrite the specified value by discarding any existing values if - * the header already exists. If the header doesn't exist then this will add the header - * with specified key and value. - * - * @generated from enum value: OVERWRITE_IF_EXISTS_OR_ADD = 2; - */ - OVERWRITE_IF_EXISTS_OR_ADD = 2, - - /** - * This action will overwrite the specified value by discarding any existing values if - * the header already exists. If the header doesn't exist then this will be no-op. - * - * @generated from enum value: OVERWRITE_IF_EXISTS = 3; - */ - OVERWRITE_IF_EXISTS = 3, -} - -/** - * Describes the enum envoy.config.core.v3.HeaderValueOption.HeaderAppendAction. - */ -export const HeaderValueOption_HeaderAppendActionSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_envoy_config_core_v3_base, 2, 0); - -/** - * Wrapper for a set of headers. - * - * @generated from message envoy.config.core.v3.HeaderMap - */ -export type HeaderMap = Message<"envoy.config.core.v3.HeaderMap"> & { - /** - * A list of header names and their values. - * - * @generated from field: repeated envoy.config.core.v3.HeaderValue headers = 1; - */ - headers: HeaderValue[]; -}; - -/** - * Describes the message envoy.config.core.v3.HeaderMap. - * Use `create(HeaderMapSchema)` to create a new message. - */ -export const HeaderMapSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_config_core_v3_base, 3); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts deleted file mode 100644 index a73b0747..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/extensions/filters/http/ext_proc/v3/processing_mode_pb.ts +++ /dev/null @@ -1,187 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto (package envoy.extensions.filters.http.ext_proc.v3, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import { file_udpa_annotations_status } from "../../../../../../udpa/annotations/status_pb.js"; -import { file_validate_validate } from "../../../../../../validate/validate_pb.js"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto. - */ -export const file_envoy_extensions_filters_http_ext_proc_v3_processing_mode: GenFile = /*@__PURE__*/ - fileDesc("Cj9lbnZveS9leHRlbnNpb25zL2ZpbHRlcnMvaHR0cC9leHRfcHJvYy92My9wcm9jZXNzaW5nX21vZGUucHJvdG8SKWVudm95LmV4dGVuc2lvbnMuZmlsdGVycy5odHRwLmV4dF9wcm9jLnYzIswGCg5Qcm9jZXNzaW5nTW9kZRJvChNyZXF1ZXN0X2hlYWRlcl9tb2RlGAEgASgOMkguZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuSGVhZGVyU2VuZE1vZGVCCPpCBYIBAhABEnAKFHJlc3BvbnNlX2hlYWRlcl9tb2RlGAIgASgOMkguZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuSGVhZGVyU2VuZE1vZGVCCPpCBYIBAhABEmsKEXJlcXVlc3RfYm9keV9tb2RlGAMgASgOMkYuZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuQm9keVNlbmRNb2RlQgj6QgWCAQIQARJsChJyZXNwb25zZV9ib2R5X21vZGUYBCABKA4yRi5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52My5Qcm9jZXNzaW5nTW9kZS5Cb2R5U2VuZE1vZGVCCPpCBYIBAhABEnAKFHJlcXVlc3RfdHJhaWxlcl9tb2RlGAUgASgOMkguZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuSGVhZGVyU2VuZE1vZGVCCPpCBYIBAhABEnEKFXJlc3BvbnNlX3RyYWlsZXJfbW9kZRgGIAEoDjJILmVudm95LmV4dGVuc2lvbnMuZmlsdGVycy5odHRwLmV4dF9wcm9jLnYzLlByb2Nlc3NpbmdNb2RlLkhlYWRlclNlbmRNb2RlQgj6QgWCAQIQASIxCg5IZWFkZXJTZW5kTW9kZRILCgdERUZBVUxUEAASCAoEU0VORBABEggKBFNLSVAQAiJkCgxCb2R5U2VuZE1vZGUSCAoETk9ORRAAEgwKCFNUUkVBTUVEEAESDAoIQlVGRkVSRUQQAhIUChBCVUZGRVJFRF9QQVJUSUFMEAMSGAoURlVMTF9EVVBMRVhfU1RSRUFNRUQQBEK1AQo3aW8uZW52b3lwcm94eS5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52M0ITUHJvY2Vzc2luZ01vZGVQcm90b1ABWltnaXRodWIuY29tL2Vudm95cHJveHkvZ28tY29udHJvbC1wbGFuZS9lbnZveS9leHRlbnNpb25zL2ZpbHRlcnMvaHR0cC9leHRfcHJvYy92MztleHRfcHJvY3YzuoDI0QYCEAJiBnByb3RvMw", [file_udpa_annotations_status, file_validate_validate]); - -/** - * [#next-free-field: 7] - * - * @generated from message envoy.extensions.filters.http.ext_proc.v3.ProcessingMode - */ -export type ProcessingMode = Message<"envoy.extensions.filters.http.ext_proc.v3.ProcessingMode"> & { - /** - * How to handle the request header. Default is "SEND". - * Note this field is ignored in :ref:`mode_override - * `, since mode - * overrides can only affect messages exchanged after the request header is processed. - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode request_header_mode = 1; - */ - requestHeaderMode: ProcessingMode_HeaderSendMode; - - /** - * How to handle the response header. Default is "SEND". - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode response_header_mode = 2; - */ - responseHeaderMode: ProcessingMode_HeaderSendMode; - - /** - * How to handle the request body. Default is "NONE". - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode request_body_mode = 3; - */ - requestBodyMode: ProcessingMode_BodySendMode; - - /** - * How do handle the response body. Default is "NONE". - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode response_body_mode = 4; - */ - responseBodyMode: ProcessingMode_BodySendMode; - - /** - * How to handle the request trailers. Default is "SKIP". - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode request_trailer_mode = 5; - */ - requestTrailerMode: ProcessingMode_HeaderSendMode; - - /** - * How to handle the response trailers. Default is "SKIP". - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode response_trailer_mode = 6; - */ - responseTrailerMode: ProcessingMode_HeaderSendMode; -}; - -/** - * Describes the message envoy.extensions.filters.http.ext_proc.v3.ProcessingMode. - * Use `create(ProcessingModeSchema)` to create a new message. - */ -export const ProcessingModeSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, 0); - -/** - * Control how headers and trailers are handled - * - * @generated from enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode - */ -export enum ProcessingMode_HeaderSendMode { - /** - * When used to configure the ext_proc filter :ref:`processing_mode - * `, - * the default HeaderSendMode depends on which part of the message is being processed. By - * default, request and response headers are sent, while trailers are skipped. - * - * When used in :ref:`mode_override - * ` or - * :ref:`allowed_override_modes - * `, - * a value of DEFAULT indicates that there is no change from the behavior that is configured for - * the filter in :ref:`processing_mode - * `. - * - * @generated from enum value: DEFAULT = 0; - */ - DEFAULT = 0, - - /** - * Send the header or trailer. - * - * @generated from enum value: SEND = 1; - */ - SEND = 1, - - /** - * Do not send the header or trailer. - * - * @generated from enum value: SKIP = 2; - */ - SKIP = 2, -} - -/** - * Describes the enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.HeaderSendMode. - */ -export const ProcessingMode_HeaderSendModeSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, 0, 0); - -/** - * Control how the request and response bodies are handled - * When body mutation by external processor is enabled, ext_proc filter will always remove - * the content length header in four cases below because content length can not be guaranteed - * to be set correctly: - * 1) STREAMED BodySendMode: header processing completes before body mutation comes back. - * 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. - * 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. - * 4) FULL_DUPLEX_STREAMED BodySendMode: header processing completes before body mutation comes back. - * - * In Envoy's http1 codec implementation, removing content length will enable chunked transfer - * encoding whenever feasible. The recipient (either client or server) must be able - * to parse and decode the chunked transfer coding. - * (see `details in RFC9112 `_). - * - * In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is - * external processor's responsibility to set the content length correctly matched to the length - * of mutated body. If they don't match, the corresponding body mutation will be rejected and - * local reply will be sent with an error message. - * - * @generated from enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode - */ -export enum ProcessingMode_BodySendMode { - /** - * Do not send the body at all. This is the default. - * - * @generated from enum value: NONE = 0; - */ - NONE = 0, - - /** - * Stream the body to the server in pieces as they are seen. - * - * @generated from enum value: STREAMED = 1; - */ - STREAMED = 1, - - /** - * Buffer the message body in memory and send the entire body at once. - * If the body exceeds the configured buffer limit, then the - * downstream system will receive an error. - * - * @generated from enum value: BUFFERED = 2; - */ - BUFFERED = 2, - - /** - * Buffer the message body in memory and send the entire body in one - * chunk. If the body exceeds the configured buffer limit, then the body contents - * up to the buffer limit will be sent. - * - * @generated from enum value: BUFFERED_PARTIAL = 3; - */ - BUFFERED_PARTIAL = 3, - - /** - * @generated from enum value: FULL_DUPLEX_STREAMED = 4; - */ - FULL_DUPLEX_STREAMED = 4, -} - -/** - * Describes the enum envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode. - */ -export const ProcessingMode_BodySendModeSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, 0, 1); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts deleted file mode 100644 index 50e93a19..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/service/ext_proc/v3/external_processor_pb.ts +++ /dev/null @@ -1,862 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file envoy/service/ext_proc/v3/external_processor.proto (package envoy.service.ext_proc.v3, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { HeaderMap, HeaderValueOption, Metadata } from "../../../config/core/v3/base_pb.js"; -import { file_envoy_config_core_v3_base } from "../../../config/core/v3/base_pb.js"; -import type { ProcessingMode, ProcessingMode_BodySendMode } from "../../../extensions/filters/http/ext_proc/v3/processing_mode_pb.js"; -import { file_envoy_extensions_filters_http_ext_proc_v3_processing_mode } from "../../../extensions/filters/http/ext_proc/v3/processing_mode_pb.js"; -import type { HttpStatus } from "../../../type/v3/http_status_pb.js"; -import { file_envoy_type_v3_http_status } from "../../../type/v3/http_status_pb.js"; -import type { Duration } from "@bufbuild/protobuf/wkt"; -import { file_google_protobuf_duration, file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; -import { file_xds_annotations_v3_status } from "../../../../xds/annotations/v3/status_pb.js"; -import { file_envoy_annotations_deprecation } from "../../../annotations/deprecation_pb.js"; -import { file_udpa_annotations_status } from "../../../../udpa/annotations/status_pb.js"; -import { file_validate_validate } from "../../../../validate/validate_pb.js"; -import type { JsonObject, Message } from "@bufbuild/protobuf"; - -/** - * Describes the file envoy/service/ext_proc/v3/external_processor.proto. - */ -export const file_envoy_service_ext_proc_v3_external_processor: GenFile = /*@__PURE__*/ - fileDesc("CjJlbnZveS9zZXJ2aWNlL2V4dF9wcm9jL3YzL2V4dGVybmFsX3Byb2Nlc3Nvci5wcm90bxIZZW52b3kuc2VydmljZS5leHRfcHJvYy52MyKpAgoVUHJvdG9jb2xDb25maWd1cmF0aW9uEmsKEXJlcXVlc3RfYm9keV9tb2RlGAEgASgOMkYuZW52b3kuZXh0ZW5zaW9ucy5maWx0ZXJzLmh0dHAuZXh0X3Byb2MudjMuUHJvY2Vzc2luZ01vZGUuQm9keVNlbmRNb2RlQgj6QgWCAQIQARJsChJyZXNwb25zZV9ib2R5X21vZGUYAiABKA4yRi5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52My5Qcm9jZXNzaW5nTW9kZS5Cb2R5U2VuZE1vZGVCCPpCBYIBAhABEjUKLXNlbmRfYm9keV93aXRob3V0X3dhaXRpbmdfZm9yX2hlYWRlcl9yZXNwb25zZRgDIAEoCCKBBgoRUHJvY2Vzc2luZ1JlcXVlc3QSQQoPcmVxdWVzdF9oZWFkZXJzGAIgASgLMiYuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IdHRwSGVhZGVyc0gAEkIKEHJlc3BvbnNlX2hlYWRlcnMYAyABKAsyJi5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkh0dHBIZWFkZXJzSAASOwoMcmVxdWVzdF9ib2R5GAQgASgLMiMuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IdHRwQm9keUgAEjwKDXJlc3BvbnNlX2JvZHkYBSABKAsyIy5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkh0dHBCb2R5SAASQwoQcmVxdWVzdF90cmFpbGVycxgGIAEoCzInLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuSHR0cFRyYWlsZXJzSAASRAoRcmVzcG9uc2VfdHJhaWxlcnMYByABKAsyJy5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkh0dHBUcmFpbGVyc0gAEjgKEG1ldGFkYXRhX2NvbnRleHQYCCABKAsyHi5lbnZveS5jb25maWcuY29yZS52My5NZXRhZGF0YRJQCgphdHRyaWJ1dGVzGAkgAygLMjwuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Qcm9jZXNzaW5nUmVxdWVzdC5BdHRyaWJ1dGVzRW50cnkSGgoSb2JzZXJ2YWJpbGl0eV9tb2RlGAogASgIEkkKD3Byb3RvY29sX2NvbmZpZxgLIAEoCzIwLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuUHJvdG9jb2xDb25maWd1cmF0aW9uGkoKD0F0dHJpYnV0ZXNFbnRyeRILCgNrZXkYASABKAkSJgoFdmFsdWUYAiABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0OgI4AUIOCgdyZXF1ZXN0EgP4QgFKBAgBEAJSCmFzeW5jX21vZGUi2AUKElByb2Nlc3NpbmdSZXNwb25zZRJFCg9yZXF1ZXN0X2hlYWRlcnMYASABKAsyKi5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkhlYWRlcnNSZXNwb25zZUgAEkYKEHJlc3BvbnNlX2hlYWRlcnMYAiABKAsyKi5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkhlYWRlcnNSZXNwb25zZUgAEj8KDHJlcXVlc3RfYm9keRgDIAEoCzInLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuQm9keVJlc3BvbnNlSAASQAoNcmVzcG9uc2VfYm9keRgEIAEoCzInLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuQm9keVJlc3BvbnNlSAASRwoQcmVxdWVzdF90cmFpbGVycxgFIAEoCzIrLmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjMuVHJhaWxlcnNSZXNwb25zZUgAEkgKEXJlc3BvbnNlX3RyYWlsZXJzGAYgASgLMisuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5UcmFpbGVyc1Jlc3BvbnNlSAASSgoSaW1tZWRpYXRlX3Jlc3BvbnNlGAcgASgLMiwuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5JbW1lZGlhdGVSZXNwb25zZUgAEjEKEGR5bmFtaWNfbWV0YWRhdGEYCCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0ElAKDW1vZGVfb3ZlcnJpZGUYCSABKAsyOS5lbnZveS5leHRlbnNpb25zLmZpbHRlcnMuaHR0cC5leHRfcHJvYy52My5Qcm9jZXNzaW5nTW9kZRI7ChhvdmVycmlkZV9tZXNzYWdlX3RpbWVvdXQYCiABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CDwoIcmVzcG9uc2USA/hCASL7AQoLSHR0cEhlYWRlcnMSMAoHaGVhZGVycxgBIAEoCzIfLmVudm95LmNvbmZpZy5jb3JlLnYzLkhlYWRlck1hcBJXCgphdHRyaWJ1dGVzGAIgAygLMjYuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IdHRwSGVhZGVycy5BdHRyaWJ1dGVzRW50cnlCCxgBkseG2AQDMy4wEhUKDWVuZF9vZl9zdHJlYW0YAyABKAgaSgoPQXR0cmlidXRlc0VudHJ5EgsKA2tleRgBIAEoCRImCgV2YWx1ZRgCIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3Q6AjgBIi8KCEh0dHBCb2R5EgwKBGJvZHkYASABKAwSFQoNZW5kX29mX3N0cmVhbRgCIAEoCCJBCgxIdHRwVHJhaWxlcnMSMQoIdHJhaWxlcnMYASABKAsyHy5lbnZveS5jb25maWcuY29yZS52My5IZWFkZXJNYXAiTgoPSGVhZGVyc1Jlc3BvbnNlEjsKCHJlc3BvbnNlGAEgASgLMikuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Db21tb25SZXNwb25zZSJLCgxCb2R5UmVzcG9uc2USOwoIcmVzcG9uc2UYASABKAsyKS5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkNvbW1vblJlc3BvbnNlIlYKEFRyYWlsZXJzUmVzcG9uc2USQgoPaGVhZGVyX211dGF0aW9uGAEgASgLMikuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IZWFkZXJNdXRhdGlvbiLwAgoOQ29tbW9uUmVzcG9uc2USUgoGc3RhdHVzGAEgASgOMjguZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Db21tb25SZXNwb25zZS5SZXNwb25zZVN0YXR1c0II+kIFggECEAESQgoPaGVhZGVyX211dGF0aW9uGAIgASgLMikuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5IZWFkZXJNdXRhdGlvbhI+Cg1ib2R5X211dGF0aW9uGAMgASgLMicuZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Cb2R5TXV0YXRpb24SMQoIdHJhaWxlcnMYBCABKAsyHy5lbnZveS5jb25maWcuY29yZS52My5IZWFkZXJNYXASGQoRY2xlYXJfcm91dGVfY2FjaGUYBSABKAgiOAoOUmVzcG9uc2VTdGF0dXMSDAoIQ09OVElOVUUQABIYChRDT05USU5VRV9BTkRfUkVQTEFDRRABIt8BChFJbW1lZGlhdGVSZXNwb25zZRIzCgZzdGF0dXMYASABKAsyGS5lbnZveS50eXBlLnYzLkh0dHBTdGF0dXNCCPpCBYoBAhABEjoKB2hlYWRlcnMYAiABKAsyKS5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkhlYWRlck11dGF0aW9uEgwKBGJvZHkYAyABKAwSOgoLZ3JwY19zdGF0dXMYBCABKAsyJS5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLkdycGNTdGF0dXMSDwoHZGV0YWlscxgFIAEoCSIcCgpHcnBjU3RhdHVzEg4KBnN0YXR1cxgBIAEoDSJmCg5IZWFkZXJNdXRhdGlvbhI8CgtzZXRfaGVhZGVycxgBIAMoCzInLmVudm95LmNvbmZpZy5jb3JlLnYzLkhlYWRlclZhbHVlT3B0aW9uEhYKDnJlbW92ZV9oZWFkZXJzGAIgAygJIjsKFFN0cmVhbWVkQm9keVJlc3BvbnNlEgwKBGJvZHkYASABKAwSFQoNZW5kX29mX3N0cmVhbRgCIAEoCCKYAQoMQm9keU11dGF0aW9uEg4KBGJvZHkYASABKAxIABIUCgpjbGVhcl9ib2R5GAIgASgISAASVgoRc3RyZWFtZWRfcmVzcG9uc2UYAyABKAsyLy5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLlN0cmVhbWVkQm9keVJlc3BvbnNlQgjSxqThBgIIAUgAQgoKCG11dGF0aW9uMn8KEUV4dGVybmFsUHJvY2Vzc29yEmoKB1Byb2Nlc3MSLC5lbnZveS5zZXJ2aWNlLmV4dF9wcm9jLnYzLlByb2Nlc3NpbmdSZXF1ZXN0Gi0uZW52b3kuc2VydmljZS5leHRfcHJvYy52My5Qcm9jZXNzaW5nUmVzcG9uc2UoATABQpgBCidpby5lbnZveXByb3h5LmVudm95LnNlcnZpY2UuZXh0X3Byb2MudjNCFkV4dGVybmFsUHJvY2Vzc29yUHJvdG9QAVpLZ2l0aHViLmNvbS9lbnZveXByb3h5L2dvLWNvbnRyb2wtcGxhbmUvZW52b3kvc2VydmljZS9leHRfcHJvYy92MztleHRfcHJvY3YzuoDI0QYCEAJiBnByb3RvMw", [file_envoy_config_core_v3_base, file_envoy_extensions_filters_http_ext_proc_v3_processing_mode, file_envoy_type_v3_http_status, file_google_protobuf_duration, file_google_protobuf_struct, file_xds_annotations_v3_status, file_envoy_annotations_deprecation, file_udpa_annotations_status, file_validate_validate]); - -/** - * This message specifies the filter protocol configurations which will be sent to the ext_proc - * server in a :ref:`ProcessingRequest `. - * If the server does not support these protocol configurations, it may choose to close the gRPC stream. - * If the server supports these protocol configurations, it should respond based on the API specifications. - * - * @generated from message envoy.service.ext_proc.v3.ProtocolConfiguration - */ -export type ProtocolConfiguration = Message<"envoy.service.ext_proc.v3.ProtocolConfiguration"> & { - /** - * Specify the filter configuration :ref:`request_body_mode - * ` - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode request_body_mode = 1; - */ - requestBodyMode: ProcessingMode_BodySendMode; - - /** - * Specify the filter configuration :ref:`response_body_mode - * ` - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode.BodySendMode response_body_mode = 2; - */ - responseBodyMode: ProcessingMode_BodySendMode; - - /** - * Specify the filter configuration :ref:`send_body_without_waiting_for_header_response - * ` - * If the client is waiting for a header response from the server, setting ``true`` means the client will send body to the server - * as they arrive. Setting ``false`` means the client will buffer the arrived data and not send it to the server immediately. - * - * @generated from field: bool send_body_without_waiting_for_header_response = 3; - */ - sendBodyWithoutWaitingForHeaderResponse: boolean; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.ProtocolConfiguration. - * Use `create(ProtocolConfigurationSchema)` to create a new message. - */ -export const ProtocolConfigurationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 0); - -/** - * This represents the different types of messages that the data plane can send - * to an external processing server. - * [#next-free-field: 12] - * - * @generated from message envoy.service.ext_proc.v3.ProcessingRequest - */ -export type ProcessingRequest = Message<"envoy.service.ext_proc.v3.ProcessingRequest"> & { - /** - * Each request message will include one of the following sub-messages. Which - * ones are set for a particular HTTP request/response depend on the - * processing mode. - * - * @generated from oneof envoy.service.ext_proc.v3.ProcessingRequest.request - */ - request: { - /** - * Information about the HTTP request headers, as well as peer info and additional - * properties. Unless ``observability_mode`` is ``true``, the server must send back a - * HeaderResponse message, an ImmediateResponse message, or close the stream. - * - * @generated from field: envoy.service.ext_proc.v3.HttpHeaders request_headers = 2; - */ - value: HttpHeaders; - case: "requestHeaders"; - } | { - /** - * Information about the HTTP response headers, as well as peer info and additional - * properties. Unless ``observability_mode`` is ``true``, the server must send back a - * HeaderResponse message or close the stream. - * - * @generated from field: envoy.service.ext_proc.v3.HttpHeaders response_headers = 3; - */ - value: HttpHeaders; - case: "responseHeaders"; - } | { - /** - * A chunk of the HTTP request body. Unless ``observability_mode`` is true, the server must send back - * a BodyResponse message, an ImmediateResponse message, or close the stream. - * - * @generated from field: envoy.service.ext_proc.v3.HttpBody request_body = 4; - */ - value: HttpBody; - case: "requestBody"; - } | { - /** - * A chunk of the HTTP response body. Unless ``observability_mode`` is ``true``, the server must send back - * a BodyResponse message or close the stream. - * - * @generated from field: envoy.service.ext_proc.v3.HttpBody response_body = 5; - */ - value: HttpBody; - case: "responseBody"; - } | { - /** - * The HTTP trailers for the request path. Unless ``observability_mode`` is ``true``, the server - * must send back a TrailerResponse message or close the stream. - * - * This message is only sent if the trailers processing mode is set to ``SEND`` and - * the original downstream request has trailers. - * - * @generated from field: envoy.service.ext_proc.v3.HttpTrailers request_trailers = 6; - */ - value: HttpTrailers; - case: "requestTrailers"; - } | { - /** - * The HTTP trailers for the response path. Unless ``observability_mode`` is ``true``, the server - * must send back a TrailerResponse message or close the stream. - * - * This message is only sent if the trailers processing mode is set to ``SEND`` and - * the original upstream response has trailers. - * - * @generated from field: envoy.service.ext_proc.v3.HttpTrailers response_trailers = 7; - */ - value: HttpTrailers; - case: "responseTrailers"; - } | { case: undefined; value?: undefined }; - - /** - * Dynamic metadata associated with the request. - * - * @generated from field: envoy.config.core.v3.Metadata metadata_context = 8; - */ - metadataContext?: Metadata; - - /** - * The values of properties selected by the ``request_attributes`` - * or ``response_attributes`` list in the configuration. Each entry - * in the list is populated from the standard - * :ref:`attributes ` supported in the data plane. - * - * @generated from field: map attributes = 9; - */ - attributes: { [key: string]: JsonObject }; - - /** - * Specify whether the filter that sent this request is running in :ref:`observability_mode - * ` - * and defaults to false. - * - * * A value of ``false`` indicates that the server must respond - * to this message by either sending back a matching ProcessingResponse message, - * or by closing the stream. - * * A value of ``true`` indicates that the server should not respond to this message, as any - * responses will be ignored. However, it may still close the stream to indicate that no more messages - * are needed. - * - * - * @generated from field: bool observability_mode = 10; - */ - observabilityMode: boolean; - - /** - * Specify the filter protocol configurations to be sent to the server. - * ``protocol_config`` is only encoded in the first ``ProcessingRequest`` message from the client to the server. - * - * @generated from field: envoy.service.ext_proc.v3.ProtocolConfiguration protocol_config = 11; - */ - protocolConfig?: ProtocolConfiguration; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.ProcessingRequest. - * Use `create(ProcessingRequestSchema)` to create a new message. - */ -export const ProcessingRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 1); - -/** - * This represents the different types of messages the server may send back to the data plane - * when the ``observability_mode`` field in the received ProcessingRequest is set to false. - * - * * If the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is not set to ``FULL_DUPLEX_STREAMED``, then for every received ProcessingRequest, - * the server must send back exactly one ProcessingResponse message. - * * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined - * for this mode to send the ProcessingResponse messages. - * [#next-free-field: 11] - * - * @generated from message envoy.service.ext_proc.v3.ProcessingResponse - */ -export type ProcessingResponse = Message<"envoy.service.ext_proc.v3.ProcessingResponse"> & { - /** - * The response type that is sent by the server. - * - * @generated from oneof envoy.service.ext_proc.v3.ProcessingResponse.response - */ - response: { - /** - * The server must send back this message in response to a message with the - * ``request_headers`` field set. - * - * @generated from field: envoy.service.ext_proc.v3.HeadersResponse request_headers = 1; - */ - value: HeadersResponse; - case: "requestHeaders"; - } | { - /** - * The server must send back this message in response to a message with the - * ``response_headers`` field set. - * - * @generated from field: envoy.service.ext_proc.v3.HeadersResponse response_headers = 2; - */ - value: HeadersResponse; - case: "responseHeaders"; - } | { - /** - * The server must send back this message in response to a message with - * the ``request_body`` field set. - * - * @generated from field: envoy.service.ext_proc.v3.BodyResponse request_body = 3; - */ - value: BodyResponse; - case: "requestBody"; - } | { - /** - * The server must send back this message in response to a message with - * the ``response_body`` field set. - * - * @generated from field: envoy.service.ext_proc.v3.BodyResponse response_body = 4; - */ - value: BodyResponse; - case: "responseBody"; - } | { - /** - * The server must send back this message in response to a message with - * the ``request_trailers`` field set. - * - * @generated from field: envoy.service.ext_proc.v3.TrailersResponse request_trailers = 5; - */ - value: TrailersResponse; - case: "requestTrailers"; - } | { - /** - * The server must send back this message in response to a message with - * the ``response_trailers`` field set. - * - * @generated from field: envoy.service.ext_proc.v3.TrailersResponse response_trailers = 6; - */ - value: TrailersResponse; - case: "responseTrailers"; - } | { - /** - * If specified, attempt to create a locally generated response, send it - * downstream, and stop processing additional filters and ignore any - * additional messages received from the remote server for this request or - * response. If a response has already started -- for example, if this - * message is sent response to a ``response_body`` message -- then - * this will either ship the reply directly to the downstream codec, - * or reset the stream. - * - * @generated from field: envoy.service.ext_proc.v3.ImmediateResponse immediate_response = 7; - */ - value: ImmediateResponse; - case: "immediateResponse"; - } | { case: undefined; value?: undefined }; - - /** - * Optional metadata that will be emitted as dynamic metadata to be consumed by - * following filters. This metadata will be placed in the namespace(s) specified by the top-level - * field name(s) of the struct. - * - * @generated from field: google.protobuf.Struct dynamic_metadata = 8; - */ - dynamicMetadata?: JsonObject; - - /** - * Override how parts of the HTTP request and response are processed - * for the duration of this particular request/response only. Servers - * may use this to intelligently control how requests are processed - * based on the headers and other metadata that they see. - * This field is only applicable when servers responding to the header requests. - * If it is set in the response to the body or trailer requests, it will be ignored by the data plane. - * It is also ignored by the data plane when the ext_proc filter config - * :ref:`allow_mode_override - * ` - * is set to false, or - * :ref:`send_body_without_waiting_for_header_response - * ` - * is set to true. - * - * @generated from field: envoy.extensions.filters.http.ext_proc.v3.ProcessingMode mode_override = 9; - */ - modeOverride?: ProcessingMode; - - /** - * When ext_proc server receives a request message, in case it needs more - * time to process the message, it sends back a ProcessingResponse message - * with a new timeout value. When the data plane receives this response - * message, it ignores other fields in the response, just stop the original - * timer, which has the timeout value specified in - * :ref:`message_timeout - * ` - * and start a new timer with this ``override_message_timeout`` value and keep the - * data plane ext_proc filter state machine intact. - * Has to be >= 1ms and <= - * :ref:`max_message_timeout ` - * Such message can be sent at most once in a particular data plane ext_proc filter processing state. - * To enable this API, one has to set ``max_message_timeout`` to a number >= 1ms. - * - * @generated from field: google.protobuf.Duration override_message_timeout = 10; - */ - overrideMessageTimeout?: Duration; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.ProcessingResponse. - * Use `create(ProcessingResponseSchema)` to create a new message. - */ -export const ProcessingResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 2); - -/** - * This message is sent to the external server when the HTTP request and responses - * are first received. - * - * @generated from message envoy.service.ext_proc.v3.HttpHeaders - */ -export type HttpHeaders = Message<"envoy.service.ext_proc.v3.HttpHeaders"> & { - /** - * The HTTP request headers. All header keys will be - * lower-cased, because HTTP header keys are case-insensitive. - * The header value is encoded in the - * :ref:`raw_value ` field. - * - * @generated from field: envoy.config.core.v3.HeaderMap headers = 1; - */ - headers?: HeaderMap; - - /** - * [#not-implemented-hide:] - * This field is deprecated and not implemented. Attributes will be sent in - * the top-level :ref:`attributes attributes = 2 [deprecated = true]; - * @deprecated - */ - attributes: { [key: string]: JsonObject }; - - /** - * If ``true``, then there is no message body associated with this - * request or response. - * - * @generated from field: bool end_of_stream = 3; - */ - endOfStream: boolean; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.HttpHeaders. - * Use `create(HttpHeadersSchema)` to create a new message. - */ -export const HttpHeadersSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 3); - -/** - * This message is sent to the external server when the HTTP request and - * response bodies are received. - * - * @generated from message envoy.service.ext_proc.v3.HttpBody - */ -export type HttpBody = Message<"envoy.service.ext_proc.v3.HttpBody"> & { - /** - * The contents of the body in the HTTP request/response. Note that in - * streaming mode multiple ``HttpBody`` messages may be sent. - * - * @generated from field: bytes body = 1; - */ - body: Uint8Array; - - /** - * If ``true``, this will be the last ``HttpBody`` message that will be sent and no - * trailers will be sent for the current request/response. - * - * @generated from field: bool end_of_stream = 2; - */ - endOfStream: boolean; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.HttpBody. - * Use `create(HttpBodySchema)` to create a new message. - */ -export const HttpBodySchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 4); - -/** - * This message is sent to the external server when the HTTP request and - * response trailers are received. - * - * @generated from message envoy.service.ext_proc.v3.HttpTrailers - */ -export type HttpTrailers = Message<"envoy.service.ext_proc.v3.HttpTrailers"> & { - /** - * The header value is encoded in the - * :ref:`raw_value ` field. - * - * @generated from field: envoy.config.core.v3.HeaderMap trailers = 1; - */ - trailers?: HeaderMap; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.HttpTrailers. - * Use `create(HttpTrailersSchema)` to create a new message. - */ -export const HttpTrailersSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 5); - -/** - * This message is sent by the external server to the data plane after ``HttpHeaders`` was - * sent to it. - * - * @generated from message envoy.service.ext_proc.v3.HeadersResponse - */ -export type HeadersResponse = Message<"envoy.service.ext_proc.v3.HeadersResponse"> & { - /** - * Details the modifications (if any) to be made by the data plane to the current - * request/response. - * - * @generated from field: envoy.service.ext_proc.v3.CommonResponse response = 1; - */ - response?: CommonResponse; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.HeadersResponse. - * Use `create(HeadersResponseSchema)` to create a new message. - */ -export const HeadersResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 6); - -/** - * This message is sent by the external server to the data plane after ``HttpBody`` was - * sent to it. - * - * @generated from message envoy.service.ext_proc.v3.BodyResponse - */ -export type BodyResponse = Message<"envoy.service.ext_proc.v3.BodyResponse"> & { - /** - * Details the modifications (if any) to be made by the data plane to the current - * request/response. - * - * @generated from field: envoy.service.ext_proc.v3.CommonResponse response = 1; - */ - response?: CommonResponse; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.BodyResponse. - * Use `create(BodyResponseSchema)` to create a new message. - */ -export const BodyResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 7); - -/** - * This message is sent by the external server to the data plane after ``HttpTrailers`` was - * sent to it. - * - * @generated from message envoy.service.ext_proc.v3.TrailersResponse - */ -export type TrailersResponse = Message<"envoy.service.ext_proc.v3.TrailersResponse"> & { - /** - * Details the modifications (if any) to be made by the data plane to the current - * request/response trailers. - * - * @generated from field: envoy.service.ext_proc.v3.HeaderMutation header_mutation = 1; - */ - headerMutation?: HeaderMutation; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.TrailersResponse. - * Use `create(TrailersResponseSchema)` to create a new message. - */ -export const TrailersResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 8); - -/** - * This message contains common fields between header and body responses. - * [#next-free-field: 6] - * - * @generated from message envoy.service.ext_proc.v3.CommonResponse - */ -export type CommonResponse = Message<"envoy.service.ext_proc.v3.CommonResponse"> & { - /** - * If set, provide additional direction on how the data plane should - * handle the rest of the HTTP filter chain. - * - * @generated from field: envoy.service.ext_proc.v3.CommonResponse.ResponseStatus status = 1; - */ - status: CommonResponse_ResponseStatus; - - /** - * Instructions on how to manipulate the headers. When responding to an - * HttpBody request, header mutations will only take effect if - * the current processing mode for the body is BUFFERED. - * - * @generated from field: envoy.service.ext_proc.v3.HeaderMutation header_mutation = 2; - */ - headerMutation?: HeaderMutation; - - /** - * Replace the body of the last message sent to the remote server on this - * stream. If responding to an HttpBody request, simply replace or clear - * the body chunk that was sent with that request. Body mutations may take - * effect in response either to ``header`` or ``body`` messages. When it is - * in response to ``header`` messages, it only take effect if the - * :ref:`status ` - * is set to CONTINUE_AND_REPLACE. - * - * @generated from field: envoy.service.ext_proc.v3.BodyMutation body_mutation = 3; - */ - bodyMutation?: BodyMutation; - - /** - * [#not-implemented-hide:] - * Add new trailers to the message. This may be used when responding to either a - * HttpHeaders or HttpBody message, but only if this message is returned - * along with the CONTINUE_AND_REPLACE status. - * The header value is encoded in the - * :ref:`raw_value ` field. - * - * @generated from field: envoy.config.core.v3.HeaderMap trailers = 4; - */ - trailers?: HeaderMap; - - /** - * Clear the route cache for the current client request. This is necessary - * if the remote server modified headers that are used to calculate the route. - * This field is ignored in the response direction. This field is also ignored - * if the data plane ext_proc filter is in the upstream filter chain. - * - * @generated from field: bool clear_route_cache = 5; - */ - clearRouteCache: boolean; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.CommonResponse. - * Use `create(CommonResponseSchema)` to create a new message. - */ -export const CommonResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 9); - -/** - * The status of the response. - * - * @generated from enum envoy.service.ext_proc.v3.CommonResponse.ResponseStatus - */ -export enum CommonResponse_ResponseStatus { - /** - * Apply the mutation instructions in this message to the - * request or response, and then continue processing the filter - * stream as normal. This is the default. - * - * @generated from enum value: CONTINUE = 0; - */ - CONTINUE = 0, - - /** - * Apply the specified header mutation, replace the body with the body - * specified in the body mutation (if present), and do not send any - * further messages for this request or response even if the processing - * mode is configured to do so. - * - * When used in response to a request_headers or response_headers message, - * this status makes it possible to either completely replace the body - * while discarding the original body, or to add a body to a message that - * formerly did not have one. - * - * In other words, this response makes it possible to turn an HTTP GET - * into a POST, PUT, or PATCH. - * - * @generated from enum value: CONTINUE_AND_REPLACE = 1; - */ - CONTINUE_AND_REPLACE = 1, -} - -/** - * Describes the enum envoy.service.ext_proc.v3.CommonResponse.ResponseStatus. - */ -export const CommonResponse_ResponseStatusSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_envoy_service_ext_proc_v3_external_processor, 9, 0); - -/** - * This message causes the filter to attempt to create a locally - * generated response, send it downstream, stop processing - * additional filters, and ignore any additional messages received - * from the remote server for this request or response. If a response - * has already started, then this will either ship the reply directly - * to the downstream codec, or reset the stream. - * [#next-free-field: 6] - * - * @generated from message envoy.service.ext_proc.v3.ImmediateResponse - */ -export type ImmediateResponse = Message<"envoy.service.ext_proc.v3.ImmediateResponse"> & { - /** - * The response code to return. - * - * @generated from field: envoy.type.v3.HttpStatus status = 1; - */ - status?: HttpStatus; - - /** - * Apply changes to the default headers, which will include content-type. - * - * @generated from field: envoy.service.ext_proc.v3.HeaderMutation headers = 2; - */ - headers?: HeaderMutation; - - /** - * The message body to return with the response which is sent using the - * text/plain content type, or encoded in the grpc-message header. - * - * @generated from field: bytes body = 3; - */ - body: Uint8Array; - - /** - * If set, then include a gRPC status trailer. - * - * @generated from field: envoy.service.ext_proc.v3.GrpcStatus grpc_status = 4; - */ - grpcStatus?: GrpcStatus; - - /** - * A string detailing why this local reply was sent, which may be included - * in log and debug output (e.g. this populates the %RESPONSE_CODE_DETAILS% - * command operator field for use in access logging). - * - * @generated from field: string details = 5; - */ - details: string; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.ImmediateResponse. - * Use `create(ImmediateResponseSchema)` to create a new message. - */ -export const ImmediateResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 10); - -/** - * This message specifies a gRPC status for an ImmediateResponse message. - * - * @generated from message envoy.service.ext_proc.v3.GrpcStatus - */ -export type GrpcStatus = Message<"envoy.service.ext_proc.v3.GrpcStatus"> & { - /** - * The actual gRPC status. - * - * @generated from field: uint32 status = 1; - */ - status: number; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.GrpcStatus. - * Use `create(GrpcStatusSchema)` to create a new message. - */ -export const GrpcStatusSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 11); - -/** - * Change HTTP headers or trailers by appending, replacing, or removing - * headers. - * - * @generated from message envoy.service.ext_proc.v3.HeaderMutation - */ -export type HeaderMutation = Message<"envoy.service.ext_proc.v3.HeaderMutation"> & { - /** - * Add or replace HTTP headers. Attempts to set the value of - * any ``x-envoy`` header, and attempts to set the ``:method``, - * ``:authority``, ``:scheme``, or ``host`` headers will be ignored. - * The header value is encoded in the - * :ref:`raw_value ` field. - * - * @generated from field: repeated envoy.config.core.v3.HeaderValueOption set_headers = 1; - */ - setHeaders: HeaderValueOption[]; - - /** - * Remove these HTTP headers. Attempts to remove system headers -- - * any header starting with ``:``, plus ``host`` -- will be ignored. - * - * @generated from field: repeated string remove_headers = 2; - */ - removeHeaders: string[]; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.HeaderMutation. - * Use `create(HeaderMutationSchema)` to create a new message. - */ -export const HeaderMutationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 12); - -/** - * The body response message corresponding to FULL_DUPLEX_STREAMED body mode. - * - * @generated from message envoy.service.ext_proc.v3.StreamedBodyResponse - */ -export type StreamedBodyResponse = Message<"envoy.service.ext_proc.v3.StreamedBodyResponse"> & { - /** - * The body response chunk that will be passed to the upstream/downstream by the data plane. - * - * @generated from field: bytes body = 1; - */ - body: Uint8Array; - - /** - * The server sets this flag to true if it has received a body request with - * :ref:`end_of_stream ` set to true, - * and this is the last chunk of body responses. - * - * @generated from field: bool end_of_stream = 2; - */ - endOfStream: boolean; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.StreamedBodyResponse. - * Use `create(StreamedBodyResponseSchema)` to create a new message. - */ -export const StreamedBodyResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 13); - -/** - * This message specifies the body mutation the server sends to the data plane. - * - * @generated from message envoy.service.ext_proc.v3.BodyMutation - */ -export type BodyMutation = Message<"envoy.service.ext_proc.v3.BodyMutation"> & { - /** - * The type of mutation for the body. - * - * @generated from oneof envoy.service.ext_proc.v3.BodyMutation.mutation - */ - mutation: { - /** - * The entire body to replace. - * Should only be used when the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is not set to ``FULL_DUPLEX_STREAMED``. - * - * @generated from field: bytes body = 1; - */ - value: Uint8Array; - case: "body"; - } | { - /** - * Clear the corresponding body chunk. - * Should only be used when the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is not set to ``FULL_DUPLEX_STREAMED``. - * Clear the corresponding body chunk. - * - * @generated from field: bool clear_body = 2; - */ - value: boolean; - case: "clearBody"; - } | { - /** - * Must be used when the corresponding ``BodySendMode`` in the - * :ref:`processing_mode ` - * is set to ``FULL_DUPLEX_STREAMED``. - * - * @generated from field: envoy.service.ext_proc.v3.StreamedBodyResponse streamed_response = 3; - */ - value: StreamedBodyResponse; - case: "streamedResponse"; - } | { case: undefined; value?: undefined }; -}; - -/** - * Describes the message envoy.service.ext_proc.v3.BodyMutation. - * Use `create(BodyMutationSchema)` to create a new message. - */ -export const BodyMutationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_service_ext_proc_v3_external_processor, 14); - -/** - * A service that can access and modify HTTP requests and responses - * as part of a filter chain. - * The overall external processing protocol works like this: - * - * 1. The data plane sends to the service information about the HTTP request. - * 2. The service sends back a ProcessingResponse message that directs - * the data plane to either stop processing, continue without it, or send - * it the next chunk of the message body. - * 3. If so requested, the data plane sends the server the message body in - * chunks, or the entire body at once. In either case, the server may send - * back a ProcessingResponse for each message it receives, or wait for - * a certain amount of body chunks received before streaming back the - * ProcessingResponse messages. - * 4. If so requested, the data plane sends the server the HTTP trailers, - * and the server sends back a ProcessingResponse. - * 5. At this point, request processing is done, and we pick up again - * at step 1 when the data plane receives a response from the upstream - * server. - * 6. At any point above, if the server closes the gRPC stream cleanly, - * then the data plane proceeds without consulting the server. - * 7. At any point above, if the server closes the gRPC stream with an error, - * then the data plane returns a 500 error to the client, unless the filter - * was configured to ignore errors. - * - * In other words, the process is a request/response conversation, but - * using a gRPC stream to make it easier for the server to - * maintain state. - * - * @generated from service envoy.service.ext_proc.v3.ExternalProcessor - */ -export const ExternalProcessor: GenService<{ - /** - * This begins the bidirectional stream that the data plane will use to - * give the server control over what the filter does. The actual - * protocol is described by the ProcessingRequest and ProcessingResponse - * messages below. - * - * @generated from rpc envoy.service.ext_proc.v3.ExternalProcessor.Process - */ - process: { - methodKind: "bidi_streaming"; - input: typeof ProcessingRequestSchema; - output: typeof ProcessingResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_envoy_service_ext_proc_v3_external_processor, 0); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts deleted file mode 100644 index a597912e..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/envoy/type/v3/http_status_pb.ts +++ /dev/null @@ -1,452 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file envoy/type/v3/http_status.proto (package envoy.type.v3, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import { file_udpa_annotations_status } from "../../../udpa/annotations/status_pb.js"; -import { file_udpa_annotations_versioning } from "../../../udpa/annotations/versioning_pb.js"; -import { file_validate_validate } from "../../../validate/validate_pb.js"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file envoy/type/v3/http_status.proto. - */ -export const file_envoy_type_v3_http_status: GenFile = /*@__PURE__*/ - fileDesc("Ch9lbnZveS90eXBlL3YzL2h0dHBfc3RhdHVzLnByb3RvEg1lbnZveS50eXBlLnYzIl8KCkh0dHBTdGF0dXMSMwoEY29kZRgBIAEoDjIZLmVudm95LnR5cGUudjMuU3RhdHVzQ29kZUIK+kIHggEEEAEgADocmsWIHhcKFWVudm95LnR5cGUuSHR0cFN0YXR1cyq1CQoKU3RhdHVzQ29kZRIJCgVFbXB0eRAAEgwKCENvbnRpbnVlEGQSBwoCT0sQyAESDAoHQ3JlYXRlZBDJARINCghBY2NlcHRlZBDKARIgChtOb25BdXRob3JpdGF0aXZlSW5mb3JtYXRpb24QywESDgoJTm9Db250ZW50EMwBEhEKDFJlc2V0Q29udGVudBDNARITCg5QYXJ0aWFsQ29udGVudBDOARIQCgtNdWx0aVN0YXR1cxDPARIUCg9BbHJlYWR5UmVwb3J0ZWQQ0AESCwoGSU1Vc2VkEOIBEhQKD011bHRpcGxlQ2hvaWNlcxCsAhIVChBNb3ZlZFBlcm1hbmVudGx5EK0CEgoKBUZvdW5kEK4CEg0KCFNlZU90aGVyEK8CEhAKC05vdE1vZGlmaWVkELACEg0KCFVzZVByb3h5ELECEhYKEVRlbXBvcmFyeVJlZGlyZWN0ELMCEhYKEVBlcm1hbmVudFJlZGlyZWN0ELQCEg8KCkJhZFJlcXVlc3QQkAMSEQoMVW5hdXRob3JpemVkEJEDEhQKD1BheW1lbnRSZXF1aXJlZBCSAxIOCglGb3JiaWRkZW4QkwMSDQoITm90Rm91bmQQlAMSFQoQTWV0aG9kTm90QWxsb3dlZBCVAxISCg1Ob3RBY2NlcHRhYmxlEJYDEiAKG1Byb3h5QXV0aGVudGljYXRpb25SZXF1aXJlZBCXAxITCg5SZXF1ZXN0VGltZW91dBCYAxINCghDb25mbGljdBCZAxIJCgRHb25lEJoDEhMKDkxlbmd0aFJlcXVpcmVkEJsDEhcKElByZWNvbmRpdGlvbkZhaWxlZBCcAxIUCg9QYXlsb2FkVG9vTGFyZ2UQnQMSDwoKVVJJVG9vTG9uZxCeAxIZChRVbnN1cHBvcnRlZE1lZGlhVHlwZRCfAxIYChNSYW5nZU5vdFNhdGlzZmlhYmxlEKADEhYKEUV4cGVjdGF0aW9uRmFpbGVkEKEDEhcKEk1pc2RpcmVjdGVkUmVxdWVzdBClAxIYChNVbnByb2Nlc3NhYmxlRW50aXR5EKYDEgsKBkxvY2tlZBCnAxIVChBGYWlsZWREZXBlbmRlbmN5EKgDEhQKD1VwZ3JhZGVSZXF1aXJlZBCqAxIZChRQcmVjb25kaXRpb25SZXF1aXJlZBCsAxIUCg9Ub29NYW55UmVxdWVzdHMQrQMSIAobUmVxdWVzdEhlYWRlckZpZWxkc1Rvb0xhcmdlEK8DEhgKE0ludGVybmFsU2VydmVyRXJyb3IQ9AMSEwoOTm90SW1wbGVtZW50ZWQQ9QMSDwoKQmFkR2F0ZXdheRD2AxIXChJTZXJ2aWNlVW5hdmFpbGFibGUQ9wMSEwoOR2F0ZXdheVRpbWVvdXQQ+AMSHAoXSFRUUFZlcnNpb25Ob3RTdXBwb3J0ZWQQ+QMSGgoVVmFyaWFudEFsc29OZWdvdGlhdGVzEPoDEhgKE0luc3VmZmljaWVudFN0b3JhZ2UQ+wMSEQoMTG9vcERldGVjdGVkEPwDEhAKC05vdEV4dGVuZGVkEP4DEiIKHU5ldHdvcmtBdXRoZW50aWNhdGlvblJlcXVpcmVkEP8DQnUKG2lvLmVudm95cHJveHkuZW52b3kudHlwZS52M0IPSHR0cFN0YXR1c1Byb3RvUAFaO2dpdGh1Yi5jb20vZW52b3lwcm94eS9nby1jb250cm9sLXBsYW5lL2Vudm95L3R5cGUvdjM7dHlwZXYzuoDI0QYCEAJiBnByb3RvMw", [file_udpa_annotations_status, file_udpa_annotations_versioning, file_validate_validate]); - -/** - * HTTP status. - * - * @generated from message envoy.type.v3.HttpStatus - */ -export type HttpStatus = Message<"envoy.type.v3.HttpStatus"> & { - /** - * Supplies HTTP response code. - * - * @generated from field: envoy.type.v3.StatusCode code = 1; - */ - code: StatusCode; -}; - -/** - * Describes the message envoy.type.v3.HttpStatus. - * Use `create(HttpStatusSchema)` to create a new message. - */ -export const HttpStatusSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_envoy_type_v3_http_status, 0); - -/** - * HTTP response codes supported in Envoy. - * For more details: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * - * @generated from enum envoy.type.v3.StatusCode - */ -export enum StatusCode { - /** - * Empty - This code not part of the HTTP status code specification, but it is needed for proto - * `enum` type. - * - * @generated from enum value: Empty = 0; - */ - Empty = 0, - - /** - * Continue - ``100`` status code. - * - * @generated from enum value: Continue = 100; - */ - Continue = 100, - - /** - * OK - ``200`` status code. - * - * @generated from enum value: OK = 200; - */ - OK = 200, - - /** - * Created - ``201`` status code. - * - * @generated from enum value: Created = 201; - */ - Created = 201, - - /** - * Accepted - ``202`` status code. - * - * @generated from enum value: Accepted = 202; - */ - Accepted = 202, - - /** - * NonAuthoritativeInformation - ``203`` status code. - * - * @generated from enum value: NonAuthoritativeInformation = 203; - */ - NonAuthoritativeInformation = 203, - - /** - * NoContent - ``204`` status code. - * - * @generated from enum value: NoContent = 204; - */ - NoContent = 204, - - /** - * ResetContent - ``205`` status code. - * - * @generated from enum value: ResetContent = 205; - */ - ResetContent = 205, - - /** - * PartialContent - ``206`` status code. - * - * @generated from enum value: PartialContent = 206; - */ - PartialContent = 206, - - /** - * MultiStatus - ``207`` status code. - * - * @generated from enum value: MultiStatus = 207; - */ - MultiStatus = 207, - - /** - * AlreadyReported - ``208`` status code. - * - * @generated from enum value: AlreadyReported = 208; - */ - AlreadyReported = 208, - - /** - * IMUsed - ``226`` status code. - * - * @generated from enum value: IMUsed = 226; - */ - IMUsed = 226, - - /** - * MultipleChoices - ``300`` status code. - * - * @generated from enum value: MultipleChoices = 300; - */ - MultipleChoices = 300, - - /** - * MovedPermanently - ``301`` status code. - * - * @generated from enum value: MovedPermanently = 301; - */ - MovedPermanently = 301, - - /** - * Found - ``302`` status code. - * - * @generated from enum value: Found = 302; - */ - Found = 302, - - /** - * SeeOther - ``303`` status code. - * - * @generated from enum value: SeeOther = 303; - */ - SeeOther = 303, - - /** - * NotModified - ``304`` status code. - * - * @generated from enum value: NotModified = 304; - */ - NotModified = 304, - - /** - * UseProxy - ``305`` status code. - * - * @generated from enum value: UseProxy = 305; - */ - UseProxy = 305, - - /** - * TemporaryRedirect - ``307`` status code. - * - * @generated from enum value: TemporaryRedirect = 307; - */ - TemporaryRedirect = 307, - - /** - * PermanentRedirect - ``308`` status code. - * - * @generated from enum value: PermanentRedirect = 308; - */ - PermanentRedirect = 308, - - /** - * BadRequest - ``400`` status code. - * - * @generated from enum value: BadRequest = 400; - */ - BadRequest = 400, - - /** - * Unauthorized - ``401`` status code. - * - * @generated from enum value: Unauthorized = 401; - */ - Unauthorized = 401, - - /** - * PaymentRequired - ``402`` status code. - * - * @generated from enum value: PaymentRequired = 402; - */ - PaymentRequired = 402, - - /** - * Forbidden - ``403`` status code. - * - * @generated from enum value: Forbidden = 403; - */ - Forbidden = 403, - - /** - * NotFound - ``404`` status code. - * - * @generated from enum value: NotFound = 404; - */ - NotFound = 404, - - /** - * MethodNotAllowed - ``405`` status code. - * - * @generated from enum value: MethodNotAllowed = 405; - */ - MethodNotAllowed = 405, - - /** - * NotAcceptable - ``406`` status code. - * - * @generated from enum value: NotAcceptable = 406; - */ - NotAcceptable = 406, - - /** - * ProxyAuthenticationRequired - ``407`` status code. - * - * @generated from enum value: ProxyAuthenticationRequired = 407; - */ - ProxyAuthenticationRequired = 407, - - /** - * RequestTimeout - ``408`` status code. - * - * @generated from enum value: RequestTimeout = 408; - */ - RequestTimeout = 408, - - /** - * Conflict - ``409`` status code. - * - * @generated from enum value: Conflict = 409; - */ - Conflict = 409, - - /** - * Gone - ``410`` status code. - * - * @generated from enum value: Gone = 410; - */ - Gone = 410, - - /** - * LengthRequired - ``411`` status code. - * - * @generated from enum value: LengthRequired = 411; - */ - LengthRequired = 411, - - /** - * PreconditionFailed - ``412`` status code. - * - * @generated from enum value: PreconditionFailed = 412; - */ - PreconditionFailed = 412, - - /** - * PayloadTooLarge - ``413`` status code. - * - * @generated from enum value: PayloadTooLarge = 413; - */ - PayloadTooLarge = 413, - - /** - * URITooLong - ``414`` status code. - * - * @generated from enum value: URITooLong = 414; - */ - URITooLong = 414, - - /** - * UnsupportedMediaType - ``415`` status code. - * - * @generated from enum value: UnsupportedMediaType = 415; - */ - UnsupportedMediaType = 415, - - /** - * RangeNotSatisfiable - ``416`` status code. - * - * @generated from enum value: RangeNotSatisfiable = 416; - */ - RangeNotSatisfiable = 416, - - /** - * ExpectationFailed - ``417`` status code. - * - * @generated from enum value: ExpectationFailed = 417; - */ - ExpectationFailed = 417, - - /** - * MisdirectedRequest - ``421`` status code. - * - * @generated from enum value: MisdirectedRequest = 421; - */ - MisdirectedRequest = 421, - - /** - * UnprocessableEntity - ``422`` status code. - * - * @generated from enum value: UnprocessableEntity = 422; - */ - UnprocessableEntity = 422, - - /** - * Locked - ``423`` status code. - * - * @generated from enum value: Locked = 423; - */ - Locked = 423, - - /** - * FailedDependency - ``424`` status code. - * - * @generated from enum value: FailedDependency = 424; - */ - FailedDependency = 424, - - /** - * UpgradeRequired - ``426`` status code. - * - * @generated from enum value: UpgradeRequired = 426; - */ - UpgradeRequired = 426, - - /** - * PreconditionRequired - ``428`` status code. - * - * @generated from enum value: PreconditionRequired = 428; - */ - PreconditionRequired = 428, - - /** - * TooManyRequests - ``429`` status code. - * - * @generated from enum value: TooManyRequests = 429; - */ - TooManyRequests = 429, - - /** - * RequestHeaderFieldsTooLarge - ``431`` status code. - * - * @generated from enum value: RequestHeaderFieldsTooLarge = 431; - */ - RequestHeaderFieldsTooLarge = 431, - - /** - * InternalServerError - ``500`` status code. - * - * @generated from enum value: InternalServerError = 500; - */ - InternalServerError = 500, - - /** - * NotImplemented - ``501`` status code. - * - * @generated from enum value: NotImplemented = 501; - */ - NotImplemented = 501, - - /** - * BadGateway - ``502`` status code. - * - * @generated from enum value: BadGateway = 502; - */ - BadGateway = 502, - - /** - * ServiceUnavailable - ``503`` status code. - * - * @generated from enum value: ServiceUnavailable = 503; - */ - ServiceUnavailable = 503, - - /** - * GatewayTimeout - ``504`` status code. - * - * @generated from enum value: GatewayTimeout = 504; - */ - GatewayTimeout = 504, - - /** - * HTTPVersionNotSupported - ``505`` status code. - * - * @generated from enum value: HTTPVersionNotSupported = 505; - */ - HTTPVersionNotSupported = 505, - - /** - * VariantAlsoNegotiates - ``506`` status code. - * - * @generated from enum value: VariantAlsoNegotiates = 506; - */ - VariantAlsoNegotiates = 506, - - /** - * InsufficientStorage - ``507`` status code. - * - * @generated from enum value: InsufficientStorage = 507; - */ - InsufficientStorage = 507, - - /** - * LoopDetected - ``508`` status code. - * - * @generated from enum value: LoopDetected = 508; - */ - LoopDetected = 508, - - /** - * NotExtended - ``510`` status code. - * - * @generated from enum value: NotExtended = 510; - */ - NotExtended = 510, - - /** - * NetworkAuthenticationRequired - ``511`` status code. - * - * @generated from enum value: NetworkAuthenticationRequired = 511; - */ - NetworkAuthenticationRequired = 511, -} - -/** - * Describes the enum envoy.type.v3.StatusCode. - */ -export const StatusCodeSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_envoy_type_v3_http_status, 0); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts deleted file mode 100644 index 0a6acd05..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/migrate_pb.ts +++ /dev/null @@ -1,38 +0,0 @@ -// THIS FILE IS DEPRECATED -// Users should instead use the corresponding proto in the xds tree. -// No new changes will be accepted here. - -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file udpa/annotations/migrate.proto (package udpa.annotations, syntax proto3) -/* eslint-disable */ - -import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file udpa/annotations/migrate.proto. - */ -export const file_udpa_annotations_migrate: GenFile = /*@__PURE__*/ - fileDesc("Ch51ZHBhL2Fubm90YXRpb25zL21pZ3JhdGUucHJvdG8SEHVkcGEuYW5ub3RhdGlvbnMiMAoVRmlsZU1pZ3JhdGVBbm5vdGF0aW9uEhcKD21vdmVfdG9fcGFja2FnZRgCIAEoCUIpWidnaXRodWIuY29tL2NuY2YveGRzL2dvL3VkcGEvYW5ub3RhdGlvbnNiBnByb3RvMw"); - -/** - * @generated from message udpa.annotations.FileMigrateAnnotation - */ -export type FileMigrateAnnotation = Message<"udpa.annotations.FileMigrateAnnotation"> & { - /** - * Move all types in the file to another package, this implies changing proto - * file path. - * - * @generated from field: string move_to_package = 2; - */ - moveToPackage: string; -}; - -/** - * Describes the message udpa.annotations.FileMigrateAnnotation. - * Use `create(FileMigrateAnnotationSchema)` to create a new message. - */ -export const FileMigrateAnnotationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_udpa_annotations_migrate, 0); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts deleted file mode 100644 index 85771028..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/status_pb.ts +++ /dev/null @@ -1,84 +0,0 @@ -// THIS FILE IS DEPRECATED -// Users should instead use the corresponding proto in the xds tree. -// No new changes will be accepted here. - -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file udpa/annotations/status.proto (package udpa.annotations, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file udpa/annotations/status.proto. - */ -export const file_udpa_annotations_status: GenFile = /*@__PURE__*/ - fileDesc("Ch11ZHBhL2Fubm90YXRpb25zL3N0YXR1cy5wcm90bxIQdWRwYS5hbm5vdGF0aW9ucyJ0ChBTdGF0dXNBbm5vdGF0aW9uEhgKEHdvcmtfaW5fcHJvZ3Jlc3MYASABKAgSRgoWcGFja2FnZV92ZXJzaW9uX3N0YXR1cxgCIAEoDjImLnVkcGEuYW5ub3RhdGlvbnMuUGFja2FnZVZlcnNpb25TdGF0dXMqXQoUUGFja2FnZVZlcnNpb25TdGF0dXMSCwoHVU5LTk9XThAAEgoKBkZST1pFThABEgoKBkFDVElWRRACEiAKHE5FWFRfTUFKT1JfVkVSU0lPTl9DQU5ESURBVEUQA0IpWidnaXRodWIuY29tL2NuY2YveGRzL2dvL3VkcGEvYW5ub3RhdGlvbnNiBnByb3RvMw"); - -/** - * @generated from message udpa.annotations.StatusAnnotation - */ -export type StatusAnnotation = Message<"udpa.annotations.StatusAnnotation"> & { - /** - * The entity is work-in-progress and subject to breaking changes. - * - * @generated from field: bool work_in_progress = 1; - */ - workInProgress: boolean; - - /** - * The entity belongs to a package with the given version status. - * - * @generated from field: udpa.annotations.PackageVersionStatus package_version_status = 2; - */ - packageVersionStatus: PackageVersionStatus; -}; - -/** - * Describes the message udpa.annotations.StatusAnnotation. - * Use `create(StatusAnnotationSchema)` to create a new message. - */ -export const StatusAnnotationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_udpa_annotations_status, 0); - -/** - * @generated from enum udpa.annotations.PackageVersionStatus - */ -export enum PackageVersionStatus { - /** - * Unknown package version status. - * - * @generated from enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - - /** - * This version of the package is frozen. - * - * @generated from enum value: FROZEN = 1; - */ - FROZEN = 1, - - /** - * This version of the package is the active development version. - * - * @generated from enum value: ACTIVE = 2; - */ - ACTIVE = 2, - - /** - * This version of the package is the candidate for the next major version. It - * is typically machine generated from the active development version. - * - * @generated from enum value: NEXT_MAJOR_VERSION_CANDIDATE = 3; - */ - NEXT_MAJOR_VERSION_CANDIDATE = 3, -} - -/** - * Describes the enum udpa.annotations.PackageVersionStatus. - */ -export const PackageVersionStatusSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_udpa_annotations_status, 0); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts deleted file mode 100644 index f33b3585..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/udpa/annotations/versioning_pb.ts +++ /dev/null @@ -1,39 +0,0 @@ -// THIS FILE IS DEPRECATED -// Users should instead use the corresponding proto in the xds tree. -// No new changes will be accepted here. - -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file udpa/annotations/versioning.proto (package udpa.annotations, syntax proto3) -/* eslint-disable */ - -import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file udpa/annotations/versioning.proto. - */ -export const file_udpa_annotations_versioning: GenFile = /*@__PURE__*/ - fileDesc("CiF1ZHBhL2Fubm90YXRpb25zL3ZlcnNpb25pbmcucHJvdG8SEHVkcGEuYW5ub3RhdGlvbnMiNQoUVmVyc2lvbmluZ0Fubm90YXRpb24SHQoVcHJldmlvdXNfbWVzc2FnZV90eXBlGAEgASgJQilaJ2dpdGh1Yi5jb20vY25jZi94ZHMvZ28vdWRwYS9hbm5vdGF0aW9uc2IGcHJvdG8z"); - -/** - * @generated from message udpa.annotations.VersioningAnnotation - */ -export type VersioningAnnotation = Message<"udpa.annotations.VersioningAnnotation"> & { - /** - * Track the previous message type. E.g. this message might be - * udpa.foo.v3alpha.Foo and it was previously udpa.bar.v2.Bar. This - * information is consumed by UDPA via proto descriptors. - * - * @generated from field: string previous_message_type = 1; - */ - previousMessageType: string; -}; - -/** - * Describes the message udpa.annotations.VersioningAnnotation. - * Use `create(VersioningAnnotationSchema)` to create a new message. - */ -export const VersioningAnnotationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_udpa_annotations_versioning, 0); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts deleted file mode 100644 index c45225c8..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/validate/validate_pb.ts +++ /dev/null @@ -1,1984 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file validate/validate.proto (package validate, syntax proto2) -/* eslint-disable */ - -import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Duration, FieldOptions, MessageOptions, OneofOptions, Timestamp } from "@bufbuild/protobuf/wkt"; -import { file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file validate/validate.proto. - */ -export const file_validate_validate: GenFile = /*@__PURE__*/ - fileDesc("Chd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90bxIIdmFsaWRhdGUimAcKCkZpZWxkUnVsZXMSJwoHbWVzc2FnZRgRIAEoCzIWLnZhbGlkYXRlLk1lc3NhZ2VSdWxlcxIlCgVmbG9hdBgBIAEoCzIULnZhbGlkYXRlLkZsb2F0UnVsZXNIABInCgZkb3VibGUYAiABKAsyFS52YWxpZGF0ZS5Eb3VibGVSdWxlc0gAEiUKBWludDMyGAMgASgLMhQudmFsaWRhdGUuSW50MzJSdWxlc0gAEiUKBWludDY0GAQgASgLMhQudmFsaWRhdGUuSW50NjRSdWxlc0gAEicKBnVpbnQzMhgFIAEoCzIVLnZhbGlkYXRlLlVJbnQzMlJ1bGVzSAASJwoGdWludDY0GAYgASgLMhUudmFsaWRhdGUuVUludDY0UnVsZXNIABInCgZzaW50MzIYByABKAsyFS52YWxpZGF0ZS5TSW50MzJSdWxlc0gAEicKBnNpbnQ2NBgIIAEoCzIVLnZhbGlkYXRlLlNJbnQ2NFJ1bGVzSAASKQoHZml4ZWQzMhgJIAEoCzIWLnZhbGlkYXRlLkZpeGVkMzJSdWxlc0gAEikKB2ZpeGVkNjQYCiABKAsyFi52YWxpZGF0ZS5GaXhlZDY0UnVsZXNIABIrCghzZml4ZWQzMhgLIAEoCzIXLnZhbGlkYXRlLlNGaXhlZDMyUnVsZXNIABIrCghzZml4ZWQ2NBgMIAEoCzIXLnZhbGlkYXRlLlNGaXhlZDY0UnVsZXNIABIjCgRib29sGA0gASgLMhMudmFsaWRhdGUuQm9vbFJ1bGVzSAASJwoGc3RyaW5nGA4gASgLMhUudmFsaWRhdGUuU3RyaW5nUnVsZXNIABIlCgVieXRlcxgPIAEoCzIULnZhbGlkYXRlLkJ5dGVzUnVsZXNIABIjCgRlbnVtGBAgASgLMhMudmFsaWRhdGUuRW51bVJ1bGVzSAASKwoIcmVwZWF0ZWQYEiABKAsyFy52YWxpZGF0ZS5SZXBlYXRlZFJ1bGVzSAASIQoDbWFwGBMgASgLMhIudmFsaWRhdGUuTWFwUnVsZXNIABIhCgNhbnkYFCABKAsyEi52YWxpZGF0ZS5BbnlSdWxlc0gAEisKCGR1cmF0aW9uGBUgASgLMhcudmFsaWRhdGUuRHVyYXRpb25SdWxlc0gAEi0KCXRpbWVzdGFtcBgWIAEoCzIYLnZhbGlkYXRlLlRpbWVzdGFtcFJ1bGVzSABCBgoEdHlwZSJ/CgpGbG9hdFJ1bGVzEg0KBWNvbnN0GAEgASgCEgoKAmx0GAIgASgCEgsKA2x0ZRgDIAEoAhIKCgJndBgEIAEoAhILCgNndGUYBSABKAISCgoCaW4YBiADKAISDgoGbm90X2luGAcgAygCEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCKAAQoLRG91YmxlUnVsZXMSDQoFY29uc3QYASABKAESCgoCbHQYAiABKAESCwoDbHRlGAMgASgBEgoKAmd0GAQgASgBEgsKA2d0ZRgFIAEoARIKCgJpbhgGIAMoARIOCgZub3RfaW4YByADKAESFAoMaWdub3JlX2VtcHR5GAggASgIIn8KCkludDMyUnVsZXMSDQoFY29uc3QYASABKAUSCgoCbHQYAiABKAUSCwoDbHRlGAMgASgFEgoKAmd0GAQgASgFEgsKA2d0ZRgFIAEoBRIKCgJpbhgGIAMoBRIOCgZub3RfaW4YByADKAUSFAoMaWdub3JlX2VtcHR5GAggASgIIn8KCkludDY0UnVsZXMSDQoFY29uc3QYASABKAMSCgoCbHQYAiABKAMSCwoDbHRlGAMgASgDEgoKAmd0GAQgASgDEgsKA2d0ZRgFIAEoAxIKCgJpbhgGIAMoAxIOCgZub3RfaW4YByADKAMSFAoMaWdub3JlX2VtcHR5GAggASgIIoABCgtVSW50MzJSdWxlcxINCgVjb25zdBgBIAEoDRIKCgJsdBgCIAEoDRILCgNsdGUYAyABKA0SCgoCZ3QYBCABKA0SCwoDZ3RlGAUgASgNEgoKAmluGAYgAygNEg4KBm5vdF9pbhgHIAMoDRIUCgxpZ25vcmVfZW1wdHkYCCABKAgigAEKC1VJbnQ2NFJ1bGVzEg0KBWNvbnN0GAEgASgEEgoKAmx0GAIgASgEEgsKA2x0ZRgDIAEoBBIKCgJndBgEIAEoBBILCgNndGUYBSABKAQSCgoCaW4YBiADKAQSDgoGbm90X2luGAcgAygEEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCKAAQoLU0ludDMyUnVsZXMSDQoFY29uc3QYASABKBESCgoCbHQYAiABKBESCwoDbHRlGAMgASgREgoKAmd0GAQgASgREgsKA2d0ZRgFIAEoERIKCgJpbhgGIAMoERIOCgZub3RfaW4YByADKBESFAoMaWdub3JlX2VtcHR5GAggASgIIoABCgtTSW50NjRSdWxlcxINCgVjb25zdBgBIAEoEhIKCgJsdBgCIAEoEhILCgNsdGUYAyABKBISCgoCZ3QYBCABKBISCwoDZ3RlGAUgASgSEgoKAmluGAYgAygSEg4KBm5vdF9pbhgHIAMoEhIUCgxpZ25vcmVfZW1wdHkYCCABKAgigQEKDEZpeGVkMzJSdWxlcxINCgVjb25zdBgBIAEoBxIKCgJsdBgCIAEoBxILCgNsdGUYAyABKAcSCgoCZ3QYBCABKAcSCwoDZ3RlGAUgASgHEgoKAmluGAYgAygHEg4KBm5vdF9pbhgHIAMoBxIUCgxpZ25vcmVfZW1wdHkYCCABKAgigQEKDEZpeGVkNjRSdWxlcxINCgVjb25zdBgBIAEoBhIKCgJsdBgCIAEoBhILCgNsdGUYAyABKAYSCgoCZ3QYBCABKAYSCwoDZ3RlGAUgASgGEgoKAmluGAYgAygGEg4KBm5vdF9pbhgHIAMoBhIUCgxpZ25vcmVfZW1wdHkYCCABKAgiggEKDVNGaXhlZDMyUnVsZXMSDQoFY29uc3QYASABKA8SCgoCbHQYAiABKA8SCwoDbHRlGAMgASgPEgoKAmd0GAQgASgPEgsKA2d0ZRgFIAEoDxIKCgJpbhgGIAMoDxIOCgZub3RfaW4YByADKA8SFAoMaWdub3JlX2VtcHR5GAggASgIIoIBCg1TRml4ZWQ2NFJ1bGVzEg0KBWNvbnN0GAEgASgQEgoKAmx0GAIgASgQEgsKA2x0ZRgDIAEoEBIKCgJndBgEIAEoEBILCgNndGUYBSABKBASCgoCaW4YBiADKBASDgoGbm90X2luGAcgAygQEhQKDGlnbm9yZV9lbXB0eRgIIAEoCCIaCglCb29sUnVsZXMSDQoFY29uc3QYASABKAgi/QMKC1N0cmluZ1J1bGVzEg0KBWNvbnN0GAEgASgJEgsKA2xlbhgTIAEoBBIPCgdtaW5fbGVuGAIgASgEEg8KB21heF9sZW4YAyABKAQSEQoJbGVuX2J5dGVzGBQgASgEEhEKCW1pbl9ieXRlcxgEIAEoBBIRCgltYXhfYnl0ZXMYBSABKAQSDwoHcGF0dGVybhgGIAEoCRIOCgZwcmVmaXgYByABKAkSDgoGc3VmZml4GAggASgJEhAKCGNvbnRhaW5zGAkgASgJEhQKDG5vdF9jb250YWlucxgXIAEoCRIKCgJpbhgKIAMoCRIOCgZub3RfaW4YCyADKAkSDwoFZW1haWwYDCABKAhIABISCghob3N0bmFtZRgNIAEoCEgAEgwKAmlwGA4gASgISAASDgoEaXB2NBgPIAEoCEgAEg4KBGlwdjYYECABKAhIABINCgN1cmkYESABKAhIABIRCgd1cmlfcmVmGBIgASgISAASEQoHYWRkcmVzcxgVIAEoCEgAEg4KBHV1aWQYFiABKAhIABIwChB3ZWxsX2tub3duX3JlZ2V4GBggASgOMhQudmFsaWRhdGUuS25vd25SZWdleEgAEhQKBnN0cmljdBgZIAEoCDoEdHJ1ZRIUCgxpZ25vcmVfZW1wdHkYGiABKAhCDAoKd2VsbF9rbm93biL7AQoKQnl0ZXNSdWxlcxINCgVjb25zdBgBIAEoDBILCgNsZW4YDSABKAQSDwoHbWluX2xlbhgCIAEoBBIPCgdtYXhfbGVuGAMgASgEEg8KB3BhdHRlcm4YBCABKAkSDgoGcHJlZml4GAUgASgMEg4KBnN1ZmZpeBgGIAEoDBIQCghjb250YWlucxgHIAEoDBIKCgJpbhgIIAMoDBIOCgZub3RfaW4YCSADKAwSDAoCaXAYCiABKAhIABIOCgRpcHY0GAsgASgISAASDgoEaXB2NhgMIAEoCEgAEhQKDGlnbm9yZV9lbXB0eRgOIAEoCEIMCgp3ZWxsX2tub3duIkwKCUVudW1SdWxlcxINCgVjb25zdBgBIAEoBRIUCgxkZWZpbmVkX29ubHkYAiABKAgSCgoCaW4YAyADKAUSDgoGbm90X2luGAQgAygFIi4KDE1lc3NhZ2VSdWxlcxIMCgRza2lwGAEgASgIEhAKCHJlcXVpcmVkGAIgASgIIoABCg1SZXBlYXRlZFJ1bGVzEhEKCW1pbl9pdGVtcxgBIAEoBBIRCgltYXhfaXRlbXMYAiABKAQSDgoGdW5pcXVlGAMgASgIEiMKBWl0ZW1zGAQgASgLMhQudmFsaWRhdGUuRmllbGRSdWxlcxIUCgxpZ25vcmVfZW1wdHkYBSABKAgiowEKCE1hcFJ1bGVzEhEKCW1pbl9wYWlycxgBIAEoBBIRCgltYXhfcGFpcnMYAiABKAQSEQoJbm9fc3BhcnNlGAMgASgIEiIKBGtleXMYBCABKAsyFC52YWxpZGF0ZS5GaWVsZFJ1bGVzEiQKBnZhbHVlcxgFIAEoCzIULnZhbGlkYXRlLkZpZWxkUnVsZXMSFAoMaWdub3JlX2VtcHR5GAYgASgIIjgKCEFueVJ1bGVzEhAKCHJlcXVpcmVkGAEgASgIEgoKAmluGAIgAygJEg4KBm5vdF9pbhgDIAMoCSK7AgoNRHVyYXRpb25SdWxlcxIQCghyZXF1aXJlZBgBIAEoCBIoCgVjb25zdBgCIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhIlCgJsdBgDIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhImCgNsdGUYBCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SJQoCZ3QYBSABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SJgoDZ3RlGAYgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEiUKAmluGAcgAygLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEikKBm5vdF9pbhgIIAMoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbiK6AgoOVGltZXN0YW1wUnVsZXMSEAoIcmVxdWlyZWQYASABKAgSKQoFY29uc3QYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmx0GAMgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNsdGUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmd0GAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNndGUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEg4KBmx0X25vdxgHIAEoCBIOCgZndF9ub3cYCCABKAgSKQoGd2l0aGluGAkgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uKkYKCktub3duUmVnZXgSCwoHVU5LTk9XThAAEhQKEEhUVFBfSEVBREVSX05BTUUQARIVChFIVFRQX0hFQURFUl9WQUxVRRACOjwKCGRpc2FibGVkEh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGK8IIAEoCFIIZGlzYWJsZWQ6OgoHaWdub3JlZBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiwCCABKAhSB2lnbm9yZWQ6OgoIcmVxdWlyZWQSHS5nb29nbGUucHJvdG9idWYuT25lb2ZPcHRpb25zGK8IIAEoCFIIcmVxdWlyZWQ6SgoFcnVsZXMSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGK8IIAEoCzIULnZhbGlkYXRlLkZpZWxkUnVsZXNSBXJ1bGVzQlAKGmlvLmVudm95cHJveHkucGd2LnZhbGlkYXRlWjJnaXRodWIuY29tL2Vudm95cHJveHkvcHJvdG9jLWdlbi12YWxpZGF0ZS92YWxpZGF0ZQ", [file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_timestamp]); - -/** - * FieldRules encapsulates the rules for each type of field. Depending on the - * field, the correct set should be used to ensure proper validations. - * - * @generated from message validate.FieldRules - */ -export type FieldRules = Message<"validate.FieldRules"> & { - /** - * @generated from field: optional validate.MessageRules message = 17; - */ - message?: MessageRules; - - /** - * @generated from oneof validate.FieldRules.type - */ - type: { - /** - * Scalar Field Types - * - * @generated from field: validate.FloatRules float = 1; - */ - value: FloatRules; - case: "float"; - } | { - /** - * @generated from field: validate.DoubleRules double = 2; - */ - value: DoubleRules; - case: "double"; - } | { - /** - * @generated from field: validate.Int32Rules int32 = 3; - */ - value: Int32Rules; - case: "int32"; - } | { - /** - * @generated from field: validate.Int64Rules int64 = 4; - */ - value: Int64Rules; - case: "int64"; - } | { - /** - * @generated from field: validate.UInt32Rules uint32 = 5; - */ - value: UInt32Rules; - case: "uint32"; - } | { - /** - * @generated from field: validate.UInt64Rules uint64 = 6; - */ - value: UInt64Rules; - case: "uint64"; - } | { - /** - * @generated from field: validate.SInt32Rules sint32 = 7; - */ - value: SInt32Rules; - case: "sint32"; - } | { - /** - * @generated from field: validate.SInt64Rules sint64 = 8; - */ - value: SInt64Rules; - case: "sint64"; - } | { - /** - * @generated from field: validate.Fixed32Rules fixed32 = 9; - */ - value: Fixed32Rules; - case: "fixed32"; - } | { - /** - * @generated from field: validate.Fixed64Rules fixed64 = 10; - */ - value: Fixed64Rules; - case: "fixed64"; - } | { - /** - * @generated from field: validate.SFixed32Rules sfixed32 = 11; - */ - value: SFixed32Rules; - case: "sfixed32"; - } | { - /** - * @generated from field: validate.SFixed64Rules sfixed64 = 12; - */ - value: SFixed64Rules; - case: "sfixed64"; - } | { - /** - * @generated from field: validate.BoolRules bool = 13; - */ - value: BoolRules; - case: "bool"; - } | { - /** - * @generated from field: validate.StringRules string = 14; - */ - value: StringRules; - case: "string"; - } | { - /** - * @generated from field: validate.BytesRules bytes = 15; - */ - value: BytesRules; - case: "bytes"; - } | { - /** - * Complex Field Types - * - * @generated from field: validate.EnumRules enum = 16; - */ - value: EnumRules; - case: "enum"; - } | { - /** - * @generated from field: validate.RepeatedRules repeated = 18; - */ - value: RepeatedRules; - case: "repeated"; - } | { - /** - * @generated from field: validate.MapRules map = 19; - */ - value: MapRules; - case: "map"; - } | { - /** - * Well-Known Field Types - * - * @generated from field: validate.AnyRules any = 20; - */ - value: AnyRules; - case: "any"; - } | { - /** - * @generated from field: validate.DurationRules duration = 21; - */ - value: DurationRules; - case: "duration"; - } | { - /** - * @generated from field: validate.TimestampRules timestamp = 22; - */ - value: TimestampRules; - case: "timestamp"; - } | { case: undefined; value?: undefined }; -}; - -/** - * Describes the message validate.FieldRules. - * Use `create(FieldRulesSchema)` to create a new message. - */ -export const FieldRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 0); - -/** - * FloatRules describes the constraints applied to `float` values - * - * @generated from message validate.FloatRules - */ -export type FloatRules = Message<"validate.FloatRules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional float const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional float lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional float lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional float gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional float gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated float in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated float not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.FloatRules. - * Use `create(FloatRulesSchema)` to create a new message. - */ -export const FloatRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 1); - -/** - * DoubleRules describes the constraints applied to `double` values - * - * @generated from message validate.DoubleRules - */ -export type DoubleRules = Message<"validate.DoubleRules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional double const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional double lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional double lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional double gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional double gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated double in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated double not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.DoubleRules. - * Use `create(DoubleRulesSchema)` to create a new message. - */ -export const DoubleRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 2); - -/** - * Int32Rules describes the constraints applied to `int32` values - * - * @generated from message validate.Int32Rules - */ -export type Int32Rules = Message<"validate.Int32Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional int32 const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional int32 lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional int32 lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional int32 gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional int32 gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated int32 in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated int32 not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.Int32Rules. - * Use `create(Int32RulesSchema)` to create a new message. - */ -export const Int32RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 3); - -/** - * Int64Rules describes the constraints applied to `int64` values - * - * @generated from message validate.Int64Rules - */ -export type Int64Rules = Message<"validate.Int64Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional int64 const = 1; - */ - const: bigint; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional int64 lt = 2; - */ - lt: bigint; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional int64 lte = 3; - */ - lte: bigint; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional int64 gt = 4; - */ - gt: bigint; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional int64 gte = 5; - */ - gte: bigint; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated int64 in = 6; - */ - in: bigint[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated int64 not_in = 7; - */ - notIn: bigint[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.Int64Rules. - * Use `create(Int64RulesSchema)` to create a new message. - */ -export const Int64RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 4); - -/** - * UInt32Rules describes the constraints applied to `uint32` values - * - * @generated from message validate.UInt32Rules - */ -export type UInt32Rules = Message<"validate.UInt32Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional uint32 const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional uint32 lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional uint32 lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional uint32 gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional uint32 gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated uint32 in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated uint32 not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.UInt32Rules. - * Use `create(UInt32RulesSchema)` to create a new message. - */ -export const UInt32RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 5); - -/** - * UInt64Rules describes the constraints applied to `uint64` values - * - * @generated from message validate.UInt64Rules - */ -export type UInt64Rules = Message<"validate.UInt64Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional uint64 const = 1; - */ - const: bigint; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional uint64 lt = 2; - */ - lt: bigint; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional uint64 lte = 3; - */ - lte: bigint; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional uint64 gt = 4; - */ - gt: bigint; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional uint64 gte = 5; - */ - gte: bigint; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated uint64 in = 6; - */ - in: bigint[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated uint64 not_in = 7; - */ - notIn: bigint[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.UInt64Rules. - * Use `create(UInt64RulesSchema)` to create a new message. - */ -export const UInt64RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 6); - -/** - * SInt32Rules describes the constraints applied to `sint32` values - * - * @generated from message validate.SInt32Rules - */ -export type SInt32Rules = Message<"validate.SInt32Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional sint32 const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional sint32 lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional sint32 lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional sint32 gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional sint32 gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated sint32 in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated sint32 not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.SInt32Rules. - * Use `create(SInt32RulesSchema)` to create a new message. - */ -export const SInt32RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 7); - -/** - * SInt64Rules describes the constraints applied to `sint64` values - * - * @generated from message validate.SInt64Rules - */ -export type SInt64Rules = Message<"validate.SInt64Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional sint64 const = 1; - */ - const: bigint; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional sint64 lt = 2; - */ - lt: bigint; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional sint64 lte = 3; - */ - lte: bigint; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional sint64 gt = 4; - */ - gt: bigint; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional sint64 gte = 5; - */ - gte: bigint; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated sint64 in = 6; - */ - in: bigint[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated sint64 not_in = 7; - */ - notIn: bigint[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.SInt64Rules. - * Use `create(SInt64RulesSchema)` to create a new message. - */ -export const SInt64RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 8); - -/** - * Fixed32Rules describes the constraints applied to `fixed32` values - * - * @generated from message validate.Fixed32Rules - */ -export type Fixed32Rules = Message<"validate.Fixed32Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional fixed32 const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional fixed32 lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional fixed32 lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional fixed32 gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional fixed32 gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated fixed32 in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated fixed32 not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.Fixed32Rules. - * Use `create(Fixed32RulesSchema)` to create a new message. - */ -export const Fixed32RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 9); - -/** - * Fixed64Rules describes the constraints applied to `fixed64` values - * - * @generated from message validate.Fixed64Rules - */ -export type Fixed64Rules = Message<"validate.Fixed64Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional fixed64 const = 1; - */ - const: bigint; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional fixed64 lt = 2; - */ - lt: bigint; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional fixed64 lte = 3; - */ - lte: bigint; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional fixed64 gt = 4; - */ - gt: bigint; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional fixed64 gte = 5; - */ - gte: bigint; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated fixed64 in = 6; - */ - in: bigint[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated fixed64 not_in = 7; - */ - notIn: bigint[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.Fixed64Rules. - * Use `create(Fixed64RulesSchema)` to create a new message. - */ -export const Fixed64RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 10); - -/** - * SFixed32Rules describes the constraints applied to `sfixed32` values - * - * @generated from message validate.SFixed32Rules - */ -export type SFixed32Rules = Message<"validate.SFixed32Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional sfixed32 const = 1; - */ - const: number; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional sfixed32 lt = 2; - */ - lt: number; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional sfixed32 lte = 3; - */ - lte: number; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional sfixed32 gt = 4; - */ - gt: number; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional sfixed32 gte = 5; - */ - gte: number; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated sfixed32 in = 6; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated sfixed32 not_in = 7; - */ - notIn: number[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.SFixed32Rules. - * Use `create(SFixed32RulesSchema)` to create a new message. - */ -export const SFixed32RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 11); - -/** - * SFixed64Rules describes the constraints applied to `sfixed64` values - * - * @generated from message validate.SFixed64Rules - */ -export type SFixed64Rules = Message<"validate.SFixed64Rules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional sfixed64 const = 1; - */ - const: bigint; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional sfixed64 lt = 2; - */ - lt: bigint; - - /** - * Lte specifies that this field must be less than or equal to the - * specified value, inclusive - * - * @generated from field: optional sfixed64 lte = 3; - */ - lte: bigint; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive. If the value of Gt is larger than a specified Lt or Lte, the - * range is reversed. - * - * @generated from field: optional sfixed64 gt = 4; - */ - gt: bigint; - - /** - * Gte specifies that this field must be greater than or equal to the - * specified value, inclusive. If the value of Gte is larger than a - * specified Lt or Lte, the range is reversed. - * - * @generated from field: optional sfixed64 gte = 5; - */ - gte: bigint; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated sfixed64 in = 6; - */ - in: bigint[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated sfixed64 not_in = 7; - */ - notIn: bigint[]; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 8; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.SFixed64Rules. - * Use `create(SFixed64RulesSchema)` to create a new message. - */ -export const SFixed64RulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 12); - -/** - * BoolRules describes the constraints applied to `bool` values - * - * @generated from message validate.BoolRules - */ -export type BoolRules = Message<"validate.BoolRules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional bool const = 1; - */ - const: boolean; -}; - -/** - * Describes the message validate.BoolRules. - * Use `create(BoolRulesSchema)` to create a new message. - */ -export const BoolRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 13); - -/** - * StringRules describe the constraints applied to `string` values - * - * @generated from message validate.StringRules - */ -export type StringRules = Message<"validate.StringRules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional string const = 1; - */ - const: string; - - /** - * Len specifies that this field must be the specified number of - * characters (Unicode code points). Note that the number of - * characters may differ from the number of bytes in the string. - * - * @generated from field: optional uint64 len = 19; - */ - len: bigint; - - /** - * MinLen specifies that this field must be the specified number of - * characters (Unicode code points) at a minimum. Note that the number of - * characters may differ from the number of bytes in the string. - * - * @generated from field: optional uint64 min_len = 2; - */ - minLen: bigint; - - /** - * MaxLen specifies that this field must be the specified number of - * characters (Unicode code points) at a maximum. Note that the number of - * characters may differ from the number of bytes in the string. - * - * @generated from field: optional uint64 max_len = 3; - */ - maxLen: bigint; - - /** - * LenBytes specifies that this field must be the specified number of bytes - * - * @generated from field: optional uint64 len_bytes = 20; - */ - lenBytes: bigint; - - /** - * MinBytes specifies that this field must be the specified number of bytes - * at a minimum - * - * @generated from field: optional uint64 min_bytes = 4; - */ - minBytes: bigint; - - /** - * MaxBytes specifies that this field must be the specified number of bytes - * at a maximum - * - * @generated from field: optional uint64 max_bytes = 5; - */ - maxBytes: bigint; - - /** - * Pattern specifies that this field must match against the specified - * regular expression (RE2 syntax). The included expression should elide - * any delimiters. - * - * @generated from field: optional string pattern = 6; - */ - pattern: string; - - /** - * Prefix specifies that this field must have the specified substring at - * the beginning of the string. - * - * @generated from field: optional string prefix = 7; - */ - prefix: string; - - /** - * Suffix specifies that this field must have the specified substring at - * the end of the string. - * - * @generated from field: optional string suffix = 8; - */ - suffix: string; - - /** - * Contains specifies that this field must have the specified substring - * anywhere in the string. - * - * @generated from field: optional string contains = 9; - */ - contains: string; - - /** - * NotContains specifies that this field cannot have the specified substring - * anywhere in the string. - * - * @generated from field: optional string not_contains = 23; - */ - notContains: string; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated string in = 10; - */ - in: string[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated string not_in = 11; - */ - notIn: string[]; - - /** - * WellKnown rules provide advanced constraints against common string - * patterns - * - * @generated from oneof validate.StringRules.well_known - */ - wellKnown: { - /** - * Email specifies that the field must be a valid email address as - * defined by RFC 5322 - * - * @generated from field: bool email = 12; - */ - value: boolean; - case: "email"; - } | { - /** - * Hostname specifies that the field must be a valid hostname as - * defined by RFC 1034. This constraint does not support - * internationalized domain names (IDNs). - * - * @generated from field: bool hostname = 13; - */ - value: boolean; - case: "hostname"; - } | { - /** - * Ip specifies that the field must be a valid IP (v4 or v6) address. - * Valid IPv6 addresses should not include surrounding square brackets. - * - * @generated from field: bool ip = 14; - */ - value: boolean; - case: "ip"; - } | { - /** - * Ipv4 specifies that the field must be a valid IPv4 address. - * - * @generated from field: bool ipv4 = 15; - */ - value: boolean; - case: "ipv4"; - } | { - /** - * Ipv6 specifies that the field must be a valid IPv6 address. Valid - * IPv6 addresses should not include surrounding square brackets. - * - * @generated from field: bool ipv6 = 16; - */ - value: boolean; - case: "ipv6"; - } | { - /** - * Uri specifies that the field must be a valid, absolute URI as defined - * by RFC 3986 - * - * @generated from field: bool uri = 17; - */ - value: boolean; - case: "uri"; - } | { - /** - * UriRef specifies that the field must be a valid URI as defined by RFC - * 3986 and may be relative or absolute. - * - * @generated from field: bool uri_ref = 18; - */ - value: boolean; - case: "uriRef"; - } | { - /** - * Address specifies that the field must be either a valid hostname as - * defined by RFC 1034 (which does not support internationalized domain - * names or IDNs), or it can be a valid IP (v4 or v6). - * - * @generated from field: bool address = 21; - */ - value: boolean; - case: "address"; - } | { - /** - * Uuid specifies that the field must be a valid UUID as defined by - * RFC 4122 - * - * @generated from field: bool uuid = 22; - */ - value: boolean; - case: "uuid"; - } | { - /** - * WellKnownRegex specifies a common well known pattern defined as a regex. - * - * @generated from field: validate.KnownRegex well_known_regex = 24; - */ - value: KnownRegex; - case: "wellKnownRegex"; - } | { case: undefined; value?: undefined }; - - /** - * This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - * strict header validation. - * By default, this is true, and HTTP header validations are RFC-compliant. - * Setting to false will enable a looser validations that only disallows - * \r\n\0 characters, which can be used to bypass header matching rules. - * - * @generated from field: optional bool strict = 25 [default = true]; - */ - strict: boolean; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 26; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.StringRules. - * Use `create(StringRulesSchema)` to create a new message. - */ -export const StringRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 14); - -/** - * BytesRules describe the constraints applied to `bytes` values - * - * @generated from message validate.BytesRules - */ -export type BytesRules = Message<"validate.BytesRules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional bytes const = 1; - */ - const: Uint8Array; - - /** - * Len specifies that this field must be the specified number of bytes - * - * @generated from field: optional uint64 len = 13; - */ - len: bigint; - - /** - * MinLen specifies that this field must be the specified number of bytes - * at a minimum - * - * @generated from field: optional uint64 min_len = 2; - */ - minLen: bigint; - - /** - * MaxLen specifies that this field must be the specified number of bytes - * at a maximum - * - * @generated from field: optional uint64 max_len = 3; - */ - maxLen: bigint; - - /** - * Pattern specifies that this field must match against the specified - * regular expression (RE2 syntax). The included expression should elide - * any delimiters. - * - * @generated from field: optional string pattern = 4; - */ - pattern: string; - - /** - * Prefix specifies that this field must have the specified bytes at the - * beginning of the string. - * - * @generated from field: optional bytes prefix = 5; - */ - prefix: Uint8Array; - - /** - * Suffix specifies that this field must have the specified bytes at the - * end of the string. - * - * @generated from field: optional bytes suffix = 6; - */ - suffix: Uint8Array; - - /** - * Contains specifies that this field must have the specified bytes - * anywhere in the string. - * - * @generated from field: optional bytes contains = 7; - */ - contains: Uint8Array; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated bytes in = 8; - */ - in: Uint8Array[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated bytes not_in = 9; - */ - notIn: Uint8Array[]; - - /** - * WellKnown rules provide advanced constraints against common byte - * patterns - * - * @generated from oneof validate.BytesRules.well_known - */ - wellKnown: { - /** - * Ip specifies that the field must be a valid IP (v4 or v6) address in - * byte format - * - * @generated from field: bool ip = 10; - */ - value: boolean; - case: "ip"; - } | { - /** - * Ipv4 specifies that the field must be a valid IPv4 address in byte - * format - * - * @generated from field: bool ipv4 = 11; - */ - value: boolean; - case: "ipv4"; - } | { - /** - * Ipv6 specifies that the field must be a valid IPv6 address in byte - * format - * - * @generated from field: bool ipv6 = 12; - */ - value: boolean; - case: "ipv6"; - } | { case: undefined; value?: undefined }; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 14; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.BytesRules. - * Use `create(BytesRulesSchema)` to create a new message. - */ -export const BytesRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 15); - -/** - * EnumRules describe the constraints applied to enum values - * - * @generated from message validate.EnumRules - */ -export type EnumRules = Message<"validate.EnumRules"> & { - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional int32 const = 1; - */ - const: number; - - /** - * DefinedOnly specifies that this field must be only one of the defined - * values for this enum, failing on any undefined value. - * - * @generated from field: optional bool defined_only = 2; - */ - definedOnly: boolean; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated int32 in = 3; - */ - in: number[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated int32 not_in = 4; - */ - notIn: number[]; -}; - -/** - * Describes the message validate.EnumRules. - * Use `create(EnumRulesSchema)` to create a new message. - */ -export const EnumRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 16); - -/** - * MessageRules describe the constraints applied to embedded message values. - * For message-type fields, validation is performed recursively. - * - * @generated from message validate.MessageRules - */ -export type MessageRules = Message<"validate.MessageRules"> & { - /** - * Skip specifies that the validation rules of this field should not be - * evaluated - * - * @generated from field: optional bool skip = 1; - */ - skip: boolean; - - /** - * Required specifies that this field must be set - * - * @generated from field: optional bool required = 2; - */ - required: boolean; -}; - -/** - * Describes the message validate.MessageRules. - * Use `create(MessageRulesSchema)` to create a new message. - */ -export const MessageRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 17); - -/** - * RepeatedRules describe the constraints applied to `repeated` values - * - * @generated from message validate.RepeatedRules - */ -export type RepeatedRules = Message<"validate.RepeatedRules"> & { - /** - * MinItems specifies that this field must have the specified number of - * items at a minimum - * - * @generated from field: optional uint64 min_items = 1; - */ - minItems: bigint; - - /** - * MaxItems specifies that this field must have the specified number of - * items at a maximum - * - * @generated from field: optional uint64 max_items = 2; - */ - maxItems: bigint; - - /** - * Unique specifies that all elements in this field must be unique. This - * constraint is only applicable to scalar and enum types (messages are not - * supported). - * - * @generated from field: optional bool unique = 3; - */ - unique: boolean; - - /** - * Items specifies the constraints to be applied to each item in the field. - * Repeated message fields will still execute validation against each item - * unless skip is specified here. - * - * @generated from field: optional validate.FieldRules items = 4; - */ - items?: FieldRules; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 5; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.RepeatedRules. - * Use `create(RepeatedRulesSchema)` to create a new message. - */ -export const RepeatedRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 18); - -/** - * MapRules describe the constraints applied to `map` values - * - * @generated from message validate.MapRules - */ -export type MapRules = Message<"validate.MapRules"> & { - /** - * MinPairs specifies that this field must have the specified number of - * KVs at a minimum - * - * @generated from field: optional uint64 min_pairs = 1; - */ - minPairs: bigint; - - /** - * MaxPairs specifies that this field must have the specified number of - * KVs at a maximum - * - * @generated from field: optional uint64 max_pairs = 2; - */ - maxPairs: bigint; - - /** - * NoSparse specifies values in this field cannot be unset. This only - * applies to map's with message value types. - * - * @generated from field: optional bool no_sparse = 3; - */ - noSparse: boolean; - - /** - * Keys specifies the constraints to be applied to each key in the field. - * - * @generated from field: optional validate.FieldRules keys = 4; - */ - keys?: FieldRules; - - /** - * Values specifies the constraints to be applied to the value of each key - * in the field. Message values will still have their validations evaluated - * unless skip is specified here. - * - * @generated from field: optional validate.FieldRules values = 5; - */ - values?: FieldRules; - - /** - * IgnoreEmpty specifies that the validation rules of this field should be - * evaluated only if the field is not empty - * - * @generated from field: optional bool ignore_empty = 6; - */ - ignoreEmpty: boolean; -}; - -/** - * Describes the message validate.MapRules. - * Use `create(MapRulesSchema)` to create a new message. - */ -export const MapRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 19); - -/** - * AnyRules describe constraints applied exclusively to the - * `google.protobuf.Any` well-known type - * - * @generated from message validate.AnyRules - */ -export type AnyRules = Message<"validate.AnyRules"> & { - /** - * Required specifies that this field must be set - * - * @generated from field: optional bool required = 1; - */ - required: boolean; - - /** - * In specifies that this field's `type_url` must be equal to one of the - * specified values. - * - * @generated from field: repeated string in = 2; - */ - in: string[]; - - /** - * NotIn specifies that this field's `type_url` must not be equal to any of - * the specified values. - * - * @generated from field: repeated string not_in = 3; - */ - notIn: string[]; -}; - -/** - * Describes the message validate.AnyRules. - * Use `create(AnyRulesSchema)` to create a new message. - */ -export const AnyRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 20); - -/** - * DurationRules describe the constraints applied exclusively to the - * `google.protobuf.Duration` well-known type - * - * @generated from message validate.DurationRules - */ -export type DurationRules = Message<"validate.DurationRules"> & { - /** - * Required specifies that this field must be set - * - * @generated from field: optional bool required = 1; - */ - required: boolean; - - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional google.protobuf.Duration const = 2; - */ - const?: Duration; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional google.protobuf.Duration lt = 3; - */ - lt?: Duration; - - /** - * Lt specifies that this field must be less than the specified value, - * inclusive - * - * @generated from field: optional google.protobuf.Duration lte = 4; - */ - lte?: Duration; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive - * - * @generated from field: optional google.protobuf.Duration gt = 5; - */ - gt?: Duration; - - /** - * Gte specifies that this field must be greater than the specified value, - * inclusive - * - * @generated from field: optional google.protobuf.Duration gte = 6; - */ - gte?: Duration; - - /** - * In specifies that this field must be equal to one of the specified - * values - * - * @generated from field: repeated google.protobuf.Duration in = 7; - */ - in: Duration[]; - - /** - * NotIn specifies that this field cannot be equal to one of the specified - * values - * - * @generated from field: repeated google.protobuf.Duration not_in = 8; - */ - notIn: Duration[]; -}; - -/** - * Describes the message validate.DurationRules. - * Use `create(DurationRulesSchema)` to create a new message. - */ -export const DurationRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 21); - -/** - * TimestampRules describe the constraints applied exclusively to the - * `google.protobuf.Timestamp` well-known type - * - * @generated from message validate.TimestampRules - */ -export type TimestampRules = Message<"validate.TimestampRules"> & { - /** - * Required specifies that this field must be set - * - * @generated from field: optional bool required = 1; - */ - required: boolean; - - /** - * Const specifies that this field must be exactly the specified value - * - * @generated from field: optional google.protobuf.Timestamp const = 2; - */ - const?: Timestamp; - - /** - * Lt specifies that this field must be less than the specified value, - * exclusive - * - * @generated from field: optional google.protobuf.Timestamp lt = 3; - */ - lt?: Timestamp; - - /** - * Lte specifies that this field must be less than the specified value, - * inclusive - * - * @generated from field: optional google.protobuf.Timestamp lte = 4; - */ - lte?: Timestamp; - - /** - * Gt specifies that this field must be greater than the specified value, - * exclusive - * - * @generated from field: optional google.protobuf.Timestamp gt = 5; - */ - gt?: Timestamp; - - /** - * Gte specifies that this field must be greater than the specified value, - * inclusive - * - * @generated from field: optional google.protobuf.Timestamp gte = 6; - */ - gte?: Timestamp; - - /** - * LtNow specifies that this must be less than the current time. LtNow - * can only be used with the Within rule. - * - * @generated from field: optional bool lt_now = 7; - */ - ltNow: boolean; - - /** - * GtNow specifies that this must be greater than the current time. GtNow - * can only be used with the Within rule. - * - * @generated from field: optional bool gt_now = 8; - */ - gtNow: boolean; - - /** - * Within specifies that this field must be within this duration of the - * current time. This constraint can be used alone or with the LtNow and - * GtNow rules. - * - * @generated from field: optional google.protobuf.Duration within = 9; - */ - within?: Duration; -}; - -/** - * Describes the message validate.TimestampRules. - * Use `create(TimestampRulesSchema)` to create a new message. - */ -export const TimestampRulesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_validate_validate, 22); - -/** - * WellKnownRegex contain some well-known patterns. - * - * @generated from enum validate.KnownRegex - */ -export enum KnownRegex { - /** - * @generated from enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - - /** - * HTTP header name as defined by RFC 7230. - * - * @generated from enum value: HTTP_HEADER_NAME = 1; - */ - HTTP_HEADER_NAME = 1, - - /** - * HTTP header value as defined by RFC 7230. - * - * @generated from enum value: HTTP_HEADER_VALUE = 2; - */ - HTTP_HEADER_VALUE = 2, -} - -/** - * Describes the enum validate.KnownRegex. - */ -export const KnownRegexSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_validate_validate, 0); - -/** - * Disabled nullifies any validation rules for this message, including any - * message fields associated with it that do support validation. - * - * @generated from extension: optional bool disabled = 1071; - */ -export const disabled: GenExtension = /*@__PURE__*/ - extDesc(file_validate_validate, 0); - -/** - * Ignore skips generation of validation methods for this message. - * - * @generated from extension: optional bool ignored = 1072; - */ -export const ignored: GenExtension = /*@__PURE__*/ - extDesc(file_validate_validate, 1); - -/** - * Required ensures that exactly one the field options in a oneof is set; - * validation fails if no fields in the oneof are set. - * - * @generated from extension: optional bool required = 1071; - */ -export const required: GenExtension = /*@__PURE__*/ - extDesc(file_validate_validate, 2); - -/** - * Rules specify the validations to be performed on this field. By default, - * no validation is performed against a field. - * - * @generated from extension: optional validate.FieldRules rules = 1071; - */ -export const rules: GenExtension = /*@__PURE__*/ - extDesc(file_validate_validate, 3); - diff --git a/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts b/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts deleted file mode 100644 index e3687e0c..00000000 --- a/packages/@apphosting/adapter-nextjs/src/protos/xds/annotations/v3/status_pb.ts +++ /dev/null @@ -1,80 +0,0 @@ -// @generated by protoc-gen-es v2.9.0 with parameter "target=ts" -// @generated from file xds/annotations/v3/status.proto (package xds.annotations.v3, syntax proto3) -/* eslint-disable */ - -import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; - -/** - * Describes the file xds/annotations/v3/status.proto. - */ -export const file_xds_annotations_v3_status: GenFile = /*@__PURE__*/ - fileDesc("Ch94ZHMvYW5ub3RhdGlvbnMvdjMvc3RhdHVzLnByb3RvEhJ4ZHMuYW5ub3RhdGlvbnMudjMidgoQU3RhdHVzQW5ub3RhdGlvbhIYChB3b3JrX2luX3Byb2dyZXNzGAEgASgIEkgKFnBhY2thZ2VfdmVyc2lvbl9zdGF0dXMYAiABKA4yKC54ZHMuYW5ub3RhdGlvbnMudjMuUGFja2FnZVZlcnNpb25TdGF0dXMqXQoUUGFja2FnZVZlcnNpb25TdGF0dXMSCwoHVU5LTk9XThAAEgoKBkZST1pFThABEgoKBkFDVElWRRACEiAKHE5FWFRfTUFKT1JfVkVSU0lPTl9DQU5ESURBVEUQA0IrWilnaXRodWIuY29tL2NuY2YveGRzL2dvL3hkcy9hbm5vdGF0aW9ucy92M2IGcHJvdG8z"); - -/** - * @generated from message xds.annotations.v3.StatusAnnotation - */ -export type StatusAnnotation = Message<"xds.annotations.v3.StatusAnnotation"> & { - /** - * The entity is work-in-progress and subject to breaking changes. - * - * @generated from field: bool work_in_progress = 1; - */ - workInProgress: boolean; - - /** - * The entity belongs to a package with the given version status. - * - * @generated from field: xds.annotations.v3.PackageVersionStatus package_version_status = 2; - */ - packageVersionStatus: PackageVersionStatus; -}; - -/** - * Describes the message xds.annotations.v3.StatusAnnotation. - * Use `create(StatusAnnotationSchema)` to create a new message. - */ -export const StatusAnnotationSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_xds_annotations_v3_status, 0); - -/** - * @generated from enum xds.annotations.v3.PackageVersionStatus - */ -export enum PackageVersionStatus { - /** - * Unknown package version status. - * - * @generated from enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - - /** - * This version of the package is frozen. - * - * @generated from enum value: FROZEN = 1; - */ - FROZEN = 1, - - /** - * This version of the package is the active development version. - * - * @generated from enum value: ACTIVE = 2; - */ - ACTIVE = 2, - - /** - * This version of the package is the candidate for the next major version. It - * is typically machine generated from the active development version. - * - * @generated from enum value: NEXT_MAJOR_VERSION_CANDIDATE = 3; - */ - NEXT_MAJOR_VERSION_CANDIDATE = 3, -} - -/** - * Describes the enum xds.annotations.v3.PackageVersionStatus. - */ -export const PackageVersionStatusSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_xds_annotations_v3_status, 0); -