@procedures/client 0.32.0 → 0.34.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 (90) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/adapters/http/server/addressing.d.ts.map +1 -1
  4. package/dist/adapters/http/server/addressing.js +6 -2
  5. package/dist/adapters/http/server/addressing.js.map +1 -1
  6. package/dist/adapters/local/client/transport.js +2 -1
  7. package/dist/adapters/local/client/transport.js.map +1 -1
  8. package/dist/browser.d.ts +3 -2
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +5 -3
  11. package/dist/browser.js.map +1 -1
  12. package/dist/events/publisher.d.ts +6 -8
  13. package/dist/events/publisher.d.ts.map +1 -1
  14. package/dist/events/publisher.js +7 -31
  15. package/dist/events/publisher.js.map +1 -1
  16. package/dist/procedures/collection/changes.d.ts +2 -2
  17. package/dist/procedures/collection/changes.js +2 -2
  18. package/dist/procedures/collection/index.js +1 -1
  19. package/dist/procedures/collection/index.js.map +1 -1
  20. package/dist/procedures/collection/partition.d.ts +8 -56
  21. package/dist/procedures/collection/partition.d.ts.map +1 -1
  22. package/dist/procedures/collection/partition.js +7 -73
  23. package/dist/procedures/collection/partition.js.map +1 -1
  24. package/dist/procedures/collection/topic.d.ts +27 -39
  25. package/dist/procedures/collection/topic.d.ts.map +1 -1
  26. package/dist/procedures/collection/topic.js +55 -38
  27. package/dist/procedures/collection/topic.js.map +1 -1
  28. package/dist/procedures/core/schemas.d.ts +26 -10
  29. package/dist/procedures/core/schemas.d.ts.map +1 -1
  30. package/dist/procedures/core/schemas.js +34 -16
  31. package/dist/procedures/core/schemas.js.map +1 -1
  32. package/dist/procedures/define-procedure.d.ts.map +1 -1
  33. package/dist/procedures/define-procedure.js +5 -5
  34. package/dist/procedures/define-procedure.js.map +1 -1
  35. package/dist/procedures/index.d.ts +4 -3
  36. package/dist/procedures/index.d.ts.map +1 -1
  37. package/dist/procedures/index.js +5 -3
  38. package/dist/procedures/index.js.map +1 -1
  39. package/dist/procedures/module.d.ts +22 -0
  40. package/dist/procedures/module.d.ts.map +1 -1
  41. package/dist/procedures/module.js +18 -0
  42. package/dist/procedures/module.js.map +1 -1
  43. package/dist/procedures/registry.d.ts +2 -1
  44. package/dist/procedures/registry.d.ts.map +1 -1
  45. package/dist/procedures/registry.js +4 -2
  46. package/dist/procedures/registry.js.map +1 -1
  47. package/dist/procedures/segments.d.ts +61 -0
  48. package/dist/procedures/segments.d.ts.map +1 -0
  49. package/dist/procedures/segments.js +71 -0
  50. package/dist/procedures/segments.js.map +1 -0
  51. package/dist/procedures/types.d.ts +5 -2
  52. package/dist/procedures/types.d.ts.map +1 -1
  53. package/dist/procedures/types.js +8 -4
  54. package/dist/procedures/types.js.map +1 -1
  55. package/dist/server/host-policy.d.ts +1 -1
  56. package/dist/server/host-policy.d.ts.map +1 -1
  57. package/dist/server/host-policy.js +5 -3
  58. package/dist/server/host-policy.js.map +1 -1
  59. package/dist/server/index.d.ts +1 -0
  60. package/dist/server/index.d.ts.map +1 -1
  61. package/dist/server/index.js +2 -0
  62. package/dist/server/index.js.map +1 -1
  63. package/dist/server/method.d.ts +18 -3
  64. package/dist/server/method.d.ts.map +1 -1
  65. package/dist/server/method.js +23 -6
  66. package/dist/server/method.js.map +1 -1
  67. package/dist/server/procedure-server.d.ts +5 -23
  68. package/dist/server/procedure-server.d.ts.map +1 -1
  69. package/dist/server/procedure-server.js +4 -29
  70. package/dist/server/procedure-server.js.map +1 -1
  71. package/package.json +1 -1
  72. package/src/adapters/http/server/addressing.ts +6 -2
  73. package/src/adapters/local/client/transport.ts +2 -2
  74. package/src/browser.ts +6 -1
  75. package/src/events/publisher.ts +14 -40
  76. package/src/procedures/collection/changes.ts +2 -2
  77. package/src/procedures/collection/index.ts +1 -1
  78. package/src/procedures/collection/partition.ts +10 -87
  79. package/src/procedures/collection/topic.ts +48 -51
  80. package/src/procedures/core/schemas.ts +35 -16
  81. package/src/procedures/define-procedure.ts +5 -7
  82. package/src/procedures/index.ts +6 -2
  83. package/src/procedures/module.ts +34 -0
  84. package/src/procedures/registry.ts +4 -2
  85. package/src/procedures/segments.ts +74 -0
  86. package/src/procedures/types.ts +8 -4
  87. package/src/server/host-policy.ts +5 -4
  88. package/src/server/index.ts +2 -0
  89. package/src/server/method.ts +23 -6
  90. package/src/server/procedure-server.ts +6 -34
@@ -1,5 +1,5 @@
1
1
  import { InvocationError } from "../invoke.js";
2
- import { collectionChangeTopic, collectionTopicPartition } from "./topic.js";
2
+ import { collectionChangeTopic } from "./topic.js";
3
3
  /** The characters of a partition: letters, digits and `_ . : @ ~ + | / -`, 256 at most. */
4
4
  export const PARTITION_PATTERN = /^[A-Za-z0-9_.:@~+|/-]{1,256}$/;
5
5
  /**
@@ -84,9 +84,11 @@ export function storageOfCall(ctx, collection, partition) {
84
84
  }
85
85
  /**
86
86
  * The error of a server that serves two collections with the same topic (roadmap CLI-57, decision
87
- * D23). The plain topic of a collection with a storage, `collections.a.b`, is also the topic of the
88
- * partition `b` of the partitioned collection `a`. Thus the readers of `a.b` get the events of the
89
- * tenant `b` of `a`. To correct it, rename the collection `a.b` to a name without the prefix `a.`.
87
+ * D23). Before CLI-75, the plain topic of a collection with a storage, `collections.a.b`, was also
88
+ * the topic of the partition `b` of the partitioned collection `a`.
89
+ *
90
+ * @deprecated Since roadmap CLI-75, each topic encodes the name of the collection, so two
91
+ * collections do not have the same topic. No server throws this error. A later release removes it.
90
92
  */
91
93
  export class CollectionTopicCollisionError extends Error {
92
94
  name = "CollectionTopicCollisionError";
@@ -99,81 +101,13 @@ export class CollectionTopicCollisionError extends Error {
99
101
  /** The topic of the two. */
100
102
  topic;
101
103
  constructor(collection, partitioned, partition) {
102
- super(collisionMessage(collection, partitioned, partition));
104
+ super(`The collection "${collection}" and the partition "${partition}" of the collection "${partitioned}" have the same topic (roadmap CLI-57)`);
103
105
  this.collection = collection;
104
106
  this.partitioned = partitioned;
105
107
  this.partition = partition;
106
108
  this.topic = collectionChangeTopic(collection);
107
109
  }
108
110
  }
109
- /** The message of a `CollectionTopicCollisionError`: the two collections, the topic and the fix. */
110
- function collisionMessage(collection, partitioned, partition) {
111
- // The plain name is the encoded name of the partitioned collection, a dot and the partition
112
- const prefix = collection.slice(0, collection.length - partition.length);
113
- return (`The collection "${collection}" and the partition "${partition}" of the collection "${partitioned}" have the same topic "${collectionChangeTopic(collection)}", ` +
114
- `so the readers of "${collection}" get the events of that partition (roadmap CLI-57). ` +
115
- `Rename the collection "${collection}" to a name that does not start with "${prefix}", for example "${collection.replace(/\./g, "_")}".`);
116
- }
117
- /**
118
- * This function gives the partition whose topic is the plain topic of a collection, or undefined
119
- * (roadmap CLI-57). The plain topic of `a.b` is `collections.a.b`, the topic of the partition `b`
120
- * of `a`. A name without a dot gives undefined. It uses the parse of the publisher, so the two agree.
121
- *
122
- * @example
123
- * ```typescript
124
- * partitionOfPlainTopic("a.b.c"); // { collection: "a", partition: "b.c" }
125
- * partitionOfPlainTopic("a%2Eb.c"); // { collection: "a.b", partition: "c" }
126
- * partitionOfPlainTopic("ab"); // undefined
127
- * ```
128
- */
129
- export function partitionOfPlainTopic(collection) {
130
- const target = collectionTopicPartition(collectionChangeTopic(collection));
131
- return target?.partition === undefined ? undefined : { collection: target.collection, partition: target.partition };
132
- }
133
- /**
134
- * This function refuses two collections with the same topic (roadmap CLI-57, decision D23). It
135
- * examines each collection with a storage: its plain topic must not be the topic of a partition of
136
- * a collection with partitions. `ProcedureServer` uses it for each new storage and for each new
137
- * collection with partitions, in each order.
138
- *
139
- * @param plain - The collections with a storage without a partition
140
- * @param hasPartitions - True for a collection with partitions
141
- * @throws CollectionTopicCollisionError for the first pair with the same topic
142
- */
143
- export function assertTopicsApart(plain, hasPartitions) {
144
- for (const collection of plain) {
145
- const shared = partitionOfPlainTopic(collection);
146
- if (shared && hasPartitions(shared.collection))
147
- throw new CollectionTopicCollisionError(collection, shared.collection, shared.partition);
148
- }
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
- }
177
111
  // The parse of a topic lives in topic.ts, with the encode (roadmap CLI-42)
178
112
  export { collectionTopicPartition, collectionTopicTarget } from "./topic.js";
179
113
  //# sourceMappingURL=partition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partition.js","sourceRoot":"","sources":["../../../src/procedures/collection/partition.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE7E,2FAA2F;AAC3F,MAAM,CAAC,MAAM,iBAAiB,GAAW,+BAA+B,CAAC;AAoBzE;;;;;GAKG;AACH,MAAM,UAAU,aA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UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;CACF;AAED,2EAA2E;AAC3E,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,65 +1,53 @@
1
- /**
2
- * The topics of the change events of a collection (roadmap CLI-15, CLI-17 and CLI-42). This module
3
- * has the one function that makes a topic, the functions that read it, and the topic rule of a
4
- * collection. Each part of the client that makes or reads the topic of a collection or of a
5
- * partition uses them.
6
- *
7
- * - `collections.<name>` is the topic of a collection. The name stays as it is, also with a dot.
8
- * - `collections.<name>.<partition>` is the topic of a partition. In this form, the name encodes
9
- * `%` as `%25` and `.` as `%2E`. Thus the first dot after `collections.` ends the name, and the
10
- * partition after that dot can have each character, also `.`, `/` and `%`.
11
- * - The partition stays as it is, and so does a name without `.` and `%`. Thus each topic of a
12
- * partition of a name without `.` and `%` stays the same as before CLI-42.
13
- * - Only the canonical form of a topic counts: a parse gives a collection and a partition only when
14
- * `collectionChangeTopic(collection, partition)` gives the same topic. Thus `%2e` is no alias of
15
- * `%2E`, and a rule or an `allow` function that compares the strings sees each topic one way.
16
- * - The topic of a collection whose name has a dot, `collections.a.b`, has the same form as the
17
- * topic of the partition `b` of the collection `a`. Only the repository knows the collection, so
18
- * `collectionTopicTarget()` decides with it.
19
- * - `ProcedureServer` refuses a storage of `a.b` while `a` has partitions, in each order (roadmap
20
- * CLI-57, decision D23). Thus the readers of `a.b` do not get the events of a partition of `a`.
21
- */
22
1
  import type { RepositoryProvider } from "../types.js";
23
2
  /**
24
3
  * This function gives the topic of the change events of a collection: `collections.<name>`, or
25
- * `collections.<name>.<partition>` for a partition (roadmap CLI-17). In the topic of a partition,
26
- * the name encodes `%` and `.` (roadmap CLI-42), so `collectionTopicPartition()` gives back the
27
- * same collection and the same partition.
4
+ * `collections.<name>.<partition>` for a partition (roadmap CLI-17). The name encodes `%` and `.`
5
+ * (roadmap CLI-42 and CLI-75), so `collectionTopicPartition()` gives back the same collection and
6
+ * the same partition.
28
7
  *
29
8
  * @example
30
9
  * ```typescript
31
10
  * collectionChangeTopic("notes", "t1/board:b1"); // "collections.notes.t1/board:b1"
32
11
  * collectionChangeTopic("graph.nodes", "acme/space"); // "collections.graph%2Enodes.acme/space"
33
- * collectionChangeTopic("graph.nodes"); // "collections.graph.nodes"
12
+ * collectionChangeTopic("graph.nodes"); // "collections.graph%2Enodes"
34
13
  * ```
35
14
  */
36
15
  export declare function collectionChangeTopic(collection: string, partition?: string): string;
37
16
  /**
38
17
  * This function gives the collection and the partition of a topic `collections.<name>` or
39
- * `collections.<name>.<partition>`, or undefined for another topic. It reads the topic alone:
40
- * `collectionTopicTarget()` also knows the collections of a repository.
18
+ * `collections.<name>.<partition>`, or undefined for another topic. A host reads the collection
19
+ * of a topic with it, and not with its own pattern.
41
20
  *
42
- * - The first dot after the name ends the name. In a topic with a partition, the name is decoded:
43
- * `%2E` is a dot and `%25` is a `%` (roadmap CLI-42).
21
+ * - The first dot after the name ends the name. The name is decoded: `%2E` is a dot and `%25` is a
22
+ * `%` (roadmap CLI-42 and CLI-75).
44
23
  * - Each character after that dot is the partition. A partition has one character at least.
45
24
  * - A topic that is not in the canonical form gives undefined: `collectionChangeTopic()` of the
46
25
  * result always gives the topic again. Thus `collections.a%2eb.t1` names no collection.
47
26
  * - For each name and each partition, `collectionTopicPartition(collectionChangeTopic(name,
48
27
  * partition))` gives the same name and the same partition.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * collectionTopicPartition("collections.e2e%2Etabs"); // { collection: "e2e.tabs", partition: undefined }
32
+ * collectionTopicPartition("collections.e2e%2Etabs.t1"); // { collection: "e2e.tabs", partition: "t1" }
33
+ * ```
49
34
  */
50
35
  export declare function collectionTopicPartition(topic: string): {
51
36
  collection: string;
52
37
  partition: string | undefined;
53
38
  } | undefined;
54
39
  /**
55
- * This function gives the collection and the partition part of a topic of a call, with the
56
- * repository of the call: one rule for the read check and for the listener of the publisher.
40
+ * This function gives the collection and the partition part of a topic of a call: one rule for
41
+ * the read check and for the listener of the publisher. It gives the result of
42
+ * `collectionTopicPartition()`.
43
+ *
44
+ * - Before CLI-75, a collection of the repository whose name was the whole rest of the topic won,
45
+ * because the plain topic of a dotted name did not encode the name. Now each topic encodes the
46
+ * name, so the function does not read the repository.
57
47
  *
58
- * - A collection of the repository whose name is the whole rest of the topic wins, with or without
59
- * partitions: its name can have a dot. The call then asks for no partition.
60
- * - Else `collectionTopicPartition()` reads the topic: the first dot after the name ends the name,
61
- * and the rest is the partition that the call asks for. In this form, the name encodes `%` and
62
- * `.`, so the name of a collection with partitions can have a dot (roadmap CLI-42).
48
+ * @param repository - Deprecated: not used since roadmap CLI-75. The parameter stays for the
49
+ * callers, and a later MINOR removes it. (TSDoc has no `@deprecated` for one parameter, and the
50
+ * block tag would deprecate the whole function, which stays.)
63
51
  */
64
52
  export declare function collectionTopicTarget(topic: string, repository: RepositoryProvider | undefined): {
65
53
  collection: string;
@@ -69,18 +57,18 @@ export declare function collectionTopicTarget(topic: string, repository: Reposit
69
57
  * This function gives the topic rule of a collection for `EventPublisher` (the option `topics`):
70
58
  * the topic of the collection, and the pattern of the topics of its partitions (roadmap CLI-42).
71
59
  * Build the rule of a collection with it. Do not join the parts yourself: a dotted name needs its
72
- * encoded form in the pattern.
60
+ * encoded form.
73
61
  *
74
62
  * - The rule always has the two forms. For a collection with partitions, the plain topic asks for
75
63
  * no partition, and the resolver of the partition decides.
76
64
  * - For a collection without partitions, a topic of a partition passes the rule. The publisher then
77
65
  * refuses it with `FORBIDDEN` (reason `partition-not-allowed`).
78
- * - The pattern matches only the canonical form of a topic, so an alias of an escape gets
66
+ * - The rule matches only the canonical form of a topic, so an alias of an escape gets
79
67
  * `TOPIC_NOT_FOUND`.
80
68
  *
81
69
  * @example
82
70
  * ```typescript
83
- * collectionTopicRule("graph.nodes"); // ["collections.graph.nodes", "collections.graph%2Enodes.*"]
71
+ * collectionTopicRule("graph.nodes"); // ["collections.graph%2Enodes", "collections.graph%2Enodes.*"]
84
72
  * new EventPublisher({ bus, topics: ["orders.*", ...collectionTopicRule("graph.nodes")] });
85
73
  * ```
86
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../src/procedures/collection/topic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAetD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAUzH;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,SAAS,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAKlK;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAEhE"}
1
+ {"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../src/procedures/collection/topic.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CASzH;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,SAAS,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAGlK;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAGhE"}
@@ -1,94 +1,111 @@
1
+ /**
2
+ * The topics of the change events of a collection (roadmap CLI-15, CLI-17, CLI-42 and CLI-75). This
3
+ * module has the one function that makes a topic, the functions that read it, and the topic rule
4
+ * of a collection. Each part of the client that makes or reads the topic of a collection or of a
5
+ * partition uses them.
6
+ *
7
+ * - `collections.<name>` is the topic of a collection, and `collections.<name>.<partition>` is the
8
+ * topic of a partition.
9
+ * - In each topic, the name encodes `%` as `%25` and `.` as `%2E` (`encodeSegment()`). Thus the
10
+ * first dot after `collections.` ends the name, and the partition after that dot can have each
11
+ * character, also `.`, `/` and `%`. The partition stays as it is.
12
+ * - A name without `.` and `%` stays as it is. Thus each topic of such a name stays the same.
13
+ * - Before CLI-75, the plain topic kept a dotted name as it is: `collections.a.b` was the topic of
14
+ * the collection `a.b` and also of the partition `b` of `a`. Now the topic of `a.b` is
15
+ * `collections.a%2Eb`, so the two topics are not the same.
16
+ * - Only the canonical form of a topic counts: a parse gives a collection and a partition only when
17
+ * `collectionChangeTopic(collection, partition)` gives the same topic. Thus `%2e` is no alias of
18
+ * `%2E`, and a rule or an `allow` function that compares the strings sees each topic one way.
19
+ */
20
+ import { encodeSegment, decodeSegment } from "../segments.js";
1
21
  /** The prefix of the topic of each collection. */
2
22
  const PREFIX = "collections.";
3
- /** This function encodes the name of a collection for a topic with a partition: `%` and `.` become `%25` and `%2E`. */
4
- function encodeTopicName(name) {
5
- return name.replace(/[%.]/g, (char) => (char === "%" ? "%25" : "%2E"));
6
- }
7
- /** This function decodes the name of a topic with a partition. The parse then checks the canonical form. */
8
- function decodeTopicName(segment) {
9
- return segment.replace(/%(25|2E)/g, (_sequence, code) => (code === "25" ? "%" : "."));
10
- }
11
23
  /**
12
24
  * This function gives the topic of the change events of a collection: `collections.<name>`, or
13
- * `collections.<name>.<partition>` for a partition (roadmap CLI-17). In the topic of a partition,
14
- * the name encodes `%` and `.` (roadmap CLI-42), so `collectionTopicPartition()` gives back the
15
- * same collection and the same partition.
25
+ * `collections.<name>.<partition>` for a partition (roadmap CLI-17). The name encodes `%` and `.`
26
+ * (roadmap CLI-42 and CLI-75), so `collectionTopicPartition()` gives back the same collection and
27
+ * the same partition.
16
28
  *
17
29
  * @example
18
30
  * ```typescript
19
31
  * collectionChangeTopic("notes", "t1/board:b1"); // "collections.notes.t1/board:b1"
20
32
  * collectionChangeTopic("graph.nodes", "acme/space"); // "collections.graph%2Enodes.acme/space"
21
- * collectionChangeTopic("graph.nodes"); // "collections.graph.nodes"
33
+ * collectionChangeTopic("graph.nodes"); // "collections.graph%2Enodes"
22
34
  * ```
23
35
  */
24
36
  export function collectionChangeTopic(collection, partition) {
25
- return partition === undefined ? `${PREFIX}${collection}` : `${PREFIX}${encodeTopicName(collection)}.${partition}`;
37
+ const name = `${PREFIX}${encodeSegment(collection)}`;
38
+ return partition === undefined ? name : `${name}.${partition}`;
26
39
  }
27
40
  /**
28
41
  * This function gives the collection and the partition of a topic `collections.<name>` or
29
- * `collections.<name>.<partition>`, or undefined for another topic. It reads the topic alone:
30
- * `collectionTopicTarget()` also knows the collections of a repository.
42
+ * `collections.<name>.<partition>`, or undefined for another topic. A host reads the collection
43
+ * of a topic with it, and not with its own pattern.
31
44
  *
32
- * - The first dot after the name ends the name. In a topic with a partition, the name is decoded:
33
- * `%2E` is a dot and `%25` is a `%` (roadmap CLI-42).
45
+ * - The first dot after the name ends the name. The name is decoded: `%2E` is a dot and `%25` is a
46
+ * `%` (roadmap CLI-42 and CLI-75).
34
47
  * - Each character after that dot is the partition. A partition has one character at least.
35
48
  * - A topic that is not in the canonical form gives undefined: `collectionChangeTopic()` of the
36
49
  * result always gives the topic again. Thus `collections.a%2eb.t1` names no collection.
37
50
  * - For each name and each partition, `collectionTopicPartition(collectionChangeTopic(name,
38
51
  * partition))` gives the same name and the same partition.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * collectionTopicPartition("collections.e2e%2Etabs"); // { collection: "e2e.tabs", partition: undefined }
56
+ * collectionTopicPartition("collections.e2e%2Etabs.t1"); // { collection: "e2e.tabs", partition: "t1" }
57
+ * ```
39
58
  */
40
59
  export function collectionTopicPartition(topic) {
41
60
  if (!topic.startsWith(PREFIX))
42
61
  return undefined;
43
62
  const rest = topic.slice(PREFIX.length);
44
63
  const dot = rest.indexOf(".");
45
- if (dot === -1)
46
- return rest === "" ? undefined : { collection: rest, partition: undefined };
47
- if (dot === 0 || dot === rest.length - 1)
64
+ if (dot === 0 || dot === rest.length - 1 || rest === "")
48
65
  return undefined;
49
- const collection = decodeTopicName(rest.slice(0, dot));
50
- const partition = rest.slice(dot + 1);
66
+ const collection = decodeSegment(dot === -1 ? rest : rest.slice(0, dot));
67
+ const partition = dot === -1 ? undefined : rest.slice(dot + 1);
51
68
  // Only the canonical form counts: an alias of an escape names no collection
52
69
  return collectionChangeTopic(collection, partition) === topic ? { collection, partition } : undefined;
53
70
  }
54
71
  /**
55
- * This function gives the collection and the partition part of a topic of a call, with the
56
- * repository of the call: one rule for the read check and for the listener of the publisher.
72
+ * This function gives the collection and the partition part of a topic of a call: one rule for
73
+ * the read check and for the listener of the publisher. It gives the result of
74
+ * `collectionTopicPartition()`.
57
75
  *
58
- * - A collection of the repository whose name is the whole rest of the topic wins, with or without
59
- * partitions: its name can have a dot. The call then asks for no partition.
60
- * - Else `collectionTopicPartition()` reads the topic: the first dot after the name ends the name,
61
- * and the rest is the partition that the call asks for. In this form, the name encodes `%` and
62
- * `.`, so the name of a collection with partitions can have a dot (roadmap CLI-42).
76
+ * - Before CLI-75, a collection of the repository whose name was the whole rest of the topic won,
77
+ * because the plain topic of a dotted name did not encode the name. Now each topic encodes the
78
+ * name, so the function does not read the repository.
79
+ *
80
+ * @param repository - Deprecated: not used since roadmap CLI-75. The parameter stays for the
81
+ * callers, and a later MINOR removes it. (TSDoc has no `@deprecated` for one parameter, and the
82
+ * block tag would deprecate the whole function, which stays.)
63
83
  */
64
84
  export function collectionTopicTarget(topic, repository) {
65
- if (!topic.startsWith(PREFIX))
66
- return undefined;
67
- const whole = topic.slice(PREFIX.length);
68
- if (whole !== "" && repository?.hasCollection(whole))
69
- return { collection: whole, partition: undefined };
85
+ void repository;
70
86
  return collectionTopicPartition(topic);
71
87
  }
72
88
  /**
73
89
  * This function gives the topic rule of a collection for `EventPublisher` (the option `topics`):
74
90
  * the topic of the collection, and the pattern of the topics of its partitions (roadmap CLI-42).
75
91
  * Build the rule of a collection with it. Do not join the parts yourself: a dotted name needs its
76
- * encoded form in the pattern.
92
+ * encoded form.
77
93
  *
78
94
  * - The rule always has the two forms. For a collection with partitions, the plain topic asks for
79
95
  * no partition, and the resolver of the partition decides.
80
96
  * - For a collection without partitions, a topic of a partition passes the rule. The publisher then
81
97
  * refuses it with `FORBIDDEN` (reason `partition-not-allowed`).
82
- * - The pattern matches only the canonical form of a topic, so an alias of an escape gets
98
+ * - The rule matches only the canonical form of a topic, so an alias of an escape gets
83
99
  * `TOPIC_NOT_FOUND`.
84
100
  *
85
101
  * @example
86
102
  * ```typescript
87
- * collectionTopicRule("graph.nodes"); // ["collections.graph.nodes", "collections.graph%2Enodes.*"]
103
+ * collectionTopicRule("graph.nodes"); // ["collections.graph%2Enodes", "collections.graph%2Enodes.*"]
88
104
  * new EventPublisher({ bus, topics: ["orders.*", ...collectionTopicRule("graph.nodes")] });
89
105
  * ```
90
106
  */
91
107
  export function collectionTopicRule(collection) {
92
- return [collectionChangeTopic(collection), `${PREFIX}${encodeTopicName(collection)}.*`];
108
+ const topic = collectionChangeTopic(collection);
109
+ return [topic, `${topic}.*`];
93
110
  }
94
111
  //# sourceMappingURL=topic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"topic.js","sourceRoot":"","sources":["../../../src/procedures/collection/topic.ts"],"names":[],"mappings":"AAuBA,kDAAkD;AAClD,MAAM,MAAM,GAAG,cAAc,CAAC;AAE9B,uHAAuH;AACvH,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,4GAA4G;AAC5G,SAAS,eAAe,CAAC,OAAe;IACtC,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAChG,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkB,EAAE,SAAkB;IAC1E,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,SAAS,EAAE,CAAC;AACrH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MA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AC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC/D,4EAA4E;IAC5E,OAAO,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACxG,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,UAA0C;IAC7F,KAAK,UAAU,CAAC;IAChB,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,KAAK,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAChD,OAAO,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;AAC/B,CAAC"}
@@ -22,27 +22,43 @@ export declare const anySchema: ZodLike<any> & StandardSchemaV1<unknown, any> &
22
22
  readonly "~jsonSchema": JsonSchema;
23
23
  };
24
24
  /**
25
- * Typed version of anySchema for specific type annotations.
26
- * Useful when you want to assert a specific type at compile time.
25
+ * This function gives a pass-through schema for the type `T`: it validates nothing and has no JSON
26
+ * Schema. The type parameter only gives the TypeScript type.
27
+ *
28
+ * Use it for internal procedures where a real schema adds nothing. Give a real schema (zod) to a
29
+ * procedure that an MCP server or the CLI exposes. Then the host validates its input, and its
30
+ * tools and help describe the fields (roadmap 2.1).
31
+ *
32
+ * ```ts
33
+ * createProcedure().path(["a", "b"]).input(typed<{ id: string }>()).output(typed<number>())
34
+ * ```
35
+ */
36
+ export declare function typed<T>(): ZodLikeSchema<T> & StandardSchemaV1<unknown, T>;
37
+ /**
38
+ * This function gives a pass-through schema for the type `T`.
39
+ *
40
+ * @deprecated Use `typed<T>()`. A later MINOR removes `typedAnySchema` (tracker item O58, decision D13).
27
41
  */
28
42
  export declare function typedAnySchema<T>(): ZodLike<T> & StandardSchemaV1<unknown, T>;
29
43
  /**
30
- * Gives a zod schema the type of a procedure schema (`ZodLikeSchema<T>`). A zod 4 schema is a
31
- * Standard Schema already, so the function returns it unchanged: the validation and the JSON
32
- * Schema come from zod itself.
44
+ * This function gives a zod schema the type of a procedure schema (`ZodLikeSchema<T>`). A zod 4
45
+ * schema is a Standard Schema already, so the function returns it unchanged: the validation and
46
+ * the JSON Schema come from zod itself.
33
47
  *
34
48
  * An object with only a `parse` method gets `safeParse` and `~standard` around that method.
49
+ *
50
+ * @deprecated Give the zod schema to `input()` and `output()` directly: they take each Standard
51
+ * Schema and infer its type. To check a schema against a type, write `const s: z.ZodType<T> = ...`.
52
+ * For a parse-only object, write a Standard Schema (`~standard`). A later MINOR removes
53
+ * `zodAdapter` (tracker item O58, decision D13).
35
54
  */
36
55
  export declare function zodAdapter<T>(schema: {
37
56
  parse: (data: unknown) => T;
38
57
  }): ZodLikeSchema<T>;
39
58
  /**
40
- * A pass-through schema: it validates nothing and has no JSON Schema. The type parameter only
41
- * gives the TypeScript type.
59
+ * This function gives a pass-through schema for the type `T`.
42
60
  *
43
- * Use it for internal procedures where a real schema adds nothing. A procedure that an MCP
44
- * server exposes, or that a user calls from the CLI, takes a real schema (zod), so its input
45
- * is validated and its tools and help describe the fields (roadmap 2.1).
61
+ * @deprecated Use `typed<T>()`. A later MINOR removes `outputSchema` (tracker item O58, decision D13).
46
62
  */
47
63
  export declare function outputSchema<T>(): ZodLikeSchema<T> & StandardSchemaV1<unknown, T>;
48
64
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/procedures/core/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,K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AAW,aAAa,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC;CACZ;AAeD;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG;IAAE,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAA;CAK3G,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAO1E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAM7E;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE;IAAE,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,CAAC,CAAA;CAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CA8BvF;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAEjF"}
@@ -28,8 +28,29 @@ export const anySchema = {
28
28
  "~jsonSchema": {},
29
29
  };
30
30
  /**
31
- * Typed version of anySchema for specific type annotations.
32
- * Useful when you want to assert a specific type at compile time.
31
+ * This function gives a pass-through schema for the type `T`: it validates nothing and has no JSON
32
+ * Schema. The type parameter only gives the TypeScript type.
33
+ *
34
+ * Use it for internal procedures where a real schema adds nothing. Give a real schema (zod) to a
35
+ * procedure that an MCP server or the CLI exposes. Then the host validates its input, and its
36
+ * tools and help describe the fields (roadmap 2.1).
37
+ *
38
+ * ```ts
39
+ * createProcedure().path(["a", "b"]).input(typed<{ id: string }>()).output(typed<number>())
40
+ * ```
41
+ */
42
+ export function typed() {
43
+ return {
44
+ parse: (data) => data,
45
+ safeParse: (data) => ({ success: true, data: data }),
46
+ _output: undefined,
47
+ "~standard": passThrough(),
48
+ };
49
+ }
50
+ /**
51
+ * This function gives a pass-through schema for the type `T`.
52
+ *
53
+ * @deprecated Use `typed<T>()`. A later MINOR removes `typedAnySchema` (tracker item O58, decision D13).
33
54
  */
34
55
  export function typedAnySchema() {
35
56
  return {
@@ -42,11 +63,16 @@ export function typedAnySchema() {
42
63
  // Zod Adapter - Wraps a Zod schema for the procedure system
43
64
  // =============================================================================
44
65
  /**
45
- * Gives a zod schema the type of a procedure schema (`ZodLikeSchema<T>`). A zod 4 schema is a
46
- * Standard Schema already, so the function returns it unchanged: the validation and the JSON
47
- * Schema come from zod itself.
66
+ * This function gives a zod schema the type of a procedure schema (`ZodLikeSchema<T>`). A zod 4
67
+ * schema is a Standard Schema already, so the function returns it unchanged: the validation and
68
+ * the JSON Schema come from zod itself.
48
69
  *
49
70
  * An object with only a `parse` method gets `safeParse` and `~standard` around that method.
71
+ *
72
+ * @deprecated Give the zod schema to `input()` and `output()` directly: they take each Standard
73
+ * Schema and infer its type. To check a schema against a type, write `const s: z.ZodType<T> = ...`.
74
+ * For a parse-only object, write a Standard Schema (`~standard`). A later MINOR removes
75
+ * `zodAdapter` (tracker item O58, decision D13).
50
76
  */
51
77
  export function zodAdapter(schema) {
52
78
  if (isStandardSchema(schema) && typeof schema.safeParse === "function") {
@@ -84,19 +110,11 @@ export function zodAdapter(schema) {
84
110
  // Output Schema - Pass-through schema for output types
85
111
  // =============================================================================
86
112
  /**
87
- * A pass-through schema: it validates nothing and has no JSON Schema. The type parameter only
88
- * gives the TypeScript type.
113
+ * This function gives a pass-through schema for the type `T`.
89
114
  *
90
- * Use it for internal procedures where a real schema adds nothing. A procedure that an MCP
91
- * server exposes, or that a user calls from the CLI, takes a real schema (zod), so its input
92
- * is validated and its tools and help describe the fields (roadmap 2.1).
115
+ * @deprecated Use `typed<T>()`. A later MINOR removes `outputSchema` (tracker item O58, decision D13).
93
116
  */
94
117
  export function outputSchema() {
95
- return {
96
- parse: (data) => data,
97
- safeParse: (data) => ({ success: true, data: data }),
98
- _output: undefined,
99
- "~standard": passThrough(),
100
- };
118
+ return typed();
101
119
  }
102
120
  //# sourceMappingURL=schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/procedures/core/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAA0C,MAAM,cAAc,CAAC;AAexF,qFAAqF;AACrF,SAAS,WAAW;IAClB,OAAO;QACL,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,oBAAoB;QAC5B,QAAQ,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAU,EAAE,CAAC;KACtD,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,uCAAuC;AACvC,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAA2F;IAC/G,KAAK,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK;IAChC,SAAS,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC/D,WAAW,EAAE,WAAW,EAAO;IAC/B,aAAa,EAAE,EAAE;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,KAAK,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,KAAU;QACrC,SAAS,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAU,EAAE,CAAC;QACpE,WAAW,EAAE,WAAW,EAAK;KAC9B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,4DAA4D;AAC5D,gFAAg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