New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

livekit-server-sdk

Package Overview
Dependencies
Maintainers
30
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

livekit-server-sdk - npm Package Compare versions

Comparing version 2.6.2 to 2.7.0

4

dist/AccessToken.d.ts

@@ -30,4 +30,4 @@ import type { ClaimGrants, SIPGrant, VideoGrant } from './grants.js';

* Creates a new AccessToken
* @param apiKey API Key, can be set in env LIVEKIT_API_KEY
* @param apiSecret Secret, can be set in env LIVEKIT_API_SECRET
* @param apiKey - API Key, can be set in env LIVEKIT_API_KEY
* @param apiSecret - Secret, can be set in env LIVEKIT_API_SECRET
*/

@@ -34,0 +34,0 @@ constructor(apiKey?: string, apiSecret?: string, options?: AccessTokenOptions);

@@ -11,4 +11,4 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

* Creates a new AccessToken
* @param apiKey API Key, can be set in env LIVEKIT_API_KEY
* @param apiSecret Secret, can be set in env LIVEKIT_API_SECRET
* @param apiKey - API Key, can be set in env LIVEKIT_API_KEY
* @param apiSecret - Secret, can be set in env LIVEKIT_API_SECRET
*/

@@ -15,0 +15,0 @@ constructor(apiKey, apiSecret, options) {

@@ -89,11 +89,11 @@ import type { DirectFileOutput, EncodedFileOutput, EncodingOptions, EncodingOptionsPreset, ImageOutput, SegmentedFileOutput, StreamOutput } from '@livekit/protocol';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/
constructor(host: string, apiKey?: string, secret?: string);
/**
* @param roomName room name
* @param output file or stream output
* @param opts RoomCompositeOptions
* @param roomName - room name
* @param output - file or stream output
* @param opts - RoomCompositeOptions
*/

@@ -106,5 +106,5 @@ startRoomCompositeEgress(roomName: string, output: EncodedOutputs | EncodedFileOutput | StreamOutput | SegmentedFileOutput, opts?: RoomCompositeOptions): Promise<EgressInfo>;

/**
* @param url url
* @param output file or stream output
* @param opts WebOptions
* @param url - url
* @param output - file or stream output
* @param opts - WebOptions
*/

@@ -115,11 +115,11 @@ startWebEgress(url: string, output: EncodedOutputs | EncodedFileOutput | StreamOutput | SegmentedFileOutput, opts?: WebOptions): Promise<EgressInfo>;

*
* @param roomName room name
* @param output one or more outputs
* @param opts ParticipantEgressOptions
* @param roomName - room name
* @param output - one or more outputs
* @param opts - ParticipantEgressOptions
*/
startParticipantEgress(roomName: string, identity: string, output: EncodedOutputs, opts?: ParticipantEgressOptions): Promise<EgressInfo>;
/**
* @param roomName room name
* @param output file or stream output
* @param opts TrackCompositeOptions
* @param roomName - room name
* @param output - file or stream output
* @param opts - TrackCompositeOptions
*/

@@ -137,20 +137,20 @@ startTrackCompositeEgress(roomName: string, output: EncodedOutputs | EncodedFileOutput | StreamOutput | SegmentedFileOutput, opts?: TrackCompositeOptions): Promise<EgressInfo>;

/**
* @param roomName room name
* @param output file or websocket output
* @param trackId track Id
* @param roomName - room name
* @param output - file or websocket output
* @param trackId - track Id
*/
startTrackEgress(roomName: string, output: DirectFileOutput | string, trackId: string): Promise<EgressInfo>;
/**
* @param egressId
* @param layout
* @param egressId -
* @param layout -
*/
updateLayout(egressId: string, layout: string): Promise<EgressInfo>;
/**
* @param egressId
* @param addOutputUrls
* @param removeOutputUrls
* @param egressId -
* @param addOutputUrls -
* @param removeOutputUrls -
*/
updateStream(egressId: string, addOutputUrls?: string[], removeOutputUrls?: string[]): Promise<EgressInfo>;
/**
* @param options options to filter listed Egresses, by default returns all
* @param options - options to filter listed Egresses, by default returns all
* Egress instances

@@ -160,8 +160,8 @@ */

/**
* @deprecated
* @param roomName list egress for one room only
* @deprecated use `listEgress(options?: ListEgressOptions)` instead
* @param roomName - list egress for one room only
*/
listEgress(roomName?: string): Promise<Array<EgressInfo>>;
/**
* @param egressId
* @param egressId -
*/

@@ -168,0 +168,0 @@ stopEgress(egressId: string): Promise<EgressInfo>;

@@ -10,5 +10,5 @@ import { EgressInfo, ListEgressRequest, ListEgressResponse, ParticipantEgressRequest, RoomCompositeEgressRequest, StopEgressRequest, TrackCompositeEgressRequest, TrackEgressRequest, UpdateLayoutRequest, UpdateStreamRequest, WebEgressRequest, } from '@livekit/protocol';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/

@@ -56,5 +56,5 @@ constructor(host, apiKey, secret) {

/**
* @param url url
* @param output file or stream output
* @param opts WebOptions
* @param url - url
* @param output - file or stream output
* @param opts - WebOptions
*/

@@ -84,5 +84,5 @@ async startWebEgress(url, output, opts) {

*
* @param roomName room name
* @param output one or more outputs
* @param opts ParticipantEgressOptions
* @param roomName - room name
* @param output - one or more outputs
* @param opts - ParticipantEgressOptions
*/

@@ -133,2 +133,3 @@ async startParticipantEgress(roomName, identity, output, opts) {

}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
isEncodedOutputs(output) {

@@ -139,2 +140,3 @@ return (output.file !== undefined ||

}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
isEncodedFileOutput(output) {

@@ -144,2 +146,3 @@ return (output.filepath !== undefined ||

}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
isSegmentedFileOutput(output) {

@@ -150,2 +153,3 @@ return (output.filenamePrefix !== undefined ||

}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
isStreamOutput(output) {

@@ -232,5 +236,5 @@ return (output.protocol !== undefined || output.urls !== undefined);

/**
* @param roomName room name
* @param output file or websocket output
* @param trackId track Id
* @param roomName - room name
* @param output - file or websocket output
* @param trackId - track Id
*/

@@ -260,4 +264,4 @@ async startTrackEgress(roomName, output, trackId) {

/**
* @param egressId
* @param layout
* @param egressId -
* @param layout -
*/

@@ -269,5 +273,5 @@ async updateLayout(egressId, layout) {

/**
* @param egressId
* @param addOutputUrls
* @param removeOutputUrls
* @param egressId -
* @param addOutputUrls -
* @param removeOutputUrls -
*/

@@ -281,3 +285,3 @@ async updateStream(egressId, addOutputUrls, removeOutputUrls) {

/**
* @param roomName list egress for one room only
* @param roomName - list egress for one room only
*/

@@ -297,3 +301,3 @@ async listEgress(options) {

/**
* @param egressId
* @param egressId -
*/

@@ -300,0 +304,0 @@ async stopEgress(egressId) {

@@ -21,2 +21,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

var _a;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const claim = Object.assign({}, grant);

@@ -23,0 +24,0 @@ // eslint-disable-next-line no-restricted-syntax

@@ -1,2 +0,3 @@

import { IngressAudioOptions, IngressInfo, IngressInput, IngressVideoOptions } from '@livekit/protocol';
import type { IngressAudioOptions, IngressInput, IngressVideoOptions } from '@livekit/protocol';
import { IngressInfo } from '@livekit/protocol';
import ServiceBase from './ServiceBase.js';

@@ -103,28 +104,28 @@ export interface CreateIngressOptions {

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/
constructor(host: string, apiKey?: string, secret?: string);
/**
* @param inputType protocol for the ingress
* @param opts CreateIngressOptions
* @param inputType - protocol for the ingress
* @param opts - CreateIngressOptions
*/
createIngress(inputType: IngressInput, opts?: CreateIngressOptions): Promise<IngressInfo>;
/**
* @param ingressId ID of the ingress to update
* @param opts UpdateIngressOptions
* @param ingressId - ID of the ingress to update
* @param opts - UpdateIngressOptions
*/
updateIngress(ingressId: string, opts: UpdateIngressOptions): Promise<IngressInfo>;
/**
* @deprecated use listIngress(opts) instead
* @param roomName list ingress for one room only
* @deprecated use `listIngress(opts)` or `listIngress(arg)` instead
* @param roomName - list ingress for one room only
*/
listIngress(roomName?: string): Promise<Array<IngressInfo>>;
/**
* @param opts list options
* @param opts - list options
*/
listIngress(opts?: ListIngressOptions): Promise<Array<IngressInfo>>;
/**
* @param ingressId ingress to delete
* @param ingressId - ingress to delete
*/

@@ -131,0 +132,0 @@ deleteIngress(ingressId: string): Promise<IngressInfo>;

@@ -1,4 +0,1 @@

// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import { CreateIngressRequest, DeleteIngressRequest, IngressInfo, ListIngressRequest, ListIngressResponse, UpdateIngressRequest, } from '@livekit/protocol';

@@ -13,5 +10,5 @@ import ServiceBase from './ServiceBase.js';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/

@@ -23,4 +20,4 @@ constructor(host, apiKey, secret) {

/**
* @param inputType protocol for the ingress
* @param opts CreateIngressOptions
* @param inputType - protocol for the ingress
* @param opts - CreateIngressOptions
*/

@@ -67,4 +64,4 @@ async createIngress(inputType, opts) {

/**
* @param ingressId ID of the ingress to update
* @param opts UpdateIngressOptions
* @param ingressId - ID of the ingress to update
* @param opts - UpdateIngressOptions
*/

@@ -93,2 +90,5 @@ async updateIngress(ingressId, opts) {

}
/**
* @param arg - list room name or options
*/
async listIngress(arg) {

@@ -107,3 +107,3 @@ var _a;

/**
* @param ingressId ingress to delete
* @param ingressId - ingress to delete
*/

@@ -110,0 +110,0 @@ async deleteIngress(ingressId) {

@@ -85,3 +85,3 @@ import type { DataPacket_Kind, RoomEgress, TrackInfo } from '@livekit/protocol';

* used to customize room settings.
* @param options
* @param options -
*/

@@ -99,4 +99,4 @@ createRoom(options: CreateOptions): Promise<Room>;

* Update metadata of a room
* @param room name of the room
* @param metadata the new metadata for the room
* @param room - name of the room
* @param metadata - the new metadata for the room
*/

@@ -106,3 +106,3 @@ updateRoomMetadata(room: string, metadata: string): Promise<Room>;

* List participants in a room
* @param room name of the room
* @param room - name of the room
*/

@@ -113,4 +113,4 @@ listParticipants(room: string): Promise<ParticipantInfo[]>;

* has published
* @param room name of the room
* @param identity identity of the participant to return
* @param room - name of the room
* @param identity - identity of the participant to return
*/

@@ -122,4 +122,4 @@ getParticipant(room: string, identity: string): Promise<ParticipantInfo>;

* Even after being removed, the participant can still re-join the room.
* @param room
* @param identity
* @param room -
* @param identity -
*/

@@ -129,6 +129,6 @@ removeParticipant(room: string, identity: string): Promise<void>;

* Mutes a track that the participant has published.
* @param room
* @param identity
* @param trackSid sid of the track to be muted
* @param muted true to mute, false to unmute
* @param room -
* @param identity -
* @param trackSid - sid of the track to be muted
* @param muted - true to mute, false to unmute
*/

@@ -152,6 +152,6 @@ mutePublishedTrack(room: string, identity: string, trackSid: string, muted: boolean): Promise<TrackInfo>;

* Updates a participant's subscription to tracks
* @param room
* @param identity
* @param trackSids
* @param subscribe true to subscribe, false to unsubscribe
* @param room -
* @param identity -
* @param trackSids -
* @param subscribe - true to subscribe, false to unsubscribe
*/

@@ -161,6 +161,6 @@ updateSubscriptions(room: string, identity: string, trackSids: string[], subscribe: boolean): Promise<void>;

* Sends data message to participants in the room
* @param room
* @param data opaque payload to send
* @param kind delivery reliability
* @param options optionally specify a topic and destinationSids (when destinationSids is empty, message is sent to everyone)
* @param room -
* @param data - opaque payload to send
* @param kind - delivery reliability
* @param options - optionally specify a topic and destinationSids (when destinationSids is empty, message is sent to everyone)
*/

@@ -171,6 +171,6 @@ sendData(room: string, data: Uint8Array, kind: DataPacket_Kind, options: SendDataOptions): Promise<void>;

* @deprecated use sendData(room, data, kind, options) instead
* @param room
* @param data opaque payload to send
* @param kind delivery reliability
* @param destinationSids optional. when empty, message is sent to everyone
* @param room -
* @param data - opaque payload to send
* @param kind - delivery reliability
* @param destinationSids - optional. when empty, message is sent to everyone
*/

@@ -177,0 +177,0 @@ sendData(room: string, data: Uint8Array, kind: DataPacket_Kind, destinationSids?: string[]): Promise<void>;

@@ -23,3 +23,3 @@ import { CreateRoomRequest, DeleteRoomRequest, ListParticipantsRequest, ListParticipantsResponse, ListRoomsRequest, ListRoomsResponse, MuteRoomTrackRequest, MuteRoomTrackResponse, ParticipantInfo, ParticipantPermission, Room, RoomParticipantIdentity, SendDataRequest, UpdateParticipantRequest, UpdateRoomMetadataRequest, UpdateSubscriptionsRequest, } from '@livekit/protocol';

* used to customize room settings.
* @param options
* @param options -
*/

@@ -47,4 +47,4 @@ async createRoom(options) {

* Update metadata of a room
* @param room name of the room
* @param metadata the new metadata for the room
* @param room - name of the room
* @param metadata - the new metadata for the room
*/

@@ -57,3 +57,3 @@ async updateRoomMetadata(room, metadata) {

* List participants in a room
* @param room name of the room
* @param room - name of the room
*/

@@ -69,4 +69,4 @@ async listParticipants(room) {

* has published
* @param room name of the room
* @param identity identity of the participant to return
* @param room - name of the room
* @param identity - identity of the participant to return
*/

@@ -81,4 +81,4 @@ async getParticipant(room, identity) {

* Even after being removed, the participant can still re-join the room.
* @param room
* @param identity
* @param room -
* @param identity -
*/

@@ -90,6 +90,6 @@ async removeParticipant(room, identity) {

* Mutes a track that the participant has published.
* @param room
* @param identity
* @param trackSid sid of the track to be muted
* @param muted true to mute, false to unmute
* @param room -
* @param identity -
* @param trackSid - sid of the track to be muted
* @param muted - true to mute, false to unmute
*/

@@ -130,6 +130,6 @@ async mutePublishedTrack(room, identity, trackSid, muted) {

* Updates a participant's subscription to tracks
* @param room
* @param identity
* @param trackSids
* @param subscribe true to subscribe, false to unsubscribe
* @param room -
* @param identity -
* @param trackSids -
* @param subscribe - true to subscribe, false to unsubscribe
*/

@@ -136,0 +136,0 @@ async updateSubscriptions(room, identity, trackSids, subscribe) {

@@ -1,2 +0,2 @@

import { SIPGrant, VideoGrant } from './grants.js';
import type { SIPGrant, VideoGrant } from './grants.js';
/**

@@ -10,9 +10,9 @@ * Utilities to handle authentication

/**
* @param apiKey API Key.
* @param secret API Secret.
* @param ttl token TTL
* @param apiKey - API Key.
* @param secret - API Secret.
* @param ttl - token TTL
*/
constructor(apiKey?: string, secret?: string, ttl?: string);
authHeader(grant: VideoGrant, sip?: SIPGrant): Promise<any>;
authHeader(grant: VideoGrant, sip?: SIPGrant): Promise<Record<string, string>>;
}
//# sourceMappingURL=ServiceBase.d.ts.map

@@ -10,5 +10,5 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

/**
* @param apiKey API Key.
* @param secret API Secret.
* @param ttl token TTL
* @param apiKey - API Key.
* @param secret - API Secret.
* @param ttl - token TTL
*/

@@ -15,0 +15,0 @@ constructor(apiKey, secret, ttl) {

@@ -60,28 +60,28 @@ import { SIPDispatchRuleInfo, SIPInboundTrunkInfo, SIPOutboundTrunkInfo, SIPParticipantInfo, SIPTransport, SIPTrunkInfo } from '@livekit/protocol';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/
constructor(host: string, apiKey?: string, secret?: string);
/**
* @param number phone number of the trunk
* @param opts CreateSipTrunkOptions
* @deprecated use createSipInboundTrunk or createSipOutboundTrunk
* @param number - phone number of the trunk
* @param opts - CreateSipTrunkOptions
* @deprecated use `createSipInboundTrunk` or `createSipOutboundTrunk`
*/
createSipTrunk(number: string, opts?: CreateSipTrunkOptions): Promise<SIPTrunkInfo>;
/**
@param name human-readable name of the trunk
* @param numbers phone numbers of the trunk
* @param opts CreateSipTrunkOptions
* @param name - human-readable name of the trunk
* @param numbers - phone numbers of the trunk
* @param opts - CreateSipTrunkOptions
*/
createSipInboundTrunk(name: string, numbers: string[], opts?: CreateSipInboundTrunkOptions): Promise<SIPInboundTrunkInfo>;
/**
* @param name human-readable name of the trunk
* @param address hostname and port of the SIP server to dial
* @param numbers phone numbers of the trunk
* @param opts CreateSipTrunkOptions
* @param name - human-readable name of the trunk
* @param address - hostname and port of the SIP server to dial
* @param numbers - phone numbers of the trunk
* @param opts - CreateSipTrunkOptions
*/
createSipOutboundTrunk(name: string, address: string, numbers: string[], opts?: CreateSipOutboundTrunkOptions): Promise<SIPOutboundTrunkInfo>;
/**
* @deprecated use listSipInboundTrunk or listSipOutboundTrunk
* @deprecated use `listSipInboundTrunk` or `listSipOutboundTrunk`
*/

@@ -92,8 +92,8 @@ listSipTrunk(): Promise<Array<SIPTrunkInfo>>;

/**
* @param sipTrunkId sip trunk to delete
* @param sipTrunkId - sip trunk to delete
*/
deleteSipTrunk(sipTrunkId: string): Promise<SIPTrunkInfo>;
/**
* @param rule sip dispatch rule
* @param opts CreateSipDispatchRuleOptions
* @param rule - sip dispatch rule
* @param opts - CreateSipDispatchRuleOptions
*/

@@ -103,13 +103,19 @@ createSipDispatchRule(rule: SipDispatchRuleDirect | SipDispatchRuleIndividual, opts?: CreateSipDispatchRuleOptions): Promise<SIPDispatchRuleInfo>;

/**
* @param sipDispatchRuleId sip trunk to delete
* @param sipDispatchRuleId - sip trunk to delete
*/
deleteSipDispatchRule(sipDispatchRuleId: string): Promise<SIPDispatchRuleInfo>;
/**
* @param sipTrunkId sip trunk to use for the call
* @param number number to dial
* @param roomName room to attach the call to
* @param opts CreateSipParticipantOptions
* @param sipTrunkId - sip trunk to use for the call
* @param number - number to dial
* @param roomName - room to attach the call to
* @param opts - CreateSipParticipantOptions
*/
createSipParticipant(sipTrunkId: string, number: string, roomName: string, opts?: CreateSipParticipantOptions): Promise<SIPParticipantInfo>;
/**
* @param roomName - room the SIP participant to transfer is connectd to
* @param participantIdentity - identity of the SIP participant to transfer
* @param transferTo - SIP URL to transfer the participant to
*/
transferSipParticipant(roomName: string, participantIdentity: string, transferTo: string): Promise<void>;
}
//# sourceMappingURL=SipClient.d.ts.map
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import { CreateSIPDispatchRuleRequest, CreateSIPInboundTrunkRequest, CreateSIPOutboundTrunkRequest, CreateSIPParticipantRequest, CreateSIPTrunkRequest, DeleteSIPDispatchRuleRequest, DeleteSIPTrunkRequest, ListSIPDispatchRuleRequest, ListSIPDispatchRuleResponse, ListSIPInboundTrunkRequest, ListSIPInboundTrunkResponse, ListSIPOutboundTrunkRequest, ListSIPOutboundTrunkResponse, ListSIPTrunkRequest, ListSIPTrunkResponse, SIPDispatchRule, SIPDispatchRuleDirect, SIPDispatchRuleIndividual, SIPDispatchRuleInfo, SIPInboundTrunkInfo, SIPOutboundTrunkInfo, SIPParticipantInfo, SIPTransport, SIPTrunkInfo, } from '@livekit/protocol';
import { CreateSIPDispatchRuleRequest, CreateSIPInboundTrunkRequest, CreateSIPOutboundTrunkRequest, CreateSIPParticipantRequest, CreateSIPTrunkRequest, DeleteSIPDispatchRuleRequest, DeleteSIPTrunkRequest, ListSIPDispatchRuleRequest, ListSIPDispatchRuleResponse, ListSIPInboundTrunkRequest, ListSIPInboundTrunkResponse, ListSIPOutboundTrunkRequest, ListSIPOutboundTrunkResponse, ListSIPTrunkRequest, ListSIPTrunkResponse, SIPDispatchRule, SIPDispatchRuleDirect, SIPDispatchRuleIndividual, SIPDispatchRuleInfo, SIPInboundTrunkInfo, SIPOutboundTrunkInfo, SIPParticipantInfo, SIPTransport, SIPTrunkInfo, TransferSIPParticipantRequest, } from '@livekit/protocol';
import ServiceBase from './ServiceBase.js';

@@ -13,5 +13,5 @@ import { TwirpRpc, livekitPackage } from './TwirpRPC.js';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/

@@ -23,5 +23,5 @@ constructor(host, apiKey, secret) {

/**
* @param number phone number of the trunk
* @param opts CreateSipTrunkOptions
* @deprecated use createSipInboundTrunk or createSipOutboundTrunk
* @param number - phone number of the trunk
* @param opts - CreateSipTrunkOptions
* @deprecated use `createSipInboundTrunk` or `createSipOutboundTrunk`
*/

@@ -65,5 +65,5 @@ async createSipTrunk(number, opts) {

/**
@param name human-readable name of the trunk
* @param numbers phone numbers of the trunk
* @param opts CreateSipTrunkOptions
* @param name - human-readable name of the trunk
* @param numbers - phone numbers of the trunk
* @param opts - CreateSipTrunkOptions
*/

@@ -98,6 +98,6 @@ async createSipInboundTrunk(name, numbers, opts) {

/**
* @param name human-readable name of the trunk
* @param address hostname and port of the SIP server to dial
* @param numbers phone numbers of the trunk
* @param opts CreateSipTrunkOptions
* @param name - human-readable name of the trunk
* @param address - hostname and port of the SIP server to dial
* @param numbers - phone numbers of the trunk
* @param opts - CreateSipTrunkOptions
*/

@@ -130,3 +130,3 @@ async createSipOutboundTrunk(name, address, numbers, opts) {

/**
* @deprecated use listSipInboundTrunk or listSipOutboundTrunk
* @deprecated use `listSipInboundTrunk` or `listSipOutboundTrunk`
*/

@@ -152,3 +152,3 @@ async listSipTrunk() {

/**
* @param sipTrunkId sip trunk to delete
* @param sipTrunkId - sip trunk to delete
*/

@@ -160,4 +160,4 @@ async deleteSipTrunk(sipTrunkId) {

/**
* @param rule sip dispatch rule
* @param opts CreateSipDispatchRuleOptions
* @param rule - sip dispatch rule
* @param opts - CreateSipDispatchRuleOptions
*/

@@ -215,3 +215,3 @@ async createSipDispatchRule(rule, opts) {

/**
* @param sipDispatchRuleId sip trunk to delete
* @param sipDispatchRuleId - sip trunk to delete
*/

@@ -223,6 +223,6 @@ async deleteSipDispatchRule(sipDispatchRuleId) {

/**
* @param sipTrunkId sip trunk to use for the call
* @param number number to dial
* @param roomName room to attach the call to
* @param opts CreateSipParticipantOptions
* @param sipTrunkId - sip trunk to use for the call
* @param number - number to dial
* @param roomName - room to attach the call to
* @param opts - CreateSipParticipantOptions
*/

@@ -258,3 +258,16 @@ async createSipParticipant(sipTrunkId, number, roomName, opts) {

}
/**
* @param roomName - room the SIP participant to transfer is connectd to
* @param participantIdentity - identity of the SIP participant to transfer
* @param transferTo - SIP URL to transfer the participant to
*/
async transferSipParticipant(roomName, participantIdentity, transferTo) {
const req = new TransferSIPParticipantRequest({
participantIdentity: participantIdentity,
roomName: roomName,
transferTo: transferTo,
}).toJson();
await this.rpc.request(svc, 'TransferSIPParticipant', req, await this.authHeader({ roomAdmin: true, room: roomName }, { call: true }));
}
}
//# sourceMappingURL=SipClient.js.map

@@ -17,2 +17,3 @@ import camelcaseKeys from 'camelcase-keys';

}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async request(service, method, data, headers) {

@@ -19,0 +20,0 @@ const path = `${this.prefix}/${this.pkg}.${service}/${method}`;

@@ -13,3 +13,3 @@ import type { BinaryReadOptions, JsonReadOptions, JsonValue } from '@bufbuild/protobuf';

* @internal
* @note only used as a default value, not a valid webhook event
* @remarks only used as a default value, not a valid webhook event
*/

@@ -21,6 +21,5 @@ | '';

/**
*
* @param body string of the posted body
* @param authHeader `Authorization` header from the request
* @param skipAuth true to skip auth validation
* @param body - string of the posted body
* @param authHeader - `Authorization` header from the request
* @param skipAuth - true to skip auth validation
* @returns

@@ -27,0 +26,0 @@ */

@@ -24,6 +24,5 @@ import { WebhookEvent as ProtoWebhookEvent } from '@livekit/protocol';

/**
*
* @param body string of the posted body
* @param authHeader `Authorization` header from the request
* @param skipAuth true to skip auth validation
* @param body - string of the posted body
* @param authHeader - `Authorization` header from the request
* @param skipAuth - true to skip auth validation
* @returns

@@ -30,0 +29,0 @@ */

{
"name": "livekit-server-sdk",
"version": "2.6.2",
"version": "2.7.0",
"description": "Server-side SDK for LiveKit",

@@ -16,3 +16,3 @@ "main": "dist/index.js",

"dependencies": {
"@livekit/protocol": "^1.20.0",
"@livekit/protocol": "^1.23.0",
"camelcase-keys": "^9.0.0",

@@ -19,0 +19,0 @@ "jose": "^5.1.2"

@@ -48,4 +48,4 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

* Creates a new AccessToken
* @param apiKey API Key, can be set in env LIVEKIT_API_KEY
* @param apiSecret Secret, can be set in env LIVEKIT_API_SECRET
* @param apiKey - API Key, can be set in env LIVEKIT_API_KEY
* @param apiSecret - Secret, can be set in env LIVEKIT_API_SECRET
*/

@@ -52,0 +52,0 @@ constructor(apiKey?: string, apiSecret?: string, options?: AccessTokenOptions) {

@@ -124,5 +124,5 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/

@@ -135,5 +135,5 @@ constructor(host: string, apiKey?: string, secret?: string) {

/**
* @param roomName room name
* @param output file or stream output
* @param opts RoomCompositeOptions
* @param roomName - room name
* @param output - file or stream output
* @param opts - RoomCompositeOptions
*/

@@ -218,5 +218,5 @@ async startRoomCompositeEgress(

/**
* @param url url
* @param output file or stream output
* @param opts WebOptions
* @param url - url
* @param output - file or stream output
* @param opts - WebOptions
*/

@@ -265,5 +265,5 @@ async startWebEgress(

*
* @param roomName room name
* @param output one or more outputs
* @param opts ParticipantEgressOptions
* @param roomName - room name
* @param output - one or more outputs
* @param opts - ParticipantEgressOptions
*/

@@ -298,5 +298,5 @@ async startParticipantEgress(

/**
* @param roomName room name
* @param output file or stream output
* @param opts TrackCompositeOptions
* @param roomName - room name
* @param output - file or stream output
* @param opts - TrackCompositeOptions
*/

@@ -369,2 +369,3 @@ async startTrackCompositeEgress(

// eslint-disable-next-line @typescript-eslint/no-explicit-any
private isEncodedOutputs(output: any): output is EncodedOutputs {

@@ -378,2 +379,3 @@ return (

// eslint-disable-next-line @typescript-eslint/no-explicit-any
private isEncodedFileOutput(output: any): output is EncodedFileOutput {

@@ -386,2 +388,3 @@ return (

// eslint-disable-next-line @typescript-eslint/no-explicit-any
private isSegmentedFileOutput(output: any): output is SegmentedFileOutput {

@@ -395,2 +398,3 @@ return (

// eslint-disable-next-line @typescript-eslint/no-explicit-any
private isStreamOutput(output: any): output is StreamOutput {

@@ -504,5 +508,5 @@ return (

/**
* @param roomName room name
* @param output file or websocket output
* @param trackId track Id
* @param roomName - room name
* @param output - file or websocket output
* @param trackId - track Id
*/

@@ -553,4 +557,4 @@ async startTrackEgress(

/**
* @param egressId
* @param layout
* @param egressId -
* @param layout -
*/

@@ -568,5 +572,5 @@ async updateLayout(egressId: string, layout: string): Promise<EgressInfo> {

/**
* @param egressId
* @param addOutputUrls
* @param removeOutputUrls
* @param egressId -
* @param addOutputUrls -
* @param removeOutputUrls -
*/

@@ -591,3 +595,3 @@ async updateStream(

/**
* @param options options to filter listed Egresses, by default returns all
* @param options - options to filter listed Egresses, by default returns all
* Egress instances

@@ -597,8 +601,8 @@ */

/**
* @deprecated
* @param roomName list egress for one room only
* @deprecated use `listEgress(options?: ListEgressOptions)` instead
* @param roomName - list egress for one room only
*/
async listEgress(roomName?: string): Promise<Array<EgressInfo>>;
/**
* @param roomName list egress for one room only
* @param roomName - list egress for one room only
*/

@@ -623,3 +627,3 @@ async listEgress(options?: string | ListEgressOptions): Promise<Array<EgressInfo>> {

/**
* @param egressId
* @param egressId -
*/

@@ -626,0 +630,0 @@ async stopEgress(egressId: string): Promise<EgressInfo> {

@@ -6,3 +6,4 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

import { describe, expect, it } from 'vitest';
import { ClaimGrants, VideoGrant, claimsToJwtPayload } from './grants';
import type { ClaimGrants, VideoGrant } from './grants';
import { claimsToJwtPayload } from './grants';

@@ -9,0 +10,0 @@ describe('ClaimGrants are parsed correctly', () => {

@@ -25,2 +25,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

): JWTPayload & { video?: Record<string, unknown> } {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const claim: Record<string, any> = { ...grant };

@@ -27,0 +28,0 @@ // eslint-disable-next-line no-restricted-syntax

// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import type { IngressAudioOptions, IngressInput, IngressVideoOptions } from '@livekit/protocol';
import {
CreateIngressRequest,
DeleteIngressRequest,
IngressAudioOptions,
IngressInfo,
IngressInput,
IngressVideoOptions,
ListIngressRequest,

@@ -16,3 +14,4 @@ ListIngressResponse,

import ServiceBase from './ServiceBase.js';
import { Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js';
import type { Rpc } from './TwirpRPC.js';
import { TwirpRpc, livekitPackage } from './TwirpRPC.js';

@@ -126,5 +125,5 @@ const svc = 'Ingress';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/

@@ -137,4 +136,4 @@ constructor(host: string, apiKey?: string, secret?: string) {

/**
* @param inputType protocol for the ingress
* @param opts CreateIngressOptions
* @param inputType - protocol for the ingress
* @param opts - CreateIngressOptions
*/

@@ -190,4 +189,4 @@ async createIngress(inputType: IngressInput, opts?: CreateIngressOptions): Promise<IngressInfo> {

/**
* @param ingressId ID of the ingress to update
* @param opts UpdateIngressOptions
* @param ingressId - ID of the ingress to update
* @param opts - UpdateIngressOptions
*/

@@ -225,10 +224,13 @@ async updateIngress(ingressId: string, opts: UpdateIngressOptions): Promise<IngressInfo> {

/**
* @deprecated use listIngress(opts) instead
* @param roomName list ingress for one room only
* @deprecated use `listIngress(opts)` or `listIngress(arg)` instead
* @param roomName - list ingress for one room only
*/
async listIngress(roomName?: string): Promise<Array<IngressInfo>>;
/**
* @param opts list options
* @param opts - list options
*/
async listIngress(opts?: ListIngressOptions): Promise<Array<IngressInfo>>;
/**
* @param arg - list room name or options
*/
async listIngress(arg?: string | ListIngressOptions): Promise<Array<IngressInfo>> {

@@ -251,3 +253,3 @@ let req: Partial<ListIngressRequest> = {};

/**
* @param ingressId ingress to delete
* @param ingressId - ingress to delete
*/

@@ -254,0 +256,0 @@ async deleteIngress(ingressId: string): Promise<IngressInfo> {

@@ -125,3 +125,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

* used to customize room settings.
* @param options
* @param options -
*/

@@ -166,4 +166,4 @@ async createRoom(options: CreateOptions): Promise<Room> {

* Update metadata of a room
* @param room name of the room
* @param metadata the new metadata for the room
* @param room - name of the room
* @param metadata - the new metadata for the room
*/

@@ -182,3 +182,3 @@ async updateRoomMetadata(room: string, metadata: string) {

* List participants in a room
* @param room name of the room
* @param room - name of the room
*/

@@ -199,4 +199,4 @@ async listParticipants(room: string): Promise<ParticipantInfo[]> {

* has published
* @param room name of the room
* @param identity identity of the participant to return
* @param room - name of the room
* @param identity - identity of the participant to return
*/

@@ -218,4 +218,4 @@ async getParticipant(room: string, identity: string): Promise<ParticipantInfo> {

* Even after being removed, the participant can still re-join the room.
* @param room
* @param identity
* @param room -
* @param identity -
*/

@@ -233,6 +233,6 @@ async removeParticipant(room: string, identity: string): Promise<void> {

* Mutes a track that the participant has published.
* @param room
* @param identity
* @param trackSid sid of the track to be muted
* @param muted true to mute, false to unmute
* @param room -
* @param identity -
* @param trackSid - sid of the track to be muted
* @param muted - true to mute, false to unmute
*/

@@ -321,6 +321,6 @@ async mutePublishedTrack(

* Updates a participant's subscription to tracks
* @param room
* @param identity
* @param trackSids
* @param subscribe true to subscribe, false to unsubscribe
* @param room -
* @param identity -
* @param trackSids -
* @param subscribe - true to subscribe, false to unsubscribe
*/

@@ -350,6 +350,6 @@ async updateSubscriptions(

* Sends data message to participants in the room
* @param room
* @param data opaque payload to send
* @param kind delivery reliability
* @param options optionally specify a topic and destinationSids (when destinationSids is empty, message is sent to everyone)
* @param room -
* @param data - opaque payload to send
* @param kind - delivery reliability
* @param options - optionally specify a topic and destinationSids (when destinationSids is empty, message is sent to everyone)
*/

@@ -365,6 +365,6 @@ async sendData(

* @deprecated use sendData(room, data, kind, options) instead
* @param room
* @param data opaque payload to send
* @param kind delivery reliability
* @param destinationSids optional. when empty, message is sent to everyone
* @param room -
* @param data - opaque payload to send
* @param kind - delivery reliability
* @param destinationSids - optional. when empty, message is sent to everyone
*/

@@ -371,0 +371,0 @@ async sendData(

@@ -5,3 +5,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

import { AccessToken } from './AccessToken.js';
import { SIPGrant, VideoGrant } from './grants.js';
import type { SIPGrant, VideoGrant } from './grants.js';

@@ -19,5 +19,5 @@ /**

/**
* @param apiKey API Key.
* @param secret API Secret.
* @param ttl token TTL
* @param apiKey - API Key.
* @param secret - API Secret.
* @param ttl - token TTL
*/

@@ -30,3 +30,3 @@ constructor(apiKey?: string, secret?: string, ttl?: string) {

async authHeader(grant: VideoGrant, sip?: SIPGrant): Promise<any> {
async authHeader(grant: VideoGrant, sip?: SIPGrant): Promise<Record<string, string>> {
const at = new AccessToken(this.apiKey, this.secret, { ttl: this.ttl });

@@ -33,0 +33,0 @@ at.addGrant(grant);

@@ -29,5 +29,7 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

SIPTrunkInfo,
TransferSIPParticipantRequest,
} from '@livekit/protocol';
import ServiceBase from './ServiceBase.js';
import { Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js';
import type { Rpc } from './TwirpRPC.js';
import { TwirpRpc, livekitPackage } from './TwirpRPC.js';

@@ -99,5 +101,5 @@ const svc = 'SIP';

/**
* @param host hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey API Key, can be set in env var LIVEKIT_API_KEY
* @param secret API Secret, can be set in env var LIVEKIT_API_SECRET
* @param host - hostname including protocol. i.e. 'https://cluster.livekit.io'
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
*/

@@ -110,5 +112,5 @@ constructor(host: string, apiKey?: string, secret?: string) {

/**
* @param number phone number of the trunk
* @param opts CreateSipTrunkOptions
* @deprecated use createSipInboundTrunk or createSipOutboundTrunk
* @param number - phone number of the trunk
* @param opts - CreateSipTrunkOptions
* @deprecated use `createSipInboundTrunk` or `createSipOutboundTrunk`
*/

@@ -161,5 +163,5 @@ async createSipTrunk(number: string, opts?: CreateSipTrunkOptions): Promise<SIPTrunkInfo> {

/**
@param name human-readable name of the trunk
* @param numbers phone numbers of the trunk
* @param opts CreateSipTrunkOptions
* @param name - human-readable name of the trunk
* @param numbers - phone numbers of the trunk
* @param opts - CreateSipTrunkOptions
*/

@@ -207,6 +209,6 @@ async createSipInboundTrunk(

/**
* @param name human-readable name of the trunk
* @param address hostname and port of the SIP server to dial
* @param numbers phone numbers of the trunk
* @param opts CreateSipTrunkOptions
* @param name - human-readable name of the trunk
* @param address - hostname and port of the SIP server to dial
* @param numbers - phone numbers of the trunk
* @param opts - CreateSipTrunkOptions
*/

@@ -253,3 +255,3 @@ async createSipOutboundTrunk(

/**
* @deprecated use listSipInboundTrunk or listSipOutboundTrunk
* @deprecated use `listSipInboundTrunk` or `listSipOutboundTrunk`
*/

@@ -290,3 +292,3 @@ async listSipTrunk(): Promise<Array<SIPTrunkInfo>> {

/**
* @param sipTrunkId sip trunk to delete
* @param sipTrunkId - sip trunk to delete
*/

@@ -304,4 +306,4 @@ async deleteSipTrunk(sipTrunkId: string): Promise<SIPTrunkInfo> {

/**
* @param rule sip dispatch rule
* @param opts CreateSipDispatchRuleOptions
* @param rule - sip dispatch rule
* @param opts - CreateSipDispatchRuleOptions
*/

@@ -375,3 +377,3 @@ async createSipDispatchRule(

/**
* @param sipDispatchRuleId sip trunk to delete
* @param sipDispatchRuleId - sip trunk to delete
*/

@@ -389,6 +391,6 @@ async deleteSipDispatchRule(sipDispatchRuleId: string): Promise<SIPDispatchRuleInfo> {

/**
* @param sipTrunkId sip trunk to use for the call
* @param number number to dial
* @param roomName room to attach the call to
* @param opts CreateSipParticipantOptions
* @param sipTrunkId - sip trunk to use for the call
* @param number - number to dial
* @param roomName - room to attach the call to
* @param opts - CreateSipParticipantOptions
*/

@@ -437,2 +439,26 @@ async createSipParticipant(

}
/**
* @param roomName - room the SIP participant to transfer is connectd to
* @param participantIdentity - identity of the SIP participant to transfer
* @param transferTo - SIP URL to transfer the participant to
*/
async transferSipParticipant(
roomName: string,
participantIdentity: string,
transferTo: string,
): Promise<void> {
const req = new TransferSIPParticipantRequest({
participantIdentity: participantIdentity,
roomName: roomName,
transferTo: transferTo,
}).toJson();
await this.rpc.request(
svc,
'TransferSIPParticipant',
req,
await this.authHeader({ roomAdmin: true, room: roomName }, { call: true }),
);
}
}

@@ -13,2 +13,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

export interface Rpc {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
request(service: string, method: string, data: JsonValue, headers?: any): Promise<string>;

@@ -36,2 +37,3 @@ }

// eslint-disable-next-line @typescript-eslint/no-explicit-any
async request(service: string, method: string, data: any, headers?: any): Promise<any> {

@@ -38,0 +40,0 @@ const path = `${this.prefix}/${this.pkg}.${service}/${method}`;

@@ -40,3 +40,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc.

* @internal
* @note only used as a default value, not a valid webhook event
* @remarks only used as a default value, not a valid webhook event
*/

@@ -53,6 +53,5 @@ | '';

/**
*
* @param body string of the posted body
* @param authHeader `Authorization` header from the request
* @param skipAuth true to skip auth validation
* @param body - string of the posted body
* @param authHeader - `Authorization` header from the request
* @param skipAuth - true to skip auth validation
* @returns

@@ -59,0 +58,0 @@ */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc