livekit-server-sdk 2.14.1 → 2.15.0
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/ConnectorClient.cjs +183 -0
- package/dist/ConnectorClient.cjs.map +1 -0
- package/dist/ConnectorClient.d.cts +134 -0
- package/dist/ConnectorClient.d.ts +131 -0
- package/dist/ConnectorClient.d.ts.map +1 -0
- package/dist/ConnectorClient.js +170 -0
- package/dist/ConnectorClient.js.map +1 -0
- package/dist/SipClient.cjs +4 -2
- package/dist/SipClient.cjs.map +1 -1
- package/dist/SipClient.d.cts +5 -1
- package/dist/SipClient.d.ts +5 -1
- package/dist/SipClient.d.ts.map +1 -1
- package/dist/SipClient.js +5 -2
- package/dist/SipClient.js.map +1 -1
- package/dist/index.cjs +35 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/ConnectorClient.ts +282 -0
- package/src/SipClient.ts +7 -0
- package/src/index.ts +17 -0
package/dist/index.cjs
CHANGED
|
@@ -19,13 +19,20 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
__export(index_exports, {
|
|
22
|
+
AcceptWhatsAppCallResponse: () => import_protocol.AcceptWhatsAppCallResponse,
|
|
23
|
+
AgentDispatch: () => import_protocol.AgentDispatch,
|
|
22
24
|
AliOSSUpload: () => import_protocol.AliOSSUpload,
|
|
23
25
|
AudioCodec: () => import_protocol.AudioCodec,
|
|
24
26
|
AutoParticipantEgress: () => import_protocol.AutoParticipantEgress,
|
|
25
27
|
AutoTrackEgress: () => import_protocol.AutoTrackEgress,
|
|
26
28
|
AzureBlobUpload: () => import_protocol.AzureBlobUpload,
|
|
29
|
+
ConnectTwilioCallRequest_TwilioCallDirection: () => import_protocol.ConnectTwilioCallRequest_TwilioCallDirection,
|
|
30
|
+
ConnectTwilioCallResponse: () => import_protocol.ConnectTwilioCallResponse,
|
|
31
|
+
ConnectWhatsAppCallResponse: () => import_protocol.ConnectWhatsAppCallResponse,
|
|
27
32
|
DataPacket_Kind: () => import_protocol.DataPacket_Kind,
|
|
33
|
+
DialWhatsAppCallResponse: () => import_protocol.DialWhatsAppCallResponse,
|
|
28
34
|
DirectFileOutput: () => import_protocol.DirectFileOutput,
|
|
35
|
+
DisconnectWhatsAppCallResponse: () => import_protocol.DisconnectWhatsAppCallResponse,
|
|
29
36
|
EgressInfo: () => import_protocol.EgressInfo,
|
|
30
37
|
EgressStatus: () => import_protocol.EgressStatus,
|
|
31
38
|
EncodedFileOutput: () => import_protocol.EncodedFileOutput,
|
|
@@ -52,13 +59,21 @@ __export(index_exports, {
|
|
|
52
59
|
Room: () => import_protocol.Room,
|
|
53
60
|
RoomAgentDispatch: () => import_protocol.RoomAgentDispatch,
|
|
54
61
|
RoomCompositeEgressRequest: () => import_protocol.RoomCompositeEgressRequest,
|
|
62
|
+
RoomConfiguration: () => import_protocol.RoomConfiguration,
|
|
55
63
|
RoomEgress: () => import_protocol.RoomEgress,
|
|
56
64
|
S3Upload: () => import_protocol.S3Upload,
|
|
65
|
+
SIPCallStatus: () => import_protocol.SIPCallStatus,
|
|
66
|
+
SIPDispatchRule: () => import_protocol.SIPDispatchRule,
|
|
67
|
+
SIPDispatchRuleDirect: () => import_protocol.SIPDispatchRuleDirect,
|
|
68
|
+
SIPDispatchRuleIndividual: () => import_protocol.SIPDispatchRuleIndividual,
|
|
57
69
|
SIPDispatchRuleInfo: () => import_protocol.SIPDispatchRuleInfo,
|
|
70
|
+
SIPInboundTrunkInfo: () => import_protocol.SIPInboundTrunkInfo,
|
|
71
|
+
SIPOutboundTrunkInfo: () => import_protocol.SIPOutboundTrunkInfo,
|
|
58
72
|
SIPParticipantInfo: () => import_protocol.SIPParticipantInfo,
|
|
59
73
|
SIPTrunkInfo: () => import_protocol.SIPTrunkInfo,
|
|
60
74
|
SegmentedFileOutput: () => import_protocol.SegmentedFileOutput,
|
|
61
75
|
SegmentedFileProtocol: () => import_protocol.SegmentedFileProtocol,
|
|
76
|
+
SessionDescription: () => import_protocol.SessionDescription,
|
|
62
77
|
StreamOutput: () => import_protocol.StreamOutput,
|
|
63
78
|
StreamProtocol: () => import_protocol.StreamProtocol,
|
|
64
79
|
TrackCompositeEgressRequest: () => import_protocol.TrackCompositeEgressRequest,
|
|
@@ -66,6 +81,7 @@ __export(index_exports, {
|
|
|
66
81
|
TrackInfo: () => import_protocol.TrackInfo,
|
|
67
82
|
TrackSource: () => import_protocol.TrackSource,
|
|
68
83
|
TrackType: () => import_protocol.TrackType,
|
|
84
|
+
TwirpError: () => import_TwirpRPC.TwirpError,
|
|
69
85
|
VideoCodec: () => import_protocol.VideoCodec,
|
|
70
86
|
WebEgressRequest: () => import_protocol.WebEgressRequest,
|
|
71
87
|
WebhookConfig: () => import_protocol.WebhookConfig
|
|
@@ -74,21 +90,30 @@ module.exports = __toCommonJS(index_exports);
|
|
|
74
90
|
var import_protocol = require("@livekit/protocol");
|
|
75
91
|
__reExport(index_exports, require("./AccessToken.cjs"), module.exports);
|
|
76
92
|
__reExport(index_exports, require("./AgentDispatchClient.cjs"), module.exports);
|
|
93
|
+
__reExport(index_exports, require("./ConnectorClient.cjs"), module.exports);
|
|
77
94
|
__reExport(index_exports, require("./EgressClient.cjs"), module.exports);
|
|
78
95
|
__reExport(index_exports, require("./grants.cjs"), module.exports);
|
|
79
96
|
__reExport(index_exports, require("./IngressClient.cjs"), module.exports);
|
|
80
97
|
__reExport(index_exports, require("./RoomServiceClient.cjs"), module.exports);
|
|
81
98
|
__reExport(index_exports, require("./SipClient.cjs"), module.exports);
|
|
99
|
+
var import_TwirpRPC = require("./TwirpRPC.cjs");
|
|
82
100
|
__reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
83
101
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
102
|
0 && (module.exports = {
|
|
103
|
+
AcceptWhatsAppCallResponse,
|
|
104
|
+
AgentDispatch,
|
|
85
105
|
AliOSSUpload,
|
|
86
106
|
AudioCodec,
|
|
87
107
|
AutoParticipantEgress,
|
|
88
108
|
AutoTrackEgress,
|
|
89
109
|
AzureBlobUpload,
|
|
110
|
+
ConnectTwilioCallRequest_TwilioCallDirection,
|
|
111
|
+
ConnectTwilioCallResponse,
|
|
112
|
+
ConnectWhatsAppCallResponse,
|
|
90
113
|
DataPacket_Kind,
|
|
114
|
+
DialWhatsAppCallResponse,
|
|
91
115
|
DirectFileOutput,
|
|
116
|
+
DisconnectWhatsAppCallResponse,
|
|
92
117
|
EgressInfo,
|
|
93
118
|
EgressStatus,
|
|
94
119
|
EncodedFileOutput,
|
|
@@ -115,13 +140,21 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
115
140
|
Room,
|
|
116
141
|
RoomAgentDispatch,
|
|
117
142
|
RoomCompositeEgressRequest,
|
|
143
|
+
RoomConfiguration,
|
|
118
144
|
RoomEgress,
|
|
119
145
|
S3Upload,
|
|
146
|
+
SIPCallStatus,
|
|
147
|
+
SIPDispatchRule,
|
|
148
|
+
SIPDispatchRuleDirect,
|
|
149
|
+
SIPDispatchRuleIndividual,
|
|
120
150
|
SIPDispatchRuleInfo,
|
|
151
|
+
SIPInboundTrunkInfo,
|
|
152
|
+
SIPOutboundTrunkInfo,
|
|
121
153
|
SIPParticipantInfo,
|
|
122
154
|
SIPTrunkInfo,
|
|
123
155
|
SegmentedFileOutput,
|
|
124
156
|
SegmentedFileProtocol,
|
|
157
|
+
SessionDescription,
|
|
125
158
|
StreamOutput,
|
|
126
159
|
StreamProtocol,
|
|
127
160
|
TrackCompositeEgressRequest,
|
|
@@ -129,11 +162,13 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
129
162
|
TrackInfo,
|
|
130
163
|
TrackSource,
|
|
131
164
|
TrackType,
|
|
165
|
+
TwirpError,
|
|
132
166
|
VideoCodec,
|
|
133
167
|
WebEgressRequest,
|
|
134
168
|
WebhookConfig,
|
|
135
169
|
...require("./AccessToken.cjs"),
|
|
136
170
|
...require("./AgentDispatchClient.cjs"),
|
|
171
|
+
...require("./ConnectorClient.cjs"),
|
|
137
172
|
...require("./EgressClient.cjs"),
|
|
138
173
|
...require("./grants.cjs"),
|
|
139
174
|
...require("./IngressClient.cjs"),
|
package/dist/index.cjs.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 AliOSSUpload,\n AudioCodec,\n AutoParticipantEgress,\n AutoTrackEgress,\n AzureBlobUpload,\n DataPacket_Kind,\n DirectFileOutput,\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 RoomEgress,\n S3Upload,\n SIPDispatchRuleInfo,\n SIPParticipantInfo,\n SIPTrunkInfo,\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 './EgressClient.js';\nexport * from './grants.js';\nexport * from './IngressClient.js';\nexport * from './RoomServiceClient.js';\nexport * from './SipClient.js';\nexport * from './WebhookReceiver.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,
|
|
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":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,sBAkEO;AACP,0BAAc,6BAvEd;AAwEA,0BAAc,qCAxEd;AAyEA,0BAAc,iCAzEd;AA0EA,0BAAc,8BA1Ed;AA2EA,0BAAc,wBA3Ed;AA4EA,0BAAc,+BA5Ed;AA6EA,0BAAc,mCA7Ed;AA8EA,0BAAc,2BA9Ed;AA+EA,sBAA2B;AAC3B,0BAAc,iCAhFd;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, DataPacket_Kind, DirectFileOutput, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomEgress, S3Upload, SIPDispatchRuleInfo, SIPParticipantInfo, SIPTrunkInfo, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, TrackCompositeEgressRequest, TrackEgressRequest, TrackInfo, TrackSource, TrackType, VideoCodec, WebEgressRequest, WebhookConfig } from '@livekit/protocol';
|
|
1
|
+
export { AcceptWhatsAppCallResponse, AgentDispatch, AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, ConnectTwilioCallRequest_TwilioCallDirection, ConnectTwilioCallResponse, ConnectWhatsAppCallResponse, DataPacket_Kind, DialWhatsAppCallResponse, DirectFileOutput, DisconnectWhatsAppCallResponse, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomConfiguration, RoomEgress, S3Upload, SIPCallStatus, SIPDispatchRule, SIPDispatchRuleDirect, SIPDispatchRuleIndividual, SIPDispatchRuleInfo, SIPInboundTrunkInfo, SIPOutboundTrunkInfo, SIPParticipantInfo, SIPTrunkInfo, SegmentedFileOutput, SegmentedFileProtocol, SessionDescription, StreamOutput, StreamProtocol, TrackCompositeEgressRequest, TrackEgressRequest, TrackInfo, TrackSource, TrackType, VideoCodec, WebEgressRequest, WebhookConfig } from '@livekit/protocol';
|
|
2
2
|
export { AccessToken, AccessTokenOptions, TokenVerifier } from './AccessToken.cjs';
|
|
3
3
|
export { AgentDispatchClient } from './AgentDispatchClient.cjs';
|
|
4
|
+
export { AcceptWhatsAppCallOptions, ConnectTwilioCallOptions, ConnectorClient, DialWhatsAppCallOptions } from './ConnectorClient.cjs';
|
|
4
5
|
export { BaseOptions, EgressClient, EncodedOutputs, ListEgressOptions, ParticipantEgressOptions, RoomCompositeOptions, TrackCompositeOptions, WebOptions } from './EgressClient.cjs';
|
|
5
6
|
export { ClaimGrants, InferenceGrant, ObservabilityGrant, SIPGrant, VideoGrant, claimsToJwtPayload, trackSourceToString } from './grants.cjs';
|
|
6
7
|
export { CreateIngressOptions, IngressClient, ListIngressOptions, UpdateIngressOptions } from './IngressClient.cjs';
|
|
7
8
|
export { CreateOptions, RoomServiceClient, SendDataOptions, UpdateParticipantOptions } from './RoomServiceClient.cjs';
|
|
8
9
|
export { CreateSipDispatchRuleOptions, CreateSipInboundTrunkOptions, CreateSipOutboundTrunkOptions, CreateSipParticipantOptions, CreateSipTrunkOptions, ListSipDispatchRuleOptions, ListSipTrunkOptions, SipClient, SipDispatchRuleDirect, SipDispatchRuleIndividual, SipDispatchRuleUpdateOptions, SipInboundTrunkUpdateOptions, SipOutboundTrunkUpdateOptions, TransferSipParticipantOptions } from './SipClient.cjs';
|
|
10
|
+
export { TwirpError } from './TwirpRPC.cjs';
|
|
9
11
|
export { WebhookEvent, WebhookEventNames, WebhookReceiver, authorizeHeader } from './WebhookReceiver.cjs';
|
|
10
12
|
import './ClientOptions.cjs';
|
|
11
13
|
import './ServiceBase.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, DataPacket_Kind, DirectFileOutput, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomEgress, S3Upload, SIPDispatchRuleInfo, SIPParticipantInfo, SIPTrunkInfo, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, TrackCompositeEgressRequest, TrackEgressRequest, TrackInfo, TrackSource, TrackType, WebEgressRequest, VideoCodec, WebhookConfig, } from '@livekit/protocol';
|
|
1
|
+
export { AcceptWhatsAppCallResponse, AliOSSUpload, AgentDispatch, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, ConnectTwilioCallRequest_TwilioCallDirection, ConnectTwilioCallResponse, ConnectWhatsAppCallResponse, DataPacket_Kind, DialWhatsAppCallResponse, DirectFileOutput, DisconnectWhatsAppCallResponse, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomConfiguration, RoomEgress, S3Upload, SessionDescription, SIPDispatchRule, SIPDispatchRuleInfo, SIPDispatchRuleDirect, SIPDispatchRuleIndividual, SIPParticipantInfo, SIPOutboundTrunkInfo, SIPInboundTrunkInfo, SIPTrunkInfo, SIPCallStatus, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, TrackCompositeEgressRequest, TrackEgressRequest, TrackInfo, TrackSource, TrackType, WebEgressRequest, VideoCodec, WebhookConfig, } from '@livekit/protocol';
|
|
2
2
|
export * from './AccessToken.js';
|
|
3
3
|
export * from './AgentDispatchClient.js';
|
|
4
|
+
export * from './ConnectorClient.js';
|
|
4
5
|
export * from './EgressClient.js';
|
|
5
6
|
export * from './grants.js';
|
|
6
7
|
export * from './IngressClient.js';
|
|
7
8
|
export * from './RoomServiceClient.js';
|
|
8
9
|
export * from './SipClient.js';
|
|
10
|
+
export { TwirpError } from './TwirpRPC.js';
|
|
9
11
|
export * from './WebhookReceiver.js';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,IAAI,EACJ,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,aAAa,EACb,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,4CAA4C,EAC5C,yBAAyB,EACzB,2BAA2B,EAC3B,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,8BAA8B,EAC9B,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,IAAI,EACJ,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AcceptWhatsAppCallResponse,
|
|
2
3
|
AliOSSUpload,
|
|
4
|
+
AgentDispatch,
|
|
3
5
|
AudioCodec,
|
|
4
6
|
AutoParticipantEgress,
|
|
5
7
|
AutoTrackEgress,
|
|
6
8
|
AzureBlobUpload,
|
|
9
|
+
ConnectTwilioCallRequest_TwilioCallDirection,
|
|
10
|
+
ConnectTwilioCallResponse,
|
|
11
|
+
ConnectWhatsAppCallResponse,
|
|
7
12
|
DataPacket_Kind,
|
|
13
|
+
DialWhatsAppCallResponse,
|
|
8
14
|
DirectFileOutput,
|
|
15
|
+
DisconnectWhatsAppCallResponse,
|
|
9
16
|
EgressInfo,
|
|
10
17
|
EgressStatus,
|
|
11
18
|
EncodedFileOutput,
|
|
@@ -32,11 +39,19 @@ import {
|
|
|
32
39
|
Room,
|
|
33
40
|
RoomAgentDispatch,
|
|
34
41
|
RoomCompositeEgressRequest,
|
|
42
|
+
RoomConfiguration,
|
|
35
43
|
RoomEgress,
|
|
36
44
|
S3Upload,
|
|
45
|
+
SessionDescription,
|
|
46
|
+
SIPDispatchRule,
|
|
37
47
|
SIPDispatchRuleInfo,
|
|
48
|
+
SIPDispatchRuleDirect,
|
|
49
|
+
SIPDispatchRuleIndividual,
|
|
38
50
|
SIPParticipantInfo,
|
|
51
|
+
SIPOutboundTrunkInfo,
|
|
52
|
+
SIPInboundTrunkInfo,
|
|
39
53
|
SIPTrunkInfo,
|
|
54
|
+
SIPCallStatus,
|
|
40
55
|
SegmentedFileOutput,
|
|
41
56
|
SegmentedFileProtocol,
|
|
42
57
|
StreamOutput,
|
|
@@ -52,20 +67,29 @@ import {
|
|
|
52
67
|
} from "@livekit/protocol";
|
|
53
68
|
export * from "./AccessToken.js";
|
|
54
69
|
export * from "./AgentDispatchClient.js";
|
|
70
|
+
export * from "./ConnectorClient.js";
|
|
55
71
|
export * from "./EgressClient.js";
|
|
56
72
|
export * from "./grants.js";
|
|
57
73
|
export * from "./IngressClient.js";
|
|
58
74
|
export * from "./RoomServiceClient.js";
|
|
59
75
|
export * from "./SipClient.js";
|
|
76
|
+
import { TwirpError } from "./TwirpRPC.js";
|
|
60
77
|
export * from "./WebhookReceiver.js";
|
|
61
78
|
export {
|
|
79
|
+
AcceptWhatsAppCallResponse,
|
|
80
|
+
AgentDispatch,
|
|
62
81
|
AliOSSUpload,
|
|
63
82
|
AudioCodec,
|
|
64
83
|
AutoParticipantEgress,
|
|
65
84
|
AutoTrackEgress,
|
|
66
85
|
AzureBlobUpload,
|
|
86
|
+
ConnectTwilioCallRequest_TwilioCallDirection,
|
|
87
|
+
ConnectTwilioCallResponse,
|
|
88
|
+
ConnectWhatsAppCallResponse,
|
|
67
89
|
DataPacket_Kind,
|
|
90
|
+
DialWhatsAppCallResponse,
|
|
68
91
|
DirectFileOutput,
|
|
92
|
+
DisconnectWhatsAppCallResponse,
|
|
69
93
|
EgressInfo,
|
|
70
94
|
EgressStatus,
|
|
71
95
|
EncodedFileOutput,
|
|
@@ -92,13 +116,21 @@ export {
|
|
|
92
116
|
Room,
|
|
93
117
|
RoomAgentDispatch,
|
|
94
118
|
RoomCompositeEgressRequest,
|
|
119
|
+
RoomConfiguration,
|
|
95
120
|
RoomEgress,
|
|
96
121
|
S3Upload,
|
|
122
|
+
SIPCallStatus,
|
|
123
|
+
SIPDispatchRule,
|
|
124
|
+
SIPDispatchRuleDirect,
|
|
125
|
+
SIPDispatchRuleIndividual,
|
|
97
126
|
SIPDispatchRuleInfo,
|
|
127
|
+
SIPInboundTrunkInfo,
|
|
128
|
+
SIPOutboundTrunkInfo,
|
|
98
129
|
SIPParticipantInfo,
|
|
99
130
|
SIPTrunkInfo,
|
|
100
131
|
SegmentedFileOutput,
|
|
101
132
|
SegmentedFileProtocol,
|
|
133
|
+
SessionDescription,
|
|
102
134
|
StreamOutput,
|
|
103
135
|
StreamProtocol,
|
|
104
136
|
TrackCompositeEgressRequest,
|
|
@@ -106,6 +138,7 @@ export {
|
|
|
106
138
|
TrackInfo,
|
|
107
139
|
TrackSource,
|
|
108
140
|
TrackType,
|
|
141
|
+
TwirpError,
|
|
109
142
|
VideoCodec,
|
|
110
143
|
WebEgressRequest,
|
|
111
144
|
WebhookConfig
|
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 AliOSSUpload,\n AudioCodec,\n AutoParticipantEgress,\n AutoTrackEgress,\n AzureBlobUpload,\n DataPacket_Kind,\n DirectFileOutput,\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 RoomEgress,\n S3Upload,\n SIPDispatchRuleInfo,\n SIPParticipantInfo,\n SIPTrunkInfo,\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 './EgressClient.js';\nexport * from './grants.js';\nexport * from './IngressClient.js';\nexport * from './RoomServiceClient.js';\nexport * from './SipClient.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,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,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 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":[]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livekit-server-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "Server-side SDK for LiveKit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"require": "dist/index.cjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "
|
|
10
|
+
"url": "https://github.com/livekit/node-sdks.git",
|
|
11
|
+
"directory": "packages/livekit-server-sdk"
|
|
11
12
|
},
|
|
12
13
|
"author": "David Zhao <david@davidzhao.com>",
|
|
13
14
|
"license": "Apache-2.0",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
],
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@bufbuild/protobuf": "^1.10.1",
|
|
33
|
-
"@livekit/protocol": "^1.
|
|
34
|
+
"@livekit/protocol": "^1.43.1",
|
|
34
35
|
"camelcase-keys": "^9.0.0",
|
|
35
36
|
"jose": "^5.1.2"
|
|
36
37
|
},
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import type {
|
|
5
|
+
ConnectTwilioCallRequest_TwilioCallDirection,
|
|
6
|
+
RoomAgentDispatch,
|
|
7
|
+
SessionDescription,
|
|
8
|
+
} from '@livekit/protocol';
|
|
9
|
+
import {
|
|
10
|
+
AcceptWhatsAppCallRequest,
|
|
11
|
+
AcceptWhatsAppCallResponse,
|
|
12
|
+
ConnectTwilioCallRequest,
|
|
13
|
+
ConnectTwilioCallResponse,
|
|
14
|
+
ConnectWhatsAppCallRequest,
|
|
15
|
+
ConnectWhatsAppCallResponse,
|
|
16
|
+
DialWhatsAppCallRequest,
|
|
17
|
+
DialWhatsAppCallResponse,
|
|
18
|
+
DisconnectWhatsAppCallRequest,
|
|
19
|
+
DisconnectWhatsAppCallResponse,
|
|
20
|
+
} from '@livekit/protocol';
|
|
21
|
+
import type { ClientOptions } from './ClientOptions.js';
|
|
22
|
+
import { ServiceBase } from './ServiceBase.js';
|
|
23
|
+
import { type Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js';
|
|
24
|
+
|
|
25
|
+
const svc = 'Connector';
|
|
26
|
+
|
|
27
|
+
// WhatsApp types
|
|
28
|
+
export interface DialWhatsAppCallOptions {
|
|
29
|
+
/** Required - The identifier of the WhatsApp phone number that is initiating the call */
|
|
30
|
+
whatsappPhoneNumberId: string;
|
|
31
|
+
/** Required - The number of the user that is supposed to receive the call */
|
|
32
|
+
whatsappToPhoneNumber: string;
|
|
33
|
+
/** Required - The API key of the business that is initiating the call */
|
|
34
|
+
whatsappApiKey: string;
|
|
35
|
+
/** Required - WhatsApp Cloud API version, eg: 23.0, 24.0, etc. */
|
|
36
|
+
whatsappCloudApiVersion: string;
|
|
37
|
+
/** Optional - An arbitrary string you can pass in that is useful for tracking and logging purposes */
|
|
38
|
+
whatsappBizOpaqueCallbackData?: string;
|
|
39
|
+
/** Optional - What LiveKit room should this participant be connected to */
|
|
40
|
+
roomName?: string;
|
|
41
|
+
/** Optional - Agents to dispatch the call to */
|
|
42
|
+
agents?: RoomAgentDispatch[];
|
|
43
|
+
/** Optional - Identity of the participant in LiveKit room */
|
|
44
|
+
participantIdentity?: string;
|
|
45
|
+
/** Optional - Name of the participant in LiveKit room */
|
|
46
|
+
participantName?: string;
|
|
47
|
+
/** Optional - User-defined metadata. Will be attached to a created Participant in the room. */
|
|
48
|
+
participantMetadata?: string;
|
|
49
|
+
/** Optional - User-defined attributes. Will be attached to a created Participant in the room. */
|
|
50
|
+
participantAttributes?: { [key: string]: string };
|
|
51
|
+
/** Optional - Country where the call terminates as ISO 3166-1 alpha-2 */
|
|
52
|
+
destinationCountry?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface AcceptWhatsAppCallOptions {
|
|
56
|
+
/** Required - The identifier of the WhatsApp phone number that is connecting the call */
|
|
57
|
+
whatsappPhoneNumberId: string;
|
|
58
|
+
/** Required - The API key of the business that is connecting the call */
|
|
59
|
+
whatsappApiKey: string;
|
|
60
|
+
/** Required - WhatsApp Cloud API version, eg: 23.0, 24.0, etc. */
|
|
61
|
+
whatsappCloudApiVersion: string;
|
|
62
|
+
/** Required - Call ID sent by Meta */
|
|
63
|
+
whatsappCallId: string;
|
|
64
|
+
/** Optional - An arbitrary string you can pass in that is useful for tracking and logging purposes */
|
|
65
|
+
whatsappBizOpaqueCallbackData?: string;
|
|
66
|
+
/** Required - The call accept webhook comes with SDP from Meta */
|
|
67
|
+
sdp: SessionDescription;
|
|
68
|
+
/** Optional - What LiveKit room should this participant be connected to */
|
|
69
|
+
roomName?: string;
|
|
70
|
+
/** Optional - Agents to dispatch the call to */
|
|
71
|
+
agents?: RoomAgentDispatch[];
|
|
72
|
+
/** Optional - Identity of the participant in LiveKit room */
|
|
73
|
+
participantIdentity?: string;
|
|
74
|
+
/** Optional - Name of the participant in LiveKit room */
|
|
75
|
+
participantName?: string;
|
|
76
|
+
/** Optional - User-defined metadata. Will be attached to a created Participant in the room. */
|
|
77
|
+
participantMetadata?: string;
|
|
78
|
+
/** Optional - User-defined attributes. Will be attached to a created Participant in the room. */
|
|
79
|
+
participantAttributes?: { [key: string]: string };
|
|
80
|
+
/** Optional - Country where the call terminates as ISO 3166-1 alpha-2 */
|
|
81
|
+
destinationCountry?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Twilio types
|
|
85
|
+
export interface ConnectTwilioCallOptions {
|
|
86
|
+
/** The direction of the call */
|
|
87
|
+
twilioCallDirection: ConnectTwilioCallRequest_TwilioCallDirection;
|
|
88
|
+
/** What LiveKit room should this call be connected to */
|
|
89
|
+
roomName: string;
|
|
90
|
+
/** Optional agents to dispatch the call to */
|
|
91
|
+
agents?: RoomAgentDispatch[];
|
|
92
|
+
/** Optional identity of the participant in LiveKit room */
|
|
93
|
+
participantIdentity?: string;
|
|
94
|
+
/** Optional name of the participant in LiveKit room */
|
|
95
|
+
participantName?: string;
|
|
96
|
+
/** Optional user-defined metadata. Will be attached to a created Participant in the room. */
|
|
97
|
+
participantMetadata?: string;
|
|
98
|
+
/** Optional user-defined attributes. Will be attached to a created Participant in the room. */
|
|
99
|
+
participantAttributes?: { [key: string]: string };
|
|
100
|
+
/** Country where the call terminates as ISO 3166-1 alpha-2 */
|
|
101
|
+
destinationCountry?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Client to access Connector APIs for WhatsApp and Twilio integrations
|
|
106
|
+
*/
|
|
107
|
+
export class ConnectorClient extends ServiceBase {
|
|
108
|
+
private readonly rpc: Rpc;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @param host - hostname including protocol. i.e. 'https://<project>.livekit.cloud'
|
|
112
|
+
* @param apiKey - API Key, can be set in env var LIVEKIT_API_KEY
|
|
113
|
+
* @param secret - API Secret, can be set in env var LIVEKIT_API_SECRET
|
|
114
|
+
* @param options - client options
|
|
115
|
+
*/
|
|
116
|
+
constructor(host: string, apiKey?: string, secret?: string, options?: ClientOptions) {
|
|
117
|
+
super(apiKey, secret);
|
|
118
|
+
const rpcOptions = options?.requestTimeout
|
|
119
|
+
? { requestTimeout: options.requestTimeout }
|
|
120
|
+
: undefined;
|
|
121
|
+
this.rpc = new TwirpRpc(host, livekitPackage, rpcOptions);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Initiate an outbound WhatsApp call
|
|
126
|
+
*
|
|
127
|
+
* @param options - WhatsApp call options
|
|
128
|
+
* @returns Promise containing the WhatsApp call ID and room name
|
|
129
|
+
*/
|
|
130
|
+
async dialWhatsAppCall(options: DialWhatsAppCallOptions): Promise<DialWhatsAppCallResponse> {
|
|
131
|
+
const whatsappBizOpaqueCallbackData = options.whatsappBizOpaqueCallbackData || '';
|
|
132
|
+
const roomName = options.roomName || '';
|
|
133
|
+
const participantIdentity = options.participantIdentity || '';
|
|
134
|
+
const participantName = options.participantName || '';
|
|
135
|
+
const participantMetadata = options.participantMetadata || '';
|
|
136
|
+
const destinationCountry = options.destinationCountry || '';
|
|
137
|
+
|
|
138
|
+
const req = new DialWhatsAppCallRequest({
|
|
139
|
+
whatsappPhoneNumberId: options.whatsappPhoneNumberId,
|
|
140
|
+
whatsappToPhoneNumber: options.whatsappToPhoneNumber,
|
|
141
|
+
whatsappApiKey: options.whatsappApiKey,
|
|
142
|
+
whatsappCloudApiVersion: options.whatsappCloudApiVersion,
|
|
143
|
+
whatsappBizOpaqueCallbackData,
|
|
144
|
+
roomName,
|
|
145
|
+
agents: options.agents,
|
|
146
|
+
participantIdentity,
|
|
147
|
+
participantName,
|
|
148
|
+
participantMetadata,
|
|
149
|
+
participantAttributes: options.participantAttributes,
|
|
150
|
+
destinationCountry,
|
|
151
|
+
}).toJson();
|
|
152
|
+
|
|
153
|
+
const data = await this.rpc.request(
|
|
154
|
+
svc,
|
|
155
|
+
'DialWhatsAppCall',
|
|
156
|
+
req,
|
|
157
|
+
await this.authHeader({ roomCreate: true }),
|
|
158
|
+
);
|
|
159
|
+
return DialWhatsAppCallResponse.fromJson(data, { ignoreUnknownFields: true });
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Accept an inbound WhatsApp call
|
|
164
|
+
*
|
|
165
|
+
* @param options - WhatsApp call accept options
|
|
166
|
+
* @returns Promise containing the room name
|
|
167
|
+
*/
|
|
168
|
+
async acceptWhatsAppCall(
|
|
169
|
+
options: AcceptWhatsAppCallOptions,
|
|
170
|
+
): Promise<AcceptWhatsAppCallResponse> {
|
|
171
|
+
const whatsappBizOpaqueCallbackData = options.whatsappBizOpaqueCallbackData || '';
|
|
172
|
+
const roomName = options.roomName || '';
|
|
173
|
+
const participantIdentity = options.participantIdentity || '';
|
|
174
|
+
const participantName = options.participantName || '';
|
|
175
|
+
const participantMetadata = options.participantMetadata || '';
|
|
176
|
+
const destinationCountry = options.destinationCountry || '';
|
|
177
|
+
|
|
178
|
+
const req = new AcceptWhatsAppCallRequest({
|
|
179
|
+
whatsappPhoneNumberId: options.whatsappPhoneNumberId,
|
|
180
|
+
whatsappApiKey: options.whatsappApiKey,
|
|
181
|
+
whatsappCloudApiVersion: options.whatsappCloudApiVersion,
|
|
182
|
+
whatsappCallId: options.whatsappCallId,
|
|
183
|
+
whatsappBizOpaqueCallbackData,
|
|
184
|
+
sdp: options.sdp,
|
|
185
|
+
roomName,
|
|
186
|
+
agents: options.agents,
|
|
187
|
+
participantIdentity,
|
|
188
|
+
participantName,
|
|
189
|
+
participantMetadata,
|
|
190
|
+
participantAttributes: options.participantAttributes,
|
|
191
|
+
destinationCountry,
|
|
192
|
+
}).toJson();
|
|
193
|
+
|
|
194
|
+
const data = await this.rpc.request(
|
|
195
|
+
svc,
|
|
196
|
+
'AcceptWhatsAppCall',
|
|
197
|
+
req,
|
|
198
|
+
await this.authHeader({ roomCreate: true }),
|
|
199
|
+
);
|
|
200
|
+
return AcceptWhatsAppCallResponse.fromJson(data, { ignoreUnknownFields: true });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Connect an established WhatsApp call (used for business-initiated calls)
|
|
205
|
+
*
|
|
206
|
+
* @param whatsappCallId - Call ID sent by Meta
|
|
207
|
+
* @param sdp - Session description from Meta
|
|
208
|
+
*/
|
|
209
|
+
async connectWhatsAppCall(
|
|
210
|
+
whatsappCallId: string,
|
|
211
|
+
sdp: SessionDescription,
|
|
212
|
+
): Promise<ConnectWhatsAppCallResponse> {
|
|
213
|
+
const req = new ConnectWhatsAppCallRequest({
|
|
214
|
+
whatsappCallId,
|
|
215
|
+
sdp,
|
|
216
|
+
}).toJson();
|
|
217
|
+
|
|
218
|
+
const data = await this.rpc.request(
|
|
219
|
+
svc,
|
|
220
|
+
'ConnectWhatsAppCall',
|
|
221
|
+
req,
|
|
222
|
+
await this.authHeader({ roomCreate: true }),
|
|
223
|
+
);
|
|
224
|
+
return ConnectWhatsAppCallResponse.fromJson(data, { ignoreUnknownFields: true });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Disconnect an active WhatsApp call
|
|
229
|
+
*
|
|
230
|
+
* @param whatsappCallId - Call ID sent by Meta
|
|
231
|
+
* @param whatsappApiKey - The API key of the business that is disconnecting the call
|
|
232
|
+
*/
|
|
233
|
+
async disconnectWhatsAppCall(
|
|
234
|
+
whatsappCallId: string,
|
|
235
|
+
whatsappApiKey: string,
|
|
236
|
+
): Promise<DisconnectWhatsAppCallResponse> {
|
|
237
|
+
const req = new DisconnectWhatsAppCallRequest({
|
|
238
|
+
whatsappCallId,
|
|
239
|
+
whatsappApiKey,
|
|
240
|
+
}).toJson();
|
|
241
|
+
|
|
242
|
+
const data = await this.rpc.request(
|
|
243
|
+
svc,
|
|
244
|
+
'DisconnectWhatsAppCall',
|
|
245
|
+
req,
|
|
246
|
+
await this.authHeader({ roomCreate: true }),
|
|
247
|
+
);
|
|
248
|
+
return DisconnectWhatsAppCallResponse.fromJson(data, { ignoreUnknownFields: true });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Connect a Twilio call to a LiveKit room
|
|
253
|
+
*
|
|
254
|
+
* @param options - Twilio call connection options
|
|
255
|
+
* @returns Promise containing the WebSocket connect URL for Twilio media stream
|
|
256
|
+
*/
|
|
257
|
+
async connectTwilioCall(options: ConnectTwilioCallOptions): Promise<ConnectTwilioCallResponse> {
|
|
258
|
+
const participantIdentity = options.participantIdentity || '';
|
|
259
|
+
const participantName = options.participantName || '';
|
|
260
|
+
const participantMetadata = options.participantMetadata || '';
|
|
261
|
+
const destinationCountry = options.destinationCountry || '';
|
|
262
|
+
|
|
263
|
+
const req = new ConnectTwilioCallRequest({
|
|
264
|
+
twilioCallDirection: options.twilioCallDirection,
|
|
265
|
+
roomName: options.roomName,
|
|
266
|
+
agents: options.agents,
|
|
267
|
+
participantIdentity,
|
|
268
|
+
participantName,
|
|
269
|
+
participantMetadata,
|
|
270
|
+
participantAttributes: options.participantAttributes,
|
|
271
|
+
destinationCountry,
|
|
272
|
+
}).toJson();
|
|
273
|
+
|
|
274
|
+
const data = await this.rpc.request(
|
|
275
|
+
svc,
|
|
276
|
+
'ConnectTwilioCall',
|
|
277
|
+
req,
|
|
278
|
+
await this.authHeader({ roomCreate: true }),
|
|
279
|
+
);
|
|
280
|
+
return ConnectTwilioCallResponse.fromJson(data, { ignoreUnknownFields: true });
|
|
281
|
+
}
|
|
282
|
+
}
|
package/src/SipClient.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
SIPDispatchRuleIndividual,
|
|
30
30
|
SIPDispatchRuleInfo,
|
|
31
31
|
SIPInboundTrunkInfo,
|
|
32
|
+
SIPMediaEncryption,
|
|
32
33
|
SIPOutboundConfig,
|
|
33
34
|
SIPOutboundTrunkInfo,
|
|
34
35
|
SIPParticipantInfo,
|
|
@@ -79,6 +80,7 @@ export interface CreateSipInboundTrunkOptions {
|
|
|
79
80
|
// Map SIP response headers from INVITE to sip.h.* participant attributes automatically.
|
|
80
81
|
includeHeaders?: SIPHeaderOptions;
|
|
81
82
|
krispEnabled?: boolean;
|
|
83
|
+
mediaEncryption?: SIPMediaEncryption;
|
|
82
84
|
}
|
|
83
85
|
export interface CreateSipOutboundTrunkOptions {
|
|
84
86
|
metadata?: string;
|
|
@@ -94,6 +96,7 @@ export interface CreateSipOutboundTrunkOptions {
|
|
|
94
96
|
headersToAttributes?: { [key: string]: string };
|
|
95
97
|
// Map SIP response headers from INVITE to sip.h.* participant attributes automatically.
|
|
96
98
|
includeHeaders?: SIPHeaderOptions;
|
|
99
|
+
mediaEncryption?: SIPMediaEncryption;
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
export interface SipDispatchRuleDirect {
|
|
@@ -189,6 +192,7 @@ export interface SipInboundTrunkUpdateOptions {
|
|
|
189
192
|
authPassword?: string;
|
|
190
193
|
name?: string;
|
|
191
194
|
metadata?: string;
|
|
195
|
+
mediaEncryption?: SIPMediaEncryption;
|
|
192
196
|
}
|
|
193
197
|
|
|
194
198
|
export interface SipOutboundTrunkUpdateOptions {
|
|
@@ -200,6 +204,7 @@ export interface SipOutboundTrunkUpdateOptions {
|
|
|
200
204
|
destinationCountry?: string;
|
|
201
205
|
name?: string;
|
|
202
206
|
metadata?: string;
|
|
207
|
+
mediaEncryption?: SIPMediaEncryption;
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
export interface TransferSipParticipantOptions {
|
|
@@ -306,6 +311,7 @@ export class SipClient extends ServiceBase {
|
|
|
306
311
|
headersToAttributes: opts.headersToAttributes,
|
|
307
312
|
includeHeaders: opts.includeHeaders,
|
|
308
313
|
krispEnabled: opts.krispEnabled,
|
|
314
|
+
mediaEncryption: opts.mediaEncryption,
|
|
309
315
|
}),
|
|
310
316
|
}).toJson();
|
|
311
317
|
|
|
@@ -352,6 +358,7 @@ export class SipClient extends ServiceBase {
|
|
|
352
358
|
headersToAttributes: opts.headersToAttributes,
|
|
353
359
|
includeHeaders: opts.includeHeaders,
|
|
354
360
|
destinationCountry: opts.destinationCountry,
|
|
361
|
+
mediaEncryption: opts.mediaEncryption,
|
|
355
362
|
}),
|
|
356
363
|
}).toJson();
|
|
357
364
|
|