livekit-server-sdk 2.15.2 → 2.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentDispatchClient.cjs +2 -1
- package/dist/AgentDispatchClient.cjs.map +1 -1
- package/dist/AgentDispatchClient.d.cts +2 -1
- package/dist/AgentDispatchClient.d.ts +2 -1
- package/dist/AgentDispatchClient.d.ts.map +1 -1
- package/dist/AgentDispatchClient.js +2 -1
- package/dist/AgentDispatchClient.js.map +1 -1
- package/dist/ConnectorClient.cjs +12 -5
- package/dist/ConnectorClient.cjs.map +1 -1
- package/dist/ConnectorClient.d.cts +11 -3
- package/dist/ConnectorClient.d.ts +11 -3
- package/dist/ConnectorClient.d.ts.map +1 -1
- package/dist/ConnectorClient.js +12 -5
- package/dist/ConnectorClient.js.map +1 -1
- package/dist/SipClient.cjs.map +1 -1
- package/dist/SipClient.d.ts.map +1 -1
- package/dist/SipClient.js +0 -2
- package/dist/SipClient.js.map +1 -1
- package/dist/grants.cjs.map +1 -1
- package/dist/grants.d.cts +2 -0
- package/dist/grants.d.ts +2 -0
- package/dist/grants.d.ts.map +1 -1
- package/dist/grants.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/AgentDispatchClient.ts +4 -0
- package/src/ConnectorClient.ts +20 -1
- package/src/SipClient.ts +2 -2
- package/src/grants.ts +3 -0
- package/src/index.ts +2 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n AcceptWhatsAppCallResponse,\n AliOSSUpload,\n AgentDispatch,\n AudioCodec,\n AutoParticipantEgress,\n AutoTrackEgress,\n AzureBlobUpload,\n ConnectTwilioCallRequest_TwilioCallDirection,\n ConnectTwilioCallResponse,\n ConnectWhatsAppCallResponse,\n DataPacket_Kind,\n DialWhatsAppCallResponse,\n DirectFileOutput,\n DisconnectWhatsAppCallResponse,\n EgressInfo,\n EgressStatus,\n EncodedFileOutput,\n EncodedFileType,\n EncodingOptions,\n EncodingOptionsPreset,\n GCPUpload,\n ImageCodec,\n ImageFileSuffix,\n ImageOutput,\n IngressAudioEncodingOptions,\n IngressAudioEncodingPreset,\n IngressAudioOptions,\n IngressInfo,\n IngressInput,\n IngressState,\n IngressVideoEncodingOptions,\n IngressVideoEncodingPreset,\n IngressVideoOptions,\n ParticipantEgressRequest,\n ParticipantInfo,\n ParticipantInfo_State,\n ParticipantPermission,\n Room,\n RoomAgentDispatch,\n RoomCompositeEgressRequest,\n RoomConfiguration,\n RoomEgress,\n S3Upload,\n SessionDescription,\n SIPDispatchRule,\n SIPDispatchRuleInfo,\n SIPDispatchRuleDirect,\n SIPDispatchRuleIndividual,\n SIPParticipantInfo,\n SIPOutboundTrunkInfo,\n SIPInboundTrunkInfo,\n SIPTrunkInfo,\n SIPCallStatus,\n SegmentedFileOutput,\n SegmentedFileProtocol,\n StreamOutput,\n StreamProtocol,\n TrackCompositeEgressRequest,\n TrackEgressRequest,\n TrackInfo,\n TrackSource,\n TrackType,\n WebEgressRequest,\n VideoCodec,\n WebhookConfig,\n} from '@livekit/protocol';\nexport * from './AccessToken.js';\nexport * from './AgentDispatchClient.js';\nexport * from './ConnectorClient.js';\nexport * from './EgressClient.js';\nexport * from './grants.js';\nexport * from './IngressClient.js';\nexport * from './RoomServiceClient.js';\nexport * from './SipClient.js';\nexport { TwirpError } from './TwirpRPC.js';\nexport * from './WebhookReceiver.js';\n"],"mappings":"AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,kBAAkB;AAC3B,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n AcceptWhatsAppCallResponse,\n AliOSSUpload,\n AgentDispatch,\n AudioCodec,\n AutoParticipantEgress,\n AutoTrackEgress,\n AzureBlobUpload,\n ConnectTwilioCallRequest_TwilioCallDirection,\n ConnectTwilioCallResponse,\n ConnectWhatsAppCallResponse,\n DataPacket_Kind,\n DialWhatsAppCallResponse,\n DirectFileOutput,\n DisconnectWhatsAppCallRequest_DisconnectReason,\n DisconnectWhatsAppCallResponse,\n EgressInfo,\n EgressStatus,\n EncodedFileOutput,\n EncodedFileType,\n EncodingOptions,\n EncodingOptionsPreset,\n GCPUpload,\n ImageCodec,\n ImageFileSuffix,\n ImageOutput,\n IngressAudioEncodingOptions,\n IngressAudioEncodingPreset,\n IngressAudioOptions,\n IngressInfo,\n IngressInput,\n IngressState,\n IngressVideoEncodingOptions,\n IngressVideoEncodingPreset,\n IngressVideoOptions,\n JobRestartPolicy,\n ParticipantEgressRequest,\n ParticipantInfo,\n ParticipantInfo_State,\n ParticipantPermission,\n Room,\n RoomAgentDispatch,\n RoomCompositeEgressRequest,\n RoomConfiguration,\n RoomEgress,\n S3Upload,\n SessionDescription,\n SIPDispatchRule,\n SIPDispatchRuleInfo,\n SIPDispatchRuleDirect,\n SIPDispatchRuleIndividual,\n SIPParticipantInfo,\n SIPOutboundTrunkInfo,\n SIPInboundTrunkInfo,\n SIPTrunkInfo,\n SIPCallStatus,\n SegmentedFileOutput,\n SegmentedFileProtocol,\n StreamOutput,\n StreamProtocol,\n TrackCompositeEgressRequest,\n TrackEgressRequest,\n TrackInfo,\n TrackSource,\n TrackType,\n WebEgressRequest,\n VideoCodec,\n WebhookConfig,\n} from '@livekit/protocol';\nexport * from './AccessToken.js';\nexport * from './AgentDispatchClient.js';\nexport * from './ConnectorClient.js';\nexport * from './EgressClient.js';\nexport * from './grants.js';\nexport * from './IngressClient.js';\nexport * from './RoomServiceClient.js';\nexport * from './SipClient.js';\nexport { TwirpError } from './TwirpRPC.js';\nexport * from './WebhookReceiver.js';\n"],"mappings":"AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,kBAAkB;AAC3B,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livekit-server-sdk",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.3",
|
|
4
4
|
"description": "Server-side SDK for LiveKit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"require": "dist/index.cjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@bufbuild/protobuf": "^1.10.1",
|
|
34
|
-
"@livekit/protocol": "^1.
|
|
34
|
+
"@livekit/protocol": "^1.45.6",
|
|
35
35
|
"camelcase-keys": "^9.0.0",
|
|
36
36
|
"jose": "^5.1.2"
|
|
37
37
|
},
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
AgentDispatch,
|
|
6
6
|
CreateAgentDispatchRequest,
|
|
7
7
|
DeleteAgentDispatchRequest,
|
|
8
|
+
type JobRestartPolicy,
|
|
8
9
|
ListAgentDispatchRequest,
|
|
9
10
|
ListAgentDispatchResponse,
|
|
10
11
|
} from '@livekit/protocol';
|
|
@@ -16,6 +17,8 @@ interface CreateDispatchOptions {
|
|
|
16
17
|
// any custom data to send along with the job.
|
|
17
18
|
// note: this is different from room and participant metadata
|
|
18
19
|
metadata?: string;
|
|
20
|
+
// controls whether the job should be restarted when it fails (cloud only)
|
|
21
|
+
restartPolicy?: JobRestartPolicy;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
const svc = 'AgentDispatchService';
|
|
@@ -57,6 +60,7 @@ export class AgentDispatchClient extends ServiceBase {
|
|
|
57
60
|
room: roomName,
|
|
58
61
|
agentName,
|
|
59
62
|
metadata: options?.metadata,
|
|
63
|
+
restartPolicy: options?.restartPolicy,
|
|
60
64
|
}).toJson();
|
|
61
65
|
const data = await this.rpc.request(
|
|
62
66
|
svc,
|
package/src/ConnectorClient.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: 2025 LiveKit, Inc.
|
|
2
2
|
//
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { Duration } from '@bufbuild/protobuf';
|
|
4
5
|
import type {
|
|
5
6
|
ConnectTwilioCallRequest_TwilioCallDirection,
|
|
7
|
+
DisconnectWhatsAppCallRequest_DisconnectReason,
|
|
6
8
|
RoomAgentDispatch,
|
|
7
9
|
SessionDescription,
|
|
8
10
|
} from '@livekit/protocol';
|
|
@@ -50,6 +52,8 @@ export interface DialWhatsAppCallOptions {
|
|
|
50
52
|
participantAttributes?: { [key: string]: string };
|
|
51
53
|
/** Optional - Country where the call terminates as ISO 3166-1 alpha-2 */
|
|
52
54
|
destinationCountry?: string;
|
|
55
|
+
/** Optional - Max time in seconds for the callee to answer the call */
|
|
56
|
+
ringingTimeout?: number;
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
export interface AcceptWhatsAppCallOptions {
|
|
@@ -79,6 +83,10 @@ export interface AcceptWhatsAppCallOptions {
|
|
|
79
83
|
participantAttributes?: { [key: string]: string };
|
|
80
84
|
/** Optional - Country where the call terminates as ISO 3166-1 alpha-2 */
|
|
81
85
|
destinationCountry?: string;
|
|
86
|
+
/** Optional - Max time in seconds for the callee to answer the call */
|
|
87
|
+
ringingTimeout?: number;
|
|
88
|
+
/** Optional - Wait for the call to be answered before returning */
|
|
89
|
+
waitUntilAnswered?: boolean;
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
// Twilio types
|
|
@@ -148,6 +156,9 @@ export class ConnectorClient extends ServiceBase {
|
|
|
148
156
|
participantMetadata,
|
|
149
157
|
participantAttributes: options.participantAttributes,
|
|
150
158
|
destinationCountry,
|
|
159
|
+
ringingTimeout: options.ringingTimeout
|
|
160
|
+
? new Duration({ seconds: BigInt(options.ringingTimeout) })
|
|
161
|
+
: undefined,
|
|
151
162
|
}).toJson();
|
|
152
163
|
|
|
153
164
|
const data = await this.rpc.request(
|
|
@@ -189,6 +200,10 @@ export class ConnectorClient extends ServiceBase {
|
|
|
189
200
|
participantMetadata,
|
|
190
201
|
participantAttributes: options.participantAttributes,
|
|
191
202
|
destinationCountry,
|
|
203
|
+
ringingTimeout: options.ringingTimeout
|
|
204
|
+
? new Duration({ seconds: BigInt(options.ringingTimeout) })
|
|
205
|
+
: undefined,
|
|
206
|
+
waitUntilAnswered: options.waitUntilAnswered,
|
|
192
207
|
}).toJson();
|
|
193
208
|
|
|
194
209
|
const data = await this.rpc.request(
|
|
@@ -228,15 +243,19 @@ export class ConnectorClient extends ServiceBase {
|
|
|
228
243
|
* Disconnect an active WhatsApp call
|
|
229
244
|
*
|
|
230
245
|
* @param whatsappCallId - Call ID sent by Meta
|
|
231
|
-
* @param whatsappApiKey - The API key of the business that is disconnecting the call
|
|
246
|
+
* @param whatsappApiKey - The API key of the business that is disconnecting the call.
|
|
247
|
+
* Required when `disconnectReason` is BUSINESS_INITIATED, optional for USER_INITIATED.
|
|
248
|
+
* @param disconnectReason - Optional reason for disconnecting the call. Defaults to BUSINESS_INITIATED.
|
|
232
249
|
*/
|
|
233
250
|
async disconnectWhatsAppCall(
|
|
234
251
|
whatsappCallId: string,
|
|
235
252
|
whatsappApiKey: string,
|
|
253
|
+
disconnectReason?: DisconnectWhatsAppCallRequest_DisconnectReason,
|
|
236
254
|
): Promise<DisconnectWhatsAppCallResponse> {
|
|
237
255
|
const req = new DisconnectWhatsAppCallRequest({
|
|
238
256
|
whatsappCallId,
|
|
239
257
|
whatsappApiKey,
|
|
258
|
+
disconnectReason,
|
|
240
259
|
}).toJson();
|
|
241
260
|
|
|
242
261
|
const data = await this.rpc.request(
|
package/src/SipClient.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type {
|
|
|
7
7
|
Pagination,
|
|
8
8
|
RoomConfiguration,
|
|
9
9
|
SIPHeaderOptions,
|
|
10
|
+
SIPMediaEncryption,
|
|
11
|
+
SIPOutboundConfig,
|
|
10
12
|
} from '@livekit/protocol';
|
|
11
13
|
import {
|
|
12
14
|
CreateSIPDispatchRuleRequest,
|
|
@@ -29,8 +31,6 @@ import {
|
|
|
29
31
|
SIPDispatchRuleIndividual,
|
|
30
32
|
SIPDispatchRuleInfo,
|
|
31
33
|
SIPInboundTrunkInfo,
|
|
32
|
-
SIPMediaEncryption,
|
|
33
|
-
SIPOutboundConfig,
|
|
34
34
|
SIPOutboundTrunkInfo,
|
|
35
35
|
SIPParticipantInfo,
|
|
36
36
|
SIPTransport,
|
package/src/grants.ts
CHANGED
|
@@ -91,6 +91,9 @@ export interface VideoGrant {
|
|
|
91
91
|
/** allow participant to subscribe to metrics */
|
|
92
92
|
canSubscribeMetrics?: boolean;
|
|
93
93
|
|
|
94
|
+
/** allow participant to manage an agent session via RemoteSession */
|
|
95
|
+
canManageAgentSession?: boolean;
|
|
96
|
+
|
|
94
97
|
/** destination room which this participant can forward to */
|
|
95
98
|
destinationRoom?: string;
|
|
96
99
|
}
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export {
|
|
|
16
16
|
DataPacket_Kind,
|
|
17
17
|
DialWhatsAppCallResponse,
|
|
18
18
|
DirectFileOutput,
|
|
19
|
+
DisconnectWhatsAppCallRequest_DisconnectReason,
|
|
19
20
|
DisconnectWhatsAppCallResponse,
|
|
20
21
|
EgressInfo,
|
|
21
22
|
EgressStatus,
|
|
@@ -36,6 +37,7 @@ export {
|
|
|
36
37
|
IngressVideoEncodingOptions,
|
|
37
38
|
IngressVideoEncodingPreset,
|
|
38
39
|
IngressVideoOptions,
|
|
40
|
+
JobRestartPolicy,
|
|
39
41
|
ParticipantEgressRequest,
|
|
40
42
|
ParticipantInfo,
|
|
41
43
|
ParticipantInfo_State,
|