@moq/net 0.4.0 → 0.4.1
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/announced.d.ts +14 -0
- package/announced.d.ts.map +1 -1
- package/announced.js.map +1 -1
- package/broadcast.d.ts +6 -3
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +9 -5
- package/broadcast.js.map +1 -1
- package/connection/accept.js +9 -1
- package/connection/accept.js.map +1 -1
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +10 -1
- package/connection/connect.js.map +1 -1
- package/connection/established.d.ts +2 -1
- package/connection/established.d.ts.map +1 -1
- package/connection/established.js.map +1 -1
- package/connection/forward.js +9 -2
- package/connection/forward.js.map +1 -1
- package/connection/handshake.d.ts +1 -0
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +3 -0
- package/connection/handshake.js.map +1 -1
- package/connection/pool.d.ts +8 -10
- package/connection/pool.d.ts.map +1 -1
- package/connection/pool.js +18 -8
- package/connection/pool.js.map +1 -1
- package/connection/reload.js +6 -6
- package/connection/reload.js.map +1 -1
- package/error.d.ts.map +1 -1
- package/error.js +21 -0
- package/error.js.map +1 -1
- package/ietf/adapter.d.ts +5 -1
- package/ietf/adapter.d.ts.map +1 -1
- package/ietf/adapter.js +27 -9
- package/ietf/adapter.js.map +1 -1
- package/ietf/connection.d.ts +1 -1
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +9 -5
- package/ietf/connection.js.map +1 -1
- package/ietf/error.js +27 -2
- package/ietf/error.js.map +1 -1
- package/ietf/hidden.d.ts +2 -0
- package/ietf/hidden.d.ts.map +1 -0
- package/ietf/hidden.js +30 -0
- package/ietf/hidden.js.map +1 -0
- package/ietf/index.d.ts +1 -0
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +1 -0
- package/ietf/index.js.map +1 -1
- package/ietf/object.d.ts +8 -2
- package/ietf/object.d.ts.map +1 -1
- package/ietf/object.js +17 -3
- package/ietf/object.js.map +1 -1
- package/ietf/parameters.d.ts +5 -0
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +20 -0
- package/ietf/parameters.js.map +1 -1
- package/ietf/properties.d.ts +1 -0
- package/ietf/properties.d.ts.map +1 -1
- package/ietf/properties.js +14 -0
- package/ietf/properties.js.map +1 -1
- package/ietf/publish.d.ts +19 -2
- package/ietf/publish.d.ts.map +1 -1
- package/ietf/publish.js +40 -6
- package/ietf/publish.js.map +1 -1
- package/ietf/publisher.js +114 -60
- package/ietf/publisher.js.map +1 -1
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +3 -4
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscribe_namespace.d.ts +8 -2
- package/ietf/subscribe_namespace.d.ts.map +1 -1
- package/ietf/subscribe_namespace.js +18 -8
- package/ietf/subscribe_namespace.js.map +1 -1
- package/ietf/subscriber.js +189 -66
- package/ietf/subscriber.js.map +1 -1
- package/internal.d.ts +7 -0
- package/internal.d.ts.map +1 -1
- package/internal.js +11 -0
- package/internal.js.map +1 -1
- package/lite/announce.d.ts +46 -2
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +126 -11
- package/lite/announce.js.map +1 -1
- package/lite/connection.d.ts +1 -1
- package/lite/connection.d.ts.map +1 -1
- package/lite/connection.js +9 -3
- package/lite/connection.js.map +1 -1
- package/lite/publisher.js +168 -109
- package/lite/publisher.js.map +1 -1
- package/lite/subscribe.d.ts +10 -4
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +20 -10
- package/lite/subscribe.js.map +1 -1
- package/lite/subscriber.d.ts +10 -2
- package/lite/subscriber.d.ts.map +1 -1
- package/lite/subscriber.js +159 -93
- package/lite/subscriber.js.map +1 -1
- package/lite/version.d.ts +11 -0
- package/lite/version.d.ts.map +1 -1
- package/lite/version.js +56 -0
- package/lite/version.js.map +1 -1
- package/origin.d.ts +37 -18
- package/origin.d.ts.map +1 -1
- package/origin.js +248 -103
- package/origin.js.map +1 -1
- package/package.json +7 -3
- package/stream.d.ts +2 -2
- package/stream.d.ts.map +1 -1
- package/stream.js +16 -11
- package/stream.js.map +1 -1
- package/tail.d.ts +11 -0
- package/tail.d.ts.map +1 -0
- package/tail.js +121 -0
- package/tail.js.map +1 -0
- package/track.d.ts +33 -5
- package/track.d.ts.map +1 -1
- package/track.js +98 -30
- package/track.js.map +1 -1
- package/wire.d.ts +2 -0
- package/wire.d.ts.map +1 -1
- package/wire.js.map +1 -1
package/origin.d.ts
CHANGED
|
@@ -31,12 +31,19 @@ export interface Table {
|
|
|
31
31
|
readonly closed: GetPromise<Error | null>;
|
|
32
32
|
/** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
|
|
33
33
|
readonly discovery: Getter<boolean | undefined>;
|
|
34
|
-
/** Create
|
|
34
|
+
/** Create an unannounced broadcast at `path`; see {@link Producer.createBroadcast}. */
|
|
35
35
|
createBroadcast(path: Path.Valid): broadcast.Producer;
|
|
36
36
|
/** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
|
|
37
37
|
request(path: Path.Valid, options?: RequestOptions): Requesting;
|
|
38
|
+
/** The available announcements under `scope`, as a live map; see {@link Consumer.broadcasts}. */
|
|
39
|
+
broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
|
|
38
40
|
/** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
|
|
39
|
-
announced(scope?: Path.Pattern): announce.Consumer;
|
|
41
|
+
announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
|
|
42
|
+
/** Advertise a prefix and serve requests under it; see {@link Producer.dynamic}. */
|
|
43
|
+
dynamic(prefix: Path.Valid, route?: Route | {
|
|
44
|
+
hops?: Route["hops"];
|
|
45
|
+
cost?: Route["cost"] | bigint;
|
|
46
|
+
}): Dynamic;
|
|
40
47
|
}
|
|
41
48
|
/** Options for resolving a broadcast path. */
|
|
42
49
|
export interface RequestOptions {
|
|
@@ -54,7 +61,7 @@ export interface RequestOptions {
|
|
|
54
61
|
*
|
|
55
62
|
* Create, attach {@link dynamic} for tracks served on demand, populate, then
|
|
56
63
|
* {@link broadcast.Producer.announce}: an exact-path subscribe before the tracks exist is
|
|
57
|
-
* refused, and
|
|
64
|
+
* refused, and nobody can see or reach a broadcast until it announces.
|
|
58
65
|
*
|
|
59
66
|
* @public
|
|
60
67
|
*/
|
|
@@ -69,14 +76,15 @@ export declare class Producer implements Table {
|
|
|
69
76
|
/**
|
|
70
77
|
* Create a broadcast at `path`, returning its producer.
|
|
71
78
|
*
|
|
72
|
-
* The broadcast
|
|
73
|
-
*
|
|
74
|
-
*
|
|
79
|
+
* The broadcast exists for nobody until {@link broadcast.Producer.announce}: announce
|
|
80
|
+
* streams skip it and requests for its path find nothing, on this origin exactly as at
|
|
81
|
+
* a peer. Announce once its tracks exist; {@link broadcast.Producer.unannounce}
|
|
82
|
+
* withdraws it from everyone again.
|
|
75
83
|
*
|
|
76
84
|
* Close the producer to drop it. Creating a path again supersedes the previous
|
|
77
85
|
* broadcast: the origin drops its handle on the old one, which closes it unless the
|
|
78
|
-
* application still holds a consumer clone.
|
|
79
|
-
* remote
|
|
86
|
+
* application still holds a consumer clone. An announced local broadcast competes with
|
|
87
|
+
* a remote route at the same path on cost, winning ties.
|
|
80
88
|
*/
|
|
81
89
|
createBroadcast(path: Path.Valid): broadcast.Producer;
|
|
82
90
|
/**
|
|
@@ -88,7 +96,7 @@ export declare class Producer implements Table {
|
|
|
88
96
|
* consumers narrow with a {@link Path.Pattern} locally. The advertisement is
|
|
89
97
|
* visible to {@link Consumer.announced} and forwarded by sessions for as long as
|
|
90
98
|
* the returned {@link Dynamic} lives. A consumer resolving a path under it that
|
|
91
|
-
* no local broadcast
|
|
99
|
+
* no announced local broadcast wins is handed to the handle as a {@link Request}.
|
|
92
100
|
*/
|
|
93
101
|
dynamic(prefix: Path.Valid, route?: Route | {
|
|
94
102
|
hops?: Route["hops"];
|
|
@@ -100,8 +108,10 @@ export declare class Producer implements Table {
|
|
|
100
108
|
get discovery(): Getter<boolean | undefined>;
|
|
101
109
|
/** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
|
|
102
110
|
request(path: Path.Valid, options?: RequestOptions): Requesting;
|
|
111
|
+
/** The available announcements under `scope`, as a live map; see {@link Consumer.broadcasts}. */
|
|
112
|
+
broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
|
|
103
113
|
/** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
|
|
104
|
-
announced(scope?: Path.Pattern): announce.Consumer;
|
|
114
|
+
announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
|
|
105
115
|
/** Close the origin, every broadcast it still routes, and its announcement streams. Idempotent. */
|
|
106
116
|
close(abort?: Error): void;
|
|
107
117
|
}
|
|
@@ -171,9 +181,10 @@ export declare class Consumer {
|
|
|
171
181
|
* Resolve `path`, optionally waiting for an announcement.
|
|
172
182
|
*
|
|
173
183
|
* The one way to consume by path. {@link Requesting.active} follows whatever the table
|
|
174
|
-
* routes (
|
|
175
|
-
* republish); when nothing does, the request stands and whichever
|
|
176
|
-
* answers first provides a blind subscription instead, re-answered
|
|
184
|
+
* routes (an announced local publish, or any feeding session's announcement, swapping
|
|
185
|
+
* on a republish or a retraction); when nothing does, the request stands and whichever
|
|
186
|
+
* attached session answers first provides a blind subscription instead, re-answered
|
|
187
|
+
* across reconnects.
|
|
177
188
|
* With `announced: true`, an unrouted request waits while discovery is supported and
|
|
178
189
|
* falls back to that blind behavior only when discovery is unavailable. Close the request
|
|
179
190
|
* when done. On a closed origin it never resolves.
|
|
@@ -188,15 +199,23 @@ export declare class Consumer {
|
|
|
188
199
|
* feeds from more than one connection.
|
|
189
200
|
*/
|
|
190
201
|
request(path: Path.Valid, options?: RequestOptions): Requesting;
|
|
202
|
+
/**
|
|
203
|
+
* The announced routes matching `scope`, as a live map from covered prefix to route.
|
|
204
|
+
* Local broadcasts appear once announced; received and dynamic routes retain their
|
|
205
|
+
* advertised prefixes. Reads are synchronous, and the getter needs no teardown.
|
|
206
|
+
* Hidden routes are left out unless `options.hidden` opts in (see {@link announce.Options}).
|
|
207
|
+
* Unscoped readers share one snapshot; each distinct scope filters the table on changes.
|
|
208
|
+
*/
|
|
209
|
+
broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
|
|
191
210
|
/**
|
|
192
211
|
* The announced routes matching `scope`, as a live stream: every currently advertised
|
|
193
212
|
* route arrives first as active, then additions and retractions as they happen.
|
|
194
|
-
* Any pattern is accepted. A local broadcast appears
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
213
|
+
* Any pattern is accepted. A local broadcast appears once it announces, exactly as a
|
|
214
|
+
* peer sees it. A dynamic or received route announces the prefix it covers when its
|
|
215
|
+
* subtree overlaps the scope. The stream ends when the origin closes or the consumer is
|
|
216
|
+
* closed. Hidden routes are left out unless `options.hidden` opts in (see {@link announce.Options}).
|
|
198
217
|
*/
|
|
199
|
-
announced(scope?: Path.Pattern): announce.Consumer;
|
|
218
|
+
announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
|
|
200
219
|
}
|
|
201
220
|
/**
|
|
202
221
|
* A served route from {@link Producer.dynamic}: advertises a prefix and answers the
|
package/origin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../src/origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAyB,KAAK,UAAU,EAAE,KAAK,MAAM,EAAwB,MAAM,cAAc,CAAC;AACzG,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../src/origin.ts"],"names":[],"mappings":"AA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