@aeolus-fleet/common 0.26.1 → 0.27.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/dist/fleet/core-version.d.ts +20 -0
- package/dist/fleet/core-version.js +59 -0
- package/dist/fleet/core-version.js.map +1 -0
- package/dist/fleet/index.d.ts +70 -9
- package/dist/fleet/index.js +90 -7
- package/dist/fleet/index.js.map +1 -1
- package/dist/fleet/no-terminal-questions.d.ts +1 -1
- package/dist/fleet/no-terminal-questions.js +1 -1
- package/dist/fleet/no-terminal-questions.js.map +1 -1
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +1 -0
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/read-reach.d.ts +4 -0
- package/dist/rules/read-reach.js +5 -0
- package/dist/rules/read-reach.js.map +1 -0
- package/dist/schemas/console.d.ts +6 -0
- package/dist/schemas/crew-request.d.ts +2 -0
- package/dist/schemas/crew-request.js +3 -0
- package/dist/schemas/crew-request.js.map +1 -1
- package/dist/schemas/delivery.d.ts +79 -4
- package/dist/schemas/delivery.js +43 -5
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/fleet.d.ts +72 -37
- package/dist/schemas/fleet.js +31 -9
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +8 -0
- package/dist/schemas/history.d.ts +232 -19
- package/dist/schemas/history.js +20 -3
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/message.d.ts +1 -0
- package/dist/schemas/message.js +2 -0
- package/dist/schemas/message.js.map +1 -1
- package/dist/schemas/needs-attention.d.ts +0 -150
- package/dist/schemas/needs-attention.js +1 -33
- package/dist/schemas/needs-attention.js.map +1 -1
- package/dist/schemas/network.d.ts +319 -12
- package/dist/schemas/network.js +84 -15
- package/dist/schemas/network.js.map +1 -1
- package/dist/schemas/scopes.d.ts +56 -0
- package/dist/schemas/scopes.js +35 -0
- package/dist/schemas/scopes.js.map +1 -0
- package/dist/schemas/ship.d.ts +2 -0
- package/dist/schemas/ship.js +7 -0
- package/dist/schemas/ship.js.map +1 -1
- package/dist/schemas/statement.d.ts +182 -0
- package/dist/schemas/statement.js +114 -0
- package/dist/schemas/statement.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
|
-
* Network rules (decision 0034): which ships may send to
|
|
4
|
-
*
|
|
5
|
-
* another; a selector is a list of terms that must all hold (an empty one
|
|
3
|
+
* Network rules (decision 0034): which ships may send to, read or manage
|
|
4
|
+
* which. A rule names its verb and says that the ships matching one selector
|
|
5
|
+
* may do it to the ships matching another; a selector is a list of terms that must all hold (an empty one
|
|
6
6
|
* holds for every ship). Allow-only. The limits are the decision's; the server
|
|
7
7
|
* checks them, so every refusal names it.
|
|
8
8
|
*/
|
|
@@ -18,8 +18,10 @@ export declare const ANY_LABEL_VALUE: "*";
|
|
|
18
18
|
export declare const SAME_LABEL_VALUE: "#";
|
|
19
19
|
/**
|
|
20
20
|
* One term of a selector: an exact label value, written as its id, which
|
|
21
|
-
* names its label;
|
|
22
|
-
* the other side's (`#`), which binds the same label there only
|
|
21
|
+
* names its label; a label with any value (`*`) or with the same value as
|
|
22
|
+
* the other side's (`#`), which binds the same label there only; or the
|
|
23
|
+
* owner (decision 0045): an owner's ship by its id, any owner (`*`), or the
|
|
24
|
+
* same owner as the other side's (`#`), which binds the owner there.
|
|
23
25
|
*/
|
|
24
26
|
export declare const selectorTermSchema: z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
25
27
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -27,8 +29,20 @@ export declare const selectorTermSchema: z.ZodUnion<readonly [z.ZodType<`lbv_${s
|
|
|
27
29
|
"*": "*";
|
|
28
30
|
"#": "#";
|
|
29
31
|
}>;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
34
|
+
"*": "*";
|
|
35
|
+
"#": "#";
|
|
36
|
+
}>]>;
|
|
30
37
|
}, z.core.$strip>]>;
|
|
31
38
|
export type SelectorTerm = z.infer<typeof selectorTermSchema>;
|
|
39
|
+
/** A term of the owner (decision 0045). */
|
|
40
|
+
export type OwnerTerm = Extract<SelectorTerm, {
|
|
41
|
+
owner: unknown;
|
|
42
|
+
}>;
|
|
43
|
+
/** A term on a label: an exact value, or a label with any or the same value. */
|
|
44
|
+
export type LabelTerm = Exclude<SelectorTerm, OwnerTerm>;
|
|
45
|
+
export declare function isOwnerTerm(term: SelectorTerm): term is OwnerTerm;
|
|
32
46
|
/** The ships for which every one of these terms holds, combined with AND. */
|
|
33
47
|
export declare const labelSelectorSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
34
48
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -36,15 +50,33 @@ export declare const labelSelectorSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodT
|
|
|
36
50
|
"*": "*";
|
|
37
51
|
"#": "#";
|
|
38
52
|
}>;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
55
|
+
"*": "*";
|
|
56
|
+
"#": "#";
|
|
57
|
+
}>]>;
|
|
39
58
|
}, z.core.$strip>]>>;
|
|
40
|
-
/**
|
|
59
|
+
/** What a rule lets one ship do to another: send to it, read it or manage it (decision 0034). */
|
|
60
|
+
export declare const NETWORK_VERBS: readonly ["send", "read", "manage"];
|
|
61
|
+
export type NetworkVerb = (typeof NETWORK_VERBS)[number];
|
|
62
|
+
/** One rule: the ships matching `from` may do its verb to the ships matching `to`. */
|
|
41
63
|
export declare const networkRuleSchema: z.ZodObject<{
|
|
64
|
+
verb: z.ZodEnum<{
|
|
65
|
+
send: "send";
|
|
66
|
+
read: "read";
|
|
67
|
+
manage: "manage";
|
|
68
|
+
}>;
|
|
42
69
|
from: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
43
70
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
44
71
|
value: z.ZodEnum<{
|
|
45
72
|
"*": "*";
|
|
46
73
|
"#": "#";
|
|
47
74
|
}>;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
77
|
+
"*": "*";
|
|
78
|
+
"#": "#";
|
|
79
|
+
}>]>;
|
|
48
80
|
}, z.core.$strip>]>>;
|
|
49
81
|
to: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
50
82
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -52,18 +84,33 @@ export declare const networkRuleSchema: z.ZodObject<{
|
|
|
52
84
|
"*": "*";
|
|
53
85
|
"#": "#";
|
|
54
86
|
}>;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
89
|
+
"*": "*";
|
|
90
|
+
"#": "#";
|
|
91
|
+
}>]>;
|
|
55
92
|
}, z.core.$strip>]>>;
|
|
56
93
|
}, z.core.$strip>;
|
|
57
94
|
export type NetworkRule = z.infer<typeof networkRuleSchema>;
|
|
58
|
-
/** Input of `fleet.setNetworkRules` (fleet:network): every rule the fleet holds from now on
|
|
95
|
+
/** Input of `fleet.setNetworkRules` (fleet:network): every rule the fleet holds from now on beside the built-in ones. */
|
|
59
96
|
export declare const setNetworkRulesInputSchema: z.ZodObject<{
|
|
60
|
-
rules: z.
|
|
97
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
98
|
+
verb: z.ZodEnum<{
|
|
99
|
+
send: "send";
|
|
100
|
+
read: "read";
|
|
101
|
+
manage: "manage";
|
|
102
|
+
}>;
|
|
61
103
|
from: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
62
104
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
63
105
|
value: z.ZodEnum<{
|
|
64
106
|
"*": "*";
|
|
65
107
|
"#": "#";
|
|
66
108
|
}>;
|
|
109
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
111
|
+
"*": "*";
|
|
112
|
+
"#": "#";
|
|
113
|
+
}>]>;
|
|
67
114
|
}, z.core.$strip>]>>;
|
|
68
115
|
to: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
69
116
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -71,9 +118,95 @@ export declare const setNetworkRulesInputSchema: z.ZodObject<{
|
|
|
71
118
|
"*": "*";
|
|
72
119
|
"#": "#";
|
|
73
120
|
}>;
|
|
121
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
122
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
123
|
+
"*": "*";
|
|
124
|
+
"#": "#";
|
|
125
|
+
}>]>;
|
|
74
126
|
}, z.core.$strip>]>>;
|
|
75
|
-
}, z.core.$strip
|
|
127
|
+
}, z.core.$strip>>;
|
|
76
128
|
}, z.core.$strip>;
|
|
129
|
+
/**
|
|
130
|
+
* The built-in rules, core's own (decision 0034): argo to and from every ship,
|
|
131
|
+
* the owner's ship to the ships it owns, an answer to the sender of the
|
|
132
|
+
* message it answers, and a connected plugin's ship reading every ship, which
|
|
133
|
+
* are never off; the viewer reading every ship,
|
|
134
|
+
* which argo turns off or on; and open, every ship to every ship, one per
|
|
135
|
+
* verb, which the networking plugin turns off or on.
|
|
136
|
+
*/
|
|
137
|
+
export declare const BUILT_IN_RULES: readonly ["argo", "owner", "answer", "pluginRead", "viewerRead", "open"];
|
|
138
|
+
export type BuiltInRule = (typeof BUILT_IN_RULES)[number];
|
|
139
|
+
/** The built-in rules that are never off. */
|
|
140
|
+
export declare const FIXED_BUILT_IN_RULES: readonly ["argo", "owner", "answer", "pluginRead"];
|
|
141
|
+
/** Input of `fleet.setBuiltInRule` (fleet:network): a built-in rule turned on or off, open for one verb, which it names and no other rule does. */
|
|
142
|
+
export declare const setBuiltInRuleInputSchema: z.ZodObject<{
|
|
143
|
+
rule: z.ZodEnum<{
|
|
144
|
+
owner: "owner";
|
|
145
|
+
open: "open";
|
|
146
|
+
argo: "argo";
|
|
147
|
+
answer: "answer";
|
|
148
|
+
pluginRead: "pluginRead";
|
|
149
|
+
viewerRead: "viewerRead";
|
|
150
|
+
}>;
|
|
151
|
+
verb: z.ZodOptional<z.ZodEnum<{
|
|
152
|
+
send: "send";
|
|
153
|
+
read: "read";
|
|
154
|
+
manage: "manage";
|
|
155
|
+
}>>;
|
|
156
|
+
isOn: z.ZodBoolean;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
export type SetBuiltInRuleInput = z.infer<typeof setBuiltInRuleInputSchema>;
|
|
159
|
+
/**
|
|
160
|
+
* One built-in rule as it is now: open for one verb, which it names and no
|
|
161
|
+
* other rule does, and whether it is on; the fixed ones always are.
|
|
162
|
+
*/
|
|
163
|
+
export declare const builtInRuleStateSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
164
|
+
rule: z.ZodEnum<{
|
|
165
|
+
owner: "owner";
|
|
166
|
+
argo: "argo";
|
|
167
|
+
answer: "answer";
|
|
168
|
+
pluginRead: "pluginRead";
|
|
169
|
+
viewerRead: "viewerRead";
|
|
170
|
+
}>;
|
|
171
|
+
isOn: z.ZodBoolean;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
rule: z.ZodLiteral<"open">;
|
|
174
|
+
verb: z.ZodEnum<{
|
|
175
|
+
send: "send";
|
|
176
|
+
read: "read";
|
|
177
|
+
manage: "manage";
|
|
178
|
+
}>;
|
|
179
|
+
isOn: z.ZodBoolean;
|
|
180
|
+
}, z.core.$strip>]>;
|
|
181
|
+
export type BuiltInRuleState = z.infer<typeof builtInRuleStateSchema>;
|
|
182
|
+
/** Output of `fleet.builtInRules` (fleet:network): every built-in rule as it is now, in the order the rule list shows them, first (decision 0034). */
|
|
183
|
+
export declare const builtInRulesOutputSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
184
|
+
rule: z.ZodEnum<{
|
|
185
|
+
owner: "owner";
|
|
186
|
+
argo: "argo";
|
|
187
|
+
answer: "answer";
|
|
188
|
+
pluginRead: "pluginRead";
|
|
189
|
+
viewerRead: "viewerRead";
|
|
190
|
+
}>;
|
|
191
|
+
isOn: z.ZodBoolean;
|
|
192
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
193
|
+
rule: z.ZodLiteral<"open">;
|
|
194
|
+
verb: z.ZodEnum<{
|
|
195
|
+
send: "send";
|
|
196
|
+
read: "read";
|
|
197
|
+
manage: "manage";
|
|
198
|
+
}>;
|
|
199
|
+
isOn: z.ZodBoolean;
|
|
200
|
+
}, z.core.$strip>]>>;
|
|
201
|
+
/**
|
|
202
|
+
* Output of `fleet.networkPlugin` (fleet:read): the fleet's networking plugin,
|
|
203
|
+
* its ship and when it registered, or null without one (decision 0035). The
|
|
204
|
+
* gateway reads it before it switches on for a fleet (interop I-3).
|
|
205
|
+
*/
|
|
206
|
+
export declare const networkPluginOutputSchema: z.ZodNullable<z.ZodObject<{
|
|
207
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
208
|
+
registeredAt: z.ZodISODateTime;
|
|
209
|
+
}, z.core.$strip>>;
|
|
77
210
|
/** Output of `fleet.setNetworkRules`: the version the fleet's network settings have now. */
|
|
78
211
|
export declare const setNetworkRulesOutputSchema: z.ZodObject<{
|
|
79
212
|
version: z.ZodInt;
|
|
@@ -81,12 +214,22 @@ export declare const setNetworkRulesOutputSchema: z.ZodObject<{
|
|
|
81
214
|
/** Input of `fleet.declareNetworkRules` (labels:define): every rule the ship declares from now on, on labels it owns; an empty list withdraws them (decision 0037). */
|
|
82
215
|
export declare const declareNetworkRulesInputSchema: z.ZodObject<{
|
|
83
216
|
rules: z.ZodArray<z.ZodObject<{
|
|
217
|
+
verb: z.ZodEnum<{
|
|
218
|
+
send: "send";
|
|
219
|
+
read: "read";
|
|
220
|
+
manage: "manage";
|
|
221
|
+
}>;
|
|
84
222
|
from: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
85
223
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
86
224
|
value: z.ZodEnum<{
|
|
87
225
|
"*": "*";
|
|
88
226
|
"#": "#";
|
|
89
227
|
}>;
|
|
228
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
229
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
230
|
+
"*": "*";
|
|
231
|
+
"#": "#";
|
|
232
|
+
}>]>;
|
|
90
233
|
}, z.core.$strip>]>>;
|
|
91
234
|
to: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
92
235
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -94,6 +237,11 @@ export declare const declareNetworkRulesInputSchema: z.ZodObject<{
|
|
|
94
237
|
"*": "*";
|
|
95
238
|
"#": "#";
|
|
96
239
|
}>;
|
|
240
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
241
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
242
|
+
"*": "*";
|
|
243
|
+
"#": "#";
|
|
244
|
+
}>]>;
|
|
97
245
|
}, z.core.$strip>]>>;
|
|
98
246
|
}, z.core.$strip>>;
|
|
99
247
|
}, z.core.$strip>;
|
|
@@ -105,12 +253,22 @@ export declare const declareNetworkRulesOutputSchema: z.ZodObject<{
|
|
|
105
253
|
export declare const declaredNetworkRulesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
106
254
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
107
255
|
rules: z.ZodArray<z.ZodObject<{
|
|
256
|
+
verb: z.ZodEnum<{
|
|
257
|
+
send: "send";
|
|
258
|
+
read: "read";
|
|
259
|
+
manage: "manage";
|
|
260
|
+
}>;
|
|
108
261
|
from: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
109
262
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
110
263
|
value: z.ZodEnum<{
|
|
111
264
|
"*": "*";
|
|
112
265
|
"#": "#";
|
|
113
266
|
}>;
|
|
267
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
269
|
+
"*": "*";
|
|
270
|
+
"#": "#";
|
|
271
|
+
}>]>;
|
|
114
272
|
}, z.core.$strip>]>>;
|
|
115
273
|
to: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
116
274
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -118,6 +276,11 @@ export declare const declaredNetworkRulesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
118
276
|
"*": "*";
|
|
119
277
|
"#": "#";
|
|
120
278
|
}>;
|
|
279
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
280
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
281
|
+
"*": "*";
|
|
282
|
+
"#": "#";
|
|
283
|
+
}>]>;
|
|
121
284
|
}, z.core.$strip>]>>;
|
|
122
285
|
}, z.core.$strip>>;
|
|
123
286
|
}, z.core.$strip>>;
|
|
@@ -142,7 +305,13 @@ export declare const registerNetworkPluginInputSchema: z.ZodObject<{
|
|
|
142
305
|
notRespondingAfterSeconds: z.ZodInt;
|
|
143
306
|
}, z.core.$strip>;
|
|
144
307
|
export type NetworkPluginDeclaration = z.infer<typeof registerNetworkPluginInputSchema>;
|
|
145
|
-
/**
|
|
308
|
+
/**
|
|
309
|
+
* The request header a plugin ship names the ship it reads on behalf of with,
|
|
310
|
+
* by id: every fleet:read read then answers with that ship's read reach
|
|
311
|
+
* (decision 0034). Any other call refuses it.
|
|
312
|
+
*/
|
|
313
|
+
export declare const ON_BEHALF_OF_HEADER = "aeolus-on-behalf-of";
|
|
314
|
+
/** One refused send: who tried to reach whom by which verb, both ships as they were with their owners, the settings version that refused it and when. */
|
|
146
315
|
export declare const reachRefusalSchema: z.ZodObject<{
|
|
147
316
|
id: z.ZodType<`rfs_${string}`, unknown, z.core.$ZodTypeInternals<`rfs_${string}`, unknown>>;
|
|
148
317
|
at: z.ZodISODateTime;
|
|
@@ -155,7 +324,25 @@ export declare const reachRefusalSchema: z.ZodObject<{
|
|
|
155
324
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
156
325
|
value: z.ZodString;
|
|
157
326
|
}, z.core.$strip>>;
|
|
327
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
328
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
329
|
+
name: z.ZodString;
|
|
330
|
+
}, z.core.$strip>>;
|
|
158
331
|
}, z.core.$strip>;
|
|
332
|
+
askedBy: z.ZodNullable<z.ZodObject<{
|
|
333
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
334
|
+
name: z.ZodString;
|
|
335
|
+
labels: z.ZodArray<z.ZodObject<{
|
|
336
|
+
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
337
|
+
key: z.ZodString;
|
|
338
|
+
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
339
|
+
value: z.ZodString;
|
|
340
|
+
}, z.core.$strip>>;
|
|
341
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
342
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
343
|
+
name: z.ZodString;
|
|
344
|
+
}, z.core.$strip>>;
|
|
345
|
+
}, z.core.$strip>>;
|
|
159
346
|
recipient: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
160
347
|
kind: z.ZodLiteral<"ship">;
|
|
161
348
|
ship: z.ZodObject<{
|
|
@@ -167,6 +354,10 @@ export declare const reachRefusalSchema: z.ZodObject<{
|
|
|
167
354
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
168
355
|
value: z.ZodString;
|
|
169
356
|
}, z.core.$strip>>;
|
|
357
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
358
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
359
|
+
name: z.ZodString;
|
|
360
|
+
}, z.core.$strip>>;
|
|
170
361
|
}, z.core.$strip>;
|
|
171
362
|
}, z.core.$strip>, z.ZodObject<{
|
|
172
363
|
kind: z.ZodLiteral<"type">;
|
|
@@ -180,8 +371,17 @@ export declare const reachRefusalSchema: z.ZodObject<{
|
|
|
180
371
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
181
372
|
value: z.ZodString;
|
|
182
373
|
}, z.core.$strip>>;
|
|
374
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
375
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
376
|
+
name: z.ZodString;
|
|
377
|
+
}, z.core.$strip>>;
|
|
183
378
|
}, z.core.$strip>>;
|
|
184
379
|
}, z.core.$strip>], "kind">;
|
|
380
|
+
verb: z.ZodEnum<{
|
|
381
|
+
send: "send";
|
|
382
|
+
read: "read";
|
|
383
|
+
manage: "manage";
|
|
384
|
+
}>;
|
|
185
385
|
settingsVersion: z.ZodInt;
|
|
186
386
|
whilePluginUnavailable: z.ZodNullable<z.ZodEnum<{
|
|
187
387
|
"block-all": "block-all";
|
|
@@ -202,7 +402,25 @@ export declare const reachRefusalsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
202
402
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
203
403
|
value: z.ZodString;
|
|
204
404
|
}, z.core.$strip>>;
|
|
405
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
406
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
407
|
+
name: z.ZodString;
|
|
408
|
+
}, z.core.$strip>>;
|
|
205
409
|
}, z.core.$strip>;
|
|
410
|
+
askedBy: z.ZodNullable<z.ZodObject<{
|
|
411
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
412
|
+
name: z.ZodString;
|
|
413
|
+
labels: z.ZodArray<z.ZodObject<{
|
|
414
|
+
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
415
|
+
key: z.ZodString;
|
|
416
|
+
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
417
|
+
value: z.ZodString;
|
|
418
|
+
}, z.core.$strip>>;
|
|
419
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
420
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
421
|
+
name: z.ZodString;
|
|
422
|
+
}, z.core.$strip>>;
|
|
423
|
+
}, z.core.$strip>>;
|
|
206
424
|
recipient: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
207
425
|
kind: z.ZodLiteral<"ship">;
|
|
208
426
|
ship: z.ZodObject<{
|
|
@@ -214,6 +432,10 @@ export declare const reachRefusalsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
214
432
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
215
433
|
value: z.ZodString;
|
|
216
434
|
}, z.core.$strip>>;
|
|
435
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
436
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
437
|
+
name: z.ZodString;
|
|
438
|
+
}, z.core.$strip>>;
|
|
217
439
|
}, z.core.$strip>;
|
|
218
440
|
}, z.core.$strip>, z.ZodObject<{
|
|
219
441
|
kind: z.ZodLiteral<"type">;
|
|
@@ -227,8 +449,17 @@ export declare const reachRefusalsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
227
449
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
228
450
|
value: z.ZodString;
|
|
229
451
|
}, z.core.$strip>>;
|
|
452
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
453
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
454
|
+
name: z.ZodString;
|
|
455
|
+
}, z.core.$strip>>;
|
|
230
456
|
}, z.core.$strip>>;
|
|
231
457
|
}, z.core.$strip>], "kind">;
|
|
458
|
+
verb: z.ZodEnum<{
|
|
459
|
+
send: "send";
|
|
460
|
+
read: "read";
|
|
461
|
+
manage: "manage";
|
|
462
|
+
}>;
|
|
232
463
|
settingsVersion: z.ZodInt;
|
|
233
464
|
whilePluginUnavailable: z.ZodNullable<z.ZodEnum<{
|
|
234
465
|
"block-all": "block-all";
|
|
@@ -240,7 +471,83 @@ export declare const explainReachInputSchema: z.ZodObject<{
|
|
|
240
471
|
fromShipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
241
472
|
toShipId: z.ZodOptional<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
242
473
|
}, z.core.$strip>;
|
|
243
|
-
/**
|
|
474
|
+
/**
|
|
475
|
+
* The rule that lets one ship reach another (decision 0034): a built-in rule;
|
|
476
|
+
* a rule the networking plugin supplied, by its place in the fleet's list;
|
|
477
|
+
* or a rule a ship declared, by its declarer and its place in that ship's
|
|
478
|
+
* list (decision 0037).
|
|
479
|
+
*/
|
|
480
|
+
export declare const reachRuleSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
481
|
+
builtIn: z.ZodEnum<{
|
|
482
|
+
owner: "owner";
|
|
483
|
+
open: "open";
|
|
484
|
+
argo: "argo";
|
|
485
|
+
answer: "answer";
|
|
486
|
+
pluginRead: "pluginRead";
|
|
487
|
+
viewerRead: "viewerRead";
|
|
488
|
+
}>;
|
|
489
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
490
|
+
plugin: z.ZodInt;
|
|
491
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
492
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
493
|
+
index: z.ZodInt;
|
|
494
|
+
}, z.core.$strip>]>;
|
|
495
|
+
export type ReachRule = z.infer<typeof reachRuleSchema>;
|
|
496
|
+
/** Output of `fleet.explainReach`: per verb, the ships it reaches now, each with the rule that allows it. */
|
|
244
497
|
export declare const explainReachOutputSchema: z.ZodObject<{
|
|
245
|
-
|
|
498
|
+
send: z.ZodArray<z.ZodObject<{
|
|
499
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
500
|
+
rule: z.ZodUnion<readonly [z.ZodObject<{
|
|
501
|
+
builtIn: z.ZodEnum<{
|
|
502
|
+
owner: "owner";
|
|
503
|
+
open: "open";
|
|
504
|
+
argo: "argo";
|
|
505
|
+
answer: "answer";
|
|
506
|
+
pluginRead: "pluginRead";
|
|
507
|
+
viewerRead: "viewerRead";
|
|
508
|
+
}>;
|
|
509
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
510
|
+
plugin: z.ZodInt;
|
|
511
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
512
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
513
|
+
index: z.ZodInt;
|
|
514
|
+
}, z.core.$strip>]>;
|
|
515
|
+
}, z.core.$strip>>;
|
|
516
|
+
read: z.ZodArray<z.ZodObject<{
|
|
517
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
518
|
+
rule: z.ZodUnion<readonly [z.ZodObject<{
|
|
519
|
+
builtIn: z.ZodEnum<{
|
|
520
|
+
owner: "owner";
|
|
521
|
+
open: "open";
|
|
522
|
+
argo: "argo";
|
|
523
|
+
answer: "answer";
|
|
524
|
+
pluginRead: "pluginRead";
|
|
525
|
+
viewerRead: "viewerRead";
|
|
526
|
+
}>;
|
|
527
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
528
|
+
plugin: z.ZodInt;
|
|
529
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
530
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
531
|
+
index: z.ZodInt;
|
|
532
|
+
}, z.core.$strip>]>;
|
|
533
|
+
}, z.core.$strip>>;
|
|
534
|
+
manage: z.ZodArray<z.ZodObject<{
|
|
535
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
536
|
+
rule: z.ZodUnion<readonly [z.ZodObject<{
|
|
537
|
+
builtIn: z.ZodEnum<{
|
|
538
|
+
owner: "owner";
|
|
539
|
+
open: "open";
|
|
540
|
+
argo: "argo";
|
|
541
|
+
answer: "answer";
|
|
542
|
+
pluginRead: "pluginRead";
|
|
543
|
+
viewerRead: "viewerRead";
|
|
544
|
+
}>;
|
|
545
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
546
|
+
plugin: z.ZodInt;
|
|
547
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
548
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
549
|
+
index: z.ZodInt;
|
|
550
|
+
}, z.core.$strip>]>;
|
|
551
|
+
}, z.core.$strip>>;
|
|
246
552
|
}, z.core.$strip>;
|
|
553
|
+
export type ExplainedReach = z.infer<typeof explainReachOutputSchema>;
|
package/dist/schemas/network.js
CHANGED
|
@@ -2,9 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { idSchema } from '../ids/index.js';
|
|
3
3
|
import { carriedLabelSchema } from './label.js';
|
|
4
4
|
/**
|
|
5
|
-
* Network rules (decision 0034): which ships may send to
|
|
6
|
-
*
|
|
7
|
-
* another; a selector is a list of terms that must all hold (an empty one
|
|
5
|
+
* Network rules (decision 0034): which ships may send to, read or manage
|
|
6
|
+
* which. A rule names its verb and says that the ships matching one selector
|
|
7
|
+
* may do it to the ships matching another; a selector is a list of terms that must all hold (an empty one
|
|
8
8
|
* holds for every ship). Allow-only. The limits are the decision's; the server
|
|
9
9
|
* checks them, so every refusal names it.
|
|
10
10
|
*/
|
|
@@ -20,16 +20,58 @@ export const ANY_LABEL_VALUE = '*';
|
|
|
20
20
|
export const SAME_LABEL_VALUE = '#';
|
|
21
21
|
/**
|
|
22
22
|
* One term of a selector: an exact label value, written as its id, which
|
|
23
|
-
* names its label;
|
|
24
|
-
* the other side's (`#`), which binds the same label there only
|
|
23
|
+
* names its label; a label with any value (`*`) or with the same value as
|
|
24
|
+
* the other side's (`#`), which binds the same label there only; or the
|
|
25
|
+
* owner (decision 0045): an owner's ship by its id, any owner (`*`), or the
|
|
26
|
+
* same owner as the other side's (`#`), which binds the owner there.
|
|
25
27
|
*/
|
|
26
|
-
export const selectorTermSchema = z.union([
|
|
28
|
+
export const selectorTermSchema = z.union([
|
|
29
|
+
idSchema('labelValue'),
|
|
30
|
+
z.object({ labelId: idSchema('label'), value: z.enum([ANY_LABEL_VALUE, SAME_LABEL_VALUE]) }),
|
|
31
|
+
z.object({ owner: z.union([idSchema('ship'), z.enum([ANY_LABEL_VALUE, SAME_LABEL_VALUE])]) }),
|
|
32
|
+
]);
|
|
33
|
+
export function isOwnerTerm(term) {
|
|
34
|
+
return typeof term !== 'string' && 'owner' in term;
|
|
35
|
+
}
|
|
27
36
|
/** The ships for which every one of these terms holds, combined with AND. */
|
|
28
37
|
export const labelSelectorSchema = z.array(selectorTermSchema);
|
|
29
|
-
/**
|
|
30
|
-
export const
|
|
31
|
-
/**
|
|
32
|
-
export const
|
|
38
|
+
/** What a rule lets one ship do to another: send to it, read it or manage it (decision 0034). */
|
|
39
|
+
export const NETWORK_VERBS = ['send', 'read', 'manage'];
|
|
40
|
+
/** One rule: the ships matching `from` may do its verb to the ships matching `to`. */
|
|
41
|
+
export const networkRuleSchema = z.object({ verb: z.enum(NETWORK_VERBS), from: labelSelectorSchema, to: labelSelectorSchema });
|
|
42
|
+
/** Input of `fleet.setNetworkRules` (fleet:network): every rule the fleet holds from now on beside the built-in ones. */
|
|
43
|
+
export const setNetworkRulesInputSchema = z.object({ rules: z.array(networkRuleSchema) });
|
|
44
|
+
/**
|
|
45
|
+
* The built-in rules, core's own (decision 0034): argo to and from every ship,
|
|
46
|
+
* the owner's ship to the ships it owns, an answer to the sender of the
|
|
47
|
+
* message it answers, and a connected plugin's ship reading every ship, which
|
|
48
|
+
* are never off; the viewer reading every ship,
|
|
49
|
+
* which argo turns off or on; and open, every ship to every ship, one per
|
|
50
|
+
* verb, which the networking plugin turns off or on.
|
|
51
|
+
*/
|
|
52
|
+
export const BUILT_IN_RULES = ['argo', 'owner', 'answer', 'pluginRead', 'viewerRead', 'open'];
|
|
53
|
+
/** The built-in rules that are never off. */
|
|
54
|
+
export const FIXED_BUILT_IN_RULES = ['argo', 'owner', 'answer', 'pluginRead'];
|
|
55
|
+
/** Input of `fleet.setBuiltInRule` (fleet:network): a built-in rule turned on or off, open for one verb, which it names and no other rule does. */
|
|
56
|
+
export const setBuiltInRuleInputSchema = z
|
|
57
|
+
.object({ rule: z.enum(BUILT_IN_RULES), verb: z.enum(NETWORK_VERBS).optional(), isOn: z.boolean() })
|
|
58
|
+
.refine((input) => (input.rule === 'open') === (input.verb !== undefined), { message: 'open names its verb, and no other built-in rule names one', path: ['verb'] });
|
|
59
|
+
/**
|
|
60
|
+
* One built-in rule as it is now: open for one verb, which it names and no
|
|
61
|
+
* other rule does, and whether it is on; the fixed ones always are.
|
|
62
|
+
*/
|
|
63
|
+
export const builtInRuleStateSchema = z.union([
|
|
64
|
+
z.object({ rule: z.enum(['argo', 'owner', 'answer', 'pluginRead', 'viewerRead']), isOn: z.boolean() }),
|
|
65
|
+
z.object({ rule: z.literal('open'), verb: z.enum(NETWORK_VERBS), isOn: z.boolean() }),
|
|
66
|
+
]);
|
|
67
|
+
/** Output of `fleet.builtInRules` (fleet:network): every built-in rule as it is now, in the order the rule list shows them, first (decision 0034). */
|
|
68
|
+
export const builtInRulesOutputSchema = z.array(builtInRuleStateSchema);
|
|
69
|
+
/**
|
|
70
|
+
* Output of `fleet.networkPlugin` (fleet:read): the fleet's networking plugin,
|
|
71
|
+
* its ship and when it registered, or null without one (decision 0035). The
|
|
72
|
+
* gateway reads it before it switches on for a fleet (interop I-3).
|
|
73
|
+
*/
|
|
74
|
+
export const networkPluginOutputSchema = z.object({ shipId: idSchema('ship'), registeredAt: z.iso.datetime() }).nullable();
|
|
33
75
|
/** Output of `fleet.setNetworkRules`: the version the fleet's network settings have now. */
|
|
34
76
|
export const setNetworkRulesOutputSchema = z.object({ version: z.int().min(1) });
|
|
35
77
|
/** Input of `fleet.declareNetworkRules` (labels:define): every rule the ship declares from now on, on labels it owns; an empty list withdraws them (decision 0037). */
|
|
@@ -53,18 +95,33 @@ export const registerNetworkPluginInputSchema = z.object({
|
|
|
53
95
|
whileUnavailable: z.enum(WHILE_UNAVAILABLE),
|
|
54
96
|
notRespondingAfterSeconds: z.int().min(NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MIN_SECONDS).max(NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MAX_SECONDS),
|
|
55
97
|
});
|
|
56
|
-
/** A ship as a reach refusal saw it: its id, its name
|
|
57
|
-
const refusedShipSchema = z.object({
|
|
58
|
-
|
|
98
|
+
/** A ship as a reach refusal saw it: its id, its name, the label values it carried then and its owner's ship then, none for argo and the viewer (decision 0045). */
|
|
99
|
+
const refusedShipSchema = z.object({
|
|
100
|
+
id: idSchema('ship'),
|
|
101
|
+
name: z.string(),
|
|
102
|
+
labels: z.array(carriedLabelSchema),
|
|
103
|
+
owner: z.object({ id: idSchema('ship'), name: z.string() }).nullable(),
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* The request header a plugin ship names the ship it reads on behalf of with,
|
|
107
|
+
* by id: every fleet:read read then answers with that ship's read reach
|
|
108
|
+
* (decision 0034). Any other call refuses it.
|
|
109
|
+
*/
|
|
110
|
+
export const ON_BEHALF_OF_HEADER = 'aeolus-on-behalf-of';
|
|
111
|
+
/** One refused send: who tried to reach whom by which verb, both ships as they were with their owners, the settings version that refused it and when. */
|
|
59
112
|
export const reachRefusalSchema = z.object({
|
|
60
113
|
id: idSchema('reachRefusal'),
|
|
61
114
|
at: z.iso.datetime(),
|
|
62
115
|
sender: refusedShipSchema,
|
|
116
|
+
/** The plugin ship that read on behalf of the sender (decision 0034), as it was then; null for the sender's own call. */
|
|
117
|
+
askedBy: refusedShipSchema.nullable(),
|
|
63
118
|
recipient: z.discriminatedUnion('kind', [
|
|
64
119
|
z.object({ kind: z.literal('ship'), ship: refusedShipSchema }),
|
|
65
120
|
/** A send to a type: the type and each ship of it, none of which the sender may reach. */
|
|
66
121
|
z.object({ kind: z.literal('type'), type: z.string(), ships: z.array(refusedShipSchema) }),
|
|
67
122
|
]),
|
|
123
|
+
/** What the sender tried to do: send, the one verb checked so far. */
|
|
124
|
+
verb: z.enum(NETWORK_VERBS),
|
|
68
125
|
settingsVersion: z.int().min(1),
|
|
69
126
|
/** What the plugin declared for while it is unavailable, when it refused because the plugin was not responding (decision 0035); null otherwise. */
|
|
70
127
|
whilePluginUnavailable: z.enum(['block-all', 'keep-latest']).nullable(),
|
|
@@ -73,6 +130,18 @@ export const reachRefusalSchema = z.object({
|
|
|
73
130
|
export const reachRefusalsOutputSchema = z.array(reachRefusalSchema);
|
|
74
131
|
/** Input of `fleet.explainReach` (argo only): the ship to explain from, and the one ship asked about, or none for every ship. */
|
|
75
132
|
export const explainReachInputSchema = z.object({ fromShipId: idSchema('ship'), toShipId: idSchema('ship').optional() });
|
|
76
|
-
/**
|
|
77
|
-
|
|
133
|
+
/**
|
|
134
|
+
* The rule that lets one ship reach another (decision 0034): a built-in rule;
|
|
135
|
+
* a rule the networking plugin supplied, by its place in the fleet's list;
|
|
136
|
+
* or a rule a ship declared, by its declarer and its place in that ship's
|
|
137
|
+
* list (decision 0037).
|
|
138
|
+
*/
|
|
139
|
+
export const reachRuleSchema = z.union([
|
|
140
|
+
z.object({ builtIn: z.enum(BUILT_IN_RULES) }),
|
|
141
|
+
z.object({ plugin: z.int().min(0) }),
|
|
142
|
+
z.object({ declared: idSchema('ship'), index: z.int().min(0) }),
|
|
143
|
+
]);
|
|
144
|
+
const reachedShipsSchema = z.array(z.object({ shipId: idSchema('ship'), rule: reachRuleSchema }));
|
|
145
|
+
/** Output of `fleet.explainReach`: per verb, the ships it reaches now, each with the rule that allows it. */
|
|
146
|
+
export const explainReachOutputSchema = z.object({ send: reachedShipsSchema, read: reachedShipsSchema, manage: reachedShipsSchema });
|
|
78
147
|
//# sourceMappingURL=network.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/schemas/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;GAMG;AAEH,wGAAwG;AACxG,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,CAAC;AAE5C,wGAAwG;AACxG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAY,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/schemas/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;GAMG;AAEH,wGAAwG;AACxG,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAA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