@livestore/webmesh 0.4.0 → 0.5.0-dev.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/dist/.tsbuildinfo +1 -1
- package/dist/channel/direct-channel-internal.d.ts +2 -3
- package/dist/channel/direct-channel-internal.d.ts.map +1 -1
- package/dist/channel/direct-channel-internal.js +23 -18
- package/dist/channel/direct-channel-internal.js.map +1 -1
- package/dist/channel/direct-channel.d.ts.map +1 -1
- package/dist/channel/direct-channel.js +20 -21
- package/dist/channel/direct-channel.js.map +1 -1
- package/dist/channel/proxy-channel.d.ts +7 -8
- package/dist/channel/proxy-channel.d.ts.map +1 -1
- package/dist/channel/proxy-channel.js +26 -22
- package/dist/channel/proxy-channel.js.map +1 -1
- package/dist/common.d.ts +33 -35
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +3 -2
- package/dist/common.js.map +1 -1
- package/dist/mesh-schema.d.ts +262 -136
- package/dist/mesh-schema.d.ts.map +1 -1
- package/dist/mesh-schema.js +45 -44
- package/dist/mesh-schema.js.map +1 -1
- package/dist/node.d.ts +6 -6
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +22 -21
- package/dist/node.js.map +1 -1
- package/dist/node.test.js +74 -71
- package/dist/node.test.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/websocket-edge.d.ts +18 -16
- package/dist/websocket-edge.d.ts.map +1 -1
- package/dist/websocket-edge.js +30 -36
- package/dist/websocket-edge.js.map +1 -1
- package/dist/websocket-edge.test.js +14 -14
- package/dist/websocket-edge.test.js.map +1 -1
- package/dist/worker/mod.d.ts +24 -0
- package/dist/worker/mod.d.ts.map +1 -0
- package/dist/worker/mod.js +44 -0
- package/dist/worker/mod.js.map +1 -0
- package/dist/worker/schema.d.ts +10 -0
- package/dist/worker/schema.d.ts.map +1 -0
- package/dist/worker/schema.js +7 -0
- package/dist/worker/schema.js.map +1 -0
- package/package.json +20 -37
- package/src/channel/direct-channel-internal.ts +30 -22
- package/src/channel/direct-channel.ts +26 -23
- package/src/channel/proxy-channel.ts +39 -36
- package/src/common.ts +6 -3
- package/src/mesh-schema.ts +34 -33
- package/src/node.test.ts +99 -86
- package/src/node.ts +32 -32
- package/src/utils.ts +3 -3
- package/src/websocket-edge.test.ts +14 -14
- package/src/websocket-edge.ts +47 -41
- package/src/worker/mod.ts +89 -0
- package/src/worker/schema.ts +8 -0
package/dist/common.d.ts
CHANGED
|
@@ -11,18 +11,15 @@ export type MessageQueueItem = {
|
|
|
11
11
|
export type MeshNodeName = string;
|
|
12
12
|
export type ChannelName = string;
|
|
13
13
|
export type ChannelKey = `target:${MeshNodeName}, channelName:${ChannelName}`;
|
|
14
|
-
declare const EdgeAlreadyExistsError_base: Schema.
|
|
15
|
-
readonly
|
|
16
|
-
}
|
|
17
|
-
target: typeof Schema.String;
|
|
18
|
-
}>;
|
|
14
|
+
declare const EdgeAlreadyExistsError_base: Schema.Class<EdgeAlreadyExistsError, Schema.TaggedStruct<"EdgeAlreadyExistsError", {
|
|
15
|
+
readonly target: Schema.String;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
19
17
|
export declare class EdgeAlreadyExistsError extends EdgeAlreadyExistsError_base {
|
|
20
18
|
}
|
|
21
19
|
export declare const packetAsOtelAttributes: (packet: typeof Packet.Type) => {
|
|
22
20
|
packet: {
|
|
23
|
-
readonly remainingHops?: readonly string[] | undefined;
|
|
24
|
-
readonly channelVersion: number;
|
|
25
21
|
readonly reqId: string | undefined;
|
|
22
|
+
readonly channelVersion: number;
|
|
26
23
|
readonly sourceId: string;
|
|
27
24
|
readonly id: string;
|
|
28
25
|
readonly target: string;
|
|
@@ -30,81 +27,82 @@ export declare const packetAsOtelAttributes: (packet: typeof Packet.Type) => {
|
|
|
30
27
|
readonly channelName: string;
|
|
31
28
|
readonly hops: readonly string[];
|
|
32
29
|
readonly _tag: "DirectChannelRequest";
|
|
30
|
+
readonly remainingHops?: readonly string[] | undefined;
|
|
33
31
|
} | {
|
|
34
|
-
readonly
|
|
32
|
+
readonly _tag: "DirectChannelResponseNoTransferables";
|
|
35
33
|
readonly reqId: string;
|
|
34
|
+
readonly remainingHops: readonly string[];
|
|
36
35
|
readonly id: string;
|
|
37
36
|
readonly target: string;
|
|
38
37
|
readonly source: string;
|
|
39
38
|
readonly channelName: string;
|
|
40
39
|
readonly hops: readonly string[];
|
|
41
|
-
readonly _tag: "DirectChannelResponseNoTransferables";
|
|
42
40
|
} | {
|
|
43
|
-
readonly remainingHops?: undefined;
|
|
44
41
|
readonly id: string;
|
|
45
42
|
readonly target: string;
|
|
46
43
|
readonly source: string;
|
|
47
44
|
readonly channelName: string;
|
|
48
45
|
readonly hops: readonly string[];
|
|
49
|
-
readonly _tag: "ProxyChannelRequest";
|
|
50
46
|
readonly channelIdCandidate: string;
|
|
47
|
+
readonly _tag: "ProxyChannelRequest";
|
|
48
|
+
readonly remainingHops?: undefined;
|
|
51
49
|
} | {
|
|
52
|
-
readonly
|
|
50
|
+
readonly _tag: "ProxyChannelResponseSuccess";
|
|
53
51
|
readonly reqId: string;
|
|
52
|
+
readonly remainingHops: readonly string[];
|
|
53
|
+
readonly combinedChannelId: string;
|
|
54
|
+
readonly channelIdCandidate: string;
|
|
54
55
|
readonly id: string;
|
|
55
56
|
readonly target: string;
|
|
56
57
|
readonly source: string;
|
|
57
58
|
readonly channelName: string;
|
|
58
59
|
readonly hops: readonly string[];
|
|
59
|
-
readonly _tag: "ProxyChannelResponseSuccess";
|
|
60
|
-
readonly channelIdCandidate: string;
|
|
61
|
-
readonly combinedChannelId: string;
|
|
62
60
|
} | {
|
|
63
|
-
readonly
|
|
61
|
+
readonly _tag: "ProxyChannelPayloadAck";
|
|
64
62
|
readonly reqId: string;
|
|
63
|
+
readonly remainingHops: readonly string[];
|
|
64
|
+
readonly combinedChannelId: string;
|
|
65
65
|
readonly id: string;
|
|
66
66
|
readonly target: string;
|
|
67
67
|
readonly source: string;
|
|
68
68
|
readonly channelName: string;
|
|
69
69
|
readonly hops: readonly string[];
|
|
70
|
-
readonly _tag: "ProxyChannelPayloadAck";
|
|
71
|
-
readonly combinedChannelId: string;
|
|
72
70
|
} | {
|
|
73
|
-
readonly id: string;
|
|
74
|
-
readonly target: string;
|
|
75
|
-
readonly source: string;
|
|
76
71
|
readonly _tag: "NetworkEdgeAdded";
|
|
77
|
-
} | {
|
|
78
72
|
readonly id: string;
|
|
79
|
-
readonly target: "-";
|
|
80
73
|
readonly source: string;
|
|
81
|
-
readonly
|
|
82
|
-
readonly _tag: "NetworkTopologyRequest";
|
|
74
|
+
readonly target: string;
|
|
83
75
|
} | {
|
|
84
|
-
readonly
|
|
85
|
-
readonly reqId: string;
|
|
76
|
+
readonly _tag: "NetworkTopologyRequest";
|
|
86
77
|
readonly id: string;
|
|
87
|
-
readonly
|
|
78
|
+
readonly hops: readonly string[];
|
|
88
79
|
readonly source: string;
|
|
80
|
+
readonly target: "-";
|
|
81
|
+
} | {
|
|
89
82
|
readonly _tag: "NetworkTopologyResponse";
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly reqId: string;
|
|
85
|
+
readonly remainingHops: readonly string[];
|
|
90
86
|
readonly nodeName: string;
|
|
91
87
|
readonly edges: readonly string[];
|
|
88
|
+
readonly source: string;
|
|
89
|
+
readonly target: "-";
|
|
92
90
|
} | {
|
|
91
|
+
readonly _tag: "BroadcastChannelPacket";
|
|
93
92
|
readonly id: string;
|
|
94
|
-
readonly target: "-";
|
|
95
|
-
readonly source: string;
|
|
96
93
|
readonly channelName: string;
|
|
97
|
-
readonly hops: readonly string[];
|
|
98
|
-
readonly _tag: "BroadcastChannelPacket";
|
|
99
94
|
readonly payload: any;
|
|
95
|
+
readonly hops: readonly string[];
|
|
96
|
+
readonly source: string;
|
|
97
|
+
readonly target: "-";
|
|
100
98
|
};
|
|
101
99
|
packetId: string;
|
|
102
100
|
'span.label': string;
|
|
103
101
|
};
|
|
104
102
|
export declare const ListenForChannelResult: Schema.Struct<{
|
|
105
|
-
channelName:
|
|
106
|
-
source:
|
|
107
|
-
mode: Schema.
|
|
103
|
+
readonly channelName: Schema.String;
|
|
104
|
+
readonly source: Schema.String;
|
|
105
|
+
readonly mode: Schema.Literals<readonly ["proxy", "direct"]>;
|
|
108
106
|
}>;
|
|
109
107
|
export type ListenForChannelResult = typeof ListenForChannelResult.Type;
|
|
110
108
|
export {};
|
package/dist/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAEvF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,kBAAkB,CAAC,IAAI,CAAA;IACtC,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,kBAAkB,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAC9E,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,OAAO,mBAAmB,CAAC,IAAI,CAAA;IACvC,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,mBAAmB,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAC/E,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAChC,MAAM,MAAM,UAAU,GAAG,UAAU,YAAY,iBAAiB,WAAW,EAAE,CAAA
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAEvF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,kBAAkB,CAAC,IAAI,CAAA;IACtC,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,kBAAkB,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAC9E,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,OAAO,mBAAmB,CAAC,IAAI,CAAA;IACvC,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,mBAAmB,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAC/E,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAChC,MAAM,MAAM,UAAU,GAAG,UAAU,YAAY,iBAAiB,WAAW,EAAE,CAAA;;;;AAO7E,qBAAa,sBAAuB,SAAQ,2BAI1C;CAAG;AAEL,eAAO,MAAM,sBAAsB,GAAI,QAAQ,OAAO,MAAM,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS/D,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;EAIjC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC,IAAI,CAAA"}
|
package/dist/common.js
CHANGED
|
@@ -10,7 +10,8 @@ export class EdgeAlreadyExistsError extends Schema.TaggedError('~@livestore/webm
|
|
|
10
10
|
}
|
|
11
11
|
export const packetAsOtelAttributes = (packet) => ({
|
|
12
12
|
packetId: packet.id,
|
|
13
|
-
'span.label': packet.id +
|
|
13
|
+
'span.label': packet.id +
|
|
14
|
+
(Predicate.hasProperty(packet, 'reqId') === true && packet.reqId !== undefined ? ` for ${packet.reqId}` : ''),
|
|
14
15
|
...omitUndefineds({
|
|
15
16
|
packet: packet._tag !== 'DirectChannelResponseSuccess' && packet._tag !== 'ProxyChannelPayload' ? packet : undefined,
|
|
16
17
|
}),
|
|
@@ -18,6 +19,6 @@ export const packetAsOtelAttributes = (packet) => ({
|
|
|
18
19
|
export const ListenForChannelResult = Schema.Struct({
|
|
19
20
|
channelName: Schema.String,
|
|
20
21
|
source: Schema.String,
|
|
21
|
-
mode: Schema.
|
|
22
|
+
mode: Schema.Literals(['proxy', 'direct']),
|
|
22
23
|
});
|
|
23
24
|
//# sourceMappingURL=common.js.map
|
package/dist/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAe,SAAS,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAmBxE,4DAA4D;AAC5D,4FAA4F;AAC5F,mDAAmD;AACnD,sCAAsC;AAEtC,MAAM,OAAO,sBAAuB,SAAQ,MAAM,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAe,SAAS,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAmBxE,4DAA4D;AAC5D,4FAA4F;AAC5F,mDAAmD;AACnD,sCAAsC;AAEtC,MAAM,OAAO,sBAAuB,SAAQ,MAAM,CAAC,WAAW,CAC5D,4CAA4C,CAC7C,CAAC,wBAAwB,EAAE;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CAAC;CAAG;AAEL,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAA0B,EAAE,EAAE,CAAC,CAAC;IACrE,QAAQ,EAAE,MAAM,CAAC,EAAE;IACnB,YAAY,EACV,MAAM,CAAC,EAAE;QACT,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/G,GAAG,cAAc,CAAC;QAChB,MAAM,EACJ,MAAM,CAAC,IAAI,KAAK,8BAA8B,IAAI,MAAM,CAAC,IAAI,KAAK,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KAC/G,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;CAC3C,CAAC,CAAA"}
|
package/dist/mesh-schema.d.ts
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import { Schema } from '@livestore/utils/effect';
|
|
2
|
-
declare const DirectChannelRequest_base: Schema.TaggedStruct<"DirectChannelRequest", {
|
|
3
|
-
remainingHops: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
4
|
-
channelVersion: typeof Schema.Number;
|
|
5
|
-
/** Only set if the request is in response to an incoming request */
|
|
6
|
-
reqId: Schema.UndefinedOr<typeof Schema.String>;
|
|
7
|
-
/**
|
|
8
|
-
* Additionally to the `source` field, we use this field to track whether the instance of a
|
|
9
|
-
* source has changed.
|
|
10
|
-
*/
|
|
11
|
-
sourceId: typeof Schema.String;
|
|
12
|
-
id: Schema.PropertySignature<":", string, never, "?:", string | undefined, true, never>;
|
|
13
|
-
target: typeof Schema.String;
|
|
14
|
-
source: typeof Schema.String;
|
|
15
|
-
channelName: typeof Schema.String;
|
|
16
|
-
hops: Schema.Array$<typeof Schema.String>;
|
|
17
|
-
}>;
|
|
1
|
+
import { Schema, Transferable } from '@livestore/utils/effect';
|
|
18
2
|
/**
|
|
19
3
|
* Needs to go through already existing DirectChannel edges, times out otherwise
|
|
20
4
|
*
|
|
@@ -22,149 +6,291 @@ declare const DirectChannelRequest_base: Schema.TaggedStruct<"DirectChannelReque
|
|
|
22
6
|
* We need a clear path back to the sender to avoid this, thus we respond with a separate
|
|
23
7
|
* `DirectChannelResponseSuccess` which contains the `port`.
|
|
24
8
|
*/
|
|
25
|
-
export declare
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
export declare const DirectChannelRequest: Schema.TaggedStruct<"DirectChannelRequest", {
|
|
10
|
+
readonly remainingHops: Schema.optional<Schema.$Array<Schema.String>>;
|
|
11
|
+
readonly channelVersion: Schema.Finite;
|
|
12
|
+
/** Only set if the request is in response to an incoming request */
|
|
13
|
+
readonly reqId: Schema.UndefinedOr<Schema.String>;
|
|
14
|
+
/**
|
|
15
|
+
* Additionally to the `source` field, we use this field to track whether the instance of a
|
|
16
|
+
* source has changed.
|
|
17
|
+
*/
|
|
18
|
+
readonly sourceId: Schema.String;
|
|
19
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
20
|
+
readonly target: Schema.String;
|
|
21
|
+
readonly source: Schema.String;
|
|
22
|
+
readonly channelName: Schema.String;
|
|
23
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
37
24
|
}>;
|
|
38
|
-
export declare
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
id: Schema.
|
|
44
|
-
target:
|
|
45
|
-
source:
|
|
46
|
-
channelName:
|
|
47
|
-
hops: Schema
|
|
25
|
+
export declare const DirectChannelResponseSuccess: Schema.TaggedStruct<"DirectChannelResponseSuccess", {
|
|
26
|
+
readonly reqId: Schema.String;
|
|
27
|
+
readonly port: Transferable.Transferable<Schema.declare<MessagePort, MessagePort>>;
|
|
28
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
29
|
+
readonly channelVersion: Schema.Finite;
|
|
30
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
31
|
+
readonly target: Schema.String;
|
|
32
|
+
readonly source: Schema.String;
|
|
33
|
+
readonly channelName: Schema.String;
|
|
34
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
48
35
|
}>;
|
|
49
|
-
export declare
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
channelName: typeof Schema.String;
|
|
58
|
-
hops: Schema.Array$<typeof Schema.String>;
|
|
36
|
+
export declare const DirectChannelResponseNoTransferables: Schema.TaggedStruct<"DirectChannelResponseNoTransferables", {
|
|
37
|
+
readonly reqId: Schema.String;
|
|
38
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
39
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
40
|
+
readonly target: Schema.String;
|
|
41
|
+
readonly source: Schema.String;
|
|
42
|
+
readonly channelName: Schema.String;
|
|
43
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
59
44
|
}>;
|
|
60
|
-
export declare
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
target: typeof Schema.String;
|
|
69
|
-
source: typeof Schema.String;
|
|
70
|
-
channelName: typeof Schema.String;
|
|
71
|
-
hops: Schema.Array$<typeof Schema.String>;
|
|
45
|
+
export declare const ProxyChannelRequest: Schema.TaggedStruct<"ProxyChannelRequest", {
|
|
46
|
+
readonly remainingHops: Schema.optional<Schema.Undefined>;
|
|
47
|
+
readonly channelIdCandidate: Schema.String;
|
|
48
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
49
|
+
readonly target: Schema.String;
|
|
50
|
+
readonly source: Schema.String;
|
|
51
|
+
readonly channelName: Schema.String;
|
|
52
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
72
53
|
}>;
|
|
73
|
-
export declare
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
hops: Schema.Array$<typeof Schema.String>;
|
|
54
|
+
export declare const ProxyChannelResponseSuccess: Schema.TaggedStruct<"ProxyChannelResponseSuccess", {
|
|
55
|
+
readonly reqId: Schema.String;
|
|
56
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
57
|
+
readonly combinedChannelId: Schema.String;
|
|
58
|
+
readonly channelIdCandidate: Schema.String;
|
|
59
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
60
|
+
readonly target: Schema.String;
|
|
61
|
+
readonly source: Schema.String;
|
|
62
|
+
readonly channelName: Schema.String;
|
|
63
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
84
64
|
}>;
|
|
85
|
-
export declare
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
channelName: typeof Schema.String;
|
|
95
|
-
hops: Schema.Array$<typeof Schema.String>;
|
|
65
|
+
export declare const ProxyChannelPayload: Schema.TaggedStruct<"ProxyChannelPayload", {
|
|
66
|
+
readonly remainingHops: Schema.optional<Schema.Undefined>;
|
|
67
|
+
readonly payload: Schema.Any;
|
|
68
|
+
readonly combinedChannelId: Schema.String;
|
|
69
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
70
|
+
readonly target: Schema.String;
|
|
71
|
+
readonly source: Schema.String;
|
|
72
|
+
readonly channelName: Schema.String;
|
|
73
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
96
74
|
}>;
|
|
97
|
-
export declare
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
target:
|
|
75
|
+
export declare const ProxyChannelPayloadAck: Schema.TaggedStruct<"ProxyChannelPayloadAck", {
|
|
76
|
+
readonly reqId: Schema.String;
|
|
77
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
78
|
+
readonly combinedChannelId: Schema.String;
|
|
79
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
80
|
+
readonly target: Schema.String;
|
|
81
|
+
readonly source: Schema.String;
|
|
82
|
+
readonly channelName: Schema.String;
|
|
83
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
103
84
|
}>;
|
|
104
85
|
/**
|
|
105
86
|
* Broadcast to all nodes when a new edge is added.
|
|
106
87
|
* Mostly used for auto-reconnect purposes.
|
|
107
88
|
*/
|
|
108
|
-
export declare
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
89
|
+
export declare const NetworkEdgeAdded: Schema.TaggedStruct<"NetworkEdgeAdded", {
|
|
90
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
91
|
+
readonly source: Schema.String;
|
|
92
|
+
readonly target: Schema.String;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const NetworkTopologyRequest: Schema.TaggedStruct<"NetworkTopologyRequest", {
|
|
95
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
96
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
113
97
|
/** Always fixed to who requested the topology */
|
|
114
|
-
source:
|
|
115
|
-
target: Schema.Literal<
|
|
98
|
+
readonly source: Schema.String;
|
|
99
|
+
readonly target: Schema.Literal<"-">;
|
|
116
100
|
}>;
|
|
117
|
-
export declare
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
nodeName: typeof Schema.String;
|
|
124
|
-
edges: Schema.Array$<typeof Schema.String>;
|
|
101
|
+
export declare const NetworkTopologyResponse: Schema.TaggedStruct<"NetworkTopologyResponse", {
|
|
102
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
103
|
+
readonly reqId: Schema.String;
|
|
104
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
105
|
+
readonly nodeName: Schema.String;
|
|
106
|
+
readonly edges: Schema.$Array<Schema.String>;
|
|
125
107
|
/** Always fixed to who requested the topology */
|
|
126
|
-
source:
|
|
127
|
-
target: Schema.Literal<
|
|
108
|
+
readonly source: Schema.String;
|
|
109
|
+
readonly target: Schema.Literal<"-">;
|
|
128
110
|
}>;
|
|
129
|
-
export declare class NetworkTopologyResponse extends NetworkTopologyResponse_base {
|
|
130
|
-
}
|
|
131
111
|
export declare const BroadcastChannelPacket: Schema.TaggedStruct<"BroadcastChannelPacket", {
|
|
132
|
-
id: Schema.
|
|
133
|
-
channelName:
|
|
112
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
113
|
+
readonly channelName: Schema.String;
|
|
134
114
|
/**
|
|
135
115
|
* The payload is expected to be encoded/decoded by the send/listen schema.
|
|
136
116
|
* Transferables are not supported.
|
|
137
117
|
*/
|
|
138
|
-
payload:
|
|
139
|
-
hops: Schema
|
|
140
|
-
source:
|
|
141
|
-
target: Schema.Literal<
|
|
118
|
+
readonly payload: Schema.Any;
|
|
119
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
120
|
+
readonly source: Schema.String;
|
|
121
|
+
readonly target: Schema.Literal<"-">;
|
|
142
122
|
}>;
|
|
143
|
-
declare const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
123
|
+
export declare const DirectChannelPacket: Schema.Union<readonly [Schema.TaggedStruct<"DirectChannelRequest", {
|
|
124
|
+
readonly remainingHops: Schema.optional<Schema.$Array<Schema.String>>;
|
|
125
|
+
readonly channelVersion: Schema.Finite;
|
|
126
|
+
/** Only set if the request is in response to an incoming request */
|
|
127
|
+
readonly reqId: Schema.UndefinedOr<Schema.String>;
|
|
128
|
+
/**
|
|
129
|
+
* Additionally to the `source` field, we use this field to track whether the instance of a
|
|
130
|
+
* source has changed.
|
|
131
|
+
*/
|
|
132
|
+
readonly sourceId: Schema.String;
|
|
133
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
134
|
+
readonly target: Schema.String;
|
|
135
|
+
readonly source: Schema.String;
|
|
136
|
+
readonly channelName: Schema.String;
|
|
137
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
138
|
+
}>, Schema.TaggedStruct<"DirectChannelResponseSuccess", {
|
|
139
|
+
readonly reqId: Schema.String;
|
|
140
|
+
readonly port: Transferable.Transferable<Schema.declare<MessagePort, MessagePort>>;
|
|
141
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
142
|
+
readonly channelVersion: Schema.Finite;
|
|
143
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
144
|
+
readonly target: Schema.String;
|
|
145
|
+
readonly source: Schema.String;
|
|
146
|
+
readonly channelName: Schema.String;
|
|
147
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
148
|
+
}>, Schema.TaggedStruct<"DirectChannelResponseNoTransferables", {
|
|
149
|
+
readonly reqId: Schema.String;
|
|
150
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
151
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
152
|
+
readonly target: Schema.String;
|
|
153
|
+
readonly source: Schema.String;
|
|
154
|
+
readonly channelName: Schema.String;
|
|
155
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
156
|
+
}>]>;
|
|
157
|
+
export declare const ProxyChannelPacket: Schema.Union<readonly [Schema.TaggedStruct<"ProxyChannelRequest", {
|
|
158
|
+
readonly remainingHops: Schema.optional<Schema.Undefined>;
|
|
159
|
+
readonly channelIdCandidate: Schema.String;
|
|
160
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
161
|
+
readonly target: Schema.String;
|
|
162
|
+
readonly source: Schema.String;
|
|
163
|
+
readonly channelName: Schema.String;
|
|
164
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
165
|
+
}>, Schema.TaggedStruct<"ProxyChannelResponseSuccess", {
|
|
166
|
+
readonly reqId: Schema.String;
|
|
167
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
168
|
+
readonly combinedChannelId: Schema.String;
|
|
169
|
+
readonly channelIdCandidate: Schema.String;
|
|
170
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
171
|
+
readonly target: Schema.String;
|
|
172
|
+
readonly source: Schema.String;
|
|
173
|
+
readonly channelName: Schema.String;
|
|
174
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
175
|
+
}>, Schema.TaggedStruct<"ProxyChannelPayload", {
|
|
176
|
+
readonly remainingHops: Schema.optional<Schema.Undefined>;
|
|
177
|
+
readonly payload: Schema.Any;
|
|
178
|
+
readonly combinedChannelId: Schema.String;
|
|
179
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
180
|
+
readonly target: Schema.String;
|
|
181
|
+
readonly source: Schema.String;
|
|
182
|
+
readonly channelName: Schema.String;
|
|
183
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
184
|
+
}>, Schema.TaggedStruct<"ProxyChannelPayloadAck", {
|
|
185
|
+
readonly reqId: Schema.String;
|
|
186
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
187
|
+
readonly combinedChannelId: Schema.String;
|
|
188
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
189
|
+
readonly target: Schema.String;
|
|
190
|
+
readonly source: Schema.String;
|
|
191
|
+
readonly channelName: Schema.String;
|
|
192
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
193
|
+
}>]>;
|
|
194
|
+
export declare const Packet: Schema.Union<readonly [Schema.Union<readonly [Schema.TaggedStruct<"DirectChannelRequest", {
|
|
195
|
+
readonly remainingHops: Schema.optional<Schema.$Array<Schema.String>>;
|
|
196
|
+
readonly channelVersion: Schema.Finite;
|
|
197
|
+
/** Only set if the request is in response to an incoming request */
|
|
198
|
+
readonly reqId: Schema.UndefinedOr<Schema.String>;
|
|
199
|
+
/**
|
|
200
|
+
* Additionally to the `source` field, we use this field to track whether the instance of a
|
|
201
|
+
* source has changed.
|
|
202
|
+
*/
|
|
203
|
+
readonly sourceId: Schema.String;
|
|
204
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
205
|
+
readonly target: Schema.String;
|
|
206
|
+
readonly source: Schema.String;
|
|
207
|
+
readonly channelName: Schema.String;
|
|
208
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
209
|
+
}>, Schema.TaggedStruct<"DirectChannelResponseSuccess", {
|
|
210
|
+
readonly reqId: Schema.String;
|
|
211
|
+
readonly port: Transferable.Transferable<Schema.declare<MessagePort, MessagePort>>;
|
|
212
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
213
|
+
readonly channelVersion: Schema.Finite;
|
|
214
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
215
|
+
readonly target: Schema.String;
|
|
216
|
+
readonly source: Schema.String;
|
|
217
|
+
readonly channelName: Schema.String;
|
|
218
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
219
|
+
}>, Schema.TaggedStruct<"DirectChannelResponseNoTransferables", {
|
|
220
|
+
readonly reqId: Schema.String;
|
|
221
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
222
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
223
|
+
readonly target: Schema.String;
|
|
224
|
+
readonly source: Schema.String;
|
|
225
|
+
readonly channelName: Schema.String;
|
|
226
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
227
|
+
}>]>, Schema.Union<readonly [Schema.TaggedStruct<"ProxyChannelRequest", {
|
|
228
|
+
readonly remainingHops: Schema.optional<Schema.Undefined>;
|
|
229
|
+
readonly channelIdCandidate: Schema.String;
|
|
230
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
231
|
+
readonly target: Schema.String;
|
|
232
|
+
readonly source: Schema.String;
|
|
233
|
+
readonly channelName: Schema.String;
|
|
234
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
235
|
+
}>, Schema.TaggedStruct<"ProxyChannelResponseSuccess", {
|
|
236
|
+
readonly reqId: Schema.String;
|
|
237
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
238
|
+
readonly combinedChannelId: Schema.String;
|
|
239
|
+
readonly channelIdCandidate: Schema.String;
|
|
240
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
241
|
+
readonly target: Schema.String;
|
|
242
|
+
readonly source: Schema.String;
|
|
243
|
+
readonly channelName: Schema.String;
|
|
244
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
245
|
+
}>, Schema.TaggedStruct<"ProxyChannelPayload", {
|
|
246
|
+
readonly remainingHops: Schema.optional<Schema.Undefined>;
|
|
247
|
+
readonly payload: Schema.Any;
|
|
248
|
+
readonly combinedChannelId: Schema.String;
|
|
249
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
250
|
+
readonly target: Schema.String;
|
|
251
|
+
readonly source: Schema.String;
|
|
252
|
+
readonly channelName: Schema.String;
|
|
253
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
254
|
+
}>, Schema.TaggedStruct<"ProxyChannelPayloadAck", {
|
|
255
|
+
readonly reqId: Schema.String;
|
|
256
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
257
|
+
readonly combinedChannelId: Schema.String;
|
|
258
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
259
|
+
readonly target: Schema.String;
|
|
260
|
+
readonly source: Schema.String;
|
|
261
|
+
readonly channelName: Schema.String;
|
|
262
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
263
|
+
}>]>, Schema.TaggedStruct<"NetworkEdgeAdded", {
|
|
264
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
265
|
+
readonly source: Schema.String;
|
|
266
|
+
readonly target: Schema.String;
|
|
267
|
+
}>, Schema.TaggedStruct<"NetworkTopologyRequest", {
|
|
268
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
269
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
270
|
+
/** Always fixed to who requested the topology */
|
|
271
|
+
readonly source: Schema.String;
|
|
272
|
+
readonly target: Schema.Literal<"-">;
|
|
273
|
+
}>, Schema.TaggedStruct<"NetworkTopologyResponse", {
|
|
274
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
275
|
+
readonly reqId: Schema.String;
|
|
276
|
+
readonly remainingHops: Schema.$Array<Schema.String>;
|
|
277
|
+
readonly nodeName: Schema.String;
|
|
278
|
+
readonly edges: Schema.$Array<Schema.String>;
|
|
279
|
+
/** Always fixed to who requested the topology */
|
|
280
|
+
readonly source: Schema.String;
|
|
281
|
+
readonly target: Schema.Literal<"-">;
|
|
282
|
+
}>, Schema.TaggedStruct<"BroadcastChannelPacket", {
|
|
283
|
+
readonly id: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.String, never>>;
|
|
284
|
+
readonly channelName: Schema.String;
|
|
152
285
|
/**
|
|
153
286
|
* The payload is expected to be encoded/decoded by the send/listen schema.
|
|
154
287
|
* Transferables are not supported.
|
|
155
288
|
*/
|
|
156
|
-
payload:
|
|
157
|
-
hops: Schema
|
|
158
|
-
source:
|
|
159
|
-
target: Schema.Literal<
|
|
289
|
+
readonly payload: Schema.Any;
|
|
290
|
+
readonly hops: Schema.$Array<Schema.String>;
|
|
291
|
+
readonly source: Schema.String;
|
|
292
|
+
readonly target: Schema.Literal<"-">;
|
|
160
293
|
}>]>;
|
|
161
|
-
export declare
|
|
162
|
-
}
|
|
163
|
-
declare const DirectChannelPing_base: Schema.TaggedStruct<"DirectChannelPing", {}>;
|
|
164
|
-
export declare class DirectChannelPing extends DirectChannelPing_base {
|
|
165
|
-
}
|
|
166
|
-
declare const DirectChannelPong_base: Schema.TaggedStruct<"DirectChannelPong", {}>;
|
|
167
|
-
export declare class DirectChannelPong extends DirectChannelPong_base {
|
|
168
|
-
}
|
|
169
|
-
export {};
|
|
294
|
+
export declare const DirectChannelPing: Schema.TaggedStruct<"DirectChannelPing", {}>;
|
|
295
|
+
export declare const DirectChannelPong: Schema.TaggedStruct<"DirectChannelPong", {}>;
|
|
170
296
|
//# sourceMappingURL=mesh-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-schema.d.ts","sourceRoot":"","sources":["../src/mesh-schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mesh-schema.d.ts","sourceRoot":"","sources":["../src/mesh-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAkBtE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;IAI/B,oEAAoE;;IAEpE;;;OAGG;;;;;;;EAEH,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;EAOvC,CAAA;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;EAI/C,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;EAI9B,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;EAMtC,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;EAK9B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;EAKjC,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;EAI3B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;IAGjC,iDAAiD;;;EAGjD,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;IAMlC,iDAAiD;;;EAGjD,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;IAGjC;;;OAGG;;;;;EAKH,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;IA9F9B,oEAAoE;;IAEpE;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;IA6FH,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK7B,CAAA;AAEF,eAAO,MAAM,MAAM;;;IA3GjB,oEAAoE;;IAEpE;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4DH,iDAAiD;;;;;;;;;IAWjD,iDAAiD;;;;;;IAQjD;;;OAGG;;;;;IA2BH,CAAA;AAEF,eAAO,MAAM,iBAAiB,8CAA+C,CAAA;AAE7E,eAAO,MAAM,iBAAiB,8CAA+C,CAAA"}
|