@procedures/client 0.22.0 → 0.22.1
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 +22 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/events/publisher.d.ts +9 -4
- package/dist/events/publisher.d.ts.map +1 -1
- package/dist/events/publisher.js +39 -11
- package/dist/events/publisher.js.map +1 -1
- package/dist/procedures/collection/partition.d.ts +21 -0
- package/dist/procedures/collection/partition.d.ts.map +1 -1
- package/dist/procedures/collection/partition.js +27 -0
- package/dist/procedures/collection/partition.js.map +1 -1
- package/package.json +1 -1
- package/src/events/publisher.ts +47 -15
- package/src/procedures/collection/partition.ts +32 -0
|
@@ -148,8 +148,13 @@ export declare class EventPublisher {
|
|
|
148
148
|
* collection names the partition that the subscriber asks for, as the input of a procedure does:
|
|
149
149
|
* the resolver of the repository gives the partition, so a subscriber cannot name the topic of
|
|
150
150
|
* another tenant. A collection without partitions refuses a topic with a partition.
|
|
151
|
+
*
|
|
152
|
+
* Without a partition, the topic of the bus is the plain topic of the collection. The plain topic
|
|
153
|
+
* of `a.b` is also the topic of the partition `b` of `a`. While `a` has partitions, the route
|
|
154
|
+
* refuses the subscriber, at the start, at each re-check and before each event (roadmap CLI-70,
|
|
155
|
+
* decision D23). Thus HTTP, WebSocket and MCP subscribers all get the refusal.
|
|
151
156
|
*/
|
|
152
|
-
private
|
|
157
|
+
private route;
|
|
153
158
|
/**
|
|
154
159
|
* The resources that a subscriber of a topic reads. The default (`collectionTopicReads`) reads
|
|
155
160
|
* the collection of the topic with the rule of the listener (`collectionTopicTarget`) and the
|
|
@@ -163,9 +168,9 @@ export declare class EventPublisher {
|
|
|
163
168
|
private admitTopics;
|
|
164
169
|
/**
|
|
165
170
|
* The admission of an open subscription again (roadmap CLI-44): the checks of its start, and the
|
|
166
|
-
* partition of each topic. A refusal of the resolver
|
|
167
|
-
* changed throws `FORBIDDEN` (reason `partition-not-allowed`),
|
|
168
|
-
* partition.
|
|
171
|
+
* partition of each topic. A refusal of the resolver or of the check of a plain topic throws its
|
|
172
|
+
* error. A topic whose partition changed throws `FORBIDDEN` (reason `partition-not-allowed`),
|
|
173
|
+
* because the listener has the old partition.
|
|
169
174
|
*/
|
|
170
175
|
private readmit;
|
|
171
176
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publisher.d.ts","sourceRoot":"","sources":["../../src/events/publisher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAoB,MAAM,wBAAwB,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,YAAY,CAAC;AAIxD,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAwB,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEjG,2DAA2D;AAC3D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;AAEzE,2DAA2D;AAC3D,MAAM,WAAW,SAAS;IACxB,yFAAyF;IACzF,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5C;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,mGAAmG;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G,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuC;IAC7D,0FAA0F;IAC1F,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgC;IACrD,gFAAgF;IAChF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEhD,YAAY,OAAO,EAAE,qBAAqB,EAmBzC;IAED,2FAA2F;IAC3F,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAEvC;IAED,wCAAwC;IACxC,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACH,GAAG,IAAI,IAAI,CAEV;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAED;;;;;;;;;;OAUG;YACW,KAAK;IAWnB;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAKf;;;OAGG;IACH,OAAO,CAAC,WAAW;IAqBnB;;;;;OAKG;YACW,OAAO;IASrB;;;OAGG;YACW,SAAS;CAWxB"}
|
package/dist/events/publisher.js
CHANGED
|
@@ -30,7 +30,7 @@ import { createProcedure } from "../procedures/define.js";
|
|
|
30
30
|
import { InvocationError } from "../procedures/invoke.js";
|
|
31
31
|
import { capabilityRefusal } from "../procedures/capability.js";
|
|
32
32
|
import { collectionChangeTopic, collectionTopicReads } from "../procedures/collection/changes.js";
|
|
33
|
-
import { collectionTopicTarget, partitionOfCall } from "../procedures/collection/partition.js";
|
|
33
|
+
import { collectionTopicTarget, partitionOfCall, plainTopicCheck } from "../procedures/collection/partition.js";
|
|
34
34
|
import { getGlobalEventBus } from "./bus.js";
|
|
35
35
|
import { EVENTS_SUBSCRIBE_PATH } from "./remote.js";
|
|
36
36
|
import { admittedValue, rowsOf } from "./rows.js";
|
|
@@ -120,7 +120,7 @@ class TopicSubscription {
|
|
|
120
120
|
/** The functions that run when the subscription ends */
|
|
121
121
|
endListeners = [];
|
|
122
122
|
constructor(bus,
|
|
123
|
-
/** The topics of the subscriber, each with the topic of the bus that it listens to */
|
|
123
|
+
/** The topics of the subscriber, each with the topic of the bus that it listens to and the check of each event */
|
|
124
124
|
routes, buffer, signal, onClose,
|
|
125
125
|
/** The output filter of the host for this subscriber: each row of a value passes it */
|
|
126
126
|
admit,
|
|
@@ -133,9 +133,27 @@ class TopicSubscription {
|
|
|
133
133
|
this.invocation = invocation;
|
|
134
134
|
this.confirmation = { type: "subscribed", topics: routes.map(([topic]) => topic) };
|
|
135
135
|
// Before, clear() removed the listeners, and the subscriber saw no end (EVENTS.md)
|
|
136
|
-
this.unsubscribes = routes.map(([topic, busTopic]) => bus.on(busTopic, (data) => this.
|
|
136
|
+
this.unsubscribes = routes.map(([topic, busTopic, check]) => bus.on(busTopic, (data) => this.take(topic, data, check), { onClear: () => this.fail(clearedError(topic), { keepQueue: true }) }));
|
|
137
137
|
signal?.addEventListener("abort", this.onAbort, { once: true });
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* This function takes one event of a route. When the check of the route throws, the subscription
|
|
141
|
+
* ends with the refusal, and the event goes (roadmap CLI-70).
|
|
142
|
+
*/
|
|
143
|
+
take(topic, data, check) {
|
|
144
|
+
if (this.closed)
|
|
145
|
+
return;
|
|
146
|
+
if (check) {
|
|
147
|
+
try {
|
|
148
|
+
check();
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
this.fail(error);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
this.push(topic, data);
|
|
156
|
+
}
|
|
139
157
|
/** This function closes a subscription whose call aborted before it started. */
|
|
140
158
|
closeIfAborted() {
|
|
141
159
|
if (this.signal?.aborted)
|
|
@@ -368,13 +386,23 @@ export class EventPublisher {
|
|
|
368
386
|
* collection names the partition that the subscriber asks for, as the input of a procedure does:
|
|
369
387
|
* the resolver of the repository gives the partition, so a subscriber cannot name the topic of
|
|
370
388
|
* another tenant. A collection without partitions refuses a topic with a partition.
|
|
389
|
+
*
|
|
390
|
+
* Without a partition, the topic of the bus is the plain topic of the collection. The plain topic
|
|
391
|
+
* of `a.b` is also the topic of the partition `b` of `a`. While `a` has partitions, the route
|
|
392
|
+
* refuses the subscriber, at the start, at each re-check and before each event (roadmap CLI-70,
|
|
393
|
+
* decision D23). Thus HTTP, WebSocket and MCP subscribers all get the refusal.
|
|
371
394
|
*/
|
|
372
|
-
async
|
|
395
|
+
async route(topic, ctx) {
|
|
373
396
|
const target = collectionTopicTarget(topic, ctx.repository);
|
|
374
397
|
if (!target)
|
|
375
|
-
return topic;
|
|
398
|
+
return [topic, topic];
|
|
376
399
|
const partition = await partitionOfCall(ctx, target.collection, target.partition);
|
|
377
|
-
|
|
400
|
+
const busTopic = collectionChangeTopic(target.collection, partition);
|
|
401
|
+
const check = partition === undefined ? plainTopicCheck(ctx, target.collection) : undefined;
|
|
402
|
+
if (!check)
|
|
403
|
+
return [topic, busTopic];
|
|
404
|
+
check();
|
|
405
|
+
return [topic, busTopic, check];
|
|
378
406
|
}
|
|
379
407
|
/**
|
|
380
408
|
* The resources that a subscriber of a topic reads. The default (`collectionTopicReads`) reads
|
|
@@ -415,14 +443,14 @@ export class EventPublisher {
|
|
|
415
443
|
}
|
|
416
444
|
/**
|
|
417
445
|
* The admission of an open subscription again (roadmap CLI-44): the checks of its start, and the
|
|
418
|
-
* partition of each topic. A refusal of the resolver
|
|
419
|
-
* changed throws `FORBIDDEN` (reason `partition-not-allowed`),
|
|
420
|
-
* partition.
|
|
446
|
+
* partition of each topic. A refusal of the resolver or of the check of a plain topic throws its
|
|
447
|
+
* error. A topic whose partition changed throws `FORBIDDEN` (reason `partition-not-allowed`),
|
|
448
|
+
* because the listener has the old partition.
|
|
421
449
|
*/
|
|
422
450
|
async readmit(routes, ctx) {
|
|
423
451
|
this.admitTopics(routes.map(([topic]) => topic), ctx);
|
|
424
452
|
for (const [topic, busTopic] of routes) {
|
|
425
|
-
if ((await this.
|
|
453
|
+
if ((await this.route(topic, ctx))[1] !== busTopic) {
|
|
426
454
|
throw new InvocationError("FORBIDDEN", `The partition of the topic "${topic}" changed, so the subscription ends`, ctx.path, "partition-not-allowed");
|
|
427
455
|
}
|
|
428
456
|
}
|
|
@@ -436,7 +464,7 @@ export class EventPublisher {
|
|
|
436
464
|
this.admitTopics(unique, ctx);
|
|
437
465
|
const routes = [];
|
|
438
466
|
for (const topic of unique)
|
|
439
|
-
routes.push(
|
|
467
|
+
routes.push(await this.route(topic, ctx));
|
|
440
468
|
const subscription = new TopicSubscription(this.bus, routes, this.buffer, ctx.signal, (closed) => this.open.delete(closed), ctx.admit, ctx.invocation);
|
|
441
469
|
this.open.add(subscription);
|
|
442
470
|
// The same checks run again at a change of the rights and after the max age (roadmap CLI-44)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publisher.js","sourceRoot":"","sources":["../../src/events/publisher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAmB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAI/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,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;IACK,KAAK,CAAC,SAAS,CAAC,MAAyB,EAAE,GAAqB;QACtE,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,MAAM,MAAM,GAAY,EAAE,CAAC;QAC3B,KAAK,MAAM,KAAK,IAAI,MAAM;YAAE,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QACvJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC5B,6FAA6F;QAC7F,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAClF,OAAO,YAAY,CAAC,cAAc,EAAE,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
* - The plain topic of a dotted name, `collections.a.b`, is also the topic of the partition `b` of
|
|
18
18
|
* `a`. Thus the server refuses a storage of `a.b` while `a` has partitions (roadmap CLI-57,
|
|
19
19
|
* decision D23).
|
|
20
|
+
* - A collection `a.b` with partitions and no storage keeps its partitions next to `a`. When its
|
|
21
|
+
* resolver gives no partition, the publisher refuses a subscriber of `a.b` while `a` has
|
|
22
|
+
* partitions (roadmap CLI-70).
|
|
20
23
|
*/
|
|
21
24
|
import type { ZodLike } from "../../client/validation/types.js";
|
|
22
25
|
import type { ProcedureContext } from "../types.js";
|
|
@@ -113,5 +116,23 @@ export declare function partitionOfPlainTopic(collection: string): {
|
|
|
113
116
|
* @throws CollectionTopicCollisionError for the first pair with the same topic
|
|
114
117
|
*/
|
|
115
118
|
export declare function assertTopicsApart(plain: Iterable<string>, hasPartitions: (collection: string) => boolean): void;
|
|
119
|
+
/**
|
|
120
|
+
* This function gives the check of a subscriber that listens to the plain topic of a collection
|
|
121
|
+
* (roadmap CLI-70, decision D23). When no partition has that topic, it gives undefined. The check
|
|
122
|
+
* throws `FORBIDDEN` (reason `partition-not-allowed`) while the repository of the call gives
|
|
123
|
+
* partitions to the collection of that partition.
|
|
124
|
+
*
|
|
125
|
+
* - The plain topic of `a.b` is also the topic of the partition `b` of `a`. Thus a subscriber of
|
|
126
|
+
* that topic gets the events of the partition `b` of `a`.
|
|
127
|
+
* - `ProcedureServer` refuses a storage of `a.b` while `a` has partitions (roadmap CLI-57). A
|
|
128
|
+
* collection `a.b` with partitions and no storage passes that check. When its resolver gives no
|
|
129
|
+
* partition, a subscriber of `a.b` listens to the plain topic. This check refuses it.
|
|
130
|
+
* - `EventPublisher` does the check at the start of a subscription, at each re-check and before
|
|
131
|
+
* each event. Thus partitions of `a` that come later also end the subscription.
|
|
132
|
+
*
|
|
133
|
+
* @param ctx - The context of the subscription: the check reads its repository each time
|
|
134
|
+
* @param collection - The collection whose plain topic the subscriber listens to
|
|
135
|
+
*/
|
|
136
|
+
export declare function plainTopicCheck(ctx: ProcedureContext, collection: string): (() => void) | undefined;
|
|
116
137
|
export { collectionTopicPartition, collectionTopicTarget } from "./topic.js";
|
|
117
138
|
//# sourceMappingURL=partition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partition.d.ts","sourceRoot":"","sources":["../../../src/procedures/collection/partition.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"part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EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAQ/H;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,SAAkB,IAAI,mCAAmC;IACzD,kGAAkG;IAClG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,YAAY,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAMrE;CACF;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAG/G;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAK/G;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAUnG;AAGD,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -147,6 +147,33 @@ export function assertTopicsApart(plain, hasPartitions) {
|
|
|
147
147
|
throw new CollectionTopicCollisionError(collection, shared.collection, shared.partition);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* This function gives the check of a subscriber that listens to the plain topic of a collection
|
|
152
|
+
* (roadmap CLI-70, decision D23). When no partition has that topic, it gives undefined. The check
|
|
153
|
+
* throws `FORBIDDEN` (reason `partition-not-allowed`) while the repository of the call gives
|
|
154
|
+
* partitions to the collection of that partition.
|
|
155
|
+
*
|
|
156
|
+
* - The plain topic of `a.b` is also the topic of the partition `b` of `a`. Thus a subscriber of
|
|
157
|
+
* that topic gets the events of the partition `b` of `a`.
|
|
158
|
+
* - `ProcedureServer` refuses a storage of `a.b` while `a` has partitions (roadmap CLI-57). A
|
|
159
|
+
* collection `a.b` with partitions and no storage passes that check. When its resolver gives no
|
|
160
|
+
* partition, a subscriber of `a.b` listens to the plain topic. This check refuses it.
|
|
161
|
+
* - `EventPublisher` does the check at the start of a subscription, at each re-check and before
|
|
162
|
+
* each event. Thus partitions of `a` that come later also end the subscription.
|
|
163
|
+
*
|
|
164
|
+
* @param ctx - The context of the subscription: the check reads its repository each time
|
|
165
|
+
* @param collection - The collection whose plain topic the subscriber listens to
|
|
166
|
+
*/
|
|
167
|
+
export function plainTopicCheck(ctx, collection) {
|
|
168
|
+
const shared = partitionOfPlainTopic(collection);
|
|
169
|
+
if (!shared)
|
|
170
|
+
return undefined;
|
|
171
|
+
return () => {
|
|
172
|
+
if (!ctx.repository?.hasPartitions?.(shared.collection))
|
|
173
|
+
return;
|
|
174
|
+
throw partitionRefused(ctx, `The call has no partition of ${collection}, and the plain topic "${collectionChangeTopic(collection)}" is also the topic of the partition "${shared.partition}" of ${shared.collection} (roadmap CLI-70)`);
|
|
175
|
+
};
|
|
176
|
+
}
|
|
150
177
|
// The parse of a topic lives in topic.ts, with the encode (roadmap CLI-42)
|
|
151
178
|
export { collectionTopicPartition, collectionTopicTarget } from "./topic.js";
|
|
152
179
|
//# sourceMappingURL=partition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partition.js","sourceRoot":"","sources":["../../../src/procedures/collection/partition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"partition.js","sourceRoot":"","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22.1",
|
|
5
5
|
"description": "Procedures as data for TypeScript: define typed procedures once and call them in process, over HTTP, WebSocket, the CLI or MCP. Streaming, middleware, retries, caching and a JSON program format.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"rpc",
|
package/src/events/publisher.ts
CHANGED
|
@@ -31,7 +31,7 @@ import { createProcedure } from "../procedures/define.js";
|
|
|
31
31
|
import { InvocationError, type Invocation } from "../procedures/invoke.js";
|
|
32
32
|
import { capabilityRefusal } from "../procedures/capability.js";
|
|
33
33
|
import { collectionChangeTopic, collectionTopicReads } from "../procedures/collection/changes.js";
|
|
34
|
-
import { collectionTopicTarget, partitionOfCall } from "../procedures/collection/partition.js";
|
|
34
|
+
import { collectionTopicTarget, partitionOfCall, plainTopicCheck } from "../procedures/collection/partition.js";
|
|
35
35
|
import type { AnyProcedure, Capability, ProcedureContext } from "../procedures/types.js";
|
|
36
36
|
import type { Principal } from "../server/types.js";
|
|
37
37
|
import type { EventBus, Unsubscribe } from "./types.js";
|
|
@@ -172,6 +172,12 @@ const eventItemSchema = z.discriminatedUnion("type", [
|
|
|
172
172
|
}),
|
|
173
173
|
]);
|
|
174
174
|
|
|
175
|
+
/**
|
|
176
|
+
* A topic of a subscriber, the topic of the bus that it listens to, and the check of each event
|
|
177
|
+
* of that topic of the bus, or undefined (roadmap CLI-70). The check throws the refusal.
|
|
178
|
+
*/
|
|
179
|
+
type Route = readonly [topic: string, busTopic: string, check?: (() => void) | undefined];
|
|
180
|
+
|
|
175
181
|
/**
|
|
176
182
|
* One subscription: the listeners on the bus and the queue of its events. It is the async
|
|
177
183
|
* iterator of the stream of the call. `return()`, the abort of the signal of the call and
|
|
@@ -196,8 +202,8 @@ class TopicSubscription implements AsyncIterableIterator<EventItem> {
|
|
|
196
202
|
|
|
197
203
|
constructor(
|
|
198
204
|
bus: EventBus,
|
|
199
|
-
/** The topics of the subscriber, each with the topic of the bus that it listens to */
|
|
200
|
-
routes: ReadonlyArray<
|
|
205
|
+
/** The topics of the subscriber, each with the topic of the bus that it listens to and the check of each event */
|
|
206
|
+
routes: ReadonlyArray<Route>,
|
|
201
207
|
private readonly buffer: number,
|
|
202
208
|
private readonly signal: AbortSignal | undefined,
|
|
203
209
|
private readonly onClose: (subscription: TopicSubscription) => void,
|
|
@@ -208,12 +214,29 @@ class TopicSubscription implements AsyncIterableIterator<EventItem> {
|
|
|
208
214
|
) {
|
|
209
215
|
this.confirmation = { type: "subscribed", topics: routes.map(([topic]) => topic) };
|
|
210
216
|
// Before, clear() removed the listeners, and the subscriber saw no end (EVENTS.md)
|
|
211
|
-
this.unsubscribes = routes.map(([topic, busTopic]) =>
|
|
212
|
-
bus.on(busTopic, (data) => this.
|
|
217
|
+
this.unsubscribes = routes.map(([topic, busTopic, check]) =>
|
|
218
|
+
bus.on(busTopic, (data) => this.take(topic, data, check), { onClear: () => this.fail(clearedError(topic), { keepQueue: true }) }),
|
|
213
219
|
);
|
|
214
220
|
signal?.addEventListener("abort", this.onAbort, { once: true });
|
|
215
221
|
}
|
|
216
222
|
|
|
223
|
+
/**
|
|
224
|
+
* This function takes one event of a route. When the check of the route throws, the subscription
|
|
225
|
+
* ends with the refusal, and the event goes (roadmap CLI-70).
|
|
226
|
+
*/
|
|
227
|
+
private take(topic: string, data: unknown, check: (() => void) | undefined): void {
|
|
228
|
+
if (this.closed) return;
|
|
229
|
+
if (check) {
|
|
230
|
+
try {
|
|
231
|
+
check();
|
|
232
|
+
} catch (error) {
|
|
233
|
+
this.fail(error);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
this.push(topic, data);
|
|
238
|
+
}
|
|
239
|
+
|
|
217
240
|
/** This function closes a subscription whose call aborted before it started. */
|
|
218
241
|
closeIfAborted(): this {
|
|
219
242
|
if (this.signal?.aborted) this.close();
|
|
@@ -450,12 +473,21 @@ export class EventPublisher {
|
|
|
450
473
|
* collection names the partition that the subscriber asks for, as the input of a procedure does:
|
|
451
474
|
* the resolver of the repository gives the partition, so a subscriber cannot name the topic of
|
|
452
475
|
* another tenant. A collection without partitions refuses a topic with a partition.
|
|
476
|
+
*
|
|
477
|
+
* Without a partition, the topic of the bus is the plain topic of the collection. The plain topic
|
|
478
|
+
* of `a.b` is also the topic of the partition `b` of `a`. While `a` has partitions, the route
|
|
479
|
+
* refuses the subscriber, at the start, at each re-check and before each event (roadmap CLI-70,
|
|
480
|
+
* decision D23). Thus HTTP, WebSocket and MCP subscribers all get the refusal.
|
|
453
481
|
*/
|
|
454
|
-
private async
|
|
482
|
+
private async route(topic: string, ctx: ProcedureContext): Promise<Route> {
|
|
455
483
|
const target = collectionTopicTarget(topic, ctx.repository);
|
|
456
|
-
if (!target) return topic;
|
|
484
|
+
if (!target) return [topic, topic];
|
|
457
485
|
const partition = await partitionOfCall(ctx, target.collection, target.partition);
|
|
458
|
-
|
|
486
|
+
const busTopic = collectionChangeTopic(target.collection, partition);
|
|
487
|
+
const check = partition === undefined ? plainTopicCheck(ctx, target.collection) : undefined;
|
|
488
|
+
if (!check) return [topic, busTopic];
|
|
489
|
+
check();
|
|
490
|
+
return [topic, busTopic, check];
|
|
459
491
|
}
|
|
460
492
|
|
|
461
493
|
/**
|
|
@@ -495,14 +527,14 @@ export class EventPublisher {
|
|
|
495
527
|
|
|
496
528
|
/**
|
|
497
529
|
* The admission of an open subscription again (roadmap CLI-44): the checks of its start, and the
|
|
498
|
-
* partition of each topic. A refusal of the resolver
|
|
499
|
-
* changed throws `FORBIDDEN` (reason `partition-not-allowed`),
|
|
500
|
-
* partition.
|
|
530
|
+
* partition of each topic. A refusal of the resolver or of the check of a plain topic throws its
|
|
531
|
+
* error. A topic whose partition changed throws `FORBIDDEN` (reason `partition-not-allowed`),
|
|
532
|
+
* because the listener has the old partition.
|
|
501
533
|
*/
|
|
502
|
-
private async readmit(routes: ReadonlyArray<
|
|
534
|
+
private async readmit(routes: ReadonlyArray<Route>, ctx: ProcedureContext): Promise<void> {
|
|
503
535
|
this.admitTopics(routes.map(([topic]) => topic), ctx);
|
|
504
536
|
for (const [topic, busTopic] of routes) {
|
|
505
|
-
if ((await this.
|
|
537
|
+
if ((await this.route(topic, ctx))[1] !== busTopic) {
|
|
506
538
|
throw new InvocationError("FORBIDDEN", `The partition of the topic "${topic}" changed, so the subscription ends`, ctx.path, "partition-not-allowed");
|
|
507
539
|
}
|
|
508
540
|
}
|
|
@@ -515,8 +547,8 @@ export class EventPublisher {
|
|
|
515
547
|
private async subscribe(topics: readonly string[], ctx: ProcedureContext): Promise<TopicSubscription> {
|
|
516
548
|
const unique = [...new Set(topics)];
|
|
517
549
|
this.admitTopics(unique, ctx);
|
|
518
|
-
const routes:
|
|
519
|
-
for (const topic of unique) routes.push(
|
|
550
|
+
const routes: Route[] = [];
|
|
551
|
+
for (const topic of unique) routes.push(await this.route(topic, ctx));
|
|
520
552
|
const subscription = new TopicSubscription(this.bus, routes, this.buffer, ctx.signal, (closed) => this.open.delete(closed), ctx.admit, ctx.invocation);
|
|
521
553
|
this.open.add(subscription);
|
|
522
554
|
// The same checks run again at a change of the rights and after the max age (roadmap CLI-44)
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
* - The plain topic of a dotted name, `collections.a.b`, is also the topic of the partition `b` of
|
|
18
18
|
* `a`. Thus the server refuses a storage of `a.b` while `a` has partitions (roadmap CLI-57,
|
|
19
19
|
* decision D23).
|
|
20
|
+
* - A collection `a.b` with partitions and no storage keeps its partitions next to `a`. When its
|
|
21
|
+
* resolver gives no partition, the publisher refuses a subscriber of `a.b` while `a` has
|
|
22
|
+
* partitions (roadmap CLI-70).
|
|
20
23
|
*/
|
|
21
24
|
import type { ZodLike } from "../../client/validation/types.js";
|
|
22
25
|
import { InvocationError } from "../invoke.js";
|
|
@@ -206,5 +209,34 @@ export function assertTopicsApart(plain: Iterable<string>, hasPartitions: (colle
|
|
|
206
209
|
}
|
|
207
210
|
}
|
|
208
211
|
|
|
212
|
+
/**
|
|
213
|
+
* This function gives the check of a subscriber that listens to the plain topic of a collection
|
|
214
|
+
* (roadmap CLI-70, decision D23). When no partition has that topic, it gives undefined. The check
|
|
215
|
+
* throws `FORBIDDEN` (reason `partition-not-allowed`) while the repository of the call gives
|
|
216
|
+
* partitions to the collection of that partition.
|
|
217
|
+
*
|
|
218
|
+
* - The plain topic of `a.b` is also the topic of the partition `b` of `a`. Thus a subscriber of
|
|
219
|
+
* that topic gets the events of the partition `b` of `a`.
|
|
220
|
+
* - `ProcedureServer` refuses a storage of `a.b` while `a` has partitions (roadmap CLI-57). A
|
|
221
|
+
* collection `a.b` with partitions and no storage passes that check. When its resolver gives no
|
|
222
|
+
* partition, a subscriber of `a.b` listens to the plain topic. This check refuses it.
|
|
223
|
+
* - `EventPublisher` does the check at the start of a subscription, at each re-check and before
|
|
224
|
+
* each event. Thus partitions of `a` that come later also end the subscription.
|
|
225
|
+
*
|
|
226
|
+
* @param ctx - The context of the subscription: the check reads its repository each time
|
|
227
|
+
* @param collection - The collection whose plain topic the subscriber listens to
|
|
228
|
+
*/
|
|
229
|
+
export function plainTopicCheck(ctx: ProcedureContext, collection: string): (() => void) | undefined {
|
|
230
|
+
const shared = partitionOfPlainTopic(collection);
|
|
231
|
+
if (!shared) return undefined;
|
|
232
|
+
return () => {
|
|
233
|
+
if (!ctx.repository?.hasPartitions?.(shared.collection)) return;
|
|
234
|
+
throw partitionRefused(
|
|
235
|
+
ctx,
|
|
236
|
+
`The call has no partition of ${collection}, and the plain topic "${collectionChangeTopic(collection)}" is also the topic of the partition "${shared.partition}" of ${shared.collection} (roadmap CLI-70)`,
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
209
241
|
// The parse of a topic lives in topic.ts, with the encode (roadmap CLI-42)
|
|
210
242
|
export { collectionTopicPartition, collectionTopicTarget } from "./topic.js";
|