@procedures/client 0.8.1 → 0.9.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 (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/adapters/websocket/client/transport.d.ts.map +1 -1
  4. package/dist/adapters/websocket/client/transport.js +4 -12
  5. package/dist/adapters/websocket/client/transport.js.map +1 -1
  6. package/dist/browser.d.ts +2 -2
  7. package/dist/browser.d.ts.map +1 -1
  8. package/dist/browser.js +2 -0
  9. package/dist/browser.js.map +1 -1
  10. package/dist/events/publisher.d.ts +11 -1
  11. package/dist/events/publisher.d.ts.map +1 -1
  12. package/dist/events/publisher.js +27 -8
  13. package/dist/events/publisher.js.map +1 -1
  14. package/dist/procedures/collection/changes.d.ts +3 -3
  15. package/dist/procedures/collection/changes.d.ts.map +1 -1
  16. package/dist/procedures/collection/changes.js +4 -4
  17. package/dist/procedures/collection/changes.js.map +1 -1
  18. package/dist/procedures/collection/index.d.ts +2 -0
  19. package/dist/procedures/collection/index.d.ts.map +1 -1
  20. package/dist/procedures/collection/index.js +2 -0
  21. package/dist/procedures/collection/index.js.map +1 -1
  22. package/dist/procedures/collection/partition.d.ts +67 -0
  23. package/dist/procedures/collection/partition.d.ts.map +1 -0
  24. package/dist/procedures/collection/partition.js +82 -0
  25. package/dist/procedures/collection/partition.js.map +1 -0
  26. package/dist/procedures/collection/procedures.d.ts +4 -4
  27. package/dist/procedures/collection/procedures.d.ts.map +1 -1
  28. package/dist/procedures/collection/procedures.js +55 -55
  29. package/dist/procedures/collection/procedures.js.map +1 -1
  30. package/dist/procedures/index.d.ts +2 -2
  31. package/dist/procedures/index.d.ts.map +1 -1
  32. package/dist/procedures/index.js +1 -1
  33. package/dist/procedures/index.js.map +1 -1
  34. package/dist/procedures/invoke.d.ts +4 -2
  35. package/dist/procedures/invoke.d.ts.map +1 -1
  36. package/dist/procedures/invoke.js +1 -1
  37. package/dist/procedures/invoke.js.map +1 -1
  38. package/dist/procedures/types.d.ts +13 -0
  39. package/dist/procedures/types.d.ts.map +1 -1
  40. package/dist/procedures/types.js.map +1 -1
  41. package/dist/server/procedure-server.d.ts +30 -1
  42. package/dist/server/procedure-server.d.ts.map +1 -1
  43. package/dist/server/procedure-server.js +59 -11
  44. package/dist/server/procedure-server.js.map +1 -1
  45. package/package.json +3 -3
  46. package/src/adapters/websocket/client/transport.ts +4 -12
  47. package/src/browser.ts +6 -0
  48. package/src/events/publisher.ts +29 -9
  49. package/src/procedures/collection/changes.ts +4 -4
  50. package/src/procedures/collection/index.ts +4 -0
  51. package/src/procedures/collection/partition.ts +123 -0
  52. package/src/procedures/collection/procedures.ts +72 -73
  53. package/src/procedures/index.ts +5 -0
  54. package/src/procedures/invoke.ts +4 -2
  55. package/src/procedures/types.ts +16 -0
  56. package/src/server/procedure-server.ts +65 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @procedures/client
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dc03903: The WebSocket client ignores a raw frame of the type `event`, as a frame of an unknown type. Before, it gave such a frame to `onEvent`, for a server outside this repository. No side of wire protocol v1 sends that frame (the type is reserved). `onEvent` now gets only the events of the subscriptions of the transport (`events.subscribe`). MINOR: a breaking change of behavior (the API is before 1.0.0).
8
+
9
+ Migration: a server that sends raw `event` frames sends its events through `events.subscribe` instead (EVENTS.md). The client then gets them in `onEvent`, with the id of the subscription.
10
+
11
+ ### Patch Changes
12
+
13
+ - 8bb469c: The partitions of a collection (roadmap CLI-17). One `collections.<name>.*` surface serves several partitions, for example one for each tenant. `ProcedureServer.usePartitions(name, { storageOf, resolve })` registers the storage of each partition and the resolver. The resolver gives the partition of each call from its context, so the tenant comes from `ctx.principal`. The input can ask for a partition, and the resolver can refuse the call (`FORBIDDEN`, reason `partition-not-allowed`).
14
+
15
+ `RepositoryProvider` has the new optional methods `getPartitionStorage`, `hasPartitions` and `resolvePartition`. A repository without them refuses a partition. The events of a partition go to `collections.<name>.<partition>`.
16
+
17
+ A subscriber of `EventPublisher` names the partition that it asks for, and the publisher resolves it with the same resolver. So a subscriber cannot name the topic of another tenant. A change of behavior for safety: a topic `collections.<name>.<partition>` of a collection without partitions is refused. Before, each subscriber with the read of the collection got it. New exports: `PARTITION_PATTERN`, `collectionTopicPartition`, `CollectionPartitions`, `PartitionInput` and `PartitionResolver`.
18
+ - dca28c1: The packages accept `@mark1russell7/service` 0.5.1 and later 0.5 versions, and `@procedures/client` accepts `@mark1russell7/algebra` 0.7.1. Before, the range `^0.4.1` stopped below 0.5. An application on service 0.5 then got a second copy of service inside the client.
19
+
20
+ - The client uses only the `/backoff`, `/heartbeat` and `/testing` entries of service. The code of `/backoff`, `/heartbeat` and the clock is the same in 0.4.1 and 0.5.1. `/testing` only gets new exports.
21
+ - The public API of the client does not change.
22
+
3
23
  ## 0.8.1
4
24
 
5
25
  ### Patch Changes