@procedures/client 0.35.1 → 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.
- package/CHANGELOG.md +33 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/browser.d.ts +3 -3
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -0
- package/dist/browser.js.map +1 -1
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +5 -1
- package/dist/events/bus.js.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/publisher.d.ts +18 -2
- package/dist/events/publisher.d.ts.map +1 -1
- package/dist/events/publisher.js +142 -25
- package/dist/events/publisher.js.map +1 -1
- package/dist/events/recheck.d.ts +27 -5
- package/dist/events/recheck.d.ts.map +1 -1
- package/dist/events/recheck.js +11 -10
- package/dist/events/recheck.js.map +1 -1
- package/dist/procedures/collection/admission.d.ts +26 -7
- package/dist/procedures/collection/admission.d.ts.map +1 -1
- package/dist/procedures/collection/admission.js +39 -7
- package/dist/procedures/collection/admission.js.map +1 -1
- package/dist/procedures/collection/changes.d.ts +13 -4
- package/dist/procedures/collection/changes.d.ts.map +1 -1
- package/dist/procedures/collection/changes.js +50 -6
- package/dist/procedures/collection/changes.js.map +1 -1
- package/dist/procedures/collection/hint-filter.d.ts +143 -0
- package/dist/procedures/collection/hint-filter.d.ts.map +1 -0
- package/dist/procedures/collection/hint-filter.js +311 -0
- package/dist/procedures/collection/hint-filter.js.map +1 -0
- package/dist/procedures/collection/index.d.ts +2 -0
- package/dist/procedures/collection/index.d.ts.map +1 -1
- package/dist/procedures/collection/index.js +2 -0
- package/dist/procedures/collection/index.js.map +1 -1
- package/dist/procedures/collection/procedures.d.ts +2 -2
- package/dist/procedures/collection/procedures.d.ts.map +1 -1
- package/dist/procedures/collection/procedures.js +6 -4
- package/dist/procedures/collection/procedures.js.map +1 -1
- package/dist/procedures/index.d.ts +2 -2
- package/dist/procedures/index.d.ts.map +1 -1
- package/dist/procedures/index.js +3 -1
- package/dist/procedures/index.js.map +1 -1
- package/package.json +1 -1
- package/src/browser.ts +7 -0
- package/src/events/bus.ts +6 -1
- package/src/events/index.ts +1 -1
- package/src/events/publisher.ts +150 -26
- package/src/events/recheck.ts +38 -13
- package/src/procedures/collection/admission.ts +50 -9
- package/src/procedures/collection/changes.ts +56 -7
- package/src/procedures/collection/hint-filter.ts +376 -0
- package/src/procedures/collection/index.ts +3 -0
- package/src/procedures/collection/procedures.ts +8 -6
- package/src/procedures/index.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @procedures/client
|
|
2
2
|
|
|
3
|
+
## 0.36.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f1fae86: The publisher of the remote events filters the change events of a collection row by row, with the rule of its rows (roadmap CLI-78). Thus a principal with a rule of the rows can subscribe to a topic of a collection. It gets only the ids of the rows that it can read.
|
|
8
|
+
|
|
9
|
+
MINOR (breaking, pre-1.0): this change has a new default. Before, each subscriber got each id of an event, and `withheld` named the rows that the rule refused. With this change, a row that the rule refuses is not in the event of that subscriber. Before 1.0.0, a changed default raises the MINOR.
|
|
10
|
+
|
|
11
|
+
- The rule is `admission.admit` of `createCollectionProcedures()`. The reads apply the same rule. The publisher finds it in the registry of the call, so it also filters the events of other publishers on the topic.
|
|
12
|
+
- A changed row that the rule admits stays in `changed`. A changed row that the rule refuses, and a deleted row, go to `deleted` only when the rule admitted the row before the change. The subscriber does not get the id of a row that it could not read.
|
|
13
|
+
- The rule examines the rows of the event: the row after the change, from the change log, and the row before the change. While a subscriber has a filter, each write of the procedures reads the rows before it with one `getBatch()`. The publisher does not read a storage.
|
|
14
|
+
- When the event has no image of a row, or the rule fails, the subscriber gets a hint without ids and without `since`. It then reads the changes through the rule of the reads.
|
|
15
|
+
- An event with `reset: true` and an event without ids pass, without ids.
|
|
16
|
+
- When the subscriber can read no row of an event, it gets no event. Its next event gets the `since` of the last event that it got, so it applies the next delta without a read. The `seq` of the events counts only the events that the subscriber gets, so the subscriber sees no gap.
|
|
17
|
+
- With values, an event has only the values of the rows that the rule admits. `withheld` names only the rows that the output filter of the host (`admitItem`) refused.
|
|
18
|
+
- The new optional `admission.admitsAll(invocation, partition)` tells that a subscriber reads each row of its partition. The events of that subscriber then pass as before, with no filter and no read before a write.
|
|
19
|
+
- At a re-check after a change of the rights (`rightsChanged()`, roadmap CLI-44), each subscriber with a filter gets a `reset` hint, so it reads its rows again. A subscriber whose `admitsAll` changes at a re-check also gets a `reset` hint.
|
|
20
|
+
- A delta of `changes` gives only ids that the caller can read. Before, it put the id of each refused row in `deleted`. A delta with a refused row or a deleted row becomes a full answer (`full: true`) of the admitted rows. The copy of the caller then drops each other row. When `admitsAll` admits the caller, the delta stays as before.
|
|
21
|
+
- `admittedStorage()` has a new optional parameter `partition`. `admitsAll` gets it.
|
|
22
|
+
- The rules get an invocation of the collection, not the call of `events.subscribe`. It has the principal, the capability, the metadata and the signal of the subscription. Its path is the path of `changes`, and its input has the partition of the topic. Thus a rule that reads `invocation.input.partition` works for the events too.
|
|
23
|
+
- `rightsChanged(change, scope)` of `EventPublisher` has a new optional parameter `scope`: `{ collection?, partition? }` or a list of them. Each field is a name or a test of the name, for example a test of each partition of a tenant. A test that throws matches.
|
|
24
|
+
- With a scope, only the topics of the scope with a filter get a `reset` hint and a new `admitsAll`. Without it, the change touches each topic, as before. The source `recheck.rightsChanges` can give a scope to its listener too. The new types are `RightsScope` and `RightsScopes`.
|
|
25
|
+
- New exports: `withHintImages(event, images)`, `hintImagesOf(event)` and the types `HintImages` and `HintRowState`. A publisher of change events, for example a watcher of a change stream, gives the rows before and after the change. Without them, a subscriber with a filter gets a hint without ids.
|
|
26
|
+
|
|
27
|
+
Migration:
|
|
28
|
+
|
|
29
|
+
- A subscriber that read `withheld` to find the rows that the rule refused: these rows are not in the event. A row that the subscriber read before the change and that the rule refuses after it comes as a delete.
|
|
30
|
+
- A reader of `changes` with a rule of the rows: apply a full answer as a replacement of the copy. The sync of `@procedures/client-store` does this. A full answer comes after each delete, so give `admitsAll` to the principals with full rights.
|
|
31
|
+
- A host whose `allow` of `events.subscribe` refused a principal with a rule of the rows can admit it.
|
|
32
|
+
- A host with full rights for some principals: give `admission.admitsAll`. Without it, the publisher examines each row of each event for each subscriber. Also, each write reads its rows before the change while such a subscriber is open.
|
|
33
|
+
- Graph: give `admitsAll` for the principals that read a whole partition. Then admit the principals with a `when` condition in `allow`.
|
|
34
|
+
- The site, MiniMongo and jarvis: no change, if their collections have no `admission.admit`. Then their events do not change.
|
|
35
|
+
|
|
3
36
|
## 0.35.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|