@stitchwire/client 0.0.0-stage → 0.31.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/LICENSE +21 -0
- package/README.md +296 -2
- package/dist/chunk-d3248e3w.js +728 -0
- package/dist/chunk-mva06nh4.js +709 -0
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.js +84 -0
- package/dist/enrollment.d.ts +1 -0
- package/dist/enrollment.js +503 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1680 -0
- package/dist/types/client/src/contracts.d.ts +1 -0
- package/dist/types/client/src/enrollment.d.ts +11 -0
- package/dist/types/client/src/index.d.ts +1 -0
- package/dist/types/contracts/src/door/client-error.d.ts +20 -0
- package/dist/types/contracts/src/door/common.d.ts +3 -0
- package/dist/types/contracts/src/door/event-lifecycle.d.ts +22 -0
- package/dist/types/contracts/src/door/local-contract.d.ts +466 -0
- package/dist/types/contracts/src/door/paths.d.ts +17 -0
- package/dist/types/contracts/src/door/request-bounds.d.ts +4 -0
- package/dist/types/contracts/src/door/requests.d.ts +47 -0
- package/dist/types/contracts/src/door/results.d.ts +319 -0
- package/dist/types/contracts/src/door/status.d.ts +859 -0
- package/dist/types/contracts/src/door/streams.d.ts +226 -0
- package/dist/types/contracts/src/enrollment/fleet-admission.d.ts +413 -0
- package/dist/types/contracts/src/enrollment/outcome.d.ts +29 -0
- package/dist/types/contracts/src/enrollment/request.d.ts +281 -0
- package/dist/types/contracts/src/enrollment/result.d.ts +713 -0
- package/dist/types/contracts/src/fleet/bundle.d.ts +209 -0
- package/dist/types/contracts/src/fleet/identity.d.ts +4 -0
- package/dist/types/contracts/src/fleet/manifest.d.ts +71 -0
- package/dist/types/contracts/src/fleet/status.d.ts +56 -0
- package/dist/types/contracts/src/peer-contract.d.ts +78 -0
- package/dist/types/contracts/src/protocol/bounds.d.ts +37 -0
- package/dist/types/contracts/src/protocol/broker-health.d.ts +384 -0
- package/dist/types/contracts/src/protocol/event.d.ts +222 -0
- package/dist/types/contracts/src/protocol/failure.d.ts +146 -0
- package/dist/types/contracts/src/protocol/identity.d.ts +11 -0
- package/dist/types/contracts/src/protocol/json-bounds.d.ts +6 -0
- package/dist/types/contracts/src/protocol/lane-url.d.ts +16 -0
- package/dist/types/contracts/src/protocol/paths.d.ts +7 -0
- package/dist/types/contracts/src/protocol/payload.d.ts +25 -0
- package/dist/types/contracts/src/protocol/presence.d.ts +66 -0
- package/dist/types/contracts/src/protocol/release.d.ts +61 -0
- package/dist/types/contracts/src/protocol/result.d.ts +41 -0
- package/dist/types/contracts/src/protocol/rpc.d.ts +106 -0
- package/dist/types/contracts/src/protocol/schema-parse.d.ts +23 -0
- package/dist/types/contracts/src/protocol/stream.d.ts +290 -0
- package/dist/types/contracts/src/protocol/topic.d.ts +185 -0
- package/dist/types/contracts/src/service/budgets.d.ts +3 -0
- package/dist/types/contracts/src/service/contract-descriptor.d.ts +9 -0
- package/dist/types/contracts/src/service/contracts.d.ts +430 -0
- package/dist/types/contracts/src/service/declaration.d.ts +122 -0
- package/dist/types/contracts/src/service/diagnostics.d.ts +104 -0
- package/dist/types/contracts/src/service/owner-route-path.d.ts +11 -0
- package/dist/types/contracts/src/service/policy-schema.d.ts +154 -0
- package/dist/types/contracts/src/service/request-bounds.d.ts +5 -0
- package/dist/types/contracts/src/service/service-contract.d.ts +112 -0
- package/dist/types/local-client/src/broker-health.d.ts +18 -0
- package/dist/types/local-client/src/client.d.ts +377 -0
- package/dist/types/local-client/src/contracts.d.ts +112 -0
- package/dist/types/local-client/src/declarations.d.ts +57 -0
- package/dist/types/local-client/src/door-paths.d.ts +18 -0
- package/dist/types/local-client/src/errno.d.ts +6 -0
- package/dist/types/local-client/src/error-chain.d.ts +25 -0
- package/dist/types/local-client/src/errors.d.ts +39 -0
- package/dist/types/local-client/src/event-sequence.d.ts +4 -0
- package/dist/types/local-client/src/feed.d.ts +8 -0
- package/dist/types/local-client/src/http.d.ts +20 -0
- package/dist/types/local-client/src/index.d.ts +13 -0
- package/dist/types/local-client/src/ingress.d.ts +31 -0
- package/dist/types/local-client/src/operation.d.ts +37 -0
- package/dist/types/local-client/src/options.d.ts +18 -0
- package/dist/types/local-client/src/paths.d.ts +52 -0
- package/dist/types/local-client/src/readers.d.ts +143 -0
- package/dist/types/local-client/src/service.d.ts +33 -0
- package/dist/types/local-client/src/status-readers.d.ts +756 -0
- package/dist/types/local-client/src/unary.d.ts +10 -0
- package/package.json +58 -4
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The fleet bundle: the manifest, signed, in the form every node keeps a copy of.
|
|
4
|
+
*
|
|
5
|
+
* The bundle is what lets the fleet's configuration live on every machine, not on one and reach the
|
|
6
|
+
* others by hand: a signer publishes it once, every broker keeps it and
|
|
7
|
+
* hands it to each node as it connects, and a node that holds the whole bundle hands it back to a
|
|
8
|
+
* broker that lost it. A node trusts a bundle because of the signature, never because of who sent
|
|
9
|
+
* it — so any node may carry it and no carrier can change it.
|
|
10
|
+
*
|
|
11
|
+
* Two shapes of copy. The `full` part is the whole manifest and goes only to members that hold the
|
|
12
|
+
* full copy. Each `own` member gets a `slice`: the tables projected for that one node, signed on
|
|
13
|
+
* their own, so a machine the fleet does not fully trust applies its configuration without ever
|
|
14
|
+
* learning the rest of the fleet.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MAX_FLEET_BUNDLE_BYTES: number;
|
|
17
|
+
export declare const FLEET_BUNDLE_FORMAT = "stitchwire.fleet-bundle";
|
|
18
|
+
/** An Ed25519 public key: the 32 raw bytes, base64url without padding. */
|
|
19
|
+
export declare const FleetPublicKeySchema: z.ZodString;
|
|
20
|
+
/** The keys a node or broker accepts a bundle from. Written locally, never taken from a bundle. */
|
|
21
|
+
export declare const FleetTrustSchema: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
publicKey: z.ZodString;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
export type FleetTrust = z.infer<typeof FleetTrustSchema>;
|
|
26
|
+
/**
|
|
27
|
+
* A signed document. The payload is carried as the exact string that was signed: re-serialising a
|
|
28
|
+
* parsed object before checking it would make the signature depend on key order and spacing.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FleetSignedSchema: z.ZodObject<{
|
|
31
|
+
keyId: z.ZodString;
|
|
32
|
+
payload: z.ZodString;
|
|
33
|
+
signature: z.ZodString;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type FleetSigned = z.infer<typeof FleetSignedSchema>;
|
|
36
|
+
/** What one node's configuration takes from the fleet — nothing else of the fleet is in it. */
|
|
37
|
+
export declare const FleetNodeTablesSchema: z.ZodObject<{
|
|
38
|
+
events: z.ZodObject<{
|
|
39
|
+
publish: z.ZodArray<z.ZodString>;
|
|
40
|
+
subscribe: z.ZodArray<z.ZodString>;
|
|
41
|
+
namespaces: z.ZodObject<{
|
|
42
|
+
publish: z.ZodArray<z.ZodString>;
|
|
43
|
+
subscribe: z.ZodArray<z.ZodString>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
services: z.ZodObject<{
|
|
47
|
+
grants: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
48
|
+
caller: z.ZodString;
|
|
49
|
+
target: z.ZodString;
|
|
50
|
+
service: z.ZodString;
|
|
51
|
+
scope: z.ZodObject<{
|
|
52
|
+
kind: z.ZodLiteral<"service-read">;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
caller: z.ZodString;
|
|
56
|
+
target: z.ZodString;
|
|
57
|
+
service: z.ZodString;
|
|
58
|
+
scope: z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"operation">;
|
|
60
|
+
operation: z.ZodString;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
}, z.core.$strict>]>>;
|
|
63
|
+
namespaces: z.ZodArray<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type FleetNodeTables = z.infer<typeof FleetNodeTablesSchema>;
|
|
67
|
+
export declare const FleetFullPayloadSchema: z.ZodObject<{
|
|
68
|
+
kind: z.ZodLiteral<"full">;
|
|
69
|
+
serial: z.ZodNumber;
|
|
70
|
+
issuedAt: z.ZodISODateTime;
|
|
71
|
+
manifest: z.ZodObject<{
|
|
72
|
+
version: z.ZodLiteral<1>;
|
|
73
|
+
members: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
74
|
+
copy: z.ZodEnum<{
|
|
75
|
+
full: "full";
|
|
76
|
+
own: "own";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
access: z.ZodArray<z.ZodObject<{
|
|
80
|
+
from: z.ZodString;
|
|
81
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
82
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"service-read">, z.ZodString]>>>>;
|
|
83
|
+
commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
peer: z.ZodOptional<z.ZodLiteral<true>>;
|
|
85
|
+
stream: z.ZodOptional<z.ZodLiteral<true>>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
topics: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
88
|
+
producer: z.ZodString;
|
|
89
|
+
subscribers: z.ZodArray<z.ZodString>;
|
|
90
|
+
}, z.core.$loose>>>;
|
|
91
|
+
topicNamespaces: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
92
|
+
subscribers: z.ZodArray<z.ZodString>;
|
|
93
|
+
maxTopics: z.ZodNumber;
|
|
94
|
+
maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
producer: z.ZodString;
|
|
96
|
+
}, z.core.$strict>>>;
|
|
97
|
+
serviceNamespaces: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
export declare const FleetSlicePayloadSchema: z.ZodObject<{
|
|
101
|
+
kind: z.ZodLiteral<"slice">;
|
|
102
|
+
serial: z.ZodNumber;
|
|
103
|
+
issuedAt: z.ZodISODateTime;
|
|
104
|
+
node: z.ZodString;
|
|
105
|
+
tables: z.ZodObject<{
|
|
106
|
+
events: z.ZodObject<{
|
|
107
|
+
publish: z.ZodArray<z.ZodString>;
|
|
108
|
+
subscribe: z.ZodArray<z.ZodString>;
|
|
109
|
+
namespaces: z.ZodObject<{
|
|
110
|
+
publish: z.ZodArray<z.ZodString>;
|
|
111
|
+
subscribe: z.ZodArray<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
services: z.ZodObject<{
|
|
115
|
+
grants: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
116
|
+
caller: z.ZodString;
|
|
117
|
+
target: z.ZodString;
|
|
118
|
+
service: z.ZodString;
|
|
119
|
+
scope: z.ZodObject<{
|
|
120
|
+
kind: z.ZodLiteral<"service-read">;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
123
|
+
caller: z.ZodString;
|
|
124
|
+
target: z.ZodString;
|
|
125
|
+
service: z.ZodString;
|
|
126
|
+
scope: z.ZodObject<{
|
|
127
|
+
kind: z.ZodLiteral<"operation">;
|
|
128
|
+
operation: z.ZodString;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
}, z.core.$strict>]>>;
|
|
131
|
+
namespaces: z.ZodArray<z.ZodString>;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
/**
|
|
136
|
+
* One edition of the fleet's configuration. `full` is null in a copy reduced to one node's slice —
|
|
137
|
+
* the only form an `own` member ever receives or stores.
|
|
138
|
+
*/
|
|
139
|
+
export declare const FleetBundleSchema: z.ZodObject<{
|
|
140
|
+
format: z.ZodLiteral<"stitchwire.fleet-bundle">;
|
|
141
|
+
serial: z.ZodNumber;
|
|
142
|
+
full: z.ZodNullable<z.ZodObject<{
|
|
143
|
+
keyId: z.ZodString;
|
|
144
|
+
payload: z.ZodString;
|
|
145
|
+
signature: z.ZodString;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
slices: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
148
|
+
keyId: z.ZodString;
|
|
149
|
+
payload: z.ZodString;
|
|
150
|
+
signature: z.ZodString;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
export type FleetBundle = z.infer<typeof FleetBundleSchema>;
|
|
154
|
+
/** Node → broker, on every connect and every offer: the edition this node keeps. */
|
|
155
|
+
export declare const FleetSyncSchema: z.ZodObject<{
|
|
156
|
+
serial: z.ZodNullable<z.ZodNumber>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
export type FleetSync = z.infer<typeof FleetSyncSchema>;
|
|
159
|
+
/**
|
|
160
|
+
* The edition the broker keeps, and the bundle itself — reduced to what this node may hold — only
|
|
161
|
+
* when it is newer than the node's. `serial` lets a node that holds the full copy see that the
|
|
162
|
+
* broker is behind and hand it the newer one.
|
|
163
|
+
*/
|
|
164
|
+
export declare const FleetSyncAckSchema: z.ZodObject<{
|
|
165
|
+
serial: z.ZodNullable<z.ZodNumber>;
|
|
166
|
+
bundle: z.ZodNullable<z.ZodObject<{
|
|
167
|
+
format: z.ZodLiteral<"stitchwire.fleet-bundle">;
|
|
168
|
+
serial: z.ZodNumber;
|
|
169
|
+
full: z.ZodNullable<z.ZodObject<{
|
|
170
|
+
keyId: z.ZodString;
|
|
171
|
+
payload: z.ZodString;
|
|
172
|
+
signature: z.ZodString;
|
|
173
|
+
}, z.core.$strict>>;
|
|
174
|
+
slices: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
175
|
+
keyId: z.ZodString;
|
|
176
|
+
payload: z.ZodString;
|
|
177
|
+
signature: z.ZodString;
|
|
178
|
+
}, z.core.$strict>>;
|
|
179
|
+
}, z.core.$strict>>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
export type FleetSyncAck = z.infer<typeof FleetSyncAckSchema>;
|
|
182
|
+
/** Any node → broker: a complete bundle to keep. Its signature is the authority, not the sender. */
|
|
183
|
+
export declare const FleetPublishSchema: z.ZodObject<{
|
|
184
|
+
bundle: z.ZodObject<{
|
|
185
|
+
format: z.ZodLiteral<"stitchwire.fleet-bundle">;
|
|
186
|
+
serial: z.ZodNumber;
|
|
187
|
+
full: z.ZodNullable<z.ZodObject<{
|
|
188
|
+
keyId: z.ZodString;
|
|
189
|
+
payload: z.ZodString;
|
|
190
|
+
signature: z.ZodString;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
slices: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
193
|
+
keyId: z.ZodString;
|
|
194
|
+
payload: z.ZodString;
|
|
195
|
+
signature: z.ZodString;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
export type FleetPublish = z.infer<typeof FleetPublishSchema>;
|
|
200
|
+
export declare const FleetPublishAckSchema: z.ZodObject<{
|
|
201
|
+
accepted: z.ZodBoolean;
|
|
202
|
+
serial: z.ZodNullable<z.ZodNumber>;
|
|
203
|
+
detail: z.ZodString;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
export type FleetPublishAck = z.infer<typeof FleetPublishAckSchema>;
|
|
206
|
+
/** Broker → every node: a newer edition is kept here; ask for it. */
|
|
207
|
+
export declare const FleetOfferSchema: z.ZodObject<{
|
|
208
|
+
serial: z.ZodNumber;
|
|
209
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The fleet's own declaration of authority: who belongs to the fleet, and what each pair of nodes
|
|
4
|
+
* may do to each other.
|
|
5
|
+
*
|
|
6
|
+
* A permission is a fact about a PAIR: this node may do that to that node. Deployed, it is stored
|
|
7
|
+
* several times over — capabilities, command grants, service grants and topics at each broker, the
|
|
8
|
+
* matching halves at each node — and every copy edited by hand drifts. So the manifest is written
|
|
9
|
+
* the way a reader asks the question, one entry per pair, and every deployed table is projected from
|
|
10
|
+
* it (`runtime/src/fleet/projection.ts`). What is not declared here does not appear there.
|
|
11
|
+
*
|
|
12
|
+
* Namespaces are where the manifest deliberately says less: it grants a node a prefix, and the
|
|
13
|
+
* owners of that node's applications declare the topics and services inside it themselves.
|
|
14
|
+
*/
|
|
15
|
+
export declare const FLEET_MANIFEST_VERSION = 1;
|
|
16
|
+
/** What a topic namespace grants, whoever produces in it. */
|
|
17
|
+
export declare const FleetTopicGrantSchema: z.ZodObject<{
|
|
18
|
+
subscribers: z.ZodArray<z.ZodString>;
|
|
19
|
+
maxTopics: z.ZodNumber;
|
|
20
|
+
maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export declare const FleetTopicNamespaceSchema: z.ZodObject<{
|
|
23
|
+
subscribers: z.ZodArray<z.ZodString>;
|
|
24
|
+
maxTopics: z.ZodNumber;
|
|
25
|
+
maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
producer: z.ZodString;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
/**
|
|
29
|
+
* How much of the fleet a member keeps. `full` holds the whole signed bundle and can hand it to any
|
|
30
|
+
* broker that lost it; `own` holds only its own signed part and never learns about the rest of the
|
|
31
|
+
* fleet — the right shape for a machine the fleet does not fully trust.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FleetCopySchema: z.ZodEnum<{
|
|
34
|
+
full: "full";
|
|
35
|
+
own: "own";
|
|
36
|
+
}>;
|
|
37
|
+
export declare const FleetMemberSchema: z.ZodObject<{
|
|
38
|
+
copy: z.ZodEnum<{
|
|
39
|
+
full: "full";
|
|
40
|
+
own: "own";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export declare const FleetManifestSchema: z.ZodObject<{
|
|
44
|
+
version: z.ZodLiteral<1>;
|
|
45
|
+
members: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
46
|
+
copy: z.ZodEnum<{
|
|
47
|
+
full: "full";
|
|
48
|
+
own: "own";
|
|
49
|
+
}>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
access: z.ZodArray<z.ZodObject<{
|
|
52
|
+
from: z.ZodString;
|
|
53
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
54
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"service-read">, z.ZodString]>>>>;
|
|
55
|
+
commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
peer: z.ZodOptional<z.ZodLiteral<true>>;
|
|
57
|
+
stream: z.ZodOptional<z.ZodLiteral<true>>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
topics: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
60
|
+
producer: z.ZodString;
|
|
61
|
+
subscribers: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$loose>>>;
|
|
63
|
+
topicNamespaces: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
64
|
+
subscribers: z.ZodArray<z.ZodString>;
|
|
65
|
+
maxTopics: z.ZodNumber;
|
|
66
|
+
maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
producer: z.ZodString;
|
|
68
|
+
}, z.core.$strict>>>;
|
|
69
|
+
serviceNamespaces: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export type FleetManifest = z.output<typeof FleetManifestSchema>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the configuration this process runs matches the edition it keeps.
|
|
4
|
+
*
|
|
5
|
+
* `unconfigured` — no fleet trust is configured, and the configuration is edited by hand.
|
|
6
|
+
* `unknown` — trust is configured, but there is no verified edition to compare with yet.
|
|
7
|
+
* `aligned` — the fleet tables on disk are exactly the projection of the kept edition.
|
|
8
|
+
* `drifted` — they differ and could not be rewritten; `detail` says why.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FleetConfigStateSchema: z.ZodEnum<{
|
|
11
|
+
aligned: "aligned";
|
|
12
|
+
drifted: "drifted";
|
|
13
|
+
unconfigured: "unconfigured";
|
|
14
|
+
unknown: "unknown";
|
|
15
|
+
}>;
|
|
16
|
+
export type FleetConfigState = z.infer<typeof FleetConfigStateSchema>;
|
|
17
|
+
export declare const FleetEditionStatusSchema: z.ZodObject<{
|
|
18
|
+
serial: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
issuedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
20
|
+
signer: z.ZodNullable<z.ZodString>;
|
|
21
|
+
config: z.ZodEnum<{
|
|
22
|
+
aligned: "aligned";
|
|
23
|
+
drifted: "drifted";
|
|
24
|
+
unconfigured: "unconfigured";
|
|
25
|
+
unknown: "unknown";
|
|
26
|
+
}>;
|
|
27
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
28
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export type FleetEditionStatus = z.infer<typeof FleetEditionStatusSchema>;
|
|
31
|
+
/** A node's view: its own copy, and the edition each of its brokers answered with. */
|
|
32
|
+
export declare const FleetNodeStatusSchema: z.ZodObject<{
|
|
33
|
+
serial: z.ZodNullable<z.ZodNumber>;
|
|
34
|
+
issuedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
35
|
+
signer: z.ZodNullable<z.ZodString>;
|
|
36
|
+
config: z.ZodEnum<{
|
|
37
|
+
aligned: "aligned";
|
|
38
|
+
drifted: "drifted";
|
|
39
|
+
unconfigured: "unconfigured";
|
|
40
|
+
unknown: "unknown";
|
|
41
|
+
}>;
|
|
42
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
43
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
44
|
+
copy: z.ZodEnum<{
|
|
45
|
+
full: "full";
|
|
46
|
+
none: "none";
|
|
47
|
+
own: "own";
|
|
48
|
+
}>;
|
|
49
|
+
lanes: z.ZodArray<z.ZodObject<{
|
|
50
|
+
lane: z.ZodString;
|
|
51
|
+
serial: z.ZodNullable<z.ZodNumber>;
|
|
52
|
+
syncedAt: z.ZodISODateTime;
|
|
53
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
export type FleetNodeStatus = z.infer<typeof FleetNodeStatusSchema>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PEER_TIMEOUT_MS = 2000;
|
|
3
|
+
export declare const PEER_FRESH_MS = 5000;
|
|
4
|
+
export declare const PEER_WINDOW_MS = 60000;
|
|
5
|
+
/** Probes in flight at once, per lane on a node and per caller on a broker. */
|
|
6
|
+
export declare const PEER_MAX_INFLIGHT = 8;
|
|
7
|
+
/** Probes admitted per minute, per identity on a broker and per node. */
|
|
8
|
+
export declare const PEER_MAX_PER_MINUTE = 60;
|
|
9
|
+
/** Routes and callers remembered at once. */
|
|
10
|
+
export declare const PEER_MAX_ROUTES = 128;
|
|
11
|
+
/** Round-trip samples kept per route inside the window. */
|
|
12
|
+
export declare const PEER_MAX_SAMPLES = 16;
|
|
13
|
+
export declare const PeerProbeSchema: z.ZodObject<{
|
|
14
|
+
id: z.ZodUUID;
|
|
15
|
+
to: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export declare const PeerEchoSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodUUID;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export declare const PeerOutcomeSchema: z.ZodEnum<{
|
|
21
|
+
capacity: "capacity";
|
|
22
|
+
denied: "denied";
|
|
23
|
+
offline: "offline";
|
|
24
|
+
ok: "ok";
|
|
25
|
+
stale: "stale";
|
|
26
|
+
timeout: "timeout";
|
|
27
|
+
unsupported: "unsupported";
|
|
28
|
+
}>;
|
|
29
|
+
export declare const PeerReplySchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodUUID;
|
|
31
|
+
outcome: z.ZodEnum<{
|
|
32
|
+
capacity: "capacity";
|
|
33
|
+
denied: "denied";
|
|
34
|
+
offline: "offline";
|
|
35
|
+
ok: "ok";
|
|
36
|
+
stale: "stale";
|
|
37
|
+
timeout: "timeout";
|
|
38
|
+
unsupported: "unsupported";
|
|
39
|
+
}>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export type PeerOutcome = z.infer<typeof PeerOutcomeSchema>;
|
|
42
|
+
export type PeerReply = z.infer<typeof PeerReplySchema>;
|
|
43
|
+
export declare const PeerRequestSchema: z.ZodObject<{
|
|
44
|
+
to: z.ZodString;
|
|
45
|
+
route: z.ZodOptional<z.ZodString>;
|
|
46
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
47
|
+
cached: "cached";
|
|
48
|
+
observe: "observe";
|
|
49
|
+
}>>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export type PeerRequest = z.infer<typeof PeerRequestSchema>;
|
|
52
|
+
export declare const PeerObservationSchema: z.ZodObject<{
|
|
53
|
+
v: z.ZodLiteral<7>;
|
|
54
|
+
observer: z.ZodString;
|
|
55
|
+
target: z.ZodString;
|
|
56
|
+
route: z.ZodNullable<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
url: z.ZodString;
|
|
59
|
+
epoch: z.ZodString;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
outcome: z.ZodEnum<{
|
|
62
|
+
capacity: "capacity";
|
|
63
|
+
denied: "denied";
|
|
64
|
+
offline: "offline";
|
|
65
|
+
ok: "ok";
|
|
66
|
+
stale: "stale";
|
|
67
|
+
timeout: "timeout";
|
|
68
|
+
unsupported: "unsupported";
|
|
69
|
+
}>;
|
|
70
|
+
observedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
71
|
+
freshnessMs: z.ZodLiteral<5000>;
|
|
72
|
+
ageMs: z.ZodNullable<z.ZodNumber>;
|
|
73
|
+
aggregationWindowMs: z.ZodLiteral<60000>;
|
|
74
|
+
sampleCount: z.ZodNumber;
|
|
75
|
+
latestMs: z.ZodNullable<z.ZodNumber>;
|
|
76
|
+
medianMs: z.ZodNullable<z.ZodNumber>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
export type PeerObservation = z.infer<typeof PeerObservationSchema>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const MAX_STREAM_BYTES: number;
|
|
2
|
+
export declare const MAX_FRAME_BYTES: number;
|
|
3
|
+
export declare const MAX_ARG_COUNT = 64;
|
|
4
|
+
export declare const MAX_ARG_BYTES: number;
|
|
5
|
+
export declare const MAX_STDIN_BYTES: number;
|
|
6
|
+
/** Commands may contain several bounded stages; streams retain their separate lifetime limit. */
|
|
7
|
+
export declare const MAX_COMMAND_TIMEOUT_MS = 3600000;
|
|
8
|
+
export declare const MAX_COMMAND_CANCELLATION_GRACE_MS = 900000;
|
|
9
|
+
/** A stream bounds a total lifetime, and a call that sets no deadline of its own gets at most this. */
|
|
10
|
+
export declare const MAX_STREAM_TIMEOUT_MS = 900000;
|
|
11
|
+
export declare const MAX_STREAM_CHUNK_BYTES: number;
|
|
12
|
+
export declare const MAX_STREAM_WINDOW_BYTES: number;
|
|
13
|
+
export declare const MAX_STREAM_TOTAL_BYTES: number;
|
|
14
|
+
export declare const MAX_EVENT_BYTES: number;
|
|
15
|
+
/** Retention is a memory cost the broker pays for a topic nobody may be listening to, so the ceiling
|
|
16
|
+
* is the protocol's business and not a per-deployment opinion. Minutes and megabytes, not days. */
|
|
17
|
+
export declare const MAX_TOPIC_RETAIN_AGE_MS = 3600000;
|
|
18
|
+
export declare const MAX_TOPIC_RETAINED_BYTES: number;
|
|
19
|
+
export declare const MAX_RETAINED_BYTES_TOTAL: number;
|
|
20
|
+
export declare const MAX_TOPIC_NAME_BYTES = 128;
|
|
21
|
+
/** Nodes in one fleet: the roster a broker is configured with and every answer that lists it. */
|
|
22
|
+
export declare const MAX_NODES = 1024;
|
|
23
|
+
/**
|
|
24
|
+
* Ceilings on the audit journal's own knobs.
|
|
25
|
+
*
|
|
26
|
+
* The journal is the one thing this process writes to disk without bound, so the size of a
|
|
27
|
+
* generation and the number of them kept are capped here rather than left to a config that can ask
|
|
28
|
+
* for anything: an operator may choose how much history to keep, never whether the journal has an
|
|
29
|
+
* end.
|
|
30
|
+
*/
|
|
31
|
+
export declare const MAX_AUDIT_FILE_BYTES: number;
|
|
32
|
+
export declare const MAX_AUDIT_GENERATIONS = 64;
|
|
33
|
+
/** The door's own ceilings: the largest request body it takes, the largest answer a client reads and
|
|
34
|
+
* the largest frame of an NDJSON stream. */
|
|
35
|
+
export declare const DOOR_MAX_REQUEST_BYTES: number;
|
|
36
|
+
export declare const DOOR_MAX_RESPONSE_BYTES: number;
|
|
37
|
+
export declare const DOOR_MAX_FRAME_BYTES: number;
|