@procedures/client 0.12.2 → 0.13.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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # @procedures/client
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e2fe006: The expose rule of a server applies to each procedure that it serves, also to each procedure that it pins (server stack CLI-47). Only an explicit `alwaysOn` pin is outside the rule. This change is a break of the server stack, thus it is its own MINOR (decision D13). No 0.12 release marks the old behavior as deprecated, because no host relies on it. A deprecation release keeps the bypass open for one more release.
8
+
9
+ Before, `ProcedureServer` examined the expose rule only for a procedure of its registry. A procedure that `registerProcedure()` or `registerProcedures()` pinned was outside the rule. The collection procedures of `registerCollectionProcedures()` and of the option `collections` of `createProcedureHost()` are pins, so the rule did not hide them. For example, `hostPolicy({ exclude: ["collections.examples.clear"] })` had no effect on a call of `collections.examples.clear`.
10
+
11
+ - New option `alwaysOn` of `ProcedureServer.registerProcedure(procedure, options)`, `registerProcedures(procedures, options)` and `registerModule(module, options)`, with the new type `RegisterProcedureOptions`. True: the server serves the pin, also when its expose rule does not match the path. The default is false.
12
+ - Only the procedures of the host set it. `createProcedureHost()` pins `host.health`, `host.info` and `host.metrics` with `{ alwaysOn: true }`. The server pins `events.subscribe` with `{ alwaysOn: true }`, because the topic rule is its expose rule.
13
+ - Each other pin passes the same expose rule as a procedure of the registry: the lookup of each call (HTTP, WebSocket and MCP), `hasProcedure()`, `procedureOf()` and `procedureCount`. The manifests, the discovery and the MCP tool list already used the rule. The rule of the nested calls is the same as before.
14
+ - `createProcedureHost()`: the option `expose` wins over the rule of the policy, for the server and now also for each face. `host.policy` has this rule. Before, the MCP face listed the tools of the rule of the policy.
15
+
16
+ The behavior that changes:
17
+
18
+ - A server with an expose rule does not serve a pin that its rule does not match. A call gets `NOT_FOUND`, as for a procedure of the registry that the rule hides.
19
+ - A host with an expose rule serves only the collection procedures that its rule lists. An `exclude` of the policy hides one of them.
20
+ - `host.health`, `host.info`, `host.metrics` and `events.subscribe` stay on, whatever the expose rule says.
21
+ - A server or a host without an expose rule changes nothing.
22
+
23
+ Migration steps:
24
+
25
+ - A host with an `expose` rule must list the collection procedures that it serves, for example `collections.notes.*`. `host.*` and `events.subscribe` stay always on.
26
+ - An app that pins its own procedures with `registerProcedures()` on a server with an expose rule: list them in the rule. Give `{ alwaysOn: true }` only to a procedure of the host itself.
27
+ - The site: no change is necessary. Its servers have no expose rule.
28
+ - MiniMongo: no change is necessary. Its server has an expose rule, but it pins no procedure and serves no collection.
29
+ - The `mark` CLI and `procedure-server`: no change is necessary. They serve no collection, and `--expose` keeps `host.*` and `events.subscribe` on.
30
+ - jarvis: no change is necessary. Its host has no expose rule.
31
+ - The procedures host of Graph (GRAPH-11): no change is necessary. Its rule `["collections.*", "graph.*"]` lists the collection procedures. To hide `clear`, an `exclude` of the policy now has an effect.
32
+
3
33
  ## 0.12.2
4
34
 
5
35
  No changes in this release.