diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 450c8495..8611d158 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -31,6 +31,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Install Protoc + uses: arduino/setup-protoc@v3 - name: Setup Pages uses: actions/configure-pages@v3 - name: Install node dependencies @@ -46,4 +48,4 @@ jobs: path: "docs" - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/node.yaml b/.github/workflows/node.yaml index 9f2ec93d..ce3a5ff0 100644 --- a/.github/workflows/node.yaml +++ b/.github/workflows/node.yaml @@ -23,7 +23,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: 'npm' + cache: "npm" + + - name: Install Protoc + uses: arduino/setup-protoc@v3 - name: Install dependencies ⬇️ run: yarn --immutable diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml index 27b28e48..277baaf6 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright.yaml @@ -19,7 +19,8 @@ jobs: with: node-version: 20 cache: npm - + - name: Install Protoc + uses: arduino/setup-protoc@v3 - name: Install dependencies ⬇️ run: yarn --immutable diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b60764a8..892947f7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,11 +13,14 @@ jobs: # Setup .npmrc file to publish to npm - uses: actions/setup-node@v4 with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + + - name: Install Protoc + uses: arduino/setup-protoc@v3 - run: yarn - run: yarn build - - run: yarn npm publish --access public + - run: yarn npm publish --access public working-directory: packages/ts-client env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -31,11 +34,11 @@ jobs: # Setup .npmrc file to publish to npm - uses: actions/setup-node@v4 with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' + node-version: "20.x" + registry-url: "https://registry.npmjs.org" - run: yarn - run: yarn build - - run: yarn npm publish --access public + - run: yarn npm publish --access public working-directory: packages/react-client env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitmodules b/.gitmodules index b9346de2..e9c585c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,3 @@ -[submodule "packages/ts-client/protos"] - path = packages/ts-client/protos +[submodule "packages/protobufs/protos"] + path = packages/protobufs/protos url = https://github.com/fishjam-cloud/protos.git - branch = master diff --git a/e2e-tests/ts-client/app/package.json b/e2e-tests/ts-client/app/package.json index 6441ff92..c41c8d8e 100644 --- a/e2e-tests/ts-client/app/package.json +++ b/e2e-tests/ts-client/app/package.json @@ -16,6 +16,7 @@ "preview": "vite preview" }, "dependencies": { + "@fishjam-cloud/protobufs": "workspace:*", "@fishjam-cloud/ts-client": "workspace:*", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/e2e-tests/ts-client/app/src/App.tsx b/e2e-tests/ts-client/app/src/App.tsx index 292a3dd2..00a9e1b9 100644 --- a/e2e-tests/ts-client/app/src/App.tsx +++ b/e2e-tests/ts-client/app/src/App.tsx @@ -8,8 +8,8 @@ import type { BandwidthLimit, SimulcastConfig, } from "@fishjam-cloud/ts-client"; -import { WebRTCEndpoint } from "@fishjam-cloud/ts-client"; -import { PeerMessage } from "@fishjam-cloud/ts-client/protos"; +import { WebRTCEndpoint, sdkVersion } from "@fishjam-cloud/ts-client"; +import { PeerMessage } from "@fishjam-cloud/protobufs/fishjamPeer"; import { useEffect, useState, useSyncExternalStore } from "react"; import { MockComponent } from "./MockComponent"; import { VideoPlayerWithDetector } from "./VideoPlayerWithDetector"; @@ -101,7 +101,9 @@ function connect(token: string, metadata: EndpointMetadata) { websocket.binaryType = "arraybuffer"; function socketOpenHandler(_event: Event) { - const message = PeerMessage.encode({ authRequest: { token } }).finish(); + const message = PeerMessage.encode({ + authRequest: { token, sdkVersion }, + }).finish(); websocket.send(message); } diff --git a/package.json b/package.json index fa5f11e2..b4f1e34b 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "license": "MIT", "private": true, "workspaces": [ + "packages/protobufs", + "packages/webrtc-client", "packages/ts-client", "packages/react-client", - "packages/webrtc-client", "examples/ts-client/*", "examples/react-client/*", "e2e-tests/ts-client/app", diff --git a/packages/protobufs/fishjam/media_events/peer/peer.ts b/packages/protobufs/fishjam/media_events/peer/peer.ts new file mode 100644 index 00000000..fe726727 --- /dev/null +++ b/packages/protobufs/fishjam/media_events/peer/peer.ts @@ -0,0 +1,1393 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc v5.28.2 +// source: fishjam/media_events/peer/peer.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Candidate, Variant, variantFromJSON, variantToJSON } from "../shared"; + +export const protobufPackage = "fishjam.media_events.peer"; + +/** Defines any type of message sent from Peer to Membrane RTC Engine */ +export interface MediaEvent { + connect?: MediaEvent_Connect | undefined; + disconnect?: MediaEvent_Disconnect | undefined; + updateEndpointMetadata?: MediaEvent_UpdateEndpointMetadata | undefined; + updateTrackMetadata?: MediaEvent_UpdateTrackMetadata | undefined; + renegotiateTracks?: MediaEvent_RenegotiateTracks | undefined; + candidate?: Candidate | undefined; + sdpOffer?: MediaEvent_SdpOffer | undefined; + trackBitrates?: MediaEvent_TrackBitrates | undefined; + enableTrackVariant?: MediaEvent_EnableTrackVariant | undefined; + disableTrackVariant?: MediaEvent_DisableTrackVariant | undefined; +} + +export interface MediaEvent_VariantBitrate { + variant: Variant; + bitrate: number; +} + +/** Sent when a peer wants to join WebRTC Endpoint. */ +export interface MediaEvent_Connect { + metadataJson: string; +} + +/** Sent when a peer disconnects from WebRTC Endpoint. */ +export interface MediaEvent_Disconnect { +} + +/** Sent when a peer wants to update its metadata */ +export interface MediaEvent_UpdateEndpointMetadata { + metadataJson: string; +} + +/** Sent when a peer wants to update its track's metadata */ +export interface MediaEvent_UpdateTrackMetadata { + trackId: string; + metadataJson: string; +} + +/** Sent when peer wants to renegatiate connection due to adding a track or removing a track */ +export interface MediaEvent_RenegotiateTracks { +} + +/** + * Sent as a response to `offerData` media event during renegotiation + * Maps contain only information about current peer's `sendonly` tracks. + * The "mid" is an identifier used to associate an RTP packet with an MLine from the SDP offer/answer. + */ +export interface MediaEvent_SdpOffer { + sdpOffer: string; + trackIdToMetadataJson: { [key: string]: string }; + /** Maps track_id to its bitrate. The track_id in the TrackBitrates message is ignored (we use the map key), so it can be ommited. */ + trackIdToBitrates: { [key: string]: MediaEvent_TrackBitrates }; + midToTrackId: { [key: string]: string }; +} + +export interface MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry { + key: string; + value: string; +} + +export interface MediaEvent_SdpOffer_TrackIdToBitratesEntry { + key: string; + value: MediaEvent_TrackBitrates | undefined; +} + +export interface MediaEvent_SdpOffer_MidToTrackIdEntry { + key: string; + value: string; +} + +/** Sent when Peer wants to update its track's bitrate */ +export interface MediaEvent_TrackBitrates { + trackId: string; + /** Bitrate of each variant. For non-simulcast tracks use VARIANT_UNSPECIFIED. */ + variantBitrates: MediaEvent_VariantBitrate[]; +} + +/** Sent when client disables one of the track variants */ +export interface MediaEvent_DisableTrackVariant { + trackId: string; + variant: Variant; +} + +/** Sent when client enables one of the track variants */ +export interface MediaEvent_EnableTrackVariant { + trackId: string; + variant: Variant; +} + +function createBaseMediaEvent(): MediaEvent { + return { + connect: undefined, + disconnect: undefined, + updateEndpointMetadata: undefined, + updateTrackMetadata: undefined, + renegotiateTracks: undefined, + candidate: undefined, + sdpOffer: undefined, + trackBitrates: undefined, + enableTrackVariant: undefined, + disableTrackVariant: undefined, + }; +} + +export const MediaEvent: MessageFns = { + encode(message: MediaEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.connect !== undefined) { + MediaEvent_Connect.encode(message.connect, writer.uint32(10).fork()).join(); + } + if (message.disconnect !== undefined) { + MediaEvent_Disconnect.encode(message.disconnect, writer.uint32(18).fork()).join(); + } + if (message.updateEndpointMetadata !== undefined) { + MediaEvent_UpdateEndpointMetadata.encode(message.updateEndpointMetadata, writer.uint32(26).fork()).join(); + } + if (message.updateTrackMetadata !== undefined) { + MediaEvent_UpdateTrackMetadata.encode(message.updateTrackMetadata, writer.uint32(34).fork()).join(); + } + if (message.renegotiateTracks !== undefined) { + MediaEvent_RenegotiateTracks.encode(message.renegotiateTracks, writer.uint32(42).fork()).join(); + } + if (message.candidate !== undefined) { + Candidate.encode(message.candidate, writer.uint32(50).fork()).join(); + } + if (message.sdpOffer !== undefined) { + MediaEvent_SdpOffer.encode(message.sdpOffer, writer.uint32(58).fork()).join(); + } + if (message.trackBitrates !== undefined) { + MediaEvent_TrackBitrates.encode(message.trackBitrates, writer.uint32(66).fork()).join(); + } + if (message.enableTrackVariant !== undefined) { + MediaEvent_EnableTrackVariant.encode(message.enableTrackVariant, writer.uint32(74).fork()).join(); + } + if (message.disableTrackVariant !== undefined) { + MediaEvent_DisableTrackVariant.encode(message.disableTrackVariant, writer.uint32(82).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.connect = MediaEvent_Connect.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.disconnect = MediaEvent_Disconnect.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.updateEndpointMetadata = MediaEvent_UpdateEndpointMetadata.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.updateTrackMetadata = MediaEvent_UpdateTrackMetadata.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.renegotiateTracks = MediaEvent_RenegotiateTracks.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.candidate = Candidate.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.sdpOffer = MediaEvent_SdpOffer.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.trackBitrates = MediaEvent_TrackBitrates.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.enableTrackVariant = MediaEvent_EnableTrackVariant.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.disableTrackVariant = MediaEvent_DisableTrackVariant.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent { + return { + connect: isSet(object.connect) ? MediaEvent_Connect.fromJSON(object.connect) : undefined, + disconnect: isSet(object.disconnect) ? MediaEvent_Disconnect.fromJSON(object.disconnect) : undefined, + updateEndpointMetadata: isSet(object.updateEndpointMetadata) + ? MediaEvent_UpdateEndpointMetadata.fromJSON(object.updateEndpointMetadata) + : undefined, + updateTrackMetadata: isSet(object.updateTrackMetadata) + ? MediaEvent_UpdateTrackMetadata.fromJSON(object.updateTrackMetadata) + : undefined, + renegotiateTracks: isSet(object.renegotiateTracks) + ? MediaEvent_RenegotiateTracks.fromJSON(object.renegotiateTracks) + : undefined, + candidate: isSet(object.candidate) ? Candidate.fromJSON(object.candidate) : undefined, + sdpOffer: isSet(object.sdpOffer) ? MediaEvent_SdpOffer.fromJSON(object.sdpOffer) : undefined, + trackBitrates: isSet(object.trackBitrates) ? MediaEvent_TrackBitrates.fromJSON(object.trackBitrates) : undefined, + enableTrackVariant: isSet(object.enableTrackVariant) + ? MediaEvent_EnableTrackVariant.fromJSON(object.enableTrackVariant) + : undefined, + disableTrackVariant: isSet(object.disableTrackVariant) + ? MediaEvent_DisableTrackVariant.fromJSON(object.disableTrackVariant) + : undefined, + }; + }, + + toJSON(message: MediaEvent): unknown { + const obj: any = {}; + if (message.connect !== undefined) { + obj.connect = MediaEvent_Connect.toJSON(message.connect); + } + if (message.disconnect !== undefined) { + obj.disconnect = MediaEvent_Disconnect.toJSON(message.disconnect); + } + if (message.updateEndpointMetadata !== undefined) { + obj.updateEndpointMetadata = MediaEvent_UpdateEndpointMetadata.toJSON(message.updateEndpointMetadata); + } + if (message.updateTrackMetadata !== undefined) { + obj.updateTrackMetadata = MediaEvent_UpdateTrackMetadata.toJSON(message.updateTrackMetadata); + } + if (message.renegotiateTracks !== undefined) { + obj.renegotiateTracks = MediaEvent_RenegotiateTracks.toJSON(message.renegotiateTracks); + } + if (message.candidate !== undefined) { + obj.candidate = Candidate.toJSON(message.candidate); + } + if (message.sdpOffer !== undefined) { + obj.sdpOffer = MediaEvent_SdpOffer.toJSON(message.sdpOffer); + } + if (message.trackBitrates !== undefined) { + obj.trackBitrates = MediaEvent_TrackBitrates.toJSON(message.trackBitrates); + } + if (message.enableTrackVariant !== undefined) { + obj.enableTrackVariant = MediaEvent_EnableTrackVariant.toJSON(message.enableTrackVariant); + } + if (message.disableTrackVariant !== undefined) { + obj.disableTrackVariant = MediaEvent_DisableTrackVariant.toJSON(message.disableTrackVariant); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent { + return MediaEvent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent { + const message = createBaseMediaEvent(); + message.connect = (object.connect !== undefined && object.connect !== null) + ? MediaEvent_Connect.fromPartial(object.connect) + : undefined; + message.disconnect = (object.disconnect !== undefined && object.disconnect !== null) + ? MediaEvent_Disconnect.fromPartial(object.disconnect) + : undefined; + message.updateEndpointMetadata = + (object.updateEndpointMetadata !== undefined && object.updateEndpointMetadata !== null) + ? MediaEvent_UpdateEndpointMetadata.fromPartial(object.updateEndpointMetadata) + : undefined; + message.updateTrackMetadata = (object.updateTrackMetadata !== undefined && object.updateTrackMetadata !== null) + ? MediaEvent_UpdateTrackMetadata.fromPartial(object.updateTrackMetadata) + : undefined; + message.renegotiateTracks = (object.renegotiateTracks !== undefined && object.renegotiateTracks !== null) + ? MediaEvent_RenegotiateTracks.fromPartial(object.renegotiateTracks) + : undefined; + message.candidate = (object.candidate !== undefined && object.candidate !== null) + ? Candidate.fromPartial(object.candidate) + : undefined; + message.sdpOffer = (object.sdpOffer !== undefined && object.sdpOffer !== null) + ? MediaEvent_SdpOffer.fromPartial(object.sdpOffer) + : undefined; + message.trackBitrates = (object.trackBitrates !== undefined && object.trackBitrates !== null) + ? MediaEvent_TrackBitrates.fromPartial(object.trackBitrates) + : undefined; + message.enableTrackVariant = (object.enableTrackVariant !== undefined && object.enableTrackVariant !== null) + ? MediaEvent_EnableTrackVariant.fromPartial(object.enableTrackVariant) + : undefined; + message.disableTrackVariant = (object.disableTrackVariant !== undefined && object.disableTrackVariant !== null) + ? MediaEvent_DisableTrackVariant.fromPartial(object.disableTrackVariant) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_VariantBitrate(): MediaEvent_VariantBitrate { + return { variant: 0, bitrate: 0 }; +} + +export const MediaEvent_VariantBitrate: MessageFns = { + encode(message: MediaEvent_VariantBitrate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.variant !== 0) { + writer.uint32(8).int32(message.variant); + } + if (message.bitrate !== 0) { + writer.uint32(16).int32(message.bitrate); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_VariantBitrate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_VariantBitrate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.variant = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.bitrate = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_VariantBitrate { + return { + variant: isSet(object.variant) ? variantFromJSON(object.variant) : 0, + bitrate: isSet(object.bitrate) ? globalThis.Number(object.bitrate) : 0, + }; + }, + + toJSON(message: MediaEvent_VariantBitrate): unknown { + const obj: any = {}; + if (message.variant !== 0) { + obj.variant = variantToJSON(message.variant); + } + if (message.bitrate !== 0) { + obj.bitrate = Math.round(message.bitrate); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_VariantBitrate { + return MediaEvent_VariantBitrate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_VariantBitrate { + const message = createBaseMediaEvent_VariantBitrate(); + message.variant = object.variant ?? 0; + message.bitrate = object.bitrate ?? 0; + return message; + }, +}; + +function createBaseMediaEvent_Connect(): MediaEvent_Connect { + return { metadataJson: "" }; +} + +export const MediaEvent_Connect: MessageFns = { + encode(message: MediaEvent_Connect, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.metadataJson !== "") { + writer.uint32(10).string(message.metadataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Connect { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Connect(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Connect { + return { metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "" }; + }, + + toJSON(message: MediaEvent_Connect): unknown { + const obj: any = {}; + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_Connect { + return MediaEvent_Connect.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_Connect { + const message = createBaseMediaEvent_Connect(); + message.metadataJson = object.metadataJson ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_Disconnect(): MediaEvent_Disconnect { + return {}; +} + +export const MediaEvent_Disconnect: MessageFns = { + encode(_: MediaEvent_Disconnect, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Disconnect { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Disconnect(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): MediaEvent_Disconnect { + return {}; + }, + + toJSON(_: MediaEvent_Disconnect): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MediaEvent_Disconnect { + return MediaEvent_Disconnect.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MediaEvent_Disconnect { + const message = createBaseMediaEvent_Disconnect(); + return message; + }, +}; + +function createBaseMediaEvent_UpdateEndpointMetadata(): MediaEvent_UpdateEndpointMetadata { + return { metadataJson: "" }; +} + +export const MediaEvent_UpdateEndpointMetadata: MessageFns = { + encode(message: MediaEvent_UpdateEndpointMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.metadataJson !== "") { + writer.uint32(10).string(message.metadataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_UpdateEndpointMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_UpdateEndpointMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_UpdateEndpointMetadata { + return { metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "" }; + }, + + toJSON(message: MediaEvent_UpdateEndpointMetadata): unknown { + const obj: any = {}; + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_UpdateEndpointMetadata { + return MediaEvent_UpdateEndpointMetadata.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_UpdateEndpointMetadata { + const message = createBaseMediaEvent_UpdateEndpointMetadata(); + message.metadataJson = object.metadataJson ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_UpdateTrackMetadata(): MediaEvent_UpdateTrackMetadata { + return { trackId: "", metadataJson: "" }; +} + +export const MediaEvent_UpdateTrackMetadata: MessageFns = { + encode(message: MediaEvent_UpdateTrackMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.trackId !== "") { + writer.uint32(10).string(message.trackId); + } + if (message.metadataJson !== "") { + writer.uint32(18).string(message.metadataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_UpdateTrackMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_UpdateTrackMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_UpdateTrackMetadata { + return { + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "", + }; + }, + + toJSON(message: MediaEvent_UpdateTrackMetadata): unknown { + const obj: any = {}; + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_UpdateTrackMetadata { + return MediaEvent_UpdateTrackMetadata.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_UpdateTrackMetadata { + const message = createBaseMediaEvent_UpdateTrackMetadata(); + message.trackId = object.trackId ?? ""; + message.metadataJson = object.metadataJson ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_RenegotiateTracks(): MediaEvent_RenegotiateTracks { + return {}; +} + +export const MediaEvent_RenegotiateTracks: MessageFns = { + encode(_: MediaEvent_RenegotiateTracks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_RenegotiateTracks { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_RenegotiateTracks(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): MediaEvent_RenegotiateTracks { + return {}; + }, + + toJSON(_: MediaEvent_RenegotiateTracks): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): MediaEvent_RenegotiateTracks { + return MediaEvent_RenegotiateTracks.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): MediaEvent_RenegotiateTracks { + const message = createBaseMediaEvent_RenegotiateTracks(); + return message; + }, +}; + +function createBaseMediaEvent_SdpOffer(): MediaEvent_SdpOffer { + return { sdpOffer: "", trackIdToMetadataJson: {}, trackIdToBitrates: {}, midToTrackId: {} }; +} + +export const MediaEvent_SdpOffer: MessageFns = { + encode(message: MediaEvent_SdpOffer, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sdpOffer !== "") { + writer.uint32(10).string(message.sdpOffer); + } + Object.entries(message.trackIdToMetadataJson).forEach(([key, value]) => { + MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry.encode({ key: key as any, value }, writer.uint32(18).fork()) + .join(); + }); + Object.entries(message.trackIdToBitrates).forEach(([key, value]) => { + MediaEvent_SdpOffer_TrackIdToBitratesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + Object.entries(message.midToTrackId).forEach(([key, value]) => { + MediaEvent_SdpOffer_MidToTrackIdEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_SdpOffer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_SdpOffer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sdpOffer = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.trackIdToMetadataJson[entry2.key] = entry2.value; + } + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = MediaEvent_SdpOffer_TrackIdToBitratesEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.trackIdToBitrates[entry3.key] = entry3.value; + } + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = MediaEvent_SdpOffer_MidToTrackIdEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.midToTrackId[entry4.key] = entry4.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_SdpOffer { + return { + sdpOffer: isSet(object.sdpOffer) ? globalThis.String(object.sdpOffer) : "", + trackIdToMetadataJson: isObject(object.trackIdToMetadataJson) + ? Object.entries(object.trackIdToMetadataJson).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + trackIdToBitrates: isObject(object.trackIdToBitrates) + ? Object.entries(object.trackIdToBitrates).reduce<{ [key: string]: MediaEvent_TrackBitrates }>( + (acc, [key, value]) => { + acc[key] = MediaEvent_TrackBitrates.fromJSON(value); + return acc; + }, + {}, + ) + : {}, + midToTrackId: isObject(object.midToTrackId) + ? Object.entries(object.midToTrackId).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: MediaEvent_SdpOffer): unknown { + const obj: any = {}; + if (message.sdpOffer !== "") { + obj.sdpOffer = message.sdpOffer; + } + if (message.trackIdToMetadataJson) { + const entries = Object.entries(message.trackIdToMetadataJson); + if (entries.length > 0) { + obj.trackIdToMetadataJson = {}; + entries.forEach(([k, v]) => { + obj.trackIdToMetadataJson[k] = v; + }); + } + } + if (message.trackIdToBitrates) { + const entries = Object.entries(message.trackIdToBitrates); + if (entries.length > 0) { + obj.trackIdToBitrates = {}; + entries.forEach(([k, v]) => { + obj.trackIdToBitrates[k] = MediaEvent_TrackBitrates.toJSON(v); + }); + } + } + if (message.midToTrackId) { + const entries = Object.entries(message.midToTrackId); + if (entries.length > 0) { + obj.midToTrackId = {}; + entries.forEach(([k, v]) => { + obj.midToTrackId[k] = v; + }); + } + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_SdpOffer { + return MediaEvent_SdpOffer.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_SdpOffer { + const message = createBaseMediaEvent_SdpOffer(); + message.sdpOffer = object.sdpOffer ?? ""; + message.trackIdToMetadataJson = Object.entries(object.trackIdToMetadataJson ?? {}).reduce< + { [key: string]: string } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + message.trackIdToBitrates = Object.entries(object.trackIdToBitrates ?? {}).reduce< + { [key: string]: MediaEvent_TrackBitrates } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = MediaEvent_TrackBitrates.fromPartial(value); + } + return acc; + }, {}); + message.midToTrackId = Object.entries(object.midToTrackId ?? {}).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseMediaEvent_SdpOffer_TrackIdToMetadataJsonEntry(): MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry { + return { key: "", value: "" }; +} + +export const MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry: MessageFns< + MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry +> = { + encode( + message: MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_SdpOffer_TrackIdToMetadataJsonEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry { + return MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_SdpOffer_TrackIdToMetadataJsonEntry { + const message = createBaseMediaEvent_SdpOffer_TrackIdToMetadataJsonEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_SdpOffer_TrackIdToBitratesEntry(): MediaEvent_SdpOffer_TrackIdToBitratesEntry { + return { key: "", value: undefined }; +} + +export const MediaEvent_SdpOffer_TrackIdToBitratesEntry: MessageFns = { + encode(message: MediaEvent_SdpOffer_TrackIdToBitratesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + MediaEvent_TrackBitrates.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_SdpOffer_TrackIdToBitratesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_SdpOffer_TrackIdToBitratesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = MediaEvent_TrackBitrates.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_SdpOffer_TrackIdToBitratesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? MediaEvent_TrackBitrates.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: MediaEvent_SdpOffer_TrackIdToBitratesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = MediaEvent_TrackBitrates.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_SdpOffer_TrackIdToBitratesEntry { + return MediaEvent_SdpOffer_TrackIdToBitratesEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_SdpOffer_TrackIdToBitratesEntry { + const message = createBaseMediaEvent_SdpOffer_TrackIdToBitratesEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? MediaEvent_TrackBitrates.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_SdpOffer_MidToTrackIdEntry(): MediaEvent_SdpOffer_MidToTrackIdEntry { + return { key: "", value: "" }; +} + +export const MediaEvent_SdpOffer_MidToTrackIdEntry: MessageFns = { + encode(message: MediaEvent_SdpOffer_MidToTrackIdEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_SdpOffer_MidToTrackIdEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_SdpOffer_MidToTrackIdEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_SdpOffer_MidToTrackIdEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: MediaEvent_SdpOffer_MidToTrackIdEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_SdpOffer_MidToTrackIdEntry { + return MediaEvent_SdpOffer_MidToTrackIdEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_SdpOffer_MidToTrackIdEntry { + const message = createBaseMediaEvent_SdpOffer_MidToTrackIdEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_TrackBitrates(): MediaEvent_TrackBitrates { + return { trackId: "", variantBitrates: [] }; +} + +export const MediaEvent_TrackBitrates: MessageFns = { + encode(message: MediaEvent_TrackBitrates, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.trackId !== "") { + writer.uint32(10).string(message.trackId); + } + for (const v of message.variantBitrates) { + MediaEvent_VariantBitrate.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TrackBitrates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TrackBitrates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.variantBitrates.push(MediaEvent_VariantBitrate.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TrackBitrates { + return { + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + variantBitrates: globalThis.Array.isArray(object?.variantBitrates) + ? object.variantBitrates.map((e: any) => MediaEvent_VariantBitrate.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MediaEvent_TrackBitrates): unknown { + const obj: any = {}; + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.variantBitrates?.length) { + obj.variantBitrates = message.variantBitrates.map((e) => MediaEvent_VariantBitrate.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TrackBitrates { + return MediaEvent_TrackBitrates.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_TrackBitrates { + const message = createBaseMediaEvent_TrackBitrates(); + message.trackId = object.trackId ?? ""; + message.variantBitrates = object.variantBitrates?.map((e) => MediaEvent_VariantBitrate.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMediaEvent_DisableTrackVariant(): MediaEvent_DisableTrackVariant { + return { trackId: "", variant: 0 }; +} + +export const MediaEvent_DisableTrackVariant: MessageFns = { + encode(message: MediaEvent_DisableTrackVariant, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.trackId !== "") { + writer.uint32(10).string(message.trackId); + } + if (message.variant !== 0) { + writer.uint32(16).int32(message.variant); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_DisableTrackVariant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_DisableTrackVariant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.variant = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_DisableTrackVariant { + return { + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + variant: isSet(object.variant) ? variantFromJSON(object.variant) : 0, + }; + }, + + toJSON(message: MediaEvent_DisableTrackVariant): unknown { + const obj: any = {}; + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.variant !== 0) { + obj.variant = variantToJSON(message.variant); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_DisableTrackVariant { + return MediaEvent_DisableTrackVariant.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_DisableTrackVariant { + const message = createBaseMediaEvent_DisableTrackVariant(); + message.trackId = object.trackId ?? ""; + message.variant = object.variant ?? 0; + return message; + }, +}; + +function createBaseMediaEvent_EnableTrackVariant(): MediaEvent_EnableTrackVariant { + return { trackId: "", variant: 0 }; +} + +export const MediaEvent_EnableTrackVariant: MessageFns = { + encode(message: MediaEvent_EnableTrackVariant, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.trackId !== "") { + writer.uint32(10).string(message.trackId); + } + if (message.variant !== 0) { + writer.uint32(16).int32(message.variant); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_EnableTrackVariant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_EnableTrackVariant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.variant = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_EnableTrackVariant { + return { + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + variant: isSet(object.variant) ? variantFromJSON(object.variant) : 0, + }; + }, + + toJSON(message: MediaEvent_EnableTrackVariant): unknown { + const obj: any = {}; + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.variant !== 0) { + obj.variant = variantToJSON(message.variant); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_EnableTrackVariant { + return MediaEvent_EnableTrackVariant.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_EnableTrackVariant { + const message = createBaseMediaEvent_EnableTrackVariant(); + message.trackId = object.trackId ?? ""; + message.variant = object.variant ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/protobufs/fishjam/media_events/server/server.ts b/packages/protobufs/fishjam/media_events/server/server.ts new file mode 100644 index 00000000..76d21044 --- /dev/null +++ b/packages/protobufs/fishjam/media_events/server/server.ts @@ -0,0 +1,2569 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc v5.28.2 +// source: fishjam/media_events/server/server.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Candidate, Variant, variantFromJSON, variantToJSON } from "../shared"; + +export const protobufPackage = "fishjam.media_events.server"; + +/** Defines any type of message sent from Membrane RTC Engine to Peer */ +export interface MediaEvent { + endpointUpdated?: MediaEvent_EndpointUpdated | undefined; + trackUpdated?: MediaEvent_TrackUpdated | undefined; + tracksAdded?: MediaEvent_TracksAdded | undefined; + tracksRemoved?: MediaEvent_TracksRemoved | undefined; + endpointAdded?: MediaEvent_EndpointAdded | undefined; + endpointRemoved?: MediaEvent_EndpointRemoved | undefined; + connected?: MediaEvent_Connected | undefined; + error?: MediaEvent_Error | undefined; + offerData?: MediaEvent_OfferData | undefined; + candidate?: Candidate | undefined; + sdpAnswer?: MediaEvent_SdpAnswer | undefined; + vadNotification?: MediaEvent_VadNotification | undefined; + trackVariantSwitched?: MediaEvent_TrackVariantSwitched | undefined; + trackVariantDisabled?: MediaEvent_TrackVariantDisabled | undefined; + trackVariantEnabled?: MediaEvent_TrackVariantEnabled | undefined; +} + +/** SCHEMAS */ +export interface MediaEvent_Track { + metadataJson: string; + simulcastConfig: MediaEvent_Track_SimulcastConfig | undefined; +} + +export interface MediaEvent_Track_SimulcastConfig { + enabled: boolean; + enabledVariants: Variant[]; + disabledVariants: Variant[]; +} + +export interface MediaEvent_Endpoint { + endpointType: string; + metadataJson: string; + trackIdToTrack: { [key: string]: MediaEvent_Track }; +} + +export interface MediaEvent_Endpoint_TrackIdToTrackEntry { + key: string; + value: MediaEvent_Track | undefined; +} + +export interface MediaEvent_IceServer { + credential: string; + urls: string[]; + username: string; +} + +/** Sent when metadata of one of the endpoints was updated */ +export interface MediaEvent_EndpointUpdated { + endpointId: string; + metadataJson: string; +} + +/** Sent when metadata of one of the tracks was updated */ +export interface MediaEvent_TrackUpdated { + endpointId: string; + trackId: string; + metadataJson: string; +} + +/** Sent to informs that one of the peers has added one or more tracks. */ +export interface MediaEvent_TracksAdded { + endpointId: string; + trackIdToTrack: { [key: string]: MediaEvent_Track }; +} + +export interface MediaEvent_TracksAdded_TrackIdToTrackEntry { + key: string; + value: MediaEvent_Track | undefined; +} + +/** Sent to informs that one of the peers has removed one or more tracks. */ +export interface MediaEvent_TracksRemoved { + endpointId: string; + trackIds: string[]; +} + +/** Sent to all peers in the room after a new endpoint was added. */ +export interface MediaEvent_EndpointAdded { + endpointId: string; + metadataJson: string; +} + +/** Sent to the peer after connecting to the WebRTC Endpoint. */ +export interface MediaEvent_Connected { + endpointId: string; + endpointIdToEndpoint: { [key: string]: MediaEvent_Endpoint }; + iceServers: MediaEvent_IceServer[]; +} + +export interface MediaEvent_Connected_EndpointIdToEndpointEntry { + key: string; + value: MediaEvent_Endpoint | undefined; +} + +/** Sent to all remaining peers in the room after some endpoint was removed. */ +export interface MediaEvent_EndpointRemoved { + endpointId: string; +} + +/** Sent to inform that an error occurred on the server providing a message to show */ +export interface MediaEvent_Error { + message: string; +} + +/** Sent to inform about the number of audio and video tracks that will be sent from the engine to the peer */ +export interface MediaEvent_OfferData { + tracksTypes: MediaEvent_OfferData_TrackTypes | undefined; +} + +export interface MediaEvent_OfferData_TrackTypes { + audio: number; + video: number; +} + +/** Sent after receiving `SdpOffer` from Peer */ +export interface MediaEvent_SdpAnswer { + sdpAnswer: string; + midToTrackId: { [key: string]: string }; +} + +export interface MediaEvent_SdpAnswer_MidToTrackIdEntry { + key: string; + value: string; +} + +/** + * Sent to inform that the track denoted by `trackId` has changed their voice actiivty + * For this notification to work, the server must be configured to use VAD extension + * and the sender must support it. + */ +export interface MediaEvent_VadNotification { + trackId: string; + status: MediaEvent_VadNotification_Status; +} + +export enum MediaEvent_VadNotification_Status { + STATUS_UNSPECIFIED = 0, + STATUS_SILENCE = 1, + STATUS_SPEECH = 2, + UNRECOGNIZED = -1, +} + +export function mediaEvent_VadNotification_StatusFromJSON(object: any): MediaEvent_VadNotification_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return MediaEvent_VadNotification_Status.STATUS_UNSPECIFIED; + case 1: + case "STATUS_SILENCE": + return MediaEvent_VadNotification_Status.STATUS_SILENCE; + case 2: + case "STATUS_SPEECH": + return MediaEvent_VadNotification_Status.STATUS_SPEECH; + case -1: + case "UNRECOGNIZED": + default: + return MediaEvent_VadNotification_Status.UNRECOGNIZED; + } +} + +export function mediaEvent_VadNotification_StatusToJSON(object: MediaEvent_VadNotification_Status): string { + switch (object) { + case MediaEvent_VadNotification_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case MediaEvent_VadNotification_Status.STATUS_SILENCE: + return "STATUS_SILENCE"; + case MediaEvent_VadNotification_Status.STATUS_SPEECH: + return "STATUS_SPEECH"; + case MediaEvent_VadNotification_Status.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Informs that track's variant has been changed */ +export interface MediaEvent_TrackVariantSwitched { + endpointId: string; + trackId: string; + variant: Variant; +} + +/** Sent when track's variant has been disabled */ +export interface MediaEvent_TrackVariantDisabled { + endpointId: string; + trackId: string; + variant: Variant; +} + +/** Sent when track's variant has been enabled */ +export interface MediaEvent_TrackVariantEnabled { + endpointId: string; + trackId: string; + variant: Variant; +} + +function createBaseMediaEvent(): MediaEvent { + return { + endpointUpdated: undefined, + trackUpdated: undefined, + tracksAdded: undefined, + tracksRemoved: undefined, + endpointAdded: undefined, + endpointRemoved: undefined, + connected: undefined, + error: undefined, + offerData: undefined, + candidate: undefined, + sdpAnswer: undefined, + vadNotification: undefined, + trackVariantSwitched: undefined, + trackVariantDisabled: undefined, + trackVariantEnabled: undefined, + }; +} + +export const MediaEvent: MessageFns = { + encode(message: MediaEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointUpdated !== undefined) { + MediaEvent_EndpointUpdated.encode(message.endpointUpdated, writer.uint32(10).fork()).join(); + } + if (message.trackUpdated !== undefined) { + MediaEvent_TrackUpdated.encode(message.trackUpdated, writer.uint32(18).fork()).join(); + } + if (message.tracksAdded !== undefined) { + MediaEvent_TracksAdded.encode(message.tracksAdded, writer.uint32(26).fork()).join(); + } + if (message.tracksRemoved !== undefined) { + MediaEvent_TracksRemoved.encode(message.tracksRemoved, writer.uint32(34).fork()).join(); + } + if (message.endpointAdded !== undefined) { + MediaEvent_EndpointAdded.encode(message.endpointAdded, writer.uint32(42).fork()).join(); + } + if (message.endpointRemoved !== undefined) { + MediaEvent_EndpointRemoved.encode(message.endpointRemoved, writer.uint32(50).fork()).join(); + } + if (message.connected !== undefined) { + MediaEvent_Connected.encode(message.connected, writer.uint32(58).fork()).join(); + } + if (message.error !== undefined) { + MediaEvent_Error.encode(message.error, writer.uint32(66).fork()).join(); + } + if (message.offerData !== undefined) { + MediaEvent_OfferData.encode(message.offerData, writer.uint32(74).fork()).join(); + } + if (message.candidate !== undefined) { + Candidate.encode(message.candidate, writer.uint32(82).fork()).join(); + } + if (message.sdpAnswer !== undefined) { + MediaEvent_SdpAnswer.encode(message.sdpAnswer, writer.uint32(90).fork()).join(); + } + if (message.vadNotification !== undefined) { + MediaEvent_VadNotification.encode(message.vadNotification, writer.uint32(98).fork()).join(); + } + if (message.trackVariantSwitched !== undefined) { + MediaEvent_TrackVariantSwitched.encode(message.trackVariantSwitched, writer.uint32(106).fork()).join(); + } + if (message.trackVariantDisabled !== undefined) { + MediaEvent_TrackVariantDisabled.encode(message.trackVariantDisabled, writer.uint32(114).fork()).join(); + } + if (message.trackVariantEnabled !== undefined) { + MediaEvent_TrackVariantEnabled.encode(message.trackVariantEnabled, writer.uint32(122).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointUpdated = MediaEvent_EndpointUpdated.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.trackUpdated = MediaEvent_TrackUpdated.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.tracksAdded = MediaEvent_TracksAdded.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.tracksRemoved = MediaEvent_TracksRemoved.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.endpointAdded = MediaEvent_EndpointAdded.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.endpointRemoved = MediaEvent_EndpointRemoved.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.connected = MediaEvent_Connected.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.error = MediaEvent_Error.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.offerData = MediaEvent_OfferData.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.candidate = Candidate.decode(reader, reader.uint32()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.sdpAnswer = MediaEvent_SdpAnswer.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.vadNotification = MediaEvent_VadNotification.decode(reader, reader.uint32()); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.trackVariantSwitched = MediaEvent_TrackVariantSwitched.decode(reader, reader.uint32()); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.trackVariantDisabled = MediaEvent_TrackVariantDisabled.decode(reader, reader.uint32()); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.trackVariantEnabled = MediaEvent_TrackVariantEnabled.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent { + return { + endpointUpdated: isSet(object.endpointUpdated) + ? MediaEvent_EndpointUpdated.fromJSON(object.endpointUpdated) + : undefined, + trackUpdated: isSet(object.trackUpdated) ? MediaEvent_TrackUpdated.fromJSON(object.trackUpdated) : undefined, + tracksAdded: isSet(object.tracksAdded) ? MediaEvent_TracksAdded.fromJSON(object.tracksAdded) : undefined, + tracksRemoved: isSet(object.tracksRemoved) ? MediaEvent_TracksRemoved.fromJSON(object.tracksRemoved) : undefined, + endpointAdded: isSet(object.endpointAdded) ? MediaEvent_EndpointAdded.fromJSON(object.endpointAdded) : undefined, + endpointRemoved: isSet(object.endpointRemoved) + ? MediaEvent_EndpointRemoved.fromJSON(object.endpointRemoved) + : undefined, + connected: isSet(object.connected) ? MediaEvent_Connected.fromJSON(object.connected) : undefined, + error: isSet(object.error) ? MediaEvent_Error.fromJSON(object.error) : undefined, + offerData: isSet(object.offerData) ? MediaEvent_OfferData.fromJSON(object.offerData) : undefined, + candidate: isSet(object.candidate) ? Candidate.fromJSON(object.candidate) : undefined, + sdpAnswer: isSet(object.sdpAnswer) ? MediaEvent_SdpAnswer.fromJSON(object.sdpAnswer) : undefined, + vadNotification: isSet(object.vadNotification) + ? MediaEvent_VadNotification.fromJSON(object.vadNotification) + : undefined, + trackVariantSwitched: isSet(object.trackVariantSwitched) + ? MediaEvent_TrackVariantSwitched.fromJSON(object.trackVariantSwitched) + : undefined, + trackVariantDisabled: isSet(object.trackVariantDisabled) + ? MediaEvent_TrackVariantDisabled.fromJSON(object.trackVariantDisabled) + : undefined, + trackVariantEnabled: isSet(object.trackVariantEnabled) + ? MediaEvent_TrackVariantEnabled.fromJSON(object.trackVariantEnabled) + : undefined, + }; + }, + + toJSON(message: MediaEvent): unknown { + const obj: any = {}; + if (message.endpointUpdated !== undefined) { + obj.endpointUpdated = MediaEvent_EndpointUpdated.toJSON(message.endpointUpdated); + } + if (message.trackUpdated !== undefined) { + obj.trackUpdated = MediaEvent_TrackUpdated.toJSON(message.trackUpdated); + } + if (message.tracksAdded !== undefined) { + obj.tracksAdded = MediaEvent_TracksAdded.toJSON(message.tracksAdded); + } + if (message.tracksRemoved !== undefined) { + obj.tracksRemoved = MediaEvent_TracksRemoved.toJSON(message.tracksRemoved); + } + if (message.endpointAdded !== undefined) { + obj.endpointAdded = MediaEvent_EndpointAdded.toJSON(message.endpointAdded); + } + if (message.endpointRemoved !== undefined) { + obj.endpointRemoved = MediaEvent_EndpointRemoved.toJSON(message.endpointRemoved); + } + if (message.connected !== undefined) { + obj.connected = MediaEvent_Connected.toJSON(message.connected); + } + if (message.error !== undefined) { + obj.error = MediaEvent_Error.toJSON(message.error); + } + if (message.offerData !== undefined) { + obj.offerData = MediaEvent_OfferData.toJSON(message.offerData); + } + if (message.candidate !== undefined) { + obj.candidate = Candidate.toJSON(message.candidate); + } + if (message.sdpAnswer !== undefined) { + obj.sdpAnswer = MediaEvent_SdpAnswer.toJSON(message.sdpAnswer); + } + if (message.vadNotification !== undefined) { + obj.vadNotification = MediaEvent_VadNotification.toJSON(message.vadNotification); + } + if (message.trackVariantSwitched !== undefined) { + obj.trackVariantSwitched = MediaEvent_TrackVariantSwitched.toJSON(message.trackVariantSwitched); + } + if (message.trackVariantDisabled !== undefined) { + obj.trackVariantDisabled = MediaEvent_TrackVariantDisabled.toJSON(message.trackVariantDisabled); + } + if (message.trackVariantEnabled !== undefined) { + obj.trackVariantEnabled = MediaEvent_TrackVariantEnabled.toJSON(message.trackVariantEnabled); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent { + return MediaEvent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent { + const message = createBaseMediaEvent(); + message.endpointUpdated = (object.endpointUpdated !== undefined && object.endpointUpdated !== null) + ? MediaEvent_EndpointUpdated.fromPartial(object.endpointUpdated) + : undefined; + message.trackUpdated = (object.trackUpdated !== undefined && object.trackUpdated !== null) + ? MediaEvent_TrackUpdated.fromPartial(object.trackUpdated) + : undefined; + message.tracksAdded = (object.tracksAdded !== undefined && object.tracksAdded !== null) + ? MediaEvent_TracksAdded.fromPartial(object.tracksAdded) + : undefined; + message.tracksRemoved = (object.tracksRemoved !== undefined && object.tracksRemoved !== null) + ? MediaEvent_TracksRemoved.fromPartial(object.tracksRemoved) + : undefined; + message.endpointAdded = (object.endpointAdded !== undefined && object.endpointAdded !== null) + ? MediaEvent_EndpointAdded.fromPartial(object.endpointAdded) + : undefined; + message.endpointRemoved = (object.endpointRemoved !== undefined && object.endpointRemoved !== null) + ? MediaEvent_EndpointRemoved.fromPartial(object.endpointRemoved) + : undefined; + message.connected = (object.connected !== undefined && object.connected !== null) + ? MediaEvent_Connected.fromPartial(object.connected) + : undefined; + message.error = (object.error !== undefined && object.error !== null) + ? MediaEvent_Error.fromPartial(object.error) + : undefined; + message.offerData = (object.offerData !== undefined && object.offerData !== null) + ? MediaEvent_OfferData.fromPartial(object.offerData) + : undefined; + message.candidate = (object.candidate !== undefined && object.candidate !== null) + ? Candidate.fromPartial(object.candidate) + : undefined; + message.sdpAnswer = (object.sdpAnswer !== undefined && object.sdpAnswer !== null) + ? MediaEvent_SdpAnswer.fromPartial(object.sdpAnswer) + : undefined; + message.vadNotification = (object.vadNotification !== undefined && object.vadNotification !== null) + ? MediaEvent_VadNotification.fromPartial(object.vadNotification) + : undefined; + message.trackVariantSwitched = (object.trackVariantSwitched !== undefined && object.trackVariantSwitched !== null) + ? MediaEvent_TrackVariantSwitched.fromPartial(object.trackVariantSwitched) + : undefined; + message.trackVariantDisabled = (object.trackVariantDisabled !== undefined && object.trackVariantDisabled !== null) + ? MediaEvent_TrackVariantDisabled.fromPartial(object.trackVariantDisabled) + : undefined; + message.trackVariantEnabled = (object.trackVariantEnabled !== undefined && object.trackVariantEnabled !== null) + ? MediaEvent_TrackVariantEnabled.fromPartial(object.trackVariantEnabled) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_Track(): MediaEvent_Track { + return { metadataJson: "", simulcastConfig: undefined }; +} + +export const MediaEvent_Track: MessageFns = { + encode(message: MediaEvent_Track, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.metadataJson !== "") { + writer.uint32(10).string(message.metadataJson); + } + if (message.simulcastConfig !== undefined) { + MediaEvent_Track_SimulcastConfig.encode(message.simulcastConfig, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Track { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Track(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.simulcastConfig = MediaEvent_Track_SimulcastConfig.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Track { + return { + metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "", + simulcastConfig: isSet(object.simulcastConfig) + ? MediaEvent_Track_SimulcastConfig.fromJSON(object.simulcastConfig) + : undefined, + }; + }, + + toJSON(message: MediaEvent_Track): unknown { + const obj: any = {}; + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + if (message.simulcastConfig !== undefined) { + obj.simulcastConfig = MediaEvent_Track_SimulcastConfig.toJSON(message.simulcastConfig); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_Track { + return MediaEvent_Track.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_Track { + const message = createBaseMediaEvent_Track(); + message.metadataJson = object.metadataJson ?? ""; + message.simulcastConfig = (object.simulcastConfig !== undefined && object.simulcastConfig !== null) + ? MediaEvent_Track_SimulcastConfig.fromPartial(object.simulcastConfig) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_Track_SimulcastConfig(): MediaEvent_Track_SimulcastConfig { + return { enabled: false, enabledVariants: [], disabledVariants: [] }; +} + +export const MediaEvent_Track_SimulcastConfig: MessageFns = { + encode(message: MediaEvent_Track_SimulcastConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.enabled !== false) { + writer.uint32(8).bool(message.enabled); + } + writer.uint32(18).fork(); + for (const v of message.enabledVariants) { + writer.int32(v); + } + writer.join(); + writer.uint32(26).fork(); + for (const v of message.disabledVariants) { + writer.int32(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Track_SimulcastConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Track_SimulcastConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.enabled = reader.bool(); + continue; + } + case 2: { + if (tag === 16) { + message.enabledVariants.push(reader.int32() as any); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.enabledVariants.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 3: { + if (tag === 24) { + message.disabledVariants.push(reader.int32() as any); + + continue; + } + + if (tag === 26) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.disabledVariants.push(reader.int32() as any); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Track_SimulcastConfig { + return { + enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false, + enabledVariants: globalThis.Array.isArray(object?.enabledVariants) + ? object.enabledVariants.map((e: any) => variantFromJSON(e)) + : [], + disabledVariants: globalThis.Array.isArray(object?.disabledVariants) + ? object.disabledVariants.map((e: any) => variantFromJSON(e)) + : [], + }; + }, + + toJSON(message: MediaEvent_Track_SimulcastConfig): unknown { + const obj: any = {}; + if (message.enabled !== false) { + obj.enabled = message.enabled; + } + if (message.enabledVariants?.length) { + obj.enabledVariants = message.enabledVariants.map((e) => variantToJSON(e)); + } + if (message.disabledVariants?.length) { + obj.disabledVariants = message.disabledVariants.map((e) => variantToJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_Track_SimulcastConfig { + return MediaEvent_Track_SimulcastConfig.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_Track_SimulcastConfig { + const message = createBaseMediaEvent_Track_SimulcastConfig(); + message.enabled = object.enabled ?? false; + message.enabledVariants = object.enabledVariants?.map((e) => e) || []; + message.disabledVariants = object.disabledVariants?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMediaEvent_Endpoint(): MediaEvent_Endpoint { + return { endpointType: "", metadataJson: "", trackIdToTrack: {} }; +} + +export const MediaEvent_Endpoint: MessageFns = { + encode(message: MediaEvent_Endpoint, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointType !== "") { + writer.uint32(18).string(message.endpointType); + } + if (message.metadataJson !== "") { + writer.uint32(26).string(message.metadataJson); + } + Object.entries(message.trackIdToTrack).forEach(([key, value]) => { + MediaEvent_Endpoint_TrackIdToTrackEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Endpoint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Endpoint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + message.endpointType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = MediaEvent_Endpoint_TrackIdToTrackEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.trackIdToTrack[entry4.key] = entry4.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Endpoint { + return { + endpointType: isSet(object.endpointType) ? globalThis.String(object.endpointType) : "", + metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "", + trackIdToTrack: isObject(object.trackIdToTrack) + ? Object.entries(object.trackIdToTrack).reduce<{ [key: string]: MediaEvent_Track }>((acc, [key, value]) => { + acc[key] = MediaEvent_Track.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: MediaEvent_Endpoint): unknown { + const obj: any = {}; + if (message.endpointType !== "") { + obj.endpointType = message.endpointType; + } + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + if (message.trackIdToTrack) { + const entries = Object.entries(message.trackIdToTrack); + if (entries.length > 0) { + obj.trackIdToTrack = {}; + entries.forEach(([k, v]) => { + obj.trackIdToTrack[k] = MediaEvent_Track.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_Endpoint { + return MediaEvent_Endpoint.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_Endpoint { + const message = createBaseMediaEvent_Endpoint(); + message.endpointType = object.endpointType ?? ""; + message.metadataJson = object.metadataJson ?? ""; + message.trackIdToTrack = Object.entries(object.trackIdToTrack ?? {}).reduce<{ [key: string]: MediaEvent_Track }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = MediaEvent_Track.fromPartial(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseMediaEvent_Endpoint_TrackIdToTrackEntry(): MediaEvent_Endpoint_TrackIdToTrackEntry { + return { key: "", value: undefined }; +} + +export const MediaEvent_Endpoint_TrackIdToTrackEntry: MessageFns = { + encode(message: MediaEvent_Endpoint_TrackIdToTrackEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + MediaEvent_Track.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Endpoint_TrackIdToTrackEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Endpoint_TrackIdToTrackEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = MediaEvent_Track.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Endpoint_TrackIdToTrackEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? MediaEvent_Track.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: MediaEvent_Endpoint_TrackIdToTrackEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = MediaEvent_Track.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_Endpoint_TrackIdToTrackEntry { + return MediaEvent_Endpoint_TrackIdToTrackEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_Endpoint_TrackIdToTrackEntry { + const message = createBaseMediaEvent_Endpoint_TrackIdToTrackEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? MediaEvent_Track.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_IceServer(): MediaEvent_IceServer { + return { credential: "", urls: [], username: "" }; +} + +export const MediaEvent_IceServer: MessageFns = { + encode(message: MediaEvent_IceServer, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.credential !== "") { + writer.uint32(10).string(message.credential); + } + for (const v of message.urls) { + writer.uint32(18).string(v!); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_IceServer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_IceServer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.credential = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.urls.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.username = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_IceServer { + return { + credential: isSet(object.credential) ? globalThis.String(object.credential) : "", + urls: globalThis.Array.isArray(object?.urls) ? object.urls.map((e: any) => globalThis.String(e)) : [], + username: isSet(object.username) ? globalThis.String(object.username) : "", + }; + }, + + toJSON(message: MediaEvent_IceServer): unknown { + const obj: any = {}; + if (message.credential !== "") { + obj.credential = message.credential; + } + if (message.urls?.length) { + obj.urls = message.urls; + } + if (message.username !== "") { + obj.username = message.username; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_IceServer { + return MediaEvent_IceServer.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_IceServer { + const message = createBaseMediaEvent_IceServer(); + message.credential = object.credential ?? ""; + message.urls = object.urls?.map((e) => e) || []; + message.username = object.username ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_EndpointUpdated(): MediaEvent_EndpointUpdated { + return { endpointId: "", metadataJson: "" }; +} + +export const MediaEvent_EndpointUpdated: MessageFns = { + encode(message: MediaEvent_EndpointUpdated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + if (message.metadataJson !== "") { + writer.uint32(18).string(message.metadataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_EndpointUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_EndpointUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_EndpointUpdated { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "", + }; + }, + + toJSON(message: MediaEvent_EndpointUpdated): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_EndpointUpdated { + return MediaEvent_EndpointUpdated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_EndpointUpdated { + const message = createBaseMediaEvent_EndpointUpdated(); + message.endpointId = object.endpointId ?? ""; + message.metadataJson = object.metadataJson ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_TrackUpdated(): MediaEvent_TrackUpdated { + return { endpointId: "", trackId: "", metadataJson: "" }; +} + +export const MediaEvent_TrackUpdated: MessageFns = { + encode(message: MediaEvent_TrackUpdated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + if (message.trackId !== "") { + writer.uint32(18).string(message.trackId); + } + if (message.metadataJson !== "") { + writer.uint32(26).string(message.metadataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TrackUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TrackUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TrackUpdated { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "", + }; + }, + + toJSON(message: MediaEvent_TrackUpdated): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TrackUpdated { + return MediaEvent_TrackUpdated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_TrackUpdated { + const message = createBaseMediaEvent_TrackUpdated(); + message.endpointId = object.endpointId ?? ""; + message.trackId = object.trackId ?? ""; + message.metadataJson = object.metadataJson ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_TracksAdded(): MediaEvent_TracksAdded { + return { endpointId: "", trackIdToTrack: {} }; +} + +export const MediaEvent_TracksAdded: MessageFns = { + encode(message: MediaEvent_TracksAdded, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + Object.entries(message.trackIdToTrack).forEach(([key, value]) => { + MediaEvent_TracksAdded_TrackIdToTrackEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TracksAdded { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TracksAdded(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = MediaEvent_TracksAdded_TrackIdToTrackEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.trackIdToTrack[entry2.key] = entry2.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TracksAdded { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + trackIdToTrack: isObject(object.trackIdToTrack) + ? Object.entries(object.trackIdToTrack).reduce<{ [key: string]: MediaEvent_Track }>((acc, [key, value]) => { + acc[key] = MediaEvent_Track.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: MediaEvent_TracksAdded): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.trackIdToTrack) { + const entries = Object.entries(message.trackIdToTrack); + if (entries.length > 0) { + obj.trackIdToTrack = {}; + entries.forEach(([k, v]) => { + obj.trackIdToTrack[k] = MediaEvent_Track.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TracksAdded { + return MediaEvent_TracksAdded.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_TracksAdded { + const message = createBaseMediaEvent_TracksAdded(); + message.endpointId = object.endpointId ?? ""; + message.trackIdToTrack = Object.entries(object.trackIdToTrack ?? {}).reduce<{ [key: string]: MediaEvent_Track }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = MediaEvent_Track.fromPartial(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseMediaEvent_TracksAdded_TrackIdToTrackEntry(): MediaEvent_TracksAdded_TrackIdToTrackEntry { + return { key: "", value: undefined }; +} + +export const MediaEvent_TracksAdded_TrackIdToTrackEntry: MessageFns = { + encode(message: MediaEvent_TracksAdded_TrackIdToTrackEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + MediaEvent_Track.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TracksAdded_TrackIdToTrackEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TracksAdded_TrackIdToTrackEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = MediaEvent_Track.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TracksAdded_TrackIdToTrackEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? MediaEvent_Track.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: MediaEvent_TracksAdded_TrackIdToTrackEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = MediaEvent_Track.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_TracksAdded_TrackIdToTrackEntry { + return MediaEvent_TracksAdded_TrackIdToTrackEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_TracksAdded_TrackIdToTrackEntry { + const message = createBaseMediaEvent_TracksAdded_TrackIdToTrackEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? MediaEvent_Track.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_TracksRemoved(): MediaEvent_TracksRemoved { + return { endpointId: "", trackIds: [] }; +} + +export const MediaEvent_TracksRemoved: MessageFns = { + encode(message: MediaEvent_TracksRemoved, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + for (const v of message.trackIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TracksRemoved { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TracksRemoved(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.trackIds.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TracksRemoved { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + trackIds: globalThis.Array.isArray(object?.trackIds) ? object.trackIds.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: MediaEvent_TracksRemoved): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.trackIds?.length) { + obj.trackIds = message.trackIds; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TracksRemoved { + return MediaEvent_TracksRemoved.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_TracksRemoved { + const message = createBaseMediaEvent_TracksRemoved(); + message.endpointId = object.endpointId ?? ""; + message.trackIds = object.trackIds?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMediaEvent_EndpointAdded(): MediaEvent_EndpointAdded { + return { endpointId: "", metadataJson: "" }; +} + +export const MediaEvent_EndpointAdded: MessageFns = { + encode(message: MediaEvent_EndpointAdded, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + if (message.metadataJson !== "") { + writer.uint32(18).string(message.metadataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_EndpointAdded { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_EndpointAdded(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_EndpointAdded { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + metadataJson: isSet(object.metadataJson) ? globalThis.String(object.metadataJson) : "", + }; + }, + + toJSON(message: MediaEvent_EndpointAdded): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.metadataJson !== "") { + obj.metadataJson = message.metadataJson; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_EndpointAdded { + return MediaEvent_EndpointAdded.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_EndpointAdded { + const message = createBaseMediaEvent_EndpointAdded(); + message.endpointId = object.endpointId ?? ""; + message.metadataJson = object.metadataJson ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_Connected(): MediaEvent_Connected { + return { endpointId: "", endpointIdToEndpoint: {}, iceServers: [] }; +} + +export const MediaEvent_Connected: MessageFns = { + encode(message: MediaEvent_Connected, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + Object.entries(message.endpointIdToEndpoint).forEach(([key, value]) => { + MediaEvent_Connected_EndpointIdToEndpointEntry.encode({ key: key as any, value }, writer.uint32(18).fork()) + .join(); + }); + for (const v of message.iceServers) { + MediaEvent_IceServer.encode(v!, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Connected { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Connected(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = MediaEvent_Connected_EndpointIdToEndpointEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.endpointIdToEndpoint[entry2.key] = entry2.value; + } + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.iceServers.push(MediaEvent_IceServer.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Connected { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + endpointIdToEndpoint: isObject(object.endpointIdToEndpoint) + ? Object.entries(object.endpointIdToEndpoint).reduce<{ [key: string]: MediaEvent_Endpoint }>( + (acc, [key, value]) => { + acc[key] = MediaEvent_Endpoint.fromJSON(value); + return acc; + }, + {}, + ) + : {}, + iceServers: globalThis.Array.isArray(object?.iceServers) + ? object.iceServers.map((e: any) => MediaEvent_IceServer.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MediaEvent_Connected): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.endpointIdToEndpoint) { + const entries = Object.entries(message.endpointIdToEndpoint); + if (entries.length > 0) { + obj.endpointIdToEndpoint = {}; + entries.forEach(([k, v]) => { + obj.endpointIdToEndpoint[k] = MediaEvent_Endpoint.toJSON(v); + }); + } + } + if (message.iceServers?.length) { + obj.iceServers = message.iceServers.map((e) => MediaEvent_IceServer.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_Connected { + return MediaEvent_Connected.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_Connected { + const message = createBaseMediaEvent_Connected(); + message.endpointId = object.endpointId ?? ""; + message.endpointIdToEndpoint = Object.entries(object.endpointIdToEndpoint ?? {}).reduce< + { [key: string]: MediaEvent_Endpoint } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = MediaEvent_Endpoint.fromPartial(value); + } + return acc; + }, {}); + message.iceServers = object.iceServers?.map((e) => MediaEvent_IceServer.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMediaEvent_Connected_EndpointIdToEndpointEntry(): MediaEvent_Connected_EndpointIdToEndpointEntry { + return { key: "", value: undefined }; +} + +export const MediaEvent_Connected_EndpointIdToEndpointEntry: MessageFns< + MediaEvent_Connected_EndpointIdToEndpointEntry +> = { + encode( + message: MediaEvent_Connected_EndpointIdToEndpointEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + MediaEvent_Endpoint.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Connected_EndpointIdToEndpointEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Connected_EndpointIdToEndpointEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = MediaEvent_Endpoint.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Connected_EndpointIdToEndpointEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? MediaEvent_Endpoint.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: MediaEvent_Connected_EndpointIdToEndpointEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = MediaEvent_Endpoint.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_Connected_EndpointIdToEndpointEntry { + return MediaEvent_Connected_EndpointIdToEndpointEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_Connected_EndpointIdToEndpointEntry { + const message = createBaseMediaEvent_Connected_EndpointIdToEndpointEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? MediaEvent_Endpoint.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_EndpointRemoved(): MediaEvent_EndpointRemoved { + return { endpointId: "" }; +} + +export const MediaEvent_EndpointRemoved: MessageFns = { + encode(message: MediaEvent_EndpointRemoved, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_EndpointRemoved { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_EndpointRemoved(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_EndpointRemoved { + return { endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "" }; + }, + + toJSON(message: MediaEvent_EndpointRemoved): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_EndpointRemoved { + return MediaEvent_EndpointRemoved.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_EndpointRemoved { + const message = createBaseMediaEvent_EndpointRemoved(); + message.endpointId = object.endpointId ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_Error(): MediaEvent_Error { + return { message: "" }; +} + +export const MediaEvent_Error: MessageFns = { + encode(message: MediaEvent_Error, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_Error { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_Error(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_Error { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + + toJSON(message: MediaEvent_Error): unknown { + const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_Error { + return MediaEvent_Error.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_Error { + const message = createBaseMediaEvent_Error(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_OfferData(): MediaEvent_OfferData { + return { tracksTypes: undefined }; +} + +export const MediaEvent_OfferData: MessageFns = { + encode(message: MediaEvent_OfferData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tracksTypes !== undefined) { + MediaEvent_OfferData_TrackTypes.encode(message.tracksTypes, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_OfferData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_OfferData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tracksTypes = MediaEvent_OfferData_TrackTypes.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_OfferData { + return { + tracksTypes: isSet(object.tracksTypes) ? MediaEvent_OfferData_TrackTypes.fromJSON(object.tracksTypes) : undefined, + }; + }, + + toJSON(message: MediaEvent_OfferData): unknown { + const obj: any = {}; + if (message.tracksTypes !== undefined) { + obj.tracksTypes = MediaEvent_OfferData_TrackTypes.toJSON(message.tracksTypes); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_OfferData { + return MediaEvent_OfferData.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_OfferData { + const message = createBaseMediaEvent_OfferData(); + message.tracksTypes = (object.tracksTypes !== undefined && object.tracksTypes !== null) + ? MediaEvent_OfferData_TrackTypes.fromPartial(object.tracksTypes) + : undefined; + return message; + }, +}; + +function createBaseMediaEvent_OfferData_TrackTypes(): MediaEvent_OfferData_TrackTypes { + return { audio: 0, video: 0 }; +} + +export const MediaEvent_OfferData_TrackTypes: MessageFns = { + encode(message: MediaEvent_OfferData_TrackTypes, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.audio !== 0) { + writer.uint32(8).int32(message.audio); + } + if (message.video !== 0) { + writer.uint32(16).int32(message.video); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_OfferData_TrackTypes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_OfferData_TrackTypes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.audio = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.video = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_OfferData_TrackTypes { + return { + audio: isSet(object.audio) ? globalThis.Number(object.audio) : 0, + video: isSet(object.video) ? globalThis.Number(object.video) : 0, + }; + }, + + toJSON(message: MediaEvent_OfferData_TrackTypes): unknown { + const obj: any = {}; + if (message.audio !== 0) { + obj.audio = Math.round(message.audio); + } + if (message.video !== 0) { + obj.video = Math.round(message.video); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_OfferData_TrackTypes { + return MediaEvent_OfferData_TrackTypes.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_OfferData_TrackTypes { + const message = createBaseMediaEvent_OfferData_TrackTypes(); + message.audio = object.audio ?? 0; + message.video = object.video ?? 0; + return message; + }, +}; + +function createBaseMediaEvent_SdpAnswer(): MediaEvent_SdpAnswer { + return { sdpAnswer: "", midToTrackId: {} }; +} + +export const MediaEvent_SdpAnswer: MessageFns = { + encode(message: MediaEvent_SdpAnswer, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sdpAnswer !== "") { + writer.uint32(10).string(message.sdpAnswer); + } + Object.entries(message.midToTrackId).forEach(([key, value]) => { + MediaEvent_SdpAnswer_MidToTrackIdEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_SdpAnswer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_SdpAnswer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.sdpAnswer = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = MediaEvent_SdpAnswer_MidToTrackIdEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.midToTrackId[entry2.key] = entry2.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_SdpAnswer { + return { + sdpAnswer: isSet(object.sdpAnswer) ? globalThis.String(object.sdpAnswer) : "", + midToTrackId: isObject(object.midToTrackId) + ? Object.entries(object.midToTrackId).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: MediaEvent_SdpAnswer): unknown { + const obj: any = {}; + if (message.sdpAnswer !== "") { + obj.sdpAnswer = message.sdpAnswer; + } + if (message.midToTrackId) { + const entries = Object.entries(message.midToTrackId); + if (entries.length > 0) { + obj.midToTrackId = {}; + entries.forEach(([k, v]) => { + obj.midToTrackId[k] = v; + }); + } + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_SdpAnswer { + return MediaEvent_SdpAnswer.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_SdpAnswer { + const message = createBaseMediaEvent_SdpAnswer(); + message.sdpAnswer = object.sdpAnswer ?? ""; + message.midToTrackId = Object.entries(object.midToTrackId ?? {}).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseMediaEvent_SdpAnswer_MidToTrackIdEntry(): MediaEvent_SdpAnswer_MidToTrackIdEntry { + return { key: "", value: "" }; +} + +export const MediaEvent_SdpAnswer_MidToTrackIdEntry: MessageFns = { + encode(message: MediaEvent_SdpAnswer_MidToTrackIdEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_SdpAnswer_MidToTrackIdEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_SdpAnswer_MidToTrackIdEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_SdpAnswer_MidToTrackIdEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: MediaEvent_SdpAnswer_MidToTrackIdEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>( + base?: I, + ): MediaEvent_SdpAnswer_MidToTrackIdEntry { + return MediaEvent_SdpAnswer_MidToTrackIdEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_SdpAnswer_MidToTrackIdEntry { + const message = createBaseMediaEvent_SdpAnswer_MidToTrackIdEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseMediaEvent_VadNotification(): MediaEvent_VadNotification { + return { trackId: "", status: 0 }; +} + +export const MediaEvent_VadNotification: MessageFns = { + encode(message: MediaEvent_VadNotification, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.trackId !== "") { + writer.uint32(10).string(message.trackId); + } + if (message.status !== 0) { + writer.uint32(16).int32(message.status); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_VadNotification { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_VadNotification(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.status = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_VadNotification { + return { + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + status: isSet(object.status) ? mediaEvent_VadNotification_StatusFromJSON(object.status) : 0, + }; + }, + + toJSON(message: MediaEvent_VadNotification): unknown { + const obj: any = {}; + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.status !== 0) { + obj.status = mediaEvent_VadNotification_StatusToJSON(message.status); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_VadNotification { + return MediaEvent_VadNotification.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MediaEvent_VadNotification { + const message = createBaseMediaEvent_VadNotification(); + message.trackId = object.trackId ?? ""; + message.status = object.status ?? 0; + return message; + }, +}; + +function createBaseMediaEvent_TrackVariantSwitched(): MediaEvent_TrackVariantSwitched { + return { endpointId: "", trackId: "", variant: 0 }; +} + +export const MediaEvent_TrackVariantSwitched: MessageFns = { + encode(message: MediaEvent_TrackVariantSwitched, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + if (message.trackId !== "") { + writer.uint32(18).string(message.trackId); + } + if (message.variant !== 0) { + writer.uint32(24).int32(message.variant); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TrackVariantSwitched { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TrackVariantSwitched(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.variant = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TrackVariantSwitched { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + variant: isSet(object.variant) ? variantFromJSON(object.variant) : 0, + }; + }, + + toJSON(message: MediaEvent_TrackVariantSwitched): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.variant !== 0) { + obj.variant = variantToJSON(message.variant); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TrackVariantSwitched { + return MediaEvent_TrackVariantSwitched.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_TrackVariantSwitched { + const message = createBaseMediaEvent_TrackVariantSwitched(); + message.endpointId = object.endpointId ?? ""; + message.trackId = object.trackId ?? ""; + message.variant = object.variant ?? 0; + return message; + }, +}; + +function createBaseMediaEvent_TrackVariantDisabled(): MediaEvent_TrackVariantDisabled { + return { endpointId: "", trackId: "", variant: 0 }; +} + +export const MediaEvent_TrackVariantDisabled: MessageFns = { + encode(message: MediaEvent_TrackVariantDisabled, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + if (message.trackId !== "") { + writer.uint32(18).string(message.trackId); + } + if (message.variant !== 0) { + writer.uint32(24).int32(message.variant); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TrackVariantDisabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TrackVariantDisabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.variant = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TrackVariantDisabled { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + variant: isSet(object.variant) ? variantFromJSON(object.variant) : 0, + }; + }, + + toJSON(message: MediaEvent_TrackVariantDisabled): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.variant !== 0) { + obj.variant = variantToJSON(message.variant); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TrackVariantDisabled { + return MediaEvent_TrackVariantDisabled.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_TrackVariantDisabled { + const message = createBaseMediaEvent_TrackVariantDisabled(); + message.endpointId = object.endpointId ?? ""; + message.trackId = object.trackId ?? ""; + message.variant = object.variant ?? 0; + return message; + }, +}; + +function createBaseMediaEvent_TrackVariantEnabled(): MediaEvent_TrackVariantEnabled { + return { endpointId: "", trackId: "", variant: 0 }; +} + +export const MediaEvent_TrackVariantEnabled: MessageFns = { + encode(message: MediaEvent_TrackVariantEnabled, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.endpointId !== "") { + writer.uint32(10).string(message.endpointId); + } + if (message.trackId !== "") { + writer.uint32(18).string(message.trackId); + } + if (message.variant !== 0) { + writer.uint32(24).int32(message.variant); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MediaEvent_TrackVariantEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMediaEvent_TrackVariantEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.endpointId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.trackId = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.variant = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MediaEvent_TrackVariantEnabled { + return { + endpointId: isSet(object.endpointId) ? globalThis.String(object.endpointId) : "", + trackId: isSet(object.trackId) ? globalThis.String(object.trackId) : "", + variant: isSet(object.variant) ? variantFromJSON(object.variant) : 0, + }; + }, + + toJSON(message: MediaEvent_TrackVariantEnabled): unknown { + const obj: any = {}; + if (message.endpointId !== "") { + obj.endpointId = message.endpointId; + } + if (message.trackId !== "") { + obj.trackId = message.trackId; + } + if (message.variant !== 0) { + obj.variant = variantToJSON(message.variant); + } + return obj; + }, + + create, I>>(base?: I): MediaEvent_TrackVariantEnabled { + return MediaEvent_TrackVariantEnabled.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): MediaEvent_TrackVariantEnabled { + const message = createBaseMediaEvent_TrackVariantEnabled(); + message.endpointId = object.endpointId ?? ""; + message.trackId = object.trackId ?? ""; + message.variant = object.variant ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/protobufs/fishjam/media_events/shared.ts b/packages/protobufs/fishjam/media_events/shared.ts new file mode 100644 index 00000000..f55d754b --- /dev/null +++ b/packages/protobufs/fishjam/media_events/shared.ts @@ -0,0 +1,196 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc v5.28.2 +// source: fishjam/media_events/shared.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "fishjam.media_events"; + +export enum Variant { + VARIANT_UNSPECIFIED = 0, + VARIANT_LOW = 1, + VARIANT_MEDIUM = 2, + VARIANT_HIGH = 3, + UNRECOGNIZED = -1, +} + +export function variantFromJSON(object: any): Variant { + switch (object) { + case 0: + case "VARIANT_UNSPECIFIED": + return Variant.VARIANT_UNSPECIFIED; + case 1: + case "VARIANT_LOW": + return Variant.VARIANT_LOW; + case 2: + case "VARIANT_MEDIUM": + return Variant.VARIANT_MEDIUM; + case 3: + case "VARIANT_HIGH": + return Variant.VARIANT_HIGH; + case -1: + case "UNRECOGNIZED": + default: + return Variant.UNRECOGNIZED; + } +} + +export function variantToJSON(object: Variant): string { + switch (object) { + case Variant.VARIANT_UNSPECIFIED: + return "VARIANT_UNSPECIFIED"; + case Variant.VARIANT_LOW: + return "VARIANT_LOW"; + case Variant.VARIANT_MEDIUM: + return "VARIANT_MEDIUM"; + case Variant.VARIANT_HIGH: + return "VARIANT_HIGH"; + case Variant.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Contains information about an ICE candidate which will be sent to the peer/server */ +export interface Candidate { + candidate: string; + sdpMLineIndex: number; + sdpMid: string; + usernameFragment: string; +} + +function createBaseCandidate(): Candidate { + return { candidate: "", sdpMLineIndex: 0, sdpMid: "", usernameFragment: "" }; +} + +export const Candidate: MessageFns = { + encode(message: Candidate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.candidate !== "") { + writer.uint32(10).string(message.candidate); + } + if (message.sdpMLineIndex !== 0) { + writer.uint32(16).int32(message.sdpMLineIndex); + } + if (message.sdpMid !== "") { + writer.uint32(26).string(message.sdpMid); + } + if (message.usernameFragment !== "") { + writer.uint32(34).string(message.usernameFragment); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Candidate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCandidate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.candidate = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.sdpMLineIndex = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.sdpMid = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.usernameFragment = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Candidate { + return { + candidate: isSet(object.candidate) ? globalThis.String(object.candidate) : "", + sdpMLineIndex: isSet(object.sdpMLineIndex) ? globalThis.Number(object.sdpMLineIndex) : 0, + sdpMid: isSet(object.sdpMid) ? globalThis.String(object.sdpMid) : "", + usernameFragment: isSet(object.usernameFragment) ? globalThis.String(object.usernameFragment) : "", + }; + }, + + toJSON(message: Candidate): unknown { + const obj: any = {}; + if (message.candidate !== "") { + obj.candidate = message.candidate; + } + if (message.sdpMLineIndex !== 0) { + obj.sdpMLineIndex = Math.round(message.sdpMLineIndex); + } + if (message.sdpMid !== "") { + obj.sdpMid = message.sdpMid; + } + if (message.usernameFragment !== "") { + obj.usernameFragment = message.usernameFragment; + } + return obj; + }, + + create, I>>(base?: I): Candidate { + return Candidate.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Candidate { + const message = createBaseCandidate(); + message.candidate = object.candidate ?? ""; + message.sdpMLineIndex = object.sdpMLineIndex ?? 0; + message.sdpMid = object.sdpMid ?? ""; + message.usernameFragment = object.usernameFragment ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/protobufs/fishjam/peer_notifications.ts b/packages/protobufs/fishjam/peer_notifications.ts new file mode 100644 index 00000000..54b86a72 --- /dev/null +++ b/packages/protobufs/fishjam/peer_notifications.ts @@ -0,0 +1,466 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc v5.28.2 +// source: fishjam/peer_notifications.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { MediaEvent } from "./media_events/peer/peer"; +import { MediaEvent as MediaEvent1 } from "./media_events/server/server"; + +export const protobufPackage = "fishjam"; + +/** Defines any type of message sent between FJ and a peer */ +export interface PeerMessage { + authenticated?: PeerMessage_Authenticated | undefined; + authRequest?: PeerMessage_AuthRequest | undefined; + mediaEvent?: PeerMessage_MediaEvent | undefined; + rtcStatsReport?: PeerMessage_RTCStatsReport | undefined; + peerMediaEvent?: MediaEvent | undefined; + serverMediaEvent?: MediaEvent1 | undefined; +} + +/** Response sent by FJ, confirming successfull authentication */ +export interface PeerMessage_Authenticated { +} + +/** Request sent by peer, to authenticate to FJ server */ +export interface PeerMessage_AuthRequest { + token: string; + sdkVersion: string; +} + +/** + * PeerConnection stats sent by peer + * https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport#the_statistic_types + */ +export interface PeerMessage_RTCStatsReport { + data: string; +} + +/** Any type of WebRTC messages passed betweend FJ and peer */ +export interface PeerMessage_MediaEvent { + data: string; +} + +function createBasePeerMessage(): PeerMessage { + return { + authenticated: undefined, + authRequest: undefined, + mediaEvent: undefined, + rtcStatsReport: undefined, + peerMediaEvent: undefined, + serverMediaEvent: undefined, + }; +} + +export const PeerMessage: MessageFns = { + encode(message: PeerMessage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.authenticated !== undefined) { + PeerMessage_Authenticated.encode(message.authenticated, writer.uint32(10).fork()).join(); + } + if (message.authRequest !== undefined) { + PeerMessage_AuthRequest.encode(message.authRequest, writer.uint32(18).fork()).join(); + } + if (message.mediaEvent !== undefined) { + PeerMessage_MediaEvent.encode(message.mediaEvent, writer.uint32(26).fork()).join(); + } + if (message.rtcStatsReport !== undefined) { + PeerMessage_RTCStatsReport.encode(message.rtcStatsReport, writer.uint32(34).fork()).join(); + } + if (message.peerMediaEvent !== undefined) { + MediaEvent.encode(message.peerMediaEvent, writer.uint32(42).fork()).join(); + } + if (message.serverMediaEvent !== undefined) { + MediaEvent1.encode(message.serverMediaEvent, writer.uint32(50).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PeerMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.authenticated = PeerMessage_Authenticated.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.authRequest = PeerMessage_AuthRequest.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.mediaEvent = PeerMessage_MediaEvent.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.rtcStatsReport = PeerMessage_RTCStatsReport.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.peerMediaEvent = MediaEvent.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.serverMediaEvent = MediaEvent1.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PeerMessage { + return { + authenticated: isSet(object.authenticated) ? PeerMessage_Authenticated.fromJSON(object.authenticated) : undefined, + authRequest: isSet(object.authRequest) ? PeerMessage_AuthRequest.fromJSON(object.authRequest) : undefined, + mediaEvent: isSet(object.mediaEvent) ? PeerMessage_MediaEvent.fromJSON(object.mediaEvent) : undefined, + rtcStatsReport: isSet(object.rtcStatsReport) + ? PeerMessage_RTCStatsReport.fromJSON(object.rtcStatsReport) + : undefined, + peerMediaEvent: isSet(object.peerMediaEvent) ? MediaEvent.fromJSON(object.peerMediaEvent) : undefined, + serverMediaEvent: isSet(object.serverMediaEvent) ? MediaEvent1.fromJSON(object.serverMediaEvent) : undefined, + }; + }, + + toJSON(message: PeerMessage): unknown { + const obj: any = {}; + if (message.authenticated !== undefined) { + obj.authenticated = PeerMessage_Authenticated.toJSON(message.authenticated); + } + if (message.authRequest !== undefined) { + obj.authRequest = PeerMessage_AuthRequest.toJSON(message.authRequest); + } + if (message.mediaEvent !== undefined) { + obj.mediaEvent = PeerMessage_MediaEvent.toJSON(message.mediaEvent); + } + if (message.rtcStatsReport !== undefined) { + obj.rtcStatsReport = PeerMessage_RTCStatsReport.toJSON(message.rtcStatsReport); + } + if (message.peerMediaEvent !== undefined) { + obj.peerMediaEvent = MediaEvent.toJSON(message.peerMediaEvent); + } + if (message.serverMediaEvent !== undefined) { + obj.serverMediaEvent = MediaEvent1.toJSON(message.serverMediaEvent); + } + return obj; + }, + + create, I>>(base?: I): PeerMessage { + return PeerMessage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): PeerMessage { + const message = createBasePeerMessage(); + message.authenticated = (object.authenticated !== undefined && object.authenticated !== null) + ? PeerMessage_Authenticated.fromPartial(object.authenticated) + : undefined; + message.authRequest = (object.authRequest !== undefined && object.authRequest !== null) + ? PeerMessage_AuthRequest.fromPartial(object.authRequest) + : undefined; + message.mediaEvent = (object.mediaEvent !== undefined && object.mediaEvent !== null) + ? PeerMessage_MediaEvent.fromPartial(object.mediaEvent) + : undefined; + message.rtcStatsReport = (object.rtcStatsReport !== undefined && object.rtcStatsReport !== null) + ? PeerMessage_RTCStatsReport.fromPartial(object.rtcStatsReport) + : undefined; + message.peerMediaEvent = (object.peerMediaEvent !== undefined && object.peerMediaEvent !== null) + ? MediaEvent.fromPartial(object.peerMediaEvent) + : undefined; + message.serverMediaEvent = (object.serverMediaEvent !== undefined && object.serverMediaEvent !== null) + ? MediaEvent1.fromPartial(object.serverMediaEvent) + : undefined; + return message; + }, +}; + +function createBasePeerMessage_Authenticated(): PeerMessage_Authenticated { + return {}; +} + +export const PeerMessage_Authenticated: MessageFns = { + encode(_: PeerMessage_Authenticated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PeerMessage_Authenticated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerMessage_Authenticated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): PeerMessage_Authenticated { + return {}; + }, + + toJSON(_: PeerMessage_Authenticated): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): PeerMessage_Authenticated { + return PeerMessage_Authenticated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): PeerMessage_Authenticated { + const message = createBasePeerMessage_Authenticated(); + return message; + }, +}; + +function createBasePeerMessage_AuthRequest(): PeerMessage_AuthRequest { + return { token: "", sdkVersion: "" }; +} + +export const PeerMessage_AuthRequest: MessageFns = { + encode(message: PeerMessage_AuthRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + if (message.sdkVersion !== "") { + writer.uint32(18).string(message.sdkVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PeerMessage_AuthRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerMessage_AuthRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.token = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.sdkVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PeerMessage_AuthRequest { + return { + token: isSet(object.token) ? globalThis.String(object.token) : "", + sdkVersion: isSet(object.sdkVersion) ? globalThis.String(object.sdkVersion) : "", + }; + }, + + toJSON(message: PeerMessage_AuthRequest): unknown { + const obj: any = {}; + if (message.token !== "") { + obj.token = message.token; + } + if (message.sdkVersion !== "") { + obj.sdkVersion = message.sdkVersion; + } + return obj; + }, + + create, I>>(base?: I): PeerMessage_AuthRequest { + return PeerMessage_AuthRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): PeerMessage_AuthRequest { + const message = createBasePeerMessage_AuthRequest(); + message.token = object.token ?? ""; + message.sdkVersion = object.sdkVersion ?? ""; + return message; + }, +}; + +function createBasePeerMessage_RTCStatsReport(): PeerMessage_RTCStatsReport { + return { data: "" }; +} + +export const PeerMessage_RTCStatsReport: MessageFns = { + encode(message: PeerMessage_RTCStatsReport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PeerMessage_RTCStatsReport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerMessage_RTCStatsReport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.data = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PeerMessage_RTCStatsReport { + return { data: isSet(object.data) ? globalThis.String(object.data) : "" }; + }, + + toJSON(message: PeerMessage_RTCStatsReport): unknown { + const obj: any = {}; + if (message.data !== "") { + obj.data = message.data; + } + return obj; + }, + + create, I>>(base?: I): PeerMessage_RTCStatsReport { + return PeerMessage_RTCStatsReport.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): PeerMessage_RTCStatsReport { + const message = createBasePeerMessage_RTCStatsReport(); + message.data = object.data ?? ""; + return message; + }, +}; + +function createBasePeerMessage_MediaEvent(): PeerMessage_MediaEvent { + return { data: "" }; +} + +export const PeerMessage_MediaEvent: MessageFns = { + encode(message: PeerMessage_MediaEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PeerMessage_MediaEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerMessage_MediaEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.data = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PeerMessage_MediaEvent { + return { data: isSet(object.data) ? globalThis.String(object.data) : "" }; + }, + + toJSON(message: PeerMessage_MediaEvent): unknown { + const obj: any = {}; + if (message.data !== "") { + obj.data = message.data; + } + return obj; + }, + + create, I>>(base?: I): PeerMessage_MediaEvent { + return PeerMessage_MediaEvent.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): PeerMessage_MediaEvent { + const message = createBasePeerMessage_MediaEvent(); + message.data = object.data ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/protobufs/fishjam/server_notifications.ts b/packages/protobufs/fishjam/server_notifications.ts new file mode 100644 index 00000000..df8e9930 --- /dev/null +++ b/packages/protobufs/fishjam/server_notifications.ts @@ -0,0 +1,2379 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc v5.28.2 +// source: fishjam/server_notifications.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "fishjam"; + +/** Defines any type of message passed between FJ and server peer */ +export interface ServerMessage { + roomCrashed?: ServerMessage_RoomCrashed | undefined; + peerConnected?: ServerMessage_PeerConnected | undefined; + peerDisconnected?: ServerMessage_PeerDisconnected | undefined; + peerCrashed?: ServerMessage_PeerCrashed | undefined; + componentCrashed?: ServerMessage_ComponentCrashed | undefined; + authenticated?: ServerMessage_Authenticated | undefined; + authRequest?: ServerMessage_AuthRequest | undefined; + subscribeRequest?: ServerMessage_SubscribeRequest | undefined; + subscribeResponse?: ServerMessage_SubscribeResponse | undefined; + roomCreated?: ServerMessage_RoomCreated | undefined; + roomDeleted?: ServerMessage_RoomDeleted | undefined; + metricsReport?: ServerMessage_MetricsReport | undefined; + hlsPlayable?: ServerMessage_HlsPlayable | undefined; + hlsUploaded?: ServerMessage_HlsUploaded | undefined; + hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined; + peerMetadataUpdated?: ServerMessage_PeerMetadataUpdated | undefined; + trackAdded?: ServerMessage_TrackAdded | undefined; + trackRemoved?: ServerMessage_TrackRemoved | undefined; + trackMetadataUpdated?: ServerMessage_TrackMetadataUpdated | undefined; + peerAdded?: ServerMessage_PeerAdded | undefined; + peerDeleted?: ServerMessage_PeerDeleted | undefined; +} + +/** Defines message groups for which peer can subscribe */ +export enum ServerMessage_EventType { + EVENT_TYPE_UNSPECIFIED = 0, + EVENT_TYPE_SERVER_NOTIFICATION = 1, + EVENT_TYPE_METRICS = 2, + UNRECOGNIZED = -1, +} + +export function serverMessage_EventTypeFromJSON(object: any): ServerMessage_EventType { + switch (object) { + case 0: + case "EVENT_TYPE_UNSPECIFIED": + return ServerMessage_EventType.EVENT_TYPE_UNSPECIFIED; + case 1: + case "EVENT_TYPE_SERVER_NOTIFICATION": + return ServerMessage_EventType.EVENT_TYPE_SERVER_NOTIFICATION; + case 2: + case "EVENT_TYPE_METRICS": + return ServerMessage_EventType.EVENT_TYPE_METRICS; + case -1: + case "UNRECOGNIZED": + default: + return ServerMessage_EventType.UNRECOGNIZED; + } +} + +export function serverMessage_EventTypeToJSON(object: ServerMessage_EventType): string { + switch (object) { + case ServerMessage_EventType.EVENT_TYPE_UNSPECIFIED: + return "EVENT_TYPE_UNSPECIFIED"; + case ServerMessage_EventType.EVENT_TYPE_SERVER_NOTIFICATION: + return "EVENT_TYPE_SERVER_NOTIFICATION"; + case ServerMessage_EventType.EVENT_TYPE_METRICS: + return "EVENT_TYPE_METRICS"; + case ServerMessage_EventType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Defines types of tracks being published by peers and component */ +export enum ServerMessage_TrackType { + TRACK_TYPE_UNSPECIFIED = 0, + TRACK_TYPE_VIDEO = 1, + TRACK_TYPE_AUDIO = 2, + UNRECOGNIZED = -1, +} + +export function serverMessage_TrackTypeFromJSON(object: any): ServerMessage_TrackType { + switch (object) { + case 0: + case "TRACK_TYPE_UNSPECIFIED": + return ServerMessage_TrackType.TRACK_TYPE_UNSPECIFIED; + case 1: + case "TRACK_TYPE_VIDEO": + return ServerMessage_TrackType.TRACK_TYPE_VIDEO; + case 2: + case "TRACK_TYPE_AUDIO": + return ServerMessage_TrackType.TRACK_TYPE_AUDIO; + case -1: + case "UNRECOGNIZED": + default: + return ServerMessage_TrackType.UNRECOGNIZED; + } +} + +export function serverMessage_TrackTypeToJSON(object: ServerMessage_TrackType): string { + switch (object) { + case ServerMessage_TrackType.TRACK_TYPE_UNSPECIFIED: + return "TRACK_TYPE_UNSPECIFIED"; + case ServerMessage_TrackType.TRACK_TYPE_VIDEO: + return "TRACK_TYPE_VIDEO"; + case ServerMessage_TrackType.TRACK_TYPE_AUDIO: + return "TRACK_TYPE_AUDIO"; + case ServerMessage_TrackType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Notification sent when a room crashes */ +export interface ServerMessage_RoomCrashed { + roomId: string; +} + +/** Notification sent when a peer is added */ +export interface ServerMessage_PeerAdded { + roomId: string; + peerId: string; +} + +/** Notification sent when a peer is removed */ +export interface ServerMessage_PeerDeleted { + roomId: string; + peerId: string; +} + +/** Notification sent when a peer connects */ +export interface ServerMessage_PeerConnected { + roomId: string; + peerId: string; +} + +/** Notification sent when a peer disconnects from FJ */ +export interface ServerMessage_PeerDisconnected { + roomId: string; + peerId: string; +} + +/** Notification sent when a peer crashes */ +export interface ServerMessage_PeerCrashed { + roomId: string; + peerId: string; + reason: string; +} + +/** Notification sent when a component crashes */ +export interface ServerMessage_ComponentCrashed { + roomId: string; + componentId: string; +} + +/** Response sent by FJ, confirming successfull authentication */ +export interface ServerMessage_Authenticated { +} + +/** Request sent by peer, to authenticate to FJ server */ +export interface ServerMessage_AuthRequest { + token: string; +} + +/** Request sent by peer to subsribe for certain message type */ +export interface ServerMessage_SubscribeRequest { + eventType: ServerMessage_EventType; +} + +/** Response sent by FJ, confirming subscription for message type */ +export interface ServerMessage_SubscribeResponse { + eventType: ServerMessage_EventType; +} + +/** Notification sent when a room is created */ +export interface ServerMessage_RoomCreated { + roomId: string; +} + +/** Notification sent when a room is deleted */ +export interface ServerMessage_RoomDeleted { + roomId: string; +} + +/** Message containing WebRTC metrics from FJ */ +export interface ServerMessage_MetricsReport { + metrics: string; +} + +/** Notification sent when the HLS stream becomes available in a room */ +export interface ServerMessage_HlsPlayable { + roomId: string; + componentId: string; +} + +/** Notification sent when the HLS recording is successfully uploded to AWS S3 */ +export interface ServerMessage_HlsUploaded { + roomId: string; +} + +/** Notification sent when the upload of HLS recording to AWS S3 fails */ +export interface ServerMessage_HlsUploadCrashed { + roomId: string; +} + +/** Notification sent when peer updates its metadata */ +export interface ServerMessage_PeerMetadataUpdated { + roomId: string; + peerId: string; + metadata: string; +} + +/** Describes a media track */ +export interface ServerMessage_Track { + id: string; + type: ServerMessage_TrackType; + metadata: string; +} + +/** Notification sent when peer or component adds new track */ +export interface ServerMessage_TrackAdded { + roomId: string; + peerId?: string | undefined; + componentId?: string | undefined; + track: ServerMessage_Track | undefined; +} + +/** Notification sent when a track is removed */ +export interface ServerMessage_TrackRemoved { + roomId: string; + peerId?: string | undefined; + componentId?: string | undefined; + track: ServerMessage_Track | undefined; +} + +/** Notification sent when metadata of a multimedia track is updated */ +export interface ServerMessage_TrackMetadataUpdated { + roomId: string; + peerId?: string | undefined; + componentId?: string | undefined; + track: ServerMessage_Track | undefined; +} + +function createBaseServerMessage(): ServerMessage { + return { + roomCrashed: undefined, + peerConnected: undefined, + peerDisconnected: undefined, + peerCrashed: undefined, + componentCrashed: undefined, + authenticated: undefined, + authRequest: undefined, + subscribeRequest: undefined, + subscribeResponse: undefined, + roomCreated: undefined, + roomDeleted: undefined, + metricsReport: undefined, + hlsPlayable: undefined, + hlsUploaded: undefined, + hlsUploadCrashed: undefined, + peerMetadataUpdated: undefined, + trackAdded: undefined, + trackRemoved: undefined, + trackMetadataUpdated: undefined, + peerAdded: undefined, + peerDeleted: undefined, + }; +} + +export const ServerMessage: MessageFns = { + encode(message: ServerMessage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomCrashed !== undefined) { + ServerMessage_RoomCrashed.encode(message.roomCrashed, writer.uint32(10).fork()).join(); + } + if (message.peerConnected !== undefined) { + ServerMessage_PeerConnected.encode(message.peerConnected, writer.uint32(18).fork()).join(); + } + if (message.peerDisconnected !== undefined) { + ServerMessage_PeerDisconnected.encode(message.peerDisconnected, writer.uint32(26).fork()).join(); + } + if (message.peerCrashed !== undefined) { + ServerMessage_PeerCrashed.encode(message.peerCrashed, writer.uint32(34).fork()).join(); + } + if (message.componentCrashed !== undefined) { + ServerMessage_ComponentCrashed.encode(message.componentCrashed, writer.uint32(42).fork()).join(); + } + if (message.authenticated !== undefined) { + ServerMessage_Authenticated.encode(message.authenticated, writer.uint32(50).fork()).join(); + } + if (message.authRequest !== undefined) { + ServerMessage_AuthRequest.encode(message.authRequest, writer.uint32(58).fork()).join(); + } + if (message.subscribeRequest !== undefined) { + ServerMessage_SubscribeRequest.encode(message.subscribeRequest, writer.uint32(66).fork()).join(); + } + if (message.subscribeResponse !== undefined) { + ServerMessage_SubscribeResponse.encode(message.subscribeResponse, writer.uint32(74).fork()).join(); + } + if (message.roomCreated !== undefined) { + ServerMessage_RoomCreated.encode(message.roomCreated, writer.uint32(82).fork()).join(); + } + if (message.roomDeleted !== undefined) { + ServerMessage_RoomDeleted.encode(message.roomDeleted, writer.uint32(90).fork()).join(); + } + if (message.metricsReport !== undefined) { + ServerMessage_MetricsReport.encode(message.metricsReport, writer.uint32(98).fork()).join(); + } + if (message.hlsPlayable !== undefined) { + ServerMessage_HlsPlayable.encode(message.hlsPlayable, writer.uint32(106).fork()).join(); + } + if (message.hlsUploaded !== undefined) { + ServerMessage_HlsUploaded.encode(message.hlsUploaded, writer.uint32(114).fork()).join(); + } + if (message.hlsUploadCrashed !== undefined) { + ServerMessage_HlsUploadCrashed.encode(message.hlsUploadCrashed, writer.uint32(122).fork()).join(); + } + if (message.peerMetadataUpdated !== undefined) { + ServerMessage_PeerMetadataUpdated.encode(message.peerMetadataUpdated, writer.uint32(130).fork()).join(); + } + if (message.trackAdded !== undefined) { + ServerMessage_TrackAdded.encode(message.trackAdded, writer.uint32(138).fork()).join(); + } + if (message.trackRemoved !== undefined) { + ServerMessage_TrackRemoved.encode(message.trackRemoved, writer.uint32(146).fork()).join(); + } + if (message.trackMetadataUpdated !== undefined) { + ServerMessage_TrackMetadataUpdated.encode(message.trackMetadataUpdated, writer.uint32(154).fork()).join(); + } + if (message.peerAdded !== undefined) { + ServerMessage_PeerAdded.encode(message.peerAdded, writer.uint32(162).fork()).join(); + } + if (message.peerDeleted !== undefined) { + ServerMessage_PeerDeleted.encode(message.peerDeleted, writer.uint32(170).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomCrashed = ServerMessage_RoomCrashed.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerConnected = ServerMessage_PeerConnected.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.peerDisconnected = ServerMessage_PeerDisconnected.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.peerCrashed = ServerMessage_PeerCrashed.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.componentCrashed = ServerMessage_ComponentCrashed.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.authenticated = ServerMessage_Authenticated.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.authRequest = ServerMessage_AuthRequest.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.subscribeRequest = ServerMessage_SubscribeRequest.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.subscribeResponse = ServerMessage_SubscribeResponse.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.roomCreated = ServerMessage_RoomCreated.decode(reader, reader.uint32()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.roomDeleted = ServerMessage_RoomDeleted.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.metricsReport = ServerMessage_MetricsReport.decode(reader, reader.uint32()); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.hlsPlayable = ServerMessage_HlsPlayable.decode(reader, reader.uint32()); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.hlsUploaded = ServerMessage_HlsUploaded.decode(reader, reader.uint32()); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.hlsUploadCrashed = ServerMessage_HlsUploadCrashed.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.peerMetadataUpdated = ServerMessage_PeerMetadataUpdated.decode(reader, reader.uint32()); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + + message.trackAdded = ServerMessage_TrackAdded.decode(reader, reader.uint32()); + continue; + } + case 18: { + if (tag !== 146) { + break; + } + + message.trackRemoved = ServerMessage_TrackRemoved.decode(reader, reader.uint32()); + continue; + } + case 19: { + if (tag !== 154) { + break; + } + + message.trackMetadataUpdated = ServerMessage_TrackMetadataUpdated.decode(reader, reader.uint32()); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.peerAdded = ServerMessage_PeerAdded.decode(reader, reader.uint32()); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.peerDeleted = ServerMessage_PeerDeleted.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage { + return { + roomCrashed: isSet(object.roomCrashed) ? ServerMessage_RoomCrashed.fromJSON(object.roomCrashed) : undefined, + peerConnected: isSet(object.peerConnected) + ? ServerMessage_PeerConnected.fromJSON(object.peerConnected) + : undefined, + peerDisconnected: isSet(object.peerDisconnected) + ? ServerMessage_PeerDisconnected.fromJSON(object.peerDisconnected) + : undefined, + peerCrashed: isSet(object.peerCrashed) ? ServerMessage_PeerCrashed.fromJSON(object.peerCrashed) : undefined, + componentCrashed: isSet(object.componentCrashed) + ? ServerMessage_ComponentCrashed.fromJSON(object.componentCrashed) + : undefined, + authenticated: isSet(object.authenticated) + ? ServerMessage_Authenticated.fromJSON(object.authenticated) + : undefined, + authRequest: isSet(object.authRequest) ? ServerMessage_AuthRequest.fromJSON(object.authRequest) : undefined, + subscribeRequest: isSet(object.subscribeRequest) + ? ServerMessage_SubscribeRequest.fromJSON(object.subscribeRequest) + : undefined, + subscribeResponse: isSet(object.subscribeResponse) + ? ServerMessage_SubscribeResponse.fromJSON(object.subscribeResponse) + : undefined, + roomCreated: isSet(object.roomCreated) ? ServerMessage_RoomCreated.fromJSON(object.roomCreated) : undefined, + roomDeleted: isSet(object.roomDeleted) ? ServerMessage_RoomDeleted.fromJSON(object.roomDeleted) : undefined, + metricsReport: isSet(object.metricsReport) + ? ServerMessage_MetricsReport.fromJSON(object.metricsReport) + : undefined, + hlsPlayable: isSet(object.hlsPlayable) ? ServerMessage_HlsPlayable.fromJSON(object.hlsPlayable) : undefined, + hlsUploaded: isSet(object.hlsUploaded) ? ServerMessage_HlsUploaded.fromJSON(object.hlsUploaded) : undefined, + hlsUploadCrashed: isSet(object.hlsUploadCrashed) + ? ServerMessage_HlsUploadCrashed.fromJSON(object.hlsUploadCrashed) + : undefined, + peerMetadataUpdated: isSet(object.peerMetadataUpdated) + ? ServerMessage_PeerMetadataUpdated.fromJSON(object.peerMetadataUpdated) + : undefined, + trackAdded: isSet(object.trackAdded) ? ServerMessage_TrackAdded.fromJSON(object.trackAdded) : undefined, + trackRemoved: isSet(object.trackRemoved) ? ServerMessage_TrackRemoved.fromJSON(object.trackRemoved) : undefined, + trackMetadataUpdated: isSet(object.trackMetadataUpdated) + ? ServerMessage_TrackMetadataUpdated.fromJSON(object.trackMetadataUpdated) + : undefined, + peerAdded: isSet(object.peerAdded) ? ServerMessage_PeerAdded.fromJSON(object.peerAdded) : undefined, + peerDeleted: isSet(object.peerDeleted) ? ServerMessage_PeerDeleted.fromJSON(object.peerDeleted) : undefined, + }; + }, + + toJSON(message: ServerMessage): unknown { + const obj: any = {}; + if (message.roomCrashed !== undefined) { + obj.roomCrashed = ServerMessage_RoomCrashed.toJSON(message.roomCrashed); + } + if (message.peerConnected !== undefined) { + obj.peerConnected = ServerMessage_PeerConnected.toJSON(message.peerConnected); + } + if (message.peerDisconnected !== undefined) { + obj.peerDisconnected = ServerMessage_PeerDisconnected.toJSON(message.peerDisconnected); + } + if (message.peerCrashed !== undefined) { + obj.peerCrashed = ServerMessage_PeerCrashed.toJSON(message.peerCrashed); + } + if (message.componentCrashed !== undefined) { + obj.componentCrashed = ServerMessage_ComponentCrashed.toJSON(message.componentCrashed); + } + if (message.authenticated !== undefined) { + obj.authenticated = ServerMessage_Authenticated.toJSON(message.authenticated); + } + if (message.authRequest !== undefined) { + obj.authRequest = ServerMessage_AuthRequest.toJSON(message.authRequest); + } + if (message.subscribeRequest !== undefined) { + obj.subscribeRequest = ServerMessage_SubscribeRequest.toJSON(message.subscribeRequest); + } + if (message.subscribeResponse !== undefined) { + obj.subscribeResponse = ServerMessage_SubscribeResponse.toJSON(message.subscribeResponse); + } + if (message.roomCreated !== undefined) { + obj.roomCreated = ServerMessage_RoomCreated.toJSON(message.roomCreated); + } + if (message.roomDeleted !== undefined) { + obj.roomDeleted = ServerMessage_RoomDeleted.toJSON(message.roomDeleted); + } + if (message.metricsReport !== undefined) { + obj.metricsReport = ServerMessage_MetricsReport.toJSON(message.metricsReport); + } + if (message.hlsPlayable !== undefined) { + obj.hlsPlayable = ServerMessage_HlsPlayable.toJSON(message.hlsPlayable); + } + if (message.hlsUploaded !== undefined) { + obj.hlsUploaded = ServerMessage_HlsUploaded.toJSON(message.hlsUploaded); + } + if (message.hlsUploadCrashed !== undefined) { + obj.hlsUploadCrashed = ServerMessage_HlsUploadCrashed.toJSON(message.hlsUploadCrashed); + } + if (message.peerMetadataUpdated !== undefined) { + obj.peerMetadataUpdated = ServerMessage_PeerMetadataUpdated.toJSON(message.peerMetadataUpdated); + } + if (message.trackAdded !== undefined) { + obj.trackAdded = ServerMessage_TrackAdded.toJSON(message.trackAdded); + } + if (message.trackRemoved !== undefined) { + obj.trackRemoved = ServerMessage_TrackRemoved.toJSON(message.trackRemoved); + } + if (message.trackMetadataUpdated !== undefined) { + obj.trackMetadataUpdated = ServerMessage_TrackMetadataUpdated.toJSON(message.trackMetadataUpdated); + } + if (message.peerAdded !== undefined) { + obj.peerAdded = ServerMessage_PeerAdded.toJSON(message.peerAdded); + } + if (message.peerDeleted !== undefined) { + obj.peerDeleted = ServerMessage_PeerDeleted.toJSON(message.peerDeleted); + } + return obj; + }, + + create, I>>(base?: I): ServerMessage { + return ServerMessage.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage { + const message = createBaseServerMessage(); + message.roomCrashed = (object.roomCrashed !== undefined && object.roomCrashed !== null) + ? ServerMessage_RoomCrashed.fromPartial(object.roomCrashed) + : undefined; + message.peerConnected = (object.peerConnected !== undefined && object.peerConnected !== null) + ? ServerMessage_PeerConnected.fromPartial(object.peerConnected) + : undefined; + message.peerDisconnected = (object.peerDisconnected !== undefined && object.peerDisconnected !== null) + ? ServerMessage_PeerDisconnected.fromPartial(object.peerDisconnected) + : undefined; + message.peerCrashed = (object.peerCrashed !== undefined && object.peerCrashed !== null) + ? ServerMessage_PeerCrashed.fromPartial(object.peerCrashed) + : undefined; + message.componentCrashed = (object.componentCrashed !== undefined && object.componentCrashed !== null) + ? ServerMessage_ComponentCrashed.fromPartial(object.componentCrashed) + : undefined; + message.authenticated = (object.authenticated !== undefined && object.authenticated !== null) + ? ServerMessage_Authenticated.fromPartial(object.authenticated) + : undefined; + message.authRequest = (object.authRequest !== undefined && object.authRequest !== null) + ? ServerMessage_AuthRequest.fromPartial(object.authRequest) + : undefined; + message.subscribeRequest = (object.subscribeRequest !== undefined && object.subscribeRequest !== null) + ? ServerMessage_SubscribeRequest.fromPartial(object.subscribeRequest) + : undefined; + message.subscribeResponse = (object.subscribeResponse !== undefined && object.subscribeResponse !== null) + ? ServerMessage_SubscribeResponse.fromPartial(object.subscribeResponse) + : undefined; + message.roomCreated = (object.roomCreated !== undefined && object.roomCreated !== null) + ? ServerMessage_RoomCreated.fromPartial(object.roomCreated) + : undefined; + message.roomDeleted = (object.roomDeleted !== undefined && object.roomDeleted !== null) + ? ServerMessage_RoomDeleted.fromPartial(object.roomDeleted) + : undefined; + message.metricsReport = (object.metricsReport !== undefined && object.metricsReport !== null) + ? ServerMessage_MetricsReport.fromPartial(object.metricsReport) + : undefined; + message.hlsPlayable = (object.hlsPlayable !== undefined && object.hlsPlayable !== null) + ? ServerMessage_HlsPlayable.fromPartial(object.hlsPlayable) + : undefined; + message.hlsUploaded = (object.hlsUploaded !== undefined && object.hlsUploaded !== null) + ? ServerMessage_HlsUploaded.fromPartial(object.hlsUploaded) + : undefined; + message.hlsUploadCrashed = (object.hlsUploadCrashed !== undefined && object.hlsUploadCrashed !== null) + ? ServerMessage_HlsUploadCrashed.fromPartial(object.hlsUploadCrashed) + : undefined; + message.peerMetadataUpdated = (object.peerMetadataUpdated !== undefined && object.peerMetadataUpdated !== null) + ? ServerMessage_PeerMetadataUpdated.fromPartial(object.peerMetadataUpdated) + : undefined; + message.trackAdded = (object.trackAdded !== undefined && object.trackAdded !== null) + ? ServerMessage_TrackAdded.fromPartial(object.trackAdded) + : undefined; + message.trackRemoved = (object.trackRemoved !== undefined && object.trackRemoved !== null) + ? ServerMessage_TrackRemoved.fromPartial(object.trackRemoved) + : undefined; + message.trackMetadataUpdated = (object.trackMetadataUpdated !== undefined && object.trackMetadataUpdated !== null) + ? ServerMessage_TrackMetadataUpdated.fromPartial(object.trackMetadataUpdated) + : undefined; + message.peerAdded = (object.peerAdded !== undefined && object.peerAdded !== null) + ? ServerMessage_PeerAdded.fromPartial(object.peerAdded) + : undefined; + message.peerDeleted = (object.peerDeleted !== undefined && object.peerDeleted !== null) + ? ServerMessage_PeerDeleted.fromPartial(object.peerDeleted) + : undefined; + return message; + }, +}; + +function createBaseServerMessage_RoomCrashed(): ServerMessage_RoomCrashed { + return { roomId: "" }; +} + +export const ServerMessage_RoomCrashed: MessageFns = { + encode(message: ServerMessage_RoomCrashed, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_RoomCrashed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_RoomCrashed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_RoomCrashed { + return { roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "" }; + }, + + toJSON(message: ServerMessage_RoomCrashed): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_RoomCrashed { + return ServerMessage_RoomCrashed.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_RoomCrashed { + const message = createBaseServerMessage_RoomCrashed(); + message.roomId = object.roomId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_PeerAdded(): ServerMessage_PeerAdded { + return { roomId: "", peerId: "" }; +} + +export const ServerMessage_PeerAdded: MessageFns = { + encode(message: ServerMessage_PeerAdded, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== "") { + writer.uint32(18).string(message.peerId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_PeerAdded { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_PeerAdded(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_PeerAdded { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "", + }; + }, + + toJSON(message: ServerMessage_PeerAdded): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== "") { + obj.peerId = message.peerId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_PeerAdded { + return ServerMessage_PeerAdded.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_PeerAdded { + const message = createBaseServerMessage_PeerAdded(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_PeerDeleted(): ServerMessage_PeerDeleted { + return { roomId: "", peerId: "" }; +} + +export const ServerMessage_PeerDeleted: MessageFns = { + encode(message: ServerMessage_PeerDeleted, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== "") { + writer.uint32(18).string(message.peerId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_PeerDeleted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_PeerDeleted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_PeerDeleted { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "", + }; + }, + + toJSON(message: ServerMessage_PeerDeleted): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== "") { + obj.peerId = message.peerId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_PeerDeleted { + return ServerMessage_PeerDeleted.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_PeerDeleted { + const message = createBaseServerMessage_PeerDeleted(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_PeerConnected(): ServerMessage_PeerConnected { + return { roomId: "", peerId: "" }; +} + +export const ServerMessage_PeerConnected: MessageFns = { + encode(message: ServerMessage_PeerConnected, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== "") { + writer.uint32(18).string(message.peerId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_PeerConnected { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_PeerConnected(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_PeerConnected { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "", + }; + }, + + toJSON(message: ServerMessage_PeerConnected): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== "") { + obj.peerId = message.peerId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_PeerConnected { + return ServerMessage_PeerConnected.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_PeerConnected { + const message = createBaseServerMessage_PeerConnected(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_PeerDisconnected(): ServerMessage_PeerDisconnected { + return { roomId: "", peerId: "" }; +} + +export const ServerMessage_PeerDisconnected: MessageFns = { + encode(message: ServerMessage_PeerDisconnected, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== "") { + writer.uint32(18).string(message.peerId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_PeerDisconnected { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_PeerDisconnected(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_PeerDisconnected { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "", + }; + }, + + toJSON(message: ServerMessage_PeerDisconnected): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== "") { + obj.peerId = message.peerId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_PeerDisconnected { + return ServerMessage_PeerDisconnected.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_PeerDisconnected { + const message = createBaseServerMessage_PeerDisconnected(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_PeerCrashed(): ServerMessage_PeerCrashed { + return { roomId: "", peerId: "", reason: "" }; +} + +export const ServerMessage_PeerCrashed: MessageFns = { + encode(message: ServerMessage_PeerCrashed, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== "") { + writer.uint32(18).string(message.peerId); + } + if (message.reason !== "") { + writer.uint32(26).string(message.reason); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_PeerCrashed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_PeerCrashed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.reason = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_PeerCrashed { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "", + reason: isSet(object.reason) ? globalThis.String(object.reason) : "", + }; + }, + + toJSON(message: ServerMessage_PeerCrashed): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== "") { + obj.peerId = message.peerId; + } + if (message.reason !== "") { + obj.reason = message.reason; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_PeerCrashed { + return ServerMessage_PeerCrashed.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_PeerCrashed { + const message = createBaseServerMessage_PeerCrashed(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? ""; + message.reason = object.reason ?? ""; + return message; + }, +}; + +function createBaseServerMessage_ComponentCrashed(): ServerMessage_ComponentCrashed { + return { roomId: "", componentId: "" }; +} + +export const ServerMessage_ComponentCrashed: MessageFns = { + encode(message: ServerMessage_ComponentCrashed, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.componentId !== "") { + writer.uint32(18).string(message.componentId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_ComponentCrashed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_ComponentCrashed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.componentId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_ComponentCrashed { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + componentId: isSet(object.componentId) ? globalThis.String(object.componentId) : "", + }; + }, + + toJSON(message: ServerMessage_ComponentCrashed): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.componentId !== "") { + obj.componentId = message.componentId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_ComponentCrashed { + return ServerMessage_ComponentCrashed.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_ComponentCrashed { + const message = createBaseServerMessage_ComponentCrashed(); + message.roomId = object.roomId ?? ""; + message.componentId = object.componentId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_Authenticated(): ServerMessage_Authenticated { + return {}; +} + +export const ServerMessage_Authenticated: MessageFns = { + encode(_: ServerMessage_Authenticated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_Authenticated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_Authenticated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ServerMessage_Authenticated { + return {}; + }, + + toJSON(_: ServerMessage_Authenticated): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): ServerMessage_Authenticated { + return ServerMessage_Authenticated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): ServerMessage_Authenticated { + const message = createBaseServerMessage_Authenticated(); + return message; + }, +}; + +function createBaseServerMessage_AuthRequest(): ServerMessage_AuthRequest { + return { token: "" }; +} + +export const ServerMessage_AuthRequest: MessageFns = { + encode(message: ServerMessage_AuthRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_AuthRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_AuthRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.token = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_AuthRequest { + return { token: isSet(object.token) ? globalThis.String(object.token) : "" }; + }, + + toJSON(message: ServerMessage_AuthRequest): unknown { + const obj: any = {}; + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_AuthRequest { + return ServerMessage_AuthRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_AuthRequest { + const message = createBaseServerMessage_AuthRequest(); + message.token = object.token ?? ""; + return message; + }, +}; + +function createBaseServerMessage_SubscribeRequest(): ServerMessage_SubscribeRequest { + return { eventType: 0 }; +} + +export const ServerMessage_SubscribeRequest: MessageFns = { + encode(message: ServerMessage_SubscribeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.eventType !== 0) { + writer.uint32(8).int32(message.eventType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_SubscribeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_SubscribeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.eventType = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_SubscribeRequest { + return { eventType: isSet(object.eventType) ? serverMessage_EventTypeFromJSON(object.eventType) : 0 }; + }, + + toJSON(message: ServerMessage_SubscribeRequest): unknown { + const obj: any = {}; + if (message.eventType !== 0) { + obj.eventType = serverMessage_EventTypeToJSON(message.eventType); + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_SubscribeRequest { + return ServerMessage_SubscribeRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_SubscribeRequest { + const message = createBaseServerMessage_SubscribeRequest(); + message.eventType = object.eventType ?? 0; + return message; + }, +}; + +function createBaseServerMessage_SubscribeResponse(): ServerMessage_SubscribeResponse { + return { eventType: 0 }; +} + +export const ServerMessage_SubscribeResponse: MessageFns = { + encode(message: ServerMessage_SubscribeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.eventType !== 0) { + writer.uint32(8).int32(message.eventType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_SubscribeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_SubscribeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.eventType = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_SubscribeResponse { + return { eventType: isSet(object.eventType) ? serverMessage_EventTypeFromJSON(object.eventType) : 0 }; + }, + + toJSON(message: ServerMessage_SubscribeResponse): unknown { + const obj: any = {}; + if (message.eventType !== 0) { + obj.eventType = serverMessage_EventTypeToJSON(message.eventType); + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_SubscribeResponse { + return ServerMessage_SubscribeResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_SubscribeResponse { + const message = createBaseServerMessage_SubscribeResponse(); + message.eventType = object.eventType ?? 0; + return message; + }, +}; + +function createBaseServerMessage_RoomCreated(): ServerMessage_RoomCreated { + return { roomId: "" }; +} + +export const ServerMessage_RoomCreated: MessageFns = { + encode(message: ServerMessage_RoomCreated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_RoomCreated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_RoomCreated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_RoomCreated { + return { roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "" }; + }, + + toJSON(message: ServerMessage_RoomCreated): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_RoomCreated { + return ServerMessage_RoomCreated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_RoomCreated { + const message = createBaseServerMessage_RoomCreated(); + message.roomId = object.roomId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_RoomDeleted(): ServerMessage_RoomDeleted { + return { roomId: "" }; +} + +export const ServerMessage_RoomDeleted: MessageFns = { + encode(message: ServerMessage_RoomDeleted, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_RoomDeleted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_RoomDeleted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_RoomDeleted { + return { roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "" }; + }, + + toJSON(message: ServerMessage_RoomDeleted): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_RoomDeleted { + return ServerMessage_RoomDeleted.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_RoomDeleted { + const message = createBaseServerMessage_RoomDeleted(); + message.roomId = object.roomId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_MetricsReport(): ServerMessage_MetricsReport { + return { metrics: "" }; +} + +export const ServerMessage_MetricsReport: MessageFns = { + encode(message: ServerMessage_MetricsReport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.metrics !== "") { + writer.uint32(10).string(message.metrics); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_MetricsReport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_MetricsReport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.metrics = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_MetricsReport { + return { metrics: isSet(object.metrics) ? globalThis.String(object.metrics) : "" }; + }, + + toJSON(message: ServerMessage_MetricsReport): unknown { + const obj: any = {}; + if (message.metrics !== "") { + obj.metrics = message.metrics; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_MetricsReport { + return ServerMessage_MetricsReport.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_MetricsReport { + const message = createBaseServerMessage_MetricsReport(); + message.metrics = object.metrics ?? ""; + return message; + }, +}; + +function createBaseServerMessage_HlsPlayable(): ServerMessage_HlsPlayable { + return { roomId: "", componentId: "" }; +} + +export const ServerMessage_HlsPlayable: MessageFns = { + encode(message: ServerMessage_HlsPlayable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.componentId !== "") { + writer.uint32(18).string(message.componentId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_HlsPlayable { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_HlsPlayable(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.componentId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_HlsPlayable { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + componentId: isSet(object.componentId) ? globalThis.String(object.componentId) : "", + }; + }, + + toJSON(message: ServerMessage_HlsPlayable): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.componentId !== "") { + obj.componentId = message.componentId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_HlsPlayable { + return ServerMessage_HlsPlayable.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_HlsPlayable { + const message = createBaseServerMessage_HlsPlayable(); + message.roomId = object.roomId ?? ""; + message.componentId = object.componentId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_HlsUploaded(): ServerMessage_HlsUploaded { + return { roomId: "" }; +} + +export const ServerMessage_HlsUploaded: MessageFns = { + encode(message: ServerMessage_HlsUploaded, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_HlsUploaded { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_HlsUploaded(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_HlsUploaded { + return { roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "" }; + }, + + toJSON(message: ServerMessage_HlsUploaded): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_HlsUploaded { + return ServerMessage_HlsUploaded.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_HlsUploaded { + const message = createBaseServerMessage_HlsUploaded(); + message.roomId = object.roomId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_HlsUploadCrashed(): ServerMessage_HlsUploadCrashed { + return { roomId: "" }; +} + +export const ServerMessage_HlsUploadCrashed: MessageFns = { + encode(message: ServerMessage_HlsUploadCrashed, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_HlsUploadCrashed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_HlsUploadCrashed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_HlsUploadCrashed { + return { roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "" }; + }, + + toJSON(message: ServerMessage_HlsUploadCrashed): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_HlsUploadCrashed { + return ServerMessage_HlsUploadCrashed.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_HlsUploadCrashed { + const message = createBaseServerMessage_HlsUploadCrashed(); + message.roomId = object.roomId ?? ""; + return message; + }, +}; + +function createBaseServerMessage_PeerMetadataUpdated(): ServerMessage_PeerMetadataUpdated { + return { roomId: "", peerId: "", metadata: "" }; +} + +export const ServerMessage_PeerMetadataUpdated: MessageFns = { + encode(message: ServerMessage_PeerMetadataUpdated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== "") { + writer.uint32(18).string(message.peerId); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_PeerMetadataUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_PeerMetadataUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.metadata = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_PeerMetadataUpdated { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : "", + metadata: isSet(object.metadata) ? globalThis.String(object.metadata) : "", + }; + }, + + toJSON(message: ServerMessage_PeerMetadataUpdated): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== "") { + obj.peerId = message.peerId; + } + if (message.metadata !== "") { + obj.metadata = message.metadata; + } + return obj; + }, + + create, I>>( + base?: I, + ): ServerMessage_PeerMetadataUpdated { + return ServerMessage_PeerMetadataUpdated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_PeerMetadataUpdated { + const message = createBaseServerMessage_PeerMetadataUpdated(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? ""; + message.metadata = object.metadata ?? ""; + return message; + }, +}; + +function createBaseServerMessage_Track(): ServerMessage_Track { + return { id: "", type: 0, metadata: "" }; +} + +export const ServerMessage_Track: MessageFns = { + encode(message: ServerMessage_Track, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_Track { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_Track(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.type = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.metadata = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_Track { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + type: isSet(object.type) ? serverMessage_TrackTypeFromJSON(object.type) : 0, + metadata: isSet(object.metadata) ? globalThis.String(object.metadata) : "", + }; + }, + + toJSON(message: ServerMessage_Track): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.type !== 0) { + obj.type = serverMessage_TrackTypeToJSON(message.type); + } + if (message.metadata !== "") { + obj.metadata = message.metadata; + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_Track { + return ServerMessage_Track.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_Track { + const message = createBaseServerMessage_Track(); + message.id = object.id ?? ""; + message.type = object.type ?? 0; + message.metadata = object.metadata ?? ""; + return message; + }, +}; + +function createBaseServerMessage_TrackAdded(): ServerMessage_TrackAdded { + return { roomId: "", peerId: undefined, componentId: undefined, track: undefined }; +} + +export const ServerMessage_TrackAdded: MessageFns = { + encode(message: ServerMessage_TrackAdded, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== undefined) { + writer.uint32(18).string(message.peerId); + } + if (message.componentId !== undefined) { + writer.uint32(26).string(message.componentId); + } + if (message.track !== undefined) { + ServerMessage_Track.encode(message.track, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_TrackAdded { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_TrackAdded(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.componentId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.track = ServerMessage_Track.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_TrackAdded { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : undefined, + componentId: isSet(object.componentId) ? globalThis.String(object.componentId) : undefined, + track: isSet(object.track) ? ServerMessage_Track.fromJSON(object.track) : undefined, + }; + }, + + toJSON(message: ServerMessage_TrackAdded): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== undefined) { + obj.peerId = message.peerId; + } + if (message.componentId !== undefined) { + obj.componentId = message.componentId; + } + if (message.track !== undefined) { + obj.track = ServerMessage_Track.toJSON(message.track); + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_TrackAdded { + return ServerMessage_TrackAdded.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_TrackAdded { + const message = createBaseServerMessage_TrackAdded(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? undefined; + message.componentId = object.componentId ?? undefined; + message.track = (object.track !== undefined && object.track !== null) + ? ServerMessage_Track.fromPartial(object.track) + : undefined; + return message; + }, +}; + +function createBaseServerMessage_TrackRemoved(): ServerMessage_TrackRemoved { + return { roomId: "", peerId: undefined, componentId: undefined, track: undefined }; +} + +export const ServerMessage_TrackRemoved: MessageFns = { + encode(message: ServerMessage_TrackRemoved, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== undefined) { + writer.uint32(18).string(message.peerId); + } + if (message.componentId !== undefined) { + writer.uint32(26).string(message.componentId); + } + if (message.track !== undefined) { + ServerMessage_Track.encode(message.track, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_TrackRemoved { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_TrackRemoved(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.componentId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.track = ServerMessage_Track.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_TrackRemoved { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : undefined, + componentId: isSet(object.componentId) ? globalThis.String(object.componentId) : undefined, + track: isSet(object.track) ? ServerMessage_Track.fromJSON(object.track) : undefined, + }; + }, + + toJSON(message: ServerMessage_TrackRemoved): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== undefined) { + obj.peerId = message.peerId; + } + if (message.componentId !== undefined) { + obj.componentId = message.componentId; + } + if (message.track !== undefined) { + obj.track = ServerMessage_Track.toJSON(message.track); + } + return obj; + }, + + create, I>>(base?: I): ServerMessage_TrackRemoved { + return ServerMessage_TrackRemoved.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ServerMessage_TrackRemoved { + const message = createBaseServerMessage_TrackRemoved(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? undefined; + message.componentId = object.componentId ?? undefined; + message.track = (object.track !== undefined && object.track !== null) + ? ServerMessage_Track.fromPartial(object.track) + : undefined; + return message; + }, +}; + +function createBaseServerMessage_TrackMetadataUpdated(): ServerMessage_TrackMetadataUpdated { + return { roomId: "", peerId: undefined, componentId: undefined, track: undefined }; +} + +export const ServerMessage_TrackMetadataUpdated: MessageFns = { + encode(message: ServerMessage_TrackMetadataUpdated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.roomId !== "") { + writer.uint32(10).string(message.roomId); + } + if (message.peerId !== undefined) { + writer.uint32(18).string(message.peerId); + } + if (message.componentId !== undefined) { + writer.uint32(26).string(message.componentId); + } + if (message.track !== undefined) { + ServerMessage_Track.encode(message.track, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServerMessage_TrackMetadataUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServerMessage_TrackMetadataUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.roomId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.peerId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.componentId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.track = ServerMessage_Track.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServerMessage_TrackMetadataUpdated { + return { + roomId: isSet(object.roomId) ? globalThis.String(object.roomId) : "", + peerId: isSet(object.peerId) ? globalThis.String(object.peerId) : undefined, + componentId: isSet(object.componentId) ? globalThis.String(object.componentId) : undefined, + track: isSet(object.track) ? ServerMessage_Track.fromJSON(object.track) : undefined, + }; + }, + + toJSON(message: ServerMessage_TrackMetadataUpdated): unknown { + const obj: any = {}; + if (message.roomId !== "") { + obj.roomId = message.roomId; + } + if (message.peerId !== undefined) { + obj.peerId = message.peerId; + } + if (message.componentId !== undefined) { + obj.componentId = message.componentId; + } + if (message.track !== undefined) { + obj.track = ServerMessage_Track.toJSON(message.track); + } + return obj; + }, + + create, I>>( + base?: I, + ): ServerMessage_TrackMetadataUpdated { + return ServerMessage_TrackMetadataUpdated.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ServerMessage_TrackMetadataUpdated { + const message = createBaseServerMessage_TrackMetadataUpdated(); + message.roomId = object.roomId ?? ""; + message.peerId = object.peerId ?? undefined; + message.componentId = object.componentId ?? undefined; + message.track = (object.track !== undefined && object.track !== null) + ? ServerMessage_Track.fromPartial(object.track) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create, I>>(base?: I): T; + fromPartial, I>>(object: I): T; +} diff --git a/packages/protobufs/package.json b/packages/protobufs/package.json new file mode 100644 index 00000000..ab811a08 --- /dev/null +++ b/packages/protobufs/package.json @@ -0,0 +1,18 @@ +{ + "name": "@fishjam-cloud/protobufs", + "version": "0.9.0", + "private": true, + "exports": { + "./peer": "./fishjam/media_events/peer/peer.ts", + "./server": "./fishjam/media_events/server/server.ts", + "./shared": "./fishjam/media_events/shared.ts", + "./fishjamPeer": "./fishjam/peer_notifications.ts", + "./fishjamServer": "./fishjam/server_notifications.ts" + }, + "scripts": { + "build": "./protobuf.sh" + }, + "devDependencies": { + "ts-proto": "^2.2.7" + } +} diff --git a/packages/protobufs/protobuf.sh b/packages/protobufs/protobuf.sh new file mode 100755 index 00000000..8c185295 --- /dev/null +++ b/packages/protobufs/protobuf.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e + +ROOTDIR=$(dirname $(dirname "$(readlink -f $0)")) + +cd $ROOTDIR + +printf "Synchronising submodules... " +git submodule sync --recursive >> /dev/null +git submodule update --recursive --remote --init >> /dev/null +printf "DONE\n" + + +cd protobufs/protos + +files=$(find fishjam -name "*.proto") + +for file in $files; do + printf "Compiling file $file... " + protoc --plugin=../../../node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=../ $file + printf "DONE\n" + count=$(($count + 1)) +done + diff --git a/packages/protobufs/protos b/packages/protobufs/protos new file mode 160000 index 00000000..1e477d1f --- /dev/null +++ b/packages/protobufs/protos @@ -0,0 +1 @@ +Subproject commit 1e477d1fe597c5f0f5106853670653ef9d47f6e4 diff --git a/packages/ts-client/package.json b/packages/ts-client/package.json index ac22e83a..d980764d 100644 --- a/packages/ts-client/package.json +++ b/packages/ts-client/package.json @@ -11,23 +11,23 @@ "webrtc", "fishjam" ], - "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", "files": [ "dist/**" ], - "exports": { - ".": { - "import": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./protos": { - "import": "./dist/protos/index.js", - "types": "./dist/protos/index.d.ts" - } + "tsup": { + "dts": true, + "minify": true, + "format": [ + "esm" + ], + "noExternal": [ + "@fishjam-cloud/webrtc-client" + ] }, "scripts": { - "build": "tsc", + "build": "tsup src/index.ts", "build:check": "tsc --noEmit", "format": "prettier --write . --ignore-path ./.eslintignore", "format:check": "prettier --check . --ignore-path ./.eslintignore", @@ -52,6 +52,7 @@ "fake-mediastreamtrack": "^1.2.0", "husky": "^9.1.7", "lint-staged": "^15.2.10", + "tsup": "^8.3.5", "typed-emitter": "^2.1.0", "typedoc": "^0.26.11", "typedoc-plugin-external-resolver": "^1.0.3", diff --git a/packages/ts-client/src/index.ts b/packages/ts-client/src/index.ts index cb91fbb9..8b1fb120 100644 --- a/packages/ts-client/src/index.ts +++ b/packages/ts-client/src/index.ts @@ -18,6 +18,8 @@ export type { AuthErrorReason } from './auth.js'; export { isAuthError, AUTH_ERROR_REASONS } from './auth.js'; +export { sdkVersion } from './sdkVersion'; + export type { TrackBandwidthLimit, SimulcastBandwidthLimit, diff --git a/packages/ts-client/src/sdkVersion.ts b/packages/ts-client/src/sdkVersion.ts new file mode 100644 index 00000000..5030c37c --- /dev/null +++ b/packages/ts-client/src/sdkVersion.ts @@ -0,0 +1,3 @@ +import packageJson from '../package.json'; + +export const sdkVersion = packageJson.version; diff --git a/packages/ts-client/tsconfig.json b/packages/ts-client/tsconfig.json index 36fadb22..7cdcab80 100644 --- a/packages/ts-client/tsconfig.json +++ b/packages/ts-client/tsconfig.json @@ -7,7 +7,6 @@ "jsx": "react-jsx", "strict": true, - "incremental": true, "skipLibCheck": true, "esModuleInterop": true, "declaration": true, diff --git a/yarn.lock b/yarn.lock index 742a624c..994ac1d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -255,6 +255,13 @@ __metadata: languageName: node linkType: hard +"@bufbuild/protobuf@npm:^2.0.0, @bufbuild/protobuf@npm:^2.2.2": + version: 2.2.2 + resolution: "@bufbuild/protobuf@npm:2.2.2" + checksum: 10c0/17687c36c85b2e489c7ffd676479c54e12437270eb5a724775cb880b09948cad205b79e5822a4d10cefde0eef433b781350d73bb649d8de9e84d7745871ee719 + languageName: node + linkType: hard + "@bufbuild/protobuf@npm:^2.2.0": version: 2.2.0 resolution: "@bufbuild/protobuf@npm:2.2.0" @@ -262,13 +269,6 @@ __metadata: languageName: node linkType: hard -"@bufbuild/protobuf@npm:^2.2.2": - version: 2.2.2 - resolution: "@bufbuild/protobuf@npm:2.2.2" - checksum: 10c0/17687c36c85b2e489c7ffd676479c54e12437270eb5a724775cb880b09948cad205b79e5822a4d10cefde0eef433b781350d73bb649d8de9e84d7745871ee719 - languageName: node - linkType: hard - "@esbuild/aix-ppc64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/aix-ppc64@npm:0.21.5" @@ -276,6 +276,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/aix-ppc64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/aix-ppc64@npm:0.24.0" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + "@esbuild/android-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/android-arm64@npm:0.21.5" @@ -283,6 +290,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-arm64@npm:0.24.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/android-arm@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/android-arm@npm:0.21.5" @@ -290,6 +304,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-arm@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-arm@npm:0.24.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + "@esbuild/android-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/android-x64@npm:0.21.5" @@ -297,6 +318,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-x64@npm:0.24.0" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + "@esbuild/darwin-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/darwin-arm64@npm:0.21.5" @@ -304,6 +332,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/darwin-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/darwin-arm64@npm:0.24.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/darwin-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/darwin-x64@npm:0.21.5" @@ -311,6 +346,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/darwin-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/darwin-x64@npm:0.24.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + "@esbuild/freebsd-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/freebsd-arm64@npm:0.21.5" @@ -318,6 +360,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/freebsd-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/freebsd-arm64@npm:0.24.0" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/freebsd-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/freebsd-x64@npm:0.21.5" @@ -325,6 +374,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/freebsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/freebsd-x64@npm:0.24.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/linux-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-arm64@npm:0.21.5" @@ -332,6 +388,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-arm64@npm:0.24.0" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/linux-arm@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-arm@npm:0.21.5" @@ -339,6 +402,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-arm@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-arm@npm:0.24.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + "@esbuild/linux-ia32@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-ia32@npm:0.21.5" @@ -346,6 +416,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-ia32@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-ia32@npm:0.24.0" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + "@esbuild/linux-loong64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-loong64@npm:0.21.5" @@ -353,6 +430,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-loong64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-loong64@npm:0.24.0" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + "@esbuild/linux-mips64el@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-mips64el@npm:0.21.5" @@ -360,6 +444,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-mips64el@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-mips64el@npm:0.24.0" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + "@esbuild/linux-ppc64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-ppc64@npm:0.21.5" @@ -367,6 +458,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-ppc64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-ppc64@npm:0.24.0" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + "@esbuild/linux-riscv64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-riscv64@npm:0.21.5" @@ -374,6 +472,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-riscv64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-riscv64@npm:0.24.0" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + "@esbuild/linux-s390x@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-s390x@npm:0.21.5" @@ -381,6 +486,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-s390x@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-s390x@npm:0.24.0" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + "@esbuild/linux-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-x64@npm:0.21.5" @@ -388,6 +500,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-x64@npm:0.24.0" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + "@esbuild/netbsd-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/netbsd-x64@npm:0.21.5" @@ -395,6 +514,20 @@ __metadata: languageName: node linkType: hard +"@esbuild/netbsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/netbsd-x64@npm:0.24.0" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/openbsd-arm64@npm:0.24.0" + conditions: os=openbsd & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/openbsd-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/openbsd-x64@npm:0.21.5" @@ -402,6 +535,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/openbsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/openbsd-x64@npm:0.24.0" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/sunos-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/sunos-x64@npm:0.21.5" @@ -409,6 +549,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/sunos-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/sunos-x64@npm:0.24.0" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + "@esbuild/win32-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/win32-arm64@npm:0.21.5" @@ -416,6 +563,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-arm64@npm:0.24.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/win32-ia32@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/win32-ia32@npm:0.21.5" @@ -423,6 +577,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-ia32@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-ia32@npm:0.24.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@esbuild/win32-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/win32-x64@npm:0.21.5" @@ -430,6 +591,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-x64@npm:0.24.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -479,6 +647,14 @@ __metadata: languageName: node linkType: hard +"@fishjam-cloud/protobufs@workspace:*, @fishjam-cloud/protobufs@workspace:packages/protobufs": + version: 0.0.0-use.local + resolution: "@fishjam-cloud/protobufs@workspace:packages/protobufs" + dependencies: + ts-proto: "npm:^2.2.7" + languageName: unknown + linkType: soft + "@fishjam-cloud/react-client@workspace:*, @fishjam-cloud/react-client@workspace:packages/react-client": version: 0.0.0-use.local resolution: "@fishjam-cloud/react-client@workspace:packages/react-client" @@ -514,6 +690,7 @@ __metadata: fake-mediastreamtrack: "npm:^1.2.0" husky: "npm:^9.1.7" lint-staged: "npm:^15.2.10" + tsup: "npm:^8.3.5" typed-emitter: "npm:^2.1.0" typedoc: "npm:^0.26.11" typedoc-plugin-external-resolver: "npm:^1.0.3" @@ -567,6 +744,7 @@ __metadata: version: 0.0.0-use.local resolution: "@fishjam-e2e/ts-client-e2e@workspace:e2e-tests/ts-client/app" dependencies: + "@fishjam-cloud/protobufs": "workspace:*" "@fishjam-cloud/ts-client": "workspace:*" "@playwright/test": "npm:^1.49.0" "@types/node": "npm:^22.9.1" @@ -1528,6 +1706,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm-eabi@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.27.2" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + "@rollup/rollup-android-arm64@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-android-arm64@npm:4.22.4" @@ -1535,6 +1720,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm64@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-android-arm64@npm:4.27.2" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + "@rollup/rollup-darwin-arm64@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-darwin-arm64@npm:4.22.4" @@ -1542,6 +1734,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-darwin-arm64@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-darwin-arm64@npm:4.27.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@rollup/rollup-darwin-x64@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-darwin-x64@npm:4.22.4" @@ -1549,6 +1748,27 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-darwin-x64@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-darwin-x64@npm:4.27.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-freebsd-arm64@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.27.2" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-freebsd-x64@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-freebsd-x64@npm:4.27.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + "@rollup/rollup-linux-arm-gnueabihf@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.22.4" @@ -1556,6 +1776,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm-gnueabihf@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.27.2" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-arm-musleabihf@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.22.4" @@ -1563,6 +1790,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm-musleabihf@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.27.2" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + "@rollup/rollup-linux-arm64-gnu@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.22.4" @@ -1570,6 +1804,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm64-gnu@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.27.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-arm64-musl@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.22.4" @@ -1577,6 +1818,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm64-musl@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.27.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + "@rollup/rollup-linux-powerpc64le-gnu@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.22.4" @@ -1584,6 +1832,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.2" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-riscv64-gnu@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.22.4" @@ -1591,6 +1846,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-riscv64-gnu@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.27.2" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-s390x-gnu@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.22.4" @@ -1598,6 +1860,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-s390x-gnu@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.27.2" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-x64-gnu@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.22.4" @@ -1605,6 +1874,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-x64-gnu@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.27.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-x64-musl@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-linux-x64-musl@npm:4.22.4" @@ -1612,6 +1888,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-x64-musl@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.27.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + "@rollup/rollup-win32-arm64-msvc@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.22.4" @@ -1619,6 +1902,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-win32-arm64-msvc@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.27.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@rollup/rollup-win32-ia32-msvc@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.22.4" @@ -1626,6 +1916,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-win32-ia32-msvc@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.27.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@rollup/rollup-win32-x64-msvc@npm:4.22.4": version: 4.22.4 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.22.4" @@ -1633,6 +1930,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-win32-x64-msvc@npm:4.27.2": + version: 4.27.2 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.27.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@shikijs/core@npm:1.17.7": version: 1.17.7 resolution: "@shikijs/core@npm:1.17.7" @@ -1900,6 +2204,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a + languageName: node + linkType: hard + "@types/events@npm:^3.0.3": version: 3.0.3 resolution: "@types/events@npm:3.0.3" @@ -2732,6 +3043,17 @@ __metadata: languageName: node linkType: hard +"bundle-require@npm:^5.0.0": + version: 5.0.0 + resolution: "bundle-require@npm:5.0.0" + dependencies: + load-tsconfig: "npm:^0.2.3" + peerDependencies: + esbuild: ">=0.18" + checksum: 10c0/92c46df02586e0ebd66ee4831c9b5775adb3c32a43fe2b2aaf7bc675135c141f751de6a9a26b146d64c607c5b40f9eef5f10dce3c364f602d4bed268444c32c6 + languageName: node + linkType: hard + "byline@npm:^5.0.0": version: 5.0.0 resolution: "byline@npm:5.0.0" @@ -2787,6 +3109,13 @@ __metadata: languageName: node linkType: hard +"case-anything@npm:^2.1.13": + version: 2.1.13 + resolution: "case-anything@npm:2.1.13" + checksum: 10c0/b02ffa51d7d58b9a32df7b40973836e16afad131eae7d343e64cb3ca7be57a936bf3d6c9d57a7aa242cf2f545d9a33990b755e93bcac2517761d77773a4a6a30 + languageName: node + linkType: hard + "ccount@npm:^2.0.0": version: 2.0.1 resolution: "ccount@npm:2.0.1" @@ -2875,6 +3204,15 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:^4.0.1": + version: 4.0.1 + resolution: "chokidar@npm:4.0.1" + dependencies: + readdirp: "npm:^4.0.1" + checksum: 10c0/4bb7a3adc304059810bb6c420c43261a15bb44f610d77c35547addc84faa0374265c3adc67f25d06f363d9a4571962b02679268c40de07676d260de1986efea9 + languageName: node + linkType: hard + "chownr@npm:^1.1.1": version: 1.1.4 resolution: "chownr@npm:1.1.4" @@ -3034,6 +3372,13 @@ __metadata: languageName: node linkType: hard +"consola@npm:^3.2.3": + version: 3.2.3 + resolution: "consola@npm:3.2.3" + checksum: 10c0/c606220524ec88a05bb1baf557e9e0e04a0c08a9c35d7a08652d99de195c4ddcb6572040a7df57a18ff38bbc13ce9880ad032d56630cef27bef72768ef0ac078 + languageName: node + linkType: hard + "convert-source-map@npm:^2.0.0": version: 2.0.0 resolution: "convert-source-map@npm:2.0.0" @@ -3079,13 +3424,13 @@ __metadata: linkType: hard "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.5 - resolution: "cross-spawn@npm:7.0.5" + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" dependencies: path-key: "npm:^3.1.0" shebang-command: "npm:^2.0.0" which: "npm:^2.0.1" - checksum: 10c0/aa82ce7ac0814a27e6f2b738c5a7cf1fa21a3558a1e42df449fc96541ba3ba731e4d3ecffa4435348808a86212f287c6f20a1ee551ef1ff95d01cfec5f434944 + checksum: 10c0/5738c312387081c98d69c98e105b6327b069197f864a60593245d64c8089c8a0a744e16349281210d56835bb9274130d825a78b2ad6853ca13cfbeffc0c31750 languageName: node linkType: hard @@ -3186,6 +3531,15 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^1.0.3": + version: 1.0.3 + resolution: "detect-libc@npm:1.0.3" + bin: + detect-libc: ./bin/detect-libc.js + checksum: 10c0/4da0deae9f69e13bc37a0902d78bf7169480004b1fed3c19722d56cff578d16f0e11633b7fbf5fb6249181236c72e90024cbd68f0b9558ae06e281f47326d50d + languageName: node + linkType: hard + "detect-node-es@npm:^1.1.0": version: 1.1.0 resolution: "detect-node-es@npm:1.1.0" @@ -3257,6 +3611,15 @@ __metadata: languageName: node linkType: hard +"dprint-node@npm:^1.0.8": + version: 1.0.8 + resolution: "dprint-node@npm:1.0.8" + dependencies: + detect-libc: "npm:^1.0.3" + checksum: 10c0/39c1f8511833226cde773129afc5862dfd05babe062375e6b1f5824e221a5743a4d9c48626f32f7c2080113566270fe80521a50acb9029a20a2e80a3cd5e4106 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -3425,6 +3788,89 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:^0.24.0": + version: 0.24.0 + resolution: "esbuild@npm:0.24.0" + dependencies: + "@esbuild/aix-ppc64": "npm:0.24.0" + "@esbuild/android-arm": "npm:0.24.0" + "@esbuild/android-arm64": "npm:0.24.0" + "@esbuild/android-x64": "npm:0.24.0" + "@esbuild/darwin-arm64": "npm:0.24.0" + "@esbuild/darwin-x64": "npm:0.24.0" + "@esbuild/freebsd-arm64": "npm:0.24.0" + "@esbuild/freebsd-x64": "npm:0.24.0" + "@esbuild/linux-arm": "npm:0.24.0" + "@esbuild/linux-arm64": "npm:0.24.0" + "@esbuild/linux-ia32": "npm:0.24.0" + "@esbuild/linux-loong64": "npm:0.24.0" + "@esbuild/linux-mips64el": "npm:0.24.0" + "@esbuild/linux-ppc64": "npm:0.24.0" + "@esbuild/linux-riscv64": "npm:0.24.0" + "@esbuild/linux-s390x": "npm:0.24.0" + "@esbuild/linux-x64": "npm:0.24.0" + "@esbuild/netbsd-x64": "npm:0.24.0" + "@esbuild/openbsd-arm64": "npm:0.24.0" + "@esbuild/openbsd-x64": "npm:0.24.0" + "@esbuild/sunos-x64": "npm:0.24.0" + "@esbuild/win32-arm64": "npm:0.24.0" + "@esbuild/win32-ia32": "npm:0.24.0" + "@esbuild/win32-x64": "npm:0.24.0" + dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-arm64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 10c0/9f1aadd8d64f3bff422ae78387e66e51a5e09de6935a6f987b6e4e189ed00fdc2d1bc03d2e33633b094008529c8b6e06c7ad1a9782fb09fec223bf95998c0683 + languageName: node + linkType: hard + "escalade@npm:^3.1.2": version: 3.1.2 resolution: "escalade@npm:3.1.2" @@ -3725,6 +4171,18 @@ __metadata: languageName: node linkType: hard +"fdir@npm:^6.4.2": + version: 6.4.2 + resolution: "fdir@npm:6.4.2" + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + checksum: 10c0/34829886f34a3ca4170eca7c7180ec4de51a3abb4d380344063c0ae2e289b11d2ba8b724afee974598c83027fea363ff598caf2b51bc4e6b1e0d8b80cc530573 + languageName: node + linkType: hard + "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -4415,6 +4873,13 @@ __metadata: languageName: node linkType: hard +"joycon@npm:^3.1.1": + version: 3.1.1 + resolution: "joycon@npm:3.1.1" + checksum: 10c0/131fb1e98c9065d067fd49b6e685487ac4ad4d254191d7aa2c9e3b90f4e9ca70430c43cad001602bdbdabcf58717d3b5c5b7461c1bd8e39478c8de706b3fe6ae + languageName: node + linkType: hard + "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -4527,7 +4992,7 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^3.0.0, lilconfig@npm:~3.1.2": +"lilconfig@npm:^3.0.0, lilconfig@npm:^3.1.1, lilconfig@npm:~3.1.2": version: 3.1.2 resolution: "lilconfig@npm:3.1.2" checksum: 10c0/f059630b1a9bddaeba83059db00c672b64dc14074e9f232adce32b38ca1b5686ab737eb665c5ba3c32f147f0002b4bee7311ad0386a9b98547b5623e87071fbe @@ -4584,6 +5049,13 @@ __metadata: languageName: node linkType: hard +"load-tsconfig@npm:^0.2.3": + version: 0.2.5 + resolution: "load-tsconfig@npm:0.2.5" + checksum: 10c0/bf2823dd26389d3497b6567f07435c5a7a58d9df82e879b0b3892f87d8db26900f84c85bc329ef41c0540c0d6a448d1c23ddc64a80f3ff6838b940f3915a3fcb + languageName: node + linkType: hard + "locate-path@npm:^6.0.0": version: 6.0.0 resolution: "locate-path@npm:6.0.0" @@ -4621,6 +5093,13 @@ __metadata: languageName: node linkType: hard +"lodash.sortby@npm:^4.7.0": + version: 4.7.0 + resolution: "lodash.sortby@npm:4.7.0" + checksum: 10c0/fc48fb54ff7669f33bb32997cab9460757ee99fafaf72400b261c3e10fde21538e47d8cfcbe6a25a31bcb5b7b727c27d52626386fc2de24eb059a6d64a89cdf5 + languageName: node + linkType: hard + "lodash@npm:^4.17.15": version: 4.17.21 resolution: "lodash@npm:4.17.21" @@ -5333,6 +5812,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.2": + version: 4.0.2 + resolution: "picomatch@npm:4.0.2" + checksum: 10c0/7c51f3ad2bb42c776f49ebf964c644958158be30d0a510efd5a395e8d49cb5acfed5b82c0c5b365523ce18e6ab85013c9ebe574f60305892ec3fa8eee8304ccc + languageName: node + linkType: hard + "pidtree@npm:~0.6.0": version: 0.6.0 resolution: "pidtree@npm:0.6.0" @@ -5422,6 +5908,29 @@ __metadata: languageName: node linkType: hard +"postcss-load-config@npm:^6.0.1": + version: 6.0.1 + resolution: "postcss-load-config@npm:6.0.1" + dependencies: + lilconfig: "npm:^3.1.1" + peerDependencies: + jiti: ">=1.21.0" + postcss: ">=8.0.9" + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + jiti: + optional: true + postcss: + optional: true + tsx: + optional: true + yaml: + optional: true + checksum: 10c0/74173a58816dac84e44853f7afbd283f4ef13ca0b6baeba27701214beec33f9e309b128f8102e2b173e8d45ecba45d279a9be94b46bf48d219626aa9b5730848 + languageName: node + linkType: hard + "postcss-nested@npm:^6.2.0": version: 6.2.0 resolution: "postcss-nested@npm:6.2.0" @@ -5816,6 +6325,13 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:^4.0.1": + version: 4.0.2 + resolution: "readdirp@npm:4.0.2" + checksum: 10c0/a16ecd8ef3286dcd90648c3b103e3826db2b766cdb4a988752c43a83f683d01c7059158d623cbcd8bdfb39e65d302d285be2d208e7d9f34d022d912b929217dd + languageName: node + linkType: hard + "readdirp@npm:~3.6.0": version: 3.6.0 resolution: "readdirp@npm:3.6.0" @@ -5839,6 +6355,13 @@ __metadata: languageName: node linkType: hard +"resolve-from@npm:^5.0.0": + version: 5.0.0 + resolution: "resolve-from@npm:5.0.0" + checksum: 10c0/b21cb7f1fb746de8107b9febab60095187781137fd803e6a59a76d421444b1531b641bba5857f5dc011974d8a5c635d61cec49e6bd3b7fc20e01f0fafc4efbf2 + languageName: node + linkType: hard + "resolve@npm:^1.1.7, resolve@npm:^1.22.8": version: 1.22.8 resolution: "resolve@npm:1.22.8" @@ -5970,6 +6493,75 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^4.24.0": + version: 4.27.2 + resolution: "rollup@npm:4.27.2" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.27.2" + "@rollup/rollup-android-arm64": "npm:4.27.2" + "@rollup/rollup-darwin-arm64": "npm:4.27.2" + "@rollup/rollup-darwin-x64": "npm:4.27.2" + "@rollup/rollup-freebsd-arm64": "npm:4.27.2" + "@rollup/rollup-freebsd-x64": "npm:4.27.2" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.27.2" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.27.2" + "@rollup/rollup-linux-arm64-gnu": "npm:4.27.2" + "@rollup/rollup-linux-arm64-musl": "npm:4.27.2" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.27.2" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.27.2" + "@rollup/rollup-linux-s390x-gnu": "npm:4.27.2" + "@rollup/rollup-linux-x64-gnu": "npm:4.27.2" + "@rollup/rollup-linux-x64-musl": "npm:4.27.2" + "@rollup/rollup-win32-arm64-msvc": "npm:4.27.2" + "@rollup/rollup-win32-ia32-msvc": "npm:4.27.2" + "@rollup/rollup-win32-x64-msvc": "npm:4.27.2" + "@types/estree": "npm:1.0.6" + fsevents: "npm:~2.3.2" + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-freebsd-arm64": + optional: true + "@rollup/rollup-freebsd-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-powerpc64le-gnu": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 10c0/563c43d064b7af64156621b52997d2c8a4609774dea4deb06c0fbc1f18450f1b65036404224e81a6bbc80a316a558452151fe9be2214b1898aa66bdd93209496 + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -6149,6 +6741,15 @@ __metadata: languageName: node linkType: hard +"source-map@npm:0.8.0-beta.0": + version: 0.8.0-beta.0 + resolution: "source-map@npm:0.8.0-beta.0" + dependencies: + whatwg-url: "npm:^7.0.0" + checksum: 10c0/fb4d9bde9a9fdb2c29b10e5eae6c71d10e09ef467e1afb75fdec2eb7e11fa5b343a2af553f74f18b695dbc0b81f9da2e9fa3d7a317d5985e9939499ec6087835 + languageName: node + linkType: hard + "space-separated-tokens@npm:^2.0.0": version: 2.0.2 resolution: "space-separated-tokens@npm:2.0.2" @@ -6583,6 +7184,16 @@ __metadata: languageName: node linkType: hard +"tinyglobby@npm:^0.2.9": + version: 0.2.10 + resolution: "tinyglobby@npm:0.2.10" + dependencies: + fdir: "npm:^6.4.2" + picomatch: "npm:^4.0.2" + checksum: 10c0/ce946135d39b8c0e394e488ad59f4092e8c4ecd675ef1bcd4585c47de1b325e61ec6adfbfbe20c3c2bfa6fd674c5b06de2a2e65c433f752ae170aff11793e5ef + languageName: node + linkType: hard + "tinypool@npm:^1.0.1": version: 1.0.1 resolution: "tinypool@npm:1.0.1" @@ -6627,6 +7238,24 @@ __metadata: languageName: node linkType: hard +"tr46@npm:^1.0.1": + version: 1.0.1 + resolution: "tr46@npm:1.0.1" + dependencies: + punycode: "npm:^2.1.0" + checksum: 10c0/41525c2ccce86e3ef30af6fa5e1464e6d8bb4286a58ea8db09228f598889581ef62347153f6636cd41553dc41685bdfad0a9d032ef58df9fbb0792b3447d0f04 + languageName: node + linkType: hard + +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 10c0/7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2 + languageName: node + linkType: hard + "trim-lines@npm:^3.0.0": version: 3.0.1 resolution: "trim-lines@npm:3.0.1" @@ -6650,6 +7279,38 @@ __metadata: languageName: node linkType: hard +"ts-poet@npm:^6.7.0": + version: 6.9.0 + resolution: "ts-poet@npm:6.9.0" + dependencies: + dprint-node: "npm:^1.0.8" + checksum: 10c0/c1e3ee6048f075407c2076c8b884b405a3402ae6c013c0af9d0f6b8a6d939c71751a954882d2bd33a606c013d4a57519f5305e0bb1fd6aa0d23edda93e6007bf + languageName: node + linkType: hard + +"ts-proto-descriptors@npm:2.0.0": + version: 2.0.0 + resolution: "ts-proto-descriptors@npm:2.0.0" + dependencies: + "@bufbuild/protobuf": "npm:^2.0.0" + checksum: 10c0/a4f47a6db7de6b328a5b22bb0bed2a0dac929c28002567613db7980e0a8392b9148530e432a602a8c6b2cfda9909be9568a2e5c545f5624bb5d5eba52031c059 + languageName: node + linkType: hard + +"ts-proto@npm:^2.2.7": + version: 2.3.0 + resolution: "ts-proto@npm:2.3.0" + dependencies: + "@bufbuild/protobuf": "npm:^2.0.0" + case-anything: "npm:^2.1.13" + ts-poet: "npm:^6.7.0" + ts-proto-descriptors: "npm:2.0.0" + bin: + protoc-gen-ts_proto: protoc-gen-ts_proto + checksum: 10c0/0571c93c277c44718e364a61b26c3d8db5c44210b150cb0966cecb27bf09996f683355c33c0eec2e4c9c960a9ea27f8197d841777a51e3b34144472449c8066e + languageName: node + linkType: hard + "tslib@npm:^2.0.0": version: 2.7.0 resolution: "tslib@npm:2.7.0" @@ -6664,6 +7325,47 @@ __metadata: languageName: node linkType: hard +"tsup@npm:^8.3.5": + version: 8.3.5 + resolution: "tsup@npm:8.3.5" + dependencies: + bundle-require: "npm:^5.0.0" + cac: "npm:^6.7.14" + chokidar: "npm:^4.0.1" + consola: "npm:^3.2.3" + debug: "npm:^4.3.7" + esbuild: "npm:^0.24.0" + joycon: "npm:^3.1.1" + picocolors: "npm:^1.1.1" + postcss-load-config: "npm:^6.0.1" + resolve-from: "npm:^5.0.0" + rollup: "npm:^4.24.0" + source-map: "npm:0.8.0-beta.0" + sucrase: "npm:^3.35.0" + tinyexec: "npm:^0.3.1" + tinyglobby: "npm:^0.2.9" + tree-kill: "npm:^1.2.2" + peerDependencies: + "@microsoft/api-extractor": ^7.36.0 + "@swc/core": ^1 + postcss: ^8.4.12 + typescript: ">=4.5.0" + peerDependenciesMeta: + "@microsoft/api-extractor": + optional: true + "@swc/core": + optional: true + postcss: + optional: true + typescript: + optional: true + bin: + tsup: dist/cli-default.js + tsup-node: dist/cli-node.js + checksum: 10c0/7794953cbc784b7c8f14c4898d36a293b815b528d3098c2416aeaa2b4775dc477132cd12f75f6d32737dfd15ba10139c73f7039045352f2ba1ea7e5fe6fe3773 + languageName: node + linkType: hard + "tweetnacl@npm:^0.14.3": version: 0.14.5 resolution: "tweetnacl@npm:0.14.5" @@ -7238,6 +7940,24 @@ __metadata: languageName: node linkType: hard +"webidl-conversions@npm:^4.0.2": + version: 4.0.2 + resolution: "webidl-conversions@npm:4.0.2" + checksum: 10c0/def5c5ac3479286dffcb604547628b2e6b46c5c5b8a8cfaa8c71dc3bafc85859bde5fbe89467ff861f571ab38987cf6ab3d6e7c80b39b999e50e803c12f3164f + languageName: node + linkType: hard + +"whatwg-url@npm:^7.0.0": + version: 7.1.0 + resolution: "whatwg-url@npm:7.1.0" + dependencies: + lodash.sortby: "npm:^4.7.0" + tr46: "npm:^1.0.1" + webidl-conversions: "npm:^4.0.2" + checksum: 10c0/2785fe4647690e5a0225a79509ba5e21fdf4a71f9de3eabdba1192483fe006fc79961198e0b99f82751557309f17fc5a07d4d83c251aa5b2f85ba71e674cbee9 + languageName: node + linkType: hard + "which@npm:^2.0.1": version: 2.0.2 resolution: "which@npm:2.0.2"