diff --git a/examples/540-livekit-example-node/.env b/examples/540-livekit-example-node/.env new file mode 100644 index 0000000..848cfe7 --- /dev/null +++ b/examples/540-livekit-example-node/.env @@ -0,0 +1,3 @@ +DEEPGRAM_API_KEY=your_deepgram_api_key +LIVEKIT_API_KEY=your_livekit_api_key +LIVEKIT_HOST=http://your-livekit-host-url \ No newline at end of file diff --git a/examples/540-livekit-example-node/.env.example b/examples/540-livekit-example-node/.env.example new file mode 100644 index 0000000..5f752c9 --- /dev/null +++ b/examples/540-livekit-example-node/.env.example @@ -0,0 +1,4 @@ +# Environment variables for Livekit and Deepgram integration example +DEEPGRAM_API_KEY= +LIVEKIT_API_KEY= +LIVEKIT_HOST= \ No newline at end of file diff --git a/examples/540-livekit-example-node/BLOG.md b/examples/540-livekit-example-node/BLOG.md new file mode 100644 index 0000000..bc69b80 --- /dev/null +++ b/examples/540-livekit-example-node/BLOG.md @@ -0,0 +1,80 @@ +# Building a Livekit and Deepgram Integration in Node.js + +Integrating audio streaming services with transcription capabilities can greatly enhance real-time communication applications. In this guide, we'll explore how to integrate Livekit, a popular audio/video conferencing API, with Deepgram, a leading speech-to-text service, using Node.js. + +## Prerequisites + +Before diving in, ensure you have the following: + +- **Node.js** installed on your machine. +- A **Deepgram API key**. Sign up at [Deepgram](https://deepgram.com) if you haven't yet. +- A **Livekit account** or a local Livekit server setup. [Livekit Documentation](https://docs.livekit.io) provides details on getting started. + +## Step 1: Setup Your Node.js Environment + +First, create a new directory for your project and initialize a Node.js project: + +```bash +mkdir livekit-deepgram-integration +cd livekit-deepgram-integration +npm init -y +``` + +Install the necessary dependencies: + +```bash +npm install @deepgram/sdk livekit-server-sdk dotenv +``` + +We'll use `dotenv` to manage environment variables, `@deepgram/sdk` for Deepgram API interactions, and `livekit-server-sdk` for Livekit operations. + +## Step 2: Configuring Environment Variables + +Create a `.env` file to store your API keys and server details: + +```plaintext +DEEPGRAM_API_KEY=your_deepgram_api_key +LIVEKIT_API_KEY=your_livekit_api_key +LIVEKIT_HOST=https://your-livekit-host +``` + +Make sure to replace the placeholder values with your actual credentials. + +## Step 3: Implement the Integration + +Create a new file `src/index.js` where we'll write the integration code: + +```javascript +require('dotenv').config(); +const { Deepgram } = require('@deepgram/sdk'); +const { connect } = require('livekit-server-sdk'); + +// Initialize Deepgram SDK +const deepgram = new Deepgram(process.env.DEEPGRAM_API_KEY); + +// Connect to Livekit +async function connectToLivekit() { + const livekitHost = process.env.LIVEKIT_HOST; + const livekitApiKey = process.env.LIVEKIT_API_KEY; + + const room = await connect(livekitHost, livekitApiKey); + + // Add your logic for handling audio streams from Livekit and sending them to Deepgram here +} + +connectToLivekit().catch(console.error); +``` + +## Step 4: Running the Example + +With everything set up, run your application: + +```bash +node src/index.js +``` + +If configured correctly, the app will connect to the Livekit server, and you should see transcriptions of any audio input in the console. + +## What's Next? + +Explore more with handling multiple streams or integrating video capabilities using Livekit. Check Deepgram's advanced models for transcription to improve accuracy. \ No newline at end of file diff --git a/examples/540-livekit-example-node/README.md b/examples/540-livekit-example-node/README.md new file mode 100644 index 0000000..722c58b --- /dev/null +++ b/examples/540-livekit-example-node/README.md @@ -0,0 +1,26 @@ +# Livekit and Deepgram Integration Example (Node.js) + +This example demonstrates how to integrate Livekit with Deepgram for real-time audio transcription using Node.js. + +## Prerequisites + +- Node.js and npm installed +- Deepgram API Key +- Livekit cloud account or local server setup + +## Environment Variables + +- `DEEPGRAM_API_KEY`: Your Deepgram API key +- `LIVEKIT_API_KEY`: Your Livekit API key (if using Livekit cloud) +- `LIVEKIT_HOST`: Host URL for Livekit server + +## Running the Example + +1. Clone the repository and navigate to this example's directory. +2. Install the dependencies with `npm install`. +3. Set up the `.env` file using `.env.example` as a template. +4. Run the example using `node src/index.js`. + +## What to Expect + +Once the application is running, it will connect to a Livekit room and start transcribing any audio input in real-time using Deepgram. The transcriptions will be printed in the console. \ No newline at end of file diff --git a/examples/540-livekit-example-node/node_modules/.package-lock.json b/examples/540-livekit-example-node/node_modules/.package-lock.json new file mode 100644 index 0000000..0e61a36 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/.package-lock.json @@ -0,0 +1,158 @@ +{ + "name": "workspace", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@bufbuild/protobuf": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.1.tgz", + "integrity": "sha512-wJ8ReQbHxsAfXhrf9ixl0aYbZorRuOWpBNzm8pL8ftmSxQx/wnJD5Eg861NwJU/czy2VXFIebCeZnZrI9rktIQ==", + "license": "(Apache-2.0 AND BSD-3-Clause)" + }, + "node_modules/@deepgram/sdk": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@deepgram/sdk/-/sdk-5.0.0.tgz", + "integrity": "sha512-x1wMiOgDGqcLEaQpQBQLTtk5mLbXbYgcBEpp7cfJIyEtqdIGgijCZH+a/esiVp+xIcTYYroTxG47RVppZOHbWw==", + "license": "MIT", + "dependencies": { + "ws": "^8.16.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@livekit/protocol": { + "version": "1.45.3", + "resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.45.3.tgz", + "integrity": "sha512-WmMxBTsy4dRBqcrswFwUUlgq3Z0nnhOqKR6tX749Rb/PcB1yBMUtrHxZvcsS6qi3/5+86zHeVG+exmu1sZqfJg==", + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "^1.10.0" + } + }, + "node_modules/camelcase": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-9.1.3.tgz", + "integrity": "sha512-Rircqi9ch8AnZscQcsA1C47NFdaO3wukpmIRzYcDOrmvgt78hM/sj5pZhZNec2NM12uk5vTwRHZ4anGcrC4ZTg==", + "license": "MIT", + "dependencies": { + "camelcase": "^8.0.0", + "map-obj": "5.0.0", + "quick-lru": "^6.1.1", + "type-fest": "^4.3.2" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dotenv": { + "version": "17.4.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", + "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/jose": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz", + "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/livekit-server-sdk": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/livekit-server-sdk/-/livekit-server-sdk-2.15.1.tgz", + "integrity": "sha512-kfhXkNxbDIKXF9pFxEYVjWjU+YAA7MQZ2qcyUCgassNplt2gQzQKnIjQz9RpIEWLAIDs8i/4lxJO0mENbjQ35Q==", + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "^1.10.1", + "@livekit/protocol": "^1.43.1", + "camelcase-keys": "^9.0.0", + "jose": "^5.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/map-obj": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz", + "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ws": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz", + "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/README.md b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/README.md new file mode 100644 index 0000000..768067e --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/README.md @@ -0,0 +1,43 @@ +# @bufbuild/protobuf + +This package provides the runtime library for the code generator plugin +[protoc-gen-es](https://www.npmjs.com/package/@bufbuild/protoc-gen-es). + +## Protocol Buffers for ECMAScript + +A complete implementation of [Protocol Buffers](https://developers.google.com/protocol-buffers) in TypeScript, +suitable for web browsers and Node.js. + +**Protobuf-ES** is intended to be a solid, modern alternative to existing Protobuf implementations for the JavaScript ecosystem. It is the first project in this space to provide a comprehensive plugin framework and decouple the base types from RPC functionality. + +Some additional features that set it apart from the others: + +- ECMAScript module support +- First-class TypeScript support +- Generation of idiomatic JavaScript and TypeScript code. +- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/blob/main/packages/bundle-size) +- Implementation of all proto3 features, including the [canonical JSON format](https://developers.google.com/protocol-buffers/docs/proto3#json). +- Implementation of all proto2 features, except for extensions and the text format. +- Usage of standard JavaScript APIs instead of the [Closure Library](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html) +- Compatibility is covered by the protocol buffers [conformance tests](https://github.com/bufbuild/protobuf-es/blob/main/packages/protobuf-conformance). +- Descriptor and reflection support + +## Installation + +```bash +npm install @bufbuild/protobuf +``` + +## Documentation + +To learn how to work with `@bufbuild/protobuf` check out the docs for the [Runtime API](https://github.com/bufbuild/protobuf-es/blob/main/docs/runtime_api.md) +and the [generated code](https://github.com/bufbuild/protobuf-es/blob/main/docs/generated_code.md). + +Official documentation for the Protobuf-ES project can be found at [github.com/bufbuild/protobuf-es](https://github.com/bufbuild/protobuf-es). + +For more information on Buf, check out the official [Buf documentation](https://docs.buf.build/introduction). + +## Examples + +A complete code example can be found in the **Protobuf-ES** repo [here](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-example). + diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-encoding.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-encoding.d.ts new file mode 100644 index 0000000..3dd718e --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-encoding.d.ts @@ -0,0 +1,422 @@ +/** + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +export declare enum WireType { + /** + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum + */ + Varint = 0, + /** + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + Bit64 = 1, + /** + * Used for string, bytes, embedded messages, packed repeated fields + * + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. + */ + LengthDelimited = 2, + /** + * Start of a tag-delimited aggregate, such as a proto2 group, or a message + * in editions with message_encoding = DELIMITED. + */ + StartGroup = 3, + /** + * End of a tag-delimited aggregate. + */ + EndGroup = 4, + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + Bit32 = 5 +} +type TextEncoderLike = { + encode(input?: string): Uint8Array; +}; +type TextDecoderLike = { + decode(input?: Uint8Array): string; +}; +export interface IBinaryReader { + /** + * Current position. + */ + readonly pos: number; + /** + * Number of bytes available in this reader. + */ + readonly len: number; + /** + * Reads a tag - field number and wire type. + */ + tag(): [number, WireType]; + /** + * Skip one element on the wire and return the skipped data. + */ + skip(wireType: WireType, fieldNo?: number): Uint8Array; + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + uint32(): number; + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32(): number; + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32(): number; + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64(): bigint | string; + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(): bigint | string; + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64(): bigint | string; + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64(): bigint | string; + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64(): bigint | string; + /** + * Read a `bool` field, a variant. + */ + bool(): boolean; + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32(): number; + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32(): number; + /** + * Read a `float` field, 32-bit floating point number. + */ + float(): number; + /** + * Read a `double` field, a 64-bit floating point number. + */ + double(): number; + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes(): Uint8Array; + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. + */ + string(): string; +} +export interface IBinaryWriter { + /** + * Return all bytes written and reset this writer. + */ + finish(): Uint8Array; + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork(): IBinaryWriter; + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join(): IBinaryWriter; + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )` + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo: number, type: WireType): IBinaryWriter; + /** + * Write a chunk of raw bytes. + */ + raw(chunk: Uint8Array): IBinaryWriter; + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value: number): IBinaryWriter; + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value: number): IBinaryWriter; + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value: number): IBinaryWriter; + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `bool` value, a variant. + */ + bool(value: boolean): IBinaryWriter; + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value: number): IBinaryWriter; + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value: number): IBinaryWriter; + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value: number): IBinaryWriter; + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value: number): IBinaryWriter; + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value: Uint8Array): IBinaryWriter; + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value: string): IBinaryWriter; +} +export declare class BinaryWriter implements IBinaryWriter { + /** + * We cannot allocate a buffer for the entire output + * because we don't know it's size. + * + * So we collect smaller chunks of known size and + * concat them later. + * + * Use `raw()` to push data to this array. It will flush + * `buf` first. + */ + private chunks; + /** + * A growing buffer for byte values. If you don't know + * the size of the data you are writing, push to this + * array. + */ + protected buf: number[]; + /** + * Previous fork states. + */ + private stack; + /** + * Text encoder instance to convert UTF-8 to bytes. + */ + private readonly textEncoder; + constructor(textEncoder?: TextEncoderLike); + /** + * Return all bytes written and reset this writer. + */ + finish(): Uint8Array; + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork(): IBinaryWriter; + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join(): IBinaryWriter; + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo: number, type: WireType): IBinaryWriter; + /** + * Write a chunk of raw bytes. + */ + raw(chunk: Uint8Array): IBinaryWriter; + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value: number): IBinaryWriter; + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value: number): IBinaryWriter; + /** + * Write a `bool` value, a variant. + */ + bool(value: boolean): IBinaryWriter; + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value: Uint8Array): IBinaryWriter; + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value: string): IBinaryWriter; + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value: number): IBinaryWriter; + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value: number): IBinaryWriter; + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value: number): IBinaryWriter; + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value: number): IBinaryWriter; + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value: number): IBinaryWriter; + /** + * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value: string | number | bigint): IBinaryWriter; + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value: string | number | bigint): IBinaryWriter; +} +export declare class BinaryReader implements IBinaryReader { + /** + * Current position. + */ + pos: number; + /** + * Number of bytes available in this reader. + */ + readonly len: number; + private readonly buf; + private readonly view; + private readonly textDecoder; + constructor(buf: Uint8Array, textDecoder?: TextDecoderLike); + /** + * Reads a tag - field number and wire type. + */ + tag(): [number, WireType]; + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType: WireType, fieldNo?: number): Uint8Array; + protected varint64: () => [number, number]; + /** + * Throws error if position in byte array is out of range. + */ + protected assertBounds(): void; + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + uint32: () => number; + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32(): number; + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32(): number; + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64(): bigint | string; + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64(): bigint | string; + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(): bigint | string; + /** + * Read a `bool` field, a variant. + */ + bool(): boolean; + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32(): number; + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32(): number; + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64(): bigint | string; + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64(): bigint | string; + /** + * Read a `float` field, 32-bit floating point number. + */ + float(): number; + /** + * Read a `double` field, a 64-bit floating point number. + */ + double(): number; + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes(): Uint8Array; + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. + */ + string(): string; +} +export {}; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-encoding.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-encoding.js new file mode 100644 index 0000000..d361abe --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-encoding.js @@ -0,0 +1,444 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BinaryReader = exports.BinaryWriter = exports.WireType = void 0; +const varint_js_1 = require("./google/varint.js"); +const assert_js_1 = require("./private/assert.js"); +const proto_int64_js_1 = require("./proto-int64.js"); +/* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/restrict-plus-operands */ +/** + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +var WireType; +(function (WireType) { + /** + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum + */ + WireType[WireType["Varint"] = 0] = "Varint"; + /** + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + WireType[WireType["Bit64"] = 1] = "Bit64"; + /** + * Used for string, bytes, embedded messages, packed repeated fields + * + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. + */ + WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited"; + /** + * Start of a tag-delimited aggregate, such as a proto2 group, or a message + * in editions with message_encoding = DELIMITED. + */ + WireType[WireType["StartGroup"] = 3] = "StartGroup"; + /** + * End of a tag-delimited aggregate. + */ + WireType[WireType["EndGroup"] = 4] = "EndGroup"; + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + WireType[WireType["Bit32"] = 5] = "Bit32"; +})(WireType || (exports.WireType = WireType = {})); +class BinaryWriter { + constructor(textEncoder) { + /** + * Previous fork states. + */ + this.stack = []; + this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder(); + this.chunks = []; + this.buf = []; + } + /** + * Return all bytes written and reset this writer. + */ + finish() { + this.chunks.push(new Uint8Array(this.buf)); // flush the buffer + let len = 0; + for (let i = 0; i < this.chunks.length; i++) + len += this.chunks[i].length; + let bytes = new Uint8Array(len); + let offset = 0; + for (let i = 0; i < this.chunks.length; i++) { + bytes.set(this.chunks[i], offset); + offset += this.chunks[i].length; + } + this.chunks = []; + return bytes; + } + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork() { + this.stack.push({ chunks: this.chunks, buf: this.buf }); + this.chunks = []; + this.buf = []; + return this; + } + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join() { + // get chunk of fork + let chunk = this.finish(); + // restore previous state + let prev = this.stack.pop(); + if (!prev) + throw new Error("invalid state, fork stack empty"); + this.chunks = prev.chunks; + this.buf = prev.buf; + // write length of chunk as varint + this.uint32(chunk.byteLength); + return this.raw(chunk); + } + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo, type) { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; + } + this.chunks.push(chunk); + return this; + } + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value) { + (0, assert_js_1.assertUInt32)(value); + // write value as varint 32, inlined for speed + while (value > 0x7f) { + this.buf.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + this.buf.push(value); + return this; + } + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + (0, assert_js_1.assertInt32)(value); + (0, varint_js_1.varint32write)(value, this.buf); + return this; + } + /** + * Write a `bool` value, a variant. + */ + bool(value) { + this.buf.push(value ? 1 : 0); + return this; + } + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value) { + this.uint32(value.byteLength); // write length of chunk as varint + return this.raw(value); + } + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value) { + let chunk = this.textEncoder.encode(value); + this.uint32(chunk.byteLength); // write length of chunk as varint + return this.raw(chunk); + } + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value) { + (0, assert_js_1.assertFloat32)(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setFloat32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value) { + let chunk = new Uint8Array(8); + new DataView(chunk.buffer).setFloat64(0, value, true); + return this.raw(chunk); + } + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value) { + (0, assert_js_1.assertUInt32)(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setUint32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value) { + (0, assert_js_1.assertInt32)(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setInt32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value) { + (0, assert_js_1.assertInt32)(value); + // zigzag encode + value = ((value << 1) ^ (value >> 31)) >>> 0; + (0, varint_js_1.varint32write)(value, this.buf); + return this; + } + /** + * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = proto_int64_js_1.protoInt64.enc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = proto_int64_js_1.protoInt64.uEnc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value) { + let tc = proto_int64_js_1.protoInt64.enc(value); + (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf); + return this; + } + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value) { + let tc = proto_int64_js_1.protoInt64.enc(value), + // zigzag encode + sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign; + (0, varint_js_1.varint64write)(lo, hi, this.buf); + return this; + } + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value) { + let tc = proto_int64_js_1.protoInt64.uEnc(value); + (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf); + return this; + } +} +exports.BinaryWriter = BinaryWriter; +class BinaryReader { + constructor(buf, textDecoder) { + this.varint64 = varint_js_1.varint64read; // dirty cast for `this` + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + this.uint32 = varint_js_1.varint32read; // dirty cast for `this` and access to protected `buf` + this.buf = buf; + this.len = buf.length; + this.pos = 0; + this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + this.textDecoder = textDecoder !== null && textDecoder !== void 0 ? textDecoder : new TextDecoder(); + } + /** + * Reads a tag - field number and wire type. + */ + tag() { + let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); + return [fieldNo, wireType]; + } + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType, fieldNo) { + let start = this.pos; + switch (wireType) { + case WireType.Varint: + while (this.buf[this.pos++] & 0x80) { + // ignore + } + break; + // eslint-disable-next-line + // @ts-ignore TS7029: Fallthrough case in switch + case WireType.Bit64: + this.pos += 4; + // eslint-disable-next-line + // @ts-ignore TS7029: Fallthrough case in switch + case WireType.Bit32: + this.pos += 4; + break; + case WireType.LengthDelimited: + let len = this.uint32(); + this.pos += len; + break; + case WireType.StartGroup: + for (;;) { + const [fn, wt] = this.tag(); + if (wt === WireType.EndGroup) { + if (fieldNo !== undefined && fn !== fieldNo) { + throw new Error("invalid end group tag"); + } + break; + } + this.skip(wt, fn); + } + break; + default: + throw new Error("cant skip wire type " + wireType); + } + this.assertBounds(); + return this.buf.subarray(start, this.pos); + } + /** + * Throws error if position in byte array is out of range. + */ + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); + } + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32() { + return this.uint32() | 0; + } + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32() { + let zze = this.uint32(); + // decode zigzag + return (zze >>> 1) ^ -(zze & 1); + } + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64() { + return proto_int64_js_1.protoInt64.dec(...this.varint64()); + } + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64() { + return proto_int64_js_1.protoInt64.uDec(...this.varint64()); + } + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64() { + let [lo, hi] = this.varint64(); + // decode zig zag + let s = -(lo & 1); + lo = ((lo >>> 1) | ((hi & 1) << 31)) ^ s; + hi = (hi >>> 1) ^ s; + return proto_int64_js_1.protoInt64.dec(lo, hi); + } + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; + } + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, true); + } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, true); + } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return proto_int64_js_1.protoInt64.uDec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return proto_int64_js_1.protoInt64.dec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `float` field, 32-bit floating point number. + */ + float() { + return this.view.getFloat32((this.pos += 4) - 4, true); + } + /** + * Read a `double` field, a 64-bit floating point number. + */ + double() { + return this.view.getFloat64((this.pos += 8) - 8, true); + } + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes() { + let len = this.uint32(), start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. + */ + string() { + return this.textDecoder.decode(this.bytes()); + } +} +exports.BinaryReader = BinaryReader; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-format.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-format.d.ts new file mode 100644 index 0000000..6c1b081 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-format.d.ts @@ -0,0 +1,113 @@ +import type { Message } from "./message.js"; +import type { IBinaryReader, IBinaryWriter, WireType } from "./binary-encoding.js"; +import type { FieldInfo } from "./field.js"; +/** + * BinaryFormat is the contract for serializing messages to and from binary + * data. Implementations may be specific to a proto syntax, and can be + * reflection based, or delegate to speed optimized generated code. + */ +export interface BinaryFormat { + /** + * Provide options for parsing binary data. + */ + makeReadOptions(options?: Partial): Readonly; + /** + * Provide options for serializing binary data. + */ + makeWriteOptions(options?: Partial): Readonly; + /** + * Parse a message from binary data, merging fields. + * + * Supports two message encodings: + * - length-prefixed: delimitedMessageEncoding is false or omitted, and + * lengthOrEndTagFieldNo is the expected length of the message in the reader. + * - delimited: delimitedMessageEncoding is true, and lengthOrEndTagFieldNo is + * the field number in a tag with wire type end-group signalling the end of + * the message in the reader. + * + * delimitedMessageEncoding is optional for backwards compatibility. + */ + readMessage(message: Message, reader: IBinaryReader, lengthOrEndTagFieldNo: number, options: BinaryReadOptions, delimitedMessageEncoding?: boolean): void; + /** + * Parse a field from binary data, and store it in the given target. + * + * The target must be an initialized message object, with oneof groups, + * repeated fields and maps already present. + */ + readField(target: Record, // eslint-disable-line @typescript-eslint/no-explicit-any -- `any` is the best choice for dynamic access + reader: IBinaryReader, field: FieldInfo, wireType: WireType, options: BinaryReadOptions): void; + /** + * Serialize a message to binary data. + */ + writeMessage(message: Message, writer: IBinaryWriter, options: BinaryWriteOptions): void; + /** + * Serialize a field value to binary data. + * + * The value must be an array for repeated fields, a record object for map + * fields. Only selected oneof fields should be passed to this method. + */ + writeField(field: FieldInfo, value: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- `any` is the best choice for dynamic access + writer: IBinaryWriter, options: BinaryWriteOptions): void; + /** + * Retrieve the unknown fields for the given message. + * + * Unknown fields are well-formed protocol buffer serialized data for + * fields that the parserdoes not recognize. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + listUnknownFields(message: Message): ReadonlyArray<{ + no: number; + wireType: WireType; + data: Uint8Array; + }>; + /** + * Discard unknown fields for the given message. + */ + discardUnknownFields(message: Message): void; + /** + * Retrieve the unknown fields for the given message and write them to + * the given writer. This method is called when a message is serialized, + * so the fields that are unknown to the parser persist through a round + * trip. + */ + writeUnknownFields(message: Message, writer: IBinaryWriter): void; + /** + * Store an unknown field for the given message. The parser will use this + * method if it does not recognize a field, unless the option + * `readUnknownFields` has been disabled. + */ + onUnknownField(message: Message, no: number, wireType: WireType, data: Uint8Array): void; +} +/** + * Options for parsing binary data. + */ +export interface BinaryReadOptions { + /** + * Retain unknown fields during parsing? The default behavior is to retain + * unknown fields and include them in the serialized output. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + readUnknownFields: boolean; + /** + * Allows to use a custom implementation to decode binary data. + */ + readerFactory: (bytes: Uint8Array) => IBinaryReader; +} +/** + * Options for serializing to binary data. + */ +export interface BinaryWriteOptions { + /** + * Include unknown fields in the serialized output? The default behavior + * is to retain unknown fields and include them in the serialized output. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + writeUnknownFields: boolean; + /** + * Allows to use a custom implementation to encode binary data. + */ + writerFactory: () => IBinaryWriter; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-format.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-format.js new file mode 100644 index 0000000..d03a43b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/binary-format.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/codegen-info.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/codegen-info.d.ts new file mode 100644 index 0000000..172c82e --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/codegen-info.d.ts @@ -0,0 +1,33 @@ +import { reifyWkt } from "./private/reify-wkt.js"; +import type { DescEnum, DescEnumValue, DescField, DescExtension, DescMessage, DescMethod, DescOneof, DescService } from "./descriptor-set.js"; +import type { ScalarValue } from "./scalar.js"; +import { LongType, ScalarType } from "./scalar.js"; +interface CodegenInfo { + /** + * Name of the runtime library NPM package. + */ + readonly packageName: string; + readonly localName: (desc: DescEnum | DescEnumValue | DescMessage | DescExtension | DescOneof | DescField | DescService | DescMethod) => string; + readonly symbols: Record; + readonly getUnwrappedFieldType: (field: DescField | DescExtension) => ScalarType | undefined; + readonly wktSourceFiles: readonly string[]; + /** + * @deprecated please use scalarZeroValue instead + */ + readonly scalarDefaultValue: (type: ScalarType, longType: LongType) => any; + readonly scalarZeroValue: (type: T, longType: L) => ScalarValue; + /** + * @deprecated please use reifyWkt from @bufbuild/protoplugin/ecmascript instead + */ + readonly reifyWkt: typeof reifyWkt; + readonly safeIdentifier: (name: string) => string; + readonly safeObjectProperty: (name: string) => string; +} +type RuntimeSymbolName = "proto2" | "proto3" | "Message" | "PartialMessage" | "PlainMessage" | "FieldList" | "MessageType" | "Extension" | "BinaryReadOptions" | "BinaryWriteOptions" | "JsonReadOptions" | "JsonWriteOptions" | "JsonValue" | "JsonObject" | "protoDouble" | "protoInt64" | "ScalarType" | "LongType" | "MethodKind" | "MethodIdempotency" | "IMessageTypeRegistry"; +type RuntimeSymbolInfo = { + typeOnly: boolean; + publicImportPath: string; + privateImportPath: string; +}; +export declare const codegenInfo: CodegenInfo; +export {}; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/codegen-info.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/codegen-info.js new file mode 100644 index 0000000..abce69e --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/codegen-info.js @@ -0,0 +1,69 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.codegenInfo = void 0; +const names_js_1 = require("./private/names.js"); +const field_wrapper_js_1 = require("./private/field-wrapper.js"); +const scalars_js_1 = require("./private/scalars.js"); +const reify_wkt_js_1 = require("./private/reify-wkt.js"); +const packageName = "@bufbuild/protobuf"; +exports.codegenInfo = { + packageName: "@bufbuild/protobuf", + localName: names_js_1.localName, + reifyWkt: reify_wkt_js_1.reifyWkt, + getUnwrappedFieldType: field_wrapper_js_1.getUnwrappedFieldType, + scalarDefaultValue: scalars_js_1.scalarZeroValue, + scalarZeroValue: scalars_js_1.scalarZeroValue, + safeIdentifier: names_js_1.safeIdentifier, + safeObjectProperty: names_js_1.safeObjectProperty, + // prettier-ignore + symbols: { + proto2: { typeOnly: false, privateImportPath: "./proto2.js", publicImportPath: packageName }, + proto3: { typeOnly: false, privateImportPath: "./proto3.js", publicImportPath: packageName }, + Message: { typeOnly: false, privateImportPath: "./message.js", publicImportPath: packageName }, + PartialMessage: { typeOnly: true, privateImportPath: "./message.js", publicImportPath: packageName }, + PlainMessage: { typeOnly: true, privateImportPath: "./message.js", publicImportPath: packageName }, + FieldList: { typeOnly: true, privateImportPath: "./field-list.js", publicImportPath: packageName }, + MessageType: { typeOnly: true, privateImportPath: "./message-type.js", publicImportPath: packageName }, + Extension: { typeOnly: true, privateImportPath: "./extension.js", publicImportPath: packageName }, + BinaryReadOptions: { typeOnly: true, privateImportPath: "./binary-format.js", publicImportPath: packageName }, + BinaryWriteOptions: { typeOnly: true, privateImportPath: "./binary-format.js", publicImportPath: packageName }, + JsonReadOptions: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName }, + JsonWriteOptions: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName }, + JsonValue: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName }, + JsonObject: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName }, + protoDouble: { typeOnly: false, privateImportPath: "./proto-double.js", publicImportPath: packageName }, + protoInt64: { typeOnly: false, privateImportPath: "./proto-int64.js", publicImportPath: packageName }, + ScalarType: { typeOnly: false, privateImportPath: "./scalar.js", publicImportPath: packageName }, + LongType: { typeOnly: false, privateImportPath: "./scalar.js", publicImportPath: packageName }, + MethodKind: { typeOnly: false, privateImportPath: "./service-type.js", publicImportPath: packageName }, + MethodIdempotency: { typeOnly: false, privateImportPath: "./service-type.js", publicImportPath: packageName }, + IMessageTypeRegistry: { typeOnly: true, privateImportPath: "./type-registry.js", publicImportPath: packageName }, + }, + wktSourceFiles: [ + "google/protobuf/compiler/plugin.proto", + "google/protobuf/any.proto", + "google/protobuf/api.proto", + "google/protobuf/descriptor.proto", + "google/protobuf/duration.proto", + "google/protobuf/empty.proto", + "google/protobuf/field_mask.proto", + "google/protobuf/source_context.proto", + "google/protobuf/struct.proto", + "google/protobuf/timestamp.proto", + "google/protobuf/type.proto", + "google/protobuf/wrappers.proto", + ], +}; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-descriptor-set.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-descriptor-set.d.ts new file mode 100644 index 0000000..a308b59 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-descriptor-set.d.ts @@ -0,0 +1,36 @@ +import { FeatureSetDefaults, FileDescriptorProto, FileDescriptorSet } from "./google/protobuf/descriptor_pb.js"; +import type { DescriptorSet } from "./descriptor-set.js"; +import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js"; +/** + * Create a DescriptorSet, a convenient interface for working with a set of + * google.protobuf.FileDescriptorProto. + * + * Note that files must be given in topological order, so each file appears + * before any file that imports it. Protocol buffer compilers always produce + * files in topological order. + */ +export declare function createDescriptorSet(input: FileDescriptorProto[] | FileDescriptorSet | Uint8Array, options?: CreateDescriptorSetOptions): DescriptorSet; +/** + * Options to createDescriptorSet() + */ +interface CreateDescriptorSetOptions { + /** + * Editions support language-specific features with extensions to + * google.protobuf.FeatureSet. They can define defaults, and specify on + * which targets the features can be set. + * + * To create a DescriptorSet that provides your language-specific features, + * you have to provide a google.protobuf.FeatureSetDefaults message in this + * option. It can also specify the minimum and maximum supported edition. + * + * The defaults can be generated with `protoc` - see the flag + * `--experimental_edition_defaults_out`. + */ + featureSetDefaults?: FeatureSetDefaults; + /** + * Internally, data is serialized when features are resolved. The + * serialization options given here will be used for feature resolution. + */ + serializationOptions?: Partial; +} +export {}; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-descriptor-set.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-descriptor-set.js new file mode 100644 index 0000000..ac644c2 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-descriptor-set.js @@ -0,0 +1,910 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDescriptorSet = void 0; +const descriptor_pb_js_1 = require("./google/protobuf/descriptor_pb.js"); +const assert_js_1 = require("./private/assert.js"); +const service_type_js_1 = require("./service-type.js"); +const names_js_1 = require("./private/names.js"); +const text_format_js_1 = require("./private/text-format.js"); +const feature_set_js_1 = require("./private/feature-set.js"); +const scalar_js_1 = require("./scalar.js"); +const is_message_js_1 = require("./is-message.js"); +/** + * Create a DescriptorSet, a convenient interface for working with a set of + * google.protobuf.FileDescriptorProto. + * + * Note that files must be given in topological order, so each file appears + * before any file that imports it. Protocol buffer compilers always produce + * files in topological order. + */ +function createDescriptorSet(input, options) { + var _a; + const cart = { + files: [], + enums: new Map(), + messages: new Map(), + services: new Map(), + extensions: new Map(), + mapEntries: new Map(), + }; + const fileDescriptors = (0, is_message_js_1.isMessage)(input, descriptor_pb_js_1.FileDescriptorSet) + ? input.file + : input instanceof Uint8Array + ? descriptor_pb_js_1.FileDescriptorSet.fromBinary(input).file + : input; + const resolverByEdition = new Map(); + for (const proto of fileDescriptors) { + const edition = (_a = proto.edition) !== null && _a !== void 0 ? _a : parseFileSyntax(proto.syntax, proto.edition).edition; + let resolveFeatures = resolverByEdition.get(edition); + if (resolveFeatures === undefined) { + resolveFeatures = (0, feature_set_js_1.createFeatureResolver)(edition, options === null || options === void 0 ? void 0 : options.featureSetDefaults, options === null || options === void 0 ? void 0 : options.serializationOptions); + resolverByEdition.set(edition, resolveFeatures); + } + addFile(proto, cart, resolveFeatures); + } + return cart; +} +exports.createDescriptorSet = createDescriptorSet; +/** + * Create a descriptor for a file. + */ +function addFile(proto, cart, resolveFeatures) { + var _a, _b; + (0, assert_js_1.assert)(proto.name, `invalid FileDescriptorProto: missing name`); + const file = Object.assign(Object.assign({ kind: "file", proto, deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false }, parseFileSyntax(proto.syntax, proto.edition)), { name: proto.name.replace(/\.proto/, ""), dependencies: findFileDependencies(proto, cart), enums: [], messages: [], extensions: [], services: [], toString() { + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- we asserted above + return `file ${this.proto.name}`; + }, + getSyntaxComments() { + return findComments(this.proto.sourceCodeInfo, [ + FieldNumber.FileDescriptorProto_Syntax, + ]); + }, + getPackageComments() { + return findComments(this.proto.sourceCodeInfo, [ + FieldNumber.FileDescriptorProto_Package, + ]); + }, + getFeatures() { + var _a; + return resolveFeatures((_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + } }); + cart.mapEntries.clear(); // map entries are local to the file, we can safely discard + for (const enumProto of proto.enumType) { + addEnum(enumProto, file, undefined, cart, resolveFeatures); + } + for (const messageProto of proto.messageType) { + addMessage(messageProto, file, undefined, cart, resolveFeatures); + } + for (const serviceProto of proto.service) { + addService(serviceProto, file, cart, resolveFeatures); + } + addExtensions(file, cart, resolveFeatures); + for (const mapEntry of cart.mapEntries.values()) { + addFields(mapEntry, cart, resolveFeatures); + } + for (const message of file.messages) { + addFields(message, cart, resolveFeatures); + addExtensions(message, cart, resolveFeatures); + } + cart.mapEntries.clear(); // map entries are local to the file, we can safely discard + cart.files.push(file); +} +/** + * Create descriptors for extensions, and add them to the message / file, + * and to our cart. + * Recurses into nested types. + */ +function addExtensions(desc, cart, resolveFeatures) { + switch (desc.kind) { + case "file": + for (const proto of desc.proto.extension) { + const ext = newExtension(proto, desc, undefined, cart, resolveFeatures); + desc.extensions.push(ext); + cart.extensions.set(ext.typeName, ext); + } + break; + case "message": + for (const proto of desc.proto.extension) { + const ext = newExtension(proto, desc.file, desc, cart, resolveFeatures); + desc.nestedExtensions.push(ext); + cart.extensions.set(ext.typeName, ext); + } + for (const message of desc.nestedMessages) { + addExtensions(message, cart, resolveFeatures); + } + break; + } +} +/** + * Create descriptors for fields and oneof groups, and add them to the message. + * Recurses into nested types. + */ +function addFields(message, cart, resolveFeatures) { + const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message, resolveFeatures)); + const oneofsSeen = new Set(); + for (const proto of message.proto.field) { + const oneof = findOneof(proto, allOneofs); + const field = newField(proto, message.file, message, oneof, cart, resolveFeatures); + message.fields.push(field); + if (oneof === undefined) { + message.members.push(field); + } + else { + oneof.fields.push(field); + if (!oneofsSeen.has(oneof)) { + oneofsSeen.add(oneof); + message.members.push(oneof); + } + } + } + for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) { + message.oneofs.push(oneof); + } + for (const child of message.nestedMessages) { + addFields(child, cart, resolveFeatures); + } +} +/** + * Create a descriptor for an enumeration, and add it our cart and to the + * parent type, if any. + */ +function addEnum(proto, file, parent, cart, resolveFeatures) { + var _a, _b, _c; + (0, assert_js_1.assert)(proto.name, `invalid EnumDescriptorProto: missing name`); + const desc = { + kind: "enum", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + parent, + name: proto.name, + typeName: makeTypeName(proto, parent, file), + values: [], + sharedPrefix: (0, names_js_1.findEnumSharedPrefix)(proto.name, proto.value.map((v) => { var _a; return (_a = v.name) !== null && _a !== void 0 ? _a : ""; })), + toString() { + return `enum ${this.typeName}`; + }, + getComments() { + const path = this.parent + ? [ + ...this.parent.getComments().sourcePath, + FieldNumber.DescriptorProto_EnumType, + this.parent.proto.enumType.indexOf(this.proto), + ] + : [ + FieldNumber.FileDescriptorProto_EnumType, + this.file.proto.enumType.indexOf(this.proto), + ]; + return findComments(file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a, _b; + return resolveFeatures((_a = parent === null || parent === void 0 ? void 0 : parent.getFeatures()) !== null && _a !== void 0 ? _a : file.getFeatures(), (_b = proto.options) === null || _b === void 0 ? void 0 : _b.features); + }, + }; + cart.enums.set(desc.typeName, desc); + proto.value.forEach((proto) => { + var _a, _b; + (0, assert_js_1.assert)(proto.name, `invalid EnumValueDescriptorProto: missing name`); + (0, assert_js_1.assert)(proto.number !== undefined, `invalid EnumValueDescriptorProto: missing number`); + desc.values.push({ + kind: "enum_value", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + parent: desc, + name: proto.name, + number: proto.number, + toString() { + return `enum value ${desc.typeName}.${this.name}`; + }, + declarationString() { + var _a; + let str = `${this.name} = ${this.number}`; + if (((_a = this.proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) === true) { + str += " [deprecated = true]"; + } + return str; + }, + getComments() { + const path = [ + ...this.parent.getComments().sourcePath, + FieldNumber.EnumDescriptorProto_Value, + this.parent.proto.value.indexOf(this.proto), + ]; + return findComments(file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a; + return resolveFeatures(desc.getFeatures(), (_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + }, + }); + }); + ((_c = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _c !== void 0 ? _c : file.enums).push(desc); +} +/** + * Create a descriptor for a message, including nested types, and add it to our + * cart. Note that this does not create descriptors fields. + */ +function addMessage(proto, file, parent, cart, resolveFeatures) { + var _a, _b, _c, _d; + (0, assert_js_1.assert)(proto.name, `invalid DescriptorProto: missing name`); + const desc = { + kind: "message", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + parent, + name: proto.name, + typeName: makeTypeName(proto, parent, file), + fields: [], + oneofs: [], + members: [], + nestedEnums: [], + nestedMessages: [], + nestedExtensions: [], + toString() { + return `message ${this.typeName}`; + }, + getComments() { + const path = this.parent + ? [ + ...this.parent.getComments().sourcePath, + FieldNumber.DescriptorProto_NestedType, + this.parent.proto.nestedType.indexOf(this.proto), + ] + : [ + FieldNumber.FileDescriptorProto_MessageType, + this.file.proto.messageType.indexOf(this.proto), + ]; + return findComments(file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a, _b; + return resolveFeatures((_a = parent === null || parent === void 0 ? void 0 : parent.getFeatures()) !== null && _a !== void 0 ? _a : file.getFeatures(), (_b = proto.options) === null || _b === void 0 ? void 0 : _b.features); + }, + }; + if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) { + cart.mapEntries.set(desc.typeName, desc); + } + else { + ((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc); + cart.messages.set(desc.typeName, desc); + } + for (const enumProto of proto.enumType) { + addEnum(enumProto, file, desc, cart, resolveFeatures); + } + for (const messageProto of proto.nestedType) { + addMessage(messageProto, file, desc, cart, resolveFeatures); + } +} +/** + * Create a descriptor for a service, including methods, and add it to our + * cart. + */ +function addService(proto, file, cart, resolveFeatures) { + var _a, _b; + (0, assert_js_1.assert)(proto.name, `invalid ServiceDescriptorProto: missing name`); + const desc = { + kind: "service", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + name: proto.name, + typeName: makeTypeName(proto, undefined, file), + methods: [], + toString() { + return `service ${this.typeName}`; + }, + getComments() { + const path = [ + FieldNumber.FileDescriptorProto_Service, + this.file.proto.service.indexOf(this.proto), + ]; + return findComments(file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a; + return resolveFeatures(file.getFeatures(), (_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + }, + }; + file.services.push(desc); + cart.services.set(desc.typeName, desc); + for (const methodProto of proto.method) { + desc.methods.push(newMethod(methodProto, desc, cart, resolveFeatures)); + } +} +/** + * Create a descriptor for a method. + */ +function newMethod(proto, parent, cart, resolveFeatures) { + var _a, _b, _c; + (0, assert_js_1.assert)(proto.name, `invalid MethodDescriptorProto: missing name`); + (0, assert_js_1.assert)(proto.inputType, `invalid MethodDescriptorProto: missing input_type`); + (0, assert_js_1.assert)(proto.outputType, `invalid MethodDescriptorProto: missing output_type`); + let methodKind; + if (proto.clientStreaming === true && proto.serverStreaming === true) { + methodKind = service_type_js_1.MethodKind.BiDiStreaming; + } + else if (proto.clientStreaming === true) { + methodKind = service_type_js_1.MethodKind.ClientStreaming; + } + else if (proto.serverStreaming === true) { + methodKind = service_type_js_1.MethodKind.ServerStreaming; + } + else { + methodKind = service_type_js_1.MethodKind.Unary; + } + let idempotency; + switch ((_a = proto.options) === null || _a === void 0 ? void 0 : _a.idempotencyLevel) { + case descriptor_pb_js_1.MethodOptions_IdempotencyLevel.IDEMPOTENT: + idempotency = service_type_js_1.MethodIdempotency.Idempotent; + break; + case descriptor_pb_js_1.MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + idempotency = service_type_js_1.MethodIdempotency.NoSideEffects; + break; + case descriptor_pb_js_1.MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + case undefined: + idempotency = undefined; + break; + } + const input = cart.messages.get(trimLeadingDot(proto.inputType)); + const output = cart.messages.get(trimLeadingDot(proto.outputType)); + (0, assert_js_1.assert)(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`); + (0, assert_js_1.assert)(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`); + const name = proto.name; + return { + kind: "rpc", + proto, + deprecated: (_c = (_b = proto.options) === null || _b === void 0 ? void 0 : _b.deprecated) !== null && _c !== void 0 ? _c : false, + parent, + name, + methodKind, + input, + output, + idempotency, + toString() { + return `rpc ${parent.typeName}.${name}`; + }, + getComments() { + const path = [ + ...this.parent.getComments().sourcePath, + FieldNumber.ServiceDescriptorProto_Method, + this.parent.proto.method.indexOf(this.proto), + ]; + return findComments(parent.file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a; + return resolveFeatures(parent.getFeatures(), (_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + }, + }; +} +/** + * Create a descriptor for a oneof group. + */ +function newOneof(proto, parent, resolveFeatures) { + (0, assert_js_1.assert)(proto.name, `invalid OneofDescriptorProto: missing name`); + return { + kind: "oneof", + proto, + deprecated: false, + parent, + fields: [], + name: proto.name, + toString() { + return `oneof ${parent.typeName}.${this.name}`; + }, + getComments() { + const path = [ + ...this.parent.getComments().sourcePath, + FieldNumber.DescriptorProto_OneofDecl, + this.parent.proto.oneofDecl.indexOf(this.proto), + ]; + return findComments(parent.file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a; + return resolveFeatures(parent.getFeatures(), (_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + }, + }; +} +/** + * Create a descriptor for a field. + */ +function newField(proto, file, parent, oneof, cart, resolveFeatures) { + var _a, _b, _c; + (0, assert_js_1.assert)(proto.name, `invalid FieldDescriptorProto: missing name`); + (0, assert_js_1.assert)(proto.number, `invalid FieldDescriptorProto: missing number`); + (0, assert_js_1.assert)(proto.type, `invalid FieldDescriptorProto: missing type`); + const common = { + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + name: proto.name, + number: proto.number, + parent, + oneof, + optional: isOptionalField(proto, file.syntax), + packedByDefault: isPackedFieldByDefault(proto, resolveFeatures), + packed: isPackedField(file, parent, proto, resolveFeatures), + jsonName: proto.jsonName === (0, names_js_1.fieldJsonName)(proto.name) ? undefined : proto.jsonName, + scalar: undefined, + longType: undefined, + message: undefined, + enum: undefined, + mapKey: undefined, + mapValue: undefined, + declarationString, + // toString, getComments, getFeatures are overridden in newExtension + toString() { + return `field ${this.parent.typeName}.${this.name}`; + }, + getComments() { + const path = [ + ...this.parent.getComments().sourcePath, + FieldNumber.DescriptorProto_Field, + this.parent.proto.field.indexOf(this.proto), + ]; + return findComments(file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a; + return resolveFeatures(parent.getFeatures(), (_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + }, + }; + const repeated = proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.REPEATED; + switch (proto.type) { + case descriptor_pb_js_1.FieldDescriptorProto_Type.MESSAGE: + case descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP: { + (0, assert_js_1.assert)(proto.typeName, `invalid FieldDescriptorProto: missing type_name`); + const mapEntry = cart.mapEntries.get(trimLeadingDot(proto.typeName)); + if (mapEntry !== undefined) { + (0, assert_js_1.assert)(repeated, `invalid FieldDescriptorProto: expected map entry to be repeated`); + return Object.assign(Object.assign(Object.assign({}, common), { kind: "field", fieldKind: "map", repeated: false }), getMapFieldTypes(mapEntry)); + } + const message = cart.messages.get(trimLeadingDot(proto.typeName)); + (0, assert_js_1.assert)(message !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`); + return Object.assign(Object.assign({}, common), { kind: "field", fieldKind: "message", repeated, + message }); + } + case descriptor_pb_js_1.FieldDescriptorProto_Type.ENUM: { + (0, assert_js_1.assert)(proto.typeName, `invalid FieldDescriptorProto: missing type_name`); + const e = cart.enums.get(trimLeadingDot(proto.typeName)); + (0, assert_js_1.assert)(e !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`); + return Object.assign(Object.assign({}, common), { kind: "field", fieldKind: "enum", getDefaultValue, + repeated, enum: e }); + } + default: { + const scalar = fieldTypeToScalarType[proto.type]; + (0, assert_js_1.assert)(scalar, `invalid FieldDescriptorProto: unknown type ${proto.type}`); + return Object.assign(Object.assign({}, common), { kind: "field", fieldKind: "scalar", getDefaultValue, + repeated, + scalar, longType: ((_c = proto.options) === null || _c === void 0 ? void 0 : _c.jstype) == descriptor_pb_js_1.FieldOptions_JSType.JS_STRING + ? scalar_js_1.LongType.STRING + : scalar_js_1.LongType.BIGINT }); + } + } +} +/** + * Create a descriptor for an extension field. + */ +function newExtension(proto, file, parent, cart, resolveFeatures) { + (0, assert_js_1.assert)(proto.extendee, `invalid FieldDescriptorProto: missing extendee`); + const field = newField(proto, file, null, // to safe us many lines of duplicated code, we trick the type system + undefined, cart, resolveFeatures); + const extendee = cart.messages.get(trimLeadingDot(proto.extendee)); + (0, assert_js_1.assert)(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`); + return Object.assign(Object.assign({}, field), { kind: "extension", typeName: makeTypeName(proto, parent, file), parent, + file, + extendee, + // Must override toString, getComments, getFeatures from newField, because we + // call newField with parent undefined. + toString() { + return `extension ${this.typeName}`; + }, + getComments() { + const path = this.parent + ? [ + ...this.parent.getComments().sourcePath, + FieldNumber.DescriptorProto_Extension, + this.parent.proto.extension.indexOf(proto), + ] + : [ + FieldNumber.FileDescriptorProto_Extension, + this.file.proto.extension.indexOf(proto), + ]; + return findComments(file.proto.sourceCodeInfo, path); + }, + getFeatures() { + var _a; + return resolveFeatures((parent !== null && parent !== void 0 ? parent : file).getFeatures(), (_a = proto.options) === null || _a === void 0 ? void 0 : _a.features); + } }); +} +/** + * Parse the "syntax" and "edition" fields, stripping test editions. + */ +function parseFileSyntax(syntax, edition) { + let e; + let s; + switch (syntax) { + case undefined: + case "proto2": + s = "proto2"; + e = descriptor_pb_js_1.Edition.EDITION_PROTO2; + break; + case "proto3": + s = "proto3"; + e = descriptor_pb_js_1.Edition.EDITION_PROTO3; + break; + case "editions": + s = "editions"; + switch (edition) { + case undefined: + case descriptor_pb_js_1.Edition.EDITION_1_TEST_ONLY: + case descriptor_pb_js_1.Edition.EDITION_2_TEST_ONLY: + case descriptor_pb_js_1.Edition.EDITION_99997_TEST_ONLY: + case descriptor_pb_js_1.Edition.EDITION_99998_TEST_ONLY: + case descriptor_pb_js_1.Edition.EDITION_99999_TEST_ONLY: + case descriptor_pb_js_1.Edition.EDITION_UNKNOWN: + e = descriptor_pb_js_1.Edition.EDITION_UNKNOWN; + break; + default: + e = edition; + break; + } + break; + default: + throw new Error(`invalid FileDescriptorProto: unsupported syntax: ${syntax}`); + } + if (syntax === "editions" && edition === descriptor_pb_js_1.Edition.EDITION_UNKNOWN) { + throw new Error(`invalid FileDescriptorProto: syntax ${syntax} cannot have edition ${String(edition)}`); + } + return { + syntax: s, + edition: e, + }; +} +/** + * Resolve dependencies of FileDescriptorProto to DescFile. + */ +function findFileDependencies(proto, cart) { + return proto.dependency.map((wantName) => { + const dep = cart.files.find((f) => f.proto.name === wantName); + (0, assert_js_1.assert)(dep); + return dep; + }); +} +/** + * Create a fully qualified name for a protobuf type or extension field. + * + * The fully qualified name for messages, enumerations, and services is + * constructed by concatenating the package name (if present), parent + * message names (for nested types), and the type name. We omit the leading + * dot added by protobuf compilers. Examples: + * - mypackage.MyMessage + * - mypackage.MyMessage.NestedMessage + * + * The fully qualified name for extension fields is constructed by + * concatenating the package name (if present), parent message names (for + * extensions declared within a message), and the field name. Examples: + * - mypackage.extfield + * - mypackage.MyMessage.extfield + */ +function makeTypeName(proto, parent, file) { + (0, assert_js_1.assert)(proto.name, `invalid ${proto.getType().typeName}: missing name`); + let typeName; + if (parent) { + typeName = `${parent.typeName}.${proto.name}`; + } + else if (file.proto.package !== undefined) { + typeName = `${file.proto.package}.${proto.name}`; + } + else { + typeName = `${proto.name}`; + } + return typeName; +} +/** + * Remove the leading dot from a fully qualified type name. + */ +function trimLeadingDot(typeName) { + return typeName.startsWith(".") ? typeName.substring(1) : typeName; +} +function getMapFieldTypes(mapEntry) { + var _a, _b; + (0, assert_js_1.assert)((_a = mapEntry.proto.options) === null || _a === void 0 ? void 0 : _a.mapEntry, `invalid DescriptorProto: expected ${mapEntry.toString()} to be a map entry`); + (0, assert_js_1.assert)(mapEntry.fields.length === 2, `invalid DescriptorProto: map entry ${mapEntry.toString()} has ${mapEntry.fields.length} fields`); + const keyField = mapEntry.fields.find((f) => f.proto.number === 1); + (0, assert_js_1.assert)(keyField, `invalid DescriptorProto: map entry ${mapEntry.toString()} is missing key field`); + const mapKey = keyField.scalar; + (0, assert_js_1.assert)(mapKey !== undefined && + mapKey !== scalar_js_1.ScalarType.BYTES && + mapKey !== scalar_js_1.ScalarType.FLOAT && + mapKey !== scalar_js_1.ScalarType.DOUBLE, `invalid DescriptorProto: map entry ${mapEntry.toString()} has unexpected key type ${(_b = keyField.proto.type) !== null && _b !== void 0 ? _b : -1}`); + const valueField = mapEntry.fields.find((f) => f.proto.number === 2); + (0, assert_js_1.assert)(valueField, `invalid DescriptorProto: map entry ${mapEntry.toString()} is missing value field`); + switch (valueField.fieldKind) { + case "scalar": + return { + mapKey, + mapValue: Object.assign(Object.assign({}, valueField), { kind: "scalar" }), + }; + case "message": + return { + mapKey, + mapValue: Object.assign(Object.assign({}, valueField), { kind: "message" }), + }; + case "enum": + return { + mapKey, + mapValue: Object.assign(Object.assign({}, valueField), { kind: "enum" }), + }; + default: + throw new Error("invalid DescriptorProto: unsupported map entry value field"); + } +} +/** + * Did the user put the field in a oneof group? + * This handles proto3 optionals. + */ +function findOneof(proto, allOneofs) { + var _a; + const oneofIndex = proto.oneofIndex; + if (oneofIndex === undefined) { + return undefined; + } + let oneof; + if (proto.proto3Optional !== true) { + oneof = allOneofs[oneofIndex]; + (0, assert_js_1.assert)(oneof, `invalid FieldDescriptorProto: oneof #${oneofIndex} for field #${(_a = proto.number) !== null && _a !== void 0 ? _a : -1} not found`); + } + return oneof; +} +/** + * Did the user use the `optional` keyword? + * This handles proto3 optionals. + */ +function isOptionalField(proto, syntax) { + switch (syntax) { + case "proto2": + return (proto.oneofIndex === undefined && + proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.OPTIONAL); + case "proto3": + return proto.proto3Optional === true; + case "editions": + return false; + } +} +/** + * Is this field packed by default? Only valid for repeated enum fields, and + * for repeated scalar fields except BYTES and STRING. + * + * In proto3 syntax, fields are packed by default. In proto2 syntax, fields + * are unpacked by default. With editions, the default is whatever the edition + * specifies as a default. In edition 2023, fields are packed by default. + */ +function isPackedFieldByDefault(proto, resolveFeatures) { + const { repeatedFieldEncoding } = resolveFeatures(); + if (repeatedFieldEncoding != descriptor_pb_js_1.FeatureSet_RepeatedFieldEncoding.PACKED) { + return false; + } + // From the proto3 language guide: + // > In proto3, repeated fields of scalar numeric types are packed by default. + // This information is incomplete - according to the conformance tests, BOOL + // and ENUM are packed by default as well. This means only STRING and BYTES + // are not packed by default, which makes sense because they are length-delimited. + switch (proto.type) { + case descriptor_pb_js_1.FieldDescriptorProto_Type.STRING: + case descriptor_pb_js_1.FieldDescriptorProto_Type.BYTES: + case descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP: + case descriptor_pb_js_1.FieldDescriptorProto_Type.MESSAGE: + return false; + default: + return true; + } +} +/** + * Pack this repeated field? + * + * Respects field type, proto2/proto3 defaults and the `packed` option, or + * edition defaults and the edition features.repeated_field_encoding options. + */ +function isPackedField(file, parent, proto, resolveFeatures) { + var _a, _b, _c, _d, _e, _f; + switch (proto.type) { + case descriptor_pb_js_1.FieldDescriptorProto_Type.STRING: + case descriptor_pb_js_1.FieldDescriptorProto_Type.BYTES: + case descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP: + case descriptor_pb_js_1.FieldDescriptorProto_Type.MESSAGE: + // length-delimited types cannot be packed + return false; + default: + switch (file.edition) { + case descriptor_pb_js_1.Edition.EDITION_PROTO2: + return (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.packed) !== null && _b !== void 0 ? _b : false; + case descriptor_pb_js_1.Edition.EDITION_PROTO3: + return (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.packed) !== null && _d !== void 0 ? _d : true; + default: { + const { repeatedFieldEncoding } = resolveFeatures((_e = parent === null || parent === void 0 ? void 0 : parent.getFeatures()) !== null && _e !== void 0 ? _e : file.getFeatures(), (_f = proto.options) === null || _f === void 0 ? void 0 : _f.features); + return (repeatedFieldEncoding == descriptor_pb_js_1.FeatureSet_RepeatedFieldEncoding.PACKED); + } + } + } +} +/** + * Map from a compiler-generated field type to our ScalarType, which is a + * subset of field types declared by protobuf enum google.protobuf.FieldDescriptorProto. + */ +const fieldTypeToScalarType = { + [descriptor_pb_js_1.FieldDescriptorProto_Type.DOUBLE]: scalar_js_1.ScalarType.DOUBLE, + [descriptor_pb_js_1.FieldDescriptorProto_Type.FLOAT]: scalar_js_1.ScalarType.FLOAT, + [descriptor_pb_js_1.FieldDescriptorProto_Type.INT64]: scalar_js_1.ScalarType.INT64, + [descriptor_pb_js_1.FieldDescriptorProto_Type.UINT64]: scalar_js_1.ScalarType.UINT64, + [descriptor_pb_js_1.FieldDescriptorProto_Type.INT32]: scalar_js_1.ScalarType.INT32, + [descriptor_pb_js_1.FieldDescriptorProto_Type.FIXED64]: scalar_js_1.ScalarType.FIXED64, + [descriptor_pb_js_1.FieldDescriptorProto_Type.FIXED32]: scalar_js_1.ScalarType.FIXED32, + [descriptor_pb_js_1.FieldDescriptorProto_Type.BOOL]: scalar_js_1.ScalarType.BOOL, + [descriptor_pb_js_1.FieldDescriptorProto_Type.STRING]: scalar_js_1.ScalarType.STRING, + [descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP]: undefined, + [descriptor_pb_js_1.FieldDescriptorProto_Type.MESSAGE]: undefined, + [descriptor_pb_js_1.FieldDescriptorProto_Type.BYTES]: scalar_js_1.ScalarType.BYTES, + [descriptor_pb_js_1.FieldDescriptorProto_Type.UINT32]: scalar_js_1.ScalarType.UINT32, + [descriptor_pb_js_1.FieldDescriptorProto_Type.ENUM]: undefined, + [descriptor_pb_js_1.FieldDescriptorProto_Type.SFIXED32]: scalar_js_1.ScalarType.SFIXED32, + [descriptor_pb_js_1.FieldDescriptorProto_Type.SFIXED64]: scalar_js_1.ScalarType.SFIXED64, + [descriptor_pb_js_1.FieldDescriptorProto_Type.SINT32]: scalar_js_1.ScalarType.SINT32, + [descriptor_pb_js_1.FieldDescriptorProto_Type.SINT64]: scalar_js_1.ScalarType.SINT64, +}; +/** + * Find comments. + */ +function findComments(sourceCodeInfo, sourcePath) { + if (!sourceCodeInfo) { + return { + leadingDetached: [], + sourcePath, + }; + } + for (const location of sourceCodeInfo.location) { + if (location.path.length !== sourcePath.length) { + continue; + } + if (location.path.some((value, index) => sourcePath[index] !== value)) { + continue; + } + return { + leadingDetached: location.leadingDetachedComments, + leading: location.leadingComments, + trailing: location.trailingComments, + sourcePath, + }; + } + return { + leadingDetached: [], + sourcePath, + }; +} +/** + * The following field numbers are used to find comments in + * google.protobuf.SourceCodeInfo. + */ +var FieldNumber; +(function (FieldNumber) { + FieldNumber[FieldNumber["FileDescriptorProto_Package"] = 2] = "FileDescriptorProto_Package"; + FieldNumber[FieldNumber["FileDescriptorProto_MessageType"] = 4] = "FileDescriptorProto_MessageType"; + FieldNumber[FieldNumber["FileDescriptorProto_EnumType"] = 5] = "FileDescriptorProto_EnumType"; + FieldNumber[FieldNumber["FileDescriptorProto_Service"] = 6] = "FileDescriptorProto_Service"; + FieldNumber[FieldNumber["FileDescriptorProto_Extension"] = 7] = "FileDescriptorProto_Extension"; + FieldNumber[FieldNumber["FileDescriptorProto_Syntax"] = 12] = "FileDescriptorProto_Syntax"; + FieldNumber[FieldNumber["DescriptorProto_Field"] = 2] = "DescriptorProto_Field"; + FieldNumber[FieldNumber["DescriptorProto_NestedType"] = 3] = "DescriptorProto_NestedType"; + FieldNumber[FieldNumber["DescriptorProto_EnumType"] = 4] = "DescriptorProto_EnumType"; + FieldNumber[FieldNumber["DescriptorProto_Extension"] = 6] = "DescriptorProto_Extension"; + FieldNumber[FieldNumber["DescriptorProto_OneofDecl"] = 8] = "DescriptorProto_OneofDecl"; + FieldNumber[FieldNumber["EnumDescriptorProto_Value"] = 2] = "EnumDescriptorProto_Value"; + FieldNumber[FieldNumber["ServiceDescriptorProto_Method"] = 2] = "ServiceDescriptorProto_Method"; +})(FieldNumber || (FieldNumber = {})); +/** + * Return a string that matches the definition of a field in the protobuf + * source. Does not take custom options into account. + */ +function declarationString() { + var _a, _b, _c; + const parts = []; + if (this.repeated) { + parts.push("repeated"); + } + if (this.optional) { + parts.push("optional"); + } + const file = this.kind === "extension" ? this.file : this.parent.file; + if (file.syntax == "proto2" && + this.proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.REQUIRED) { + parts.push("required"); + } + let type; + switch (this.fieldKind) { + case "scalar": + type = scalar_js_1.ScalarType[this.scalar].toLowerCase(); + break; + case "enum": + type = this.enum.typeName; + break; + case "message": + type = this.message.typeName; + break; + case "map": { + const k = scalar_js_1.ScalarType[this.mapKey].toLowerCase(); + let v; + switch (this.mapValue.kind) { + case "scalar": + v = scalar_js_1.ScalarType[this.mapValue.scalar].toLowerCase(); + break; + case "enum": + v = this.mapValue.enum.typeName; + break; + case "message": + v = this.mapValue.message.typeName; + break; + } + type = `map<${k}, ${v}>`; + break; + } + } + parts.push(`${type} ${this.name} = ${this.number}`); + const options = []; + if (((_a = this.proto.options) === null || _a === void 0 ? void 0 : _a.packed) !== undefined) { + options.push(`packed = ${this.proto.options.packed.toString()}`); + } + let defaultValue = this.proto.defaultValue; + if (defaultValue !== undefined) { + if (this.proto.type == descriptor_pb_js_1.FieldDescriptorProto_Type.BYTES || + this.proto.type == descriptor_pb_js_1.FieldDescriptorProto_Type.STRING) { + defaultValue = '"' + defaultValue.replace('"', '\\"') + '"'; + } + options.push(`default = ${defaultValue}`); + } + if (this.jsonName !== undefined) { + options.push(`json_name = "${this.jsonName}"`); + } + if (((_b = this.proto.options) === null || _b === void 0 ? void 0 : _b.jstype) !== undefined) { + options.push(`jstype = ${descriptor_pb_js_1.FieldOptions_JSType[this.proto.options.jstype]}`); + } + if (((_c = this.proto.options) === null || _c === void 0 ? void 0 : _c.deprecated) === true) { + options.push(`deprecated = true`); + } + if (options.length > 0) { + parts.push("[" + options.join(", ") + "]"); + } + return parts.join(" "); +} +/** + * Parses a text-encoded default value (proto2) of a scalar or enum field. + */ +function getDefaultValue() { + const d = this.proto.defaultValue; + if (d === undefined) { + return undefined; + } + switch (this.fieldKind) { + case "enum": + return (0, text_format_js_1.parseTextFormatEnumValue)(this.enum, d); + case "scalar": + return (0, text_format_js_1.parseTextFormatScalarValue)(this.scalar, d); + default: + return undefined; + } +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry-from-desc.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry-from-desc.d.ts new file mode 100644 index 0000000..37df6d9 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry-from-desc.d.ts @@ -0,0 +1,15 @@ +import type { IEnumTypeRegistry, IExtensionRegistry, IMessageTypeRegistry, IServiceTypeRegistry } from "./type-registry.js"; +import { FileDescriptorSet } from "./google/protobuf/descriptor_pb.js"; +import type { DescriptorSet } from "./descriptor-set.js"; +/** + * Create a registry from a set of descriptors. The types returned by this + * registry behave exactly like types from generated code. + * + * This function accepts google.protobuf.FileDescriptorSet in serialized or + * deserialized form. Alternatively, it also accepts a DescriptorSet (see + * createDescriptorSet()). + * + * By default, all well-known types with a specialized JSON representation + * are replaced with their generated counterpart in this package. + */ +export declare function createRegistryFromDescriptors(input: DescriptorSet | FileDescriptorSet | Uint8Array, replaceWkt?: boolean): IMessageTypeRegistry & IEnumTypeRegistry & IExtensionRegistry & IServiceTypeRegistry; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry-from-desc.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry-from-desc.js new file mode 100644 index 0000000..65486d4 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry-from-desc.js @@ -0,0 +1,264 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createRegistryFromDescriptors = void 0; +const assert_js_1 = require("./private/assert.js"); +const proto3_js_1 = require("./proto3.js"); +const proto2_js_1 = require("./proto2.js"); +const names_js_1 = require("./private/names.js"); +const timestamp_pb_js_1 = require("./google/protobuf/timestamp_pb.js"); +const duration_pb_js_1 = require("./google/protobuf/duration_pb.js"); +const any_pb_js_1 = require("./google/protobuf/any_pb.js"); +const empty_pb_js_1 = require("./google/protobuf/empty_pb.js"); +const field_mask_pb_js_1 = require("./google/protobuf/field_mask_pb.js"); +const struct_pb_js_1 = require("./google/protobuf/struct_pb.js"); +const enum_js_1 = require("./private/enum.js"); +const wrappers_pb_js_1 = require("./google/protobuf/wrappers_pb.js"); +const descriptor_pb_js_1 = require("./google/protobuf/descriptor_pb.js"); +const create_descriptor_set_js_1 = require("./create-descriptor-set.js"); +const is_message_js_1 = require("./is-message.js"); +// well-known message types with specialized JSON representation +const wkMessages = [ + any_pb_js_1.Any, + duration_pb_js_1.Duration, + empty_pb_js_1.Empty, + field_mask_pb_js_1.FieldMask, + struct_pb_js_1.Struct, + struct_pb_js_1.Value, + struct_pb_js_1.ListValue, + timestamp_pb_js_1.Timestamp, + duration_pb_js_1.Duration, + wrappers_pb_js_1.DoubleValue, + wrappers_pb_js_1.FloatValue, + wrappers_pb_js_1.Int64Value, + wrappers_pb_js_1.Int32Value, + wrappers_pb_js_1.UInt32Value, + wrappers_pb_js_1.UInt64Value, + wrappers_pb_js_1.BoolValue, + wrappers_pb_js_1.StringValue, + wrappers_pb_js_1.BytesValue, +]; +// well-known enum types with specialized JSON representation +const wkEnums = [(0, enum_js_1.getEnumType)(struct_pb_js_1.NullValue)]; +/** + * Create a registry from a set of descriptors. The types returned by this + * registry behave exactly like types from generated code. + * + * This function accepts google.protobuf.FileDescriptorSet in serialized or + * deserialized form. Alternatively, it also accepts a DescriptorSet (see + * createDescriptorSet()). + * + * By default, all well-known types with a specialized JSON representation + * are replaced with their generated counterpart in this package. + */ +function createRegistryFromDescriptors(input, replaceWkt = true) { + const set = input instanceof Uint8Array || (0, is_message_js_1.isMessage)(input, descriptor_pb_js_1.FileDescriptorSet) + ? (0, create_descriptor_set_js_1.createDescriptorSet)(input) + : input; + const enums = new Map(); + const messages = new Map(); + const extensions = new Map(); + const extensionsByExtendee = new Map(); + const services = {}; + if (replaceWkt) { + for (const mt of wkMessages) { + messages.set(mt.typeName, mt); + } + for (const et of wkEnums) { + enums.set(et.typeName, et); + } + } + return { + /** + * May raise an error on invalid descriptors. + */ + findEnum(typeName) { + const existing = enums.get(typeName); + if (existing) { + return existing; + } + const desc = set.enums.get(typeName); + if (!desc) { + return undefined; + } + const runtime = desc.file.syntax == "proto3" ? proto3_js_1.proto3 : proto2_js_1.proto2; + const type = runtime.makeEnumType(typeName, desc.values.map((u) => ({ + no: u.number, + name: u.name, + localName: (0, names_js_1.localName)(u), + })), {}); + enums.set(typeName, type); + return type; + }, + /** + * May raise an error on invalid descriptors. + */ + findMessage(typeName) { + const existing = messages.get(typeName); + if (existing) { + return existing; + } + const desc = set.messages.get(typeName); + if (!desc) { + return undefined; + } + const runtime = desc.file.syntax == "proto3" ? proto3_js_1.proto3 : proto2_js_1.proto2; + const fields = []; + const type = runtime.makeMessageType(typeName, () => fields, { + localName: (0, names_js_1.localName)(desc), + }); + messages.set(typeName, type); + for (const field of desc.fields) { + fields.push(makeFieldInfo(field, this)); + } + return type; + }, + /** + * May raise an error on invalid descriptors. + */ + findService(typeName) { + const existing = services[typeName]; + if (existing) { + return existing; + } + const desc = set.services.get(typeName); + if (!desc) { + return undefined; + } + const methods = {}; + for (const method of desc.methods) { + const I = resolve(method.input, this, method); + const O = resolve(method.output, this, method); + methods[(0, names_js_1.localName)(method)] = { + name: method.name, + I, + O, + kind: method.methodKind, + idempotency: method.idempotency, + // We do not surface options at this time + // options: {}, + }; + } + return (services[typeName] = { + typeName: desc.typeName, + methods, + }); + }, + /** + * May raise an error on invalid descriptors. + */ + findExtensionFor(typeName, no) { + var _a; + if (!set.messages.has(typeName)) { + return undefined; + } + let extensionsByNo = extensionsByExtendee.get(typeName); + if (!extensionsByNo) { + // maintain a lookup for extension desc by number + extensionsByNo = new Map(); + extensionsByExtendee.set(typeName, extensionsByNo); + for (const desc of set.extensions.values()) { + if (desc.extendee.typeName == typeName) { + extensionsByNo.set(desc.number, desc); + } + } + } + const desc = (_a = extensionsByExtendee.get(typeName)) === null || _a === void 0 ? void 0 : _a.get(no); + return desc ? this.findExtension(desc.typeName) : undefined; + }, + /** + * May raise an error on invalid descriptors. + */ + findExtension(typeName) { + const existing = extensions.get(typeName); + if (existing) { + return existing; + } + const desc = set.extensions.get(typeName); + if (!desc) { + return undefined; + } + const extendee = resolve(desc.extendee, this, desc); + const runtime = desc.file.syntax == "proto3" ? proto3_js_1.proto3 : proto2_js_1.proto2; + const ext = runtime.makeExtension(typeName, extendee, makeFieldInfo(desc, this)); + extensions.set(typeName, ext); + return ext; + }, + }; +} +exports.createRegistryFromDescriptors = createRegistryFromDescriptors; +function makeFieldInfo(desc, registry) { + var _a; + const f = { + kind: desc.fieldKind, + no: desc.number, + name: desc.name, + jsonName: desc.jsonName, + delimited: desc.proto.type == descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP, + repeated: desc.repeated, + packed: desc.packed, + oneof: (_a = desc.oneof) === null || _a === void 0 ? void 0 : _a.name, + opt: desc.optional, + req: desc.proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.REQUIRED, + }; + switch (desc.fieldKind) { + case "map": { + (0, assert_js_1.assert)(desc.kind == "field"); // maps are not allowed for extensions + let T; + switch (desc.mapValue.kind) { + case "scalar": + T = desc.mapValue.scalar; + break; + case "enum": { + T = resolve(desc.mapValue.enum, registry, desc); + break; + } + case "message": { + T = resolve(desc.mapValue.message, registry, desc); + break; + } + } + f.K = desc.mapKey; + f.V = { + kind: desc.mapValue.kind, + T, + }; + break; + } + case "message": { + f.T = resolve(desc.message, registry, desc); + break; + } + case "enum": { + f.T = resolve(desc.enum, registry, desc); + f.default = desc.getDefaultValue(); + break; + } + case "scalar": { + f.L = desc.longType; + f.T = desc.scalar; + f.default = desc.getDefaultValue(); + break; + } + } + return f; +} +function resolve(desc, registry, context) { + const type = desc.kind == "message" + ? registry.findMessage(desc.typeName) + : registry.findEnum(desc.typeName); + (0, assert_js_1.assert)(type, `${desc.toString()}" for ${context.toString()} not found`); + return type; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry.d.ts new file mode 100644 index 0000000..c5aef2e --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry.d.ts @@ -0,0 +1,13 @@ +import type { MessageType } from "./message-type.js"; +import type { EnumType } from "./enum.js"; +import type { ServiceType } from "./service-type.js"; +import type { IEnumTypeRegistry, IExtensionRegistry, IMessageTypeRegistry, IMutableRegistry, IServiceTypeRegistry } from "./type-registry.js"; +import type { Extension } from "./extension.js"; +/** + * Create a new registry from the given types. + */ +export declare function createRegistry(...types: Array): IMessageTypeRegistry & IEnumTypeRegistry & IExtensionRegistry & IServiceTypeRegistry; +/** + * Create a mutable registry from the given types. + */ +export declare function createMutableRegistry(...types: Array): IMutableRegistry; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry.js new file mode 100644 index 0000000..aad4a37 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/create-registry.js @@ -0,0 +1,103 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMutableRegistry = exports.createRegistry = void 0; +/** + * Create a new registry from the given types. + */ +function createRegistry(...types) { + const mutable = createMutableRegistry(...types); + delete mutable.add; + return mutable; +} +exports.createRegistry = createRegistry; +/** + * Create a mutable registry from the given types. + */ +function createMutableRegistry(...types) { + const messages = {}; + const enums = {}; + const services = {}; + const extensionsByName = new Map(); + const extensionsByExtendee = new Map(); + const registry = { + findMessage(typeName) { + return messages[typeName]; + }, + findEnum(typeName) { + return enums[typeName]; + }, + findService(typeName) { + return services[typeName]; + }, + findExtensionFor(typeName, no) { + var _a, _b; + return (_b = (_a = extensionsByExtendee.get(typeName)) === null || _a === void 0 ? void 0 : _a.get(no)) !== null && _b !== void 0 ? _b : undefined; + }, + findExtension(typeName) { + var _a; + return (_a = extensionsByName.get(typeName)) !== null && _a !== void 0 ? _a : undefined; + }, + add(type) { + var _a; + if ("fields" in type) { + if (!this.findMessage(type.typeName)) { + messages[type.typeName] = type; + type.fields.list().forEach(addField); + } + } + else if ("methods" in type) { + if (!this.findService(type.typeName)) { + services[type.typeName] = type; + for (const method of Object.values(type.methods)) { + this.add(method.I); + this.add(method.O); + } + } + } + else if ("extendee" in type) { + if (!extensionsByName.has(type.typeName)) { + extensionsByName.set(type.typeName, type); + const extendeeName = type.extendee.typeName; + if (!extensionsByExtendee.has(extendeeName)) { + extensionsByExtendee.set(extendeeName, new Map()); + } + (_a = extensionsByExtendee.get(extendeeName)) === null || _a === void 0 ? void 0 : _a.set(type.field.no, type); + this.add(type.extendee); + addField(type.field); + } + } + else { + enums[type.typeName] = type; + } + }, + }; + function addField(field) { + if (field.kind == "message") { + registry.add(field.T); + } + else if (field.kind == "map" && field.V.kind == "message") { + registry.add(field.V.T); + } + else if (field.kind == "enum") { + registry.add(field.T); + } + } + for (const type of types) { + registry.add(type); + } + return registry; +} +exports.createMutableRegistry = createMutableRegistry; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/descriptor-set.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/descriptor-set.d.ts new file mode 100644 index 0000000..512772a --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/descriptor-set.d.ts @@ -0,0 +1,672 @@ +import type { DescriptorProto, Edition, EnumDescriptorProto, EnumValueDescriptorProto, FieldDescriptorProto, FileDescriptorProto, MethodDescriptorProto, OneofDescriptorProto, ServiceDescriptorProto } from "./google/protobuf/descriptor_pb.js"; +import { LongType, ScalarType } from "./scalar.js"; +import type { MethodIdempotency, MethodKind } from "./service-type.js"; +import type { MergedFeatureSet } from "./private/feature-set.js"; +/** + * DescriptorSet provides a convenient interface for working with a set + * of google.protobuf.FileDescriptorProto. + * + * When protobuf sources are compiled, each file is parsed into a + * google.protobuf.FileDescriptorProto. Those messages describe all parts + * of the source file that are required to generate code for them. + * + * DescriptorSet resolves references between the descriptors, hides + * implementation details like synthetic map entry messages, and provides + * simple access to comments. + */ +export interface DescriptorSet { + /** + * All files, in the order they were added to the set. + */ + readonly files: DescFile[]; + /** + * All enumerations, indexed by their fully qualified type name. + * (We omit the leading dot.) + */ + readonly enums: ReadonlyMap; + /** + * All messages, indexed by their fully qualified type name. + * (We omit the leading dot.) + */ + readonly messages: ReadonlyMap; + /** + * All services, indexed by their fully qualified type name. + * (We omit the leading dot.) + */ + readonly services: ReadonlyMap; + /** + * All extensions, indexed by their fully qualified type name. + */ + readonly extensions: ReadonlyMap; +} +/** + * A union of all descriptors, discriminated by a `kind` property. + */ +export type AnyDesc = DescFile | DescEnum | DescEnumValue | DescMessage | DescField | DescExtension | DescOneof | DescService | DescMethod; +/** + * Describes a protobuf source file. + */ +export interface DescFile { + readonly kind: "file"; + /** + * The syntax specified in the protobuf source. + */ + readonly syntax: "proto3" | "proto2" | "editions"; + /** + * The edition of the protobuf file. Will be EDITION_PROTO2 for syntax="proto2", + * EDITION_PROTO3 for syntax="proto3"; + */ + readonly edition: Exclude; + /** + * The name of the file, excluding the .proto suffix. + * For a protobuf file `foo/bar.proto`, this is `foo/bar`. + */ + readonly name: string; + /** + * Files imported by this file. + */ + readonly dependencies: DescFile[]; + /** + * Top-level enumerations declared in this file. + * Note that more enumerations might be declared within message declarations. + */ + readonly enums: DescEnum[]; + /** + * Top-level messages declared in this file. + * Note that more messages might be declared within message declarations. + */ + readonly messages: DescMessage[]; + /** + * Top-level extensions declared in this file. + * Note that more extensions might be declared within message declarations. + */ + readonly extensions: DescExtension[]; + /** + * Services declared in this file. + */ + readonly services: DescService[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: FileDescriptorProto; + /** + * Get comments on the syntax element in the protobuf source. + */ + getSyntaxComments(): DescComments; + /** + * Get comments on the package element in the protobuf source. + */ + getPackageComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Describes an enumeration in a protobuf source file. + */ +export interface DescEnum { + readonly kind: "enum"; + /** + * The fully qualified name of the enumeration. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the enumeration, as declared in the protobuf source. + */ + readonly name: string; + /** + * The file this enumeration was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this enumeration was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * Values declared for this enumeration. + */ + readonly values: DescEnumValue[]; + /** + * A prefix shared by all enum values. + * For example, `MY_ENUM_` for `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}` + */ + readonly sharedPrefix?: string; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: EnumDescriptorProto; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Describes an individual value of an enumeration in a protobuf source file. + */ +export interface DescEnumValue { + kind: "enum_value"; + /** + * The name of the enumeration value, as specified in the protobuf source. + */ + readonly name: string; + /** + * The enumeration this value belongs to. + */ + readonly parent: DescEnum; + /** + * The numeric enumeration value, as specified in the protobuf source. + */ + readonly number: number; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: EnumValueDescriptorProto; + /** + * Return a string that (closely) matches the definition of the enumeration + * value in the protobuf source. + */ + declarationString(): string; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Describes a message declaration in a protobuf source file. + */ +export interface DescMessage { + readonly kind: "message"; + /** + * The fully qualified name of the message. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the message, as specified in the protobuf source. + */ + readonly name: string; + /** + * The file this message was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this message was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * Fields declared for this message, including fields declared in a oneof + * group. + */ + readonly fields: DescField[]; + /** + * Oneof groups declared for this message. + * This does not include synthetic oneofs for proto3 optionals. + */ + readonly oneofs: DescOneof[]; + /** + * Fields and oneof groups for this message, ordered by their appearance in the + * protobuf source. + */ + readonly members: (DescField | DescOneof)[]; + /** + * Enumerations declared within the message, if any. + */ + readonly nestedEnums: DescEnum[]; + /** + * Messages declared within the message, if any. + * This does not include synthetic messages like map entries. + */ + readonly nestedMessages: DescMessage[]; + /** + * Extensions declared within the message, if any. + */ + readonly nestedExtensions: DescExtension[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: DescriptorProto; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Describes a field declaration in a protobuf source file. + */ +export type DescField = DescFieldCommon & (DescFieldScalar | DescFieldMessage | DescFieldEnum | DescFieldMap) & { + readonly kind: "field"; + /** + * The message this field is declared on. + */ + readonly parent: DescMessage; +}; +/** + * Describes an extension in a protobuf source file. + */ +export type DescExtension = DescFieldCommon & (DescFieldScalar | DescFieldMessage | DescFieldEnum | DescFieldMap) & { + readonly kind: "extension"; + /** + * The fully qualified name of the extension. + */ + readonly typeName: string; + /** + * The file this extension was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this extension was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * The message that this extension extends. + */ + readonly extendee: DescMessage; +}; +interface DescFieldCommon { + /** + * The field name, as specified in the protobuf source + */ + readonly name: string; + /** + * The field number, as specified in the protobuf source. + */ + readonly number: number; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: DescOneof | undefined; + /** + * Whether this field was declared with `optional` in the protobuf source. + */ + readonly optional: boolean; + /** + * Pack this repeated field? + */ + readonly packed: boolean; + /** + * Is this field packed by default? Only valid for repeated enum fields, and + * for repeated scalar fields except BYTES and STRING. + * + * In proto3 syntax, fields are packed by default. In proto2 syntax, fields + * are unpacked by default. + * + * With editions, the default is whatever the edition specifies as a default. + * In edition 2023, fields are packed by default. + */ + readonly packedByDefault: boolean; + /** + * A user-defined name for the JSON format, set with the field option + * [json_name="foo"]. + */ + readonly jsonName: string | undefined; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: FieldDescriptorProto; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Return a string that (closely) matches the definition of the field in the + * protobuf source. + */ + declarationString(): string; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +interface DescFieldScalar { + readonly fieldKind: "scalar"; + /** + * Is the field repeated? + */ + readonly repeated: boolean; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: ScalarType; + /** + * JavaScript type for 64 bit integral types (int64, uint64, + * sint64, fixed64, sfixed64). + */ + readonly longType: LongType; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * The map key type, if this is a map field. + */ + readonly mapKey: undefined; + /** + * The map value type, if this is a map field. + */ + readonly mapValue: undefined; + /** + * Return the default value specified in the protobuf source. + * Only valid for proto2 syntax. + */ + getDefaultValue(): number | boolean | string | bigint | Uint8Array | undefined; +} +interface DescFieldMessage { + readonly fieldKind: "message"; + /** + * Is the field repeated? + */ + readonly repeated: boolean; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * JavaScript type for 64 bit integral types (int64, uint64, + * sint64, fixed64, sfixed64). + */ + readonly longType: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: DescMessage; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * The map key type, if this is a map field. + */ + readonly mapKey: undefined; + /** + * The map value type, if this is a map field. + */ + readonly mapValue: undefined; +} +interface DescFieldEnum { + readonly fieldKind: "enum"; + /** + * Is the field repeated? + */ + readonly repeated: boolean; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * JavaScript type for 64 bit integral types (int64, uint64, + * sint64, fixed64, sfixed64). + */ + readonly longType: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: DescEnum; + /** + * The map key type, if this is a map field. + */ + readonly mapKey: undefined; + /** + * The map value type, if this is a map field. + */ + readonly mapValue: undefined; + /** + * Return the default value specified in the protobuf source. + * Only valid for proto2 syntax. + */ + getDefaultValue(): number | boolean | string | bigint | Uint8Array | undefined; +} +interface DescFieldMap { + readonly fieldKind: "map"; + /** + * Is the field repeated? + */ + readonly repeated: false; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * JavaScript type for 64 bit integral types (int64, uint64, + * sint64, fixed64, sfixed64). + */ + readonly longType: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * The map key type, if this is a map field. + */ + readonly mapKey: Exclude; + /** + * The map value type, if this is a map field. + */ + readonly mapValue: DescFieldMapValueEnum | DescFieldMapValueMessage | DescFieldMapValueScalar; +} +interface DescFieldMapValueEnum { + readonly kind: "enum"; + /** + * The enum type, if this is a map field with enum values. + */ + readonly enum: DescEnum; + /** + * The message this message field uses. + */ + readonly message: undefined; + /** + * Scalar type, if this is a map field with scalar values. + */ + readonly scalar: undefined; +} +interface DescFieldMapValueMessage { + readonly kind: "message"; + /** + * The enum type, if this is a map field with enum values. + */ + readonly enum: undefined; + /** + * The message type, if this is a map field with message values. + */ + readonly message: DescMessage; + /** + * Scalar type, if this is a map field with scalar values. + */ + readonly scalar: undefined; +} +interface DescFieldMapValueScalar { + readonly kind: "scalar"; + /** + * The enum type, if this is a map field with enum values. + */ + readonly enum: undefined; + /** + * The message type, if this is a map field with message values. + */ + readonly message: undefined; + /** + * Scalar type, if this is a map field with scalar values. + */ + readonly scalar: ScalarType; +} +/** + * Describes a oneof group in a protobuf source file. + */ +export interface DescOneof { + readonly kind: "oneof"; + /** + * The name of the oneof group, as specified in the protobuf source. + */ + readonly name: string; + /** + * The message this oneof group was declared in. + */ + readonly parent: DescMessage; + /** + * The fields declared in this oneof group. + */ + readonly fields: DescField[]; + /** + * Marked as deprecated in the protobuf source. + * Note that oneof groups cannot be marked as deprecated, this property + * only exists for consistency and will always be false. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: OneofDescriptorProto; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Describes a service declaration in a protobuf source file. + */ +export interface DescService { + readonly kind: "service"; + /** + * The fully qualified name of the service. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the service, as specified in the protobuf source. + */ + readonly name: string; + /** + * The file this service was declared in. + */ + readonly file: DescFile; + /** + * The RPCs this service declares. + */ + readonly methods: DescMethod[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: ServiceDescriptorProto; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Describes an RPC declaration in a protobuf source file. + */ +export interface DescMethod { + readonly kind: "rpc"; + /** + * The name of the RPC, as specified in the protobuf source. + */ + readonly name: string; + /** + * The parent service. + */ + readonly parent: DescService; + /** + * One of the four available method types. + */ + readonly methodKind: MethodKind; + /** + * The message type for requests. + */ + readonly input: DescMessage; + /** + * The message type for responses. + */ + readonly output: DescMessage; + /** + * The idempotency level declared in the protobuf source, if any. + */ + readonly idempotency?: MethodIdempotency; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: MethodDescriptorProto; + /** + * Get comments on the element in the protobuf source. + */ + getComments(): DescComments; + /** + * Get the edition features for this protobuf element. + */ + getFeatures(): MergedFeatureSet; + toString(): string; +} +/** + * Comments on an element in a protobuf source file. + */ +export interface DescComments { + readonly leadingDetached: readonly string[]; + readonly leading?: string; + readonly trailing?: string; + readonly sourcePath: readonly number[]; +} +export {}; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/descriptor-set.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/descriptor-set.js new file mode 100644 index 0000000..d03a43b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/descriptor-set.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/enum.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/enum.d.ts new file mode 100644 index 0000000..d57beae --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/enum.d.ts @@ -0,0 +1,35 @@ +/** + * Reflection information for a protobuf enumeration. + */ +export interface EnumType { + /** + * The fully qualified name of the enumeration. + */ + readonly typeName: string; + readonly values: readonly EnumValueInfo[]; + /** + * Find an enum value by its (protobuf) name. + */ + findName(name: string): EnumValueInfo | undefined; + /** + * Find an enum value by its number. + */ + findNumber(no: number): EnumValueInfo | undefined; +} +/** + * Reflection information for a protobuf enumeration value. + */ +export interface EnumValueInfo { + /** + * The numeric enumeration value, as specified in the protobuf source. + */ + readonly no: number; + /** + * The name of the enumeration value, as specified in the protobuf source. + */ + readonly name: string; + /** + * The name of the enumeration value in generated code. + */ + readonly localName: string; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/enum.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/enum.js new file mode 100644 index 0000000..d03a43b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/enum.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension-accessor.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension-accessor.d.ts new file mode 100644 index 0000000..3f60876 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension-accessor.d.ts @@ -0,0 +1,35 @@ +import type { Message } from "./message.js"; +import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js"; +import type { Extension } from "./extension.js"; +/** + * Retrieve an extension value from a message. + * + * The function never returns undefined. Use hasExtension() to check whether an + * extension is set. If the extension is not set, this function returns the + * default value (if one was specified in the protobuf source), or the zero value + * (for example `0` for numeric types, `[]` for repeated extension fields, and + * an empty message instance for message fields). + * + * Extensions are stored as unknown fields on a message. To mutate an extension + * value, make sure to store the new value with setExtension() after mutating. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function getExtension, V>(message: E, extension: Extension, options?: Partial): V; +/** + * Set an extension value on a message. If the message already has a value for + * this extension, the value is replaced. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function setExtension, V>(message: E, extension: Extension, value: V, options?: Partial): void; +/** + * Remove an extension value from a message. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function clearExtension, V>(message: E, extension: Extension): void; +/** + * Check whether an extension is set on a message. + */ +export declare function hasExtension, V>(message: E, extension: Extension): boolean; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension-accessor.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension-accessor.js new file mode 100644 index 0000000..a593f5f --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension-accessor.js @@ -0,0 +1,114 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasExtension = exports.clearExtension = exports.setExtension = exports.getExtension = void 0; +const assert_js_1 = require("./private/assert.js"); +const extensions_js_1 = require("./private/extensions.js"); +/** + * Retrieve an extension value from a message. + * + * The function never returns undefined. Use hasExtension() to check whether an + * extension is set. If the extension is not set, this function returns the + * default value (if one was specified in the protobuf source), or the zero value + * (for example `0` for numeric types, `[]` for repeated extension fields, and + * an empty message instance for message fields). + * + * Extensions are stored as unknown fields on a message. To mutate an extension + * value, make sure to store the new value with setExtension() after mutating. + * + * If the extension does not extend the given message, an error is raised. + */ +function getExtension(message, extension, options) { + assertExtendee(extension, message); + const opt = extension.runtime.bin.makeReadOptions(options); + const ufs = (0, extensions_js_1.filterUnknownFields)(message.getType().runtime.bin.listUnknownFields(message), extension.field); + const [container, get] = (0, extensions_js_1.createExtensionContainer)(extension); + for (const uf of ufs) { + extension.runtime.bin.readField(container, opt.readerFactory(uf.data), extension.field, uf.wireType, opt); + } + return get(); +} +exports.getExtension = getExtension; +/** + * Set an extension value on a message. If the message already has a value for + * this extension, the value is replaced. + * + * If the extension does not extend the given message, an error is raised. + */ +function setExtension(message, extension, value, options) { + assertExtendee(extension, message); + const readOpt = extension.runtime.bin.makeReadOptions(options); + const writeOpt = extension.runtime.bin.makeWriteOptions(options); + if (hasExtension(message, extension)) { + const ufs = message + .getType() + .runtime.bin.listUnknownFields(message) + .filter((uf) => uf.no != extension.field.no); + message.getType().runtime.bin.discardUnknownFields(message); + for (const uf of ufs) { + message + .getType() + .runtime.bin.onUnknownField(message, uf.no, uf.wireType, uf.data); + } + } + const writer = writeOpt.writerFactory(); + let f = extension.field; + // Implicit presence does not apply to extensions, see https://github.com/protocolbuffers/protobuf/issues/8234 + // We patch the field info to use explicit presence: + if (!f.opt && !f.repeated && (f.kind == "enum" || f.kind == "scalar")) { + f = Object.assign(Object.assign({}, extension.field), { opt: true }); + } + extension.runtime.bin.writeField(f, value, writer, writeOpt); + const reader = readOpt.readerFactory(writer.finish()); + while (reader.pos < reader.len) { + const [no, wireType] = reader.tag(); + const data = reader.skip(wireType, no); + message.getType().runtime.bin.onUnknownField(message, no, wireType, data); + } +} +exports.setExtension = setExtension; +/** + * Remove an extension value from a message. + * + * If the extension does not extend the given message, an error is raised. + */ +function clearExtension(message, extension) { + assertExtendee(extension, message); + if (hasExtension(message, extension)) { + const bin = message.getType().runtime.bin; + const ufs = bin + .listUnknownFields(message) + .filter((uf) => uf.no != extension.field.no); + bin.discardUnknownFields(message); + for (const uf of ufs) { + bin.onUnknownField(message, uf.no, uf.wireType, uf.data); + } + } +} +exports.clearExtension = clearExtension; +/** + * Check whether an extension is set on a message. + */ +function hasExtension(message, extension) { + const messageType = message.getType(); + return (extension.extendee.typeName === messageType.typeName && + !!messageType.runtime.bin + .listUnknownFields(message) + .find((uf) => uf.no == extension.field.no)); +} +exports.hasExtension = hasExtension; +function assertExtendee(extension, message) { + (0, assert_js_1.assert)(extension.extendee.typeName == message.getType().typeName, `extension ${extension.typeName} can only be applied to message ${extension.extendee.typeName}`); +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension.d.ts new file mode 100644 index 0000000..8b405e0 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension.d.ts @@ -0,0 +1,24 @@ +import type { FieldInfo } from "./field.js"; +import type { AnyMessage, Message } from "./message.js"; +import type { MessageType } from "./message-type.js"; +import type { ProtoRuntime } from "./private/proto-runtime.js"; +export interface Extension = AnyMessage, V = unknown> { + /** + * The fully qualified name of the extension. + */ + readonly typeName: string; + /** + * The message extended by this extension. + */ + readonly extendee: MessageType; + /** + * Field information for this extension. Note that required fields, maps, + * oneof are not allowed in extensions. Behavior of "localName" property is + * undefined and must not be relied upon. + */ + readonly field: FieldInfo; + /** + * Provides serialization and other functionality. + */ + readonly runtime: ProtoRuntime; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension.js new file mode 100644 index 0000000..d03a43b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/extension.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field-list.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field-list.d.ts new file mode 100644 index 0000000..bb5fafa --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field-list.d.ts @@ -0,0 +1,27 @@ +import type { FieldInfo, OneofInfo } from "./field.js"; +/** + * Provides convenient access to field information of a message type. + */ +export interface FieldList { + /** + * Find field information by field name or json_name. + */ + findJsonName(jsonName: string): FieldInfo | undefined; + /** + * Find field information by proto field number. + */ + find(fieldNo: number): FieldInfo | undefined; + /** + * Return field information in the order they appear in the source. + */ + list(): readonly FieldInfo[]; + /** + * Return field information ordered by field number ascending. + */ + byNumber(): readonly FieldInfo[]; + /** + * In order of appearance in the source, list fields and + * oneof groups. + */ + byMember(): readonly (FieldInfo | OneofInfo)[]; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field-list.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field-list.js new file mode 100644 index 0000000..d03a43b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field-list.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field.d.ts new file mode 100644 index 0000000..eb5b317 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field.d.ts @@ -0,0 +1,314 @@ +import type { EnumType } from "./enum.js"; +import type { MessageType } from "./message-type.js"; +import type { LongType, ScalarType } from "./scalar.js"; +/** + * FieldInfo describes a field of a protobuf message for runtime reflection. We + * distinguish between the following kinds of fields: + * + * - "scalar": string, bool, float, int32, etc. The scalar type is "T". + * - "enum": The field was declared with an enum type. The enum type is "T". + * - "message": The field was declared with a message type. The message type is "T". + * - "map": The field was declared with map. The key type is "K", the value type is "V". + * + * Every field always has the following properties: + * + * - "no": The field number of the protobuf field. + * - "name": The original name of the protobuf field. + * - "localName": The name of the field as used in generated code. + * - "jsonName": The name for JSON serialization / deserialization. + * - "opt": Whether the field is optional. + * - "req": Whether the field is required (a legacy proto2 feature). + * - "repeated": Whether the field is repeated. + * - "packed": Whether the repeated field is packed. + * + * Additionally, fields may have the following properties: + * + * - "oneof": If the field is member of a oneof group. + * - "default": Only proto2: An explicit default value. + * - "delimited": Only proto2: Use the tag-delimited group encoding. + */ +export type FieldInfo = fiRules | fiRules | fiRules | fiRules; +/** + * Version of `FieldInfo` that allows the following properties + * to be omitted: + * + * - "localName", "jsonName": can be omitted if equal to lowerCamelCase(name) + * - "opt": Can be omitted if false. + * - "repeated": Can be omitted if false. + * - "packed": Can be omitted if equal to the standard packing of the field. + */ +export type PartialFieldInfo = fiPartialRules | fiPartialRules | fiPartialRules | fiPartialRules; +/** + * Provides convenient access to field information of a oneof. + */ +export interface OneofInfo { + readonly kind: "oneof"; + readonly name: string; + readonly localName: string; + readonly repeated: false; + readonly packed: false; + readonly opt: false; + readonly req: false; + readonly default: undefined; + readonly delimited?: undefined; + readonly fields: readonly FieldInfo[]; + /** + * Return field information by local name. + */ + findField(localName: string): FieldInfo | undefined; +} +interface fiShared { + /** + * The field number of the .proto field. + */ + readonly no: number; + /** + * The original name of the .proto field. + */ + readonly name: string; + /** + * The name of the field as used in generated code. + */ + readonly localName: string; + /** + * The name for JSON serialization / deserialization. + */ + readonly jsonName: string; + /** + * The `oneof` group, if this field belongs to one. + */ + readonly oneof?: OneofInfo | undefined; +} +interface fiScalar extends fiShared { + readonly kind: "scalar"; + /** + * Scalar type of the field. + */ + readonly T: ScalarType; + /** + * JavaScript representation of 64 bit integral types (int64, uint64, + * sint64, fixed64, sfixed64). + * + * By default, this is LongType.BIGINT. Generated code will use the BigInt + * primitive. + * + * With LongType.STRING, generated code will use the String primitive instead. + * This can be specified per field with the option `[jstype = JS_STRING]`: + * + * ```protobuf + * uint64 field_a = 1; // BigInt + * uint64 field_b = 2 [jstype = JS_NORMAL]; // BigInt + * uint64 field_b = 2 [jstype = JS_NUMBER]; // BigInt + * uint64 field_b = 2 [jstype = JS_STRING]; // String + * ``` + * + * This property is ignored for other scalar types. + */ + readonly L: LongType; + /** + * Is the field repeated? + */ + readonly repeated: boolean; + /** + * Is this repeated field packed? + * BYTES and STRING can never be packed, since they are length-delimited. + * Other types can be packed with the field option "packed". + * For proto3, fields are packed by default. + */ + readonly packed: boolean; + /** + * Is the field optional? + */ + readonly opt: boolean; + /** + * Is the field required? A legacy proto2 feature. + */ + readonly req: boolean; + /** + * Only proto2: An explicit default value. + */ + readonly default: number | boolean | string | bigint | Uint8Array | undefined; + /** + * Serialize this message with the delimited format, also known as group + * encoding, as opposed to the standard length prefix. + * + * Only valid for message fields. + */ + readonly delimited?: undefined; +} +interface fiMessage extends fiShared { + readonly kind: "message"; + /** + * Message handler for the field. + */ + readonly T: MessageType; + /** + * Is the field repeated? + */ + readonly repeated: boolean; + /** + * Is this repeated field packed? Never true for messages. + */ + readonly packed: false; + /** + * Is the field required? A legacy proto2 feature. + */ + readonly req: boolean; + /** + * An explicit default value (only proto2). Never set for messages. + */ + readonly default: undefined; + /** + * Serialize this message with the delimited format, also known as group + * encoding, as opposed to the standard length prefix. + * + * Only valid for message fields. + */ + readonly delimited?: boolean; +} +interface fiEnum extends fiShared { + readonly kind: "enum"; + /** + * Enum type information for the field. + */ + readonly T: EnumType; + /** + * Is the field repeated? + */ + readonly repeated: boolean; + /** + * Is this repeated field packed? + * Repeated enums can be packed with the field option "packed". + * For proto3, they are packed by default. + */ + readonly packed: boolean; + /** + * Is the field optional? + */ + readonly opt: boolean; + /** + * Is the field required? A legacy proto2 feature. + */ + readonly req: boolean; + /** + * Only proto2: An explicit default value. + */ + readonly default: number | undefined; + /** + * Serialize this message with the delimited format, also known as group + * encoding, as opposed to the standard length prefix. + * + * Only valid for message fields. + */ + readonly delimited?: undefined; +} +interface fiMap extends fiShared { + readonly kind: "map"; + /** + * Map key type. + * + * The key_type can be any integral or string type + * (so, any scalar type except for floating point + * types and bytes) + */ + readonly K: Exclude; + /** + * Map value type. Can be scalar, enum, or message. + */ + readonly V: { + readonly kind: "scalar"; + readonly T: ScalarType; + } | { + readonly kind: "enum"; + readonly T: EnumType; + } | { + readonly kind: "message"; + readonly T: MessageType; + }; + /** + * Is the field repeated? Never true for maps. + */ + readonly repeated: false; + /** + * Is this repeated field packed? Never true for maps. + */ + readonly packed: false; + /** + * An explicit default value (only proto2). Never set for maps. + */ + readonly default: undefined; + /** + * Serialize this message with the delimited format, also known as group + * encoding, as opposed to the standard length prefix. + * + * Only valid for message fields. + */ + readonly delimited?: undefined; +} +type fiRules = Omit & ({ + readonly repeated: false; + readonly packed: false; + readonly opt: false; + readonly req: boolean; + readonly oneof: undefined; +} | { + readonly repeated: false; + readonly packed: false; + readonly opt: true; + readonly req: false; + readonly oneof: undefined; +} | { + readonly repeated: boolean; + readonly packed: boolean; + readonly opt: false; + readonly req: boolean; + readonly oneof: undefined; +} | { + readonly repeated: false; + readonly packed: false; + readonly opt: false; + readonly req: false; + readonly oneof: OneofInfo; +}); +type fiPartialRules = Omit & ({ + readonly jsonName?: string; + readonly repeated?: false; + readonly packed?: false; + readonly opt?: false; + readonly req?: boolean; + readonly oneof?: undefined; + default?: T["default"]; + L?: LongType; + delimited?: boolean; +} | { + readonly jsonName?: string; + readonly repeated?: false; + readonly packed?: false; + readonly opt: true; + readonly req?: false; + readonly oneof?: undefined; + default?: T["default"]; + L?: LongType; + delimited?: boolean; +} | { + readonly jsonName?: string; + readonly repeated?: boolean; + readonly packed?: boolean; + readonly opt?: false; + readonly req?: boolean; + readonly oneof?: undefined; + default?: T["default"]; + L?: LongType; + delimited?: boolean; +} | { + readonly jsonName?: string; + readonly repeated?: false; + readonly packed?: false; + readonly opt?: false; + readonly req?: false; + readonly oneof: string; + default?: T["default"]; + L?: LongType; + delimited?: boolean; +}); +export {}; diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field.js new file mode 100644 index 0000000..d03a43b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/field.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/any_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/any_pb.d.ts new file mode 100644 index 0000000..a825685 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/any_pb.d.ts @@ -0,0 +1,157 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { proto3 } from "../../proto3.js"; +import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js"; +import type { IMessageTypeRegistry } from "../../type-registry.js"; +import type { MessageType } from "../../message-type.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +/** + * `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" + * } + * + * + * @generated from message google.protobuf.Any + */ +export declare class Any extends Message { + /** + * 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. + * + * + * @generated from field: string type_url = 1; + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * @generated from field: bytes value = 2; + */ + value: Uint8Array; + constructor(data?: PartialMessage); + toJson(options?: Partial): JsonValue; + fromJson(json: JsonValue, options?: Partial): this; + packFrom(message: Message): void; + unpackTo(target: Message): boolean; + unpack(registry: IMessageTypeRegistry): Message | undefined; + is(type: MessageType | string): boolean; + private typeNameToUrl; + private typeUrlToName; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Any"; + static readonly fields: FieldList; + static pack(message: Message): Any; + static fromBinary(bytes: Uint8Array, options?: Partial): Any; + static fromJson(jsonValue: JsonValue, options?: Partial): Any; + static fromJsonString(jsonString: string, options?: Partial): Any; + static equals(a: Any | PlainMessage | undefined, b: Any | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/any_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/any_pb.js new file mode 100644 index 0000000..1c668a5 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/any_pb.js @@ -0,0 +1,273 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Any = void 0; +const message_js_1 = require("../../message.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * `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" + * } + * + * + * @generated from message google.protobuf.Any + */ +class Any extends message_js_1.Message { + constructor(data) { + super(); + /** + * 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. + * + * + * @generated from field: string type_url = 1; + */ + this.typeUrl = ""; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * @generated from field: bytes value = 2; + */ + this.value = new Uint8Array(0); + proto3_js_1.proto3.util.initPartial(data, this); + } + toJson(options) { + var _a; + if (this.typeUrl === "") { + return {}; + } + const typeName = this.typeUrlToName(this.typeUrl); + const messageType = (_a = options === null || options === void 0 ? void 0 : options.typeRegistry) === null || _a === void 0 ? void 0 : _a.findMessage(typeName); + if (!messageType) { + throw new Error(`cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`); + } + const message = messageType.fromBinary(this.value); + let json = message.toJson(options); + if (typeName.startsWith("google.protobuf.") || (json === null || Array.isArray(json) || typeof json !== "object")) { + json = { value: json }; + } + json["@type"] = this.typeUrl; + return json; + } + fromJson(json, options) { + var _a; + if (json === null || Array.isArray(json) || typeof json != "object") { + throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${json === null ? "null" : Array.isArray(json) ? "array" : typeof json}`); + } + if (Object.keys(json).length == 0) { + return this; + } + const typeUrl = json["@type"]; + if (typeof typeUrl != "string" || typeUrl == "") { + throw new Error(`cannot decode message google.protobuf.Any from JSON: "@type" is empty`); + } + const typeName = this.typeUrlToName(typeUrl), messageType = (_a = options === null || options === void 0 ? void 0 : options.typeRegistry) === null || _a === void 0 ? void 0 : _a.findMessage(typeName); + if (!messageType) { + throw new Error(`cannot decode message google.protobuf.Any from JSON: ${typeUrl} is not in the type registry`); + } + let message; + if (typeName.startsWith("google.protobuf.") && Object.prototype.hasOwnProperty.call(json, "value")) { + message = messageType.fromJson(json["value"], options); + } + else { + const copy = Object.assign({}, json); + delete copy["@type"]; + message = messageType.fromJson(copy, options); + } + this.packFrom(message); + return this; + } + packFrom(message) { + this.value = message.toBinary(); + this.typeUrl = this.typeNameToUrl(message.getType().typeName); + } + unpackTo(target) { + if (!this.is(target.getType())) { + return false; + } + target.fromBinary(this.value); + return true; + } + unpack(registry) { + if (this.typeUrl === "") { + return undefined; + } + const messageType = registry.findMessage(this.typeUrlToName(this.typeUrl)); + if (!messageType) { + return undefined; + } + return messageType.fromBinary(this.value); + } + is(type) { + if (this.typeUrl === '') { + return false; + } + const name = this.typeUrlToName(this.typeUrl); + let typeName = ''; + if (typeof type === 'string') { + typeName = type; + } + else { + typeName = type.typeName; + } + return name === typeName; + } + typeNameToUrl(name) { + return `type.googleapis.com/${name}`; + } + typeUrlToName(url) { + if (!url.length) { + throw new Error(`invalid type url: ${url}`); + } + const slash = url.lastIndexOf("/"); + const name = slash >= 0 ? url.substring(slash + 1) : url; + if (!name.length) { + throw new Error(`invalid type url: ${url}`); + } + return name; + } + static pack(message) { + const any = new Any(); + any.packFrom(message); + return any; + } + static fromBinary(bytes, options) { + return new Any().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Any().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Any().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Any, a, b); + } +} +exports.Any = Any; +Any.runtime = proto3_js_1.proto3; +Any.typeName = "google.protobuf.Any"; +Any.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/api_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/api_pb.d.ts new file mode 100644 index 0000000..93d3eac --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/api_pb.d.ts @@ -0,0 +1,256 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { Option, Syntax } from "./type_pb.js"; +import { SourceContext } from "./source_context_pb.js"; +import { proto3 } from "../../proto3.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +import type { JsonReadOptions, JsonValue } from "../../json-format.js"; +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * @generated from message google.protobuf.Api + */ +export declare class Api extends Message { + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The methods of this interface, in unspecified order. + * + * @generated from field: repeated google.protobuf.Method methods = 2; + */ + methods: Method[]; + /** + * Any metadata attached to the interface. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * @generated from field: string version = 4; + */ + version: string; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from field: repeated google.protobuf.Mixin mixins = 6; + */ + mixins: Mixin[]; + /** + * The source syntax of the service. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + syntax: Syntax; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Api"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Api; + static fromJson(jsonValue: JsonValue, options?: Partial): Api; + static fromJsonString(jsonString: string, options?: Partial): Api; + static equals(a: Api | PlainMessage | undefined, b: Api | PlainMessage | undefined): boolean; +} +/** + * Method represents a method of an API interface. + * + * @generated from message google.protobuf.Method + */ +export declare class Method extends Message { + /** + * The simple name of this method. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * A URL of the input message type. + * + * @generated from field: string request_type_url = 2; + */ + requestTypeUrl: string; + /** + * If true, the request is streamed. + * + * @generated from field: bool request_streaming = 3; + */ + requestStreaming: boolean; + /** + * The URL of the output message type. + * + * @generated from field: string response_type_url = 4; + */ + responseTypeUrl: string; + /** + * If true, the response is streamed. + * + * @generated from field: bool response_streaming = 5; + */ + responseStreaming: boolean; + /** + * Any metadata attached to the method. + * + * @generated from field: repeated google.protobuf.Option options = 6; + */ + options: Option[]; + /** + * The source syntax of this method. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + syntax: Syntax; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Method"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Method; + static fromJson(jsonValue: JsonValue, options?: Partial): Method; + static fromJsonString(jsonString: string, options?: Partial): Method; + static equals(a: Method | PlainMessage | undefined, b: Method | PlainMessage | undefined): boolean; +} +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from message google.protobuf.Mixin + */ +export declare class Mixin extends Message { + /** + * The fully qualified name of the interface which is included. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from field: string root = 2; + */ + root: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Mixin"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Mixin; + static fromJson(jsonValue: JsonValue, options?: Partial): Mixin; + static fromJsonString(jsonString: string, options?: Partial): Mixin; + static equals(a: Mixin | PlainMessage | undefined, b: Mixin | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/api_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/api_pb.js new file mode 100644 index 0000000..ef351b1 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/api_pb.js @@ -0,0 +1,316 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Mixin = exports.Method = exports.Api = void 0; +const message_js_1 = require("../../message.js"); +const type_pb_js_1 = require("./type_pb.js"); +const source_context_pb_js_1 = require("./source_context_pb.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * @generated from message google.protobuf.Api + */ +class Api extends message_js_1.Message { + constructor(data) { + super(); + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from field: string name = 1; + */ + this.name = ""; + /** + * The methods of this interface, in unspecified order. + * + * @generated from field: repeated google.protobuf.Method methods = 2; + */ + this.methods = []; + /** + * Any metadata attached to the interface. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + this.options = []; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * @generated from field: string version = 4; + */ + this.version = ""; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from field: repeated google.protobuf.Mixin mixins = 6; + */ + this.mixins = []; + /** + * The source syntax of the service. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + this.syntax = type_pb_js_1.Syntax.PROTO2; + proto3_js_1.proto3.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new Api().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Api().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Api().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Api, a, b); + } +} +exports.Api = Api; +Api.runtime = proto3_js_1.proto3; +Api.typeName = "google.protobuf.Api"; +Api.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "methods", kind: "message", T: Method, repeated: true }, + { no: 3, name: "options", kind: "message", T: type_pb_js_1.Option, repeated: true }, + { no: 4, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "source_context", kind: "message", T: source_context_pb_js_1.SourceContext }, + { no: 6, name: "mixins", kind: "message", T: Mixin, repeated: true }, + { no: 7, name: "syntax", kind: "enum", T: proto3_js_1.proto3.getEnumType(type_pb_js_1.Syntax) }, +]); +/** + * Method represents a method of an API interface. + * + * @generated from message google.protobuf.Method + */ +class Method extends message_js_1.Message { + constructor(data) { + super(); + /** + * The simple name of this method. + * + * @generated from field: string name = 1; + */ + this.name = ""; + /** + * A URL of the input message type. + * + * @generated from field: string request_type_url = 2; + */ + this.requestTypeUrl = ""; + /** + * If true, the request is streamed. + * + * @generated from field: bool request_streaming = 3; + */ + this.requestStreaming = false; + /** + * The URL of the output message type. + * + * @generated from field: string response_type_url = 4; + */ + this.responseTypeUrl = ""; + /** + * If true, the response is streamed. + * + * @generated from field: bool response_streaming = 5; + */ + this.responseStreaming = false; + /** + * Any metadata attached to the method. + * + * @generated from field: repeated google.protobuf.Option options = 6; + */ + this.options = []; + /** + * The source syntax of this method. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + this.syntax = type_pb_js_1.Syntax.PROTO2; + proto3_js_1.proto3.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new Method().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Method().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Method().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Method, a, b); + } +} +exports.Method = Method; +Method.runtime = proto3_js_1.proto3; +Method.typeName = "google.protobuf.Method"; +Method.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "request_type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "request_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "response_type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "response_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "options", kind: "message", T: type_pb_js_1.Option, repeated: true }, + { no: 7, name: "syntax", kind: "enum", T: proto3_js_1.proto3.getEnumType(type_pb_js_1.Syntax) }, +]); +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from message google.protobuf.Mixin + */ +class Mixin extends message_js_1.Message { + constructor(data) { + super(); + /** + * The fully qualified name of the interface which is included. + * + * @generated from field: string name = 1; + */ + this.name = ""; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from field: string root = 2; + */ + this.root = ""; + proto3_js_1.proto3.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new Mixin().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Mixin().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Mixin().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Mixin, a, b); + } +} +exports.Mixin = Mixin; +Mixin.runtime = proto3_js_1.proto3; +Mixin.typeName = "google.protobuf.Mixin"; +Mixin.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "root", kind: "scalar", T: 9 /* ScalarType.STRING */ }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/compiler/plugin_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/compiler/plugin_pb.d.ts new file mode 100644 index 0000000..fac4656 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/compiler/plugin_pb.d.ts @@ -0,0 +1,271 @@ +import type { PartialMessage, PlainMessage } from "../../../message.js"; +import { Message } from "../../../message.js"; +import { proto2 } from "../../../proto2.js"; +import type { FieldList } from "../../../field-list.js"; +import type { BinaryReadOptions } from "../../../binary-format.js"; +import type { JsonReadOptions, JsonValue } from "../../../json-format.js"; +import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor_pb.js"; +/** + * The version number of protocol compiler. + * + * @generated from message google.protobuf.compiler.Version + */ +export declare class Version extends Message { + /** + * @generated from field: optional int32 major = 1; + */ + major?: number; + /** + * @generated from field: optional int32 minor = 2; + */ + minor?: number; + /** + * @generated from field: optional int32 patch = 3; + */ + patch?: number; + /** + * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + * be empty for mainline stable releases. + * + * @generated from field: optional string suffix = 4; + */ + suffix?: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.compiler.Version"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Version; + static fromJson(jsonValue: JsonValue, options?: Partial): Version; + static fromJsonString(jsonString: string, options?: Partial): Version; + static equals(a: Version | PlainMessage | undefined, b: Version | PlainMessage | undefined): boolean; +} +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from message google.protobuf.compiler.CodeGeneratorRequest + */ +export declare class CodeGeneratorRequest extends Message { + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from field: repeated string file_to_generate = 1; + */ + fileToGenerate: string[]; + /** + * The generator parameter passed on the command-line. + * + * @generated from field: optional string parameter = 2; + */ + parameter?: string; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * Note: the files listed in files_to_generate will include runtime-retention + * options only, but all other files will include source-retention options. + * The source_file_descriptors field below is available in case you need + * source-retention options for files_to_generate. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + protoFile: FileDescriptorProto[]; + /** + * File descriptors with all options, including source-retention options. + * These descriptors are only provided for the files listed in + * files_to_generate. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; + */ + sourceFileDescriptors: FileDescriptorProto[]; + /** + * The version number of protocol compiler. + * + * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; + */ + compilerVersion?: Version; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.compiler.CodeGeneratorRequest"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): CodeGeneratorRequest; + static fromJson(jsonValue: JsonValue, options?: Partial): CodeGeneratorRequest; + static fromJsonString(jsonString: string, options?: Partial): CodeGeneratorRequest; + static equals(a: CodeGeneratorRequest | PlainMessage | undefined, b: CodeGeneratorRequest | PlainMessage | undefined): boolean; +} +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse + */ +export declare class CodeGeneratorResponse extends Message { + /** + * Error message. If non-empty, code generation failed. The plugin process + * should exit with status code zero even if it reports an error in this way. + * + * This should be used to indicate errors in .proto files which prevent the + * code generator from generating correct code. Errors which indicate a + * problem in protoc itself -- such as the input CodeGeneratorRequest being + * unparseable -- should be reported by writing a message to stderr and + * exiting with a non-zero status code. + * + * @generated from field: optional string error = 1; + */ + error?: string; + /** + * A bitmask of supported features that the code generator supports. + * This is a bitwise "or" of values from the Feature enum. + * + * @generated from field: optional uint64 supported_features = 2; + */ + supportedFeatures?: bigint; + /** + * The minimum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 minimum_edition = 3; + */ + minimumEdition?: number; + /** + * The maximum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 maximum_edition = 4; + */ + maximumEdition?: number; + /** + * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + file: CodeGeneratorResponse_File[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.compiler.CodeGeneratorResponse"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): CodeGeneratorResponse; + static fromJson(jsonValue: JsonValue, options?: Partial): CodeGeneratorResponse; + static fromJsonString(jsonString: string, options?: Partial): CodeGeneratorResponse; + static equals(a: CodeGeneratorResponse | PlainMessage | undefined, b: CodeGeneratorResponse | PlainMessage | undefined): boolean; +} +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +export declare enum CodeGeneratorResponse_Feature { + /** + * @generated from enum value: FEATURE_NONE = 0; + */ + NONE = 0, + /** + * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; + */ + PROTO3_OPTIONAL = 1, + /** + * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; + */ + SUPPORTS_EDITIONS = 2 +} +/** + * Represents a single generated file. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File + */ +export declare class CodeGeneratorResponse_File extends Message { + /** + * The file name, relative to the output directory. The name must not + * contain "." or ".." components and must be relative, not be absolute (so, + * the file cannot lie outside the output directory). "/" must be used as + * the path separator, not "\". + * + * If the name is omitted, the content will be appended to the previous + * file. This allows the generator to break large files into small chunks, + * and allows the generated text to be streamed back to protoc so that large + * files need not reside completely in memory at one time. Note that as of + * this writing protoc does not optimize for this -- it will read the entire + * CodeGeneratorResponse before writing files to disk. + * + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * If non-empty, indicates that the named file should already exist, and the + * content here is to be inserted into that file at a defined insertion + * point. This feature allows a code generator to extend the output + * produced by another code generator. The original generator may provide + * insertion points by placing special annotations in the file that look + * like: + * @@protoc_insertion_point(NAME) + * The annotation can have arbitrary text before and after it on the line, + * which allows it to be placed in a comment. NAME should be replaced with + * an identifier naming the point -- this is what other generators will use + * as the insertion_point. Code inserted at this point will be placed + * immediately above the line containing the insertion point (thus multiple + * insertions to the same point will come out in the order they were added). + * The double-@ is intended to make it unlikely that the generated code + * could contain things that look like insertion points by accident. + * + * For example, the C++ code generator places the following line in the + * .pb.h files that it generates: + * // @@protoc_insertion_point(namespace_scope) + * This line appears within the scope of the file's package namespace, but + * outside of any particular class. Another plugin can then specify the + * insertion_point "namespace_scope" to generate additional classes or + * other declarations that should be placed in this scope. + * + * Note that if the line containing the insertion point begins with + * whitespace, the same whitespace will be added to every line of the + * inserted text. This is useful for languages like Python, where + * indentation matters. In these languages, the insertion point comment + * should be indented the same amount as any inserted code will need to be + * in order to work correctly in that context. + * + * The code generator that generates the initial file and the one which + * inserts into it must both run as part of a single invocation of protoc. + * Code generators are executed in the order in which they appear on the + * command line. + * + * If |insertion_point| is present, |name| must also be present. + * + * @generated from field: optional string insertion_point = 2; + */ + insertionPoint?: string; + /** + * The file contents. + * + * @generated from field: optional string content = 15; + */ + content?: string; + /** + * Information describing the file content being inserted. If an insertion + * point is used, this information will be appropriately offset and inserted + * into the code generation metadata for the generated files. + * + * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; + */ + generatedCodeInfo?: GeneratedCodeInfo; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.compiler.CodeGeneratorResponse.File"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): CodeGeneratorResponse_File; + static fromJson(jsonValue: JsonValue, options?: Partial): CodeGeneratorResponse_File; + static fromJsonString(jsonString: string, options?: Partial): CodeGeneratorResponse_File; + static equals(a: CodeGeneratorResponse_File | PlainMessage | undefined, b: CodeGeneratorResponse_File | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/compiler/plugin_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/compiler/plugin_pb.js new file mode 100644 index 0000000..6a8f345 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/compiler/plugin_pb.js @@ -0,0 +1,219 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGeneratorResponse_File = exports.CodeGeneratorResponse_Feature = exports.CodeGeneratorResponse = exports.CodeGeneratorRequest = exports.Version = void 0; +const message_js_1 = require("../../../message.js"); +const proto2_js_1 = require("../../../proto2.js"); +const descriptor_pb_js_1 = require("../descriptor_pb.js"); +/** + * The version number of protocol compiler. + * + * @generated from message google.protobuf.compiler.Version + */ +class Version extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new Version().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Version().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Version().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(Version, a, b); + } +} +exports.Version = Version; +Version.runtime = proto2_js_1.proto2; +Version.typeName = "google.protobuf.compiler.Version"; +Version.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "major", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 2, name: "minor", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 3, name: "patch", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 4, name: "suffix", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, +]); +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from message google.protobuf.compiler.CodeGeneratorRequest + */ +class CodeGeneratorRequest extends message_js_1.Message { + constructor(data) { + super(); + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from field: repeated string file_to_generate = 1; + */ + this.fileToGenerate = []; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * Note: the files listed in files_to_generate will include runtime-retention + * options only, but all other files will include source-retention options. + * The source_file_descriptors field below is available in case you need + * source-retention options for files_to_generate. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + this.protoFile = []; + /** + * File descriptors with all options, including source-retention options. + * These descriptors are only provided for the files listed in + * files_to_generate. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; + */ + this.sourceFileDescriptors = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new CodeGeneratorRequest().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new CodeGeneratorRequest().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new CodeGeneratorRequest().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(CodeGeneratorRequest, a, b); + } +} +exports.CodeGeneratorRequest = CodeGeneratorRequest; +CodeGeneratorRequest.runtime = proto2_js_1.proto2; +CodeGeneratorRequest.typeName = "google.protobuf.compiler.CodeGeneratorRequest"; +CodeGeneratorRequest.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "file_to_generate", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "parameter", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 15, name: "proto_file", kind: "message", T: descriptor_pb_js_1.FileDescriptorProto, repeated: true }, + { no: 17, name: "source_file_descriptors", kind: "message", T: descriptor_pb_js_1.FileDescriptorProto, repeated: true }, + { no: 3, name: "compiler_version", kind: "message", T: Version, opt: true }, +]); +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse + */ +class CodeGeneratorResponse extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + this.file = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new CodeGeneratorResponse().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new CodeGeneratorResponse().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new CodeGeneratorResponse().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(CodeGeneratorResponse, a, b); + } +} +exports.CodeGeneratorResponse = CodeGeneratorResponse; +CodeGeneratorResponse.runtime = proto2_js_1.proto2; +CodeGeneratorResponse.typeName = "google.protobuf.compiler.CodeGeneratorResponse"; +CodeGeneratorResponse.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "supported_features", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 3, name: "minimum_edition", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 4, name: "maximum_edition", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 15, name: "file", kind: "message", T: CodeGeneratorResponse_File, repeated: true }, +]); +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +var CodeGeneratorResponse_Feature; +(function (CodeGeneratorResponse_Feature) { + /** + * @generated from enum value: FEATURE_NONE = 0; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["NONE"] = 0] = "NONE"; + /** + * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["PROTO3_OPTIONAL"] = 1] = "PROTO3_OPTIONAL"; + /** + * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["SUPPORTS_EDITIONS"] = 2] = "SUPPORTS_EDITIONS"; +})(CodeGeneratorResponse_Feature || (exports.CodeGeneratorResponse_Feature = CodeGeneratorResponse_Feature = {})); +// Retrieve enum metadata with: proto2.getEnumType(CodeGeneratorResponse_Feature) +proto2_js_1.proto2.util.setEnumType(CodeGeneratorResponse_Feature, "google.protobuf.compiler.CodeGeneratorResponse.Feature", [ + { no: 0, name: "FEATURE_NONE" }, + { no: 1, name: "FEATURE_PROTO3_OPTIONAL" }, + { no: 2, name: "FEATURE_SUPPORTS_EDITIONS" }, +]); +/** + * Represents a single generated file. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File + */ +class CodeGeneratorResponse_File extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new CodeGeneratorResponse_File().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new CodeGeneratorResponse_File().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new CodeGeneratorResponse_File().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(CodeGeneratorResponse_File, a, b); + } +} +exports.CodeGeneratorResponse_File = CodeGeneratorResponse_File; +CodeGeneratorResponse_File.runtime = proto2_js_1.proto2; +CodeGeneratorResponse_File.typeName = "google.protobuf.compiler.CodeGeneratorResponse.File"; +CodeGeneratorResponse_File.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "insertion_point", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 15, name: "content", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 16, name: "generated_code_info", kind: "message", T: descriptor_pb_js_1.GeneratedCodeInfo, opt: true }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/descriptor_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/descriptor_pb.d.ts new file mode 100644 index 0000000..2611043 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/descriptor_pb.d.ts @@ -0,0 +1,2277 @@ +import { proto2 } from "../../proto2.js"; +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +import type { JsonReadOptions, JsonValue } from "../../json-format.js"; +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +export declare enum Edition { + /** + * A placeholder for an unknown edition value. + * + * @generated from enum value: EDITION_UNKNOWN = 0; + */ + EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** + * 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. + * + * @generated from enum value: EDITION_PROTO2 = 998; + */ + EDITION_PROTO2 = 998, + /** + * @generated from enum value: EDITION_PROTO3 = 999; + */ + EDITION_PROTO3 = 999, + /** + * 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. + * + * @generated from enum value: EDITION_2023 = 1000; + */ + EDITION_2023 = 1000, + /** + * @generated from enum value: EDITION_2024 = 1001; + */ + EDITION_2024 = 1001, + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relyed on outside of tests. + * + * @generated from enum value: EDITION_1_TEST_ONLY = 1; + */ + EDITION_1_TEST_ONLY = 1, + /** + * @generated from enum value: EDITION_2_TEST_ONLY = 2; + */ + EDITION_2_TEST_ONLY = 2, + /** + * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; + */ + EDITION_99997_TEST_ONLY = 99997, + /** + * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; + */ + EDITION_99998_TEST_ONLY = 99998, + /** + * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; + */ + EDITION_99999_TEST_ONLY = 99999, + /** + * 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. + * + * @generated from enum value: EDITION_MAX = 2147483647; + */ + EDITION_MAX = 2147483647 +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from message google.protobuf.FileDescriptorSet + */ +export declare class FileDescriptorSet extends Message { + /** + * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file: FileDescriptorProto[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FileDescriptorSet"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FileDescriptorSet; + static fromJson(jsonValue: JsonValue, options?: Partial): FileDescriptorSet; + static fromJsonString(jsonString: string, options?: Partial): FileDescriptorSet; + static equals(a: FileDescriptorSet | PlainMessage | undefined, b: FileDescriptorSet | PlainMessage | undefined): boolean; +} +/** + * Describes a complete .proto file. + * + * @generated from message google.protobuf.FileDescriptorProto + */ +export declare class FileDescriptorProto extends Message { + /** + * file name, relative to root of source tree + * + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * e.g. "foo", "foo.bar", etc. + * + * @generated from field: optional string package = 2; + */ + package?: string; + /** + * Names of files imported by this file. + * + * @generated from field: repeated string dependency = 3; + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from field: repeated int32 public_dependency = 10; + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from field: repeated int32 weak_dependency = 11; + */ + weakDependency: number[]; + /** + * All top-level definitions in this file. + * + * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType: DescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service: ServiceDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptions; + /** + * 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. + * + * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * + * @generated from field: optional string syntax = 12; + */ + syntax?: string; + /** + * The edition of the proto file. + * + * @generated from field: optional google.protobuf.Edition edition = 14; + */ + edition?: Edition; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FileDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FileDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): FileDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): FileDescriptorProto; + static equals(a: FileDescriptorProto | PlainMessage | undefined, b: FileDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * Describes a message type. + * + * @generated from message google.protobuf.DescriptorProto + */ +export declare class DescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field: FieldDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType: DescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange: DescriptorProto_ExtensionRange[]; + /** + * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl: OneofDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptions; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + 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. + * + * @generated from field: repeated string reserved_name = 10; + */ + reservedName: string[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.DescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): DescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): DescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): DescriptorProto; + static equals(a: DescriptorProto | PlainMessage | undefined, b: DescriptorProto | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.DescriptorProto.ExtensionRange + */ +export declare class DescriptorProto_ExtensionRange extends Message { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; + /** + * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptions; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.DescriptorProto.ExtensionRange"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): DescriptorProto_ExtensionRange; + static fromJson(jsonValue: JsonValue, options?: Partial): DescriptorProto_ExtensionRange; + static fromJsonString(jsonString: string, options?: Partial): DescriptorProto_ExtensionRange; + static equals(a: DescriptorProto_ExtensionRange | PlainMessage | undefined, b: DescriptorProto_ExtensionRange | PlainMessage | undefined): boolean; +} +/** + * 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. + * + * @generated from message google.protobuf.DescriptorProto.ReservedRange + */ +export declare class DescriptorProto_ReservedRange extends Message { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.DescriptorProto.ReservedRange"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): DescriptorProto_ReservedRange; + static fromJson(jsonValue: JsonValue, options?: Partial): DescriptorProto_ReservedRange; + static fromJsonString(jsonString: string, options?: Partial): DescriptorProto_ReservedRange; + static equals(a: DescriptorProto_ReservedRange | PlainMessage | undefined, b: DescriptorProto_ReservedRange | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.ExtensionRangeOptions + */ +export declare class ExtensionRangeOptions extends Message { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + 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. + * + * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; + */ + verification?: ExtensionRangeOptions_VerificationState; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.ExtensionRangeOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): ExtensionRangeOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): ExtensionRangeOptions; + static fromJsonString(jsonString: string, options?: Partial): ExtensionRangeOptions; + static equals(a: ExtensionRangeOptions | PlainMessage | undefined, b: ExtensionRangeOptions | PlainMessage | undefined): boolean; +} +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export declare enum ExtensionRangeOptions_VerificationState { + /** + * All the extensions of the range must be declared. + * + * @generated from enum value: DECLARATION = 0; + */ + DECLARATION = 0, + /** + * @generated from enum value: UNVERIFIED = 1; + */ + UNVERIFIED = 1 +} +/** + * @generated from message google.protobuf.ExtensionRangeOptions.Declaration + */ +export declare class ExtensionRangeOptions_Declaration extends Message { + /** + * The extension number declared within the extension range. + * + * @generated from field: optional int32 number = 1; + */ + number?: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * @generated from field: optional string full_name = 2; + */ + fullName?: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * @generated from field: optional string type = 3; + */ + type?: string; + /** + * 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. + * + * @generated from field: optional bool reserved = 5; + */ + reserved?: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * @generated from field: optional bool repeated = 6; + */ + repeated?: boolean; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.ExtensionRangeOptions.Declaration"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): ExtensionRangeOptions_Declaration; + static fromJson(jsonValue: JsonValue, options?: Partial): ExtensionRangeOptions_Declaration; + static fromJsonString(jsonString: string, options?: Partial): ExtensionRangeOptions_Declaration; + static equals(a: ExtensionRangeOptions_Declaration | PlainMessage | undefined, b: ExtensionRangeOptions_Declaration | PlainMessage | undefined): boolean; +} +/** + * Describes a field within a message. + * + * @generated from message google.protobuf.FieldDescriptorProto + */ +export declare class FieldDescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional int32 number = 3; + */ + number?: number; + /** + * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label?: FieldDescriptorProto_Label; + /** + * 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. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type?: FieldDescriptorProto_Type; + /** + * 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). + * + * @generated from field: optional string type_name = 6; + */ + typeName?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from field: optional string extendee = 2; + */ + extendee?: string; + /** + * 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. + * + * @generated from field: optional string default_value = 7; + */ + defaultValue?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from field: optional int32 oneof_index = 9; + */ + oneofIndex?: number; + /** + * 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. + * + * @generated from field: optional string json_name = 10; + */ + jsonName?: string; + /** + * @generated from field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptions; + /** + * 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`. + * + * @generated from field: optional bool proto3_optional = 17; + */ + proto3Optional?: boolean; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FieldDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FieldDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): FieldDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): FieldDescriptorProto; + static equals(a: FieldDescriptorProto | PlainMessage | undefined, b: FieldDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +export declare enum FieldDescriptorProto_Type { + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + DOUBLE = 1, + /** + * @generated from enum value: TYPE_FLOAT = 2; + */ + FLOAT = 2, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + INT64 = 3, + /** + * @generated from enum value: TYPE_UINT64 = 4; + */ + UINT64 = 4, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + INT32 = 5, + /** + * @generated from enum value: TYPE_FIXED64 = 6; + */ + FIXED64 = 6, + /** + * @generated from enum value: TYPE_FIXED32 = 7; + */ + FIXED32 = 7, + /** + * @generated from enum value: TYPE_BOOL = 8; + */ + BOOL = 8, + /** + * @generated from enum value: TYPE_STRING = 9; + */ + STRING = 9, + /** + * 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. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + GROUP = 10, + /** + * Length-delimited aggregate. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + MESSAGE = 11, + /** + * New in version 2. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + BYTES = 12, + /** + * @generated from enum value: TYPE_UINT32 = 13; + */ + UINT32 = 13, + /** + * @generated from enum value: TYPE_ENUM = 14; + */ + ENUM = 14, + /** + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + SFIXED32 = 15, + /** + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + SFIXED64 = 16, + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + SINT32 = 17, + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + SINT64 = 18 +} +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +export declare enum FieldDescriptorProto_Label { + /** + * 0 is reserved for errors + * + * @generated from enum value: LABEL_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * @generated from enum value: LABEL_REPEATED = 3; + */ + REPEATED = 3, + /** + * 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. + * + * @generated from enum value: LABEL_REQUIRED = 2; + */ + REQUIRED = 2 +} +/** + * Describes a oneof. + * + * @generated from message google.protobuf.OneofDescriptorProto + */ +export declare class OneofDescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptions; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.OneofDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): OneofDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): OneofDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): OneofDescriptorProto; + static equals(a: OneofDescriptorProto | PlainMessage | undefined, b: OneofDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * Describes an enum type. + * + * @generated from message google.protobuf.EnumDescriptorProto + */ +export declare class EnumDescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value: EnumValueDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptions; + /** + * 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. + * + * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from field: repeated string reserved_name = 5; + */ + reservedName: string[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.EnumDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): EnumDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): EnumDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): EnumDescriptorProto; + static equals(a: EnumDescriptorProto | PlainMessage | undefined, b: EnumDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * 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. + * + * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export declare class EnumDescriptorProto_EnumReservedRange extends Message { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Inclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.EnumDescriptorProto.EnumReservedRange"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): EnumDescriptorProto_EnumReservedRange; + static fromJson(jsonValue: JsonValue, options?: Partial): EnumDescriptorProto_EnumReservedRange; + static fromJsonString(jsonString: string, options?: Partial): EnumDescriptorProto_EnumReservedRange; + static equals(a: EnumDescriptorProto_EnumReservedRange | PlainMessage | undefined, b: EnumDescriptorProto_EnumReservedRange | PlainMessage | undefined): boolean; +} +/** + * Describes a value within an enum. + * + * @generated from message google.protobuf.EnumValueDescriptorProto + */ +export declare class EnumValueDescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional int32 number = 2; + */ + number?: number; + /** + * @generated from field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptions; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.EnumValueDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): EnumValueDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): EnumValueDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): EnumValueDescriptorProto; + static equals(a: EnumValueDescriptorProto | PlainMessage | undefined, b: EnumValueDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * Describes a service. + * + * @generated from message google.protobuf.ServiceDescriptorProto + */ +export declare class ServiceDescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method: MethodDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptions; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.ServiceDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): ServiceDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): ServiceDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): ServiceDescriptorProto; + static equals(a: ServiceDescriptorProto | PlainMessage | undefined, b: ServiceDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * Describes a method of a service. + * + * @generated from message google.protobuf.MethodDescriptorProto + */ +export declare class MethodDescriptorProto extends Message { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from field: optional string input_type = 2; + */ + inputType?: string; + /** + * @generated from field: optional string output_type = 3; + */ + outputType?: string; + /** + * @generated from field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptions; + /** + * Identifies if client streams multiple client messages + * + * @generated from field: optional bool client_streaming = 5 [default = false]; + */ + clientStreaming?: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from field: optional bool server_streaming = 6 [default = false]; + */ + serverStreaming?: boolean; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.MethodDescriptorProto"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): MethodDescriptorProto; + static fromJson(jsonValue: JsonValue, options?: Partial): MethodDescriptorProto; + static fromJsonString(jsonString: string, options?: Partial): MethodDescriptorProto; + static equals(a: MethodDescriptorProto | PlainMessage | undefined, b: MethodDescriptorProto | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.FileOptions + */ +export declare class FileOptions extends Message { + /** + * 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. + * + * @generated from field: optional string java_package = 1; + */ + javaPackage?: string; + /** + * 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. + * + * @generated from field: optional string java_outer_classname = 8; + */ + javaOuterClassname?: string; + /** + * 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. + * + * @generated from field: optional bool java_multiple_files = 10 [default = false]; + */ + javaMultipleFiles?: boolean; + /** + * This option does nothing. + * + * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + javaGenerateEqualsAndHash?: boolean; + /** + * 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. + * + * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; + */ + javaStringCheckUtf8?: boolean; + /** + * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + optimizeFor?: FileOptions_OptimizeMode; + /** + * 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. + * + * @generated from field: optional string go_package = 11; + */ + goPackage?: string; + /** + * 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. + * + * @generated from field: optional bool cc_generic_services = 16 [default = false]; + */ + ccGenericServices?: boolean; + /** + * @generated from field: optional bool java_generic_services = 17 [default = false]; + */ + javaGenericServices?: boolean; + /** + * @generated from field: optional bool py_generic_services = 18 [default = false]; + */ + pyGenericServices?: boolean; + /** + * 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. + * + * @generated from field: optional bool deprecated = 23 [default = false]; + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; + */ + ccEnableArenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from field: optional string objc_class_prefix = 36; + */ + objcClassPrefix?: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from field: optional string csharp_namespace = 37; + */ + csharpNamespace?: string; + /** + * 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. + * + * @generated from field: optional string swift_prefix = 39; + */ + swiftPrefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from field: optional string php_class_prefix = 40; + */ + phpClassPrefix?: string; + /** + * 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. + * + * @generated from field: optional string php_namespace = 41; + */ + phpNamespace?: string; + /** + * 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. + * + * @generated from field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace?: string; + /** + * 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. + * + * @generated from field: optional string ruby_package = 45; + */ + rubyPackage?: string; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FileOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FileOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): FileOptions; + static fromJsonString(jsonString: string, options?: Partial): FileOptions; + static equals(a: FileOptions | PlainMessage | undefined, b: FileOptions | PlainMessage | undefined): boolean; +} +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +export declare enum FileOptions_OptimizeMode { + /** + * Generate complete code for parsing, serialization, + * + * @generated from enum value: SPEED = 1; + */ + SPEED = 1, + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2, + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from enum value: LITE_RUNTIME = 3; + */ + LITE_RUNTIME = 3 +} +/** + * @generated from message google.protobuf.MessageOptions + */ +export declare class MessageOptions extends Message { + /** + * 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. + * + * @generated from field: optional bool message_set_wire_format = 1 [default = false]; + */ + messageSetWireFormat?: boolean; + /** + * 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". + * + * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + noStandardDescriptorAccessor?: boolean; + /** + * 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. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * 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. + * + * @generated from field: optional bool map_entry = 7; + */ + mapEntry?: boolean; + /** + * 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. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 12; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.MessageOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): MessageOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): MessageOptions; + static fromJsonString(jsonString: string, options?: Partial): MessageOptions; + static equals(a: MessageOptions | PlainMessage | undefined, b: MessageOptions | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.FieldOptions + */ +export declare class FieldOptions extends Message { + /** + * 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 -- sorry, we'll try to include + * other types in a future version! + * + * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + ctype?: FieldOptions_CType; + /** + * 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. + * + * @generated from field: optional bool packed = 2; + */ + packed?: boolean; + /** + * 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. + * + * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + jstype?: FieldOptions_JSType; + /** + * 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). + * + * @generated from field: optional bool lazy = 5 [default = false]; + */ + lazy?: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from field: optional bool unverified_lazy = 15 [default = false]; + */ + unverifiedLazy?: boolean; + /** + * 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. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * For Google-internal migration only. Do not use. + * + * @generated from field: optional bool weak = 10 [default = false]; + */ + weak?: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from field: optional bool debug_redact = 16 [default = false]; + */ + debugRedact?: boolean; + /** + * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention?: FieldOptions_OptionRetention; + /** + * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + targets: FieldOptions_OptionTargetType[]; + /** + * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 21; + */ + features?: FeatureSet; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FieldOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FieldOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): FieldOptions; + static fromJsonString(jsonString: string, options?: Partial): FieldOptions; + static equals(a: FieldOptions | PlainMessage | undefined, b: FieldOptions | PlainMessage | undefined): boolean; +} +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +export declare enum FieldOptions_CType { + /** + * Default mode. + * + * @generated from enum value: STRING = 0; + */ + STRING = 0, + /** + * 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. + * + * @generated from enum value: CORD = 1; + */ + CORD = 1, + /** + * @generated from enum value: STRING_PIECE = 2; + */ + STRING_PIECE = 2 +} +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +export declare enum FieldOptions_JSType { + /** + * Use the default type. + * + * @generated from enum value: JS_NORMAL = 0; + */ + JS_NORMAL = 0, + /** + * Use JavaScript strings. + * + * @generated from enum value: JS_STRING = 1; + */ + JS_STRING = 1, + /** + * Use JavaScript numbers. + * + * @generated from enum value: JS_NUMBER = 2; + */ + JS_NUMBER = 2 +} +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +export declare enum FieldOptions_OptionRetention { + /** + * @generated from enum value: RETENTION_UNKNOWN = 0; + */ + RETENTION_UNKNOWN = 0, + /** + * @generated from enum value: RETENTION_RUNTIME = 1; + */ + RETENTION_RUNTIME = 1, + /** + * @generated from enum value: RETENTION_SOURCE = 2; + */ + RETENTION_SOURCE = 2 +} +/** + * 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. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +export declare enum FieldOptions_OptionTargetType { + /** + * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; + */ + TARGET_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: TARGET_TYPE_FILE = 1; + */ + TARGET_TYPE_FILE = 1, + /** + * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + TARGET_TYPE_EXTENSION_RANGE = 2, + /** + * @generated from enum value: TARGET_TYPE_MESSAGE = 3; + */ + TARGET_TYPE_MESSAGE = 3, + /** + * @generated from enum value: TARGET_TYPE_FIELD = 4; + */ + TARGET_TYPE_FIELD = 4, + /** + * @generated from enum value: TARGET_TYPE_ONEOF = 5; + */ + TARGET_TYPE_ONEOF = 5, + /** + * @generated from enum value: TARGET_TYPE_ENUM = 6; + */ + TARGET_TYPE_ENUM = 6, + /** + * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + TARGET_TYPE_ENUM_ENTRY = 7, + /** + * @generated from enum value: TARGET_TYPE_SERVICE = 8; + */ + TARGET_TYPE_SERVICE = 8, + /** + * @generated from enum value: TARGET_TYPE_METHOD = 9; + */ + TARGET_TYPE_METHOD = 9 +} +/** + * @generated from message google.protobuf.FieldOptions.EditionDefault + */ +export declare class FieldOptions_EditionDefault extends Message { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition?: Edition; + /** + * Textproto value. + * + * @generated from field: optional string value = 2; + */ + value?: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FieldOptions.EditionDefault"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FieldOptions_EditionDefault; + static fromJson(jsonValue: JsonValue, options?: Partial): FieldOptions_EditionDefault; + static fromJsonString(jsonString: string, options?: Partial): FieldOptions_EditionDefault; + static equals(a: FieldOptions_EditionDefault | PlainMessage | undefined, b: FieldOptions_EditionDefault | PlainMessage | undefined): boolean; +} +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export declare class FieldOptions_FeatureSupport extends Message { + /** + * 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. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + /** + * 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. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: Edition; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FieldOptions.FeatureSupport"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FieldOptions_FeatureSupport; + static fromJson(jsonValue: JsonValue, options?: Partial): FieldOptions_FeatureSupport; + static fromJsonString(jsonString: string, options?: Partial): FieldOptions_FeatureSupport; + static equals(a: FieldOptions_FeatureSupport | PlainMessage | undefined, b: FieldOptions_FeatureSupport | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.OneofOptions + */ +export declare class OneofOptions extends Message { + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 1; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.OneofOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): OneofOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): OneofOptions; + static fromJsonString(jsonString: string, options?: Partial): OneofOptions; + static equals(a: OneofOptions | PlainMessage | undefined, b: OneofOptions | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.EnumOptions + */ +export declare class EnumOptions extends Message { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from field: optional bool allow_alias = 2; + */ + allowAlias?: boolean; + /** + * 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. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * 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. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 7; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.EnumOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): EnumOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): EnumOptions; + static fromJsonString(jsonString: string, options?: Partial): EnumOptions; + static equals(a: EnumOptions | PlainMessage | undefined, b: EnumOptions | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.EnumValueOptions + */ +export declare class EnumValueOptions extends Message { + /** + * 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. + * + * @generated from field: optional bool deprecated = 1 [default = false]; + */ + deprecated?: boolean; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 2; + */ + features?: FeatureSet; + /** + * 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. + * + * @generated from field: optional bool debug_redact = 3 [default = false]; + */ + debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.EnumValueOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): EnumValueOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): EnumValueOptions; + static fromJsonString(jsonString: string, options?: Partial): EnumValueOptions; + static equals(a: EnumValueOptions | PlainMessage | undefined, b: EnumValueOptions | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.ServiceOptions + */ +export declare class ServiceOptions extends Message { + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 34; + */ + features?: FeatureSet; + /** + * 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. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.ServiceOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): ServiceOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): ServiceOptions; + static fromJsonString(jsonString: string, options?: Partial): ServiceOptions; + static equals(a: ServiceOptions | PlainMessage | undefined, b: ServiceOptions | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.MethodOptions + */ +export declare class MethodOptions extends Message { + /** + * 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. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated?: boolean; + /** + * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + idempotencyLevel?: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 35; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.MethodOptions"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): MethodOptions; + static fromJson(jsonValue: JsonValue, options?: Partial): MethodOptions; + static fromJsonString(jsonString: string, options?: Partial): MethodOptions; + static equals(a: MethodOptions | PlainMessage | undefined, b: MethodOptions | PlainMessage | undefined): boolean; +} +/** + * 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. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export declare enum MethodOptions_IdempotencyLevel { + /** + * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + IDEMPOTENCY_UNKNOWN = 0, + /** + * implies idempotent + * + * @generated from enum value: NO_SIDE_EFFECTS = 1; + */ + NO_SIDE_EFFECTS = 1, + /** + * idempotent, but may have side effects + * + * @generated from enum value: IDEMPOTENT = 2; + */ + IDEMPOTENT = 2 +} +/** + * 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. + * + * @generated from message google.protobuf.UninterpretedOption + */ +export declare class UninterpretedOption extends Message { + /** + * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + 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. + * + * @generated from field: optional string identifier_value = 3; + */ + identifierValue?: string; + /** + * @generated from field: optional uint64 positive_int_value = 4; + */ + positiveIntValue?: bigint; + /** + * @generated from field: optional int64 negative_int_value = 5; + */ + negativeIntValue?: bigint; + /** + * @generated from field: optional double double_value = 6; + */ + doubleValue?: number; + /** + * @generated from field: optional bytes string_value = 7; + */ + stringValue?: Uint8Array; + /** + * @generated from field: optional string aggregate_value = 8; + */ + aggregateValue?: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.UninterpretedOption"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): UninterpretedOption; + static fromJson(jsonValue: JsonValue, options?: Partial): UninterpretedOption; + static fromJsonString(jsonString: string, options?: Partial): UninterpretedOption; + static equals(a: UninterpretedOption | PlainMessage | undefined, b: UninterpretedOption | PlainMessage | undefined): boolean; +} +/** + * 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". + * + * @generated from message google.protobuf.UninterpretedOption.NamePart + */ +export declare class UninterpretedOption_NamePart extends Message { + /** + * @generated from field: required string name_part = 1; + */ + namePart?: string; + /** + * @generated from field: required bool is_extension = 2; + */ + isExtension?: boolean; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.UninterpretedOption.NamePart"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): UninterpretedOption_NamePart; + static fromJson(jsonValue: JsonValue, options?: Partial): UninterpretedOption_NamePart; + static fromJsonString(jsonString: string, options?: Partial): UninterpretedOption_NamePart; + static equals(a: UninterpretedOption_NamePart | PlainMessage | undefined, b: UninterpretedOption_NamePart | PlainMessage | undefined): 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. + * + * @generated from message google.protobuf.FeatureSet + */ +export declare class FeatureSet extends Message { + /** + * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; + */ + fieldPresence?: FeatureSet_FieldPresence; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; + */ + enumType?: FeatureSet_EnumType; + /** + * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; + */ + repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding; + /** + * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; + */ + utf8Validation?: FeatureSet_Utf8Validation; + /** + * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; + */ + messageEncoding?: FeatureSet_MessageEncoding; + /** + * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; + */ + jsonFormat?: FeatureSet_JsonFormat; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FeatureSet"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FeatureSet; + static fromJson(jsonValue: JsonValue, options?: Partial): FeatureSet; + static fromJsonString(jsonString: string, options?: Partial): FeatureSet; + static equals(a: FeatureSet | PlainMessage | undefined, b: FeatureSet | PlainMessage | undefined): boolean; +} +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +export declare enum FeatureSet_FieldPresence { + /** + * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FIELD_PRESENCE_UNKNOWN = 0, + /** + * @generated from enum value: EXPLICIT = 1; + */ + EXPLICIT = 1, + /** + * @generated from enum value: IMPLICIT = 2; + */ + IMPLICIT = 2, + /** + * @generated from enum value: LEGACY_REQUIRED = 3; + */ + LEGACY_REQUIRED = 3 +} +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +export declare enum FeatureSet_EnumType { + /** + * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; + */ + ENUM_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: OPEN = 1; + */ + OPEN = 1, + /** + * @generated from enum value: CLOSED = 2; + */ + CLOSED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +export declare enum FeatureSet_RepeatedFieldEncoding { + /** + * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + /** + * @generated from enum value: PACKED = 1; + */ + PACKED = 1, + /** + * @generated from enum value: EXPANDED = 2; + */ + EXPANDED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +export declare enum FeatureSet_Utf8Validation { + /** + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + UTF8_VALIDATION_UNKNOWN = 0, + /** + * @generated from enum value: VERIFY = 2; + */ + VERIFY = 2, + /** + * @generated from enum value: NONE = 3; + */ + NONE = 3 +} +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +export declare enum FeatureSet_MessageEncoding { + /** + * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + MESSAGE_ENCODING_UNKNOWN = 0, + /** + * @generated from enum value: LENGTH_PREFIXED = 1; + */ + LENGTH_PREFIXED = 1, + /** + * @generated from enum value: DELIMITED = 2; + */ + DELIMITED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +export declare enum FeatureSet_JsonFormat { + /** + * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; + */ + JSON_FORMAT_UNKNOWN = 0, + /** + * @generated from enum value: ALLOW = 1; + */ + ALLOW = 1, + /** + * @generated from enum value: LEGACY_BEST_EFFORT = 2; + */ + LEGACY_BEST_EFFORT = 2 +} +/** + * 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. + * + * @generated from message google.protobuf.FeatureSetDefaults + */ +export declare class FeatureSetDefaults extends Message { + /** + * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * @generated from field: optional google.protobuf.Edition minimum_edition = 4; + */ + minimumEdition?: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * @generated from field: optional google.protobuf.Edition maximum_edition = 5; + */ + maximumEdition?: Edition; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FeatureSetDefaults"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FeatureSetDefaults; + static fromJson(jsonValue: JsonValue, options?: Partial): FeatureSetDefaults; + static fromJsonString(jsonString: string, options?: Partial): FeatureSetDefaults; + static equals(a: FeatureSetDefaults | PlainMessage | undefined, b: FeatureSetDefaults | PlainMessage | undefined): boolean; +} +/** + * 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. + * + * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +export declare class FeatureSetDefaults_FeatureSetEditionDefault extends Message { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition?: Edition; + /** + * Defaults of features that can be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; + */ + overridableFeatures?: FeatureSet; + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSet; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FeatureSetDefaults_FeatureSetEditionDefault; + static fromJson(jsonValue: JsonValue, options?: Partial): FeatureSetDefaults_FeatureSetEditionDefault; + static fromJsonString(jsonString: string, options?: Partial): FeatureSetDefaults_FeatureSetEditionDefault; + static equals(a: FeatureSetDefaults_FeatureSetEditionDefault | PlainMessage | undefined, b: FeatureSetDefaults_FeatureSetEditionDefault | PlainMessage | undefined): boolean; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from message google.protobuf.SourceCodeInfo + */ +export declare class SourceCodeInfo extends Message { + /** + * 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. + * + * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location: SourceCodeInfo_Location[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.SourceCodeInfo"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): SourceCodeInfo; + static fromJson(jsonValue: JsonValue, options?: Partial): SourceCodeInfo; + static fromJsonString(jsonString: string, options?: Partial): SourceCodeInfo; + static equals(a: SourceCodeInfo | PlainMessage | undefined, b: SourceCodeInfo | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.SourceCodeInfo.Location + */ +export declare class SourceCodeInfo_Location extends Message { + /** + * 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). + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + 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. + * + * @generated from field: repeated int32 span = 2 [packed = true]; + */ + 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. + * + * @generated from field: optional string leading_comments = 3; + */ + leadingComments?: string; + /** + * @generated from field: optional string trailing_comments = 4; + */ + trailingComments?: string; + /** + * @generated from field: repeated string leading_detached_comments = 6; + */ + leadingDetachedComments: string[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.SourceCodeInfo.Location"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): SourceCodeInfo_Location; + static fromJson(jsonValue: JsonValue, options?: Partial): SourceCodeInfo_Location; + static fromJsonString(jsonString: string, options?: Partial): SourceCodeInfo_Location; + static equals(a: SourceCodeInfo_Location | PlainMessage | undefined, b: SourceCodeInfo_Location | PlainMessage | undefined): boolean; +} +/** + * 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. + * + * @generated from message google.protobuf.GeneratedCodeInfo + */ +export declare class GeneratedCodeInfo extends Message { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation: GeneratedCodeInfo_Annotation[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.GeneratedCodeInfo"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): GeneratedCodeInfo; + static fromJson(jsonValue: JsonValue, options?: Partial): GeneratedCodeInfo; + static fromJsonString(jsonString: string, options?: Partial): GeneratedCodeInfo; + static equals(a: GeneratedCodeInfo | PlainMessage | undefined, b: GeneratedCodeInfo | PlainMessage | undefined): boolean; +} +/** + * @generated from message google.protobuf.GeneratedCodeInfo.Annotation + */ +export declare class GeneratedCodeInfo_Annotation extends Message { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from field: optional string source_file = 2; + */ + sourceFile?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from field: optional int32 begin = 3; + */ + begin?: number; + /** + * 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). + * + * @generated from field: optional int32 end = 4; + */ + end?: number; + /** + * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic?: GeneratedCodeInfo_Annotation_Semantic; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto2; + static readonly typeName = "google.protobuf.GeneratedCodeInfo.Annotation"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): GeneratedCodeInfo_Annotation; + static fromJson(jsonValue: JsonValue, options?: Partial): GeneratedCodeInfo_Annotation; + static fromJsonString(jsonString: string, options?: Partial): GeneratedCodeInfo_Annotation; + static equals(a: GeneratedCodeInfo_Annotation | PlainMessage | undefined, b: GeneratedCodeInfo_Annotation | PlainMessage | undefined): boolean; +} +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export declare enum GeneratedCodeInfo_Annotation_Semantic { + /** + * There is no effect or the effect is indescribable. + * + * @generated from enum value: NONE = 0; + */ + NONE = 0, + /** + * The element is set or otherwise mutated. + * + * @generated from enum value: SET = 1; + */ + SET = 1, + /** + * An alias to the element is returned. + * + * @generated from enum value: ALIAS = 2; + */ + ALIAS = 2 +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/descriptor_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/descriptor_pb.js new file mode 100644 index 0000000..04502be --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/descriptor_pb.js @@ -0,0 +1,2077 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GeneratedCodeInfo_Annotation_Semantic = exports.GeneratedCodeInfo_Annotation = exports.GeneratedCodeInfo = exports.SourceCodeInfo_Location = exports.SourceCodeInfo = exports.FeatureSetDefaults_FeatureSetEditionDefault = exports.FeatureSetDefaults = exports.FeatureSet_JsonFormat = exports.FeatureSet_MessageEncoding = exports.FeatureSet_Utf8Validation = exports.FeatureSet_RepeatedFieldEncoding = exports.FeatureSet_EnumType = exports.FeatureSet_FieldPresence = exports.FeatureSet = exports.UninterpretedOption_NamePart = exports.UninterpretedOption = exports.MethodOptions_IdempotencyLevel = exports.MethodOptions = exports.ServiceOptions = exports.EnumValueOptions = exports.EnumOptions = exports.OneofOptions = exports.FieldOptions_FeatureSupport = exports.FieldOptions_EditionDefault = exports.FieldOptions_OptionTargetType = exports.FieldOptions_OptionRetention = exports.FieldOptions_JSType = exports.FieldOptions_CType = exports.FieldOptions = exports.MessageOptions = exports.FileOptions_OptimizeMode = exports.FileOptions = exports.MethodDescriptorProto = exports.ServiceDescriptorProto = exports.EnumValueDescriptorProto = exports.EnumDescriptorProto_EnumReservedRange = exports.EnumDescriptorProto = exports.OneofDescriptorProto = exports.FieldDescriptorProto_Label = exports.FieldDescriptorProto_Type = exports.FieldDescriptorProto = exports.ExtensionRangeOptions_Declaration = exports.ExtensionRangeOptions_VerificationState = exports.ExtensionRangeOptions = exports.DescriptorProto_ReservedRange = exports.DescriptorProto_ExtensionRange = exports.DescriptorProto = exports.FileDescriptorProto = exports.FileDescriptorSet = exports.Edition = void 0; +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). +// @generated by protoc-gen-es v1.10.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" +// @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2) +/* eslint-disable */ +const proto2_js_1 = require("../../proto2.js"); +const message_js_1 = require("../../message.js"); +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +var Edition; +(function (Edition) { + /** + * A placeholder for an unknown edition value. + * + * @generated from enum value: EDITION_UNKNOWN = 0; + */ + Edition[Edition["EDITION_UNKNOWN"] = 0] = "EDITION_UNKNOWN"; + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + Edition[Edition["EDITION_LEGACY"] = 900] = "EDITION_LEGACY"; + /** + * 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. + * + * @generated from enum value: EDITION_PROTO2 = 998; + */ + Edition[Edition["EDITION_PROTO2"] = 998] = "EDITION_PROTO2"; + /** + * @generated from enum value: EDITION_PROTO3 = 999; + */ + Edition[Edition["EDITION_PROTO3"] = 999] = "EDITION_PROTO3"; + /** + * 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. + * + * @generated from enum value: EDITION_2023 = 1000; + */ + Edition[Edition["EDITION_2023"] = 1000] = "EDITION_2023"; + /** + * @generated from enum value: EDITION_2024 = 1001; + */ + Edition[Edition["EDITION_2024"] = 1001] = "EDITION_2024"; + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relyed on outside of tests. + * + * @generated from enum value: EDITION_1_TEST_ONLY = 1; + */ + Edition[Edition["EDITION_1_TEST_ONLY"] = 1] = "EDITION_1_TEST_ONLY"; + /** + * @generated from enum value: EDITION_2_TEST_ONLY = 2; + */ + Edition[Edition["EDITION_2_TEST_ONLY"] = 2] = "EDITION_2_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; + */ + Edition[Edition["EDITION_99997_TEST_ONLY"] = 99997] = "EDITION_99997_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; + */ + Edition[Edition["EDITION_99998_TEST_ONLY"] = 99998] = "EDITION_99998_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; + */ + Edition[Edition["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY"; + /** + * 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. + * + * @generated from enum value: EDITION_MAX = 2147483647; + */ + Edition[Edition["EDITION_MAX"] = 2147483647] = "EDITION_MAX"; +})(Edition || (exports.Edition = Edition = {})); +// Retrieve enum metadata with: proto2.getEnumType(Edition) +proto2_js_1.proto2.util.setEnumType(Edition, "google.protobuf.Edition", [ + { no: 0, name: "EDITION_UNKNOWN" }, + { no: 900, name: "EDITION_LEGACY" }, + { no: 998, name: "EDITION_PROTO2" }, + { no: 999, name: "EDITION_PROTO3" }, + { no: 1000, name: "EDITION_2023" }, + { no: 1001, name: "EDITION_2024" }, + { no: 1, name: "EDITION_1_TEST_ONLY" }, + { no: 2, name: "EDITION_2_TEST_ONLY" }, + { no: 99997, name: "EDITION_99997_TEST_ONLY" }, + { no: 99998, name: "EDITION_99998_TEST_ONLY" }, + { no: 99999, name: "EDITION_99999_TEST_ONLY" }, + { no: 2147483647, name: "EDITION_MAX" }, +]); +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from message google.protobuf.FileDescriptorSet + */ +class FileDescriptorSet extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + this.file = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FileDescriptorSet().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FileDescriptorSet().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FileDescriptorSet().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FileDescriptorSet, a, b); + } +} +exports.FileDescriptorSet = FileDescriptorSet; +FileDescriptorSet.runtime = proto2_js_1.proto2; +FileDescriptorSet.typeName = "google.protobuf.FileDescriptorSet"; +FileDescriptorSet.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "file", kind: "message", T: FileDescriptorProto, repeated: true }, +]); +/** + * Describes a complete .proto file. + * + * @generated from message google.protobuf.FileDescriptorProto + */ +class FileDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + /** + * Names of files imported by this file. + * + * @generated from field: repeated string dependency = 3; + */ + this.dependency = []; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from field: repeated int32 public_dependency = 10; + */ + this.publicDependency = []; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from field: repeated int32 weak_dependency = 11; + */ + this.weakDependency = []; + /** + * All top-level definitions in this file. + * + * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + this.messageType = []; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + this.enumType = []; + /** + * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + this.service = []; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + this.extension = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FileDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FileDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FileDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FileDescriptorProto, a, b); + } +} +exports.FileDescriptorProto = FileDescriptorProto; +FileDescriptorProto.runtime = proto2_js_1.proto2; +FileDescriptorProto.typeName = "google.protobuf.FileDescriptorProto"; +FileDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "package", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "dependency", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 10, name: "public_dependency", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + { no: 11, name: "weak_dependency", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + { no: 4, name: "message_type", kind: "message", T: DescriptorProto, repeated: true }, + { no: 5, name: "enum_type", kind: "message", T: EnumDescriptorProto, repeated: true }, + { no: 6, name: "service", kind: "message", T: ServiceDescriptorProto, repeated: true }, + { no: 7, name: "extension", kind: "message", T: FieldDescriptorProto, repeated: true }, + { no: 8, name: "options", kind: "message", T: FileOptions, opt: true }, + { no: 9, name: "source_code_info", kind: "message", T: SourceCodeInfo, opt: true }, + { no: 12, name: "syntax", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 14, name: "edition", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, +]); +/** + * Describes a message type. + * + * @generated from message google.protobuf.DescriptorProto + */ +class DescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + this.field = []; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + this.extension = []; + /** + * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + this.nestedType = []; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + this.enumType = []; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + this.extensionRange = []; + /** + * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + this.oneofDecl = []; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + this.reservedRange = []; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * @generated from field: repeated string reserved_name = 10; + */ + this.reservedName = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new DescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new DescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new DescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(DescriptorProto, a, b); + } +} +exports.DescriptorProto = DescriptorProto; +DescriptorProto.runtime = proto2_js_1.proto2; +DescriptorProto.typeName = "google.protobuf.DescriptorProto"; +DescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "field", kind: "message", T: FieldDescriptorProto, repeated: true }, + { no: 6, name: "extension", kind: "message", T: FieldDescriptorProto, repeated: true }, + { no: 3, name: "nested_type", kind: "message", T: DescriptorProto, repeated: true }, + { no: 4, name: "enum_type", kind: "message", T: EnumDescriptorProto, repeated: true }, + { no: 5, name: "extension_range", kind: "message", T: DescriptorProto_ExtensionRange, repeated: true }, + { no: 8, name: "oneof_decl", kind: "message", T: OneofDescriptorProto, repeated: true }, + { no: 7, name: "options", kind: "message", T: MessageOptions, opt: true }, + { no: 9, name: "reserved_range", kind: "message", T: DescriptorProto_ReservedRange, repeated: true }, + { no: 10, name: "reserved_name", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, +]); +/** + * @generated from message google.protobuf.DescriptorProto.ExtensionRange + */ +class DescriptorProto_ExtensionRange extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new DescriptorProto_ExtensionRange().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new DescriptorProto_ExtensionRange().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new DescriptorProto_ExtensionRange().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(DescriptorProto_ExtensionRange, a, b); + } +} +exports.DescriptorProto_ExtensionRange = DescriptorProto_ExtensionRange; +DescriptorProto_ExtensionRange.runtime = proto2_js_1.proto2; +DescriptorProto_ExtensionRange.typeName = "google.protobuf.DescriptorProto.ExtensionRange"; +DescriptorProto_ExtensionRange.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "start", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 2, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 3, name: "options", kind: "message", T: ExtensionRangeOptions, opt: true }, +]); +/** + * 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. + * + * @generated from message google.protobuf.DescriptorProto.ReservedRange + */ +class DescriptorProto_ReservedRange extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new DescriptorProto_ReservedRange().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new DescriptorProto_ReservedRange().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new DescriptorProto_ReservedRange().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(DescriptorProto_ReservedRange, a, b); + } +} +exports.DescriptorProto_ReservedRange = DescriptorProto_ReservedRange; +DescriptorProto_ReservedRange.runtime = proto2_js_1.proto2; +DescriptorProto_ReservedRange.typeName = "google.protobuf.DescriptorProto.ReservedRange"; +DescriptorProto_ReservedRange.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "start", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 2, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, +]); +/** + * @generated from message google.protobuf.ExtensionRangeOptions + */ +class ExtensionRangeOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.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. + * + * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + this.declaration = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new ExtensionRangeOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new ExtensionRangeOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new ExtensionRangeOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(ExtensionRangeOptions, a, b); + } +} +exports.ExtensionRangeOptions = ExtensionRangeOptions; +ExtensionRangeOptions.runtime = proto2_js_1.proto2; +ExtensionRangeOptions.typeName = "google.protobuf.ExtensionRangeOptions"; +ExtensionRangeOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, + { no: 2, name: "declaration", kind: "message", T: ExtensionRangeOptions_Declaration, repeated: true }, + { no: 50, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 3, name: "verification", kind: "enum", T: proto2_js_1.proto2.getEnumType(ExtensionRangeOptions_VerificationState), opt: true, default: ExtensionRangeOptions_VerificationState.UNVERIFIED }, +]); +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +var ExtensionRangeOptions_VerificationState; +(function (ExtensionRangeOptions_VerificationState) { + /** + * All the extensions of the range must be declared. + * + * @generated from enum value: DECLARATION = 0; + */ + ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["DECLARATION"] = 0] = "DECLARATION"; + /** + * @generated from enum value: UNVERIFIED = 1; + */ + ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["UNVERIFIED"] = 1] = "UNVERIFIED"; +})(ExtensionRangeOptions_VerificationState || (exports.ExtensionRangeOptions_VerificationState = ExtensionRangeOptions_VerificationState = {})); +// Retrieve enum metadata with: proto2.getEnumType(ExtensionRangeOptions_VerificationState) +proto2_js_1.proto2.util.setEnumType(ExtensionRangeOptions_VerificationState, "google.protobuf.ExtensionRangeOptions.VerificationState", [ + { no: 0, name: "DECLARATION" }, + { no: 1, name: "UNVERIFIED" }, +]); +/** + * @generated from message google.protobuf.ExtensionRangeOptions.Declaration + */ +class ExtensionRangeOptions_Declaration extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new ExtensionRangeOptions_Declaration().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new ExtensionRangeOptions_Declaration().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new ExtensionRangeOptions_Declaration().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(ExtensionRangeOptions_Declaration, a, b); + } +} +exports.ExtensionRangeOptions_Declaration = ExtensionRangeOptions_Declaration; +ExtensionRangeOptions_Declaration.runtime = proto2_js_1.proto2; +ExtensionRangeOptions_Declaration.typeName = "google.protobuf.ExtensionRangeOptions.Declaration"; +ExtensionRangeOptions_Declaration.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 2, name: "full_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 5, name: "reserved", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 6, name: "repeated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, +]); +/** + * Describes a field within a message. + * + * @generated from message google.protobuf.FieldDescriptorProto + */ +class FieldDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FieldDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FieldDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FieldDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FieldDescriptorProto, a, b); + } +} +exports.FieldDescriptorProto = FieldDescriptorProto; +FieldDescriptorProto.runtime = proto2_js_1.proto2; +FieldDescriptorProto.typeName = "google.protobuf.FieldDescriptorProto"; +FieldDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 4, name: "label", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldDescriptorProto_Label), opt: true }, + { no: 5, name: "type", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldDescriptorProto_Type), opt: true }, + { no: 6, name: "type_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "extendee", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 7, name: "default_value", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 9, name: "oneof_index", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 10, name: "json_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 8, name: "options", kind: "message", T: FieldOptions, opt: true }, + { no: 17, name: "proto3_optional", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, +]); +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +var FieldDescriptorProto_Type; +(function (FieldDescriptorProto_Type) { + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["DOUBLE"] = 1] = "DOUBLE"; + /** + * @generated from enum value: TYPE_FLOAT = 2; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FLOAT"] = 2] = "FLOAT"; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT64"] = 3] = "INT64"; + /** + * @generated from enum value: TYPE_UINT64 = 4; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT64"] = 4] = "UINT64"; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT32"] = 5] = "INT32"; + /** + * @generated from enum value: TYPE_FIXED64 = 6; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED64"] = 6] = "FIXED64"; + /** + * @generated from enum value: TYPE_FIXED32 = 7; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED32"] = 7] = "FIXED32"; + /** + * @generated from enum value: TYPE_BOOL = 8; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["BOOL"] = 8] = "BOOL"; + /** + * @generated from enum value: TYPE_STRING = 9; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["STRING"] = 9] = "STRING"; + /** + * 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. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["GROUP"] = 10] = "GROUP"; + /** + * Length-delimited aggregate. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["MESSAGE"] = 11] = "MESSAGE"; + /** + * New in version 2. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["BYTES"] = 12] = "BYTES"; + /** + * @generated from enum value: TYPE_UINT32 = 13; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT32"] = 13] = "UINT32"; + /** + * @generated from enum value: TYPE_ENUM = 14; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["ENUM"] = 14] = "ENUM"; + /** + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED32"] = 15] = "SFIXED32"; + /** + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED64"] = 16] = "SFIXED64"; + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT32"] = 17] = "SINT32"; + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT64"] = 18] = "SINT64"; +})(FieldDescriptorProto_Type || (exports.FieldDescriptorProto_Type = FieldDescriptorProto_Type = {})); +// Retrieve enum metadata with: proto2.getEnumType(FieldDescriptorProto_Type) +proto2_js_1.proto2.util.setEnumType(FieldDescriptorProto_Type, "google.protobuf.FieldDescriptorProto.Type", [ + { no: 1, name: "TYPE_DOUBLE" }, + { no: 2, name: "TYPE_FLOAT" }, + { no: 3, name: "TYPE_INT64" }, + { no: 4, name: "TYPE_UINT64" }, + { no: 5, name: "TYPE_INT32" }, + { no: 6, name: "TYPE_FIXED64" }, + { no: 7, name: "TYPE_FIXED32" }, + { no: 8, name: "TYPE_BOOL" }, + { no: 9, name: "TYPE_STRING" }, + { no: 10, name: "TYPE_GROUP" }, + { no: 11, name: "TYPE_MESSAGE" }, + { no: 12, name: "TYPE_BYTES" }, + { no: 13, name: "TYPE_UINT32" }, + { no: 14, name: "TYPE_ENUM" }, + { no: 15, name: "TYPE_SFIXED32" }, + { no: 16, name: "TYPE_SFIXED64" }, + { no: 17, name: "TYPE_SINT32" }, + { no: 18, name: "TYPE_SINT64" }, +]); +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +var FieldDescriptorProto_Label; +(function (FieldDescriptorProto_Label) { + /** + * 0 is reserved for errors + * + * @generated from enum value: LABEL_OPTIONAL = 1; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["OPTIONAL"] = 1] = "OPTIONAL"; + /** + * @generated from enum value: LABEL_REPEATED = 3; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["REPEATED"] = 3] = "REPEATED"; + /** + * 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. + * + * @generated from enum value: LABEL_REQUIRED = 2; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["REQUIRED"] = 2] = "REQUIRED"; +})(FieldDescriptorProto_Label || (exports.FieldDescriptorProto_Label = FieldDescriptorProto_Label = {})); +// Retrieve enum metadata with: proto2.getEnumType(FieldDescriptorProto_Label) +proto2_js_1.proto2.util.setEnumType(FieldDescriptorProto_Label, "google.protobuf.FieldDescriptorProto.Label", [ + { no: 1, name: "LABEL_OPTIONAL" }, + { no: 3, name: "LABEL_REPEATED" }, + { no: 2, name: "LABEL_REQUIRED" }, +]); +/** + * Describes a oneof. + * + * @generated from message google.protobuf.OneofDescriptorProto + */ +class OneofDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new OneofDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new OneofDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new OneofDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(OneofDescriptorProto, a, b); + } +} +exports.OneofDescriptorProto = OneofDescriptorProto; +OneofDescriptorProto.runtime = proto2_js_1.proto2; +OneofDescriptorProto.typeName = "google.protobuf.OneofDescriptorProto"; +OneofDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "options", kind: "message", T: OneofOptions, opt: true }, +]); +/** + * Describes an enum type. + * + * @generated from message google.protobuf.EnumDescriptorProto + */ +class EnumDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + this.value = []; + /** + * 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. + * + * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + this.reservedRange = []; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from field: repeated string reserved_name = 5; + */ + this.reservedName = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new EnumDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new EnumDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new EnumDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(EnumDescriptorProto, a, b); + } +} +exports.EnumDescriptorProto = EnumDescriptorProto; +EnumDescriptorProto.runtime = proto2_js_1.proto2; +EnumDescriptorProto.typeName = "google.protobuf.EnumDescriptorProto"; +EnumDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "value", kind: "message", T: EnumValueDescriptorProto, repeated: true }, + { no: 3, name: "options", kind: "message", T: EnumOptions, opt: true }, + { no: 4, name: "reserved_range", kind: "message", T: EnumDescriptorProto_EnumReservedRange, repeated: true }, + { no: 5, name: "reserved_name", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, +]); +/** + * 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. + * + * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +class EnumDescriptorProto_EnumReservedRange extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new EnumDescriptorProto_EnumReservedRange().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new EnumDescriptorProto_EnumReservedRange().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new EnumDescriptorProto_EnumReservedRange().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(EnumDescriptorProto_EnumReservedRange, a, b); + } +} +exports.EnumDescriptorProto_EnumReservedRange = EnumDescriptorProto_EnumReservedRange; +EnumDescriptorProto_EnumReservedRange.runtime = proto2_js_1.proto2; +EnumDescriptorProto_EnumReservedRange.typeName = "google.protobuf.EnumDescriptorProto.EnumReservedRange"; +EnumDescriptorProto_EnumReservedRange.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "start", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 2, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, +]); +/** + * Describes a value within an enum. + * + * @generated from message google.protobuf.EnumValueDescriptorProto + */ +class EnumValueDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new EnumValueDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new EnumValueDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new EnumValueDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(EnumValueDescriptorProto, a, b); + } +} +exports.EnumValueDescriptorProto = EnumValueDescriptorProto; +EnumValueDescriptorProto.runtime = proto2_js_1.proto2; +EnumValueDescriptorProto.typeName = "google.protobuf.EnumValueDescriptorProto"; +EnumValueDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 3, name: "options", kind: "message", T: EnumValueOptions, opt: true }, +]); +/** + * Describes a service. + * + * @generated from message google.protobuf.ServiceDescriptorProto + */ +class ServiceDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + this.method = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new ServiceDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new ServiceDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new ServiceDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(ServiceDescriptorProto, a, b); + } +} +exports.ServiceDescriptorProto = ServiceDescriptorProto; +ServiceDescriptorProto.runtime = proto2_js_1.proto2; +ServiceDescriptorProto.typeName = "google.protobuf.ServiceDescriptorProto"; +ServiceDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "method", kind: "message", T: MethodDescriptorProto, repeated: true }, + { no: 3, name: "options", kind: "message", T: ServiceOptions, opt: true }, +]); +/** + * Describes a method of a service. + * + * @generated from message google.protobuf.MethodDescriptorProto + */ +class MethodDescriptorProto extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new MethodDescriptorProto().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new MethodDescriptorProto().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new MethodDescriptorProto().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(MethodDescriptorProto, a, b); + } +} +exports.MethodDescriptorProto = MethodDescriptorProto; +MethodDescriptorProto.runtime = proto2_js_1.proto2; +MethodDescriptorProto.typeName = "google.protobuf.MethodDescriptorProto"; +MethodDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 2, name: "input_type", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "output_type", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "options", kind: "message", T: MethodOptions, opt: true }, + { no: 5, name: "client_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 6, name: "server_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, +]); +/** + * @generated from message google.protobuf.FileOptions + */ +class FileOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FileOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FileOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FileOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FileOptions, a, b); + } +} +exports.FileOptions = FileOptions; +FileOptions.runtime = proto2_js_1.proto2; +FileOptions.typeName = "google.protobuf.FileOptions"; +FileOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "java_package", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 8, name: "java_outer_classname", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 10, name: "java_multiple_files", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 20, name: "java_generate_equals_and_hash", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 27, name: "java_string_check_utf8", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 9, name: "optimize_for", kind: "enum", T: proto2_js_1.proto2.getEnumType(FileOptions_OptimizeMode), opt: true, default: FileOptions_OptimizeMode.SPEED }, + { no: 11, name: "go_package", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 16, name: "cc_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 17, name: "java_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 18, name: "py_generic_services", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 23, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 31, name: "cc_enable_arenas", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: true }, + { no: 36, name: "objc_class_prefix", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 37, name: "csharp_namespace", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 39, name: "swift_prefix", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 40, name: "php_class_prefix", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 41, name: "php_namespace", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 44, name: "php_metadata_namespace", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 45, name: "ruby_package", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 50, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +var FileOptions_OptimizeMode; +(function (FileOptions_OptimizeMode) { + /** + * Generate complete code for parsing, serialization, + * + * @generated from enum value: SPEED = 1; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["SPEED"] = 1] = "SPEED"; + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from enum value: CODE_SIZE = 2; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE"; + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from enum value: LITE_RUNTIME = 3; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["LITE_RUNTIME"] = 3] = "LITE_RUNTIME"; +})(FileOptions_OptimizeMode || (exports.FileOptions_OptimizeMode = FileOptions_OptimizeMode = {})); +// Retrieve enum metadata with: proto2.getEnumType(FileOptions_OptimizeMode) +proto2_js_1.proto2.util.setEnumType(FileOptions_OptimizeMode, "google.protobuf.FileOptions.OptimizeMode", [ + { no: 1, name: "SPEED" }, + { no: 2, name: "CODE_SIZE" }, + { no: 3, name: "LITE_RUNTIME" }, +]); +/** + * @generated from message google.protobuf.MessageOptions + */ +class MessageOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new MessageOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new MessageOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new MessageOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(MessageOptions, a, b); + } +} +exports.MessageOptions = MessageOptions; +MessageOptions.runtime = proto2_js_1.proto2; +MessageOptions.typeName = "google.protobuf.MessageOptions"; +MessageOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "message_set_wire_format", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 2, name: "no_standard_descriptor_accessor", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 7, name: "map_entry", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 11, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 12, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * @generated from message google.protobuf.FieldOptions + */ +class FieldOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + this.targets = []; + /** + * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + this.editionDefaults = []; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FieldOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FieldOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FieldOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FieldOptions, a, b); + } +} +exports.FieldOptions = FieldOptions; +FieldOptions.runtime = proto2_js_1.proto2; +FieldOptions.typeName = "google.protobuf.FieldOptions"; +FieldOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "ctype", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldOptions_CType), opt: true, default: FieldOptions_CType.STRING }, + { no: 2, name: "packed", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 6, name: "jstype", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldOptions_JSType), opt: true, default: FieldOptions_JSType.JS_NORMAL }, + { no: 5, name: "lazy", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 15, name: "unverified_lazy", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 10, name: "weak", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 16, name: "debug_redact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 17, name: "retention", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldOptions_OptionRetention), opt: true }, + { no: 19, name: "targets", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldOptions_OptionTargetType), repeated: true }, + { no: 20, name: "edition_defaults", kind: "message", T: FieldOptions_EditionDefault, repeated: true }, + { no: 21, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 22, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +var FieldOptions_CType; +(function (FieldOptions_CType) { + /** + * Default mode. + * + * @generated from enum value: STRING = 0; + */ + FieldOptions_CType[FieldOptions_CType["STRING"] = 0] = "STRING"; + /** + * 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. + * + * @generated from enum value: CORD = 1; + */ + FieldOptions_CType[FieldOptions_CType["CORD"] = 1] = "CORD"; + /** + * @generated from enum value: STRING_PIECE = 2; + */ + FieldOptions_CType[FieldOptions_CType["STRING_PIECE"] = 2] = "STRING_PIECE"; +})(FieldOptions_CType || (exports.FieldOptions_CType = FieldOptions_CType = {})); +// Retrieve enum metadata with: proto2.getEnumType(FieldOptions_CType) +proto2_js_1.proto2.util.setEnumType(FieldOptions_CType, "google.protobuf.FieldOptions.CType", [ + { no: 0, name: "STRING" }, + { no: 1, name: "CORD" }, + { no: 2, name: "STRING_PIECE" }, +]); +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +var FieldOptions_JSType; +(function (FieldOptions_JSType) { + /** + * Use the default type. + * + * @generated from enum value: JS_NORMAL = 0; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_NORMAL"] = 0] = "JS_NORMAL"; + /** + * Use JavaScript strings. + * + * @generated from enum value: JS_STRING = 1; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_STRING"] = 1] = "JS_STRING"; + /** + * Use JavaScript numbers. + * + * @generated from enum value: JS_NUMBER = 2; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_NUMBER"] = 2] = "JS_NUMBER"; +})(FieldOptions_JSType || (exports.FieldOptions_JSType = FieldOptions_JSType = {})); +// Retrieve enum metadata with: proto2.getEnumType(FieldOptions_JSType) +proto2_js_1.proto2.util.setEnumType(FieldOptions_JSType, "google.protobuf.FieldOptions.JSType", [ + { no: 0, name: "JS_NORMAL" }, + { no: 1, name: "JS_STRING" }, + { no: 2, name: "JS_NUMBER" }, +]); +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +var FieldOptions_OptionRetention; +(function (FieldOptions_OptionRetention) { + /** + * @generated from enum value: RETENTION_UNKNOWN = 0; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN"; + /** + * @generated from enum value: RETENTION_RUNTIME = 1; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME"; + /** + * @generated from enum value: RETENTION_SOURCE = 2; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE"; +})(FieldOptions_OptionRetention || (exports.FieldOptions_OptionRetention = FieldOptions_OptionRetention = {})); +// Retrieve enum metadata with: proto2.getEnumType(FieldOptions_OptionRetention) +proto2_js_1.proto2.util.setEnumType(FieldOptions_OptionRetention, "google.protobuf.FieldOptions.OptionRetention", [ + { no: 0, name: "RETENTION_UNKNOWN" }, + { no: 1, name: "RETENTION_RUNTIME" }, + { no: 2, name: "RETENTION_SOURCE" }, +]); +/** + * 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. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +var FieldOptions_OptionTargetType; +(function (FieldOptions_OptionTargetType) { + /** + * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN"; + /** + * @generated from enum value: TARGET_TYPE_FILE = 1; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE"; + /** + * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE"; + /** + * @generated from enum value: TARGET_TYPE_MESSAGE = 3; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE"; + /** + * @generated from enum value: TARGET_TYPE_FIELD = 4; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD"; + /** + * @generated from enum value: TARGET_TYPE_ONEOF = 5; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF"; + /** + * @generated from enum value: TARGET_TYPE_ENUM = 6; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM"; + /** + * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY"; + /** + * @generated from enum value: TARGET_TYPE_SERVICE = 8; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE"; + /** + * @generated from enum value: TARGET_TYPE_METHOD = 9; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD"; +})(FieldOptions_OptionTargetType || (exports.FieldOptions_OptionTargetType = FieldOptions_OptionTargetType = {})); +// Retrieve enum metadata with: proto2.getEnumType(FieldOptions_OptionTargetType) +proto2_js_1.proto2.util.setEnumType(FieldOptions_OptionTargetType, "google.protobuf.FieldOptions.OptionTargetType", [ + { no: 0, name: "TARGET_TYPE_UNKNOWN" }, + { no: 1, name: "TARGET_TYPE_FILE" }, + { no: 2, name: "TARGET_TYPE_EXTENSION_RANGE" }, + { no: 3, name: "TARGET_TYPE_MESSAGE" }, + { no: 4, name: "TARGET_TYPE_FIELD" }, + { no: 5, name: "TARGET_TYPE_ONEOF" }, + { no: 6, name: "TARGET_TYPE_ENUM" }, + { no: 7, name: "TARGET_TYPE_ENUM_ENTRY" }, + { no: 8, name: "TARGET_TYPE_SERVICE" }, + { no: 9, name: "TARGET_TYPE_METHOD" }, +]); +/** + * @generated from message google.protobuf.FieldOptions.EditionDefault + */ +class FieldOptions_EditionDefault extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FieldOptions_EditionDefault().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FieldOptions_EditionDefault().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FieldOptions_EditionDefault().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FieldOptions_EditionDefault, a, b); + } +} +exports.FieldOptions_EditionDefault = FieldOptions_EditionDefault; +FieldOptions_EditionDefault.runtime = proto2_js_1.proto2; +FieldOptions_EditionDefault.typeName = "google.protobuf.FieldOptions.EditionDefault"; +FieldOptions_EditionDefault.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 3, name: "edition", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, +]); +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +class FieldOptions_FeatureSupport extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FieldOptions_FeatureSupport().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FieldOptions_FeatureSupport().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FieldOptions_FeatureSupport().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FieldOptions_FeatureSupport, a, b); + } +} +exports.FieldOptions_FeatureSupport = FieldOptions_FeatureSupport; +FieldOptions_FeatureSupport.runtime = proto2_js_1.proto2; +FieldOptions_FeatureSupport.typeName = "google.protobuf.FieldOptions.FeatureSupport"; +FieldOptions_FeatureSupport.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "edition_introduced", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, + { no: 2, name: "edition_deprecated", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, + { no: 3, name: "deprecation_warning", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "edition_removed", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, +]); +/** + * @generated from message google.protobuf.OneofOptions + */ +class OneofOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new OneofOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new OneofOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new OneofOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(OneofOptions, a, b); + } +} +exports.OneofOptions = OneofOptions; +OneofOptions.runtime = proto2_js_1.proto2; +OneofOptions.typeName = "google.protobuf.OneofOptions"; +OneofOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * @generated from message google.protobuf.EnumOptions + */ +class EnumOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new EnumOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new EnumOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new EnumOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(EnumOptions, a, b); + } +} +exports.EnumOptions = EnumOptions; +EnumOptions.runtime = proto2_js_1.proto2; +EnumOptions.typeName = "google.protobuf.EnumOptions"; +EnumOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 2, name: "allow_alias", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 6, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 7, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * @generated from message google.protobuf.EnumValueOptions + */ +class EnumValueOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new EnumValueOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new EnumValueOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new EnumValueOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(EnumValueOptions, a, b); + } +} +exports.EnumValueOptions = EnumValueOptions; +EnumValueOptions.runtime = proto2_js_1.proto2; +EnumValueOptions.typeName = "google.protobuf.EnumValueOptions"; +EnumValueOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 2, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 3, name: "debug_redact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 4, name: "feature_support", kind: "message", T: FieldOptions_FeatureSupport, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * @generated from message google.protobuf.ServiceOptions + */ +class ServiceOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new ServiceOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new ServiceOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new ServiceOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(ServiceOptions, a, b); + } +} +exports.ServiceOptions = ServiceOptions; +ServiceOptions.runtime = proto2_js_1.proto2; +ServiceOptions.typeName = "google.protobuf.ServiceOptions"; +ServiceOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 34, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 33, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * @generated from message google.protobuf.MethodOptions + */ +class MethodOptions extends message_js_1.Message { + constructor(data) { + super(); + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + this.uninterpretedOption = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new MethodOptions().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new MethodOptions().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new MethodOptions().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(MethodOptions, a, b); + } +} +exports.MethodOptions = MethodOptions; +MethodOptions.runtime = proto2_js_1.proto2; +MethodOptions.typeName = "google.protobuf.MethodOptions"; +MethodOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 33, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false }, + { no: 34, name: "idempotency_level", kind: "enum", T: proto2_js_1.proto2.getEnumType(MethodOptions_IdempotencyLevel), opt: true, default: MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN }, + { no: 35, name: "features", kind: "message", T: FeatureSet, opt: true }, + { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true }, +]); +/** + * 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. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +var MethodOptions_IdempotencyLevel; +(function (MethodOptions_IdempotencyLevel) { + /** + * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENCY_UNKNOWN"] = 0] = "IDEMPOTENCY_UNKNOWN"; + /** + * implies idempotent + * + * @generated from enum value: NO_SIDE_EFFECTS = 1; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["NO_SIDE_EFFECTS"] = 1] = "NO_SIDE_EFFECTS"; + /** + * idempotent, but may have side effects + * + * @generated from enum value: IDEMPOTENT = 2; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENT"] = 2] = "IDEMPOTENT"; +})(MethodOptions_IdempotencyLevel || (exports.MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel = {})); +// Retrieve enum metadata with: proto2.getEnumType(MethodOptions_IdempotencyLevel) +proto2_js_1.proto2.util.setEnumType(MethodOptions_IdempotencyLevel, "google.protobuf.MethodOptions.IdempotencyLevel", [ + { no: 0, name: "IDEMPOTENCY_UNKNOWN" }, + { no: 1, name: "NO_SIDE_EFFECTS" }, + { no: 2, name: "IDEMPOTENT" }, +]); +/** + * 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. + * + * @generated from message google.protobuf.UninterpretedOption + */ +class UninterpretedOption extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + this.name = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new UninterpretedOption().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new UninterpretedOption().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new UninterpretedOption().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(UninterpretedOption, a, b); + } +} +exports.UninterpretedOption = UninterpretedOption; +UninterpretedOption.runtime = proto2_js_1.proto2; +UninterpretedOption.typeName = "google.protobuf.UninterpretedOption"; +UninterpretedOption.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 2, name: "name", kind: "message", T: UninterpretedOption_NamePart, repeated: true }, + { no: 3, name: "identifier_value", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "positive_int_value", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 5, name: "negative_int_value", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true }, + { no: 6, name: "double_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true }, + { no: 7, name: "string_value", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true }, + { no: 8, name: "aggregate_value", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, +]); +/** + * 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". + * + * @generated from message google.protobuf.UninterpretedOption.NamePart + */ +class UninterpretedOption_NamePart extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new UninterpretedOption_NamePart().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new UninterpretedOption_NamePart().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new UninterpretedOption_NamePart().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(UninterpretedOption_NamePart, a, b); + } +} +exports.UninterpretedOption_NamePart = UninterpretedOption_NamePart; +UninterpretedOption_NamePart.runtime = proto2_js_1.proto2; +UninterpretedOption_NamePart.typeName = "google.protobuf.UninterpretedOption.NamePart"; +UninterpretedOption_NamePart.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "name_part", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true }, + { no: 2, name: "is_extension", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true }, +]); +/** + * 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. + * + * @generated from message google.protobuf.FeatureSet + */ +class FeatureSet extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FeatureSet().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FeatureSet().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FeatureSet().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FeatureSet, a, b); + } +} +exports.FeatureSet = FeatureSet; +FeatureSet.runtime = proto2_js_1.proto2; +FeatureSet.typeName = "google.protobuf.FeatureSet"; +FeatureSet.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "field_presence", kind: "enum", T: proto2_js_1.proto2.getEnumType(FeatureSet_FieldPresence), opt: true }, + { no: 2, name: "enum_type", kind: "enum", T: proto2_js_1.proto2.getEnumType(FeatureSet_EnumType), opt: true }, + { no: 3, name: "repeated_field_encoding", kind: "enum", T: proto2_js_1.proto2.getEnumType(FeatureSet_RepeatedFieldEncoding), opt: true }, + { no: 4, name: "utf8_validation", kind: "enum", T: proto2_js_1.proto2.getEnumType(FeatureSet_Utf8Validation), opt: true }, + { no: 5, name: "message_encoding", kind: "enum", T: proto2_js_1.proto2.getEnumType(FeatureSet_MessageEncoding), opt: true }, + { no: 6, name: "json_format", kind: "enum", T: proto2_js_1.proto2.getEnumType(FeatureSet_JsonFormat), opt: true }, +]); +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +var FeatureSet_FieldPresence; +(function (FeatureSet_FieldPresence) { + /** + * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["FIELD_PRESENCE_UNKNOWN"] = 0] = "FIELD_PRESENCE_UNKNOWN"; + /** + * @generated from enum value: EXPLICIT = 1; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["EXPLICIT"] = 1] = "EXPLICIT"; + /** + * @generated from enum value: IMPLICIT = 2; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["IMPLICIT"] = 2] = "IMPLICIT"; + /** + * @generated from enum value: LEGACY_REQUIRED = 3; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["LEGACY_REQUIRED"] = 3] = "LEGACY_REQUIRED"; +})(FeatureSet_FieldPresence || (exports.FeatureSet_FieldPresence = FeatureSet_FieldPresence = {})); +// Retrieve enum metadata with: proto2.getEnumType(FeatureSet_FieldPresence) +proto2_js_1.proto2.util.setEnumType(FeatureSet_FieldPresence, "google.protobuf.FeatureSet.FieldPresence", [ + { no: 0, name: "FIELD_PRESENCE_UNKNOWN" }, + { no: 1, name: "EXPLICIT" }, + { no: 2, name: "IMPLICIT" }, + { no: 3, name: "LEGACY_REQUIRED" }, +]); +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +var FeatureSet_EnumType; +(function (FeatureSet_EnumType) { + /** + * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; + */ + FeatureSet_EnumType[FeatureSet_EnumType["ENUM_TYPE_UNKNOWN"] = 0] = "ENUM_TYPE_UNKNOWN"; + /** + * @generated from enum value: OPEN = 1; + */ + FeatureSet_EnumType[FeatureSet_EnumType["OPEN"] = 1] = "OPEN"; + /** + * @generated from enum value: CLOSED = 2; + */ + FeatureSet_EnumType[FeatureSet_EnumType["CLOSED"] = 2] = "CLOSED"; +})(FeatureSet_EnumType || (exports.FeatureSet_EnumType = FeatureSet_EnumType = {})); +// Retrieve enum metadata with: proto2.getEnumType(FeatureSet_EnumType) +proto2_js_1.proto2.util.setEnumType(FeatureSet_EnumType, "google.protobuf.FeatureSet.EnumType", [ + { no: 0, name: "ENUM_TYPE_UNKNOWN" }, + { no: 1, name: "OPEN" }, + { no: 2, name: "CLOSED" }, +]); +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +var FeatureSet_RepeatedFieldEncoding; +(function (FeatureSet_RepeatedFieldEncoding) { + /** + * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["REPEATED_FIELD_ENCODING_UNKNOWN"] = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN"; + /** + * @generated from enum value: PACKED = 1; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["PACKED"] = 1] = "PACKED"; + /** + * @generated from enum value: EXPANDED = 2; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["EXPANDED"] = 2] = "EXPANDED"; +})(FeatureSet_RepeatedFieldEncoding || (exports.FeatureSet_RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding = {})); +// Retrieve enum metadata with: proto2.getEnumType(FeatureSet_RepeatedFieldEncoding) +proto2_js_1.proto2.util.setEnumType(FeatureSet_RepeatedFieldEncoding, "google.protobuf.FeatureSet.RepeatedFieldEncoding", [ + { no: 0, name: "REPEATED_FIELD_ENCODING_UNKNOWN" }, + { no: 1, name: "PACKED" }, + { no: 2, name: "EXPANDED" }, +]); +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +var FeatureSet_Utf8Validation; +(function (FeatureSet_Utf8Validation) { + /** + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN"; + /** + * @generated from enum value: VERIFY = 2; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["VERIFY"] = 2] = "VERIFY"; + /** + * @generated from enum value: NONE = 3; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 3] = "NONE"; +})(FeatureSet_Utf8Validation || (exports.FeatureSet_Utf8Validation = FeatureSet_Utf8Validation = {})); +// Retrieve enum metadata with: proto2.getEnumType(FeatureSet_Utf8Validation) +proto2_js_1.proto2.util.setEnumType(FeatureSet_Utf8Validation, "google.protobuf.FeatureSet.Utf8Validation", [ + { no: 0, name: "UTF8_VALIDATION_UNKNOWN" }, + { no: 2, name: "VERIFY" }, + { no: 3, name: "NONE" }, +]); +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +var FeatureSet_MessageEncoding; +(function (FeatureSet_MessageEncoding) { + /** + * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["MESSAGE_ENCODING_UNKNOWN"] = 0] = "MESSAGE_ENCODING_UNKNOWN"; + /** + * @generated from enum value: LENGTH_PREFIXED = 1; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["LENGTH_PREFIXED"] = 1] = "LENGTH_PREFIXED"; + /** + * @generated from enum value: DELIMITED = 2; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["DELIMITED"] = 2] = "DELIMITED"; +})(FeatureSet_MessageEncoding || (exports.FeatureSet_MessageEncoding = FeatureSet_MessageEncoding = {})); +// Retrieve enum metadata with: proto2.getEnumType(FeatureSet_MessageEncoding) +proto2_js_1.proto2.util.setEnumType(FeatureSet_MessageEncoding, "google.protobuf.FeatureSet.MessageEncoding", [ + { no: 0, name: "MESSAGE_ENCODING_UNKNOWN" }, + { no: 1, name: "LENGTH_PREFIXED" }, + { no: 2, name: "DELIMITED" }, +]); +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +var FeatureSet_JsonFormat; +(function (FeatureSet_JsonFormat) { + /** + * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["JSON_FORMAT_UNKNOWN"] = 0] = "JSON_FORMAT_UNKNOWN"; + /** + * @generated from enum value: ALLOW = 1; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["ALLOW"] = 1] = "ALLOW"; + /** + * @generated from enum value: LEGACY_BEST_EFFORT = 2; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["LEGACY_BEST_EFFORT"] = 2] = "LEGACY_BEST_EFFORT"; +})(FeatureSet_JsonFormat || (exports.FeatureSet_JsonFormat = FeatureSet_JsonFormat = {})); +// Retrieve enum metadata with: proto2.getEnumType(FeatureSet_JsonFormat) +proto2_js_1.proto2.util.setEnumType(FeatureSet_JsonFormat, "google.protobuf.FeatureSet.JsonFormat", [ + { no: 0, name: "JSON_FORMAT_UNKNOWN" }, + { no: 1, name: "ALLOW" }, + { no: 2, name: "LEGACY_BEST_EFFORT" }, +]); +/** + * 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. + * + * @generated from message google.protobuf.FeatureSetDefaults + */ +class FeatureSetDefaults extends message_js_1.Message { + constructor(data) { + super(); + /** + * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + this.defaults = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FeatureSetDefaults().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FeatureSetDefaults().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FeatureSetDefaults().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FeatureSetDefaults, a, b); + } +} +exports.FeatureSetDefaults = FeatureSetDefaults; +FeatureSetDefaults.runtime = proto2_js_1.proto2; +FeatureSetDefaults.typeName = "google.protobuf.FeatureSetDefaults"; +FeatureSetDefaults.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "defaults", kind: "message", T: FeatureSetDefaults_FeatureSetEditionDefault, repeated: true }, + { no: 4, name: "minimum_edition", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, + { no: 5, name: "maximum_edition", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, +]); +/** + * 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. + * + * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +class FeatureSetDefaults_FeatureSetEditionDefault extends message_js_1.Message { + constructor(data) { + super(); + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new FeatureSetDefaults_FeatureSetEditionDefault().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FeatureSetDefaults_FeatureSetEditionDefault().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FeatureSetDefaults_FeatureSetEditionDefault().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(FeatureSetDefaults_FeatureSetEditionDefault, a, b); + } +} +exports.FeatureSetDefaults_FeatureSetEditionDefault = FeatureSetDefaults_FeatureSetEditionDefault; +FeatureSetDefaults_FeatureSetEditionDefault.runtime = proto2_js_1.proto2; +FeatureSetDefaults_FeatureSetEditionDefault.typeName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; +FeatureSetDefaults_FeatureSetEditionDefault.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 3, name: "edition", kind: "enum", T: proto2_js_1.proto2.getEnumType(Edition), opt: true }, + { no: 4, name: "overridable_features", kind: "message", T: FeatureSet, opt: true }, + { no: 5, name: "fixed_features", kind: "message", T: FeatureSet, opt: true }, +]); +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from message google.protobuf.SourceCodeInfo + */ +class SourceCodeInfo extends message_js_1.Message { + constructor(data) { + super(); + /** + * 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. + * + * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + this.location = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new SourceCodeInfo().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new SourceCodeInfo().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new SourceCodeInfo().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(SourceCodeInfo, a, b); + } +} +exports.SourceCodeInfo = SourceCodeInfo; +SourceCodeInfo.runtime = proto2_js_1.proto2; +SourceCodeInfo.typeName = "google.protobuf.SourceCodeInfo"; +SourceCodeInfo.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "location", kind: "message", T: SourceCodeInfo_Location, repeated: true }, +]); +/** + * @generated from message google.protobuf.SourceCodeInfo.Location + */ +class SourceCodeInfo_Location extends message_js_1.Message { + constructor(data) { + super(); + /** + * 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). + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + this.path = []; + /** + * 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. + * + * @generated from field: repeated int32 span = 2 [packed = true]; + */ + this.span = []; + /** + * @generated from field: repeated string leading_detached_comments = 6; + */ + this.leadingDetachedComments = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new SourceCodeInfo_Location().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new SourceCodeInfo_Location().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new SourceCodeInfo_Location().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(SourceCodeInfo_Location, a, b); + } +} +exports.SourceCodeInfo_Location = SourceCodeInfo_Location; +SourceCodeInfo_Location.runtime = proto2_js_1.proto2; +SourceCodeInfo_Location.typeName = "google.protobuf.SourceCodeInfo.Location"; +SourceCodeInfo_Location.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "path", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, + { no: 2, name: "span", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, + { no: 3, name: "leading_comments", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "trailing_comments", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 6, name: "leading_detached_comments", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, +]); +/** + * 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. + * + * @generated from message google.protobuf.GeneratedCodeInfo + */ +class GeneratedCodeInfo extends message_js_1.Message { + constructor(data) { + super(); + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + this.annotation = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new GeneratedCodeInfo().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new GeneratedCodeInfo().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new GeneratedCodeInfo().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(GeneratedCodeInfo, a, b); + } +} +exports.GeneratedCodeInfo = GeneratedCodeInfo; +GeneratedCodeInfo.runtime = proto2_js_1.proto2; +GeneratedCodeInfo.typeName = "google.protobuf.GeneratedCodeInfo"; +GeneratedCodeInfo.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "annotation", kind: "message", T: GeneratedCodeInfo_Annotation, repeated: true }, +]); +/** + * @generated from message google.protobuf.GeneratedCodeInfo.Annotation + */ +class GeneratedCodeInfo_Annotation extends message_js_1.Message { + constructor(data) { + super(); + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + this.path = []; + proto2_js_1.proto2.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new GeneratedCodeInfo_Annotation().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new GeneratedCodeInfo_Annotation().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new GeneratedCodeInfo_Annotation().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto2_js_1.proto2.util.equals(GeneratedCodeInfo_Annotation, a, b); + } +} +exports.GeneratedCodeInfo_Annotation = GeneratedCodeInfo_Annotation; +GeneratedCodeInfo_Annotation.runtime = proto2_js_1.proto2; +GeneratedCodeInfo_Annotation.typeName = "google.protobuf.GeneratedCodeInfo.Annotation"; +GeneratedCodeInfo_Annotation.fields = proto2_js_1.proto2.util.newFieldList(() => [ + { no: 1, name: "path", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true, packed: true }, + { no: 2, name: "source_file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "begin", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 4, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, + { no: 5, name: "semantic", kind: "enum", T: proto2_js_1.proto2.getEnumType(GeneratedCodeInfo_Annotation_Semantic), opt: true }, +]); +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +var GeneratedCodeInfo_Annotation_Semantic; +(function (GeneratedCodeInfo_Annotation_Semantic) { + /** + * There is no effect or the effect is indescribable. + * + * @generated from enum value: NONE = 0; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["NONE"] = 0] = "NONE"; + /** + * The element is set or otherwise mutated. + * + * @generated from enum value: SET = 1; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["SET"] = 1] = "SET"; + /** + * An alias to the element is returned. + * + * @generated from enum value: ALIAS = 2; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["ALIAS"] = 2] = "ALIAS"; +})(GeneratedCodeInfo_Annotation_Semantic || (exports.GeneratedCodeInfo_Annotation_Semantic = GeneratedCodeInfo_Annotation_Semantic = {})); +// Retrieve enum metadata with: proto2.getEnumType(GeneratedCodeInfo_Annotation_Semantic) +proto2_js_1.proto2.util.setEnumType(GeneratedCodeInfo_Annotation_Semantic, "google.protobuf.GeneratedCodeInfo.Annotation.Semantic", [ + { no: 0, name: "NONE" }, + { no: 1, name: "SET" }, + { no: 2, name: "ALIAS" }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/duration_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/duration_pb.d.ts new file mode 100644 index 0000000..bd10b68 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/duration_pb.d.ts @@ -0,0 +1,100 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { proto3 } from "../../proto3.js"; +import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +/** + * 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". + * + * + * @generated from message google.protobuf.Duration + */ +export declare class Duration extends Message { + /** + * 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 + * + * @generated from field: int64 seconds = 1; + */ + seconds: bigint; + /** + * 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. + * + * @generated from field: int32 nanos = 2; + */ + nanos: number; + constructor(data?: PartialMessage); + fromJson(json: JsonValue, options?: Partial): this; + toJson(options?: Partial): JsonValue; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Duration"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Duration; + static fromJson(jsonValue: JsonValue, options?: Partial): Duration; + static fromJsonString(jsonString: string, options?: Partial): Duration; + static equals(a: Duration | PlainMessage | undefined, b: Duration | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/duration_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/duration_pb.js new file mode 100644 index 0000000..2679404 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/duration_pb.js @@ -0,0 +1,169 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Duration = void 0; +const message_js_1 = require("../../message.js"); +const proto_int64_js_1 = require("../../proto-int64.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * 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". + * + * + * @generated from message google.protobuf.Duration + */ +class Duration extends message_js_1.Message { + constructor(data) { + super(); + /** + * 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 + * + * @generated from field: int64 seconds = 1; + */ + this.seconds = proto_int64_js_1.protoInt64.zero; + /** + * 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. + * + * @generated from field: int32 nanos = 2; + */ + this.nanos = 0; + proto3_js_1.proto3.util.initPartial(data, this); + } + fromJson(json, options) { + if (typeof json !== "string") { + throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`); + } + const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/); + if (match === null) { + throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`); + } + const longSeconds = Number(match[1]); + if (longSeconds > 315576000000 || longSeconds < -315576000000) { + throw new Error(`cannot decode google.protobuf.Duration from JSON: ${proto3_js_1.proto3.json.debug(json)}`); + } + this.seconds = proto_int64_js_1.protoInt64.parse(longSeconds); + if (typeof match[2] == "string") { + const nanosStr = match[2] + "0".repeat(9 - match[2].length); + this.nanos = parseInt(nanosStr); + if (longSeconds < 0 || Object.is(longSeconds, -0)) { + this.nanos = -this.nanos; + } + } + return this; + } + toJson(options) { + if (Number(this.seconds) > 315576000000 || Number(this.seconds) < -315576000000) { + throw new Error(`cannot encode google.protobuf.Duration to JSON: value out of range`); + } + let text = this.seconds.toString(); + if (this.nanos !== 0) { + let nanosStr = Math.abs(this.nanos).toString(); + nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr; + if (nanosStr.substring(3) === "000000") { + nanosStr = nanosStr.substring(0, 3); + } + else if (nanosStr.substring(6) === "000") { + nanosStr = nanosStr.substring(0, 6); + } + text += "." + nanosStr; + if (this.nanos < 0 && Number(this.seconds) == 0) { + text = "-" + text; + } + } + return text + "s"; + } + static fromBinary(bytes, options) { + return new Duration().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Duration().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Duration().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Duration, a, b); + } +} +exports.Duration = Duration; +Duration.runtime = proto3_js_1.proto3; +Duration.typeName = "google.protobuf.Duration"; +Duration.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/empty_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/empty_pb.d.ts new file mode 100644 index 0000000..b047b26 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/empty_pb.d.ts @@ -0,0 +1,28 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { proto3 } from "../../proto3.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +import type { JsonReadOptions, JsonValue } from "../../json-format.js"; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * + * @generated from message google.protobuf.Empty + */ +export declare class Empty extends Message { + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Empty"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Empty; + static fromJson(jsonValue: JsonValue, options?: Partial): Empty; + static fromJsonString(jsonString: string, options?: Partial): Empty; + static equals(a: Empty | PlainMessage | undefined, b: Empty | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/empty_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/empty_pb.js new file mode 100644 index 0000000..c16930a --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/empty_pb.js @@ -0,0 +1,52 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Empty = void 0; +const message_js_1 = require("../../message.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * + * @generated from message google.protobuf.Empty + */ +class Empty extends message_js_1.Message { + constructor(data) { + super(); + proto3_js_1.proto3.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new Empty().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Empty().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Empty().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Empty, a, b); + } +} +exports.Empty = Empty; +Empty.runtime = proto3_js_1.proto3; +Empty.typeName = "google.protobuf.Empty"; +Empty.fields = proto3_js_1.proto3.util.newFieldList(() => []); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/field_mask_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/field_mask_pb.d.ts new file mode 100644 index 0000000..eb1e100 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/field_mask_pb.d.ts @@ -0,0 +1,227 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { proto3 } from "../../proto3.js"; +import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from message google.protobuf.FieldMask + */ +export declare class FieldMask extends Message { + /** + * The set of field mask paths. + * + * @generated from field: repeated string paths = 1; + */ + paths: string[]; + constructor(data?: PartialMessage); + toJson(options?: Partial): JsonValue; + fromJson(json: JsonValue, options?: Partial): this; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.FieldMask"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): FieldMask; + static fromJson(jsonValue: JsonValue, options?: Partial): FieldMask; + static fromJsonString(jsonString: string, options?: Partial): FieldMask; + static equals(a: FieldMask | PlainMessage | undefined, b: FieldMask | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/field_mask_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/field_mask_pb.js new file mode 100644 index 0000000..037c165 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/field_mask_pb.js @@ -0,0 +1,311 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FieldMask = void 0; +const message_js_1 = require("../../message.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from message google.protobuf.FieldMask + */ +class FieldMask extends message_js_1.Message { + constructor(data) { + super(); + /** + * The set of field mask paths. + * + * @generated from field: repeated string paths = 1; + */ + this.paths = []; + proto3_js_1.proto3.util.initPartial(data, this); + } + toJson(options) { + // Converts snake_case to protoCamelCase according to the convention + // used by protoc to convert a field name to a JSON name. + function protoCamelCase(snakeCase) { + let capNext = false; + const b = []; + for (let i = 0; i < snakeCase.length; i++) { + let c = snakeCase.charAt(i); + switch (c) { + case '_': + capNext = true; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + b.push(c); + capNext = false; + break; + default: + if (capNext) { + capNext = false; + c = c.toUpperCase(); + } + b.push(c); + break; + } + } + return b.join(''); + } + return this.paths.map(p => { + if (p.match(/_[0-9]?_/g) || p.match(/[A-Z]/g)) { + throw new Error("cannot encode google.protobuf.FieldMask to JSON: lowerCamelCase of path name \"" + p + "\" is irreversible"); + } + return protoCamelCase(p); + }).join(","); + } + fromJson(json, options) { + if (typeof json !== "string") { + throw new Error("cannot decode google.protobuf.FieldMask from JSON: " + proto3_js_1.proto3.json.debug(json)); + } + if (json === "") { + return this; + } + function camelToSnake(str) { + if (str.includes("_")) { + throw new Error("cannot decode google.protobuf.FieldMask from JSON: path names must be lowerCamelCase"); + } + const sc = str.replace(/[A-Z]/g, letter => "_" + letter.toLowerCase()); + return (sc[0] === "_") ? sc.substring(1) : sc; + } + this.paths = json.split(",").map(camelToSnake); + return this; + } + static fromBinary(bytes, options) { + return new FieldMask().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new FieldMask().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new FieldMask().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(FieldMask, a, b); + } +} +exports.FieldMask = FieldMask; +FieldMask.runtime = proto3_js_1.proto3; +FieldMask.typeName = "google.protobuf.FieldMask"; +FieldMask.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/source_context_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/source_context_pb.d.ts new file mode 100644 index 0000000..2c160a9 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/source_context_pb.d.ts @@ -0,0 +1,29 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { proto3 } from "../../proto3.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +import type { JsonReadOptions, JsonValue } from "../../json-format.js"; +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from message google.protobuf.SourceContext + */ +export declare class SourceContext extends Message { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from field: string file_name = 1; + */ + fileName: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.SourceContext"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): SourceContext; + static fromJson(jsonValue: JsonValue, options?: Partial): SourceContext; + static fromJsonString(jsonString: string, options?: Partial): SourceContext; + static equals(a: SourceContext | PlainMessage | undefined, b: SourceContext | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/source_context_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/source_context_pb.js new file mode 100644 index 0000000..2249ee7 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/source_context_pb.js @@ -0,0 +1,55 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourceContext = void 0; +const message_js_1 = require("../../message.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from message google.protobuf.SourceContext + */ +class SourceContext extends message_js_1.Message { + constructor(data) { + super(); + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from field: string file_name = 1; + */ + this.fileName = ""; + proto3_js_1.proto3.util.initPartial(data, this); + } + static fromBinary(bytes, options) { + return new SourceContext().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new SourceContext().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new SourceContext().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(SourceContext, a, b); + } +} +exports.SourceContext = SourceContext; +SourceContext.runtime = proto3_js_1.proto3; +SourceContext.typeName = "google.protobuf.SourceContext"; +SourceContext.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/struct_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/struct_pb.d.ts new file mode 100644 index 0000000..60c5a5b --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/struct_pb.d.ts @@ -0,0 +1,158 @@ +import { proto3 } from "../../proto3.js"; +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +export declare enum NullValue { + /** + * Null value. + * + * @generated from enum value: NULL_VALUE = 0; + */ + NULL_VALUE = 0 +} +/** + * `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. + * + * @generated from message google.protobuf.Struct + */ +export declare class Struct extends Message { + /** + * Unordered map of dynamically typed values. + * + * @generated from field: map fields = 1; + */ + fields: { + [key: string]: Value; + }; + constructor(data?: PartialMessage); + toJson(options?: Partial): JsonValue; + fromJson(json: JsonValue, options?: Partial): this; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Struct"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Struct; + static fromJson(jsonValue: JsonValue, options?: Partial): Struct; + static fromJsonString(jsonString: string, options?: Partial): Struct; + static equals(a: Struct | PlainMessage | undefined, b: Struct | PlainMessage | undefined): boolean; +} +/** + * `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. + * + * @generated from message google.protobuf.Value + */ +export declare class Value extends Message { + /** + * The kind of value. + * + * @generated from oneof google.protobuf.Value.kind + */ + kind: { + /** + * Represents a null value. + * + * @generated from field: google.protobuf.NullValue null_value = 1; + */ + value: NullValue; + case: "nullValue"; + } | { + /** + * Represents a double value. + * + * @generated from field: double number_value = 2; + */ + value: number; + case: "numberValue"; + } | { + /** + * Represents a string value. + * + * @generated from field: string string_value = 3; + */ + value: string; + case: "stringValue"; + } | { + /** + * Represents a boolean value. + * + * @generated from field: bool bool_value = 4; + */ + value: boolean; + case: "boolValue"; + } | { + /** + * Represents a structured value. + * + * @generated from field: google.protobuf.Struct struct_value = 5; + */ + value: Struct; + case: "structValue"; + } | { + /** + * Represents a repeated `Value`. + * + * @generated from field: google.protobuf.ListValue list_value = 6; + */ + value: ListValue; + case: "listValue"; + } | { + case: undefined; + value?: undefined; + }; + constructor(data?: PartialMessage); + toJson(options?: Partial): JsonValue; + fromJson(json: JsonValue, options?: Partial): this; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Value"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Value; + static fromJson(jsonValue: JsonValue, options?: Partial): Value; + static fromJsonString(jsonString: string, options?: Partial): Value; + static equals(a: Value | PlainMessage | undefined, b: Value | PlainMessage | undefined): boolean; +} +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @generated from message google.protobuf.ListValue + */ +export declare class ListValue extends Message { + /** + * Repeated field of dynamically typed values. + * + * @generated from field: repeated google.protobuf.Value values = 1; + */ + values: Value[]; + constructor(data?: PartialMessage); + toJson(options?: Partial): JsonValue; + fromJson(json: JsonValue, options?: Partial): this; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.ListValue"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): ListValue; + static fromJson(jsonValue: JsonValue, options?: Partial): ListValue; + static fromJsonString(jsonString: string, options?: Partial): ListValue; + static equals(a: ListValue | PlainMessage | undefined, b: ListValue | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/struct_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/struct_pb.js new file mode 100644 index 0000000..8178260 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/struct_pb.js @@ -0,0 +1,240 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0; +// @generated by protoc-gen-es v1.10.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts" +// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3) +/* eslint-disable */ +const proto3_js_1 = require("../../proto3.js"); +const message_js_1 = require("../../message.js"); +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +var NullValue; +(function (NullValue) { + /** + * Null value. + * + * @generated from enum value: NULL_VALUE = 0; + */ + NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE"; +})(NullValue || (exports.NullValue = NullValue = {})); +// Retrieve enum metadata with: proto3.getEnumType(NullValue) +proto3_js_1.proto3.util.setEnumType(NullValue, "google.protobuf.NullValue", [ + { no: 0, name: "NULL_VALUE" }, +]); +/** + * `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. + * + * @generated from message google.protobuf.Struct + */ +class Struct extends message_js_1.Message { + constructor(data) { + super(); + /** + * Unordered map of dynamically typed values. + * + * @generated from field: map fields = 1; + */ + this.fields = {}; + proto3_js_1.proto3.util.initPartial(data, this); + } + toJson(options) { + const json = {}; + for (const [k, v] of Object.entries(this.fields)) { + json[k] = v.toJson(options); + } + return json; + } + fromJson(json, options) { + if (typeof json != "object" || json == null || Array.isArray(json)) { + throw new Error("cannot decode google.protobuf.Struct from JSON " + proto3_js_1.proto3.json.debug(json)); + } + for (const [k, v] of Object.entries(json)) { + this.fields[k] = Value.fromJson(v); + } + return this; + } + static fromBinary(bytes, options) { + return new Struct().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Struct().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Struct().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Struct, a, b); + } +} +exports.Struct = Struct; +Struct.runtime = proto3_js_1.proto3; +Struct.typeName = "google.protobuf.Struct"; +Struct.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "message", T: Value } }, +]); +/** + * `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. + * + * @generated from message google.protobuf.Value + */ +class Value extends message_js_1.Message { + constructor(data) { + super(); + /** + * The kind of value. + * + * @generated from oneof google.protobuf.Value.kind + */ + this.kind = { case: undefined }; + proto3_js_1.proto3.util.initPartial(data, this); + } + toJson(options) { + switch (this.kind.case) { + case "nullValue": + return null; + case "numberValue": + if (!Number.isFinite(this.kind.value)) { + throw new Error("google.protobuf.Value cannot be NaN or Infinity"); + } + return this.kind.value; + case "boolValue": + return this.kind.value; + case "stringValue": + return this.kind.value; + case "structValue": + case "listValue": + return this.kind.value.toJson(Object.assign(Object.assign({}, options), { emitDefaultValues: true })); + } + throw new Error("google.protobuf.Value must have a value"); + } + fromJson(json, options) { + switch (typeof json) { + case "number": + this.kind = { case: "numberValue", value: json }; + break; + case "string": + this.kind = { case: "stringValue", value: json }; + break; + case "boolean": + this.kind = { case: "boolValue", value: json }; + break; + case "object": + if (json === null) { + this.kind = { case: "nullValue", value: NullValue.NULL_VALUE }; + } + else if (Array.isArray(json)) { + this.kind = { case: "listValue", value: ListValue.fromJson(json) }; + } + else { + this.kind = { case: "structValue", value: Struct.fromJson(json) }; + } + break; + default: + throw new Error("cannot decode google.protobuf.Value from JSON " + proto3_js_1.proto3.json.debug(json)); + } + return this; + } + static fromBinary(bytes, options) { + return new Value().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Value().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Value().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Value, a, b); + } +} +exports.Value = Value; +Value.runtime = proto3_js_1.proto3; +Value.typeName = "google.protobuf.Value"; +Value.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "null_value", kind: "enum", T: proto3_js_1.proto3.getEnumType(NullValue), oneof: "kind" }, + { no: 2, name: "number_value", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, oneof: "kind" }, + { no: 3, name: "string_value", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "kind" }, + { no: 4, name: "bool_value", kind: "scalar", T: 8 /* ScalarType.BOOL */, oneof: "kind" }, + { no: 5, name: "struct_value", kind: "message", T: Struct, oneof: "kind" }, + { no: 6, name: "list_value", kind: "message", T: ListValue, oneof: "kind" }, +]); +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @generated from message google.protobuf.ListValue + */ +class ListValue extends message_js_1.Message { + constructor(data) { + super(); + /** + * Repeated field of dynamically typed values. + * + * @generated from field: repeated google.protobuf.Value values = 1; + */ + this.values = []; + proto3_js_1.proto3.util.initPartial(data, this); + } + toJson(options) { + return this.values.map(v => v.toJson()); + } + fromJson(json, options) { + if (!Array.isArray(json)) { + throw new Error("cannot decode google.protobuf.ListValue from JSON " + proto3_js_1.proto3.json.debug(json)); + } + for (let e of json) { + this.values.push(Value.fromJson(e)); + } + return this; + } + static fromBinary(bytes, options) { + return new ListValue().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new ListValue().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new ListValue().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(ListValue, a, b); + } +} +exports.ListValue = ListValue; +ListValue.runtime = proto3_js_1.proto3; +ListValue.typeName = "google.protobuf.ListValue"; +ListValue.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "values", kind: "message", T: Value, repeated: true }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/timestamp_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/timestamp_pb.d.ts new file mode 100644 index 0000000..1fb8894 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/timestamp_pb.d.ts @@ -0,0 +1,132 @@ +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { proto3 } from "../../proto3.js"; +import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +/** + * 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. + * + * + * @generated from message google.protobuf.Timestamp + */ +export declare class Timestamp extends Message { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @generated from field: int64 seconds = 1; + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @generated from field: int32 nanos = 2; + */ + nanos: number; + constructor(data?: PartialMessage); + fromJson(json: JsonValue, options?: Partial): this; + toJson(options?: Partial): JsonValue; + toDate(): Date; + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Timestamp"; + static readonly fields: FieldList; + static now(): Timestamp; + static fromDate(date: Date): Timestamp; + static fromBinary(bytes: Uint8Array, options?: Partial): Timestamp; + static fromJson(jsonValue: JsonValue, options?: Partial): Timestamp; + static fromJsonString(jsonString: string, options?: Partial): Timestamp; + static equals(a: Timestamp | PlainMessage | undefined, b: Timestamp | PlainMessage | undefined): boolean; +} diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/timestamp_pb.js b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/timestamp_pb.js new file mode 100644 index 0000000..f33b1d6 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/timestamp_pb.js @@ -0,0 +1,213 @@ +"use strict"; +// Copyright 2021-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Timestamp = void 0; +const message_js_1 = require("../../message.js"); +const proto_int64_js_1 = require("../../proto-int64.js"); +const proto3_js_1 = require("../../proto3.js"); +/** + * 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. + * + * + * @generated from message google.protobuf.Timestamp + */ +class Timestamp extends message_js_1.Message { + constructor(data) { + super(); + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @generated from field: int64 seconds = 1; + */ + this.seconds = proto_int64_js_1.protoInt64.zero; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @generated from field: int32 nanos = 2; + */ + this.nanos = 0; + proto3_js_1.proto3.util.initPartial(data, this); + } + fromJson(json, options) { + if (typeof json !== "string") { + throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${proto3_js_1.proto3.json.debug(json)}`); + } + const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/); + if (!matches) { + throw new Error(`cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string`); + } + const ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z")); + if (Number.isNaN(ms)) { + throw new Error(`cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string`); + } + if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) { + throw new Error(`cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`); + } + this.seconds = proto_int64_js_1.protoInt64.parse(ms / 1000); + this.nanos = 0; + if (matches[7]) { + this.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000); + } + return this; + } + toJson(options) { + const ms = Number(this.seconds) * 1000; + if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) { + throw new Error(`cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`); + } + if (this.nanos < 0) { + throw new Error(`cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative`); + } + let z = "Z"; + if (this.nanos > 0) { + const nanosStr = (this.nanos + 1000000000).toString().substring(1); + if (nanosStr.substring(3) === "000000") { + z = "." + nanosStr.substring(0, 3) + "Z"; + } + else if (nanosStr.substring(6) === "000") { + z = "." + nanosStr.substring(0, 6) + "Z"; + } + else { + z = "." + nanosStr + "Z"; + } + } + return new Date(ms).toISOString().replace(".000Z", z); + } + toDate() { + return new Date(Number(this.seconds) * 1000 + Math.ceil(this.nanos / 1000000)); + } + static now() { + return Timestamp.fromDate(new Date()); + } + static fromDate(date) { + const ms = date.getTime(); + return new Timestamp({ + seconds: proto_int64_js_1.protoInt64.parse(Math.floor(ms / 1000)), + nanos: (ms % 1000) * 1000000, + }); + } + static fromBinary(bytes, options) { + return new Timestamp().fromBinary(bytes, options); + } + static fromJson(jsonValue, options) { + return new Timestamp().fromJson(jsonValue, options); + } + static fromJsonString(jsonString, options) { + return new Timestamp().fromJsonString(jsonString, options); + } + static equals(a, b) { + return proto3_js_1.proto3.util.equals(Timestamp, a, b); + } +} +exports.Timestamp = Timestamp; +Timestamp.runtime = proto3_js_1.proto3; +Timestamp.typeName = "google.protobuf.Timestamp"; +Timestamp.fields = proto3_js_1.proto3.util.newFieldList(() => [ + { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, +]); diff --git a/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/type_pb.d.ts b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/type_pb.d.ts new file mode 100644 index 0000000..9bbae19 --- /dev/null +++ b/examples/540-livekit-example-node/node_modules/@bufbuild/protobuf/dist/cjs/google/protobuf/type_pb.d.ts @@ -0,0 +1,437 @@ +import { proto3 } from "../../proto3.js"; +import type { PartialMessage, PlainMessage } from "../../message.js"; +import { Message } from "../../message.js"; +import { SourceContext } from "./source_context_pb.js"; +import type { FieldList } from "../../field-list.js"; +import type { BinaryReadOptions } from "../../binary-format.js"; +import type { JsonReadOptions, JsonValue } from "../../json-format.js"; +import { Any } from "./any_pb.js"; +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +export declare enum Syntax { + /** + * Syntax `proto2`. + * + * @generated from enum value: SYNTAX_PROTO2 = 0; + */ + PROTO2 = 0, + /** + * Syntax `proto3`. + * + * @generated from enum value: SYNTAX_PROTO3 = 1; + */ + PROTO3 = 1, + /** + * Syntax `editions`. + * + * @generated from enum value: SYNTAX_EDITIONS = 2; + */ + EDITIONS = 2 +} +/** + * A protocol buffer message type. + * + * @generated from message google.protobuf.Type + */ +export declare class Type extends Message { + /** + * The fully qualified message name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The list of fields. + * + * @generated from field: repeated google.protobuf.Field fields = 2; + */ + fields: Field[]; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * @generated from field: repeated string oneofs = 3; + */ + oneofs: string[]; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 4; + */ + options: Option[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 6; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 7; + */ + edition: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Type"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Type; + static fromJson(jsonValue: JsonValue, options?: Partial): Type; + static fromJsonString(jsonString: string, options?: Partial): Type; + static equals(a: Type | PlainMessage | undefined, b: Type | PlainMessage | undefined): boolean; +} +/** + * A single field of a message type. + * + * @generated from message google.protobuf.Field + */ +export declare class Field extends Message { + /** + * The field type. + * + * @generated from field: google.protobuf.Field.Kind kind = 1; + */ + kind: Field_Kind; + /** + * The field cardinality. + * + * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality: Field_Cardinality; + /** + * The field number. + * + * @generated from field: int32 number = 3; + */ + number: number; + /** + * The field name. + * + * @generated from field: string name = 4; + */ + name: string; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * @generated from field: string type_url = 6; + */ + typeUrl: string; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * @generated from field: int32 oneof_index = 7; + */ + oneofIndex: number; + /** + * Whether to use alternative packed wire representation. + * + * @generated from field: bool packed = 8; + */ + packed: boolean; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 9; + */ + options: Option[]; + /** + * The field JSON name. + * + * @generated from field: string json_name = 10; + */ + jsonName: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * @generated from field: string default_value = 11; + */ + defaultValue: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Field"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Field; + static fromJson(jsonValue: JsonValue, options?: Partial): Field; + static fromJsonString(jsonString: string, options?: Partial): Field; + static equals(a: Field | PlainMessage | undefined, b: Field | PlainMessage | undefined): boolean; +} +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +export declare enum Field_Kind { + /** + * Field type unknown. + * + * @generated from enum value: TYPE_UNKNOWN = 0; + */ + TYPE_UNKNOWN = 0, + /** + * Field type double. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + TYPE_DOUBLE = 1, + /** + * Field type float. + * + * @generated from enum value: TYPE_FLOAT = 2; + */ + TYPE_FLOAT = 2, + /** + * Field type int64. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + TYPE_INT64 = 3, + /** + * Field type uint64. + * + * @generated from enum value: TYPE_UINT64 = 4; + */ + TYPE_UINT64 = 4, + /** + * Field type int32. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + TYPE_INT32 = 5, + /** + * Field type fixed64. + * + * @generated from enum value: TYPE_FIXED64 = 6; + */ + TYPE_FIXED64 = 6, + /** + * Field type fixed32. + * + * @generated from enum value: TYPE_FIXED32 = 7; + */ + TYPE_FIXED32 = 7, + /** + * Field type bool. + * + * @generated from enum value: TYPE_BOOL = 8; + */ + TYPE_BOOL = 8, + /** + * Field type string. + * + * @generated from enum value: TYPE_STRING = 9; + */ + TYPE_STRING = 9, + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + TYPE_GROUP = 10, + /** + * Field type message. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + TYPE_MESSAGE = 11, + /** + * Field type bytes. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + TYPE_BYTES = 12, + /** + * Field type uint32. + * + * @generated from enum value: TYPE_UINT32 = 13; + */ + TYPE_UINT32 = 13, + /** + * Field type enum. + * + * @generated from enum value: TYPE_ENUM = 14; + */ + TYPE_ENUM = 14, + /** + * Field type sfixed32. + * + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + TYPE_SFIXED32 = 15, + /** + * Field type sfixed64. + * + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + TYPE_SFIXED64 = 16, + /** + * Field type sint32. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + TYPE_SINT32 = 17, + /** + * Field type sint64. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + TYPE_SINT64 = 18 +} +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +export declare enum Field_Cardinality { + /** + * For fields with unknown cardinality. + * + * @generated from enum value: CARDINALITY_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * For optional fields. + * + * @generated from enum value: CARDINALITY_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * For required fields. Proto2 syntax only. + * + * @generated from enum value: CARDINALITY_REQUIRED = 2; + */ + REQUIRED = 2, + /** + * For repeated fields. + * + * @generated from enum value: CARDINALITY_REPEATED = 3; + */ + REPEATED = 3 +} +/** + * Enum type definition. + * + * @generated from message google.protobuf.Enum + */ +export declare class Enum extends Message { + /** + * Enum type name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * Enum value definitions. + * + * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue: EnumValue[]; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContext; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 5; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 6; + */ + edition: string; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.Enum"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): Enum; + static fromJson(jsonValue: JsonValue, options?: Partial): Enum; + static fromJsonString(jsonString: string, options?: Partial): Enum; + static equals(a: Enum | PlainMessage | undefined, b: Enum | PlainMessage | undefined): boolean; +} +/** + * Enum value definition. + * + * @generated from message google.protobuf.EnumValue + */ +export declare class EnumValue extends Message { + /** + * Enum value name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * Enum value number. + * + * @generated from field: int32 number = 2; + */ + number: number; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + constructor(data?: PartialMessage); + static readonly runtime: typeof proto3; + static readonly typeName = "google.protobuf.EnumValue"; + static readonly fields: FieldList; + static fromBinary(bytes: Uint8Array, options?: Partial): EnumValue; + static fromJson(jsonValue: JsonValue, options?: Partial): EnumValue; + static fromJsonString(jsonString: string, options?: Partial): EnumValue; + static equals(a: EnumValue | PlainMessage | undefined, b: EnumValue | PlainMessage | undefined): boolean; +} +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + * + * @generated from message google.protobuf.Option + */ +export declare class Option extends Message