@crvouga/mockingbird-service-daily 2.1.0 → 2.2.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/CHANGELOG.md +12 -4
- package/README.md +2 -1
- package/SUPPORT.md +4 -3
- package/dist/{chunk-67NLEIU4.js → chunk-XBBOL255.js} +2 -2
- package/dist/{chunk-IXMDDMPJ.js → chunk-ZJLG2FE7.js} +97 -9
- package/dist/chunk-ZJLG2FE7.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +2 -2
- package/openapi.yaml +44 -0
- package/package.json +1 -1
- package/dist/chunk-IXMDDMPJ.js.map +0 -7
- /package/dist/{chunk-67NLEIU4.js.map → chunk-XBBOL255.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-daily
|
|
2
2
|
|
|
3
|
+
## 2.2.0 (2026-10-05)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add scripted local API mock ([4a76a11](https://github.com/crvouga/mockingbird/commit/4a76a114e2efad45934e0a93cf29576fd418e15c))
|
|
8
|
+
- add room listing and cursors ([70d0412](https://github.com/crvouga/mockingbird/commit/70d04125bd2f7d4a573b9b67bb3a6ee3351b16d5))
|
|
9
|
+
|
|
10
|
+
### Fixes and improvements
|
|
11
|
+
|
|
12
|
+
- support embedded route parameters ([127cad9](https://github.com/crvouga/mockingbird/commit/127cad997ef106950c1b866070eea191ba54403f))
|
|
13
|
+
- preserve namespace URLs after main sync ([62a15ce](https://github.com/crvouga/mockingbird/commit/62a15ce9bd453069bde69e3a30c91efc01f8871b))
|
|
14
|
+
|
|
3
15
|
## 2.1.0 (2026-10-04)
|
|
4
16
|
|
|
5
17
|
### Features
|
|
@@ -12,10 +24,6 @@
|
|
|
12
24
|
- fill the embedded viewport ([c1a35a4](https://github.com/crvouga/mockingbird/commit/c1a35a4789389ee9cd06c286d09bd47c4d06c71e))
|
|
13
25
|
- make dialog cleanup immediate ([0c1a3c5](https://github.com/crvouga/mockingbird/commit/0c1a3c5b12584d50c19dcae595b951b8e5417b9c))
|
|
14
26
|
|
|
15
|
-
### Dependencies
|
|
16
|
-
|
|
17
|
-
- `@crvouga/mockingbird-service-sqlite`
|
|
18
|
-
|
|
19
27
|
## 2.0.0 (2026-10-04)
|
|
20
28
|
|
|
21
29
|
### ⚠️ Breaking changes
|
package/README.md
CHANGED
|
@@ -76,6 +76,7 @@ await admin("/rooms/<room name>/session", {
|
|
|
76
76
|
|
|
77
77
|
| Route | Behaviour |
|
|
78
78
|
| --- | --- |
|
|
79
|
+
| `GET /v1/rooms` | `{total_count, data}` in newest-first creation order; `limit` (default 100), `ending_before` and `starting_after` use room IDs. Shares state with room creation, updates and deletion. |
|
|
79
80
|
| `POST /v1/rooms` | `{name?, privacy?, properties?}`; unknown properties, bad types and a duplicate `name` are 400 `{error: "invalid-request-error", info}`. No name → a random 20-character one. Answers `{id, name, api_created, privacy, url: <roomUrlBase><name>, created_at, config}` with `config` echoing the properties. Accepts both the backend's strict body and the EMR's `generateRoomConfig` body. |
|
|
80
81
|
| `GET /v1/rooms/:name` | The room, or 404 `{error: "not-found", info: "room <name> not found"}` (the EMR branches on `message.includes('404')`). |
|
|
81
82
|
| `POST /v1/rooms/:name` | Merge `properties` (and `privacy`) into the room; 404 when missing. |
|
|
@@ -140,7 +141,7 @@ Fault presets (`POST /__admin/faults {"preset": "<name>", "count"?: n}`): `room_
|
|
|
140
141
|
through `useCallProviderLogic(createCallObject)`.
|
|
141
142
|
- The room page at `https://<domain>.daily.co/<room>?t=` (the URL is produced, not served).
|
|
142
143
|
- Daily's own webhook signature scheme and webhook registration API (see above).
|
|
143
|
-
-
|
|
144
|
+
- Recordings/transcripts REST APIs, dial-out, streaming.
|
|
144
145
|
|
|
145
146
|
## API
|
|
146
147
|
|
package/SUPPORT.md
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Generated from `openapi.yaml`; do not edit by hand.
|
|
4
4
|
|
|
5
|
-
- operations in spec: **
|
|
6
|
-
- supported by the mock: **
|
|
7
|
-
- parity enabled: **
|
|
5
|
+
- operations in spec: **9**
|
|
6
|
+
- supported by the mock: **9**
|
|
7
|
+
- parity enabled: **9**
|
|
8
8
|
|
|
9
9
|
| operationId | route | mock | parity | notes |
|
|
10
10
|
| --- | --- | --- | --- | --- |
|
|
11
|
+
| `ListRooms` | `GET /v1/rooms` | ✅ supported | ✅ | |
|
|
11
12
|
| `CreateRoom` | `POST /v1/rooms` | ✅ supported | ⚠️ unsafe (opt-in) | |
|
|
12
13
|
| `GetRoom` | `GET /v1/rooms/{name}` | ✅ supported | ✅ | |
|
|
13
14
|
| `UpdateRoom` | `POST /v1/rooms/{name}` | ✅ supported | ⚠️ unsafe (opt-in) | |
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createRuntime,
|
|
4
4
|
parseDuration,
|
|
5
5
|
resolveAdminPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZJLG2FE7.js";
|
|
7
7
|
|
|
8
8
|
// ../../adapters/node/dist/cli.js
|
|
9
9
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
@@ -909,4 +909,4 @@ export {
|
|
|
909
909
|
createServer2 as createServer,
|
|
910
910
|
serveTarget
|
|
911
911
|
};
|
|
912
|
-
//# sourceMappingURL=chunk-
|
|
912
|
+
//# sourceMappingURL=chunk-XBBOL255.js.map
|
|
@@ -1018,7 +1018,40 @@ var decodeBody = (contentType, bytes) => {
|
|
|
1018
1018
|
return { kind: "bytes", value: bytes };
|
|
1019
1019
|
};
|
|
1020
1020
|
var readBody = async (message) => {
|
|
1021
|
-
|
|
1021
|
+
if (!(message instanceof Request) || !message.body) {
|
|
1022
|
+
if (message instanceof Request)
|
|
1023
|
+
message.signal.throwIfAborted();
|
|
1024
|
+
return decodeBody(message.headers.get("content-type"), new Uint8Array(await message.arrayBuffer()));
|
|
1025
|
+
}
|
|
1026
|
+
message.signal.throwIfAborted();
|
|
1027
|
+
const reader = message.body.getReader();
|
|
1028
|
+
const cancel = () => {
|
|
1029
|
+
void reader.cancel(message.signal.reason).catch(() => {
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
1032
|
+
message.signal.addEventListener("abort", cancel, { once: true });
|
|
1033
|
+
const chunks = [];
|
|
1034
|
+
let size = 0;
|
|
1035
|
+
try {
|
|
1036
|
+
for (; ; ) {
|
|
1037
|
+
message.signal.throwIfAborted();
|
|
1038
|
+
const { done, value } = await reader.read();
|
|
1039
|
+
message.signal.throwIfAborted();
|
|
1040
|
+
if (done)
|
|
1041
|
+
break;
|
|
1042
|
+
chunks.push(value);
|
|
1043
|
+
size += value.byteLength;
|
|
1044
|
+
}
|
|
1045
|
+
} finally {
|
|
1046
|
+
message.signal.removeEventListener("abort", cancel);
|
|
1047
|
+
reader.releaseLock();
|
|
1048
|
+
}
|
|
1049
|
+
const bytes = new Uint8Array(size);
|
|
1050
|
+
let offset = 0;
|
|
1051
|
+
for (const chunk of chunks) {
|
|
1052
|
+
bytes.set(chunk, offset);
|
|
1053
|
+
offset += chunk.byteLength;
|
|
1054
|
+
}
|
|
1022
1055
|
return decodeBody(message.headers.get("content-type"), bytes);
|
|
1023
1056
|
};
|
|
1024
1057
|
|
|
@@ -1756,7 +1789,42 @@ var verifyOperations = (document2, handlers) => {
|
|
|
1756
1789
|
}
|
|
1757
1790
|
return problems;
|
|
1758
1791
|
};
|
|
1759
|
-
var
|
|
1792
|
+
var escapePattern = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1793
|
+
var serviceRoute = (template) => {
|
|
1794
|
+
const names = [];
|
|
1795
|
+
let pattern = "", end = 0;
|
|
1796
|
+
for (const match of template.matchAll(/\{([^}]+)\}/g)) {
|
|
1797
|
+
pattern += `${escapePattern(template.slice(end, match.index))}([^/]+?)`;
|
|
1798
|
+
const name = match[1];
|
|
1799
|
+
if (!name)
|
|
1800
|
+
throw new Error(`Invalid OpenAPI route template: ${template}`);
|
|
1801
|
+
names.push(name);
|
|
1802
|
+
end = match.index + match[0].length;
|
|
1803
|
+
}
|
|
1804
|
+
pattern += escapePattern(template.slice(end));
|
|
1805
|
+
const matcher = new RegExp(`^${pattern}$`);
|
|
1806
|
+
const path = template.split("/").map((segment, index) => {
|
|
1807
|
+
if (!segment.includes("{"))
|
|
1808
|
+
return segment;
|
|
1809
|
+
const literal = /^\{([^}]+)\}$/.exec(segment);
|
|
1810
|
+
if (literal)
|
|
1811
|
+
return `:${literal[1]}`;
|
|
1812
|
+
let expression = "", offset = 0;
|
|
1813
|
+
for (const match of segment.matchAll(/\{[^}]+\}/g)) {
|
|
1814
|
+
expression += `${escapePattern(segment.slice(offset, match.index))}[^/]+?`;
|
|
1815
|
+
offset = match.index + match[0].length;
|
|
1816
|
+
}
|
|
1817
|
+
expression += escapePattern(segment.slice(offset));
|
|
1818
|
+
return `:mockingbirdSegment${index}{${expression}}`;
|
|
1819
|
+
}).join("/");
|
|
1820
|
+
return {
|
|
1821
|
+
path,
|
|
1822
|
+
params: (pathname) => {
|
|
1823
|
+
const values = matcher.exec(pathname);
|
|
1824
|
+
return Object.fromEntries(names.map((name, index) => [name, decodeURIComponent(values?.[index + 1] ?? "")]));
|
|
1825
|
+
}
|
|
1826
|
+
};
|
|
1827
|
+
};
|
|
1760
1828
|
var routeOrder = (a, b) => {
|
|
1761
1829
|
const sa = a.path.split("/");
|
|
1762
1830
|
const sb = b.path.split("/");
|
|
@@ -1791,6 +1859,7 @@ var createService = (options) => {
|
|
|
1791
1859
|
for (const operation of operations) {
|
|
1792
1860
|
const metadata = operationMetadata(operation.operation);
|
|
1793
1861
|
const handler = options.handlers[operation.operationId];
|
|
1862
|
+
const registeredRoute = serviceRoute(operation.path);
|
|
1794
1863
|
const route = async (c) => {
|
|
1795
1864
|
const request = c.req.raw;
|
|
1796
1865
|
if (!metadata.supported || !handler) {
|
|
@@ -1800,7 +1869,7 @@ var createService = (options) => {
|
|
|
1800
1869
|
const context = {
|
|
1801
1870
|
request,
|
|
1802
1871
|
url,
|
|
1803
|
-
params:
|
|
1872
|
+
params: registeredRoute.params(url.pathname),
|
|
1804
1873
|
query: queryOf(url),
|
|
1805
1874
|
body: await readBody(request),
|
|
1806
1875
|
sqlite: options.sqlite,
|
|
@@ -1812,7 +1881,7 @@ var createService = (options) => {
|
|
|
1812
1881
|
const short = await options.before?.(context);
|
|
1813
1882
|
return withIssues(request, short ?? await handler(context));
|
|
1814
1883
|
};
|
|
1815
|
-
app.on(operation.method.toUpperCase(),
|
|
1884
|
+
app.on(operation.method.toUpperCase(), registeredRoute.path, route);
|
|
1816
1885
|
}
|
|
1817
1886
|
return {
|
|
1818
1887
|
app,
|
|
@@ -2281,7 +2350,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
2281
2350
|
};
|
|
2282
2351
|
|
|
2283
2352
|
// ../core/dist/version.js
|
|
2284
|
-
var PACKAGE_VERSION = true ? "2.
|
|
2353
|
+
var PACKAGE_VERSION = true ? "2.2.0" : UNRELEASED_VERSION;
|
|
2285
2354
|
|
|
2286
2355
|
// ../core/dist/signing.js
|
|
2287
2356
|
var encoder = new TextEncoder();
|
|
@@ -3540,9 +3609,9 @@ var putObject = async (target, key, body, contentType = "application/octet-strea
|
|
|
3540
3609
|
};
|
|
3541
3610
|
|
|
3542
3611
|
// src/generated/openapi.ts
|
|
3543
|
-
var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"Daily.co REST API (Mockingbird subset)","description":"Stateful mock subset of the Daily.co REST API: rooms (create, get, update, delete, presence,\\neject) and meeting tokens (create, validate). Trimmed from Daily's documented API to the\\ncalls our backend and EMR make; request schemas follow the fields our consumers send\\n(daily-video.schemas.ts strict zod schemas, EMR RoomConfig / TokenConfig).\\n","version":"1","x-mockingbird-upstream":{"note":"Hand-authored from docs.daily.co/reference/rest-api and our consumers (apps/backend daily-video.service.ts + schemas, the consumer app's daily-service.ts)."}},"servers":[{"url":"https://api.daily.co"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/rooms":{"post":{"operationId":"CreateRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoomBody"}}}},"responses":{"200":{"description":"The created room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rooms/{name}":{"parameters":[{"$ref":"#/components/parameters/RoomName"}],"get":{"operationId":"GetRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"UpdateRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoomBody"}}}},"responses":{"200":{"description":"The updated room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"delete":{"operationId":"DeleteRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","required":["deleted","name"],"properties":{"deleted":{"type":"boolean"},"name":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rooms/{name}/presence":{"parameters":[{"$ref":"#/components/parameters/RoomName"}],"get":{"operationId":"GetRoomPresence","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Participants currently in the room","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["total_count","data"],"properties":{"total_count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PresenceParticipant"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rooms/{name}/eject":{"parameters":[{"$ref":"#/components/parameters/RoomName"}],"post":{"operationId":"EjectParticipants","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ids":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":64}},"user_ids":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":36}}}}}}},"responses":{"200":{"description":"Session ids of the ejected participants","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["ejectedIds"],"properties":{"ejectedIds":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/meeting-tokens":{"post":{"operationId":"CreateMeetingToken","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["properties"],"properties":{"properties":{"$ref":"#/components/schemas/TokenProperties"}}}}}},"responses":{"200":{"description":"A signed meeting token","content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","x-mockingbird-resource":{"type":"meeting_token","identity":true},"x-mockingbird-volatile":{"kind":"token"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/meeting-tokens/{token}":{"parameters":[{"name":"token","in":"path","required":true,"description":"A meeting token, minted by Daily or self-signed (HS256 with the API key).","schema":{"type":"string","x-mockingbird-resource-ref":{"type":"meeting_token","missing":"eyJhbGciOiJIUzI1NiJ9.e30.bm90LWEtc2lnbmF0dXJl"}}},{"name":"ignoreNbf","in":"query","required":false,"schema":{"type":"boolean"}}],"get":{"operationId":"ValidateMeetingToken","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The token's properties (it verifies with this API key and is in its time window)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodedTokenProperties"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"RoomName":{"name":"name","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"room","missing":"no-such-room"}}}},"responses":{"InvalidRequest":{"description":"The request was not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error","info"],"properties":{"error":{"type":"string"},"info":{"type":"string"}}},"Bucket":{"type":"object","additionalProperties":false,"required":["bucket_name","assume_role_arn"],"properties":{"bucket_name":{"type":"string","maxLength":63},"bucket_region":{"type":"string","maxLength":32},"assume_role_arn":{"type":"string","maxLength":256},"allow_api_access":{"type":"boolean"},"allow_streaming_from_bucket":{"type":"boolean"},"storage_provider":{"type":"string","maxLength":32},"namespace":{"type":"string","maxLength":64}}},"Permissions":{"type":"object","additionalProperties":false,"properties":{"hasPresence":{"type":"boolean"},"canSend":{"oneOf":[{"type":"boolean"},{"type":"array","maxItems":4,"items":{"type":"string","enum":["video","audio","screenVideo","screenAudio"]}}]},"canReceive":{"type":"object"},"canAdmin":{"oneOf":[{"type":"boolean"},{"type":"array","maxItems":3,"items":{"type":"string","enum":["participants","streaming","transcription"]}}]}}},"Recording":{"oneOf":[{"type":"string","enum":["cloud","local","raw-tracks"]},{"type":"boolean","enum":[false]}]},"RoomProperties":{"type":"object","additionalProperties":false,"properties":{"nbf":{"type":"number","description":"Unix seconds (some callers send milliseconds; tolerated with a warning)."},"exp":{"type":"number","description":"Unix seconds (some callers send milliseconds; tolerated with a warning)."},"max_participants":{"type":"integer","minimum":1,"maximum":200},"enable_people_ui":{"type":"boolean"},"enable_cpu_warning_notifications":{"type":"boolean"},"enable_pip_ui":{"type":"boolean"},"enable_emoji_reactions":{"type":"boolean"},"enable_hand_raising":{"type":"boolean"},"enable_prejoin_ui":{"type":"boolean"},"enable_live_captions_ui":{"type":"boolean"},"enable_network_ui":{"type":"boolean"},"enable_noise_cancellation_ui":{"type":"boolean"},"enable_breakout_rooms":{"type":"boolean"},"enable_video_processing_ui":{"type":"boolean"},"enable_knocking":{"type":"boolean"},"enable_screenshare":{"type":"boolean"},"enable_chat":{"type":"boolean"},"enable_shared_chat_history":{"type":"boolean"},"enable_advanced_chat":{"type":"boolean"},"start_video_off":{"type":"boolean"},"start_audio_off":{"type":"boolean"},"owner_only_broadcast":{"type":"boolean"},"enable_recording":{"$ref":"#/components/schemas/Recording"},"eject_at_room_exp":{"type":"boolean"},"eject_after_elapsed":{"type":"integer","minimum":0},"enable_hidden_participants":{"type":"boolean"},"enable_mesh_sfu":{"type":"boolean"},"experimental_optimize_large_calls":{"type":"boolean"},"enable_terse_logging":{"type":"boolean"},"close_tab_on_exit":{"type":"boolean","description":"Documented on meeting tokens; the live API also accepts it on a room, so a body that sets it on both is not rejected."},"sfu_switchover":{"type":"number"},"enable_adaptive_simulcast":{"type":"boolean"},"enable_multiparty_adaptive_simulcast":{"type":"boolean"},"enforce_unique_user_ids":{"type":"boolean"},"lang":{"type":"string","enum":["da","de","en","es","fi","fr","it","jp","ka","nl","no","pt","pt-BR","pl","ru","sv","tr","user"]},"meeting_join_hook":{"type":"string","maxLength":255},"geo":{"type":"string","enum":["af-south-1","ap-northeast-2","ap-southeast-1","ap-southeast-2","ap-south-1","eu-central-1","eu-west-2","sa-east-1","us-east-1","us-west-2"]},"rtmp_geo":{"type":"string","enum":["us-west-2","eu-central-1","ap-south-1"]},"disable_rtmp_geo_fallback":{"type":"boolean"},"recordings_bucket":{"$ref":"#/components/schemas/Bucket"},"transcription_bucket":{"$ref":"#/components/schemas/Bucket"},"recordings_template":{"type":"string","maxLength":1024},"transcription_template":{"type":"string","maxLength":1024},"auto_transcription_settings":{"type":"object"},"enable_transcription_storage":{"type":"boolean"},"enable_dialout":{"type":"boolean"},"dialout_config":{"type":"object","additionalProperties":false,"properties":{"allow_room_start":{"type":"boolean"},"dialout_geo":{"type":"string","maxLength":32},"max_idle_timeout_sec":{"type":"number"},"max_idle_timeout_post_conversation_sec":{"type":"number"}}},"streaming_endpoints":{"type":["array","null"],"maxItems":3,"items":{"type":"object"}},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"CreateRoomBody":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"privacy":{"type":"string","enum":["public","private"]},"properties":{"$ref":"#/components/schemas/RoomProperties"}}},"UpdateRoomBody":{"type":"object","additionalProperties":false,"properties":{"privacy":{"type":"string","enum":["public","private"]},"properties":{"$ref":"#/components/schemas/RoomProperties"}}},"Room":{"type":"object","required":["id","name","api_created","privacy","url","created_at","config"],"properties":{"id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string","x-mockingbird-resource":{"type":"room","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"api_created":{"type":"boolean"},"privacy":{"type":"string","enum":["public","private"]},"url":{"type":"string","x-mockingbird-volatile":{"kind":"url"}},"created_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"config":{"type":"object"}}},"PresenceParticipant":{"type":"object","additionalProperties":false,"required":["room","id","userId","userName","joinTime","duration"],"properties":{"room":{"type":"string"},"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"joinTime":{"type":"string"},"duration":{"type":"number"}}},"TokenProperties":{"type":"object","additionalProperties":false,"properties":{"room_name":{"type":"string","maxLength":128,"x-mockingbird-resource-ref":{"type":"room","missing":"no-such-room"}},"knocking":{"type":"boolean"},"nbf":{"type":"number"},"exp":{"type":"number"},"eject_at_token_exp":{"type":"boolean"},"eject_after_elapsed":{"type":"integer","minimum":0},"is_owner":{"type":"boolean"},"user_name":{"type":"string","maxLength":128},"user_id":{"type":"string","maxLength":36},"enable_screenshare":{"type":"boolean"},"start_video_off":{"type":"boolean"},"start_audio_off":{"type":"boolean"},"enable_recording":{"$ref":"#/components/schemas/Recording"},"enable_recording_ui":{"type":"boolean"},"start_cloud_recording":{"type":"boolean"},"start_cloud_recording_opts":{"type":"object"},"auto_start_transcription":{"type":"boolean"},"enable_prejoin_ui":{"type":"boolean"},"enable_live_captions_ui":{"type":"boolean"},"enable_terse_logging":{"type":"boolean"},"close_tab_on_exit":{"type":"boolean"},"redirect_on_meeting_exit":{"type":"string","maxLength":255},"lang":{"type":"string","enum":["da","de","en","es","fi","fr","it","jp","ka","nl","no","pt","pt-BR","pl","ru","sv","tr","user"]},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"DecodedTokenProperties":{"type":"object","description":"The token's claims under Daily's full property names.","properties":{"room_name":{"type":"string"},"is_owner":{"type":"boolean"},"user_name":{"type":"string"},"user_id":{"type":"string"},"nbf":{"type":"number"},"exp":{"type":"number"}}}}}}`);
|
|
3544
|
-
var operationIds = ["CreateRoom", "GetRoom", "UpdateRoom", "DeleteRoom", "GetRoomPresence", "EjectParticipants", "CreateMeetingToken", "ValidateMeetingToken"];
|
|
3545
|
-
var supportedOperationIds = ["CreateRoom", "GetRoom", "UpdateRoom", "DeleteRoom", "GetRoomPresence", "EjectParticipants", "CreateMeetingToken", "ValidateMeetingToken"];
|
|
3612
|
+
var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"Daily.co REST API (Mockingbird subset)","description":"Stateful mock subset of the Daily.co REST API: rooms (create, get, update, delete, presence,\\neject) and meeting tokens (create, validate). Trimmed from Daily's documented API to the\\ncalls our backend and EMR make; request schemas follow the fields our consumers send\\n(daily-video.schemas.ts strict zod schemas, EMR RoomConfig / TokenConfig).\\n","version":"1","x-mockingbird-upstream":{"note":"Hand-authored from docs.daily.co/reference/rest-api and our consumers (apps/backend daily-video.service.ts + schemas, the consumer app's daily-service.ts)."}},"servers":[{"url":"https://api.daily.co"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/rooms":{"get":{"operationId":"ListRooms","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1}},{"name":"ending_before","in":"query","schema":{"type":"string"}},{"name":"starting_after","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Rooms in reverse creation order, with the account total","content":{"application/json":{"schema":{"type":"object","required":["total_count","data"],"properties":{"total_count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Room"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"CreateRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoomBody"}}}},"responses":{"200":{"description":"The created room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rooms/{name}":{"parameters":[{"$ref":"#/components/parameters/RoomName"}],"get":{"operationId":"GetRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"post":{"operationId":"UpdateRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoomBody"}}}},"responses":{"200":{"description":"The updated room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}},"delete":{"operationId":"DeleteRoom","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","required":["deleted","name"],"properties":{"deleted":{"type":"boolean"},"name":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rooms/{name}/presence":{"parameters":[{"$ref":"#/components/parameters/RoomName"}],"get":{"operationId":"GetRoomPresence","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Participants currently in the room","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["total_count","data"],"properties":{"total_count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PresenceParticipant"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rooms/{name}/eject":{"parameters":[{"$ref":"#/components/parameters/RoomName"}],"post":{"operationId":"EjectParticipants","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ids":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":64}},"user_ids":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":36}}}}}}},"responses":{"200":{"description":"Session ids of the ejected participants","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["ejectedIds"],"properties":{"ejectedIds":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/meeting-tokens":{"post":{"operationId":"CreateMeetingToken","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["properties"],"properties":{"properties":{"$ref":"#/components/schemas/TokenProperties"}}}}}},"responses":{"200":{"description":"A signed meeting token","content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string","x-mockingbird-resource":{"type":"meeting_token","identity":true},"x-mockingbird-volatile":{"kind":"token"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/v1/meeting-tokens/{token}":{"parameters":[{"name":"token","in":"path","required":true,"description":"A meeting token, minted by Daily or self-signed (HS256 with the API key).","schema":{"type":"string","x-mockingbird-resource-ref":{"type":"meeting_token","missing":"eyJhbGciOiJIUzI1NiJ9.e30.bm90LWEtc2lnbmF0dXJl"}}},{"name":"ignoreNbf","in":"query","required":false,"schema":{"type":"boolean"}}],"get":{"operationId":"ValidateMeetingToken","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The token's properties (it verifies with this API key and is in its time window)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodedTokenProperties"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"RoomName":{"name":"name","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"room","missing":"no-such-room"}}}},"responses":{"InvalidRequest":{"description":"The request was not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error","info"],"properties":{"error":{"type":"string"},"info":{"type":"string"}}},"Bucket":{"type":"object","additionalProperties":false,"required":["bucket_name","assume_role_arn"],"properties":{"bucket_name":{"type":"string","maxLength":63},"bucket_region":{"type":"string","maxLength":32},"assume_role_arn":{"type":"string","maxLength":256},"allow_api_access":{"type":"boolean"},"allow_streaming_from_bucket":{"type":"boolean"},"storage_provider":{"type":"string","maxLength":32},"namespace":{"type":"string","maxLength":64}}},"Permissions":{"type":"object","additionalProperties":false,"properties":{"hasPresence":{"type":"boolean"},"canSend":{"oneOf":[{"type":"boolean"},{"type":"array","maxItems":4,"items":{"type":"string","enum":["video","audio","screenVideo","screenAudio"]}}]},"canReceive":{"type":"object"},"canAdmin":{"oneOf":[{"type":"boolean"},{"type":"array","maxItems":3,"items":{"type":"string","enum":["participants","streaming","transcription"]}}]}}},"Recording":{"oneOf":[{"type":"string","enum":["cloud","local","raw-tracks"]},{"type":"boolean","enum":[false]}]},"RoomProperties":{"type":"object","additionalProperties":false,"properties":{"nbf":{"type":"number","description":"Unix seconds (some callers send milliseconds; tolerated with a warning)."},"exp":{"type":"number","description":"Unix seconds (some callers send milliseconds; tolerated with a warning)."},"max_participants":{"type":"integer","minimum":1,"maximum":200},"enable_people_ui":{"type":"boolean"},"enable_cpu_warning_notifications":{"type":"boolean"},"enable_pip_ui":{"type":"boolean"},"enable_emoji_reactions":{"type":"boolean"},"enable_hand_raising":{"type":"boolean"},"enable_prejoin_ui":{"type":"boolean"},"enable_live_captions_ui":{"type":"boolean"},"enable_network_ui":{"type":"boolean"},"enable_noise_cancellation_ui":{"type":"boolean"},"enable_breakout_rooms":{"type":"boolean"},"enable_video_processing_ui":{"type":"boolean"},"enable_knocking":{"type":"boolean"},"enable_screenshare":{"type":"boolean"},"enable_chat":{"type":"boolean"},"enable_shared_chat_history":{"type":"boolean"},"enable_advanced_chat":{"type":"boolean"},"start_video_off":{"type":"boolean"},"start_audio_off":{"type":"boolean"},"owner_only_broadcast":{"type":"boolean"},"enable_recording":{"$ref":"#/components/schemas/Recording"},"eject_at_room_exp":{"type":"boolean"},"eject_after_elapsed":{"type":"integer","minimum":0},"enable_hidden_participants":{"type":"boolean"},"enable_mesh_sfu":{"type":"boolean"},"experimental_optimize_large_calls":{"type":"boolean"},"enable_terse_logging":{"type":"boolean"},"close_tab_on_exit":{"type":"boolean","description":"Documented on meeting tokens; the live API also accepts it on a room, so a body that sets it on both is not rejected."},"sfu_switchover":{"type":"number"},"enable_adaptive_simulcast":{"type":"boolean"},"enable_multiparty_adaptive_simulcast":{"type":"boolean"},"enforce_unique_user_ids":{"type":"boolean"},"lang":{"type":"string","enum":["da","de","en","es","fi","fr","it","jp","ka","nl","no","pt","pt-BR","pl","ru","sv","tr","user"]},"meeting_join_hook":{"type":"string","maxLength":255},"geo":{"type":"string","enum":["af-south-1","ap-northeast-2","ap-southeast-1","ap-southeast-2","ap-south-1","eu-central-1","eu-west-2","sa-east-1","us-east-1","us-west-2"]},"rtmp_geo":{"type":"string","enum":["us-west-2","eu-central-1","ap-south-1"]},"disable_rtmp_geo_fallback":{"type":"boolean"},"recordings_bucket":{"$ref":"#/components/schemas/Bucket"},"transcription_bucket":{"$ref":"#/components/schemas/Bucket"},"recordings_template":{"type":"string","maxLength":1024},"transcription_template":{"type":"string","maxLength":1024},"auto_transcription_settings":{"type":"object"},"enable_transcription_storage":{"type":"boolean"},"enable_dialout":{"type":"boolean"},"dialout_config":{"type":"object","additionalProperties":false,"properties":{"allow_room_start":{"type":"boolean"},"dialout_geo":{"type":"string","maxLength":32},"max_idle_timeout_sec":{"type":"number"},"max_idle_timeout_post_conversation_sec":{"type":"number"}}},"streaming_endpoints":{"type":["array","null"],"maxItems":3,"items":{"type":"object"}},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"CreateRoomBody":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"privacy":{"type":"string","enum":["public","private"]},"properties":{"$ref":"#/components/schemas/RoomProperties"}}},"UpdateRoomBody":{"type":"object","additionalProperties":false,"properties":{"privacy":{"type":"string","enum":["public","private"]},"properties":{"$ref":"#/components/schemas/RoomProperties"}}},"Room":{"type":"object","required":["id","name","api_created","privacy","url","created_at","config"],"properties":{"id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string","x-mockingbird-resource":{"type":"room","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"api_created":{"type":"boolean"},"privacy":{"type":"string","enum":["public","private"]},"url":{"type":"string","x-mockingbird-volatile":{"kind":"url"}},"created_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"config":{"type":"object"}}},"PresenceParticipant":{"type":"object","additionalProperties":false,"required":["room","id","userId","userName","joinTime","duration"],"properties":{"room":{"type":"string"},"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"joinTime":{"type":"string"},"duration":{"type":"number"}}},"TokenProperties":{"type":"object","additionalProperties":false,"properties":{"room_name":{"type":"string","maxLength":128,"x-mockingbird-resource-ref":{"type":"room","missing":"no-such-room"}},"knocking":{"type":"boolean"},"nbf":{"type":"number"},"exp":{"type":"number"},"eject_at_token_exp":{"type":"boolean"},"eject_after_elapsed":{"type":"integer","minimum":0},"is_owner":{"type":"boolean"},"user_name":{"type":"string","maxLength":128},"user_id":{"type":"string","maxLength":36},"enable_screenshare":{"type":"boolean"},"start_video_off":{"type":"boolean"},"start_audio_off":{"type":"boolean"},"enable_recording":{"$ref":"#/components/schemas/Recording"},"enable_recording_ui":{"type":"boolean"},"start_cloud_recording":{"type":"boolean"},"start_cloud_recording_opts":{"type":"object"},"auto_start_transcription":{"type":"boolean"},"enable_prejoin_ui":{"type":"boolean"},"enable_live_captions_ui":{"type":"boolean"},"enable_terse_logging":{"type":"boolean"},"close_tab_on_exit":{"type":"boolean"},"redirect_on_meeting_exit":{"type":"string","maxLength":255},"lang":{"type":"string","enum":["da","de","en","es","fi","fr","it","jp","ka","nl","no","pt","pt-BR","pl","ru","sv","tr","user"]},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"DecodedTokenProperties":{"type":"object","description":"The token's claims under Daily's full property names.","properties":{"room_name":{"type":"string"},"is_owner":{"type":"boolean"},"user_name":{"type":"string"},"user_id":{"type":"string"},"nbf":{"type":"number"},"exp":{"type":"number"}}}}}}`);
|
|
3613
|
+
var operationIds = ["ListRooms", "CreateRoom", "GetRoom", "UpdateRoom", "DeleteRoom", "GetRoomPresence", "EjectParticipants", "CreateMeetingToken", "ValidateMeetingToken"];
|
|
3614
|
+
var supportedOperationIds = ["ListRooms", "CreateRoom", "GetRoom", "UpdateRoom", "DeleteRoom", "GetRoomPresence", "EjectParticipants", "CreateMeetingToken", "ValidateMeetingToken"];
|
|
3546
3615
|
|
|
3547
3616
|
// src/state.ts
|
|
3548
3617
|
var DEFAULT_SETTINGS = {
|
|
@@ -3908,6 +3977,7 @@ var DailyAPI = class {
|
|
|
3908
3977
|
this.transcripts = options.transcripts;
|
|
3909
3978
|
this.state = new DailyState(sqlite, namespace, options.settings ?? {});
|
|
3910
3979
|
const handlers = defineOperations({
|
|
3980
|
+
ListRooms: (context) => this.listRooms(context),
|
|
3911
3981
|
CreateRoom: (context) => this.createRoom(context),
|
|
3912
3982
|
GetRoom: (context) => this.withRoom(context, (room) => jsonRes(200, roomView(room))),
|
|
3913
3983
|
UpdateRoom: (context) => this.updateRoom(context),
|
|
@@ -4020,6 +4090,24 @@ var DailyAPI = class {
|
|
|
4020
4090
|
ids: { roomName: name, ...warning ? { warning } : {} }
|
|
4021
4091
|
});
|
|
4022
4092
|
}
|
|
4093
|
+
listRooms(context) {
|
|
4094
|
+
const query = context.url.searchParams;
|
|
4095
|
+
const rawLimit = query.get("limit");
|
|
4096
|
+
const limit = rawLimit === null ? 100 : Number(rawLimit);
|
|
4097
|
+
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
4098
|
+
return invalid("limit must be a positive integer");
|
|
4099
|
+
const before = query.get("ending_before");
|
|
4100
|
+
const after = query.get("starting_after");
|
|
4101
|
+
if (before !== null && after !== null) return invalid("provide only one room cursor");
|
|
4102
|
+
const rooms = this.state.rooms.list({ order: "newest" }).map((row) => row.value);
|
|
4103
|
+
let selected = rooms;
|
|
4104
|
+
const cursor = before ?? after;
|
|
4105
|
+
if (cursor !== null) {
|
|
4106
|
+
const index = rooms.findIndex((room) => room.id === cursor);
|
|
4107
|
+
selected = index < 0 ? [] : before !== null ? rooms.slice(index + 1) : rooms.slice(0, index);
|
|
4108
|
+
}
|
|
4109
|
+
return jsonRes(200, { total_count: rooms.length, data: selected.slice(0, limit).map(roomView) });
|
|
4110
|
+
}
|
|
4023
4111
|
updateRoom(context) {
|
|
4024
4112
|
return this.withRoom(context, (room) => {
|
|
4025
4113
|
const body = record(context);
|
|
@@ -4318,4 +4406,4 @@ export {
|
|
|
4318
4406
|
DailyAPI,
|
|
4319
4407
|
synthesizeTranscript
|
|
4320
4408
|
};
|
|
4321
|
-
//# sourceMappingURL=chunk-
|
|
4409
|
+
//# sourceMappingURL=chunk-ZJLG2FE7.js.map
|