livekit-server-sdk 2.15.5 → 2.17.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/AgentDispatchClient.cjs +5 -3
- package/dist/AgentDispatchClient.cjs.map +1 -1
- package/dist/AgentDispatchClient.js +5 -3
- package/dist/AgentDispatchClient.js.map +1 -1
- package/dist/ClientOptions.cjs.map +1 -1
- package/dist/ClientOptions.d.cts +12 -0
- package/dist/ClientOptions.d.ts +12 -0
- package/dist/ClientOptions.d.ts.map +1 -1
- package/dist/ConnectorClient.cjs +9 -5
- package/dist/ConnectorClient.cjs.map +1 -1
- package/dist/ConnectorClient.d.cts +6 -3
- package/dist/ConnectorClient.d.ts +6 -3
- package/dist/ConnectorClient.d.ts.map +1 -1
- package/dist/ConnectorClient.js +9 -5
- package/dist/ConnectorClient.js.map +1 -1
- package/dist/EgressClient.cjs +5 -3
- package/dist/EgressClient.cjs.map +1 -1
- package/dist/EgressClient.js +5 -3
- package/dist/EgressClient.js.map +1 -1
- package/dist/IngressClient.cjs +5 -3
- package/dist/IngressClient.cjs.map +1 -1
- package/dist/IngressClient.js +5 -3
- package/dist/IngressClient.js.map +1 -1
- package/dist/LiveKitAPI.cjs +80 -0
- package/dist/LiveKitAPI.cjs.map +1 -0
- package/dist/LiveKitAPI.d.cts +77 -0
- package/dist/LiveKitAPI.d.ts +77 -0
- package/dist/LiveKitAPI.d.ts.map +1 -0
- package/dist/LiveKitAPI.js +56 -0
- package/dist/LiveKitAPI.js.map +1 -0
- package/dist/RoomServiceClient.cjs +5 -3
- package/dist/RoomServiceClient.cjs.map +1 -1
- package/dist/RoomServiceClient.js +5 -3
- package/dist/RoomServiceClient.js.map +1 -1
- package/dist/ServiceBase.cjs +9 -9
- package/dist/ServiceBase.cjs.map +1 -1
- package/dist/ServiceBase.d.cts +20 -1
- package/dist/ServiceBase.d.ts +20 -1
- package/dist/ServiceBase.d.ts.map +1 -1
- package/dist/ServiceBase.js +9 -9
- package/dist/ServiceBase.js.map +1 -1
- package/dist/SipClient.cjs +56 -21
- package/dist/SipClient.cjs.map +1 -1
- package/dist/SipClient.d.cts +22 -4
- package/dist/SipClient.d.ts +22 -4
- package/dist/SipClient.d.ts.map +1 -1
- package/dist/SipClient.js +58 -22
- package/dist/SipClient.js.map +1 -1
- package/dist/TwirpRPC.cjs +135 -48
- package/dist/TwirpRPC.cjs.map +1 -1
- package/dist/TwirpRPC.d.cts +38 -2
- package/dist/TwirpRPC.d.ts +38 -2
- package/dist/TwirpRPC.d.ts.map +1 -1
- package/dist/TwirpRPC.js +140 -38
- package/dist/TwirpRPC.js.map +1 -1
- package/dist/dialTimeout.cjs +39 -0
- package/dist/dialTimeout.cjs.map +1 -0
- package/dist/dialTimeout.d.cts +21 -0
- package/dist/dialTimeout.d.ts +21 -0
- package/dist/dialTimeout.d.ts.map +1 -0
- package/dist/dialTimeout.js +13 -0
- package/dist/dialTimeout.js.map +1 -0
- package/dist/failover.cjs +139 -0
- package/dist/failover.cjs.map +1 -0
- package/dist/failover.d.cts +30 -0
- package/dist/failover.d.ts +30 -0
- package/dist/failover.d.ts.map +1 -0
- package/dist/failover.js +107 -0
- package/dist/failover.js.map +1 -0
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/version.cjs +29 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.cts +3 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -3
- package/src/AgentDispatchClient.ts +5 -5
- package/src/ClientOptions.ts +12 -0
- package/src/ConnectorClient.ts +20 -11
- package/src/EgressClient.ts +5 -5
- package/src/IngressClient.ts +5 -5
- package/src/LiveKitAPI.ts +126 -0
- package/src/RoomServiceClient.ts +5 -5
- package/src/ServiceBase.ts +35 -4
- package/src/SipClient.ts +89 -24
- package/src/TwirpRPC.test.ts +42 -0
- package/src/TwirpRPC.ts +187 -39
- package/src/dialTimeout.test.ts +41 -0
- package/src/dialTimeout.ts +37 -0
- package/src/failover.test.ts +188 -0
- package/src/failover.ts +170 -0
- package/src/index.ts +4 -1
- package/src/version.ts +1 -0
package/dist/failover.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const FAILOVER_MAX_ATTEMPTS = 3;
|
|
2
|
+
const FAILOVER_BACKOFF_BASE_MS = 200;
|
|
3
|
+
const MIN_FAILOVER_TIMEOUT_SECONDS = 5;
|
|
4
|
+
function failoverAttempts(enabled, hostname, force = false, timeoutSeconds = 0) {
|
|
5
|
+
if (!enabled || !(force || isCloud(hostname))) {
|
|
6
|
+
return 1;
|
|
7
|
+
}
|
|
8
|
+
if (timeoutSeconds > 0 && timeoutSeconds < MIN_FAILOVER_TIMEOUT_SECONDS) {
|
|
9
|
+
return 1;
|
|
10
|
+
}
|
|
11
|
+
return FAILOVER_MAX_ATTEMPTS;
|
|
12
|
+
}
|
|
13
|
+
function isCloud(hostname) {
|
|
14
|
+
return hostname.endsWith(".livekit.cloud");
|
|
15
|
+
}
|
|
16
|
+
function toHttp(url) {
|
|
17
|
+
return url.startsWith("ws") ? `http${url.slice(2)}` : url;
|
|
18
|
+
}
|
|
19
|
+
function hostKey(url) {
|
|
20
|
+
return url.host.toLowerCase();
|
|
21
|
+
}
|
|
22
|
+
function pickNext(regionOrigins2, attempted) {
|
|
23
|
+
for (const origin of regionOrigins2) {
|
|
24
|
+
try {
|
|
25
|
+
if (!attempted.has(hostKey(new URL(origin)))) {
|
|
26
|
+
return origin;
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
function sleep(ms) {
|
|
34
|
+
return ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve();
|
|
35
|
+
}
|
|
36
|
+
const regionCache = /* @__PURE__ */ new Map();
|
|
37
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
38
|
+
async function regionOrigins(origin, headers) {
|
|
39
|
+
const key = hostKey(origin);
|
|
40
|
+
const cached = regionCache.get(key);
|
|
41
|
+
if (cached && Date.now() - cached.fetchedAt < cached.ttl) {
|
|
42
|
+
return cached.origins;
|
|
43
|
+
}
|
|
44
|
+
const existing = inflight.get(key);
|
|
45
|
+
if (existing) {
|
|
46
|
+
return existing;
|
|
47
|
+
}
|
|
48
|
+
const request = (async () => {
|
|
49
|
+
try {
|
|
50
|
+
const { origins, ttl } = await fetchRegions(origin, headers);
|
|
51
|
+
if (ttl > 0) {
|
|
52
|
+
regionCache.set(key, { origins, fetchedAt: Date.now(), ttl });
|
|
53
|
+
}
|
|
54
|
+
return origins;
|
|
55
|
+
} catch {
|
|
56
|
+
return (cached == null ? void 0 : cached.origins) ?? [];
|
|
57
|
+
} finally {
|
|
58
|
+
inflight.delete(key);
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
inflight.set(key, request);
|
|
62
|
+
return request;
|
|
63
|
+
}
|
|
64
|
+
async function fetchRegions(origin, headers) {
|
|
65
|
+
const fetchHeaders = {};
|
|
66
|
+
for (const [k, v] of Object.entries(headers ?? {})) {
|
|
67
|
+
if (k.toLowerCase() === "content-type" || k.toLowerCase() === "content-length") continue;
|
|
68
|
+
fetchHeaders[k] = v;
|
|
69
|
+
}
|
|
70
|
+
const response = await fetch(new URL("/settings/regions", origin.origin), {
|
|
71
|
+
method: "GET",
|
|
72
|
+
headers: fetchHeaders,
|
|
73
|
+
// Short timeout so a slow/unreachable discovery endpoint doesn't stall the
|
|
74
|
+
// failover path.
|
|
75
|
+
signal: AbortSignal.timeout(2e3)
|
|
76
|
+
});
|
|
77
|
+
if (!response.ok) {
|
|
78
|
+
throw new Error(`region discovery failed: ${response.status}`);
|
|
79
|
+
}
|
|
80
|
+
const ttl = parseMaxAge(response.headers.get("cache-control"));
|
|
81
|
+
const body = await response.json();
|
|
82
|
+
const origins = (body.regions ?? []).filter((r) => !!r.url).map((r) => new URL(toHttp(r.url)).origin);
|
|
83
|
+
return { origins, ttl };
|
|
84
|
+
}
|
|
85
|
+
function parseMaxAge(cacheControl) {
|
|
86
|
+
if (!cacheControl) return 0;
|
|
87
|
+
for (const directive of cacheControl.split(",")) {
|
|
88
|
+
const trimmed = directive.trim().toLowerCase();
|
|
89
|
+
if (trimmed.startsWith("max-age=")) {
|
|
90
|
+
const secs = parseInt(trimmed.slice("max-age=".length), 10);
|
|
91
|
+
return Number.isFinite(secs) && secs > 0 ? secs * 1e3 : 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
FAILOVER_BACKOFF_BASE_MS,
|
|
98
|
+
FAILOVER_MAX_ATTEMPTS,
|
|
99
|
+
MIN_FAILOVER_TIMEOUT_SECONDS,
|
|
100
|
+
failoverAttempts,
|
|
101
|
+
hostKey,
|
|
102
|
+
parseMaxAge,
|
|
103
|
+
pickNext,
|
|
104
|
+
regionOrigins,
|
|
105
|
+
sleep
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=failover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/failover.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// Region failover for the Twirp API clients.\n//\n// On a retryable failure (any transport error or HTTP 5xx) the client discovers\n// alternative LiveKit Cloud regions via /settings/regions and replays the\n// request against the next region, with exponential backoff. 4xx responses are\n// returned immediately.\n\n// Total attempts (the original request + fallback regions) and the base retry\n// backoff are fixed, not user-configurable, so retries can't be tuned to values\n// that could overwhelm the server.\nexport const FAILOVER_MAX_ATTEMPTS = 3;\nexport const FAILOVER_BACKOFF_BASE_MS = 200;\n// Below this per-request timeout, a retry is unlikely to help and many clients\n// would retry in lockstep across regions, so a short request gets a single\n// attempt (thundering-herd guard).\nexport const MIN_FAILOVER_TIMEOUT_SECONDS = 5;\n\n/**\n * Total request attempts for a host; 1 means no failover. Failover only engages\n * when enabled, the host is a LiveKit Cloud domain, and the request timeout is\n * long enough to retry. `force` bypasses the cloud-host check (test-only).\n */\nexport function failoverAttempts(\n enabled: boolean,\n hostname: string,\n force = false,\n timeoutSeconds = 0,\n): number {\n if (!enabled || !(force || isCloud(hostname))) {\n return 1;\n }\n if (timeoutSeconds > 0 && timeoutSeconds < MIN_FAILOVER_TIMEOUT_SECONDS) {\n return 1;\n }\n return FAILOVER_MAX_ATTEMPTS;\n}\n\n// Failover only engages for LiveKit Cloud project domains.\nfunction isCloud(hostname: string): boolean {\n return hostname.endsWith('.livekit.cloud');\n}\n\n/** Normalizes a region URL to an http(s) scheme (ws -> http, wss -> https). */\nfunction toHttp(url: string): string {\n return url.startsWith('ws') ? `http${url.slice(2)}` : url;\n}\n\n/** A stable key identifying a host (including port) for dedup across attempts. */\nexport function hostKey(url: URL): string {\n return url.host.toLowerCase();\n}\n\n/** Returns the first region origin whose host has not yet been attempted. */\nexport function pickNext(regionOrigins: string[], attempted: Set<string>): string | undefined {\n for (const origin of regionOrigins) {\n try {\n if (!attempted.has(hostKey(new URL(origin)))) {\n return origin;\n }\n } catch {\n // skip malformed URLs\n }\n }\n return undefined;\n}\n\nexport function sleep(ms: number): Promise<void> {\n return ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve();\n}\n\ntype CacheEntry = {\n origins: string[];\n fetchedAt: number;\n ttl: number; // ms\n};\n\n// Shared across all clients in the process so the region list is fetched once.\nconst regionCache = new Map<string, CacheEntry>();\n// Coalesces concurrent discovery fetches per origin: while one /settings/regions\n// request is in flight, other callers for the same origin await its result\n// rather than issuing their own (avoids a thundering herd when many requests\n// fail over at once).\nconst inflight = new Map<string, Promise<string[]>>();\n\n/**\n * Returns alternative region origins for `origin`, fetching /settings/regions\n * if the cache is stale. Best-effort: on a fetch failure it serves a stale\n * cached list when available, otherwise an empty list. Forwards `headers` so a\n * valid token — and any test directives — reach the discovery endpoint.\n */\nexport async function regionOrigins(origin: URL, headers: unknown): Promise<string[]> {\n const key = hostKey(origin);\n const cached = regionCache.get(key);\n if (cached && Date.now() - cached.fetchedAt < cached.ttl) {\n return cached.origins;\n }\n\n const existing = inflight.get(key);\n if (existing) {\n return existing;\n }\n const request = (async () => {\n try {\n const { origins, ttl } = await fetchRegions(origin, headers);\n // A zero TTL (e.g. Cache-Control: max-age=0) means \"do not cache\".\n if (ttl > 0) {\n regionCache.set(key, { origins, fetchedAt: Date.now(), ttl });\n }\n return origins;\n } catch {\n return cached?.origins ?? [];\n } finally {\n inflight.delete(key);\n }\n })();\n\n inflight.set(key, request);\n return request;\n}\n\nasync function fetchRegions(\n origin: URL,\n headers: unknown,\n): Promise<{ origins: string[]; ttl: number }> {\n // Forward the caller's headers (auth + any custom), minus body-specific ones.\n const fetchHeaders: Record<string, string> = {};\n for (const [k, v] of Object.entries((headers as Record<string, string>) ?? {})) {\n if (k.toLowerCase() === 'content-type' || k.toLowerCase() === 'content-length') continue;\n fetchHeaders[k] = v;\n }\n\n const response = await fetch(new URL('/settings/regions', origin.origin), {\n method: 'GET',\n headers: fetchHeaders,\n // Short timeout so a slow/unreachable discovery endpoint doesn't stall the\n // failover path.\n signal: AbortSignal.timeout(2000),\n });\n if (!response.ok) {\n throw new Error(`region discovery failed: ${response.status}`);\n }\n const ttl = parseMaxAge(response.headers.get('cache-control'));\n const body = (await response.json()) as { regions?: Array<{ url?: string }> };\n const origins = (body.regions ?? [])\n .filter((r) => !!r.url)\n .map((r) => new URL(toHttp(r.url!)).origin);\n return { origins, ttl };\n}\n\n/**\n * Returns the `max-age` from a Cache-Control header in milliseconds, or 0 when\n * absent, non-positive, or unparseable (meaning \"do not cache\"). Only `max-age`\n * is honored; other directives (including `s-maxage`, which targets shared\n * proxies) are ignored.\n */\nexport function parseMaxAge(cacheControl: string | null): number {\n if (!cacheControl) return 0;\n for (const directive of cacheControl.split(',')) {\n const trimmed = directive.trim().toLowerCase();\n if (trimmed.startsWith('max-age=')) {\n const secs = parseInt(trimmed.slice('max-age='.length), 10);\n return Number.isFinite(secs) && secs > 0 ? secs * 1000 : 0;\n }\n }\n return 0;\n}\n"],"mappings":"AAcO,MAAM,wBAAwB;AAC9B,MAAM,2BAA2B;AAIjC,MAAM,+BAA+B;AAOrC,SAAS,iBACd,SACA,UACA,QAAQ,OACR,iBAAiB,GACT;AACR,MAAI,CAAC,WAAW,EAAE,SAAS,QAAQ,QAAQ,IAAI;AAC7C,WAAO;AAAA,EACT;AACA,MAAI,iBAAiB,KAAK,iBAAiB,8BAA8B;AACvE,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGA,SAAS,QAAQ,UAA2B;AAC1C,SAAO,SAAS,SAAS,gBAAgB;AAC3C;AAGA,SAAS,OAAO,KAAqB;AACnC,SAAO,IAAI,WAAW,IAAI,IAAI,OAAO,IAAI,MAAM,CAAC,CAAC,KAAK;AACxD;AAGO,SAAS,QAAQ,KAAkB;AACxC,SAAO,IAAI,KAAK,YAAY;AAC9B;AAGO,SAAS,SAASA,gBAAyB,WAA4C;AAC5F,aAAW,UAAUA,gBAAe;AAClC,QAAI;AACF,UAAI,CAAC,UAAU,IAAI,QAAQ,IAAI,IAAI,MAAM,CAAC,CAAC,GAAG;AAC5C,eAAO;AAAA,MACT;AAAA,IACF,QAAQ;AAAA,IAER;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,MAAM,IAA2B;AAC/C,SAAO,KAAK,IAAI,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC,IAAI,QAAQ,QAAQ;AACtF;AASA,MAAM,cAAc,oBAAI,IAAwB;AAKhD,MAAM,WAAW,oBAAI,IAA+B;AAQpD,eAAsB,cAAc,QAAa,SAAqC;AACpF,QAAM,MAAM,QAAQ,MAAM;AAC1B,QAAM,SAAS,YAAY,IAAI,GAAG;AAClC,MAAI,UAAU,KAAK,IAAI,IAAI,OAAO,YAAY,OAAO,KAAK;AACxD,WAAO,OAAO;AAAA,EAChB;AAEA,QAAM,WAAW,SAAS,IAAI,GAAG;AACjC,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,QAAM,WAAW,YAAY;AAC3B,QAAI;AACF,YAAM,EAAE,SAAS,IAAI,IAAI,MAAM,aAAa,QAAQ,OAAO;AAE3D,UAAI,MAAM,GAAG;AACX,oBAAY,IAAI,KAAK,EAAE,SAAS,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;AAAA,MAC9D;AACA,aAAO;AAAA,IACT,QAAQ;AACN,cAAO,iCAAQ,YAAW,CAAC;AAAA,IAC7B,UAAE;AACA,eAAS,OAAO,GAAG;AAAA,IACrB;AAAA,EACF,GAAG;AAEH,WAAS,IAAI,KAAK,OAAO;AACzB,SAAO;AACT;AAEA,eAAe,aACb,QACA,SAC6C;AAE7C,QAAM,eAAuC,CAAC;AAC9C,aAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAS,WAAsC,CAAC,CAAC,GAAG;AAC9E,QAAI,EAAE,YAAY,MAAM,kBAAkB,EAAE,YAAY,MAAM,iBAAkB;AAChF,iBAAa,CAAC,IAAI;AAAA,EACpB;AAEA,QAAM,WAAW,MAAM,MAAM,IAAI,IAAI,qBAAqB,OAAO,MAAM,GAAG;AAAA,IACxE,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA;AAAA,IAGT,QAAQ,YAAY,QAAQ,GAAI;AAAA,EAClC,CAAC;AACD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,MAAM,4BAA4B,SAAS,MAAM,EAAE;AAAA,EAC/D;AACA,QAAM,MAAM,YAAY,SAAS,QAAQ,IAAI,eAAe,CAAC;AAC7D,QAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,QAAM,WAAW,KAAK,WAAW,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EACrB,IAAI,CAAC,MAAM,IAAI,IAAI,OAAO,EAAE,GAAI,CAAC,EAAE,MAAM;AAC5C,SAAO,EAAE,SAAS,IAAI;AACxB;AAQO,SAAS,YAAY,cAAqC;AAC/D,MAAI,CAAC,aAAc,QAAO;AAC1B,aAAW,aAAa,aAAa,MAAM,GAAG,GAAG;AAC/C,UAAM,UAAU,UAAU,KAAK,EAAE,YAAY;AAC7C,QAAI,QAAQ,WAAW,UAAU,GAAG;AAClC,YAAM,OAAO,SAAS,QAAQ,MAAM,WAAW,MAAM,GAAG,EAAE;AAC1D,aAAO,OAAO,SAAS,IAAI,KAAK,OAAO,IAAI,OAAO,MAAO;AAAA,IAC3D;AAAA,EACF;AACA,SAAO;AACT;","names":["regionOrigins"]}
|
package/dist/index.cjs
CHANGED
|
@@ -66,6 +66,7 @@ __export(index_exports, {
|
|
|
66
66
|
S3Upload: () => import_protocol.S3Upload,
|
|
67
67
|
SIPCallStatus: () => import_protocol.SIPCallStatus,
|
|
68
68
|
SIPDispatchRule: () => import_protocol.SIPDispatchRule,
|
|
69
|
+
SIPDispatchRuleCallee: () => import_protocol.SIPDispatchRuleCallee,
|
|
69
70
|
SIPDispatchRuleDirect: () => import_protocol.SIPDispatchRuleDirect,
|
|
70
71
|
SIPDispatchRuleIndividual: () => import_protocol.SIPDispatchRuleIndividual,
|
|
71
72
|
SIPDispatchRuleInfo: () => import_protocol.SIPDispatchRuleInfo,
|
|
@@ -75,7 +76,9 @@ __export(index_exports, {
|
|
|
75
76
|
SIPTrunkInfo: () => import_protocol.SIPTrunkInfo,
|
|
76
77
|
SegmentedFileOutput: () => import_protocol.SegmentedFileOutput,
|
|
77
78
|
SegmentedFileProtocol: () => import_protocol.SegmentedFileProtocol,
|
|
79
|
+
ServerError: () => import_TwirpRPC.ServerError,
|
|
78
80
|
SessionDescription: () => import_protocol.SessionDescription,
|
|
81
|
+
SipCallError: () => import_TwirpRPC.SipCallError,
|
|
79
82
|
StreamOutput: () => import_protocol.StreamOutput,
|
|
80
83
|
StreamProtocol: () => import_protocol.StreamProtocol,
|
|
81
84
|
TrackCompositeEgressRequest: () => import_protocol.TrackCompositeEgressRequest,
|
|
@@ -96,6 +99,7 @@ __reExport(index_exports, require("./ConnectorClient.cjs"), module.exports);
|
|
|
96
99
|
__reExport(index_exports, require("./EgressClient.cjs"), module.exports);
|
|
97
100
|
__reExport(index_exports, require("./grants.cjs"), module.exports);
|
|
98
101
|
__reExport(index_exports, require("./IngressClient.cjs"), module.exports);
|
|
102
|
+
__reExport(index_exports, require("./LiveKitAPI.cjs"), module.exports);
|
|
99
103
|
__reExport(index_exports, require("./RoomServiceClient.cjs"), module.exports);
|
|
100
104
|
__reExport(index_exports, require("./SipClient.cjs"), module.exports);
|
|
101
105
|
var import_TwirpRPC = require("./TwirpRPC.cjs");
|
|
@@ -149,6 +153,7 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
149
153
|
S3Upload,
|
|
150
154
|
SIPCallStatus,
|
|
151
155
|
SIPDispatchRule,
|
|
156
|
+
SIPDispatchRuleCallee,
|
|
152
157
|
SIPDispatchRuleDirect,
|
|
153
158
|
SIPDispatchRuleIndividual,
|
|
154
159
|
SIPDispatchRuleInfo,
|
|
@@ -158,7 +163,9 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
158
163
|
SIPTrunkInfo,
|
|
159
164
|
SegmentedFileOutput,
|
|
160
165
|
SegmentedFileProtocol,
|
|
166
|
+
ServerError,
|
|
161
167
|
SessionDescription,
|
|
168
|
+
SipCallError,
|
|
162
169
|
StreamOutput,
|
|
163
170
|
StreamProtocol,
|
|
164
171
|
TrackCompositeEgressRequest,
|
|
@@ -176,6 +183,7 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
176
183
|
...require("./EgressClient.cjs"),
|
|
177
184
|
...require("./grants.cjs"),
|
|
178
185
|
...require("./IngressClient.cjs"),
|
|
186
|
+
...require("./LiveKitAPI.cjs"),
|
|
179
187
|
...require("./RoomServiceClient.cjs"),
|
|
180
188
|
...require("./SipClient.cjs"),
|
|
181
189
|
...require("./WebhookReceiver.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 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":";;;;;;;;;;;;;;;;;;;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;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 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 SIPDispatchRuleCallee,\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 './LiveKitAPI.js';\nexport * from './RoomServiceClient.js';\nexport * from './SipClient.js';\nexport { ServerError, SipCallError, TwirpError } from './TwirpRPC.js';\nexport type { ClientOptions } from './ClientOptions.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;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,sBAqEO;AACP,0BAAc,6BA1Ed;AA2EA,0BAAc,qCA3Ed;AA4EA,0BAAc,iCA5Ed;AA6EA,0BAAc,8BA7Ed;AA8EA,0BAAc,wBA9Ed;AA+EA,0BAAc,+BA/Ed;AAgFA,0BAAc,4BAhFd;AAiFA,0BAAc,mCAjFd;AAkFA,0BAAc,2BAlFd;AAmFA,sBAAsD;AAEtD,0BAAc,iCArFd;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export { AcceptWhatsAppCallResponse, AgentDispatch, AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, ConnectTwilioCallRequest_TwilioCallDirection, ConnectTwilioCallResponse, ConnectWhatsAppCallResponse, DataPacket_Kind, DialWhatsAppCallResponse, DirectFileOutput, DisconnectWhatsAppCallRequest_DisconnectReason, DisconnectWhatsAppCallResponse, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, JobRestartPolicy, 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';
|
|
1
|
+
export { AcceptWhatsAppCallResponse, AgentDispatch, AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, ConnectTwilioCallRequest_TwilioCallDirection, ConnectTwilioCallResponse, ConnectWhatsAppCallResponse, DataPacket_Kind, DialWhatsAppCallResponse, DirectFileOutput, DisconnectWhatsAppCallRequest_DisconnectReason, DisconnectWhatsAppCallResponse, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, JobRestartPolicy, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomConfiguration, RoomEgress, S3Upload, SIPCallStatus, SIPDispatchRule, SIPDispatchRuleCallee, 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
4
|
export { AcceptWhatsAppCallOptions, ConnectTwilioCallOptions, ConnectorClient, DialWhatsAppCallOptions } from './ConnectorClient.cjs';
|
|
5
5
|
export { BaseOptions, EgressClient, EncodedOutputs, ListEgressOptions, ParticipantEgressOptions, RoomCompositeOptions, TrackCompositeOptions, WebOptions } from './EgressClient.cjs';
|
|
6
6
|
export { ClaimGrants, InferenceGrant, ObservabilityGrant, SIPGrant, VideoGrant, claimsToJwtPayload, trackSourceToString } from './grants.cjs';
|
|
7
7
|
export { CreateIngressOptions, IngressClient, ListIngressOptions, UpdateIngressOptions } from './IngressClient.cjs';
|
|
8
|
+
export { LiveKitAPI, LiveKitAPIOptions } from './LiveKitAPI.cjs';
|
|
8
9
|
export { CreateOptions, RemoveParticipantOptions, RoomServiceClient, SendDataOptions, UpdateParticipantOptions } from './RoomServiceClient.cjs';
|
|
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';
|
|
10
|
+
export { CreateSipDispatchRuleOptions, CreateSipInboundTrunkOptions, CreateSipOutboundTrunkOptions, CreateSipParticipantOptions, CreateSipTrunkOptions, ListSipDispatchRuleOptions, ListSipTrunkOptions, SipClient, SipDispatchRuleCallee, SipDispatchRuleDirect, SipDispatchRuleIndividual, SipDispatchRuleUpdateOptions, SipInboundTrunkUpdateOptions, SipOutboundTrunkUpdateOptions, TransferSipParticipantOptions } from './SipClient.cjs';
|
|
11
|
+
export { ServerError, SipCallError, TwirpError } from './TwirpRPC.cjs';
|
|
12
|
+
export { ClientOptions } from './ClientOptions.cjs';
|
|
11
13
|
export { WebhookEvent, WebhookEventNames, WebhookReceiver, authorizeHeader } from './WebhookReceiver.cjs';
|
|
12
|
-
import './ClientOptions.cjs';
|
|
13
14
|
import './ServiceBase.cjs';
|
|
14
15
|
import 'jose';
|
|
15
16
|
import '@bufbuild/protobuf';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export { AcceptWhatsAppCallResponse, AgentDispatch, AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, ConnectTwilioCallRequest_TwilioCallDirection, ConnectTwilioCallResponse, ConnectWhatsAppCallResponse, DataPacket_Kind, DialWhatsAppCallResponse, DirectFileOutput, DisconnectWhatsAppCallRequest_DisconnectReason, DisconnectWhatsAppCallResponse, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, JobRestartPolicy, 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';
|
|
1
|
+
export { AcceptWhatsAppCallResponse, AgentDispatch, AliOSSUpload, AudioCodec, AutoParticipantEgress, AutoTrackEgress, AzureBlobUpload, ConnectTwilioCallRequest_TwilioCallDirection, ConnectTwilioCallResponse, ConnectWhatsAppCallResponse, DataPacket_Kind, DialWhatsAppCallResponse, DirectFileOutput, DisconnectWhatsAppCallRequest_DisconnectReason, DisconnectWhatsAppCallResponse, EgressInfo, EgressStatus, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, JobRestartPolicy, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomConfiguration, RoomEgress, S3Upload, SIPCallStatus, SIPDispatchRule, SIPDispatchRuleCallee, 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.js';
|
|
3
3
|
export { AgentDispatchClient } from './AgentDispatchClient.js';
|
|
4
4
|
export { AcceptWhatsAppCallOptions, ConnectTwilioCallOptions, ConnectorClient, DialWhatsAppCallOptions } from './ConnectorClient.js';
|
|
5
5
|
export { BaseOptions, EgressClient, EncodedOutputs, ListEgressOptions, ParticipantEgressOptions, RoomCompositeOptions, TrackCompositeOptions, WebOptions } from './EgressClient.js';
|
|
6
6
|
export { ClaimGrants, InferenceGrant, ObservabilityGrant, SIPGrant, VideoGrant, claimsToJwtPayload, trackSourceToString } from './grants.js';
|
|
7
7
|
export { CreateIngressOptions, IngressClient, ListIngressOptions, UpdateIngressOptions } from './IngressClient.js';
|
|
8
|
+
export { LiveKitAPI, LiveKitAPIOptions } from './LiveKitAPI.js';
|
|
8
9
|
export { CreateOptions, RemoveParticipantOptions, RoomServiceClient, SendDataOptions, UpdateParticipantOptions } from './RoomServiceClient.js';
|
|
9
|
-
export { CreateSipDispatchRuleOptions, CreateSipInboundTrunkOptions, CreateSipOutboundTrunkOptions, CreateSipParticipantOptions, CreateSipTrunkOptions, ListSipDispatchRuleOptions, ListSipTrunkOptions, SipClient, SipDispatchRuleDirect, SipDispatchRuleIndividual, SipDispatchRuleUpdateOptions, SipInboundTrunkUpdateOptions, SipOutboundTrunkUpdateOptions, TransferSipParticipantOptions } from './SipClient.js';
|
|
10
|
-
export { TwirpError } from './TwirpRPC.js';
|
|
10
|
+
export { CreateSipDispatchRuleOptions, CreateSipInboundTrunkOptions, CreateSipOutboundTrunkOptions, CreateSipParticipantOptions, CreateSipTrunkOptions, ListSipDispatchRuleOptions, ListSipTrunkOptions, SipClient, SipDispatchRuleCallee, SipDispatchRuleDirect, SipDispatchRuleIndividual, SipDispatchRuleUpdateOptions, SipInboundTrunkUpdateOptions, SipOutboundTrunkUpdateOptions, TransferSipParticipantOptions } from './SipClient.js';
|
|
11
|
+
export { ServerError, SipCallError, TwirpError } from './TwirpRPC.js';
|
|
12
|
+
export { ClientOptions } from './ClientOptions.js';
|
|
11
13
|
export { WebhookEvent, WebhookEventNames, WebhookReceiver, authorizeHeader } from './WebhookReceiver.js';
|
|
12
|
-
import './ClientOptions.js';
|
|
13
14
|
import './ServiceBase.js';
|
|
14
15
|
import 'jose';
|
|
15
16
|
import '@bufbuild/protobuf';
|
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,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,8CAA8C,EAC9C,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,gBAAgB,EAChB,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;
|
|
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,8CAA8C,EAC9C,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,gBAAgB,EAChB,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,qBAAqB,EACrB,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,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
SIPDispatchRuleInfo,
|
|
50
50
|
SIPDispatchRuleDirect,
|
|
51
51
|
SIPDispatchRuleIndividual,
|
|
52
|
+
SIPDispatchRuleCallee,
|
|
52
53
|
SIPParticipantInfo,
|
|
53
54
|
SIPOutboundTrunkInfo,
|
|
54
55
|
SIPInboundTrunkInfo,
|
|
@@ -73,9 +74,10 @@ export * from "./ConnectorClient.js";
|
|
|
73
74
|
export * from "./EgressClient.js";
|
|
74
75
|
export * from "./grants.js";
|
|
75
76
|
export * from "./IngressClient.js";
|
|
77
|
+
export * from "./LiveKitAPI.js";
|
|
76
78
|
export * from "./RoomServiceClient.js";
|
|
77
79
|
export * from "./SipClient.js";
|
|
78
|
-
import { TwirpError } from "./TwirpRPC.js";
|
|
80
|
+
import { ServerError, SipCallError, TwirpError } from "./TwirpRPC.js";
|
|
79
81
|
export * from "./WebhookReceiver.js";
|
|
80
82
|
export {
|
|
81
83
|
AcceptWhatsAppCallResponse,
|
|
@@ -125,6 +127,7 @@ export {
|
|
|
125
127
|
S3Upload,
|
|
126
128
|
SIPCallStatus,
|
|
127
129
|
SIPDispatchRule,
|
|
130
|
+
SIPDispatchRuleCallee,
|
|
128
131
|
SIPDispatchRuleDirect,
|
|
129
132
|
SIPDispatchRuleIndividual,
|
|
130
133
|
SIPDispatchRuleInfo,
|
|
@@ -134,7 +137,9 @@ export {
|
|
|
134
137
|
SIPTrunkInfo,
|
|
135
138
|
SegmentedFileOutput,
|
|
136
139
|
SegmentedFileProtocol,
|
|
140
|
+
ServerError,
|
|
137
141
|
SessionDescription,
|
|
142
|
+
SipCallError,
|
|
138
143
|
StreamOutput,
|
|
139
144
|
StreamProtocol,
|
|
140
145
|
TrackCompositeEgressRequest,
|
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 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;
|
|
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 SIPDispatchRuleCallee,\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 './LiveKitAPI.js';\nexport * from './RoomServiceClient.js';\nexport * from './SipClient.js';\nexport { ServerError, SipCallError, TwirpError } from './TwirpRPC.js';\nexport type { ClientOptions } from './ClientOptions.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,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,aAAa,cAAc,kBAAkB;AAEtD,cAAc;","names":[]}
|
package/dist/version.cjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var version_exports = {};
|
|
20
|
+
__export(version_exports, {
|
|
21
|
+
SDK_VERSION: () => SDK_VERSION
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(version_exports);
|
|
24
|
+
const SDK_VERSION = "2.17.0";
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
SDK_VERSION
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=version.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const SDK_VERSION = \"2.17.0\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,WAAW,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const SDK_VERSION = \"2.17.0\";\n"],"mappings":"AAAO,MAAM,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livekit-server-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "Server-side SDK for LiveKit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"require": "dist/index.cjs",
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@bufbuild/protobuf": "^1.10.1",
|
|
34
|
-
"@livekit/protocol": "^1.
|
|
35
|
-
"camelcase-keys": "^9.0.0",
|
|
34
|
+
"@livekit/protocol": "^1.48.0",
|
|
36
35
|
"jose": "^5.1.2"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
@@ -52,6 +51,7 @@
|
|
|
52
51
|
"node": ">=18"
|
|
53
52
|
},
|
|
54
53
|
"scripts": {
|
|
54
|
+
"prebuild": "node -p \"'export const SDK_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
|
|
55
55
|
"build": "tsup --onSuccess \"tsc -p tsconfig.json --declaration --emitDeclarationOnly --skipLibCheck\"",
|
|
56
56
|
"build:watch": "tsc --watch",
|
|
57
57
|
"build-docs": "typedoc",
|
|
@@ -39,11 +39,11 @@ export class AgentDispatchClient extends ServiceBase {
|
|
|
39
39
|
* @param options - client options
|
|
40
40
|
*/
|
|
41
41
|
constructor(host: string, apiKey?: string, secret?: string, options?: ClientOptions) {
|
|
42
|
-
super(apiKey, secret);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
:
|
|
46
|
-
|
|
42
|
+
super({ apiKey, secret, token: options?.token });
|
|
43
|
+
this.rpc = new TwirpRpc(host, livekitPackage, {
|
|
44
|
+
requestTimeout: options?.requestTimeout,
|
|
45
|
+
failover: options?.failover,
|
|
46
|
+
});
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
package/src/ClientOptions.ts
CHANGED
|
@@ -10,4 +10,16 @@ export type ClientOptions = {
|
|
|
10
10
|
* Optional timeout, in seconds, for all server requests
|
|
11
11
|
*/
|
|
12
12
|
requestTimeout?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to fail over to alternative regions on retryable errors (LiveKit
|
|
15
|
+
* Cloud hosts only). Defaults to true; set to false to disable.
|
|
16
|
+
*/
|
|
17
|
+
failover?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A pre-signed access token, sent verbatim as the Authorization header on
|
|
20
|
+
* every request instead of signing one per call from an API key and secret.
|
|
21
|
+
* The token must already carry the grants for the calls it's used with; since
|
|
22
|
+
* it needs no secret, the client can run client-side.
|
|
23
|
+
*/
|
|
24
|
+
token?: string;
|
|
13
25
|
};
|
package/src/ConnectorClient.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import type { ClientOptions } from './ClientOptions.js';
|
|
24
24
|
import { ServiceBase } from './ServiceBase.js';
|
|
25
25
|
import { type Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js';
|
|
26
|
+
import { DEFAULT_RINGING_TIMEOUT_SECONDS } from './dialTimeout.js';
|
|
26
27
|
|
|
27
28
|
const svc = 'Connector';
|
|
28
29
|
|
|
@@ -83,10 +84,13 @@ export interface AcceptWhatsAppCallOptions {
|
|
|
83
84
|
participantAttributes?: { [key: string]: string };
|
|
84
85
|
/** Optional - Country where the call terminates as ISO 3166-1 alpha-2 */
|
|
85
86
|
destinationCountry?: string;
|
|
86
|
-
/** Optional -
|
|
87
|
-
ringingTimeout?: number;
|
|
88
|
-
/** Optional - Wait for the call to be answered before returning */
|
|
87
|
+
/** Optional - Wait until the inbound party joins before returning. */
|
|
89
88
|
waitUntilAnswered?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Optional - Request timeout in seconds. When `waitUntilAnswered` is set it
|
|
91
|
+
* defaults to the standard ring window; otherwise the client default applies.
|
|
92
|
+
*/
|
|
93
|
+
timeout?: number;
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
// Twilio types
|
|
@@ -122,11 +126,11 @@ export class ConnectorClient extends ServiceBase {
|
|
|
122
126
|
* @param options - client options
|
|
123
127
|
*/
|
|
124
128
|
constructor(host: string, apiKey?: string, secret?: string, options?: ClientOptions) {
|
|
125
|
-
super(apiKey, secret);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
:
|
|
129
|
-
|
|
129
|
+
super({ apiKey, secret, token: options?.token });
|
|
130
|
+
this.rpc = new TwirpRpc(host, livekitPackage, {
|
|
131
|
+
requestTimeout: options?.requestTimeout,
|
|
132
|
+
failover: options?.failover,
|
|
133
|
+
});
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
/**
|
|
@@ -200,17 +204,22 @@ export class ConnectorClient extends ServiceBase {
|
|
|
200
204
|
participantMetadata,
|
|
201
205
|
participantAttributes: options.participantAttributes,
|
|
202
206
|
destinationCountry,
|
|
203
|
-
ringingTimeout: options.ringingTimeout
|
|
204
|
-
? new Duration({ seconds: BigInt(options.ringingTimeout) })
|
|
205
|
-
: undefined,
|
|
206
207
|
waitUntilAnswered: options.waitUntilAnswered,
|
|
207
208
|
}).toJson();
|
|
208
209
|
|
|
210
|
+
// When waiting for the inbound party to join, the request can block, so
|
|
211
|
+
// default the timeout to the standard ring window; otherwise the client
|
|
212
|
+
// default applies.
|
|
213
|
+
const timeout = options.waitUntilAnswered
|
|
214
|
+
? (options.timeout ?? DEFAULT_RINGING_TIMEOUT_SECONDS)
|
|
215
|
+
: options.timeout;
|
|
216
|
+
|
|
209
217
|
const data = await this.rpc.request(
|
|
210
218
|
svc,
|
|
211
219
|
'AcceptWhatsAppCall',
|
|
212
220
|
req,
|
|
213
221
|
await this.authHeader({ roomCreate: true }),
|
|
222
|
+
timeout,
|
|
214
223
|
);
|
|
215
224
|
return AcceptWhatsAppCallResponse.fromJson(data, { ignoreUnknownFields: true });
|
|
216
225
|
}
|
package/src/EgressClient.ts
CHANGED
|
@@ -141,11 +141,11 @@ export class EgressClient extends ServiceBase {
|
|
|
141
141
|
* @param options - client options
|
|
142
142
|
*/
|
|
143
143
|
constructor(host: string, apiKey?: string, secret?: string, options?: ClientOptions) {
|
|
144
|
-
super(apiKey, secret);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
:
|
|
148
|
-
|
|
144
|
+
super({ apiKey, secret, token: options?.token });
|
|
145
|
+
this.rpc = new TwirpRpc(host, livekitPackage, {
|
|
146
|
+
requestTimeout: options?.requestTimeout,
|
|
147
|
+
failover: options?.failover,
|
|
148
|
+
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/**
|
package/src/IngressClient.ts
CHANGED
|
@@ -128,11 +128,11 @@ export class IngressClient extends ServiceBase {
|
|
|
128
128
|
* @param options - client options
|
|
129
129
|
*/
|
|
130
130
|
constructor(host: string, apiKey?: string, secret?: string, options?: ClientOptions) {
|
|
131
|
-
super(apiKey, secret);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
:
|
|
135
|
-
|
|
131
|
+
super({ apiKey, secret, token: options?.token });
|
|
132
|
+
this.rpc = new TwirpRpc(host, livekitPackage, {
|
|
133
|
+
requestTimeout: options?.requestTimeout,
|
|
134
|
+
failover: options?.failover,
|
|
135
|
+
});
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/**
|