@procedures/client 0.35.0 → 0.36.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/adapters/http/server/handler.d.ts.map +1 -1
  4. package/dist/adapters/http/server/handler.js +17 -3
  5. package/dist/adapters/http/server/handler.js.map +1 -1
  6. package/dist/adapters/port/transport.d.ts.map +1 -1
  7. package/dist/adapters/port/transport.js +2 -0
  8. package/dist/adapters/port/transport.js.map +1 -1
  9. package/dist/adapters/websocket/server/transport.d.ts.map +1 -1
  10. package/dist/adapters/websocket/server/transport.js +2 -0
  11. package/dist/adapters/websocket/server/transport.js.map +1 -1
  12. package/dist/adapters/websocket/shared/rpc.d.ts.map +1 -1
  13. package/dist/adapters/websocket/shared/rpc.js +14 -5
  14. package/dist/adapters/websocket/shared/rpc.js.map +1 -1
  15. package/dist/browser.d.ts +6 -4
  16. package/dist/browser.d.ts.map +1 -1
  17. package/dist/browser.js +4 -1
  18. package/dist/browser.js.map +1 -1
  19. package/dist/client/errors/index.d.ts +1 -1
  20. package/dist/client/errors/index.d.ts.map +1 -1
  21. package/dist/client/errors/index.js +1 -1
  22. package/dist/client/errors/index.js.map +1 -1
  23. package/dist/client/errors/registry.d.ts +10 -0
  24. package/dist/client/errors/registry.d.ts.map +1 -1
  25. package/dist/client/errors/registry.js +12 -0
  26. package/dist/client/errors/registry.js.map +1 -1
  27. package/dist/client/index.d.ts +1 -1
  28. package/dist/client/index.d.ts.map +1 -1
  29. package/dist/client/index.js +1 -1
  30. package/dist/client/index.js.map +1 -1
  31. package/dist/events/bus.d.ts.map +1 -1
  32. package/dist/events/bus.js +5 -1
  33. package/dist/events/bus.js.map +1 -1
  34. package/dist/events/index.d.ts +1 -1
  35. package/dist/events/index.d.ts.map +1 -1
  36. package/dist/events/publisher.d.ts +18 -2
  37. package/dist/events/publisher.d.ts.map +1 -1
  38. package/dist/events/publisher.js +142 -25
  39. package/dist/events/publisher.js.map +1 -1
  40. package/dist/events/recheck.d.ts +27 -5
  41. package/dist/events/recheck.d.ts.map +1 -1
  42. package/dist/events/recheck.js +11 -10
  43. package/dist/events/recheck.js.map +1 -1
  44. package/dist/procedures/collection/admission.d.ts +26 -7
  45. package/dist/procedures/collection/admission.d.ts.map +1 -1
  46. package/dist/procedures/collection/admission.js +39 -7
  47. package/dist/procedures/collection/admission.js.map +1 -1
  48. package/dist/procedures/collection/changes.d.ts +28 -4
  49. package/dist/procedures/collection/changes.d.ts.map +1 -1
  50. package/dist/procedures/collection/changes.js +50 -6
  51. package/dist/procedures/collection/changes.js.map +1 -1
  52. package/dist/procedures/collection/hint-filter.d.ts +143 -0
  53. package/dist/procedures/collection/hint-filter.d.ts.map +1 -0
  54. package/dist/procedures/collection/hint-filter.js +311 -0
  55. package/dist/procedures/collection/hint-filter.js.map +1 -0
  56. package/dist/procedures/collection/index.d.ts +2 -0
  57. package/dist/procedures/collection/index.d.ts.map +1 -1
  58. package/dist/procedures/collection/index.js +2 -0
  59. package/dist/procedures/collection/index.js.map +1 -1
  60. package/dist/procedures/collection/procedures.d.ts +2 -2
  61. package/dist/procedures/collection/procedures.d.ts.map +1 -1
  62. package/dist/procedures/collection/procedures.js +6 -4
  63. package/dist/procedures/collection/procedures.js.map +1 -1
  64. package/dist/procedures/index.d.ts +2 -2
  65. package/dist/procedures/index.d.ts.map +1 -1
  66. package/dist/procedures/index.js +3 -1
  67. package/dist/procedures/index.js.map +1 -1
  68. package/dist/server/error-policy.d.ts +96 -0
  69. package/dist/server/error-policy.d.ts.map +1 -0
  70. package/dist/server/error-policy.js +196 -0
  71. package/dist/server/error-policy.js.map +1 -0
  72. package/dist/server/error-response.d.ts +30 -0
  73. package/dist/server/error-response.d.ts.map +1 -0
  74. package/dist/server/error-response.js +90 -0
  75. package/dist/server/error-response.js.map +1 -0
  76. package/dist/server/index.d.ts +2 -0
  77. package/dist/server/index.d.ts.map +1 -1
  78. package/dist/server/index.js +1 -0
  79. package/dist/server/index.js.map +1 -1
  80. package/dist/server/last-resort.d.ts +17 -0
  81. package/dist/server/last-resort.d.ts.map +1 -0
  82. package/dist/server/last-resort.js +19 -0
  83. package/dist/server/last-resort.js.map +1 -0
  84. package/dist/server/procedure-server.d.ts +3 -11
  85. package/dist/server/procedure-server.d.ts.map +1 -1
  86. package/dist/server/procedure-server.js +7 -42
  87. package/dist/server/procedure-server.js.map +1 -1
  88. package/dist/server/server.d.ts +43 -1
  89. package/dist/server/server.d.ts.map +1 -1
  90. package/dist/server/server.js +39 -2
  91. package/dist/server/server.js.map +1 -1
  92. package/dist/server/types.d.ts +12 -0
  93. package/dist/server/types.d.ts.map +1 -1
  94. package/dist/server/types.js.map +1 -1
  95. package/package.json +1 -1
  96. package/src/adapters/http/server/handler.ts +18 -3
  97. package/src/adapters/port/transport.ts +2 -0
  98. package/src/adapters/websocket/server/transport.ts +2 -0
  99. package/src/adapters/websocket/shared/rpc.ts +14 -5
  100. package/src/browser.ts +11 -0
  101. package/src/client/errors/index.ts +1 -0
  102. package/src/client/errors/registry.ts +13 -0
  103. package/src/client/index.ts +1 -0
  104. package/src/events/bus.ts +6 -1
  105. package/src/events/index.ts +1 -1
  106. package/src/events/publisher.ts +150 -26
  107. package/src/events/recheck.ts +38 -13
  108. package/src/procedures/collection/admission.ts +50 -9
  109. package/src/procedures/collection/changes.ts +68 -7
  110. package/src/procedures/collection/hint-filter.ts +376 -0
  111. package/src/procedures/collection/index.ts +3 -0
  112. package/src/procedures/collection/procedures.ts +8 -6
  113. package/src/procedures/index.ts +5 -0
  114. package/src/server/error-policy.ts +263 -0
  115. package/src/server/error-response.ts +91 -0
  116. package/src/server/index.ts +2 -0
  117. package/src/server/last-resort.ts +23 -0
  118. package/src/server/procedure-server.ts +8 -41
  119. package/src/server/server.ts +73 -3
  120. package/src/server/types.ts +13 -0
@@ -20,6 +20,12 @@
20
20
  * (`ctx.admit`): each row passes the filter, and the subscriber gets only the admitted rows.
21
21
  * - An open subscription gets the same checks again at a change of the rights (`rightsChanged()`,
22
22
  * `recheck.rightsChanges`) and after `recheck.maxAge` (roadmap CLI-44). A refusal ends it.
23
+ * - The change events of a collection with a rule of the rows (`admission.admit`) reach each
24
+ * subscriber through a row filter (roadmap CLI-78, `hint-filter.ts`). The subscriber gets only the
25
+ * ids of the rows that it can read. A re-check at a change of the rights gives such a subscriber a
26
+ * `reset` hint, so it reads its rows again.
27
+ * - The `seq` of an event counts the events that the subscriber gets. An event that the row filter
28
+ * takes out gets no number, so the subscriber sees no gap.
23
29
  *
24
30
  * The delivery is at most once. The queue of a subscription holds at most `buffer` events. When
25
31
  * it is full, the publisher drops the oldest event, and the next event tells the number of lost
@@ -36,6 +42,7 @@ import { EVENTS_SUBSCRIBE_PATH } from "./remote.js";
36
42
  import { admittedValue, rowsOf } from "./rows.js";
37
43
  import { realClock } from "../clock.js";
38
44
  import { SubscriptionRechecks } from "./recheck.js";
45
+ import { DROPPED, RowHintFilter, collectionInvocation, collectionRulesOf, markFilteredTopic } from "../procedures/collection/hint-filter.js";
39
46
  /** The number of topics that one subscription can name. */
40
47
  export const MAX_SUBSCRIPTION_TOPICS = 64;
41
48
  /** The number of characters of a topic name. */
@@ -95,6 +102,32 @@ const eventItemSchema = z.discriminatedUnion("type", [
95
102
  dropped: z.number().int().optional().describe("The events that the publisher dropped immediately before this one"),
96
103
  }),
97
104
  ]);
105
+ /** True when a change of the rights with this scope touches the rows of the route (roadmap CLI-78). */
106
+ function inScope(route, scope) {
107
+ if (scope === undefined)
108
+ return true;
109
+ const scopes = Array.isArray(scope) ? scope : [scope];
110
+ return scopes.some(({ collection, partition }) => matchesName(collection, route.collection) && matchesName(partition, route.partition));
111
+ }
112
+ /** True when a name of a route matches a field of a scope. A test that throws matches. */
113
+ function matchesName(field, name) {
114
+ if (field === undefined)
115
+ return true;
116
+ if (name === undefined)
117
+ return false;
118
+ if (typeof field === "string")
119
+ return field === name;
120
+ try {
121
+ return field(name) === true;
122
+ }
123
+ catch {
124
+ return true;
125
+ }
126
+ }
127
+ /** The `reset` hint that a re-check gives to a subscriber with a row filter (roadmap CLI-78). */
128
+ function resetHint() {
129
+ return { changed: [], deleted: [], reset: true };
130
+ }
98
131
  /**
99
132
  * One subscription: the listeners on the bus and the queue of its events. It is the async
100
133
  * iterator of the stream of the call. `return()`, the abort of the signal of the call and
@@ -107,6 +140,7 @@ class TopicSubscription {
107
140
  onClose;
108
141
  admit;
109
142
  invocation;
143
+ filters;
110
144
  confirmation;
111
145
  queue = [];
112
146
  seq = 0;
@@ -125,15 +159,18 @@ class TopicSubscription {
125
159
  /** The output filter of the host for this subscriber: each row of a value passes it */
126
160
  admit,
127
161
  /** The invocation of the subscription: the rule of the rows of a value gets it (roadmap CLI-41) */
128
- invocation) {
162
+ invocation,
163
+ /** The row filter of each topic of a collection, by the topic of the subscriber (roadmap CLI-78) */
164
+ filters) {
129
165
  this.buffer = buffer;
130
166
  this.signal = signal;
131
167
  this.onClose = onClose;
132
168
  this.admit = admit;
133
169
  this.invocation = invocation;
134
- this.confirmation = { type: "subscribed", topics: routes.map(([topic]) => topic) };
170
+ this.filters = filters;
171
+ this.confirmation = { type: "subscribed", topics: routes.map(({ topic }) => topic) };
135
172
  // 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.push(topic, data), { onClear: () => this.fail(clearedError(topic), { keepQueue: true }) }));
173
+ this.unsubscribes = routes.map(({ topic, busTopic }) => bus.on(busTopic, (data) => this.push(topic, data), { onClear: () => this.fail(clearedError(topic), { keepQueue: true }) }));
137
174
  signal?.addEventListener("abort", this.onAbort, { once: true });
138
175
  }
139
176
  /** This function closes a subscription whose call aborted before it started. */
@@ -147,7 +184,7 @@ class TopicSubscription {
147
184
  push(topic, data) {
148
185
  if (this.closed)
149
186
  return;
150
- const event = { type: "event", topic, data, seq: ++this.seq };
187
+ const event = { topic, data };
151
188
  const waiter = this.waiter;
152
189
  if (waiter && this.queue.length === 0 && !this.recheck) {
153
190
  this.waiter = undefined;
@@ -162,23 +199,42 @@ class TopicSubscription {
162
199
  this.queue.push(event);
163
200
  }
164
201
  /**
165
- * The item of an event for the subscriber. The rows of its data pass the output filter of the
166
- * host for this subscriber and the rule of the rows, and the subscriber gets only the admitted rows.
202
+ * This function gives a `reset` hint to the subscriber on a topic (roadmap CLI-78): its rights
203
+ * changed, so it reads its rows again. The hint goes after the events of the queue.
204
+ */
205
+ reset(topic) {
206
+ this.filters?.get(topic)?.forget();
207
+ this.push(topic, resetHint());
208
+ }
209
+ /**
210
+ * The item of an event for the subscriber. The ids of a change event pass the row filter of the
211
+ * topic (roadmap CLI-78). The rows of its data pass the output filter of the host for this
212
+ * subscriber and the rule of the rows. The subscriber gets only the admitted rows. An event
213
+ * that the row filter takes out goes, and the subscriber gets the next event.
167
214
  */
168
215
  deliver(event) {
169
- const item = this.withDropped(event);
170
- const rows = rowsOf(item.data);
171
- if (!rows || (!this.admit && !rows.admit))
172
- return Promise.resolve({ value: item, done: false });
173
- return admittedValue(item.data, this.admit, this.invocation).then((data) => ({ value: { ...item, data }, done: false }));
216
+ const filtered = this.filters?.get(event.topic)?.apply(event.data);
217
+ if (!filtered)
218
+ return this.item(event.topic, event.data);
219
+ return filtered.then((data) => (data === DROPPED ? this.next() : this.item(event.topic, data)),
220
+ // A filter that fails: the subscriber reads the changes itself
221
+ () => this.item(event.topic, { changed: [], deleted: [] }));
174
222
  }
175
- /** The event with the number of events that the publisher dropped before it. */
176
- withDropped(event) {
177
- if (this.dropped === 0)
178
- return event;
223
+ /**
224
+ * The item of the data of an event. It gets the next `seq`, and the number of events that the
225
+ * publisher dropped before it. A dropped event keeps its number, so the subscriber sees the gap.
226
+ */
227
+ item(topic, data) {
179
228
  const dropped = this.dropped;
180
229
  this.dropped = 0;
181
- return { ...event, dropped };
230
+ this.seq += dropped;
231
+ const item = { type: "event", topic, data, seq: ++this.seq, ...(dropped > 0 && { dropped }) };
232
+ const rows = rowsOf(data);
233
+ if (!rows || (!this.admit && !rows.admit))
234
+ return Promise.resolve({ value: item, done: false });
235
+ // The rule of the rows of a topic of a collection gets the invocation of that topic (roadmap CLI-78)
236
+ const invocation = this.filters?.get(topic)?.invocation ?? this.invocation;
237
+ return admittedValue(data, this.admit, invocation).then((admitted) => ({ value: { ...item, data: admitted }, done: false }));
182
238
  }
183
239
  next() {
184
240
  if (this.confirmation) {
@@ -358,10 +414,15 @@ export class EventPublisher {
358
414
  * and the partition. Its events wait for the check. A refusal ends the subscription with its
359
415
  * error, for example `FORBIDDEN`. The promise ends when each check ends, and it does not reject.
360
416
  *
417
+ * The change can also have a scope (roadmap CLI-78): the collections or the partitions whose rows
418
+ * it touches. Then only the topics of the scope with a row filter get a `reset` hint and a new
419
+ * `admitsAll`. Each touched subscription still gets the checks of its start.
420
+ *
361
421
  * @param change - The subscriptions that the change touches. Without it, each open subscription gets a check.
422
+ * @param scope - The rows that the change touches. Without it, the change touches each topic.
362
423
  */
363
- rightsChanged(change) {
364
- return this.rechecks.rightsChanged(change);
424
+ rightsChanged(change, scope) {
425
+ return this.rechecks.rightsChanged(change, scope);
365
426
  }
366
427
  /**
367
428
  * The topic of the bus for a topic of a subscriber (roadmap CLI-17). A topic of a partitioned
@@ -376,9 +437,9 @@ export class EventPublisher {
376
437
  async route(topic, ctx) {
377
438
  const target = collectionTopicTarget(topic, ctx.repository);
378
439
  if (!target)
379
- return [topic, topic];
440
+ return { topic, busTopic: topic };
380
441
  const partition = await partitionOfCall(ctx, target.collection, target.partition);
381
- return [topic, collectionChangeTopic(target.collection, partition)];
442
+ return { topic, busTopic: collectionChangeTopic(target.collection, partition), collection: target.collection, partition, requested: target.partition };
382
443
  }
383
444
  /**
384
445
  * The resources that a subscriber of a topic reads. The default (`collectionTopicReads`) reads
@@ -424,13 +485,29 @@ export class EventPublisher {
424
485
  * because the listener has the old partition.
425
486
  */
426
487
  async readmit(routes, ctx) {
427
- this.admitTopics(routes.map(([topic]) => topic), ctx);
428
- for (const [topic, busTopic] of routes) {
429
- if ((await this.route(topic, ctx))[1] !== busTopic) {
488
+ this.admitTopics(routes.map(({ topic }) => topic), ctx);
489
+ for (const { topic, busTopic } of routes) {
490
+ if ((await this.route(topic, ctx)).busTopic !== busTopic) {
430
491
  throw new InvocationError("FORBIDDEN", `The partition of the topic "${topic}" changed, so the subscription ends`, ctx.path, "partition-not-allowed");
431
492
  }
432
493
  }
433
494
  }
495
+ /**
496
+ * The row filters of the topics of the collections of a subscription (roadmap CLI-78). Each one
497
+ * gets the rules of its collection and the result of `admitsAll`.
498
+ */
499
+ async filtersOf(routes, ctx) {
500
+ const filters = new Map();
501
+ for (const { topic, collection, partition, requested } of routes) {
502
+ if (collection === undefined)
503
+ continue;
504
+ // The rules get an invocation of the collection and its partition, not the call of `events.subscribe`
505
+ const filter = new RowHintFilter(() => collectionRulesOf(ctx, collection), collectionInvocation(ctx.invocation, ctx, collection, requested), partition);
506
+ await filter.refresh();
507
+ filters.set(topic, filter);
508
+ }
509
+ return filters;
510
+ }
434
511
  /**
435
512
  * The stream of one subscription. The publisher examines each topic before it adds a listener:
436
513
  * the topic rule, the reads, `allow`, and the partition. A call with one bad topic makes no subscription.
@@ -441,10 +518,50 @@ export class EventPublisher {
441
518
  const routes = [];
442
519
  for (const topic of unique)
443
520
  routes.push(await this.route(topic, ctx));
444
- const subscription = new TopicSubscription(this.bus, routes, this.buffer, ctx.signal, (closed) => this.open.delete(closed), ctx.admit, ctx.invocation);
521
+ const filters = await this.filtersOf(routes, ctx);
522
+ const subscription = new TopicSubscription(this.bus, routes, this.buffer, ctx.signal, (closed) => this.open.delete(closed), ctx.admit, ctx.invocation, filters);
445
523
  this.open.add(subscription);
524
+ // The marks of the topics with a row filter: the writes of these topics read the rows before them (roadmap CLI-78)
525
+ const marks = new Map();
526
+ let ended = false;
527
+ const mark = (route, mode) => {
528
+ if (ended)
529
+ return;
530
+ const marked = marks.get(route.topic);
531
+ if (mode === "pass") {
532
+ marked?.();
533
+ marks.delete(route.topic);
534
+ }
535
+ else if (!marked) {
536
+ marks.set(route.topic, markFilteredTopic(this.bus, route.busTopic));
537
+ }
538
+ };
539
+ for (const route of routes) {
540
+ const filter = filters.get(route.topic);
541
+ if (filter)
542
+ mark(route, filter.mode);
543
+ }
544
+ subscription.onEnd(() => {
545
+ ended = true;
546
+ for (const unmark of marks.values())
547
+ unmark();
548
+ marks.clear();
549
+ });
446
550
  // The same checks run again at a change of the rights and after the max age (roadmap CLI-44)
447
- this.rechecks.watch(subscription, ctx.principal, () => this.readmit(routes, ctx));
551
+ this.rechecks.watch(subscription, ctx.principal, async (cause, scope) => {
552
+ await this.readmit(routes, ctx);
553
+ // The rights can change the rows that the subscriber reads: a `reset` hint makes it read them again (roadmap CLI-78)
554
+ for (const route of routes) {
555
+ const filter = filters.get(route.topic);
556
+ if (!filter || !inScope(route, scope))
557
+ continue;
558
+ const before = filter.mode;
559
+ const after = await filter.refresh();
560
+ mark(route, after);
561
+ if (after !== before || (cause === "rights" && after === "filter"))
562
+ subscription.reset(route.topic);
563
+ }
564
+ });
448
565
  return subscription.closeIfAborted();
449
566
  }
450
567
  }
@@ -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,E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each subscription touches it.
25
25
  */
26
26
  export type RightsChange = string | ((principal: Principal | undefined) => boolean);
27
+ /**
28
+ * The rows that a change of the rights touches (roadmap CLI-78): the rows of the collections and
29
+ * of the partitions of the scope. The partition is the partition after the resolver. Without a
30
+ * collection, the scope touches each collection. Without a partition, it touches each partition.
31
+ *
32
+ * - A string matches one name.
33
+ * - A test matches each name that it admits, for example each partition of a tenant. A test that
34
+ * throws matches: a `reset` hint too many is safe, and a missing one is not.
35
+ * - A partition matches only a topic with a partition.
36
+ */
37
+ export interface RightsScope {
38
+ readonly collection?: string | ((collection: string) => boolean) | undefined;
39
+ readonly partition?: string | ((partition: string) => boolean) | undefined;
40
+ }
41
+ /** One scope or a list of scopes of a change of the rights. A list touches the rows of each scope. */
42
+ export type RightsScopes = RightsScope | readonly RightsScope[];
27
43
  /** The options of the re-check of the open subscriptions of a publisher (roadmap CLI-44). */
28
44
  export interface SubscriptionRecheck {
29
45
  /**
@@ -38,8 +54,10 @@ export interface SubscriptionRecheck {
38
54
  * removes the listener. Each call of the listener is a call of `rightsChanged()`: without a
39
55
  * change, each subscription gets a check.
40
56
  */
41
- readonly rightsChanges?: ((listener: (change?: RightsChange) => void) => () => void) | undefined;
57
+ readonly rightsChanges?: ((listener: (change?: RightsChange, scope?: RightsScopes) => void) => () => void) | undefined;
42
58
  }
59
+ /** The cause of a re-check: a change of the rights, or the max age. */
60
+ export type RecheckCause = "rights" | "age";
43
61
  /** A subscription that the re-checks can hold and watch. */
44
62
  export interface RecheckedSubscription {
45
63
  /**
@@ -50,6 +68,8 @@ export interface RecheckedSubscription {
50
68
  /** This function runs the listener when the subscription ends. */
51
69
  onEnd(listener: () => void): void;
52
70
  }
71
+ /** The check of a subscription. A check of a change of the rights can get the scope of the change. */
72
+ type RecheckCheck = (cause: RecheckCause, scope?: RightsScopes) => Promise<void>;
53
73
  /**
54
74
  * The re-checks of the open subscriptions of one publisher (roadmap CLI-44). The publisher gives
55
75
  * each new subscription to `watch()`, with the check of its admission.
@@ -66,14 +86,15 @@ export declare class SubscriptionRechecks {
66
86
  get size(): number;
67
87
  /**
68
88
  * This function watches a subscription until it ends. A change of the rights of its principal
69
- * and its max age start the check. The check must throw the refusal.
89
+ * and its max age start the check. The check gets the cause and the scope of the change. It must
90
+ * throw the refusal.
70
91
  */
71
- watch(subscription: RecheckedSubscription, principal: Principal | undefined, check: () => Promise<void>): void;
92
+ watch(subscription: RecheckedSubscription, principal: Principal | undefined, check: RecheckCheck): void;
72
93
  /**
73
94
  * This function starts a check of each watched subscription that the change touches. The
74
- * promise ends when each check ends.
95
+ * promise ends when each check ends. Each check gets the scope of the change.
75
96
  */
76
- rightsChanged(change?: RightsChange): Promise<void>;
97
+ rightsChanged(change?: RightsChange, scope?: RightsScopes): Promise<void>;
77
98
  /** This function stops the watch of a subscription that ended. */
78
99
  private unwatch;
79
100
  /** This function starts the timer of the max age of a subscription. */
@@ -81,4 +102,5 @@ export declare class SubscriptionRechecks {
81
102
  /** This function stops the timer of the max age of a subscription. */
82
103
  private stopTimer;
83
104
  }
105
+ export {};
84
106
  //# sourceMappingURL=recheck.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recheck.d.ts","sourceRoot":"","sources":["../../src/events/recheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC;AAEpF,6FAA6F;AAC7F,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACvC;;;;;O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,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACnC;AA2BD,sGAAsG;AACtG,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjF;;;GAGG;AACH,qBAAa,oBAAoB;IAS7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IARxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,yFAAyF;IACzF,OAAO,CAAC,aAAa,CAA2B;IAEhD,YACE,OAAO,EAAE,mBAAmB,EACX,KAAK,EAAE,KAAK,EAQ9B;IAED,gEAAgE;IAChE,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAwBtG;IAED;;;OAGG;IACH,aAAa,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxE;IAED,kEAAkE;IAClE,OAAO,CAAC,OAAO;IASf,uEAAuE;IACvE,OAAO,CAAC,UAAU;IAYlB,sEAAsE;IACtE,OAAO,CAAC,SAAS;CAKlB"}
@@ -30,8 +30,8 @@ function touches(change, principal) {
30
30
  }
31
31
  }
32
32
  /** The promise of a check. A check that throws at once gives a rejected promise. */
33
- function started(check) {
34
- return new Promise((resolve) => resolve(check()));
33
+ function started(check, cause, scope) {
34
+ return new Promise((resolve) => resolve(check(cause, scope)));
35
35
  }
36
36
  /**
37
37
  * The re-checks of the open subscriptions of one publisher (roadmap CLI-44). The publisher gives
@@ -59,15 +59,16 @@ export class SubscriptionRechecks {
59
59
  }
60
60
  /**
61
61
  * This function watches a subscription until it ends. A change of the rights of its principal
62
- * and its max age start the check. The check must throw the refusal.
62
+ * and its max age start the check. The check gets the cause and the scope of the change. It must
63
+ * throw the refusal.
63
64
  */
64
65
  watch(subscription, principal, check) {
65
66
  const watch = {
66
67
  principal,
67
68
  timer: undefined,
68
- recheck: () => {
69
+ recheck: (cause, scope) => {
69
70
  this.stopTimer(watch);
70
- return subscription.hold(started(check)).then(() => {
71
+ return subscription.hold(started(check, cause, scope)).then(() => {
71
72
  // A check that passes gives the admission a new age
72
73
  if (this.watches.has(watch))
73
74
  this.startTimer(watch);
@@ -81,7 +82,7 @@ export class SubscriptionRechecks {
81
82
  this.startTimer(watch);
82
83
  if (this.source && !this.stopListening) {
83
84
  try {
84
- this.stopListening = this.source((change) => void this.rightsChanged(change));
85
+ this.stopListening = this.source((change, scope) => void this.rightsChanged(change, scope));
85
86
  }
86
87
  catch (error) {
87
88
  // A source that cannot listen cannot tell a revocation: the subscription ends
@@ -91,13 +92,13 @@ export class SubscriptionRechecks {
91
92
  }
92
93
  /**
93
94
  * This function starts a check of each watched subscription that the change touches. The
94
- * promise ends when each check ends.
95
+ * promise ends when each check ends. Each check gets the scope of the change.
95
96
  */
96
- rightsChanged(change) {
97
+ rightsChanged(change, scope) {
97
98
  const checks = [];
98
99
  for (const watch of [...this.watches]) {
99
100
  if (touches(change, watch.principal))
100
- checks.push(watch.recheck());
101
+ checks.push(watch.recheck("rights", scope));
101
102
  }
102
103
  return Promise.all(checks).then(() => undefined);
103
104
  }
@@ -119,7 +120,7 @@ export class SubscriptionRechecks {
119
120
  const timer = this.clock.after(this.maxAgeMs, () => {
120
121
  if (watch.timer === timer)
121
122
  watch.timer = undefined;
122
- void watch.recheck();
123
+ void watch.recheck("age");
123
124
  });
124
125
  // A check does not keep a Node process alive
125
126
  timer.unref?.();
@@ -1 +1 @@
1
- {"version":3,"file":"recheck.js","sourceRoot":"","sources":["../../src/events/recheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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IAC/D,UAAU,CAAC,KAAY;QAC7B,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;YAAE,OAAO;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;YACjD,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK;gBAAE,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;YACnD,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,6CAA6C;QAC7C,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAChB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,sEAAsE;IAC9D,SAAS,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;QACxB,KAAK,EAAE,EAAE,CAAC;IACZ,CAAC;CACF"}
@@ -4,8 +4,10 @@
4
4
  * `admission` of `createCollectionProcedures()` gives the rules as data:
5
5
  *
6
6
  * - `admit` examines each row `{ id, value }` that a read gives. It has the shape of `AdmitItem`,
7
- * the output filter of a host. The change events with values give it the same rows for each
8
- * subscriber, so the reads and the events obey one rule.
7
+ * the output filter of a host. The publisher of the change events gives it the rows of each
8
+ * event for each subscriber (roadmap CLI-78). Thus the reads and the events obey one rule.
9
+ * - `admitsAll` tells that `admit` admits each row of a partition for a call. The events of such a
10
+ * subscriber then pass without the filter of each row.
9
11
  * - `guard` examines each write `{ op, id, doc, prev }` before the storage changes. A refused write
10
12
  * gets `FORBIDDEN` with the reason `write-not-allowed`.
11
13
  * - `versionOf` gives the version of a stored item (roadmap CLI-55). With it, a guarded write
@@ -16,8 +18,11 @@
16
18
  * (`admittedStorage()`). Each read and each write of each procedure goes through this view.
17
19
  *
18
20
  * - A refused row is absent: `get` gives undefined, `has` gives false, and the lists, `size`,
19
- * `find` and `changes` do not have it. A delta of `changes` puts the id of a refused row in
20
- * `deleted`, so a copy of the caller drops it.
21
+ * `find` and `changes` do not have it.
22
+ * - A delta of `changes` gives only ids that the caller can read (roadmap CLI-78). The view
23
+ * does not know which rows the caller read before the delta. Thus a delta with a refused row or
24
+ * with a deleted row becomes a full answer of the admitted rows. The copy of the caller then
25
+ * drops each other row. When `admitsAll` admits the caller, the delta stays as it is.
21
26
  * - An error of `admit` fails the read. It does not hide the rows, so a sync does not delete them.
22
27
  * - The guard reads the stored item before the write. With `versionOf`, the write expects the
23
28
  * version of that item (roadmap CLI-16). A change of another writer between the read and the
@@ -60,10 +65,23 @@ export type CollectionWriteGuard = (write: CollectionWrite, invocation: Invocati
60
65
  export interface CollectionAdmission {
61
66
  /**
62
67
  * The rule of the rows. It gets each row `{ id, value }` of a read and the invocation of the
63
- * call, and it gives true to admit the row. The change events with values apply it for each
64
- * subscriber, with the invocation of the subscription.
68
+ * call, and it gives true to admit the row. The publisher of the change events applies it to the
69
+ * rows of each event for each subscriber, with the invocation of the subscription (roadmap
70
+ * CLI-78). A subscriber gets only the ids of the rows that it can read.
65
71
  */
66
72
  admit?: AdmitItem | undefined;
73
+ /**
74
+ * This function tells that the rule `admit` admits each row of a partition for a call (roadmap
75
+ * CLI-78). It gets the invocation and the partition (undefined for the collection without a
76
+ * partition). True: the change events reach the subscriber without the filter of each row, as
77
+ * before CLI-78. The publisher asks at the start of a subscription and at each re-check.
78
+ *
79
+ * - Give true only when `admit` admits each row of the partition. Else the subscriber gets the
80
+ * ids of rows that it cannot read.
81
+ * - An error gives false.
82
+ * - Without it, the publisher examines each row of each event for each subscriber.
83
+ */
84
+ admitsAll?: ((invocation: Invocation, partition: string | undefined) => boolean | Promise<boolean>) | undefined;
67
85
  /** The guard of each `set`, `patch` and `delete`, also of the batches and of `clear`. */
68
86
  guard?: CollectionWriteGuard | undefined;
69
87
  /**
@@ -122,6 +140,7 @@ export declare function admitsRow(admission: CollectionAdmission | undefined, ct
122
140
  * @param storage - The storage of the call: of the collection, or of its partition
123
141
  * @param admission - The rules of the collection
124
142
  * @param ctx - The context of the call. The rules get its invocation.
143
+ * @param partition - The partition of the call. `admitsAll` gets it.
125
144
  */
126
- export declare function admittedStorage<T>(storage: CollectionStorage<T>, admission: CollectionAdmission | undefined, ctx: ProcedureContext): CollectionStorage<T>;
145
+ export declare function admittedStorage<T>(storage: CollectionStorage<T>, admission: CollectionAdmission | undefined, ctx: ProcedureContext, partition?: string): CollectionStorage<T>;
127
146
  //# sourceMappingURL=admission.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admission.d.ts","sourceRoot":"","sources":["../../../src/procedures/collection/admission.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAA0F,MAAM,cAAc,CAAC;AAE9I,OAAO,EAAkE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnH,sGAAsG;AACtG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACxC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,iHAAiH;IACjH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,M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