@aeolus-fleet/common 0.26.0 → 0.27.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/fleet/index.d.ts +67 -9
- package/dist/fleet/index.js +87 -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 +10 -1
- package/dist/schemas/delivery.js +8 -2
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/fleet.d.ts +61 -37
- package/dist/schemas/fleet.js +25 -9
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +6 -0
- package/dist/schemas/history.d.ts +137 -11
- package/dist/schemas/history.js +5 -1
- 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 +302 -12
- package/dist/schemas/network.js +77 -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 +126 -0
- package/dist/schemas/statement.js +88 -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,82 @@ 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>>;
|
|
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, and an answer to the sender of the
|
|
132
|
+
* message it answers, which are never off; the viewer reading every ship,
|
|
133
|
+
* which argo turns off or on; and open, every ship to every ship, one per
|
|
134
|
+
* verb, which the networking plugin turns off or on.
|
|
135
|
+
*/
|
|
136
|
+
export declare const BUILT_IN_RULES: readonly ["argo", "owner", "answer", "viewerRead", "open"];
|
|
137
|
+
export type BuiltInRule = (typeof BUILT_IN_RULES)[number];
|
|
138
|
+
/** The built-in rules that are never off. */
|
|
139
|
+
export declare const FIXED_BUILT_IN_RULES: readonly ["argo", "owner", "answer"];
|
|
140
|
+
/** 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. */
|
|
141
|
+
export declare const setBuiltInRuleInputSchema: z.ZodObject<{
|
|
142
|
+
rule: z.ZodEnum<{
|
|
143
|
+
owner: "owner";
|
|
144
|
+
open: "open";
|
|
145
|
+
argo: "argo";
|
|
146
|
+
answer: "answer";
|
|
147
|
+
viewerRead: "viewerRead";
|
|
148
|
+
}>;
|
|
149
|
+
verb: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
send: "send";
|
|
151
|
+
read: "read";
|
|
152
|
+
manage: "manage";
|
|
153
|
+
}>>;
|
|
154
|
+
isOn: z.ZodBoolean;
|
|
76
155
|
}, z.core.$strip>;
|
|
156
|
+
export type SetBuiltInRuleInput = z.infer<typeof setBuiltInRuleInputSchema>;
|
|
157
|
+
/**
|
|
158
|
+
* One built-in rule as it is now: open for one verb, which it names and no
|
|
159
|
+
* other rule does, and whether it is on; the fixed ones always are.
|
|
160
|
+
*/
|
|
161
|
+
export declare const builtInRuleStateSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
162
|
+
rule: z.ZodEnum<{
|
|
163
|
+
owner: "owner";
|
|
164
|
+
argo: "argo";
|
|
165
|
+
answer: "answer";
|
|
166
|
+
viewerRead: "viewerRead";
|
|
167
|
+
}>;
|
|
168
|
+
isOn: z.ZodBoolean;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
rule: z.ZodLiteral<"open">;
|
|
171
|
+
verb: z.ZodEnum<{
|
|
172
|
+
send: "send";
|
|
173
|
+
read: "read";
|
|
174
|
+
manage: "manage";
|
|
175
|
+
}>;
|
|
176
|
+
isOn: z.ZodBoolean;
|
|
177
|
+
}, z.core.$strip>]>;
|
|
178
|
+
export type BuiltInRuleState = z.infer<typeof builtInRuleStateSchema>;
|
|
179
|
+
/** 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). */
|
|
180
|
+
export declare const builtInRulesOutputSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
181
|
+
rule: z.ZodEnum<{
|
|
182
|
+
owner: "owner";
|
|
183
|
+
argo: "argo";
|
|
184
|
+
answer: "answer";
|
|
185
|
+
viewerRead: "viewerRead";
|
|
186
|
+
}>;
|
|
187
|
+
isOn: z.ZodBoolean;
|
|
188
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
189
|
+
rule: z.ZodLiteral<"open">;
|
|
190
|
+
verb: z.ZodEnum<{
|
|
191
|
+
send: "send";
|
|
192
|
+
read: "read";
|
|
193
|
+
manage: "manage";
|
|
194
|
+
}>;
|
|
195
|
+
isOn: z.ZodBoolean;
|
|
196
|
+
}, z.core.$strip>]>>;
|
|
77
197
|
/** Output of `fleet.setNetworkRules`: the version the fleet's network settings have now. */
|
|
78
198
|
export declare const setNetworkRulesOutputSchema: z.ZodObject<{
|
|
79
199
|
version: z.ZodInt;
|
|
@@ -81,12 +201,22 @@ export declare const setNetworkRulesOutputSchema: z.ZodObject<{
|
|
|
81
201
|
/** 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
202
|
export declare const declareNetworkRulesInputSchema: z.ZodObject<{
|
|
83
203
|
rules: z.ZodArray<z.ZodObject<{
|
|
204
|
+
verb: z.ZodEnum<{
|
|
205
|
+
send: "send";
|
|
206
|
+
read: "read";
|
|
207
|
+
manage: "manage";
|
|
208
|
+
}>;
|
|
84
209
|
from: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
85
210
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
86
211
|
value: z.ZodEnum<{
|
|
87
212
|
"*": "*";
|
|
88
213
|
"#": "#";
|
|
89
214
|
}>;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
217
|
+
"*": "*";
|
|
218
|
+
"#": "#";
|
|
219
|
+
}>]>;
|
|
90
220
|
}, z.core.$strip>]>>;
|
|
91
221
|
to: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
92
222
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -94,6 +224,11 @@ export declare const declareNetworkRulesInputSchema: z.ZodObject<{
|
|
|
94
224
|
"*": "*";
|
|
95
225
|
"#": "#";
|
|
96
226
|
}>;
|
|
227
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
229
|
+
"*": "*";
|
|
230
|
+
"#": "#";
|
|
231
|
+
}>]>;
|
|
97
232
|
}, z.core.$strip>]>>;
|
|
98
233
|
}, z.core.$strip>>;
|
|
99
234
|
}, z.core.$strip>;
|
|
@@ -105,12 +240,22 @@ export declare const declareNetworkRulesOutputSchema: z.ZodObject<{
|
|
|
105
240
|
export declare const declaredNetworkRulesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
106
241
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
107
242
|
rules: z.ZodArray<z.ZodObject<{
|
|
243
|
+
verb: z.ZodEnum<{
|
|
244
|
+
send: "send";
|
|
245
|
+
read: "read";
|
|
246
|
+
manage: "manage";
|
|
247
|
+
}>;
|
|
108
248
|
from: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
109
249
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
110
250
|
value: z.ZodEnum<{
|
|
111
251
|
"*": "*";
|
|
112
252
|
"#": "#";
|
|
113
253
|
}>;
|
|
254
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
255
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
256
|
+
"*": "*";
|
|
257
|
+
"#": "#";
|
|
258
|
+
}>]>;
|
|
114
259
|
}, z.core.$strip>]>>;
|
|
115
260
|
to: z.ZodArray<z.ZodUnion<readonly [z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>, z.ZodObject<{
|
|
116
261
|
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
@@ -118,6 +263,11 @@ export declare const declaredNetworkRulesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
118
263
|
"*": "*";
|
|
119
264
|
"#": "#";
|
|
120
265
|
}>;
|
|
266
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
267
|
+
owner: z.ZodUnion<readonly [z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>, z.ZodEnum<{
|
|
268
|
+
"*": "*";
|
|
269
|
+
"#": "#";
|
|
270
|
+
}>]>;
|
|
121
271
|
}, z.core.$strip>]>>;
|
|
122
272
|
}, z.core.$strip>>;
|
|
123
273
|
}, z.core.$strip>>;
|
|
@@ -142,7 +292,13 @@ export declare const registerNetworkPluginInputSchema: z.ZodObject<{
|
|
|
142
292
|
notRespondingAfterSeconds: z.ZodInt;
|
|
143
293
|
}, z.core.$strip>;
|
|
144
294
|
export type NetworkPluginDeclaration = z.infer<typeof registerNetworkPluginInputSchema>;
|
|
145
|
-
/**
|
|
295
|
+
/**
|
|
296
|
+
* The request header a plugin ship names the ship it reads on behalf of with,
|
|
297
|
+
* by id: every fleet:read read then answers with that ship's read reach
|
|
298
|
+
* (decision 0034). Any other call refuses it.
|
|
299
|
+
*/
|
|
300
|
+
export declare const ON_BEHALF_OF_HEADER = "aeolus-on-behalf-of";
|
|
301
|
+
/** 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
302
|
export declare const reachRefusalSchema: z.ZodObject<{
|
|
147
303
|
id: z.ZodType<`rfs_${string}`, unknown, z.core.$ZodTypeInternals<`rfs_${string}`, unknown>>;
|
|
148
304
|
at: z.ZodISODateTime;
|
|
@@ -155,7 +311,25 @@ export declare const reachRefusalSchema: z.ZodObject<{
|
|
|
155
311
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
156
312
|
value: z.ZodString;
|
|
157
313
|
}, z.core.$strip>>;
|
|
314
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
315
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
316
|
+
name: z.ZodString;
|
|
317
|
+
}, z.core.$strip>>;
|
|
158
318
|
}, z.core.$strip>;
|
|
319
|
+
askedBy: z.ZodNullable<z.ZodObject<{
|
|
320
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
321
|
+
name: z.ZodString;
|
|
322
|
+
labels: z.ZodArray<z.ZodObject<{
|
|
323
|
+
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
324
|
+
key: z.ZodString;
|
|
325
|
+
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
326
|
+
value: z.ZodString;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
329
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
330
|
+
name: z.ZodString;
|
|
331
|
+
}, z.core.$strip>>;
|
|
332
|
+
}, z.core.$strip>>;
|
|
159
333
|
recipient: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
160
334
|
kind: z.ZodLiteral<"ship">;
|
|
161
335
|
ship: z.ZodObject<{
|
|
@@ -167,6 +341,10 @@ export declare const reachRefusalSchema: z.ZodObject<{
|
|
|
167
341
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
168
342
|
value: z.ZodString;
|
|
169
343
|
}, z.core.$strip>>;
|
|
344
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
345
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
346
|
+
name: z.ZodString;
|
|
347
|
+
}, z.core.$strip>>;
|
|
170
348
|
}, z.core.$strip>;
|
|
171
349
|
}, z.core.$strip>, z.ZodObject<{
|
|
172
350
|
kind: z.ZodLiteral<"type">;
|
|
@@ -180,8 +358,17 @@ export declare const reachRefusalSchema: z.ZodObject<{
|
|
|
180
358
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
181
359
|
value: z.ZodString;
|
|
182
360
|
}, z.core.$strip>>;
|
|
361
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
362
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
363
|
+
name: z.ZodString;
|
|
364
|
+
}, z.core.$strip>>;
|
|
183
365
|
}, z.core.$strip>>;
|
|
184
366
|
}, z.core.$strip>], "kind">;
|
|
367
|
+
verb: z.ZodEnum<{
|
|
368
|
+
send: "send";
|
|
369
|
+
read: "read";
|
|
370
|
+
manage: "manage";
|
|
371
|
+
}>;
|
|
185
372
|
settingsVersion: z.ZodInt;
|
|
186
373
|
whilePluginUnavailable: z.ZodNullable<z.ZodEnum<{
|
|
187
374
|
"block-all": "block-all";
|
|
@@ -202,7 +389,25 @@ export declare const reachRefusalsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
202
389
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
203
390
|
value: z.ZodString;
|
|
204
391
|
}, z.core.$strip>>;
|
|
392
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
393
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
394
|
+
name: z.ZodString;
|
|
395
|
+
}, z.core.$strip>>;
|
|
205
396
|
}, z.core.$strip>;
|
|
397
|
+
askedBy: z.ZodNullable<z.ZodObject<{
|
|
398
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
399
|
+
name: z.ZodString;
|
|
400
|
+
labels: z.ZodArray<z.ZodObject<{
|
|
401
|
+
labelId: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
402
|
+
key: z.ZodString;
|
|
403
|
+
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
404
|
+
value: z.ZodString;
|
|
405
|
+
}, z.core.$strip>>;
|
|
406
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
407
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
408
|
+
name: z.ZodString;
|
|
409
|
+
}, z.core.$strip>>;
|
|
410
|
+
}, z.core.$strip>>;
|
|
206
411
|
recipient: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
207
412
|
kind: z.ZodLiteral<"ship">;
|
|
208
413
|
ship: z.ZodObject<{
|
|
@@ -214,6 +419,10 @@ export declare const reachRefusalsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
214
419
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
215
420
|
value: z.ZodString;
|
|
216
421
|
}, z.core.$strip>>;
|
|
422
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
423
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
424
|
+
name: z.ZodString;
|
|
425
|
+
}, z.core.$strip>>;
|
|
217
426
|
}, z.core.$strip>;
|
|
218
427
|
}, z.core.$strip>, z.ZodObject<{
|
|
219
428
|
kind: z.ZodLiteral<"type">;
|
|
@@ -227,8 +436,17 @@ export declare const reachRefusalsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
227
436
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
228
437
|
value: z.ZodString;
|
|
229
438
|
}, z.core.$strip>>;
|
|
439
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
440
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
441
|
+
name: z.ZodString;
|
|
442
|
+
}, z.core.$strip>>;
|
|
230
443
|
}, z.core.$strip>>;
|
|
231
444
|
}, z.core.$strip>], "kind">;
|
|
445
|
+
verb: z.ZodEnum<{
|
|
446
|
+
send: "send";
|
|
447
|
+
read: "read";
|
|
448
|
+
manage: "manage";
|
|
449
|
+
}>;
|
|
232
450
|
settingsVersion: z.ZodInt;
|
|
233
451
|
whilePluginUnavailable: z.ZodNullable<z.ZodEnum<{
|
|
234
452
|
"block-all": "block-all";
|
|
@@ -240,7 +458,79 @@ export declare const explainReachInputSchema: z.ZodObject<{
|
|
|
240
458
|
fromShipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
241
459
|
toShipId: z.ZodOptional<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
242
460
|
}, z.core.$strip>;
|
|
243
|
-
/**
|
|
461
|
+
/**
|
|
462
|
+
* The rule that lets one ship reach another (decision 0034): a built-in rule;
|
|
463
|
+
* a rule the networking plugin supplied, by its place in the fleet's list;
|
|
464
|
+
* or a rule a ship declared, by its declarer and its place in that ship's
|
|
465
|
+
* list (decision 0037).
|
|
466
|
+
*/
|
|
467
|
+
export declare const reachRuleSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
468
|
+
builtIn: z.ZodEnum<{
|
|
469
|
+
owner: "owner";
|
|
470
|
+
open: "open";
|
|
471
|
+
argo: "argo";
|
|
472
|
+
answer: "answer";
|
|
473
|
+
viewerRead: "viewerRead";
|
|
474
|
+
}>;
|
|
475
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
476
|
+
plugin: z.ZodInt;
|
|
477
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
478
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
479
|
+
index: z.ZodInt;
|
|
480
|
+
}, z.core.$strip>]>;
|
|
481
|
+
export type ReachRule = z.infer<typeof reachRuleSchema>;
|
|
482
|
+
/** Output of `fleet.explainReach`: per verb, the ships it reaches now, each with the rule that allows it. */
|
|
244
483
|
export declare const explainReachOutputSchema: z.ZodObject<{
|
|
245
|
-
|
|
484
|
+
send: z.ZodArray<z.ZodObject<{
|
|
485
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
486
|
+
rule: z.ZodUnion<readonly [z.ZodObject<{
|
|
487
|
+
builtIn: z.ZodEnum<{
|
|
488
|
+
owner: "owner";
|
|
489
|
+
open: "open";
|
|
490
|
+
argo: "argo";
|
|
491
|
+
answer: "answer";
|
|
492
|
+
viewerRead: "viewerRead";
|
|
493
|
+
}>;
|
|
494
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
495
|
+
plugin: z.ZodInt;
|
|
496
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
497
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
498
|
+
index: z.ZodInt;
|
|
499
|
+
}, z.core.$strip>]>;
|
|
500
|
+
}, z.core.$strip>>;
|
|
501
|
+
read: z.ZodArray<z.ZodObject<{
|
|
502
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
503
|
+
rule: z.ZodUnion<readonly [z.ZodObject<{
|
|
504
|
+
builtIn: z.ZodEnum<{
|
|
505
|
+
owner: "owner";
|
|
506
|
+
open: "open";
|
|
507
|
+
argo: "argo";
|
|
508
|
+
answer: "answer";
|
|
509
|
+
viewerRead: "viewerRead";
|
|
510
|
+
}>;
|
|
511
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
512
|
+
plugin: z.ZodInt;
|
|
513
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
514
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
515
|
+
index: z.ZodInt;
|
|
516
|
+
}, z.core.$strip>]>;
|
|
517
|
+
}, z.core.$strip>>;
|
|
518
|
+
manage: z.ZodArray<z.ZodObject<{
|
|
519
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
520
|
+
rule: z.ZodUnion<readonly [z.ZodObject<{
|
|
521
|
+
builtIn: z.ZodEnum<{
|
|
522
|
+
owner: "owner";
|
|
523
|
+
open: "open";
|
|
524
|
+
argo: "argo";
|
|
525
|
+
answer: "answer";
|
|
526
|
+
viewerRead: "viewerRead";
|
|
527
|
+
}>;
|
|
528
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
529
|
+
plugin: z.ZodInt;
|
|
530
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
531
|
+
declared: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
532
|
+
index: z.ZodInt;
|
|
533
|
+
}, z.core.$strip>]>;
|
|
534
|
+
}, z.core.$strip>>;
|
|
246
535
|
}, z.core.$strip>;
|
|
536
|
+
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,51 @@ 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, and an answer to the sender of the
|
|
47
|
+
* message it answers, which are never off; the viewer reading every ship,
|
|
48
|
+
* which argo turns off or on; and open, every ship to every ship, one per
|
|
49
|
+
* verb, which the networking plugin turns off or on.
|
|
50
|
+
*/
|
|
51
|
+
export const BUILT_IN_RULES = ['argo', 'owner', 'answer', 'viewerRead', 'open'];
|
|
52
|
+
/** The built-in rules that are never off. */
|
|
53
|
+
export const FIXED_BUILT_IN_RULES = ['argo', 'owner', 'answer'];
|
|
54
|
+
/** 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. */
|
|
55
|
+
export const setBuiltInRuleInputSchema = z
|
|
56
|
+
.object({ rule: z.enum(BUILT_IN_RULES), verb: z.enum(NETWORK_VERBS).optional(), isOn: z.boolean() })
|
|
57
|
+
.refine((input) => (input.rule === 'open') === (input.verb !== undefined), { message: 'open names its verb, and no other built-in rule names one', path: ['verb'] });
|
|
58
|
+
/**
|
|
59
|
+
* One built-in rule as it is now: open for one verb, which it names and no
|
|
60
|
+
* other rule does, and whether it is on; the fixed ones always are.
|
|
61
|
+
*/
|
|
62
|
+
export const builtInRuleStateSchema = z.union([
|
|
63
|
+
z.object({ rule: z.enum(['argo', 'owner', 'answer', 'viewerRead']), isOn: z.boolean() }),
|
|
64
|
+
z.object({ rule: z.literal('open'), verb: z.enum(NETWORK_VERBS), isOn: z.boolean() }),
|
|
65
|
+
]);
|
|
66
|
+
/** 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). */
|
|
67
|
+
export const builtInRulesOutputSchema = z.array(builtInRuleStateSchema);
|
|
33
68
|
/** Output of `fleet.setNetworkRules`: the version the fleet's network settings have now. */
|
|
34
69
|
export const setNetworkRulesOutputSchema = z.object({ version: z.int().min(1) });
|
|
35
70
|
/** 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 +88,33 @@ export const registerNetworkPluginInputSchema = z.object({
|
|
|
53
88
|
whileUnavailable: z.enum(WHILE_UNAVAILABLE),
|
|
54
89
|
notRespondingAfterSeconds: z.int().min(NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MIN_SECONDS).max(NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MAX_SECONDS),
|
|
55
90
|
});
|
|
56
|
-
/** A ship as a reach refusal saw it: its id, its name
|
|
57
|
-
const refusedShipSchema = z.object({
|
|
58
|
-
|
|
91
|
+
/** 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). */
|
|
92
|
+
const refusedShipSchema = z.object({
|
|
93
|
+
id: idSchema('ship'),
|
|
94
|
+
name: z.string(),
|
|
95
|
+
labels: z.array(carriedLabelSchema),
|
|
96
|
+
owner: z.object({ id: idSchema('ship'), name: z.string() }).nullable(),
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* The request header a plugin ship names the ship it reads on behalf of with,
|
|
100
|
+
* by id: every fleet:read read then answers with that ship's read reach
|
|
101
|
+
* (decision 0034). Any other call refuses it.
|
|
102
|
+
*/
|
|
103
|
+
export const ON_BEHALF_OF_HEADER = 'aeolus-on-behalf-of';
|
|
104
|
+
/** 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
105
|
export const reachRefusalSchema = z.object({
|
|
60
106
|
id: idSchema('reachRefusal'),
|
|
61
107
|
at: z.iso.datetime(),
|
|
62
108
|
sender: refusedShipSchema,
|
|
109
|
+
/** The plugin ship that read on behalf of the sender (decision 0034), as it was then; null for the sender's own call. */
|
|
110
|
+
askedBy: refusedShipSchema.nullable(),
|
|
63
111
|
recipient: z.discriminatedUnion('kind', [
|
|
64
112
|
z.object({ kind: z.literal('ship'), ship: refusedShipSchema }),
|
|
65
113
|
/** A send to a type: the type and each ship of it, none of which the sender may reach. */
|
|
66
114
|
z.object({ kind: z.literal('type'), type: z.string(), ships: z.array(refusedShipSchema) }),
|
|
67
115
|
]),
|
|
116
|
+
/** What the sender tried to do: send, the one verb checked so far. */
|
|
117
|
+
verb: z.enum(NETWORK_VERBS),
|
|
68
118
|
settingsVersion: z.int().min(1),
|
|
69
119
|
/** What the plugin declared for while it is unavailable, when it refused because the plugin was not responding (decision 0035); null otherwise. */
|
|
70
120
|
whilePluginUnavailable: z.enum(['block-all', 'keep-latest']).nullable(),
|
|
@@ -73,6 +123,18 @@ export const reachRefusalSchema = z.object({
|
|
|
73
123
|
export const reachRefusalsOutputSchema = z.array(reachRefusalSchema);
|
|
74
124
|
/** Input of `fleet.explainReach` (argo only): the ship to explain from, and the one ship asked about, or none for every ship. */
|
|
75
125
|
export const explainReachInputSchema = z.object({ fromShipId: idSchema('ship'), toShipId: idSchema('ship').optional() });
|
|
76
|
-
/**
|
|
77
|
-
|
|
126
|
+
/**
|
|
127
|
+
* The rule that lets one ship reach another (decision 0034): a built-in rule;
|
|
128
|
+
* a rule the networking plugin supplied, by its place in the fleet's list;
|
|
129
|
+
* or a rule a ship declared, by its declarer and its place in that ship's
|
|
130
|
+
* list (decision 0037).
|
|
131
|
+
*/
|
|
132
|
+
export const reachRuleSchema = z.union([
|
|
133
|
+
z.object({ builtIn: z.enum(BUILT_IN_RULES) }),
|
|
134
|
+
z.object({ plugin: z.int().min(0) }),
|
|
135
|
+
z.object({ declared: idSchema('ship'), index: z.int().min(0) }),
|
|
136
|
+
]);
|
|
137
|
+
const reachedShipsSchema = z.array(z.object({ shipId: idSchema('ship'), rule: reachRuleSchema }));
|
|
138
|
+
/** Output of `fleet.explainReach`: per verb, the ships it reaches now, each with the rule that allows it. */
|
|
139
|
+
export const explainReachOutputSchema = z.object({ send: reachedShipsSchema, read: reachedShipsSchema, manage: reachedShipsSchema });
|
|
78
140
|
//# 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,wGA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