@rindle/api-server 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +326 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +854 -22
- package/dist/index.js.map +1 -1
- package/dist/rooms.d.ts +194 -0
- package/dist/rooms.d.ts.map +1 -0
- package/dist/rooms.js +393 -0
- package/dist/rooms.js.map +1 -0
- package/package.json +6 -5
- package/src/index.ts +1213 -23
- package/src/rooms.ts +578 -0
package/dist/rooms.js
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
// Room profiles — the DECLARATION layer of Rindle Realtime query enablement
|
|
2
|
+
// (designs/RINDLE-REALTIME-QUERY-ENABLEMENT-DESIGN.md §2): the api-server owns a small set of
|
|
3
|
+
// NAMED room profiles (key derivation + canonical unwindowed footprint + read-only context
|
|
4
|
+
// tables), and client queries opt into one via their `defineQuery` realtime label. This module is
|
|
5
|
+
// the pure-TS compile/validate half — "loud at registration" (§2.3): every rule checkable at
|
|
6
|
+
// `createRindleApiServer` construction throws (or warns) THERE, not at a 3am room boot.
|
|
7
|
+
//
|
|
8
|
+
// The serve DECISION (covering proof, lease wire changes, room tokens) is the NEXT slice
|
|
9
|
+
// (G-iv-b); it consumes the {@link CompiledRoomProfile} records this module produces. Only
|
|
10
|
+
// {@link RoomProfile}, {@link queryResultToAst} and {@link queryRealtimeLabel} are re-exported
|
|
11
|
+
// from the package index — the compiled shapes and the wire-key helpers stay internal.
|
|
12
|
+
export function queryResultToAst(result) {
|
|
13
|
+
if (result && typeof result === "object" && "ast" in result && typeof result.ast === "function") {
|
|
14
|
+
return result.ast();
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
// ------------------------------------------------------------------------------- wire room keys
|
|
19
|
+
/** The wire room-key delimiter: a named profile's doc is `"<profile>/<key>"`; a doc with no known
|
|
20
|
+
* profile prefix belongs to the legacy anonymous profile (`resolveFootprint`, bare-key form). */
|
|
21
|
+
export const ROOM_DOC_SEPARATOR = "/";
|
|
22
|
+
/** Mint the wire room doc for a named profile (the lease path — G-iv-b — mints these). */
|
|
23
|
+
export function mintRoomDoc(profile, key) {
|
|
24
|
+
return `${profile}${ROOM_DOC_SEPARATOR}${key}`;
|
|
25
|
+
}
|
|
26
|
+
/** Split a wire room doc at the FIRST separator. `undefined` for a bare doc (no separator, or an
|
|
27
|
+
* empty would-be profile name). The CALLER decides whether the prefix actually names a profile —
|
|
28
|
+
* a legacy doc may itself contain `/`, and then falls through to the legacy resolver whole. */
|
|
29
|
+
export function splitRoomDoc(doc) {
|
|
30
|
+
const i = doc.indexOf(ROOM_DOC_SEPARATOR);
|
|
31
|
+
if (i <= 0)
|
|
32
|
+
return undefined;
|
|
33
|
+
return { profile: doc.slice(0, i), key: doc.slice(i + 1) };
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* §2.3 "profile footprints are unwindowed", enforced: throw loudly (with the offending AST path)
|
|
37
|
+
* if `limit` / `start` (cursor paging — the skip lowering) / `one` appears ANYWHERE in the
|
|
38
|
+
* footprint tree — the root, a related subquery, or an EXISTS child. A window computed over an
|
|
39
|
+
* unwindowed superset equals the window over the full store, which is what makes room-serving of
|
|
40
|
+
* windowed *queries* sound; a windowed *footprint* would silently break that, so it is rejected
|
|
41
|
+
* by construction. Windows belong on the labeled queries a room serves, never on the footprint.
|
|
42
|
+
*/
|
|
43
|
+
export function assertUnwindowedFootprint(ast, profile) {
|
|
44
|
+
const hit = findWindow(ast, "footprint");
|
|
45
|
+
if (hit === undefined)
|
|
46
|
+
return;
|
|
47
|
+
throw new Error(`room profile "${profile}": the footprint must be UNWINDOWED — found ${hit.kind} at ${hit.path}. ` +
|
|
48
|
+
`Windows (limit/start/one) belong on the labeled queries a room serves, never on the room's ` +
|
|
49
|
+
`footprint (RINDLE-REALTIME-QUERY-ENABLEMENT §2.3).`);
|
|
50
|
+
}
|
|
51
|
+
function findWindow(ast, path) {
|
|
52
|
+
if (ast.limit !== undefined)
|
|
53
|
+
return { kind: `limit(${ast.limit})`, path: `${path}.limit` };
|
|
54
|
+
if (ast.start !== undefined)
|
|
55
|
+
return { kind: "start (cursor paging)", path: `${path}.start` };
|
|
56
|
+
if (ast.one === true)
|
|
57
|
+
return { kind: "one()", path: `${path}.one` };
|
|
58
|
+
for (const [i, rel] of (ast.related ?? []).entries()) {
|
|
59
|
+
const hit = findWindow(rel.subquery, `${path}.related[${rel.subquery.alias ?? i}]`);
|
|
60
|
+
if (hit !== undefined)
|
|
61
|
+
return hit;
|
|
62
|
+
}
|
|
63
|
+
return (findWindowInCondition(ast.where, `${path}.where`) ?? findWindowInCondition(ast.having, `${path}.having`));
|
|
64
|
+
}
|
|
65
|
+
function findWindowInCondition(cond, path) {
|
|
66
|
+
if (cond === undefined)
|
|
67
|
+
return undefined;
|
|
68
|
+
switch (cond.type) {
|
|
69
|
+
case "simple":
|
|
70
|
+
return undefined;
|
|
71
|
+
case "and":
|
|
72
|
+
case "or": {
|
|
73
|
+
for (const [i, c] of cond.conditions.entries()) {
|
|
74
|
+
const hit = findWindowInCondition(c, `${path}.${cond.type}[${i}]`);
|
|
75
|
+
if (hit !== undefined)
|
|
76
|
+
return hit;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
case "correlatedSubquery": {
|
|
81
|
+
const label = cond.op === "EXISTS" ? "exists" : "notExists";
|
|
82
|
+
const sub = cond.related.subquery;
|
|
83
|
+
return findWindow(sub, `${path}.${label}[${sub.alias ?? sub.table}]`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Walk the footprint: every base table it draws rows from, and — per table — the correlation
|
|
88
|
+
* (join-key) columns every related/EXISTS edge binds on it. These are §3.2's routing metadata
|
|
89
|
+
* and slice H's "room mutators never write join keys" enforcement input; G-iv-b ships them to
|
|
90
|
+
* the room engine as part of the RoomTableSpec compilation ({@link compileRoomTableSpecs}). */
|
|
91
|
+
export function scanFootprint(ast) {
|
|
92
|
+
const scan = { tables: new Set(), joinKeys: new Map() };
|
|
93
|
+
scanAst(ast, scan);
|
|
94
|
+
return scan;
|
|
95
|
+
}
|
|
96
|
+
function addJoinKeys(scan, table, cols) {
|
|
97
|
+
let set = scan.joinKeys.get(table);
|
|
98
|
+
if (set === undefined) {
|
|
99
|
+
set = new Set();
|
|
100
|
+
scan.joinKeys.set(table, set);
|
|
101
|
+
}
|
|
102
|
+
for (const c of cols)
|
|
103
|
+
set.add(c);
|
|
104
|
+
}
|
|
105
|
+
function scanAst(ast, scan) {
|
|
106
|
+
scan.tables.add(ast.table);
|
|
107
|
+
for (const rel of ast.related ?? [])
|
|
108
|
+
scanEdge(ast.table, rel, scan);
|
|
109
|
+
scanCondition(ast.table, ast.where, scan);
|
|
110
|
+
scanCondition(ast.table, ast.having, scan);
|
|
111
|
+
}
|
|
112
|
+
function scanEdge(parentTable, edge, scan) {
|
|
113
|
+
addJoinKeys(scan, parentTable, edge.correlation.parentField);
|
|
114
|
+
addJoinKeys(scan, edge.subquery.table, edge.correlation.childField);
|
|
115
|
+
scanAst(edge.subquery, scan);
|
|
116
|
+
}
|
|
117
|
+
function scanCondition(table, cond, scan) {
|
|
118
|
+
if (cond === undefined)
|
|
119
|
+
return;
|
|
120
|
+
switch (cond.type) {
|
|
121
|
+
case "simple":
|
|
122
|
+
return;
|
|
123
|
+
case "and":
|
|
124
|
+
case "or":
|
|
125
|
+
for (const c of cond.conditions)
|
|
126
|
+
scanCondition(table, c, scan);
|
|
127
|
+
return;
|
|
128
|
+
case "correlatedSubquery":
|
|
129
|
+
scanEdge(table, cond.related, scan);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/** Compile the per-table {@link RoomScopeSpec}s from a RESOLVED footprint AST + the profile's
|
|
134
|
+
* context set — the ONE compiler both wires derive from (the boot wire ships it whole; the
|
|
135
|
+
* lease wire serializes the {@link RoomTableSpec} projection via {@link compileRoomTableSpecs}).
|
|
136
|
+
* Deterministic output order (tables sorted by name). */
|
|
137
|
+
export function compileRoomScopeSpecs(footprint, context) {
|
|
138
|
+
const scan = scanFootprint(footprint);
|
|
139
|
+
const specs = [];
|
|
140
|
+
for (const table of [...scan.tables].sort()) {
|
|
141
|
+
const where = tablePredicate(footprint, table);
|
|
142
|
+
const spec = { table, writable: { kind: "none" } };
|
|
143
|
+
// footprintWhere is EXACT-only (see the RoomScopeSpec doc): the widened `where` feeds the
|
|
144
|
+
// writable side below, never the absent-read proof.
|
|
145
|
+
const membership = exactMembershipPredicate(footprint, table);
|
|
146
|
+
if (membership !== undefined)
|
|
147
|
+
spec.footprintWhere = membership;
|
|
148
|
+
if (!context.has(table)) {
|
|
149
|
+
const joinKeyCols = [...(scan.joinKeys.get(table) ?? [])].sort();
|
|
150
|
+
spec.writable =
|
|
151
|
+
where === undefined ? { kind: "predicate", joinKeyCols } : { kind: "predicate", where, joinKeyCols };
|
|
152
|
+
}
|
|
153
|
+
specs.push(spec);
|
|
154
|
+
}
|
|
155
|
+
return specs;
|
|
156
|
+
}
|
|
157
|
+
/** The vacuous-true wire condition (`empty AND` — the room gate's combinator pins it true): what
|
|
158
|
+
* an EXACT but unconstrained footprint root emits as its membership predicate. */
|
|
159
|
+
const CONDITION_TRUE = { type: "and", conditions: [] };
|
|
160
|
+
/** The footprint's EXACT membership predicate for `table`, or `undefined` when none exists (see
|
|
161
|
+
* the {@link RoomScopeSpec} doc for why absent-read proofs must never see a widened one):
|
|
162
|
+
* defined iff every node reading the table is the footprint ROOT node (a child node's implicit
|
|
163
|
+
* parent correlation is a dropped constraint, so any child/EXISTS occurrence forfeits exactness)
|
|
164
|
+
* and the root's `where` extraction is LOSSLESS. An exact unconstrained root (whole table in the
|
|
165
|
+
* footprint) yields {@link CONDITION_TRUE}. */
|
|
166
|
+
function exactMembershipPredicate(footprint, table) {
|
|
167
|
+
const nodes = [];
|
|
168
|
+
collectTableNodes(footprint, table, nodes);
|
|
169
|
+
if (nodes.length === 0 || !nodes.every((n) => n.isRoot))
|
|
170
|
+
return undefined;
|
|
171
|
+
// isRoot can only be true for the top-level node, so an all-root list has exactly one entry.
|
|
172
|
+
const { cond, exact } = rowLocalExtraction(nodes[0].node.where);
|
|
173
|
+
if (!exact)
|
|
174
|
+
return undefined;
|
|
175
|
+
return cond ?? CONDITION_TRUE;
|
|
176
|
+
}
|
|
177
|
+
/** Compile the per-table {@link RoomTableSpec}s from a RESOLVED footprint AST + the profile's
|
|
178
|
+
* context set — since H-iii the lease wire carries `footprintWhere` exactly where the boot wire
|
|
179
|
+
* does, so this IS {@link compileRoomScopeSpecs} (one compiler, two wires; the identity is
|
|
180
|
+
* pinned by serve-proof.test.ts). Kept as a named entry point for the lease call site. */
|
|
181
|
+
export function compileRoomTableSpecs(footprint, context) {
|
|
182
|
+
return compileRoomScopeSpecs(footprint, context);
|
|
183
|
+
}
|
|
184
|
+
/** The footprint's row-local predicate for `table`: per NODE reading the table, the row-local
|
|
185
|
+
* extraction of its `where`; multiple nodes OR together (a row held under EITHER node's
|
|
186
|
+
* predicate is in the footprint's row set). Any unconstrained node ⇒ `undefined` (no row-local
|
|
187
|
+
* constraint at all — the widest sound answer). */
|
|
188
|
+
function tablePredicate(ast, table) {
|
|
189
|
+
const nodes = [];
|
|
190
|
+
collectTableNodes(ast, table, nodes);
|
|
191
|
+
const parts = [];
|
|
192
|
+
for (const { node } of nodes) {
|
|
193
|
+
const local = rowLocalCondition(node.where);
|
|
194
|
+
if (local === undefined)
|
|
195
|
+
return undefined; // one unconstrained node ⇒ the table is unconstrained
|
|
196
|
+
parts.push(local);
|
|
197
|
+
}
|
|
198
|
+
if (parts.length === 0)
|
|
199
|
+
return undefined;
|
|
200
|
+
return parts.length === 1 ? parts[0] : { type: "or", conditions: parts };
|
|
201
|
+
}
|
|
202
|
+
function collectTableNodes(ast, table, out, isRoot = true) {
|
|
203
|
+
if (ast.table === table)
|
|
204
|
+
out.push({ node: ast, isRoot });
|
|
205
|
+
for (const rel of ast.related ?? [])
|
|
206
|
+
collectTableNodes(rel.subquery, table, out, false);
|
|
207
|
+
collectTableNodesInCondition(ast.where, table, out);
|
|
208
|
+
collectTableNodesInCondition(ast.having, table, out);
|
|
209
|
+
}
|
|
210
|
+
function collectTableNodesInCondition(cond, table, out) {
|
|
211
|
+
if (cond === undefined)
|
|
212
|
+
return;
|
|
213
|
+
switch (cond.type) {
|
|
214
|
+
case "simple":
|
|
215
|
+
return;
|
|
216
|
+
case "and":
|
|
217
|
+
case "or":
|
|
218
|
+
for (const c of cond.conditions)
|
|
219
|
+
collectTableNodesInCondition(c, table, out);
|
|
220
|
+
return;
|
|
221
|
+
case "correlatedSubquery":
|
|
222
|
+
collectTableNodes(cond.related.subquery, table, out, false);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/** Extract the row-local part of one node's condition tree, WIDENING (see {@link RoomTableSpec}):
|
|
227
|
+
* `undefined` = "no constraint kept". The writable side's entry point — for absent-read proofs
|
|
228
|
+
* use {@link exactMembershipPredicate}, never this. */
|
|
229
|
+
function rowLocalCondition(cond) {
|
|
230
|
+
return rowLocalExtraction(cond).cond;
|
|
231
|
+
}
|
|
232
|
+
/** The row-local extraction WITH exactness: `exact` means `cond` is equivalent to the input —
|
|
233
|
+
* nothing was dropped (an `undefined` input is exactly the vacuous-true constraint). Kept:
|
|
234
|
+
* simple column-vs-literal comparisons; `and` keeps its extractable conjuncts (dropping the
|
|
235
|
+
* rest widens ⇒ inexact); `or` survives only when EVERY disjunct is extractable (dropping a
|
|
236
|
+
* disjunct would narrow — the whole OR drops instead, inexact); `correlatedSubquery` always
|
|
237
|
+
* drops (inexact). */
|
|
238
|
+
function rowLocalExtraction(cond) {
|
|
239
|
+
if (cond === undefined)
|
|
240
|
+
return { cond: undefined, exact: true };
|
|
241
|
+
switch (cond.type) {
|
|
242
|
+
case "simple": {
|
|
243
|
+
const columnVsLiteral = (cond.left.type === "column" && cond.right.type === "literal") ||
|
|
244
|
+
(cond.left.type === "literal" && cond.right.type === "column");
|
|
245
|
+
return columnVsLiteral ? { cond, exact: true } : { cond: undefined, exact: false };
|
|
246
|
+
}
|
|
247
|
+
case "and": {
|
|
248
|
+
const parts = cond.conditions.map(rowLocalExtraction);
|
|
249
|
+
const kept = parts.map((p) => p.cond).filter((c) => c !== undefined);
|
|
250
|
+
const exact = parts.every((p) => p.exact);
|
|
251
|
+
if (kept.length === 0)
|
|
252
|
+
return { cond: undefined, exact };
|
|
253
|
+
return { cond: kept.length === 1 ? kept[0] : { type: "and", conditions: kept }, exact };
|
|
254
|
+
}
|
|
255
|
+
case "or": {
|
|
256
|
+
const parts = cond.conditions.map(rowLocalExtraction);
|
|
257
|
+
// DROPPING a disjunct would narrow (unsound even for the widening direction) — the whole
|
|
258
|
+
// OR drops. But a disjunct that merely WIDENED (a partially-extracted AND) stays: widening
|
|
259
|
+
// every disjunct widens the OR, which is fine for the writable side and marked inexact.
|
|
260
|
+
if (parts.some((p) => p.cond === undefined))
|
|
261
|
+
return { cond: undefined, exact: false };
|
|
262
|
+
const kept = parts.map((p) => p.cond);
|
|
263
|
+
return {
|
|
264
|
+
cond: kept.length === 1 ? kept[0] : { type: "or", conditions: kept },
|
|
265
|
+
exact: parts.every((p) => p.exact),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
case "correlatedSubquery":
|
|
269
|
+
return { cond: undefined, exact: false }; // never row-local; the room relays footprint rows
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/** The symbolic doc key construction-time validation resolves each footprint with. A profile
|
|
273
|
+
* footprint should be a TOTAL builder over any key; one that throws on this key (or is async /
|
|
274
|
+
* ctx-dependent) simply defers its unwindowed check to boot, with a loud warning. */
|
|
275
|
+
export const PROBE_DOC_KEY = "__rindle-room-profile-probe__";
|
|
276
|
+
/**
|
|
277
|
+
* Compile + validate the named room profiles — §2.3 "loud at registration". Rules enforced here:
|
|
278
|
+
* the profile name is wire-key-safe (no `/`); (b) the footprint is UNWINDOWED (throw, with the
|
|
279
|
+
* offending AST path); (c) context tables exist in the schema and are a subset of the footprint's
|
|
280
|
+
* tables (throw); (d) per-table join-key columns are derived and RECORDED on the compiled profile
|
|
281
|
+
* (a loud WARNING when the footprint isn't statically resolvable and they can't be).
|
|
282
|
+
*/
|
|
283
|
+
export function compileRoomProfiles(input) {
|
|
284
|
+
const warn = input.warn ?? ((message) => console.warn(message));
|
|
285
|
+
const out = new Map();
|
|
286
|
+
for (const [name, profile] of Object.entries(input.rooms ?? {})) {
|
|
287
|
+
if (name.length === 0 || name.includes(ROOM_DOC_SEPARATOR)) {
|
|
288
|
+
throw new Error(`realtime.rooms: invalid profile name ${JSON.stringify(name)} — profile names are non-empty and may ` +
|
|
289
|
+
`not contain "${ROOM_DOC_SEPARATOR}" (it delimits the wire room key "<profile>${ROOM_DOC_SEPARATOR}<key>").`);
|
|
290
|
+
}
|
|
291
|
+
if (typeof profile.key !== "function") {
|
|
292
|
+
throw new Error(`realtime.rooms.${name}: \`key\` must be a function (args) => string.`);
|
|
293
|
+
}
|
|
294
|
+
if (typeof profile.footprint !== "function") {
|
|
295
|
+
throw new Error(`realtime.rooms.${name}: \`footprint\` must be a function (docKey, ctx) => Query | Ast.`);
|
|
296
|
+
}
|
|
297
|
+
const context = new Set(profile.context ?? []);
|
|
298
|
+
if (input.schema !== undefined) {
|
|
299
|
+
for (const t of context) {
|
|
300
|
+
if (input.schema.tables[t] === undefined) {
|
|
301
|
+
throw new Error(`realtime.rooms.${name}: context table "${t}" is not in the schema — \`context\` lists the ` +
|
|
302
|
+
`footprint tables the room follows read-only (§2.2).`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// Statically resolve the footprint with a symbolic key. An async / ctx-dependent / throwing
|
|
307
|
+
// footprint can't be checked here — warn loudly and defer the unwindowed rule to boot time.
|
|
308
|
+
let ast;
|
|
309
|
+
let unresolvable;
|
|
310
|
+
try {
|
|
311
|
+
const result = profile.footprint(PROBE_DOC_KEY, { user: undefined });
|
|
312
|
+
if (isThenable(result)) {
|
|
313
|
+
// The probe's promise is deliberately abandoned — swallow a late rejection.
|
|
314
|
+
void Promise.resolve(result).then(undefined, () => undefined);
|
|
315
|
+
unresolvable = "the footprint is async";
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
ast = queryResultToAst(result);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
unresolvable = `the footprint threw on the symbolic probe key: ${String(e?.message ?? e)}`;
|
|
323
|
+
}
|
|
324
|
+
let staticFacts;
|
|
325
|
+
if (ast !== undefined) {
|
|
326
|
+
assertUnwindowedFootprint(ast, name); // (b) — throws with the offending path
|
|
327
|
+
const scan = scanFootprint(ast);
|
|
328
|
+
for (const t of context) {
|
|
329
|
+
if (!scan.tables.has(t)) {
|
|
330
|
+
throw new Error(`realtime.rooms.${name}: context table "${t}" is not loaded by the footprint (footprint tables: ` +
|
|
331
|
+
`${[...scan.tables].sort().map((x) => `"${x}"`).join(", ")}) — context must be a SUBSET of the ` +
|
|
332
|
+
`footprint's tables: followed means loaded-but-room-read-only (§2.2).`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
staticFacts = {
|
|
336
|
+
ast,
|
|
337
|
+
tables: scan.tables,
|
|
338
|
+
writableTables: new Set([...scan.tables].filter((t) => !context.has(t))),
|
|
339
|
+
joinKeys: scan.joinKeys,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
warn(`realtime.rooms.${name}: the footprint could not be statically resolved at registration ` +
|
|
344
|
+
`(${unresolvable}) — the unwindowed check (§2.3) will run at each room boot instead, and the ` +
|
|
345
|
+
`per-table join-key columns (§3.2 routing metadata) could not be derived.`);
|
|
346
|
+
}
|
|
347
|
+
out.set(name, { name, key: profile.key, footprint: profile.footprint, context, static: staticFacts });
|
|
348
|
+
}
|
|
349
|
+
return out;
|
|
350
|
+
}
|
|
351
|
+
function isThenable(v) {
|
|
352
|
+
return v !== null && typeof v === "object" && typeof v.then === "function";
|
|
353
|
+
}
|
|
354
|
+
// ------------------------------------------------------------------ realtime-label carry-through
|
|
355
|
+
//
|
|
356
|
+
// `registerQueries` erases everything but a bare resolve function at its seam; the realtime label
|
|
357
|
+
// must survive it so the lease path (G-iv-b) can look up (profile, args mapping) by query name.
|
|
358
|
+
// It rides a symbol property on the registered wrapper; {@link queryRealtimeLabel} is the ONE
|
|
359
|
+
// accessor — G-iv-b reads through it, never through ad-hoc properties.
|
|
360
|
+
const API_QUERY_REALTIME_LABEL = Symbol("rindle.apiQuery.realtimeLabel");
|
|
361
|
+
/** @internal Stamp a registered query wrapper with its `defineQuery` realtime label. */
|
|
362
|
+
export function attachRealtimeLabel(wrapper, label) {
|
|
363
|
+
return Object.assign(wrapper, { [API_QUERY_REALTIME_LABEL]: label });
|
|
364
|
+
}
|
|
365
|
+
/** The realtime label a registered query carries (stamped by `registerQueries` from its
|
|
366
|
+
* `defineQuery` options), or `undefined` for an unlabeled query. The lease path uses this to
|
|
367
|
+
* derive `(room profile, args mapping)` for a named query. */
|
|
368
|
+
export function queryRealtimeLabel(query) {
|
|
369
|
+
if (typeof query !== "function")
|
|
370
|
+
return undefined;
|
|
371
|
+
return query[API_QUERY_REALTIME_LABEL];
|
|
372
|
+
}
|
|
373
|
+
/** Rule (a) of the §2.3 "loud at registration" checks: every labeled registered query must name
|
|
374
|
+
* an existing room profile — a label pointing at nothing is config drift that would otherwise
|
|
375
|
+
* surface as a query that silently never room-serves. */
|
|
376
|
+
export function assertLabeledProfilesExist(queries, profiles) {
|
|
377
|
+
for (const [name, q] of Object.entries(queries ?? {})) {
|
|
378
|
+
const label = queryRealtimeLabel(q);
|
|
379
|
+
if (label === undefined)
|
|
380
|
+
continue;
|
|
381
|
+
if (!profiles.has(label.room)) {
|
|
382
|
+
const configured = [...profiles.keys()];
|
|
383
|
+
throw new Error(`query "${name}" is labeled realtime (room profile "${label.room}") but no such profile is ` +
|
|
384
|
+
`configured — ` +
|
|
385
|
+
(configured.length > 0
|
|
386
|
+
? `configured profiles: ${configured.map((p) => `"${p}"`).join(", ")}. `
|
|
387
|
+
: `no realtime.rooms profiles are configured. `) +
|
|
388
|
+
`Add realtime.rooms["${label.room}"] to createRindleApiServer or remove the label ` +
|
|
389
|
+
`(RINDLE-REALTIME-QUERY-ENABLEMENT §2.1).`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=rooms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooms.js","sourceRoot":"","sources":["../src/rooms.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,8FAA8F;AAC9F,2FAA2F;AAC3F,kGAAkG;AAClG,6FAA6F;AAC7F,wFAAwF;AACxF,EAAE;AACF,yFAAyF;AACzF,2FAA2F;AAC3F,+FAA+F;AAC/F,uFAAuF;AA+BvF,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;QAChG,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,MAAa,CAAC;AACvB,CAAC;AAED,iGAAiG;AAEjG;kGACkG;AAClG,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,0FAA0F;AAC1F,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,GAAW;IACtD,OAAO,GAAG,OAAO,GAAG,kBAAkB,GAAG,GAAG,EAAE,CAAC;AACjD,CAAC;AAED;;gGAEgG;AAChG,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI,CAAC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C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;oBACxE,CAAC,CAAC,6CAA6C,CAAC;gBAClD,uBAAuB,KAAK,CAAC,IAAI,kDAAkD;gBACnF,0CAA0C,CAC7C,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rindle/api-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@rindle/client": "0.
|
|
29
|
-
"@rindle/daemon-client": "0.
|
|
30
|
-
"@rindle/query-compiler": "0.
|
|
28
|
+
"@rindle/client": "0.5.0",
|
|
29
|
+
"@rindle/daemon-client": "0.5.0",
|
|
30
|
+
"@rindle/query-compiler": "0.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^22.10.0",
|
|
34
|
-
"typescript": "^5.7.0"
|
|
34
|
+
"typescript": "^5.7.0",
|
|
35
|
+
"@rindle/room": "0.0.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "tsc -p tsconfig.build.json",
|