livekit-server-sdk 2.16.0 → 2.18.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/README.md +82 -15
- 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 +19 -3
- package/dist/EgressClient.cjs.map +1 -1
- package/dist/EgressClient.d.cts +7 -1
- package/dist/EgressClient.d.ts +7 -1
- package/dist/EgressClient.d.ts.map +1 -1
- package/dist/EgressClient.js +20 -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 +40 -19
- package/dist/SipClient.cjs.map +1 -1
- package/dist/SipClient.d.cts +4 -2
- package/dist/SipClient.d.ts +4 -2
- package/dist/SipClient.d.ts.map +1 -1
- package/dist/SipClient.js +41 -20
- 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 +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -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 +21 -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 +55 -23
- 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 +11 -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
|
@@ -40,6 +40,7 @@ __export(index_exports, {
|
|
|
40
40
|
EncodedFileType: () => import_protocol.EncodedFileType,
|
|
41
41
|
EncodingOptions: () => import_protocol.EncodingOptions,
|
|
42
42
|
EncodingOptionsPreset: () => import_protocol.EncodingOptionsPreset,
|
|
43
|
+
FileOutput: () => import_protocol.FileOutput,
|
|
43
44
|
GCPUpload: () => import_protocol.GCPUpload,
|
|
44
45
|
ImageCodec: () => import_protocol.ImageCodec,
|
|
45
46
|
ImageFileSuffix: () => import_protocol.ImageFileSuffix,
|
|
@@ -54,10 +55,13 @@ __export(index_exports, {
|
|
|
54
55
|
IngressVideoEncodingPreset: () => import_protocol.IngressVideoEncodingPreset,
|
|
55
56
|
IngressVideoOptions: () => import_protocol.IngressVideoOptions,
|
|
56
57
|
JobRestartPolicy: () => import_protocol.JobRestartPolicy,
|
|
58
|
+
MediaSource: () => import_protocol.MediaSource,
|
|
59
|
+
Output: () => import_protocol.Output,
|
|
57
60
|
ParticipantEgressRequest: () => import_protocol.ParticipantEgressRequest,
|
|
58
61
|
ParticipantInfo: () => import_protocol.ParticipantInfo,
|
|
59
62
|
ParticipantInfo_State: () => import_protocol.ParticipantInfo_State,
|
|
60
63
|
ParticipantPermission: () => import_protocol.ParticipantPermission,
|
|
64
|
+
ParticipantVideo: () => import_protocol.ParticipantVideo,
|
|
61
65
|
Room: () => import_protocol.Room,
|
|
62
66
|
RoomAgentDispatch: () => import_protocol.RoomAgentDispatch,
|
|
63
67
|
RoomCompositeEgressRequest: () => import_protocol.RoomCompositeEgressRequest,
|
|
@@ -76,9 +80,14 @@ __export(index_exports, {
|
|
|
76
80
|
SIPTrunkInfo: () => import_protocol.SIPTrunkInfo,
|
|
77
81
|
SegmentedFileOutput: () => import_protocol.SegmentedFileOutput,
|
|
78
82
|
SegmentedFileProtocol: () => import_protocol.SegmentedFileProtocol,
|
|
83
|
+
ServerError: () => import_TwirpRPC.ServerError,
|
|
79
84
|
SessionDescription: () => import_protocol.SessionDescription,
|
|
85
|
+
SipCallError: () => import_TwirpRPC.SipCallError,
|
|
86
|
+
StartEgressRequest: () => import_protocol.StartEgressRequest,
|
|
87
|
+
StorageConfig: () => import_protocol.StorageConfig,
|
|
80
88
|
StreamOutput: () => import_protocol.StreamOutput,
|
|
81
89
|
StreamProtocol: () => import_protocol.StreamProtocol,
|
|
90
|
+
TemplateSource: () => import_protocol.TemplateSource,
|
|
82
91
|
TrackCompositeEgressRequest: () => import_protocol.TrackCompositeEgressRequest,
|
|
83
92
|
TrackEgressRequest: () => import_protocol.TrackEgressRequest,
|
|
84
93
|
TrackInfo: () => import_protocol.TrackInfo,
|
|
@@ -87,6 +96,7 @@ __export(index_exports, {
|
|
|
87
96
|
TwirpError: () => import_TwirpRPC.TwirpError,
|
|
88
97
|
VideoCodec: () => import_protocol.VideoCodec,
|
|
89
98
|
WebEgressRequest: () => import_protocol.WebEgressRequest,
|
|
99
|
+
WebSource: () => import_protocol.WebSource,
|
|
90
100
|
WebhookConfig: () => import_protocol.WebhookConfig
|
|
91
101
|
});
|
|
92
102
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -97,6 +107,7 @@ __reExport(index_exports, require("./ConnectorClient.cjs"), module.exports);
|
|
|
97
107
|
__reExport(index_exports, require("./EgressClient.cjs"), module.exports);
|
|
98
108
|
__reExport(index_exports, require("./grants.cjs"), module.exports);
|
|
99
109
|
__reExport(index_exports, require("./IngressClient.cjs"), module.exports);
|
|
110
|
+
__reExport(index_exports, require("./LiveKitAPI.cjs"), module.exports);
|
|
100
111
|
__reExport(index_exports, require("./RoomServiceClient.cjs"), module.exports);
|
|
101
112
|
__reExport(index_exports, require("./SipClient.cjs"), module.exports);
|
|
102
113
|
var import_TwirpRPC = require("./TwirpRPC.cjs");
|
|
@@ -124,6 +135,7 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
124
135
|
EncodedFileType,
|
|
125
136
|
EncodingOptions,
|
|
126
137
|
EncodingOptionsPreset,
|
|
138
|
+
FileOutput,
|
|
127
139
|
GCPUpload,
|
|
128
140
|
ImageCodec,
|
|
129
141
|
ImageFileSuffix,
|
|
@@ -138,10 +150,13 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
138
150
|
IngressVideoEncodingPreset,
|
|
139
151
|
IngressVideoOptions,
|
|
140
152
|
JobRestartPolicy,
|
|
153
|
+
MediaSource,
|
|
154
|
+
Output,
|
|
141
155
|
ParticipantEgressRequest,
|
|
142
156
|
ParticipantInfo,
|
|
143
157
|
ParticipantInfo_State,
|
|
144
158
|
ParticipantPermission,
|
|
159
|
+
ParticipantVideo,
|
|
145
160
|
Room,
|
|
146
161
|
RoomAgentDispatch,
|
|
147
162
|
RoomCompositeEgressRequest,
|
|
@@ -160,9 +175,14 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
160
175
|
SIPTrunkInfo,
|
|
161
176
|
SegmentedFileOutput,
|
|
162
177
|
SegmentedFileProtocol,
|
|
178
|
+
ServerError,
|
|
163
179
|
SessionDescription,
|
|
180
|
+
SipCallError,
|
|
181
|
+
StartEgressRequest,
|
|
182
|
+
StorageConfig,
|
|
164
183
|
StreamOutput,
|
|
165
184
|
StreamProtocol,
|
|
185
|
+
TemplateSource,
|
|
166
186
|
TrackCompositeEgressRequest,
|
|
167
187
|
TrackEgressRequest,
|
|
168
188
|
TrackInfo,
|
|
@@ -171,6 +191,7 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
171
191
|
TwirpError,
|
|
172
192
|
VideoCodec,
|
|
173
193
|
WebEgressRequest,
|
|
194
|
+
WebSource,
|
|
174
195
|
WebhookConfig,
|
|
175
196
|
...require("./AccessToken.cjs"),
|
|
176
197
|
...require("./AgentDispatchClient.cjs"),
|
|
@@ -178,6 +199,7 @@ __reExport(index_exports, require("./WebhookReceiver.cjs"), module.exports);
|
|
|
178
199
|
...require("./EgressClient.cjs"),
|
|
179
200
|
...require("./grants.cjs"),
|
|
180
201
|
...require("./IngressClient.cjs"),
|
|
202
|
+
...require("./LiveKitAPI.cjs"),
|
|
181
203
|
...require("./RoomServiceClient.cjs"),
|
|
182
204
|
...require("./SipClient.cjs"),
|
|
183
205
|
...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 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 './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;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 FileOutput,\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 MediaSource,\n Output,\n ParticipantEgressRequest,\n ParticipantInfo,\n ParticipantInfo_State,\n ParticipantPermission,\n ParticipantVideo,\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 StartEgressRequest,\n StorageConfig,\n StreamOutput,\n StreamProtocol,\n TemplateSource,\n TrackCompositeEgressRequest,\n TrackEgressRequest,\n TrackInfo,\n TrackSource,\n TrackType,\n WebEgressRequest,\n WebSource,\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,sBA6EO;AACP,0BAAc,6BAlFd;AAmFA,0BAAc,qCAnFd;AAoFA,0BAAc,iCApFd;AAqFA,0BAAc,8BArFd;AAsFA,0BAAc,wBAtFd;AAuFA,0BAAc,+BAvFd;AAwFA,0BAAc,4BAxFd;AAyFA,0BAAc,mCAzFd;AA0FA,0BAAc,2BA1Fd;AA2FA,sBAAsD;AAEtD,0BAAc,iCA7Fd;","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, SIPDispatchRuleCallee, 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, FileOutput, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, JobRestartPolicy, MediaSource, Output, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, ParticipantVideo, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomConfiguration, RoomEgress, S3Upload, SIPCallStatus, SIPDispatchRule, SIPDispatchRuleCallee, SIPDispatchRuleDirect, SIPDispatchRuleIndividual, SIPDispatchRuleInfo, SIPInboundTrunkInfo, SIPOutboundTrunkInfo, SIPParticipantInfo, SIPTrunkInfo, SegmentedFileOutput, SegmentedFileProtocol, SessionDescription, StartEgressRequest, StorageConfig, StreamOutput, StreamProtocol, TemplateSource, TrackCompositeEgressRequest, TrackEgressRequest, TrackInfo, TrackSource, TrackType, VideoCodec, WebEgressRequest, WebSource, 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
10
|
export { CreateSipDispatchRuleOptions, CreateSipInboundTrunkOptions, CreateSipOutboundTrunkOptions, CreateSipParticipantOptions, CreateSipTrunkOptions, ListSipDispatchRuleOptions, ListSipTrunkOptions, SipClient, SipDispatchRuleCallee, SipDispatchRuleDirect, SipDispatchRuleIndividual, SipDispatchRuleUpdateOptions, SipInboundTrunkUpdateOptions, SipOutboundTrunkUpdateOptions, TransferSipParticipantOptions } from './SipClient.cjs';
|
|
10
|
-
export { TwirpError } from './TwirpRPC.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, SIPDispatchRuleCallee, 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, FileOutput, GCPUpload, ImageCodec, ImageFileSuffix, ImageOutput, IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, JobRestartPolicy, MediaSource, Output, ParticipantEgressRequest, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, ParticipantVideo, Room, RoomAgentDispatch, RoomCompositeEgressRequest, RoomConfiguration, RoomEgress, S3Upload, SIPCallStatus, SIPDispatchRule, SIPDispatchRuleCallee, SIPDispatchRuleDirect, SIPDispatchRuleIndividual, SIPDispatchRuleInfo, SIPInboundTrunkInfo, SIPOutboundTrunkInfo, SIPParticipantInfo, SIPTrunkInfo, SegmentedFileOutput, SegmentedFileProtocol, SessionDescription, StartEgressRequest, StorageConfig, StreamOutput, StreamProtocol, TemplateSource, TrackCompositeEgressRequest, TrackEgressRequest, TrackInfo, TrackSource, TrackType, VideoCodec, WebEgressRequest, WebSource, 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
10
|
export { CreateSipDispatchRuleOptions, CreateSipInboundTrunkOptions, CreateSipOutboundTrunkOptions, CreateSipParticipantOptions, CreateSipTrunkOptions, ListSipDispatchRuleOptions, ListSipTrunkOptions, SipClient, SipDispatchRuleCallee, SipDispatchRuleDirect, SipDispatchRuleIndividual, SipDispatchRuleUpdateOptions, SipInboundTrunkUpdateOptions, SipOutboundTrunkUpdateOptions, TransferSipParticipantOptions } from './SipClient.js';
|
|
10
|
-
export { TwirpError } from './TwirpRPC.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,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,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,UAAU,EACV,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,WAAW,EACX,MAAM,EACN,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,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,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,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
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
EncodedFileType,
|
|
21
21
|
EncodingOptions,
|
|
22
22
|
EncodingOptionsPreset,
|
|
23
|
+
FileOutput,
|
|
23
24
|
GCPUpload,
|
|
24
25
|
ImageCodec,
|
|
25
26
|
ImageFileSuffix,
|
|
@@ -34,10 +35,13 @@ import {
|
|
|
34
35
|
IngressVideoEncodingPreset,
|
|
35
36
|
IngressVideoOptions,
|
|
36
37
|
JobRestartPolicy,
|
|
38
|
+
MediaSource,
|
|
39
|
+
Output,
|
|
37
40
|
ParticipantEgressRequest,
|
|
38
41
|
ParticipantInfo,
|
|
39
42
|
ParticipantInfo_State,
|
|
40
43
|
ParticipantPermission,
|
|
44
|
+
ParticipantVideo,
|
|
41
45
|
Room,
|
|
42
46
|
RoomAgentDispatch,
|
|
43
47
|
RoomCompositeEgressRequest,
|
|
@@ -57,14 +61,18 @@ import {
|
|
|
57
61
|
SIPCallStatus,
|
|
58
62
|
SegmentedFileOutput,
|
|
59
63
|
SegmentedFileProtocol,
|
|
64
|
+
StartEgressRequest,
|
|
65
|
+
StorageConfig,
|
|
60
66
|
StreamOutput,
|
|
61
67
|
StreamProtocol,
|
|
68
|
+
TemplateSource,
|
|
62
69
|
TrackCompositeEgressRequest,
|
|
63
70
|
TrackEgressRequest,
|
|
64
71
|
TrackInfo,
|
|
65
72
|
TrackSource,
|
|
66
73
|
TrackType,
|
|
67
74
|
WebEgressRequest,
|
|
75
|
+
WebSource,
|
|
68
76
|
VideoCodec,
|
|
69
77
|
WebhookConfig
|
|
70
78
|
} from "@livekit/protocol";
|
|
@@ -74,9 +82,10 @@ export * from "./ConnectorClient.js";
|
|
|
74
82
|
export * from "./EgressClient.js";
|
|
75
83
|
export * from "./grants.js";
|
|
76
84
|
export * from "./IngressClient.js";
|
|
85
|
+
export * from "./LiveKitAPI.js";
|
|
77
86
|
export * from "./RoomServiceClient.js";
|
|
78
87
|
export * from "./SipClient.js";
|
|
79
|
-
import { TwirpError } from "./TwirpRPC.js";
|
|
88
|
+
import { ServerError, SipCallError, TwirpError } from "./TwirpRPC.js";
|
|
80
89
|
export * from "./WebhookReceiver.js";
|
|
81
90
|
export {
|
|
82
91
|
AcceptWhatsAppCallResponse,
|
|
@@ -100,6 +109,7 @@ export {
|
|
|
100
109
|
EncodedFileType,
|
|
101
110
|
EncodingOptions,
|
|
102
111
|
EncodingOptionsPreset,
|
|
112
|
+
FileOutput,
|
|
103
113
|
GCPUpload,
|
|
104
114
|
ImageCodec,
|
|
105
115
|
ImageFileSuffix,
|
|
@@ -114,10 +124,13 @@ export {
|
|
|
114
124
|
IngressVideoEncodingPreset,
|
|
115
125
|
IngressVideoOptions,
|
|
116
126
|
JobRestartPolicy,
|
|
127
|
+
MediaSource,
|
|
128
|
+
Output,
|
|
117
129
|
ParticipantEgressRequest,
|
|
118
130
|
ParticipantInfo,
|
|
119
131
|
ParticipantInfo_State,
|
|
120
132
|
ParticipantPermission,
|
|
133
|
+
ParticipantVideo,
|
|
121
134
|
Room,
|
|
122
135
|
RoomAgentDispatch,
|
|
123
136
|
RoomCompositeEgressRequest,
|
|
@@ -136,9 +149,14 @@ export {
|
|
|
136
149
|
SIPTrunkInfo,
|
|
137
150
|
SegmentedFileOutput,
|
|
138
151
|
SegmentedFileProtocol,
|
|
152
|
+
ServerError,
|
|
139
153
|
SessionDescription,
|
|
154
|
+
SipCallError,
|
|
155
|
+
StartEgressRequest,
|
|
156
|
+
StorageConfig,
|
|
140
157
|
StreamOutput,
|
|
141
158
|
StreamProtocol,
|
|
159
|
+
TemplateSource,
|
|
142
160
|
TrackCompositeEgressRequest,
|
|
143
161
|
TrackEgressRequest,
|
|
144
162
|
TrackInfo,
|
|
@@ -147,6 +165,7 @@ export {
|
|
|
147
165
|
TwirpError,
|
|
148
166
|
VideoCodec,
|
|
149
167
|
WebEgressRequest,
|
|
168
|
+
WebSource,
|
|
150
169
|
WebhookConfig
|
|
151
170
|
};
|
|
152
171
|
//# sourceMappingURL=index.js.map
|
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 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 './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,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 FileOutput,\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 MediaSource,\n Output,\n ParticipantEgressRequest,\n ParticipantInfo,\n ParticipantInfo_State,\n ParticipantPermission,\n ParticipantVideo,\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 StartEgressRequest,\n StorageConfig,\n StreamOutput,\n StreamProtocol,\n TemplateSource,\n TrackCompositeEgressRequest,\n TrackEgressRequest,\n TrackInfo,\n TrackSource,\n TrackType,\n WebEgressRequest,\n WebSource,\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,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.18.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.18.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.18.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.18.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": "
|
|
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
|
}
|